Tuesday, January 31, 2006

In Sickness and in Health...

My last blog was on Friday afternoon, just before Alice and I went on our road trip, (Manchester&Nottingham->Cambridge->Kent->Cambridge->Reading->Stoke-On-Trent->Manchester&Nottingham.) I had a really good time on Saturday with Alice's family, and some of my friends from uni. Then on Sunday had a meal with a lot of other uni friends, before a quick trip to the pub, (so far so good), sadly was violently sick, (not alcohol related!) On Sunday and Monday, so not feeling so great now!

Still I did drag my self in for my supervision today... the supervision that is scheduled for NEXT Tuesday!!!!! I have been able to make some progress on some problems that I've been having with the robots, and will go to town on developing some interesting code for them tomorrow, along with a bit of report writing. I may even go in to the Dept first thing, as I can now actually make progress without needing to poke other people constantly!

It should be noted here, that Alice was FANTASTIC all through the weekend. She looked after me for most of Monday, and did all the driving, whilst I slept in a sleeping bag in the back!

This evening I'm going to start my first proper Eclipse program (in C++) and start writing a little prog that will teach itself how to play Cribbage. I'll start by writing a simple app that will try to score a given hand. If it ever gets finished, I will post the code on the projects page. I'm a little behind on that actually - so I may schedule some quality web-time at some stage!

Friday, January 27, 2006

Fire Alarm-tastic

I am so tired its untrue. Here is how my day panned out...

1am - Got to bed

4am - Fire alarm went off. I've never heard it before and ran round turning all my plugs off, thinking that it was coming from something I own! In my head I could remember plugging in a new alarm clock. Eventually, when I woke up a little more, I realised that this was a false memory that my brain had added to make sense of what was going on! Hall was evacuated.

4:40 - After 40 mins of being in the cold, I was allowed back in

6am - Fire alarm went off - hall nearly evacuated, but we were stopped by security who told us to just ignore it. I don't know what our security guard's hearing is like, but a 120db siren 2m away from my bed is pretty hard to ignore.

8am - Fire alarm went off. Only myself and three others bothered to get out of bed. We ambled around swearing in a sleep-deprived stupour and went back to bed.

10am - Having decided to have a lie in to make up for my lack of sleep, I was woken... by the fire alarm. I went to work to relax!

Supposed to be driving to Cambridge this evening... I think that I might let Alice drive.

Thursday, January 26, 2006

Sad Day

I went to a funeral today for a guy who I used to work with before I went to uni. He was in his mid-thirties, and died very suddenly.

I've been to several funerals but this one, more than most, carried with it a sense of unfairness.

My thoughts go out to his family and friends.

Wednesday, January 25, 2006

Why Linux is Rubbish

As part of my project, there are two, open-source simulators and control systems that one can use. The first is a Linux-only system called Player, (the control system) and stage, (the simulator.) The other can be used in either Linux or Windows, and is called Aria, (an API for writing control software) and MobileSim, (the simulator.)

I once wasted an entire day with a colleague trying to get player and stage to install and run properly. That day included reinstalling the operating system (twice) and then downloading the EXACT configuration of libraries that the highly brittle system needed to be perfect before it would run.

In a day I had downloaded Aria for Windows, written a simple app, and was able to control the robot in the simulation. "Brilliant" I thought, "I just need to recompile it and everything will work."

Oh, how foolish these words seem now. First of all, there was the business of installing all of the right software on to the Debian machine. Most of the things we wanted went on fine, but Aria, only comes as an rpm - and Debian doesn't usually do rpms. Eventually we persuaded the rpm tool that it would be a good idea to help, (after it had complained about not being able to find a dependency that was exactly where it complained it wasn't.) We ran the simulator and all was well.

Then to recompile the program. Now it could be said that the command line shouldn't scare a PhD Computer Scientist, and it doesn't - I just don't understand why anyone would put themselves through it voluntarily!
First things first - specify an output, "-o outputProg". Easy. Now link to the Aria library... "-lAria" - great.

Compile....

"Can't find "Aria.h"" Dammit.... Ok, tell the compiler where all the Aria files are installed, (fair enough - had to do the same for Win)... "I\rar\rar\rar".

Compile...

"Can't find "aria.h". Aghhh - they should of just made it say "Linux doesn't do case-insensitive searching - good luck with that, bitch!" So I go through my source code and make sure everything says "Aria.h" not "aria.h".

Compile...

"Can't find library Aria". Hmm - now this one has me stumped... I must need to specify where it is change "-lAria" to "-l/rar/rar/rar/Aria"

Compile....

