directory

Http request failed when including file through url from subdomain

假如想象 提交于 2019-12-24 23:59:10
问题 I'm trying to make reliable code that will work both on my local server and on my actual server for website so I won't have to change paths etc. to my files. I cannot use relative paths since I'm using a subdomain so browser doesn't see folders above that path so what I'm trying to do is on my local server use root folder to guide my code where the files are and on webserver I retrive servername. The error that I get right now is Warning: include(http://cms.domain.com/serverdetails.php):

VB.NET - Check if URL is a directory or file

佐手、 提交于 2019-12-24 23:10:10
问题 Is there a way, in VB.NET, to check if a URL is a directory? I've seen a lot of methods of checking if a local path is a directory but what about a remote url (i.e. http://website.com/foo) I read that some plain text files have no extension so I need a solution other than checking what if the file name contains a space or something. 回答1: You can use FileAttributes class: 'get the file attributes for file or directory FileAttributes attr = File.GetAttributes("c:\\Temp") 'detect whether its a

Google App Engine static pages Python 2.5 directories etc

心不动则不痛 提交于 2019-12-24 22:13:53
问题 I am new at this and am planning to move my stuff from a paid web service to GAE (nothing dynamic just static pages). Believe me I have spent countless hours trying to make this work but am at an impasse whereby I achieve one result at the exclusion of another and visa versa. I am sure it is a simple answer and that I am violating some basic principles. What I want is that the app engine page (mygaeid.appspot.com) delivers a static landing page such that other pages are available with the

PHP images from directory - Random order

China☆狼群 提交于 2019-12-24 21:15:53
问题 I have a page of my website which I use to store reference images.. Currently I just drop all of the images into a directory on my server and the php displays them how I like. What i'd like to ask is how to I get them to display in a different random order every time the page is refreshed? code is below: $dir = 'images'; $file_display = array ('jpg', 'jpeg', 'png', 'gif'); if (file_exists($dir) ==false) { echo 'Directory \'', $dir, '\' not found'; } else { $dir_contents = scandir($dir);

Unauthorized Access exception when i try to create a directory

北慕城南 提交于 2019-12-24 20:24:11
问题 i have an exception Unauthorized Access when i did this : if (fileurl != null && fileurl.ContentLength > 0) { var fileName = Path.GetFileName(fileurl.FileName); // var path = AppDomain.CurrentDomain.BaseDirectory + fileName; var path = Path.Combine(@"C:\Projets", fileName); fileurl.SaveAs(path); string path2 = Path.GetFileNameWithoutExtension(path); Directory.CreateDirectory(path2); I saved a compressed file fileurl.SaveAs(path); and i'd like o create a new directory in the same path. i

batch code to chnage folders name after read text files

让人想犯罪 __ 提交于 2019-12-24 20:19:57
问题 Someone great in this site give me this code at batch change folder name by read line from text file @echo off pushd "your root location" for /f "tokens=1* delims=:" %%A in ( 'findstr /srbc:"SMTP_Email_Address *type=SZ *[^ ][^ ]*@[^ ][^ ]*\.[^ ][^ ]* *SMTP_Email_Address" filel.txt^|sort /r' ) do if exist "%%A" for %%F in ("%%A\..") do ( for /f "tokens=3" %%N in ("%%B") do ren "%%~fF" "%%N" ) popd the code find this code perfectly SMTP_Email_Address type=SZ name@company.com SMTP_Email_Address

Netbeans 7.x: Maven creates my project in the wrong directory

只愿长相守 提交于 2019-12-24 19:33:58
问题 I cannot get Netbeans 7.3.1 to create a Maven Web Application in the directory I specify. OS: Windows 7 x64 NetBeans: 7.3.1 Maven: 3.0.4/3.0.5 I am using the NetBeans GUI and its internal Maven 3.0.5 for creating that type of project. It always creates the project in the root of my E: \ drive, regardless of which folder I specify. Here's an example: After I click the 'finish' button after having provided all the needed parameters to create the project: > cd E:\Dev\Java\Test; JAVA_HOME=E:\

Reading/Writing to/from iPhone's Documents folder performance

北战南征 提交于 2019-12-24 19:26:57
问题 I have got an iPhone application where I archive permanent data in the documents folder of the application (arrays, dictionaries). I read/write from and to the documents folder quite frequently and I would like to know whether this is considered a bad habit. Wouldn't it be better if I had a singleton class, read and write to arrays there and then, only when the application quits, write this data to the documents folder ? I do not see/feel any performance issues right now on my iPhone 5, but I

Is spring Resource a file or directory?

自作多情 提交于 2019-12-24 19:26:57
问题 I am using the spring Resource API and using a ResourcePatternResolver to scan my classpath for files. In one situation the scan is picking up some directories and files that are in a pre-built jar and some that are on the file system. In either case a 'resource' will either be a file or a directory. How can I reliably detect whether a resource points to a directory or file, whether in a jar file or not? Calling getFile() on a Resource inside a jar throws an Exception so I can't use that plus

Getting R to store the working directory for every session

拟墨画扇 提交于 2019-12-24 19:24:04
问题 I asked this on Super User, but someone suggested that I take it here because there are many more R experts. The question: I have to keep navigating to my directory when I go to File > Change dir..., which is particularly annoying. Does anyone know how to make R remember the previously used directory? 回答1: I keep all the code associated with a particular project in a file (or more often a series of files). The first line is usually setwd(...) which sets the directory. Once a workspace has