Buying An iMac: The Waiting Game

Thursday, 11 March 2010

I almost bought the new 27” iMac when they were announced in October last year. Finally Apple had released the computer I was waiting for and addressed all the key issues that had prevented me from purchasing an iMac before, namely

  • Quad core modern CPU
  • Video input from an external source
  • LED backlighting
  • Larger screen

I even went so far as to ordering the super high end Core i7 version but wound up cancelling due to my finances that month. Since then I’ve been so busy with work and other projects that I never got round to ordering again.

Boom Goes the PC

A few nights ago my main PC that I use for gaming (and as a backup when we need more than one computer) stopped working. I had a poke around but couldn’t see anything wrong. I just don’t have parts anymore to go through replacing each component to find the problem.

Now my time is freeing up slightly and I’m ready to play a few more PC games and I have no computer to play them on.

The Waiting Game

So I need to get an iMac but its got to that point where I’ve waited too long. It’s a uniquely Apple problem that I can’t justify the purchase even though the system has only been on the market for 4 months. The best time to buy their products is as soon as they come out so they retain value and you ensure you always have the latest model.

I’m fully aware that the previous update was a major overhaul and as such the next update will be relatively minor but I still think it’s worth waiting a couple of months if they are going to bump up the CPU or graphics card.

MacRumor’s buyers guide suggests updates usually happen every 221 days. That means updates could happen around the 29th May. It’s awful having to wait that long but that’s the price you pay for a good computer.

Steam for MacOS Changes Everything

Wednesday, 10 March 2010

With the announcement that Valve is bringing Steam to MacOS it seems like a good chance to see how we got here and look at the importance of what is to come. When you take the average Windows PC and the average MacOS computer, all differences aside on a software level, they should be able to play the same games. The reason why Windows pulled ahead (or away) from other computer platforms in gaming is because of Microsoft’s introduction of DirectX with Windows 95.

DirectX Killed The Competition

By implementing their own proprietary layer in between the graphics hardware and game software, Microsoft were able to effectively stamp out cross platform development. OpenGL had been the standard way to program to 3D graphics chips since the 3DFX days and was an open source, cross platform standard - allowing developers to compile for any platform that the compiler would run on.

Microsoft were able to offer more advanced features and become intertwined with the graphics card manufacturers to such an extent that they now rely on each other very heavily. New graphics hardware generations are now released along side new DirectX software. The release of the Xbox in 2001 further solidified DirectX now that it could be used in the console space (albeit only on the Xbox).

During this time OpenGL, while making advances, was never able to catchup to DirectX and win over game developers. There were a few exceptions such as the more traditional PC developers id and Epic who actually released Linux versions of the Quake and Unreal series respectively.

Valve’s Engineering Culture

In the last few years Microsoft’s stock among enthusiasts has taken a nose dive and they have turned to Apple. It’s no secret in the development and tech community that Macs are the computers of choice. We all enjoy using them so much that we knowingly accept it won’t be possible to play the latest games under MacOS. The key developers and engineers at Valve will be no exception to this rule and it’s why I feel they were able to forge ahead with this new strategy. They want to be able to play their games on the best hardware and software on the market.

I also believe Valve’s strategy moving forward is to own as much of their stack as possible. This would include untethering Source and Steam from Windows and making it truly cross platform. Steam has seen such rapid growth in its users and platform offerings that to be reliant on Microsoft, who have been making their own plays in the digital games market, could be risky in the future. By making their store and primary engine cross platform they are guaranteeing their future.

Growing Mac Market Share

Valve aren’t ignoring the market share either. With strong growth among normal consumers in addition to enthusiasts and signs that Mac owners are more inclined to pay for software it is a market they can no longer ignore. Apple also have the mobile games market in the palm of their hands right now and although they control the storefront on the iPhone OS lets not forget that OpenGL games run on these devices too.

A Bright Future

