Wednesday, February 7, 2018

15 Must-Have iPhone Accessories Under $25

The most important gadget in almost everyone's life is their phone, and for Apple fans that means the iPhone. Although it's an incredibly capable gadget on its own, having a few additional accessories can make your experience with it even better. The best part? It doesn't take a lot...

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Irfan Ahmad via Digital Information World

The Evolution of Video Game Storage - #infographic

How we play and store video games has changed immeasurably in recent years, Starting with cartridges, we have progressed to discs and now internal memory in next-generation consoles.

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Web Desk via Digital Information World

Counter Up – jQuery Plugin to Animate Numbers

Counter Up is a lightweight jQuery plugin that counts up to a targeted number when the number becomes visible.

It supports counting up:

  • integers 12345
  • floats 0.1234
  • formatted numbers 1,234,567.00

by via jQuery-Plugins.net RSS Feed

List Of Top 10 Countries In Terms Of Online Censorship

In a predominantly technological era where almost everything is available online to see has its own demerits too. As a result, most of the countries have taken some stern measures to limit the online access of the user. It takes too few seconds for someone to connect to his loved one even if the...

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Zubair Ahmed via Digital Information World

#326: Using Media Queries for Responsive Design in 2018

Frontend Focus
Issue 326 — February 7, 2018
Explores the use of media queries in responsive design today, how they work alongside Flexbox and Grid Layout, and what’s coming in the future.
Rachel Andrew

Google Chrome will soon begin to block ads on some sites by default. Here’s a closer look at how it will work.
Daniel Aleksandersen

Firefox’s new JS debugger is pretty powerful, and will help you write fast, bug-free code.
Smashing Magazine

Master CSS Grid and Flexbox, the latest tools and tricks to layout beautiful, responsive web applications with less code.
Frontend Masters   Sponsor

Historical context on how CSS approaches/tooling have evolved to what we have today.
Peter Jang

A meaty first step in a series on creating a game built around the mechanic of React and Redux controlling SVG elements.
Bruno Krebs

We all want images to load fast: “Choosing the right image format, optimizing the quality and using responsive images are important tasks, but what can we do beyond that?”
Smashing Magazine

We linked to the code a few weeks ago but now the CTO of Basecamp and creator of Ruby on Rails shares his vision for an alternative to single-page client-side MVC apps.
David Heinemeier Hansson

The grid- prefix is no longer required for properties such as grid-gap and grid-row-gap, (although Firefox still needs it right now).
Manuel Rego on Twitter

Jobs

In Brief

CSS Grid Layout Module Level 2: First Public Working Draft news
Level 2 expands Grid by adding ‘subgrid’ capabilities and aspect-ratio–controlled gutters.
W3C

How W3C is Fast-Forwarding Media Support on the Web news
François Daoust (W3C)

Welcoming Progressive Web Apps to MS Edge and Windows 10 news
Edge now supports Service Workers and push notifications.
Microsoft

Project Tracking, Teamwork & Client Reporting Like You've Never Seen Before 
monday.com  Sponsor

Get a Parallax Effect on the Cheap tutorial
It’s pretty neat just how simple this approach is.
Dave Rupert

Automatic Visual Diffing of Web Pages with Puppeteer tutorial
How to set up Puppeteer to automate both taking screenshots of your project and comparing them.
Monica Dinculescu

Hyperapp + Parcel = A Neat Way to Create Frontend Apps tutorial
Beat that JavaScript fatigue with a tiny Elm-inspired frontend library plus a new, no-config asset bundler?
Adam Boro

Three 'Superpowers' of the Flexbox Model tutorial
How flex-basis, flex-shrink and flex-grow work.
Maciej Nowakowski

Using the 'initial' Keyword in CSS tutorial
It can act something like a ‘reset’ for CSS properties.
Adam Laki

Counting with CSS Counters and CSS Grid tutorial
Cleverly using CSS Grid to work around a CSS counter limitation.
Preethi Sam

Five Things Episode 4: Five Things About RxJS in Angular, with Ward Bell video
In this episode learn how Angular uses RxJS and how RxJS helps with cloud development with Ward Bell.
Microsoft  Sponsor

CSS Best Practices: Scaling CSS in a Fast-Growing SaaS Startup story
Sqreen

A History of WaSP and Why Web Standards Matter story
Jason Hoffman

Frontend Frameworks: Custom vs Ready-to-Use Solutions opinion
Ivaylo Gerchev

