所有问题

0 投票
4 回答
399 浏览

javascript - Replacing multiple strings of text on webpage using javascript

I want to make a google chrome extension that replaces many different strings of text on a webpage to exhibit different words on client side. I came accros with this example below.

But I failed after trying a lot to change it to handle different words to replace. I can only handle one at a time.

i.e: I want to change all 'pink' words to 'blue', all 'cat' words to 'dog' and all 'boy' words to 'girl'. All at once.

How could I accomplish that? When I tinkered with this sample code all the times I would end only changing one of the words. In some cases, only on its first occurence.

Thanks in advance. I could not an answer to this question anywhere. Sorry if it looks noobish.

0 投票
1 回答
40 浏览

excel - How to calculate year over year Loan yield until the maturity. ?

My finance guy asked me to help with his broken spreadsheet and I cant figure out the logic/formula behind it..

I have Remaining Principal, Loan Rate, Maturity Date, Data create Date, Payment Frequency and I would like to calculate the total yield for year over year.

For Example, Data create date is Dec 31, 2018. The Remaining pricipal is 11500. Loan rate is 9.99% Payment Frequency is Bi-Weekly. Payment amount is $350.

I would like to know how much money I am expecting in the year 2018, 2019 and 2020.

I can attach Excel if that helps.

enter image description here

0 投票
1 回答
638 浏览

node.js - 向指定用户发送消息

我正在创建一个机器人,我希望它向指定用户发送私人消息。

例如:

这将发送“欢迎来到服务器!” 给@用户。

0 投票
1 回答
2348 浏览

python - 如果我从 Django 查询集中删除行然后再次过滤怎么办?

考虑以下代码:

不会add_questions包含问题retain=False?即当我们在其子集上questions运行时是否重新评估对象?delete()del_questions

0 投票
0 回答
630 浏览

wordpress - How to get images instead of radio boxes for Contact Form 7 in Wordpress?

I tried the steps as discussed in this thread: Use image as radio button on Contact Form 7

However nothing happens. I just the the text show up on the page.

Any advice?

0 投票
1 回答
103 浏览

coq - 匹配战术/战术符号内的上下文模式

我通过一种策略在我的目标中找到了一种模式。

为什么会失败:

虽然这成功了?


有什么方法可以编写 a my_context_match,这样我就可以传递不完整的模式(带有_它们)并查看我的目标内是否有任何内容与模式匹配?

0 投票
1 回答
634 浏览

python-3.x - Calling TensorBoard from Keras to inspect diagnostics

I am trying to use TensorBoard with Keras and I follow the instructions in this short tutorial: http://fizzylogic.nl/2017/05/08/monitor-progress-of-your-keras-based-neural-network-using-tensorboard/

My code is:

The code is executed without any problem.

Following the advice of the tutorial:

Monitoring progress Now that you have a tensorboard instance hooked up you can start to monitor the program by executing the following command in a separate terminal:

tensorboard --logdir=logs/

I open a terminal and execute the aforementioned command. This is what I get:

I then open the webpage. This is what I see:

enter image description here

How can I sort this out?

0 投票
3 回答
3310 浏览

php - Problem with: Maximum upload file size: 2 MB in Google Kubernetes Wordpress

I deployed this Wordpress kubernetes container: https://console.cloud.google.com/marketplace/details/google/wordpress?project

But I have a problem with upload the theme in Wordpress. The uploaded file exceeds the upload_max_filesize directive in php.ini.

I can't find the file: php.ini. in the pods of kubernetes.

I tried to use plugin for edit php.ini in Wordpress https://wordpress.org/plugins/php-settings/ but it's no write the file.

Could someone help me with a step-by-step guide to modify the container's yaml or other solution?

0 投票
1 回答
98 浏览

asp.net - 禁用用户的 2FA 后如何正确删除 .AspNet.TwoFactorRememberBrowser cookie?

Microsoft.AspNet.Identity V2.2:当用户禁用 2FA(之前已启用)时,用户的 cookie.AspNet.TwoFactorRememberBrowser仍然存在,并且在适当的情况下可能会带来安全风险。我正在寻找一种干净且适当的方法来删除该用户的 cookie,或者我应该只是将过期日期更改为过去的日期 - 如果是这样,我将如何做到这一点?我用谷歌搜索了一堆都无济于事,好像没有人意识到 cookie 仍然存在。

0 投票
1 回答
92 浏览

rest - Twitter API:如何检索时间线,包括推广或赞助的推文?

如何检索当前经过身份验证的用户的时间线,包括推广或赞助的推文?这样的体验就像官方的 Twitter 客户端一样。

