command

How do you only build a file's project using Visual Studio's Command Window?

a 夏天 提交于 2020-01-15 03:24:09
问题 Ctrl-Shift-B, by default, builds an entire solution. An entire solution may contain many projects. Compiling all at the same time may be very slow, especially when development is only occurring on a single project. I have tried t remap Ctrl-Shift-B to Build.BuildOnlyProject, but it does not work. Nothing happens. From the menu, the following option does exactly what I want: Build -> Build [MY PROJECT NAME] 回答1: The command is Build.BuildSelection To bind that to a key, click Tools | Customize

RoutedCommands that use tunneling instead of bubbling

可紊 提交于 2020-01-14 16:34:38
问题 I have a custom control ( MyControl ) that exposes a custom command. I want the parent Window to be able to invoke this command, and all MyControls should react to it. I have added the command to MyControl 's CommandBindings collection, which also provides a CanExecute callback that always returns true. My problem is that a menu item that invokes this command never gets enabled. I'm presuming this is because the menu is above the MyControls in the visual tree, but to be honest I'm a little

Python: Use input from another command

馋奶兔 提交于 2020-01-14 10:39:09
问题 I am wondering how can I manage input from another command from a python script. Example: $ cat myfile.txt | my_python_script.py How can my script manage the input stream from the cat command ? How Can I get an input from this piped commands ? ... Thanks a lot. 回答1: An easy and quite versatile way to accomplish this is to use the fileinput module. import fileinput for line in fileinput.input() # do things with line This way you can both use the script in a pipeline (as you need to right now)

Want to hide the cmd prompt screen

会有一股神秘感。 提交于 2020-01-14 08:54:22
问题 I have developed a utility which will get time of all servers in the list. System.Diagnostics.Process p; string server_name = ""; string[] output; p = new System.Diagnostics.Process(); p.StartInfo.FileName = "net"; p.StartInfo.UseShellExecute = false; p.StartInfo.RedirectStandardOutput = true; p.StandardOutput.ReadLine().ToString() While executing this code. Cmd prompt screens are coming. I want to hide it from the user. What can I do for it? 回答1: You can tell the process to use no window or

How to create custom commands in VSCode?

和自甴很熟 提交于 2020-01-14 08:52:38
问题 In Emacs, I can create functions in Lisp language and place them in .emacs file. Those function will become commands that can be called from the editor or bound to keys just like any other built-in command. Is there a way to do that in VSCode? Note: The custom commands need to be able to call other commands. Simply using a batch file and running it as a task will not work. 回答1: A few marketplace extensions may be of interest: https://marketplace.visualstudio.com/items?itemName=mkloubert.vs

How to use findstr to search for multiple strings in one line

本秂侑毒 提交于 2020-01-14 03:35:09
问题 So I want to be able to search for the string "[ FAILED ]" and the string "." that are both on the same line inside of a text file. How would I do this? I tried this: FINDSTR /C:"[ FAILED ]" /C:"." output_.txt but it produces lines that contain either of the strings. If possible I also want to be able to exclude any lines that contain numbers from my finds. 回答1: I have answered my own question using piping and coming up with the following command: FINDSTR /C:"[ FAILED ]" output_.txt | FINDSTR

What exactly the cmds.scriptCtx in Maya Python does?

只愿长相守 提交于 2020-01-13 16:14:29
问题 I'm wondering what exactly the cmds.scriptCtx command does, cuz I've tried to copy and paste it directly from the Autodesk help page to my script editor and nothing happened. Here's the script from Autodesk help: import maya.cmds as cmds cmds.scriptCtx( title='Attach Curve', totalSelectionSets=1, fcs="select -r $Selection1; performAttachCrv 0 \"\"", cumulativeLists=True, expandSelectionList=True, setNoSelectionPrompt='Select two curves close to the attachment points', setSelectionPrompt=

PHP exec in background using & is not working

不羁的心 提交于 2020-01-13 14:04:13
问题 I am using this code on Ubuntu 13.04, $cmd = "sleep 20 &> /dev/null &"; exec($cmd, $output); Although it actually sits there for 20 seconds and waits :/ usually it works fine when using & to send a process to the background, but on this machine php just won't do it :/ What could be causing this?? 回答1: Try <?PHP $cmd = '/bin/sleep'; $args = array('20'); $pid=pcntl_fork(); if($pid==0) { posix_setsid(); pcntl_exec($cmd,$args,$_ENV); // child becomes the standalone detached process } echo "DONE\n

Windows service custom commands from command line

十年热恋 提交于 2020-01-13 06:32:25
问题 I've implemented a Windows Service with custom commands overriding OnCustomCommand method. I can access these custom commands from another .net application with: ServiceController Controller = new ServiceController("MyWindowsService"); if (Controller.Status == ServiceControllerStatus.Running) { Controller.ExecuteCommand(128); } But, can I access these custom commands from the command line (cmd) the same way I can start/stop/... the service? EDIT: (Without creating a middleware application to

Preventing management commands from running more than one at a time

大憨熊 提交于 2020-01-13 05:56:26
问题 I'm designing a long running process, triggered by a Django management command, that needs to run on a fairly frequent basis. This process is supposed to run every 5 min via a cron job, but I want to prevent it from running a second instance of the process in the rare case that the first takes longer than 5 min. I've thought about creating a touch file that gets created when the management process starts and is removed when the process ends. A second management command process would then