Tuesday, February 25th, 2014

I was recently asked: “What does it mean to be a developer? What are some traits that you think successful developers should have?”.

I certainly don’t have the answers for a question like that. But I do have opinions. I shared them with my friend, but I think it may also be worthwhile to share them with you as well.

Ultimately, “being a developer” comes down to one thing: a developer writes code. This, of course, is a pretty broad definition.

Because it’s so broad, there are a lot of paths to being a developer. Traditionally, you might think of analytic “mathy” people being developers. And that’s certainly true, and it’s where the roots of the industry lie. But creative “artsy” people can also be great developers. And, because the world is not easily broken up into two sets of people, there are all sorts of other kinds of people who can excel at software development.

But different people can approach the field different ways and look for different goals. It takes a hard-core mathematician to work up solid and correct encryption software, but that person may not be the most suited for building something like Facebook’s recent Paper app. Some people will like to work out their software on paper before ever opening a text editor so they know exactly what they’re building. Others like to explore and make mistakes and figure it out as they go.

Because I’m only one person, I can really only talk about what it means for me to be a developer. I’m not a representative sample by any means and your mileage may vary.

And I, without question, fall on the side of building things as I go and learning and exploring. When I was in school, I noticed that there tended to be two sorts of students in lectures (and here I will pretend that the world is, in fact, easily broken up into two sets of people): those who would raise their hand and ask “What about when you do {X}+{Y}+{Z}?” and those who would just type “{X}+{Y}+{Z}” into their laptops to see what would happen.

I was definitely in the latter set. One of the things that I love about computers so much is the way they make it so easy to just try and see. They make it so easy to just try and fail. And when you try and see and try and fail enough times, eventually you learn something. And then it’s on to the next thing. And then the next.

And sure, there’s a ton of advantage to reading and taking classes and what have you. The good part of a CS education isn’t so much that it teaches you to program (which schools do poorly and only because it’s necessary), but because it gives you a good idea for the shape of problems: so when you find a new problem that sort of looks like problem {A} but also looks a little like problem {B} when you squint, you know what to Google for.

I find that programming, at its best, is a creative endeavor: it’s taking a problem and figuring out how to solve it within a set of constraints. And a lot of that can be taking different solutions for similar problems and squishing them together. Sometimes it works, sometimes it doesn’t: but it’s almost always fun.

So when I try to come up with the things that I think make me a good developer (and again, there are so many different kinds of developers that this cannot possibly be representative), the list starts to look like:

  • Experiment. Try things. Fail. Learn. Repeat.
  • Tinker. Try new technologies, languages, techniques. It’s not about developing mastery: it’s about seeing the shape of the industry so when a new problem appears, you have a wide body of experience to be able to say “Hmm. I think if we combine technology {A} with service {B}, it might get us close to a solution.”
  • Read. Read about all the things there are to tinker with. Read about directions and new ideas and exciting people. Read all the things that the best developers are writing about their craft. Sometimes they’ll be right. Sometimes they’ll be wrong. But they’re always full of exciting ideas about the industry’s history, future, practices, failures, and so much more. There’s no substitute for experimentation and tinkering, but there’s just so much to learn and so little time that we have no choice but to follow in the footsteps of giants.
  • Always Be Coding. Developers love programming. It’s in the blood. It’s one of the most fun things you can do. Create things. Throw them away or ship them, it doesn’t matter. Then create some more.

There’s so much about programming, so many areas to focus on. And I don’t have advice about any of that, because all I know to do is to chase all of it. Like a dog chasing a car, you’ll never catch it: but that’s just not the point.

Good luck.

Tuesday, September 17th, 2013

Today (Wednesday, September 18, 2013) is a big day for Apple fans: the software that powers the iPhone, iPad, and iPod Touch is getting its major yearly update. That’s right: today is release day for iOS 7.

iOS 7 represents the first truly significant design change to iOS since the iPhone was first announced back in 2007. iOS now has an intense focus on typography, color, and depth. I’ve been running it on my two-year-old phone for a week now and it really does make it feel like a new device.

But while I think it’s a great update, there are some changes that may throw a more casual user for a loop. The web is full of in-depth previews and reviews of the differences and new features of iOS 7 and I don’t want to re-tread that same old ground. Instead, I want to take a look at how iOS 7 might look to the most casual of users who might be taken aback by some of the more sweeping changes.

First Impressions

