小编Dom*_*que的帖子

如何使用命令提示符 echo 命令编写带双引号的 XML 标记

我想使用 CMD 批处理文件将最简单的标签添加到文件中,但双引号似乎破坏了聚会:

\n\n

从其他 StackOverflow 帖子中,我知道双引号状态机和 ^" (^ 作为转义字符)的用法。但我仍然无法使其工作:
\n以下是我的尝试(及其结果):

\n\n
C:\\>echo <tag variable="value">  // very na\xc3\xafve\nThe syntax of the command is incorrect.\n\nC:\\>echo "<tag variable="value">"  // let\'s use quotes for delimiting the string\n"<tag variable="value">"\n\nC:\\>echo "<tag variable=^"value^">" // let\'s use the escape character\nThe system cannot find the path specified.\n\nC:\\>echo "<tag variable=^"value^"> // what if the state machine is not switched back?\nThe syntax of the command is incorrect.\n\nC:\\>echo "<tag variable=^"value"> // desperate people do weird things :-)\n"<tag variable=^"value">\n
Run Code Online (Sandbox Code Playgroud)\n\n

我还使用标签字符 < …

xml cmd escaping batch-file double-quotes

2
推荐指数
1
解决办法
2886
查看次数

Windows 7任务调度程序注销

早上好,
我正在使用Windows 7计算机.
每当我从系统中注销时,我都希望我的计算机能够警告我一些我不会忘记的事情.

为了做到这一点,我正在考虑"Windows任务计划程序".
但是,在可能的触发器列表("开始任务"组合框)中,我只看到以下可能性:

  • 按计划(确定日期/时间)
  • 登录时(登录PC时)
  • 启动时(启动PC时)
  • 在空闲时(当PC没有被其他任务占用时,我推测)

我没有看到"At log off"或"At shutdown"的可能性.

有没有人知道是否可以添加这种可能性(可能通过处理注册表)?

由于
多米尼克

scheduled-tasks windows-7

2
推荐指数
1
解决办法
6607
查看次数

subprocess.Popen 输出:如何克服命令行执行的差异

我正在编写一个 Python 脚本来比较两个文件。因此,我选择作为外部程序使用grep,启动以下两个命令:

grep -Fvf content1.txt content2.txt
grep -Fvf content2.txt content1.txt
Run Code Online (Sandbox Code Playgroud)

从这些命令的结果中可以看出差异,我可以通过计算行数来提取差异量。

为了在 Python 脚本中执行此操作,我将这些grep命令嵌入到subprocess.Popen()函数中:

try:
    output1, errors1 = subprocess.Popen(
        ["c:\\cygwin\\bin\\grep", "-Fvf", "content1.txt", "content2.txt"],
        shell=True, stdout=PIPE, stderr=PIPE).communicate()

    output2, errors2 = subprocess.Popen(
        ["c:\\cygwin\\bin\\grep", "-Fvf", "content2.txt", "content1.txt"],
        shell=True, stdout=PIPE, stderr=PIPE).communicate()

    if (len(output1) + len(output2) + len(errors1) + len(errors2) > 0):
        print("Result : there are differences:")

        if (len(output1) + len(output2) > 0):
            print("  Output differences : ")
            print(output1)
            # print (str(str(output1).count('\n'))); (*)
            print(output2)
            # print (str(str(output2).count('\n'))); (*) …
Run Code Online (Sandbox Code Playgroud)

python grep cygwin subprocess python-3.x

1
推荐指数
1
解决办法
4417
查看次数

如何处理子函数中的const传播

我需要修改现有函数,有一些const输入参数:

int f(const owntype *r1, const owntype *r2)
Run Code Online (Sandbox Code Playgroud)

为了做到这一点,我想调用一个使用相同类型但没有const关键字的子函数:

void subfunction (owntype *src, owntype *dst)
Run Code Online (Sandbox Code Playgroud)

我已经尝试了这个(以及其他一些变体),但它不起作用:

int f(const owntype *r1, const owntype *r2) {
  ...
  subfunction((const owntyp*) r1);
  ...
}
Run Code Online (Sandbox Code Playgroud)

如何在不需要更改两个函数的parmeter描述的情况下编译它?

c const

1
推荐指数
1
解决办法
72
查看次数

删除 Spacy 下载的模型

通过以下方式下载并链接 spacy 模型(大图)后:

python -m spacy download en_core_web_lg
Run Code Online (Sandbox Code Playgroud)

这是大约 850 Mb 的数据。

它如何在我的 mac 上查找和删除数据(下载的模型)以释放一些空间?

Spacy: 2.0.18  
Python: 3.6.9  
en_core_web_lg: 2.0.0
Run Code Online (Sandbox Code Playgroud)

python nlp pip spacy

1
推荐指数
1
解决办法
4208
查看次数

如何调试Windbg?(如何获取有关Windbg正在做什么的信息)

大多数人都知道,Windbg 可用于调试程序,但现在我想做相反的事情:我想调试我在 Windbg 中所做的事情,让我向您展示原因:

我发现了一个有趣的本机可视化工具,包含以下条目:

