shell进程的并行执行

2024-05-02

有没有一个工具可以在 Windows 批处理文件中并行执行多个进程?我发现了一些有趣的 Linux 工具(parallel http://mi.eng.cam.ac.uk/~er258/code/parallel.html and PPSS http://code.google.com/p/ppss/),但是,我需要一个适用于 Windows 平台的工具。

奖励:如果该工具还允许在多台计算机之间以简单的方式分发进程,并远程运行进程,那就太好了PsExec http://technet.microsoft.com/de-de/sysinternals/bb897553.aspx.

示例:我希望在下面的 for 循环中

for %F in (*.*) do processFile.exe %F

有限数量的 processFile.exe 实例并行运行以利用多核 CPU。


Edit - 我修改了脚本以选择性地显示每个进程的输出

这是一个本机批处理解决方案,可以可靠地并行运行命令列表,永远不会启动超过n一次处理。

它甚至有一个内置机制,可以通过 PSEXEC 将进程分发到特定的 CPU 或远程计算机,但我尚未测试该功能。

完成这项工作的技巧是通过 CMD 进程启动每个命令,该进程将 stdout 或未定义的句柄重定向到锁定文件。该进程将保持文件上的独占锁,直到其终止。无论进程如何终止(正常退出、崩溃、进程被杀死),锁都会立即释放。

主脚本可以通过尝试重定向到同一锁定文件来测试进程是否仍处于活动状态。如果进程仍处于活动状态,则重定向将失败;如果进程已终止,则重定向将成功。

默认情况下,脚本忽略每个进程的输出。如果开始于/O选项作为第一个参数,然后它显示每个进程的输出,没有交错。

我的演示将进程限制设置为 4,并简单地运行一系列不同长度的 PING 命令。

我已经在 XP、Vista 和 Windows 7 上对此进行了测试。

@echo off
setlocal enableDelayedExpansion

:: Display the output of each process if the /O option is used
:: else ignore the output of each process
if /i "%~1" equ "/O" (
  set "lockHandle=1"
  set "showOutput=1"
) else (
  set "lockHandle=1^>nul 9"
  set "showOutput="
)

:: The list of commands could come from anywhere such as another file
:: or the output of another command. For this demo I will list the
:: commands within this script - Each command is prefixed with :::
::: ping /n 05 ::1
::: ping /n 20 ::1
::: ping /n 10 ::1
::: ping /n 15 ::1
::: ping /n 07 ::1
::: ping /n 05 ::1
::: ping /n 20 ::1
::: ping /n 10 ::1
::: ping /n 15 ::1
::: ping /n 07 ::1

:: Define the maximum number of parallel processes to run.
:: Each process number can optionally be assigned to a particular server
:: and/or cpu via psexec specs (untested).
set "maxProc=4"

:: Optional - Define CPU targets in terms of PSEXEC specs
::           (everything but the command)
::
:: If a CPU is not defined for a proc, then it will be run on the local machine.
:: I haven't tested this feature, but it seems like it should work.
::
:: set cpu1=psexec \\server1 ...
:: set cpu2=psexec \\server1 ...
:: set cpu3=psexec \\server2 ...
:: etc.

:: For this demo force all CPU specs to undefined (local machine)
for /l %%N in (1 1 %maxProc%) do set "cpu%%N="

:: Get a unique base lock name for this particular instantiation.
:: Incorporate a timestamp from WMIC if possible, but don't fail if
:: WMIC not available. Also incorporate a random number.
  set "lock="
  for /f "skip=1 delims=-+ " %%T in ('2^>nul wmic os get localdatetime') do (
    set "lock=%%T"
    goto :break
  )
  :break
  set "lock=%temp%\lock%lock%_%random%_"

:: Initialize the counters
  set /a "startCount=0, endCount=0"

:: Clear any existing end flags
  for /l %%N in (1 1 %maxProc%) do set "endProc%%N="

:: Launch the commands in a loop
:: Modify the IN () clause as needed to retrieve the list of commands
  set launch=1
  for /f "tokens=* delims=:" %%A in ('findstr /b ":::" "%~f0"') do (
    if !startCount! lss %maxProc% (
      set /a "startCount+=1, nextProc=startCount"
    ) else (
      call :wait
    )
    set cmd!nextProc!=%%A
    if defined showOutput echo -------------------------------------------------------------------------------
    echo !time! - proc!nextProc!: starting %%A
    2>nul del %lock%!nextProc!
    %= Redirect the lock handle to the lock file. The CMD process will     =%
    %= maintain an exclusive lock on the lock file until the process ends. =%
    start /b "" cmd /c %lockHandle%^>"%lock%!nextProc!" 2^>^&1 !cpu%%N! %%A
  )
  set "launch="

:wait
:: Wait for procs to finish in a loop
:: If still launching then return as soon as a proc ends
:: else wait for all procs to finish
  :: redirect stderr to null to suppress any error message if redirection
  :: within the loop fails.
  for /l %%N in (1 1 %startCount%) do 2>nul (
    %= Redirect an unused file handle to the lock file. If the process is    =%
    %= still running then redirection will fail and the IF body will not run =%
    if not defined endProc%%N if exist "%lock%%%N" 9>>"%lock%%%N" (
      %= Made it inside the IF body so the process must have finished =%
      if defined showOutput echo ===============================================================================
      echo !time! - proc%%N: finished !cmd%%N!
      if defined showOutput type "%lock%%%N"
      if defined launch (
        set nextProc=%%N
        exit /b
      )
      set /a "endCount+=1, endProc%%N=1"
    )
  )
  if %endCount% lss %startCount% (
    1>nul 2>nul ping /n 2 ::1
    goto :wait
  )

2>nul del %lock%*
if defined showOutput echo ===============================================================================
echo Thats all folks^^!

以下是忽略进程输出的示例运行的输出

12:24:07.52 - proc1: starting  ping /n 05 ::1
12:24:07.52 - proc2: starting  ping /n 20 ::1
12:24:07.53 - proc3: starting  ping /n 10 ::1
12:24:07.54 - proc4: starting  ping /n 15 ::1
12:24:11.60 - proc1: finished  ping /n 05 ::1
12:24:11.60 - proc1: starting  ping /n 07 ::1
12:24:16.66 - proc3: finished  ping /n 10 ::1
12:24:16.66 - proc3: starting  ping /n 05 ::1
12:24:17.68 - proc1: finished  ping /n 07 ::1
12:24:17.68 - proc1: starting  ping /n 20 ::1
12:24:20.72 - proc3: finished  ping /n 05 ::1
12:24:20.72 - proc3: starting  ping /n 10 ::1
12:24:21.75 - proc4: finished  ping /n 15 ::1
12:24:21.75 - proc4: starting  ping /n 15 ::1
12:24:26.82 - proc2: finished  ping /n 20 ::1
12:24:26.82 - proc2: starting  ping /n 07 ::1
12:24:29.86 - proc3: finished  ping /n 10 ::1
12:24:32.89 - proc2: finished  ping /n 07 ::1
12:24:35.92 - proc4: finished  ping /n 15 ::1
12:24:36.93 - proc1: finished  ping /n 20 ::1
Thats all folks!

如果使用以下命令运行,则输出如下/O显示进程输出的选项

-------------------------------------------------------------------------------
12:24:51.02 - proc1: starting  ping /n 05 ::1
-------------------------------------------------------------------------------
12:24:51.02 - proc2: starting  ping /n 20 ::1
-------------------------------------------------------------------------------
12:24:51.03 - proc3: starting  ping /n 10 ::1
-------------------------------------------------------------------------------
12:24:51.04 - proc4: starting  ping /n 15 ::1
===============================================================================
12:24:55.10 - proc1: finished  ping /n 05 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
-------------------------------------------------------------------------------
12:24:55.10 - proc1: starting  ping /n 07 ::1
===============================================================================
12:25:00.17 - proc3: finished  ping /n 10 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
-------------------------------------------------------------------------------
12:25:00.19 - proc3: starting  ping /n 05 ::1
===============================================================================
12:25:01.22 - proc1: finished  ping /n 07 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 7, Received = 7, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
-------------------------------------------------------------------------------
12:25:01.23 - proc1: starting  ping /n 20 ::1
===============================================================================
12:25:04.27 - proc3: finished  ping /n 05 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 5, Received = 5, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
-------------------------------------------------------------------------------
12:25:04.28 - proc3: starting  ping /n 10 ::1
===============================================================================
12:25:05.30 - proc4: finished  ping /n 15 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 15, Received = 15, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
-------------------------------------------------------------------------------
12:25:05.32 - proc4: starting  ping /n 15 ::1
===============================================================================
12:25:10.38 - proc2: finished  ping /n 20 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 20, Received = 20, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
-------------------------------------------------------------------------------
12:25:10.40 - proc2: starting  ping /n 07 ::1
===============================================================================
12:25:13.44 - proc3: finished  ping /n 10 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 10, Received = 10, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
===============================================================================
12:25:16.48 - proc2: finished  ping /n 07 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 7, Received = 7, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
===============================================================================
12:25:19.52 - proc4: finished  ping /n 15 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 15, Received = 15, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
===============================================================================
12:25:20.54 - proc1: finished  ping /n 20 ::1

Pinging ::1 with 32 bytes of data:
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms
Reply from ::1: time<1ms

Ping statistics for ::1:
    Packets: Sent = 20, Received = 20, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 0ms, Maximum = 0ms, Average = 0ms
===============================================================================
Thats all folks!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

shell进程的并行执行 的相关文章

  • SidBySide:3rd Party Dll 指的是 MSVCR80.DLL 的两个版本

    我们包含了一个 3rd Party lib DLL 最近在安装时造成了很多麻烦 使用依赖步行者 http www dependencywalker com 我们发现dll本身引用了两个不同版本的 MSVCR80 DLL Version 8
  • 如何使用 Python 与窗口的 GUI 交互?

    假设您想打开myapp exe 打开第三个菜单 然后选择第二个菜单项 即像用户使用键盘或鼠标一样 然后在对话框窗口中选择第二个按钮 pyahk https pyahk readthedocs io en latest and pyautog
  • NTFS 连接点和符号链接有什么区别?

    在高水平上 两者之间唯一明显的区别NTFS 连接点 http msdn microsoft com en us library windows desktop aa365006 aspx and 符号链接 http msdn microso
  • Windows 上的 Node.js 和 Express

    今晚 我决定尝试在我的 Windows 7 计算机上使用 Express 构建一个简单的 Node js 应用程序 安装过程还算顺利 但 Express 拒绝配合 以下是我已采取的步骤 使用以下位置提供的 MSI 安装 Node jshtt
  • 每个进程每个线程的时间量

    我有一个关于 Windows 和 Linux 中进程和线程的时间量子的问题 我知道操作系统通常为每个线程提供固定的时间量 我知道时间量根据前台或后台线程而变化 也可能根据进程的优先级而变化 每个进程有固定的时间量吗 例如 如果操作系统为每个
  • VBscript 以提升的权限运行 bat 文件

    这是我的bat文件 REG DELETE HKLM Software Microsoft Windows CurrentVersion WindowsUpdate v SusClientId f REG DELETE HKLM Softwa
  • 使用 Windows 命令行连接文本文件,删除前导行

    我需要连接一些相对较大的文本文件 并且更喜欢通过命令行来完成此操作 不幸的是我只有Windows 无法安装新软件 type file1 txt file2 txt gt out txt 允许我几乎得到我想要的 但我不希望 file2 txt
  • 使用 mingw32 在 Windows 上构建 glew 时“DllMainCRTStartup@12”的多个定义

    我关注了这个主题 使用 mingw 使建筑物在 Windows 上闪闪发光 https stackoverflow com questions 6005076 building glew on windows with mingw 6005
  • 满足条件时终止所有进程

    我正在使用星图来运行测试功能 当进程首次找到排列 5 2 4 3 1 时 终止所有进程的最佳 最安全方法是什么 import multiprocessing as mp import time def testing lts code st
  • 如何在安装过程中运行“.bat”文件?

    在安装项目中 诸如 exe dll js vbs 之类的可执行文件是可以接受的 但无法运行 bat自定义操作中的文件 问题是如何运行 bat安装过程中的文件 好吧 经过大量搜索和反复试验 我解决了这个问题 我不确定这是否是最好的方法 但它确
  • Windows 和 python 3.2 的 Pylint 安装问题

    当我尝试使用 pip 在 Windows 上安装 pylint 时 我遇到了这个问题 我真的不知道它来自哪里 C Python33 Scripts gt pip exe install pylint Downloading unpackin
  • 为 Windows 98 编译 Qt

    我需要支持 Windows 98 Qt 文档声称这是可能的 但没有说明 Qt 4 6 的分布式二进制文件不能在 Win98 上运行 而且我采样的大多数 Qt 应用程序也不能在 Win98 上运行 对于几个确实在 98 上运行的应用程序 我询
  • uri 警告中缺少端口:使用 Python OpenCV cv2.VideoCapture() 打开文件时出错

    当我尝试流式传输 ipcam 时 出现了如下所示的错误 tcp 000000000048c640 uri 中缺少端口 警告 打开文件时出错 build opencv modules videoio src cap ffmpeg impl h
  • 如何获取Windows批处理的父文件夹

    我正在编写一个批处理文件 我需要获取该bat文件的父文件夹 有可能吗 注意 我的意思是批处理文件的父文件夹 而不是调用该批处理的提示的当前目录 Thanks 批处理的父文件夹位于变量中 dp0位于 例子 echo off setlocal
  • xsel -o 对于 OS X 等效项

    是否有一个等效的解决方案可以在 OS X 中抓取选定的文本 就像适用于 Linux 的 xsel o 一样 只需要当前的选择 这样我就可以在 shell 脚本中使用文本 干杯 埃里克 你也许可以安装xsel在 MacOS 上 更新 根据 A
  • Boost + Visual Studio 2010 + Windows 平台 SDK 7.1

    有人可以告诉我 bjam 的命令行开关或其他可以使用新的 Windows Platform SDK 7 1 工具链使用 VS2010 进行 boost 编译的东西吗 您可以在普通的视觉工作室项目中设置该选项 默认值是 v100 是平台 7
  • 使用 BitmapEncoder 生成时如何使 GIF 循环重复

    我能够使用 BitmapEncoder C WinRT 创建动画 gif 但是 我一直无法弄清楚如何让GIF循环回来并从头开始 没有尝试太多 因为我不确定要尝试什么 搜索了更多要在 GIF 上设置的属性 但找不到任何相关内容 好吧 终于能弄
  • 如何使用 python 在 Windows 中禁用/启用特定 USB 端口? [关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我想在图形窗口中创建一个切换开关 可以使用 python 禁用 启用 Windows 中的特定 USB 端口 我可以使用哪个外部命令或
  • 哪个版本的 Miniconda 具有适用于 Windows 64 位的 Python 3.6?

    我正在开发一个需要这些深度学习库的项目 keras 和 tensorflow 不幸的是 这些不适用于 Python 3 7 有人可以告诉我一个带有 Python 3 6 的 Miniconda 版本 适用于 Windows 64 位 吗 我
  • Bash 解析和 shell 扩展

    我对 bash 解析输入和执行扩展的方式感到困惑 对于输入来说 hello world 作为 bash 中的参数传递给显示其输入内容的脚本 我不太确定 Bash 如何解析它 Example var hello world displaywh

随机推荐

  • Angular 4 - 请在您的应用程序中包含“BrowserAnimationsModule”或“NoopAnimationsModule”

    当我在浏览器上启动 Angular 应用程序时遇到问题 一切都可以用代码说话 但我仍然收到此错误 发现合成性质 routerAnimations 请包括其中之一BrowserAnimationsModule or NoopAnimation
  • 使用迭代器将部分文件流读入字符串

    这是我到目前为止所尝试过的但没有成功 std string ReadPartial std ifstream file int size std istreambuf iterator
  • 为什么 selenium chromedriver 使用的资源比常规 chrome 少

    我注意到 当通过 selenium chromedriver 使用新的用户数据目录启动 chrome 时 它 使用的资源 cpu 内存和磁盘 比正常启动时要少得多 我能够找到的原因之一是 selenium chromedriver 启动时带
  • Flutter如何使用ListTile Threeline

    Flutter时使用ListTile ThreeLines 不知道如何使用ThreeLine import package flutter material dart void main gt runApp MyApp class MyAp
  • 将 KB/MB/GB 等字符串解析为数值

    为了不发明自行车 我想知道是否有任何库能够将大小字符串 MB KB TB MiB KiB 等 的各种表示形式解析为基于数字字节的值 ActiveState Receipes 有一个示例here http code activestate c
  • 二维数组列表

    我听说过使用这样的二维数组 String strArr 但是有什么方法可以用列表来做到这一点吗 也许是这样的 ArrayList
  • 如何将指针传递给函数并在函数 C++ 中动态分配内存

    我试图声明一个指针并将该指针传递给分配内存的函数 这是一个最小的例子 include
  • iOS SDK - 在蒙版图像上添加阴影

    如何在上面添加阴影UIImageView哪个有蒙版图像 我不是指矩形阴影 我也想对阴影应用相同的遮罩效果 给 UIImageView 提供阴影效果尝试下面的代码 1 import
  • 在 python 中返回 self [关闭]

    Closed 这个问题需要多问focused help closed questions 目前不接受答案 我有一个代表对象的类 我有很多方法可以修改这个对象状态 没有明显的返回或显然没有任何返回 在 C 中 我会将所有这些方法声明为void
  • 如何在jpanel上延迟显示图片?

    这是我遇到问题的代码部分 我应该每 5 秒显示一次图片 但它不起作用 我希望你能帮忙 谢谢 编辑 5秒后所有图片一起显示 JButton btnGenerateNumber new JButton Generate Number btnGe
  • AWS Lambda - 在区域之间自动复制 EC2 快照?

    我想创建一个 Lambda 函数 python 它将自动将已创建的快照复制到另一个区域 我已联系 AWS Support 他们只向我发送了用于 RDS 数据库的 GitHub 脚本 没有 EC2 快照复制脚本 任何帮助都会很棒 谢谢 是的
  • 使用自定义元素类在 Python 中解析 xml

    我想使用 Python 的 xml etree ElementTree 模块解析 xml 文档 但是 我希望生成的树对象中的所有元素都具有我定义的一些类方法 这建议创建我自己的 Python 元素类的子类 但我无法告诉解析器在解析时使用我自
  • 如何从 Emacs 中运行 Cygwin Bash Shell?

    我在 Windows 上运行 GNU Emacs 因此输入 M x shell 启动 Windows 命令行 DOS shell 但是 我希望能够从 Emacs 中运行 Cygwin Bash Shell 或任何其他非 Windows sh
  • android studio 中 xml 文件的设计预览无法“打开”

    我在制作一个 Android 项目时遇到了一个问题 更新 android studio 后 我的 xml 文件之一设计预览将无法打开 我收到 2 个错误 我已经寻找了解决方案 并且已经尝试了很多我在网上找到的东西 但都没有改变这种情况 第一
  • 从 Rcpp C++ 函数获取 r 函数参数

    我在 R 端定义了一个函数 如下所示 foo lt function arg1 arg2 arg3 以及使用 Rcpp 的 C 函数 该函数获取全局环境并实例化 R 函数以从该函数执行它 这是代码 namespace Rcpp void m
  • 使用 javascript 获取选择标签的名称

    我在任何地方都没有找到这个问题 所以我将其发布在这里 我有一堆选择标签 部分使用 VBScript 命名 我希望能够获取从 javascript 中的 onchange 事件调用的选择标签的名称 这是代码
  • 向项目添加资源的设计

    我有课Project Resource and File where A Project包含列表资源 Each Resource包含以下列表Files特定类型的 这被映射到 XML
  • 在基于 RESTful 的应用程序中管理状态

    我们正在评估用于基于 Web 的应用程序的技术 一些建议是采用基于 RESTful 的服务方法 技术堆栈 1 春天 2 Apache CXF JAX RS 我的问题是 1 如何在请求之间管理状态 例如 用户已经过身份验证 现在他正在发出一系
  • Python 3:如何更改GDAL中的图像数据?

    我有一个 GeoTIFF 图像 其中包含颜色表和带有 8 位表键的单个栅格带 并且使用 LZW 压缩 我加载该图像gdal Open https gdal org python osgeo gdal module html 我还有一个包含
  • shell进程的并行执行

    有没有一个工具可以在 Windows 批处理文件中并行执行多个进程 我发现了一些有趣的 Linux 工具 parallel http mi eng cam ac uk er258 code parallel html and PPSS ht