After your device reboots, you will be greeted by the new lock screen. The new lock-screen is a showcase for the new design sensibilities in iOS 7: its edge-to-edge wallpaper, complete lack of OS-chrome, and emphasis on typography are all themes that you will now find throughout the new operating system.

iOS 7 Lock Screen

The old “slide to unlock” slider is gone now. Instead, you can slide anywhere on the screen to move the entire screen out of the way and unlock your device. It’s elegant and natural and it feels like the way it should have worked from the beginning.

There are a few things to call out on the lock screen. At the top and bottom of the screen are two rectangular indicators. On the right-hand bottom corner, there’s a little camera icon.

Callouts of special areas of the lock screen

These are there to let you know that you can slide in from the top or the bottom of the screen to some special features. If you put your finger on top of your device above the screen (say, on the earpiece) and swipe down, you’ll access the Notification Center. If you put your finger at the bottom of your device below the screen (say, on the home button) and swipe up, you’ll access the new Control Center. And if you swipe up on the camera icon, you’ll be granted quick access to the camera app without ever needing to unlock your device (or entering a passcode).

The Notification Center is an update to an existing feature. Now, there are three tabs at the top: “Today”, “All”, and “Missed”.

Notification Center - Today

The Today screen becomes more useful the more information you put into your device. It can give you a short weather forecast along with the current conditions. It can give you an at-a-glimpse view of your financial holdings. If you use your device’s calendar, it can tell you when and where your next appointment is and give you a quick snapshot of your calendar. It can even give you a preview of what your schedule looks like tomorrow.

The “All” tab is roughly the same as the entire Notification Center in iOS 6. It will list any notifications that apps have given. Tapping a notification will open the appropriate app and tapping the x icon will remove those notifications from the list.

Notification Center - All

Dragging up from the bottom of the screen will instead open an entirely new feature: Control Center. Control Center is a fantastic reason to upgrade. With just a swipe, you can control your device’s radios (by turning on or off WiFi or Bluetooth — or enabling/disabling Airplane Mode). You can activate Do Not Disturb to keep your device from intruding in your life and you can activate the portrait lock to keep your device from rotating.

There’s now a slider to easily adjust your screen’s brightness and you have full access to music playback controls. There’s even a feature to turn on your devices camera flash so you can use it as a flashlight.

Control Center

Both Control Center and Notification Center are accessible from anywhere in the system. Even if you’re in an app, you can just swipe up or down and they’ll be there.

Once you unlock your device, you’ll see the new Home Screen.

Home Screen

The biggest change to the home screen is probably the new icons for the built-in apps. Instead of showing those changes here, I’ll link to this Mashable post which does a really good job of showing the new vs. the old. Overall, I think the new icons are recognizable updates of their now-classic ancestors.

The Apps

Apple’s built-in apps have also been redesigned to match the new look of their OS. In addition, you can expect 3rd party app developers to work to update their own apps to avoid looking dated.

I won’t run down the full list of changes: other sites have done that far more thoroughly than seems warranted here. Instead, I want to look at a few of the highlights that might be most likely to throw someone for a loop.

The Calendar app is a showcase for some of the dynamic animations that Apple wants to encourage throughout the system. It’s a clean design that’s nice to use.

Calendar

The biggest negative is that Apple has kind of “hidden” the extremely handy “list view”. This view is now found along with the search interface.

Calendar Search

Once there, you can easily see your agenda in a handy list view. (Note: Additional blurring added by me)

Calendar List

Safari, the web browser, has fully embraced the chromeless look. When you first load a page, it feels a lot like the iOS 6 version.

Safari With Chrome

But, as you scroll down the page, the toolbar at the bottom of the screen disappears and the address bar display shrinks.

Safari With No Chrome

By removing its interface elements, Safari really lets the web page’s content shine. But, some of those buttons (like “back”) are really useful. To summon them back, you just need to tap on the now-miniaturized address bar.

Safari Address Bar

The Photos app has been given a new focus on “moments”. It starts by organizing your photos by year and then guesses which photos belong together based on the time and location they were taken.

Photos - Years

I find this view to be completely useless. Fortunately, Apple left an escape hatch. The “Albums” button in the bottom right hand corner takes you to a familiar album list. From there, you can access your camera roll just like always.

Photos - Albums

Photos - Camera Roll

The Camera app has become a bit more functional. The major new feature is some built-in effects. These can let you spice up your pictures without needing a separate app.

Camera

Camera - Effects

Diving Deeper

iOS 7 also offers some deeper features that can help you get the most out of your device.

