background-process

Pass a variable from foreground to background in Swift

余生颓废 提交于 2019-12-22 14:38:30
问题 I am developing an iOS application where I want to record the time when a user presses a particular button and keep it. Later I will use this time record in background. Is there a nice way of doing that without invoking NSUserDefaults or CoreData or whatever other database? I am very new to iOS development. I think this is very likely to be a naive question. But I'm just curious. Please don't laugh at me haha. Edit: This is indeed a very naive question haha. 回答1: A simple way to make sure

Where should I put background processes in rails?

痴心易碎 提交于 2019-12-22 12:26:12
问题 I'm building a Rails project that has a cron-type job that I'm managing with Rufus Scheduler. I have two questions about how to set this up appropriately in Rails: Where's the best place to put the job's code? Where should I place the Rufus code to schedule the job? How should I kick it off? 回答1: To control the scheduler I would create a config/initializers/task_scheduler.rb : task_scheduler = Rufus::Scheduler.start_new task_scheduler.every("1m") do Something.to_do! # Do something every

How to run Matlab computations in parallel

空扰寡人 提交于 2019-12-22 12:19:57
问题 I have Matlab .m script that sets and trains Neural network ("nn") using Matlab's Neural network toolbox. The script launches some GUI that shows trainig progress etc. The training of nn usually takes long time. I'm doing these experiments on computer with 64 processor cores. I want to train several networks at the same time without having to run multiple Matlab sessions. So I want to: Start training of neural network Modify script that creates network to create different one Start training

How can I act on Core Data iCloud sync notification when the app is in the background?

烂漫一生 提交于 2019-12-22 08:27:31
问题 I have an iOS app that uses Core Data with iCloud sync. The app is working perfectly and syncing across multiple devices. As part of my implementation my app is registered for the: NSPersistentStoreCoordinatorStoresDidChangeNotification This notification works perfectly with the app in the foreground, but what I would like to do is fire a local notification to let the user know that the iCloud data in the app has changed, whenever the app is in the background and a sync notification comes in.

NSURLSession background upload not working

╄→尐↘猪︶ㄣ 提交于 2019-12-22 04:29:27
问题 I'm trying to upload a series of files from iPhone up to a server, with the intent that the upload of these files happen even when the App is in the background or suspended. I'm using background transfer provided by NSURLSession and its series of APIs. what was odd was it it was fully working 2 weeks ago . As in: I would click the "upload" button on the UI files would start to appear one by one on my server I tap the "Home" button on the iPhone to make the app go into the background Files

Downloading in background and waking app when finished

假装没事ソ 提交于 2019-12-22 01:13:06
问题 I use URLSession configured as background session to download some files. When download finishes I use: func urlSession(_ session: URLSession, downloadTask: URLSessionDownloadTask, didFinishDownloadingTo location: URL) to move downloaded file. Everything works fine, except that when app is in the background this function is not being called. It's called right after app is restored to foreground, but I would like the system to wake my app after file is downloaded. Is there some way to do this?

How to reboot CoreBluetooth manager instance at fixed interval in background

六眼飞鱼酱① 提交于 2019-12-22 00:29:34
问题 I'm developing a iOS application of using CoreBluetooth and i have one problem in application BackGround. Generally, iOS application can't run long-term in Background. (e.g. pushing HomeButton. switching other application) But my application is set "Uses Bluetooth LE accessories" as BackGroundMode, so i can monitor region in Background. And i implemented startRangingBeaconsInRegion in didEnterRegion. When enter a region, Ranging region will be started and will be stopped after about 10 sec by

iOS Notification when App is in Background

大兔子大兔子 提交于 2019-12-21 22:44:42
问题 i want to know if it is possible to launch a background process in iOS. In my background process every 30 minutes there should a function get called, in order to check in my database if there are new messages, etc in order to send a notification. I don't want to implement push notifications. I don't know where to implement this feature, and if there are override functions e.g. in the AppDelegate. Thanks for your help, hannes 回答1: What you want is called "Background Fetch" and is available

Get Java Runtime Process running in background

偶尔善良 提交于 2019-12-21 21:47:49
问题 I'm writing a java application where I require to run a process in background throughout the lifetime of the running application. Here's what I have: Runtime.getRuntime().exec("..(this works ok).."); Process p = Runtime.getRuntime().exec("..(this works ok).."); InputStream is = p.getInputStream(); InputStreamReader isr = new InputStreamReader(is); BufferedReader br = new BufferedReader(isr); So, basically I print out every br.readLine() . The thing that I'm not sure about is how to implement

Background script on shared host with multiple PHP versions installed

一世执手 提交于 2019-12-21 21:38:59
问题 I was needing a way to generate thumbnails (using PHP5) for an image management script and had a problem where my host has multiple versions of PHP installed (4 and 5), with PHP4 set as default. This meant that any calls to php from the CLI would run PHP4. I've come up with the following as what I hope to be a cross platform solution. I'm posting it here primarily as I had a lot of trouble finding any help using Google, so this might help someone in the future, I also have the following