Blog Archives

YOURLS Plugin: Remove YouTube Play Indicator

A few months ago, I set up a self-hosted YOURLS install to handle all of my URL-shortening needs, replacing I decided I wanted to be wholly responsible for breaking any links in the future. It’s here, although probably at some point I’ll buy a shorter domain and redirect everything.

Last month, YouTube added a play indicator that modifies the <title> attribute to include U+25B6 BLACK RIGHT-POINTING TRIANGLE. I don’t like this showing up in the title in the YOURLS admin interface. I wrote a quick plugin that strips this out.

Remove YouTube Play Indicator is available on GitHub. Please comment there if you have any issues.

Posted in Code Projects Tagged with: , , , ,

Netflix Ratings Import/Export

Andrle and I each used to have our own Netflix accounts. For a time, after we got married, we kept both; mine was used for disc rentals, and hers for streaming. Eventually we realized we were mostly just streaming, so we canceled my account and went to a single shared account. Sadly, this meant I lost over 1400 movie ratings, since Netflix provides no official way to export. After a while, I gave up on ever getting my ratings back.

Finally, earlier this month, Netflix embraced their role as a household service and added profiles. I decided to pay for a month of streaming and reactivate my old account to see if I could get my ratings out. I found this browser script which, after applying a patch described there, gave me a JSON file containing all of my ratings. This is also a useful backup to have in case Netflix ever goes away (unlikely).

Unfortunately there is still no way to easily import ratings into Netflix, so I wrote a very basic Chrome extension that would read the exported JSON file and click through each movie, rating it. It’s available on GitHub. Make sure to read the instructions included with the code; it’s straightforward but requires some poweruser comfort to follow the steps, since I didn’t bother with an interface. (Incidentally, this is one thing I love about having programming skills – that sense of having more power and control over my own data.)

Obviously it would be nice if various online services practiced across-the-board data liberation (though with Facebook and Twitter adding export, it’s getting better), but hopefully this is one tiny step in helping other nerdy family units transfer their precious Netflix ratings.

Posted in Code Projects, How-Tos Tagged with: , , , ,

A Better git-svn Log

This morning, Devon tweeted a great git tip that shows how to create a git alias that produces more readable git logs. I decided I wanted to set this up.

At work, we use a central Subversion repository, but a number of us use git-svn because we prefer git’s various local branch tools for development. I decided that it would be useful to extend this alias to also include the Subversion revision number if the commit has one. Unfortunately, this information (in the form of a Subversion URL) is stored in the commit body by git-svn, which may include other notes added by a developer. git-log exposes this text via the %b format specifier, but since we want to do some post-processing to extract just the revision number, we’ll need to set up a shell alias.

Here’s the final version I’ve added to my ~/.aliases:

alias glog='git log --graph --pretty=format:'"'"'%Cred%h%Creset%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset%Cred%b%Creset'"'"' | perl -e '"'"'$log = do { local $/; <> }; $log =~ s/(>\e\[m\e\[31m)([^\n]*\n\| )*git-svn-id: svn\+ssh:\/\/[^\s\@]*\@(\d+) [0-9A-F-]+\n(\|| ) (\e\[m)/$1 r$3$5/gm; print "$log\n";'"'"' | less -RS'

First you’ll note the weird quote escaping – we want the alias to be single-quoted (no expansion), but we want the arguments to the commands to also be single-quoted. That’s where the '"'"' trick comes in; see this explanation on StackOverflow. The format string is almost identical to Filipe’s solution, except for the addition of the body. The nasty Perl regular expression pulls out the revision number from that while also preserving the ANSI color escape sequences I inserted into the format string. Finally, we pass everything back to less for paging; -R makes sure it interprets the colors correctly, while -S disables line-wrapping.

One unfortunate side effect of adding the post-processing is that you can’t pass the -p option to git log anymore, because Perl needs to read the whole log in for multiline matching (in case a developer had literal newlines in their commit body), and the diffs are large and could get caught in the regex filter.

