path

Lua Require function on a full path name

左心房为你撑大大i 提交于 2019-12-19 05:17:21
问题 I need to call the require on a lua file that will not always be in the same place. I was trying to call require on the full path name but that doesn't seem to be working either. I even tried replacing one of my working normal requires with a correct full path name to the same file example changing require "foo" to require "C:\Users\Me\MyLuaProject\foo" but when i switched it to the full path name it could no longer find it. So I am wondering if you can even call require on a full path and if

Codeigniter multiple file upload paths

早过忘川 提交于 2019-12-19 04:02:50
问题 I'm building an app which needs to take uploaded files and put them in separate directories for thumbnails and fullsize images. But $config['upload_path'] = './uploads/'; only allows me to select one upload path. How do I define two or more upload paths? 回答1: Actually all you need to do is "re-initialize" the upload class. Codeigniter does not allow you to call the class twice with new parameters (it ignores the second request), however you can tell the class to manually load new parameters.

PYTHONPATH ignored

 ̄綄美尐妖づ 提交于 2019-12-18 20:15:51
问题 Environment: debian 4.0 Python 2.4 My 'project' is installed in: /usr/lib/python2.4/site-packages/project. But I want to use my working copy instead of the installed one which is located in: /home/me/dev/project/src So what I do is: export PYTHONPATH=/home/me/dev/project/src ipython import foo # which is in src foo.__file__ */usr/lib/python2.4/site-packages/project/foo.py* instead of : /home/me/dev/project/src/project/foo.py How come? I try to check the pathes (having done the export above)

Python cant get full path name of file

梦想与她 提交于 2019-12-18 19:40:14
问题 Trying to drill through a directory on my drive that has subfoldrs within it. When I find files that have the file extensions I'm looking for I want the full file path. Right now this is what I have: import os import Tkinter import tkFileDialog from Tkinter import Tk from tkFileDialog import askopenfilename root = Tkinter.Tk().withdraw() dirname = tkFileDialog.askdirectory(initialdir='.') list = [] for root, dirs, files in os.walk(dirname): for name in files: if name.find(".txt") != -1: name

Algorithm: shortest path between all points

馋奶兔 提交于 2019-12-18 19:07:08
问题 Suppose I have 10 points. I know the distance between each point. I need to find the shortest possible route passing through all points. I have tried a couple of algorithms (Dijkstra, Floyd Warshall,...) and they all give me the shortest path between start and end, but they don't make a route with all points on it. Permutations work fine, but they are too resource-expensive. What algorithms can you advise me to look into for this problem? Or is there a documented way to do this with the above

slash and backslash in Ruby

混江龙づ霸主 提交于 2019-12-18 18:52:05
问题 I want to write a application that works in windows and linux. but I have a path problem because windows use "\" and Linux use "/" .how can I solve this problem. thanks 回答1: In Ruby, there is no difference between the paths in Linux or Windows. The path should be using / regardless of environment. So, for using any path in Windows, replace all \ with / . File#join will work for both Windows and Linux. For example, in Windows: Dir.pwd => "C/Documents and Settings/Users/prince" File.open(Dir

Mac OS X Lion: What is the max path length?

纵饮孤独 提交于 2019-12-18 14:55:53
问题 I am having trouble finding this information, and trial and error is telling me that the value is very high. So I figured I ask the community to see if anyone knows and can point me to a apple page that confirms the length for Lion. All I know is it is larger that Snow Leopard. 回答1: The limits depend on the used filesystem - OSX uses HFS Plus by default... The only official documents I can point to are the HFS Plus spec which document the limit of 255 for filename length. Wikipedia hints that

ld: library not found for -lgsl

断了今生、忘了曾经 提交于 2019-12-18 14:46:41
问题 I'm working in OSX and I'm attempting to run a make file and when I try I get the following: ld: library not found for -lgsl clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [harm] Error 1 Earlier I found out the I needed to get the gsl library and I used mac ports and typed: sudo port install gsl into my command line window and it seemed to isntall okay. Is the missing lgsl not configured correctly or does it not come with gsl? I tried googling lgsl

Read a local file in django

梦想的初衷 提交于 2019-12-18 14:15:47
问题 I'm quite stuck on this one! I am writing a Django view that reads data from an external database. To do this, I am using the standard MySQLdb library. Now, to load the data, I must do a very long and complex query. I can hard code that query in my view and that works just fine. But I think that is not practical; I want to be able to change the query in the future, so I try to load the statement from a text file. My problem is that I don't know where to store and how to open that file.

Qt how to access resources

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-18 14:14:15
问题 Qt Creator give the possibility to attach some resource to the project. I created in the project directory a folder called: Images. inside i have the file splash1.jpg I created then the Resources file and attached the file as shown in the following figure: Which is now the correct way to access from code such a file? I tryed QPixmap pixmap( "Images/splash1.jpg" ); QPixmap pixmap( "./Images/splash1.jpg" ); but none of them worked. if i put just ./Images/splash1.jpg work at least if i compile