One Thing All Laptops Get Wrong

I don’t understand why my laptop can’t play videos without sounding like a jet plane. My iPad can do it. My phone can do it. It looks to me like it’s actually a problem we’ve already solved. What is so wrong with x86 based laptops that playing video – even low-quality video from YouTube say – causes them to get really hot, really fast, which then causes the (annoyingly noisy) fans to spin at full speed? It seems to be the only thing they can’t really do.

Arm chips can decode full-hd video in real-time and stay at room temperature (which means no need for fans). It’d be great if laptop makers could figure out a way of including Arm chips along with the Intel/AMD chips so that video could be off-loaded. That’d be a really difficult task (from an engineering point of view), but I bet there’d be a way (maybe just regular old DMA or something — the Arm chip could work as a plug-in card though PCI-Express). I wonder why Apple don’t do something like this? It’d be a real selling point, and they have more expertise with Arm-based computers than just about anybody.

Maybe the Arm thing wouldn’t work, but either way, a few seconds ago I started a YouTube video playing and already the fans are making a lot of noise. Time to get the iPad…

Mojang Are Building A Game This Weekend And You Can Watch As They Do It

Right now, over at www.humblebundle.com, you can watch a live-stream video of the people at Mojang making a game in 60 hours. I’m not sure if they plan on sleeping or not :)

They’ve got a great atmosphere in the office, it looks like a good place to work. I don’t know how good the game will be once it’s done, but that’s not the most important thing this time — all of the money goes to some great charities.

I don’t play games all that much any more, but I really like what they do at humble bundle and I always buy the bundles.

Posted February 17, 2012 in Games

CQRS

This week I came across my first real-world honest-to-goodness example of a CQRS application. It works really well, and it’s very interesting to see a proper example of CQRS.

Even if you’re a full-time professional progammer, the chances are you won’t know what CQRS is. Martin Fowler explains it well in a blog post, though even after reading that you still might not be entirely sure what it really means.

So far as I understand, CQRS means updating your data-model using well-defined commands, which in turn cause events to fire, which in turn can be used to build a read-only view.

It sounds strange, and the name CQRS doesn’t help. I’ll be honest here and tell you that I can’t even remember what the acronym means, and even if I could it doesn’t really describe the mechanism that well [I just looked it up, and it means Command Query Responsibility Segregation].

Now, the idea of updating a model through commands actaully makes a lot of sense in many ways. It kind of ties in with the way you should do Domain-Driven-Development — you don’t want a bunch of properties and a Save() method, you really want operations that describe well-defined business goals.

As you execute commands against your model, events are fired. These events are used by the application to build a view of the data that meets a particular need. For example, let’s say you’re building an app for tracking used car sales. If you had a page that listed Prestige Used Cars, you might have a ‘NewCarListing’ event handler that only pays attention to events that involve cars over $30,000, and stores that data in a way that is custom-built just for that screen. It seems redundant, and it is, but the goal is to keep your domain logic pure.

As you read the last paragraph, you might have wondered how you could possibly build new reports based on commands and events that have already happened? Well, you keep a history of the commands, so you can replay them. [edit: I got a correction from @ToJans on Twitter that you actually replay events, not commands]. This strikes me as the place where any CQRS app is going to start getting overly complicated (compared to an equivelant solution, using an ORM for example), but in the example I saw yesterday (a definitely non-trivial application) it absolutely worked.

There aren’t many CQRS drop-in frameworks that you can easily use in your own projects, but there is a SimpleCQRS example project over on Gregory Young’s git hub page, and it might be worth looking at the Ncqrs Framework. Even if you don’t do CQRS in your own solution, just being aware of it is going to give you some good ideas that you definitely will be able to use.

Another Interview With Tim Schafer

Here’s another interview with Tim Schafer after the amazing Kickstarter project.

The most interesting thing he talks about, for me at least, is the size of budgets for various games. At $1.1M, Tim says they’ve passed the budget for Monkey Island 1 & 2 combined, passed the budget for Day of the Tentacle and passed the budget for the far more recent Happy Action Theatre. He goes on to say that Full Throttle was $1.5M, Grim Fandango $3M and somewhere between those two values are the budgets for Stacking and Costume Quest.

Bigger 3D action games typically have much bigger budgets. I’ve heard $15M mentioned for the original Psychonaughts, and an estimate of about $20M if they are to make a Psychonaughts sequel.

It’s pretty interesting to get a glimpse behind the curtain. To be honest, I’m just as excited about the behind-the-schenes documentary that’s being produced as part of the Kickstarter game as I am about the game itself.

Posted February 14, 2012 in Games

I Installed WP To Twitter

