Icon_search
Stephanie Sharp Nick Reistad Buck Sharp Kim Landrum Charlie Maffitt Juli Tredwell Kevin Warrick
Charlie

Charlie's Blog

RSS

Form Validation vs. Correction in Rails

Posted on 12/17/2008
19 Comments

Developers have a great deal of control over a web user's experience, and when it comes to validating input forms, opportunities to make things smoother for the user are something every good developer should think about.

For example, I am working on a project right now where users can enter the URL of a link into the database-driven content. In order for the link to work correctly on the front end, it has to have the "http://" prefix on it. And as we all know, it would be folly to assume that every user who submits a link will append the correct prefix.

The easiest solution, and the one I see most often, is to validate the format of the URL and return an error if the user left out the http:// at the beginning of the URL, prompting them to correct their own formatting before they can submit the form. That would look something like this (in the model):


In my opinion, a better option is to validate and correct the user's input if it lacks the proper formatting, using a simple Ruby method (again, in the model):


Then you add a before_save helper which fires off the method before the model is saved:


This way, the user can format the link correctly or incorrectly and it won't matter. The form will still submit, and the link will be properly formatted behind the scenes. The solution is much better from the user's perspective, because it doesn't require a second round of corrections or annoying error messages.

Lastly, a little refactoring. You don't actually even need the before_save helper if you do it this way:


So, a little extra thought at the developer level makes for a much smoother experience at the user level, and the database gets nicely formatted data every time.

Tagged:  ruby, rails, ruby on rails, validation, correction, forms, user experience

Back to top

In Rainbows: One Year Later

Posted on 10/16/2008
10 Comments

One year ago, I wrote a blog post about Radiohead's album In Rainbows, which was released over the internet on Radiohead's web site prior to a physical record release. The noteworthy thing about that release was that the user determined the price they were willing to pay for the download, even for free. In my post, I championed this move as a progressive, consumer-friendly move by a very talented set of artists, but there was some question at the time as to whether it would prove viable to the band, and to the recording idustry as a whole, from a financial perspective. After being available for download under these terms for three months, the download was removed and the album was released physically in stores.

A year later, some data has become available on how In Rainbows did during its internet release. According to a release by Warner Chappell, Radiohead's publishing company, the band made more money during the 3-month "pay-what-you-want" internet release than they had off all the revenues from their prior album, 2003's 'Hail to the Thief'. In Rainbows then went on to sell 1.75 million physical copies in stores.

The same release points out that most of the people who downloaded the record chose to pay nothing.

That puts some serious weight behind my contention a year ago that by eliminating the role of the record company, and their publicity, marketing, production, and distribution costs (not to mention salaries) and use the internet as a direct distribution tool, a band can actually make more money off an internet release than a traditional release, even if the majority of consumers who download the album don't pay a dime for it. What money people did decide to pay went straight into the band's pockets, not some record label exec's, and it turned out to be more money than they'd ever made off an album prior to that time.

When the album did become available in a physical format in stores, it rocketed to #1 in both the United States and the U.K. This completely disproved any criticism of the internet release based on the idea that free or reduced-cost downloads would hurt album sales. If anything, it seems to have helped by drawing a flurry of media coverage to the album's release. Rather than detracting from physical sales, the download appears to have stimulated them.

What this all adds up to is a potentially lucrative new business model in the recording industry, one that rewards the artists rather than the businessmen who "promote" them, one made possible by the mass disrtibution network we know as the internet. Thom Yorke, the band's frontman, said in an interview in December, "In terms of digital income, we've made more money out of this record than out of all the other Radiohead albums put together, forever - in terms of anything on the 'net. And that's nuts. It's partly due to the fact that EMI wasn't giving us any money for digital sales. All the contracts signed in a certain era have none of that stuff."

I'm not saying that bands across the board can tell their management to take a hike. Most of the people I've ever known in bands couldn't manage a Burger King, much less a profitable recording and touring act. Bands will continue to need representation and management in order to focus their efforts where they really matter, in the creative realm. However, Radiohead have proven that our ideas regarding the distribution and sale of intellectual and artistic property are outdated, trailing the weight and baggage of a no-longer-relevant 20th century business model. We have a new model now, one for the 21st century, one which certainly benefits both artist and consumer. I called it "economic liberty" in October of 2007, and I think that description is still apt.