<Type Name='CMap&lt;*,*,*,*&gt;'>
  <AlternativeType Name="CMapStringToString"/>                 
  <AlternativeType Name="CMapStringToPtr"/>                    
  <DisplayString>{{size = {m_nCount} }}</DisplayString>         
  <Expand>                                                     
    <CustomListItems>                                          
      <Variable Name='pHashtable' InitialValue='m_pHashTable'/>
      <Variable Name='hashtable_index' InitialValue='0'/>      
      <Variable Name='pList' InitialValue='*m_pHashTable'/>    
      <Variable Name='i' InitialValue='0'/>                    
      <Loop Condition='hashtable_index &lt; m_nHashTableSize'> 
        <Exec>pList = pHashtable[hashtable_index]</Exec>       
        <Loop Condition='pList '>                              
          <Item Name='{i}: [{pList->key}]'>pList->value</Item> 
          <Exec>pList = pList->pNext</Exec>                    
          <Exec>++i</Exec>                                     
        </Loop>                                                
        <Exec>++hashtable_index</Exec>                         
      </Loop>                                                  
    </CustomListItems>                                         
  </Expand>                                                    
</Type>                                                        

<Type Name='CMap&lt;*,*,*,*&gt;' IncludeView='keys'>
  <AlternativeType Name="CMapStringToString::CAssoc"/>
  <AlternativeType Name="CMapStringToPtr::CAssoc"/>
  <DisplayString>{{size = {m_nCount} }}</DisplayString>
  <Expand>
    <CustomListItems>
      <Variable Name='pHashtable' InitialValue='m_pHashTable'/>
      <Variable Name='hashtable_index' InitialValue='0'/>
      <Variable Name='pList' InitialValue='*m_pHashTable'/>
      <Variable Name='i' InitialValue='0'/>
      <Loop Condition='hashtable_index &lt; …
Run Code Online (Sandbox Code Playgroud)

windbg visual-studio natvis

1
推荐指数
1
解决办法
374
查看次数

从网络驱动器中删除文件的批处理文件命令

我正在尝试定期从共享驱动器中删除应用程序日志,

ForFiles /p "\\netapp-1\Transfers\Logs\QA" /s /d -15 /c "cmd /c del @file"
Run Code Online (Sandbox Code Playgroud)

当路径是我的本地驱动器时,上述命令有效,但不适用于共享驱动器,任何帮助将不胜感激。

干杯!

windows cmd unc batch-file

1
推荐指数
1
解决办法
6879
查看次数

Windbg 脚本将命令的结果分配给变量

我需要定期以相同的方式调查转储文件,并且我想自动执行此操作。我正在使用 Windbg 作为工具,并且正在考虑使用 Windbg 脚本。

我已经对 PYKD 进行了一些初步尝试,但我不太喜欢这种开销,因此我选择了标准 Windbg 脚本,但这正在陷入一场噩梦,让我向您展示我想要做什么:

0:001> kb
 # RetAddr           : Args to Child                                                           : Call Site
00 00007ffc`26272685 : ffffffff`fffffffe 00007ff7`06e563f0 00007ff7`00000000 0000005a`1fb6fd70 : user32!NtUserGetMessage+0xa
01 00007ff7`06d87596 : 00000000`00000008 00007ff7`06e5d048 00000000`00007c1c 0000005a`00000004 : user32!GetMessageW+0x25
02 00007ff7`06d87673 : 0000005a`1f2b3710 00007ff7`06e5c7d0 0000005a`1f2ac270 00000000`00000002 : <Application>!CServiceModule::Run+0x8ee [sourcefile.cpp @ 1905] 
03 00007ffc`26875ada : 00000000`00000000 00000000`00000000 00000000`00000000 00000000`00000000 : <Application>!CServiceModule::ServiceMain+0x63 [sourcefile.cpp @ 1379] 
04 00007ffc`26ef13d2 : 00007ffc`26875aa0 0000005a`1f2ac270 00000000`00000000 00000000`00000000 : sechost!ScSvcctrlThreadA+0x3a
05 00007ffc`270454f4 : 00007ffc`26ef13b0 00000000`00000000 00000000`00000000 00000000`00000000 : …
Run Code Online (Sandbox Code Playgroud)

debugging scripting windbg dump

1
推荐指数
1
解决办法
1824
查看次数

为什么 SqlDataReader 似乎修改了它的数据类型?

这个问题是这个DBA相关问题之后的下一步

我现在有以下 C# 代码,基于变量SqlCommand sqlCommandSqlDataReader sqlDataReader.

我正在运行这段代码:

// What's the max difference of two "Own_Table" tupples for "Field_Name" column?
sqlCommand.CommandText = $"SELECT MAX(val - lag_value) FROM " + 
                         $" (SELECT t.{Field_Name} AS val,LAG(t.{Field_Name}) " +
                         $"    OVER(ORDER BY t.{Field_Name}) as lag_value " +
                         $"  FROM {Own_Table} t) AS tmp " +
                         $"WHERE lag_value IS NOT NULL";
sqlCommand.Parameters.Clear();
sqlDataReader = sqlCommand.ExecuteReader();
long max_value = 0;
while (sqlDataReader.Read())
{
    max_value = sqlDataReader.GetInt32(0); <== sometimes NOK …
Run Code Online (Sandbox Code Playgroud)

c# sql-server sqldatareader

1
推荐指数
1
解决办法
44
查看次数

如何创建仅在大于指定文件大小的文件上执行的 for 循环?

我想将大于 500MB 的 mp4 文件分割成小于 500MB 的片段。

如何创建 for 循环来迭代文件目录,运行

mp4box -splits 500000 input.mp4
Run Code Online (Sandbox Code Playgroud)

每个大于 500 MB 的文件?

(循环部分不是问题。文件大小部分的测试是问题。)

macos bash zsh find

1
推荐指数
1
解决办法
491
查看次数