Friday, 31 August 2007

A little toy for you

If you want to play about with a little toy I've been messing around with then you can find it here (but probably not for long, since that's a temporary storage area).

It's a little Python app (requiring pygame to be installed, on Debian systems like Ubuntu this is provided by the python-pygame package) which, when given a band name, connects to and gets related artists, and their related artists, etc. putting them all in a graph weighted to their relative strengths to make a map of musicians (for an explanation of the algorith see below).

This is very buggy, unbelievably inefficient, and could likely cause a lot of stress for, so use sparingly (remember, if someone wants to DOS attack this is not the most efficient way of doing so, so don't think of it at warez or anything because it's not meant to be).

To use:
Extract the archive, then run the file I would recommend running it in a way that can be killed easily (for example from within the Geany IDE, which has an Execute and Stop button), since it is an experiment with threading for me and killing those threads can be annoying if (when) the (increasingly complex) graphics thread dies (although if you do run it from a commandline then you can give it a band name directly, like "./ Children of Bodom")

When the window comes up click on the Artist Entry field to select it, use backspace to get rid of the default text, then enter the artist you want to start with and press return. The program should then start downloading images and relationships between artists, adding them to the graph as it does. The deeper the relationship matching the more accurate the map, at the expense of coverage, the more artists modelled the more accurate the map, at the expense of speed (there's a stupid-ass bug in the total artists down button at the moment because I'm an idiot). You can choose to see images (which, if disabled, will also disable image downloading), text labels and the underlying web of connections (the lighter the strand the stronger the connection). Note that enabling and disabling images shifts the nodes in the rendering of the web only, it doesn't affect the modelling in any way (the artists are modelled with their position as the top-left corner of the image/text, which doesn't change).

What it's doing:
The artists exist in a python dictionary, with various different lists of the keys existing for different purposes (the main one being usableArtists). Connections between artists are stored in a separate dictionary, and pairs of artists with no connection between each other are stored in another dictionary.

The Handling thread goes through a list of artists which are known to exist but who are not yet modelled. It then puts each artist in turn into the dictionary and appropriate lists, creating connections as far as the link depth goes (a link depth of zero only connects the most related artist to each artist, which makes forming closed systems easier (eg. Edguy is most related to Avantasia, Avantasia is most related to Edguy, resulting in only those two being modelled for a link depth of zero)). After the connections have been made it sets up a repulsion between the new artist and every artist which it is not connected to. It continues like this until there are either no more artists left to process (a closed system has been made) or until the total artists limit is reached (cutting short a complete modelling of the given variables).

The Image Fetching thread, as long as images are enabled, fetches images for those artists which haven't been assigned one yet. The Relation Fetching thread does the same thing for artists without relationship information.

The Drawing thread draws the graphics and handles user interaction.

The Force thread goes through the list of modelled artists, setting the force on each to zero and halving their velocities (which gives a little bounce to the system). It then goes through the list of connections, assigning an optimum distance apart for the artists (100% similar artists should be close, 20% similar artists should be further away. The distance is direction-independent), then adds a force to each based on how far away they are from this optimum distance, further away means greater force, and the stronger the connection the stronger the force. This means that weakly related artists will tend to move a good distance apart over time, but if other factors can easily overpower this tendency. The list of repulsions is then gone through, forcing apart any not connected artists which are closer than a certain distance.

The Linear thread constantly updates the movement of the artists, calculating their acceleration based on their experienced force and a set mass, from that calculating their velocity and from that calculating their position (which in turn feeds back to the Force thread)

Well, that's basically it for the time being. There are many bugs with it (due to the repulsion's cut-off point some arms of the map can arc around and become close to other areas to which they have no relation, non-English alphanumeric characters cause problems, the total artists down button is broken, there is a rare tendency for the artists to shoot off and crash PyGame by having extremely massive coordinates and probably a lot more needs seeing to as well) but it is purely experimental at the moment.

