w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Sublime Text 2 How To Change Default Runtime Shell Command For C++?
{ "cmd": ["g++", "${file}", "-o", "${file_path}/${file_base_name}"], "file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$", "working_dir": "${file_path}", "selector": "source.c, source.c++", "variants": [ { "name": "Run", "cmd": ["${file_path}/${file_base_name}"] } ] } Just drop the compilation command and retain only the executable invocation part. But remember, you have to compile before running otherwise the executable would not have got generated.

Categories : C++

bash shell in Cygwin
A child process cannot alter its parent's environment. When you execute the run_alias.sh script, you launch a new bash process, which sources your alias file. Then the script ends, that bash process terminates and it takes its modified environment with it. If you want your aliases to be automatically available, source it from your $HOME/.bashrc file.

Categories : Bash

Shell Script Error using Cygwin
bash does not treat the DOS-standard as the end-of-line marker, so the is treated as a normal character, which fouls up its parsing. You need to change the line endings to be only.

Categories : Shell

Run shell script in Windows without Cygwin/requiring downloads from clients
Is there an easy way to use bash scripts in software running in Windows, potentially with some code we can ship with it? You can take a look at UnxTools which is old, but still works pretty well. It has a sh shell which can be used for your purposes. Otherwise, you might need to use Cygwin to accomplish what you're doing.

Categories : Batch File

escaping spaces and other special characters in cygwin shell script
You should run it as bash instead and store your arguments as arrays. Also, do not add literal quotes to your spaces: #!/bin/bash VMRUN="/cygdrive/c/Program Files (x86)/VMware/VMware VIX/vmrun" echo "VMRUN is [$VMRUN]" ARGS=(-T ws start 'C:Users edDocumentsVirtual Machinesmyvm-dev-006 (2)myvm-dev-006 (2).vmx') echo "ARGS is [${ARGS[*]}]" "$VMRUN" "${ARGS[@]}" Run bash script.sh.

Categories : Windows

How can I default to a login shell for Jenkins shell execution
You could work around by creating a wrapper around bash: #!/bin/sh # for ex.: /usr/local/bin/login-bash exec /bin/bash -l "$@" If you want to use the default ruby just use the rvm-shell, which comes with rvm. Login as the jenkins user and type: $ which rvm-shell /home/jenkins/.rvm/bin/rvm-shell to get the path of the rvm-shell. Use this path for the "Shell executable" option.

Categories : Bash

Segmentation fault in Cygwin and default variable initialisation
GG *ptr[200]; ptr is an array of pointers to GG type of structure.You are trying to access these pointers which does not have any memory location. You need to allocate memory to each pointer of this array like below- for(x = 0; x<200; x++) ptr[x] = malloc(sizeof(struct test));

Categories : C

Batch Command to Cygwin after Cygwin Loads
Assuming that you're using bash, appending the following line to your ${HOME}/.bashrc would achieve the desired result: cd /cygdrive/c/cygwin/home/Alex/rails_projects/demo_app/

Categories : Windows

How to change the android default browser default Home URL
From Ben Williams I'm fairly (although admittedly not absolutely) certain this isn't possible, because apps are sandboxed, so you won't be able to access the browser's private sharedpreferences.

Categories : Android

How to set the default app for Trebuchet launcher using adb shell?
Preferred apps are stored in /data/system/users/0/package-restrictions.xml Update this file to set default applications as you need. Remember to reboot afterwards to apply the new settings. It's also worth mentioning that the file seems to be always opened and modified by android on boot, so better check after change and reboot that your settings are still there as it might not always be the case (If there is an error for example). Also if you set an app as default for some intent and this app crashes, you have to change that XML file again to restore your settings as android would automatically unset an app as default if it crashed. Source

Categories : Android

How to zip a file in windows shell without vb script and with Window default zip only
Yes and no. There is no built in way to do this inside windows. You can use a external application like vbscript, a exe file like 7zip, rar, lots of resources can do this. Since windows is application poor when it comes to command lines is not really surprising. But no you do not need the VB Script for anything. Just not so easy out of the box. Maybe makecab could do it for you? As a general rule you have a hard constraint in your question. A single BAT file which in general can not do almost anything without the support of hundreds of preinstalled or commonly installed other applications. Could you specify a the constraints a bit better. Tel WHY you need this particular constraint? And what does it mean as even most of the bat command you use require more than one file.

Categories : Shell

