所有问题
excel - 使用vba从多个工作表中提取数据到一张表
我有一个包含大约 50 个工作表的工作簿(表 1、表 2、表 3、........、表 50)。
我想把它们中的所有数据都放在一张纸上。我为此使用了以下代码。
但是此代码不适用于我拥有的所有工作表。它适用于随机表。
我应该怎么做才能使其适用于所有工作表。(我在每张纸上有不同的行。)
而且上面的代码运行了很长时间。
javascript - 如何解码角度打字稿文件中的jsonpickle数据
我正在创建一个爱好应用程序,其中 Angular 是前端,Python 充当后端。Angular 中的一个组件正在向 Python 发送 HTTP GET,python 用 jsonpickled 对象响应。
我希望解开(解码)在 HTTP RESPONSE 中收到的 jsonpickled 对象。 unpickle(解码)将发生在接收 HTTP REPSONSE 对象的 Angular 的 component.ts 文件中。
按照此处示例文件中的说明进行操作,但它不起作用:https ://github.com/cuthbertLab/jsonpickleJS (在测试目录下有 testUnpickle.html 文件,我曾用作参考,但脚本标签中的部分只是没有' t 执行)。
下面是 Angular 的 component.ts 文件中的代码:
下面是来自 component.html 文件的片段:
python - 我试图将 python 文件转换为 exe 文件,但它不工作
我尝试使用.将我的python文件制作成一个exe pyinstaller main.py --onefile --noconsole
。当我尝试从dist打开exe时出现错误,所以我使用--debug=all它说pyinstaller: error: the following arguments are required: scriptname。
作为我的第一次,我到底做了什么我不太确定。
python - 为什么输出是应有的一半?
输出- 16 同样对于数据类型“float 64”,数据大小为 32。我很困惑为什么会发生这种情况?不应该是32和64吗?
python - 如何在一个窗口中显示 mad libs 生成器的用户输入条目,包括另一个窗口中的故事(使用 tkinter,包括代码)
用户输入条目在窗口中(opnw1),显示整个故事的代码应该是什么,包括窗口中的条目(opnw1a),请给我一个示例代码。
sql - 从 PostgreSQL 中观察到的日期中提取“咒语”
我有一张这样的桌子
我想推断不重叠的咒语,即看起来像的表格。
在python中,我会做类似的事情
但我不确定如何在 SQL 中实现相同的结果。
flutter - 在颤动中向服务器发送 Post 请求
我想向 Api 服务器发送一个发布请求以更新我的文章浏览次数。我可以通过 Postman 通过运行http://127.0.0.1:8000/api/updateViews/19来做到这一点 (19 是文章 ID)。
我尝试了 http.post() 方法,但无法向服务器发送请求。
每当有人打开文章详细信息页面时,我只想发送发布请求。
memory - 为什么 CPU 访问对齐的内存
互联网的好人!
在过去的几天里,我一直在阅读有关 CPU 如何访问内存以及如果访问的对象分布在 CPU 访问的不同块上,它会如何变慢。
用一个非常笼统和抽象的话来说,如果我有一个从 0x0 到 0xF 的地址空间,其中一个字节的单元格,并且 CPU 以 4 字节的块读取内存(即,具有四字节的内存访问粒度),然后,如果我需要读取位于单元格 0x0 - 0x3 中的 4 字节大小的对象,CPU 将在一次操作中完成,而如果同一对象占用单元格 0x1 - 0x4,则 CPU 需要执行两次读取操作(读取内存首先在 0x0 - 0x3 中,然后在 0x4 - 0x7 中),移位字节并组合两个部分(或中断,如果它不能进行非对齐访问)。这再次发生,因为 CPU 可以读取 4 字节块的内存(在我们的抽象情况下)。我们还假设,CPU 在一个高速缓存行内进行这些读取,并且在读取之间不需要更改高速缓存的内容。
因此,在这种情况下,CPU 可以读取的每个块的开头都驻留在地址为 4 的倍数的内存单元中(对吗?)。好的,我对 CPU 读取块的原因没有任何疑问,但是why exactly the beginning of each chunk is aligned in such a way?如果参考上一段中的示例,why exactly CPU cannot read a chunk of 4 bytes starting from 0x1?
据我所知,CPU 非常清楚 0x1 的存在。那么所有的fuzz都是因为内存控制器无法访问从0x1开始的内存块吗?还是因为在某些架构上保留了处理器字中的几个 LSB?或者它们被保留的事实是对齐访问的结果,而不是它的原因(似乎已经是第二个问题,但我会留下它,因为在我写这个问题时我觉得它们是相关的)?
这里有很多关于这个主题的答案(比如这个和这个)和在线文章(比如这个和这个),但是在所有的资源中都有关于现象本身及其后果的很好的解释,但没有解释为什么 CPU无法读取从“介于”字节边界之间的内存块(或者我可能看不到它)。
classification - 如何为随机森林设置 class_weight 字典?
我正在处理一个不平衡的数据集,所以我决定使用权重字典进行分类。
文档说必须定义权重字典,如下所示: https ://imbalanced-learn.org/stable/generated/imblearn.ensemble.BalancedRandomForestClassifier.html
所以,因为我想预测位于最后一列的 12 个类。我假设设置如下:
老实说,我不清楚第一个指标的符号,我的意思是:
或者:
它们代表列位置、标签顺序吗?
设置它的正确方法是什么?
我会很感激你的见解。
postgresql - How to insert data into multiple table using single query in postgresql
Hi I am new to SQL and postgresql and currently using it for timescaledb. It's a good timeseries database but I think I have hit a wall as my query took longer and longer as the data grows. Currently my table look like this.
Some example on how the data look like
From my research this is not a good way to store data as it will produce a lot of duplicate in the table and storing some of the data into separate table is better way. I can manually add data to each table but I find it really not optimize and may caused slow down in insert performance. Is there a way I can use a single query that do the transaction in one go. eg.
- insert node in node_table if the node name does not exist and return the id.
- insert view in view_table if the view name does not exist and return the id.
- insert qname in qname_table if the node name does not exist and return the id.
- insert client_ip in ip_table if the client_ip does not exist and return the id.
- insert iface_ip in ip_table if the iface_ip does not exist and return the id.
- insert country in country_table if the country does not exist and return the id.
- insert the time value and count value and use the return id for each column to complete the bind_query_log table.
extra
can i also do bulk insert of data if I have large number of data to insert into a single transaction.
r - 堆积线面积图在ggplot中不起作用
我正在制作面积折线图。它没有堆叠,因为它们不位于其他每条线的顶部。
线部分和区域部分没有对齐。我想在一个面积折线图中显示两组。
这是我的代码
红线与红色区域的顶部不匹配。
c# - 如何使用 EF Core 迁移在我的数据库中创建许多表
我正在做一个书店项目,我首先为添加书创建了一个表。所以我想添加登录和注册页面并存储到数据库中,但我对如何添加另一个表或使用迁移创建与我的需要相关的表感到困惑。我已经附上了我的DbContext班级。
原谅我的英文不太好。我在等你的答案。谢谢
javascript - Wierd Error while working with unlimited argument function Node JS
When I start the program it crashes with this error:
Any Idea? Thank you for helping me!
azure - Terrafrom Dynamic block with tags
Below is the error i am getting while terraform plan
on main.tf line 45, in resource "azurerm_windows_virtual_machine" "myvm": tags.key = tags.value
python - How do I create one column in pandas (Python) based on indexes out of multiple columns?
I have a data frame where there's multiple options for a certain index (1-M relationship) - e.g. States as Index and Counties as respective columns. I want to group it in a way that creates just one column but with all the values. This is a basic transformation but somehow I can't get it right.
Sorry I don't know how to insert code that actually is already run so here I present the code to create example DFs as to what I'd like to create.
and I want it to transform it so that I end up with this data frame:
c++ - Pointer to class with only static methods
Is there a way to obtain a pointer to a class consisting of only static methods? There are no member variables.
I have a vector class using a typename alloc = allocator<T> as one of the template arguments. the allocator<T> template class is purely made of static methods. I intend to implement a get_allocator method which provides access to the methods of a given vectors allocator. E.g. so that this works:
Inside custom::vector I have this method:
This throws MSVC Compiler error 2275: 'alloc': illegal use of this type as an expression
Prefixing typename to the signature doesn't help.
Allocator class looks like this:
java - 在类/方法之间交换值
我最近在我的不同课程中学习了公共、私人和双重的使用。但由于某种原因,我不明白为什么这不起作用。我的意图是使用三个不同的类作为练习:我希望 Do() 生成从 0 到 20 的数字,并在不同的类中使用 for1() 方法在我的控制台上仅显示数字 0 到 10。有人可以解决这个问题吗?我不需要更短的代码或仅 1 个类中的代码,因为我需要它来使用许多类来教育自己。如果您可以使用这种设置解决此问题,我将感谢任何人。提前致谢。
sdk - Add attachment to a document which is in adding mode in SAP SDK
I have developed an addon which adds scanned images to the invoice. If an invoice is added I have no problem, if it's in adding mode I can't allocate it because I don't have a DocEntry value which I need to pass.
Is it possible to add an attachment to a sales document in SDK which is in adding mode?
python - Appending values from a text file to an array in python
I have this program that calculates an approximation to the derivative of sin(pi/3). The print gives this output into a txt file:
Now I want to write a function that reads the file and returns three arrays consisting of numbers corresponding to delta_x, abs_error and n. How would I do that? Because I have to plot these arrays into a graph as well later, but I can't wrap my head around on how to actually extract the wanted values with a function that returns arrays for each of the values that I calculated? I have tried with this code, but I get ridiculous print:
the print is:
Which is completely wrong, because each array is supposed to have float values from delta_x, abs_error and n that is in the txt file. When I do it as a list it works, but I have to use arrays. Anyone got an idea how to fix it? Can anyone write a code that works???
sql - 自联接具有下一行的表
我试图加入一个表本身,但在下一行(按 Empno 排序)。
示例数据:
我需要将每个员工的数据与下一个员工进行比较。
我需要这样的结果:
我在 SQL Server 中工作,我尝试了多种使用方法ROW_NUMBER(),但我无法得到如上所述的结果。
java - 使用Spring在Java中传递API时如何根据条件设置哪个字段是强制性的?
假设我有两个不同的 API:A 和 B,它们获得相同的 POJO C。POJO C 有 2 个不同的字段 x 和 y。
是否可以设置一些条件验证注释,所以在将 POJO c 传递给 API A 时,只有字段 x 是必需的,而对于 API B,字段 x 和 y 都是必需的?
谢谢。
python - 有没有办法让 A 中的 * 线更靠近中间?
我自己制作了这个程序,它看起来像这样:
我会说这很原始,但至少它给了我对人工智能的需求。有没有办法让它变平并让一条线更靠近中间?
mysql - 从函数或查询中自动设置列的值
我有一个 MariaDB 数据库,我有一个包含anduserInfo列的表。我想要另一列命名并自动从中获取国家并将其插入列中。我已经导入了 GeoIPLite2 并且已经有一个 SQL 查询,但我不知道如何使用 make mariadb 来做它而不是在我的代码上做它。ipAddresscountrycountryipAddresscountry
这个查询给了我国家名称。我希望 MySQL从上面的查询输出中设置表中country列的值。userInfo
我也已经写了这个函数:
rabbitmq - 相关ID和交付标签有什么区别
我已经为这两者之间的区别寻找了一个很好的解释,但并没有真正找到一个。
到目前为止我所知道的是:相关 id 是一个字符串(转换为字符串的 Guid),交付标签是一个 int。每条消息的correlation id都是唯一的,而delivery tag只在channel中是唯一的(channel就是scope)。
没关系....但是目的有什么区别?为什么我们需要一个消息的两个标识符?