Hopefully you find this useful!

Posted in Computers, How-Tos Tagged with: , , , , , ,

Empty Expo Hall


Wish I could play with the demos now…

Posted in Photos, Video Games Tagged with: , ,

Full Expo Hall


PAX was crazy busy today. I stuck to the tabletop area mostly.

Posted in Photos, Uncategorized, Video Games Tagged with: , ,


If you were on the media social much shortly before Christmas, you no doubt heard quite the kerfuffle about changes to Instagram’s Terms of Service that would take effect on January 16th, 2013, in part related to Facebook’s purchase of the service earlier last year. While much of this response was overblown, and based on misunderstandings of the relevant legalese, and Instagram later apologized and canceled some of the changes, the folderol was a reminder to me that you can’t really trust a service you’re not paying for for hosting your content under the license you want. Thus, I quit.


Posted in Code Projects, How-Tos, meta, Opinion Tagged with: , , ,

PAX East 2012 Indie Megabooth


Early this year, I made my fifth PAX pilgrimage, this time to PAX East 2012. Even though we only attended two days (because of Easter Sunday and impending travel), we managed to fit in a mix of activities, including the keynote from Jordan Mechner, the Saturday night concert featuring JoCo, a few panels, and some good tabletop gaming. I also spent a fair bit of time on the expo hall floor. An interesting twist this year was the creation of The Indie Megabooth, for which a bunch of small independent developers pooled their resources to secure one large booth.

This is where I ended up spending most of my time, because to me, this is where the gameplay innovation is happening. Also unlike AAA games, many of these games were going to be available much sooner, are generally more affordable, and are more likely to be available on my platforms of choice (Mac and iOS). Another bonus was that the lines were short, so you could get a demo of many of these games without having to wait a couple of hours in line for a preview video (which in my mind is a total waste of your PAX ticket).

They also did something fun: they created a little achievement card, called the Indie Mega Passport, with silly activities or game actions that you had to complete at each booth. Pictures of my completed passport, plus a review of the games I was able to play, are below the cut.


Posted in Reviews, Video Games Tagged with: , , ,

Baby Got Backup

A Mind Changed

About two years ago, after a primary hard drive failure, I wrote a long post on what I called the “backup tripod”. As I said then, the tripod consists of three classes of regularly performed backup: offsite clones, incremental local backups, and cloud backups. For me, that consisted of Carbon Copy Cloner, Time Machine, and a few files on Dropbox on an as-needed basis, respectively. I think that the trade-offs of each leg of the tripod make for a complete solution, so you need all of them.

At the time, I was pretty strongly against any sort of comprehensive cloud backup solution. I was suspect of their security practices, and disliked the lack of control. I think this was in part inspired by bad experiences with Windows backup products for my work desktop, as well as the sketchy TV commercials from companies like Mozy. I’ve since changed my mind, convinced in large part by The Wirecutter‘s selection of Crashplan as their Best Online Backup Service. Why do I trust their review? A combination of Daring Fireball‘s recommendation, and the fact that we are very happy with the Omega 8300 juicer that they recommended. Crashplan’s own website also talks about security in a knowledgeable way, which makes me think they’re engaging in best practices.

Another factor is that due to a little life change (marriage to Andrle!), I’m now backing up more than just my own computer. Crashplan’s family plan takes care of that, for her 11″ MacBook Air, since we don’t currently run OS X Server or own a Time Capsule. While we have an offsite clone of her laptop, a cloud backup service can capture more recent changes. Unfortunately we’re not always on top of updating those offsite clones, so they can lag behind by a month or more, which is just asking for data loss.

The Third Leg

At first glance, it might seem that an online backup service is all you need; it provides a combination of the benefits of an offsite backup and incremental backups. It is both complete and updated regularly. However, while I’m sure Crashplan would be quite happy if they were your only backup provider, I maintain that you still need all three. Each of the other two legs still has an advantage: speed of recovery and frequency of increment.