How to persist change to mongo in shell?
If you're using the Mongodb shell, you need to use the methods on the collection object to update a document. For example, if you first: car = db.cars.findOne(); Then, modify the car instance, you can just use the save method to update the single document (save documentation). db.cars.save(car); That will update the single document in the cars collection. For more advanced usage, you might consider using one of the Array operators which can directly manipulate an array as part of an update.

Categories : Mongodb

How to change shell to dash from bash
SHELL environment variable picks up the value from /etc/passwd. (It denotes the path to user's preferred command language interpreter.) This value wouldn't change if you change the shell in your session or your script.

Categories : Bash

Is there any way to use django shell without restarting when change code
I personally in such cases just record my session from shell_plus to file, and then call this file from within shell_plus after manually reloading. Both is possible with iPython, which is used by shell_plus by default. (If you don't have iPython installed, just pip install ipython and it should automatically work after that, I think). The recorded script is also often nice to keep as part of the project, as it's basically a small integration test. With minor modifications it could be executed outside shell as a standalone script, which is convenient. If you definitely want to use reloading, I think this answer might be able to help you: How do you reload a Django model module using the interactive interpreter via “manage.py shell”?.

Categories : Python

Update a shell script change in all directories
You can make use of the symbolic link feature. Use the ln command with all the files you've created. In this way you'll change one file and will show up at every linked path. To create a symbolic link you can use this simple command - ln -s script.sh sample.sh here sample.sh is the path which will be created.

Categories : Linux

Change Active directory in Shell Script
Following is the problem line in your script: exit Remove it, and execute your script by either saying: source runIt.sh or . runIt.sh You might have observed that your session would have exited upon invoking the script using either of the two forms mentioned above. This is because using source or . cause the script to run in the same shell.

Categories : Bash

How to change git shell's start directory in windows 7
According the article below (in the "Posh-Git and PowerShell" section) you should be able to create a DocumentsWindowsPowerShellGitHub.PowerShell_profile.ps1 file that will start when your GitHub PowerShell starts. In that file you can add the Set-Location c:path o epo command. For what it's worth, in case anyone comes across this but has a Bash shell, adding the command cd /path/to/repo to ~/.basrc should do the trick. http://haacked.com/archive/2012/05/21/introducing-github-for-windows.aspx

Categories : GIT

Shell - Change file name without changing extension from a given path
This could be one way: find "$input_variable" -type f -name "$word.*" | while read file; do dir=${file%/*} base=${file##*/} ext=${base##*.} noext=${base:0:${#base} - ${#ext} - 1} newname=${noext/"$word"/"$replace"}.$ext echo mv "$file" "$dir/$newname" done Remove the echo part when you're sure it's already correct. Edit: find "$input_variable" -type f -name "$word.*" | while read file; do dir=${file%/*} base=${file##*/} noext=${base%.*} ext=${base:${#noext}} newname=${noext/"$word"/"$replace"}$ext echo mv "$file" "$dir/$newname" done

Categories : Linux

How to change some symbols (e.g. "space") to other symbol in Bash/shell
Basic sed command: ps -ef | grep apache | sed 's/ /@/g' sed 's/text/new text/g' looks for "text" and replaces it with "new text". In case you want to replace more characters, for example replace all spaces and _ with @: (thanks Adrian Frühwirth): ps -ef | grep apache | sed 's/[_ ]/@/g'

Categories : Linux

Change major mode from fundamental to shell in emacs
Put this into your Emacs init file: (add-to-list 'auto-mode-alist '("\.bashrc_custom\'" . sh-mode)) Note possibly directory local variables are not questioned here, it's ruled by a list reading strings resp. regular expressions for matching file-names.

Categories : Emacs

Shell command works in shell but not in shell script
You are using single quotes in this command: filelist=$(grep '$incstring' -rl --include=*.{h,cpp} pathToFiles) Single quotes inhibit variable expansion. That is, you're looking for the literal string $incstring rather than the contents of that variable. This command, as shown here, would not have worked on the command line either. From the bash(1) man page: Enclosing characters in single quotes preserves the literal value of each character within the quotes. A single quote may not occur between single quotes, even when preceded by a backslash. Replace the single quotes with double quotes: filelist=$(grep "$incstring" -rl --include=*.{h,cpp} pathToFiles)

Categories : Shell

Change display information (like name) of files from a shell extension for explorer.exe
After extensive research, I've found that the best way to do it is to write a Shell Namespace extension. I'll be able to provide a virtual directory representing my server's structure, and translate the names the way I want. This seems a little overkill though, but there's no other way to change the informations displayed as the display name is managed by an IShellFolder which provides it to an IShellView One excellent source of informations I've found about it, and the most up to date so far, is an article on Michael Edenfiled's blog

Categories : C#

Is it possible to write a cron/ SHELL script that runs only when there is a change in the folder size?
There is no support for such a monitor event in standard cron: cron is strictly time-based. Assuming that cron is used, this task would need to be handled in a "woken up" job, which could then choose to sleep/end immediately or do something else depending on comparing the folder with a previous-known state .. Now, if cron is removed from the role of being the launch/monitor platform, then there are "non polling" ways to monitor a filesystem such as inotify. If just looking for a system daemon to supplement standard cron for this task, see the following alternatives. incron: incron is an "inotify cron" system. It works like the regular cron but is driven by filesystem events instead of time periods. It contains two programs, a daemon called "incrond" (analogous to crond) and a table

Categories : Shell

FTDI Change PID to default
It sounds like you programmed your PID but you have no driver to match that PID. So your device will enumerate, but it's not going to associate with any USB driver on the system. You can modify the original driver to add in your PID, and then install that driver for your modified device. Alternatively you can force the load of the original driver on the device. Open Device Manager then right click on your device and select Update Driver. Then click Browse, then click Let Me Pick. Finally click Have Disk then browse to your original driver. It will prompt you that it doesn't match and ask if you are sure - you can say yes to force the load of the original driver. This will give you access to change your PID back to what it was before.

Categories : Misc

C# - Change Default Of A Struct?
Structs cannot override the parameterless default constructor, nor can they explicitly initialize their fields. What you could do is use nullable points Point? and use null for invalid values.

Categories : C#

Change the default value of a settingsvalue
You can override the Properties property of the ApplicationSettingsBase class: public override SettingsPropertyCollection Properties { get { var properties = base.Properties; properties["SQLServer"].DefaultValue = String.Format("John Doe {0}", DateTime.Now); return properties; } }

Categories : C#

how to change the default div on backbone?
You can easily override the default tag by setting the tagName property to whatever you want var ListView = Backbone.View.extend({tagName: 'li'}); var listView = new ListView(); console.log(listView.el); // logs <li></li> check out the documentation

Categories : Backbone Js

Can I change the default view of tig?
As of Tig version 1.2, there is no way to configure what view is shown at startup. The best workaround at this point is to use a shell alias. For example, alias ti='tig status'. See tig -h for other options.

Categories : Misc

JAX-RS 2.0 change default implementation
Well, JAX-RS relies on the Service Provider convention. On the first lines of the newBuilder method you can read: Object delegate = FactoryFinder.find(JAXRS_DEFAULT_CLIENT_BUILDER_PROPERTY, JAXRS_DEFAULT_CLIENT_BUILDER); Where JAXRS_DEFAULT_CLIENT_BUILDER_PROPERTY is "javax.ws.rs.client.ClientBuilder" In turn, FactoryFinder looks first for the class name into META-INF/services/javax.ws.rs.client.ClientBuilder then in the property javax.ws.rs.client.ClientBuilder into ${java.home}/lib/jaxrs.properties finally into the System property javax.ws.rs.client.ClientBuilder. So, to use RESTEasy, you should create a file META-INF/services/javax.ws.rs.client.ClientBuilder with the text: org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder which is the class name of the RESTEasy

Categories : Rest

How to change default path for php.ini in PHP?
Referring to http://php.net/manual/en/install.windows.apache2.php you can specify a "PHPIniDir" directive in your apache configuration (at least if you run it as a module).

Categories : PHP

How do I change the default solver in AMPL?
Create a text file in the directory where AMPL and lpsolve is with the following line: option solver './lpsolve'; Before running ampl, you have to set the OPTIONS_IN environment variable and make it point to this newly created text file. I am using bash and I gave the name settings.txt to this text file. Before calling ampl, I issue the following command in the bash shell: export OPTIONS_IN=./settings.txt There are others ways to do this, and you may use another shell so I don't want to expand on this. You may find useful the CPLEX user's guide. Even though it's for CPLEX, there are a few sections on ampl that generally apply. For example all the above I write is in this user's guide, see Chapter 4 Customizing AMPL, section Persistent Option Settings.

Categories : Misc

How to change the default navigation speed in iOS SDK?
You need to use a custom animation like seague Animation class file where you can give the Transition duration for moving from one view controller to another view controller -(void)perform{ UIViewController *sourceViewController = (UIViewController *) [self sourceViewController]; UIViewController *destinationViewController = (UIViewController *) [self destinationViewController]; CATransition* transition = [CATransition animation]; if ([self.identifier isEqualToString:@"b"]){ transition.duration = .25; transition.timingFunction = [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]; transition.type = kCATransitionMoveIn; //kCATransitionMoveIn; //, kCATransitionPush, kCATransitionReveal, kCATransitionFade transition.sub

Categories : Iphone

How do I change the default command for `run-python`?
You can use the shebang line to specify which version you want to run: #!/usr/bin/env python Will use whichever one the system considers "python" #!/usr/bin/env python2.6 #!/usr/bin/env python2.7 #!/usr/bin/env python3.2 Will run the specified version if you have more than one installed. A friend taught me this when our Ops guy set up a VM with 2.6 and 2.7 installed, and I required 2.7, while the CentOS package manager required 2.6. Saved me a lot of having to go back and make things 2.6-compatible.

Categories : Python

Is there a way to change default font for your application
The answer is no, you cant change apple's systemFont, you need to set the font on your control yourself. For best way to set a default font for whole iOS app, please check the below SO questions: Set a default font for whole iOS app? How to set a custom font for entire iOS app without specifying size How do I set a custom font for the whole application? Is there a simple way to set a default font for the whole app?

Categories : IOS

How to change the default message.properties
If you want to fix the locale, put the following lines into the init closure of your BootStrap.groovy: TimeZone.setDefault(TimeZone.getTimeZone("CET")) Locale.setDefault(new Locale("it")); or Locale.setDefault(new Locale("es"));

Categories : Grails

Change the default message name in WCF wsdl
You can use the IWsdlExportExtension to control this. See the example on msdn: http://msdn.microsoft.com/en-us/library/system.servicemodel.description.iwsdlexportextension.aspx The pertinent code // Get parameter information. ParameterInfo[] args = op.SyncMethod.GetParameters(); for (int i = 0; i < args.Length; i++) { object[] docAttrs = args[i].GetCustomAttributes(typeof(WsdlParameterDocumentationAttribute), false); if (docAttrs.Length != 0) { // <param name="Int1">Text.</param> XmlElement newParamElement = opOwner.CreateElement("param"); XmlAttribute paramName = opOwner.CreateAttribute("name"); paramNam

Categories : Wcf

change Default font for Android App
You can create custom TextView and reffer it everywhere. public class TypefacedTextView extends TextView { public TypefacedTextView(Context context, AttributeSet attrs) { super(context, attrs); Typeface typeface = Typeface.createFromAsset(context.getAssets(), fontName); setTypeface(typeface); } } Inside view.xml <packagename.TypefacedTextView android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Hello"/>

Categories : Android

Change the default Rails application
You can use a application builder, rails new app --builder="/path/to/app/builder" Descriptions in API Doc The application builder allows you to override elements of the application generator without being forced to reverse the operations of the default generator. In a nutshell, you can define your default set of dependencies before creating a new rails app. For more info, see this post -> Rails 3 Application Builders

Categories : Ruby On Rails

How can I change to a default background image
You need to handle the onerror event of this image, which will occur whenever the file cannot be found: $('#image').error(function(){ $(this).off('error'); // otherwise, inexistence of the default image is a real pain $(this).attr('src', 'http://www.google.ca/images/srpr/logo4w.png'); }); Take a look at this working FIDDLE. Then, in your situation, you could have something like this: var path='the path'; clone.css('background-image', 'url('+path+')'); $('<img src="'+path+'" />').error(function(){ $(this).off('error'); clone.css('background-image', 'url('+default_path+')'); }); Hope this helps :-)

Categories : Javascript

RecognizerIntent change default language
I solved the problem: String language = "us-US"; Intent intent = new Intent(RecognizerIntent.ACTION_RECOGNIZE_SPEECH); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_MODEL,language); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE, language); intent.putExtra(RecognizerIntent.EXTRA_LANGUAGE_PREFERENCE, language); intent.putExtra(RecognizerIntent.EXTRA_ONLY_RETURN_LANGUAGE_PREFERENCE, language); startActivityForResult(intent, RESULT_SPEECH_GUEST);

Categories : Java

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