I’m visiting family over the holidays and am a big fan of Castle Crashers.  Unfortunately, V’s brother didn’t have it installed (nor any Microsoft Points).  I figured this would be a pretty simple affair: Add my card, buy the points, remove the card and call it a day. I am pleasantly surprised to see that I now cannot remove the card from his account.  From what I’ve researched, as long as auto-renewal is off there shouldn’t be any problems.  Though, still I get some kind of 80xxxxxx error.

Alternatively there’s a web portal you can access to remove payment methods as well.  Unfortunately, this also doesn’t allow me to remove the card.  Instead we need to log into the ‘parental account’ which is essentially a dead account.  What I find curious is how easily I could add a card to this account (without ‘parental’ permission or whatever), yet to remove the card is a whole different story.  I would love to know how many 12 year olds have added their mom’s credit card to their Live account for those sweet, sweet MS points.

So, here I am with my Credit Card tied to a Live account with no ability to remove the card whatsoever.  I can say that I’ve learned a few things from this; one of those being that I won’t be giving Microsoft (at least the Xbox division) any of my business until they clean up their half-working practices.

Earlier this week I finished reading my copy of The Net Delusion by Evgeny Morozov. I’ve always been rather skeptical of the claims about how Twitter and Facebook are being used as tools for revolutions. The Net Delusion is extremely critical of this very western assumption and uses several examples from the cold war (Samizdat, Radio Free Europe, etc.) as how these technologies really aren’t that effective.

Morozov also talks about the hypocrisy of the west (primarily America) in regards to censorship and monitoring of ones people. America has been very critical of authoritarian states in regards to freedom, but then allows various industries to censor its citizens when someone’s bottom line is at risk. These acts essentially put cards in the authoritarian states hands; “If you (America) can sensor its citizens when it’s convenient why can’t we?”

When I was nearing the end of the book it felt like it had run out of a bit of steam. Although it made going through the last few chapters a bit tough it is still an excellent read.

If you are looking for an interesting read over the holidays, or simply want to learn about the other side of “Internet freedom” then you probably won’t be disappointed.

I’ve recently started using spine for a project I’m working on at Shopify and I realized that there were some deficiencies in the framework. These were primarily around dealing with prefixed API responses and finding items that weren’t necessarily available locally (yet). I had been working on fixing the prefix issues several times, though I was informed by Alex (the maintainer) that he was going to be dropping support for prefixed responses anyway. Also, for finding items Spine made an assumption that on your fetch call everything would be retrieved from the server. This works for tiny applications, but when dealing with large datasets (such as those that can be retrieved in the Shopify API), you may not get everything you want in a single call. This required being able to defer a call off to the server to see if it exists there before reporting an item as unknown/not found.

Hence, bring on the plugins project that I’ve started. Currently the only plugin is the ajax.find plugin that solves the problems mentioned above. Hopefully it will help anyone using spine with any issues they may be having in the future when their server responses are non-standard (in the rails sense) or simply legacy from old rails applications.

The code is available on github and I really hope that it helps with any problems you may have been having. I’m definitely willing to accept contributions, though it would be preferable that they are tested.

It’s really not as bad as you might think actually. It’s just important to know if you are doing something like User Agent sniffing to determine what kind of browser is hitting your site. Typically everything will work fine, except when the user decides to add your web application as a bookmark to their Springboard.

If I remember correctly, when you launch a springboard web app the application then gets contained within a UIWebView instead of being launched from within Mobile Safari. This means that your UA string has changed; but only slightly.

Here is the UA string for Mobile Safari:

Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X;  en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2  Mobile/8J2 Safari/6533.18.5

And here it is for a Springboard Launched Application:

