Nick Chapman

Got to give the people what they want
Be inspired and inspiring.
  • April 6, 2010 6:01 am

    It’s a Frame Inside the Frame

    I’ve noticed a somewhat annoying trend where iPad app designers are putting a “frame” around the content of their applications. Nobody did this on the iPhone because pixels were too precious, but it seems the iPad’s plethora of pixels are begging to be wasted. In all the cases below, the extra space could be used to show more information usefully. Articles seems to be the least annoying, but even so, the iPad is a real device that can sit on a real wood surface. No need to draw fake desks for me. Calculator, don’t get me started…

    Weather Station Pro (via Well-Placed Pixels)

    Articles for iPad (via Well-Placed Pixels)

    Twittelator Pad (via Engadget)

    Calculator (via Engadget)

  • April 5, 2010 10:03 pm
    You can now add stickers to recommendations for the Tumblr Directory for $1. Tumblr is doing a great job coming up with entertaining, creative and unobtrusive ways to make money. Not to mention that their integrated payment “bubbles” make it positively fun to spend money on the site.

    You can now add stickers to recommendations for the Tumblr Directory for $1. Tumblr is doing a great job coming up with entertaining, creative and unobtrusive ways to make money. Not to mention that their integrated payment “bubbles” make it positively fun to spend money on the site.

  • 9:16 am
    I love these statistics from Vimeo where the labels for the sparkline graphs are attached to the bottom in matching colors.

    I love these statistics from Vimeo where the labels for the sparkline graphs are attached to the bottom in matching colors.

  • April 2, 2010 11:57 pm

    Quick Tip: In the terminal in Mac OS X you can easily pipe the output of commands to your favorite desktop text editor (providing it supports it) for much easier reading.

    $ curl http://www.apple.com/ipad/ | mate
    $ ruby script_with_massive_output.rb | bbedit

  • 1:45 pm

    "It’s really not hard. It’s a 10 inch flat screen where magic happens. Get it? Of course you do. So go fucking buy one. Stop taking everything so damn seriously. It’s just an amazingly cool computer. Don’t you like amazingly cool computers? Stop wringing your hands about platforms and publishing industries and openness. You don’t really even care about that shit. You think you do but you don’t."

    MorrisonFilm: THE MAGIC PAD

  • April 1, 2010 11:01 am
    Beautiful site for Jax Vineyards using fonts from TypeKit. I really like the sliding navigation in “Our Wines”. It’s great to see developers creating interesting experiences without having to use Flash.

    Beautiful site for Jax Vineyards using fonts from TypeKit. I really like the sliding navigation in “Our Wines”. It’s great to see developers creating interesting experiences without having to use Flash.

  • March 31, 2010 9:35 pm

    "I’m getting a necklace case for it, and I’m going to rock it like Flavor Flav."

    Bryan about the iPad

  • 8:57 pm

    Comparing CSV Files with Ruby

    Today I was tasked with comparing a spreadsheet of carefully verified data to what’s now on our production servers. After spending less than a minute staring at two spreadsheets in Excel and knowing I didn’t want to compare lots of rows of data with my eyes and scroll wheel finger, I decided it was time to get Ruby on the job. Here’s the outcome:

    require 'rubygems'
    require 'fastercsv'
    
    def normalize(row)
      row[2].sub!(/^0+/, "") if row[2]
      row[3].sub!(/^0+/, "") if row[3]
      
      return row
    end
    
    old_rows = FasterCSV.read("old.csv")
    new_rows = FasterCSV.read("new.csv")
    
    old_rows.each { |row| normalize(row) }
    new_rows.each { |row| normalize(row) }
    
    additions = new_rows - old_rows
    deletions = old_rows - new_rows
    
    puts "Additions (#{additions.size})"
    
    additions.each { |a| puts a.inspect }
    
    FasterCSV.open("additions.csv", "w") do |csv|
      additions.each { |a| csv << a }
    end
    
    puts
    
    puts "Deletions (#{deletions.size})"
    
    deletions.each { |d| puts d.inspect }
    
    FasterCSV.open("deletions.csv", "w") do |csv|
      deletions.each { |d| csv << d }
    end

    I’m using FasterCSV because it’s, um, faster, so make sure you have that gem installed. The script outputs two CSV files. One for additions, items that exist in the new file, but not the old one. And one for deletions, items that exist in the old file but not the new one. I have the normalize method in there to clean up some data. In my case I had leading zeros in some places but not others, so I removed those there.

    So there you have it: tedium and eye strain avoided!

  • 8:04 am

    "People should demand more from the things they own. They need to demand that things work."

    — David Kelley, IDEO

  • March 30, 2010 10:09 pm

    Goodbye Adobe

    Dear Adobe,

    I have finally been abused by you for the last time. We, your increasingly estranged users, spend large sums of our hard earned cash for your software, and you in turn give us a steaming pile of crap and a slap on the face. I will not ever use your software voluntarily again and will enthusiastically encourage others to pick alternative products to yours.

    Adobe, now is the time to set things right. Make software that’s friendly to your users and stop charging an arm and a leg for it. People want to like you and your products, but you are making it impossible.

    http://adobe.getthefutonoff.me/

    Your longtime and incredibly frustrated customer,

    Nick

  • 2:42 pm
    Chrome, get your blue off me!
