XBBCode now available through SVN
It's actually been some time since I began using my own SVN repository for the XBBCode module (described in more detail in earlier posts). It's far more convenient than the combination of Dreamweaver and vim I have been using before.
Also, I have made it publically available, so if you have an SVN client (which you undoubtedly do if you have Linux), you can now get the current version by checking out the repository at this URL:
MD5 in Java
MD5 is a hashing algorithm invented by Ronald Rivest in 1991. A hashing function is used to make a short (usually constant-length) check sum from an indefinite amount of binary input data. There are two criteria:
- Read more about MD5 in Java
- 6787 reads
Mayan Numbers
Today, I handed in my final assignment for my apprenticeship. This was a five-day project, assigned on Monday and due Friday afternoon. A software project that also required about 30 pages of documentation.
- Read more about Mayan Numbers
- 2993 reads
Bring it On, Spammers
I have enabled (moderated) comments for anonymous users. The last time this was enabled (nearly a year ago), I was inundated by spam. This time, I trust Drupal to weed out improper comments and I'll use the IP ban table to get rid of these creeps.
If the spammers make me lock down my blog so tightly that nobody can comment, not even legitimate readers, they've already won. It's a bit like Dubya's "war on terrah".
Well, except nobody's ever been killed by a spam filter.
- Read more about Bring it On, Spammers
- 3 comments
- 4044 reads
AvernumScript Syntax
I wrote of my first scenario two days ago, and of my success in combining the Pear syntax highlighter with my XBBcode module to integrate it in Drupal today.
So this shouldn't come as a surprise, really.
AvernumScript is one hell of a scripting language, and not really in the positive sense: Arbitrary spellings and abbreviations of functions are awful to remember, and the tight limitations (only integer and string types, only while and if-else flow control) aren't good to design for.
- Read more about AvernumScript Syntax
- 4433 reads
I can highlight Syntax!
With the help of the PEAR Text_Highlighter package, I just extended XBBCode with an interface that used this library. The module is called Highlighter. It scans a directory for generated class files (Text_Highlighter generates PHP classes for specific code types from XML descriptions), includes them, and then provides XBBCode tags for each. I can now use PHP:
- Read more about I can highlight Syntax!
- 4090 reads
My first Blades scenario: Express Delivery
Yesterday evening, I put the finishing touches on my first Blades of Avernum scenario. If you do not know what that is, you should read the Wikipedia page, go to the homepage, try the game, begin to love it, buy it, and play a few scenarios before continuing to read this article.
Okay, done?
Euclidean Algorithm for finding the GCD
Today, I was saved by the knowledge of yet another neat little algorithm. Well, not 'saved' as such; I could have done the job with something less efficient and elegant, but it certainly didn't hurt.
For a programming exercise, I needed to find the GCD of two numbers.
Neighbouring cells in a matrix
This is a little algorithm snippet that has come in handy for me three times in the past month since I came up with it, so I thought I should share it.
A lot of algorithms deal with matrices, or two-dimensional arrays. Looping through each cell in an array, either to find something or update them all, has been done for ages (and the commonly used loop indices are 'i' and 'j', folks, not 'x' and 'y'. Please.)
Conway in a nutshell
So I implemented Conway's Game of Life in Java. On a torus, a body whose edges are mapped onto each other to give it an infinite area easily navigated using modulo arithmetics.
It took 140 lines, but that's not spectacular - being the solution to an excercise I wrote on paper earlier today, it's written more for elegance and readability than number of lines, and has plenty of comments.
- Read more about Conway in a nutshell
- 3590 reads

Recent comments