"Can't find library /rar/rar/rar/Aria" Dammit! A quick chat to our Linux guru, (don't even THINK about trying to use Linux without having a Linux guru to hand, try reading the dodgy documentation in the Vim editor and see why!) and he points out that you can't specify where libraries are with that - you need to tell it where to search. Change "-l/rar/rar/rar/Aria" back to "-lAria" and add "-L/rar/rar/rar"

Compile...

Compiled!

OMG! It compiled - praised be. Now to run it... No not just the output file name - you need a "./" in front of it... "./outputProg"

"outputProg Running...
Doing init...
Doing comms to robot...
Segmentation Fault"

Aghhhhhhhhhhhhhhhhhhhhhhh!!!!! There are few things that fill my heart with more dread than a Linux command prompt bearing the words "Segmentation Fault".

So I try to debug. First of all I need to recompile again, adding the intuitive, "-g" option to tell it to include debug info. Then I try to use gdb... Not on your life - If God had wanted us to debug at the command prompt, he'd of given us massive wings, so we couldn't hurt ourselves when we finally gave up and threw ourselves out of the window. No - its time to install another program. Firstly I try xxgdb - the visual front end for gdb - sounds great! Install..... run.... open program.... run program.... Segmentation fault occurs in the same place - good. Put in a break point..... run. Yup, we're stopped. "Step" to the next line.... Its stepped INTO the function, and because its open source code, it keeps on stepping, and stepping and stepping AGGHHHHHHHH why would you not have a "step over" button, or a "step out of" button????!!! What was that nice looking one that I've seen the guru use? ddd, that's the one! Install..... Add program..... run... Step... IT'S ONLY BLOODY STEPPING INTO! I look frantically for another button - but no. So I go through my code and add breakpoints to EVERY LINE and then use continue... Except that the fault isn't happening in that file, its happening in another. Time to open a different file... file, open source.... aha - a list of available files... Where's mine? hmmm - I know that its called X , but the list goes straight from W to Y....

Oh, God No....

Oh my....

But the list is huge, surely it is...

No, it isn't sorted in any way shape or form. I actually have to click through it!! Ah ha - a filter box thank goodness.... Except the filter box is read-only, its just there to get your hopes up! But no, you have to scroll through the list manually - I can hear the voices of greasy-haired Linux programmers, that will never reproduce, saying "that'll teach you for trying to use a GUI you Windowsy Bastard".

I'm still yet to track down the problem. But I wrote a different program from scratch that doesn't do anything clever with the robots, except make them spin round on the spot for 10 seconds and then stop. Except of course the documentation was wrong, and despite the assurances of the websites, in the version of Linux I have, "sleep(X)" X is specified in SECONDS not milliseconds as it is in the rest of the world.... Excuse me, I have to attend to a robot with sea-sickness after 1000 seconds of revolutions......

But that's why Linux is rubbish. The GUIs are designed by Windows-hating zealots that seem to be out to get you for not using the almighty Bash; the libraries change more often than a Linux programmer's pants, (almost 6 monthly cycles) ; and the delicate stack of dependencies collapses around your ears as your mp3 player needs version X and Y, but the compiler needs version T and V but.......

Of course it has improved security! For a start, you couldn't guarantee a Linux virus would be able to find the libraries it needed on EVERY machine, and once you had access to your Linux Zombie PC, you'd have to overcome the ultimate security challenge... Getting Linux to actually do what you want.

I shall persevere, and one day I shall have a working robot in Linux and Windows. But for now, I'll be sticking with Bill, because the words/phrases that he doesn't understand like "security" and "unfair monopoly" have been lost to make room for his extensive definitions of "user-friendly" and "uniform".

Get stuffed Tux, come back Clippy, all is forgiven, yes it does look a bit like I'm writing a letter doesn't it....

Monday, January 23, 2006

Change of Settings

I've enabled the ability for anyone to add comments without needing a user account!

See the below blog - and add comments!

Comments

A couple of people have recently admitted to being closet boB-blog readers. So I tried to think of a way of encouraging people to leave comments. I know that it involves a scary registration process - but it doesn't hurt - promise!

So - how can I achieve a higher number of comments? I could take a leaf out of Scott Adams' book, and make some obviously contraversial comment and dare people to prove me wrong?

But instead I shall draw upon the medium of comedy!

In a recent conversation with a friend, we started discussing useful "cover-all" warnings that you could put on random products, to prevent ridiculous law-suits being filed by greedy morons.

My suggestions include:
"Warning - you may be too stupid to use this product, you do so at your own risk"
"Warning - the voices in your head are not 'experienced power-tool professionals'"

What can my non-existing public come up with?

"Warning - posts asking for comments that are blank 6 months later could be potentially embarassing....."

Friday, January 20, 2006

Settling In

Well - I'm back on the internet and free to pollute my web page with my mindless drivel. Although I am encouraged by the fact that a couple of people have actually admitted to reading my blog!

I've recently moved to The University of Nottingham to start a PhD in their brand-spanking new robotics lab. It's the end of my second week now and so far it's all been a good experience. The first week was largely consumed by fighting the many-headed beast that is university bureaucracy. For the most part things were ok but, as usual, one department, (not named to protect the innocent - i.e. me) let the whole thing down, and resulted in days of me trying to figure out what went wrong.

This week has been distinctly more productive, (I think that all of the admin stuff is sorted now) and I'm starting to read papers and play with simulations. Sadly not in my office though, as a key shortage has resulted in me only being able to be in my office, when my the guy I share it with lets me in! I do have a key, for a different office, that I may or may not be moving into next week. :) The upshot is that I've decided to work from home until the whole office fiasco blows over! Speaking of which - evil plans for world domination don't just think themselves up, you know! Back to reading papers!