Home Screen folders now have a new look (and a fantastic new animation) and, most importantly, support paging.

Folder

If you double-press the home button on your device, you’ll be presented with the snazzy new multitasking interface.

Multitasking

This lets you easily scroll through your apps (in the order that you’ve most recently used them) and shows a gorgeous visual of just what you were doing the last time you were in that app.

If you need to close an app for some reason, you can just throw the screenshot up towards the top of the screen. This gesture will be particularly familiar if you ever used a Palm Pre.

Conclusion

The just scratches the surface of all of the changes between iOS 6 and 7. I think it’s an incredibly worthwhile update and would encourage everyone to upgrade. But it’s possible I haven’t touched on the best feature yet.

New Ringtones.

Ringtones

Mic Drop

The Internet has been aflutter recently with news of a massive attack against WordPress blogs: one good resource might be this article at Ars Technica.

The gist of the attack is that automated scripts are hammering at WordPress blogs that use the default names like “admin” for the administrator user. Since blogs which have changed their admin user name aren’t at risk, the security advice going around at the moment is to make sure you’re not using “admin” as a username (as well as making sure that you have strong passwords for all of your accounts, of course) [EDIT: Hmm. It seems you can't change a username once it's been created. I'm sure there's a plugin for that, but I haven't studied it enough to give advice one way or another. Still, at least this will let you know if you're at risk so you can go set stronger passwords to those accounts!].

But I host a lot of WordPress sites on my server (17 right now) and I don’t even have logins for all of those. So I needed a way to see what usernames each of the blogs on my server use.

So I wrote a script. This script will scan a root folder and look for wordpress blogs. It will then use the database credentials for each blog to log into mysql and look for the usernames that can log in. It will then tell you what those usernames are.

Since it seems like this script could be useful to folks other than me, I’m making it available in my public Mercurial repository. In the process, I went ahead and added a couple other scripts that I’ve written which you might find useful.

The direct link for the “Audit WordPress Blog Credentials” script is http://hg.jameswilliams.me/sysadmin_scripts/file/tip/wp_audit_blog_credentials.sh. You’ll find a link to download the “raw” version of the file on the left-hand side of the page.

I’m sure more scripts will make their way to this repository as I find things I need to automate (that aren’t particularly specific to my situation).

I hope this is useful!

I’ve recently started doing a lot of writing in Markdown: I’ve been taking notes on my iPad in Byword and syncing them through Dropbox so I could open them in Sublime Text on my Mac and Windows computers. And, at least for now, I’ve settled on pandoc as my markdown renderer of choice.

I was using the SublimePandoc plugin for a week or two when I realized that SmartMarkdown had built-in support for SublimePandoc: so there was no reason to duplicate the plugins (this also explains why my command menu had all of those pandoc duplicates…). Also, SublimePandoc hard-codes its html template in its package directory (so using a different template means changing the plugin package) and SmartMarkdown actually uses the template from your regular pandoc data directory. Huzzah. (Of course, I ended up having to edit the SmartMarkdown package directory anyway, but I’m assuming this is a bug that will be fixed one day and not a deliberate design choice.)

So tonight I wanted to dump SublimePandoc and just use SmartMarkdown. I had to fiddle a bit to make it work on my Mac, unfortunately, so I want to document those steps here in case I ever need to do it again.

The biggest problem is that I would get the error "[Errno 2] No such file or directory" whenever I’d try to use SmartMarkdown’s pandoc renderer. It took me a while to track this down (using printf debugging of the plugin: yay Python!) but this error resulted because the plugin couldn’t see my pandoc binary. I don’t really understand this because pandoc is clearly in my path (and I can run it freely from the commandline).

Unfortunately, SmartMarkdown does not currently support setting the pandoc path as a configuration option, so I just hardcoded it in the plugin (yay Python!). I used the terminal command

where pandoc

to find the full path of my pandoc binary and then opened up pandoc_render.py (in $SUBLIME_PACKAGES_DIRECTORY$/SmartMarkdown) and found the run_pandoc method. I changed the line

cmd = ['pandoc'] + args

to

cmd = ['/usr/local/bin/pandoc'] + args

which saved me from that error.

And in my user settings file for SmartMarkdown, I had to add the key

"pandoc_args": ["--standalone"]

to convince pandoc to actually use my template. After that, everything is peachy.

For completeness sake, my full settings for SmartMarkdown and my keyboard shortcuts are:

SmartMarkdown Users Setting File

