path

python location of the running program on windows

I have an python application that need to know in which directory it founded when it run, how can i know the running application path on windows for example when i change the directory path is changed to the new directory . is there a way to know where is the python application run withour saving it on the beginning by os.path.abspath(...

How to open a file with it's relative path in Linux?

I have a program which opens a file by using a relative path (for instance '..'). Now the problem is, when I execute the program from another directory, the relative path is not relative to the program but relative to the working directory. Thus, if I start the program with '/path/to/program/myprog' it fails to find the file. Is there ...

SVN: translation between path and node ids?

I have some build info used to identify at runtime the Subversion version # and the URL of the source directory within the repository. Does SVN use any kind of node ID to identify paths? I'm using an embedded system with a communications link that does not deal well with large data fields, and would be much happier using a 32- or 64-bit...

How to get the fully qualified path name in C++

Hi, Is there a function that returns the fully qualified path name for any inputted file? I'm thinking of something like: LPCSTR path = "foo.bar" LPCSTR fullPath = FullyQualifiedPath(path); //fullPath now equals C:\path\to\foo.bar Thanks ...

Installing Ruby on Mac 1.9.2, still getting 1.8.7 even though path changed

I'm on a Mac running 10.6.4 Snow Leopard, and apparently ruby comes ready to go. But I'm new to Ruby, trying to learn the Rails framework, and so i decided to install the latest version 1.9.2. I followed the instructions here, but after I compile and install, when I run ruby -v I'm still getting 1.8.7. Anyone can help a noob out? Whe...

Ruby unc path access on windows

Not sure what i'm missing: I'm trying to access a unc share via irb on a Windows 2k8 machine: irb(main):016:0> Dir.entries('\\server\share') Errno::ENOENT: No such file or directory - \server\share irb(main):017:0> Dir.entries('\\192.168.10.1\share') Errno::ENOENT: No such file or directory - \192.168.10.1\share Any hints? Sven ...

Clipping Paths in Silverlight Mobile (WP7) - I can't create anything but a simple rectangle?

Hello, I'm trying to create clipping paths for shapes, such as circles, polygons, etc. I'm actually trying to make the clipping path follow the line of the shape. I've tried the below in Expression Blend, what am I missing? What I'm really trying to do here is have the user trace shapes with an InkPresenter, and have it error if they've...

HTML Image Tags

I was asked to resolve an issue with shtml file and the problem is like this: A person was asked to edit an shtml file to add a new radio button. She downloaded the file, added some content and uploaded it to the web server. To my utter shock, the img src="images/Front_Page_22.jpg is now pointing to file:///C|\path1\path2\images\Front_P...

Finding the path of the program that will execute from the command line in Windows

Say I have a program X.EXE installed in folder c:\abcd\happy\ on the system. The folder is on the system path. Now suppose there is another program on the system that's also called X.EXE but is installed in folder c:\windows\. Is it possible to quickly find out from the command line that if I type in X.EXE which of the two X.EXE's will ...

Paths - How do I parse / cast or convert a Path to a StylusPointCollection?

Hello, I'd like to convert a Path to a StylusPointCollection. Can I parse this using XamlReader or something similar? Is there a property of the Path that represents Points (x, y coordinates) that I can cast to a StylusPointCollection? If not, is there a way to render the Path out to an x, y coordinates, so I can manually loop through ...

PHP is_file and server root relative paths

Hello! How can I use is_file with a path like: /folder/file.jpg please? Thank you! ...

Open file in eclipse on mac 10.6

I have a deceivingly (at least for me) simple problem. I want to open a file in eclipse FROM Mac's finder. Whenever I try, I get the alert that Eclipse cannot open that file. Yet, from within Eclipse I can open the file, either by double clicking it in the Explorer/Navigator window or going file/Open File ... At the end of the day, I wa...

Find ALL paths in a grid between 2 nodes

I'm trying to find all the paths between 2 nodes in a grid, and the path has to go through all the node from start to end. Example (Start = S, End = E) 0 0 0 0 S 0 0 0 E The answer for the above is 2 paths: (ignore the '.''s) 0-0-0 |.......| 0 S-0 | 0-0-E 0-0-0 |......| 0 S 0 |...|...| 0-0 E I thought of using recursing, but g...

How do I change my gdb path in Unix?

My professor posted this online for a lab this week, but I missed the tutorial and didn't find how to do this. Does anyone know? It is just a simple command line thing, but I have been hunting around and can't seem to figure it out... Hi everyone, A new version of gdb (version 6.8) has been installed on the servers csb and csg (but not...

How do I get my executable's location using Fortran?

Hi everyone, I have a program written in Fortran 90/95; after invocation it always reads a certain data file. For the users' convenience I'd like them to just have to place this file in the same directory as the executable itself, without making them set some environment variable/extend $PATH, and without forcing them to use a certain d...

How to set PATH to use Java and Python simultaneously

Hi, I was just wondering if there was any way to set to %PATH% variables so I can compile my Java code, along with my Python code? For instance.. PATH is currently C:\ ... JDK_bin blah blah, and that's it. To run my python code, I have to change my path variable completely. Any answers? ...

Serving images directly from server with getting path from PHP script.

Hello everyone, as most of you probably know, we can serve images from PHP using constructs like this: RewriteRule ^images/([a-zA-Z0-9]+)\.jpg script.php?image=$1 And then in PHP: header('Content-Type: image/png'); $image=imagecreatefromjpeg($pathComputedSomewhereElse); imagejpeg($image); That's dead simple, but that's not my prob...

paperclip custom :path and :url

Hi, I have some problems trying to custom the :path and :url options for has_attached_file with paperclip: I have a polymorphic class named "Asset" that have : class Asset < ActiveRecord::Base belongs_to :file_owner, :polymorphic => true has_attached_file :picture, :styles => { ...}, :url => "/attachments/user_:use...

Algorithm to find solution to puzzle.

Hello! I am trying to make a game where a player have to find his way from Start to End on the Game Board. As you see this Game Board contains a bunch of red circular obstacles. To win the game the player has to remove a minimum amount of obstacles. So my question is, how do I programatically find out the minimum amount of obstacles t...

How do you change the PATH used in an external makefile build using XCode?

I currently have a project that I'm building with a makefile. This project includes some additional software (jflex) which is not on one of the default system search paths (it's installed to (/opt/local/bin/). My .profile file adds this directory to my PATH, and so building the project from a terminal window succeeds. However, if I try ...