Please join me at my new location bryankyle.com

Thursday, March 10, 2011

Xcode 4 Features Single Window Interface, new Price Tag

Yesterday afternoon a noticed a big storm of tweets about Xcode 4. One in particular caught my interest:

@JimRoepcke Can you imagine being a Mac App Store Reviewer, looking at your queue and seeing Xcode 4?

At first I figured it was just a thought experiment but a few minutes later I started seeing more tweets about Xcode 4 and Mac App Store. Since the Developer Preview for Lion was sent out through the store I put 2-and-2 together and figured that Xcode 4 was finally released. What I found out shortly there after is that you now have to pay for it.

That's right, Apple now charges for its developer tools. The whopping 4.6GB (that's giga, with a G) is $4.99. Naturally, this set Reddit, Hacker News and my Twitter feed on fire.

Now, I'm not opposed to paying for developer tools. Back in the day I used to do a lot of development on Windows. I went through several versions of Delphi (best language evar) and numerous editions of Visual Studio. The price though, $4.99? What's that about?

After a few minutes of thought a tweeted that the price seemed too low to offset the bandwidth costs. But bandwidth costs aren't what this is about. Neither is offsetting the cost of development for that matter. Remember a few years back when iPod Touch owners were charged a nominal fee to upgrade to a later version of iOS 3.0? After some thought I'm guessing that the same thing is happening again. And like the iOS on iPod Touch, later versions of Xcode will probably not cost anything.

Putting the precedent of iOS 3.0 aside, Apple has come out on several occasions and touted that they give away all the same tools to build apps that they themselves use. This has been a big point for them in the past and it's unlikely that they'd want to make a change now. Granted, Apple has been known to change its mind, and make decisions that are in its best interests. But $4.99 is too low of a price to charge if their planning on breaking even. Especially when you look at the fact that Google gives away all of the development tools for Android -- a platform that currently has more market share.

No, I'm pretty sure that this isn't a money grab. It's probably just a blip required by the bean counters.

Tuesday, March 8, 2011

My Backup Strategy

Both my wife and I have suffered through a catastrophic hard drive failure in the past. Neither of us really enjoyed losing irreplaceable photos or countless hours trying to piece back together our digital lives. Since then, we've learned our lesson and took a few steps to reduce the likelihood of ever going through that again. So what exactly did we do? In short, we've started applying the 3-2-1 backup rule:

We recommend keeping 3 copies of any important file (a primary and two backups) We recommend having the files on 2 different media types (such as hard drive and optical media), to protect against different types of hazards. 1 copy should be stored offsite (or at least offline).

The Hardware

Recently I bought 2 1TB hard drives. I opted for the Western Digital Caviar Green. They offered a decent amount of size and performance for the price. An added benefit of these drives is that they're fairly quiet and turn themselves off when they aren't in use. For drives that are only in use sporadically throughout the day these were perfect.

To hold these drives, I first considered using a SATA drive dock. However, being a Mac user I prefer the things on my desk to be well designed and look great. I had a really hard time finding a dock that met my standards. Design concerns aside, I've got a few cats that like to walk all over my desk. I'm not sure that having exposed electronics would be such a good idea. Moreover, I also needed a safe place to store the drive that wasn't in use. Hard cases do exist, but NCIX, the place I ordered my backup stuff from didn't sell any -- yet another nail in the SATA dock coffin.

Instead, I opted to get a few enclosures by Macally -- the G-S350SUAB to be precise. These enclosures look just like tiny Mac Pro towers. Being made of aluminum they don't require any fans to keep quiet, and since the tolerances are fairly tight they don't rattle when the drive spins up.

The Software

I sliced up each of the drives into 3 partitions: a 120GB, 240GB, and 640GB.

The 120GB partition is the same size as the internal drive in my MacBook Pro and is used as a clone of the internal drive -- cloned with SuperDuper! an awesome tool for cloning drives for the Mac. Having a clone means that I don't need to go to the trouble of replacing the internal drive, installing the OS, and restoring data immediately. All I need to do is reboot off of the clone and I'm up and running with a fairly recent backup. However, just having a clone isn't enough. Typically cloning takes a long time to run and therefore is done less often. In my case it's done nightly but sometimes I'll go a few days without running it.

With the 240GB partition I use Time Machine. Every hour or so Time Machine will make an incremental backup of what's on my Mac. Having this partition be larger than the internal drive means that I can keep several revisions of files in case I need to restore old versions or deleted files. Incremental backup decreases the mean time between backups. I can't boot off of the Time Machine backup, but the number of files changed since the last clone will probably be small and can be restored to the clone if need be.

The last partition, large partition stores archived data -- photos, music, old projects, etc. Stuff that I don't need to work with regularly. The archived files on this partition are cloned from a Time Capsule I have running on the network (2 copies of everything, remember).

