Archive for October, 2005

Little Man Computer interpreter in Ruby

Wednesday, October 19th, 2005

Today I wrote a Little Man Computer interpreter. I’m quite pleased with it.

For those who don’t know (almost everybody?), Little Man Code is a simple assembly-like language for teaching students. For example:

00 901
01 310
02 901
03 110
04 902
05 000

Which can be written in shorthand as (assume -- is comment syntax—which it isn’t):

00 INPUT  -- Get input and put it in the accumulator
01 STO 10 -- Store it in address 10
02 INPUT  -- Get input and put it in the accumulator
03 ADD 10 -- Add the contents of 10 to what's in the accumulator
04 OUTPUT -- Output what's in the accumulator
05 STOP   -- Stops execution

Very simple. We’re using it in Computer Architecture and Systems Software 2 (the return of the compiler?). I wrote 20 lines of it for coursework. And I’ll write some more of it.

Anyway, here’s my interpreter complete with examples and such: lmci_0.1.zip.

Even though it won’t be very useful to very many people, at least I had fun with it. And I learnt from it.

I ♥ Google

Saturday, October 15th, 2005

I was just looking through my Search History on Google to find a week-old query (the first time I’ve used it, but boy is it better than looking through Firefox’s history!) when I realised why all the URLs from searches are redirected—Google knows what sites I visit! The sites I visit are listed under the queries. I just think that’s so useful. And bookmarks! Why didn’t I notice all this earlier? I use Google dozens of times a day (I do, it says so in my search history; my record thus far is 39 in one day) and I’ve only just discovered the greatness of Search History.

Life is good

Saturday, October 15th, 2005

I’m sitting here at home. Most of everybody’s out. Mike and his girlfriend (I forget her name) are playing on his PS2, and he might be coming to Jujitsu tomorrow. I was entertaining Davina, Pam, and Shirley earlier. I cooked some soup-like thing, made some humus, and made pancakes. Life is good.

I went to the pub with the rest of the Jujitsu-ka after Jujitsu on Wednesday. I talked to Karen mostly. As it turns out she spent a year in Japan teaching English as a second language (E2L) after her degree, which I was very interested in. I’d quite like to do something like that myself. It could prove more fun and maybe better for my career if I skipped the placement year, finished my course, and went to Japan for a year. It would give me a rest from computer science and some experience in something other than computer science. Employers like transferable skills, don’t they? Also, it would be so fun!

So, what have I been doing this week? I obviously haven’t been blogging. I’ve been reading cat-related blogs: I found catv7 while looking for some Japanese thing (maybe I was looking up some kanji); and cats.noehr.org, via Anne.

I found Vegan Lunch Box on my travels. I love the format. It’s so simple and concise.

I’ve been replying to comments too. I didn’t know what I was missing out on before I got comments. I got a lot of feedback for Google Reader (and I’ve been linked to lots).

I’ve decided it might be time to start learning カタカナ (Katakana, the second Japanese script that one learns) now that I can read ひらがな (Hiragana, the first script) pretty perfectly and I can write almost all the characters without too much effort.

Google Reader

Saturday, October 8th, 2005

Google Reader was announced today.

It’s rather cool. There’s a preview feature, which I’ve found missing in other feed readers I’ve tried. Here’s a preview of my feed (must be signed into your Google account for it to work). You can see all my latest entries, and there’s a big, fat Subscribe button at the top. You will notice, if you’re paying attention, that it supports Atom 1.0.

I’m happy with the lack of technical terms, and the way the subscription is handled. You’re not expected to find a feed URI and put it in manually. All you do is search and subscribe.

How do you subscribe to a feed when you’re already at a website and you can’t be bothered to go to Reader and search for the feed? Get a bookmarklet to do it: → Reader (Yay! My first bookmarklet!). It finds the author’s preferred feed and takes you to the preview page where you can subscribe. It only has one real bug; it takes you to a blank page with a cryptic message if there are no feeds listed on a Web page.

Update: I’ve found several other bookmarklets since I first posted this:

SSLC

Wednesday, October 5th, 2005

I’m currently eating a great load of miso soup and wondering when I should fast, and how.

Some of my house-mates are installing a TV cable from the aerial that comes out in Mike’s room to the rest of the rooms.

The first Student–Staff Liaison Committee (SSLC) on Monday was fun as usual. The basic premise is that a few student representatives moan about a few issues and then the staff tell us that they’ve been moaning about the same thing to the beurocrats over the road (in Richmond) for two months.

As could have been predicted, there was no first year representative present. Just me and Will for the second year, Nat from the final year, and Neil who is now a post-graduate.

Thanks to pathetic timetabling, I shall be missing careers talks whenever I attend SSLC. What should I do? Go and be told how to improve my career prospects or actually improve my career prospects by learning the social skills needed for meetings and turning my course into something better than it was?

Mmm, that was good miso soup.

Atom 1.0 Feeds in WordPress

Sunday, October 2nd, 2005

After a small amount of hacking, I now have fully-valid Atom 1.1 feeds for entries (thanks to comatoast’s patch, although I patched it further because the <id>s were silly) and comments (thanks to this Atom 0.3 comments feed thing). They’re both valid: entries, comments.

Here are the relevant files I now have in my 1.5.2 installation:

There is also an RSS entries feed for legacy software.

Tip for those using the Universal Feed Parser: there’s a patch for Atom 1.0 support (that’s how I got Straw to be happy).

