Author Archive

HTML5 – Browser Ability

April 14th, 2010

Doing a quick test of the major browsers (on OSX Snow Leopard) and of the 160 HTML5 features tested these are the scores:

Chrome 5.0.342.9b 137
Safari 4.0.5 113 (this is the score I got on Chrome Windows which suggests an older version of Webkit)
Opera 10.10 38 (I expected much better from Opera as they’re normally very quick to implement)
Firefox 3.6.3 31
IE8 19
Browser HTML5 Support Comparison Chart

Well that’s a bunch of fascinating numbers. I think we can take away from that a simple fact: Internet Explorer is shit.

Test your browser with HTML5Test

8 Code Snippet Sites

April 11th, 2010

Code SnippetSnippet sites first cropped up as a way of sharing code with others in IRC and forums where formatted code with syntax highlighting wasn’t practical. Since then they’ve grown to provide version control, sharing and other features. Here’s a quick list of the major players. Personally – I’d recommend Github.

dZone Snippets

Part of the massive dZone network who also run jobs boards, social news, etc.

  • URL: http://snippets.dzone.com
  • Pros: huge membership, massive selection, solid brand.
  • Cons: interface needs improvement.

Snipplr

  • URL: http://www.snipplr.com
  • Pros: Huge selection of snippets.
  • Cons: suffers from spam and neglect.

ByteMyCode

Only a small selection compared to the others mentioned earlier. Nice looking site though.

  • URL: http://www.bytemycode.com
  • Pros: interface
  • Cons: small numbers

Snipt

  • Pros: clean interface and easy sharing features.
  • Cons: not a huge database.
  • URL: http://snipt.org

PasteBin

One of the oldest services on the net and you can tell with a mature set of features and large database.

  • Pros: plugins for various browsers.
  • Cons: Not much.
  • URL: http://pastebin.com

Pastie

A Rails app and I suppose the opposite to dpaste below.

  • Pros: Clean, basic.
  • Cons: Basic.
  • URL: http://pastie.org/

GitHub Gist

For a relative newcomer this service has grown massively. It helps to be a part of one of the largest developer communities on the web – Github. Not only do you get to put your code snippet up but its also version checked too – using Git obviously.

  • Pros: Each snippet is also a Git repo.
  • Cons: Not as feature-packed as other services like Pastebin.
  • URL: http://gist.github.org

DPaste

Purely for sharing code and originally developed by and for Django developers.

  • Pros: Simple.
  • Cons: VERY simple. Snippets deleted after 7 days.
  • URL: http://dpaste.com

Comment Multiple Lines in Vim

January 5th, 2010

Oh Look - The Vim LogoEarlier today I was asked how to comment out multiple lines in Vim. Unfortunately I wasn’t too sure what the best way was and the only one I knew felt less than friendly. Anyway – after some research I’ve nailed a few different methods and thought I’d post them here for people to choose their favourite one.

1. Visual Insert

This is the simplest method by far. Quick fire steps are:

  1. Ctrl + V (enter block-visual selection mode)
  2. Select the first character of the lines you want to comment out using “hjkl” or cursor keys
  3. Shift + i
  4. Type your comment marker: “//”, “#”, etc.
  5. Escape
  6. The end – there is a tiny delay as the comments are now put into your other lines.

2. Visual Search/Replace

This is similar to the above but has a slightly more arcane method to adding the comments.

  1. Shift + V (enter line selection mode)
  2. Select the lines you want to comment out.
  3. Type:
:s/^/# [Return]

or

:s/^/\/\/ [Return]

