Evan Doll : iOS Tools at Flipboard

Evan Doll of Flipboard fame explained the tools they use in Flipboard development in a 2014 NSConference talk. What I like about Evan and his talk is his honesty and straight forward approach. There is no hipster framework name dropping, cat pictures, or other side shows – just an honest look into the tools and techniques they’ve used to build a very successful iOS product.

Here are my notes from the talk – which you can find here – iOS Tools at Flipboard


 

Evan Doll – Prior to Flipboard worked for Apple doing video / photo software. Also iOS system apps / UIKit. Stanford course instructor.

Goals

  • Automation – avoid crap work.
  • Squash bugs – add hooks to improve debugging.
  • Tools – Give yourself superpowers
Automation – avoid crap work
  • Jenkins for automation.
  • Pretty generic discussion of build automation (build / tag / upload to HockeyApp).
  • Run clang static analyzer.
  • Automatic beta distribution.
  • Provisioning : black magic and swearing involved.
  • Spolsky : can you make a build for testing purposes in 1 step?
  • Stamp app icon with version – easy to identify.
  • Multiple bundle IDs for different versions of apps. Allows multiple installed builds per device.
  • App Code – unused code detection, additional warnings that clang will not catch.
  • Hockeyapp
  • In-app debugging – tools to expose app internals for debugging – turned on in debug builds via flags.
  • Cocoa Lumberjack
Squash bugs – add hooks to improve debugging
  • View hierarchy debugging.
  • Gesture based tools / issue reporting. Double pressing the up/down volume button press to trigger the debug UI. Similar to Google’s “shake to report bug”.
  • JIRA – “the least bad of the bug trackers out there”.
  • Global keyboard shortcut handler. Flipboard hooked up a global event listener to globally listen for keyboard events to trigger actions. They use this for debugging in the simulator. Subclass UIApplication, override sendEvent to extract GSEventRef, posts NSNotification. Example : Cmd-L to send logs, etc.
Internal feature switches
  • Feature switches (debug only) to customize / streamline the debug experience. i.e., skip the login screen.
  • Feature switches for UI – toggle between UI modes to determine which UI is better.
  • International testing – override the default language via a defaults config value.
  • Pseudo-localization – writing your own “language” to verify your views are handing variable string lengths and strings you’ve forgot to localize.
  • WebTranslateIt – shared localized strings between iOS / Android.
Tools – Give yourself superpowers
  • Push as much app logic can server side to workaround bugs. For example, a JSON dictionary to configure the device at runtime.
  • Changing help files / strings / etc.
  • Add generic hooks into the app to allow you to update the app w/o deploying an app store update.
Communication tools
  • Pivotal tracker
  • Github pull requests (in-progress code)
  • HipChat
  • Dropbox
  • Google Hangouts
  • GitX + email

RACifying Non-Reactive Code – Dave Lee’s Presentation Code

Dave Lee gave a talk titled RACifying Non-Reactive Code for GitHub Reactive Cocoa Developer Conference in June 2014 (about two weeks after Apple’s Swift WWDC announcement). His presentation is a no-nonsense, fast paced ~25 minutes of walking thru the multitude of ways in which objective-c, cocoa, and the Apple frameworks present events and how to translate those events into RAC (e.g., RACSignal).

One of the first things every newcomer to RAC learns – perhaps the first “a-ha!” moment – is that cocoa presents a multitude of ways in which events are passed and received. It’s eye opening to realize how much these seemingly different event mechanisms have in common. When learning about KVO for example, you don’t consider the commonality KVO has with another eventing mechanism such as delegation or target/action. But stepping back to look at these event paradigms together, to understand what they are ultimately trying to solve, makes you realize they indeed are all doing fundamentally the same thing – an event source is providing events to another object observing those events.

Now, this is one of the fundamental goals the RAC authors are trying to achieve : abstracting the 20+ years of cruft and ugliness built up in the various Objective-C eventing patterns into common, modern, and functional abstractions (i.e., RACSignal, RACSubscriber, etc). While their implementation is not perfect (“hot” vs. “cold” signals, a non-generic type system preventing you from clearly seeing what type will be delivered with an event), it goes a long way towards writing clear, concise code with less state (win, win, win!).

