Application development on the iPhone

Just like every other techie in the world, we recently got our hands on some iPhones.  And, as software developers, our first thoughts were: what can we write for this thing?  Well, as everyone else has already pointed out, you’re pretty much limited to writing web apps for the iPhone only, but this doesn’t impact us as much: we’re doing web apps exclusively at the moment anyway!  I’ve been looking into creating an invotrak app for the iPhone recently, and believe I should have something available in the near future.

Craig Hunter has a good article up on his site that discusses some of the limitations of creating applications for the iPhone, though his standpoint is coming as a traditional Mac developer (and he makes great points: it doesn’t make any sense for a user to connect to a web app to input to-do list items):

Business aspects aside, the main issue I see as a traditional developer is that iPhone web app development is still very limited. Outside of some viewport settings, a couple special link types (really only the “tel:” link is new), and some new “-webkit” style attributes, there is little about making iPhone-specific web apps that differs from generic web apps. And that’s possibly the most disappointing aspect of all from my standpoint. Apple’s announcement states that “developers can create Web 2.0 applications which look and behave just like the applications built into iPhone”, but that’s not the case.

I believe there’s a lot that can still be done with the tools we’re given, and I look forward to Apple creating more tools in the future.

Capistrano deployments and MediaWiki

A friend alerted me to an article he put together recently regarding deployments in a custom build environment.  It’s intriguing, as my own software company has a similarly-setup system.  The idea is to keep logs of deployments on a MediaWiki-powered internal wiki automatically, allowing developers to see what repository revision was rolled out, the build version number, along with other salient information.

For our internal processes, we wanted to keep a running list of the code release version (such as “0.9.1″), the SVN repository revision that was deployed, the timestamp Capistrano used as the folder name in the Releases directory, and a more human-readable date and time of deployment. The first field, the release version, is an arbitrary string given by the person making the deployment; Capistrano prompts the deployer for this string as the first step in the deployment. The repository revision and release timestamp are both provided by Capistrano, and the human-readable date is provided by Media Wiki.

Some additional coolness: automatically linking to BugZilla bug numbers whenever they’re referenced in the commit messages, and automatically creating “readme” files containing commit messages for each new build.  Check out the article here.

5 Key Points of Great (Facebook) Applications

FaceReviews.com looks at the common traits in successful Facebook applications: Branding, Engaging, Viral, Useful, and Smart (or BEVUS, admittedly not the best acronym ever devised).  Although they’re looking at Facebook apps in particular, these traits more broadly apply to successful web applications in general.

I think some of these characteristics are sometimes looked at as being more than others. For example, being “viral” is considered an important part of bringing a steady flow of new visitors to a site. However, equally important in my mind is filling a real need for the user, and doing it in an intelligent way.

I also think these points nicely show the melding of the big picture ideas with the smaller, more technical details. Specifically, “branding” and “engaging” apply to the general concept of a site, but shouldn’t come at the expense of how the site handles the design and interface of the smaller details (the “useful” and “smart” aspects).

Remote editing Ruby code and timestamps

This is a programming quickie, but can be one of those gotchas if you don’t know what to look for. As I mentioned recently, I had to temporarily switch back to the Windows side of things when my MacBook died, and in doing, had to learn new tools for getting my work done. One of those tools was to replace Cyberduck, which I used to open a remote connection (via SFTP) to edit files live. Well, I was recently working on a Ruby on Rails project, and I noticed a strange side effect: whenever I would edit a file (a view, controller, etc), and hit reload in my browser, I never noticed the change. It could be the simplest or most complex, but it never seemed to appear unless I restarted Mongrel.

Turns out the problem was actually quite simple: WinSCP, the replacement I was using for Cyberduck, was set to preserve timestamps on files by default. Mongrel checks timestamps of files to determine whether to reload them live (in development mode, mind you, where I wasn’t doing any caching), and these timestamps need to be changed by WinSCP in order to show up to Mongrel.

To fix the problem, just click the Preferences icon in WinSCP, click the Transfer selection on the left, then uncheck the “Preserve timestamp” option under Common options. This should now update timetamps correctly and your changes should appear to Mongrel. Enjoy.

Bad Webapp Names

There’s a funny article up on ReadWriteWeb about some of the worst webapp names, though only 10? Almost every day there’s a stupid name coming across the TechCrunch wires. But on the flip side, you have to give a lot of these people credit: coming up with a name for a product is very difficult.

Case in point: for a long time, we’ve been calling our monitoring software RSP (which, for those paying attention, doesn’t stand for anything). The name is forgettable and boring, and really doesn’t convey what the product is all about. So, in a teaser for the future, we’ll be ditching the name RSP in favor of something else. It’s a bit more web 2.0-ish, it’s kind of fun, and it’s different. I won’t say just what it is yet, but it’s coming soon. :)

Linux 2.6.22 Released

LinuxThe latest and greatest Linux kernel (2.6.22) has just been released. Of the numerous interesting new features, I’m especially excited about two things: a new way to measure approximately how much memory a process is using (via the process footprint measurement facility), and the ability to measure file timestamps using nanoseconds for greater precision.