My initial Crashplan backup (roughly 450 GB) took almost two weeks. Obviously part of that problem is the ridiculous imbalance in downstream vs. upstream bandwidth with almost all ISPs, including Comcast. Downloading to restore from backup wouldn’t be quite that slow, but could easily be a couple of days after a catastrophic failure. The second problem is that I’d need some working OS install with which to run the Crashplan client. These two downsides are both solved by the first leg, a bootable offsite clone. I store mine in a locked drawer in my locked office in a locked building at work, which is only a 20 minute round trip by bicycle if I had a data emergency. Crashplan does offer seeded backups and restores, but it’s well over $150 which at best gets it to you on a hard drive the next day. Although this wouldn’t be a problem for me, it’s also limited to a 1 TB USB drive, which for some people probably isn’t nearly enough.

While Crashplan does promise regular backups, that can’t always help you back off a very recent set of changes, or an accidental deletion right after making changes. That’s where the combination of OS X Lion’s Versions feature and Time Machine can save you on a per-file basis (and, as before, Dropbox may be useful).

Speaking of Dropbox, it has an additional role for me these days: synchronization for iOS apps. iCloud is still a pretty nascent feature, and for me only really helps moving data within one app between my iPhone and iPad. Dropbox, because it’s not post-filesystem, provides some combination of cloud backup and cloud sync for files across all of my computers and devices. Probably the most important example of this is my 1Password keychain, synced between my home and work desktops and my iOS devices, which is absolutely critical since I use generated passwords everywhere. I also use it to move files into GoodReader on my iPad for work, and to export files from Textastic, which I occasionally use for code editing. (I should add that my iDevices are backed up to my computer, not iCloud.)

Overall I think Crashplan will fit in fairly seamlessly to my current backup solutions. Obviously the hope is that I’ll never need it!

Social Media Exports

One quick aside that’s related to backups generally, but not so much to backing up your computer: update a local copy of your social network data periodically. At least for me, I generate a lot of content on Facebook and Twitter, and I would be sad to lose it. A data loss on their end is probably less likely than some kind of major service change, but either of them could make it impossible to access your old posts.

Somewhat ironically, Facebook makes this a lot easier than Twitter; just go to Account Settings and click the tiny “Download a copy” link at the bottom of the page. Unfortunately Twitter doesn’t provide API access to anything but your 2000 most recent tweets; I hope this changes at some point. I have all of my tweets being archived to Pinboard, but that only goes back to May 2011, missing over two years of usage.


Cloud backups now have my full blessing as part of the Backup Tripod. Crashplan seems to be the best service for the cost, and fits in well with the other legs of the tripod. The steps I’ve suggested in these two posts are fairly easy (albeit Mac-centric); at this point I think very few people have an excuse for losing data due to not having backups. I can’t reiterate this enough: back up your data, or someday you’ll get burned. Help your less-skilled family members set up automated backups that they don’t have to worry about.

Increasingly our lives are recorded almost entirely in bits. While there are many advantages to this, too numerous to go into here, they are inherently much more ephemeral things. Regular backups are one of the best ways to avoid complete data loss, although it may need to be coupled with occasional conversions in order to avoid file format rot. Make sure you have a plan to protect all of your data, on your own devices and in the cloud.

Posted in Computers, How-Tos Tagged with: , , , , , , , , , , ,

Robot Evolution

Although it’s been almost a month since the end of the semester, I wanted to share some of the final project that consumed most of my time and mental capacity in April. I was taking CS266: Bio-inspired Multi-agent Systems from Prof. Rhadika Nagpal. It was a very fun course, emphasizing seminar-style discussion of research papers, with labs working with actual robot hardware and culminating in a final project that had both a physical robot competition component and a more open-ended simulation component.

My contribution to the final project focused on the simulation, while my partners Andrew Reiter and Pierre-Emile Duhamel focused on the robots. We decided to use the recommended MASON simulation library to implement a virtual version of the competitive foraging task, and then coupled that with a genetic programming implementation to attempt to evolve robot strategies. You can read a lot more detail about our methods and results in our final paper (pdf), including our approaches using the actual e-puck hardware. The simulation is discussed in Section 3. Long story short, the GP approach worked, in that it did successfully learn strategies, but I think that our fitness function could use some work in order to develop strategies that do something more interesting than the manually written strategies.