Dave’s talk was interesting since it showed concrete examples of the various objective-c patterns and how they translate into RAC. As I was watching the video, I was frequently pausing it, thinking to myself “oh, I can use that in this project – I need to copy this code down”. After stopping a few times, I realized I should just start over, copy all the examples down, and keep them for reference. The objective-c patterns he converts to RAC are:

  • Blocks
  • Delegates
  • Notifications
  • Errors
  • Target-Action
  • KVO
  • Method Overriding

Dave’s talk is highly recommended for anyone new to RAC. Without further ado, here’s the code:

 

Spotify : Mac and web app comparision

spotify-logo

For Christmas, I was gifted a year subscription to Spotify. Up to this point, I’ve purchased all my music. I’ve used Spotify in the past using a free account to try it out, but never committed. I didn’t really get into the service much – I found my playlists got stale quick and didn’t invest time to make new playlists, listen to the radio or find new music.

Now that I’m a subscriber, I want to fully understand the software and community. To this point, I used the Mac client. Features being equal, I’d rather use the web client and avoid maintaining software on my macs. So I did a comparison of both apps.

First of all, let me say that I have respect for any company that supports all the major desktop, mobile, and web platforms. I live that reality and fully understand the challenges trying to accommodate all of them. It’s a huge effort – from engineering to support.

Their Mac interface isn’t terrible. It’s not purely mac, but it’s ok. Buttons aren’t Mac buttons, table views don’t bounce, etc. But it does the job. Looking at iTunes isn’t any better. Looking into Spotify.app, they are embedding Chromium, use C++, boost, Lua, SQLite, Flash (really? for ads?), Growl, have a few helper applications (for web, ads, it appears), run their helper under launchd, nothing too out of the ordinary here.

Spotify appears to be really OSS friendly. Much of their architecture is freely available online. One of their engineers, Gunnar Kreitz, posted a few papers that I’ll probably read to better understand their design.

I did notice Spotify took the chrome route and are forking multiple child processes to presumably handle plug-in “apps” or web views. They are aggressive with their subprocesses.

spotify-processes

 

All things being equal, I would rather use the web version. No installation, no upgrades, no maintenance. And quite honestly, Spotify did a nice job with the web interface. Featurewise, it’s nearly identical. I listed below the list of differences I saw – most of them are minor.

One thing that stuck out – you can’t sort playlists on the web. The main function of any subscription music service is to discover and play music, right? The ability to discover, create, manipulate, and share playlists is essential. It’s eyebrow raising – here we have a cross platform music streaming service cut from the cloth of seemingly very solid computer scientists that lacks the ability to sort a playlist.

A quick google search later and it turns out this is a 2 year old new idea. I’m shocked it’s a known, unsolved, and 2 year old issue. I can sort a playlist on my iOS device, but not the web? Has web development stopped? Does nobody use the web client?

 

As far as the rest of the Mac/web differences. App Finder might be nice depending on what the apps have access to within Spotify.

I’m going to give the web player a try and use my iOS device for sorting. We’ll see how it goes. I’m looking forward to using the service in 2015!

Main differences

  • Native app has USB device sync. Does anyone need this?
  • Native app has “App Finder”. Might be nice for discovery, recommendations, or analytics.
  • Native app has Local Files section (surely for offline playback). (not relevant for web). I don’t need this – all my offline needs are handled on my iOS device.
  • Playlist sorting, song sorting within a playlist.
Minor differences
  • The left sidebar options are different: * Native app – contains “follow”, “top lists”, “messages”, “play queue”, devices” * Web app embeds most of this under the “browse” item.
  • Your music : * Native app has a section in the left sidebar (songs / albums / artists ..) * Web app has a single “your music” icon on left, all content is broken out as submenus on the “your music” page.
  • Right sidebar differences: * Native app – “activity feed” – can hide. * Web app – player + related items.

#gettingalumpofcole

#gettingalumpofcole

