FAQ Database Discussion Community


How Path.GetDirectoryName Works?

c#,path,openfiledialog
When i use OpenFileDialog to Open file, of course i need to get the file directory and its name to load the file.(to load xml, to access the file i need full path.) opd is OpenFileDialog if (opd.ShowDialog() == true) { var names = opd.FileNames; foreach (string name in names)...

How to check if a given path is a file or directory?

file,file-io,path,directory,rust
I'm building a program that should be able to take both paths to files (*.*), and directories (./, ..). I want to be able to check if the path supplied is a file, or a directory.

string path inside a directory of WPF c# solution

c#,string,path
I created a directory inside my WPF solution called Sounds and it holds sound files.(For example: mySound.wav). Inside my code I use a List and there I have to add to those strings that relate to the sound files. In the beginning I used @"C:..." but I want it to...

Give absolute url adress

html,path
i'm trying to understand absolute and relative Url adresses; however, when i attempted an exercise, i couldn't solve it. Here is the exercise: Given the following URL address http://www.unsite.org/a/b/index.html , the document index.html contains 3 relatives URL addresses: <img src="../logo.png" alt="Logo de l’entreprise"/> //Line 1 <img src="/images/logo.png" alt="Logo de l’entreprise"/>...

Wildcard (*) in the path don't work while copying from cmd [closed]

windows,cmd,path
There is a file (abc.txt) in a folder- C:\vackwrk\24may\abc.txt and i want to copy that file to another folder using cmd- G:\work\ I use copy C:\vackwrk\24may\abc.txt G:\work\ this work , but when i am using wildcard it don't work copy C:\vackwrk\*\abc.txt G:\work\ this time output is - The filename ,...

Path of the current, parents and root directory

shell,unix,sed,path,pwd
I need to print the path of the current, parent and root directory in UNIX. I can use commands, or a shell script. I managed to do that for the current and the parent directory, but I do not know how to print it for the root directory. Here is...

Recursively expand and search pattern of specific subdirectories

python,path,filepath,subdirectories,wildcard-expansion
I'm looking for an option to search specific subdirectories in python. For instance a directory structure like this: some_files/ common/ 2009/ 2010/ 2011/ ... I only want to search for in the subdirectories that start with a 2, so that it must be something like 'some_files/2*'. I think it must...

How to use default path for ActivePerl 5.20 Mac OS X (/usr/bin/perl) instead of /usr/local/ActivePerl…?

osx,perl,path,osx-mavericks,activeperl
I have installed ActivePerl 5.20.2 today on Mac OS X 10.9.5 Checking the version of perl in Terminal (perl -v) I see 5.20.2 So everything seems to be ok. But.. When I start my CGI scripts the script is running under built in perl (which is 5.16) (if using #!/usr/bin/perl)....

Multiplatform getResourceAsStream

java,windows,unix,path,separator
What file separators should I use in order to specify a path to resource? I run the packed program java -jar program.jar. Currently I use the following loading inputStream = getClass.getResourceAsStream( File.separator + "resources" + File.separator + "my.class"); On linux, it's correctly evaluated to /resources/my.class and the class is loaded....

User path with username

ruby-on-rails,ruby,path,user,friendly-id
To show User's profile I used their id. In controller: @user = User.find(params[:id]) In routes: get ':id' => 'users#show' But now I try new way with username: get ':username' => 'users#show' #route @user = User.find_by(username: params[:username]) #controller And when I go to user's profile with /username I see error: undefined...

Path to Android folder with all images

android,path
I'm trying to build a feature to load the latest saved image from the device into an app. Currently I'm using this path DCIM/Camera/ but it only stores camera taken images. Is there a folder that stores all images? (screenshots, images saved from the web or camera roll)

Mule - Exported project - Error java.io.FileNotFoundException

deployment,path,wsdl,mule
I have exported my mule project which contains a WSDL file in src.main.resources/wsdl-request. The type of export is AnyPoint Studio Project to AnyPoint Deployable Archive. The problem is that when I execute the deployable archive in the server it return this error: Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'file:/C:/Users/usrAdmin/AnypointStudio/workspace/mule-project-test/src/main/resources/wsdl-test/Request.wsdl'....

set css image from current folder using jquery script page

javascript,jquery,css,asp.net,path
I have an external Javascript page located under ../Scripts/CBox/ folder from parent. There is an image located in the same folder. I want to set background-image for a control using Jquery from there. When I use this code, It sets the background-image path as localhost:7905/ddl_arrow.png where localhost:7905 is my asp.net...

Python how to join cross platform paths

python,path,os.path
If I have a json directory structure that lists paths in mac format ()i.e. "/0000_test/video.mp4" and I want to join it with c:\\ the mac format, is there a way to do this? So on windows the path would be returned as c:\\0000_test\video.mp4" I have tried os.path.join to no avail...

Traverse a tree from root to all children in Objective-C

objective-c,recursion,path,tree
A simplified version of what I want to do is to turn a tree like this: Into an array like this: ["abc","abd","ae"] Basically I want to traverse the tree from it's root node to each of the children. I've tried doing this by putting a for-in loop in a recursive...

Change ID in File

java,file,text,path,rename
Let's say I have this notepad file name: Company_XXX_768_JGH.txt Contents: Random Text Blah Blah Blah Network ID: 80801568 I need to change the ID last 4 numbers (1568) to (0003). So far I am able to read the whole, find the line with the number AND print a statement for...

Specifying file path in Mac

osx,path,identification
I shifted to Mac last week and trying to run python code that i used in my windows machine. However, I could not specify the file path correctly and repeatedly getting error. File path as seen from machine: The code i used is as follows: for line in open('Macintosh HD/Users/mageshpoondi/Documents/2015/Travel/IPL2015-5.5.2015.txt')...

Using URL vs Filepath to include css?

php,css,url,path
Which one is better ? Using URL to include css ? <link rel="stylesheet" href="<?php echo BASE_URL; ?>/css/style.css"> Or, using filesystem ? <link rel="stylesheet" href="<?php echo BASE_PATH; ?>/css/style.css"> BASE_URL containes the base url of the app, and BASE_PATH contains the file path to the base of the app....

Cannot set PHP include_path

php,ubuntu,path,include-path
I have uploaded all my files in var/www/html and in one of my php files I have this line : require_once('libraries/stripe/init.php'); the structure of my folders are list this: www -html/ -libraries -> Stripe -> init.php -register.php I keep getting this error message: Warning: require_once(libraries/Stripe/init.php): failed to open stream: No...

Zcat + awk with absolute path

linux,shell,awk,path,zcat
In my "test.tar.gz" there is a text file : "test.txt" with : col1 {tab} col2 {tab} col3 - The problem is, when I run it : zcat ./folder1/test.tar.gz | awk -F '\t' '{print $1, $3}' It returns : test.txt So if I add : zcat ./folder1/test.tar.gz | awk -F '\t'...

Generate TCPDF output to a shared drive folder

php,pdf,path,directory,tcpdf
I'm trying to save my PDF file to a "Shared Folder", I'm using a configuration file to set the "Shared Folder" and then I just set the path inside the PHP file. However it doesn't allow me to save with a "Shared Folder" path, it gives me the error: Failed...

PHP web crawler, check URL for path

php,url,path,web-crawler,bots
I'm writing a simple web crawler to grab some links from a site. I need to check the returned links to make sure I selectively collect what I want. For example, here's a few links returned from http://www.polygon.com/ [0] http://www.polygon.com/2015/5/15/8613113/destiny-queens-wrath-bounties-ether-key-guide#comments [1] http://www.polygon.com/videos [2] http://www.polygon.com/2015/5/15/8613113/destiny-queens-wrath-bounties-ether-key-guide [3] http://www.polygon.com/features so link 0 and...

Python command removed from PATH when adding PIP

python,cmd,path,pip
I started by downloading Python and adding it to the PATH variable setx PATH c:\Python27 Next when I run the Python command it works Next I installed pip and I had to add it to de PATH variable setx PATH c:\Python27\scripts Now when I run the PIP command it works,...

How to Combine Two paths?

c#,xml,path,filenames
I have an XmlTextReader to read series of XML files to load some information in to my program. However, in some XML files I have the file name of an image and I want to load that image. But the problem is the XML file does not have the full...

A way to include paths dynamically in php?

php,path
I have structured a server with this file and folders: index.php |lib -> lib.php |framework -> fw.php |folderA -> index2.php In lib.php there is functionA() with a require_once inside that calls "fw.php" correctly from index2.php: functionA(){ require_once "../framework/fw.php"; //other stuff... } if it's called from index.php, the path must be...

Rake not exporting PATH

ruby,path,environment-variables,rake
I would like a Rake task to export the path to my command line tool to $PATH, and so I have the following line in my Rakefile: task :make_path do sh 'export PATH=$HOME/Desktop/folder:$PATH' end When putting that line export PATH=$HOME/Desktop/folder:$PATH into the terminal directly, the path is prepended to my...

How do I edit $PATH (.bash_profile) on OSX?

osx,path,terminal,osx-yosemite
Hello I am trying to edit a entry to PATH, as i added something wrong. I am using OSX 10.10.3 I have tried touch ~/.bash_profile; open ~/.bash_profile Bu the file editor open, with nothing inside. What it is: I am trying to Install ANDROID_HOME to my PATH I miss typed...

algorithm for ai to chase player in straight line?

java,algorithm,path,libgdx
I am making a game in libgdx(java) where squares chase the main player. I can't figure out how to make the squares move in a straight line directly to the player at a constant speed. this means i want the squares to travel the same distance every second. I make...

Simplexml get path from variable

variables,path,simplexml
Is there a way to pass the path to a simplexml node as a variable? This is what I tried: //set the path to the node in a variable $comp = 'component->structuredBody->component'; echo count($xml->component->structuredBody->component); //=== 13 echo count($xml->$comp); //===0 echo count($xml->{$comp});//===0 ...

Check md5sum of all files in a directory in python

python,path
I am having too many duplicate songs on my hard-disk and i want to remove duplicates.What i want to do is write a python program to check md5sum of all files and remove file with similar md5sum but keeping at least 1 copy.The issue i am facing is that music...

Adding Pygame to PYTHONPATH

python,path,pygame,pythonpath
Windows 8 64 bit Python 3.4.3 Pygame-1.9.2a0.win32-py3.4 I'm in the process of trying to install Pygame now. This computer has two hard-drives, and I'm not sure if that means anything, but when I try and install Pygame it defaults to my D:\ drive. Python itself is installed on my...

set the OpenSSL_HOME variable

amazon-web-services,https,path,openssl,command-prompt
I am trying to configuring HTTPS based on this tutorial: Configuring HTTPS for your Elastic Beanstalk Environment I am stuck at the following section: To set the OpenSSL_HOME variable Enter the path to the OpenSSL installation: c:\ set OpenSSL_HOME=path_to_your_OpenSSL_installation My openSSL is installed in c:\OpenSSL, so would I write set...

Python Path Library Using regular expressions to search for files

python,regex,python-2.7,path
I am trying to remove duplicate files(rather the files with extended "(number)" in the end. I am using regular expression "^[a-zA-z0-9_]+\([0-9]*\)\.pdf$" for that purpose. There is no issue with the regex. Following is my code import re; from path import path; pattern1 = re.compile("^[a-zA-z0-9_]+\([0-9]*\)\.pdf$"); p = path("/home/jill/Downloads/Dinamalar (copy)") #Deletes the...

Joomla css path incorrect

css,joomla,path
i have a problem with the joomla css path... Go to the url for check : http://www.vendreweb.fr/cx/ You can see the page is correct, but now click on Shipment button... you will see my problem... The Fields css won't run correctly... Can you help me please :( Below the source...

How to write a Scala parser for paths?

scala,parsing,path
I am a beginner in scala writing a scala parser in which I need to parse a path like this (suppose x is an integer): /hfds://xxx.xxx.xx.xxx:xxxx/path1/path2/filename1.jpg I tried the following not sure if I am on the right track: def pathIdent: Parser[String] = ("/hdfs""+"""(\d+~\.\d*)"""+ ~("""(u[a-zA-Z0-9])*+"""+"\.[\\'"jpg]"").r I know it has errors!...

Using Express' route paths to match `/` and `/index`

javascript,regex,node.js,express,path
I'm using Express and I want to match / and /index to the same route. But if I write app.route('/(index)?') Node throws this error: c:\myproject\node_modules\express\node_modules\path-to-regexp\index.js:69 return new RegExp(path, flags); ^ SyntaxError: Invalid regular expression: /^\/(?(?:([^\/]+?)))?e\/?$/: Invalid group at new RegExp (native) at pathtoRegexp (c:\myproject\node_modules\express\node_modules\path-to-regexp\index.js:69:10) at new Layer (c:\myproject\node_modules\express\lib\router\layer.js:32:17) at Function.proto.route...

Running JAR file from terminal (Runtime.getRuntime().exec) with both native and .jar dependencies

java,linux,jar,path,classpath
I am having trouble running a JAR file from terminal which has both native and .jar dependencies. Okay, my goal isn't to run it from the terminal, but to run it as a separate process with Java's Runtime.getRuntime().exec function, but if I can't run it from the terminal, then I...

Find the path of every running process in Python

python,windows,process,path,psutil
I want to find the path of every running process in windows. I tried to use the psutil module but it doesn't show me all the paths. It can't find many processes' paths because of the error: "psutil.AccessDenied" c = wmi.WMI() for process in c.Win32_Process(): p = psutil.Process(int(process.ProcessId)) try: path...

Python is not recognized after cd

python,windows,batch-file,cmd,path
I am using Windows 8 64-bit. I installed Python, and see that Windows Path is appended by the two paths : C:\Python27\Scripts; C:\Python27; So when I run cmd and type python I get the error 'python' is not recognized as an internal or external command, operable program or batch file....

JavaFX load image from external folder

java,image,javafx,path,folder
I need some help with importing Images to my JavaFx application: My image has the path : /sprinter/ExternalSprinterFolder/Maps/map_asteroid/map_asteroid.jpg My GUI code has the path: /sprinter/src/de/sprinter/gameclient/gui/SelectSectorGui.java I tried already a lot but I can't load the image... I tried for example: File file = new File(imagePath); Image image = new Image(file.toURI().toString());...

Run tomcat application from any subdomain, subfolder or ROOT

java,url,tomcat,path
I'm new to java web development so bear with me. I have created a application which runs on localhost:8080. The application uses a simpel MVC setup (controller servlet forwards request to jsp page). If I deploy my application to a remote server in a subfolder (www.myserver.com/myapplication) the application does not...

formatting path string in javascript

javascript,node.js,path,format
If you feel that you have to down-vote this question I would be grateful that would comment on it: any feedback is better that no feedback. I have been trying to format an array of mixed path (unix and windows format) and to remove the root directory in certain case....

What does // mean when it is used in a file path? (Classic ASP)

file,asp-classic,path
On this site I have taken over development of, it keeps using file paths for certain images like: /ClassicWeb//pictures/catalogs/world.gif or ..//pictures/catalogs/cintas.jpg It doesn't appear to be an escape character because it is only used for one of the slashes. What does the // (double slash) signify when it is used...

Move node along path without PathTransition

javafx,path
Problem I want to move an object along a Path. The PathTransition works in terms of Duration, but I need to use the movement along the Path in an AnimationTimer. Question Does anyone know a way to move a Node along a given Path via AnimationTimer? Or if someone has...

Android: When I save a file in the phone's internal memory will store Where's that file? How can I access it path?

android,android-activity,path,android-sdcard
we have 2 memories for store files: 1- phone memory 2- sd card memory now : I can access to files and roots in sdcard memory with Environment.getExternalStorageDirectory ... and return : /storage/sdcard0 this is ok. but : When i store files and media (music,pic, ...) in phone memory, how...

Can you set cwd for abspath?

python,path,python-3.4
I am trying to expand out a relative path into an absolute path. The relative path will sometimes in include a . which will need to be expanded out from the current working directory. I was wondering if the any standard functions in Python accept a cwd kwarg, like subprocess.popen...

Fetch a saved image and display

ios,image,path
I am developing an App in which I have stored images through imagePicker. now i want to display same images in my collectionView. I got response as a path path=assets/image/155/155_557b1259b8a51.jpg when i add http://xyz.com.assets/image/155/155_557b1259b8a51.jpg then it shows error. How can i get the images through this path.Please Help me out....

Powershell Join Path returns array

arrays,powershell,join,path
I am trying to create folders at the start of my script and afterwords create files in those. To create paths i use md -Force $path, i also used just to test similar methods if(![System.IO.Directory]::Exists($path)){ [System.IO.Directory]::CreateDirectory($path) } After creating the path i like to build the filename + path of...

how to provide 'make directory as source root' from pyCharm to terminal

python,path,pycharm
I have some problems with migrating to production: cabox@box-codeanywhere:~/workspace/PEP$ python ./dev_scrapers/jordan.py Traceback (most recent call last): File "./dev_scrapers/jordan.py", line 3, in <module> from utils import create_entity, create_id, custom_opener ImportError: No module named utils i have used pyCharm with button 'make directory as source root' how to execute such command in...

Issues with relative paths in PHP includes

php,css,path,brokenimage
Before going on, I'd just like to say that I've tried pretty much everything, and I read a lot of questions here at Stackoverflow, but none of the solutions worked. So here is the deal, I have a file ("empresaConf.php") that contains this code: <?php include 'navigator2.php'; ?> <div class="contTudo">...

Animate raphael objects

javascript,html,path,raphael
I'm quite new to raphael.js and I'm trying to animate raphael elements. For example, I've drawn an arrow using paper.path(). var arrow = paper.path("M10,10L100,100"); arrow.attr({ "stroke-width": 5, "stroke-dasharray": "-.", "arrow-end": "classic-wide-long" }); How do I make the arrow's color seem like flashing when it's drawn?...

Python - input of file path

python,file,path,python-2.x
this code works fine when I put the path of the file myself. but when I want to get it from users raw_input() it doesn't work. what can I do? import string import random print "enter number between 6 and 20" n = raw_input() print "enter pathway of file" p...

How to make D3.js path generator append two points?

javascript,d3.js,path
Using D3.js I would like to create a graph that has horizontal lines, which are connected by a line. See this example: http://s15.postimg.org/7ffms1f7f/tmp.png With the help of some tutorials I managed to display the horizontal bars using line. jsfiddle.net /m2p1xky9/4/ For displaying connected bars it made sense to me to...

Center Aligning an SVG element?

svg,path
I don't know how to really explain this but how can I center align this logo http://jsfiddle.net/fa7w3h99/3/ I have tried the following but it didnt seem to work as intended. .center-logo { display: block; margin: auto; } ...

Normalize arbitrary file paths in bash on OSX

osx,bash,file,path
I'm looking for a way to normalize arbitrary file paths in bash, resolving . and .. to their absolute values. Examples: > cd /foo/bar > normalize_path "." /foo/bar > normalize_path "../baz" /foo/baz > normalize_path "../../folder/that/doesnt/exist/" /folder/that/doesnt/exist Notice how in the examples above, normalize_path returns a value even if the path...

How to make `MANPATH=~/.nmap/doc man 1 nmap` look for nmap.1?

linux,path,gnu,man,system-paths
I recently decided that since quite often I experiment with the latest version of nmap, it might be a good idea to keep its SVN checkout in ~/.nmap without installing and just run svn up; make to make it up to date. I added ~/.nmap to $PATH and just realized...

GetFullPath no output ?! VB.NET

vb.net,visual-studio-2010,path
Good evening to all of you! I have a problem that I can't solve with the method GetFullPath in vb.net. What I want to do : I would like to get the full path of a text file (test.txt) which is located in the same folder as the app.exe, the...

Meteor - Router.go() doesn't run when passed a variable

templates,meteor,static,path,iron-router
I have a template for a back button I've been reusing: <template name="btnBack" label="" path=""> <a href="" data-path="{{path}}" class="btn btn-info btn-small" role="button"> <span class="glyphicon glyphicon-menu-left" aria-hidden="true"></span> {{label}} </a> </template> I pass it two fields, label and path statically. My intention is to pass the static path field to Iron-Router to...

Why am I missing PYTHONPATH?

python,python-2.7,path,xubuntu
I was trying to list installed packages in newly installed Xubuntu 12.04 with: for d in `echo "${PYTHONPATH}" | tr ':' '\n'`; do ls "${d}"; done but after I got nothing I figured out that I am missing PYTHONPATH. Then I tried it on my Xubuntu 14.04 and I got...

Rails less url path change

ruby-on-rails,ruby,url,path,less
Developing a Rails application with the less-rails gem I found something unusual : // app/assets/common/css/desktop/typo.less @font-face{ font-family:'SomeFont'; src:url("fonts/db92e416-da16-4ae2-a4c9-378dc24b7952.eot?#iefix"); // ... } The requested font is app/assets/common/css/fonts/db92e416-da16-4ae2-a4c9-378dc24b7952.eot This font is compiled with less and the results is : @font-face { font-family: 'SomeFont'; src: url("desktop/fonts/db92e416-da16-4ae2-a4c9-378dc24b7952.eot?#iefix"); //... } Do you know why is...

Doing a batch file for first time

batch-file,path
First time doing batch files, I don't even know how to do it. I need a batch file that given a path (say I:\FOLDER1\SUBFOLDER1\) will produce a text file showing all the subfolders in that directory as fully qualified paths. Something like this: I:\FOLDER1\SUBFOLDER1\SUBSUBFOLDER1 I:\FOLDER1\SUBFOLDER1\SUBSUBFOLDER2 I:\FOLDER1\SUBFOLDER1\SUBSUBFOLDER3 I:\FOLDER1\SUBFOLDER1\SUBSUBFOLDER4 ... ...

How to use Expression Tree to safely access path of nullable objects?

c#,lambda,path,tree,expression-trees
When I get deserialized XML result into xsd-generated tree of objects and want to use some deep object inside that tree a.b.c.d.e.f, it will give me exception if any node on that query path is missing. if(a.b.c.d.e.f != null) Console.Write("ok"); I want to avoid checking for null for each level...

How do I make findstr show the full file path inline?

command-line,path,grep,dos,findstr
When I use grep I get a list of matching results with the full file path for all the child subdirectories. When i do this with findstr - I don't get the inline results. My question is: How do I make findstr show the full file path inline?...

Java get path of executing jar without .jar file

java,path,resources
I am trying to export my app into jar using intelij Idea artifacts. I export everything except for resources (14,5GB is in my opinion too much for .jar file) so I have put /res folder inside same folder as jar. Right now my structure looks like this: /SAR.jar /res/colors/ /res/icons/...

How to find path of the user profile in VBA

windows,vba,path
How can I get the path of the current user that is as same as %UserProfile% result in Windows 7?

IllegalStateException: Iterator already obtained [duplicate]

java,file,loops,path
This question already has an answer here: java.lang.IllegalStateException: Iterator already obtained 1 answer so I wrote a little Java program to test a little stack language I made vie various test file, but for some reason it won't work. Here is the code: import org.apache.commons.io.FilenameUtils; import java.io.IOException; import java.nio.file.*;...

python to guess specific path?

python,path
I am working on a script to get information from the Skype database. I got the following code: con = sqlite3.connect('C:\\Users\\joey\\AppData\\Roaming\\Skype\\jre93\\main.db') But the skype ID (jre93) and the USER (joey) of the computer are always different. Is there a way python can recognize those path automatic with out user input?...

TeamCity checkout GitHub repo to specific absolute path

github,path,teamcity,git-checkout
My TeamCity VCS Root step needs to checkout a specific GitHub repo to a specific absolute folder on the agent ( Windows server ) : c:\github\{organization}\{repo} I'm not understanding how to construct my checkout rule to do this. By default, checkout rules are relative to the checkout dir which is...

IOError: [Errno 2] No such file or directory

python,python-2.7,path,ioerror
I'm trying to add some informations of all the torrents file in a path to a Table of my MySQL database but it seems like i have some PATH problems. As you can see there is the full path and it even detect the "charlie.torrent" so i don't really understand...

Difference between Environment.getExternalStorageDirectory() and Environment.getExternalStorageDirectory().getAbsolutePath()

android,path,environment
What's the difference between Environment.getExternalStorageDirectory() and Environment.getExternalStorageDirectory().getAbsolutePath() or Environment.getExternalStorageDirectory().getCanonicalPath() or Environment.getExternalStorageDirectory().getPath() I know what getAbsolutePath(), getCanonicalPath() and getPath() are. I see in some examples Environment.getExternalStorageDirectory() is used like this: getExternalStorageDirectory() + "/somefolder/anotherfolder/" What confuses me is what getExternalStorageDirectory() itself as...

Bad Interpreter Error Trying to Install Packages in Anaconda

python,linux,path,packages,anaconda
I'm trying to install neo into my Anaconda distribution using conda install -c https://conda.binstar.org/neuroinf neo (taken from here) but am getting the error: bash: /transform/anaconda/bin/conda: /usr/local/anaconda/bin/python: bad interpreter: No such file or directory It's not finding /usr/local/anaconda/bin/python because it doesn't exist. I have anaconda installed in /transform/anaconda/. I've edited my...

Using Ruby Pathname to access relative directory

ruby,path,pathname
Given I have a relative path pointing to a directory how can I use it with Ruby's Pathname or File library to get the directory itself? p = Pathname.new('dir/') p.dirname => . p.directory? => false I have tried './dir/', 'dir/', 'dir'. What I want is p.dirname to return 'dir'. I...

Cannot find file path

c#,path,windows-ce,c#-2.0,relative-path
I'm using Windows CE 6.0. I'm developping an application that needs to read a XML file (bar.xml) that is placed right next to my executable (foo.exe). I try to access it with the following method, called right after my Main() : private void ParseXmlFile(string _sFileName) { XmlDocument l_doc = new...

can't get to bash_profile file to edit the path on mac

path,edit,.bash-profile
I can't access my .bash_profile file to edit my environment path. I was editing it in nano, saved and exited, making it so I only have one file path that is useless and can no longer do anything such as sudo or ls. I've tried nano, vi, open, grep search,...

user.dir is incorrect while using tomcat web app in eclipse

java,eclipse,tomcat,path,relative-path
I have a configuration project that few projects are using it. All of my project under the same workingspace. workingspace/configuration workingspace/webapp1 workingspace/mongoDB workingspace/model mongoDB and the model project are using the configuration jar project and able to read the xml files using relative path ../configuration/conf/....xml when using the System.out.println("Working Directory...

How can I implement functionality like the program which?

c,string,path,strtok,stat
I'd like to find if the program less is installed on the system. I'm not allowed to use a direct system("which less") because of my requirements. So I'm going to try the PATHs in the PATH variable and do stat on the files to see if less is installed. But...

python3 subprocess in Oracle Linux (wget -o)

python-3.x,path,subprocess
I see there are several posts on python subprocess invoking bash shell commands. But I can't find an answer to my problem unless someone has a link that I'm missing. So here is a start of my code. import os; import subprocess; subprocess.call("wget ‐O /home/oracle/Downloads/puppet-repo.rpm https://yum.puppetlabs.com/puppetlabs-release-el-6.noarch.rpm"); When I do wget...

RegEx for selecting the first element of a path

regex,path
My question is pretty simple, I would like to write a RegEx that does this: / -> / /foo -> /foo /foo/bar -> /foo /foo/bar/baz -> /foo I've tried this: replace(/(\/[^\/]*)\/[^\/]*/, '$1') But it returns the path, unmodified. Does anyone know how to do?...

Running custom program located in /bin

linux,unix,path,bin
I have created a folder ~/bin. This is my own bin to store my own custom programs. As a test, I wrote a simple hello world program. I export using PATH=~/bin:$PATH so that Linux looks in that directory. If I save hello (my test program name) I can successfully run...

Calling python scripts from anywehre

python,unix,path
I have a collection of python scripts that import from each other. If I want to use these in a location where the scripts are not physically present, how can I do this. I tried adding the path of the dir with the scripts to my $PATH but got no...

Sublimerge on SublimexText2 gives error /bin/sh: git: command not found Exit code: 127 on OSX 10.8.5

osx,git,path,sublimetext2
I installed Sublimerge on SublimeText2, it was working fine until it started giving the following error /bin/sh: git: command not found Exit code: 127 Git path on the computer has not been changed and git works as is. Not sure why then Sublimerge is unable to find the path. Thanks....

Cannot locate java installation error for logstash

java,path,logstash,java-home
I downloaded Logstash-1.5.0 on Windows 8.1 and tried to run it in the command prompt. First I checked the java version. Then changed the directory to logstash-1.5.0/bin then entered the command logstash -e 'input { stdin { } } output { elasticsearch { host => localhost } stdout { }...

Issues with relative/absolute path

php,path,relative-path,realpath,pathinfo
I've searched ways to do it so it would work but none of them seemed to work for all paths, so I was wondering if you could give me a direction on how to do this: This is the structure: Home Directoy config.php index.php includes/ user_login.php applicant_track.php ucp/ index.php When...

JOptionPane Message with File Path

java,swing,file,path,joptionpane
Is there a way to put a filepath into a JOptionPane? E.g. I have a folder in my project directory and would like to get the path to that folder and show it into the message....

Add TeX path to R Studio - Ubuntu

path,ubuntu-14.04,tex,sweave
I'm having the same issue as this question: When I open any .Rnw file, R Studio says that I have no TeX Distribution installed: I'm using Ubuntu 14.04 w/ Gnome and TeXLive 2014. I include the line PATH=/usr/local/texlive/2014/bin:${PATH} in the Renviron.site file, which now looks like: ## Emacs please make...

How to implement Flask Application Dispatching by Path with WSGI?

python,path,flask,wsgi,dispatch
I would like to use a single domain as a Staging Environment for multiple flask applications that will eventually run on their own domains. Something like: example_staging.com/app1 example_staging.com/app2 example_staging.com/app3 where: example_staging.com/app1 acts same as app1.example_staging.com example_staging.com/app2 acts same as app2.example_staging.com example_staging.com/app3 acts same as app3.example_staging.com or: example_staging.com/app1 acts same as...

Error when using python to change directories in script

python,path,cd
I am creating a program that will convert files. My main issue is that I need my program to change the working directory. I have the code for that, but it keeps saying that there is: OSError: [Errno 2] No such file or directory: Do you guys have any ideas....

Haxe add own Modules to path

import,path,haxe,haxelib
I created some Modules from .Net dlls using cslibgen. Now I want to be able to use these modules in my haxe projects by using the import statement. For testing I used cslibgen on mscorlib.dll (to be able to use the system.Console class). Of course, when I make a project...

Store Core Data Sqlite in NSLibraryDirectory or NSApplicationSupportDirectory?

ios,sqlite,core-data,path,sync
What is the difference between NSLibraryDirectory and NSApplicationSupportDirectory? Which one is the best place to store the Core Data .sqlite file if I am planning on using a syncing service? I currently store my .sqlite file in NSLibraryDirectory. If NSApplicationSupportDirectory turns out to be the better choice, how will changing...

Is there a way to find the home screen directory? [closed]

java,android,path,folder,home
My Question may be stupid but let's say how can I get the path of a folder in the home screen My problem is that I can't think of away to get the path of a folder in the home screen. Let's say i have a folder with some applications...

Javascript onclick display multiple SVGs

javascript,svg,path,onclick
I am trying to display multiple SVG paths after clicking on a SVG polygon. I was able to get and individual path to appear onclick by using document.getElementById(id).style.display = "block"; getElementById() on works for one path though. How can I get the onlclick to work for multiple paths? I tried...

What is the difference between (., .., …) in html file path?

html,path
So my question is what is the difference between. . .. ... I know .. goes up 1 directory. And . I think is used for current directory but I don't know what the ... is for. Can anyone tell me?...

Indirect function with file path

excel,file,path
I am trying to create a formula that will look at four cells and return the contents of a cell defined by the contents of the 4 ref cells. for example: a1 - file path a2 - workbook name a3 - sheet name a4 - cell ref I've tried to...

how to upload multiple files, store their paths in different columns in a mysql database row

php,mysql,file,upload,path
Hello i am trying to create a subscription form, that allows a user to fill in a form and upload multiple files. already i have gotten some directions on this site as regards uploading a file and storing their paths in a database using this. <form method="post" action="addMember.php" enctype="multipart/form-data"> <p>...

Multiple SSH Clients on Mac

osx,ssh,path
I have multiple SSH clients on my mac, one is at /usr/local/bin//ssh and the other one is at /usr/bin/ssh I want to use /usr/bin/ssh always! My PATH looks like: /usr/local/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin I am wondering how to set default SSH to /usr/bin/ssh without modify the PATH?...

Python 3 not aware of Windows filename encodings?

windows,python-3.x,encoding,path,filenames
The following code works well in Win7 until it crashes in the last print(f). It does it when it finds some "exotic" characters in the filenames, as the french "oe" as in œuvre and the C in Karel Čapek. The program crashes with an Encoding error, saying the character x...

Error in system(cmd, input = filelist, intern = TRUE) : 'zip' not found

r,path,mnist
I tried to read the MNIST database using the package darch and the function readMNIST() It seems to work fine until I get the message: Error in system(cmd, input = filelist, intern = TRUE) : 'zip' not found' I looked on the internet and found out that was because I...

boost shortest path finding algorithm

c++,boost,graph,path,shortest-path
Good day, dear friends. I want to find shortest path in random graph. I use boost graph library. As I understand I need to build graph using existing distances between dots. After that I need to use some algorithm... As I see Dijkstra's algorithm is really finds all paths from...

Why can't I access my vi folder?

mongodb,path,terminal,root,cd
I keep getting this error on my terminal which stops me accessing the vi folder. I've been trying to set a path to the MongoDB bin and when experimenting on how to do this, I think I've broken the folder. Can someone please help? Last login: Mon May 18 10:31:54...

Is there a way to drill down/search directory in dotcms?

path,dotcms
For example, if I wanted to go to mysite.com/this/is/the/path is there a way to just drill down to that path quickly via some search function? Scrolling through layers and layers of folders is no fun, especially on a siteas big as ours is here at work. As far as I...