background-process

Upload image/video to facebook asynchronously using php sdk 4

自作多情 提交于 2019-12-08 09:01:17
问题 I am trying to upload video/image to facebook albumb using php sdk 4 asynchronously.I googled and found that php asynchronous call be sent using fsockopen . However, it is not working for facebook request. I have two files, one for checking login and getting token. Then second file is called for uploading the file to facebook. Below is the code for first file: // start session session_start(); Yii::import('application.vendor.*'); require_once('facebook-4/autoload.php'); use Facebook

Run multiple cURLs in background using PHP

爷,独闯天下 提交于 2019-12-08 06:40:44
问题 I want to run multiple cURL tasks in background using PHP on Ubuntu. There are a few ways, but I'm not sure which one I should choose. Way 1: use OS's cURL <?php require_once('database.php'); $db = new Database; // SQLite3 database $query = $db->query("SELECT * FROM users"); while ($user = $query->fetchArray(SQLITE3_ASSOC)) { exec("nohup curl --url http://example.com/?id=".$user['id']." &"); } ?> Way 2: http://www.paul-norman.co.uk/2009/06/asynchronous-curl-requests <?php require_once(

deserializing json C# “First chance exception of type - newtonsoft”

泪湿孤枕 提交于 2019-12-08 06:40:16
问题 I am trying to save and load files from isolatedStorage based on this class by forum member Shawn Kendrot that i got throughout this forum post. I’m able to save with no problem but when loading then deserialising the json file I am getting an error “A first chance exception of type 'Newtonsoft.Json.JsonSerializationException' occurred in Newtonsoft.Json.DLL” I don’t know what I could be doing wrong, because the file is saved and it’s reading properly but not deserializing. The json file has

update sqlite db from push notification, app is closed and not running in background iOS

会有一股神秘感。 提交于 2019-12-08 04:50:11
问题 I am trying to update local sqlite database when notification received and app is closed/killed by user. Everything works fine when app is background or active mode. Reference : REFERENCE STACK LINK 1 REFERENCE STACK LINK 2 Here is code i am trying: -(void)application:(UIApplication )application didReceiveRemoteNotification:(NSDictionary )userInfo fetchCompletionHandler:(nonnull void (^)(UIBackgroundFetchResult))completionHandler{ NSLog(@"App Background :%@",userInfo); if(application

Transferring Data from Central to peripheral in Background mode in iOS

折月煮酒 提交于 2019-12-08 03:39:56
问题 I am developing an application for a custom wearable communicating through BLE. I have subscribed to the UI background modes in the info.plist file for Bluetooth-central. I am transferring a firmware file of around 600 kb by dividing into chunk sizes of 200 bytes each. The process is going fine but as I am pressing the Home button the app is entering into background state and thus terminating the process after 1-2 minutes. If my screens dims after certain amount of time then the firmware

AVPlayer Not Loading Media In Background

早过忘川 提交于 2019-12-07 23:45:06
问题 When running in the background, my implementation of the AVPlayer is unable to play audio (e.g. podcast) that is downloaded, but is able to play songs that are stored locally. Failure to play in the background is only when the phone is disconnected from my computer. If my phone is direct connected to my computer/debugger, any media that is local or is downloaded plays without a problem. In the foreground, there is also no problem playing either media type. Here is my implementation: AVPlayer

Android Application saving data when app in background

☆樱花仙子☆ 提交于 2019-12-07 20:43:19
问题 currently I'm developing xmmp client which is working quite fine when app is in foreground. But due to the fact that im keeping quite lot of data in Application class (complex ArrayList, Strings and booleans as public statics) when app is in background every field is being garbage-collected. So my question is what is the best way to retrieve this data when i get app from background? Its quite a problem because I use this public statics in every class so far and it causes my app to crash. The

Import python modules in the background in REPL

◇◆丶佛笑我妖孽 提交于 2019-12-07 13:23:13
问题 Some python modules, notably matplotlib , take a long time to load start = datetime.datetime.now(); import numpy, pandas, matplotlib, sklearn; datetime.datetime.now() - start takes half a second with cached files, and several seconds for non-cached files. Is there a way to load these modules in the background, when in the Python interpreter? 回答1: You can import modules in separate threads. Here is the solution. Create a file load_modules.py : from concurrent.futures import ThreadPoolExecutor

SIGPIPE crash when switching background task

北城以北 提交于 2019-12-07 09:56:56
问题 I'm experiencing a weird crash when sending my app into the background, loading a new app, switching the device into sleep mode, waking up the device, closing the new app and then opening my app from the background tasks. A black screen will appear and I cannot exit this black screen with the home button, and in the debugger I am shown this message: Program received signal: “SIGPIPE”. Data Formatters unavailable (Error calling dlopen for: "/Developer/usr/lib/libXcodeDebuggerSupport.dylib":

CloudKit Push Notification, App running on background

我的未来我决定 提交于 2019-12-07 09:48:27
问题 When iOS8.2-app is running in the background, it does not receive any push notification, while if it is running on the foreground, it receives the push notifications fine. Any idea what is going on ? Running on CloudKit Development mode, the subscription is for add,edit,and remove, and using the following didReceiveRemoteNotification : -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo fetchCompletionHandler:(void (^)(UIBackgroundFetchResult)