Merry Christmas! Our son, Cole (8), master of the photo bomb, is this year’s star on our Christmas card. #gettingalumpofcole made us laugh – it’s the perfect hashtag to accompany the card and the young man himself.

We wish you a very Merry Christmas and a healthy, prosperous 2015!

2014-xmas-card-front2014-xmas-card-back

 

Living the Bible in the workplace

This March, I attended a Men’s fellowship / breakfast with guest speaker Bill English who delivered a great talk titled “Living the Bible in the Workplace”. It was a fantastic presentation. Experienced engineers and scientists know that while computers are important, the most important skill we can master is dealing with people. Bill’s talk challenged us to think about we treat people at work, how we want our professional legacy to be remembered, and how we can focus our daily activities towards achieving success with our work and with our professional relationships.

Oh – as it turns out, Bill is a tech guy – a Microsoft SharePoint / Exchange trainer and author here in Minneapolis. You can find out more about Bill and his company here – Bill English – Mindsharp

Bill English – “Living the Bible in the workplace”

Legacy
  • How will you be remembered for your work? What will you leave behind in “your wake” (boat wake):
  • What did you accomplish?
  • How did you treat others in the process?
  • Before you can be an effective teacher, you must earn respect from others.
Examples
  • Steve Jobs : accomplished a lot, didn’t always treat others well.
  • Tony Dungee : accomplished some, was great to others.
To earn respect, be Integrated with people
  • Connect authentically. “Lean in” to them. Listen before talking.
  • Orient toward the truth. High achievers face reality and deal with it.
  • Resolve conflict. The Bible clearly states we will have problems. If you want to help people in their relationship to God, you need to resolve personal conflict.
  • Delivers results & finish well. Don’t be mediocre. Human tendency is to do just enough to get by. Fight the temptation to coast. Fight the temptation to blame others for mediocrity.
  • Orient toward growth. Own your work. Don’t check out, check in.
  • Be transcendent. Sacrifice yourself for the greater cause.
Ask yourself
  • Do you take risks? If you want to walk on water, you have to get out of your boat (comfort zone). There is always risk. Take on risk.
  • Are you coasting? Are you holding back?

Book Review : Born to Run

While on vacation earlier this year, I ran across (see what I did there?) Born to Run at my cousin and fellow marathoner Chad Allison’s house. Of course I was curious. Was he getting a leg up on me for the Twin Cities Marathon this year by learning a few new tricks? I certainly couldn’t let that happen. Also having a little extra motivation for this spring’s races couldn’t hurt – so I bought a copy. Overall, I enjoyed it. I picked up a few tips to improve my form and improved my motivation for spring. Enjoy the review!

 

Damon

 

mzi.smkxgmpc.225x225-75

 

Born to Run

tl;dr : Born to Run is a story about the “secrets” of a Mexican tribe known for being world-class ultra runners. It also discusses the history, diet, industry, and medical aspects of ultra running.

The actual book review is below. I think the most important part of this review is the main points about running mentioned in the book. If I end up losing you before the end of the review, I want to make sure you read these – so here they are!

Running Lessons

Passion

  • Runners do it for love – there is no money in the sport. They (probably) don’t dope since they don’t have any fame or money.

  • The Tarahumara secret was they “loved to run”.

  • Jurek’s tip : “You can’t hate The Beast (fatigue, pain); the only way to truly conquer something, as every great philosopher and geneticist will tell you, is to love it.”

  • “You don’t stop running because you get old. You get old because you stop running” – Jack Kirk, 96 year old ultra marathoner.

  • “If you don’t have answers to your problems after a four hour run, you ain’t getting them”

Nutriton

  • Low protien, high carb diet. The more primitive the better. Makes you realize just how bad the American diet has become.

  • Jurek eats a very low protien, vegetarian diet. Lots of nutrients in low calorie meals that settle quick in the stomach.

Technique

  • The surge for minimalist running started around 1997.

  • Running technique tips : straight back, short steps, on your toes, “easy, light, smooth, fast”

  • Barefoot running, minimalist shoes are the real deal. Bashes Nike, Bowerman.