In order to get the offline side of the 3-2-1 backup I swap out the hard drives once a week. If the house were to burn down, or someone stole everything the most I'd be out is a week's worth of work. And since most of my work is stored in Dropbox anyway it's likely that I'd lose less than that.

Weaknesses and Pain Points

So far this strategy is working fairly well. It can be a pain to have to swap the drives but since I only have to do this once a week the pain is tolerable. I could have opted for an online storage system like Carbonite or Crashplan but decided that I wanted to do the whole thing myself without worrying about long restore operations, monthly fees, or feeling socially obligated to host someone else's backup. This does mean, however, that if there were an earthquake and the city was levelled I'd lose my data but I'm pretty sure that my data would be the last thing I'd be thinking of if that were to happen.

Time Machine automatically remembers some identifying information about the drive used as the backup drive. When I do my weekly swap I have to force Time Machine to do an initial backup. This prompts Time Machine to warn me that I might be backing up to another drive and performs a fairly long scan and backup on that first hit. It doesn't back up every file, it's still smart about just backing-up the files that have changed, so it's not as bad as it could be.

Conclusion

In the end I'm fairly happy with my backup plan. It's not perfect, but I feel safe knowing that my data is well protected and that the chance of me losing all of my and my families important data is low.

Sunday, February 13, 2011

Scripting Inkscape

tl;dr

$INKSCAPE/Contents/Resources/bin/inkscape in.svg -e out.png -D -h 100 -w 100

SVGs, like all other vector graphics formats are scalable and work well for any sort of graphic that needs to scale well to different resolutions. So if you have an image that needs to displayed at many different sizes vector graphics are a good bet.

Vector graphics take much more overhead to render than do raster images. Since raster graphics are simply an array of bytes in memory that represent each pixel of the image they are relatively simple for a computer to perform operations on. Vector graphics on the other hand are usually stored as a series of drawing operations: draw a rectangle, fill it with a gradient, clip it with circle, etc. Because these operations have to be executed in order, sometimes drawing over the same pixels a few times they can be slower. Hence, vector graphics applications, such as Inkscape, have a rasterizer in them that takes the output of the SVG and converts it into a raster image. You might think of a vector graphic as a recipe, or the source code, for a raster graphic.

Using Inkscape to rasterize images can be a chore since you have to open manually adjust the size of the output graphic and filename for each different size that you want to generate. Luckily inkscape includes a command line rasterizer that you can script!

On the Mac, the actual executable is within the Inkscape.app bundle in Contents/Resources/bin/inkscape. You can invoke it from the terminal with options to control the height and width of the output graphic, it's name as well as a few other options. Running inkscape --help will list all of the available options. The ones we're concerned with are: -e, -C/-D, -h, and -w. -C is used when you want to export the drawing and -D when you want to export the entire page. The difference between the two being that exporting the page will export everything including white space around your drawing and exporting the drawing will trigger Inkscape to find the smallest rectangle that includes everything you've drawn (which might be smaller than the page) and export that.

To export the drawing contained in "Scenery.svg" to a 100x100 PNG called "Scenery.png" you would use the following command in Terminal:

$INKSCAPE/Contents/Resources/bin/inkscape Scenery.svg -e Scenery.png -D -h 100 -w 100

Where $INKSCAPE-APP is the location of Inkscape.app.

Since rasterizing SVGs is something you might be doing frequently you can always write a script to run the above command with different sizes and output names. If you want to get fancy you could even automate the process using Make or another build tool.

Thursday, November 18, 2010

The Playbook

RIM recently released a video "previewing some of the cool stuff [they're] doing with the Blackberry Playbook browser." From the video, it certainly looks like the Playbook wipes the floor with the iPad. It loads pages faster. It supports "dynamic" content, by which they mean Adobe Flash. It passes the ACID3 test. Of course the video is incredible, they'd be fools to release a video that wasn't. But after thinking about it for a little while, I came to the realization that it wasn't really that amazing at all.

This video is showing a speed comparison between 2 devices. Yes, they're both tablets but it's not really a fair comparison. The iPad has been shipping to customers for about a year. Since Apple doesn't rev the hardware between releases that makes the hardware at least a year old, if not older. As for the Playbook, there's no official release date yet. All we've so far is early 2011, which means sometime between January and March. Assuming that the Playbook's hardware specs have been nailed down, the video is comparing a brand new device with one that's a year old. Of course the new one's going to be faster, no surprise there.

The sites that RIM picked for the demo were obviously not chosen at random. Clearly these were sites that they knew would show off the features of the Playbook. Almost any site would loaded faster and performed better on the Playbook given that it's newer. Similarly, the Playbook claims that it has better ACID compliance than the iPad. Both devices, as far as I know, use WebKit. Safari on the iPad is just using an older version of it. Maybe we'll see better ACID compliance out of Safari on iOS 4.2 which should be released in the next week or so.

