Saturn V Launch


The 1:10 speed video at about 4:00 minutes looks and sounds like the real thing. Amazing accomplishment.


Install Eclipse Ganymede on Ubuntu 9.04


Previously I wrote about installing Eclipse Ganymede on Ubuntu 8.10, however retracing those steps wouldn’t work for the latest Ubuntu release, as the Synaptic package doesn’t end up in the /opt directory. However there is a very quick as easy way to get the latest Eclipse running on Jaunty Jackalope.


Flickr Upload Via Command Line


Recently one of my coworkers Twittered that he had uploaded some 11,000 pictures to his Flickr account. After getting over my initial shock at the sheer volume of images, I started thinking that I had a couple thousand images on my hard drive that I would like to have on Flickr too.

Using the Flickr Uploadr is problematic. First you have to select the pictures you wish to upload; a task exacerbated by the hierarchically nested directory structure that iPhoto uses to store your pictures. The Uploadr isn’t bright enough to traverse sub-directories looking for images, so you are forced to open each year/month/day combination to select images. An unenviable task with pictures spanning the last nine years on your hard drive.

A better approach would be to copy all the images you wanted to upload into one directory and then let Flickr Uploadr work against that collection. Fortunately the Unix under pinnings of Mac OS X make copying files from dozens of nested sub-directories to a single target directory simple. Using the find command with the -exec switch like so:

find . -name “*.JPG” -exec cp “{}” /path/to/new/directory ;

will search the current directory (and all of its sub-directories) for files matching the *.JPG string. And the -exec switch runs the copy (cp) command for each file found (the “{}” portion of the command). The /path/to/new/directory is delimited by the backslash-semi-colon at the end of the command.

After running this command I had a folder with over 4,600 images. Far more than I expected. The OS X operating system keeps metadata in files beginning with a dot, and my new images directory was filled with these dot-files, one for each image file. If there was an image file named 396.JPG, then there was a dot-file named .396.JPG.

Another find command, this time executing the rm (remove) command would take care of these dot-files for me:

find . -name “.*.JPG” -exec rm “{}” ;

As always when you are using rm, care should be taken to not delete more than you wish. Leaving the -exec portion of the command off, i.e., find . -name “.*.JPG” will list the file found by the find. Running that variation of the command first will help you to see what effect adding the -exec rm “{}” ; switch will have.

After removing the dot-files, I had approximately 2,300 images left, which seemed like the right amount. Starting Flickr Uploadr, I selected all the images in my new directory and waited. And waited. And waited. It took Flickr Uploadr a very long time to import all the images to its interface, before I could adjust the upload settings and start the upload process.

Once I had created a new set, and marked the images to be private, I started the upload. Within minutes Flickr Uploadr crashed. Subsequent re-starts also crashed. Finally I managed to click on the “remove all” button and empty the tool of images to be uploaded. I then tried uploading only smaller sets of images, say 500 at a time. This initially appeared to be working, but again the Uploadr crashed. Doggedly rerunning the utility I finally managed to upload all my images.

Signing into my Flickr account, and opening the new set I had created for these images I discovered that I had uploaded the thumbnail image size and not the full image size. 2,200 of them.

Some investigating in one of the iPhoto image directories revealed that there were two copies of each picture, one a thumbnail and one the full-sized image. The thumbnail has the file extension .jpg, while the full-sized image ends with .JPG. Unix based operating systems are cAse sEnsITive. .jpg and .JPG are not the same. I am used to using lowercase letters for file extensions, so when the find command above, using “*.jpg” for the search pattern return what appeared to be the right number of images, I didn’t realize that I had gotten the thumbnails only.

After deleting 2,279 images from Flickr, which takes a really long time, I wasn’t looking forward to struggling with the balky Flickr Uploadr utility again, especially since the full-size images would big considerably large (i.e. much slower loading) than the thumbnails. Through Google I discovered a Lifehacker article on a command line utility to upload images to Flickr. My hope was that by eliminating the extra layers of complexity, and the memory requirements, of the GUI Uploadr, I would have better luck.

In short the command line utility, a pair of Python scripts, worked like a champ. It uploaded 2,299 images with only 22 failures, for a total of 2,279 new pictures in my Flickr account. If I were to do this again, here are the steps I would follow from start to finish. These steps assume that you have read the Lifehacker article, and downloaded the necessary Python scripts.

