Friday, July 8, 2016

4 Major Technical Challenges Facing IoT Developers

The Internet of Things (IoT) is taking the world by storm. The millions of connected sensors and smart devices that are being deployed on a daily basis in homes, offices, cities and even on our persons are creating unprecedented opportunities in cutting costs, reducing energy consumption, improving efficiency and customer services, and better understanding how we interact with our environment.

The IoT, hailed as one of the biggest breakthroughs in the history of the tech industry, will soon be an inherent part of every aspect of our lives, from retail shops to hotels, to cars and airplanes and practically everything we interact with.

But this added utility comes with its own set of caveats and requirements, which need to be met and overcome with the proper solutions and approaches. Here are four challenges to expect in the future.

Security Challenges

IoT has already turned into a serious security concern that has drawn the attention of prominent tech firms and government agencies across the world. The hacking of baby monitors, smart fridges, Barbie dolls, drug infusion pumps, cameras and even assault rifles are portending a security nightmare being caused by the future of IoT. So many new nodes being added to networks and the internet will provide malicious actors with innumerable attack vectors and possibilities to carry out their evil deeds, especially since a considerable number of them suffer from security holes.

The more important shift in security will come from the fact that IoT will become more ingrained in our lives. Concerns will no longer be limited to the protection of sensitive information and assets. Our very lives and health can become the target of IoT hack attacks, as was shown in the hacking of pacemakers. Critical city infrastructure can also become a target, as the Ukraine power grid hack warned us last year.

There are many reasons behind the state of insecurity in IoT. Some of it has to do with the industry being in its “gold rush” state, where every vendor is hastily seeking to dish out the next innovative connected gadget before competitors do. Under such circumstances, functionality becomes the main focus and security takes a back seat.

Also, many IoT developers often come from an embedded systems programming background and are ignorant of the threats of IoT programming. They don’t necessarily have the knowhow and expertise to program for the hostile connected environment of the internet, and end up dishing out code that is reliable from a functionality perspective, but can easily be exploited remotely.

Scalability issues also contribute to the creation insecure IoT products. The fact is that many security solutions being used today have been created with generic computing devices in mind. IoT devices often lack the computational power, storage capacity and even proper operating system to be able to deploy such solutions.

Continue reading %4 Major Technical Challenges Facing IoT Developers%


by Ben Dickson via SitePoint

PHP, Arduino, And… Minecraft? Connecting an Arduino to PHP!

IoTWeek_Gray

It's IoT Week at SitePoint! All week we're publishing articles focused on the intersection of the internet and the physical world, so keep checking the IoT tag for the latest updates.

In the first part of this series, we learned a bit of Minecraft and the circuitry we can make inside it. We also made a circuit to alert us when the door to our mansion was opened.

We then hooked this virtual alarm to a listening PHP script, so we can know when the door is opened in the context of a PHP script.

In this part, we'll build a small Arduino-based alarm circuit. We'll learn how to trigger the alarm, using the the official IDE and programming language, and then using something called Firmata.

We'll round the series out by connecting the alarm circuit to the Minecraft circuit, so we hear a real alarm for Minecraft mansion.

You can find the code for this tutorial at http://ift.tt/29AgL1G

Crash Course in Arduino Programming

Arduino is one of many types hobbyist circuit controllers. There are a few different designs, like the bigger Uno or the smaller Micro.

What's common among them is that they have ports/pins for connecting to different components (e.g. buttons, sensors, and LEDs) and understand a common programming languages. The programming languages are C and C++, which is about the hardest thing to learn about Arduino.

Continue reading %PHP, Arduino, And… Minecraft? Connecting an Arduino to PHP!%


by Christopher Pitt via SitePoint

What to Expect From Swift 3

You probably know that Swift 3 is coming later this year. It is the first release that incorporates the hard work of a fantastic community. Dozens of proposals were submitted since Apple open sourced Swift in 2015 and dozens were accepted after careful consideration by the core team. In this article, we take a look at some of the important changes in Swift 3.

What Is Swift 3 About?

The core team has a very clear goal in mind with the release of Swift 3, creating a solid foundation for the Swift programming language. At WWDC 2016, Chris Lattner emphasized that Swift 3 introduces a range of breaking changes with the intent of getting the fundamentals right. That is the common theme of the upcoming release. This means breaking existing features, removing some features, and improving the foundation of the language.

The Swift evolution project has been a true success story for everyone involved in the Swift community. The engagement has been tremendous and the result is Swift 3. Apple is transparent about the release process and snapshots of Swift 3 are available from the Swift website and included in Xcode 8, which is in beta at the time of writing.

More Than Swift

The Swift 3 release not only focuses on the Swift programming language, it also includes substantial changes to the toolchain, the standard library, and the language's interoperability with Cocoa. Remember that Swift is more than a language. When we talk about Swift, we generally only think about the language, but it also includes the standard library and the package manager.

