Saturday, March 31, 2012

Media center upgrades

I have a small form factor (SFF) machine on the way to take up duties as a media center machine. After waiting for long, finally pulled the trigger on a Foxconn Barebones Book sized system and 4G of RAM. I haven't ordered a hard drive - the plan is to run XBMC completely off a USB drive. As it is, media is on a 1TB external disk and the cost of 2.5" laptop HDDs has gone through the roof.

In terms of software, I've got to figure out which XBMC to use - the contenders are to either install XBMCBuntu or go with one of the specialized builds from OpenElec. I'm still new to both - so will need to do some reading up before I decide.

OpenElec

OpenElec has small footprint (100MB), customized builds for different chipsets. Its meant to be run from a flash drive - so it has a few optimizations to make sure that it doesn't clobber your flash drive. Also, the stable version of OpenElec based on XBMC 10.0 "Dharma" has native AMD Fusion chipset support. Its also designed to be self updating and from reading the manuals, boots right into XBMC and OpenElec settings are all accessed via a XBMC extension so you never have to drop down to the linux machine underneath it.

At this point, looks like OpenELec is really limiting. I would really love to run a browser, use the machine for torrenting etc - and somehow using the XBMC interface for all those doesn't sound too good.

Also, XBMC Eden is supposed to support AMD Fusion natively and OpenElec hasn't been updated yet for Eden (there are nightly builds available though that are based on Eden).

XBMCBuntu

XBMCBuntu is XBMC's official liveCD - you can use the live CD to install to another USB drive media and provided the system can boot from USB, you're off to the races.
The thing here is that it isnt specific to a 'flash' drive - so there's a small tradeoff in terms of the flash drive life. XBMCBuntu is based on Lubuntu 11.10.

Migrating the database

I also have to figure out how to migrate my XBMC database of movie information from Windows XP to the Linux setup - not sure if its even possible - but its something that's definitely worth a shot. In any case, if it doesnt work, then will just let XBMC rebuild its database overnight.

The hardware's supposed to come in april 2nd week - can't wait for it :)

Friday, March 23, 2012

Moved to bitbucket

I've been using Git Enterprise for hosting private repositories since github's free plan doesn't include any private repos. Git enterprise's worked - but the UI leads a lot to be desired the few times that you actually have to use the web interface.

So the other day while doing something else, I landed on bitbucket . Bitbucket is Atlassian's code hosting service - and for some reason I was under the impression that it only supported mercurial repositories. Was pleasantly surprised to see that not only can you have git repos, you also get unlimiited private and public repos with upto 5 collaborators all for the unbeatable price of free!

Can't ask for more - so it's Bye-bye Git Enterprise! and Hello! Bitbucket... Bitbucket also has a nice helpful repo import - plug in the url to your git repo and it gets cloned. Once that was done, it was a simple matter to update the origin url of my repo with


git remote set-url origin https://raghur@bitbucket.org/raghur/home.git

Thursday, March 22, 2012

Hey look! A flying pig!

:)

MS has added git support to Codeplex - who'd have thought that such a day would ever dawn.

Kudos to the good souls at MS who made this happen - One can only imagine the kind of conversations that would've taken place to get the necessary approvals for this :).

Still Git has great mindshare but native windows support is pretty bad. Hopefully this might even help making a good gui for git on windows. After creating an abomination like TFS, MS should realize the benefit of just going with openly available tools rather than create.

Maybe not - that's more like seeing a squadron of pigs flying!

Tuesday, March 13, 2012

Coffeescript looks promising

I've just ran across Coffeescript... can't believe what sort of a hole I've been living in.

It's a source to source compiler (ie when you 'compile' a coffeescript script, you get javascript source.)

So why would you want a source to source compiler for Javascript?
Well, as apps become more and more 'front-end' heavy with DHTML/Ajax bling bling, the javascript that holds all that together also becomes more and more complex. Yeah, sure you used Jquery (or 'insert your favourite js framework') - but that's not even scratching the surface. You're still writing tons of js code, and dealing with its idiosyncracies and tearing your hair apart.

Enter Coffeescript - clean syntax with elements of style borrowed from ruby and python, this is super clean and efficient. You write your code in coffeescript which is neat, clean and concise. What it generates is very idiomatic and clean javascript.

Let's try something - take a guess at what the following does:

    var Animal, Mammal, animal, farm, _i, _len,
      __hasProp = {}.hasOwnProperty,
      __extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };

    Animal = (function() {

      function Animal(name) {
        this.name = name;
      }

      Animal.prototype.speak = function() {
        return console.log("I am a " + this.name);
      };

      return Animal;

    })();

    Mammal = (function(_super) {

      __extends(Mammal, _super);

      function Mammal() {
        return Mammal.__super__.constructor.apply(this, arguments);
      }

      Mammal.prototype.speak = function() {
        Mammal.__super__.speak.apply(this, arguments);
        return console.log("and I'm a mammal");
      };

      return Mammal;

    })(Animal);

    farm = [new Animal("fish"), new Mammal("dog")];

    for (_i = 0, _len = farm.length; _i < _len; _i++) {
      animal = farm[_i];
      animal.speak();
    }
    
And now - see if you like this better:


    class Animal
        constructor: (@name)->
        speak: ->
            console.log "I am a #{@name}"
    
    class Mammal extends Animal
        speak:->
            super
            console.log ("and I'm a mammal")
    
    farm=[ (new Animal "fish"), (new Mammal "dog")]
    
    animal.speak() for animal in farm

The javascript version is the generated from the coffeescript version above . Head over to coffeescript.org page - they have an online interpreter where you can try out coffeescript code and it generates equivalent javascript source.


If you're wow'ed with that (I am) - and just in case you're saying good bye to javascript, here's the nub.. since its a source to source compiler, unless you understand what's going on under the covers, you'll hit a problem soonish when you have to debug something.

So, Javascript isn't optional - but if you have that bit covered, there's no reason to have to 'live' with the iffy side of javascript. Take a look something like coffeescript and have a little fun along the way.