First create a directory to temporarily hold the images you wish to upload:

mkdir ~/images

Next, switch to your iPhoto Library and copy all the full sized images to the new images directory:

cd ~/Pictures/iPhoto\ Library/

find . -name “*.JPG” -exec cp “{}” ~/images ;

Since this find command will also capture all the OS X meta files (dot files) run this command to remove them:

cd ~/images

find . -name “.*.JPG” -exec rm “{}” ;

Now you should have a directory filled with all the full sized images from your iPhoto library. The next step is to run the Python upload script. Make sure to follow the configuration instructions listed in the Lifehacker article. And be aware that on the first running of this script you will have to sign into your Flickr account and authorize the Python script so it can access your account. Since all the parameters are specified in the script itself the final command is rather simple. In my case I saved the utility to my bin folder:

cd ~/bin

python uploadr.py

The script will display a success (or problem) line for each file it operates against. Running the command as I’ve shown above will dump these messages to your console. If you wanted to save them for posterity you could run the command like this:

python uploadr.py > log.txt

which would produce a text file with the output for you.

Now I have 2,279 images to tag, comment on, add titles to, et cetera. Unfortunately there isn’t a utility, command line or otherwise, to do that for me.


PlasticWrap Theme for Bluebird


Earlier this week I downloaded the new Twitter client from {13 Bold} called Bluebird. While the client only runs on Mac OS X 10.5, meaning I only use it at work (my home machine are all 10.4.11 due to their aging G4 processors), I like the way it works. I especially like the theming capability that is built in.

Working from one of the provided themes, and using the PlasticCodeWrap theme for TextMate as an inspiration, I created a new theme called PlasticWrap for Bluebird. It sports a dark background, uses colors to distinguish between regular tweets, your tweets, and responses to your tweets. It also bumps up the size of the avatars displayed.