Joe Vigil (legendary coach) running tips:

  • Practice abundance by giving back.

  • Improve personal relationships.

  • Show integrity to your value system. (You have to become a strong person before you become a strong runner.)

  • Run like a kindergartner. Feet land under your body and they push back.

  • Kenyans have super quick foot turnover. Short, quick strides are more economical than long, powerful ones.

  • Run like you’re running on hot coals.

  • “Nearly all runners do their slow runs too fast and fast runs too slow.”

  • Teach your body to use fat by staying under the aerobic threshold.

Evolution

  • Evolution : early tribes hunted by running. Humans were slower than animals, but much longer endurance. McDougall makes the case that humans were “Born to Run” and attempts to prove it by human body characteristics and early hunting.

  • Living a happy, peaceful, life like the Tarahumara is what Western cultures strive for. Western cultures value materialism and self-centeredness which prevent them from achieving that lifestyle.

Corporate Influence

  • American running : “Overpronation” and other running jargon didn’t exist in the 70’s, before Nike and the shoe companies. Americans in the 70’s were fast. A handful of people ran 2:12 marathons. 20 years later, nobody did. The Kenyans didn’t get faster, Americans got slower. In the 80’s, when cash and shoe companies entered into the mix, we slowed down. The fun was replaced with money.

  • Bill Bowerman started advocating a new kind of running style that required his shoes. He asked “what if you stepped beyond your center of gravity to lengthen your stride”. Thus – you needed his shoes. Completely wrong advice, but he marketed it well.

  • Bowerman created a market for his product, then created the product.

  • The real test that heel landing is incorrect is if you run without shoes. It will hurt to land on your heel. Bowerman’s advice was actually hurting people.

  • Bowerman’s mentor, Arthur Lydiard, advocated a barefoot running style. After Bowerman died in 2002, they asked Arthur for advice. He advocated a barefoot style. Nike researched barefoot running cultures and created “Nike Free” with the slogan “Run Barefoot”.

  • So Nike created an artifical market for running shoes based on Bowerman’s scientifically incorrect theory that thick soled shoes reduce injury, then after 30 years realizes they were wrong, created Nike Free.

  • Nike held a practice of discontinuing shoes periodically and bringing them back a few years later. Why? Money. To motivate people into buying multiple pairs of shoes at a time before their favorite model was discontinued.

Medical

  • Dr. Daniel Lieberman, anthropologist at Harvard “Many running injuries are caused by our feat being weak. Before Nike in 1972, people ran in thin soled shoes and had a much lower incidence of knee injuries”.

  • He claims that if running shoes didn’t exist, more people would run and less would die of illness due to being sedentary. * There is no evidence that running shoes prevent injury.

  • Astronauts, when returning to earth, return with weak bones / muscles, have depression, atrophy, all because they haven’t moved their muscles in days. Humans need to run for survival.

  • The American diet is truly killing people. Diets high in fruits and vegetables (little meat) severely reduces cancer, obesity, diabetes, and other American diet related diseases.

“Painful Truths”
  1. The best running shoes are the worst. Runners wearing top of the line shoes are 123% more likely to get injured than those in cheap shoes. – Univerity of Bern (Switzerland)

  2. Feet like a good beating Impact is actually lightest when you don’t have cushioned shoes.

  3. Humans were designed to run without shoes. Our feet were designed with an arch – which gets stronger under stress. “Putting your feet in shoes is like putting them in a plaster cast” Kenyans have very elasticity in their feet.

Scott Jurek

  • He has a true spirit and passion for running, not attention or stardom. He is the real deal.

  • Scott believed the reason he raced wasn’t to beat people, but be with them.

  • “It’s easy to get outside yourself when you’re thinking about someon else” – great advice to keep yourself motivated on a long run.

  • After being beat by Arnulfo (the fastest Tarahumara runner) in Caballo’s race, he bowed to him. Classy.

The Review

Born to Run is a true story about the author’s adventures into the highly secluded Mexican Copper Canyons to learn about an Indian tribe of “super athletes” called the Tarahumara. The Tarahumara were legendary for their ability to run straight for days at a time, in sandals, on a primitive, vegetarian diet.

