Hello,
Suppose I have a path in a string called '/home/user/directory/HelloWorld.txt'. I would like to remove the HelloWorld.txt, and end up with '/home/user/directory'. What regex would I need.
Given file names like these:
/the/path/foo.txt
bar.txt
I hope to get
foo
bar
Why this doesn't work?
#!/bin/bash
fullfile=$1
fname=$(basename $fullfile)
fbname=${filename%.*}
echo $fbname
What's the right way to do it?
Hello all,
I am trying to use path info in my asp.net web application. I am using iis 6 on the production machine and iis 7.5 on my home computer.
Does anyone know how this can be done?
Thank you !
On a few Windows Vista Home Premium systems, the following returns an empty string:
wstring appData = GetSpecialFolderLocation(CSIDL_LOCAL_APPDATA);
Any ideas what would make that
happen?
What's another equivalent
path I can use for storing app data
(currently user accessible only, not
requiring elevation)?
Hi
I'm trying to figure out how to set Data property of the Path element to get soft corners of this type:
Right now I have only sharp corners like this:
I tried playing with ellipses, but I can't get what I want.
Thanks
Hi all
I have a Django app which, submitting a package, should return values that are inside it..
Submitted the form to a view called "insert":
request.FILES['file']
returns the file objects, but it is of kind < InMemoryUploadedFile.
What i need is a way to get the absolute path of the uploaded file, so that i can feed it to a method that will return the values needed
Anyone know how i can accomplish this?
Thanks
Hello,
Suppose I have a path in a string called '/home/user/directory/HelloWorld.txt'. I would like to remove the HelloWorld.txt, and end up with '/home/user/directory'. What regex would I need.
So I've found out that setting the PATH environment variable affects only the old command prompt, powershell seems to have different environment settings. How do I change the environment variables for powershell (v1)?
Note:
I want to make my changes permanent, so I don't have to set it every time I run powershell. Does powershell have a profile file? Something like bash profile on unix?
Is it possible to create a "tree resolver" in SQL?
I have a table:
ID Name Parent
1 a
2 b 1
3 c 1
4 d 3
Now I want a SQL query that returns:
ID PATH
1 /a
2 /a/b
3 /a/c
4 /a/c/d
Is this possible with SQL? It would make many things easier for me. Any help would really be appreciated!
I have used the folllowing steps to add classes to my build path still i am geting errors as import not resolved.I had followed the following steps.
Select Create New Folder and name it
TpmWebUIClasses.
Click the Advanced button and
select the Link to folder in the
file system check box.
Browse for to the folder where you
have copied the classes
Make sure the selected folder is
listed and then click OK.
How can i resolve the error?
Assuming the current buffer is a file open for edit, so :e does not display E32: No file name.
I would like to yank one or all of:
The file name exactly as show on the status line, e.g. ~\myfile.txt
A full path to the file, e.g. c:\foo\bar\myfile.txt
Just the file name, e.g. myfile.txt
hi ,
Mine is similar to this question.
http://stackoverflow.com/questions/2042342/network-path-and-variables-in-python/2042376
The only difference is my network drive has a password protect with user name and password .
I need to copy files to a samba share using python and verify it.
if i manually login in then the code works but without logging in the shutil command does not work
Thanks
Hello, is it any way to read path to current page? For example, I am at www.example.com/foo/bar/ - and I want to read '/foo/bar/'. But, all have to be done in template file without modyficating views. I have to many view files to edit each one.
Sorry for my english, hope everyone understand. Cheers.
In a Windows command script, one can determine the directory path of the currently executing script using %~dp0. For example:
@echo Running from %~dp0
What would be the equivalent in a BASH script?
Hi everyone,
I have an entity which has relationships with other entities. Let say we have: user-menu-meal
My problem is that some of the users don't have a menu. So when I try to check: user.menu.meal == rice I get an error (path not found...)!
Thank you for your help!
Hello,
Why does ServletContext#getRealPath() not return me correct path if i use ../
This code works :-
System.out.println(context.getRealPath("/"));
This one doesn't :-
System.out.println(context.getRealPath("/.."));
How can i get one level up directory from getRealPath()?
I'm an experienced iOS programmer and have recently began to dabble in web development to expand my horizons. I've found it quite interesting and was wondering what learning path I should take through all the numerous languages. Here's what I planned on doing:
HTML+CSS- PHP/Jquery
Does that sound reasonable? Currently I'm nearly confident with my html/css abilities, and am planning to move ahead. Any good suggestions you guys could throw my way?
Thinking about if we modify the definition of Hamiltonian path as we need to go through every edge once,but can pass vertex any times,is there still an algorithm available?
How should I modify the original Hamiltonian algorithm to account for this?
I need to make an animated gif 'fly over a page and follow a path. I'm thinking of using jQuery but would I be right in thinking the only way to do it is manually calculating the percentage of width/height where the shape layer should be placed, then using absolute positioning is the only way to do this? I know there are some amazing jQuery plugins available for this type of thing.
i am doing a project about shell, and i want the code that gives me the path the system() function uses.
example, when i enter the command
type dir
the reply will be
dir is external command (/bin/dir)
I can get the active window's process, but I have no idea how to get the location of that process, as far as I can see the process object only has ProcessName property which just returns like chrome instead of C:\pathtochrome\chrome.exe
How can I get the latter because I'm trying to get the process's File Description attribute, but I need the full path to it.
I've got some code that runs on every (nearly) every admin request but doesn't have access to the 'request' object.
I need to find the path to Django installation. I could do:
import django
django_path = django.__file__
but that seems rather wasteful in the middle of a request.
Does putting the import at the start of the module waste memory? I'm fairly sure I'm missing an obvious trick here.
I have a directory named reports inside my winform project in .net. My project name is AccountingReports and inside that Directory reports exists. So i need the way to access this path via code. In Asp.net we use Request.PhysicalApplicationPath property. So is there any method or property exists that will give me the root of my project