Download the ZIP archive, expand it, and copy the PlasticWrap.bbtheme file to ~/Library/Application Support/Bluebird and restart Bluebird to refresh its list of themes. (You may have to create the Bluebird directory if it doesn’t already exist.

Updated: Here’s a screen shot of the theme in action.

{{ $image := .ResourceGetMatch “plasticWrap.png” }}

Tell all your friends. Enjoy.


Floating Cannonball


Via Kottke.org


James Earl Jones Does the Alphabet



RSS versus Live


I have a love - hate relationship with RSS feeds. Being able to view updates from several hundred sites in one place rather than having to visit them all individually is certainly a benefit. But only consuming a site through NetNewsWire means you never see the site itself. There’s something to be said for the manner in which people present their digital selves on the web.

Recently I closed NNW thinking that i’d like to view the actual sites every day, rather than only on occasion. With 95 sites in my “A-List” folder, visiting each site was rather taxing for my aging PowerBook. Well, taxing in the sense that while Safari can open all 95 pages in individual tabs more or less simultaneously, it takes a long time for the last tab to complete.

Instead I now trying a hybrid approach. I keep NNW open throughout the day, and I can dip into the large pool of content whenever I choose. But there are those sites whose visual presentation is exceptional, and I visit those in the browser, usually without having check NNW to see if there are any updates. Part of the fun of visiting sites via the browser is the anticipation while you wait for the page to load.

Type and “s” and let Safari auto-complete it to “shawnblanc.net” and hit the return key. For a second or so you get to wonder if Shawn posted something new today or not. If so, great, sit back and enjoy. If not, well, you still get to see his finely modified Hemingway theme. Or “p” for “paragiraffe.com.

RSS is perfect for drinking from the Web hose, but a browser is best for truly enjoying your favorite flavors, a sip at a time.


Deleting "Un-deleteable" Google Calendar Events


Recently Sibylle added a repeating event to one of her Google Calendars. She’s been auditing a class at K-State, and added the three-times-a-week classroom schedule to her calendar. This week is spring break here, and so she wanted to remove the three events from her calendar, since she won’t be going to class.

Google Calendar refused to remove the events. They would disappear from the calendar when you deleted them, but the next time the calendar was refreshed, they would reappear. Opening up any of the events in the series showed that the title had been changed to the word CANCELED. The title shown inside the event bubble on the calendar was still correct, however. Sometimes in the past Google Calendar has been slow to respond to changes, and waiting a few minutes to try an action again is all it takes to set things right. This time waiting didn’t accomplish anything.

Over the course of several days we both tried to remove the now offending events with no success. Poking around in the help pages didn’t provide any insight or advice. Doing a Google search led me to a couple of forum threads filled with postings of similar issues. There appeared to be a work around, which involves exporting your calendar and editing it outside of Google Calendar, and then importing the corrected calendar. Since this is a calendar Sibylle has had for years, and one filled with history she wants to keep, we were hesitant to go the export-edit-import route.

One of the last comments in the thread suggested finding the very last event in the series and deleting it. In at least two cases this removed all the other CANCELED but still visible events. She tried that with no success, and later I tried it as well. Finally in desperation, and because “no” is a powerful motivator for me at times, I manually deleted every single occurrence of the event. All 312 of them.

Working on the assumption that the problem was somewhere in the long tail of events, stretching out to May 2011, I deleted events in reverse order. Each time I selected the “All events in series” option hoping that I’d finally found the magic event that would clear away the rest. It wasn’t until I reached February 2009, events that had already occurred, that deleting an instance wiped out others in the series.

Yes my solution was labor intensive, in all I spent maybe 15 minutes deleting one event after another. In the end, however, Sibylle gets her calendar back.

There is one comment buried in the thread from a Google employee that indicates they are aware of the issue and are working on it. I don’t know when (or if) they will address it. Hopefully we won’t need it.


Flickr Photo Gallery


Recently Sibylle asked me if we could add a photo gallery to her piano studio web site, so that she might be able to display pictures there. I started to look at various examples but wasn’t really excited about any of the templates I had found, until I read the Create a Slick Flickr Gallery with SimplePIE on Nettuts.com.

The tutorial shows how to use the SimplePIE RSS reader to dynamically pull pictures from your Flickr account and make a nice gallery page on your website. Want new pictures on your website? Just add new pictures to the collection or set you used as the source for the RSS feed.

I was able to get Sibylle’s photographs page working in relatively little time. The one stumbling block (once I got the example page provided working with her style sheet) was dealing with pictures of varying sizes. The RSS feed from Flickr contains links to all the available image sizes for each image in the set. The gallery page uses the thumbnail size image for display; when that image is clicked the large image size is shown in a modal window. Not all of the images in the set had a large size, so clicking on their thumbnail resulted in an “image not available” message from Flickr.

Since I had the URLs for all the image sizes, I decided to see if I could test the results for the large image URL, and if it wasn’t available, substitute the URL for the medium image size. The gallery page uses PHP to manipulate the images, so I did come Google searches and discovered the curl function. Using that function I was able to capture the HTTP response header from Flickr when the large image URL was used as the request. Parsing that response using the string position function, strpos, I was able to determine if the image existed or was unavailable.

The php code that does this image pre-fetch is shown below. $full_url is set to the large image size URL by the time this code is reached. $not_available is set to the image not available URL from Flickr, or http://l.yimg.com/g/images/photo_unavailable.gif. If strpos returns a value greater than zero the image isn’t there, and we set $full_url to be the medium sized URL from the $img collection.

// make sure the full size image exists
$timeout = 2;
$ch = curl_init();
// set the URL we are interested in
curl_setopt($ch, CURLOPT_URL, $full_url);
// bring back the HEADER
curl_setopt($ch, CURLOPT_HEADER, 1);
// and just the HEADER please
curl_setopt($ch, CURLOPT_NOBODY, 1);
// don't show results in browswer
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// time out after the value set above
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
$output = curl_exec($ch);
curl_close($ch);
// test the result
if (strpos($output,$not_available) > 0) {
	$full_url = select_image($img, 3);
}
Now her gallery page automatically adjusts the modal window to display the large image if it is available, or the medium sized image if it is not. A slick Flickr gallery made even slicker.

If you are interested it the full source listing of the page, please leave a comment with a working email address and I’ll be happy to send it to you.


Stairway to Heaven - Rodrigo y Gabriela