July 17, 2009

Opening PDFs with Firefox 3.5 and Acrobat

Ever since I started using the release candidate of 3.5, I've been unable to open PDFs in the browser. It would open and say something to the effect of "Adobe Acrobat cannot use Adobe Reader to view PDF in your web browser. Reader will now exit. Please exit your browser and try again."

It was extremely annoying and would also close any other PDFs I happened to have open in Acrobat. It was easily fixed, however, by closing Firefox, opening Acrobat, going to Edit > Preferences > Internet > unchecking "Display PDF in browser" and clicking OK, and then doing the same process again only checking it the second time.

June 17, 2009

Google Calendar and iPhone OS 3.0

Typically when someone schedules a meeting on UMcal my first instinct is to copy the information to a Google Calendar. I've got a few for work: one general work calendar, another specific to a topic I'm frequently involved in, and another more general University calendar marking holidays, starts and ends of semesters, and the like.

Among the new features in iPhone OS 3.0 is the ability to use CalDAV to sync calendars to your mobile device. Google Calendar supports CalDAV, and it's pretty easy to set up. Go to the Settings app, tap "Mail, Contacts, Calendars", "Add account...", "Other", and finally "Add CalDAV Account." Enter the following information:

Server: www.google.com
User Name: [Your user name]
Password: [Your password]
Description: GCal (or whatever you prefer)

iPhone will verify that you entered everything correctly and send you on your way. The only problem is that it doesn't sync all of the calendars on your account. Instead, it just gives you your default calendar. Fortunately, armed with a special token found on the calendar's setting page, you can add secondary calendars to your iPhone by creating additional accounts in the same manner as above and changing the "Account URL" in the advanced settings page.

First, you'll need to find the token for your calendar. Log into Google Calendar, click "Settings" at the top right, then the "Calendars" tab, open the detail page for the calendar you want to add, and then copy the "Calendar ID" listed near the bottom in the "Calendar Address" section. It'll look something like [random alpha-numeric characters]@group.calendar.google.com.


I haven't been able to find a way to get this token from the mobile version of Google Calendar, and I can't find a way to force the fully-featured version to show up in Safari on iPhone. I put the IDs in an e-mail and sent it to myself (which conveniently masquerades as a way to test cut and paste functionality).

Once you have the calendar ID you would like to add, create a new account, name it appropriately, and then edit the advanced settings for that account. The Account URL should be:

https://www.google.com:443/calendar/dav/[random characters]@group.calendar.google.com/user

Once that's in place, you should be set with multiple calendar goodness.

June 24, 2008

Dear John...

Serving quite a blow to our office which has made Taco Tuesday a weekly event, we found out today (of all days) that the Dinkydome Taco John's is closed for the summer. :( There was only a note written in blue highlighter stating as much and a thanks to their customers. Our Tuesdays are now ruined.

June 22, 2008

Branching out on my own (Git it?)

Lately I've been working with Git. Git is a revision control system, along the lines of CVS or Subversion. It has two main advantages: it is a distributed RCS meaning it allows for decentralized revision control and it does branching and merging quite well. It also happens to be the brainchild of Linus Torvalds, of Linux fame.

Having mainly used CVS my entire professional life (all of eight years), I've grown accustomed to its eccentricities especially when it comes to branching (and merging) and file management. Once I saw Linus's Google TechTalk on Git12, I decided that I'd give Git a try. I like it so much more than CVS that I'm plugging it wherever I can. Admittedly, this is probably not so much due to Git being awesome (which itself is somewhat similar to Mercurial, Bazaar, or Darcs) but rather to CVS being horrible.

I found Git a bit confusing beyond the update code and commit work flow. Everything being a SHA1 sum led to much of that confusion. A commit is a SHA1 sum. The tree is a SHA1 sum. Content is a SHA1 sum. Reading a few articles and blog posts of other folks who were at one time or another similarly afloat in a sea of "Dur?" was tremendously helpful, especially Git from the Bottom Up by John Wiegley. Git's documentation is also helpful but not so much the man files than the online documentation including the CVS migration manual and Git User's Manual.

After reading Git from the Bottom Up, everything pretty much just clicked. The structures in which Git stores content is really easy to digest and is the basis for the type of work flows that can be achieved that you would never imagine or find possible to do in CVS. Git at one time or another was called "the stupid content tracker," and it really is just that (as an aside, you may find this discussion between Linus and Bram Cohen about merging strategies interesting). The rather basic content tracking is what allows for its distributed nature and painless branching and merging.

