Thursday 27th
August 2009

1st Year at the University of Glasgow

I recently finished my first year at the University of Glasgow where I did Computer Science, Maths and Physics. I enjoyed it immensely and I cannot wait to go back in just over 3 weeks time (although I’ve still not decided exactly what courses I’ll be taking) when I’ll be doing Computer Science, Electric Engineering, C Programming under Linux and Exploring the Cosmos 2X.

This is an account of my thoughts about 1st year and will hopefully prove useful to anyone starting university soon.

Living away from home

University was exactly what I expected and hoped for. It gave me much more freedom, not just in terms of my eduction but my life too. Living away from home has been the biggest change and although I do miss my family, it’s been the most positive too. I’m not talking about the ability to do whatever I want or stay out as late as I want – my parents have always been very trusting and relaxed when it came to what I did. Being forced to be independent and do things for myself made me a more organised person. It increased my confidence and made me even more determined to succeed.

Student Halls

If you’re living in Halls, or even just a student flat, you’ll become accustom to all of these:
  • Alcohol
  • Drugs
  • Dirt
  • Noise
You’ll meet lots of people you can’t stand too. I’m not a big drinker. I’ve never done drugs. I can’t sleep with lots of noise and I like things to be clean and tidy. For anyone like me student halls sounds like a nightmare, but you know what? I loved every minute of it! You’ll meet lots of people. Some of them you’ll hate. Others you’ll get on with and, if you’re lucky, you might even find someone you love. Drink, drugs, noise and dirt are all part of student life. Alcohol will be all around you almost every day. You don’t have to drink it if you don’t want to. I didn’t encounter anyone trying to sell me drugs, although there are obviously people who are on them. Noise and dirt, on the other hand, are something you’ll just have to get used to. Most people will be living away from home for the first time and some of them won’t remember to shower every day or, in some cases, every week. Keeping the kitchen & bathroom clean, washing clothes and changing the bed just proves too much for some people. Keep yourself clean and tidy and with a bit of luck the people around you will do the same. A little push in the right direction here and there – a comment about the pile of unwashed dishes at the sink or how messy the bathroom is can help but it doesn’t always work – they’ll quite possibly hate you because of it – but sometimes (and more often than not) they’ll apologise and clear up their mess.

“Mum, what’s for dinner?”

It’s a line that I got far too used to blurting out at home. For my first night in student halls, when my tummy started to rumble, I was left thinking: “What the hell do I do now?”. I could cook my own food easy enough – that wasn’t my problem. It was the daunting task of making myself 3 meals per day, every day and doing the dishes afterwards. On top of all that, I actually had to go out and buy the food and ingredients too! Somehow I survived though. Feeding yourself isn’t as difficult as you’d think and after a while you get used to it. Depending on how brave you are (and your budget) you might even start to investigate and try some more adventurous dishes than pasta or baked beans – the hardest part is usually just getting together the ingredients and equipment you need.

Lectures, labs, workshops

Lectures won’t teach you everything, in fact they won’t teach you very much at all. The real learning is done in preparing for, and during, labs and workshops (I’m talking as a science and maths student here, other subject areas, such as English may be different). I’m not saying that you shouldn’t go to lectures, they are still very important and you should attend them as often as possible. However, you wont fail the year because you missed one or two lectures. What they do provide you with is all the information you need to complete the labs, workshops and coursework. The notes you take in lectures are the basis of your learning. Don’t neglect lectures, you wont know what to do in labs, miss workshops and when exam time comes running along you’ll find yourself begging others for notes. Labs are what taught me the most. Preparation for labs is important. Before a Computer Science lab I generally complete most of, if not all of, the set work for that lab. Why? Because labs are where you have most access to help. Work out problems before you go, find your weaknesses. You can ask as many question as you need and get help, not only from your tutor, but from the other people in your lab too. Workshops are small tests done either at home or, for the majority, in class. They count for a percentage of your overall grade and are definatly work working for. Consider these as a chance to bump up your grade without too much work. They serve as great examples of the sort of thing you can expect in the actual exam.

It’s lots of work

Student life really is a lot of work. University is hard and if you want an easy ride then it’s not the place to be. You can do nothing all year, skip all your lectures, miss workshops and labs, get drunk every night of the week and sleep during the day – you’ll have the time of your life – but you’ll probably fail. It’s ok to have fun, go out drinking and miss a few lectures here and there. All work and no play would make life suck. It’s not, however, a good idea to treat every week like its freshers week.

Good luck

That’s all I have to say. I loved first year and if you’re about to start University I hope you do to. I hope to write up a review of 1st Year Computer Science at Glasgow soon and go into some detail about the course but for now I’m going to leave you with a picture of a really cute cat I found. Isn't it cute?
Wednesday 26th
August 2009

Ubuntu 9.10 – Karmic Koala