I just installed WP to Twitter on my WordPress blog. It looks by far the best plugin for connecting a blog to Twitter. It’s worth noting that I couldn’t find it in the plugin search screen, so I downloaded the zip file from the website and installed it that way.

You can consider this post a quick test to check it’s working :)

If you want to follow me on Twitter, I am @adrianoconnor.

Posted February 14, 2012 in Blog

What Can You Do With An EC2 Micro Instance?

Warning: This post contains some factual inaccuracies. I’ll fix it asap. I’m just trying a few things out on my EC2 servers and measuring the results…

The EC2 Micro instance is very reasonably priced. For about $40/month you effectively get a virtual private server with 1 small CPU worth of processing power, 680MB RAM and the benefits of EC2 storage (easily expandable to terabytes, can be moved between servers etc). That price is very competitive with any shared host’s VPC pricing.

So what can you do with one small CPU and 680MB RAM? Well, here are my very unscientific findings: You can run one WordPress blog, and two mid-sized Rails apps, and a good number of HTML-and-static-content-only sites. When I added a third Rails site, I started getting out-of-memory errors and MySQL would crash.

I think a very crude rule of thumb is 80MB for a minimally used MySQL service, 80MB for a WordPress site and about 160MB for a Rails site, and about 200MB for the system to do its thing. If some of those values seem big, don’t forget that a typical web site will create 10 instances to serve up to 10 simultaneous requests (that might not seem like many, but 10 simultaneous requests is actually enough to service hundreds, maybe thousands of concurrent users — they don’t take long, and when needed they just queue up).

My Blog Traffic

One thing that nobody tells you when you start a blog is how much traffic you’ll get. Or rather, how much traffic you won’t get. Maybe it’s just me, but I kind of hoped that when I started a blog I’d be writing for a loyal and vibrant readership from day one. Of course, that was a stupid thing to think, and I didn’t seriously believe it, but I was still disappointed when I added Google Analytics after a few months and watched the tumble weeds go rolling past.

I’ll quickly add that I am writing for pleasure (and practice), not traffic, but there is no denying that it is very nice to see some kind of tangible result. The only tangible result you can really see with a blog is traffic. Increased traffic hopefully means improved writing style (or more relevant at least), and that makes you feel good.

Anyway, if you’re a tech person, and you’re thinking of starting some vague, general and rambling blog (like mine), here are my figures for you to compare/compete against. I’ll just add that I started blogging properly about 5 years ago, but I deleted that blog and started this one in 2010. My old blog had lots of very technical posts (with plenty of sample source code and useful commands), and I got a disproportionate amount of traffic to one or two specific posts (80% or so of traffic went to a post about resetting passwords in Oracle — it lives at another blog I reposted it to). Those posts still get great traffic, mainly from good Google ranking, but they aren’t a useful measure. I just happened to answer a question that lots of people ask, and aside from their immediate pain they had zero interest in my blog. Bounce rate was something like 98%.

This blog is different. I so far have one or two disproportionately high-traffic posts (like this summary of the best things about OS X, and the corresponding list of great features in Windows), but the rest are pretty evenly split. For the month of January 2012, I got 629 unique visitors, 1,169 page views and a bounce rate of 75%. Not great, but it’s roughly a three-fold improvement over a year ago when I had just over 200 unique visitors.

So there are my numbers. After two years I have 629 unique visitors a month for the last full month. I’ll re-post my updated figures whenever they jump significantly — it’ll hopefully be interesting to plot over time and see how things change at least (especially if I can keep up the renewed pace since my re-design). If you want to get in touch, either to commiserate or gloat, feel free :) I’m mostly on Twitter these days. I turned comments off due to spam :|

Defeating Key Loggers with Snake Oil

This comes via John Gruber, who quotes a New York Times story about the odd security precautions a guy called Kenneth G. Lieberthal takes when he visits China. He calls out the fact that clipboard loggers are just as easy to install as key loggers. Here’s the relevant bit from the NYT article:

[He] copies and pastes his password from a USB thumb drive. He never types in a password directly, because, he said, “the Chinese are very good at installing key-logging software on your laptop.”

This is a moronic policy designed purely to make Kenneth ‘feel’ more secure because, at the front of his mind, he is worried about key loggers. Gruber is right — a clip board logger is just as easy to implement as a key logger, but this over looks one important fact — a program to steal files from a USB stick is vastly easier to implement than either a key logger or a clip board logger, because it doesn’t need any special system privelege.

Don’t write your passwords down and don’t store them in a file. I presume there’s some missing detail here — maybe he’s using a programme that encrypts the file with the password, the article doesn’t say, but even if that’s so, he still needs to descrypt it some way or another, and that means the key logger would be just as effective.

If you want true security and it is important (and justified), use one time passwords.