所有问题

0 投票
1 回答
52 浏览

r - 如何在R中连接txt行

我有一个包含 2940 行的 txt 文件,其中模式每 10 行出现一次(即,从第 1 行到第 10 行对应于对象 1 ...等)。

以下是一些示例行:

我用代码创建了这个

当我尝试创建一个每 10 行连接一次的循环时,

输出将行中的数字相加。例如,第 1 行变为 1323。

基本上,我想将 txt 文件重新组织成如下内容:

这是 73 列的 1 行,之后是类似的行。

这是一个 dput() 以备不时之需:https ://codeshare.io/5Dy4EW

0 投票
1 回答
537 浏览

c# - 将解决方案从 .net framework 4 升级到更高版本。4.7.2;4.8.VS2013

从 .net 4 更新到更高版本(例如 4.5、4.72)后,我收到以下错误。我更新了参考资料等。

使用 TargetFrameworkMigrator 手动执行更新。

0 投票
2 回答
60 浏览

entity-framework - 如何设置我的模型关系以在 .NET Core 3.1 和 EF 中执行以下操作

我正在学习 .NET Core 3.1 和 EF,并决定开始我自己的项目。我一直想设置我的模型,以便我可以创建以下关系:

用户 -1-to-Many-> 事件 -1-to-many-> EventMember -1-to-many-> 用户

我创建了一个事件API 来测试我的更改,但没有运气。

我设想 JSON 令牌如下所示:

用户.cs

事件.cs

事件成员.cs

以下是我的问题:

  1. 这里有一个循环依赖,这是不好的做法吗?
  2. 保留用户会更好吗独立于其他模型并在控制器中手动填充事件表中的 userId 会更好吗?
  3. 如果我正确设置了关系,当我调用我的事件 API 时,EF 是否会自动返回包含其他嵌套对象(例如 EventMember 和 User)的结果,或者这是我必须手动填充的内容,例如:event.EventMember = _eventMemberRepository.FirstOfDefault(MyEventMemberId); //Something like that, basically call the repo to get the object and populate it in the parent object

但最重要的是,在 EF 中为这种关系设置模型的正确方法是什么?任何帮助是极大的赞赏。谢谢大家。

0 投票
1 回答
217 浏览

flutter - ListView 在另一个可滚动小部件中构建所有项目

我想ListView.builder在另一个可滚动的小部件内有一个小部件,但是当我构建这样的树时,内部ListView.builder会构建所有项目(因此渲染速度很慢,列表很大)

我有以下构建方法:

执行总是在断点处停止itemBuilder (但如果我删除第一个SingleChildScrollViewColumn,一切正常,最后一个项目仅在需要时呈现)

0 投票
1 回答
548 浏览

javascript - 从 Google Cloud Functions (JS) 中运行 Google Storage Command

我正在使用 Cloud Functions 将 GCS 中文件夹的全部内容移动到同一存储桶中的另一个文件夹。我正在使用 Javascript。尽管存储桶和源对象存在,但我不断收到该对象不存在的错误。

这是云函数代码:

这是 package.json 的来源

这是我得到的错误(来自谷歌日志):

我错过了什么……?

谢谢

0 投票
1 回答
230 浏览

r - 马尔可夫链的R模拟

我试图估计学生如何通过年级进行过渡。这是一个样本数据,其中 t11 = 留在年级,t12 = 前进一个年级,t13 等于毕业。等等。这是数据1。

我看到了一些非常复杂的包来模拟这种概率矩阵的结果——我想知道是否有一种更简单的方法可以使用 data2 作为学生体来模拟这 10 次步骤并使用 data1 进行转换?

0 投票
2 回答
38 浏览

regex - 如果某些数据依赖于另一个字段,如何使用正则表达式捕获某些数据?

我需要帮助为下面提到的日志编写正则表达式:

URLReputation: Risk unknown, URL: http://facebook.com

我写了一个如下的正则表达式:

URLReputation\:\s*(.*?),\s*URL\:\s*(.*)

这里一切正常。但如果 URL 不存在,则 URLReputation 也不会被捕获。

请帮忙。

问候,

米特什·阿格拉瓦尔

0 投票
0 回答
36 浏览

html - 在 flexbox 布局中展开中间项