I am ecstatic about this announcement, I always believed Valve would take the lead in this and other studios are bound to follow. It makes sense for a business side and an engineering side and guarantees a bright future for Mac gaming.

Dropping Wordpress and Moving to Jekyll

Tuesday, 09 March 2010

Wordpress as a blogging platform and general CMS is incredibly popular and it’s easy to see why. Creating a large, blog backed site is very easy and quick to do. There are also a wealth of plugins available to customise specific bits and pieces. But while attempting to streamline my sites over the last few months Wordpress has been the real dog I’ve been unable to budge.

The Problem With Wordpress

What was once the king of blogging engines had become a cumbersome legacy platform that I needed to maintain. For me Wordpress just doesn’t fit into my stack anymore.

  • My data was locked away in its massive MySQL database.
  • Some of the SQL queries were incredibly slow.
  • Switching hosts was a real chore and prone to serious error.
  • It’s written in god awful PHP which I no longer want to run as a module. I don’t run any other PHP apps on my VPS so it just adds bloat.
  • I need to take regular backups.
  • The whole thing is a memory hog.

Where To Go?

I have 5 years worth of posts in the database and hundreds of comments that I need to keep. I looked into several options. I wanted style flexibility, ease of posting and most importantly of all the ability to import all my existing data. I investigated many self hosted platforms but all the database backed ones such as Mephisto didn’t really solve my problems. As for the hosted solutions such as Tumblr, Posterous and Wordpress.com I didn’t see a clear way to maintain comments and permalinks. Thats when I started looking into static site generators.

Enter the Jekyll

Jekyll is a blog aware static site generator. You write posts in markdown files and they are compiled to clean HTML. You have full control of the layout and templates and there is no database in sight. It can be deployed to any webhost as the site generated is pure HTML with no dependancies.

The icing on the cake is that Github pages supports Jekyll out of the box, allowing pushes to Github to automatically generate blog posts.

How I Converted Wordpress To Jekyll

  • Permalinks are maintained because Jekyll’s pretty permalink option is identical to the Wordpress default scheme.
  • Jekyll provides a Wordpress convertor to bring all published blog posts over as HTML
  • By installing the Disqus plugin into Wordpress before switching all my years of existing comments were ported to their system. Disqus host your comments and provide a Javascript widget - perfect for static sites! If you maintain permalinks when porting over the comments fetched from Disqus will be the same as in Wordpress.

Thats the three main pieces of data that I need to maintain - finally blog independence!

Problems Encountered

Jekyll’s markdown to HTML convertor doesn’t like all my posts and I have had to spend a while going through and cleaning them up. 90% of the time this was because my Wordpress blog posts contained invalid HTML. This was easily the most time consuming thing.

I was well aware of this going in but you are basically writing a blog from scratch and relying on the post processing and template engine that Jekyll provides. This did allow my to use the excellent Compass framework and probably explains why the site looks at little minimalistic right now.

Would I Recommend It?

To normal people - no. There is simply too much low level blog building and a knowledge of web development and version control is really useful. If you are a developer or have a desire to control every aspect of your blog I believe this is the way to go. Writing posts in markdown and committing them to Github is such a nice way to publish. You also have the flexibility to leave Github and take your blog else where at any time.

Best of all I can finally remove MySQL from my server and unload the PHP module. I do prefer blogging this way as markdown almost encourages long form posts with its ease of inserting markup. I hope to be blogging more frequently from Jekyll in the future. Let me know if you spot any oddities along the way.

CouchDB - Top 10 Tips

