Other good reasons: the existence of Python, Ruby, Haskell, Smalltalk, …

There are many, many reasons why you should never ever accept a job which involves programming in C++ [via TR].

“Nothing interesting has happened in the last 20 years”, apparently

I delivered my first lecture, for CS-228 Operating Systems, 5 years ago yesterday. Today, TR delivered his first lecture — for, er, CS-228 Operating Systems. I’m sure he’ll do it very well, and certainly better than I, as he is both more informed and opinionated on that topic than I am. Well, on all topics, really… ;-) Welcome to the club, TR!

Visualizing regular expressions with reAnimator

reAnimator — a very cool tool for visualizing regular expressions. Given an RE, renders the corresponding NFA and DFA and animates acceptance (or not) of an input string. Try out the “a|ab|abc|abcd” example with input “a” for a neato example. A flash app, written using python.

5 glorious years of, er, rambling and mumbling and getting paid to do it

I started working in Swansea University’s Computer Science department five years ago today. Here’s the evidence. It’s been a blast, and the executive summary still holds true, somewhat amazingly. That is all.

Water! From the skies!

Water! From the skies! – Armstrong & Miller comedy gold on Youtube.

Just like a tutorial with Gimbo.

I used to love Armstrong & Miller — hit and miss, for sure, but when it hit it hit well. If you ask me what the funniest thing I’ve ever seen was, I’d tell you it was a sketch of theirs involving an undercooked steak, some surly chefs, and a remote-controlled car. Haven’t found it online yet, and in a way I hope I never do because it’ll be bound to be a disappointment now, but oh, the memory…

My eyes, they are burning!

One thing I’ve learnt, to my great surprise, while marking my students’ exams is this:

My handwriting, which I’ve always considered pretty bad, really really could be a hell of a lot worse.

*shudder*

Comparison of Haskell and Scheme

Here’s a nice comparison of Haskell and Scheme [raganwald]. Not a “vs”, but a thoughtful, informed, and reasoned look at a number of their respective features.

I’m still on my Haskell learning curve, and I can vouch for the incomprehensibility of monads. Thankfully I haven’t had to do anything yet that required actually understanding them, though I have used them… :-)

This paragraph grave me pause:

If you’ve got a class full of first year computer scientists, you can teach them to read and understand the full formal semantics of Haskell. You can make it completely non-mysterious. Everything can be explained by the standard lambda calculus α, β, and η rules, with no hidden complexities. It’s all remarkably straightforward.

In fact, it made me sigh, imagining first years getting formal semantics, lambda calculus, and even, well, Haskell. Another world…

Design patterns as responses to programming language deficiencies

We teach a third-year/MSc module called “Design Patterns and Generic Programming”. Instantiated by Oliver Kullman, and now taught by Chris Whyley, it introduces these topics in the context of C++ (and is, for most of our students, their first exposure to that language).

On Friday I suggested something to Chris which I’d been mulling over for a while, namely an “anti-patterns” lecture at the end of the module. It would be “anti” in two senses… First, a discussion of the idea of antipatterns: things to avoid. Second, and more interestingly, a discussion of the idea that patterns are just a stop-gap response (albeit a highly rational one) to deficiencies in your programming language, and that more advanced languages make them trivial or meaningless. Chris thought this sounded good, so now I’ve got to gather my thoughts. In timely fashion, along comes this piece (via raganwald) expounding the very same idea. (Disclosure: it’s not my idea, it’s something I’ve been seeing mulled over and expressed in varying depth and eloquence on the blogosphere of late.) This post is particularly interesting in that it looks for pre-GoF patterns, recognising that patterns aren’t a specifically Object-oriented phenomenom, but rather a general software development phenomenom, and we can excect to see new patterns in the future, as the patterns of today fade into the undistinguished background.

Tail call optimisation at Raganwald

I command all of my students reading this to go and read this piece on tail call optimisation. If you’re anything like me, you’ll need to read it at least twice, write out the ruby examples by hand so they actually enter your brain (maybe I just needed more coffee), and follow many of the links for further explanation. It will be well worth it. This man has intelligent things to say, with which it is worth being familiar, if not intimate.

Security Engineering: free to download

Oh, happy day! Ross Anderson‘s classic work “Security Engineering: A Guide To Building Dependable Distributed Systems” is now free to download. Yay!

This might explain why the publishers didn’t send me an inspection copy when I asked them for one about six months ago…

Bruce Schneier Facts

One for everyone who took CS-318 last year, or will be taking it next year: Bruce Schneier Facts.

(And if you don’t get it but want to, check out this and this.)

jobtimer.py – timing small repetitive jobs

It’s exam marking season hereabouts (and, thanks to the AUT industrial action, coursework marking time), so I’ve got my head down in piles of exam scripts.

One exam (on IT security) was a complete nightmare to mark – essay questions, loads of text, oh it just took ages. It really seemed to go on forever. At least I only had to mark half of it – but I really wasn’t looking forward to my other exams, to be marked all on my own.

