December 25, 2013

കലണ്ടറുകൾ

ഒരു ഗൂഗിൾ പ്ലസ് പോസ്റ്റ് കണ്ടപ്പോൾ കലണ്ടറുകൾ എത്ര പ്രാവശ്യം വരുമെന്ന് നോക്കണമെന്നു തോന്നി. ഇതാണ് റിസൽട്ട്:
എഡി 1 മുതൽ 5000 വരെയുള്ള കലണ്ടറുകൾ ഓരോന്നും എത്രപ്രാവശ്യം വരുമെന്നെ കണക്ക് ഇതാ:
      1 bd30d102085f9899cb6c2c2060307f85
    167 36f01bef85a89cc8e951955441653a4e
    167 c197d36fcec25aced5da1e93368aa8c3
    168 f93d80b2ff5e304125310452ea18560e
    175 17e88e8be482fd24e98d2de1234b62ea
    177 048b5d0fc88e9f6768bfdc2d7580d8c7
    185 22465bceeda7b12a8e1dbfb8f8ce605d
    185 d4d9912ad523f8bcab60ee8a247e40eb
    535 8cf2c8f2157920ab14211ef3d51829de
    537 1a2b91b95b224758a3f2a88d60f96a89
    537 1ab991e95f86b6efa9364b926cff539c
    537 d50d4d721243c8b0163795fb8dfd3a3c
    538 b450c6e75884ad695c5f8a512b366414
    545 651a68a9dbc555d8629dc50dbdb23a54
    546 08c08487b9fed33686e68872ad833150
ആദ്യത്തെ അക്കം ഒരു കലണ്ടർ എത്ര പ്രാവശ്യം വരുന്നു എന്നും രണ്ടാമത്തേത് കലണ്ടറിന്റെ md5sum-ഉം ആണ്. ഇതനുസരിച്ച് ആകപ്പാടെ 15 കലണ്ടറുകൾ മാത്രമേ ഉള്ളൂ എന്നു കാണാം. 1752ലെ പരിഷ്കാരമില്ലാതിരുന്നെങ്കിൽ 14 എണ്ണമേ ഉണ്ടാകുമായിരുന്നുള്ളൂ. ഇരുന്നൂറിൽ കുറഞ്ഞ എണ്ണമുള്ള കലണ്ടറുകൾ അധിവർഷങ്ങളുടേതാണ്.

md5sum-ഉം കലണ്ടറുമായുള്ള മാപ്പിങ്, ആദ്യം md5sum, രണ്ടാമത് വർഷം എന്ന ക്രമത്തിൽ:
1a2b91b95b224758a3f2a88d60f96a89  - 1
d50d4d721243c8b0163795fb8dfd3a3c  - 2
b450c6e75884ad695c5f8a512b366414  - 3
048b5d0fc88e9f6768bfdc2d7580d8c7  - 4
651a68a9dbc555d8629dc50dbdb23a54  - 5
8cf2c8f2157920ab14211ef3d51829de  - 6
d4d9912ad523f8bcab60ee8a247e40eb  - 8
08c08487b9fed33686e68872ad833150  - 9
1ab991e95f86b6efa9364b926cff539c  - 10
22465bceeda7b12a8e1dbfb8f8ce605d  - 12
17e88e8be482fd24e98d2de1234b62ea  - 16
36f01bef85a89cc8e951955441653a4e  - 20
c197d36fcec25aced5da1e93368aa8c3  - 24
f93d80b2ff5e304125310452ea18560e  - 28
bd30d102085f9899cb6c2c2060307f85  - 1752

ഇത് എങ്ങനെ കണ്ടുപിടിച്ചു എന്ന് ചിന്തിക്കുന്നവർക്ക് വേണ്ടി:
ഒന്നു മുതൽ 5000 വരെയുള്ള കലണ്ടറുകളുടെ md5sum കണ്ടുപിടിക്കാൻ :
for i in `seq 5000`
do
        md5Sum=`cal $i | tail -n +2 | md5sum`
        echo "$md5Sum $i"
