path

Conda: what happens when you activate an environment?

浪尽此生 提交于 2019-12-18 13:34:49
问题 How does running source activate <env-name> update the $PATH variable? I've been looking in the CONDA-INSTALLATION/bin/activate script and do not understand how conda updates my $PATH variable to include the bin directory for the recently activated environment. No where can I find the code that conda uses to prepend my $PATH variable. 回答1: Disclaimer: I am not a conda developer, and I'm not a Bash expert. The following explanation is based on me tracing through the code, and I hope I got it

Convert backward slash to forward slash in python

好久不见. 提交于 2019-12-18 13:28:57
问题 Hi I have read articles related converting backward to forward slashes. But sol was to use raw string. But Problem in my case is : I will get file path dynamically to a variable var='C:\dummy_folder\a.txt' In this case i need to convert it to Forward slashes. But due to '\a',i am not able to convert to forward slashes How to i convert it? OR How should i change this string to raw string so that i can change it to forward slash 回答1: Don't do this. Just use os.path and let it handle everything.

Cannot load rJava because cannot load a shared library

≡放荡痞女 提交于 2019-12-18 13:24:18
问题 I have been struggling to load the rJava package in R. I get the following messages > library(rJava) Error in inDL(x, as.logical(local), as.logical(now), ...) : unable to load shared library \ 'C:/PROGRA~1/R/R-210~1.1/library/rJava/libs/rJava.dll': LoadLibrary failure: The specified module could not be found. Error : .onLoad failed in 'loadNamespace' for 'rJava' Error: package/namespace load failed for 'rJava' I have tried so many solutions that they are all bamboozeled in my head. At some

'stringByAppendingPathComponent' is unavailable

情到浓时终转凉″ 提交于 2019-12-18 12:58:09
问题 I'm getting the error 'stringByAppendingPathComponent' is unavailable: Use 'stringByAppendingPathComponent' on NSString instead. when I try to do let documentsFolder = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as String let databasePath = documentsFolder.stringByAppendingPathComponent("test.sqlite") This apparently worked for people before, but it doesn't work for me now in Xcode 7 beta 5. This thread on the Apple Developer Forums had the suggestion to

How do I get just the jar URL from a jar: URL containing a “!” and a specific file in the jar?

我的梦境 提交于 2019-12-18 12:54:10
问题 I get a jar file url at runtime as: jar:file:///C:/proj/parser/jar/parser.jar!/test.xml How can this be converted to a valid path as: C:/proj/parser/jar/parser.jar. I have already tried using File(URI) , getPath() , getFile() in vain. 回答1: This might do it, if MS-Windows is not offended by a leading slash: final URL jarUrl = new URL("jar:file:/C:/proj/parser/jar/parser.jar!/test.xml"); final JarURLConnection connection = (JarURLConnection) jarUrl.openConnection(); final URL url = connection

A system independent way using python to get the root directory/drive on which python is installed

会有一股神秘感。 提交于 2019-12-18 12:45:51
问题 For Linux this would give me / , for Windows on the C drive that would give me C:\\ . Note that python is not necessarily installed on the C drive on windows. 回答1: You can get the path to the Python executable using sys.executable : >>> import sys >>> import os >>> sys.executable '/usr/bin/python' Then, for Windows, the drive letter will be the first part of splitdrive: >>> os.path.splitdrive(sys.executable) ('', '/usr/bin/python') 回答2: Try this: import os def root_path(): return os.path

Need help installing JUnit on Mac/How to add JUnit to Path environmental variable on Mac OSX

梦想与她 提交于 2019-12-18 12:26:29
问题 I am not able to figure out how to correctly install JUnit onto my mac. I know I am supposed to add it to the path environmental variable, and I have tried a few tutorials I've found on Google on how to do that, but I keep getting errors. This is the link to the tutorial I have used: http://hathaway.cc/post/69201163472/how-to-edit-your-path-environment-variables-on-mac-os-x I have a feeling I am doing something wrong in step 3. I have placed the junit.jar file in the Library folder by the way

msys git and long paths

陌路散爱 提交于 2019-12-18 12:22:34
问题 I'm trying to use git to more effectively manage working on project which uses CVS for its source control, but I'm having problems add -ing a file which has a very long path indeed - 276 characters. Unfortunately, this file is generated by the custom IDE the tool I'm using is shipped with and it's expected to be there by the tool, so can't be renamed or moved. Using the following to try to make this semi-readable: <projectpath> - the path holding all components for this project <hugepath> -

In Node.js how can I tell the path of `this` module?

梦想的初衷 提交于 2019-12-18 12:09:38
问题 In a Node.js module I'm writing I would like to open a file--i.e, with fs.readFile() --that is contained in the same directory as my module. By which I mean it is in the same directory as the ./node_modules/<module_name>/index.js file. It looks like all relative path operations which are performed by the fs module take place relative to the directory in which Node.js is started. As such, I think I need to know how to get the path of the current Node.js module which is executing. Thanks. 回答1:

How to use relative paths for included files such as .css

那年仲夏 提交于 2019-12-18 11:58:01
问题 I have a header.php file which contains a .css file link. When I "include" header.php into another php file in different folder, the .css href for that header.php is not correct for the new php file. How should I declare the href in my .css file to include the header.php with it that will be correct for any folder that php file is in? 回答1: This is a reason many large applications will try to set a 'root URI' constant/variable when installing. While /css/style.css will work if your application