traversals of a schizoverted mind

mind — (nay, billions of cells evolved over millions of years out of hydrocarbon molecules)

Category: Uncategorized

Ticklesss cpu — lwn article — thoughts and comments.

Came across this article and out of curiousity ended up reading this . Note the dates, the original proposal or Proof of concept code and patch set was started 3 years ago.. Phew… i guess given the complexity involved it’s necessary, but kinda puts some perspective on the blind Windows bashing i used to do until a couple of years ago.. Very humbling..

Anyway, this part of the article triggers some more thoughts/ideas from my memory..

enable the no-tick mode whenever the workload is right for it, regardless of a request (or the lack thereof) from any specific process

Years ago, i had applied for the M.Sc in management sciences program at Indian institute of Science. Bangalore. By some fluke, i cleared their entrance test and was called for the interview. One form i had to fill out before it was to make a project/thesis proposal. I was naive, optimistic, had just read Eli Goldratt’s Flow (management book) and had just learnt a bit about linux kernel scheduling.. So ofcourse, i wrote out a proposal to replace the kernel scheduler with flow-based management. i.e: to say based on the workload requested by the currently running processes, we can schedule them.
I didn’t know any better to understand the complexities and details involved, but was mostly adviced that i should have applied to the CS department.. Anyway,now this comment tells me i need to look at what is currently being done, and motivates me to see if i can contribute, even if only by commenting and adding to the discussions.

Gervais principle — -sociopaths reckoning

Warning: this is supposed to be a follow-up to the series of articles here.. Without reading you’re likely to misinterpret or completely miss the point of the article. Given my writing skills, it may not even make sense even if you have read it, in which case, i beg you to point out where the jumps are and i’ll explain what i was thinking but forgot to write.

. OK,  i got tired of waiting for venkatesh rao for getting that sociopath’s reckoning part of the gervais principle. So i decided screw this, i’ll write my own.

So what happens to these sociopaths that regularly use, pull and setup HIWTYL manuevers on each other and on losers and the clueless?  Well, as with so many other things in modern life, they make it a habit*. They start pulling them out of sheer reflex on every aspect of their lives. I would be happy to bet that these sociopaths(not sure how that can be defined operationally for a study?) end up with complicated, out of the norm, personal lives, late marriage, affairs, divorces, widely public scandals etc…  In The Office Example, Michael’s affair with Jan and Holly. Jan’s breakdown when she’s being let go, George Clooney’s single hood/fantasy relationship in “Up in the air”, etc..

It gets progressively harder to pull off HIWTYL maneuvers as time passes and the bunch of young people coming in turns in to be more street-smart vs educated. (Almost wants me to join them) it’s one of those rare professions where you need to keep getting creative just to stay in place, sure the cycling time may not be what i think it is, but it definitely gets harder every cycle. You also want to get and promote some of those vacillating between losers and sociopaths(Jim in the Office example), all the while keeping the increasingly agitated/getting crazier clueless calm and clueless. Most of these i write/say from the viewpoint of the timeline of a declining organization.

And this habit of looking out for contracts and options in every aspect of life, and looking out for clauses(in the legal sense) that add indemnity/responsibilities is why the whole pre-nuptial agreements concept rose and perhaps added complexity. The irony ofcourse is that, you’ll end up having to depend/trust your lawyer based on past experiences, recommendations and interactions with  him/her in natural language(most likely vocal/verbal contracts/promises, that are hardly enforceable).    Adding one more level of difference calculus will give you the source of gossip columns and their effect on celebrities, but i diverge from the topic..

Another effect of this HIWTYL behaviour, is a constant, exploration of how can i exploit this current situation in a short-term (gah, i hate that word, i mean bound/fixed time limit) scenario. yet another way to classify the sociopaths, line staff, and hierarchical ladder positions is to see how much and what part of their HITWYL behaviours are automatic/habituated learning vs how much of them are deliberate… Warning, there’s a confound in the form of the actual industry they are working in, and it’s intricacies, but it holds in general.. So overall the Sociopaths are doomed** to lead mostly unsatisfactory/unhappy lives. You know they end up with a more than needed amount of money, but spending a lot to keep getting more money, spending to keep the appearance, spending to avoid meeting people who want to take it away etc…. But that sort of happiness can only be achieved within the organization by taking up the Career path of the loser.

* — The cognitive scientist in me wants to pull in more details, read up more research, but i don’t have the time for that now. may be later.

** — In the sense of happiness as quoted/highlighted by McCandless “Into the wild” on Tolstoy’s book

“I have lived through much, and now I think I have found what is needed for happiness. A quiet secluded life in the country, with the possibility of being useful to people to whom it is easy to do good, and who are not accustomed to have it done to them; then work which one hopes may be of some use; then rest, nature, books , music, love for one’s neighbor – such is my idea of happiness. And then, on top of all that, you for a mate, and children, perhaps – what more can the heart of a man desire?” …”

flashing my sony neo V phone

