The AADL Developer's Blog. Technical info about what new features we're working on, releasing, and playing with.

Infrastructure Upgrade: Online CD Previews

About the Upgrade

We've been working hard lately on an aadl.org infrastructure upgrade that includes updates to Drupal, SOPAC and the servers that run the site.

While it will still have the same look and feel, behind the scenes we've made changes to speed things up, fix bugs and give us a robust platform to more quickly roll out new features and bug fixes. You'll notice most of the changes in the catalog which was completely revamped. Below is one such update to the catalog you can look forward to when we go live with the changes.

Stay tuned for more previews and please leave any feedback and suggestions you have.

Online CD Previews

AADL CD Preview Station

You may have used our CD preview stations that are present in our branches. They allow you to scan a CD and listen to samples of the tracks. Thanks to the company that produces our stations we were able to get a head start on moving these samples online. Here is a screen shot of the tracks for Big Dave and the Ultrasonics:

cd preview

The display is based on the BSD licensed project SoundManager 2. While we're starting small with just simple previews the project supports more advanced scripting of volume and playlists which we can hopefully take advantage of. This also opens the door for featured previews, playlists and the like.

Currently our sample collection is rather incomplete but we hope to fill it out and hopefully get some of our more unique and obscure items up for easier discovery.

If you have ideas of projects/ideas that can take advantage of this new track and preview data, please leave a comment.

New Public Computers

This past week we rolled out our new public computer stations at the Malletts Creek branch, bringing the number of locations with our new system to three (the others being Traverwood and West). The new stations have a few features that improve both hardware management and the user experience:

Traverwood Thin Clients

The new thin clients have standard VESA mounts on both the top and bottom. The bracket splits into two parts, with one part attaching with screws to the client and the other attaching to the table. Once you've made your cable connections you slide them back together. Super easy, and very solid. The thin clients run a customized version of linux, which gives us more control over configuration and remote access than the embedded windows of the old system. Once you log in to a computer, it launches a full screen remote Windows session, which is transparent to the user.

Easy Parallel Processing with PHP on the Command Line

Developers often come across tasks that can be sped up with Parallel processing. When there is a lot of repetitive tasks to be done, which can be split into independent parts, being able to run multiple processes simultaneously can speed the job up immensely. A good example is a running some calculation on every line of a huge report. Here's how I was able to make a command line script in PHP that allowed me to break a process into parts and process them all at the same time. One caveat: this technique only works on the command line and on Linux/Unix servers.

Part 1: starting another process from within PHP using exec()

The exec() function will run the command given to it. Normally, your PHP script will wait for the command to complete before proceeding, but if you redirect the output to a file and end the command with a '&', exec() will run the process in the background. so instead of writing

exec("ls -al");

you can write

exec("ls -al > listing.txt &");

and your script will create a new process and then proceed to the next statement immediately.

Part 2: make your function recursive with $argv

Drupal Development Tricks

Last week I was privileged to attend the drupal4lib camp at Darien Library. I was prepared to give a lightning talk on my development environment for drupal but we ran out of time. I thought I'd share a couple of tricks I've found here. Nothing earth shattering, but they've become very helpful to me in my day-to-day code monkeying.

1) Use SSHFS to access remote files

Greetsaver Update

GreetsaverQC
As requested by superpatron Ed Vielmetti, here's a fresh link to the latest and greatest version of our "GreetSaver", which welcomes patrons and visitors to various locations of the Library.

This should work on any Mac running OSX Leopard, but there's a bit of additional configuration that must be done. You need to subscribe to the AADL video podcast, and you need to put some awesome library pictures into a new folder called "GreetPics" inside your Pictures folder (~/Pictures/GreetPics for you terminal geeks out there).

