Text

Coda 2 Impressions

I played with the trial version of Coda 2 for a few hours this morning. It’s a very cool application. A great deal of craftsmanship and care went into making it. It’s an amazing piece of software to behold. I’d really like to be able to switch to it for my everyday coding work. But as good as Coda 2 is I don’t think it’ll work out.

Like the Coda 1, it’s very centered around the concept of FTP sites. This is how all websites were maintained in the early days and many smaller sites are still maintained this way. This is not a criticism. It’s a statement of fact. The workflow of editing locally and then transferring individual files to a server somewhere is an entirely appropriate and desirable workflow for many people. But not me. The heart of soul of Coda 2 is based on concepts and workflows which simply don’t apply to me.

Okay, can I ignore all the stuff I don’t need and just use Coda 2 as solid lightweight code editor? Possibly. The code editor is really nice with Xcode style autocompletion and awesome CSS helpers. However, I have a couple of problems with the idea of using Coda 2 as just a code editor.

I’d be paying for an extremely robust piece of software only to not use a lot of what makes it awesome to its core users. In this case, it’s not lightweight since I’d always be carrying around the other stuff I wouldn’t use most of the time. This other stuff aren’t just fluffy extras — like most of the stuff in MS Word — but critically important features to the users Coda 2 is targeted at. Which means I’d be using Coda 2 in a way that goes against the way it was intended to be used.

In my experience, it’s never a good idea to go against the grain with software applications. Meaning, it’s a bad idea to adopt workarounds in order to use an application that wasn’t originally intended to solve your problem. Sooner or later the experience will deteriorate because the developer may update the application in such a way that breaks your workaround. More importantly, over time the application may evolve in a direction that goes even further from your usage patterns. Thus, over time you may find yourself fighting the application more than being productive with it.

For software you use everyday to make your living with it’s especially important to choose applications which were intended to solve your particular problems. Use applications which are optimized for your everyday use rather than rare need.

So while Coda 2 is an amazing technological achievement and a case-study in amazing design and great user experience it’s not suitable for me.

Tags: coda 2
Text

iOS 6 Feature Requests

As WWDC draws nears so does our first look at iOS 6. Here’s a few things I’d like to see.

  • A redesigned Music app for the iPad. The existing one feels clunky and shallow. Considering the depth of apps like GarageBand, iPhoto, and iMovie on the iPad I think they could do a much better version of the Music app.

  • Also, I really want iTunes Match to handle smart playlists. My entire music listening experience revolves around smart playlists.

  • The option to include videos in the Photo Stream. Yes, I’m aware of the storage issues. I don’t care how they address that. I just want to record video with my iPhone and edit with iMovie on my iPad without manually syncing.

  • Developer Request: I’d like a button on the iPhone keyboard to dismisses the keyboard. The iPad keyboard has one. On the iPhone I have to put a UI element somewhere else on the screen — typically a ‘done’ button in the navigation bar — to dismiss the keyboard. It would be really convenient if the iPhone keyboard could take care of dismissing itself.

  • Developer Request: I’d like more accurate font rendering for UIKit controls. I don’t think many people know this but many UIKit controls like UILabel and UITextView use WebKit under the hood to render their text. Apparently, WebKit rendering is faster and uses less memory but is less accurate. I’m currently working on a font catalog app where accurate font rendering is critical. The designer I’m working with immediately noticed his fonts looked wrong. The solution is to use the low-level CoreText API and forego much of the niceties of UIKit. It would be really cool (for me) if iOS 6 switched to more accurate font rendering in UIKit controls.

Text

iTunes Playlist as a Timer

Sometimes you want to work on a project but need to stop after to certain amount of time to do something else. You could set a timer on your iPhone. But that would be boring. If your activity is compatible with background music you can use an iTunes Smart Playlist as a timer. When the music’s over, you’ll know it’s time to quit. Here’s an example.

playlist timer

The keys are those last checkboxes. The ‘Limit to’ option allows you to limit the playlist to a certain amount of time. The ‘selected by’ option allows you to choose songs randomly or by rating, play count, date of last play and bunch of other choices.

This playlist won’t come out to exactly one hour but it gets within a minute or two which is good enough for me. If you want a different set of songs select them all (⌘-A) and hit delete. Because Live Updating is checked the playlist will automatically fill up with different songs.

I have playlists for 15 minutes, 30 minutes, 45 minutes and 1 hour. Since I require musical accompaniment for practically everything I do these help keep me on schedule if I’m time-bound.

Now if iTunes Match could actually handle Smart Playlists…

Text

How to Type the Apple Command Symbol

This character: ⌘. It’s used a lot on the Mac. It’d be nice to able put that symbol into a document. Here’s how.

Open the Keyboard preference panel. Make sure “Show Keyboard & Character Viewers in menu bar” is checked.

keyboard system preferences

Select “Character Viewer” from the menu icon.

character viewer

In the resulting window select the “gear” button at the top left. Then select “Customize List…”.

customize