The first will replace the the beginning of the line (^) with a hash (#) and the second will do the same with a double slash (//). Note the extra slashes to escape.

3 Line Number Range

Similar to above this is the only method I could think of and its hardly very friendly but it gets the job done.

Pick the line numbers of the first and last lines you want commented – this is rarely simple.

Type:

:2,10s/^/#

That will put hash comments at the start of lines 2 to 10.

4. Using Markers

I’m not fond of this method as I’m still not 100% on markers. In fact I’m around about…..0% on markers as I’d not heard of them until now!! Woo for learning!

Anyway – markers. Oh yes, I’ll do a nice list of steps again:

  1. On the first line while in command mode type “ma” (no colon required here)
  2. Go to the last line of your intended block.
  3. Type:
:'a,. s/^/# /

In English that means: Form marker “a” to here (.) perform this command: s/^/# /

5. Plugins

You could just skip all that and install a Vim plugin. The advantage being they have more features. The disadvantage being you’d have to make sure all the servers you use have this plugin otherwise you’re stumped.

Chrome Extension: Shiny MPs

January 3rd, 2010
Chrome Extension Screenshot - Shiny MPs

Chrome Extension Screenshot - Shiny MPs

Writing extensions for Chrome is so refreshingly simple it’s exciting. So as a result I produced another one and this time for a slightly more specialised use. If you’re UK-based and interested in politics then this plugin will enable you to keep tabs on your MP with their latest parliamentary updates and links to further info.

If anyone had suggestions I’d love to hear them.

The extension: Shiny MPs

The Source: Bitbucket Hg Repo

The API used is developed by the great TheyWorkForYou.com

Chrome Extension: Augment Search

December 29th, 2009

Augment Chrome ExtensionJust released first Chrome Extension: Augment Search.

Its been heavily inspired by BetterSearch which is available on Firefox. I wanted this mainly for myself nut thought it’d be worth releasing to. Will hopefully be the first of many.

Get It

Download from Google

What It Does

  • Adds links to other search results pages for: Google, Yahoo, Bing, Ask, Reddit, Digg, Technorati.
  • Adds extra info links to each result: Alexa, Robotex DNS info, Web archive

Problems

If you have any problems with the extension leave a comment.

To Come

Much more goodies including an options page to customise what is shown.

Tabs vs. Spaces

December 1st, 2009

Every time I’ve seen one of these “vs” posts its gone into great length about the philosophy behind such and such.  You’ll never convince someone based on ‘religious argument’. So I’m going to take a different approach here and state who does what and hopefully the weight of ‘who does what’ will make the point quite clear.

Screw the Scientific Method!!

Language/Organisation Spaces Tabs Reference
PHP Pear * [1]
Zend (PHP) * [1]
Python * [1]
Ruby * [1]
Java * * [1]
.Net * [1]
C# * [1 Philips (PDF)] [2 - Microsoft]
Lua * [1]
Erlang * * [1]
Object Pascal * [1]
Adobe Flex * [1]
Ada 95 * [1]
Mozilla (Javascript) * [1]
Mozilla * [1]
Google * [1] [2]
Mono Project * [1]
Webkit * [1]
NASA * [1]
Apache (C) * [1]
Linux Kernel * [1]
Gnome * [1]
KDE Libs * [1]
Joomla * [1]
Wordpress * [1]
Zope * [1]
Django * [1]

Notes:

  • Tabs may be rendered differently on different editors and systems.  So they make for less friendly code sharing.
  • Its interesting to note that the ones using tabs all have histories of mental instability, cannibalism, Morris Dancing, witchcraft and heresy.

Clear win for Spaces, which happens to be what I use.

Epic Self Documenting Code

October 9th, 2009

This is the best:

switch (mIntegrationDirection)
{
   case InventoryIntegrationDirection.DoTheSameChangeInShop:
      DoTheSameChangeInShop(GetChangedDataFromInventory(mLastSynchDate));
      break;

   case InventoryIntegrationDirection.DoTheSameChangeInInventory:
      DoTheSameChangeInInventory(GetChangedDataFromShop(mLastSynchDate));
      break;

   case InventoryIntegrationDirection.DoTheSameChangeInShopThenDoTheSameChangeInInventoryForNotChangedDataInInventory:
      DoTheSameChangeInShopThenDoTheSameChangeInInventoryForNotChangedDataInInventory(
	   GetChangedDataFromInventory(mLastSynchDate),
	   GetChangedDataFromShop(mLastSynchDate));
      break;

   case InventoryIntegrationDirection.DoTheSameChangeInInventoryThenDoTheSameChangeInShopForNotChangedData:
      DoTheSameChangeInInventoryThenDoTheSameChangeInShopForNotChangedData(
	   GetChangedDataFromShop(mLastSynchDate),
	   GetChangedDataFromInventory(mLastSynchDate));
      break;

   default:
      break;
}

Read how this travesty occurred at DailyWTF

GMail Downtime: Affected Small Subset of Users?

September 25th, 2009

goog_mail_logo.pngNo it didn’t. According to a quote on the Telegraph website the GMail downtime affected only a small subset of users but if you look at the comments on the story it was hitting people in Florida, France, UK and Canada. That’s quite a big, “small subset”!

This is the second time this month – not good.

Django CMS

September 25th, 2009

New Django CMSFinally a Django CMS that looks stable and well built has been released at: http://www.django-cms.org. It’s sponsored by a Swiss compay which doesn’t bother me one bit (I love ….cheese and chocolate?) but the Americans seem obsessed with the idea of everything being American, tariff charges, protectionism, etc, etc, etc.

Anyway – this isn’t a political post so here’s a quick summary of the important points about the new Django CMS project:

  • BSD License
  • Hosted on GitHub
  • Original name: Django CMS
  • Features Summary:
    • Publishing workflow
    • Versioning
    • Multilanguage
    • Application architecture – similar to Joomla Components & Modules
    • Media management
    • SEO friendly
    • Flexible plugin architecture

All in all it looks promising so give it a go. I’m planning on setting up a few sites using it as I need something quick and dirty to use but also the ability to extend it. Being a young project this should be pretty easy. Django CMS

Seskelohots is Lonely

August 18th, 2009

I have no idea who this is but they commented about 4 months ago claiming to be lonely. They need a hug.

I’m the only one in this world. Can please someone join me in this life? Or maybe death - Seskelohots

With no spammy links posted I can only assume its one of the lonely racoons I mentioned that’s currently lost in Yorkshire.

shy-racoon.jpg

Is this Seskelohot?

Here:
Hug Seskelohot