path

Best practice: retrieving paths that don't physically exist

I am currently writing some methods to determine certain paths on the hard drive. For the sake of the example, let's call them GetBasePath(), GetSpecialPath(), etc. My question is, from a design point of view, how should these methods behave if the directories do not exist in the expected location? I am a bit puzzled what the best pract...

Setting a virtual path in classic ASP

Hi All, I'm having trouble after moving my site to a new server. There is an admin page in ASP that is designed to allow the user to upload photos to the SQL database. It seems to be working alright (no errors returned) but the site will only display blanks as though it can't find where the images are saved. So I'm guessing my path m...

PHP: Why such weird behaviour when I include a file from another directory which also includes a file???!

I've never seen anything like this. File structure: somefolder/base.php includes/stuff.php includes/constants.php base.php: <?php require("../includes/stuff.php"); ?> stuff.php: <?php require("constants.php"); echo "Welcome to stuff.php"; ?> constants.php: <?php echo "IMPORTANT CONSTANTS DEFINED HERE!"; ?> Result:...

Wrong xml path or just me?

I have a PHP script that loads in an XML file. That said XML file exists in the same directory as the script - the path in the script for the XML file is relative to the php file. Now when I put that PHP script+XML files in the root of my website it works. Yet when I put that PHP script+XML files in a sub-directory the XML file doesn'...

SVG arcs in java2D for general path

I found this method in this page, that add an arc2D to an general path, i try to understand the method, but i can't, could you help me? public static final void arcTo(GeneralPath path, float rx, float ry, float theta, boolean largeArcFlag, boolean sweepFlag, float x, float y) { // Ensure radii are valid if (rx == 0 || ry...

Export PYTHONPATH - syntax error.

I need to connect MySQLdb - module. I download MySQLdb - module and install it. But when i write (in python interactive shell): import MySQLdb - i get no module named MySQLdb. Then i decided to include MySQLdb directory in PYTHONPATH variable. I write (in python interactive shell): export PYTHONPATH=${PYTHONPATH}:/where/module/live...

Vocabulary: path in a graph of objects?

Hi. I'm having trouble with the following sentence: DeepClone performs a deep clone of the target object, stopping the cloning process when all <dependency paths> have reached a value type or an ITransactionalObject. What I mean by "dependency path" is the chain of references you follow in the cloning process: object A has a ...

In a batch file, Combining two strings to create a combined path string

I need to take two strings and combine them into a single path string inside a batch file similar to the Path.Combine method in .Net. For example, whether the strings are "C:\trunk" and "ProjectName\Project.txt" or "C:\trunk\" and "ProjectName\Project.txt", the combined path will be "C:\trunk\ProjectName\Project.txt". I have tried using...

Robocopy filter not working?

Hi I'm trying to use robocopy to copy a single file from my computer to another computer over the network. The file I'm going to copy is named setup.exe and the directory it rests in also has a directory called "setup". I only want to copy over the executable, so I tried applying a filter to the robocopy command at the end listing the fi...

Regex: match all but two dots

Hi, I'm trying to validate a system path. This path is valid if it begins with some dirs and don't contain two dots one another. #valid path /home/user/somedir/somedir_2 #evil path /home/user/../somedir_2/ I know how to check for two dots in a path: \.\. or [\.]{2} But I really want to do something like that: /home/user/<match ev...

Install my compiled libs in the system to be used by an executable

Hi! I am using Xcode and, after some struggling, it is compiling my dynamic libraries okie dokie for now. My kinda-problem now is that I need to use those libs with another project, that is an executable. I would like that Xcode, after compiling my libs, copy them to the executable folder, or, better, copy the libs to a system dire...

Running a different CMS system under drupal folder.

Hi friends, I'm a drupal newbie... I completed my first drupal site. then client wanted to run their old CRM under new drupal site, they uploaded CRM folder into drupal folder, and when I try to address the CRM admin, as below, it redirects drupal 404 page (which is search page). www.blablabla.com/crm/admin Error message from dru...

PHP: find key position in multidimensional array

Possible Duplicate: PHP: get keys of independent arrays Hello. I have a multi-dimensional array. I want a function that finds the position of the given array key (all my array keys are strings) and then returns the position of the key as an array. E.g: $arr = array ( 'fruit' => array( 'apples' => array(), ...

How to get the list of images in the application folder wpf

Hi All, I want to get the image list in the image folder in the application folder. The following code will returns the Images in the Mypicture folder. string[] files = System.IO.Directory.GetFiles(Environment.GetFolderPath(Environment.SpecialFolder.MyPictures)); Geetha ...

get resource path

Hello, created a new folder "resources" with all my images in eclipse. I added this folder to the class path. Now i tried to access this images URL url = new URL("imageA"); I also tried URL url = new URL("resources/imageA"); Both doesnt't work. What is wrong? Sincerely Christian ...

XAML image source set dynamically based on content

Well it's not really very dynamic, at least it won't change at runtime. The idea is I have buttons and each one has a unique image ( icon 32x32 ). The buttons all share a style where I mess with the ControlTemplate. So each image also has 2 colors one normal and another when I mouse over. I noticed that when I declare the source path f...

Expand Python Search Path to Other Source

I have just joined a project with a rather large existing code base. We develop in linux and do not use and IDE. We run through the command line. I'm trying to figure out how to get python to search for the right path when I run project modules. For instance, when I run something like: python 'someprojectfile.py' I get ImportError: no...

Finding Shortest path in DAG (unweighed), between 2 vertices

Before the Floyd–Warshall/Dijkstra replies flood comes in please let me explain the situation as i'm sure either algorithm can be tuned for this case, and it has to be as this is not a toy example program (mind you, in java so have to keep it manageable memory-wise) What i have is a web graph generated from node 0 to node n, node 3 cann...

Question about SVG path specification regarding absolute and relative path definitions

Hi all! Currently I'm developing an app that converts svg-paths created by Inkscape. Now I'm not clear about the path specification regarding absolute and relative path-combinations. Does the specification say anything about a path definition, that holds relative and absolute coodinates at the same time? Espacially the case regarding an...

How do I get my current working directory in Java?

Let's say I have my main class in C:\Users\Justian\Documents. How can I get my program to show that it's in C:\Users\Justian\Documents. Hard-Coding is not an option- it needs to be adaptable if it's moved to another location. I want to dump a bunch of CSV files in a folder, have the program recognize all the files, then load the data ...