Azure table to json with jQuery

I have been working with Azure quite a bit lately. We are looking to move all our hosted servers “into the cloud” – wherever that may be… Anyway, I have been working on a simple asset management system and I just started to implement the Azure Search API. I wanted to seed the index with existing data about the assets but I couldn’t see any easy way to export a list of the files in the container. Google to the rescue!

My search found a great post by Dave Ward on extracting data from an HTML table using jQuery. It is a pretty simple little snippet but it works quite well:

var data = $('#__fx-grid3 tbody tr').map(function() {
  // $(this) is used more than once; cache it for performance.
  var $row = $(this);

  return {
    name: $row.find('td:nth-child(1)').text(),
    url: $row.find('td:nth-child(2) .fxs-copybutton-value').text(),
    creationTime: $row.find('td:nth-child(3)').text(),
    size: $row.find('td:nth-child(4)').text(),
  };
}).get();

Use the snippet in the container details page and it will pull the name, url, etc. from the table. Now you’ve got the table data stored nicely in a local variable named data – but how to easily get at it? A little more googling found another simple little trick:

copy(data);

This will copy the data variable value to the clipboard. Now it is a simple paste into whatever text editor you favor. The above may be Chrome-specific, but if you are a web dev then you are likely using Chrome anyway – or at least have it at your disposal…

HTML 5 Video Codec Debate

My co-worker sent me an interesting article from Ars Technica about the current HTML 5 video codec stalemate over whether to use Ogg Theora or H.264 as the de facto video standard. I don’t know much about either, but it is an interesting read and both sides make valid points.

My 2 cents on the whole thing is why choose anything that requires royalty payments (H.264), as MPEG LA are looking to collect licensing fees starting in 2010. Worse than that, these fees may be a whole lot:

The language used in the current license treats Internet streaming just like over-the-air television, implying that the licensees will have to pay broadcast fees per-region. That could prove to be extremely costly for Internet video providers who make their content available around the world.

Theora is open source and currently free from any subversive patents (or so it seems), but there are questions about the validity of that “freedom”. Either way, I am sure the big video players (a la YouTube) will wind up determining which wins the “format war”.

I do wonder why the HTML 5 spec cannot support both? I am sure that is not ideal, but couldn’t it work similarly to <object> and <embed> tags?