Technology updates

Quite a bit has happened recently!

I’ll try and give a bit of info about each, there’s quite a lot to write about though!

EyeInTheSky

An IRC bot which stalks changes to Wikipedia based on regex matches. Read more

caterpie beedrill as minecraft server

Those of you who use my Minecraft server will know that the server known as “caterpie” was bad. Any more than one person connected, and it would lag to the depths of hell. I’ve replaced it with a 1.7G beast of a server, still running as an Amazon server instance.

stwalkerster.co.uk

I registered a new domain! I’m still in the process of setting the thing up though, but that will become my main website, not quite sure what I’m gonna put there yet, but it’ll probably replace what webspace I had at http://helpmebot.org.uk/~stwalkerster/

ACC‘s IRC Bot, ACCBot

A couple of weeks ago, the IRC bot that we use over at Wikipedia’s Account Creation Assistance project decided it would stop giving notifications to the IRC channel.

I’ll write more about this at a later time, hopefully soon, but probably when I’ve finished messing with my new site :P

strobe light

Growing tired of the poor strobe light applications available on Android Market, I decided to build my own.

I’ll also write more about this too at a later time – I think this bit and the last one need their own posts.

EyeInTheSky

EyeInTheSky is one of my newer projects, an idea which I’ve stolen from two other people.

Wikipedia has so many modifications being made to it that it’s just not possible to keep an eye on everything you want to watch. While the MediaWiki software has a feature known as a watchlist, it’s neither flexible nor easy to use in my opinion.

EyeInTheSky is an IRC bot (seems to be my speciality!) which monitors the Wikimedia IRC recent changes feed, compares every entry to a set of regular expressions and reports them to a different network.

It’s possible to set up the bot with an entire XML tree of regular expressions matching on the username, edit summary, and page title. There are also logical constructs which allow more-or-less unlimited regexes to specify what exactly you want to watch.

For example, with this tree, I could specify I wanted to stalk all the edits which are made by someone with “the” in their name, “and” or “or” but not “xor” in the page title, and with “train” in the edit summary:

I also can set a flag, something that I can then set my IRC client to respond to, and it will speak that flag for every stalked edit.

Of course, it’s not just edits that can be stalked this way – log entries are sent to the IRC RC feed in the exact same way. It’s just a case of specifying Special:Log/delete as the page title to get the deletion log, for example. The entire log entry except for the time/user is sent in the edit summary field. This means the same system can be used to stalk log entries as well.

The bot logs all stalked edits, and is capable of emailing the entire log to me, so I can clear the log when I disconnect from IRC, and when I get back on, I can email the log, go through what I’ve missed, and catch up.

I’m planning on making it multi-channel too, with probably multiple people able to command it to email them the log. I can already tell it to not email certain stalks, especially as some of the stalks that have been set up are not things that interest me, but rather interest other people. I just ignore those when it reports them, and have it set not to email me for those stalks.

There’s quite a lot this little bot can do, if you want to learn more, I’d recommend taking a look over the source code, and see what you think!

The source code is available on GitHub here.

Minecraft Pixel Art

Hey folks

Just thought you’d love to hear about a few things I’ve been doing in Minecraft recently!

PIXEL ART!

I decided to make the Google Chrome logo from coloured wool in Minecraft.

I took the Google Chrome Logo:

Reduced it to 32x32px (actually, I initially found a 32x32px image :P):

Applied this GIMP Colour Palette to it to adapt the colours to the wool colours in Minecraft (Image -> Mode -> Indexed, using custom palette – you’ll need to right click the palettes window and import it first):
(this is the one I’m actually using, if you use the one above, you’ll end up with this)

Build in Minecraft!

I’m considering building all the major browser’s logos, but I’m having a hard time finding the resources to do just Chrome’s. And Chrome has gone and got itself a new logo in the meantime…

Because I was finding it hard to know what I needed, I also built a spreadsheet. This spreadsheet knows all the requirements for the wool blocks, asks you what you need to complete the project, what you currently have, and goes away and calculates what else you need to gather.

Download spreadsheet

If you want to download it, feel free to. I’ve released it under CC-BY-SA, so do whatever you want with it under the terms of that licence (attribute me and share any changes you make under similar conditions, otherwise do what you want). Details are in the file.

