Don't Panic

Feb 05, 2015

In a recent AMA, Bill Gates was asked:

Mr Gates, Do you feel that we are facing an overpopulation problem on this planet? If so, what do you think needs to be done about it?

He gave a short answer, stating that as people become more healthy they choose to have fewer children. To back this up he referred to the work of Hans Rosling from Gapminder. At times I found his style a bit odd. That didn't detract from how amazing it was at tying together so many topics that seem big and hard to fix.

Over population, extreme poverty, birth rate, infant mortality, climate change, education, access to healthcare, and ignorance of the west are all interconnected in this video. The basic gist is that since birth rates are falling the population will begin growing much more slowly in the near future. He outlines a number of reasons why birth rates are falling like education, lower infant mortality rates and a general cultural shift in poor countries.

I am not sure about everything being as cut and dry as he makes it. You really should watch the whole video and judge for yourself.

DON'T PANIC — Hans Rosling showing the facts about population from Gapminder on Vimeo.

Be Promiscuous

Aug 20, 2014

A friend of mine decided it was time to move on from his current long-term job. We were chatting about what he was going to do next. He wasn't exactly asking me for advice, but I was giving it to him anyway :) It felt weird because he has done many more things than I have, worked for huge companies, small companies, consulted, etc. Still, it seemed he was unsure of what he should do next. The best advice I could come up with was "Be Promiscuous."

When you don't know what you want in life, the best thing to do is try a bunch of things quickly. In our society, promiscuity gets a bad rap. I think, as time goes on the stigma associated with promiscuity decreases. Our grandparents picked a company and stuck with them. Back then, you didn't experiment - you were a company man and, as such, you were rewarded for that loyalty.

Times change. In most cases you are rewarded for jumping between companies. Constantly proving yourself over and over. By far the best way to get a raise or more responsibility is to find a new job. When an employer sees someone that has been successful again and again, their confidence increases. Crazily, they don't reward the people who stick with them long term. I assume they do a calculation in their head about how likely a person is to leave vs how much it would cost to insure the person stays. When employers think in aggregate about talent retention, they tend to undervalue individuals. Everyone understands that people come and go. Employers know that getting 12 months of a successful engineer's time is better than getting 4 years from someone who can merely keep their job.

Similar to life, the best time in a career to experiment is when you are younger. You need to figure out what you actually want to do with your life. Do you crave solving hard problems? Or is making people's lives easier more important to you? Maybe an easy job, so you can take care of your family is best for you. You should experiment with the tools you use and the domains you work in. You should try anything you think you might like, and only change when you are bored, unhappy or generally feel stuck. When you make a change, at least have a vague understanding of how the change helps you accomplish one of your goals. If your change isn't working for you, start over at square one.

Even if you are not young you should feel free to experiment with your career. It can seem like there is risk in switching jobs, but think how easy it is to get a new job with the skills you already know. Now consider how much easier it will be to find a job with the new skills you will learn. There is a saying, "the best time to plant a tree is 20 years ago, but the second to best time to plant one is now."

I used to worry that switching jobs so often would reflect poorly on me in interviews. However, no one has ever asked me why I switched jobs so often, but it might be because I usually stay at least a year in a position. That is how long it takes me to get bored. Sometimes I stayed longer, if I was interested. Ultimately as I advance in my career, I value the feeling of change above all. Contracting was the perfect fit for that, you get to work with a team for awhile, learn from them, and when they don't need you anymore you get to move on; no hard feelings.

I may end up taking a full time job again some day. I may end up starting a company and cursing all my employees who leave with their "institutional knowledge." But ultimately doing my best work depends on me being motivated and happy. Until then, promiscuity awaits.

Things Are Better

May 29, 2014

In 2007 I was working at Taxi Magic. The iPhone had been announced, but it wasn't clear how big it would be. There was no Appstore in sight. Our goal was to let corporate users book, track and expense taxis from their smartphones. This was an ambitious goal that had a lot of moving pieces. We had to integrate with taxi dispatch systems, build a smartphone application and integrate with expense management companies. It was a lot for a small start up to take on. For most of the first 2 years there were 6ish of us on the engineering team.

I remember the integrations being annoying, but never difficult. Integrations are time consuming, the most difficult part is convincing a 3rd party that you are something they should spend time on. All that pales in comparison to the hell that was getting an app onto a person's BlackBerry.

As you know the smartphone king in the United States those days was BlackBerry (RIP). You could write apps for Blackberry, but pre Appstore you not only had to advertise but also help people install it. Our sign up process was hilarious, in a sad way. We had a wizard that would walk you through, signing up, configuring a payment method, deciding how you wanted to pay, installing the application and finally testing that application worked.

