<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description></description><title>Justin's Blog</title><generator>Tumblr (3.0; @fitzsimmons)</generator><link>http://fitzsimmons.ca/</link><item><title>Technology Evaluations</title><description>&lt;h3&gt;Intro&lt;/h3&gt;
&lt;p&gt;I built &lt;a href="http://tothemax.spawnmoreoverlords.org" title="Tweeting To The Max!!"&gt;a stupid app&lt;/a&gt; this weekend. In doing so, I tried out a bunch of technologies that have been around for a while, but are new to me.&lt;/p&gt;
&lt;p&gt;They are:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Coffeescript&lt;/li&gt;
&lt;li&gt;jQuery deferred&lt;/li&gt;
&lt;li&gt;The twitter API&lt;/li&gt;
&lt;li&gt;JSONP&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Here’s my review of each.&lt;/p&gt;
&lt;h3&gt;Coffeescript&lt;/h3&gt;
&lt;p&gt;I don’t really like coffescript. I will never be a fan of languages that are whitespace sensitive. But I still use them. I’m willing to overlook the straight-jacket of whitespace sensitivity as long as the laugage is good enough. Now that I think about it, both haml and sass (also used this weekend) are whitespace sensitive, and also compile to a base language before being transmitted. Their benefits are worth it, but they’re not on trial today.&lt;/p&gt;
&lt;h4&gt;Context&lt;/h4&gt;
&lt;p&gt;I like the initial idea of the @ operator in Coffeescript. It’s a shorthand for “&lt;em&gt;this.&lt;/em&gt;” And you’d better remember that. It can’t be used like you would use it in ruby. I was stuck for longer than I’d like to admit wondering why my assignment to an instance variable wasn’t working in one of my callbacks. Culrpit: @ did not reference my class, but the context that I was currently in. From a javascript perspective, that behavior is obvious. From the object-oriented, ruby-like context that Coffeescript was trying to pretend I’m working in, it was baffling. I had to fall back to the &lt;em&gt;that = this&lt;/em&gt; idiom in order to get my callbacks to close over the object I really wanted to operate on.&lt;/p&gt;
&lt;h4&gt;Documentation&lt;/h4&gt;
&lt;p&gt;The documentation is pretty abysmal too. You’re lucky if you get more than a couple of examples. The tutorial doesn’t even show how to make multi-line functions! Nor does it demonstrate how to use an in-line function for a function parameter that is not the final parameter. The whitespace-sensitivity can make it a bit confusing.&lt;/p&gt;
&lt;p&gt;Only from knowing javascript did I know that I would have to call a co-member function with &lt;em&gt;@&lt;/em&gt; or &lt;em&gt;this&lt;/em&gt;. Somehow in their discussion of classes in both the tutorial and the book, they managed to avoid calling a method from another method. I’m not asking for a python style formal grammar documentation, but there’s a lot to be desired here.&lt;/p&gt;
&lt;h4&gt;Globals&lt;/h4&gt;
&lt;p&gt;Coffeescript also makes it really hard to write library files. They’ve gone from javascript’s implicit globals to the complete opposite, which is not allowing any globals at all. This is an improvement in many ways, but means you have to fall back to raw javascript or settle with using the &lt;em&gt;window&lt;/em&gt; global if you want to actually expose your code to something outside the current file.&lt;/p&gt;
&lt;p&gt;I had my code set up with separate responsibilities: a library that interacts with the twitter API, and a UI frontend. These files can’t talk to each other at all without globals. It’s a shame that the architecture of Javascript has forced that behaviour, but coffeescript goes and makes it worse. I had to use the following code to create a global and then drop my class into it:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; `TweetMax = {}`&lt;br/&gt; class TweetMax.Twitterer &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If it’s not clear, the backticks drop me down to raw javascript. Thankfully I can at least do this, but this is like having to drop down from C to assembly if C didn’t have the &lt;em&gt;extern&lt;/em&gt; keyword.&lt;/p&gt;
&lt;h3&gt;jQuery Deferred&lt;/h3&gt;
&lt;p&gt;The majority of my interaction with jQuery Deferred objects was just to use the bindings off of ajax actions. However, I did write a few custom ones of my own. It’s a great API, and is probably a pattern that I’ll wonder how I ever lived without.&lt;/p&gt;
&lt;p&gt;The one deficiency that I noted, is that you can’t reset the status of a deferred object. Once a deferred object is resolved, it can’t ever be re-resolved. This meant that I had to pull in a proper eventing framework instead of just re-resolving the deferred that I was supplying to the clients of the library. Not a big deal, and for many uses cases, that’s probably a deliberate feature. But for me, it was a deficiency.&lt;/p&gt;
&lt;h3&gt;Twitter API&lt;/h3&gt;
&lt;p&gt;The twitter API itself is nice. It’s available in a variety of formats, and is quite sensible about urls, parameterization, and paging.&lt;/p&gt;
&lt;p&gt;It all falls down in the service. Throughout the weekend I was constantly plagued with 502s (Service Unavailable). At first, I thought I might be getting rate-limited, since my app does require quite a few sequential requests. After a bit of googling and head-scratching, I discovered that the API service is simply flaky and goes down all the time. 502s aren’t really an exceptional failure with the Twitter API. It means “try again in a few seconds”. When working with the twitter API, you absolutely must write code that anticipates that the servers will be constantly failing to fulfill your requests. Which is okay in theory, but leads us into the next technology…&lt;/p&gt;
&lt;h3&gt;JSONP&lt;/h3&gt;
&lt;p&gt;JSONP is a way to get around the cross-domain restriction on XHR requests. This means my clients can make requests directly to the Twitter API without having to filter through my server first. The specific implementation of the format isn’t entirely important, but how it interacts with the browser &lt;em&gt;is&lt;/em&gt;. The browser loads the response from a JSONP request the same way it loads any other resource. Basically, to do a JSONP request, you add a script tag to the DOM, the browser fulfills a request, and a function gets called when it all works. What happens when it doesn’t work? Nothing. The only way to figure out that request failed is to set a timeout in Javascript that fires if your function &lt;em&gt;doesn’t&lt;/em&gt; get called within an arbitrary time limit. Ouch. So that twitter API that is constantly failing? Doesn’t play very nice with JSONP. Even with the timeout, you don’t get the luxury of knowing what exactly went wrong. So I have to jump through more hoops to tell if I’ve been rate-limited, or if Twitter is just screwing up again.&lt;/p&gt;
&lt;h3&gt;Conclusion&lt;/h3&gt;
&lt;ul&gt;&lt;li&gt;Coffescript: I’ll probably avoid it in the future. You know what you’re signing up for with javascript. Writing “function(” everywhere is annoying for some people, but not for me.&lt;/li&gt;
&lt;li&gt;jQuery Deferred: A+++++ would use again&lt;/li&gt;
&lt;li&gt;Twitter API: Hopefully I won’t have any bad ideas that involve the Twitter API again. Of course, my gripes with it aren’t the fundamental parts of the API, just the reliability of delivery. So if they fix that up, I’d be pleased.&lt;/li&gt;
&lt;li&gt;JSONP: Cool technology, but the inability to detect failures really snuck up on me and derailed this project. Now that I know about that problem, I’ll have to carefully consider what I want to use it for, in the future.&lt;/li&gt;
&lt;/ul&gt;</description><link>http://fitzsimmons.ca/post/13747379751</link><guid>http://fitzsimmons.ca/post/13747379751</guid><pubDate>Sun, 04 Dec 2011 17:09:19 -0500</pubDate></item><item><title>vim, ijkl</title><description>&lt;p&gt;My coworkers finally managed to convince me to switch to vim. What a chore.    I basically spent an entire weekend customizing &lt;a href="https://github.com/akitaonrails/vimfiles"&gt;someone else’s .vim&lt;/a&gt; directory to my tastes, which was mercifully easier than tracking down the plugins and configuring them myself, but it was a frustrating bit of changing my vimrc from within a vim that is not quite configured the way I want it.&lt;/p&gt;
&lt;p&gt;It’s a real shame that the vim authors grew up in an era before video games. In my humble opinion ijkl (used in the same way as wasd) is a vastly superior directional scheme to hjkl. It’s directionally intuitive, unlike the linear hjkl, which relies on memorization. It also keeps your index finger on j, where it belongs on the home row. I use h for insert. It’s not as crazy as it sounds. How often do you repeat ‘go left’? Sometimes. How often do you repeat ‘insert’? Never. Because now you’re in insert mode.    Stretching to h for repeated go-lefts became uncomfortable, and sometimes I would unconciously move my whole hand to start on h, which would offset my right handed typing and I’d have to find my place on the home row again after moving around.&lt;/p&gt;
&lt;p&gt;So far I haven’t run into much trouble. At least vim has the configurability to change this sort of stuff, even if it does take me an entire weekend to get everything sorted out.    Thanks go to Deewiant for &lt;a href="http://www.reddit.com/r/vim/comments/f33ge/rebinding_vim_motions_across_every_context/c1cyhs4"&gt;this comment&lt;/a&gt;, which helped me get my bindings consitent.&lt;/p&gt;
&lt;p&gt;Here’s the rebindings, for anyone who wants to join my little cult:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;noremap i k &lt;br/&gt;noremap I K &lt;br/&gt;noremap &lt;C-w&gt;i &lt;C-w&gt;k &lt;br/&gt;noremap &lt;C-w&gt;I &lt;C-w&gt;K &lt;br/&gt;noremap &lt;C-w&gt;&lt;C-i&gt; &lt;C-w&gt;&lt;C-k&gt; &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;noremap j h &lt;br/&gt;noremap J H &lt;br/&gt;noremap &lt;C-w&gt;j &lt;C-w&gt;h &lt;br/&gt;noremap &lt;C-w&gt;J &lt;C-w&gt;H &lt;br/&gt;noremap &lt;C-w&gt;&lt;C-j&gt; &lt;C-w&gt;&lt;C-h&gt; &lt;br/&gt;&lt;br/&gt;noremap k j &lt;br/&gt;noremap K J &lt;br/&gt;noremap &lt;C-w&gt;k &lt;C-w&gt;j &lt;br/&gt;noremap &lt;C-w&gt;K &lt;C-w&gt;J &lt;br/&gt;noremap &lt;C-w&gt;&lt;C-k&gt; &lt;C-w&gt;&lt;C-k&gt; &lt;br/&gt;&lt;br/&gt;noremap h i &lt;br/&gt;&lt;/code&gt;&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://fitzsimmons.ca/post/2916403349</link><guid>http://fitzsimmons.ca/post/2916403349</guid><pubDate>Mon, 24 Jan 2011 19:54:17 -0500</pubDate></item><item><title>Publishers! :(</title><description>&lt;p&gt;Availability of “Starship Troopers” by Heinlein:&lt;br/&gt;
1. Kindle Store: 0&lt;br/&gt;
2. Google search for “starship troopers mobi”: First Link&lt;/p&gt;

&lt;p&gt;You lost a sale!&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2751193281</link><guid>http://fitzsimmons.ca/post/2751193281</guid><pubDate>Fri, 14 Jan 2011 19:08:38 -0500</pubDate></item><item><title>GOMTV Video Ripper</title><description>&lt;p&gt;Okay, so it’s done. As done as it’s going to be, anyway. I really can’t be bothered to spend time beautifying a dirty hack of a web scraper. You’ll have to know about ruby and have a gomtv.net login with a season ticket in order for it to work.&lt;/p&gt;

&lt;p&gt;Here it is:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/Lugghawk/SCScraper"&gt;https://github.com/Lugghawk/SCScraper&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enjoy.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2654058277</link><guid>http://fitzsimmons.ca/post/2654058277</guid><pubDate>Sat, 08 Jan 2011 12:50:57 -0500</pubDate></item><item><title>New Year, New Stuff</title><description>&lt;p&gt;I finally got around to some stuff I’ve been meaning to do for a while this weekend/holiday.&lt;/p&gt;
&lt;ol&gt;&lt;li&gt;With the help of the rest of the l3ibs, l3ib.org and all its corresponding services have been migrated from a dedicated rusty old celeron to a shiny new linode. I like the idea of virtualized machines, since in theory it reduces the impact of a hardware failure, since the virtual machine can be migrated to working hardware with little to no noticeable effect. We’ll see how that turns out.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;In addition to the migration of services, I put together a short list of security priorities for the new server. Embarrassingly, the old one wasn’t even running a firewall. The new server feels much safer with the addition of a strict firewall and some rootkit mitigation, but there’s still more to be done. In depth auditing of privilege escalation is possible via sudo, which has an option to launch subprocesses in a virtual terminal and log everything in a way that can be played back like a video. I’ll talk about this and more if I ever get around to setting it up.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;As part of the server migration, and part of something I’ve wanted to do for a while now, I’ve migrated to tumblr from wordpress. My wordpress was constantly being hit with comment spam, and I was reluctant to spend time updating a platform I barely ever posted with. Tumblr will let me have a more hands off approach.&lt;br/&gt;&lt;br/&gt;Tumblr’s templating engine is easier to figure out than wordpress’s and I managed to get a working theme ported over in an hour or two. It’s feature barren, but I never intend to use a lot of the features that tumblr provides anyway.&lt;br/&gt;&lt;br/&gt;I like tumblr’s custom domain solution. It was easy to set up and works nicely.&lt;/li&gt;&lt;br/&gt;&lt;li&gt;With a new season of GOMTV starting up again, I took it upon myself to see if I could get my video scraper working. The goal is to be able to grab all of the videos without much human intervention. It was possible to get all of the videos before by just taking them out of Flash’s temp directory, but it was a cumbersome manual process, and prone to spoilers. If I can get this to work, it’ll provide a technique for archival, as well as a way to much more easily stream the content to my PS3.&lt;br/&gt;&lt;br/&gt;Turns out GOM has modified their site between seasons again, which meant that about half of my previous reverse engineering work had to be redone. Fortunately they didn’t change the fundamental way of authenticating that you have a season ticket and downloading the video. HTML scraping just had to be done in a different way, and I’m guessing this problem will repeat itself because will continue as GOM improves their site as time progresses.&lt;br/&gt;&lt;br/&gt;I sort of have a script working. It can fetch some videos, but I’m running into frustrating-to-debug corner cases.&lt;br/&gt;&lt;br/&gt;I will post about progress as it happens.&lt;/li&gt;
&lt;/ol&gt;</description><link>http://fitzsimmons.ca/post/2601662989</link><guid>http://fitzsimmons.ca/post/2601662989</guid><pubDate>Tue, 04 Jan 2011 19:06:00 -0500</pubDate></item><item><title>mediastreamer transcoding support</title><description>&lt;p&gt;I’ve recently been using &lt;a href="http://code.google.com/p/mediastreamer/"&gt;mediastreamer&lt;/a&gt; to stream my music to work. The actual audio playback portion of mediastreamer relies on either flash or the HTML5 &lt;audio&gt; tag, which limits the formats that you can stream in; the only consistent playback method has been mp3 in flash. With all of the excitement behind HTML5 multimedia, it would be great to use &lt;audio&gt;, but there’s a long way to go before &lt;audio&gt; is feature-complete or stable in any browser.&lt;/audio&gt;&lt;/audio&gt;&lt;/audio&gt;&lt;/p&gt;

&lt;p&gt;Anyway, about half my collection is in &lt;a href="http://flac.sourceforge.net/"&gt;FLAC&lt;/a&gt;. Even if the endpoint did support FLAC playback, it would be too large to be practical for all-day-streaming. Since I didn’t want to go to the bother of reencoding my entire collection just so I could stream it over the internet, I sat down this weekend and started hacking transcoding support into mediastreamer.&lt;/p&gt;

&lt;p&gt;The tag reading library used by mediastreamer already supported FLAC, so adding FLAC files to the database was as simple as updating the glob that searched for files. My approach to transcoding was to use commandline tools to decode and reencode the file in question, and then pipe that into the webserver for streaming. It turns out that everyone’s implementation is broken in some way unless I specify a Content-length header. As far as Flash is concerned, files hosted without a Content-length never end, meaning the playlist never advances. Chrome’s native &lt;audio&gt; support for mp3 simply rejects files are served without Content-length. Firefox and Opera don’t matter, because they don’t even support mp3 natively.&lt;/audio&gt;&lt;/p&gt;

&lt;p&gt;There’s two ways I can think of to know the file-size, so that I can set the Content-length header in HTTP:&lt;br/&gt;&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Transcode the entire file before streaming, and just look&lt;/li&gt;&lt;br/&gt;&lt;li&gt;Use a deterministic method of encoding, so that the size of the output file can be estimated by looking at the length of the input file&lt;/li&gt;&lt;br/&gt;&lt;/ol&gt;&lt;br/&gt;
I tried method 1, but I was not satisfied with the several second pauses between files. Since I plan on deploying this solution to a computer much slower than my development machine, the pauses between files would be even longer, and unacceptable.

&lt;p&gt;Method 2 is currently in development. Deterministic output means that VBR is right out, so I’m stuck with encoding to CBR mp3. I’m estimating the Content-length by multiplying the length of the song in milliseconds by (bitrate / 1000). This is close enough, but somehow results in a length several kbytes longer than the output from lame. Interestingly, this doesn’t seem to affect Flash; the Content-length doesn’t need to be&lt;strong&gt; &lt;/strong&gt;&lt;em&gt;right&lt;/em&gt;, it just needs to be &lt;em&gt;close&lt;/em&gt;. How frustrating. Still, it would be nice to know how to accurately predict the output of lame. It’s unsettling to be setting incorrect Content-lengths.&lt;/p&gt;

&lt;p&gt;I’m going to look into submitting bug reports to webkit for their poor &lt;audio&gt; support. Or maybe not. It’s possible that Sinatra is just incorrectly responding to Range requests, which webkit seems to like - but range is probably a dangerous proposition for a file that’s being dynamically generated, so I’m not entirely sure whose fault it is. No other browsers use Range when they make requests for their &lt;audio&gt; tags, as far as I can tell. Unfortunately, I’ll probably have to build a webserver that hosts both vorbis and mp3, without Content-length headers, to test this across a wide range of browsers.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033418</link><guid>http://fitzsimmons.ca/post/2576033418</guid><pubDate>Mon, 24 May 2010 15:50:00 -0400</pubDate><category>Tech</category></item><item><title>BFBC2ConfigTool Alpha 3</title><description>&lt;p&gt;&lt;a href="http://fitzsimmons.ca/stuff/BFBC2ConfigTool-alpha3.zip"&gt;Download&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cgit.l3ib.org/index.cgi/BFBC2ConfigTool.git/"&gt;Browse Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Another bugfix release. Looks like I forgot to set ConceptRoll for turrets (because apparently you want to roll vehicles). Not being able to move turrets left and right should be fixed. If your config files are in a non-working state, simply open the program and hit save for a fix.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033420</link><guid>http://fitzsimmons.ca/post/2576033420</guid><pubDate>Wed, 24 Mar 2010 21:39:36 -0400</pubDate><category>Tech</category></item><item><title>BFBC2ConfigTool Alpha 2</title><description>&lt;p&gt;&lt;strong&gt;NOTICE: Alpha 2 is bugged. Please get &lt;a href="http://fitzsimmons.ca/bfbc2configtool-alpha-3/"&gt;Alpha 3&lt;/a&gt;.
&lt;/strong&gt;

&lt;span style="text-decoration: line-through;"&gt;&lt;a href="http://fitzsimmons.ca/stuff/BFBC2ConfigTool-alpha2.zip"&gt;Download&lt;/a&gt;&lt;/span&gt;

&lt;a href="http://cgit.l3ib.org/index.cgi/BFBC2ConfigTool.git/"&gt;Browse Source&lt;/a&gt;

Alpha 2 is out already, with fixes:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Completely forgot to modify relevant parts of GameSettings.ini in Alpha 1, now fixed&lt;/li&gt;
	&lt;li&gt;Program now exits gracefully when BFBC2 directory not found, instead of crashing&lt;/li&gt;
	&lt;li&gt;Warning message actually says what it should&lt;/li&gt;
&lt;/ul&gt;</description><link>http://fitzsimmons.ca/post/2576033381</link><guid>http://fitzsimmons.ca/post/2576033381</guid><pubDate>Wed, 24 Mar 2010 14:33:38 -0400</pubDate><category>Tech</category></item><item><title>BFBC2ConfigTool Alpha Release 1</title><description>&lt;p&gt;&lt;strong&gt;NOTICE: Alpha 1 is bugged (big surprise). Please get &lt;a href="http://fitzsimmons.ca/bfbc2configtool-alpha-3/"&gt;Alpha 3&lt;/a&gt;.&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;span style="text-decoration: line-through;"&gt;&lt;a href="http://fitzsimmons.ca/stuff/BFBC2ConfigTool-alpha1.zip"&gt;Download Alpha 1&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cgit.l3ib.org/index.cgi/BFBC2ConfigTool.git/"&gt;Browse Source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the first release of the BFBC2ConfigTool. I’ve hacked up a quick alpha version that should painlessly deactivate mouse smoothing, and allow people to fiddle with their sensitivities. There’s also an option to make the Russians in BFBC2 speak in English, since apparently some people were encountering problems with that.&lt;/p&gt;

&lt;p&gt;This initial alpha release is targeted mainly at reddit users. If all goes well, I’ll post about this on the EA forums.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;This is alpha software. It will probably break. Use at your own risk. There is currently no input validation. I take responsibility for nothing. Please report bugs so I can fix them.&lt;br/&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To use, simply run the provided exe. You need .NET 2.0.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033358</link><guid>http://fitzsimmons.ca/post/2576033358</guid><pubDate>Wed, 24 Mar 2010 04:37:39 -0400</pubDate><category>Tech</category></item><item><title>Proof of concept BFBC2/HTTP Redirector</title><description>&lt;p&gt;As noted by &lt;a href="http://www.reddit.com/r/badcompany2/comments/bf85d/a_bacon_server_another_unofficial_reddit_server/"&gt;a reddit post&lt;/a&gt;, reddit doesn’t accept bfbc2:// style links. It’s probably going to be a fairly common problem. I wrote a proof of concept script that just does a simple 302 redirect from http to bfbc2. The base URI is &lt;a href="http://fitzsimmons.ca/bfbc2/"&gt;http://fitzsimmons.ca/bfbc2/&lt;/a&gt;[server string here]. You can enter a server string raw, or URLified (with bfbc2:// on the front) and the webserver will automatically redirect you to a URI that the handler can pick up.&lt;/p&gt;

&lt;p&gt;Here’s a couple examples:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://fitzsimmons.ca/bfbc2/2503473115,3fc5640a-7dbb-415f-9e45-ba6cec0562dc,A%20Bacon%20Server"&gt;&lt;a href="http://fitzsimmons.ca/bfbc2/2503473115,3fc5640a-7dbb-415f-9e45-ba6cec0562dc,A"&gt;http://fitzsimmons.ca/bfbc2/2503473115,3fc5640a-7dbb-415f-9e45-ba6cec0562dc,A&lt;/a&gt; Bacon Server&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://fitzsimmons.ca/bfbc2/bfbc2://3363010643,b652b484-4188-42ea-8885-50fc4991af5b,Reddit%20Unofficial%20Gaming%20Community-%20Chicago"&gt;&lt;a href="http://fitzsimmons.ca/bfbc2/bfbc2://3363010643,b652b484-4188-42ea-8885-50fc4991af5b,Reddit%20Unofficial%20Gaming%20Community-%20Chicago"&gt;http://fitzsimmons.ca/bfbc2/bfbc2://3363010643,b652b484-4188-42ea-8885-50fc4991af5b,Reddit%20Unofficial%20Gaming%20Community-%20Chicago&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This should allow you to link from places that only allow http style URIs. If this takes off at all, I’ll write a some info about what’s happening on the redirect page, for people that don’t have the handler set up.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033360</link><guid>http://fitzsimmons.ca/post/2576033360</guid><pubDate>Thu, 18 Mar 2010 20:47:02 -0400</pubDate><category>Tech</category></item><item><title>BFBC2FavouriteManager Alpha 5</title><description>&lt;p&gt;Download: &lt;a href="http://fitzsimmons.ca/stuff/BFBC2FavouriteManager-alpha5.zip"&gt;alpha 5&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://cgit.l3ib.org/index.cgi/BFBC2FavouriteManager.git/"&gt;Browse source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I’ve released the next alpha of BFBC2 to address issues with alpha4. Exception handler code has been added which should me debug tripwire’s problem. The regex has been updated to include server names with !s in them.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033353</link><guid>http://fitzsimmons.ca/post/2576033353</guid><pubDate>Thu, 18 Mar 2010 17:41:26 -0400</pubDate><category>Tech</category></item><item><title>That was fast; BFBC2FavouriteManager now has a real UI (Haxpact Day 5)</title><description>&lt;p&gt;&lt;a href="http://fitzsimmons.ca/stuff/BFBC2FavouriteManager-alpha4.zip"&gt;Alpha 4 download&lt;/a&gt; &lt;a href="http://cgit.l3ib.org/index.cgi/BFBC2FavouriteManager.git/"&gt;Browse source&lt;/a&gt; It turns out that creating UIs in Visual Studio is really easy. I created one for BFBC2FavouriteManager, so it now actually lives up to its name; it can now manage your favourites. Here’s a screenshot:&lt;/p&gt;
&lt;dl class="wp-caption alignnone" id="attachment_93"&gt;&lt;dt class="wp-caption-dt"&gt;&lt;img src="http://media.tumblr.com/tumblr_lefu6cXKjN1qf8ox4.png"/&gt;&lt;br/&gt;&lt;/dt&gt; &lt;/dl&gt;&lt;p&gt;The only thing missing now is that I’d like to add some signalling to the program so that the manager knows to reload the list when the link handler adds a new server. The link handler operates as a separate process, so I’m going to need IPC of some kind to achieve that.  Outside of that, I can’t think of any other features to add. I’m open to suggestions.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033362</link><guid>http://fitzsimmons.ca/post/2576033362</guid><pubDate>Fri, 12 Mar 2010 16:15:00 -0500</pubDate><category>Tech</category></item><item><title>BFBC2FavouriteManager Release (Haxpact Day 4)</title><description>&lt;p&gt;Alpha release: &lt;a href="http://fitzsimmons.ca/stuff/BFBC2FavouriteManager-alpha3.zip"&gt;download&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="http://cgit.l3ib.org/index.cgi/BFBC2FavouriteManager.git/"&gt;browse source&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It’s painfully difficult to add custom servers to Battlefield Bad Company 2. There’s no support for directly connecting via IP, and the server browser has a tendency to fail. Fortunately, the server strings for favourites and history are saved in a easily-parsed plaintext ini file, so it’s possible to hack in new servers to your favourites.&lt;/p&gt;

&lt;p&gt;I’ve written this program to help make that process a little easier. It registers the bfbc2:// URI protocol, and when you click on a properly formatted link, it’ll automatically add that server to your favourites. Hopefully this will make sharing servers a bit easier on everyone.&lt;/p&gt;

&lt;p&gt;The current release is alpha! Use at your own risk! It has nothing fancy like installers or icons! Read the readme in the archive for more information. I’m sure even this minimal program has a handful of bugs. Let me know what they are so I can fix them. I expect to see my regex reject a few server strings that are actually legit.&lt;/p&gt;

&lt;p&gt;.NET 2.0 is a minimum requirement. If you don’t have that, you might as well get &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=AB99342F-5D1A-413D-8319-81DA479AB0D7&amp;displaylang=en"&gt;.NET 3.5 SP1&lt;/a&gt; while you’re at it.&lt;/p&gt;

&lt;p&gt;Anyway, here’s some sample links:&lt;/p&gt;

&lt;p&gt;&lt;a href="bfbc2://3363010643,b652b484-4188-42ea-8885-50fc4991af5b,Reddit%20Unofficial%20Gaming%20Community-%20Chicago"&gt;Reddit Unofficial Gaming Community- Chicago&lt;/a&gt;&lt;br/&gt;&lt;a href="bfbc2://2313393967,6bc27d28-15cf-4b4f-8b8c-8a46820fc886,--o%20Narwhal%20o--%20Ranked%20Rush%2024/7"&gt;—o Narwhal o— Ranked Rush 24/7&lt;/a&gt;&lt;br/&gt;&lt;a href="bfbc2://1220867783,6396db87-daa3-4b85-bb6d-a6d84227f526,Hals%20n'%20Pals%20-%20Mature%20Gaming%20Community"&gt;Hals n’ Pals - Mature Gaming Community&lt;/a&gt;&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033312</link><guid>http://fitzsimmons.ca/post/2576033312</guid><pubDate>Thu, 11 Mar 2010 19:13:25 -0500</pubDate><category>Tech</category></item><item><title>Haxpact Day 3</title><description>&lt;p&gt;The regexp of horror is complete. I ran into some truncation problem with the ini library that I grabbed yesterday, because the buffer was too small. Thanks to the mercifully good debugger in Visual C#, I was able to track down the source of the truncation bug pretty quickly. The problem was that the author of the adaptor only allocated a buffer of 255. I’ve increased the limit to 2k, which should be way more than anyone should ever need (famous last words). It should be possible to test if the buffer was large enough, so I can probably future-proof the parser at some point by adding code that will dynamically increase the buffer size if the initial amount is too low. I’ll come back to that later.&lt;/p&gt;

&lt;p&gt;I think the alpha is complete. Next on the list is to run some preliminary testing. Once that is done, I’ll make a source and binary release to the community.&lt;/p&gt;

&lt;p&gt;&lt;a href="bfbc2://3363010643,b652b484-4188-42ea-8885-50fc4991af5b,Reddit%20Unofficial%20Gaming%20Community%20-%20Chicago"&gt;Reddit Unofficial Gaming Community&lt;/a&gt;&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033310</link><guid>http://fitzsimmons.ca/post/2576033310</guid><pubDate>Thu, 11 Mar 2010 12:34:59 -0500</pubDate><category>Tech</category></item><item><title>Haxpact Day 2</title><description>&lt;p&gt;Registration of the bfbc2:// protocol is now complete. Now on to the real part of the program. I also found a &lt;a href="http://www.codeproject.com/KB/cs/cs_ini.aspx"&gt;chunk of C# code&lt;/a&gt; that will bind to the win32 INI parsing functions, since .NET doesn’t have something built in for it.

The next step is input validation. Here’s a sample server string: 3363010643,b652b484-4188-42ea-8885-50fc4991af5b,Reddit Unofficial Gaming Community - Chicago;

As far as I can tell, the format for the server string is three fields separated by commas:
&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Some sort of numeric ID&lt;/li&gt;
	&lt;li&gt;Something that’s probably a GUID, looks like it’s in hexidecimal. All servers appear to be in the 8-4-4-4-12 configuration.&lt;/li&gt;
	&lt;li&gt;A freeform string&lt;/li&gt;
&lt;/ol&gt;
My current goal is to write a regular expression to match this format, and validate incoming input with it. It’s not a particularly challenging goal, but it will take time and will undoubtedly be a fairly ugly “write-only” regexp that nobody (including my future self) will understand.

After input is validated, I simply need to parse the ini file, check that the input is not already in the user’s list, and insert the new server. Not unreasonable to think I’d be done the basic functionality of this program by the end of the week.</description><link>http://fitzsimmons.ca/post/2576033316</link><guid>http://fitzsimmons.ca/post/2576033316</guid><pubDate>Wed, 10 Mar 2010 16:11:51 -0500</pubDate><category>Tech</category></item><item><title>Haxpact Day 1 - BFBC2FavouriteManager</title><description>&lt;p&gt;First day of &lt;a href="http://www.minuslab.net/d/?p=93"&gt;haxpact&lt;/a&gt; report:

I’m planning on making a favourite server manager for Battlefield Bad Company 2. The ingame server browser has a crappy UI, and has a tendency to just fail. For example, there is a well known bug where pings simply do not show up in the server browser. Makes it challenging for me to find a good server. Also, adding a server to the favourites list doesn’t work from the global list for me. It just locks up forever.

Fortunately, the favourites list is saved in a fairly simple format in BFBC2’s configuration file, called GameSettings.ini. I can modify this file to add favourite servers manually, as long as I have their identification string. What I’m aiming to do with my haxpact project is make a program that is bound to the bfbc2:// uri; the config information can be hosted on webpages, and people can simply click on a link to add the server to their favourites. At first, this is all the program will do. Perhaps in the future I will add a GUI that will allow people to export their favourites, reorder their favourites, etc.

&lt;/p&gt;&lt;hr&gt;The first technical problem I’ve encountered is registering the URI handler. You need to have administrator privileges in Windows Vista and 7 in order to modify the part of the registry that I need to modify. There’s no way to escalate the privileges of an existing process, so my project needs to launch another process with admin privileges (invoking UAC) to set up the URI handler. So far I’ve been struggling with understanding all this and figuring out the C# build environment, so I haven’t really made any progress on the project itself.

P.S. I’m Canadian so there’s going to be a u in the name. Deal with it.</description><link>http://fitzsimmons.ca/post/2576033191</link><guid>http://fitzsimmons.ca/post/2576033191</guid><pubDate>Tue, 09 Mar 2010 12:51:07 -0500</pubDate><category>Tech</category></item><item><title>rsync-ing only dotdirs and dotfiles (hidden directories and files on unix) </title><description>&lt;p&gt;TL;DR:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls [source] | rsync -a --exclude-from=- [source] [dest]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;I’ve recently been working on setting up a backup solution for my various computers. One of the things I wanted to do was backup only my program settings. In unix-like operating systems, these are usually stored in the user’s home directory, with a . in the beginning of the filename. This denotes that the file is hidden by default.&lt;/p&gt;

&lt;p&gt;Rsync is a utility that is used to copy files from a source to a destination, optionally over a network. It is great for backups since it checks the contents of the files on both sides, and only sends the (parts of) the files that have changed.&lt;/p&gt;

&lt;p&gt;Rsync can be a bit cumbersome to use, and I searched google for a while and even asked in their IRC channel for help. I couldn’t figure out how to make rsync select only my dotdirs. I figured it out today.&lt;/p&gt;

&lt;p&gt;The command is:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;ls [source] | rsync -a --exclude-from=- [source] [dest]&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;How it works: by default, ls only shows non-hidden files. So, the command ls builds a list of files and directories that are not hidden - a list of everything I don’t want. I pipe that to rsync -a (a is for archive). —exclude-from usually operates on files, but when you give it a - as a filename, it reads from stdin instead. In this case, stdin is the listing of stuff that I don’t want, piped from ls. Works perfectly.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033125</link><guid>http://fitzsimmons.ca/post/2576033125</guid><pubDate>Thu, 11 Jun 2009 13:37:20 -0400</pubDate><category>Tech</category></item><item><title>File managers, parallel copy, and performance hits</title><description>&lt;p&gt;Scenario:

I’m using an everyday modern GUI file manager to copy a huge file to my portable harddrive. A few minutes later, while the first transfer is still in progress, I realize that there were actually two huge files I want to copy to my portable harddrive.

What are my options? I could copy the other file right away, or I can babysit the file copy and copy the second file when the first one is complete.

The disadvantage to the first option is that the files copy in parallel. Harddrives operate best when used sequentially. Copying the files in parallel reduces the total rate at which data is copied to the harddrive, thanks to the head having to jump around to different parts of the disk. The total time of the operation is significantly increased.

The disadvantage to the second option is that I have to sit here and babysit a process that should be automatic. I’m just copying two files. What if my two files would take 15 minutes each to copy, but I want to do something that is going to take half an hour, and then come back and collect my portable harddrive and then leave immediately?

Another similar scenario: I want to copy two huge files to the same destination, but they’re in different source directories, meaning I can’t select both of them at once.

The solution? I think a queue would work nicely, but while solving one problem would introduce several others:
&lt;/p&gt;&lt;ul&gt;&lt;li&gt;User confusion: “why aren’t my files copying [right away]?”&lt;/li&gt;
	&lt;li&gt;Having to add a complex UI to otherwise simple and unintrusive file-copy dialogs to handle queues - at the very least, you need to be able to remove the items from a queue&lt;/li&gt;
	&lt;li&gt;Priority/detection of when queues should be used; should queues always be used when the destination device is the same for every file? Should queuing be explicit [Copy -&gt; Paste (add to queue)]? Or maybe it is parallel that should be explicit [Copy-&gt;Paste Immediately]?&lt;/li&gt;
&lt;/ul&gt;
Why don’t we see a queue feature in modern file managers? Is it because it’s just a hard problem, or is there a good reason &lt;strong&gt;not&lt;/strong&gt; to have it? Or perhaps I’m just using the wrong file manager?</description><link>http://fitzsimmons.ca/post/2576033039</link><guid>http://fitzsimmons.ca/post/2576033039</guid><pubDate>Sat, 21 Mar 2009 22:01:25 -0400</pubDate><category>Tech</category></item><item><title>Pro Starcraft In English - A RSS Feed</title><description>&lt;p&gt;I’ve picked up starcraft fever again. And, I’ve started watching professional games out of Korea.&lt;/p&gt;

&lt;p&gt;For all of us non-Koreans, we’re able to get the videos in VOD form; that is, someone records the match from TV and posts it to the internet for the rest of us. However, these matches are almost always commentated in Korean. They’re still exciting to watch, but the commentary adds a lot to understanding why the players are playing how they’re playing.&lt;/p&gt;

&lt;p&gt;Fortunately, &lt;a href="http://www.gomtv.net/classics2/"&gt;GOM TV&lt;/a&gt; has started to provide internet-only english coverage of their tournament with &lt;a href="http://www.tastelessgaming.com/"&gt;tasteless&lt;/a&gt;, an American starcraft progamer. This is available in both a live format and as a series of recorded videos after the match (VOD). Also, there are a number of excellent amateur commentators that provide english commentary over top of Korean VODs, from &lt;a href="http://sc2gg.com/"&gt;sc2gg.com&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Obviously, I want to follow these games, but who wants to visit a bunch of sites just to keep up to date in this day and age of RSS? SC2GG’s aggregation is particularly bad: they only link to the individual commentator’s youtube pages and leave it from there.&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="http://pipes.yahoo.com/pipes/"&gt;Yahoo! Pipes&lt;/a&gt;: a very handy &lt;em&gt;web 2.0 mashup tool thing&lt;/em&gt;. It provides a method of aggregating and manipulating several different types of sources on the internet, but in my case, RSS feeds were available for everything, so my sources are all RSS. What I did was combine all of the youtube feeds for each SC2GG commentator, and GOMTV’s coverage, filter out non-starcraft entries, cut off entries from longer than a week ago, and sort the whole thing by the date it was published. The result: &lt;a href="http://pipes.yahoo.com/pipes/pipe.run?_id=XqZXoDPc3RGRfwmppgt1Yg&amp;_render=rss&amp;dateinput1=7+days+ago"&gt;a RSS feed of Pro Starcraft games with English commentary&lt;/a&gt;. Or, you can view the &lt;a href="http://pipes.yahoo.com/fitzsimmons/prostarcraft"&gt;Yahoo! Pipe itself&lt;/a&gt;, which allows you to get the output in several other formats, or take a look at the internals of how the pipe works, as long as you have a Yahoo! account. Pipes are pretty cool.&lt;/p&gt;

&lt;p&gt;If anyone knows of any other sources of English commentary for Starcraft, let me know, and I’ll work on incorporating it into my feed.&lt;/p&gt;</description><link>http://fitzsimmons.ca/post/2576033033</link><guid>http://fitzsimmons.ca/post/2576033033</guid><pubDate>Wed, 07 Jan 2009 06:40:54 -0500</pubDate><category>Tech</category></item><item><title>jquery, XHTML 1.1 Strict, and NS_ERROR_INVALID_POINTER</title><description>&lt;p&gt;I ran into a tiny poorly-documented problem with Firefox and jquery.

I’m developing a website using XHTML 1.1 Strict. This causes firefox to barf with a semi-helpful parsing error when the page it loads is not valid XML, instead of the usual behaviour which is to guess at what the developer meant and make and display a DOM tree anyway. This can be nice to help you validate as you code.

What it doesn’t handle well is when the changes you make to the DOM tree are not valid. I’m also using jquery in my page, and if you screw up your XML, you’ll get an almost useless error in your javascript console:
&lt;/p&gt;&lt;blockquote&gt;uncaught exception: [Exception… “Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMNSHTMLElement.innerHTML]”  nsresult: “0x80004003 (NS_ERROR_INVALID_POINTER)”  location: “JS frame :: http://yourserver/include/jquery.js :: anonymous :: line 11”  data: no]

Line 0&lt;/blockquote&gt;
So, viewers who are hopefully finding this page via google: if you are getting this error when modifying the DOM tree with jquery, and you’re using XHTML 1.1 Strict, then you’ve probably screwed up your XML.</description><link>http://fitzsimmons.ca/post/2576033000</link><guid>http://fitzsimmons.ca/post/2576033000</guid><pubDate>Sat, 13 Dec 2008 23:20:43 -0500</pubDate><category>Tech</category></item></channel></rss>