I run Ubuntu as my primary operating system and as far as I’m concerned it’s the best operating system out there for me. Linux has come a long way in the last few years, it has become a much more viable desktop OS – even for the computer illiterate, such as my parents – and although Ubuntu isn’t solely responsible for this, it’s certainly been a big part of it.

My Desktop The latest version, Karmic Koala, is scheduled for release in October. I’ve been running it for a little while now and although it’s still unstable, it’s very usable. Karmic finally brings the official build of Firefox 3.5 to Ubuntu which has support for HTML 5 video, the ability to tear off a tab to create a new window and a faster JavaScript engine. It also includes Canonical’s new file syncing and collaboration service Ubuntu One. It’s very similar to Dropbox and offers 2GB of storage for free or if you’re willing to shell out $10/month, 10GB. It’s limited to Ubuntu for now. One of the more controversial changes in Karmic is the replacement of Pidgin with Empathy. Empathy is still missing a number of rather significant features for the MSN protocol (file transfers, off-line messaging and chatting with invisible users) and there are a number of people who think that Empathy isn’t mature enough to replace Pidgin. Empathy’s biggest advantage over Pidgin was voice and video support for Gtalk and XMPP. Pidgin received these features in 2.6.0 so there’s a chance that the decision will be reverted before the official release in October. With 9.10 comes Gnome 2.28 and lots of small but noticeable changes. The most obvious is the removal of icons from buttons and menus. Gnome has always had a fetish for icons littering the interfaces – everything had an icon attached to it. The removal of them means less cluttered menus and smaller, more aligned buttons – perfect for small screens and netbooks. no-icons A couple of features have been added to the mouse configuration, specifically for touchpads. “Disable touchpad while typing”. To whoever added this I want to say thank you! It’s made typing on my laptop keyboard so much easier. “Two-finger scrolling” does exactly what you think it does; it allows you to use 2 fingers to scroll anywhere on the touchpad. Just a couple of examples of small updates that make a big difference. Mouse Configuration Options One thing that has me very happy is the updated Intel video drivers. Compiz in 9.04 could get very choppy and slow at times. In 9.10 they have done an amazing job at getting it back up to speed and even my integrated intel video card handles the most demanding Compiz effect without a problem. It’s also now possible to run Compiz while using a combined resolution greater than the maximum texture size of your graphics card. Previously Compiz would stop working if I attempted to use my laptop screen and my 1680×1050 LCD monitor set side by side. The only way to have both working was to place one above the other, keeping the combined resolution within the 2048×2048 my card could handle. Now I can have both running side-by-side. If you want to get your hands of a copy of Karmic Koala and are willing to put up with crashes, bugs and potentially loss of data then you can find out more here or simply run sudo update-manager -d if you’ve already got Ubuntu installed.
Tuesday 25th
August 2009

Solway Optical

I’ve been working on a website for a Dumfries opticians, I think it’s coming along quite nicely.

Solway Optical

Wednesday 19th
August 2009

Project Euler

I discovered Project Euler a few weeks ago while searching for something to keep my mind (and programming skills) busy during the holidays. Its proven itself to be exactly what I was looking for — if a bit more challenging than I was expecting.

Project Euler isn’t for everyone. If you don’t have a fairly decent grasp of maths and the ability to do a bit of coding then you will struggle with the vast majority of the 250+ problems. These are not easy. Of course if you’re willing to learn and have enough determination then the first few should be well within your reach. One of the fantastic things about Project Euler is that many of the concepts you learn can be used later on as part of a solution to a much more difficult problem. This is a great learning experience and something well worth putting some time into if you’re interested in this sort of thing.

Problem 1

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples of 3 or 5 below 1000.
A very simple first problem to get us started. Arguably the most obvious solution is a bruteforce algorithm which looks at the numbers 1-999, checks whether they meet the desired criteria (divides evenly by 3 or 5) and returns the sum of the valid results. Below is my implementation of the algorithm in Python:
sum = 0
for i in xrange(1000):
    if ((i % 3) == 0) or ((i % 5) == 0):
        sum += i
print sum
Or in much less (readable) code:
print sum(x for x in xrange(1000) if (x % 3) == 0 or (x % 5) == 0)
Even using bruteforce it computes the answer comfortably inside Project Euler’s “one-minute rule”, it takes only 0.035s to run only my 2.2Ghz laptop. Of course there’s more than one way to skin a cat. Another solution is to sum all the multiples of 3 and 5 between 1 and 999 and subtract the sum of the duplicates, in this case all multiples of 15. This method is an example of the Inclusion-exclusion principle. Python makes this very easy to do thanks to the range() function (or xrange if you’re working with larger numbers and have the memory to spare):
print sum(xrange(0,1000,3)) + sum(xrange(0,1000,5)) - sum(xrange(0,1000,15))
This runs in approximately the same time as my bruteforce algorithm, there are much more efficient ways of calculating the sum of a series of numbers but I’ll leave you to discover them for yourself.