path

Where is Python's sys.path initialized from?

 ̄綄美尐妖づ 提交于 2019-12-16 21:18:13
问题 Where is Python's sys.path initialized from? UPD : Python is adding some paths before refering to PYTHONPATH: >>> import sys >>> from pprint import pprint as p >>> p(sys.path) ['', 'C:\\Python25\\lib\\site-packages\\setuptools-0.6c9-py2.5.egg', 'C:\\Python25\\lib\\site-packages\\orbited-0.7.8-py2.5.egg', 'C:\\Python25\\lib\\site-packages\\morbid-0.8.6.1-py2.5.egg', 'C:\\Python25\\lib\\site-packages\\demjson-1.4-py2.5.egg', 'C:\\Python25\\lib\\site-packages\\stomper-0.2.2-py2.5.egg', 'C:\

Setting environment variables on OS X

泪湿孤枕 提交于 2019-12-16 18:20:58
问题 What is the proper way to modify environment variables like PATH in OS X? I've looked on Google a little bit and found three different files to edit: /etc/paths ~/.profile ~/.tcshrc I don't even have some of these files, and I'm pretty sure that .tcshrc is wrong, since OS X uses bash now. Where are these variables, especially PATH, defined? I'm running OS X v10.5 (Leopard). 回答1: Bruno is right on track. I've done extensive research and if you want to set variables that are available in all

Setting environment variables on OS X

拟墨画扇 提交于 2019-12-16 18:18:14
问题 What is the proper way to modify environment variables like PATH in OS X? I've looked on Google a little bit and found three different files to edit: /etc/paths ~/.profile ~/.tcshrc I don't even have some of these files, and I'm pretty sure that .tcshrc is wrong, since OS X uses bash now. Where are these variables, especially PATH, defined? I'm running OS X v10.5 (Leopard). 回答1: Bruno is right on track. I've done extensive research and if you want to set variables that are available in all

Setting PATH variable is not working

不打扰是莪最后的温柔 提交于 2019-12-14 04:07:43
问题 I apologize for the vague title, was not sure how to categorize my problem. I have a script which I call from a Visual Studio 2013 project (C++). In that script, I try to set my path variable. When the PATH variable gets set, it seems like the it is including visual studio stuff in the path and copying the path more than once. Not sure why. Note: Running the bat directly and running from the command prompt does not present this error. .cpp: int main(void) { system("CALL C:\\HFSS\\setup_vars

Swift: How to expand a tilde in a path String

独自空忆成欢 提交于 2019-12-14 03:40:41
问题 How can I expand a path String with a tilde in Swift? I have a string like "~/Desktop" and I'd like to use this path with the NSFileManager methods, which requires the tilde to be expanded to "/Users/<myuser>/Desktop" . (This question with a clear problem statement doesn't exist yet, this should be easily findable. Some similar but not satisfying questions are Can not make path to the file in Swift, Simple way to read local file using Swift?, Tilde-based Paths in Objective-C) 回答1: Tilde

Show route between current and desired location on iPhone MapView

匆匆过客 提交于 2019-12-14 03:39:27
问题 I want to show a route on a MKMapView between the current location and a desired location as an annotation. What is the best way to do this? 回答1: ///in .h add delegate MKMapViewDelegate ///in .m file - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation { CLLocationCoordinate2D newcordinate = newLocation.coordinate; CLLocationCoordinate2D oldcordinate = oldLocation.coordinate; MKMapPoint * pointsArray = malloc

Application crashes at [[NSBundle mainBundle] pathForResource

懵懂的女人 提交于 2019-12-14 02:54:26
问题 My Application is crashes in the device at this point, [[NSBundle mainBundle] pathForResource I am giving the path for the pdf here . but at the execution time it is showing that it is not getting path there . and that may be the reason for crashing. however it is running perfectly on simulator . i am not able to figure out why is this happening here is that code NSString *path = [[NSBundle mainBundle] pathForResource:[myArray objectAtIndex:0] ofType:[myArray objectAtIndex:1]]; NSLog(@"array

Get Url For Currently Executing Javascript

情到浓时终转凉″ 提交于 2019-12-14 02:20:09
问题 I'm trying to find the url for the currently executing javascript. I know I can use window.location.href for the current page, but that's not necessarily the path to the script which is executing. Any help is greatly appreciated. Thanks. EDIT 1: I'm fully open to the use of plugins and such to accomplish this. Don't hesitate to suggest anything. EDIT 2: I need this so that I can find a relative path from where my currently executing script is at to another resource. The issue is that, for

how to use Union/or in sparql path with arbitrary length?

陌路散爱 提交于 2019-12-14 02:19:46
问题 I'm using below query to find all properties with domain of city (or superclasses of city) or range of country (or superclasses of country) from DBPedia ontology. when I use path with fixed length there is no problem but when I put * to define paths with arbitrary length, I get this error: Virtuoso 37000 Error SP031: SPARQL compiler: Variable '_::trans_subj_6_4' is used in subexpressions of the query but not assigned my SPARQL: define sql:signal-void-variables 1 define input:default-graph-uri

iOS - How do apps like Path optimize their table cells where every cell is (almost) different?

血红的双手。 提交于 2019-12-14 00:25:10
问题 So here's the issue i'm currently running into. I have an app that shows a Facebook/Path like feed with a UITableView. Let's say that my datasource has about 200 items and not all cells have the same content and cell height. Some have images and some don't. I was able to overcome the scrolling performance issue by initializing my cells with a reusable identifier in the following format: [NSString stringWithFormat:"entry_%d", some_id]. Things were going really well up until I started using the