Heh heh heh. Atom 1.1 exists only in my imagination. Did I mention I implemented the <unicorn> element in my feed?

The Very Long Post

Saturday, October 1st, 2005

In this post I will be entirely self-indulgant and tell you all about what I’ve been up to in the past few months. Sorry if it’s all over the place, but I have a lot to say, and I’ll start trying to write coherently after this post.

Well, not much happened until the middle of August, when I was invited camping in Eskdale with Sammy, Adam, Jenny, Katie, and Laura. It was good fun, and I enjoyed it very much. Climbing up a mountain (some contest that it was a hill, but those people didn’t walk up it) almost made up for the fact that I didn’t swim for five consecutive days.

That brings me onto the next, or possibly the previous item: I now swim every day. Bar that trip, the last time I missed swimming was the 26th of June.

A week and a half after the camping trip, I went to Cockermouth with Davina for three nights. Yes, nearing university time everything started to get busy. It was annoying that all the fun stuff was so clustered at the end of the holidays.

Then on the 3rd of September, Niall moved in. Soon after we had Internet. It took a lot of getting used to again. After two months of visiting the labs for Internet, it was so nice.

On the 10th Will turned up. It was good to see him again.

My housemates all turned up around that time. It took getting used to having other people in the house, but it is a good thing to have company.

The day after Will arrived, Scott Sigler released the first episode of Ancestor, his latest podio book. It didn’t grab me like EarthCore did.

On the 20th I went to my first Japanese lesson at Bradford College. I like the language, as I’d established when I started reading Japanese for Busy People. As it turns out, this is the course text. So I ordered the Kana version from Amazon, because I’m ambitious (I can already read and write most of Hiragana - and I’m quite far through the book so I need to keep myself occupied, lest I become complacant).

On the 22nd, it was the Sports and Societies fair down in the basement. I sat and stood at the Cult TV stand for most of it. I talked to people, got them to sign up to the mailing list, discussed anime with them. More on my socialisation later.

The sports and societies I attend at the moment are:

  • Cult TV
  • Archery
  • Katana Ju-Jitsu (Ju-Jitsu with Kobudo)

I’m not officially a member of any yet. But I plan on joining them all. It’s gonna be spendy. Athletics Association membership, World Ju-Jitsu Federation membership and insurance, gi. That’s another thing: my loan hasn’t come through yet. I’m living on my overdraft at the moment. I say living, but most of my money goes on books.

Cult TV is as fun as ever.

Archery is surprisingly fun considering that it’s shooting pointy things with twangy things into big unbreakable things.

Ju-Jitsu is very fun. It was good on Wednesday, but today it was even better. We learnt to break-fall and then we got straight into throwing each other. I really like it. I did kind of have my heart set on Aikido, but Ju-Jitsu seems to be just as good and it’s closer. Self-defense was also something I wanted out of a martial art (before I found out how fun it is); I think Ju-Jitsu is very good for that. Of course I doubt I’ll get a chance to use it any time soon (not that that’s a problem) but it seems like it would be effective. One of the first things we learnt was how to get out of a strangle hold from the front and then from the back. In fact my favourite skit we’ve learnt so far starts with a strangle hold and ends with the attacker on the floor with the victim’s knee on the attacker’s neck and their arm in an easy but painful lock.

We started uni last week. It should be fun, and challenging. I already have an issue I want to bring up at the SSLC on Monday.

That’s about the sum of my holiday from blogging.

Now on to today: I woke up at 8:40am, went swimming at 9, did archery from 10 till 12, did Ju-Jitsu from 12 till 2. And that may well become a weekly occurrance.

I think I’ve developed. Last year I barely did any exercise. The year before last I was very shy. Now look at me: I’m barely recognisable. I swim every day, and do Archery and Ju-Jitsu twice a week. I speak to strangers.

Yesterday I upgraded from Firefox 1.0.6-5 in Debian to 1.5 Beta 1. It has many nice features including many nice UE enhansements and support for some new technology like <canvas> and SVG. Of all my old extensions only Hit-a-Hint had to be manually upgraded and only Adblock is slightly broken.

I’ve been listening to lots of podcasts lately. I thought I’d share with you the main ones that I listen to regularly:

  • Daily Source Code - Adam Curry (yes, the famous one) talks about podcasting, mainly. It’s quite autobiographical.
  • The Dawn and Drew Show - Dawn Miceli and Drew Domkus, professional podcasters, talk about all sorts from the difference between Jesus and zombies, to how being born is like going down on your mum. It’s very amusing.
  • Addicted to Race - Jen Chau and Carmen Van Kerckhove talk about anything relevant to mixed-race identity. I know plenty about other cultures thanks to Davina, but I must admit I’m very naïve about mixed-race issues.

For completeness, I’d like to tell you what I’m reading at the moment:

Whoa. That was very long and very all-over-the-place but it could have happened no other way. I promise I’ll try not to be as terrible next time.

I’m back

Saturday, October 1st, 2005

After a good while of having no weblog, I return.

I sacraficed some control I would have had with a self-written weblog for ease of use. Compared to the last thing I was using, this is really sexy and… usable.

I plan to keep the same IRI structure, and I’d like to import the old database into the new one at some point, although with my MySQL installation fucked (yes, I’ve removed, and purged mysql several times) it may take some time. So, unfortunately, the older entries will give 404s at the moment.

Welcome back me. I might post something interesting soon, if you’re lucky (I’d hope I have at least a little to blog about from the past three months).