Wikipedia Account Request System

I thought it was about time I did a bit of a technical post on the new Wikipedia Account Request System that’s been sat around slowly being worked on over what’s nearly a year(!) now.

It’s still a long way off, but I’ve not had time to actually buckle down and do work on it, so I’m hoping that I’ll be able to spend a bit more time with it in the near future.

Since the migration to GitHub, I’ve been doing quite a bit of development work on it, and have recently (semi) finalised the database, which will hopefully speed things up a bit, and stop me from saying “ooh, let’s do this with the database”, “nah, nevermind”, “ooh, let’s do this instead”, etc.

The database finalisation comes after writing the conversion script to convert the database from the current format into the new format – there’s roughly 35 operations to be done to make the database sort-of OK, 28 of which are done on one single database table.

I’m taking this opportunity to make these somewhat huge database changes to the core of the system as there’s not much that’s using the database at the moment in the new system, and a huge migration would have to happen in order to swap from one system to another anyway, so I’m not too fussed about making more changes like this.

As the developers of the current system will know, the code is quite frankly shocking. I’m pretty certain that SQL injection and XSS attacks are prevented, but only because we apply about 15000 sanitisation operations to the input data, mangling anything that’s remotely cool such as unicode chars – to cite a recent example: • – into a mess that MIGHT be displayed correctly on the tool, but any other areas just don’t work. In this case, MediaWiki rejected it as a bad title, because it was passed • instead of •.

The new system should hopefully solve some of these issues.

For starters, all the database quote escaping is going – I’m not even going to do database input sanitising – and I’m going to actively reject any change that adds it.

There’s a reason for this, and that is because of the database abstraction layer I’m using for this new system – PDO.

PDO handles all the database connection details for me automatically, and supports both raw SQL queries, and prepared statements. Where the former requires sanitisation to be secure, the latter doesn’t. You simply pass in place-holders (called parameters) to the query where your input goes. You can then bind values or variables to the parameters, and execute the query. Because the query and parameters are passed separately to the server, no sanitisation ever needs to happen because it’s just impossible to inject anything in the first place.

The really cool thing that I’m planning to (ab)use a lot is the ability to retrieve a database row from the database as an instance of a class you’ve previously defined.

The above is an actual excerpt from the User class of WARS at the moment, and the database structure of the acc_user table.

As you can see, the class has a set of fields which exactly match the names of the columns in the table. This is a key part of making the code work – all you need to do is create a query which pulls out all the columns for one row in the database, pass it the parameter which tells it which row to return, and then tell it to fetch an object, telling it which class to instantiate. A simple four-line function dealing with the searching and retrieval from the database, and instantiating a class with the relevant data – it’s actually beautiful! :D

My plan is to use this structure of data access objects for all the other database tables, and then I should be able to deal with the entire system on a purely object-based level, rather than constantly mashing in database queries here and there.

Git, GitHub, and some project ideas

Yeah, yeah, I’m an addict.

Already.

Monday was when I switched my first subversion repository over to Git, and over the course of the next few days, a couple more repositories had been switched. Thanks to this guy, I’m properly addicted to Git.

It’s been a bit of a learning curve, especially since I’ve quite literally grown up using subversion. The most worrying thing about moving from subversion to git is the message at the top of most guides: “forget everything you know about version control”.

I won’t go into describing the conversion from one to another, but I will say this: it’s tricky at first, but once you get the hang of it, it’s a much nicer and more natural workflow.

I’ve got a few repositories on github already, though some of them aren’t that great and don’t have that much in them.

I’ve got a few ideas for some projects I want to have a go at building too, quite a few of them are git oriented, such as a github android client (or more precisely, patching the existing one), and adding git support to mediawiki’s codereview extension. The list of stuff I want to do is here: http://helpmebot.org.uk/wiki/Idea_Lab

“Robots gave us six extra seconds of co-operation!”

Humans cannot be trusted.

Apparently, robots can’t be trusted either. At least I now know that I can trust a Aperture Science robot for 6 more seconds than I can an Aperture Science employee. Though I wouldn’t like to put it to the test against GLaDOS…