Here is something you probably didn't know about Blackberry, some of the models didn't come configured with the ability to hit https endpoints. Yes you read that correctly you couldn't use secure endpoints without configuring your APN on a few of the carriers (I think cingular for sure). So you had to add a step to the wizard, "What carrier do you have?" I would not have gone through the wizard if I were a user, it was horrible.

But the funniest step of the whole configuration came after you went through that shitshow. Some models of Blackberries had to be rebooted to have their new settings take effect. And worse some of them didn't take effect unless you pulled the whole battery out. So, add a step to the wizard, "remove your battery." I remember we had one customer who called and wanted to use our system, but he didn't want to reboot his device. When we asked him why he couldn't reboot his device he said, "I don't want to lose my Brick Breaker game." Apparently he could pause his game of Brick Breaker and resume it. Obviously losing his score was a deal breaker. Tough to reason with that.

I say all this not just to walk down memory lane. Sometimes, I think that all the horrible restrictions in the Appstore are holding us back from advancing computing to the next level. But I don't want to lose sight of how difficult it was for technical and nontechnical people to install 3rd party software on their Smartphones. We are now around 6 years from the announcement of the app store and the painful memories of getting software onto someone's phone have slowly faded away. In those 6 years we went from a 10 step wizard to a a single link; that is progress. Unfortunately, in those 6 years not much has changed, probably because the current system is working fine for the user. In 6 years I hope, we will all be talking about how terrible today's system was and be gleeful that the goals of the user, developer and platform provider are aligned. But in reality, I will probably just rewrite this article and increment all the numbers by 6 years ;)

Time for Xcode to Grow Up

Apr 17, 2014

It is fair to say that Xcode has gotten immeasurably better since the early times of Xcode 4. Long forgotten are the days of selecting a different /Developer directory to install Xcode betas. Soon forgotten will be the days of random crashes. Everything seems reasonably snappy, you don't have to wait 15 seconds if you hit CMD-T on accident (or on purpose).

The whole system seems much more predictable. That said things are not perfect. You still don't want to press a button that says Fix when it comes to provisioning, because (spoiler alert) it doesn't fix your problem. Sometimes restarting Xcode fixes random things, sometimes you have to sweet talk Xcode* into compliance.

Since Xcode has stabilized so much people are tentatively optimistic about its future. We are currently in a Renaissance of Xcode plugins. Unfortunately, the best plugins have yet to be written. Companies are hesitant to build plugins because there is no official support from Apple. Every new version of Xcode is likely to break your plugin. As a company it is difficult to do capacity planning if there is no official api or support from your platform owner.

A formalized system benefits apple in a few (mostly theoretical) ways:

  • If developers are able to be more productive, they can spend extra time creating more amazing things for the platform.
  • The more comfortable developers are using a tool, the less they want to switch. Creating voluntary vendor lock in for mid to junior developers.
  • If a company had an official Xcode plugin you can be sure they would put an Xcode logo on their website, subtly extending apple's brand.

But I think an official plugin api for Xcode is highly unlikely. Apple has a track record of supporting people who make apps, but not people who support app makers. Helping tool makers doesn't make Apple more money, in the short. Not having to support an official plugin architecture allows them to iterate more quickly. If I were running Apple I might make the same choice. But I still pine for a streamlined workflow that supported plugins could partially provide.

* this doesn't work, I've tried

Time for a change

Dec 14, 2013

I have been in the DC area for 9 years. It is the longest I have lived anywhere in my adult life. I can't believe it has been that long.

DC has been amazing for me. I have made lifelong friendships. I was one of the first employees at Taxi Magic. I started my own business. I changed my career direction multiple times for the better. I attended the 2008 Obama inauguration when people were excited. I was able to do things I never imagined being able to do.

I say all that because when people relocate, I think there is a tendency to think they were unhappy. I was not unhappy. That said DC is a place that is difficult to call "home." It is big and people are constantly leaving (now I am one of them). I am mostly looking for a place that is a bit smaller with a bunch of new adventures.

Starting in March, I am going to be calling Portland, OR home. I have been there on multiple occasions and have loved it. I am looking forward to exploring the west coast for a while. If there is someone you think I should meet, please do an intro I would like to have a few more friends when I get there.

Some things are not changing though. I am still going to be running 2 limes, my consulting company. I am still going to be pursuing my own commercial and open source products. My day to day will probably not be changed, which is good since I am happy.

Keep being awesome and call me up if you are going to visit Portland.


Dec 14, 2013

A childhood dream

Like many teenagers, I loved video games. When it was time to decide what I was going to do with my life, I thought it might be fun to make video games for people. So, I studied software, I built things, and somewhere along the way I stopped playing all but the most casual video games. This year when Apple announced SpriteKit, a 1st class iOS game framework, I decided to follow through on that dream.