In addition, there’s a new wireless stack, a new Firewire stack (very cool), and a slew of new drivers and other changes. Check out details about this release here, then download the kernel. Enjoy!

How I work: Web browsers

Camino LogoI was thinking I’d start a new thread on this blog about some of the things I do on a regular basis to get work done. Lately (like since the release of the new Safari beta), I’ve been trying out different web browsers to find one that really fits. For a long time, I was using Firefox on my Mac and was doing just fine, until I really gave Safari a chance and realized how much FASTER Safari is over Firefox (and how much that really makes a difference for me).

Using Safari was good for some time, though my biggest issues were the plugins (I really need a good ad-blocking program, and SafariBlock seemed buggy and missing some features), and site support. Since many sites are setup to allow only the most popular browsers, certain features weren’t available within Safari. With Apple’s latest version of the browser being released for Windows as well (most likely in a ploy to get more developers on board for the iPhone), this will probably change. But for now, I found Firefox was still a better choice for me over Safari.

I then tried out Camino (which is what I’m using currently). Camino is different from Safari in that it uses the same rendering engine as Firefox (so pages that work in Firefox should also work in Camino), though has a much more MacOS-friendly interface than Firefox (and seems a bit faster). So far, I’ve been very happy with Camino, and I like the built-in ad-blocking feature. One downside, however, is the lack of a Javascript console. Since I do a lot of web development, I’ve come to rely on Firefox’s Javascript console (and the Firebug plugin), so unfortunately, I still need to use Firefox to do this.

Hope you found this useful. I’d like to turn this into a regular thing: discussing what tools I use in my work, why I choose to use that tool, etc.

Sake – Rake for Your Whole System

Ruby’s version of make, Rake, is an indispensable tool that all Rubyists should learn and use regularly. It’s the perfect way to run all of those project-specific tasks like clearing the cache or removing stale session data.

Once you start using Rake, you’ll probably find that you duplicate many of your tasks in all of your projects. It’s not too much to copy often-used .rake files, but there is a better way. Sake (short for System-wide Rake) solves this. Once you install a Rake task into Sake’s repository, it becomes available system-wide via the sake command.

Say you have a file named dbversion.rake, which finds the migration version of your database, as follows:
[ruby]
namespace :db do
desc “Returns the current schema version”
task :version => :environment do
puts “Current version: ” +
ActiveRecord::Migrator.current_version.to_s
end
end
[/ruby]

To install this system-wide, first install Sake by running gem install sake. Rubygems will download and install everything for you. Now you can install the Rake task into Sake by typing sake -i dbversion.rake. You can now run the db:version task inside any Rails app by typing sake db:version. Pretty neat, eh?

Sake has a few more tricks up its sleeve. You can view the rake tasks that are currently installed into Sake by running sake -T. It can also install tasks hosted on a remote web server by replacing the filename that appears after sake -i with the url. Check out the original blog post to read more.

Some other sites with info on Rake that I found interesting:

Freelancers/small business: Track your invoices

invotrakApologies for the shameless plug, but I’m excited to mention our new site which launched late last week: invotrak.com. We do a lot of consulting work for various clients, often with many projects running simultaneously, and it got harder and harder to keep track of the invoices we sent to our clients. So, out of this need, invotrak was created. It’s free and easy to use, so if you’re in a similar position to us (freelancers, small businesses, etc), check it out and let us know what you think.

Also, apologies for the lack of posts lately – we’ve been real busy getting invotrak launched and work with our clients. Hopefully we’ll get some more posts up this week.

Footnotes: Improving Rails / TextMate Synergy

As a Rails developer on OS X, I spent a lot of time bouncing back and forth between my web browser and the incredible editor TextMate. Often times, I will complete my latest modification to the source and I’ll load it up in Firefox only to find an ambiguous page with the title “Action Controller: Exception Caught”. Usually, a quick look through the stack trace reveals the line that is causing the problems. Then, it is back to TextMate to open the offending file, find the mistake and reload the web browser.

This can get tedious rather quickly. I have found that the Footnotes plugin for Rails does wonders and increases my productivity dramatically. It turns all of the lines in the stack trace into clickable txmt:// links. TextMate registers itself with the OS X so that it receives all clicks of this type – a quick click on the stack trace will open the relevant file and place the cursor at the correct line. In addition, Footnotes adds some extremely useful debug information (and more TextMate links!) to the bottom of every view when the application is launched in the debug environment.

Footnotes is incredibly easy to install directly from within TextMate. To do it, just follow these instructions:

  1. TextMate Context Menu - Install PluginOpen up your application as a TextMate project by issuing “mate ." from Terminal.app in the application’s root. Then, open any file (I chose application.rb in the app/controllers directory).
  2. Make sure that the editor has focus and then press Ctrl-| to bring up the Rails bundle’s context menu. Select item #2 (Install plugin) from this menu.
  3. In the Plugin Search dialog that appears, type “Footnotes” and then press Go. This should bring up the Textmate Footnotes plugin as the only result. To install it, click the down arrow button on the right. If all is well, the Footnotes plugin should now be installed.
  4. Start up script/server and see the pretty links!