Think of all the things that one must do to set up centralized revision control. First, you have to find some place for the repository to live. Then, you must give access to commit to the repository to those who need it which may entail giving them login access to the machine on which the repository lives. After everyone is able to talk with the repository, rules about branching, merging, and tagging are usually set up to avoid problems.

With Git, the repository lives on the developer's machine. When he or she gets to the point of wanting to share that code with a wider audience, it is simply a matter of making it available via HTTP which they're likely to have set up before hand. (See http://git.kernel.org/ for an example of gitweb, a nice front end to the directory structure that a repository lives in.) Any changes that someone else would make are sent by e-mail, done over HTTP as the clone was, or could potentially occur over SSH. (They'll rely on SHA1 sums of the content, tree, and commit history common to both repositories to facilitate the merge.) This eliminates a lot of the annoying server administrivia to manage a repository.

Furthermore, setting up rules for branching and merging are completely unnecessary because the repository you cloned from the original programmer is yours to do with as you please. You can commit without regard to whether or not it will break the code base or someone may be checking out code later on in the day. Things like git rebase --interactive are sufficiently advanced to be freakin' magic to CVS users such as myself and help in creating a single commit or series of commits to send back to the original (and possibly authoritative) developer for inclusion in their repository.

This has been rather haphazardly put together, but I hope that you'll take a look at Git if you haven't already. I highly recommend reading Git from the Bottom Up because it is interesting from a computer science standpoint and serves as a primer to the staging area and content storage model Git uses. I'm hoping that as time goes on, I will have worn down my co-workers' resolve (really, we just have to find the time to do it) and we'll finally port our CVS repository to Git. In the mean time, I'll be happily coding away on my personal projects with Git.

1) As a side note, probably my favorite Linus quote comes from this video: "[...] the way merging is done is the way real security is done--by a network of trust. If you have ever done any security work and it did not involve the concept of network of trust, it wasn't security work. It was masturbation."

2) Randal Schwartz of Perl fame is apparently involved with Git and did a TechTalk about six months after Linus.

June 15, 2008

iPhone 3G, New SDK Features

Sometime in March, my Razr was on its last legs and I wasn't held down to any contract, so I started my search for a phone that would let me install software on it. The iPhone was the closest thing to it--the Palm and Blackberry options didn't appeal to my programming tastes and I was intrigued by the touch interface. Knowing the SDK was coming out, I took the plunge and bought it. However, it appears I bought my iPhone prematurely.

Although I wouldn't call myself a Mac zealot, I watched the live keynote updates on macrumorslive.com just like everyone else. Most of what was revealed was expected. There were three pieces I was most interested in: an addition to the SDK that was an attempt at pleasing those who wanted background processes, a way of adding applications to the iPhone without having to use the App Store or have an enterprise SDK license, and the addition of a GPS chip.

The push notification service, as they call it, is pretty neat. It does take care of a good 75% of use cases for background processes on a mobile device--but not all. Say you wanted to create a service that sent severe weather updates to a user's phone based on their location. If you assume the user is stationary, the push notification service will work.

However, if they're mobile, they could be driving 70 MPH into a dangerous situation and there's nothing you can do to warn them (although the large line of dark clouds will probably tip them off). Apple missed the boat in not doing an information pull at the same time as they do the information push. There's not a whole lot of other data that would change over time while the user is not utilizing their phone--and I'm sure there are other uses for live user location data. Maybe they'll work on that after September.

The ability to add your own applications to the iPhone (and 99 of your closest friends) without having to go through the App Store or shell out for the enterprise license is awesome. I figured that they would at least allow personal applications to be put on the iPhone, but the ability to send them to friends, family, co-workers, or whatever is great news. I guess others expected this, but I found it to be a nice surprise.

Then there's the addition of a true GPS receiver. Being an amateur radio operator (K0WMS), it was at this point that an idea slapped me in the face so hard that I have to try and get to work. Now that the iPhone has a GPS, you can write custom software for it, and there will be an easier to use headphone jack--it seems that it would make for the perfect APRS unit. Just connect the iPhone's headphone jack to the packet radio adapter on your trusty VX-7R using the sound card to generate both the data stream and PTT signal and you're set.

As strange as it sounds, this might be the killer feature that will push me over the edge (no pun intended) to upgrade, rather than the better internet data speeds afforded by 3G. I will say that I have found EDGE to be an annoyingly slow service. If AT&T is reasonable about upgrading to the iPhone 3G, I may have to consider it. I hate you, Steve Jobs.