Source Compatibility

If you have worked with Swift, then you know that migrating a codebase from one version to another is no small feat. Unfortunately, migrating a project to Swift 3 will be no different.

That said, the primary goal of Swift 3 is to make sure the transition from Swift 3 to future versions of the language won't be like that. Source compatibility is a key focus point of Swift 3.

Awesomeness

Swift was designed to be a modern programming language, but it was equally important to create a language that looked nice and was ... well ... awesome. With Swift 3, the team continues to "optimize the language for awesomeness" as Chris Lattner puts it.

While there are many breaking changes, the net result is a language that feels and looks great. Swift 3 is a joy to use. The changes to Core Graphics and Grand Central Dispatch, which we discuss in a moment, are fine examples.

What Is Changing?

Enough about how awesome Swift is and how much more awesome Swift 3 will be. In the remainder of this article, I would like to focus on some of the key changes introduced in Swift 3. Keep in mind that Swift 3 continues to evolve until the official release later this year.

API

Readability

A lot of time and energy was spent on improving the API of the Swift language. The changes are significant, there is no denying that. But the result is very, very nice. With Swift 3, the core team aims for an API that focuses on readability and accessibility.

While many of us have become used to the verbosity of Objective-C, the new Swift API takes a different approach by only emphasizing and focusing on the essentials. Take a look at the following example of Swift 2.2.1. This example should look familiar if you have spent some time with Swift ... or Objective-C.

In Swift 3, this code snippet looks slightly different as you can see below.

The Swift community realized that there is no need to include a reference to what is about to be presented since that information is already included in the first parameter. As a result, the method name becomes more readable and more concise. A definite improvement if you ask me.

This is a common thread in Swift 3. Several of the proposals that were accepted and included in Swift 3 focus on simplification and removing cruft from the language. The Swift API was initially heavily influenced by the verbose nature of Objective-C. Readability is great, but Swift 3 cuts back on verbosity without compromising readability.

The Swift community is of the opinion that the design of an API should always take the use of the API into account and that is clearly visible in the changes that are introduced in Swift 3. I am sure you agree that the revamped API looks—and reads—great.

Labeling Parameters

Another important change many developers welcome is the consistent signature of function and methods by including the first parameter label by default. This is what a typical function looks like in Swift 2.2.1. By default, the first parameter label is omitted when the function is invoked.

That is no longer true in Swift 3. The first parameter is no longer given a special treatment, which is a very welcome change.

Because of this change, you could further improve the above example by omitting the reference to the view in the function name.

Import as Member

Working with C APIs in Swift has always looked and felt clunky. Core Graphics functions, for example, are imported as global functions, which isn't a great solution and, as a result, using Core Graphics in Swift doesn't feel great.

The same applies to Grand Central Dispatch. In the next example, we use Grand Central Dispatch to asynchronously dispatch a task to a background queue.

In Swift 3, the API feels much more like a native Swift API. Functions are imported as methods, which results in the following syntax in Swift 3.

Removing Features

The Swift community also agreed on the removal of a number of features, some of which have sparked a few heated discussions. I would like to point out four of them.

C-Style for Loops

Does this look familiar to you?

C-style for loops are no longer available in Swift 3. Wait. What? Why? That is a very good question. You can read the proposal, submitted by Erica Sadun, on GitHub. This brings us to the next controversial change.

Say Goodbye to ++ and --

Soon after open sourcing Swift, Chris Lattner, the creator of Swift, submitted a proposal to remove the increment and decrement operators from the language. In his proposal, he mentions that these operators were added, "without much consideration", early in the development of Swift. To clean up the Swift API and avoid any confusion, ++ and -- are no longer available in Swift.

Don't panic, though. The solution is simple. No need to fret.

No More var Parameters

If you are familiar with functions in Swift, then you know that the parameters of a function are constant by default. You can change this behavior by prepending a parameter name with the var keyword. For variable parameters, a variable copy of the parameter is passed to the function.

But how does this differ from parameters marked as inout? Right. That is exactly what many of us have been wondering and it is the motivation for removing variable parameters from the language.

From the perspective of the function, there is no difference, that is, the function receives a mutable local copy of the parameter's value. As the name implies, however, a parameter marked as inout writes its value back to the original variable.

To avoid any confusion, var parameters are no longer available in Swift 3. Fortunately, inout parameters are here to stay.

Speaking of inout parameters, in Swift 3, the inout keyword is integrated in the type syntax of function parameters. Take a look at the following examples to better understand this change.

Implicit Tuple Splat Behavior

Even though Swift is still very young, there are many features that are pretty advanced. Did you know that you can pass a tuple to a function instead of a list of parameters? There is no need to cheer, though. This feature is going to be removed in Swift 3.