30 Scalable and Customizable SVG Backgrounds for Web Pages tools
These are really neat.
Matthew Lipman

AccessLint Hooks into GitHub, and Comments on Your Pull Requests tools
AccessLint  Sponsor

Font Awesome Free 5 Now Available on GitHub tools
Fort Awesome

LCUI: A C Library for Building Desktop UIs with C, XML and CSS code
Like C? Like Web technologies? Here’s a lightweight way to marry the two if building small desktop apps.
Liu Chao


by via Frontend Focus

Bitcoin Secures No. 1 Position In The Q4 Of 2017 On Newest Skills Index In U.S.

According to the biggest worldwide freelancing website, Upwork, Bitcoin has managed to secure the No. 1 spot on newest skills index in the U.S. freelance market. The craze for the cryptocurrency continues to evolve as Bitcoin takes over Forex Trading, Robotics, Augmented Reality, Video Editing...

[ This is a content summary only. Visit our website http://ift.tt/1b4YgHQ for full links, other content, and more! ]

by Zubair Ahmed via Digital Information World

How To Use App Center To Build, Test And Deliver iOS Apps

This article was created in partnership with Microsoft. Thank you for supporting the partners who make SitePoint possible.

Typically, each native OS and platform has its own build tools, testing tools, and deployment tools. This often implies that you need separate Continuous Integration (CI) and Continuous Delivery (CD) pipelines for each platform you are working on, thereby duplicating or triplicating your efforts.

Microsoft’s Visual Studio App Center is one of the best ways to deal with the fragmentation of the mobile development landscape: it seamlessly centralises all your Continuous Integration and Continuous Delivery needs in a single place, supporting any platform and framework you may need, including iOS, Android, Windows, macOS, Xamarin, and React Native.

This present tutorial will show you how to use App Center to build, test, and deliver a very simple native Swift iOS app.

Note: You'll need Xcode 8+. If you're following this tutorial to integrate the App Center SDK into an existing app, your app must target iOS 8.0+ and cannot use any other crash reporting library. Also, this tutorial will assume you have a good working knowledge of Git.

Note again: If you’re already familiar with Continuous Integration or Unit Testing, you can skip to the Wrapping up tests section. If not, follow along.

I’ll create a very simple app and some tests to demonstrate the value of Continuous Integration by showing the many ways in which even something seemingly simple should be tested for bugs, and the ease with which this can be achieved in App Center. I'll also go over App Center's Continuous Delivery features and show how painless it is to send your iOS builds to internal and external testers.

Reliable Burgers

Our local burger shop has asked us to build them an app with a simple daily calorie counter, which can also tell the user how many hamburgers they can have without exceeding their daily calorie intake. Let’s assume that a teammate is taking care of the UI, we’re just going to work on the app’s back-end logic.

burgers

The client are called Reliable Burgers because they can be relied upon to provide food that’s of the highest quality. A bold claim, but it’s backed up by all the 5 Star restaurant reviews they’ve received. But because they’re not the type that simply make or accept “bold claims” they want independent validation from us that our code will also produces the expected results.

To this end, they have employed a large team of internal and external testers to receive the latest changes to the code as soon as they’re committed to the codebase.

This is where the Continuous Integration and Continuous Delivery features in App Center can help.

Setting up the project

  1. Open Xcode
  2. Create a new project, use the iOS Single View App template
  3. Name it Reliable Burgers
  4. Make sure to tick Include Unit Tests

Writing code

Open ViewController.swift, and paste the following code above class ViewController: UIViewController { :

class CalorieCounter {

    let maxDailyCalories = 2200

    let caloriesPerBurger = 550

    private var totalCaloriesConsumedToday = 0

    func add(caloriesToAdd: Int) {
        totalCaloriesConsumedToday += caloriesToAdd
    }

    var hamburgersICanStillEatToday: Int {
        return maxDailyCalories - totalCaloriesConsumedToday / caloriesPerBurger
    }
}

Whenever the user consumes food, they'll input the corresponding amount of calories using the add method, which updates totalCaloriesConsumedToday. hamburgersICanStillEatToday computes how many Reliable Hamburgers the user can still eat that day (we just divide the calories the user can still consume that day by the number of calories in a Reliable Hamburger (550)).

That's it, looks like we took care of all the requirements! Let's commit, push, send to the testers, and we're done for the day.

Continuous Integration using App Center Build & Test

Catching Bugs

Less than 10 minutes after you've opened Reddit, you receive these messages from testers:

The app said I could still eat more than 2000 Reliable Burgers, so I bought and ate 20 and now I'm not feeling too well!

So clearly our code needs fixing. But rather than just applying the fixes, we should also write tests to ensure that these bugs won’t appear again.

You Can't Eat 2200 Burgers

We can reproduce the error thus:

let counter = CalorieCounter()
print(counter.hamburgersICanStillEatToday) // 2200

How could hamburgersICanStillEatToday return a number over 2000? Let's take a closer look at the operation we're doing:

var hamburgersICanStillEatToday: Int {
    return maxDailyCalories - totalCaloriesConsumedToday / caloriesPerBurger
}

Assume totalCaloriesConsumedToday is 0 and caloriesPerBurger is 550. The operation is: 2200 - 0 / 550. The bad result is due to our ignoring an elementary rule of maths: divisions are carried out before subtractions. Swift follows these rules to the letter, so it starts by dividing 0 by 550, obtaining 0, then subtracting 0 from 2200. hamburgersICanStillEatToday is thus 2200 when totalCaloriesConsumedToday is 0!

Before we write a fix, let's ensure that we never again tell a user they can eat 2200 burgers! Assuming that a human should consume approximately 2200 calories a day, and that a burger is approximately 550 calories, hamburgersICanStillEatToday should never return a number above 4 (a figure we get by dividing 2200 by 550, keeping our users (and our client) happy).

Open Reliable_BurgersTests.swift (located within the Reliable BurgersTests folder in Xcode), and add the following lines beneath class Reliable_BurgersTests: XCTestCase {

func testHamburgersICanStillEatTodayReturnsWithinRange() {
    let counter = CalorieCounter()
    XCTAssert(counter.hamburgersICanStillEatToday <= 4, "we should NOT recommend eating more than four hamburgers a day!")
    XCTAssert(counter.hamburgersICanStillEatToday >= 0)
}

This test method will recreate the scenario our above user encountered by creating a new CalorieCounter from scratch and querying it for hamburgersICanStillEatToday. The XCTAssert methods will expect the expression within their parentheses to be true. If all XCTAsserts pass, the test passes. If one or more fails, the test fails.

Let's test our app! Go ahead and press ⌘ + U (or long click on the run button in the top left of the screen, and select Test)

testHamburgersICanStillEatTodayReturnsWithinRange fails

testHamburgersICanStillEatTodayReturnsWithinRange fails, as expected.

Now go to ViewController.swift and implement the fix (simply involves adding parentheses in the right place):

var hamburgersICanStillEatToday: Int {
    return (maxDailyCalories - totalCaloriesConsumedToday) / caloriesPerBurger
}

hamburgersICanStillEatToday should now pass the test, let's press ⌘ + U to verify that. Here's the output:

hamburgersICanStillEatToday passes the test

Wrapping up tests

These two tests ensure that the two bugs we identified earlier on don't sneak into our app again. We must now make sure that these tests pass before new code is merged into the codebase, and before an app is sent to users.

App Center will make it easy for us to ensure this!

Sharing the Xcode scheme

In order for App Center to build our Xcode project, we need to share the Xcode scheme.

To share a scheme, alt + click on Xcode's run button, click on Manage Schemes, and ensure the Shared box is ticked.

sharing xcode scheme

Committing and pushing the code

App Center can build and test our app once it's hosted on GitHub, Bitbucket, or Visual Studio Team Services. Continuous Integration always works in tandem with version control.

To continue, create a new repository in one of the above services (I'll use GitHub for the remainder of this tutorial) named Reliable Burgers. Then, commit the entire directory we just worked on:

/Reliable Burgers/
|-- Reliable Burgers.xcodeproj/
|-- Reliable Burgers/
|-- Reliable BurgersTests/

and push.

Building and Testing using App Center Portal

  1. Visit appcenter.ms and click on the link to Get Started (you can then sign up for a new account or sign in with Github, Microsoft, Facebook, or Google)

  2. Once you're in, click on Add New App, set Reliable Burgers as the name, select iOS as the OS, and Objective-C/Swift as the platform.

    app center setup

  3. In App Center's left column, click on Build, connect your hosting service if needed, and select your repository.

  4. Reliable Burgers is now being handled by App Center! Now let's click on "Configure Build" and take a look at the options:

    xctests should fail build

  5. Turn the Run XCTest tests to On. We want the build to fail if any of the tests fail!

  6. Click on Save & Build.

Continue reading %How To Use App Center To Build, Test And Deliver iOS Apps%


by Ariel Elkin via SitePoint