June 10, 2008

Log Browsing

And the winner for the most confusing search query to find the blog so far: giant heart created from keyboard characters. Second on the list as of right now.

         lawllawl            lawllawll
      lawllawllawlla       lawllawllawllawl
    lawllawllawllawllaw   lawllawllawllawllaw
   lawllawllawllawllawllawllawllawl       lawl
  lawllawllawllawllawllawllawllawl         lawl
 lawllawllawllawllawllawllawllawllawl       lawl
 lawllawllawllawllawllawllawllawllawllawl      l
lawllawllawllawllawllawllawllawllawllawllawl  law
lawllawllawllawllawllawllawllawllawllawllawllaw l
lawllawllawllawllawllawllawllawllawllawllawllawll
lawllawllawllawllawllawllawllawllawllawllawllawll
 lawllawllawllawllawllawllawllawllawllawllawllaw
  lawllawllawllawllawllawllawllawllawllawllawll
    lawllawllawllawllawllawllawllawllawllawlla
      lawllawllawllawllawllawllawllawllawll
         lawllawllawllawllawllawllawllaw
            lawllawllawllawllawllawll
              lawllawllawllawllawl
                 lawllawllawll
                   lawllawll
                     lawlla
                      lawl
                       la

Proper partitioning, FTW.

Having played around with Fedora 9 at work for a while, I decided it was high time to update my main workstation at home. It's been running Fedora Core 5 since it came out, and required a bit of playing around to get it to work properly with the NVIDIA on-board RAID. That tedious installation kinda kept me from upgrading even though they stopped delivering updates a while ago. While backing up configurations and generally dreading the upgrade, I remembered that my Johnston Hall workstation also had an NVIDIA on-board RAID. The manual dmraid configuration I had to deal with before is now handled by anaconda. Awesome.

Thanks to what I thought was an overboard partitioning scheme at the time, all I had to do was reformat the root partition and select packages to install. My /home, /backup (RAID mirrored), /data (large LVM logical volume holding Fedora and CPAN mirrors, database tables, and other stuff), and /var/www directories were all on separate logical volumes so they popped right back up after the reboot. My first log in went straight to my desktop as if nothing had changed.

Aside from restoring config files, compiling a few custom packages (httpd, php, MySQL, proprietary plugins/encoders/decoders) and kicking myself for the slight oversight of not backing up my crontab, I really had nothing left to do after the installation process. Things have come a long way since I played around with Red Hat Linux 6.2 all those years ago. Excuse me while I spin the cube for a while.

June 7, 2008

Automating Wireless Login on the iPhone

A few people have found this to be useful so I figured I'd post it. Anyone who's logged into the campus wireless network from their iPhone have probably found it to be somewhat annoying after the third time or so. So, we in the office have created a JavaScript bookmark in Safari to automate the login process.

The fun part was figuring out how to actually get the URL onto the iPhone/iPod given the limited keyboard characters available (not sure why they restricted the character set in Safari). Just create a bookmark at any old web site, and then add the following JavaScript URL (the eureka moment was that the brackets can be URL encoded):

javascript:document.forms%5b0%5d.uid.value='examp001'; document.forms%5b0%5d.upass.value='password'; document.forms%5b0%5d.submit();

Then whenever you're presented with the wireless login page, just activate the bookmark and it'll use whatever credentials you entered in the bookmark to login. It's pretty slick. If you wanted, you could set the desturl too.

June 4, 2008

MySQL Query Browser Blues

If you're ever around our office and there's a random outburst of obscenities or objects flying in various directions, chances are one of us is using MySQL Query Browser. For whatever reason, Query Browser delights in refusing to execute queries. There is no rhyme or reason. Usually a restart allows you to execute the same query without a problem. Probably the most infuriating attribute is that it returns error messages that make no sense.

There is a load alright...

When the message above was displayed, there was ample memory available on the client machine. The server has so much memory it may as well be a giant solid-state drive. It doesn't specify whether the client or the server is the one causing the problem. Not that it really matters--it seems to be wrong in either case. This is a nearly certain occurrence during any non-trivial length of time spent working with Query Browser.

