Sunday, November 11, 2007

the first story

once upon a time there was a grandmother who made vada and sold them, she'll eat the last vada as her food.
one day a crow took away the last vada, grandma became sad, and started to cry, her beloved pet, a dog named dommy, wanted to help her, so he went to the tree where the crow took shelter and said, "how  beautiful you are, i want to hear your sweet voice, so please sing for me", the crow became overjoyed and started to sing, kaa kaaka ... the vada fell from its mouth, the dog picked the vada and gave it to grandma, both lived happily ever after.

the moral of the story is, if i don't have anything to write, I'll write these kind of things, so forgive me

Blogged with Flock

the Zzz Stories

once upon a time ....

i am a great lover of stories, i wish to share interesting ones here ...

nowadays i have been adding the "Zzz" sound to most words, so welcome to "the ztories"

http://zstories.blogspot.com/

welcome

once upon a time ....

i am a great lover of stories, i wish to share interesting ones here ...

nowadays i have been adding the "Zzz" sound to most words, so welcome to "the ztories"

Saturday, November 10, 2007

Give windows a “bash”

How many of us, who love the power of command line feel handicapped when it comes to windows, with its pathetic cmd.exe or command.exe, I was missing the auto-completion, multiple tabs, and most importantly the commands, pipes, redirection, tee, I am not sure of the windows equivalents of these, so I was looking for some way to Linux-ify my widows.

Being a TA required me to compile few softwares for windows (skyeye, softgun, arm-elf-gprof etc...), so I had to choose between MinGW and Cygwin, first I started with MinGW and found it quite inadequate, since Cygwin gives a complete Linux environment, I settled for it, but I still miss the tabbed terminals, I was searching for “tabbed command prompt” in google and found a few links but none were open source, some how I stumbled upon a blog where they have mentioned about Console2, an open source one currently under development, so I downloaded it and am pretty happy about it, now i'll give a step by step procedure how I got a almost working gnome-terminal(or Konsole) alike...

  • download and install cygwin
  • download and extract console2
  • open console2
  • press ctrl+s to bring settings dialog
  • go to tabs option, click add change title to you something you want, select cygwin.bat from CYGWIN_HOME, press ok
  • now if you want a cygwin terminal press ctrl+f2 (assuming the cygwin appears below console2)
If you dont want cygwin then you can use gnuwin32 package, and add its wbin folder to path and just use console2 with all the power of unix

Console2: http://sourceforge.net/projects/console

Blogged with Flock

Banana, Good day & mineral water

what is your favorite mode of travel, 3-tire AC, Business class air travel or a private cruiser, mine is unreserved train travel, i.e.. general compartment, my friends who knows Hindi can recognize my Hindi knowledge which is mostly attributed to train travel, “Yatrigan kripya jyandije .. ghadi number ... Mumbai sai Chennai central sub janevalli ....platfrom number .. aaye hey”, ya I know its not exactly Hindi, but this is what I “hear”.

I haven't tried any form of luxury travel in my life before coming to IIITB, some times I end up paying 190 bucks for Bangalore-Mysore trip because its a bit faster and I can sleep properly(it doesn't mean i cant sleep in other situations), the one thing that I miss after coming to Bangalore is train travel (the other one is hot sun).

I don't know how many of you will agree that it's fun to travel in general compartment, the never ending line of vendors selling anything like chikkus, bananas, roasted ground nuts, murukku and other eatables.

I observe that most people in reserved compartment are well planed families who have the idea of hygienic food (i.e. Cooked and packed from home) or people who don't hesitate to spend money in branded products or people who hesitate to buy from these poor vendors, why others, even I feel awkward to buy and eat from these vendors when I travel in reserved compartment because no one else will be doing that, so I decided to be a general compartment person.

I even calculated the amount of money I spent on eating in one journey, 200 bucks is not that bad you know, few cups of coffee, two or three cups of tea, masala tea, tomato soup , ground nuts, samosa, a dozen of chikku, one or two custard apples, bananas blah blah blah ...

