effects of news of death

It’s amazing the effect death has on one. Or rather the differencehaving met someone makes in the news of death of someone. When i heard my manager’s husband killed himself, was sad for him.

When I heard prabhu, a guy i met at CTC during the yercaud cycling trip, died during another trek, it has upset me long enough to disrupt my work for the day so far. (4-5 hours) .
And am sure, it will get back to me again some time during the week. one of the first thoughts is damn, it could have been me running away from bees and falling into a pool. and drowning.

The more i think about it, the more i am puzzled by the affect this guy’s death raises/arouses in me. I did not know him very well, we met on that cycling trip, and i’ve been out of touch with him after that. He was one of the first bunch to notice me i had fallen and hurt myself, after i was back on the bike and these guys caught up with me.

Maybe, that’s why. the simple act of noticing torn pyjamas and enquiring about it, must have had an impact. Hmm. interesting.

Infact, so much so that, i want to go and meet his parents, but realize, i can’t say much. Usually, these cases, people say their experiences with the dead person,(biased in a positive light ),.

One part, was that i don’t know swimming and i go to treks. Another was the realization of my own mortality.

Not to mention, i was up till 0500 in the morning watching human anatomy videos, cutting and taking apart, cadavers and explaining what happens.

programming abstractions

I remember my first program in C. I remember my self-chosen first programming challenge, write a image processing library in C++ and learn C++ on the way.. Duh.. how naive was i.

Once upon a time i did imagine that new programming languages will make it easier and simpler, how naive was I.

http://www.joelonsoftware.com/articles/LeakyAbstractions.html

Now 12 years on from when I first learnt C, i see myself still running into frustrating, stuck dead-ends, it actually seems i run into the more often than I used to when i started, funny.. But as joel puts it here, new programming languages don’t make the learning curve shorter or easier. They just make it easier to deal with higher complexity programming projects.

Anyway, right now am stuck at the abstraction level of nagios nrpe application/daemon trying to connect.

And what do i do? i take a break go home.. do nonsense and other stuff and then come back.. I end up getting exhausted or frustrated by the sheer volume and variety of open-source software out there. begin to lose interest in figuring out all those, especially since technology seems to be coming out very very fast. Decidi i should go back to math and work on it.. duh..

But overall it has been an interesting experience so far and good training. one of the next things i need to do is quit the GUI for most of my focused work-mode.. the window focus changing si too demanding and distracting if i have to think deeply. I am beginning to understand why so many people working on multilpe languages and stuff, use the console mode for work.

C_learnings from trying to fix cpython bug #8452

argc passed to a C main function is a special type of variable.
it seems immutable. and not only that it seems like an implicit pointer.
whenever i use it in say memset(ptr,0,argc) it throws me a runtime error
“Use of uninitialised value of size 4”
on the valgrind

Phew,.. i have been trying to moonlight on fixing a cpython bug to add another readline function to the python readline module.
What a task it has been. i have clearly been mis evaluating my C knowledge. While a majority of the language concepts still seem to hold solid, boy my memory of the syntax has been lost.. and perhaps more sadly, my thinking/design thinking has gone so used to python that i just don’t think about types before i use variables… My brain just conveniently ignores them.. damn it.. that’s a bad addiction in general anand….

Anyway, even without all those problems, it turns since i haven’t used gcc, or worked on the cpython code base, it’s stupid of me to make optimistic time expectations.. that eventually led to frustrations..
Anyway, after what seemed to be 10 days’ amount of work (scattered over 2 months of free time), i have got to the state of getting some of the functions registered with python readline module and being able to call them…. Now time to get on to passing on the variables and functionality checking..

I think it’s a good time to write test cases.. will look into that…

i got the prototype function not found error enough no of times , to look it up finally, and learnt that it is an effect of C standard changes.
in a way to work around/for different C versions(pre-ANSI,post-ANSI,ISO C, etc..), it seems gcc has introduced an option of converting function declarations to the format as prescribed by the given C standard in preprocessor directives. Ofcourse, they don’t try to do it themselves, but allow the C programmer to check of the C-implementation and write a prototype(aka template) of function declarations to convert.

To run the gcc compiler with a strict check use -Wstrict-prototype.

Initial part of this activity was painstaking as i used to either cat and grep or manually search for function defs(based on their names and my guess at what they mean). But sometime after a couple of days, i came across cscope -R. i now just hit Ctrl-Shift-t and run cscope -R in the new terminal… I know there’s vim option but am lazy…:). Anyway, thanks to the authors of cscope program.

And now i run into some function called begin_unwind_frame, with cscope’s help i find it is in a file called prot.c and is supposed to be a function from the unwind protect module for bash. Now what the hell is unwind protect module?? I can’t figure from the source code of prot.c what it does, as it seems to use some magic variable ent to set and unset. weary of having to figure out which import header files,contain this variable, i reach for google and end up reading this instead. Ok that’s interesting but the only way it seems relevant to bash or readline is in ensuring that the file handler for the std. input stream gets set and released. Oh well then i can ignore it as after all my work is for the python readline module functionality and not even the interpreter’s readline functionality… thankfully.. phew..

Quote from the source code for bash/unwind_prot.c
“/* I can’t stand it anymore! Please can’t we just write the
whole Unix system in lisp or something? */”

Haha..

After all these diversions and excursions and more learnings and junk, i finally get the code for query_bindings function from bash builtin bind.def source code into cpython readline module and get it to compile and import the module fine.. (Mind it i had to figure out cpython’s method of registering a new function with python module. )So what happens now, when i call the query_bindings function? does it work yet? can i just post the diff and let cpython regular people chirp in and criticize/clean it up? Ofcourse not, it segfaults..
Meh…

well now to do some real work instead of just reacting to the compiler’s yellings and fixing errors.. i.e: to actually understand what that piece of C code does, it seems to involve me reading more linked C code so i have put it off, but can’t avoid it anymore.

turns out readline.h has some conventions. i need to figure out what exactly that keyseqs variable is i.e: the return type of the rl_invoking_keyseqs function… i have to go down the rabbit-hole of C call stack to find out and i forgot what i saw on the way, but it returns keymaps
and what is keymaps? it is a structure with a char and a function pointer(mapped to a readline function). ok that makes sense, now how do i convert this to a string, that too a python string and print it out. Once i convert it to a python string i can just return it and the python interpreter will take care of printing it, so atleast that part of the work doesn’t need to be done.. time to go poking out bash/builtins/bind.def for how it converts the output to a string and prints it..

Ok it turns out keyseqs is really just a pointer to a pointer to character data. So now the question now is how to convert it into a list of strings in python.

thoughts on s/w is eating the world

Marc Andreeson: in his interview reiterates his 3 forms of thesis on software is eating the world (weak, strong, strongest). I think the strongest form is where it will take the longest time period to come to frutition. Honestly,I have no hopes of seeing it in my lifetime. I think there are a lot of revolutionary changes in transportation, material science, etc.. for that to become true. I am thinking in terms of the logistics of materials problem. That problem needs a lot of basic science revolutions to improve.

The weak form i think is already underway and peak within 5-10 years(aka, within the decade). The strong form is what i find very intriguing, as it can have a big impact on my life, and i can do something about it. It basically says software is going to dominate other industries outside of the software industry.