我有一个小屏幕布局堆叠:

但在更大的屏幕上,我希望有这样的布局:

图像相当高,内容块应位于标题块的正下方。

我试过使用 flex:

但是标题块和内容块之间存在差距。

我怎样才能产生这种布局 - 是否可以使用 flex?

https://jsfiddle.net/tjL27c8r/

0 投票
1 回答
533 浏览

php - Cannot install WordPress error: "cannot connect to database"

Apache2 on Ubuntu, no SELinux.

New server I am trying to install WordPress and I get the error

I can log in via the command line using

just fine and port 3306 is live.

root@localhost:/home/www/services.com# netstat -an

root@localhost:/home/www/services.com# cat wp-config.php

root@localhost:/home/www/services.com# ufw status

full error:

I also triple checked for whitespaces or errors in usernames and read numerous other similar post.

How do I get WordPress to connect to MySQL?

0 投票
1 回答
222 浏览

c - `atomic_compare_exchange_strong_explicit()` -- what do the various combinations of `success` and `failure` parameter do, when not equal?

The atomic_compare_exchange_strong_explicit() function takes two memory_order parameters, success and failure (as does atomic_compare_exchange_weak_explicit()). Unpicking the C11/C18 Standards, I find that the allowed values for success and failure are:

The Standard also says:

Further, if the comparison is true, memory is affected according to the value of success, and if the comparison is false, memory is affected according to the value of failure. These operations are atomic read-modify-write operations (5.1.2.4).

Your ARM, POWER-PC and other "LL/SC" devices do a Load-Link/Cmp/Store-Conditional sequence to implement atomic-cmp-exchange, where the Load-Link may or may not be _acquire and the Store-Conditional may or may not be _release.

So I can understand: success = _acq_rel and failure = _acquire.

What I cannot get my head around is (amongst others): success = _acq_rel and failure = _relaxed. Surely, in order to achieve _acq_rel, the Load-Link must be _acquire ? If the cmp fails, surely it is then too late to downgrade to _relaxed ?

What is the intended meaning of the combinations of success and failure parameters (when they are not equal) ?