{
    /* Please specify the PATH of pdflatex if you wanna generate PDF */
    "tex_path": ["/usr/texbin",
                 "/usr/texbin"],
    /* Provide your arguments here as a list e.g.: ["--latex-engine=xelatex", "--toc"]
    arguments that are separated by space must be in separate slots. e.g. ["-H", "template.tex"] */
    "pandoc_args": ["--standalone"],
    "pandoc_args_pdf": [],
    "pandoc_args_html": [],
    "pandoc_args_docx": []
}

User Keyboard Setting (Snippet)

{
    "keys": ["super+shift+m"],
    "command": "pandoc_render",
    "args": {"open_after": true, "target": "html", "save_result": false}
}
Thursday, January 24th, 2013

I’ve been slowly trying to catch up on podcasts since I took my commute-less holiday vacation and have finally hit Episode 120 of The Incomparable. In this episode, the geeks do sort of a preview of 2013 geeky movies by talking about the trailers for upcoming films.

One of those films was, of course, Star Trek Into Darkness. Though the producers are keeping a tight lid on most details of this film, it seems to be accepted that Benedict Cumberbatch is playing a villain who is seeking revenge (against either Jim Kirk or The Federation; I’m not sure).

I’m a big fan of Cumberbatch, so I think it will work out. But “a guy is seeking vengeance in a big action movie” is basically the plot of the last Star Trek film. Don’t get me wrong. I really like that movie. So repeating some of its major plot beats may not be a sin. It worked once after all, so it could work again.

But I think there’s room in Star Trek for more than that. Roddenberry’s world offers a big playground to explore different sorts of ideas and, through those ideas, to offer a lens on our own lives and times.

There’s little argument that The Wrath of Khan is the best of the Trek films. And though this film does feature the “madman seeking vengeance” plot, it’s not about that. Khan is about getting older and it’s about the mistakes of your past coming back to haunt you.

J. J. Abram’s first Trek film is about a bunch of attractive young people trying to stop Nero from blowing up Earth (while failing to stop him from blowing up Vulcan). I suppose it’s also about a new team gelling and I think it tries to be about leadership but largely fails at that (since ultimately, Kirk gets the gold shirt because he’s Kirk and basically had to). But I think that’s okay. I think that this was exactly the sort of movie that was needed to bring new fans into a post-Berman Star Trek franchise.

But I’m concerned that the sequel will follow that same trend and be about Chris Pine trying to stop Benedict Cumberbatch. It will undoubtedly be fun and it will make a lot of money but it won’t reach the heights that Star Trek should be capable of.

That unabashed action piece was exactly what Abram’s first Trek movie needed to be. His second will need to find something a little deeper. At least, it will need to do that in an artistic sense if not a business sense.

If Khan is the best Star Trek movie, I think Undiscovered Country is the second best. These are both about getting older (in Khan, it’s about facing up to your past; in Undiscovered Country, it’s about moving out of the way to let a newer generation take on the world unimpeded) and not so much about the actual action movie conflicts that the story appears to revolve around.

If Abrams can tell that kind of story in Into Darkness, he will probably cement his legacy as the rebirth of the Great Bird of the Galaxy. If not, we’re in for a long run of profitable sci-fi popcorn movies while we cling to our Deep Space Nine DVDs for the sort of thoughtful stories that have always drawn us into this universe. I have hopes that soar above my expectations. I think Abrams can absolutely do that sort of film-making. I just don’t know if it ever occurred to him to try.


For fun, I’ve created a table listing the primary antongists in each Star Trek film. The first signs of a worrisome trend can be seen at the bottom of this table.

Film Antagonist
Star Trek The Motion Picture Giant, unknowable entity searching for its origins
Star Trek II: The Wrath of Khan Individual madman seeking vengeance
Star Trek III: The Search For Spock Individual seeking political and military power
Star Trek IV: The Voyage Home Giant, unknowable entity searching for its friends
Star Trek V: The Final Frontier Individual madman, seeking religious experience. Also, God.
Star Trek VI: The Undiscovered Country Political enemies working together to maintain the status quo. Also, Communism.
Star Trek: Generations Individual madman seeking paradise
Star Trek: First Contact Giant, unknowable hivemind seeking the destruction or assimilation of everything else
Star Trek: Insurrection I don’t know. Old age? The West’s unbridled capitalism and exploitation of the planet? Looten Plunder?
Star Trek: Nemesis Rick Berman
Star Trek (2009) Individual madman seeking vengeance
Star Trek Into Darkness Individual madman seeking vengeance (allegedly)