path

.load() and relative paths

匆匆过客 提交于 2020-01-09 11:09:29
问题 .load() is giving me trouble. I'm working on a section loader project and I just can't seem to fetch the file that I need. What I am trying to achieve : #sectionContainer is empty on document load, but on document ready it is 'filled' with Pages1.html . This is done by a JavaScript file sections.js . The JS file and the index.html are NOT in the same folder. Here is the site structure (I am running a lot of projects on my site) main folder Project 1 Project 2 (sectionLoaderTest/) index.html

How can I access the “Documents and Settings” folder?

我是研究僧i 提交于 2020-01-09 11:09:23
问题 I'm using C# .NET 4 with VS 2010. When Iterating over some paths, I'm running this line: files = Directory.GetFiles(path, searchPattern); I get an exception when the path is the documents and settings folder. How can I access it? And no, I don't want to skip the folder with a try and catch. I want to be able to access it somehow. Edit: I got a follow up question. As I told you, I'm iterating over the paths. Is there a way to use Environment.GetFolderPath but somehow idetifying the correct

Test if executable exists in Python?

最后都变了- 提交于 2020-01-08 11:19:50
问题 In Python, is there a portable and simple way to test if an executable program exists? By simple I mean something like the which command which would be just perfect. I don't want to search PATH manually or something involving trying to execute it with Popen & al and see if it fails (that's what I'm doing now, but imagine it's launchmissiles ) 回答1: Easiest way I can think of: def which(program): import os def is_exe(fpath): return os.path.isfile(fpath) and os.access(fpath, os.X_OK) fpath,

Why savepath resets userpath in Matlab?

旧时模样 提交于 2020-01-07 09:42:29
问题 Condition: unsuccessful userpath with addpath and savepath Differential conditions: unable to start Matlab as sudo/root here Support: MATLAB is not intended to be run by the super user - Service desk. Settings echo "export MATLAB_USE_USERWORK=1" >> $HOME/.bashrc matlab -nodesktop -nosplash -r \ "userpath('/home/masi/Documents/bin/matlab/'); exit;" Situations which cause userpath to be empty ( '' ) Test code 1 userpath('/home/masi/Documents/bin/matlab/') home='/home/masi/'; savepath(fullfile

ibase_connect: remote computer host and shared db file from windows

旧街凉风 提交于 2020-01-07 06:41:19
问题 Linux red hat, connect the drive to a remote server (192.168.0.103) via mount to /mnt/databases Then trying to connect $idbh = ibase_connect("192.168.0.103/3050:/mnt/databases/XXX.IB", "SYSDBA", "masterkey", "WIN1251") or die(ibase_errmsg().' on line: '.__LINE__); Result ibase_connect(): I/O error for file "/mnt/databases/XXX.IB" Error while trying to open file unknown Win32 error 3 Try stat /mnt/databases/XXX.IB File: `/mnt/databases/XXX.IB' Size: 46415872 Blocks: 90752 IO Block: 16384

Launch application in gdb with non-path name

冷暖自知 提交于 2020-01-07 06:27:32
问题 I am trying to launch a legacy application in GDB, and it requires that it's argv[0] value not contain anything other than alphanumeric characters. Whenever I launch the program in GDB it seems that it expands the name to be the full path before running the program, so I get an error like (because it can't deal with the slashes): "Cannot find /home/user/myapp ..." Is it possible to run a program in GDB with a relative path, so that it will just see "myapp"? 回答1: Gdb normally runs target

Launch application in gdb with non-path name

被刻印的时光 ゝ 提交于 2020-01-07 06:27:10
问题 I am trying to launch a legacy application in GDB, and it requires that it's argv[0] value not contain anything other than alphanumeric characters. Whenever I launch the program in GDB it seems that it expands the name to be the full path before running the program, so I get an error like (because it can't deal with the slashes): "Cannot find /home/user/myapp ..." Is it possible to run a program in GDB with a relative path, so that it will just see "myapp"? 回答1: Gdb normally runs target

How do you get the project path in Struts 2?

a 夏天 提交于 2020-01-07 04:03:34
问题 For example: <constant name="struts.multipart.saveDir" value="temp" /> will save to: \Apache Tomcat 7.0.14\bin\temp\upload__781d3178_13831f5e207__8000_00000003.tmp So, instead, how do I make it go to: C:\my_project\build\web\temp\ Without using the absolute file path because I don't want to reconfigure it each time the project moves. I just want the relative path basically. EDIT 1: I don't think it matters, but I'm using Struts 2 version 2.1.8.1 EDIT 2: I'm using Apache Tomcat. That's where I

Android: Change size of canvas / drawable in custom drawable

℡╲_俬逩灬. 提交于 2020-01-06 20:35:32
问题 I'm trying to implement a custom drawable which should have the shape of a speechbubble. Therefore I use two paths, one draws the rect and the other should draw the triangle for the bubble. My class looks like the following: public class SpeechBubbleView extends Drawable { private Paint mBubblePaint; private Paint mBubblePaint2; private Path mRectPath; private Path mBubblePath; public SpeechBubbleView() { } public void initPaint() { mBubblePaint = new Paint(Paint.ANTI_ALIAS_FLAG);

Android: Change size of canvas / drawable in custom drawable

荒凉一梦 提交于 2020-01-06 20:35:21
问题 I'm trying to implement a custom drawable which should have the shape of a speechbubble. Therefore I use two paths, one draws the rect and the other should draw the triangle for the bubble. My class looks like the following: public class SpeechBubbleView extends Drawable { private Paint mBubblePaint; private Paint mBubblePaint2; private Path mRectPath; private Path mBubblePath; public SpeechBubbleView() { } public void initPaint() { mBubblePaint = new Paint(Paint.ANTI_ALIAS_FLAG);