Python to the rescue!

No, not a random number generator (though it’s sometimes tempting). Instead, a motivational tool: something to keep me focussed and “in the game”.

I have two problems when marking, basically: one is that when I’ve got a huge pile to get through, and it’s going fairly slowly, oh it’s sooo painful and you want it to be over, but it isn’t, and it won’t do itself, and, well, it’s all very antimotivational. The other problem is that I get distracted easily, so I’ll do a few, then chat, then do a few, then play Urban Dead for a bit, then do a few more, etc. Naturally these two problems feed into each other, and a snail’s pace is achieved.

It’s all mental – the issue is focus. Thus, we present jobtimer.py, a little script I knocked up in a hurry yesterday evening to help me stay focussed. And I gotta say, it’s proven instrumental in helping me hammer through the networks exams in record time.

Basically, jobtimer.py is a simple tool for keeping track of progress through a large batch of small repetetive jobs, where you want to know how long you’re spending on each job on average, and how many you’ve done so far. It has a simple text-mode keyboard interface, whose central feature is “you hit space to tell it you’ve finished one job and are starting another”. You can pause it, report on averages, and see how much time since you started has been spent “unpaused and working” (as opposed to “paused and playing Shartak, say).

It’s very simple: no persistence between sessions, no flashy graphics, and probably only works on Unix – it uses select() on stdin to catch keypresses; a Windows version could be hacked using msvcrt, I guess. The code’s not beautiful, but it does the job beautifully well for me.

Read the comment at the start of the code to see excactly how to use it. It’s dead simple.

Screenshot:

Screenshot of jobtimer.py in action

The clock starts ticking at 15:06:07; the first job takes 27 seconds, then 2 mins 5, then 1:42, then 2:51. 10 seconds into the next job (at 15:06:23), the clock is paused. 15 seconds later, it’s unpaused, and three seconds later that job’s complete. At 15:06:44 we hit ‘a’ to get a reading of averages/stats: 5 done, average 1 min 27, elapsed wall clock time is 7 mins 36, 96% of which has been spent with the clock ticking. Etc., etc. – you get the picture. Actually, looking at this shows me a bug/feature: when you quit, it doesn’t count the job that was just running – so end a job before quitting if you care about accuracy. :-)

Calmly seeking powerpoint diagram extraction tool

Does anyone know of a tool which can extract the diagrams from a Powerpoint presentation and turn them into something sensible and open, preferably SVG (but EPS or even PDF would do I guess)? Ideally a tool which can do this for all of the diagrams in a presentation in a single pass, but even a solution that requires manual intervention for each diagram would be better than nothing… Thanks!

Students: if you ever do this, you are compelled to commit seppuku

Lesson one in security: deny by default, allow with care. It is entirely brain dead for your login logic to be “if the logged_in cookie is false, they’re not logged in, otherwise they are”, rather than “if the logged_in cookie is true, they’re logged in, otherwise they’re not”.

The wacky world of Thorsten Altenkirch

The wacky world of Thorsten Altenkirch [via ping/will]

A blurry Thorsten Altenkirch at BTCTCS 2005

Cheers, Thorsten!

(For balance, here’s the perfectly sensible world of Thorsten Altenkirch.)

How’s My Teaching?

My students are invited to club together and buy me a How’s My Teaching? t-shirt. Charcoal grey or olive, medium or large, long or short sleeved, phone number as on my work home page, please. ;-)

Positive feedback

At the end of every module we teach, we hand out forms to all the students asking for feedback. One of my second year seems to be impressed, and made the following +1 Insightful comment at the bottom of his form:

Mr Gimblett’s lectures tell a compelling story. His office is full of leather-bound books and his apartment smells of rich mahogany.

Please would whoever is selling LSD to my students stop it?

Another great use for fixed-width fonts

Nice life hack which I should remember next time I need to, for example, arrange tutorials with my students…

Happy Anniverary, disciples…

I’ve just delivered the first lecture in this year’s CS-228 Operating Systems module, which makes today my kinda second anniversary as a lecturer.

Today was definitely smoother than that first time and was also (I hope) better than last year, too (though I had other things on my mind then, to be fair…). It was certainly more fun and relaxed, which always helps.

I am celebrating by drinking coffee and feeling knackered, probably because yesterday I worked from 06:30 to 12:30 and was then kept awake by overloud purring.

Hack Yourself

Hack Yourself [43folders].

ring.ruleAll() – reference ring not found

Relevant examples are of great help when teaching. I was criticised by students this year for overusing “foo” and “bar” as variable names in my C couse. More imagination is needed, apparently.

Here’s a prime example which I shall recommend to Mr Whyley that he use in his Object Technology course: Rings as objects. And the initial comment to which that one refers..

Courtesy of TR.

Swansea University gets rootkitted