I seriously can’t wait for Portal 2 to be released. Unfortunately, it’s right before the exams, so I’m either likely to fail the exams or fail the exams playing Portal 2!

Minecraft and the towers

So, I’ve wasted a considerable amount of free time building what was at first a tower, then a few towers, then an aerial walkway, canal system, boatlift, and now is a fully fledged quadrangle.

The towers themselves are really impressive, the basic structure being a 5×5 square tower with a hollow inside, then building a double helix in the centre:

glass glass glass glass glass
glass air air air glass
glass glass glass glass glass
glass air air air glass
glass glass glass glass glass

glass glass glass glass glass
glass glass air air glass
glass air glass air glass
glass air air glass glass
glass glass glass glass glass

etc. The bottom is slightly more fancy, in that it started out like that, but I added a walkway through the middle, and sealed off the bottom. Hence:

  • Layer 1:
    glass glass glass glass glass
    glass glass glass glass glass
    air air air air air
    glass glass glass glass glass
    glass glass glass glass glass
  • Layer 2:
    glass glass glass glass glass
    glass glass glass glass glass
    air air air air air
    glass glass glass glass glass
    glass glass glass glass glass
  • Layer 3:
    glass glass glass glass glass
    glass air air air glass
    glass glass glass glass glass
    glass air air air glass
    glass glass glass glass glass

There’s nothing special about the top, you just need to stop building the glass spiral when you don’t want to go any higher, and stick a lava source in one side, and a water source in the other. If all goes to plan, you should end up with zero cobblestone, zero obsidian, and a nice tower that looks something like this:

water lava tower by day

or by night:

water lava tower by night

I ended up building a glass staircase around the outside edge of the tower to aid getting up and down. Alson if you’re fast enough, you can get down the tower before the lava has finished forming (jumping down into water helps!), and you can watch it form:

2011-03-12_17.57.55

Now, I decided to go to the top of the world. Then I decided that wasn’t enough, so I moved 100 blocks and built another. And another. And another.

Here’s three of the towers, the other one hadn’t been built yet (I’m actually stood halfway up it while building it)

2011-03-12_17.36.22

Four fancy looking towers still didn’t seem good enough, as I seemed to be able to rattle off new ones far too quickly, so I built a walkway between them right at the top, then a few blocks down a canal system:

2011-03-13_00.11.07

… which in itself was starting to look really cool from the ground:

2011-03-13_00.11.51

Add a fair amount of water…

2011-03-13_01.01.22

2011-03-13_01.07.42

I ended up building an extra ledge onto the outside wall of my canal system, and flooding that too to form water curtains:

2011-03-13_15.12.27

2011-03-13_15.28.39

A 1 block deep trench directly underneath the fall path of the water ensured no unintentional flooding, except for the one time I forgot about doing that…

2011-03-13_15.45.45

I decided I ought to make a few “portals” through the curtain so others on the server could easily come and go to their respective bases, so using the 1 block trench idea, I created a very simple doorway with the trench on top:

2011-03-13_14.58.37

I also added a boat lift, which is essentially just a column of water, and a drop into a 3-block deep area of water, with a current driving you off the edge. It works really well, assuming you can get the boat to move where you want it to!

2011-03-14_01.50.43

2011-03-14_01.53.20

More photos can be found here

All in all, I’m pleased with the result, though I’m not so sure about the water curtains.

If you want a look around for yourself, take the backup dated midnight on the 14th from here, and have a look around!

Courage and Cowardice

Something I’ve learnt over the past few weeks is that cowardice builds walls in our lives, makes us hide our true feelings for each other, and prevents us from doing what we want to do.
Only with courage can we break down those walls, and bring us closer together in our friendships. Courage enables us to do what we want, and enjoy ourselves, and enjoy our time with others.

There are those who won’t like what you say or do, but we all have a right to an opinion, and a right to our own beliefs, for “It is our choices that show what we truly are, far more than our abilities.” (Albus Dumbledore in Harry Potter and the Chamber Of Secrets).

We should be proud of who we are and what we believe, and not worried about what people might think of us.

That said, we should respect each other’s opinions and beliefs, or we will be dismissing valuable friendships and ideas which can help us grow as a person.