path

spring security filter-chain regex pattern

In my application which uses spring security I want to define two different areas both using their own spring security filter-chain. My question is: is it possible to define two regex expressions as follows: every path starting with /foobar/* every other path not starting with /foobar The important part here is that the second path ...

Program fails to load image from relative path on drag-drop file open

I have a program I have written in C#, which loads an image with Image.FromFile, and it loads the image successfully every time. However, when you drag and drop another file on the executable, like you are giving the program the command line argument of the file, and the file is not in the same folder as the executable, the program crash...

CSS file pathing problem

Hi there, When designing a HTML template in my favorite editor (TextPad at the moment) I can view my code in a browser by pressing F11 or the appropriate toolbar button. I have my common css rules in a separate file so my HTML contains the code: <link rel="stylesheet" href="commoncss.css" type="text/css"> This works when the .css f...

Code coverage (c++ code execution path)

Let's say I have this code: int function(bool b) { // execution path 1 int ret = 0; if(b) { // execution path 2 ret = 55; } else { // execution path 3 ret = 120; } return ret; } I need some sort of a mechanism to make sure that the code has gone in any possible path, ...

How to set the application path to the running program?

Hello, I have a program that is executed by another program. The program that is being executed needs files located at its own location [same folder]. If I call myfile.open("xpo.dll") I might get an error because I am not passing the [fullpath + name + extension]. The program that is being executed can vary paths depending on the instal...

Path String Concatenation Question in C#.

Hello. I want to output D:\Learning\CS\Resource\Tutorial\C#LangTutorial But can't work. Compiler error error CS0165: Use of unassigned local variable 'StrPathHead Please give me some advice about how to correct my code or other better solution for my case. Thank you. static void Main(string[] args) { string path = "D:\\Learning\\C...

How Can I Remove The 'file:\\' From the Return Value of Path.GetDirectoryName() in C#

string path = Path.GetDirectoryName( Assembly.GetAssembly(typeof(MyClass)).CodeBase); output: file:\d:\learning\cs\test\test.xml What's the best way to return only d:\learning\cs\test\test.xml file:\\ will throw exception when I call doc.Save(returnPath) ,however doc.Load(returnPath); works well. Thank you. ...

How to get the path of a shortcut (NOT target path) in .net?

Hello world! I have an .exe application written in vb.net. When I make shortcuts to the application, say on desktop (or anywhere else) and then click on them I want to programatically get the path to that shortcut, ie. C:/Users/xxx/Desktop/shortcut.lnk. I want this so I can store the pairs shortcuts : (program + different cmd args). ...

One code on dev server, and production server - how to deal with links?

I have a copy of a code running on the production server, and I use my local machine(s) running xampp as a dev server. I have several websites that I actively develop, so I'm forced to use http://localhost/sitename All my URLs are relative to the domain, (/file.php). They work fine on the prod server, but on a local server, they all poi...

windows bat file: how to strip the path-part from a absolute filepath

hello i have a variable like this: set file=c:\dir\foo\bar\file.txt how can i get just the path-part into another variable? echo %pathpart% should give c:\dir\foo\bar\ thanks! ...

How to check java installation from batch script?

I need to write a batch script to find out if java is installed, and if it is, then under what path? I feel it has to be something similar to: for /f %%j in ("java.exe") do ( set JAVA_HOME=.......... ) but I can not quite nail it. P.S. Has to work with path with spaces two. Like if java is installed into "Program Files" Thanks...

Accessing relative path in Python

Hi, I'm running a Mac OS X environment and am used to using ~/ to provide the access to the current user's directory. For example, in my python script I'm just trying to use os.chdir("/Users/aaron/Desktop/testdir/") But would like to use os.chdir("~/Desktop/testdir/") I'm getting a no such file or directory error when trying to ...

Windows path in python

Hi all. What is the best way to represent a windows directory, for example "C:\meshes\as"? I have been trying to modify a script but it never works because I can't seem to get the directory right, I assume because of the '\' acting as escape character? Thanks, Gareth ...

Passing a filepath to a R function?

Hi everybody, I tried to pass a filepath to a function in R, but I failed =/ I hope someone here can help me. >heat <- function(filepath) { chicks <- read.table(file=filepath, dec=",", header=TRUE, sep="\t") ... } When I call the function, nothing happens... >heat("/home/.../file.txt") ... and "chicks" is not found >chicks Error...

ASP.NET MVC routing and paths is js files

Hello, we're facing a problem now. We have a pretty big page with a loooong inline script, which does all the work. We now want to obfuscate it and use it as a separate .js file. But the problem is that we have paths which are generated by Url helper (Url.Content()). So what is the best way to separate js file from the page and not using...

How to get short DOS style [ProgramFilesFolder] path in visual studio setup and deployment project?

I am creating an installer for an application. In the installer (created as a Visual Studio Setup and Deployment project) I am trying to set a registry value to hold a DOS style path that includes the end-users Program Files directory... unfortunately the [ProgramFilesFolder] property provided gives me a full long style path. i.e. I wan...

How to delete a gem path?

Hi there, how can I delete the second path (/home/tom/.gem/ruby/1.8) of "GEM PATHS:" ? Here's the output of "$ gem env": RubyGems Environment: RUBYGEMS VERSION: 1.3.5 RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i486-linux] INSTALLATION DIRECTORY: /usr/lib/ruby/gems/1.8 RUBY EXECUTABLE: /usr/bin/ruby1.8 EXECUTABLE DIRECTORY: /us...

Alternatives to the --sysroot switch of gcc?

The --sysroot switch is useful when you don't want the headers/libraries in the standard paths affect your build. --sysroot=dir: Use dir as the logical root directory for headers and libraries. For example, if the compiler would normally search for headers in /usr/include and libraries in /usr/lib, it will instead search di...

Is there a Standard or Best Practice for Perl Programs, as opposed to Perl Modules?

I've written any number of perl modules in the past, and more than a few stand-alone perl programs, but I've never released a multi-file perl program into the wild before. I have a perl program that is almost at the beta stage and is going to be released open source. It requires a number of data files, as well as some external perl modu...

Issues regarding playing audio files in a JME midlet.

I am making a midlet which is to be used to play out local audio files. It is obviously not working. I am getting a null reference on the "is" variable, in the code snippet shown below. 1. try{ 2. System.out.println("path: " + this.getClass()); 3. InputStream is = this.getClass().getResourceAsStream("res/01Track.wav"); 4. p1=Manager.cre...