While the video was certainly impressive at first glance, after some thought it's really not that amazing at all. In fact, it leaves a lot of open questions. What's the battery life like on the Playbook? Sure the device appears faster and supports flash, but if you can only use it for a few hours what's the point? How smooth is the UI? Where are the Apps? I'm sure RIM has a good answer for all of these questions, I just wish they'd stop releasing marketing material and just ship the damn thing and let it stand for itself.

Tuesday, October 26, 2010

Do Smart IDEs Cause Dumbening?

The other day I read an interesting blog post from Luke Palmer the other day titled IDEWTF. In the article Luke discusseshow IDEs appear to be falling behind in the state-of-the-art compared to creative tools like Photoshop, Premiere, AutoCAD, etc. Luke's main point is that as developers we should be able to create and use the best tools for our craft. IDEs should be much more advanced than they currently are. While I agree with his point in spirit, I'm not sure that making our IDEs do more is the best thing for developers.

In 2003, a study (pdf) was conducted by a psychologist named Christof van Nimwegen. In the study 2 groups of people were asked to play a logic game. The game involved transfering colours balls according to a set of rules. One group was given a piece of software that assisted them in playing the game. For example, the software would highlight moves the player could make at a given point in time. The other group was given software that was not helpful -- it would not highlight permitted moves.

In the beginning, the group that was given the helpful software was able to solve the problems faster than the group that had the non-helpful software. However as the study progressed the group that was given the non-helpful software became much more proficient. In the end, the group using the non-helpful software was able to solve the puzzles using fewer extra moves, and produced fewer dead-end states where no more moves were possible.

The two groups were brought back in 8 months later to re-run the tests and try a different, but similar, logic puzzle. The group that had initially used the non-helpful software hit the ground running, so to speak. Not only were they able to solve the puzzles faster than the group using the helpful software but they were able to adapt their knowledge to the second puzzle.

This study suggests that helpful software, or software that offloads complexity from the user onto the software, makes us reliant on it. This doesn't say that it's a zero-sum game in which by the IDEs getting smarter the developers must get dumber. Far from it. I believe that we need to strike a balance between HAL 9000 and Notepad.

If the IDEs become too smart, and coddle the developer too much the developer will learn to rely on it. Automatic correction of syntax, imports, exceptions, etc are not in and of themselves bad. They certainly improve productivity. But the developer then learns to rely on their presence, like a drug. If the developer ever tries to work with a language that doesn't have the kind of tooling their used to they will pay a huge cognitive price up front, something that might be enough to scare them away.

So where do we draw the line? Which features improve both long term and short term productivity, and which cause dependence? I think the line is right between those features that do something automatically for the developer and those that provide advice. A feature that does something for the developer effectively offloads the cognitive complexity from the developer to the software; the developer is freed from having to think about it -- at least that's how they see it. With features that simply provide advice to the developer the IDE is allowing them to be more productive without having to pay a long term price.

An IDE like Eclipse has many of types of features. The classic example of an automatic feature is "Quick Fix". When Eclipse notices that something is wrong with the code that it can fix, it allows the user to tell the IDE to fix the problem for them. Developers that are experienced without the IDE will probably understand what it's doing. They would have been able to make the correction themselves without the help of the IDE. To them, this automatic feature is simply a way of improving their productivity. For the less experienced developer however, its mode insidious. Because the user doesn't understand what the IDE is doing, or why it needs to the user becomes more dependent.

Eclipse also has a variety of features that are designed to assist the developer. Call Hierarchy, and Class Hierarchy are two great examples. The developer still needs to understand what these features are used for; the tool simply gives the user advice, quick information that helps them make a decision or explore a code base. These features still cause a sort of dependence, but since the developer understands what the tools are for, and why they need to use them the dependence is less insidious. Without these tools the developer can still do her job, but productivity might be affected. In contrast with automatic tools where the developer wouldn't be able to do his job.

So, do smarter IDEs cause dumbening? You be the judge.


Footnote: I know "dumbening" is not grammatically correct. The word comes from a Simpsons episode where Lisa worries that she's losing her intelligence and writes in her journal:

Dear log. Can it be true? Do all Simpsons go through a process of dumbening? Wait, that's not how you spell dumbening... waaait, dumbening isn't even a word!

Wednesday, October 20, 2010

Predictions Report Card

So Apple held their much anticipated Back to the Mac event today. Since I made some predictions, I thought I'd follow up to see how well I did on my first attempt and predicting what was going to be shown.