And the point of this? Well, firstly I think it is pretty cool. Aside from that I think it would be a nice way of browsing one's music collection. By hooking into the multiple genre tags that gives to artists then this information could be used to map out genres, thus letting users select an area of music they want to listen to, rather than having to specify Speed Metal OR Thrash, and playlists could be defined by drawing a path through the map, moving gradually from one genre to another without obvious jumps. Anyway, that is work for the future. At the moment have fun watching the pictures bounce aroud on strings :)

Thursday, 30 August 2007


User friendliness indeed BT....

Some Cool Graphics Algorithms

Content-aware image resizing (and object removal) (Check out someone's working implementation of this)

There are also a load of cool technology (including videos) here.

How Dare They!

We must put a stop to copyright infringement, it is killing the movie industry! You know who's to blame don't you? It's those damned pirates taking all of their money (and by that I of course mean potentially altering projected future profits)!

Monday, 20 August 2007

Why you shouldn't rely on a single company with closed protocols

One of the many reasons I don't use Skype. If Skype was decentralised then this would not have been an issue, and of course if their excuse is right then the widespread use of a single vendor for computer operating systems is also a bad thing (well duh).

I have ambitious plans to set up a Wifi mesh over part of Sheffield, and things like Voice over IP (Internet telephony) are selling points I would like to use. However, Skype is not something I would like to advocate, mainly due to ethical reasons, but also for practical reasons such as this (plus the fact that a centralised system means everyone must have access to the central server. If two people want to talk to each other through a Wifi mesh they'd have to connect outside the mesh to get to the server, slowing things down and putting extra stress on any outbound gateways, whereas using something like Jingle or SIP (probably the former, since SIP seems a little complicated) can run from a server inside the mesh, keeping things fast and scalable. That is also a reason why I like XMPP/Jabber compared to shitty MSN)

Also, I'd like to link to this story about the CD being 25 years old. The reason? The Phillips engineer they quote says:

"We did this by collaborating openly to agree on a new standard. For Philips, this open innovation was a new approach and it paid off."


"The world was not as globalised as it is today. Our management had told us to be as open as possible and to share everything because that was the only way to have success.

"But we were suspicious and so were their engineers. But after a few days it became clear we could work together."

If there was ever a reason not to use locked-down, proprietary, patent-encumbered, secretive, bollocks formats and protocols it's this. This is a BBC news story, the iPlayer people (who it should be noted have strong ties to Microsoft, for example the "Group Controller at BBC Future Media & Technology", Erik Huggers, used to be Senior Director at Microsoft and a Director of Business Development for them) should be paying attention.

Anyway, yes. I want to start meshing some networks soon, which would be cool. I can't wait to get back to Sheffield and get some stuff done.

PS: I wouldn't want shit-based data storage to explode anywhere near me!

Thursday, 9 August 2007

Way to make my work sound easy there...

I just saw this on a BBC news story:Thought it was pretty funny considering the complexity of the situation.

Anyway, on a more serious note I am cracking on with my Service Pack tool, which is almost fully working now on Debian derived distros, the only problems are 1) The installation script doesn't run properly from the package installer (although it runs fine from a commandline) and 2) The postpone tool is currently used, which isn't particularly widespread yet, so this dependancy must be eliminated (although postpone was used heavily throughout the program it now only exists in the package installation phase). You can usually find a semi-recent version from the Wiki page.

This post has been sitting unposted on my machine for a couple of days while I work on other things, but an interesting thing I'm playing with which you might be interested in is a visualisation program for displaying what is essentially a "map" of music, using to find relations and create a web of interconnected artists. It still needs some physics added to create a proper visual representation (at the moment images and text are dumped randomly on a single screen), but since it is my first venture in the area of networked programs and multithreading I think it has turned out well for a few hours work (this is just a test, so I don't think I'll be releasing it while it still uses, since their servers would take a hammering. The idea is to be able to sort through local music collections, and thus the needed metadata should be inside local files to make the best use of it.) When I have the physics sorted then I'll probably post a video to Google Video showing it off.

Until the next time, erm, yes....

Wednesday, 8 August 2007


Nice one James :D

Tuesday, 7 August 2007

Some phrases should be culled

Although 'screen real estate' is up there, the top dog must be 'bling bling'. With that in mind I've been pimping my laptop in anticipation of the influx of potential new Free Software users in the form of the next academic year's worth of firstyears. I am now running Ubuntu Gutsy, which overall seems to be following the less-dramatic-upgrade tendancy I've seen in Ubuntu (Breezy>Dapper was very pervasive, Dapper>Edgy seemed nice, Edgy>Feisty didn't really seem worth it, Feisty>Gutsy? Dunno yet), but it means that along with working out how to get ATI's crapware to 'work' I can run Compiz Fusion (using XGL, eww) which seems nice, although I really don't like the 'CompizConfig' tool, it is in serious need of some UI lovin' (who in their right mind would provide users an integer system for animations without telling them what animation each number corresponds to? Plus, the amount of conflicting stuff is annoying, like 'minimise effect' not being disabled when minimise/maximise animations are enabled).