If the will it or won't it game isn't fun enough, when it works correctly Query Browser has downright strange user interface quirks. Seemingly random column size selection, the inability to copy cells of data with a keyboard shortcut, and not saving the query history until the program exits (which rather artfully assumes that the program will exit normally) add to the experience. I imagine that the fact it's written in GTK+ and ported to Windows does not help with some of these quirks. However, Pidgin's excellent port (developer UI choices non-withstanding) means that excuse is somewhat hollow.

Sadly, it seems to be the only show in town. I could revert to the command line (and do on occasion), but that doesn't help me produce reports. I could use phpMyAdmin, but that has its own quirks--not to mention it being somewhat slow.

Anyone want to help write a new engine-agnostic query tool?

June 1, 2008

Installing Fedora 9, the hard way

Friday afternoon I decided to start the migration process to my new workstation. I'm moving away from Windows XP and on to Linux--an operating system near and dear to my heart. Knowing that the folks over at JaWS (or ADCS?) keep an up-to-date Fedora repository, I decided to do a network-based install rather than burning the 48 CDs or single DVD it would take. Little did I know that this would set me on an interesting journey.

Turns out that we didn't have anything that would burn Fedora-9-x86_64-netinst.iso. Both Roxio and cdrecord (on Windows and Linux) refused to burn the image and we didn't have any MacBooks in the office that burned DVDs at the moment. The SHA1 sums matched, so that was rather curious. In any event, I had a portable hard drive I keep in my pack for random occasions like this and started on getting the installation image onto the HDD.

Continue reading "Installing Fedora 9, the hard way" »

May 31, 2008

A few good minions...

We (CLA Student Services Office of Application Development) are hiring! I have an opening for an undergraduate web developer. You can read more (and apply) at http://minions.class.umn.edu/job.html. If you have any questions or wish to apply, e-mail me at kendrick@umn.edu.

Web Developer

The College of Liberal Arts Assistant Dean's Office is hiring for an undergraduate web developer position. Applicants should have experience in one or more of PHP, Perl, Python, Java, or Visual Basic. Experience using SQL (both MySQL and MSSQL) and programming database-driven applications is also required. Preference will be given to applicants with experience in XML technologies (i.e. XSL and XPath), server administration, and/or data mining.

Applicants must be a current University of Minnesota undergraduate student, able to work individually as well as collaboratively in small groups. Hours are flexible, anywhere from 8AM-6PM on weekdays. During the semester the position is 20 hours/week, but during the summer and winter breaks it increases to 40 hours/week.

September 28, 2007

MacBooks are fun.

$ for laptop in $LAPTOPS; do ssh -f admin@$laptop "echo 'say \"rawful copter skates lemau\"' | osascript"; done;

July 24, 2007

Hockey + Will It Blend = Princess Diana?

YouTube sent me a friendly reminder this morning about new videos in my channel subscriptions. I only keep an eye on two channels. The NHL channel hasn't been all that active during the off-season, so that had to mean there was another BlendTec "Will It Blend?" episode. (My interest in Will It Blend? was recently reinvigorated after they tested the iPhone's blendability.)

Videos to Di for

Alas, neither channel had new videos. Instead, YouTube wanted to let me know that there were newly posted videos in the "princessdianaislove" channel to which I had supposedly subscribed. We've been known to watch and link to some fairly random videos in the nerd room, but I'm fairly sure this was the first time I've ever seen that channel before.

Obviously something went awry in the code that generated the e-mail. Usually you can piece something together from stuff you've previously looked at. For example, when you've been recommended something completely oddball at Amazon you can usually find out what it used to generate the recommendation. But not this time. The least they could have done was default to something like the debate videos from last night rather than a random pull from the database.

July 23, 2007

I am allergic to spam.

One of my uncle's friends, Marc Breitsprecher, runs an internet business from his home selling ancient coins. Back in 2000, before I even started my undergrad, he approached me and asked if I could build a web site for him. Previously, he was just selling his coins on eBay.

Over the last seven years, Ancient Imports has grown beyond both of our expectations. He was able to quit his job at the postal service and work on the site full-time. We've outgrown two hosting providers, the most recent event happening a few weeks ago.

We moved from a poor shared hosting environment to a spiffy virtual private server. It's the closest thing to having full control over a physical machine as we can get right now. It's fun for me because I essentially have full control over the virtual machine, which means I'm pretty much free to do whatever I need to do to implement new functionality. The cost, however, was that I also have to maintain the security, e-mail services, and DNS that were previously dealt with by the hosting provider. The classic blessing and curse.

Continue reading "I am allergic to spam." »