In julia, I always start the program by typing
exec /Applications/Julia-0.3.2.app/Contents/Resources/julia/bin/julia
in command line.
How could I add "/Applications/Julia-0.3.2.app/Contents/Resources/julia/bin/julia" into PATH or set a variable so I don't need type all the directory everytime using julia?
BTW, i'm using mac os.
I figured out the solution, add following command to profile and refresh the terminal:
alias julia='exec /Applications/Julia-0.3.2.app/Contents/Resources/julia/bin/julia'
Related
shell_exec("Rscript C:\R\R-3.2.2\bin\code.R ");
This is the call to script.On calling the above script, the error occurs.
I am trying to call my R script from the above path but no output is being shown. While checking the error logs of PHP, it says 'Rscript' is not recognized as an internal or external command, operable program or batch file.' The script is working fine on the Rstudio but not running on the command line.
Add the Rscript path to your environment variables in Windows:
Go to Control Panel\System and Security\System and click Advanced System Settings, then environment variables, click on path in the lower box, edit, add "C:\R\R-3.2.2\bin"
Restart everything. Should be good to go. Then you should be able to do
exec('Rscript PATH/TO/my_code.R')
instead of typing the full path to Rscript. Won't need the path to your my_code.R script if your php file is in the same directory.
You need to set the proper path where your RScript.exe program is located.
exec ("\"C:\\R\\R-3.2.2\\bin\\Rscript.exe\"
C:\\My_work\\R_scripts\\my_code.R my_args";
#my_args only needed if you script take `args`as input to run
other way is you declare header in your r script (my_code.r)
#!/usr/bin/Rscript
and call it from command line
./my_code.r
If you are running it in Git Bash terminal, you could follow a revised version of the idea suggested by #user5249203: in the first line of your file my_code.R, type the following
#!/c/R/R-3.2.2/bin/Rscript.exe
I assumed that your path to Rscript.exe is the one listed above C:\R\R-3.2.2\bin. For anyone having a different path to Rscript.exe in Windows, just modify the path-to-Rscript accordingly. After this modification of your R code, you could run it in the Git Bash terminal using path-to-the-code/mycode.R. I have tested it on my pc.
I faced the same problem while using r the first time in VS Code, just after installing the language package (CRAN).
I restart the application and everything worked perfectly. I think restarting would work for you as well.
I am trying to remap the command of running my python source file, which is from the atom-python-run package to the shortcut cmd+r, which is currently used by the replacement function.
if I type:
'cmd-r': 'unbind!'
It says the command is not found. So I can unbind it.
Do I need to unbind the command or can I somehow assign the new command without doing all of that stuff.
I found this online to remap another command of another package, just as a scheme of how to remap.
'atom-workspace atom-text-editor:not([mini])':
'ctrl-j': 'unset!'
However I could not figure out how to rewrite that for my purpose. Is there a way to rewrite this for my purpose or is that something different?
Thanks for your time.
You don't need to unset the keymap, you can simple overwrite it by assigning the name of the run command to it:
'atom-workspace atom-text-editor:not([mini])':
'ctrl-r': 'Python run: run-f5'
The author of this made the command a bit hard to guess, since it's more common to use a slug of the command (e.g. python-run:run-f5).
You can get a full list of available commands by running atom.commands.registeredCommands in the console.
Whenever I try to run any Arduino CLI commands, I am always getting a popup saying "MainClassNameRequired". What is going on and what do I need to do to be able to run arduino CLI commands?
I found the following JA.SO question and answer: https://ja.stackoverflow.com/q/20667.
My Japanese is terrible, and Google Translate didn't help too much, but the paths in the answer were correct and I was able to get the gist & get it working.
It turns out that, for whatever reason, the Arduino symbolic link created in /usr/local/bin, even though it is linked to the correct executable, doesn't actually pass the parameters through.
The Japanese answer suggested two solutions, both of which work. Firstly, remove the existing symlink from /usr/local/bin, then you can either:
Create a shell script wrapper to call the Arduino executable that will pass parameters through and then link create a symlink to that (or just make it executable and place it in /usr/local/bin):
#!/bin/bash
exec /Applications/Arduino.app/Contents/MacOS/Arduino "$#"
ln -s /usr/local/bin/arduino arduino.sh
Create an alias
alias arduino='/Applications/Arduino.app/Contents/MacOS/Arduino
Now when you execute arduino from your command prompt, your parameters are correctly passed to the program.
OS: UNIX Solaries, Oracle Application Server 10g
To run shell script from Oracle Forms, I used the following host('/bin/bash /u01/compile.sh') and it works well
Now, I need to run unix command something like
host('mv form1.fmx FORM1.FMX') but it's not working
I tried to append the command mv form1.fmx FORM1.FMX' to the compile.sh shell script but also it's not working although the rest lines of the shell script is running well
The solution is to just add the full path of the mv command and it worked well, as follow
/bin/mv /u01/oracle/runtime/test/form1.fmx /u01/oracle/runtime/test/FORM1.FMX
In case anyone else encounters the same problem, the cause is that Forms process creates a subprocess to execute host() command, and that subprocess inherits environment variables of the parent process, which are derived from default.env (or other env file as defined in server config). There is a PATH variable defined in that file, but it doesn't contain usual /bin or /usr/bin, so the commands will not execute unless full path is specified.
The solution is to set the correct PATH variable either in the executed script (via export PATH=$PATH:...) or in default.env. I set it in the script, since, knowing Oracle, there's no guarantee that modifying default.env won't break something.
How do you set up Octave software to run initialization commands when it starts? For example, set the prompt (PS1) and cd to the project directory?
Thanks.
I have Octave installed in C:\Octave, so I did what you ask in file at location C:\Octave\3.2.4_gcc-4.4.0\share\octave\site\m\startup. File is called System-wide startup file for Octave and code I put in there is:
PS1('>> ');
addpath('{$path-to-my-octave-files}');
But any code is OK, I guess.
You could
write a script that does the start up routines you want and call octave afterwards
use
octave --persist --eval 'some_code_to_evaluate'
or
set the exec path with
octave --exec-path path_to_your_subprogramms
Personally, I wouldn't want octave to cd to the project directory, since projects directories can change. Furthermore, other features like the --eval command are not that easy to use anymore if you always have some default code running beforehand.