Learning how to program iOS – Part 2

A quick update on Chapter 2 of “iOS Application Development” which covered Xcode and the iOS simulator. I had played with an older version of Xcode (3.2 I think?) with the current version being 4.6 as I write this – seems like a lot has changed. I think the IDE has greatly improved – I like the Assistant Editor which pulls up header (.h) files in a separate side window from the current implementation (.m) files, and I like snapshots and the visual diffs they show, plus the error/warning feedback seems much better than I remember it.

I think the one thing I really like about learning from a book as opposed to finding stuff on the web – it’s great having everything in one place, and it’s great having stuff grouped together. It was nice to read a quick overview of the iOS Simulator’s capabilities, something I had never even thought to look up.

Now comes the actual learning part – starting the Objective-C portion next..

Learning how to program iOS – Part 1

I’ve been wanting to learn how to develop iOS applications since the iPhone first came out, not because I have the perfect idea for an app but mainly just curiosity. I’ve dabbled a bit here and there, using some of the Apple documentation (which is pretty awful for those just starting out), but it’s just so graphically oriented, and that is so not my thing – that’s probably why I never really did it. I almost took an in-person class starting a couple of weeks ago – there’s something about having to actually show up at a specific place and time that’s very appealing to my procrastinational nature, but I was told by other iOS developers that it didn’t have a good syllabus and that it would teach me the bare minimum and also how most iOS developers DON’T write iOS apps so I skipped.

However, I’ve got a client with an existing iOS application that needs work, so now’s my chance to really jump in with both feet. I’m using a book I just bought: “iOS Application Development in 24 Hours”. It was the newest and highest rated book available (just released actually), and I have been told that Apple keeps changing Xcode and the libraries from version to version and sometimes they’re not backwards compatible, so it’s best to be developing with the latest information and the latest versions.

The first chapter was some good starting information about the the devices themselves, including the Retina display, which if you were using an earlier book, would not have mentioned. It also had some information about signing up for the iOS developer program through Apple, though not nearly enough in my opinion.

Moving from Apache to Nginx – wow!

I have been meaning to switch this site from Apache to Nginx for a while now – actually, to tune this website a bit better as a whole. I’ve been using various tools (Google PageSpeed, http://www.monitor.us, http://www.pingdom.com) to track the results and I thought I would recap how things have gone.

When I first started this project, I had a plain vanilla WordPress with no optimization running a handful of plugins on an old Dell 1U Solaris server using Apache+mod_php. PageSpeed showed my initial score to be 75. An infrequent monitor.us performance monitoring was telling me the average response time was about 650ms as a baseline.

My first step was to resize all the “system” images (NOT the gallery images). This bumped the PageSpeed score up to 77.

I tried installing W3 Total Cache, but the whole install was a mess. It wants to run to /wp-content, requests 777 permissions, etc. I had problems with the page display getting messed up, even after clearing the cache. Even though the pages were messed up, the PageSpeed score went to 81. I’m sure I could have figured how to actually get it up and running the way I wanted, but I wanted to do all this by hand anyway, so I scrapped Total Cache and moved on – back to Page Speed score 77.

Next up – enabling mod_gzip on Apache. PageSpeed score increased to 81 – not bad for a simple modification.

I was going to try and install mod_pagespeed from Google, but I had no luck getting it to compile with gcc under Solaris. I love Solaris, but I swear I need to switch to Linux one of these days. None of the new software compiles under Solaris. My list of stuff I can’t get to compile is long: mongodb, mcrypt, mysql-5.5.x, newrelic – and those are just the relics sitting in my /usr/local/src directory that I haven’t deleted in frustration.

Next I installed some object caching via APC, but the PageSpeed score stayed at 81. Adding sendfile and MMAP via the Apache httpd.conf bumped it up to 83.
It was at this point that I started a trial of Pingdom to track the page response times on a more granular level. However, Pingdom was showing page response times of around 975ms, which surprised me since monitor.us showed a drop from 650ms to around 587ms. I wish now I had a baseline number from Pingdom before starting any of this, but oh well.
Next up was the big change – moving from Apache to Nginx+php-fpm. After getting everything configured and tested, I switched. WOW! PageSpeed reports 94, and Pingdom reports response time dropping from 975ms to 237ms (see graphic). Talk about immediate results!
There’s more tuning I plan on doing (like implementing a CDN via S3), though I think all the big gains have been achieved. I’ll update the blog as I get the results.

New tool for weekly planning: Teux Deux

I’m not sure about you, but I struggle with planning and prioritizing things. My problem is that I’m too efficient at capturing thoughts and ideas, and I’m always overwhelmed by what things I should be doing because my ‘to do’ list is way too long!

One of the productivity steps I’ve read about but had problems implementing was planning out the major things I’d like to get accomplished in the week ahead. All the techniques I tried to visualize and track this data never seemed to work for me until I remembered a piece of software I had demo’ed long ago – Teux Deux:

Teux Deux screencapture

I love the layout – perfect for visualizing the tasks allocated each day for the whole week. If you don’t finish the tasks for a day, they’re automatically moved to the next day which is helpful. Once you enter a string/task, you can re-arrange the order (or move to another day) by dragging and dropping. You can also check off the task once it’s done (shows a line drawn through the task) or click an ‘x’ at the end of the line to delete it. Unfortunately, to edit a string, you need to delete it and re-add it which is kind of stupid. Helps to read the FAQ: you can edit a string by dragging to the inpput box! But it does have an iPhone app now so you can take your list with you.

Give it a try and see if it can’t help you focus on getting more major accomplishments done each week!

Consulting and startups

After my dad passed away, I was very fortunate to be able to take some time off and figure out what’s important to me and how I want to move forward with my life.  During this period, I moved back to Seattle from San Diego, re-established very close ties to my family, and evaluated what I wanted to do with my time.

Lately, I’ve been getting up to speed on the latest techniques and technologies.  For example, I had worked with WordPress before writing backend plugins and hacking things  up as needed, but I knew it was important that I learn how to do things the right way using filters and actions. I’ve also spent quite a bit of time learning JavaScript/Ajax, jQuery and CSS. Those technologies really started to blossom when I was getting less hands-on as a COO-type, and I feel like it was very important for me to be up-to-speed on them.

I’m learning to love rapid deployment cycle.  I’ve always been an old-school guy, writing code in vi over an SSH session (which I still do of course!). But I like using Komodo to develop code locally, especially with MVC frameworks!  I use both SVN and Git to manage projects which allows me to develop on my MacBookPro remotely, my home Windows machine, or the unix command line on my servers sometimes.  And especially love using branches to fold updates into my main trunks – truly handy for updating things like WordPress and CodeIgniter.

I’m doing all of these things because I find myself wanting to get back into consulting – it’s what I love and it’s what I’m good at. It took some time away from it for me to realize it, but isn’t that how things always seem to work?

And I’ve got my eye on the startup community here in Seattle. I won’t lie – I absolutely love being around REALLY smartest people. I love the energy and excitment coming from the local startups here, and I’m curious to see where I fit in.

I’m in the process of developing a consulting website, and I’ll certainly be promoting it when it’s presentable.