0 投票
1 回答
160 浏览

javascript - 删除嵌套在对象内的数组项

我正在尝试根据数组中的标题属性从对象数组中删除特定项目。我一直遇到一个问题,我可以查看数组项,但我无法根据删除函数中输入的参数将项从数组中拼接出来。我只是从else函数中的语句中得到错误消息。

我尝试使用find, forEach, findIndex并匹配这种情况,以测试根据索引或key 'text'. 在论坛推荐中搜索答案之前,我将我尝试过的所有功能都注释掉了。我所有的配方函数都在工作,我的createIngredient函数将一个对象添加到配方数组中。但是removeIngredient我一直试图开始工作的功能并不是因为上面提到的问题。

输出

因此,我可以查看上面打印的输出并查看ingredients数组中的每个项目,但是尝试根据index数字拼接项目,或者key使用我已经尝试过的功能和我找到的信息对我不起作用到目前为止有关对象、数组和拼接方法的 Stackoverflow。

0 投票
1 回答
1594 浏览

progress-bar - 如何将 mp3 文件与滑块链接,以使滑块相对于 mp3 文件长度移动?

如何将 mp3 文件与滑块链接,以便滑块相对于 mp3 文件长度移动?在我的代码中,只有当我在滑块槽上按住鼠标时,滑块才会移动。如何在不一直按住鼠标的情况下完成这项工作?

0 投票
1 回答
2832 浏览

java - 带有 spring-boot-maven 插件的 Spring Boot - 运行集成测试后无法重新启动应用程序服务器

我有一个 Spring Boot 应用程序,并且该应用程序具有集成测试。

这是我的 pom.xml 中用于运行集成测试的相关片段。

当我运行时mvn verify,我看到单元测试首先运行。然后应用服务器启动并且集成测试成功运行。mvn 进程成功退出。

我还在控制台日志中看到以下内容,这让我相信应用程序服务器正在正确关闭 -

随后,当我mvn verify再次运行时,我得到以下绑定异常。

使用netstat并且ps我能够确定有一些进程仍在保留端口 7654,并jps告诉我这是这个进程 -

我不知道如何让 JMX 进程关闭。我认为spring-boot-maven插件会这样做。情况似乎并非如此。

我做错了什么,有人可以帮忙吗?非常感谢您花时间研究这个(潜在的)问题。

0 投票
4 回答
449 浏览

javascript - 首次单击 Ajax.BeginForm 后禁用按钮

在提交表单时隐藏/禁用提交按钮时出现问题。我尝试添加:onclick="this.value='Submitting, Please Wait.'; this.disabled='disabled';"到输入提交字段中,这将禁用按钮但不会提交表单。我也尝试将它放入 javascript 部分,但它不起作用。我也尝试过这样的事情:

我很茫然,因为我正在查看的很多示例都是针对 html.beginform 的,而这个旧表单是用Ajax.BeginForm. 关于如何使用下面的代码隐藏按钮或禁用按钮的任何见解都会有很大帮助!

编辑!!!!!

0 投票
0 回答
61 浏览

java - 使用服务器发送事件时如何在时间结束时使会话无效?

我正在使用 Server Sent Events 来发送通知,并且它工作得很好,并且监听事件的 servlet 具有这些参数

我的问题是为什么会话在指定时间结束后没有结束?这个问题发生在我将这个servlet添加到应用程序之后,如果servlet是它的原因..如何修改servlet或者我应该怎么做才能解决这个问题?

0 投票
0 回答
104 浏览

typescript - 使用 Typescript 将对象映射到字符串

在 TypeScript 中,我有以下课程:

我需要将一组帖子转换为一组帖子模型:

我尝试了以下方法:

但我得到了错误:

我错过了什么?

0 投票
1 回答
214 浏览

c++ - 有没有办法只评估函子的参数?

鉴于foo这是一个vector我想评估它的内容all_of。但我真正想要检查的是每个元素的计算结果为true.

我可以通过使用logical_notand来做到这一点,none_of但我宁愿不使用双重否定,而且编写 lambda 感觉很愚蠢:[](const auto param) -> bool { return param; }

该标准是否为我提供了一个可以满足我要求的函子?

0 投票
3 回答
34 浏览

html - 网络表单应用程序

在我的 Web 表单中,右侧有一个空白区域,如何将其删除或调整面板大小?

我也尝试过面板padding和容器,但它不起作用。 marginwidth