[It's always possible that I have been bamboozled by the Standard, and that the failure memory-order may, in fact, only be the read half of whatever the success memory-order is.]

0 投票
2 回答
30 浏览

c# - 如何在构成 DataTable 中的第 3 列的 2 列值之间添加空格?

我有以下代码在我的 WinForms 应用程序上填充我的 ListBox。

这些值在 ListBox 中显示如下: 0007Fishing Lures 我正在尝试找出如何更改上述代码,使其看起来像这样:

或者像这样

我更喜欢在值周围添加 (),但我可以解决两列之间的空间。

0 投票
1 回答
134 浏览

r - Multiple plots gives a blank PDF, data dimension error

I have an error when trying to plot multiple plots to a PDF. I have used the code from Printing multiple ggplots into a single pdf, multiple plots per page to create my loop, but I am not sure what is causing the error.

The PDF compiles, but it’s just one 1 page and its blank. I have recreated the problem below and it seems like a data dimension issue, but it’s not clear to me how it should be resolved. The plots can be saved manually to PDF from the plot viewer, but it seems to fall over in the loop. My expectation is to get a PDF that's 3 pages long with one chart per page.

The error that comes up:

0 投票
1 回答
482 浏览

c++ - 不能在 C++ 中包含标头

我正在用 C++ 编写一些程序。我需要包含一些标题(#include <gnuplot>)。但是当我使用#includeand 括号执行此操作时<gnuplot>,我收到错误,即此标头不存在。我需要指定从程序文件到main文件的整个路径。但是如果我把这个项目移到另一个地方,我需要重新指定所有的东西,所以这很烦人。

我是否必须在main标题文件中写一些东西,我可以将它包含在括号中?我需要在哪个文件夹中下载所有库。检查我的整棵树的数据

其他标题也发生了这种情况。

我怎样才能做到这一点?


数据:

C++我在我的项目的各个文件夹中命名了一些大文件夹。我Libraries在这个文件夹中有一个文件C++夹,在不同的文件夹中有一些库。

我的树:

我使用 Visual Studio 2019。

希望这些数据有所帮助。如果您需要更多数据,请在评论部分说明。也告诉这个问题的一些改进。

感谢你的付出!

0 投票
1 回答
43 浏览

sql - 如何在后台保存 SQL 查询分析,同时仍向用户提供记录?

我有兴趣知道是否有一种有效的方法可以记录 SQL 查询的分析,同时仍向请求者提供记录?我目前在 MS SQL Server 2012 上。

例如,假设您有多种方式让用户从数据库中提取记录(SSRS、SSIS、基于网页等),由于没有更好的术语,我们只称它们为报告。随着时间的推移,很高兴知道正在运行哪些报告、何时运行、运行报告需要多长时间、给定报告返回的记录数等等等等。这些分析数据点将使我能够密切关注事物——请求最多、运行时间最长、最活跃的用户等。

现在我已经建立了一个系统,其中我有一个视图,它是报告的完整“基本记录”集,以及最终用户调用的在视图上运行的存储过程——它调用视图并转储过滤的结果进入@TempTableSProc 内部。除了根据用户的需要过滤 View 返回的记录外,SProc 还会记录执行时间、持续时间、记录计数、提供的参数等,所有这些都保存到单独的“分析”表中以进行单独分析。最后,SProc 只是将记录返回@TempTable给用户。

虽然这确实有效,但它只是感觉很笨重,并且确实会增加一两秒的总处理时间。我希望有一种更有效的方法来完成这种信息的背景捕获?

注意:第三方软件不适用于我的环境。

0 投票
1 回答
168 浏览

android - android studio Jsoup 缺少内容

我正在android studio中创建链接预览,我已经成功但是当我开始进一步测试我的工作时,我注意到有时链接没有显示所有必需的内容,例如我试图打开

像这样用jsoup

以下是我得到的结果文件

在此处输入图像描述

然后我去https://try.jsoup.org/从同一个链接检查结果,这就是结果

https://try.jsoup.org/~sY0KUiRifqNt-BzogCFyQuXVeDc

在此处输入图像描述

如果您检查标题,您会发现缺少“描述”以及正文中的其他内容......有人知道这背后的原因吗?我想获得所有的内容。

先感谢您。

更新

所以我环顾四周,发现我从一开始就没有得到正确的信息。

我去了https://www.google.com然后按CTRL + U你会看到这与 Jsoup 获得的信息完全相同......但仍然使用https://try.jsoup.org/获得所有的元数据信息,那么为什么 android 版本不这样做呢?

0 投票
1 回答
343 浏览

triggers - 将服务挂钩的 Azure Devops IP 列入白名单

在我所见的任何地方,我都找不到将服务挂钩列入白名单的 IP,该服务挂钩从 Azure Devops 回到我们的内部网络。我能够通过发出请求并查看日志什么 IP 被阻止来让它工作。然后我去了 ARIN 并查找了 IP 并找到了 Microsoft 用于此服务的块。

截至 2020 年 3 月 10 日 -

净范围 20.33.0.0 - 20.128.255.255 CIDR 20.33.0.0/16 20.34.0.0/15 20.36.0.0/14 20.40.0.0/13 20.48.0.0/12 20.64.0.0/10 20.128.0.0/16

0 投票
4 回答
90 浏览

java - 为什么在分配给临时变量的 for 循环值中不能按原样打印?

我的演示程序:

输出 :

i 的值:0 _tempVal:5

i 的值:1 _tempVal:0

i 的值:2 _tempVal:1

i 的值:3 _tempVal:2

i 的值:4 _tempVal:3

为什么变量“tempVal”与“i”的值不同?

0 投票
2 回答
1331 浏览

javascript - 数据表:未捕获的类型错误:无法读取未定义的属性“唯一”

我的 jquery 数据表代码有问题。这个新错误突然冒出来。

我怀疑这可能是因为我正在加载的所有库文件,数据表初始化失败,因为数据表文件没有及时加载,因为这个错误似乎在我添加额外的库和大部分内容后立即弹出类似问题的论坛似乎暗示了这一点。

但是我的错误还没有解决。加载数据表库的顺序应该没问题,因为它们以前工作得很好。

这就是我加载脚本文件的方式:

这是我的数据表初始化:

0 投票
1 回答
528 浏览

java - How to configure a Gradle Java Platform to prefer the higher dependency version?

I am getting the following error in my spring boot gradle multi module project.

The root cause is that spring-boot-starter-data-jpa transitively depends on 3.24.0-GA and spring-boot-starter-thymeleaf transitively dependens on 3.20.0-GA. I am using the Gradle Java Platform Pulgin rather than the Spring Boot Gradle plugin.

Question:

  • How do I configure a Gradle Java Platform to prefer the higher dependency version? I want to fix the conflict the resolution centrally and not in every project.

Gradle Platform Project

Security module gradle project

Full dependency insight report

0 投票
0 回答
65 浏览

angular - 如何使用 TranslateHttpLoader 从文件中加载翻译并动态添加更多翻译数据?

我的应用程序有大多数翻译的静态 JSON 文件,但一些用户生成的数据也有翻译,我想按需加载该翻译数据。

我目前正在使用 TranslateHttpLoader 加载 JSON 文件,但它会导致加载的翻译setTranslation()被忽略。

有没有办法加载静态文件并能够按需加载额外的数据?

0 投票
1 回答
431 浏览

python - Rotate xticks on both seaborn chart

I have a time series data and I plot two charts side by side. I need to rotate x labels as there are too may years to show. When I add plt.xticks(rotation=45) it changes rotation only for the second plot but not the first. Any suggestions?

This is my code:

0 投票
2 回答
80 浏览

html - 为什么我不能使用下载的引导程序

我已经从这个链接下载了Bootstrap的编译 CSS 和 JS版本。将其解压缩到我的项目根目录中,并在我的 html 文件中引用它们。我的 html 文件现在是这样的:

现在,如果我运行该页面,则它不会正确显示引导导航栏。它的显示就像这个 屏幕截图

但是,如果我将 cdn 用于引导 css 和 js,那么它可以完美运行。

我究竟做错了什么?

===== 编辑=========

经过一番挖掘,我发现我在 bootstrap.min.css 或我下载的 bootstrap.css 文件中找不到引导样式。例如,我找不到类 .navbar-inverse 的任何样式。

0 投票
0 回答
26 浏览

python - Python 在方法中打印一个数组,然后返回 None

我最近编写了一个简单的 Python 程序来查找素数。代码如下:

(不要因为我使用全局变量而责备我 - 我知道这是不好的做法,对于这个简单的测试,我无法想象它会有所作为)

当调用 findPrimes 时,程序首先确保没有超出搜索限制(在本例中为 20)。之后,它会做一些算术来检查这个数字是否有任何素因数。如果数字是素数,它会将 n 附加到素数数组,然后将 n 加 1 并递归。最终,这部分方法的性质应该是无关紧要的,正如我们将看到的那样。

当我运行程序时,输出如下:

输出 "[2, 3, 5, 7, 11, 13, 17, 19]" 来自 findPrimes 内部的 print(primes),这当然意味着 primes = [2, 3, 5, 7, 11, 13 , 17, 19]。但是,当我返回素数并将 findPrimes 的输出设置为等于 foundPrimes 并打印它时,Python 会给出输出 None - 暗示 findPrimes,因此 findPrimes 的输出,因此素数为空。

所以,我的问题是:这些相互矛盾的含义的根源是什么,我如何解决这个问题以从 findPrimes 获得非空输出?提前致谢。

0 投票
2 回答
119 浏览

java - How to calculate time complexity on psuedo-code

So I've been stuck on this problem for quite a while now and I figured, I can get some support from this community as its my last resort

Algorithm gibby(A, B, n)

I'm I right thinking that this has a time complexity of 0(N^2), if I'm mistaken please elaborate as this would be greatly appreciated.

Also how can I create another algorithm that computes exactly the same thing as the algorithm above but has a time complexity of 0(N)?

Thank you in advance.

0 投票
1 回答
226 浏览

ruby-on-rails - how to resolve libgomp.spec missing while attempting to install rmagick gem with ruby 2.3.8 | Rails 3.2.22.5 | Amazon Linux 2018.03

Error while attempting to install rmagick on an Amazon Linux Version 2018.03

After yum install ImageMagick

attempting gem install rmagick causes the following error. This happens with any rmagic gem version.

The additional information within the rmagick 4.0.0 mkmf.rb