w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
How To Launch Git Bash from DOS Command Line?
I'm not sure exactly what you mean by "full Git Bash environment", but I get the nice prompt if I do "C:Program FilesGitinsh.exe" --login In PowerShell & 'C:Program FilesGitinsh.exe' --login The --login switch makes the shell execute the login shell startup files.

Categories : Windows

Launch PHP app (WordPress) from command line for development?
PHP 5.4.0 introduced a built-in web server. This should be what you are looking for. Edit: It seems to be possible to run wordpress on it <?php $root = $_SERVER['DOCUMENT_ROOT']; chdir($root); $path = '/'.ltrim(parse_url($_SERVER['REQUEST_URI'])['path'],'/'); set_include_path(get_include_path().':'.__DIR__); if(file_exists($root.$path)) { if(is_dir($root.$path) && substr($path,strlen($path) - 1, 1) !== '/') $path = rtrim($path,'/').'/index.php'; if(strpos($path,'.php') === false) return false; else { chdir(dirname($root.$path)); require_once $root.$path; } }else include_once 'index.php'; Drop this script in your project, and off you go! $ php -S localhost:9393 -t /path/to/wordpress router.php If you placed router.php inside your wordpress directory, don’t bother

Categories : PHP

Batch file (command line) to get target path of Internet Shortcut (.url) in the "URL:" field under "Web Document" tab
I think i understand your question, here is a batch file that will loop through the links in a given folder and then echo each of the destination URLs Batch file: echo off setlocal enableextensions enabledelayedexpansion pushd %1 for %%F in (%1*.url) do ( echo %%~dpnxF call :findurl "%%~dpnxF" ) popd goto end :findurl inputfile set url= for /f "tokens=2 delims==" %%i in ('findstr URL %1') do set url=%%i echo %url% echo ----- :end Usage: MyBatchFile.bat C:usersUsernameDesktop Expected Output: d:UsersMartynDesktop estlink - Copy.URL http://google.co.uk ----- d:UsersMartynDesktop estlink.URL http://stackoverflow.com/questions/17687358/batch-file-command-line-to-get-target-path-of-internet-s hortcut-url-in-the ----- [edit] Just a quick explanation on whats going on, .ur

Categories : Batch File

Visual Studio 2012, Unable to launch the IIS Express Webserver, Webmatrix and command line ok
Start your project using the Visual Studio Development Server and see if it works. If it does then it means its a configuration problem. Close Visual Studio, back up or rename the %USER_HOME%DocumentsIISExpress folder. Re start Visual Studio again and open your application. Right Click your application and select Use IISExpress. Hope it helps.

Categories : Visual Studio 2012

Flyway command line filesystem migrations from actual command line input
flyway.cmd -configFile=/path/to/other/configFile.conf should do what you want. I just checked and it seems I forgot to document this on the website (It is in the usage description of the tool itself). Could you file an issue against the website, requesting this to be added?

Categories : Windows

How to get the shortcut menu name of Intent?
You can get it with activityInfo.labelRes Edit: That only returns an int referencing the String res ID. You still have to get that package's res to map it to the correct String.

Categories : Android

Is there a shortcut to open resharper menu?
You want the Action List. To access it hit.. Alt + Enter Here is the full list of R# commands Here is more info on the Action List.

Categories : C#

SWT popup menu shortcut not working
Try item.setAccelerator(SWT.MOD1 + 'A'); MOD1, MOD2 .. MOD4 are the keyboard and/or mouse event mask indicating that the MOD1 key was pushed on the keyboard when the event was generated. More references here and there. Edit: If you are developing an Eclipse plugin, and you are putting the menu on a View, then it is possible that the Eclipse Platform shortcut system is interfering with your SWT component's accelerator. I suggest you refactor your code, so that you use the shortcuts extension that Eclipse provides.

Categories : Java

