Run code when MacBook lid is closed with external monitor connected - objective-c

I want to get a notification for when my MacBook's lid is closed, when an external monitor is connected.
Lion prevents the computer from sleeping when an external monitor is plugged in, so I can't listen for sleep notifications.

You can use Quartz Display Services to watch for changes to the display configuration. See CGDisplayRegisterReconfigurationCallback().

Related

Mac OS X 10.x Network Service Notification

Using Mac os x 10.13 the network preferences pane shows status of network services (eg Wi-Fi and/or Ethernet) being connected or not. If I change the service status, say by turning Wi-Fi off or on, or disconnecting/connecting ethernet cable then the Preferences Pane reflects this change immediately which implies that it is getting some notification of the network service changes.
How can I accomplish receiving these types of notifications in my Swift program?
I know that I can create a timer object to periodically check the status using the NetworkSetup app process commands and this works fine, but I wish to be notified when the changes occur.
never mind; it looks like this is do-able using the SystemConfiguration framework

Trigger a script using Wake-on-LAN on Windows 10

I have recently enabled wake-on-LAN on my PC running the latest version of Windows 10. Can a script (or any other means of automation) be set up so that each time my PC wakes from LAN (and only on wake from LAN), it will automatically open a specified webpage?
I am lazy and I want to sent a wake-on-LAN from my Android smartphone while on my bed. I want my PC to then start playing a wake-up playlist on YouTube, without me pressing any more buttons.

Windows Phone 8.1 : UDP packets stop being transmitted when phone app is in background

Background Info
I downloaded the Thread Pool Sample for Windows Phone 8.1 (C++) and modified it so that the periodic timer sends UDP packets to a remote IP on a regular interval.
Problem
I noticed the following:
The UDP packets are sent out regularly when the app is launched from MSVS 2013 regardless of what you do on the phone
The UDP packets stop being sent out when the app is launched from the phone's program list when the app is put in background.
Question
How do you create a periodic task on Windows Phone 8.1 which runs every 10 seconds? The periodic task must send out a UDP packet to a pre-defined IP:PORT address regardless of what the user is doing on the phone.
I had a look at this one:
http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh977059.aspx
but I don't see the possibility of having the timed task run every 10 seconds.
How to reproduce the problem
Link To Test Project
The test project includes instructions on how to reproduce the problem that I've described.
Unfortunately, what you're after is not possible on Windows Phone. Once the application is no longer active on the phone, it is tombstoned and no longer runs.
You can achieve something similar with Background Agents, but they are restricted in what they can do and they only run every 30 minutes.
There are other background agents that respond to different phone events, including location changes, network availability changes and geofencing triggers.
There's a slightly hacky method available to force a background tasks, and that's to impersonate an audio player task. It's not a great solution though.

Can iPhone app which runs in background send data over network to a remote server?

This application is location awareness app. It uses GPS details so it can be run in background. But is it possible to send the collected data to a remote server while the app is in background? or maybe when the screen is locked?
For Required background modes add App registers for location updates in plist, this will make application work in background and you can send location updates to server.
Here consider that your location services are not continuously on, else it will drain complete battery of device.
Hope this help you..

Monitor Application and Network activity in Mac OSX

Is it possible monitor Application activity in background something like this,
When user logged-in ,
Which application being accessed and when,
when system went to sleep, etc....
when it was disconnected to network and connected to it, : I believe, for that some service can be implemented which keeps on pinging an IP or some other approach,