Meet the elements by They Might Be Giants

September 9th, 2009

From the new They Might Be Giants kids’ album, Here Comes Science.

More mtDNA

July 31st, 2009

I little while ago I wrote a layman’s overview of mitochondrial DNA. David, over at The Atavism – who actually knows what he is talking about which it comes to all things mtDNA – has written an excellent piece on the topic where he goes into the nitty gritty of the inheritance of mutations (good, bad and neutral), discusses how these mutations provide an important piece of the puzzle showing our common ancestry with the other great apes and monkeys, and even reveals a dirty little secret he’s been keeping all these years. Go check it out.

How to delete all .svn directories

July 30th, 2009

In Linux, if you want to remove all .svn files and folders within a directory, navigate to the directory in your terminal and use:

find . -name ".svn" -type d -exec rm -rf {} \;

Credit

Programming with VIM

July 28th, 2009

vim

For years now I’ve used IDEs like Visual Studio and Eclipse occasionally falling back to plain text editors like GEdit or Notepad2 when making quick changes. I’ve been running Linux for almost three years now and, as you do when dealing with remote servers, have sometimes had to edit text files via the console using VIM.

VIM has been around for 18 years and is an extended version of VI which has in turn been around for 33 years. VIM = VImproved. It’s a console-based text editor designed on the assumption that you will only ever be using your keyboard (kiss your mouse goodbye) which means that much of the most common functions are based around the home keys (‘asdf’ and ‘jkl;’) and it’s packed with great programming features.

But the learning curve is about the steepest I’ve ever come across.

I decided a couple of months ago to make an effort to get to grips with it and it took a good four weeks before I was matching the programming speed I was used to with Eclipse. But now I’m finding that my speed is continuing to increase and there is no way I can go back now. It’s not the be-all-and-end-all though; if you are writing a document from scratch (like this blog entry) then VIM doesn’t really have much to offer but if you are editing an existing document (as you often are when programming) it’s streets ahead of IDEs and text editors.

One of the hardest things to get your head around is the fact that VIM is modal which means that you switch between typing stuff and doing stuff to existing text. By default you are not in ‘typing stuff’ mode and so when you type the letter w it’ll skip to the next word. If you want to add text you have to press i and then press Esc after you’ve finished to go back to ‘doing stuff’ mode. For example, to copy an entire line, paste it below, move to the new line, skip three words along, delete the remaining text on the line and start typing, in VIM you would type yy, p, 3w, c$ but the equivalent in a text editor would be to press Shift-End, Ctrl-C, End, Return, Ctrl-V, Home, Ctrl-Right, Ctrl-Right, Ctrl-Right, Shift-End, Delete and then start typing. Those key combinations may seem strange but, once you are used to them, they make a lot more sense than having to constantly move your hands away from the home keys. Especially on a laptop!

VIM is free, open source and is available for AmigaOS, Atari MiNT, BeOS, DOS, MacOS, NextStep, OS/2, OSF, RiscOS, SGI, UNIX, VMS, Windows, FreeBSD and Linux. If you are a programmer or edit plain text on a regular basis I recommend you give it a go but be aware that the curve is about as steep as curves get. If you decide to try it out I can also recommend this website to get you on your feet.

Alternative Medicine ER

July 15th, 2009

Sign up to Sign On

May 30th, 2009

Sign On - The World Needs UsThis week saw the launch of the new Sign On campaign. The essence of it is that world leaders are meeting in Copenhagen later this year and by signing up to Sign On we are letting John Key know that we want New Zealand to agree to set a target 40% reduction of emissions by 2020.

The reasons I support this campaign are threefold:

Firstly, the science behind the need for a 40% reduction is clear and strong; anything less is not going to be enough.

Secondly, I don’t have the willpower myself to achieve a 40% reduction and I believe this is one of the roles governments perform; to constrain some of our harmful and selfish urges and to reward behaviour that is mutually beneficial.

And, finally, I see great technological opportunities for our civilisation should we find the motivation to innovate. I’m confident we’ll come up with energy, transport, agriculture and production technologies far superior to what we have now. We just need the will to do so. As I heard someone say, the bronze age didn’t come about because stones became scarce; bronze was a better technology. I think that there is another age waiting for us beyond the oil-and-deforestation age.

I also like the fact that the campaign is saying nothing about how we ought to go about achieving a 40% reduction. That can wait. First we need the will to make a commitment and then we can act on the best advice from our scientists, politicians and economists to see how we will best achieve this target.

So, if you share my opinions on this, head on over to the Sign Up website and add your name to their list of participants. And perhaps let your local MP know where you stand on the issue too. Hopefully enough people will step forward to let our prime minister know that we taking this seriously.

Blogosphere observations

May 21st, 2009

social_media

How to run a half marathon

May 10th, 2009

Last year I entered and completed the Auckland Half Marathon. When I started training I could barely run non-stop for 10 minutes but by the time the day of the event rolled around I was able to run the entire 21km without stopping or being hospitalised.

This year I’m doing it again and trying for a better time but thought I’d publish the training regime that I found so useful on the off chance that someone else reading this might benefit.

The essence of the regime is to build up the strength of your muscles in small increments with plenty of rest in between challenging runs to give your body time to heal properly. Most of the runs are only minimally more challenging than the previous ones but the general idea is that you should be able to comfortably chat throughout most of them. It’s a good idea to have an event to work towards and to start the regime 14 weeks out from that event.

Tue Thu Sun
01 10 10 15
02 10 10 20
03 15* 10 20
04 10 10 30
05 20* 20* 40
06 30* 20* 50
07 20 30 60
08 30* 40* 80
09 40* 50* 90
10 30 30 60
11 30 30 100
12 40* 60* 120
13 30* 40* 90
14 20 20 Half marathon!!

All figures are in minutes. Run as slowly as you like but try not to stop. Days marked with (*) indicate hilly runs for building up extra strength (optional). Don’t run if you are sore and think you might do yourself damage. Get some good running shoes and perhaps lightweight shorts and a shirt. Don’t worry about missing some runs but try to keep up with the Sunday ones.

Good luck! It’s totally do-able and you’ll feel pretty amazing after having completed it.

First encounter with the recession

May 8th, 2009

In the last week I’ve encountered my first real taste of the recession. One of my clients went into receivership and liquidation last Friday owing me $18,000 and it’s unlikely that I’ll be getting anything once they’ve liquidated their assets and paid off their secured creditors, etc. And to make matters worse I’ve had to pay around $5000 tax on it because a large portion of it was declared as earnings in the last financial year. I can’t claim that tax back until I can prove beyond doubt that I’ll not receive the money owed to me which will take at least a year.

Still, I have my health, my family, my friends and my home. And it’s only money at the end of the day.

The scientific method paraphrased

May 6th, 2009

Neil deGrasse Tyson succinctly sums up the scientific method:

Do whatever it takes to not fool yourself when trying to understand the world around you.

(Thank you Ken!)