Set Button shortcut Without Command?
This could give you a general idea on how you would go about things Keys lastkey = Keys.None; Button b = new Button(); private void KeyPress(object sender, KeyEventArgs e) { if (lastkey == Keys.Control) { //Do some stuff b.PerformClick(); } if (e.KeyCode == Keys.Control) lastkey = Keys.Control; else lastkey = e.KeyCode; }

Categories : C#

How To create a shortcut for a command in python 3.3
You can write a function: def draw_circle(t): t.forward(100) t.left(91) And then call it: t = turtle.Pen() command = input() if command == "circle": draw_circle(t) elif command = "stuff": ... A more robust solution would be to use a dictionary that maps commands to functions: commands = { "circle": draw_circle, "square": draw_square } And then get a function by name: t = turtle.Pen() turtle_command = input() command = commands[turtle_command] command(t)

Categories : Python

How can I add a keyboard shortcut for my command in CKEditor 3?
For 4.x, use editor.setKeystroke: CKEDITOR.plugins.add( 'foo', { init: function( editor ) { editor.setKeystroke( CKEDITOR.CTRL + 81, 'bold' ); // CTRL+Q } } ); For 3.x: CKEDITOR.plugins.add( 'foo', { init: function( editor ) { editor.on( 'instanceReady', function( evt ) { evt.removeListener(); this.keystrokeHandler.keystrokes[ CKEDITOR.CTRL + 81 ] = 'bold'; // CTRL+Q } ); } } );

Categories : Javascript

how to use shortcut key id different forms that grouped in one tool strip menu
You can do this by setting the Focus to the specific control and setting the cursor position. I wrote a bit of code that opens another form on the KeyDown event and sets the focus to a specific textbox. Of course to reference a control on one form from another one I had to make the control public. Not sure exactly how yours is set up with the multiple forms and how they're linked together, but if you can reference the control, you can set the focus to it. if (e.KeyCode == Keys.A) { Form2 form = new Form2(); form.Show(); form.NotesTextBox.Focus(); Cursor.Position = form.NotesTextBox.Location; }

Categories : C#

WPF: Calling a keyboard shortcut for a routed command if you're in a TextBox
You can intercept the keystrokes in the PreviewKeyDown event. If the input is a defined shortcut, raise the corresponding event and set e.Handled to true, to prevent further processing of it.

Categories : Wpf

Eclipse shortcut "go to line + column"
Ctrl+L Jump to Line Number. To hide/show line numbers, press ctrl+F10 and select 'Show Line Numbers' There is no way to go to a particular column according to my knowledge. It you want more short-cuts, refer http://www.shortcutworld.com/en/win/Eclipse.html

Categories : Eclipse

Piping output from 1 command to other command in an adb shell command line
One way is to create a shell script containing the commands you want and then run the shell script. Since the Android root filesystem is not writeable at run time (usually, unless you have rooted your device and remount it), you can copy the file to the removable (or emulated) storage, for example /sdcard. Then run the script using the command adb shell sh /sdcard/your-script-name. Because each script runs in its own subshell, both of your commands will be executed in the same shell on the device (you can confirm it with ps).

Categories : Android

How to use adb to launch an app and select a menu inside the app?
If you know display coordinates of the control you want to interact with you can use input tap <x> <y> command to click it. Or you can use input keyevent KEYCODE_DPAD_DOWN to scroll down to the menu item and then input keyevent KEYCODE_ENTER to select it. The input command has the following options: usage: input ... input text <string> [delay] input keyevent <key code number or name> input [touchscreen|touchpad] tap <x> <y> input [touchscreen|touchpad] swipe <x1> <y1> <x2> <y2> input trackball press input trackball roll <dx> <dy>

Categories : Android

Visual Studio Shortcut to select an entire line
hit home twice before you hit shift + end to select the whole line plus tabs Or my preferred method is start from the end and type end -> shift+home+home As for correcting tabs, if you select more than 1 line it will tab out all lines, but selecting only 1 line will replace that line with a tab (whether you select the current tabs along with it or not). To tab a single line don't highlight the line at all: home + tab

Categories : Visual Studio

Launch a Google-Form via Spreadsheet menu
You got caught by changes in the HtmlService. As announced in May 2013, Google has been changing the defaults for the ECMA sandbox mode used by scripts. The good news is that you just need to specify the NATIVE sandbox mode, and the form embedding will resume functioning. var htmlApp = HtmlService .createHtmlOutput(formHtml) .setSandboxMode(HtmlService.SandboxMode.NATIVE) .setTitle('Tec-problem') .setWidth(500) .setHeight(450);

Categories : Google Apps Script

Shortcut for toggling line numbers in Visual Studio 2012
For 2012 you can use add-ins to map all macro functionality, and hook it up to toolbars and keyboard shortcuts. I persisted the solution as a GitHub repository in order to document how to map pre-2012 macros to 2012 add-in commands, from creation to completion. Long story short, look up the macro definition you want in Visual Studio 2010, then create an add-in command in Visual Studio 2012 (Extensibility project type) that maps that functionality (modify 3 methods to create command) and deploy (copy 2 built files) and map keyboard shortcuts. As it is checked in, it fulfills your particular request for line number toggling in files and works slickly with keyboard shortcuts. Please check out https://github.com/dherod/MacroMapper.git The README.md file shows all the details about how to e

Categories : Visual Studio

How to display the command's drop-down menu after the command icon is clicked?
I just asked the same question on Eclipse RCP forum and got immediate answer. The trick is to fire a fake event that will trigger the menu to display, here are the details: http://www.eclipse.org/forums/index.php/t/488692/

Categories : Java

unix command line cut and remove new line, unwrap next line
This awk one liner can do it: $ awk '{if ($0 ~ /&$/) {getline a; print $0,a} else {print }}' file it gets the lines ending with & and joins them with the next one. Otherwise just prints the line. Test $ awk '{if ($0 ~ /&$/) {getline a; print $0,a} else {print }}' file A7233334 PALLETS 2 11.000 EACH 2331 Storm Supply 247.5000 2,722.50 2,722.50 4144 Gentro Sales 225.0000 2,475.00 2,475.00 5155 Wacca Outfit 225.0000 2,475.00 2,475.00 6661 Acme Warehouse & Fuller Supply 225.0000 2,475.00 2,475.00 1661 McHugh & Donaldson

Categories : Unix

Why "hadoop -jar" command only launch local job?
/usr/bin/hadoop jar is what your Hadoop's $HADOOP_HOME/bin/hadoop script requires as an argument, where $HADOOP_HOME is where you have kept your hadoop related files. Excerpt from hadoop script elif [ "$COMMAND" = "jar" ] ; then CLASS=org.apache.hadoop.util.RunJar HADOOP_OPTS="$HADOOP_OPTS $HADOOP_CLIENT_OPTS" and, elif [[ "$COMMAND" = -* ]] ; then # class and package names cannot begin with a - echo "Error: No command named `$COMMAND' was found. Perhaps you meant `hadoop ${COMMAND#-}'" exit 1 Here COMMAND="jar" and when COMMAND=-*, or -jar it should throw an exception as coded above. I'm not sure how you can even run a local jar.

Categories : Hadoop

Launch a container with Docker without specifying command
You can build a Docker image that includes a run command and other configuration, such that a docker run <image> will start the container. The easiest way to do this is with CMD from the Docker Builder. You'll need a recent version of Docker (> 0.4.6?). Outside of using Docker Builder, check out the flags for docker commit and docker run (where the command arguments are optional). https://docs.docker.com/reference/commandline/cli/#commit https://docs.docker.com/reference/commandline/cli/#run

Categories : Misc

Navigator.app.exitApp()/navigator.device.exitApp() crashing with error on 3.0.0 only
Without the full code it is hard to tell where the problem is :( Check if you are making some alerts or calls inside getObj("btnBack"). Did you change something iside your activity?

Categories : Cordova

Launch nano editor passing piped command
Use process substitution: nano <(cat /var/log/qmail/current | tai64nlocal) Also, you don't need to use cat nano <(tai64nlocal < /var/log/qmail/current)

Categories : Linux

sublime text launch separate command window (c / c++)
{ "cmd": ["start", "cmd", "/c $file_base_name.exe"], "selector": "text.c", "shell": "true" } The cmd start command opens a new window of the command passed to it. Note that to keep the window from closing immediately at the end of your programs, you'll have end them with system("pause"); or getch();, or replace /c with /k to keep cmd up. EDIT: after more digging and debugging: "cmd": ["start", "cmd", "/c", "$file_base_name.exe & pause"] I had the same issue with Java, trying to create a Run Variant, and eventually came out with this: "variants": [ { "cmd": ["start", "cmd", "/c", "java $file_base_name & pause"], "name": "Run" } ]

Categories : C++

How can launch title bar and dummy button when Menu hard key is pressed instead of touching screen?
If I understand your situation right, you shouldn't add a OnClickListener to your contentView. This makes title bar and dummy button show up when the screen is touched. Instead you should overwrite public boolean onKeyDown(int keyCode, KeyEvent event) and do the following: if (keyCode == KeyEvent.KEYCODE_MENU) { // put your onClickListener code here return true; } EDIT: I changed your code on pastie. http://pastie.org/8221961 I deleted your onClickListener for the content view, since you don't want to go fullscreen when the screen is touched. Then I overwrote the onKeyDown method to handle the menu button. I just pasted the code from the onClickListener into this method, since you want it to do the same thing. I marked the lines where I added/removed code in the pas

Categories : Java

Can I make Visual Studio recognize more than just two shortcut key sequences for a keyboard shortcut binding?
As far as i know are only maximum 2 sequences allowed in Visual Studio 2012. You can check that when you open the Options in Visual Studio and open the Keyboard Settings. I have checked that by using Ctrl+A, Ctrl+C, but i´m not allowed to add more.

Categories : Visual Studio

Command works in command line but gives 'no such file or directory' in bash script
Remove the quotes around line 8. Like this: ./optAlg.exe "$inputFile" 500 2>&1 > "output/$outputFile" By placing quotes around the whole line you tell bash to execute a command which is called exactly ./optAlg.exe $inputFile 500 2>&1 > output/$outputFile and of course there is no such command. In reality you want to run ./optAlg.exe with parameters. Do not forget to place quotes around the variables because otherwise filenames that have whitespace characters are going to be passed as several arguments. Please read about arguments. And you can read about common pitfalls as well.

Categories : Bash

PHP exec command works in shell and php command line but not on website
You can add the second parameter to help debug, $output will display what the cp command is doing, whether it be an error or not. I would also recommend placing quotes around the files, just in case something with a space gets in there. $src = "/mnt/..."; $dest = "/var/www/..."; exec("cp '$src' '$dest'", $output, $retrun_var); var_dump($output, $retrun_var);

Categories : PHP

Defining the command line arguments of a linux command in python
format is your friend: import os, sys if len(sys.argv) == 2: os.system("sudo rtcwake -m off -s {}".format(sys.argv[1])) else: print "usage: ..." so the seconds are command line parameters. Or, you can make it interactive: import os secs = raw_input() os.system("sudo rtcwake off -s {}".format(secs)) to verify that the user input is an integer: try: secs = int(secs) except: print 'usage: '

Categories : Python

Batch file/command to start a program through command line
I'll edit this if you respond to my comment but if you want to simply execute this command via a batch file (and you know nothing about batch files): Open a text editor (e.g.Notepad) Type in your command (e.g. c: andaotherfoldermyprogram.exe 10 20) Save the file as mybatchfile.cmd Double click the file (in Windows Explorer etc.)

Categories : Windows

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

different order of command line options in a command affecting my output
getoptlong() is doing exactly what it is supposed to do. The format-string "d:g:hv" implies that the parameters d and g require a value. Anything specified following a command-line parameter is consider a value being passed to it. You should run your program as $program --download file --version Checkout this detailed example demonstrating the various aspects of using getoptlong(). How rm can handle the differing position of its cmd-line params? Apparently because rm's parameters (r, v etc.) do NOT accept any values as arguments. Thus directory does not get passed to any of them but rather is a separate cmd-line argument on its own. You can confirm this from the source-code of rm. To do something similar for your program, you will need to modify the optstring to "dghv" a

Categories : C

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

php sudo shell_exec command runs from command line, but not from browser
Would it be out of the question to make a shell script that would run your command? #!/bin/sh sudo whoami in the php: $retVal = `/path/to/custom/script/myscript.sh &2>1`; if ($retVal) echo 'SWEET'; else echo 'POOP: ' . $retVal; {command} inside `` means the same as shell_exec('{command}') on a linux server. If I'm not way off base here your goal is to add users to your VPN (among other things perhaps) in which case you could pass command-line parameters for username/password/etc to your custom shell script. It's not exactly a pure shell_exec() answer to your question, but maybe you can run myscript.sh without doing sudo. Just basing this on the fact you said everything you tried worked in shell and path was set in echo $PATH, but not sudo echo $PATH in your PHP script. Seem

Categories : PHP

Always given command line before python fabric command is executed on remote
Interesting, I don't have such issue, your code works fine for me (up to adding env.key_filename and env.password) c:work>fab hello [x.x.x.x] Executing task 'hello' [x.x.x.x] run: touch hello.world Done. Disconnecting from x.x.x.x... done. I'm using Fabric 1.7.0 and Paramiko 1.11.0. Possibly it's a problem of the terminal on your server.

Categories : Python

How to get command-line equivalent of command entered in Task Scheduler
schtasks /query /? schtasks /create /? the first has an option to export to xml, the second one as an option to import from xml. If you have only one or a few tasks to schedule, I would create them "the hard way" with schtasks /create

Categories : Windows

Remote command execution from command line in Windows XP
Maybe you could do that via Windows Scripting Host (WSH) which supported remote execution. See Setting up Remote WSH. The article contains a link to examples. (You may need to use the WshShell object to invoke taskkill from your remote script.)

Categories : Windows

Is there a command I can use to sign my modified apk on the command line in Linux?
For this you use standard Java SE tools: jarsigner and keytool. From Android documentation on signing: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore my-release-key.keystore my_application.apk alias_name Remember that you should first sign and then align.

Categories : Android



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