The game

Linkage 1
Linkage 2

Linkage is the type of game I play now. Super easy to start playing, the longer you play the better you get. It feels like if you play longer you will get better at it. There is some strategy to it and you can get a better score by thinking. Most importantly, you can't buy your way to a better score.

The general game play is inspired by Bejeweled. You swap and rotate tiles a make connections. There are two game modes. One is for people who like to go faster and be pressured. The other is for people who like to think. I think they are both fun. I would be honored if you would play it and let me know what you think. It is free so have fun.

Lapse the World

Oct 18, 2013

Origin Story

I am excited to announce my first new personal project in awhile. It is called Lapse the World. It is a app for making time lapses on your iPhone. It is my first (completed) project that involves AVFoundation. It took me way out of my comfort zone in the best possible way.

It started as a proof of concept because a job required me make extensive use of a framework I wasn't comfortable with. I didn't end up getting the job for a variety of reasons. I did end up getting a taste for audio and video programming. It is different than the usual consume web services and do something on the device. My friend calls this type of programming being a "bit dump truck driver".

I knew I wanted to finish this project, I also knew that I sucked at finishing things on my own. I recruited my friend, Seth, to help with the code and keep me motivated. Between the two of us we were able to wrap this up and get it launched.

Lapse List Screen

Lapse List Screen

Recording Setup Screen

Recording Setup Screen

The Recording Process

Many time lapse apps record the video in real time then compress it later. This is good for some reasons and bad for others. The best part about this approach is that you can choose how fast to make the video look after it has been recorded. The downside is that the recording is stored in it's original size which is a deal breaker for me since the iPhone is storage constrained.

We decided to go a different route. We let you specify a number of different compression ratios before you start recording and only record the frames that are needed. A normal video is recorded at 30 frames per second. Say you want to make a recording that appears 30 times faster than real time. So, we grab 1 frame per second instead of 30. Then when you play the video back, you view it at 30 frames per second making 30 seconds fly by in 1 second.

We are allowing you to pick up to 3 compressions while you record, because if you are like us, you don't really know what compression to use to make it look cool. As you can see in the above screen shot, we have a couple presets and a way to customize it if you want to experiment, or know what you are doing.

Other Stuff

We decided to make it free with In App Purchase. Enough digital ink has been spilled talking about app store pricing and the race to the bottom, so I am not going to go into further detail about it. But suffice to say, since Seth and I don't have huge internet followings, we thought it would sell better if it were free and people could pay to export their videos after they have tried it out.

Seth also build a custom video scrubber that shows frames from your lapse. It is awesome and Seth will be open sourcing it shortly. For time lapses, it isn't that cool because most time lapses kinda look the same throughout the video, but if you use Lapse the World while you are driving or something the scrubber should help you see different parts of your video while you are scrubbing.


If you make any lapses with the app drop us a line we would love to see them.

Real Quick: Template Images

Oct 15, 2013

iOS 7 introduced the concept of image templates. This builds on the idea of an app having a tint color. When you use a template image any nontransparent pixels get colored to your application's tintColor.

In order to support this concept UIImages have the concept of renderMode. There are three unique render modes:

  • UIImageRenderingModeAutomatic
  • UIImageRenderingModeAlwaysOriginal
  • UIImageRenderingModeAlwaysTemplate

As you can guess, automatic is default. In the documentation, Apple says that automatic render mode is context sensitive. The context in this case is the type of UIKit element the image is rendered in. For instance, UIBarButtonItems render in template mode when you use the automatic render mode.

The general rule is that if you are interacting with the element, automatic mode will probably render as a template. Elements that follow this rule are:

  • UIBarButtonItem
  • UISegmentedControl
  • UIButton (foreground images)

One borderline exception to this rule is background images for UIButtons. They act like UIImageViews, automatic mode acts like original mode.

Overall it is pretty straight forward. Below are two images showing these items rendered with different tint colors and only 1 image packaged. I shared the code for this post github.

Blue Tint Color

Blue Tint Color

Red Tint Color

Red Tint Color

Xcode Asset Catalogs

Oct 01, 2013


This year at WWDC Apple introduced Asset Catalogs. Asset Catalogs are meant to reduce clutter in your project navigator and bring clarity to how images are being used. The idea is that instead of having all your images listed out, you have one or more asset catalogs in which you can drag and drop the images into the correct spot.

Asset Catalog

In addition to using it for the app icon and launch images, you can use it for arbitrary images. Images can be used universally or device specific. This is super handy because you don't need to remember all the file naming conventions for iPhone vs iPad vs retina vs 4inch vs etc.


Universal Asset

Device Specific

Device Specific Asset

Slicing and Resizing

