path

Relative/Absolute paths - how to absolutely refer to a file outside the website root

For security purposes, all system, images documents are located outside my website root directory. I dont want to use relative paths because some files are called in difference circumstances, and sometimes they are included inside other files. I'm looking for an infallible solution to allow me to maintain my system files outside my root...

PHP - with require_once/include/require, the path is relative to what?

when on "index.php", I do require_once("/all_fns.php"). "all_fns.php" itself requires files with paths relative to all_fns.php (itself). My question is, should I write the paths on all_fns relative to all_fns.php or to index.php? This is all very confusing to me and wanted to get it straight. ...

Detecting address type given an a string

I have a text box, which users are allowed to enter addresses in these forms: somefile.htm someFolder/somefile.htm c:\somepath\somemorepath\somefile.htm http://someaddress \\somecomputer\somepath\somefile.htm or any other source that navigates to some content, containing some markup. Should I also put a drop down list near the text b...

Self-contained egg installs: turbogears and pythonpath

Hi there! I have a TG 1.0 application (not 1.1 -- I'm not sure I can convince the admin to upgrade) running. I have my own checkout of the project from cvs that I'm developing with, and it's come time to integrate xlwt (http://www.python-excel.org/) into the web app. However, I don't have administrator access and it's not easy to get ...

2to3 not working

I'm converting a single module using 2to3. test_lib2to3.py is in /Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/test/test_lib2to3.py File to be converted is in /Users/Nimbuz/Documents/python31/Excercise 1/time3.py Terminal Session: localhost:test Nimbuz$ 2to3 /Users/Nimbuz/Documents/python31/Excercise\ 1/time3.py Ref...

Where is the .emacs file in windows GNU emacs

Where is the .emacs file in windows (I'm using Emacs-23-CvsP091103-EmacsW32-1.58 ) When Emacs starts up, it attempts to load and execute the contents of a file commonly called .emacs (though it may have other names, see Where do I put my init file?) which contains any customizations you have made. You can manually add lis...

Return value of os.path in Python

For this code: import os a=os.path.join('dsa','wqqqq','ffff') print a print os.path.exists('dsa\wqqqq\ffff') #what situation this will be print True? When will os.path.exists('what') print True? ...

Setting up java classpath and java_home correctly in Ubuntu

I am getting the error Exception in thread "main" java.lang.NoClassDefFoundError: When I try and run a compiled class on Ubuntu. I am using a very simple Helloworld example, and the millions of responses which already exist on the internet suggest that my CLASSPATH and JAVA_HOME variables have been incorrectly set. However, I hav...

Drupal: losing images when moving site location; placeholders point to old absolute path rather than relative path

My file directories have not changed, but every time I move from local host to production, or just change the filename of a test site online, I loose the images. Example: I've mainly been using an online location for building and testing Drupal sites, but recently I forgot to stop the robots from indexing a test site. So as a quick fix...

PHP: Serve pages without .php files in file structure

I am working on building an internal CMS for clients. Instead of creating a new php file for each page, I am wondering if there is a way to load up a page based on the URL but not a physical php file in that location. So, if I visit www.mysite.com/new-page I would like this to just be a reference to my template, content, etc. rather th...

Using / or \\ for folder paths in C#

When writing file paths in C#, I found that I can either write something like "C:\" or "C:/" and get the same path. Which one is recommended? I heard somewhere that using a single / was more recommended than using \ (with \ as an escaped sequence). ...

Uses with unit file path in unit file

Hello. I have problem. I ll try to explain it. I have a unit which has a class and may will have new functions. D3BF4E849ACC45249B990F802EFB1F15\UnitFile1.pas 8DC8977E7A7B469AACFE3CC77CA7075E\UnitFile1.pas Both of them have same class: IClass_1 = class Im using code numbers for different versions of this file. Another unit file (Uni...

Django FILES upload: path and filename

When an uploaded file is received by the Django server, its name can be read using UploadedFile.name If filename in the multipart-data content contains a path like: '/a/b/c', UploadedFile.name seems to contain '/c' . How can I retrieve the full path and not just the file name. Thanks. Laurent Luce ...

Fast way to read filename from directory?

Given a local directory structure of /foo/bar, and assuming that a given path contains exactly one file (filename and content does not matter), what is a reasonably fast way to get the filename of that single file (NOT the file content)? ...

Invalidating a path from the Django cache recursively

I am deleting a single path from the Django cache like this: from models import Graph from django.http import HttpRequest from django.utils.cache import get_cache_key from django.db.models.signals import post_save from django.core.cache import cache def expire_page(path): request = H...

In C#, how do I combine more than two parts of a file path at once?

To combine two parts of a file path, you can do System.IO.Path.Combine (path1, path2); However, you can't do System.IO.Path.Combine (path1, path2, path3); Is there a simple way to do this? Edit: I ended up using Aaron's helper method, but simplified it with Kha's advice: public static string CombinePaths (params string [] paths) ...

How do I fix a broken Lisp directory path for Emacs?

I installed a new version of emacs (new for me). I didn't want to overwrite the stock copy so I put it in a group-readable directory ~admin/sw. I point my $PATH there and I'm able to pick it up, but when I run ~admin/sw/bin/emacs I get a whole bunch of warnings and errors: Warning: arch-dependent data dir (/usr/local/libexec/emacs/23.1/...

how do I set the PATH on Mac permanently (specifically for subversion upgrade)

Grrr, getting an error in RadRails that I need to upgrade suversion when I try to run script/plugin install. So I followed the instructions to download the .dmg for 1.6.6. I have tried to save the PATH for /opt/subversion/bin by editing ~/.profile, and even editing the etc/profile file. No avail. It still comes up svn --version as 1....

What 's the equivalence of VB6 App.Path, in c#?

Hi How can I get the file path of .csproj in c#? I wanna to get this info in order to check the existence of a file in that path. So If the program found that file, it means that it's in debug mode, else there is a user who is executing the program. but using Application.ExecutablePath or Application.StartupPath or System.Reflection.....

Why the Path and Polyline have different renderings in WPF?

Why the Path and Polyline have different renderings in WPF? This is happening both in code and blend, maybe a I missing something or this is just a anti aliasing effect. <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="GeometryMonky.Window1" x:...