This Drone Is Not Trying To Kill You

Every year, 800,000 people in the European Union suffer a heart attack, but the survival rate remains only about 8%.  Now, thanks to an innovative "ambulance" drone created by a Belgian engineering student, reaching people in a time of emergency can be more effective than ever.

According to inquisitr.com, grad student Alec Momont developed the drone to reach the scene of an accident in considerably less time than the standard urban emergency services.  With most post-cardiac-arrest brain death occurring within 4-6 minutes, the ambulance drone can save lives by reaching anywhere in a 12-kilometer zone in one minute (as opposed to an actual ambulance's 10+ minute arrival time.)

This speed, coupled with onboard defibrillator equipment, could theoretically raise the survival rate from 8% to 80%.

The Ambulance Drone floats like a butterfly, shocks like an electric eel.
(Image courtesy omroepwest.nl.)

The drone uses GPS from an emergency caller's phone to arrive at their position.  Onboard cameras, speakers and microphones enable emergency service providers to coach the on-site rescuer in aid techniques until professional lifesavers can arrive.

Momont wants the drones to eventually contain a "flying medical toolbox" with gear including insulin needles and oxygen masks, to provide for other types of emergencies.  Now, instead of drones stereotypically raining down "death from above", a more optimistic option can take flight.

This drone is considerably less helpful to your health.
(Image courtesy robedwards.com.)

Pay Your Dues As You Snooze: New Alarm Clock App Makes Charity Donations Every Time You Hit "Snooze"

Do you hate leaving the warm embrace of your bed in the morning?  Do you hit the snooze button enough to prolong your beauty sleep by a matter of hours?  Now, put your laziness to work, with a new app that donates money to charity every time you choose to snooze.

"I will give you $100 to shut up and let me sleep until it's dark out again."
(Image courtesy solent.photoshelter.com.)

iCukoo, according to the Daily Mail, is a new app that functions as an alarm clock and donation device.  Just select your charity of choice, the usual duration of your snooze-nap, and the amount you're willing to donate rather than get up and be a productive human being.

The app currently only donates to charities in the UK, but the list is a nicely diverse one.  Parkinson's UK, National Literacy Trust, Starlight (a support group for seriously ill children), Prostate Cancer UK and Maggie's (a cancer charity) can all benefit from your extended sweet dreams.

iCukoo is currently available on iOS and is in development for Android devices, so soon all types of smartphone users can enjoy their snooze as a donation accrues.

Just don't do to your smartphone what you did to your last obnoxious alarm clock.
(Image courtesy rediscoverthemagic.com.)

New York Brings Wireless To The Masses With New LinkNYC Plan


The Big Apple loves going big for its citizens, and now, it's doing so technologically.  A new initiative is set to bring NYC "the fastest and largest free municipal Wi-Fi deployment in the world."

According to theverge.com, the new LinkNYC program will supplant public pay phones with wifi-enabled kiosks that operate 24/7 (because the city doesn't sleep, just like the internet.)  The extremely useful e-encampments will also provide free domestic phone calls and access to information on a host of city services (yes tourists, that includes directions.)

"GIVE ME CUPCAKES...oh wait, it's not one of those cupcake ATMs.  Well...GIVE ME DIRECTIONS TO CUPCAKES."
(Image courtesy dailytech.com.)

Funded by ad revenue from the kiosk's lit-up sides, the machines are to operate at significant speeds using gigabit Wi-Fi, which according to planners "is more than a 100 times faster than the average public Wi-Fi and more than 20 times faster than the average home Internet service in NYC."  Yes, this probably means a lot of people will use it for naughty purposes, even (or especially) due to the public location.

Of course, this is NYC, so some will just remain dirty with no help from the internet.
(Image courtesy trunkrecords.com.)

The program's intent is to have the first wave of machines operational by the second half of 2015, with 10,000 LinkNYC stations eventually accessible from all five boroughs (yeah, even you, Staten Island.)

It's not like you're going to miss these.
(Image courtesy nyt.com.)


Swift Networking Tutorial Index: Building a Swift App to Query a Custom API

Our tutorial series on networking in Swift provides a detailed, practical overview of the topic from the back-end API to the end user application. The series is broken up into two major parts. In the first part, we build a custom web service in PHP which provides access to a RESTful API that serves inventory content from a hypothetical plumbing supply shop. Knowing how to create a simple API is useful for delivering mock content during your app development cycle, and provides application developers with more knowledge on precisely how such a service is constructed. In the second part, we use table views to create a Swift application to query our custom API and deliver the contents of the service to the end user of the application. Use the index below to navigate the tutorial.

Introduction
Introduction and Overview: From the Back End API to the End User Application

The Web API
Building a RESTful API in PHP, Part 1
Building a RESTful API in PHP, Part 2

The Swift Client App
Networking in Swift: Building the Swift Client, Part 1
Networking in Swift: Building the Swift Client, Part 2
Networking in Swift: Building the Swift Client, Part 3
Networking in Swift: Building the Swift Client, Part 4
Networking in Swift: Building the Swift Client, Part 5
 


This tutorial was authored by Stefan Agapie, a Senior iOS Software Engineer, and adapted for the present piece.

No Posting While Toasting: New "Drunk Locker" App Blocks Your Social Media During Drinking Time


Anyone with social media, a smartphone, and a proclivity for partying knows this story.  You're out with friends, sipping a few libations, and suddenly the next morning there's love notes to tequila and photos of you attempting to twerk all over your facebook feed.  If you're the sort who'd rather outsource self-control to a technological bouncer, you need the new Drunk Locker app.

"I just told Facebook that the next three people who come party with us can do shots out of my cleavage...HAHAHA AWESOME IDEA, RIGHT?"
(Image courtesy gettyimages.com.)

Drunk Locker, according to its creators, acts as a "binary conscience" during your benders.  Simply put, it prevents you from accessing six major social media interfaces while you're 'faced.  Facebook, Messenger, Snapchat, Twitter, Instagram, and Tumblr are all strictly prohibited for use while juiced. A predetermined time selection (from one to ten hours) allows for your sober judgement to keep you out of social harm's way, and nothing (even uninstalling the app) will stop Drunk Locker from that mission.

Drunk Locker is free, so you'll still have plenty of beer money.  And then you might need Drunk Locker more than ever.

SHUT UP WINE, YOU'RE WRONG.
I'm sorry I yelled at you.
I love you.
Let's just send a smiley face...
(Image courtesy theluxuryspot.com.)

Networking in Swift: Building the Swift Client, Part 5

This is the final article in our tutorial segment on building a Swift client application to query a RESTful API and serve the response to the end user in a table view. If you've been following along since the introductory article, we've come a long way, and we're almost done! But we're not at our final destination just yet.

When we last left off in part four, we had added the necessary code to display thumbnail images next to our lists of inventory items. In this article, we will walk through the process of adding views for each individual item in our inventory such that when a user taps an item in the list view, she'll be presented with an item description scene that displays: 1) a bigger picture of the item, 2) the name of the item, and 3) the lengthy item description provided by the API. Let's jump right in.

The Item Description Scene
We will now set up our final story board scene. When the user taps on an inventory item from among those listed in the table view, we want to display a new view that provides an image at the top of the screen and below it a scrollable content area that displays the description text for the selected item. Create a new file,  and name it PlumbingSupplyItemDescriptionViewController:


Switch over to the main storyboard and drag a view controller into the scene. Next, drag in an Image View and place it to the top of newly added view controller. Give the Image View a height of 160 points using the size inspector in the utilities panel. With the Image View selected, bring up the 'pin' popover view as shown below:

Within the 'pin' view, uncheck the 'Constrain to margins' box and select the horizontal red bars and the top vertical red bar. Also check the 'Height' box as shown below:

Finally, click the button that reads 'Add 4 Constraints.' If done correctly, you should see no red or yellow lines near the Image View:

Now drag and drop a Text View into the scene, and size it as shown below with a small margin all around. (The vibrant color you see in the image below on the Text View was set by us so that it is clear what object we are referring to).

While the Text View is selected, bring up the 'pin' menu again, uncheck the 'Constrain to margins' box, and select the horizontal red bars and the vertical red bars as shown below, and then add the constraints:

We will now make the view controller that we dragged into our storyboard be of type PlumbingSupplyItemDescriptionViewController. Ensure that the view controller is selected. From the Identity Inspector menu locate the Class field and type in PlumbingSupplyItemDescriptionViewController as shown here:

Open the Assistant Editor. You should now see the main storyboard with our selected view controller along with the corresponding class. To the top of this class add the following code:

Like so:


To link these IBOutlets (@IBOutlet) to the elements to our main storyboard, we select the given element on the story board with [control+left mouse button] and drag the blue line over to the corresponding variable as shown below:


Do this for both elements in the view controller (i.e. the image and the text), connecting them to the corresponding outlets in the class.

When we select a table view cell from our list of inventory items, we want our newly-added view controller to be presented to the user. To do this we will [control+left mouse button] from the table view cell located in each of our table view controllers and drag the blue line over to the new view controller. Do this for both table view controllers. When the drop down menu appears select 'Show.'

From Apple Docs: “The Navigation Bar provides a control for navigating hierarchical content. It’s a bar, typically displayed at the top of the screen, containing buttons for navigating within a hierarchy of screens." To prevent the Navigation Bar from overlapping our Image View, we need to set some properties in the main storyboard. Ensure that the newly-added view controller is selected. From the Attributes Inspector menu locate the check box labeled 'Under Top Bars' and uncheck it. Run the application, navigate to one of the two categories and select one of the item table view cell. You should see a view similar to the following:


Item Description Scene: Displaying Image and Text
When using storyboards with segues, the system provides a callback method to the source view controller for when the segue is about to be performed. This allows us to prepare the destination view controller for its presentation onto the screen. (A segue is triggered when we select a table view cell that was linked to some view controller using a storyboard segue.) Ensure that the callback method is located in the PlumbingSupplyInventoryTableViewController class like so (by default it is supplied in the class but commented out):

Uncomment this code block if it is commented out, and replace the comments in this callback method with the following snippet:

On the first line, the segue object provides a reference to the destination view controller. On the second line we cast the sender object that the callback method provides as a table view cell since the cell that was selected becomes the sender of this segue event. Then we grab the index of the selected cell, on line three, and use it to retrieve the associated plumbing supply item from our data source and send it over to the destination view controller on line four. To avoid having to download the image again we simply capture it in our destination view controller from the selected table view cell.

Now back to the destination view controller class, a.k.a the PlumbingSupplyItemDescriptionViewController. Define these three functions:

The viewDidAppear(animated: Bool) function is a system method that we override with custom behavior after the view appears onto the screen. In this method we set the title of the view controller to the name of the selected item and call a function that downloads the description of an item. Replace the comment, '// title and download //,' within this method with the following snippet:

Notice that the item description text is passed through a completion handler closure once the download is complete. The code 'self.bsn_textView.text = itemDescription' sets the Text View's text area with the text of the item description. On the source view controller, we did not use this completion handler, which is available on its networking request method, but instead made the UI updates inside the method itself. We prefer to update the UI outside of the method that is tasked to download content as it makes for clearer code by breaking up the variegated logic into separate sections. Both approaches are possible, as we'll now see.

In the function urlForItemWithDescription(itemID : String) -> (NSURL?) add the following lines of code:

This method takes an item's id, maps it one of two possible endpoints and inserts that item id into the selected endpoint. The mapping is done by inspecting the first two characters of an item's id and using a switch statement.

In the function, requestItem(endPointURL : NSURL?, responseHandler : (. . .) -> () ) -> (), add the following code:

This code should look familiar. We already described what this code does when we originally downloaded inventory items. The only difference here is that we passed our data for the UI element to the completion block.

For our final function, i.e. the system function viewDidLoad(), place the following code within it:

The first line of code takes the captured image that was assigned to us by the source view controller and insert it into our Image View. The second line sets the font type and size of the items description. The third line disables editing of the Text View since this functionality should not be applicable. The fourth line displays text that serves to indicate that there is activity with getting an items description. Run the application and navigate to the item description page. You should see a screen similar to the one depicted below:

Success!  With that, we've completed the last major task for our Super PHPlumbing Bros Swift client application! When run, the client queries our custom API to first display the titles of the two inventory categories supplied by the API. When the user selects one of those categories, the app displays a list view of the inventory and provides each item's name along with the corresponding thumbnail image. And finally, when the user selects an individual item, the app displays the full image along with the item's full description.

This project can be found on GitHub.

We hope you've found this tutorial series helpful and fun. As always, questions, comments and suggestions are welcome below!

Index
Introduction
Introduction and Overview: From the Back End API to the End User Application

The Web API
Building a RESTful API in PHP, Part 1
Building a RESTful API in PHP, Part 2

The Swift Client App
Networking in Swift: Building the Swift Client, Part 1
Networking in Swift: Building the Swift Client, Part 2
Networking in Swift: Building the Swift Client, Part 3
Networking in Swift: Building the Swift Client, Part 4
Networking in Swift: Building the Swift Client, Part 5

This tutorial was authored by Stefan Agapie, a Senior iOS Software Engineer, and adapted for the present piece. 

Space Station Sunday: Many Happy Returns

Good evening space fans!  After 165 days in orbit, the three crewmen of Expedition 41 were safely re-embraced in the grasp of gravity last Sunday night.  The Soyuz landing craft departed the ISS flawlessly and touched down in Kazahkstan some 3 hours later, returning NASA astronaut Reid Wiseman, ESA astronaut Alexander Gerst, and cosmonaut Maxim Suraev back to their home planet.

The outside looks crispy...


...but the crew stayed cool.  Here, Reid Wiseman is shown before he's regained the use of his Earth-legs.
(Images courtesy NASA.gov.)

In a video interview with NASA public relations officer Dan Huot conducted shortly after the landing, Wiseman lauded the tight-knit crew's scientific diligence, and was quoted as saying, "The ride {back} was awesome."

According to NASA.gov, NASA astronaut Terry Virst, ESA astronaut Samantha Cristoforetti, and cosmonaut Anton Shkaplerov are currently in residence at the Cosmonaut Hotel near the Baikonur launch facility in Kazahkstan, conducting fit checks and preparing for their launch to the station next Sunday.  The team will ride in a Soyux TMA-15M to the ISS to join the three Expedition 42 crewmembers at their floating post.

Go team!  Safe travels.
(Image courtesy the ESA's Flickr.)

Meanwhile, the three crew remaining aboard the ISS remained busy, with Commander Butch Wilmore (NASA) working in the Destiny module on the Seedling Growth experiment, which analyzes new ways for food and oxygen to be cultivated in space.  Plants are subjected to different wavelengths of light (red waves being longer, blue being shorter) during growth, and then compared with similarly-controlled plants' data (including genetic information) back on earth.

Human biological science was also assessed, with Wilmore collecting blood and urine samples, and cosmonauts Yelena Serova and Alexander Samokutyaev undergoing hearing tests.  All data collected will be, among other observations, part of an ongoing study that determines how microgravity affects humans.

Cosmonauts Samokutyaev and Serova transferred cargo from the recently-arrived Progress 57 resupply ship into the appropriate locations on the ISS.  Wilmore pitched in with the heavy "lifting" too, when taking "out" a bag of trash.

Floating garbage only works well in a contained space environment.  In NYC it'd get horrifying really fast.
(Image courtesy NASA.gov.)

A small piece of space debris from a Chinese satellite prompted the ISS to make a Pre-Determined Debris Avoidance Maneuver (PDAM) on Wednesday, according to NASA.  Swooping the station out of the path of the spent Yaogan 12 satellite, the maneuver also put the station in better orbital alignment for the upcoming Expedition 42 arrival.  The station now currently resides at 262.3 x 252.0 statute miles up.

Stay tuned for the arrival of the new Expedition 42 crew next week!  Watch this space!

The Expedition 41 team were greeted with a traditional Kazakh ceremony, but is seeing the world up close still as interesting after having been aloft for so long?
(Image courtesy NASA.gov.)