I use a Windows XP virtual machine for a fair amount of time each day. In XP, Chrome is terribly blue, but this extension fixes that and makes it blah gray instead which is a nice upgrade. (via Greg)

    Chrome, get your blue off me!

    I use a Windows XP virtual machine for a fair amount of time each day. In XP, Chrome is terribly blue, but this extension fixes that and makes it blah gray instead which is a nice upgrade. (via Greg)

  • March 29, 2010 11:43 pm

    How to Restore MySQL Data from a Crashed Server

    First off let me say that I hope you never have to deal with this. It’s terrible. I thought I had my servers sufficiently backed up, but I didn’t. Back up your database servers multiple ways; it’ll definitely pay off. Seriously.

    OK so let me put you into the thick of it: through a terrible set of circumstances you have an unbootable Ubuntu server and can only recover the data. No other backups exist. A lot of data is on the line. Here’s how to be a hero.

    Disclaimer: I’m not actually sure this is the best or right way to do this, but it worked for me. I am repeating this from memory so I apologize in advance for errors. Proceed at your own risk.

    Setup a new MySQL server

    I use the Rackspace Cloud, so spinning up a new server was no problem for me. If you’re using real hardware, good luck. Next, get MySQL up and running. Hopefully if you’re this far in you know how to do that.

    Compress the data directory on your crashed server

    You’ll need to start the crashed server in recovery mode if your cloud-ish host offers that or mount the drives in a working machine. In my case the data was stored in /var/lib/mysql. If you don’t know where your data is, check your MySQL config file. Look for datadir in /etc/mysql/my.cnf. Compressing the directory would look something like this:

    $ cd path/to/mount/var/lib/
    $ sudo tar -czvf mysql.tgz mysql/

    Once you’ve gzipped your data, scp it over to your new server.

    $ scp mysql.tgz user@newserverip:

    Run your new server with your old data

    Login to your new server. Your compressed data should by in your home folder. Decompress your data.

    $ tar -xzvf mysql.tgz

    Now let’s stop MySQL:

    $ sudo /etc/init.d/mysql stop

    Move the new MySQL data for safe keeping:

    $ cd /var/lib
    $ sudo mv mysql mysql_new

    Copy your old data into place and fix the permissions:

    $ sudo cp -r ~/mysql mysql
    $ sudo chown -R mysql:mysql mysql/ 

    Now it would be great if you could just start MySQL and call it a day, but there is good chance you’d have a mess. So instead we’re going to start MySQL and have it ignore permissions so that we can dump the data with mysqldump. Start MySQL, ignoring grant tables:

    $ sudo mysqld_safe --skip-grant-tables &

    You should now be able to connect to MySQL as root without a password and poke around in your databases. This is a good time to do a sanity check and make sure everything is in order.

    $ mysql -u root

    Once you feel good about what’s in there, it’s time to dump the data. You can dump all the data at once, and if you have lots of databases that is probably your best bet. I prefer to do it one database at a time so that I can selectively restore. Let’s head back to our home folder and put these files somewhere safe.

    $ cd ~
    $ mkdir backup
    $ cd backup

    Run the following for each one of your databases and you’ll end up with a backup directory full of .sql files.

    $ mysqldump -u root databasename > databasename.sql

    Get your new server back in fighting shape

    Now at this point you can kill MySQL if you know how to look up its process ID and kill it, but sometimes MySQL can be a hard one to kill so we’re going to resort to rebooting. Let’s get or data directories back in order first:

    $ cd /var/lib
    $ sudo mv mysql mysql_old
    $ sudo mv mysql_new mysql

    All right. Our clean data is back in place. Let’s reboot the server.

    $ sudo reboot now

    Let’s restore some data!

    At this point MySQL should be running with a standard set of data. So, reconnect to your server and make sure that MySQL is running and you can login. While you’re in there, create a database for each one that you’d like to restore.

    $ mysql -u root -p
    > create database databasename;

    Once you’ve confirmed that all is well and have created your databases, exit from there and move to your backup directory.

    $ cd ~/backup

    Hey, we’ve made it to the big moment where you get to restore some data! Run the following for each file that you need to restore.

    $ mysql -u root -p databasename < databasename.sql

    Your data is back on a fresh MySQL server! You did it! Great work. Everyone whose data you saved will be anxiously lined up to shake your hand (and then ask why there were no backups).

    You have averted disaster. Time to grab a cocktail and celebrate! That is unless you still need to reconfigure all your applications to use the new server… drat.

  • 5:10 pm

    "7 of the 11 iPad demos require you to have your feet up on the table."

    Andrew Pile

  • 12:43 pm
    Everyone is passing around this link to the HTML5 &amp; CSS3 Checklist. Yeah, so it&#8217;s pretty, but has nobody noticed some glaring problems? Is this some social experiment where they hand out something with obviously false information, but it&#8217;s too pretty for us to notice? It&#8217;s wrong about HTML5 video, the most hotly contested issue of the internet moment. This can&#8217;t stand! Internet, right this wrong!

    Everyone is passing around this link to the HTML5 & CSS3 Checklist. Yeah, so it’s pretty, but has nobody noticed some glaring problems? Is this some social experiment where they hand out something with obviously false information, but it’s too pretty for us to notice? It’s wrong about HTML5 video, the most hotly contested issue of the internet moment. This can’t stand! Internet, right this wrong!

  • 11:06 am
    Apple has posted some iPad Guided Tours. Let the drooling (and/or complaining) begin!

    Apple has posted some iPad Guided Tours. Let the drooling (and/or complaining) begin!