我想从中删除此网络上的空白。为什么会这样显示让我知道。我想从中删除此网络上的空白。为什么会这样显示让我知道。我想从中删除此网络上的空白。为什么会这样显示让我知道。 我想删除标记的部分

0 投票
0 回答
62 浏览

.net - 集成测试:Microsoft.Owin.Selfhost 与 Microsoft.AspNet.TestHost(或 Selenium)?

我有控制器扩展方法,它们与正在测试的控制器紧密耦合,并且想要比模拟方法响应提供的有关控制器行为的更完整信息。

最好的选择是自托管吗?我看到 Microsoft.Owin.Selfhost 和 Microsoft.AspNet.TestHost 的 nuget 包,这对于使用 Owin.Security 和 Identity.Owin 的 MVC5(即非核心)Web 应用程序来说是首选?

Selenium 有什么帮助吗?我宁愿测试 HTML/Json 响应,也不愿使用编码的 UI 测试。

0 投票
2 回答
48 浏览

sql-server - 将生成的列添加到 SQL 查询结果的末尾

我试图弄清楚是否可以使用 SQL 生成人工列。

鉴于下面的假数据,您如何创建一个名为GENERATED_SEQUENCE.

规则如下:

  • 必须在同一门课程中(Id)
  • 必须在同一日期(Course_Date)
  • 每个课程会话必须在 30 分钟内(Course_Start_Time 和 Course_End_Time)

代码:

这可能吗?

谢谢!

0 投票
2 回答
41 浏览

python - 使用 Beautiful soup 在 HTML 表格中查找信息

我正在尝试从 html 表中提取信息(在此示例页面https://www.detrasdelafachada.com/house-for-sale-marianao-havana-cuba/dcyktckvwjxhpl9中找到):

使用美丽的汤,我怎样才能找到“建筑风格:”(以及其他条目)的价值?

我的问题是我直接找到该类,因为表中的所有条目都具有相同的 div 类名。

0 投票
1 回答
94 浏览

asp.net - 如何在 ASP.net Code.behind 中添加文本框列

从代码隐藏有没有办法将数据表列添加为文本框?在 aspx 文件中,我添加了一个文本框列:

但我需要在代码隐藏中执行此操作,例如:

0 投票
1 回答
247 浏览

java - 多线程 Java 服务器,套接字异常错误

为分配设置多线程服务器。似乎套接字输出流无法识别源 - 至少这是我从返回的错误中收集到的。

当我在“RequestHandlerThread”Runnable 类上调用 run() 方法时,一切都很好。据我了解,这不是多线程。当我实例化一个新线程并将我的'RequestHandlerThread'作为可运行线程传递并尝试启动()线程时 - 我收到以下错误:

我希望线程可以同时创建和运行,以便多个客户端可以同时连接到服务器。但我没有真正正确地“启动”线程

0 投票
2 回答
7169 浏览

android - 私有 IP 上的自签名 SSL 证书在 Chrome 中无效

我想为 nodejs 服务器创建一个自签名证书。我从 macOS 运行它。我希望能够通过Chrome 上的“ https://192.9.200.77:8005 ”从同一 wifi 网络上的另一台设备(Android)访问该服务器通过 https 呈现的页面。192.9.200.77 是服务器的 IP。

我设法使用带有 SAN 的 OpenSSL 创建了一个密钥和一个证书。我在 Android 设备和 macOS 上安装了证书。

在 MacOS 上,证书适用于 Safari,但不适用于 Chrome 71。

在 Android 上,证书也不起作用。

app.js(节点服务器):

要创建证书,我使用配置文件:

ssl.conf

和 Openssl 使用这些命令:

然后我按照这里的建议将证书转换为 Android 设备的 DER 格式:

并将 priv_and_pub.key 转换为节点服务器的 .pem :

app.js工作正常。我.cert在 macOS 中安装了,在 Safari 上一切正常(绿色锁和所有),但在 Chrome 上不起作用:(net::ERR_CERT_COMMON_NAME_INVALID).在浏览器控制台的“安全”选项卡中,我得到连接的绿色标志(连接 - 安全(强 TLS 1.2) )和资源(资源 - 全部安全提供),但证书(证书 - 缺失)的红旗和此错误:'无法在服务器上验证这是域 192.9.200.77,因为它的安全证书来自域 192.9 .200.77。这可能是由于您的黑客配置错误或连接造成的。(谷歌法语翻译)

任何帮助表示赞赏,花了一天的时间来解决这个问题!谢谢!

0 投票
3 回答
63 浏览

python - 基于字符串的Python类型转换

如何编写此代码以使其适用于给定的每种类型?