To recap, I made the following predictions. I'll address each of these in turn.

  • Sneak peek of OS X 10.7, to be called Lion
  • New OS will have more user facing features
  • New OS will have over-the-air syncing with portables
  • OS will be seeded to developers shortly
  • OS will be generally available around WWDC '11
  • New release of iWork
  • New release of iLife
  • New MacBook, MacBook Pro and MacBook Air
  • Minor speed improvements for new models
  • SSD becoming standard equipment
  • USB 3.0
  • No Blueray
  • No iPad

Sneak peek of OS X 10.7

Sure enough, Apple did announce a new version of OS X today. As expected the new release is called Lion. I got this one right. It was a gimme, but I'll take it.

New OS will have more user facing features

In the announcement today Apple talked about a few new things that they were adding to the OS X 10.7. These included Mission Control, Launchpad, and Full Screen apps. These are clearly user facing features but since I was extremely general with my prediction I'm only going to give myself a half a point.

New OS will have over-the-air syncing with portables

Apple didn't make any announcements about whether over-the-air syncing would be available. Even as I was writing that prediction it seemed a little far-fetched to me. That sort of announcement really only makes sense at an iOS/iTunes announcement, not a Mac event. I missed this one.

New OS will be seeded to developers shortly

Apple didn't make any announcements regarding when the OS would be going out to developers. Since it could be released any time I'm going to hold off on saying whether or not I got this one.

OS will be generally available around WWDC '11

According to Apple, OS X 10.7 is on track to be shipping during the summer of 2011. WWDC is typically in June which puts it in (the beginning) of summer. Since I was more specific than Apple, and these dates tend to slip I'll only give myself a half a point on this one.

New release of iWork

There was no announcement regarding a new release of iWork. I flat out missed this one.

New release of iLife

A new release of iLife was announced. I got it.

New MacBook, MacBook Pro and MacBook Air

This one's tricky. While a new MacBook Air was announced there was no mention of revving the MacBook and MacBook Pro line. I'm going to give myself 1/3 of a point for that one.

Minor speed improvements for new models

Sure enough, there were speed improvements for the MacBook Air line. +1 for me.

SSD becoming standard equipment

Again, SSDs are standard equipment on the MacBook Air. I got it.

USB 3.0

No USB 3.0. No points for me.

No Blueray

As expected, there was no Blueray announcement. But since the MacBook Air doesn't have an optical drive I'm not going to count this one for or against me.

No iPad

No new iPad was announced. +1 for me.

Conclusion

In total I made 13 predictions. Of those one is pending an outcome in the next few weeks and one I've rationalized away leaving me with a total of 11 predictions that I can grade myself on today. According to a completely impartial jury I got 6 and a 1/3 out of 11 right. That's better than half. Not bad for a first timer.

Monday, October 18, 2010

Predictions for Wednesday

Apple has a Mac press event coming up on the 20th of October. Usually, I don't do this but I thought I'd take a stab at some predictions for the event. So, without further ado, here's what I think we'll see.

Sneak Peek of Mac OS X 10.7

The invitation that was sent out to the press for the event includes a picture of a lion peeking out from behind an Apple logo. Given that all releases of Mac OS X are named after large cats it doesn't take a genius to put two and two together. Clearly a new version of the operating system will be previewed, and its name will be Lion.

The last release, Snow Leopard, was mostly about the plumbing. Lion will need to have more user facing features. I'm willing to bet we're going to see some better integration between the Mac and Apple's portable devices: iPad, iPhone and iPod. The new OS will probably include over-the-air syncing with mobile devices and some new APIs to support it. As for other features, I don't have a clue.

I don't think the new OS will be released at the event. Apple seeds a few releases to the developers before shipping it publicly. This will be a preview only, the developers will probably get their copies within a few weeks and the new OS will ship around WWDC '11 next year.

iWork and iLife

The last release of both iLife and iWork was in 2009. Usually Apple likes to release new versions of its productivity software at the beginning of the year, but seeing as the last release is almost 2 years old it could use an update. Plus, with Microsoft due to release Office 2010 soon it makes sense for Apple to release its competitive software around the same time, hopefully to knock the wind out of Microsoft's sails in the consumer market.

New MacBook, MacBook Pro and MacBook Air Portables

According to the MacRumors.com buyer's guide all of the portables have been out for about 6 months. In the case of the MacBook Air much longer than that. I'm guessing we'll see speed bumps across the board, SSDs becoming a standard component and USB 3.0. With Apple supporting high-def video through rentals and purchases in the iTunes Store I don't see Apple including a Blueray player.

No iPad

I don't think we're going to see an update to the iPad. iPad was first announced late January 2010 and didn't start shipping until March. That means the 1st generation iPad hasn't been shipping for a full calendar year yet. With the holiday season coming soon and a well oiled supply line on the device it doesn't make sense for Apple to announce a new one and canabalize its holiday sales.


This is the first time I've ever done a predictions entry, and usually I don't pay much attention to what's going on. So don't quote me!