While the primary story is about the Tarahumara, Born to Run weaves in rather fascinating stories about the evolution, fundamentals, science, diet, and commercialization of ultra running. The story begins with the author, Scott McDougall, a casual athlete, trying to find a cure for his foot injuries and pain caused by running. He visits multiple American doctors who recommend drug treatments, expensive equipment, and eventually to quit running and take up biking. He didn’t quit, but he listened to the doctors. He bought expensive equipment, took cortizone shots and medication, but nothing worked.

After reading an article about the Tarahumara, he became curious. He wanted to find out how the Tarahumara could run for days while he, with Western culture’s best doctors, medicine, and equipment, could not. Runner’s World magazine, where he worked, allowed him to research and travel to Mexico to find the Tarahumara. The Tarahumara lived deep in the Mexican Copper Canyon mountains – a place surrounded by drug lords, gangs, and crime. He met locals along the way who helped him navigate the tough terrain to eventually meet the Tarahumara.

The Tarahumara are a very hidden, peaceful, healthy, tribe. They eat a very low protein, healthy diet which includes a corn and chia-rich paste called pinole. They enjoyed running games and would literally run together for days at a time. They wore very minimalist homemade sandals which allowed them to keep a natural stride while protecting their feet from the mountainous terrain.

A central figure in the story is Caballo Blanco (“White Horse”). Caballo is an American who met the Tarahumara by crewing for them in the 1992 Leadville 100 race. He liked them so much, he went down to Mexico to live with them. He’s portrayed as sort of a mythical figure who roams around sort of nomadic in Mexico running and living a carefree, simple lifestyle. Caballo’s dream was to hold a race between the Tarahumara and a hand picked group of US ultra marathoners. He admired Scott Jurek, who agreed to race. Jurek was interested since that was his life’s goal : compete and beat the best in the world. Caballo invited Jurek because he had the “right spirit” (not driven by money, like Karnazes and others).

Besices Jurek, Caballo invited a few other ultra athletes to race. Jenn Shelton and Billy Barnett – 21 year old couple tearing up the East Coast ultra races ran w/ Jurek and the Tarahumara in Caballo’s race as did “Barefoot Ted” – Vibram’s first endorsed athlete.

He also invited McDougall, who trained for and eventually raced with the other athletes. He went from a hurt weekender to an ultra runner by going back to tribal practices and learning running fundamentals. He ran with proper form and equipment, ate a primitive diet, and was able to finish the 50 mile race.

The majority of the book involved Caballo’s race, which took place in 2004. The training and preparation the author put into the race, the logistics and personalities of the athletes in the race, and finally the race itself was the main story line carried throughout the book. Interleaved throughout the story were truly great background stories of distance running – some of the main points I’ve highlighted below. These various aspects are applicable to everyone and the advice is fantastic. The main conclusion is rather predictable – the best runners in the world are those who do it because they love it. Like anything in life, passion drives success. The same goes for distance running. After passion comes diet and fundamentals.

Born to Run convincingly links the American diet to disease, stress, obesity (and thus diabetes), and other painfully horrible medical conditions. This book advocates for and shows how a primitive, “tribal” diet high in fruits and vegetables, low in protein is proven to power ultra running success.

The book offers up a brief look at the corruption Bill Bowerman and Nike caused the running community. Bill invented and sold a running style that required his shoes. By claiming that reaching your feet out further, you could lengthen your stride and thus speed up. The problem is lengthening your stride will cause you to land on your heel – an unnatural, painful, and injury causing form. Bill sold this style because it required cushioned shoes – Nike shoes. The book describes Nike’s influence and links the slowing of American distance runners to the time Nike entered the market. Interestingly, after Bowerman died, Nike launched a minimalist line called Nike Free – to attempt to capitalize on the growing number of “minimalist” athletes who were fed up with cushioned shoes.

Born to Run struck a good balance between the story of the Tarahumara, elite athletes and general background information on distance running. It gave me motivation to clean up my stride and diet, which alone is worth the price of the book. I can’t highly recommend it, but I think it makes for an easy to read casual book endurance athletes or aspiring 5k’ers will enjoy.