A mind less ordinary

3Feb/102

Gracefully degrading jQuery edit-in-place

I recently became curious about creating some edit-in-place controls: things that look like static text until you click them, and they magically become editable. It turns out that creating this sort of thing is almost trivial with jQuery, which is now my favourite JavaScript framework. I'm a big fan of functional-style programming, and jQuery plays right into that.

It was still surprising that the bulk of what I wanted to do can be done in about 16 lines of code. That's right: sixteen.

4Jun/096

A content-based file manager

I've been thinking recently about Insight again, and I've been considering part of the problem with naming and uniqueness.

Names in a traditional file system are made unique based on a full path to the file, but most people think of a file name as just the final component. This would then cause a problem with the move to Insight, as a file could appear in multiple directories, and its only distinguishing feature would be the final component of its path. This is counter-intuitive and can cause all sorts of problems.

Consider makefiles, for example. They rely on a standard named file (Makefile) appearing at various levels in the hierarchy in order to work. Obviously, you would want different makefiles at different levels and in different projects, but Insight as it stands has no way to handle this.

I then started thinking about what makes a file unique. In the end, I came up with two things: name and content. This covers the makefile case (same name, different content) as well as the backup case (same content, different name). It then occurred to me that, in the general case, all you need to distinguish a file is its content, and then actually finding it can all be left up to metadata.

10Sep/0814

mod_sqltemplate: A distraction from work

I've begun the long and (hopefully) interesting task of working on mod_sqltemplate.  I have not yet found a tutorial or guide to working with APR's DBD API (the database abstraction layer for the Apache Portable Runtime), so I'll write one and publish it here as I go along...

13Aug/081

Modules for Apache and PHP

The number of projects I have in mind just keeps growing... I really need to get something together to organise them, and remember them! But here are two more to add to the list: an Apache module for dynamic configuration generation and a PHP framework inside an extension. Read on for a monster post with more information...

10Jul/081

In-place array uniq in C

I've been developing Insight even though the uni project has come to an end, because it's fun! I also want to make it more stable and eventually release it under an open-source licence of some kind. There will be an update coming soon, I promise! I now have Internet, so I can write up some things... Anyway, one of the interesting things I wanted to do for Insight was an in-place form of uniq for an array, ideally without any additional memory allocation. It seems that this is something nobody else has done yet! So I set about doing it myself... For those of you who are unfamiliar with the Linux/UNIX command uniq, it takes a sorted list and removes any duplicates. This is almost exactly what I'm trying to do, with one caveat: I need to keep the "discarded" duplicates. What happens is that I have an array containing a number of strings, and these have all been dynamically allocated via malloc() or calloc(). If I just remove or overwrite their pointers, they'll vanish and cause a memory leak. While I've now fixed a large number of leaks thanks to Valgrind, I'm trying to actively avoid any possibility of adding them. Read on for the details...

29Apr/083

Overflowing with ideas

I've found myself overflowing with ideas as I try to focus on revision, so I thought I might as well scribble some of them down, if only to get them out of my head! To name the prominent few:

  • More on Partis and its future
  • A web service integration API proposal
  • A PHP system to make it easy to plug together a load of code modules for rapid development
  • Not to mention some others which are too fleeting or too vague to pin down yet
8May/070

FolderCheck Thunderbird Extension

This is something I've been meaning to write for a while, and finally got round to doing. Basically, it's a simple Thunderbird extension that makes it easier for you to check other folders for new messages. I've named it FolderCheck* (rather unimaginatively), and it's available from the Mozilla Add-ons site sandbox.

The problem is that, at the moment, Thunderbird will only check either the inbox or every folder for messages (for all accounts). This is pretty useless for me, as I only get new email in my inbox for some accounts, and get my email server-sorted into different folders for other accounts. This means that if I want to tell Thunderbird to check a specific folder for messages, I have to right-click the folder, choose "Properties", check "Check this folder for new messages", then click OK. And do it all over again for the next folder. And the next. This quickly gets irritating!

My extension adds a new "Check for new items" item to the context menu for each folder (except Inbox and some other special folders) that allows you to quickly see whether a folder is checked for new messages, and to quickly and easily toggle that setting. Now I just have to right-click each folder and hit "h" to toggle the setting.

Coming soon (when I get round to it): a dedicated window to make multiple folder selection easy. My current thought is a list of folders with a filter box and "(De)Select All Visible Folders" buttons.

* Note: currently requires a free Mozilla Developer account, as it's not yet a public extension.

7Apr/070

Coolermaster CoolDrive 6

Well this has been a bit of a saga so far. I've been working on Linux support for the CoolerMaster CoolDrive 6 (CD6 henceforth) which I currently have in my computer. It has a USB connection, and an inbuilt Prolific PL2303X USB-Serial converter. Sadly, I've been struggling with uncooperative C code that I'd found which supposedly allows me to control a serial port. Yeah, right.

8Mar/071

Automatic email forwarding

Well I got fed up with email filter rules last week, and this is the rather bizarre result: autoforward, a Perl script and configuration file that will automatically generate Exim filter files (.forward files), mainly to be used on my University account. My email processing rules have become pretty complex and messy, making them difficult to control, and there's a lack of uniformity about them. I decided there had to be a better way, so set about writing a configuration format and parser... and I think I succeeded.

8Mar/070

My current projects

So, what am I working on at the moment?

Filed under: Coding, Work Continue reading