Chris Lattner refers to this behavior as "cute" in his proposal to remove the feature. While this behavior can be useful from time to time, it seems to have quite a few consequences. The reason for bringing up this proposal is to highlight the main goal of the core team, simplifying the syntax and the API of the language.

I can see how this feature looked neat at first, but, as the language grew, gained in complexity, and more people started using it, features like this are adding limited value to the language in exchange for what seems to be a list of complications, including performance issues during compilation and complexity to the type checker that could be avoided by omitting the feature.

What Is the Deal With Swift 2.3?

Last week, I wrote about Xcode 8. In that article, I mentioned that Xcode 8 supports both Swift 2.3 and Swift 3. But what is Swift 2.3 and how does it compare to Swift 2.2?

Swift 2.3 is a minor but important update to Swift. The main difference with Swift 2.2.1, the version included in Xcode 7.3.1, is compatibility with the SDKs for Apple's new operating systems, iOS 10, tvOS 10, watchOS 3, and macOS Sierra (10.12).

This means that you can use and build against the new SDKs without making the jump to Swift 3. With Xcode 8, you can submit applications to the App Store using Swift 2.3 or Swift 3. The Swift team knows and understands that the migration to Swift 3 has a significant impact on existing projects that include Swift. Swift 2.3 makes sure you can migrate your projects when you see fit.

Tools

What I also like about the Swift project is that the tools are developed alongside the language. This means that the tools also receive a substantial update when Swift 3 is released later this year.

Documentation

During WWDC, we already saw a glimpse of the changes made to the documentation. While this may seem trivial, have you ever considered how much time you spend browsing the documentation? I have a soft spot for details like this and appreciate the effort the team has put into making the documentation more accessible. The changes are even more dramatic in Xcode 8 as I wrote last week.

Xcode

For now, the vast majority of Swift developers use Xcode as their workhorse. This may change in the future as the language gains traction on other platforms. Didn't Google have plans to use Swift on Android?

In Xcode 8, the integration of Swift is much improved. Navigating the standard library, for example, is more intuitive. In one of the sessions of WWDC 2016, Ewa Matejska illustrates how the synthesized interfaces are now more intuitive and easier to understand. This makes browsing the standard library less daunting.

This brings us to compilation and optimization. You may have heard of whole module optimization. This feature is now enabled by default in Xcode. It impacts application performance and Apple recommends to have this feature enabled in production. If you want to learn more about whole module optimization, I recommend reading this article by Keith Harrison.

While whole module optimization increases compilation time when you first build a project, the results are more than worth it. Subsequent builds are less impacted thanks to incremental compilation.

Conclusion

Swift 3 is a major milestone for everyone involved in the Swift community. Even though nobody likes breaking changes, the direction the language is taking is becoming more clear, making the platform more robust and ready for future changes without compromising source compatibility.

In this article, I highlighted a few of the more important changes that you can expect in Swift 3. For a comprehensive list of the changes, I encourage you to visit the migration guide on the Swift website.

You can also visit the Swift evolution project on GitHub to read more about the proposals that have been accepted and the ones that are still being worked on. Don't be scared. The proposals are often easy to understand. In fact, the goal of the Swift evolution project is for everyone to be able to add to the discussion. What is stopping you?


by Bart Jacobs via Envato Tuts+ Code

Connecting to Web Services with Android Wear

The Internet fuels an ever increasing part of our lives. We are more connected than ever, with fast and virtually unlimited access to information. Our phones where the accelerators of this push, giving us all the information we need from weather reports, news, music, videos, games and everything in-between. The desire for connectivity has given rise to wearables. Small devices such as watches that connect to a phone or directly to the internet. While these platforms are still in their infancy, they provide a new way for users to access small pieces of information right when it's needed most. In this tutorial I'm going show how to build a native Android Wear app and connect it to a web service to pull the latest tidal information. This is perfect for a wearable app as you can quickly open it, connect to the API and get a snapshot of the info you need.

Continue reading %Connecting to Web Services with Android Wear%


by Simon Codrington via SitePoint

Process Payments With Stripe and Laravel Cashier: HTTP vs. HTTPS

Smartphone Video Excellence: How to Film Like a Pro

ms-podcast205-justin-brown-600

Do you record videos with your smartphone? Want to make them look really professional? To talk about how to do video like a pro from your smartphone, I interview Justin Brown. More About This Show The Social Media Marketing podcast is an on-demand talk radio show from Social Media Examiner. It’s designed to help busy marketers and [...]

This post Smartphone Video Excellence: How to Film Like a Pro first appeared on .
- Your Guide to the Social Media Jungle


by Michael Stelzner via

B&O PLAY H5

B&O Play's H5 earphones are revolutionary. A combination of quality materials and the newest technology in a beautiful product, B-Reel sought to create a web experience to match.
by via Awwwards - Sites of the day