If you are a user of my nationality statistics, some of your artists may get classified as ‘Unknown’. The main problem here is that your artist is not tagged with its nation on Last.fm (if you have other problems, mail me). In the following text I will describe how to tag the artist correctly. If the artist’s nation is still classified faulty after 1 week, just let me know.
First we have to identify which artists are unknown, for this we enter our username in the Last.fm nationality statistics page and after we have received the result we sort the artists in descending order after their country.
Now we see that ‘Ringo vs. Paul’ is listed who are from Germany but listed as ‘Unknown’. By clicking on the artist, we will be redirected to the artist page on Last.fm.
As you may see, I am using the german version of Last.fm, but it doesn’t matter in which language you use it.
Below the description of the artist, the most used tags are listed. Here we do not see any tag that reminds us of Germany and so we need to add some that do. This can be done on the tag overview page which we reach clicking on More… or Mehr… (depending on your Last.fm language).
On this page, you see that the city Jena is listed which identifies the artist as Germany. But as cities are not often recognized by my app, you should add here some tags that are very close related to the country. In this case we add ‘Germany’ and ‘german’ and their corresponding translations.
That’s it. Please remind that changes need up to one week to be incorporated into the results as there are many levels of caching done in between.
Sometimes you need to compile the squashfs module by yourself, sadly this does not work out of the box at the moment in Ubuntu Jaunty. The first thing to know is that it depends on the lzma module as it has some patches in Ubuntu which add lzma compression to it. To start up we just install the needed packages with this command:
sudo aptitude install lzma-source squashfs-source
After that we simply compile the lzma module with these 3 commands:
sudo m-a prepare
sudo m-a build lzma
sudo m-a install lzma
If we would do the same steps with the squashfs module, the build will not work, we’ll have to fix some code as the supplied is not compilable against that kernel version. The source code for the squashfs module is stored at /usr/src/squashfs.tar.bz2 which we need to edit, so we temporarly extract it to /tmp
cd /tmp
sudo tar jxf /usr/src/squashfs.tar.bz2
The first change that we need to do is at line 693 in squashfs/inode.c where we need to replace the no longer existing function d_alloc_anon through d_obtain_alias. The other change is at line 2318 in the same file. The init_once function should only take one void* parameter instead of those two that are dcclared here, corrected line 2318 should equal to
static void init_once(void *foo)
After we are finished with the changes we have to repack the source code into the archive.
sudo tar jcf /usr/src/squashfs.tar.bz2 squashfs
Now, we are able to build the squashfs module with the already known commands:
sudo m-a build squashfs
sudo m-a install squashfs
Thanks to Carlos Costa who wrote an article how to fix this squashfs compile problem in general.
With the new version of the Last.fm nationality statistics I’m scanning the content of the user’s whole music library. Since this is a task which needs a lot of time I needed to cache the result. First, I thought of caching it in the database, but as the cached data is a bit bigger and sending the data from the harddisk to the database server and then to the script would be too much overhead. I implemented a simple file caching algorithm.
My version could be easily used as you only need to supply the filename where the method result could be already be cached (the default lifetime of a cached result is one week) and the method that should be called if the cached result is outdated as a block. The following code shows how my algorithm is implemented and how it can be used:
After some time of work, I’m proud to announce that I released the second version of my nationality statistics. There have been a lot of changes done in the last time:
I'm a computer science student at the Karlsruhe
Institute of Technology. In my spare time I create some nice pieces of
software (mostly for the web), enjoy tuning some of my websites or volunteer
in a fantastic youth organisation.
Read more about me or
my projects.