external

How to launch an iphone app when an external accessory is either paired over BT or plugged into dock connector

[亡魂溺海] 提交于 2019-11-29 19:05:58
问题 I have researched this to death online and cannot find anything regarding auto launching an iphone app when an external accessory is either paired using BT or plugged into the dock connector. We are an MFi developer with a BT accessory and application that we would like to launch when paired. We have the Info.plist containing our protocols and the device containing the correct protocol all working and communicating. The application works well with our BT device, however I would like to see

Calling Drupal functions in external PHP file

痴心易碎 提交于 2019-11-29 18:06:19
问题 How can I call a Drupal function or get the global variable in a PHP file which is located under the drupal installation folder. I doing it for the first time. Are there any files I need to include in my code in order to access the Drupal function or variables? 回答1: Taken from the linked question in the comment above You need to Bootstrap Drupal in the external PHP file: /** bootstrap Drupal **/ chdir("/path/to/drupal/site/htdocs"); require_once './includes/bootstrap.inc'; drupal_bootstrap

Map external directory to web.xml

邮差的信 提交于 2019-11-29 15:46:57
问题 Is there an easy way to map a directory in the web.xml or other deployment descriptor (jetty.xml, etc) files? For example, if I have a directory /opt/files/ is there a way that I can access its files and sub-directories by visiting http://localhost/some-mapping/? It strikes me that there should be some simple way of doing this, but I haven't been able to find out how (via google, stackoverflow, etc). All I've found are servlets that mimic fileservers, which is not what I would like. For

AS3 Stop external swf

让人想犯罪 __ 提交于 2019-11-29 14:07:45
Hi I'm loading an external swf into a MovieClip, and I want it to stop until I choose to play. Currently it plays upon loading immediately. var mc:MovieClip; var swfLoader:Loader = new Loader(); swfLoader.contentLoaderInfo.addEventListener (Event.COMPLETE, eventLoaded); var request:URLRequest; request = new URLRequest("external.swf"); swfLoader.load (request); function eventLoaded(e:Event): void { mc = e.target.content as MovieClip; // does not stop the clip mc.Stop (); } So I tried adding a Event.ENTER_FRAME to the movieclip and stop it there, that will stop but it will play the first frame.

can't create a folder in external storage on android device

梦想的初衷 提交于 2019-11-29 11:57:52
I am trying to create a folder in external storage and I followed a couple of other threads here. However, even though I seem to be doing what they indicate, creation fails. Here's a piece of code boolean mExternalStorageAvailable = false; boolean mExternalStorageWriteable = false; String state = Environment.getExternalStorageState(); if (Environment.MEDIA_MOUNTED.equals(state)) { mExternalStorageAvailable = true; mExternalStorageWriteable = true; } else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { mExternalStorageAvailable = true; mExternalStorageWriteable = false; } else {

Python: Create Dictionary from Text/File that's in Dictionary Format

这一生的挚爱 提交于 2019-11-29 11:04:27
问题 I'd like to create a dictionary from a text file that I have, who's contents are in a 'dictionary' format. Here's a sample of what the file contains: {'fawn': [1], 'sermersheim': [3], 'sonji': [2], 'scheuring': [2]} It's exactly this except it contains 125,000 entries. I am able to read in the text file using read(), but it creates a variable of the literal text of the file even when I initialize the variable with dict = {} 回答1: You can use the eval built-in. For example, this would work if

Auto-installing a google chrome extension won't work !

不问归期 提交于 2019-11-29 09:56:56
问题 I am working on a job in relation with this page http://code.google.com/chrome/extensions/external_extensions.html I wrote a NSIS script that is trying to auto install a chrome extensions. (Why ? because our extension can be offered with another product installation flow through a checkbox, then if user select our extension to be added, it will auto-install on the user chrome browser using NSIS silent installation) I tried a lot of scenario and I need help, on google website, they say you can

Spring get files and images from external folder on disk, outside webapps?

旧街凉风 提交于 2019-11-29 07:58:01
I have webproject which has images inside src/main/webapp folder. I would like to place images in different folder on the disk. But I have no idea how to manage requests to reach this images. Should I create some kind of httpServlet like shown here: http://balusc.omnifaces.org/2007/07/fileservlet.html Or as I use Spring MVC with java configuration, there is more suitable and simpler way. Looking forward for your suggestions. Ralph Use the spring mvc support for static resources , its location attribute is an Spring Resource , so you could use file: prefix <resources mapping="/resources/**"

App Engine and MySQL

[亡魂溺海] 提交于 2019-11-29 07:34:49
问题 I just wanted to ask if we can access an external MySQL server from Google App Engine... 回答1: The only way to communicate with other hosts is by using UrlFetch that only provides HTTP and HTTPS requests. So, you can't do it out of the box. Anyway, if you really need to access an external MySQL server database, you should consider to expose it through a Web API (RESTful, Soap web-services for example). In this way your data would be available also via UrlFetch. 回答2: I am still in the learning

Any way to gracefully enforce a timeout limit when loading a slow external file via javascript?

笑着哭i 提交于 2019-11-29 06:41:53
I'm using javascript to include some content served up from a php file on another server. However, this other service can sometimes get flaky and either take a long time to load or will not load at all. Is there a way in JS to try to get the external data for x number of seconds before failing and displaying a "please try again" message? <script type="text/javascript" src="htp://otherserver.com/myscript.php"></script> Couple issues: you can use timeout thresholds with XMLHttpRequest (aka ajax), but then since it's on an otherserver.com you cannot use XMLHttpRequest (and support all A-grade