*UPDATE* I forgot I used a custom patch to grab the video files on the welcome page. If you want them to show up follow these instructions:

  1. Download the latest Folder Movies patch from Kineme: http://kineme.net/QuartzComposerPatches/FolderMoviesPatch
  2. Create a new folder in /Library/Graphics called "Quartz Composer Patches" (there should already be a folder there called "Quartz Composer Plug-Ins", don't use that folder)
  3. Copy the FolderMoviesPatch.plugin file into this new folder "Quartz Composer Patches"

This should make a random movie from the AADL video podcast display on the welcome screen.

Enjoy, and throw me a note if you have questions or want to mash it up.

You want to Ubuntu?

I'm sure many of you have seen Jessamyn's awesome video installing Ubuntu on a couple of donated library PCs. I made the switch to Ubuntu for my primary desktop workstation here at AADL after we had a windows virus get loose on our network and I was fed up. I never looked back, even after the virus was summarily squashed.

If you're looking to jump into or even experiment with Ubuntu, this week might be the time to go for it. The latest version of Ubuntu, code named Hardy Heron, is scheduled to be released April 24. Ubuntu releases new major versions about every 6 months, but only once every two years do they label a release as Long Term Support (LTS), which means it will be supported for 3 years for the desktop (5 years for the server edition). The last LTS release was code named Dapper Drake, released in 2006. This version also includes tools that makes it even easier to try Ubuntu, letting you install it like an application inside Windows to try it out.

Ubuntu 8.04 Long Term Support (LTS) provides a stable platform for software and hardware vendors, developers and users. With three years of support and maintenance on the desktop, 8.04 LTS is a great choice for large-scale deployment. A substantial and growing ecosystem of free and commercial software built for Ubuntu provides a rich set of choices for desktop users. This is the eighth desktop release of Ubuntu. Ubuntu's track record in delivering - on a precise schedule every six months - a commercial operating system that is free, stable, secure and fully supported, remains unique. (read more...)

Specific to my geekly duties at AADL, here are some of the applications I use on Ubuntu:

  • Gimp: Great image editor, perfect for quick crops and resizes as well as multi-layer intensive editing. (included in Ubuntu)
  • Firefox: not only works with flash, but all the great Firefox plugins like Adblock plus, firebug, and greasemonkey. (note Firefox 3 beta 5 is included in Hardy)
  • OpenOffice: able to open and edit MS Office docs, still a necessity in this day. (included in Ubuntu)
  • Komodo Edit: a free PHP editor with code completion and syntax highlighting. (Download linux version here).
  • VMWare Server: I've been unable to find a email client that can establish a consistent and stable connection with our Exchange server for email, so I installed XP and Outlook2003 in a virtual machine in VMWare Server. Also nice when I need to test something in Internet Explorer or another Windows-only app. (Download linux version here)
  • Flex Builder: Adobe has an alpha of their Eclipse-based Flex editor for linux. Unfortunately it doesn't include the Design view, but the code completion and compiler work just right. (Install info here)
  • Innovative Millennium: Yes, because the Millennium client is Java based, it works just as well on Linux as any other platform. (download from csdirect)

So give Ubuntu a shot. You might never look back.

PHP Class Notes

Below is the sample code I created during a PHP class on Tuesday. I'm planning to cover storing and retrieving data from MySQL on Thursday, plus some more practical examples of web applications. If you have any questions or suggestions, log in and comment or send me an email.

<html>
    <head>
        <title>Example</title>
    </head>
    <body>
    <form action="test.php" method="post">
    First Name:  <input type="text" name="first" /><br />
    Last Name: <input type="text" name="last" /><br />
    <input type="submit" name="submit" value="Submit me!" />
		</form>
        <?php
        echo "<p>" . date('l dS \of F Y h:i:s A', time()) . "</p>";
        
        if ($_POST)
        {
        	$first_name = $_POST['first'];
        	$last_name = $_POST['last'];
        
        	if ($first_name == "Eric")
        	{
        		echo "Authorized User: ";
        	}
        	else
        	{
        		echo "Unauthorized User: ";
        	}
        	echo $first_name . " " . $last_name ;
        
        	echo "<pre>";
        	var_dump($_POST);
        	echo "</pre>";
        
        	echo "<table border=1>";
        	foreach($numbers as $number)
        	{
        		echo "<tr><td>" . $number . "</td></tr>";
        	}
        	echo "</table>";
        }
        ?>
    </body>
</html>

Events, Twitter and iCal

We recently redid the backend for out events here at AADL. While you probably haven't seen many changes on the public site, we now have the backbone that will allow us to create all kinds of cool things and improved events. Online registration, My Events, reminders. All kinds of things will be possible.

Twitter

To test out the new system we made a few quick applications to take advantage of it. The first is a Twitter feed at http://twitter.com/aadl which gives announcements of events 30 minutes before they begin, among other things. Within a couple days there was already over a dozen followers. The twitter feed utilizes a PHP5 class that can be found at http://groups.google.com/group/twitter-development-talk/files which was coupled with a few simple calls to our events API. With our class and the Twitter class it took very little time to get up an running. A cron takes care of the rest.

iCal

Another big feature is iCal feeds that can be subscribed to for out events. This is still under active development so you may experience some occasional issues. Feel free to comment if you have any suggestions or problems. Here are the URLs currently available. I'll update the list as I add them. Only the Exhibits feed shows exhibits until I can fix some of the all day events so they don't clutter up your calendar.

  • All Events : http://api.aadl.org/ical/all
  • Exhibits: http://api.aadl.org/ical/exhibits
  • Downtown Events: http://api.aadl.org/ical/all/downtown
  • Malletts Events: http://api.aadl.org/ical/all/malletts
  • Pittsfield Events: http://api.aadl.org/ical/all/pittsfield
  • West Events: http://api.aadl.org/ical/all/west
  • Northeast Events: http://api.aadl.org/ical/all/northeast

To get events for a specific keyword you can do the following (replace keyword with your word of choice)

http://api.aadl.org/ical/search/keyword

Again, send any comments, suggestions or problems. Once the iCal becomes more stable you should see easy links on out website.

Showcasing Video Content

A number of our locations include large screens near the entrance which run a screensaver we have dubbed the Greetsaver. It displays information about the library, upcoming events, new and popular books and more. I am currently enhancing the Greetsaver we use for the purpose of a new launch in time for our new Traverwood Branch opening, but hopefully much sooner.

In the current version of the Greetsaver, the welcome screen has a static movie displayed along the bottom. It's nice to show video, but it's the same one every single day. As I was wondering about how to pick one video to use in each location, I thought of our new Video-on-Demand page, and if I could use it in the Screen Saver. Thanks to our video podcast functionality, I was able to do just that. Now we have dynamic, automatically updated video content on display at every location where we have a screen.

Ann Arbor Cooks: behind the project

Now that the Ann Arbor Cooks project has been officially launched, I thought I would post a wrap up some of the cool pieces of the project.

As discussed before, I created a new custom node type to store the recipe data. This was an ideal solution because it allowed us to use drupal's existing security and content creation functionality. Plus, tags, categories, and comments are a snap!

Syndicate content