The complete source code is available on GitHub under a BSD license.

Various videos (some of which I’ve already posted elsewhere) are below the cut.


Posted in Code Projects Tagged with: , , , , ,

Captain Picard Doesn’t Have an iPad

It should be of no surprise to any of you that I am a huge Trekkie. You are probably also aware that I am a total MacAddict. What better binding of bailiwicks than to blather about both?

Star Trek has been at various times credited with inspiring a number of modern gadgets, including the mobile phone (TOS communicator), the PDA and/or tablet (TNG PADD), and touch interfaces (TNG LCARS). The truth of that seems to be a form of loose inspiration (as is often the feedback between science fiction and technology). I’m going to focus in particular on the tablet iPad as compared to the PADD, because I think TNG missed on this in several key ways.

Depending on the specific “model”, a PADD might have:

  • A stylus
  • Separate touch/display areas
  • Various sizes of bezel/case
  • Different colors which indicate dedicated function

Steve Jobs famously said “If you see a stylus, they blew it.”, but a lot of these design choices come out of the realities of prop design – they needed to convey “futuristic” and “alien” in instant, simple, visual ways, and were not trying to build usable devices. Similarly, at the time of filming, they couldn’t embed live video into such a thin device, because the technology didn’t exist yet, so they either had backlit images or had to implement it in post-production with special effects.

Additionally, you’ll often see characters using PADDs in ways people don’t generally use iPads:

  • Handing a PADD to another person to give them a document (various main characters)
  • Having something “signed” by an officer (numerous nameless ensigns)
  • Using multiple PADDs in a disorganized pile (Jake Sisko)

I think for the most part this is due to the writers not having any conception of an always-on network. This is pretty understandable, given that the Web didn’t arrive for non-academics until the middle of Deep Space Nine’s run, and widespread WiFi and mobile data weren’t around until almost the end of Enterprise’s run (EDGE was just getting started in 2003, and Enterprise was cancelled in 2005). The idea of something like iCloud, where the current state of all of your documents is nearly instantly available on all of your devices, was apparently too impossible for science fiction. They didn’t even seem to have a concept of email or file transfer!

Also, I think that for most adults both mobile phones and tablets are 1:1 devices – you are the only user of the device, and you have only one of them. There may be brief cases of lending, and there are certainly plenty of people who have separate work and personal phones, but I believe these are the exception. Children, of course, make heavy use of the devices of parental units until they are old enough to have their own. As such, you wouldn’t hand your device off to someone else indefinitely for their use – you’d transfer state digitally. You also wouldn’t keep different files on different devices. In this way PADDs were more like futuristic notebooks or clipboards, not computers.

I’ve been using an iPad for almost two years, and even though I never got around to reviewing it, my uses have definitely differed from my predictions. I even named mine “PADD” (partially in keeping with my theme of naming Macs after Star Trek animals). I checked out the Retina Display today at an Apple Store – it really is astounding, in some ways more so that the iPhone 4/4S. In spite of all of the improvements, especially the screen, I don’t feel the need to upgrade from my original 16 GB Wi-Fi iPad to “the new iPad“. However, if mine turns out to be unable to support iOS 6, that would be a significant motivation for me to shift.

I like to joke about how using it means I’m living in the future, even a Star Trek future, but in many ways, what we have is better than what Star Trek imagined. I believe that Captain Picard would have been much happier annotating treaties, reading Shakespeare, and writing condolence letters for dead security officers… on an iPad.

Posted in Computers Tagged with: , , , , , ,

Nicolas Ward

Software engineer in Natural Language Processing research by day; gamer, reader, and aspiring UltraNurd by night. Husband to Andrle
Creative Commons License

Post History

August 2018
« Jun