I always board the train with Deccan Chronicle and Hindu (why two?), I have to take care of my cloths which are mostly light colored ones (I have to wash them), so DC helps here..i travel light, light in sense real light(both in money and luggage), I didn't have a mobile phone, mostly I'll be unshaved and wouldn't have had a haircut, a small bag with a set of cloths and some books, every time I reach home I'll be hearing the same comment (grandfather: who will believe if you say you are a college student, mom: why torture me every time, all our relatives know about your pathetic state, I wont find a girl for you, dad: no girl will come near you) irrespective of what time I reach home (mostly around midnight), followed by “did you eat?”, the obvious answer is yes, no matter weather I ate or not, I don't want to trouble my mom to prepare something at that time, first of all I wont inform her, giving her an unpleasant surprise, and she'll be very angry of my appearance(don't forget the long nails).

I think I understand the kind of people who do general compartment travel, some wired people(Me!!), daily travelers, some people who didn't get a reservation or unplanned journeys, some poor people who don't know that reservations exist or can't afford that, etc.. however very few people enjoy journeys the way I do(I think), the heavy wind (some times hot) that hits your face when you sit near the door, the struggle to hold sambar from flowing out of plate, the water splash on face(people wash their hands thro the window, ya I know yuk..), fight between kids, elderly people, general discussion that ranges from politics to daily life, hmm It feels good.

But I should caution, if you don't like to sit with dirty people, hear some unpleasing words, worry about sitting comfortably through out the journey, or people snoring in your ears please stay away.

Other than that it's a wonderful experience to know about the majority of India, eat good snacks and fruits at throw away price, get good flow of air, and most importantly get to know some “good” bad words.

Welcome, to a new world of journeys


PS: what is “banana, good day & mineral water”, my regular food/eatables during journey nowadays, I cant expect vendors at every stop in bus, can I?.

Blogged with Flock

Tuesday, November 06, 2007

infront or infront of back

sounds crazy right, i could not come up with a sexy title for (pre or post increment operators in c), anyways today the issue of pre/post increment operators in c, sagar and i had a good 15 minute discussion how this works so he results are here

int i=5;
printf("%d,%d,%d",++i, i, i++);
/*
output: 7,7,5
*/

how, we understood that printf evaluates from right to left, so it'll do i++ first and return '5' and update value of i i.e. 6 in stack, the middle i is just i, the first ++i, will increment value of i in stack i.e. it becomes 7, now it'll examine the value of stack finds i=7, therefore it substitutes 7 as first and second argument


int i=5;
printf("%d,%d,%d",++i, i, ++i);
/*
output: 7,7,7
*/


how, we understood that printf evaluates from right to left, so it'll do ++i in stack i.e. 6 in stack, the middle i is just i, the first ++i, will increment value of i in stack i.e. it becomes 7, now it'll examine the value of stack finds i=7, therefore it substitutes 7 as first and second argument

because in post increment operator, the assignment happens before increment, therefore in case one 5 is assigned or returned, and get incremented on stack.
fair enough understanding i think.

refer:-

Blogged with Flock

Monday, November 05, 2007

Nurses or NCurses

the first time i saw this package was during Fedora Core 1 installation, a nurses package... what a funny name or is it really for nurses, but i forgot about it.
next comes kernel compilation for Advanced OS class, where make menuconfig reports some error in ubuntu.. after some digging someone found out that we have to install libncurses-dev package for it to work, and i remembered that funny incident that happened 3 years before.

the assignment questions seemed simple
  1. Observing “Linux“ behavior“ by writing a program to use the  /proc  mechanism to inspect various kernel values
  2. Learn how to write a UNIX—style shell program
what big deal, half the program is in book complete it and finish the assignment, my "proc" will intelligently display the status of the program if you give PID, and as an unexpected move Prof SN was completely "satisfied" with our work so we have to redo it.
so i want to add interactivity to my shell , that is history, command completion etc.. , so i have to capture keystrokes, but what shit, ours is not a complete shell, so the shell that we run on didn't give us the keycodes that we expect .. after a lot of blah blah .. nurses or ncurses came to resuce, there is a getch() function will capture all keys if we set keypad(stdsrc,TRUE), done...

worked for three more days to "port".. when every thing is working .. Hmm this is not what i wanted SEGMENTATION FAULT, why the hell!!, Hmm if do chdir() there is a seg fault, i got bugged of curses so had to revert back to non-interactive shell, but i can upgrade my proc code to work as a task manager (like top command) again 2 days of work, i could implement killing a process provided you have sufficient access rights, ya i know it has lot of flaws but i believe it is a "proof of concept" , now ask me do something in ncurses, i can do it with a bit of struggle.
next is a file manager in queue .. (long live ncurses ).

food for thought: try "tpp" the ncurses based based presentation program, ultimate, so decided to torture people with "tpp"  (available in ubuntu/debian repos)

Blogged with Flock

Movie Morning ...

we all would have heard about and experienced movie nite's, here is a place where we have movie mornings.

After making sure that i sleep early and get up early (save my wife) i have good amount of noise free time in the morning (say 4 to 8), first i thought about preparing for placements but god thought in different way (ya i believe in god vijay), gouuth@tLL happened and postpone that placement preparation forever...

I thought about doing my TA work, you know its difficult to work when nobody is around to disturb you (hostel effect), so i decided to go to college early ( say 5) and browse hoping that the internet speed will be good( and it is), gradually i got bored of it (actually 2 days), so i had to find some other option to "kill" time, then my old habit(actually CEG habit) of watching movies 24x7 seemed to be the best option, so here i am watching those all damn old movies(some even 20 times), suddenly i felt guilty when everyone in college is doing something important in life ( like sleeping ) WTF i am doing, so i want to see what others are doing, so today i instead of starting a movie directly took a look around and viola, there were 3 groups of people and of which 2 are ... watching movies .. what a good encouraging sight, i hurried to start my MOVIE.

so very soon expect some worst movie reviews here (PS: i kinda like all movies...).
I should say early morning walking alone in cold weather , going to infy for coffee is a damn good one, i urge everyone to try it once in every year ...

Blogged with Flock

Friday, November 02, 2007

MFC

MFC project problem statement is out...
in simple words identify a state machine which will accept the given string of alphabets (full 2 months), god only knows how to do this..        

Blogged with Flock

Intern....

accepted internship @ theLearningLabs, my professors startup.. technical updates will be in super-techie and others will be here ...                    

Blogged with Flock