Friday, September 03, 2010

Trouble with ejecting cd/dvd roms

Today, I got bored and so decided to watch some favorite movie on my dvd rom.(I use fedora/kde by the way x86). As usual when I popped in the dvd drive, I got the familiar prompt "So and so is mounted.. what do you want to do?". All I wanted was to watch a movie, relax, have a beer(just a figure of speech). To my horror, the dvd drive kept spinning and I never ended up watching the movie. Damn you dvd!
       After convincing myself that hulu will entertain me better, I decided to eject the dvd(It was making crazy amount of noise!). Pressing eject/right click->eject did not work.. linux kept ignoring me and continued to struggle with the drive.

Hmmm... I hate when these things happen and gives people the excuse to say "Oh! Linux? its not ready for desktop users.. try mac(pussies - NOTE: I'm not a sexist)". Okay, back to my conjecture...

I speculated, what if some process was using the dvd rom(must be my file manager-dolphin); what if I killed it? would eject succeed?

so pulled down my yakuake terminal and typed in the following hoping it would work.

ps -ef | grep sr0

Shows up hal-daemon and some other shit.. killed 'em all. Still eject button won't work! After googling around someone who suffered as much as I had suggested firing a bunch of eject commands quickly and seems that did the trick.

Closing my eyes, praying one final time hoping I don't have to reboot to take out the damn dvd.. I typed in the following


for i in `seq 1 20`; do sudo eject -v /dev/sr0 & done

and pressed Enter.....

A slew of outputs flew across the screen and finally success! dvdrom ejected.. I wish there was an option to just say 'shut the fuck up and get the dvd out'. Unfortunately no.

Saturday, August 28, 2010

I'm blogging again!

To my non-existent blog readers,
       Thank you for the support you have provided so far! I have decided to start blogging again. As you may have noticed, I have changed the layout of my blog(thanks to blogger for awesome templates). Stay tuned for more updates...

Sunday, January 17, 2010

Fixing Eclipse interaction with kde4.3

I love KDE(no secret!) and kde underwent a big review after Qt4 was introduced. KDE stopped being the environment I loved. So many bugs and it kept crashing all the time. I had to switch to Gnome. I started using Ubuntu(Ubuntu Linux Bible (versions 9.10 and 10.04)) for some time and it was fun for some time. But my longing for KDE just kept me troubling. I was waiting for a stable release and hoping that I get back to KDE. So KDE 4.3 came to my rescue; not only is it stable, its really really fun. 
      Probably I will reserve another post for all the things I love about KDE but for now lets get to the main issue. Lately I wanted to learn Android and start writing applications for the platform. I borrowed "Android Wireless Application Development" from my university's library and so far its just great! 
To develop android applications, I am using google's eclipse plugin. However, lately eclipse stopped working or rather its not working properly on distros with KDE 4.3. You cannot click buttons, only menus work and the eclipse wizards are a pain in the ass! You have to use combination of space bar, tab key and enter key to navigate. Very annoying indeed! Looks like the problem seems to be with the latest SWT framework which has made some kind of internal changes.     
After googling, the fix was very simple. I will describe what you need to do to solve this. It will work for any linux distro you are using. I am going to assume that you have eclipse installed under folder /opt/eclipse. Open your favorite editor(kate/kwrite/jedit whatever) and paste the following contents into the file.
#!/bin/sh
export GDK_NATIVE_WINDOWS=true
cd /opt/eclipse
./eclipse





Save the file under $HOME/bin/eclipse_launch. Next, press Alt+F2. This will bring your runner upfront. Type 'konsole'. After the konsole launches, navigate to your bin directory by typing

cd bin
chmod +x eclipse_launch
Thats it! You can create a shortcut on your desktop for the script or just click the script directly to launch eclipse. The weird problem is gone! Long live KDE :)


Wednesday, May 02, 2007

The Seed Stopper......(Smokey!)