done > res

കലണ്ടറുകൾ ഓരോന്നും എത്രപ്രാവശ്യം വരുമെന്ന് കണ്ടുപിടിക്കാൻ :
awk -F"-" '{print $1}' res |sort  |uniq -c  |sort -n

md5sum-ഉം കലണ്ടറുമായുള്ള മാപ്പിങ് :
for m in `awk -F"-" '{print $1}' res |sort  |uniq`; do grep "$m" res | head -1  ; done | sort -n -k 3

വമ്പിച്ച ന്യൂഇയർ ഓഫർ :
വിൻഡോസിൽ ഇതുപോലെ പത്തുമിനിട്ടുകൊണ്ട് ഈ ഡേറ്റ കണ്ടുപിടിക്കാനുള്ള ബാച്ച് ഫയൽ ഉണ്ടാക്കുന്നവരുടെ ലാപ്‌‌ടോപ് ബാംഗ്ലൂരിൽ എത്തിച്ചാൽ ഫ്രീയായി ലിനക്സ് ഇൻസ്റ്റാൾ ചെയ്തു തരുന്നതാണ്

December 18, 2013

Fedora 20 installation

Fedora 20 was released yesterday and I managed to download the DVD by this morning. Pretty soon I found myself installing it in a virtual machine.

The installation procedure was mostly smooth. Few annoyances from Fedora 19 still lingers. When I was installing Fedora 19 for the first time, I clicked "Installation Destination" expecting to see some mechanisms to partition the disk; couldn't find it there. You have to click "Done" to see that - not very intuitive. The story is no different in Fedora 20. You can partition it either automatically or manually once you get that screen.

The software selection is still a bit of disappointment. There are some pre-configured profiles/environments/settings. It is difficult to customize the software selection from here. I guess I need to try this part once again to see how selecting software from different profiles/environments works. Since I use KDE, went with KDE Plasma Workspaces. I remember selecting Firefox somewhere but it was not installed!

The installation process went through without problems. However it took a while (about 10 to 15mins) in the post-installation setup tasks though - may be because it was running in VirtualBox.

After a reboot, I was able to log in to KDE (4.11.3).  Within few minutes of logging in, package kit told me that updates were available for 177 packages :)

Didn't try the new installation much, but will be testing it bit more in the coming days.














December 12, 2013

ID3 Blues

I primarily use Amarok to play my music. One of my long standing gripe about Amarok is it's inability to read the lyrics from the id3 tags. This was not a major issue since the Amarok's lyrics plugins were able to fetch the lyrics from some external sites. However the online retrieval didn't work when I was listening to some new Malayalam songs[1] as the lyrics was not available online. That was when I tried to modify an Amarok plug in to read lyrics from the tags.

Since I had no experience with Qt Script, extracting lyrics using Qt Script  within the plug in was out of question. I thought of extracting the lyrics from the id3 tags using some utilities to a file and read it from the plug in. Tried to extract the lyrics using id3info and id3v2 but no lyrics[2]! Then I briefly considered writing my on program to extract the USLT frame scrapped the idea when I realized how crazy  the id3 format was.

Now I know why Amarok developers haven't implemented the feature to read the lyrics from the id3 tag. No wonder people consider it is easy to fetch lyrics from online instead of reading from the tags[3]. While reading about the id3 tags, I came across this post from Coding Horror - http://www.codinghorror.com/blog/2006/08/a-spec-tacular-failure.html I couldn't agree more. I guess it is high time someone come up with something simple tagging format instead of the id3 mess.

[1] The songs are from http://onam.eenam.com/. It is a nice album released under CC-BY-NC-ND license.
[2] To my surprise exiftool was able to extract the lyrics from the mp3 files. However I could not find a way to trigger the script that extract the lyrics. Finally I had to trigger the script from conky and the plugin was able to read the extracted lyrics from the output file. Since this was very inefficient, I manually copied the lyrics to Amarok's lyrics tab and solved the problem for the time being.
[3] Clementine & mpd fetch lyrics from online lyrics databases.