Swansea University’s front page appears to have been rootkitted at some point over the last 48 hours [via davea]:

Swansea Uni Rootkit Thumbnail

w00t. I wonder if this has anything to do with recent hacks on the uni servers, or if it’s an unrelated incident…

(Ten hours later, Sunday evening, and the server is still 0wnz3d. I guess the concept of 24-hour cover doesn’t extend into academia. Hopefully the kiddies aren’t using the box for anything nasty, like spamming…)

Moaning about work again

Yesterday (a Sunday): at work from 2pm until midnight. Today, 10am until right now (00:50 the next morning).

I’m not spending this quality time doing research or catching up on my marking, so it must be time to exam team stuff? That’s right, kiddies. Joy… Or, to put it another way, sob.

However, my gift of a wife is hauling her purty self out of bed to come and pick me up. Don’t feel too bad: she wasn’t asleep, she was surfing the net and occasionally chatting with me. So that’s nice.

Operating Systems in Python

More project ideas for next year: further to this post about writing an operating system kernel in Haskell, it looks like some crazy dudes are doing similar things using Python. Ladies and gentlemen, we present: Cleese, and the delightfully-named Unununium [python-list].

Apparently Cleese started with the idea to “make the Python intepreter a micro-kernel and boot directly to the Python prompt.”, but it doesn’t look like there’s been any movement there over a year, and hasn’t released any files.

Unununium looks interesting, and very much under development. The introduction states that components and a unified filesystem namespace (a la Plan 9) are key goals.

OK, maybe all this is too flakey and out-there for a decent project, but nonetheless, nice to know it’s happening.

hOp – a micro-kernel based on the Glasgow Haskell Compiler

Wow… Potential third year project supervision material for next year: hOp, a microkernel based on the Glasgow Haskell Compiler, in which “experimenting with writing drivers in Haskell should be reasonably easy“. Funky as. [lambda]

Clockin’ out!

It’s five o clock and I’m leaving work. This is wonderful – the first time this has happened to me for weeks. Colour me cycling!

Smashing the stack for fun and profit

Phrack 49 article 14 aka “Smashing the stack for fun and profit”, a classic article on hacker techniques for the exploitation of buffer overflow bugs. I should consider talking about this in my C programming course – should get the more mischevious students excited, at least.

I was amused to note that the author calls themself “Aleph One”, which is also the name of a tape I put together about six years ago of the music I’d created up to that point. As it happens, I’m currently in the process of recording those tracks from the minidisc on which they currently live, and anticipate publishing them in Ogg Vorbis format (mp3s suck, people!) Real Soon Now.

I used the name because I’d been blown away by learning about infinite cardinals in my set theory lectures as an undergraduate. Aleph Zero is the smallest infinite number, equal in size to the number of integers that exist. Aleph One is the next one up, equal in size to the number of reals (ie decimals). It all gets crazy from there, and is somewhat explained here (where what they call Aleph Null is what I call Aleph Zero).

And here’s the proof

And here’s the proof that what I told you yesterday was true…

Me with Snowman, lecturing

Click the picture to see more of Swansea in the snow.

I’d just like to point out/emphasise, by the way, that I didn’t put the snowman there. Honest.

Frosty The Lecturer

Well, that was new… I walked into my Networking lecture this morning only to find an actual snowman on the podium at the front of the room. I wasn’t quite sure what to do but reasoned it’d probably last through the lecture so I left it there and sure enough, it was fine. Well, it need need a little preventative maintenance around about “Isolated Routing – Hot Potato”, but that done, he made it through, only to be rescued by a couple of second year girls and taken to his new home on the flower beds outside, there to melt in the sun.

Oh yes, forgot to say: it snowed last night. Car had four inches of powdery white fluff on it this morning – fun fun fun fun fun!

Wedding preparations continue apace… Bronwen (bridesmaid #1) arrives today, Bash is off work to meet her. It’s Bash’s mehndi party tonight, and I’ll be here at work burning CDs of music for the party & ceremony. Tomorrow I lecture 12-1 then we skidaddle to Cornwall. Party on Saturday, wedding on Sunday – wish us luck!

Dog Tired

I worked a 59 hour week this week. Highlights included ’til 10 on Monday, ’til midnight on Tuesday, ’til 3AM on Wednesday, and 7 hours today (Sunday). It’s been exam marking and mark-collating season, and I’m on the team that does this job in the department, so…

This level of craziness is unusual for me, thank God, but every week since Christmas has been full on (wedding preparations and house-related shenanigans (selling one, looking for another to rent) have helped fill the gaps nicely), and in fact, when one of the secretaries said to me a couple of weeks ago “ooh, it’s been really busy this week – last week was lovely and quiet, wasn’t it?”, I had to reply “Jill, I haven’t had a quiet week since <pause for thinking> – August”. Alas, it’s true.

Roll on the summer, that’s all I’ll say…