所有问题

0 投票
1 回答
212 浏览

javascript - 让 Redux 返回一个数组而不是嵌套对象

所以我试图用redux返回一个数组,直到现在还没有多大成功。

我尝试记录操作有效负载,直到那时,它似乎还可以,但是当我实际更新状态时,它返回一个嵌套对象而不是有效负载中的数组。

同时,我修改了 proptype 以获取数组,但我收到提供对象而不是数组的错误消息,这是另一个问题。

这是我的减速器:

日志说:

所以看起来不错,但事实并非如此。我做的下一件事是将道具类型更改为:

这是我获取组的操作:

我在道具中得到的结果如下:

这就是我在获得结果后注销 this.props 的方式:

axios 发布结果中的日志显示 res.data 的类型是对象,即使服务器肯定返回了一个数组。除此之外,我可能也做错了很多事情,但这是我这次无法弄清楚的。

谢谢您的帮助!

0 投票
1 回答
281 浏览

ruby-on-rails - redis中rails缓存条目中的时间戳格式是什么?

当我查看 redis 中的 rails 缓存键时,它看起来像这样:

如何解释“created_at”时间戳?

0 投票
1 回答
74 浏览

sql - 递归 CTE 性能不佳

我有一个 [LOCATION] 表,它是一个自引用表。

一个位置可以有一个 [PARENT_ID](id 或 NULL)。
一个位置可以是 [ENABLED](0 或 1)。

我的视图的目的是列出每个位置,并添加一个新列[ENABLE_IN_HIERARCHY]
此新列必须说明:
-如果位置已启用其所有父级均已启用,则为1 -如果位置未启用其父级之一未启用,则为0


我的 T-SQL 视图做得对,但我遇到了性能问题:

有没有更好的方法来构建这个查询?

0 投票
1 回答
213 浏览

php - 生成大文件时如何解决 PHP 中的“分段失败”?

我在不同的论坛中阅读了很多关于此错误的信息,但仍然找不到解决方案

我的生产服务器目前有:

阿帕奇:2.4.25 PHP:5.6.40

使用1.8.2版本的PHPSpreadsheet库,生成不同的Excel文件;由于不同的原因(大量信息和样式应用于单元格表),在相当长的执行时间(可以达到 30/40 分钟)中导出最大 3MB 的 xlsx 文件。

所有这一切都奏效了,直到我们移动并 dockerized 到我们的新服务器,它的操作系统是 CentOS7,并且有一个用于 apache、php 和另一个用于 mysql 的 docker。

现在,当生成这些“大”文件时,error.log 跟踪显示以下错误:[core: notice][pid 8] AH00052: child pid 15829 exit signal Segmentation fault (11)

我试图在我的本地机器上使用虚拟机复制错误,在另一台机器上,我将 OS centos7 和 dockerized 放在它们上,我什至从生产服务器复制了相同的配置文件,但是,在这些机器上,错误没有出现并且允许我正确下载。

目前我很绝望,在生产线上尝试任何解决方案之前,我已经反向尝试了每个互联网解决方案来复制错误,但这个错误绝不会被复制。

我感谢任何信息和正义事业的帮助......我知道此时 php 5.6 已被发送到收集,但如果最终它无法解决此事件,我无法将工作时间提交给更新。

0 投票
2 回答
1566 浏览

sql - 在雪花中将 YYYYMMDD 转换为 MM/DD/YYYY

我需要帮助来弄清楚 Snowflake 中的日期转换逻辑。文档对此不够清楚。

在 SQL Server 中,我会尝试

它给了我'07/30/2020'。

如果我在雪花中尝试以下内容,

它给了我'08/22/1970'。为什么它会给出一个完全不同的日期?需要帮助以获取正确日期的逻辑。

0 投票
0 回答
48 浏览

swift - 有没有办法在 Xcode 中发表评论,以便在拉取请求中不显示?

我正在研究我团队的代码库并在其中做笔记以澄清我不明白的地方。显然,当我提出拉取请求时,我不希望这些注释出现。除了创建代码库的副本用于记笔记之外,有没有办法输入笔记以使其不会发生?也许有一个 CocoaPod 可以做到这一点?

0 投票
3 回答
108 浏览

java - 返回从 String 的输入参数索引开始的字符串

0 投票
1 回答
23 浏览

swift - not initialised at super.init swift

I'm trying to create a dynamic cell where sometimes I would like the cell to show the last message and sometimes I don't want the label to be there.

I get an error saying lastMsg not initialized at super.init here's my cell:

0 投票
1 回答
26 浏览

javascript - 按设置的顺序获取所有本地存储项目

我想知道是否有一种方法可以按照放入的顺序遍历所有本地存储数据。问题是我的键是对象的 id 并且不会按顺序排列。

我可以有一个 id 为 102 的项目,下一个是 3。我需要保留这些 id,因为所有 tr 都用这些 id 标识,以便我可以操纵它们,所以我需要 localstorage.setitem(ID,data)保持这样。