I'm sure at this point Yorke and co. feel pretty vindicated. So do I for having cheered them on for the idea at the time. A little vindication goes a long way...

Some stats (as of October 15, 2008):

  • After being made available for free for 3 months the album was no.1 in the UK and in the US
  • 1st Radiohead album on iTunes – no.1 album selling 30,000 units in the US in the first week
  • The physical CD has sold 1.75 million to date and is still top 200 UK & US
  • Total sales (physical and download) in excess of 3 million
  • They sold 100k boxsets via W.A.S.T.E.
  • Nearing 17 million plays on last.fm
  • 1.2 million fans will see the tour
  • The digital income from the experiment made a material difference to WCM’s UK digital revenue this year

Tagged:  radiohead, in rainbows, music, music industry, recording, internet, distribution

Back to top

Two iPhone Apps You Might Actually Use

Posted on 09/15/2008
23 Comments

At Apple's press event last week, Steve Jobs announced that iPhone and iPod touch users have downloaded over 100 million apps since Apple's App Store came online. That's a lot of downloads, approximately twice the rate of song downloads from iTunes, according to Apple.

But how many of those apps add value to our iPhones, and how many are simply diversions which illustrate the kinds of neat tricks one can pull with a built-in accelerometer? A large number, like the "Beer" app, which shows a glass of beer on your touch screen which empties if you tilt the phone, are utterly useless except as novelties for idiots. Others, like the interface apps for Facebook, mySpace, Twitter, Wikipedia, etc, make it easier to interact with those sites, which is great if you use those sites. A large number of the apps are games, some of which are more fun than others (Labyrinth LE being one of the best examples), but none of which are really useful in any way other than as time-killers. Still others, like the impressive "Shazam", do really neat things that don't really have any practical value.

The best apps, as far as I'm concerned, are the ones that expand your iPhone's potential as a convergence device, taking advantage of things like the built in GPS or WiFi connection to add new (and perhaps more importantly, useful) things you can do with your phone that it didn't do straight out of the box. Here are two that I think meet that description:

1. Apple Remote: One of the few applications developed by Apple so far for the App Store, Remote allows you to control your iTunes via WiFi, turning your phone into a remote control for your music system. What makes this potentially awesome is iTunes' available AirTunes feature, which lets iTunes broadcast wirelessly to stereo speakers via an AirPort Express. That means you can have your home theater, your music library, and your iPhone, all in separate places, all communicating wirelessly, all working together to deliver a 21st century home music experience.

Here's how things are set up at my house: I have an old Windows box that Travis gave me, and that box lives in the attic. It is running iTunes and loaded up with a healthy library of music on its hard drive. It can stay in the attic because I have a remote way of accessing and controlling it: Whenever I want to listen to music, I simply pull my iPhone out of my pocket, access the iTunes library with Remote, find the artist and track I want to hear, and press Play. The Windows box in the attic then broadcasts a signal to my AirPort Express (available from Apple for about $99), which is connected to my home theater system. With no lag time, the music comes out of the high-quality speaker/subwoofer system sounding delicious and rich (that's why I paid for nice speakers, after all). The combination of AirTunes and Remote means I can hide the computer out of sight and seemingly pull music from thin air, just by calling it up on the iPhone. It's just one step closer to my dream of ultra-convergence, the day when every electronic device in my house will be connected to and communicating via the WiFi network -- the lights, the HVAC, the sprinkler system, the TV, everything. And instead of a million remotes lying around everywhere, there will be one remote in my pocket, the one that makes phone calls, plays music, checks your email, surfs the web, and controls every appliance in the house. I'm not there yet, but Apple Remote has brought me just a little closer.