Mozilla/5.0 (iPod; U; CPU iPhone OS 4_3_3 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8J2

If you are going to be doing UA detection, it’s probably safer to look for the iPhone OS string instead of something like Mobile/*** Safari/***

First PourSo my first brew is completed, and after all the worries I’d have to say everything has turned out alright. When I think about how to describe what making the first brew is like I kinda want to draw parallels to have a kid. It seems that you try to follow whatever directions you have to the best of your ability but always question yourself during the process. Did I sanitize enough? Did some of that water that had store bought ice in it get in my wort? Why does this warm, uncarbonated beer taste horrible? Though, I may be completely wrong since I don’t actually have children but it feels like the sort of questions I would ask while raising a child.

As for the beer itself, it’s actually pretty decent. Although it’s not as complex as what you’d get from craft breweries, it’s drinkable. Now that my first batch is complete I’m going to be starting my second which will be an APA this time.

In case you are curious to see what the end result looks like, here is a picture I took after opening my first bottle.

So DROIDHACK was this weekend, and I wasn’t exactly too sure what I wasn’t too sure what I was going to work on. I really wanted to get into the data layer of Mercury, but was really really dreading having to write all the data layer junk that comes with working with SQLite on Android.

Back when I first started working at Shopify I was initially going to be making an Android application. The first thing I knew I needed to do was find some kind of ORM that would make working with the database less painful. I had come across a few options, where the best was a proprietary one which I didn’t think was the best choice. Alternatively, there were a few open source projects that at first glance seemed like a good choice but were using way too much reflection and was kinda difficult to add features to. I really wanted a tool that would make it easy to create a database, but wouldn’t rely on reflection too much.

Another attendee, Don Kelly wasn’t too sure what kind of Android project he wanted to work on either so I bounced the idea off him and then we started hacking up some unit tests. My TDD process is pretty weak, and it was great working with someone who approached the problem from a test driven perspective. What I really liked about this was we were able to make API decisions right away. How do we want to get objects from the database? How do we want to interact with them? How would we create a table? I’ve read Becks’ book on TDD but have always found it tough to apply it when I’m actually working on something.

As for the project we worked on; it’s called velvet and the goal is to make working with databases on Android suck less. We haven’t really got much working with it yet, but the goal will be to have a simple data access layer, migrations and easy access to database cursors for presenting data in listviews and such. I’d have to say working with any kind of structured data with SQLite on Android requires far too much work already, wastes time and is often error prone.

Well so do I! Here’s a good article that covers how to setup your emacs configuration so you can become a more effective developer.

Effective Emacs

A little over a week ago I decided to figure out if there were emacs modules which would allow me to do all my Android development with. Of course there were, and it was just a matter of getting my environment setup in order to have everything working.

Much of this required actually getting Java tools installed, which is a fairly large pain. There are several dependencies, and for a somewhat new Emacs user somewhat complicated. As such my entire environment isn’t fully set up yet (still no auto-completion and auto-detection of libraries are glaring omissions right now) but I’m pretty satisfied so far. I find I’m a smidge slower than on Eclipse, but considering how I would have eclipse fully lock up on me for several seconds every once in a while I’m confident it balances out.

Although I haven’t gotten into anything crazy yet (debugging, testing) I’m pretty satisfied with the tools I have available to me. By simply typing in M-x android-ant-compile I can run the ant tasks for my project. I also get some nice features like logcat output in an emacs buffer as well. I’ll continue to update my experiences in using emacs for Android development in the future.

References:

I’m really curious to know why initializing objects, primarily Hashes (maps, dictionaries, key-value lookups, whatever you want to call them) are such a pain to initialize.

In your typical Java scenario this is how you initialize your Hash:

HashMap hashyMcHash = new HashMap();
hashyMcHash.put("foo", "bar");
hashyMcHash.put("car", "jar");
hashyMcHash.put("arr", "rawr");
// And... so on

Meanwhile, most sane languages allow you to do crazy things like this:

hashyMcHash = {foo: "bar", car: "jar", arr: "rawr"};

Now, in languages like Python, Ruby, JavaScript those are just parts of the language and you kinda get them for free, so I can understand something like that not being available in Java. Now, lets look at another statically typed language that I think took a fair compromise between how to initialize a Hash.

NSDictionary hashyMcHash = [[NSDictionary alloc] initWithObjectsAndKeys: @"foo", @"bar", @"car", @"jar", @"arr", @"rawr", nil];

To me this seems like a pretty fair compromise for initializing our Hashes since it allows me to state what some default values in it will be in code that is fairly readable. I have an idea of how one could do it in Java, though don’t know if it exists or not.

// Constructor would probably look like this:
// HashMap(K[] keys, V[] values)
HashMap hashyMcHash =
                new HashMap(
                    ["foo", "car", "arr"],
                    ["bar", "jar", "rawr"],
                );

If this does exist, please let me know because I’d really love something like this. If it doesn’t… why?

Yesterday was my first attempt at making homebrewed beer. It’s a long day of work, though hope it will pay off.

Getting into homebrewing did have a bit of an upfront cost since I had to get my hands on a bunch of equipment that I didn’t have at home. Luckily, my father used to brew back when I was a kid and still had someof his old equipment. It wasn’t much, but every little bit helps in getting started.

Although I was really excited to get brewing, there’s a bunch of upfront work that needs to be done before the fun can actually happen. All of the equipment from my parents was pretty dirty and needed to be cleaned quite thoroughly, as well as sanitized. I chose to go with bleach as my sanitizer of choice, but it was worth it. I initially thought the buckets I had inherited were just stained, but the dark coloring inside my buckets was actually dirt which got removed during the sanitization phase.

After everything was clean, I was finally able to get to the brewing. This included a bunch of waiting for things like boiling water which will be used later for ensuring I have a 5 gallon batch of beer. I did need to watch a lot of pots to see if they would start to boil, which wasn’t too exciting.

Once I was finally able ready to start making my wort, this is when it got intersting. My brew consisted of some grain as well as malt extracts, so I had to steep the malts (similar to making tea) for a while. After steeping my malts and adding the extract I was then ready to get everything setup for adding my hops.

The final step in the preparation of the wort was to remove it from the heat and rapidly cool it to prevent something called a ‘chill haze’, which is really more of a cosmetic problem. I didn’t have much ice and wanted to get the wort cooled faster so I took a risk and stirred it around the pot. This might have been a bad idea, since I may oxidized the wort, but I tried to be as careful as possible, so I’m fairly optimistic.

Last steps were to aerate the wort by passing the wort and water mixture between the pot and the fermeter then add the yeast.

Now with my beer sitting in my closet away from any cats and light, I wait and hope that it’s going to be as good as it smells.

© 2011 Christopher Saunders Suffusion theme by Sayontan Sinha