所有问题
python - 如何检查给定端口上的设备是否正常工作
我必须编写一个代码,在无限循环中从串行端口读取一些信息,但我希望这个脚本能够抵抗电源故障。我尝试迭代所有可用的端口,但它花费的时间太长,因为我需要每秒读取大约 13 行,并对它们做一些事情。处理它的最佳方法是什么?
sql - How add aggregate function value in where clause?
I need to get sales comparison between two reporting periods. It should display sales which only have decreased than previous year. I tried below query to get values.But how can I add aggregate function in where clause.
azure - How to run multiple Azure Functions projects locally as single app (on one port) on Docker?
I've inherited a project where there's around 15 projects in solution with Azure Functions in it. These are not 15 different function apps when deployed to Azure, rather (for example) first five projects are deployed to FunctionApp1, then next five to FunctionApp2 and final five to FunctionApp3.
This causes a lot of discrepancies when debugging locally, mostly with configs and dlls because when debugging locally we just run functions we require but when publishing we publish one project after the other and everything gets deployed eventually. Then, we merge the configs on function app level etc...
So what I want to do is to somehow have all functions from five projects run on the same port and with joined configs, as if it was deployed to Azure. I understand that this cannot be done via azure-cli, as far as I know, and that I need to containerize this? I've searched for quite a while to similar solutions but I didn't find anything useful...
Also want to mention that having them run "on the same port" is not a requirement per se (I can work around this via configuration) but I would like to simulate deployment of multiple projects with joined configs and dlls (if possible).
I know how to host a single app in a Windows' Azure Func container, but is it even possible to have all of these Function projects "published" to a container to simulate Azure's environment?
html - How to make the width of this video 100% responsive?
I'm creating a Shopify website and I want to show a hero video on the top. But the video is somehow leaning to the right, leaving a blank on the left. Anyone knows how I can make it 100% responsive? I don't know much about coding and I did everything I could... any help is appreciated.
Spent three days searching but in vain...
My website is here: https://v3xt5u4y7es2qbjl-22601531467.shopifypreview.com
The video on the top currently is not exactly what I want. I actually just want to keep the second video.
HTML
CSS
c++ - Dtls client doesn't send ClientHello with cookie
I'm implementing dtls support for my sip client, using openssl. My SSL_connect returns SSL_ERROR_WANT_READ, my 'select' to handle it always timeout. In wireshark I saw a first ClientHello and HelloVerifyRequest, but second ClientHello with cookie never came.
php - i am new in php i need to upload file with random name
I am new in php i need to upload file with random name assigning to the file and store that file with random name to upload folder and store that random name into mysql database.
excel - How to populate a variable using a formula
The basic idea is to have a search, that will not only highlight a row which contains a specific value in column C, but also takes me there. I'm trying to combine the conditional formatting, with the CTRL+F function, basically.
My spreadsheet is about 6000 rows.
I've tried various apporoaches, but the closest I've managed to come is using this:
To get me the row where the text in that row matches the value I've typed in my "Search box" located in cell U1. This cell is part of my frozen title bar, so it's always available on the screen.
This will return the row from my search range, let's say it's 1175. Since I have a frozen title row, my target row will end up being Row 1176 in the actual spreadsheet. My aim is to have Excel go to row 1176, highlight that row, and select it as the active row, so that I can immediately work on that row.
I use this formula to generate the actual cell reference:
My problem is that I can't find a way to get Excel to just jump to row 1176, based on the result of the above forumla. So my solution was a short sub in VBA:
This doesn't work, and I can't figure out why. The variable doesn't seem to poplulate with C1176. The forumal works fine and displays the correct cell reference when I use it in Excel, but it doesn't work in VBA.
Can anyone shed some light on why it's failing there?
c# - Do I properly approach this logic and which collection to choose?
I have homework from the Abstraction
section: I need to add items in a bag, such as
- Group: Gold has only name and quantity.
- Group: Gems Minerals have a variety, for example: Topazgem, EmeraldGem, Rubygem also have their name and quantity each.
- Group: Currencies are also different, for example, USD, Euro as also have name and quantity individually.
Тhe result must finally produce the total quantity separately of gold, minerals, and currency, as for minerals and currency separately for each of the subunits.
My confusion is as follows: have I properly expressed the abstraction, and how to suit my choosing for a collection when added to the bag.
Here is the code:
Class Gold, Gem, Currencies inherit Item
php - How to stop formatting php code in .html file using vscode
I'm using vscode to code view file in a PHP project. A traditional way is echo variables in HTML view file, javascript code block, using <?php echo $var; ?>
.
for example:
This is what I want, but the vscode keep formatting the code to
My vscode format setting is:
mysql - 是否有一个 SQL 查询,它只能检索那些在第二个字母后包含连字符的数据?
我想执行一个 SQL 查询,该查询从列中返回所有在第二个字母后包含连字符的数据。
基本上我有一列包含“BC-123456-1”形式的字符串,但在它们之间我有其他字符串,如 NULL(作为字符串而不是类型)和其他垃圾字符串
我目前的查询是
那么有什么方法可以过滤掉那些不符合我模式的数据吗?
python - Twisted installation issue post visual studio update to 15.0
Unable to install Twisted package on python 3.7 version
I installed Microsoft Visual Studio build tools 15.0 as suggested but I am still unable to install Twisted its still throwing the error "error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/"
Do I need to perform any additional setup's to make it work ?
sql - Data Truncation issue while importing excel from Azure Blob storage to Sql Server
I'm trying to import the below excel file present in the azure blob storage into sql server
EXCEL File
Query
Format file
Illustration of Format File
when I execute the query, I'm getting the below error
Msg 4863, Level 16, State 1, Line 210 Bulk load data conversion error (truncation) for row 1, column 1 (DepartmentID).
looks like field terminator in the format file is not working, any ideas to import the file ?
android - 使用导航架构停止重新加载上一个片段
我们如何通过按后退按钮停止从当前片段重新加载前一个片段
前任。就好像我们正在从 List-fragment 移动到 Details Fragment on back press 不需要使用 Android Jet Pack 和 Navigation Architecture 再次重新加载 List-fragment
image-processing - 在 Chainer 模型中仅提供图像
我有一个仅包含图像的数据集,这些图像将在自动编码器中用于重新生成输入图像。我想使用链接器 ImageDataset 将数据输入迭代器。
我已经给出了包含图像地址的文本文件的地址,并在根目录中给出了保存图像的文件夹的地址。
这是使用 ImageDataset 的正确方法吗?另外我想知道 ImageDataset 是否是仅输入图像的好选择,还是有其他选择。
c# - 如何在具有一些不同位置 Unity 的模式中生成彼此向下的平台
我正在彼此下方实例化一个平台,您可以在下面的图片中看到
但我想生成这样的平台
那么我该怎么做呢?您可以在下面阅读我的代码,该代码仅在 Y 位置生成彼此下方的平台。
php - 编码 JSON (PHP) 中不带 /r /n 和 /t 的多行回显
使用 ob_get_clean() 和 json_encode 使用 PHP 为 XHR 请求创建响应时,响应包含不必要的新行(/r,/n)和制表符(/t)。它们对用户没有明显的目的,但无论如何都会消耗带宽。
删除它们可以str_replace
解决问题,同时会导致另一个问题:它还删除了 textareas 中必要的换行符。
输出:
使用 str_replace 删除它们:
输出:
然而:
如何在不弄乱文本区域的情况下摆脱/r /n和/t ?
更公开地问:
是否有另一种(或更好的)解决方案将多行 html 元素附加到除ob_start()
and之外的变量ob_get_clean()
?
c# - 带有控制台工具的 DLL
我正在使用使控制台输出更容易的工具来开发类库 DLL。我没有兴趣让它自动执行。我只会将它用作其他项目的辅助库。DLL/项目是否仍需要是控制台应用程序?
c++ - 如何创建具有固定列长和动态行长的二维向量?
我有一个 char 类型的二维向量,如下所示:
我希望行数是未知的,列数是固定的。因此,每行向量将包含 3 个单元格。
c# - 当我们在服务器上删除 http 标头时,我们收到错误,因为在这种情况下响应不可用
重定向“响应在此上下文中不可用”时出错
javascript - 在javascript循环中增加php变量
我正在尝试使用 chartJS 创建图表显示,该图表显示的图表数量及其内容都是动态的。我被困在如何遍历 php 中的结果集,同时循环创建 javascript 中的图表。我知道 Javascript 是在客户端处理的,而 php 是在服务器端处理的。我编写这段代码是为了让你们大致了解我想要做什么。现在计数器没有增加,我最终得到相同的图表,无论数组中的第一个数据是什么。从某种意义上说,我需要某种方式来跟踪 php 中 javascript 中的 var i 以访问我的结果集中的内容。
javascript - 如何在使用 JSPDF 新 html API 从 html 生成 pdf 时给出宽度、高度、x 和 y 坐标
我一直在使用 JSPDF 来生成基于一些 html 的 pdf 文档。早些时候使用来自HTML Api的jspdf,我们可以像这样给出边距
但是,在新的 .html API 中,我如何提供边距、宽度和高度。新的 API 就像
batch-file - 将文本从一个文件复制到另一个文件的批处理问题,没有空格
我有一个奇怪的问题。我认为我的代码在 3 天前就可以工作,我对此非常确定。但是从昨天开始它给了我错误,而源代码没有任何改变。
我想将文本文件中的文本复制到另一个文本文件但没有空格。因此,如果我的原始文本文件有 3 个空格(因此仅包含制表符或“”的行),则新文件中应该有 0。这是我的代码:
但是在备份文件中它仍然给我空白,即使我认为它们被“如果定义的行”部分消除了。我似乎无法理解这里有什么问题,因为我认为for /f
跳过了空格?
谢谢你的帮助!
php - 如何在 php 函数中设置和传递关联数组
数据库中有三个表:
A-用户输入一个词,我们应该在股票表中搜索以找到名称中包含该词的股票并获取其ID
B- 在 stock-seller 表中搜索,找到哪个卖家有这些股票要出售,并获取卖家的消息
C-在 Stocks 表中搜索以查找卖方要出售的股票的描述
D- 打印卖方的信息和他们必须出售的股票,如下所示:
我的代码如下:但问题是我无法将每个卖家的消息和库存分开,并且每个库存都打印了多次卖家的消息,并且打印的卖家库存是混合的
我想我应该使用数组,但我不知道如何
它在一条消息中打印卖家 1 的消息和 stock1 的描述,然后是卖家 2 的消息和 stock1 的描述,然后是卖家 1 的消息和 stock2 的描述,然后是卖家 2 的消息和 stock2 的描述,而我想要每个卖家有一条单独的消息,其中包含他们的消息和股票
angular - 在 Ionic 4 中从一个选项卡移动到另一个选项卡时如何清除嵌套的子路由
我正在使用 Ionic 4 应用程序,并且我有特定选项卡的子路由。
我正在尝试当用户从 tab1 的子路由移动到 tab2 并且当用户来到 tab1 时,它应该打开 tab1 页面而不是 tab1 的子路由。
这是tabs.router.module.ts:
当我从任何选项卡的子路径移动到另一个选项卡时,当我移动到该选项卡时,它将打开从我移动到另一个选项卡的子路径。
我希望当用户从任何选项卡的子路径移动到另一个选项卡并返回到该选项卡时,它应该打开该选项卡而不是子选项卡。
就像当用户从 tab1>progresspage 移动到 tab2 时,当它点击 tab1 时,它应该打开 tab1 页面而不是 progresspage 页面。
任何帮助深表感谢。