Sunday, 26 December 2010

atoi do it yourself

This interesting post came up on my twitter feed today. Given it's the holidays and I have now finished my PhD, I don't know why I read it, but I did.

You can find it here

But in essence this is a discussion on how to convert a string to an int without making use of the built-in tools to do this - in fact, in Python, this is usually as simple as casting;

a = "1234"
b = int(a)

but in this blog we are shown how to use the ord method to get the int value of each character, then multiply by 10, 100, 1000 etc depending on the position in the string.

Happy Christmas everyone!

Tuesday, 14 December 2010

Some other discoveries from today, which I forgot to mention...
These are all software related, and since I'm a mac user, they're all mac applications, which came via the cult of mac top 50 mac applications.

One: Caffeine - this little program sits in your menu bar doing nothing - until you click it. Then, activated, it will prevent the screensaver coming on, or the screen dimming, until you click the icon again. Perfect for watching an iPlayer or other long video.

Two: Coconut-battery - this app gives a full breakdown of not only the charge on your battery, but the battery condition relative to when you purchased your mac. A great little tool, especially on the older macs which didn't come with a battery "for life" like the new ones do.

As you can tell, today isn't the most productive.
I've discovered some pretty awesome things today.

One: When you are only a few days from submitting your thesis but you're waiting on comments, it's a great feeling. No work to do!

Two: Fine-tuning references is strangely rewarding. For instance, I've added astro-ph numbers to all paper's that are on arxiv.org, and updated any which were previously arxiv papers but are now published. Satisfaction.

Three: Free tiramisu and mince pies make my day

That will do for now. Still on target to submit before this weekend. Out.

Tuesday, 7 December 2010

Count your LaTeX blessings

I discovered today that I wanted to do a word count on my thesis. Given that it's written in LaTeX (the brilliant typesetting software), this is more tricky than you might imagine.

However, I found (with very little Googling) that TeXcount will do the job. You can even download the perl script and run it on the command line. Brilliant!

Friday, 3 December 2010

Beginnings

This is my first blog post. So I will leave it short and sweet. But if you somehow have stumbled across this page, feel free to check out my twitter. Posts are mainly football/computers and ranting.

I'm about to submit my PhD thesis in 2 weeks' time, so hopefully the ranting will cease after that.