Blog Archives

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: , , , ,

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.

(more…)

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

BackSnapper – My First Chrome Extension

BackSnapper

On a whim tonight, I whipped up my first Google Chrome extension in about 2 hours. A non-trivial amount of time was spent writing it up and making the icons. It’s obviously very simple, but it replicates one of my favorite features of Safari 3: SnapBack (the feature got eviscerated in Safari 4).

Basically all this extension does is add a button to the Chrome toolbar that you can click to jump back to the first page in a tab’s history. I realize the button and icons are ugly; I am not a design-type person.

The BackSnapper button once installed in Chrome 4

The BackSnapper button once installed in Chrome 4

You can read a bit more about my BackSnapper extension, download it if you’re using the developer edition of Google Chrome (currently version 4), or view the code on github.

As Chrome rolls out the Extensions Gallery, I’ll deploy the extension out there. It could probably use some better options, and some smarter heuristics for determining where the beginning is, but for my purposes it gives me the magic button I want.

Installation

You can install the BackSnapper extension from the .zip file more or less by following Step 4 in these instructions. Note that at present this only works for the dev channel (version 4) of Google Chrome.

  1. Download and unpack the .zip file
  2. Select Extensions from the Tools menu.
  3. Click “Developer Mode” on the right in the Extensions display.
  4. Click “Load unpacked extension…” and select the unpacked BackSnapper folder

Development Tips

There were a few things I learned getting this working that weren’t immediately obvious from the documentation:

  • The debug console is per tab
  • You may need to select your injected content Javascript in the debug console to view logged messages
  • For simple calls into content scripts, chrome.tabs.sendRequest() is sufficient, you don’t need to use the more complicated connect() message passing calls.

There were also a few things I couldn’t figure out:

  • Why won’t the current developers-only Extensions Gallery accept my unsigned zip file?
  • Why can’t I determine the current URL in the history after having called history.go()? location.href remains unchanged, and history.current is undefined.
Posted in Code Projects, Computers Tagged with: , , , , ,

Tweetworks Python API

Tweetworks Python API

Version 1.0.0b1 of the tweetworks package for Python 2.6 is now available. This package implements the web service API for Tweetworks, a Web 2.0 service that facilitates threaded conversations on top of Twitter.

This is definitely a beta, because while I’ve tested everything I can think of, I haven’t tried writing anything seriously complicated with it, although I certainly plan to. Comments and questions are welcome here, or find me in the Tweetworks Developers group or as @UltraNurd. I admit that the documentation is a little light at the moment.

If you’re interested in using Tweetworks programmatically from Python, or want to know more about the service, read on.

(more…)

Posted in Code Projects 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

February 2017
S M T W T F S
« Jan    
 1234
567891011
12131415161718
19202122232425
262728