path

Use absolute path for easier modify include path in future?

config.php put at the root level, this file will be included in any pages. Then at config.php <?php define( 'ROOT_DIR', dirname(__FILE__) ); ?> So at all other pages from different sub/a.php , sub/sub/b.php directories, when I want to include a specific file in specific location, I just need to include( ROOT_DIR.'/include/functions....

require_once in php

I have a php file which has a require_once Statement (?) this file is then in included in 2 other php files, one php file is in a sub directory so the layout is like this ("file1" and "file2" include the file "included" which require_onces the "required")# L--subfolder1 | L--file1 L--subfolder2 | L--required L--file2 L--included...

Finding all the shortest paths between two nodes in unweighted directed graphs using BFS algorithm

Hi All, I am working on a problem that I need to find all the shortest path between two nodes in a given directed unweighted graph. I have used BFS algorithm to do the job, but unfortunately I can only print one shortest path not all of them, for example if they are 4 paths having lenght 3, my algorithm only prints the first one but I w...

Is there a PHP equivalent function to the Python os.path.normpath()?

Is there a PHP equivalent function to the Python os.path.normpath()? Or how can i get the exactly same functionality in PHP? ...

Eclipse CDT -- How to map Linux path's to Windows paths?

We have a C-code project written for a Linux environment but we also want the ability to view and edit the code on Eclipse for Windows and have the headers be resolved. The problem we are facing is that a lot of the headers are included with absolute paths in the Linux format such as: #include "/path/to/custom/header.h" What I would l...

Overriding @Path at Jersey

Hi! I've been trying to make a Jersey app that takes the following structure from the path: Example 1 (http:// omitted due to stackoverflow restrictions) example.com/source/{source-id}/ example.com/source/ With code (error handling and unneeded code omitted): With code (sum up): @Path("/source/") public class SourceREST { ... @GET ...

Paths when both including and requesting AJAX

I was wondering if there is a way of making a relative path to the main folder (where the index.php lies) from every file that needs to be included or requested by AJAX. I want to combine both AJAX and PHP include so first time the page loads with PHP, and then to be able to refresh parts of the page with AJAX, but the files are the sa...

Generating a canonical path

Does any one know of any Java libraries I could use to generate canonical paths (basically remove back-references). I need something that will do the following: Raw Path -> Canonical Path /../foo/ -> /foo /foo/ -> /foo /../../../ -> / /./foo/./ -> /foo //foo//bar -> /foo/bar //foo/../bar -> /bar etc......

Win32's PathResolve() and root folder

Win32's PathResolve is resolving \temp into c:\temp, even if I run the function from another drive. In addition, IsRelative() returns false for '\temp' - which makes me wonder what kind of resolution it actually thinks it's doing for this path. ...

commons-exec: Executing a program on the system PATH?

I'm trying to execute a program (convert from ImageMagick, to be specific) whose parent folder exists on the path. Ergo, when I run convert from the command line, it runs the command. The following, however, fails: String command = "convert" CommandLine commandLine = CommandLine.parse(command); commandLine.addArgument(...) ... int exitV...

Adobe Air: Is it possible to save files to a network path (osx)

I was wondering if it would be possible to write a file, not to the local system, but to a connected server or other network path. Would i have to use an external php interface for this or can i entrust this to the AIR framework? I'm pretty sure that AIR has certain security precautions to prevent this. Thanks a bunch! Regards ...

Unix variable best practice: Should variable containing a path end in a slash

What is the best practice when storing a directory in a file name on a unix system? Should the directory path end in a slash? Method A TMP="/tmp/pasteTmp/" which allows you to do: cd "$TMP$fileName" Method B TMP="/tmp/pasteTmp" which allows you to do (with an extra slash which seems less clean): cd "$TMP/$fileName" but a...

Simulink: Specifying trajectory

I would like to use jtraj to specify a trajectory in a Simulink model. Below are what I attempted to retrieve in the command prompt: Q0 = [1 1 0]; Q1 = [1+0.5*cos(2*20) 1+0.5*sin(2*20) 0]; t = 0:0.1:20; [Q, Qd, Qdd] = jtraj(Q0, Q1, t); However, I don't know how to include such trajectory data in the Simulink model easily. Any comments...

What is the equivalent "aspnet_regiis -lk" on Windows 7?

Or: how do I find the IIS metabase paths in Windows 7? I used to just run aspnet_regiis -lk, but this is "Not supported in Windows Vista" according to aspnet_regiis help... ...

What is __path__ useful for?

I had never noticed the __path__ attribute that gets defined on some of my packages before today. According to the documentation: Packages support one more special attribute, __path__. This is initialized to be a list containing the name of the directory holding the package’s __init__.py before the code in that file is exe...

java get file paths

hey everybody, I have a jsp page which contains the code which prints all files in a given directory and their file paths. The code is if (dir.isDirectory()) { File[] dirs = dir.listFiles(); for (File f : dirs) { if (f.isDirectory() for (File d : files) ...

Relative paths in C#

I need some help with paths please! Basically I have a project with the following folder structure: Project (root directory which contains the .sln file etc.) Project/MyProj (contains the code) Project/MyProjTest (the test folder) Project/TestResults Now with this Project I need to have a common folder where I can stick a bunch of fi...

Ant path/pathelement not expanding properties correctly

My property gwt.sdk expands just fine everywhere else, but not inside a path/pathelement: <target name="setup.gwtenv"> <property environment="env"/> <condition property="gwt.sdk" value="${env.GWT_SDK}"> <isset property="env.GWT_SDK" /> </condition> <property name="gwt.sdk" value="/usr/local/gwt" /> <!-- Default value. --> <...

Beginner problem / error with ansi-c and gcc under ubuntu.

Hi, I am just starting programming ansi c with gcc under ubuntu (9.04). I get following error messages: error messages: main.c:6: error: expected identifier or ‘(’ before ‘/’ token In file included from /usr/include/stdio.h:75, from main.c:9: /usr/include/libio.h:332: error: expected specifier-qualifier-list before ...

What's this setting of MATLAB for(which is causing lots of troubles for lots of people)?

This setting in PATH: D:\MATLAB\R2007b\bin\win32 Here is a fresh bad affect by this setting for me: http://stackoverflow.com/questions/2712913/why-does-this-program-require-msvcr80-dll-and-whats-the-best-solution-for-this-k And here's an issue reported by another guy: http://groups.google.com/group/ggobi/browse_thread/thread/dacea0...