w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Pycharm unit test interactive debug command line doesn't work
This is likely because your test runner is capturing stdout but not stderr. I use py.test which captures both stdout and stderr so I see no output at all. If I want to see output I have to pass the -s flag to my py.test runner which can be done by modifying the run/debug configuration and adding this flag to the options field. (Run > Edit Configurations > Defaults > Python tests > py.test > add -s to the options field.) >>> print 'a' a >>> import sys >>> sys.stderr.write('moof') moof>>> sys.stdout.write('moof') moof>>> sys.stderr.write('test') test Note: the -s flag can equally be used with nose tests

Categories : Unit Testing

Running commands in three command prompts automatically?
Write a batch file (start.bat) and inside write start command1.exe start command2.exe start command3.exe this will open 3 console windows and execute corresponding command at the same time

Categories : Windows

Run a few command line commands from c++
Try checking out the boost::filesystem library. (http://www.boost.org/doc/libs/1_54_0/libs/filesystem/doc/index.htm) All three of your requests are covered in the tutorial.

Categories : C++

Running shell commands in GVim without echoing the Vim command
You could try the :redir command: *:redi* *:redir* :redi[r][!] > {file} Redirect messages to file {file}. The messages which are the output of commands are written to that file, until redirection ends. The messages are also still shown on the screen. When [!] is included, an : : To stop the messages and commands from being echoed to the screen, put the commands in a function and call it with ":silent call Function()". An alternative is to use the 'verbosefile' option, this can be used in combination with ":redir". I haven't tested, but

Categories : Shell

how can execute nagios commands from command line in linux
You actually have the answer in your config - just execute in shell: /usr/lib/nagios/plugins/check_http -H site1.dreaddomain.com You may add -v for verbose output. Nagios is only a scheduler and executes commands at specified intervals. Then reports the state based on response.

Categories : Linux

How do I pass raw strings to commands through the command line in PowerShell?
If you are using Powershell v3.0, there is a new syntax to make Powershell avoid any extra parsing for arguments. Something like: inventory.exe --% 'inventory', 'date', 'owner' There are other approaches as mentioned here: http://blogs.technet.com/b/josebda/archive/2012/03/03/using-windows-powershell-to-run-old-command-line-tools-and-their-weirdest-parameters.aspx

Categories : Powershell

Ruby thor command line tool commands
In the case of git clone the way it works is that git program is executed and clone is passed to it as a parameter. So, if you have several scripts that should be started in a similar manner, you can create a small launcher. This code is in bash(but the script is sh compatible, so you can safely change the shebang to /bin/sh). It is very easy to write the same thing in any other language. #!/bin/bash command=$1 shift case $1 in cmd1) echo "Executing command #1" ./smallcmd1 "$@" ;; cmd2) echo "Executing command $command" ./smallcmd2 "$@" ;; '') echo 'No option specified' exit 1 ;; *) echo "Invalid option" exit 1 ;; esac exit $? Where smallcmds are your secondary command scripts

Categories : Ruby

How to open any command line program through a swing GUI and pass commands to it?
I would actually avoid passing through the command prompt and directly invoke your command line program. All you have to do is to find where your program is located. A few things to take into consideration: You should execute your command outside the EDT (Event dispatching thread) to avoid GUI-freeze (SwingWorker will do a very good job at it) Rather use ProcessBuilder than RuntimeExec Here is an example of such code which invokes the command java -version (this is only for the example of using the ProcessBuilder API): import java.awt.BorderLayout; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.io.IOException; import java.io.InputStream; import java.io.StringWriter; import java.util.concurrent.ExecutionException; import javax.swing.JButton; impo

Categories : Java

Handling unknown commands with the boost command line parser
try { po::options_description desc("Allowed options"); desc.add_options() ("help,h", "produce help message") ("compression", po::value<int>()->required(), "set compression level") ; po::variables_map vm; po::store(po::parse_command_line(ac, av, desc), vm); po::notify(vm); } catch(std::exception& e) { std::cerr << "Error: " << e.what() << " "; return -1; } catch(...) { std::cerr << "Unknown error!" << " "; return -1; }

Categories : C++

System() / windows Command line commands don't change the directory?
Assuming that the C# tag is accurate, this is not the correct way to do that. Look at the Directory class. Specifically Directory.EnumerateFiles().

Categories : C++

How to execute command line ffmpeg commands programatically in android?
Recently I came across the similar problem. My solution is to simulate a command line in Java program. Firstly, I add a function to the file "ffmpeg.c": int cmd_simulation(int argc, const char** argv) { OptionsContext o = { 0 }; // int64_t ti; reset_options(&o, 0); av_log_set_flags(AV_LOG_SKIP_REPEATED); parse_loglevel(argc, argv, options); if(argc>1 && !strcmp(argv[1], "-d")){ run_as_daemon=1; av_log_set_callback(log_callback_null); argc--; argv++; } avcodec_register_all(); avfilter_register_all(); av_register_all(); avformat_network_init(); //show_banner(argc, argv, options); term_init(); parse_cpuflags(argc, argv, options); /* parse options */ parse_options(&o, argc, argv, options, opt_output_file); if (nb_output_files <= 0 && nb

Categories : Android

How to run two commands in one line in shell script in ggsci command interpreter
Is there some reason you need to this on one line? A here document works fine for me ggs> ggsci <<HERE > DBLOGIN USERID abc, PASSWORD 123 > INFO ALL > HERE Oracle GoldenGate Command Interpreter for Oracle Version 16874194 OGGCORE_11. Solaris, sparc, 64bit (optimized), Oracle 11g on Jun 5 2013 01:15:20 Copyright (C) 1995, 2013, Oracle and/or its affiliates. All rights reserved. GGSCI (foo01) 1> Successfully logged into database. GGSCI (foo01) 2> Program Status Group Lag at Chkpt Time Since Chkpt MANAGER RUNNING REPLICAT ABENDED PERF1REP 00:00:00 01:54:59 GGSCI (foo01) 3> ggs>

Categories : Oracle

How to issue a command from the command line of a process running on Linux
If you don't mind waiting for the calls to finish (one at a time) before returning control to your program, you can use the subprocess library. If you want to start something running and not wait for it to finish, you can use the multiprocessing library.

Categories : Python

How do I set a command-line flag when running a Symfony2 Command test?
disabling debug in the kernel You can initialize the kernel in your test's setUp() method with debug set to false. use SymfonyBundleFrameworkBundleTestWebTestCase; class YourCommandTest extends WebTestCase { public function setUp() { static::$kernel = static::createKernel(array('debug' => false)); static::$kernel->boot(); // ... } Have a look at WebTestCase->createKernel(). using enviroments If you don't want the debug output in your logs edit/create app/config/config_test.yml and edit ... monolog: handlers: file: type: stream level: debug # log-level ... ... to another log level that suits your needs. Then execute your command using the test environment with --env=test

Categories : PHP

WIN2K8: Running two netsh commands in one line; hitting a syntax error
Matt, You're correct that BladeLogic fires up separate shells for each statement, however, depending on what you're trying to achieve, it may be possible to "persuade" it to run a complete script remotely on your target. If you're still facing this issue, please respond with a little more info about what you're trying to achieve and which approaches you've tried, and we can look a the alternatives. -John.

Categories : Windows

visual studio 2012 multiple -commands in command line arguments
If you first want add-pssnapin Registerv2.0 and then New-Token to be called, you should chain them in one command, like so: -command "add-pssnapin Registerv2.0; New-Token" If New-Token expects a parameter, you should pass it on the command line directly, instead of trying to simulate user input. For example, New-Item would expect a list of paths and a type as input, both can also be supplied on the command line as parameters. Like so: New-Item foo -type directory So, how you would pass the value www.google.com to New-Token depends on the name of the parameter. But could look like: -command "add-pssnapin Registerv2.0; New-Token -tokenName www.google.com"

Categories : Visual Studio 2012

Trouble running android command in command line
What Am I missing? You are missing two ~ characters, perhaps. The exact path is /Users/me/Development/adt-bundle/ That's not what you typed into your PATH. Your PATH says that there is no /Users/me -- instead, PATH is expecting a /Development directory in the root of your volume. Now, in Linux, the solution would be to add a ~ to indicate that /Development is relative to your home directory: export PATH=${PATH}:~/Development/adt-bundle/sdk/platform-tools:~/Development/adt-bundle/sdk/tools My OS X shell experience is rusty, so I forget if ~ will map to /Users/me or not. If it does, use ~, otherwise, go with: export PATH=${PATH}:/Users/me/Development/adt-bundle/sdk/platform-tools:/Users/me/Development/adt-bundle/sdk/tools

Categories : Android

How to debug Django commands in PyCharm
After installing ipdb (pip install ipdb) put those lines to debug point: import ipdb ipdb.set_trace() https://pypi.python.org/pypi/ipdb

Categories : Django

Running Perl Script from Command Line?
According to the documentation: Perl Express is not tied to a specific Perl port and should work with any build for Windows. and the system requirements: Windows 98/Me/2000/XP/2003, Perl Interpreter So you, presumably, have a separate Perl distribution already installed somewhere. That should have a perl.exe executable that you can use to run your script.

Categories : Perl

Running a function that prompts from command line
You can pass arguments to your python program via the sys.argv list. They are passed in as strings, similar to C's argc,argv convention. Shell: $ python myprog.py 1 2 1 1 2 4 myprog.py: import sys print [int(x) for x in sys.argv[1:]] As you can see, we are using all of the members of sys.argv except the first. The first member, like argv[0] in C, is the program name. If you already have some function defined in your python program, you can add this to the bottom of the file: if __name__ == '__main__': MyFunction([int(x) for x in sys.argv[1:]]) As an alternative, if you don't want to modify your python program, and it already reads its inputs from the standard input stream, you can use shell programming: echo 1 2 1 1 2 4 | python myprog.py or, depending upon how your prog

Categories : Python

wxpython GUI running a command-line program
I wrote up an article where I did something along the lines that you're talking about. I needed to run ping and traceroute and capture their output in real-time. Here's the article: http://www.blog.pythonlibrary.org/2010/06/05/python-running-ping-traceroute-and-more/ Basically you need to redirect stdout to a text control and then do something like this: proc = subprocess.Popen("ping %s" % ip, shell=True, stdout=subprocess.PIPE) line = proc.stdout.readline() print line.strip() As you can see, I use subprocess to start ping and read its stdout. Then I use the strip() command to remove extra whitespace from the beginning and end of the line before I print it out. When you do the print, it gets redirected to the text control.

Categories : Python

Overhead in running Julia from command-line
Please see the julia-users@googlegroups.com mailing list for questions like these. This one has been answered a few times (possibly also on StackOverflow), so check the archives first. It is also generally a much better way to get current, prompt answers to questions about Julia. Yes, I just checked and it's the first related question: Julia compiles the script everytime?

Categories : Misc

Error while running through command line in springs
There could be many configuration / environmental differences when running maven from Eclipse vs command line: The maven version / path. In Eclipse the actual maven binary can be default / explicitly set via preferences, whereas in command line your OS will pick the first one available on your PATH env var. Check maven version using mvn -version Maven user / global settings.xml. When running through command line typically ~/.m2/settings.xml is used but this can be explicitly overridden on Eclipse preferences Maven local repository cache. If you have discrepancy on 1 and/or 2, you could end up with different local repository cache. Incorrect artifact distribution could cause build to fail if performed against different local repository cache. Eclipse maven could use different version of J

Categories : Spring

Running a Java program in Eclipse as if from command line
You need to go to: Run Configuration > Argument > Program argument. Then copy and paste "inputFile.txt" "inputFile2.txt" inside the box.

Categories : Java

PHP Error encountered when running Command Line using CodeIgniter 2.xx
https://github.com/EllisLab/CodeIgniter/issues/1890 Just replace $_SERVER['REMOTE_ADDR'] with $this->server('remote_addr') at the line that generates the notice. - modify /system/core/Input.php line 351

Categories : PHP

Using and running Tortoise svnsync in Windows via command line
When you install TortoiseSVN you are given the option to install the Subversion binaries as well: Once you do that, you will see svnsync.exe in the installation folder: As long as you have C:Program FilesTortoiseSVNin in your PATH variable, you will be able to call svnsync.exe from the command-line: (You can view your PATH variable thus (on Windows 7): Start -> right-click Computer -> Properties -> Advanced system settings -> Environment variables.... DO NOT overwrite whatever is there - simply append the path to TortoiseSVN if it isn't already there. More info here.) Hope this helps.

Categories : Windows

-nographics alternative for MAC OSx in running unity3d from command line?
The Unity3d -nographics command line option is not available on Mac. You have complete control of the arguments you send to Unity3d through the plugin when specifying the "Editor command line arguments". What are you trying to do exactly ? Note: I am the author of the Unity3DBuilder plugin. So please report any missing feature to the plugin's issue tracker.

Categories : Osx

Getting output from running command line app in Inno Setup
With TLama pointing to the progress bar messages I was able to solve the problem. At first I needed to pass the progress bar handle from Inno to my C# app. For this I created a function that would return me the int-pointer as a string function GetProgressHandle(Param: String): String; begin Result := Format('%d',[WizardForm.ProgressGauge.Handle]); end; and use it in the Run-section when calling my app: [Run] Filename: "{app}myApp.exe"; Parameters: "{code:GetProgressHandle}"; .... In C# I read the int-pointer from the console arguments and use it to create an IntPtr: IntPtr pointer = new IntPtr(Int32.Parse(args[0])); To send the messages to the progress bar I imported user32.dll and re-defined the needed constants, that normally can be found in commctrl.h: [DllImport("user32.dl

Categories : C#

Package error when running r code on command line
RStudio sets a default repository when you call install.packages from within RStudio. When you run the script via the command line, you have to tell R which repository to use (or set a global default repository). You can easily fix this problem by telling R to use your favorite repository. For example, if you want to use RStudio's package repository, set repos="http://cran.rstudio.com/" inside the install.packages call. if (!require("yaml")) { install.packages("yaml", repos="http://cran.rstudio.com/") library("yaml") } This should work!

Categories : R

Display progress of a command line process that is running in MVC
I hope this link will help: Asynchronous processing in ASP.Net MVC with Ajax progress bar You can call Controller's action method and get the status of the process. Controller code: /// <summary> /// Starts the long running process. /// </summary> /// <param name="id">The id.</param> public void StartLongRunningProcess(string id) { longRunningClass.Add(id); ProcessTask processTask = new ProcessTask(longRunningClass.ProcessLongRunningAction); processTask.BeginInvoke(id, new AsyncCallback(EndLongRunningProcess), processTask); } jQuery Code: $(document).ready(function(event) { $('#startProcess').click(function() { $.post("Home/StartLongRunningProcess", { id: uniqueId }, funct

Categories : Asp Net Mvc

How to query running java application from command line?
Your program can use the attach API to locate the running JVM and connect to it. http://docs.oracle.com/javase/7/docs/jdk/api/attach/spec/ Then you can tell it to load an agent into the JVM. See the java.lang.instrument package description, chapter “Starting Agents After VM Startup” to see how such an agent can be implemented. This agent can call the desired method in the target JVM. Note that there already exists the JMX agent for a lot of operations you might want to perform when dealing with managing another application. It’s worth studying it.

Categories : Java

Running R script from crontab gives different results than from command line
Don't compare a string to a number if you don't have to. If you removed the space from the format pattern (i.e. made it "%H" instead of " %H"), it should work. However, you don't have to introduce strings in this case; you can get the hour as a number by converting to POSIXlt and extracting the hour component. Try this: as.POSIXlt(Sys.time())$hour > 12

Categories : R

Running TestNG programmatically using maven command line
The simplest solution to run tests in parallel is to use the configuration for the maven-surefire-plugin like this: </plugins> [...] <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> <version>2.15</version> <configuration> <parallel>methods</parallel> <threadCount>10</threadCount> </configuration> </plugin> [...] </plugins> Usually you don't need a separate testng.xml file to run the tests, cause they will be run by default based on the naming conventions for tests. Furthermore it's not needed to make separate include rules apart from that your given definition is

Categories : Maven

Running 7zip command line silently via Python
Pipe stdout and stderr to your system's null file: import os with open(os.devnull, 'w') as null: subprocess.Popen(['7z', 'e', input_file, '-o', output_dest, '-y'], stdout=null, stderr=null)

Categories : Python

MSTest execution stuck when running through command line
As Mike said in the comments, the issue was actually a bug in VS 2010 that made it impossible to run tests through the 2010 IDE if you have VS 2012 installed side by side. Unfortunately, I was unable to install VS 2010 SP1 on the build machine, but it is also possible to solve the issue by adding the /noisolation argument to the standard command line syntax (this runs the tests through the MSTest process, which somehow solves the issue). However, since you cannot define additional arguments to be passed to MSTest through TFS's integrated automated testing feature, I wrote my own application that invokes as a scheduled task, runs the tests and sends an email containing an HTML report (I used trx2html for that -- note that if you're using VS2012, you'll need the beta 0.7 version, as there'

Categories : Tfs

running SWF from the command line and getting trace output to the console
You can use the command line debugger, fdb to see console output. First, compile a debug SWF: mxmlc -debug=true myApp.mxml Then launch the debugger: java -jar ../lib/fdb.jar Then you can either launch your app in the standalone Flash Player or in a browser. When you see the (fdb) prompt, use the run debugger command to start your app. You have several choices: run <path to SWF> (launch SWF in the standalone Flash Player) run <url to SWF> or run <path to HTML file that embeds SWF> (launch in browser)

Categories : Misc

Running JUnit 4 from command line on Eclipse project
Just take off the .class part. Java knows to look in that file when you specify the class name. java -cp /usr/share/java/junit.jar org.junit.runner.JUnitCore MySuite

Categories : Java

msinfo command line export only running tasks
If you can use Powershell rather than msinfo32, this is significantly easier and a lot quicker: powershell Get-Process. This runs quickly and can easily be piped to a file, e.g. powershell Get-Process > . fo.txt. This should work on any version of Windows which supports Powershell 2.0 or later, I believe. See http://technet.microsoft.com/en-us/library/ee176855.aspx for complete documentation of the Get-Process cmdlet. There are a lot of options you can use to limit the columns the cmdlet outputs, so that you don't have to parse a ton of extra columns.

Categories : Misc

Debug in Eclipse while running from command line ubuntu
Is your application written in C or in Java? If your application is in C and you are using CDT, you can attach to existing project by: Run your application from terminal. In Eclipse CDT, go to main menu "Run"->"Debug Configurations...", double-click "C/C++ Attach to Application" and press "Debug" (you should not need to specify executable and/or project). For Java applications, see this

Categories : Eclipse

running "exec()" under "windows+apache+php5.4" slower than command line
Obviously there is no difference in time cost execution of your test.exe. So the difference is related to your web server and how it handles PHP scripts. Apache is a Thread Safe web server and there are many scheduling and other process tables exist in order to manage Thread safety on it. Besides, the time that your system costs for searching the path from Apache exe file to your test.exe file may play important role in exceeding the time cost in your case. You can test your program on other web servers and post the results for exact comparison.

Categories : PHP

© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.