有没有办法像推/弹出本地存储或像 localStorage.First() 这样我可以按顺序获取我的物品?

0 投票
1 回答
949 浏览

xamarin.forms - Xamarin.Forms with Shell:有没有办法只为活动选项卡指定图标的颜色?

我正在开发基于Shell的Xamarin.Forms应用程序,并且我使用字体图标作为以下图标:TabBar

我想只为活动选项卡指定颜色,但只为图标指定颜色,而不是为文本指定颜色,正如我们在 Airbnb 上看到的那样: 爱彼迎截图

我在 Shell 设置中没有找到任何选项:

是否可以?

0 投票
1 回答
51 浏览

python - Applying multiple conditions to a python dataframe

I have some output from an online task that I need to wrangle into a usable form for scoring, which requires multiple conditions in order to be wrangled correctly. I tried using if and else statements but I am having a hard time meeting all the conditions needed this way. A description of the data and conditions needed - in the first column there are three possible values corresponding to the person's response: either 'yes', 'no', or 'NR' (meaning no response given yet). In the second column is a type of counter, which is supposed to run from 1-5 sequentially, but it will repeat a value if the person held down the key for too long. So for each count in the second column, I want there to be one corresponding response in the first column, which should be the first response given ('yes' or 'no') for that count. If no response is given during that entire count, it should stay as 'NR'. The count then repeats itself from 1-5 again. For example, this input data:

Should reduce to this:

It is a bit of a confusing problem, and so far I haven't found a combination of conditions or if/else statements applied to arrays that have given me the outcome I wanted. Any help or ideas would be much appreciated!

Source code for input data:

0 投票
1 回答
52 浏览

c++ - 人为降低 CPU 速度或内核数量

我有一台非常强大的开发机器,用于开发和测试我的项目。我设置了一个应该非常重地加载 CPU 的情况,并检查了性能监视器以查看我正在使用 130% 的 CPU。我想知道我的程序在内核较少的机器上会如何表现。有没有办法限制操作系统将分配给我的程序的 CPU 数量?或者我可以以某种方式降低有效时钟速度吗?

0 投票
1 回答
631 浏览

kotlin - Kotlin Types, Subtypes, and Supertypes vs Classes, Subclasses and Superclasses

I am learning about subtypes and supertypes in Kotlin, and initially assumed that these terms meant inherited and parent classes. But after reading this post from JetBrains, I am not sure I understand exactly what they mean by subtyping.

The post explains that Any is a subtype of Any? (makes sense), Number is a subtype of Any, and Int is a subtype of Number. So far so good (Any? -> Any -> Number -> Int), and (Any? -> Number? -> Int?).

But notice diagram # 5:

enter image description here

This diagram (and the accompanying text) imply and explain that Number is a subtype of its nullable counterpart Number?, and that Int is also a subtype of its nullable counterpart Int?. This sounds intuitive, until you remember that Int is also a subtype of Number, and Number a subtype of Any! This is in direct contradiction with the Kotlin docs which specify that

Kotlin supports single-parent class inheritance - so each class (except the root class Any) has got exactly one parent class, called a superclass.

I am left assuming that subtypes are not children classes per se (a single class can be a subtype of more than one parent class at once maybe?). If so, can someone clarify for me exactly what is meant by "subtypes" and "supertypes" in Kotlin?

0 投票
1 回答
547 浏览

flutter - How do I send an email through a Contact Form using Flutter Web?

So I want users to be able to fill the form and send an email like the typical website Contact forms we have.

I have tried several libraries on pub dev, but non seems to do the job right, most only focus on IOS and Android.

0 投票
0 回答
373 浏览

