IdeaMonk

thoughts, ideas, code and other things...

Tuesday, December 29, 2009

Interesting chat with BakaBot and a stranger.

Labels: , , ,

Sunday, December 27, 2009

Simple Scrolling down in jQuery

Well tried getting jQuery ScrollTo plugin to work, and I couldn't. Anyways that looks like a pile of mess and in my case I don't want to scroll anywhere other than bottom of an element.
Eric's blog mentions a very clean way to do it -
 var objDiv = document.getElementById("divExample");
objDiv.scrollTop = objDiv.scrollHeight;

and what I am doing is precisely the same but by using jQuery animate -
$("#chatbox").animate ({scrollTop:$("#chatbox").attr('scrollHeight')},500);

The good this about this one is, that it actually scrolls down smoothly :)
Looks great if you are popping out small divs at bottom of a container as in my case -
$(gimeMeADiv("Hello World")).hide().appendTo("#chatbox").show(400);
$("#chatbox").animate ({scrollTop:$("#chatbox").attr('scrollHeight')},500);

One noticeable point is that, always keep .animate()'s time period greater than .show()'s, otherwise it won't scroll completely to the base and the new element hasn't grown yet.
This is the chatbox div where I am populating messages with auto scrolling :) -

Labels: ,

Sunday, December 20, 2009

Easiest way to reset mysql server password.

I was almost going to give up on resetting mysql password, even the ones mentioned on mysql page did not work due to security policies and mysqld_safe would just not start working :/ bleh! Until I found the other way round :) thanks to some Debian goodness -
sudo dpkg-reconfigure mysql-server-5.0


That's all :)

Labels: , ,

Monday, December 07, 2009

FlashLearner 0.1 on Maemo

Another abandoned project which I don't see reaching finishing point in near future. Was playing around with PyGame and Maemo SDK very shortly after foss.in. Grab the source here -
http://github.com/ideamonk/FlashLearner/

Its a basic flash card app that should turn your n900 into a flash card :D



The patience to install maemo sdk is there no more, but the good part is that its a normal PyGame program which can go where ever goes python+pymage support.

Labels: , ,