path variable in Environmental variable accepts only one path - path

There is a path to JDK in Environmental variable and I'd like to add another path for spark. But whenever I click on the path variable to edit it, it only lets me change the existing path and does not let me add another path to it. Any help is much appreciated.

I found the answer. Simply add the second path you would like to add after the existing path and separate them with ";". This way, both paths are added and in case you want add more paths, by clicking on "edit" you can simply create a new path within the "path" variable.

Related

Grails config Locations not understanding it

I am trying to set up my grails config locations but I am not sure what to put instead of userHome, I changed the app name to file_down which is what my app is called. So how does it work ?
grails.config.locations = [ "classpath:${file_down}-config.properties",
"classpath:${file_down}-config.groovy",
"file:${userHome}/.grails/${file_down}-config.properties",
"file:${userHome}/.grails/${file_down}-config.groovy"]
First and for maintaining default settings, you don't have to modify those statements; they will be resolved to their appropriate values when the app is running because that location needs to get to the ".grails" directory. If you want to see what the value is, add this statement in some controller or a gsp page (no println and quotes are needed then):
println "${System.properties.'user.home'}"
And that will tell you what the path resolves to, it would be something like c:\Users\katkut for example for a username being katkut. If you have your .grails folder in some other place then go ahead and put the absolute path as you wish instead, but, I hope you are maintaining the default installation settings.
One more thing. If userHome gives you null when you try to print it, just replace it with user.home as you see in the above statement, I believe they are the same, but the latter is accessible inside your .groovy and .gsp files.

cxShellTreeView component get the path

i'm trying to get full path of the selected Folder. Only thing i was able to find is this
cxShellTreeView2.Folders[Index].PathName, but i don't know how to get this Index.
Is it the path of the map?
self.cxShellTreeView2.Path;
or
self.cxShellTreeView2.AbsolutePath;
Description TcxCustomShellTreeView.AbsolutePath
Use the AbsolutePath property to specify the path to the required shell node. Folder path can be specified in two ways:
as a full path, including all sequence of folders, required for accessing the required shell node from the shell root.
Description TcxCustomShellTreeView.Path
Use the Path property to specify the path to the current shell item. Folder path can be specified in two ways:
as a full path, including all sequence of folders, required for accessing the required shell item from the shell root.
The full path of a selected folder is returned by cxShellTreeView1.AbsolutePath.

How do I find a particular sub directory using Ant and then use it to create a symlink?

I need to create a symlink to a sub-directory using Ant. The issue is that I don't know where the target sub-directory is.
To create a symlink with ant I do this:
<symlink link="${parent.dir}/FOO/linkname" resource="${parent.dir}/BAR/target"/>
But I don't know what BAR is called in advance so I need to do a search for "target" under parent.dir and then pass the one result into the resource.
Is this possible using fileset? Or another way?
It might be possible to use a fileset but that might give you several symlinks or none.
A much better approach is to define the path to BAR in a property. If there is a dynamic part in this path, change the code so that Ant evaluates the dynamic part and everyone else uses Ant's value.
The typical example here is that the path contains a version or timestamp. Define those in your build file so you can use them everywhere. If a Java process needs the values, pass them to the process as a system property (-D...).

How to add a set path only for that batch file executing?

Basically, I know I can go through my control panel and modify the path variable. But, I'm wondering if there is a way to through batch programming have a temporary path included? That way it is only used during that batch file execution. I don't want to have people go in and modify their path variables just to use my batch file.
Just like any other environment variable, with SET:
SET PATH=%PATH%;c:\whatever\else
If you want to have a little safety check built in first, check to see if the new path exists first:
IF EXIST c:\whatever\else SET PATH=%PATH%;c:\whatever\else
If you want that to be local to that batch file, use setlocal:
setlocal
set PATH=...
set OTHERTHING=...
#REM Rest of your script
Read the docs carefully for setlocal/endlocal , and have a look at the other references on that site - Functions is pretty interesting too and the syntax is tricky.
The Syntax page should get you started with the basics.
There is an important detail:
set PATH="C:\linutils;C:\wingit\bin;%PATH%"
does not work, while
set PATH=C:\linutils;C:\wingit\bin;%PATH%
works. The difference is the quotes!
UPD also see the comment by venimus
That's right, but it doesn't change it permanently, but just for current command prompt.
If you wanna to change it permanently you have to use for example this:
setx ENV_VAR_NAME "DESIRED_PATH" /m
This will change it permanently and yes, you can overwrite it in another batch script.

Running C processes in Rails

I make a call just like this:
value = ./simulated_annealing
Which is a C Object file, but Rails tells me it cannot find that file. I
put it in the same dir that the rest of the models files (since it's
called by one of those models), but I guess it should be in any other
place.
I've tried that outside Ruby and it works great.
What do I have to do?
The thing is, when you say:
./simulated_annealing
you're explicitly saying: run file named simulated_annealing which is found in the current directory. That's what the ./ means. If the file's located elsewhere you need to provide the path to it, or add that path to the environment variable $PATH. So, you should replace that line with:
/path/to/simulated_annealing
where /path/to represents the actual path.
The best option is to use an absolute path for running the program. For ex.,
you can create a directory "bin" under your rails application top level
directory. Place your program under "bin" directory. Then you can
execute the program something like:
cmd = "#{RAILS_ROOT}/bin/cbin arg1 arg2"
value = `#{cmd}`

Resources