In a fit of bravery/stupidity(you pick :) ), i decided to flash my phone with cyanogenmod. and being the naive idiot i am ended up with something that just doesn’t boot and seems to get stuck at the boot screen splash page with FreeXperia logo. After some more mistakes(i.e using haida vs hallon etc..) i finally got some boot.img flashed that lets me login and make changes via the clockwork mod recovery manager at boot time. but still despite trying a few other images, i can’t get to a bootable OS. After lots of search, download, install, boot, and failures, i decided enough is enough, it’s time to try my hand and building an OS from source. I remembered my love for mozilla and decided to try Firefox OS. Unfortunately my device is not supported. Darn. not to be disappointed, i decided, i’ll come back and figure out how to port it to my phone, when i have understood how to figure out the debugging tools on boot and see what’s happening on the phone. Anyway, i come across this and i hit the jackpot…* Ok, i need to figure out the toolchain for cross-compiling to ARM architecture from my x86_64 arch machine, but then i already have a whole set of kvms and virtualization packages installed, i guess it wouldn’t be too hard huh?? Also this seems relevant.. Oops that repo seems to have gone. but this does seem relevant And this is positively cool.. http://www.gnuarm.com/ArmDevices_frame.html * — Hmm. that doesn’t seem to have a default config for neo V MT11i which is nicknamed haida, it seems to have a default config for hallon though. Wonder if i should spend time building the kernel on that or figure out the configs for my device. Oh well let me write to that guy. Crap that blog comments doesn’t work, throws me some php error dang.. P.S: that firefox OS repo sync keeps running forever… damn.. UPDATE – 28-01-2013: Ok enough is enough.. no more undocumented half asleep installation attempts and moaning.. Now it’s 0048 hrs am downloading cyanogenmod-9.1.0-haida.zip for ericsson neo V. Ok i got it and put in the sdcard and used the install from sdcard option by booting into cwm recovery mode. I got an error as follows: “assert failed: getprop(“ro.product.device”) == “MT11i” ||getprop(“ro.build.product”) == “MT11i” || == “MT11a”, || ==”haida” ” Ok clearly either my belief that i bought the MT11i neo V sony experia phone is wrong or something got changed when i unlocked the bootloader and put in a boot.img from a cm.zip file. Whatever am now trying to flash a new boot.img from my new download zip file. Mainly because the probability of me being stupid and having flashed the wrong image file is higher than remembering the model name wrong..:-) and ran into trouble getting adb running on my 64bit trisquel box. Damn it.. turns out adb binaries are by default 32 bit damn it.. still came across this and i learnt about objdump cool. 0210 hrs Okay done with flashing the new cm9 haida boot.img.. fastboot boot boot.img.. Now it seems to stuck at the freeXperia boot screen and i can’t seem to get into the cwm mode. 0213 hrs.. OOps same error again.. Hmm brain’s on strike, time to take a nap.. 0229 hrs.. Ok last sane try, before i go home and sleep… atleast now i know i have the right boot.img. it has been neo V device am sure of that.. time to try editing the updater file as mentioned here.

Ok still installation aborted only this time no error message. Ok that’s it, i give up.. am going to sleep and trying this some other time tommorrow.

0341 hrs..
Finally at the haida cm-10 circling animation logo.. it was haida alright just had to get the cm-10 and update the boot.img too.. cool.. am in..

Mechanical Sympathy: CPU Cache Flushing Fallacy

http://mechanical-sympathy.blogspot.in/2013/02/cpu-cache-flushing-fallacy.html

my laptop hunt woes

I have been hunting/narrowing down on a laptop i want or need and have come to the conclusion that, unless i build/assemble one myself, i am doomed to buy one of those pre-packaged,over-priced junk.
Sites-wise, Dell’s site is the only one that provides a decent UI of filtering based on features. Lenovo’s is the worst.. It forces you to choose some series based on whatever junk their marketing department decided was their goal. I mean there perhaps is some correlation and it is a good navigation for someone who doesn’t want to spend comparing hardware specs.

But for a Techie like me, that’s outright condescending.
On the packaging, part clearly there is an established habit among consumers to correlate price and HDD size and all the laptop vendors are utilizing it as much as they can.
Don’t get me started on Acer, they have 3 categories Notebooks, Ultrabooks, Netbooks.. WTF is the difference between these nonsense categories??

Toshiba UI compares nicely to the Dell one in terms ability to search by price, but still has the packaging problem. Guess that’s the standard in laptop market and it’ll take sometime for the business model to be disrupted, by a clever, laptop assembling company.

Here’s what i want:
1. Storage: A SSD for hard disk(anything > 32G will do). The point of SSD is just to hold the OS and packages i end up installing and can get to use on the fly. Guess a 64G is a good limit for it. For any data am just going to be using my external SATA Disk.
2. Processor; most of my operations i plan to do are computation intensive. I plan to run some NLP algorithms, Machine Learning algorithms etc… Perhaps i can expand my master’s thesis. So a good processing power is a must. preferably core i7(but due to the packaging and price limit, i might end up going for core i5)
3. RAM: Again given my usage, and that am not a fan of heavy loading complex physics games, a minimum of 4GB DDR3 sounds reasonable.
4. Graphics Card: Again, not being a frothing at the mouth fan of video games, am willing to forgo heavy acceleration graphics card, and settle for normal,decent graphics performance. Intel HD graphics 3000 seems to fit the bill.
5.OS: My biggest grouch/pain-point. I don’t care for Windows 7′s new shiny UI. I have been on linux for a couple of years now, and find it painful to work even on Windows XP. Given that, i would rather, get one without any OS, but it seems like i won’t. I just can’t find a laptop without Windows installed.

From what i understand about the hardware prices, it should be possible to put together a laptop with these component within the 50K-60K INR price range.
But no apparently according to the Dell business/pricing team, if i go for a 6GB RAM i will also want a 1TB hard disk. Darn..

And if i go with a i7 i’ll have to go with a minimum of 500GB HD or 256GB SSD..Gaargh…Either am totally missing something about the hard ware price ranges.. or dell is designing it’s laptop packages to maintain their profit margin. And given my decent Quant. Aptitude skills i suspect it’s the latter.

attention money metaphors

Title : Attention Economy/Attentoin metaphors
Date : 03/04/2012 11:31:41 IST

$ latex
Ever since i read this post on

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.

Follow

Get every new post delivered to your Inbox.

Join 276 other followers