Wednesday, 17 February 2010

  1. Read the book!! (can't emphasise this enough)
  2. Forget about trying to link documents together like tables
  3. Use the JSON hierarchy to define how bits of information are connected within documents
  4. Don't think about each document being a row on table
  5. Use a MapReduce to get the data out in the way you want
  6. Use keys in a MapReduce for sorting
  7. If you need key on something other than the uuid write a MapReduce for it
  8. Don't worry about putting too much into a Document because a quick MapReduce will just pull it all out for you
  9. Use a plugin like CouchRest-Rails which doesn't pretend CouchDB is a relational database
  10. Spend as long as you can designing and tweaking the structure of your documents

CouchDB - A Next Generation Database

Tuesday, 16 February 2010

Over the last few months I have been digging more and more into NoSQL databases. I initially tried several out but my focus remained on CouchDB because of it’s accessibility and well thought out design.

Everything in CouchDB has been very well planned out from a modern, web facing perspective. I’m specifically talking about the RESTful HTTP interaction with the database, the JSON document format and the ability to construct a complex MapReduce with pure Javascript. These all combine into the most credible alternative to traditional SQL databases.

One thing that has surprised me when moving from years of using relational databases is how much you need to change your mind set. Sure, everyone said I would need to unlearn what I already knew but it was still took longer than I was expecting. At several stages during my projects I felt I had finally turned the corner and had my CouchDB eureka moment but as I later found out I still hadn’t fully grokked it yet.

I will do a separate post with quick tips for those new to CouchDB.

If you are interested in giving it a try just go and install it and play around with the web interface. You can insert documents and write MapReduce views all with the built in web app! I highly recommend using <a href=”http://github.com/couchrest/couchrest”>CouchRest</a> if you are a Ruby developer and <a href=”http://github.com/hpoydar/couchrest-rails”>CouchRest-Rails</a> if you need Rails support.

Splitstate.com - Latest Gaming News

Friday, 15 January 2010

splitstate.com

I have been quietly working away on a new site for a little while and it’s now ready for public access. Splitstate.com is a gaming news site that delivers the most popular stories from across the internet right now on a single page. The hottest stories are always at the top and only highly reported items make it onto the page.

I hope you check it out and bookmark it if you think it’s useful.

Ruby: Convert Relative URI to Absolute

Monday, 21 December 2009

Just discovered this today but the URI concatenation in Ruby is fantastic. Fantastic to the extent that you can take a host URL add it to a relative URL and produce an absolute URL for that resource. For example:

u=URI.parse("http://www.chart-track.co.uk/?i=756&amp;s=1111")
a=u+"/assets/images/m/modernwarfare2hangson_797_2.jpg"
a.to_s
>> "http://www.chart-track.co.uk/assets/images/m/modernwarfare2hangson_797_2.jpg"

via Eric Hodel

Ruby 1.8: Convert Any String to UTF-8

Monday, 21 December 2009

For those of us who have yet to take the plunge into Ruby 1.9 it can be quite annoying to convert the encoding of a string to utf-8. I’m using couchdb so it’s quite important when bringing data in that it’s utf-8. Luckily there is a handy standard library called Iconv to help, so if you can’t guarantee the encoding of your data I recommend trying this little snippet to strip out the badness:

ic = Iconv.new('UTF-8//IGNORE', 'UTF-8')
valid_string = ic.iconv(untrusted_string + ' ')[0..-2]

via Stack Overflow

NoMethodError: undefined method `count' for Array

Thursday, 26 November 2009

NoMethodError: undefined method `count' for #<Array:0x9c0e3e8>

Getting this error like this when you deploy your Ruby on Rails app to a production server?

You probably need to upgrade the server to Ruby 1.8.7 like me :) Doh! Luckily <a href=”http://github.com/railsmachine/moonshine/commit/41eb65a37c3781b2e28d8434f95f1a1165c358b4”>moonshine</a> has it covered for this one, I just had to switch from using ree to ree187 in my moonshine.yml file.

Fedora 11 to 12 Upgrade Tips

Wednesday, 18 November 2009

This worked for me after a bit of faffing:

yum install yum-fastestmirror
yum clean all
yum install preupgrade
rm -rf /var/cache/yum/preupgrade*

Run the final line to blow away the upgrade cache if you run into any problems and need to try again.

UPDATE: Oh and you might need to run gparted to resize your /boot partition. It needs to be at least 300mb!!