所有问题
excel - 从 Outlook 宏自动打开后无法调用 Excel 宏
我从 Outlook 编写了一个宏来打开 Excel。
代码下方:
之后,Excel 已打开,我Auto_Open在 Excel 上有一个宏,我想在该页面打开时启动它,但这不起作用。
从 Outlook 的宏开始打开 Excel 时,在 Excel 上编写的自动打开宏似乎不会启动,位于 Excel 上的 vba 代码下方:
javascript - 避免在 React 中由对象字面量引起的重新渲染:如何处理对象中的变量?
我在这篇文章React is Slow, React is Fast: Optimizing React Apps in Practice中读到:
实际上,每次将对象文字作为 prop 传递给子组件时,都会破坏纯度。
好吧,我明白了。所以最好避免这种情况是用对象创建一个变量,并将这个变量插入到道具中,就像这样:
但是如果 style 属性依赖于接收到的属性呢?对象应该在哪里?例如,我有这个组件:
这样做是一个好习惯吗:
[编辑] 我忘了说我的大部分组件都有状态,所以在这种情况下,这样做是个好主意:
php - CakePHP 3 - 分隔 JOIN 条件时使用不同的表别名
我正在使用 CakePHP 3.5.13 重建一个普通的 PHP/MySQL 应用程序。
原始应用程序中的一个查询需要在同一个表上构建一个JOIN条件,并通过使用单独的表别名来实现。查询如下 - 并给出了我们期望的正确结果:
需要这样做的原因是因为查询正在搜索 2 个单独的用户输入项 - 在同一个表 ( display_substances) 中但针对不同的display_substances .display_id字段。就上面的查询而言,它意味着:
- 搜索在
"%dye%"哪里display_id = 128 - 搜索不存在
"%bpr%"的地方display_id1,2,3,4,6 or 128
在 Cake 中,我在一个处理搜索功能的控制器中这样写:
这会产生错误的 SQL,因为当我调试时$query->sql();它给出了不同的JOIN条件:
我不确定如何重写此查询,以便它将两个搜索输入中的JOIN每一个都视为一个条件,就像原始查询一样。
我注意到的主要事情是原始查询对同一个表(AS dsUses和AS displays)有不同的别名。我不确定这是否相关?
我正在尝试使用 ORM 而不是手动编写 SQL,因此更愿意知道如何使用它来执行此操作。
jquery - 三消比赛
我正在做一个项目,我需要制作一个三消游戏,我需要用 jQuery 检查是否有 3 个或更多糖果彼此相邻但无法弄清楚。
有一列 7,这是用随机图像填充它的代码:
如你所见,我有 4 种不同的糖果。我需要的是让程序检查 3 个或更多糖果是否对齐并移除它们。
任何帮助或提示将不胜感激。
google-chrome - 如何在 Chromebook 上使用 Assembla SVN 更新和提交?
我正在运行 ASUS C300 Chromebook(71.0.3578.127(官方构建)(64 位)),我想像我的 Windows 7 开发 PC 一样设置它。在 Win 7 上,我使用 TortoiseSVN 连接到托管在 Assembla 上的 SVN,我可以从那里更新和提交。
是否可以在 Chromebook 上做同样的事情?另外,是否可以使用免费/开源软件来做到这一点?
我已经看到了一些关于安装 Ubuntu 和以这种方式进行设置的选项——这对我来说不是一个选项。
[编辑] 我也将 ShiftEdit 视为一个选项,但这是一个付费应用程序,因此并不理想,但是,我确实尝试了 ShiftEdit 的试用版,但我无法找到连接到 Assembla 的方法,它似乎只有Git 集成。
到目前为止,似乎没有像 TortoiseSVN 一样运行在 Chrome OS 上的软件——希望有人知道吗?
c# - 来自 Azure 的 .net 核心流文件并调整大小
我正在尝试从 Azure blob 中获取文件,使用 ImageSharp 调整其大小,然后将其提供给客户端。我有以下代码,它有效:
与创建 2 个内存流相比,有没有更有效的方法来做到这一点?这最终将需要大量的请求,我真的希望它尽可能地高效。
bash - Bash PS1 提示设置 \h 在第一个点之后去除主机名
我的系统主机名是这样的:192.168.2.1_machine05我的 bash 提示$PS1设置是[\u@\h \W]\$.
由于主机名中有一个点字符,因此该\h变量仅提取第一个点字符之前的字符串的第一部分,而忽略第一个点之后的其余字符。
为了避免它,我必须使用:PS1='[\u@$(uname -n) \W]\$ '
我可以让这个\h变量显示完整的主机名吗?
google-bigquery - 在标准 SQL / BigQuery 中将 YYYYMMDD 字符串转换为日期
我有一个名为“日期”的列,其中包含以这种方式格式化的日期:“20150101”。
我尝试使用 sql 子字符串,但是当我在 sql 中使用“日期”函数运行查询时,它不适用于我拥有的日期格式。
这是我提出的查询:
任何想法?我找不到类似这种日期格式的东西!我找到了一个使用转换函数的函数,但它不在 StandardSQL 或 BigQuery 中
java - 匿名内部类中不允许使用 Java continue 语句
我正在处理一个耗时的 for 循环并在 N 个线程中执行它们。continue 语句抛出错误
收到错误“不能在循环外使用继续”
有人可以帮我跳过特定条件的特定循环,但不使用 continue 语句,因为它会引发错误。
javascript - Bokeh & Custom JS - 使用滑块更新多线图
我正在使用 Bokeh 生成交互式时间序列图。可以同时显示 n 个系列。每个系列将显示从 t= 0 到 t = x,其中 x 是滑块创建的值。
我使用 ColumnDataSource 来包含所有内容,使用 MultiLine 字形显示系列,使用 Slider 用于滑块,使用 CustomJS 来控制更新交互。
此代码呈现图形,绘制的两条线覆盖source.data.
移动滑块将按预期更新lons&中的数据lats,但图形显示不会更新。
非常感谢您的指点,建议,建议,解释!
java - Trying to re-direct path of a file from c drive to tomcat apache server
Is there a way to change the path of a file present in C folder in a java program and put it into tomcat apache server. This whole code is running on Eclipse IDE and a java program takes the path of a file which is present in C: of the local machine. Can I change that path and somehow store or re-direct that path from the Tomcat apache server.
We are running the code through tomcat apache server on the local machine, now we would like to implement CI/CD pipeline and host the code on rancher for which the code is hosted on gitlab first and then the pipeline starts. Is there a way I can change this path and store the file in tomcat apache server or re-direct the path of the file from the server. Or will the project face any problem when processing through the pipeline? I'm using eclipse as IDE. Any help is much appreciated.
python-3.x - 如何将数据框列与列表匹配并使用列表中的元素创建一个新列
我有一个 pandas df 列,其中包含一些文本。现在我想将此文本的每个单词与列表中的元素进行比较,如果有匹配项,那么我想将该单词添加到新列中。虽然,我可以使用循环提取这些(虽然不理想)但是当涉及到没有匹配的文本时,我无法追加任何内容。例如。
python list: bodyparts = ['thumb', 'back', 'elbow', 'should', 'ankle', 'hamstring', 'knee']
此外,以下表达式仅部分完成工作,并且仅附加 0 或 1,如果有匹配或没有匹配。
input_file_1['bodyparts'] = input_file_1['Description'].apply(lambda x: sum(i in bodyparts for i in x.split()))...... . 我可以使用任何其他表达式,它实际上可以附加匹配的单词吗?
虽然,我可以使用循环提取这些(虽然不理想)但是当涉及到没有匹配的文本时,我无法追加任何内容。
此外,以下表达式仅部分完成工作,并且仅附加 0 或 1,如果有匹配或没有匹配。
input_file_1['bodyparts'] = input_file_1['Description'].apply(lambda x: sum(i in bodyparts for i in x.split()))
预期产出
身体部位
拇指
背部
弯头
没有任何
实际输出
1
1
1
0
javascript - 追加块时如何修复 CHUNK_DEMUXER_ERROR_APPEND_FAILED 错误?
我想创建一个可以播放多种分辨率的视频播放器,所以我必须加载不同编解码器的块。
我试图附加相同编解码器的块并且它工作。所以我尝试使用 changeType() 但是当我在视频元素中附加新的编解码器块时,我发现了这个错误“CHUNK_DEMUXER_ERROR_APPEND_FAILED: Append: stream parsing failed.”。
我该如何解决?
sparql - how to group count items in SPARQL, accumulating low hit entries?
How do I count grouped entries in SPARQL, merging entries whose quantity is less than a specific factor?
Consider for example the Nobel Prize data. I could get a count of all family names with a query like
How do I modify the query so it only returns the family names occuring at least 3 times, accumulating the other names as other.
azure - 流中的 Avro 对象容器无效。无法识别标头。- 如何解析 Blob 存储中的消息
我有向 IOT Hub 发送消息的设备。我正在使用IoT 中心的路由功能将消息路由到 blob 存储。
我看到所有消息都到达了Blob存储。但它以附加格式存储。所有的消息一个接一个地附加。
我知道我们可以配置chunk size,frequency但我的要求是将一条消息分别存储在一个 blob 中。可能吗?
或者
如何根据时间戳解析每条消息?
这是avro消息
这是 Azure 函数代码
但我得到这样的错误
流中的 Avro 对象容器无效。无法识别标头。
matlab - Solve a system of boolean equations in Matlab
I have a set of boolean equations, i.e.
And the constraint that every output vari should equal 1.
I want every corresponding combination of input variables (x, y ,z ...) which satisfies these equations.
For example, the first two equations would allow [x y z] = [1 1 0] or [1 1 1] as solutions.
php - remove duplicated data from two different foreach loops
I have two for each loop . Each one is running on a different table
The firs result is:
And the second result is:
I would like to check for duplication and remove the duplication values, display only the one that are not duplicated in
docker - 从 Docker Hub 在 Rancher 上部署镜像
我正在尝试将我的 Docker 映像从 Docker Hub 部署到 Rancher。当我这样做时,我只得到更新状态,然后过了一段时间,我得到了部署超时。我是 Rancher 的新手,正在尝试浏览文档但无法正确理解。谁能帮助我做到这一点?
我已经尝试拉取图像,一段时间后它显示“部署没有最低可用性”。
下面是我的 .gitlab-ci.yml 文件配置:
下面是我的 DockerFile:
我想在将 C# Web API 部署到 Rancher 后运行它。
ios - 旧消息未在 iPhone 通知中删除尝试
我在 ionic 3 应用程序中使用推送插件,一切正常,但是从我的服务器端,我们一次发送一条消息,我正在接收消息到 iPhone,但是旧消息应该用新消息覆盖,或者一旦我们收到新消息然后旧消息消息自动清除..我找不到与此相关的任何内容,请任何人帮我解决这个问题。
javascript - Importing external libraries in Postman
My need: I want to build a path containing filters on my JSON response.
Postman does not understand the [?(@.Node3 == 'value')] syntax as jsonPath is not supported natively.
Hence, I am trying to import the jsonPath js library in Postman, and I have found two:
Researches
I already read this post, and none of the answers satisfy my needs.
Postman js code is limited to the sandbox.
Postman limits libraries to this list.
There is a trick (check TIP #5) to add js code as global variable, and call it in requests. However it does not work for jsonPath project as it is not just a simple function but a whole project. I tried many different ways, but still unable to call the jsonPath functions from my Postman Test.
I also read the related Postman issue.
From GitHub community, this issue was closed in favor of this one. Which has been closed in favor of this one. Which is opened without clear answer (only small tricks mentioned above) since June 2015.
Unknown domains
Even if I read their global use, I do not know anything technical about NodeJs / NPM / Newman.
But I read that postman supports NodeJs, allows to generate NodeJs code snippet and I saw that jsonPath library can be imported using NodeJs.
Maybe something can be done from there, but I don't have the expertise to make it happen.
Question:
Does anyone knows how to make it work altogether ?
I mean, find a way to use jsonPath expression, thanks to the jsonPath js library, in postman... Please help.
Any postman collection making it work is welcome :).
java - JavaFX: where is the best place to declare nodes of controller
I created a LoginFieldsController custom controller that inherits from the VBox class. Later in the programs I use this controller as an ordinary node like Button, TextFiled, etc. Please note that I only write pure Java code, I do not use FXML.
Question: is it better to declare LoginFieldsController nodes as the fields of the LoginFieldsController class, or inside the LoginFieldsController constructor? Outside the constructor I was doing nothing.
In other words, it would be better like this:
Or that:
node.js - Error: Timed out while waiting for handshake in Lambda logs
The function of SFTP is working locally and it has the correct configuration. The problem is with the logs of Lambda that complains about the configuration I believe by giving me an Error: Timed out while waiting for a handshake.
-
-
I added VPC and Security Group in AWS and I still get the same error. I ran out of ideas of how to fix it.
c++ - 在 Linux 上部署 Qt
我正在尝试在不同的操作系统上部署 Qt 应用程序。
在这个帮助页面之后,Windows 就像一个魅力。不幸的是,我在 Linux 上部署我的软件时遇到了问题。我已阅读此帮助页面,但似乎我不理解该Plugins部分。
到目前为止我做了什么:
- 我已经使用 QMake 编译了我的应用程序
- 我已将所有动态链接库(如:、、、
libQt5Core.so.5...libQt5Core.so.5.11.2)libQt5Gui.so.5添加libQt5Gui.so.5.11.2到与我的应用程序相同的目录中(其中一些出于某种原因是符号链接,但这不是这里的问题) - 我创建了一个名为的子目录
platforms并将libqxcb.so库放在那里 - 我创建了一个 bash 脚本,如我正在运行的教程中建议的那样
编辑:以下错误已经解决:
现在我也在纠结如何以及将哪些插件放入我的目录中。我收到以下错误消息:
根据这个问题,我确实运行ldd libqxcb.so了其中列出了以下库(以及更多)
我已经看到图书馆libQt5DBus.so.5也是必需的。因此,我已将该文件(以及 )复制到所有其他 Qt 库所在libQt5DBus.so.5.11.2的父目录中。platforms
但是,我仍然收到相同的错误消息。
难道是它与第一个输出有关,ldd因为是说“未找到”?
当我查看我的 Windows 部署时,我有其他名为iconengines, imageformats,的文件夹styles,translations我是否还需要提供这些文件夹和库?如果是,我在哪里可以找到它们,我如何检查我需要哪一个?
编辑:新错误
我想出了第一个问题。这是由于一个被忽视的图书馆,即:libQt5XcbQpa.so.5.
但是现在我收到一个新错误:
我注意到我要安装应用程序的 PC 上有一个旧的 Qt 安装 (5.6)。我已将我的库(5.11)复制到与我的应用程序和我的 bash 脚本调用相同的文件夹中:
我认为这个文件夹现在位于动态链接库的搜索路径中。但是,还有其他安装(5.6)。这些库会在我文件夹中的库之前还是之后找到?我问是因为例如 5.6 安装缺少 QtCharts 库,该库在我的文件夹中提供,但版本为 5.11。这可能是问题的原因吗?
这是我的文件夹的图像:
最终编辑
我让它工作了!问题是我有libQt5DBus.so而不是libQt5DBus.so.5. 因此,它在我的目录中找到了版本 5.11 的所有库,除了libQt5DBus.so在旧安装中找到版本 5.6 的库。
感谢你的帮助。
c# - 如何使用 Automapper 将复杂的嵌套对象映射到简单的对象?
我正在尝试在我的 Xamarin 表单应用程序中使用 Event Espresso 4 (EE4) REST API。我从 EE4 REST API 收到的 DTO(作为 JSON)相当复杂,我想将它展平为我将在应用程序中使用的“相当简单”的模型。
我从 EE4 REST API 收到的 DTO 如下所示:
我在我的项目中拥有的 C# 等价物在这里。
我的简单 C# 对象如下所示:
我尝试过不同的东西,比如 ForMember 和 ForPath。我也尝试将内部对象映射到简单对象,但我不断收到以下错误:
我很感激我在映射它们时能得到的任何帮助。
谢谢
编辑:
在同一个项目中,我必须遵循 JSON 和 C# 对象和映射配置,尽管对象不同,但映射工作得很好。
来自 EE4 REST API 的 JSON 对象
我的 C# 对象
上面的 Automapper 映射配置:
如您所见,我必须首先映射内部类,然后映射外部类,这样做,我已经能够仅通过映射生成我的 c# 对象。