2. Air Sharing: A new release from Avatron Software is Air Sharing, an app which uses WiFi to turn your iPhone into a wireless thumb drive. Need to take some files home from work with you? Air Sharing lets you mount your iPhone as a hard drive, allowing you to drag and drop files onto it wirelessly. The range of acceptable file formats pretty much runs the spectrum from Word docs, PDF's, image files such as JPEG's, PowerPoint files, etc. to video and audio (MPEG-4, MP3, WAV, whatever you need). Then when you get home, just access the files (again, wirelessly) and copy them onto your home computer. Everything is as simple as dragging and dropping between finder windows in OSX, and though I haven't tried it in Windows yet, it should be pretty straightforward. At the time of this writing (Sept. 15, 08), Avatron is offering Air Sharing for free at the App Store for the first two weeks of its release, after which the price will be $6.99.

So, there are two apps that make you iPhone something it wasn't already -- a remote control and a thumb drive. I hope that as the App Store grows, developers will continue to look for ways to make my iPhone into a tool rather than a novelty.

Tagged:  iphone, apple, apps, remote, sharing, wifi, convergence

Back to top

Our New Old Home

Posted on 06/17/2008
60 Comments

As some of you may already know, Plexus recently moved to a new office space near downtown Athens in a building known as the Leathers Building. Since I'm into local history and architecture I thought I'd blog a little bit about the building and its past.

Leathers Building

Originally constructed in 1946, the building is a typical factory in the style of the late 19th and early 20th centuries, with thick masonry exterior walls, high vaulted ceilings supported by iron trusses, and skylights providing natural light to work by. It sits adjacent to the main railroad line running through Athens.

The L.M. Leathers manufacturing company occupied the building for the early part of its life, cranking out various things from sheet metal for roofing and trouser guards to peanut butter crackers and Moon Pies. In the early 1990's, L.M. Leathers & Sons moved to a newer, larger facility, leaving the original building empty and unused. It sat that way for over a decade, gathering weeds and watching trains go by. Here's a picture of it from 2003, when it was just another abandoned factory:

Leathers Building

Shortly after that picture was taken, the building was bought and developed as an adaptive re-use development for retail and professional offices. The concept of adaptive re-use, in short, is the idea that clear-cutting wooded areas on the edge of town to make office complexes is wasteful and unnecessary when historic buildings such as the Leathers building exist and are just waiting for a second (or third) incarnation. Adaptive re-use is a way to counter urban sprawl and is far more environmentally friendly than new development. It is intelligent urban planning, reinforces the local flavor of this very unique community, and enhances our appreciation of local history.

Plexus at the Leathers Building

In addition to being within walking distance of downtown Athens, the Leathers Building also sits about two blocks from my house (another historic building which is actually twice as old as the Leathers), making it very easy for me to get to work these days. Look for my bike out front on nice days when I don't have to dress up for clients.

Plexus at the Leathers Building

So now Plexus Global Headquarters sits beside the tracks cranking out websites from a factory that once cranked out roofing metal and Moon Pies. We still work under iron trusses by the light of the original skylights. Few things have changed -- although we probably have a much faster internet connection than they did in '46.

Tagged:  Leathers Building, Adaptive Re-use, historic buildings, architecture, Athens

Back to top

How Many Phone Numbers do you Remember?

Posted on 02/13/2008
16 Comments

I saw a news story online recently that said watchmakers are scrambling because so many people use their mobile phones as their primary timepiece. I'll admit, I'm far less likely to wear a watch these days with the knowledge that my phone will pick up the slack.

So phones are taking over territory from watches. At the same time I think we are recovering territory from our phones, in the form of available memory.

In 1995, how many phone numbers did you have memorized? I'll bet that number has been cut in half, if not more by now. I've come so far as to get my list of memorized numbers down to a handful. At present I know exactly four phone numbers off the top of my head: my cell phone, the landline to my parents' house in North Carolina, the number of my cousin's house when we were kids, and 911. I can also remember a couple of prior iterations of my own cell phone number, but those are no longer valid, so I'm not counting them. Every other number I "have" is stored on a microchip.

What now lives in my memory in place of all those phone numbers? Hopefully something useful, like good memories, not more numbers.

Tagged:  phone, numbers, memory

Back to top