I am having my exams on the 9th and 11th of this month. The first exam is Software Testing which sucks so much, i had to take a diversion today! and guess what a mad scientist does? I created a very small plugin for Azureus which does nothing other than preventing it from seeding any of the files downloaded.
I know this goes against the principles of bit torrent protocol, but for people like me who have a bandwidth of just 10KB/s for upload, its a tough call :( . Anyway I am providing the link here, help yourself. Seed Stopper!!

Also have a look at the release notes for info about installing the plugin.

Wednesday, February 07, 2007

My Multimedia keyboard works.!!!

What a wonderfull feeling.......yesterday by accident i moved the volume scroll on my system.... It is a multimedia keyboard .... however i never expected that linux has installed the appropriate drivers for it .The above screen shot is that of the volume and the bottom is that of mute. Besides the play,next,previous,stop all work..By the way i am using kubuntu :) . Go linux !!! Go!!!! You rock

Saturday, January 13, 2007

An dissapointing topcoder contest....

Yesteday topcoder conducted its srm contest at 10:30 pm . Even though it was pretty late for us i did not mind since i usually sleep late into the night. It was damn cold in my room which was pretty unusual in a city like chennai . I donot know whether it was the climate or was it my body that started freezing ? This was my first top coder srm and i wished i did properly . I was not able to get the gist of the first problem . I got a bit confused . the second problem was regarding a problem validating a knight's move .
the full code is here :http://www.topcoder.com/stat?c=problem_solution&rm=263249&rd=10658&pm=7245&cr=20718854
for (int i = 0; i < cells.length; i+=2) {
if(!this.valid(parse(cells[i]),parse(cells[i+1])))
return "Invalid";
}
this loop was the mistake i did. here what i did was that i paired up two consequtive moves instead of sequence
so suppose you have a sequence of moves say
"D5", "F6", "C6", "A5",

so what my code did was validate knights move from D5->F6 and then the next validate C6->A5
however it should have been
D5->F6, F6->C6,C6->A5 .
then the corrected loop looks something like this
for (int i = 0; i < cells.length; i+=1) {
if(!this.valid(parse(cells[i]),parse(cells[i+1])))
return "Invalid";
}
so its i+=1 and not i+=2!!!!!
damn this seemed to be the easiest that top coder could ask and i messed it up!!!!

the next 1000 sum was easy.......but never did it strike me to use dp or memoization .
so i did the normal way and it took too much time to execute ! :(
http://www.topcoder.com/stat?c=problem_statement&pm=7244&rd=10658&rm=263249&cr=20718854
and here is my solution
http://www.topcoder.com/stat?c=problem_solution&rd=10658&rm=263249&cr=20718854&pm=7244

better luck next time!!!

Sunday, March 26, 2006

My First Music Class!

perhaps for too long have i been writing about my theories... for a change i thought i could write something about my life experiences....... so here goes one of them!

Well.... long long ago when i was still a small kid.......when the world was waiting to hear my beautiful voice, i thought of going to a music class to enhance my singing skills.........so near my house there was a karnatic music teacher

So i went to his house with the notion of mastering carnatic music.... so he gladly accepted me as his disciple and went on to teach me music.......well you know me! i showed him how loud i was.......he was wondering whether he made a mistake of taking me in!(though he didn show it out!)

so days went on and i was gradually improving in my singing skills......now each day the master had a visitor from the neighbourhood! they were asking the master "who is singing in such a beautiful voice"! and he directed them to me! So on the fourth day of my class as usual i started walking towards my music master's house......but i found his house locked for unknown reasons :((.... probably he was'nt well... so i walked back home! He didn come back even after 3 or 4 days.... i started getting impatient..
Suddenly one day my parents got a letter from my music master! And it said

"Your son has such a beautiful voice that teaching him is beyond my powers.... you would and should definitly find a better music teacher!"
and so on.........
that is what my mother said to me......how ever i recently am starting to guess that he ran away from his house due to some compulsions from his neighbours regarding his music class and i was his dear disciple! LOL! my god , my first music teacher ran away trying to teach me music........my parents decided not to send me to any music class from here after..........

well well! that explains why i dont know karnatic music........ but that doesnt mean i cannot sing ! well if you wanna hear mine you can surely write to me and i shall show you! :p