Asset Catalogs also allow you to do slicing. This tells iOS and Xcode how to stretch the image when the view it is filling is larger than the underlying image. This functionality has always been supported in iOS with a few different methods on UIImage the most recent is resizableImageWithCapInsets:. One big improvement is that Interface Builder will now show the stretching maintaining the insets correctly. As always, the images can be stretched vertically, horizontally or both.

One thing that is actually great about slicing in Xcode is that the designer can provide you an image as wide as they want. You don't have to explain to them how slicing off end caps and a middle two pixels works. After some quick tests, I have determined that Xcode produces the smallest image in needs at build time. Which means it is slicing off all the unneeded bits before it packages it for you. That leaves you with the best of both worlds, when you look at it in Xcode it looks big, but it packages the minimum amount needed.

For reference here is Apple's guide to image slicing.


I haven't dug into this too much but it looks like all your Asset Catalogs are being put into one file called I don't know the specific binary format being used to pack all the images and slicing data, but I would guess one advantage would be that you don't have wasted block fractions. As you probably know the smallest amount of space you can allocate to a file is 1 block. Since the block size on iOS is 8k, if an image is 12k, it takes up 1.5 blocks, leaving half a block wasted. Multiply that by 1000 images and are talking about a real savings. That will speed up download times for your users. UPDATE: Daniel Jalkut points out in these tweets (1, 2) that the app is delivered in 1 zip file, so this will not help download speeds.

There is some overhead associated with loading Asset Catalogs. I would guess that the app would load all your assets into memory, this could lead to having images in memory that aren't being used. That said, you probably don't have enough images to be problematic. One important thing you should be doing anyway is removing unused images. I use a the Slender Mac app. It doesn't support Asset Catalogs yet, hopefully in the future it will.

Updating and Diffing Images

The biggest issue I have with Asset Catalogs is updating images. Many times when I am working with a designer they will iterate 2 to ∞ times to make sure the app looks and feels perfect. Typically I will get a new set of images from the designer and drop them into the project and start using them. As far as I can tell, you have to drop the image into the correct box in the Asset Catalog if you want to update it, which is less than ideal. Currently, I don't have a simplified solution to improve the new workflow. Since the point of Asset Catalogs is abstracting away the file name conventions, I don't see how Xcode would know where to put those images.

Another issue is diffing. You used to be able to look at the the old image and the new image side by side in Xcode's "version editor." With Asset Catalogs it shows the whole catalog as different even if only 1 image has changed. This is mostly a non issue for me since I use Black Pixel's Kaleidoscope for all my diffing needs. Kaleidoscope still diffs the images as good as ever. But it is a bit of a drag to not be able to glance at the project navigator to see what has been changed.

Localization and Translation

Images get localized and translated like other things in the application. At this point I don't see a way to localize Asset Catalogs. This is probably not that big of a deal because image localization should only occur when an icon means a different thing in a different country. That happens, but not enough to let it stop you from using Asset Catalogs. If you do need to translate an image you can do it the old way.

iOS 6

This is mostly a non issue since most people are going iOS 7 only so quickly. But if you choose to target iOS 6 for backwards compatibility, it will include the file and all the image files. I didn't research how this would affect the resizing. It doesn't really matter, because if you are targeting iOS 6 you probably shouldn't use Asset Catalogs due to the increased app size.

Somethings Do Not Need To Be Uberified

Aug 26, 2013

I was reading the article, Uber for Everything. The idea is that if you have a drill (or whatever) you aren't using, you can rent it out to nearby people and make a little coin. In addition to that some middle man can shave a few percent off the transaction and get rich. What could be better?

Some of the stuff in the article make no sense. The first example is a drill that costs $22. It would probably cost 1/4 that just to transport it over. Then you have the middleman's cut, then you have whatever money the owner is going to make. Probably not a good candidate for a marketplace.

Another example is Dinner set for 12 people on a friday night. A much better candidate, but who wants to rent out their dinner set to strangers? Presumably you like your plates (because you bought them). If one plate gets broke while your friends are over, you can excuse that, because you probably like your friends too. But if a person renting the plates from you breaks a plate whatever amount of money you get in compensation is not going to make up for the fact that you now have an incomplete set.

I think a better fit for this problem a community driven co-op. Where the government seeds a new organization with a $100k. This would allow them to buy a few of every item they want to rent out. Community members could pay a small monthly fee to be a member of the co-op. In addition to the fee if they broke anything they would be liable for paying to replace it (based on depreciation values). The monthly fee would go to running the staff and essentially replacing items and adding new items as needed. It would work similarly to a library, If you check out dishes on friday, you have to bring them back clean on saturday so your neighbors can use them.

I just can't see a world where we need to create a marketplace for everyday things. That said, I also don't want to have a hammer or drill in my house, so someone get on this co-op idea.