Scroll down the list and make sure “Technical Symbols” is checked. It most likely isn’t checked by default. Then select “Technical Symbols” in the list on the left.

technical symbols

It should be the first symbol in the upper left of the main part of the Character Viewer window. Double-click it to insert it into whatever document you’re working on.

If you don’t want to go through the Character Viewer every time you want to insert the ⌘ symbol you can what I do. Add the ⌘ symbol to a document called ‘scrap.txt’. I usually have scrap.txt open most of the time during the day anyway for short-lived notes. Alternatively, you could use Notational Velocity and keep it as a note there. Copy-n-paste from that file whenever you need to.

There’s better ways of doing this for people who really need to type ⌘ a lot but that’s my lo-fi approach.

Text

Simple CoreText Example

Here’s a simple demonstration of how to use CoreText to draw text in an iOS application.

The application consists of a UIViewController and a UIView. The view controller creates an instance of the view and adds it as a subview. The view uses CoreText to draw a string of text in it’s drawRect method. The drawRect method is where all the interesting code is at.

The drawRect method is very heavily commented in an attempt to explain to myself how everything works. Hopefully, other people can benefit from this as well. Here’s the basic rundown. This assumes a NSMutableAttributedString instance variable named string has been initialized in the view’s initWithFrame method. I’m going to omit the typical drawRect boilerplate code of saving the device context, flipping the coordinate plane, and any memory management in order to focus on the CoreText code. See the GitHub project for the complete implementation.

  1. Create a CTFrameSetterRef object. The framesetter object contains the fully typeset string. But you can’t use this to display it on screen. For that to happen you need to define the size and shape on the container it will be placed into. (The code below is ARC compliant hence the __bridge cast. Omit the __bridge cast for non-ARC projects.)

    CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString((__bridge CFAttributedStringRef)string);
    
  2. In this simple example the size and shape of the container will be the boundaries of the view itself. This should be defined as a CGPath because it is possible for text to exist within shapes other than basic rectangles.

    CGMutablePathRef path = CGPathCreateMutable();
    CGPathAddRect(path, NULL, self.bounds);
    
  3. Now that we have a framesetter object and the path in which it will be displayed we can create the CTFrameRef object. This is what will be used to actually display the text on screen. The CTFrameDraw is what actually draws the text.

    CTFrameRef textFrame = CTFramesetterCreateFrame(framesetter, CFRangeMake(0,0), path, NULL);
    CTFrameDraw(textFrame, ctx);
    

Useful documentation includes Apple’s CTFrameSetter Reference and CTFrame Reference

View the complete GitHub project.

Text

Google as the Internet’s Address Bar

Geeks often wonder why people type perfectly good domain names into the Google search box. Isn’t that what the address bar is for? It turns out typing what you think is a perfectly good domain name into the address bar of your browser doesn’t always take you where you want to go. Case in point: Simplenote.

If you type “simplenote.com” into the address bar you’ll see a site that doesn’t have anything to do with the popular note taking app.

However, if you type “simplenote.com” into the Google search box the first result is simplenoteapp.com which is probably where you actually want to be.

That’s one example but there are many more like it. Next time you’re looking at your Google Analytics don’t be so quick to scoff at all the search engine referrals with yourdomain.com as the search term. People have good reason to trust Google more than their address bar.

Text

The OS X Sleep File

I was browsing my filesystem with DaisyDisk this morning. While I love the speed of my SSD the 256 GB drive is rather tight and I find myself having to actively manage my storage more. Currently, I need to make sure I have enough room for Diablo III.

I noticed /private/var/vm/sleepimage is taking up 8 GB on my system. Judging by the name of the file I thought I had a pretty good idea of what it was for. A quick Google search confirmed it. It’s the entire contents of RAM at the time my Mac last went to sleep. OS X uses this file to restore itself to its previous state when waking up. You can safely delete this file but it’ll only come back the next time your Mac goes to sleep.

OS X Daily has more information on it. According to the comments it is possible to disable this functionality on a permanent basis but I’m one of those “go with the flow” type of users so I’ll keep it.

Text

And the whole world shall live on Pacific time!

Found this code in a project today.

Time.zone = ActiveSupport::TimeZone.all.find { |time_zone|
  (time_zone.name == "Pacific Time (US & Canada)")
}
Link

This is a good article which clearly explains some of the disadvantages of using RubyMotion. Some of the arguments concerning support and documentation sound similar to my arguments for not Covering Up Browser Languages.

Text

Best Icon Ever :: ImageOptim

This may be the best icon I’ve ever seen for an application.

ImageOptim Icon

The application, ImageOptim, is very cool too. Drag an image file onto its window and it will optimize it to make the file size smaller. The result is automatically saved in place of the original file. If you want to keep the original unoptimized version you should make a copy first. Alternatively, there’s a preference option to backup originals before optimizing. If you keep the icon in your dock you can drag images to the icon and the app automatically opens and optimizes the selected images.

It’s an extremely low-friction way to quickly optimize images. It free but I’d gladly pay a couple of bucks for this.