path

Android How to get image path of contact photo?

社会主义新天地 提交于 2019-12-22 18:51:51
问题 I need to upload contact image to server but not able to get real path. Please anyone help me. I'm getting below uri. URI: content://com.android.contacts/display_photo/2, 回答1: first get InputStream from Contact.Write the Inpustream in file and save as Image File. Finally upload that image path to server after success simply delete that Image File. See below code. First I get InputStream from Contact by using Contact Id. getContactInputStream("58");//58 is my contact id. public void

how to get directory names under a path in Vim script?

淺唱寂寞╮ 提交于 2019-12-22 18:36:32
问题 I want a simple solution to get directory names under a path in vim script. Here is my tried ways: the code. https://gist.github.com/4307744 Function is at line L84. I use this function as complete function for input(). So this function need to return a list of directory names under a path. e.g. to/path/ - a/ - b/ I want to get a and b . I tried to find vim internal functions with :help functions . only found globpath() , but it will return full path. So does anyone have a simple solution ?

jquery re-establish img src in .load() function

走远了吗. 提交于 2019-12-22 14:04:34
问题 I'm trying to figure out how to re-establish the img src if the image src path is invalid or no image is found. I have a dynamically created img src path that may sometimes be pointing to a directory with no actual images. In this case I need to change the src to img/missing.jpg . I have done this with no luck: $('.imgContainer').append( "<img id='pic' src='/dynamically/created/path/to/img.jpg'>" ); $('.imgContainer img#pic').load(function(){ if( $(this).width() == 0 && $(this).height() == 0

Exploiting and Correcting Path Traversal Vulnerability

会有一股神秘感。 提交于 2019-12-22 12:18:07
问题 I have a Java Web App running on Tomcat on which I'm supposed to exploit Path traversal vulnerability. There is a section (in the App) at which I can upload a .zip file, which gets extracted in the server's /tmp directory. The content of the .zip file is not being checked, so basically I could put anything in it. I tried putting a .jsp file in it and it extracts perfectly. My problem is that I don't know how to reach this file as a "normal" user from browser. I tried entering ../../../tmp

Store path to dictionary value

爷,独闯天下 提交于 2019-12-22 12:07:30
问题 How might one store the path to a value in a dict of dict s? For instance, we can easily store the path to the name value in a variable name_field : person = {} person['name'] = 'Jeff Atwood' person['address'] = {} person['address']['street'] = 'Main Street' person['address']['zip'] = '12345' person['address']['city'] = 'Miami' # Get name name_field = 'name' print( person[name_field] ) How might the path to the city value be stored? # Get city city_field = ['address', 'city'] print( person

Ada GPS IDE can't seem to find GtkAda

血红的双手。 提交于 2019-12-22 11:29:57
问题 I have installed both the GNAT Programming Studio (GPS) and GtkAda. They both seem to work fine, but when I try to build the Simple Window project under New Project from Template, I get a bunch of errors saying "file gtk.ads not found." This seems to be a directory/dependency sort of problem - GPS doesn't know where to look for GtkAda. I'm running Windows 7, and have GPS installed at C:\GNAT\2011, and GtkAda installed at C:\GtkAda. I tried adding GtkAda to my PATH; at the moment my PATH user

Environment.getExternalStorageDirectory().getAbsolutePath() not working and giving /storage

雨燕双飞 提交于 2019-12-22 10:44:19
问题 My code myDb = openOrCreateDatabase("/sdcard/FashionGirl/ImagesDB.db", Context.MODE_PRIVATE, null); myDb = openOrCreateDatabase(dbPath, Context.MODE_PRIVATE, null); worked perfectly, but was giving warning Do not hardcode "/sdcard/"; use Environment.getExternalStorageDirectory().getPath() instead So I tried, String dbPath = Environment.getExternalStorageDirectory().getAbsolutePath() + "FashionGirl/ImagesDB.db"; myDb = openOrCreateDatabase(dbPath, Context.MODE_PRIVATE, null); But strangely,

How to check programatically that 8.3 short path name is enabled on system?

[亡魂溺海] 提交于 2019-12-22 10:34:00
问题 I know manually we can enable or disable 8.3 short path name support by setting NtfsDisable8dot3NameCreation . But how to read this system information through code? Actually I have to disable some functionality based on whether the system have 8.3 enabled or not. Please help Thanks 回答1: fsutil provides this functionality: PS C:\Windows\system32> FSUTIL.EXE 8dot3name query D: The volume state is: 0 (8dot3 name creation is enabled). The registry state is: 2 (Per volume setting - the default).

TYPO3 Extbase backend module. Template path issue

牧云@^-^@ 提交于 2019-12-22 10:27:14
问题 I'm experiencing a strange problem with extbase/fluid extension creation. I use TYPO3 6.1 I've made an extension with a backend module on my dev server (same configuration/hardware then the prod). The module works perfectly with the path to the template : myext/Resources/Private/Backend/Templates myext/Resources/Private/Backend/Layouts myext/Resources/Private/Backend/Partials After this, I downloaded my extension's zip in the ext manager and then installer on the prod server. Now I can't use

can not modify PATH with putenv() running MAMP / PHP 5.6.1 / Mac OS X El Capitan

柔情痞子 提交于 2019-12-22 09:59:56
问题 Config: MAMP Pro PHP 5.6.1 Mac OS X El Capitan I need to add /user/local/bin to the system paths php can access I've tried to use putenv() but it seems like I can't change the value of environment variable PATH in php using putenv() putenv('PATH=' . '/user/local/bin' . PATH_SEPARATOR . getenv('PATH') ); does not change the value this works with other variables PATH seems to be protected and I can not figure out where I can unprotect it - php ini settings do not seem to have anything regarding