I've installed E17 as well, which has changed a bit since I last played around with it. Although it has gained features on the whole the process of configuring the thing is a real mess. The 'shelves' idea is OK I guess, but as far as I can tell I can no longer use the modules as desktop widgets (strange, considering how other desktop systems are moving in the opposite direction) which would be a shame. Still, I have set up a new non-admin user called fss-test and set up a nice enlightenment configuration to use (although Amarok, Rhythmbox, MPD and Exaile all crash for that user :( Banshee seems to be OK so far (Banshee has become very nice recently too I have noticed!), but that's what you get for using pre-release software). I wanted to have KDE4 running too, but the packages are pretty bare at the moment (Plasma is the main area I'm interested in but they only have 2 plasmoids in the vanilla setup, the rest of them living in the 'playground' directory in subversion, which I have tried unsuccessfully to compile).

Now that I know my own laptop will stand up well in the first-impression-critical world of the Freshers' Fair I want to get other machines on board. I have asked my friend Heminder if I can borrow his laptop to demo stuff on and I think he agreed, I'm not sure. I'll try and hunt down some more (perhaps James could pop along, since he is supposed to be a member and has Fedora installed on his laptop, making no live CD needed).

Oh well, time to get back to the real world and make sure my monetary hurdles are overcome.

PS: Must test Wii controller with my laptop, since demoing that would be awesome :)

Wednesday, 1 August 2007

Will the FUD never end?!

I just happened upon yet another complete misinterpretation of the OLPC project, this time on the BBC's Click programme, interviewing Bill Gates. When asked about the "$100 laptop" (a popular name for the Children's Laptop 1 XO device) Mr Gates dismissed it saying that prices are always coming down, so that in a few years we can make devices for around $150-$200 which don't sacrifice functionality and use decent screens and decent batteries. Erm...... Perhaps by "decent screens" he meant the sunlight-readable screens showed off earlier on the show. Well guess what? There already is a $150-$200 laptop with just such sunlight-readable, extremely high resolution screens much more advanced than any other laptop in the world, which also use brand new long-life, cool-running, non-explosive lithium ferrous phosphate batteries which I think would count as "decent", considering the fact that again they are more advanced than any other laptop's in the world. Wanna know what this amazing laptop is? Visit if you want to find out.

This marketing strategy is insidious. It doesn't scream about the advantages of one system and the weaknesses of another, instead it inserts misinformation into conversations and discussions, gradually twisting the general opinion about what something actually is, and therefore makes it easier to coerce people into dismissing the adversaries' systems since they are dismissing a terribly thought-out system with many problems (ie. the one made up by the marketing bullshit to slyly replace the real, decent system people think they are hearing about). If Billy was talking about the Intel Classmate PC then I would probably agree with his statements (although the "in a few years" part could be replaced with "now, if you look at the XO"), but focusing on the hardware (even if it is extraordinarily ingenious and desirable) misses the point completely, and the whole issue of "One Laptop Per Child" and "$100 Laptop" damages the actual mission in my opinion, because it diverts thinking immediately to the implementation instead of the problem, design, etc. This pervasive misinformation spreads itself and can be found all over /. along with many other presumably-knowledgable areas (thus reinforcing the thought that this must be the truth, because geeks say it). The same can be said of Linux and Free Software. Most of our marketing and advocacy has to focus on shattering commonly held misconceptions, rather than actually getting useful knowledge across.