php - 警告:imap_open():无法打开流 {imap.gmail.com:993/imap/ssl

这是我列出来自 Gmail 的电子邮件的 PHP 代码,我还在 php.ini 和 gmail 中启用了 IMAP。但我不断收到以下错误,我做错了什么?

///

警告:imap_open():无法在第 62 行打开 C:\xampp7\htdocs\inbox\gmail\index.php 中的流 {imap.gmail.com:993/imap/ssl}INBOX 无法连接到 Gmail:太多登录失败通知:未知:[AUTHENTICATIONFAILED] 第 0 行未知中的无效凭据(失败)(errflg=1)

注意:未知:[AUTHENTICATIONFAILED] 第 0 行未知中的无效凭据(失败)(errflg=1)

注意:未知:[AUTHENTICATIONFAILED] 第 0 行未知中的无效凭据(失败)(errflg=1)

注意:未知:在第 0 行的未知中登录失败太多(errflg=2) ///

0 投票
1 回答
124 浏览

assembly - Scrolling the terminal sideways (BIOS)

I am writing a bootsector game which attempts to copy the chrome dinosaur game you can play when you have no internet.

To do this, I must run from left to right until the player hits a cactus.

How do I achieve this? (How do I make the terminal scroll from right to left so that it looks like I am moving?) So instead of scrolling up and down, I need to scroll from right to left and left to right. I am in 16 bit real mode (BIOS), and I am using nasm / intel syntax.

0 投票
0 回答
158 浏览

html - 来自谷歌字体的字体系列流沙在 Mozilla Firefox 上被破坏

我在 mozilla 浏览器中显示字体时遇到问题。它看起来与其他浏览器不同,并且在使用大写字母时出现损坏。解决方案是什么?感谢您的回复。我附上了一小部分显示,实际上所有大写的东西看起来都坏了。下面是我的代码,我只使用谷歌的说明。

p>

显示在歌剧上

在 Mozilla 上显示

html代码导入字体系列

css

0 投票
0 回答
304 浏览

apache-kafka - 由于没有身份验证问题,kafka 启动失败

我在同一主机上安装了 Apache kafka_2.12-2.5.1(嵌入式 zookeeper)的单节点集群。在 Zookeeper 上启用 SSL,它启动得很好。然而,Kafka 在启动时会抛出致命错误“NoAuth for /brokers/ids”。如果您有任何指示,请帮忙。

0 投票
2 回答
1686 浏览

php - 从数组中选择的 Laravel Blade 多选选项

我有一个选择输入,允许选择多个选项。由于简单的要求,这些选择只是作为一个数组存储在我的 MySQL 字段中。例如,它们存储为:

[Retail, Wholesale]

现在我的问题是,如果我希望用户能够编辑特定记录,我将如何拉出在选择输入中选择的选项?

选择字段是这样的:

这是在 Laravel 刀片模板中,但如有必要,我愿意使用纯 php 答案甚至 javascript,我只需要能够解决这个问题。

谢谢!

0 投票
0 回答
60 浏览

javascript - 从另一个数组中过滤出一组项目

在加载时,我收到了我想从用户视图中隐藏的图像 URL 列表。

我也有一个包含所有原始图像 URL 的数组。

我想创建一个没有隐藏图像 URL 的新数组。

我正在使用该array.filter()函数,但它没有从数组中删除 URL。

我认为这是我加载函数的方式,因为隐藏的图像最初是空的,然后它再次加载并且它在那里有它的值,但我不确定我没有做什么来让它正常工作。

感谢您的任何见解。

hiddenImages值示例:

在此处输入图像描述

console.log(ImagesToView)

在此处输入图像描述

0 投票
1 回答
33 浏览

python - 使用 bs4 python 抓取图像

这是链接“https://www.blocket.se/annons/stockholm/samsung_note10__i_nyskick_med_kvitto/92119857”

我想提取手机的图像

当我使用 find_all 进行搜索时,我得到的是背景图片,而不是我想要的(电话),或者没有

任何知道如何仅提取手机图像的人

0 投票
2 回答
73 浏览

python - How to check the folder for file and then read the file in python

I need to read a csv from a folder location, but there is catch in it. It could also happen my other module which writes the csv into that folder fails and unable to export the file, so basically i have to check the folder that if a csv file called "test.csv" exist or not in that folder, if it exist read the file else print('file not found')

0 投票
2 回答
142 浏览

azure - 在新数据流中将现有数据集与 Azure 数据工厂一起使用

当我想创建新的数据流时,我在使用 Azure 数据工厂的现有数据集时遇到了问题。数据工厂中的数据集组合框下不加载现有数据集。此外,当我想创建一个新数据集时,大多数数据源(如 SQL Server)都被禁用。

有什么想法吗?

请看这个屏幕截图

我无法选择之前构建的数据集 当我按下新数据集时,sql server 被禁用,我无法选择它。

此列表中的 SQL Server 已禁用且无法选择

0 投票
2 回答
75 浏览

python - How to capture table in a structured format from the website using Beautiful soup and Pandas or any other method?

I want to scrape the table 'Summary statement holding of specified securities' from this website https://www.bseindia.com/stock-share-price/infosys-ltd/infy/500209/shareholding-pattern/ I tried scraping data using selenium but it was all in one column without any table and there is no unique identifier to this table. How to use pandas and Beautiful Soup to scrape the table in a structured format or any other method. This is the code I'm trying to figure out but it didn't work.

0 投票
0 回答
958 浏览

c# - 如何调试 System.Text.Json 反序列化器

在使用 System.Text.Json 反序列化 JSON 数据且数据与目标模型不匹配的情况下,它会抛出 NotSupportedException 且没有任何细节。

如果数据很复杂,则很难确定问题发生的位置。

有没有办法获得更多的调试信息,或者一些关于哪个成员未能反序列化的提示?

编辑

这是一个示例命令

错误信息:

不支持集合类型“System.Collections.Generic.Dictionary 2[System.Int32,OntraportApi.Models.ResponseSectionFields]' on 'OntraportApi.Models.ApiResponse1[System.Collections.Generic.Dictionary`2[System.Int32,OntraportApi.Models.ResponseSectionFields]].Data”。

responseStream.Length = 18494,要我粘贴吗?