Sunday, December 19, 2010

Chemically toxicated BrainStorming

Ok So all this happened on a Saturday..
Saturday evenings are perfect coz its Sunday the next day..
So there are no concerns about when to sleep on a Saturday evening.

This Saturday there were some pals from college who had gathered at a friends place in Delhi.

To start off there were the customary Hi's and Hello's.
Then we started discussing cricket as Mr. IdiotBox was out there in its full glory screening India's battle against the awesome pace attack of SA at centurion. All that was the traditional crico-religion talk we Indians get into so frequently even though our assessments of Indian cricket wont cause any difference to the guys there in SA until unless one of us goes on to become the next Lalit Modi :)

Our pal had been out on a EuroTrip.. He enthusiastically portrayed all his experiences to us and most of us were all ears..

That done.. Next ppl started thinking what to do next..

Hence came in the intoxicant..
To fetch the intoxicant we went out at some 9.40 by the time we reached the theka.. it was 9.55 pm.
There were some ppl who were purchasing the intoxicant..
But just before the clock was about to strike 10 things changed radically around that place..
There were so many hands with 500 rupee note trying to get hold of some intoxicant and the sellers of the intoxicant were tensed they had to shut their tent at 10 pin point.

That is when I realised how "Vijay Mallya" became "Vijay Mallya". Boy o boy those quotes around those two Proper Nouns denote the Brand name that is Vijay Mallya..

SO with that realization my friend loads the intoxicants in his school bag..
Yes there was a time that school bag would contain sources of knowledge aka books..
But now that same bag had intoxicants.. And the ppl related to that bag were so very concerned about the contents ..

I was just thinking " Lo School chale hum" when I looked at his bag and grinned.. :D

Back to the room and then placing the intoxicants at the right places.. Intoxicants should have its effects dispersed into the bodies slowly.. So in comes in the glasses which restrict the quantities that can be consumed at a time..

And after the cheers started the conversation :
The points which are discussed:

  • Risk Aversion..
  • The favoured and customary Indian Routes being Risk free..
  • The condition of Gurgaon routes :P
  • Minimal requirements - Roti, Kapda Makaan, etc.
  • What after minimal requirements are met?
  • Facebook in India ?
  • China has its own social networking site and has a some Billion $ eval.
  • Stereotype Indian mentality which wants a degree..
  • Academic pathways are so very programmatic in India..
  • Why Indians find American culture cool even though India is so very culturally gifted.. ?
  • "The Social Network" Movie - passion, Enthusiasm
  • Bread Pakodas and networking? :P - Ppl outsourcing..
  • Serendipity - during placements? - What were the pointers doing to us at BTech?
  • Are the MBA chaps very interested in those stock tickers..
  • Stock market ruining lives of ppl..
  • Speculation has huge alluring powers..
  • Hedging..
  • Futures and options..
  • Gandhi...Merits /demerits
  • Jawahar Lal nehru
  • World wars
  • Vallabh Bhai patel
  • Kashmir
  • Origins
  • Languages
  • Mahabharat
  • Suyodhan v/s Duryodhan - power which the historians have
  • Logic
  • Technology
  • Probability
  • Market penetration through acquisition
  • Innovation
  • Potential in India
  • Hi Slopes v/s continuous slope v/s sustainability
  • Market Cannibalism
  • many more :)

Saturday, July 10, 2010

Facebook Badges Bug!!

Facebook profile Badges doesn't seems to be updating the badge's current city information available in my facebook profile database. If the current city info cant be retrieved from the DB to badge then why give user the option. Bug!! Bug!! Bug!!

Is it because of facebook's privacy setting?? Grr.. I donno.. The point is, facebook badges gave me the option to display the current city on the badge, But it dint retrieve this info from its DB.

This is my facebook profile page which lists my Current City to be: Gurgaon..


Now this is the my Profiles badge page which lists my Current City to be None!!!



The above images aren't clear. Link to clearer images: http://bit.ly/bFrZwA

Sunday, July 4, 2010

Batch file miseries Part 1 !!

Batch files are useful:
  1. Coz you know if its some reasonably contemporary Windows it would work. Obviously the batch file must have been written correctly..
  2. Running of the bat files wouldn't require any separate tool installation etc. Until and unless you've got a messed up windows sytem which has the cmd.exe replaced or the PATH variable messed or many others ;)
  3. The for loops, if conditionals, variable assignments etc. to script are already there.
  4. Using Bat files is a much faster way to browse and work with your machine instead of using the mouse.
But.. The no. of dangerous buts which come up when it comes to batch file scripting are..

Batch file scripting sucks big time
e.g. Simple bat file.. Arrg.. Not that simple coz u'll come up with lot of "was unexpected at this time." and all other kinds of errors.

@echo off

set TESTVARIABLE=init

if "%TESTVARIABLE%"=="init" (

set TESTVARIABLE=used

if "%TESTVARIABLE%"=="used" (

echo This was logical
) else (
echo Bat files suck big time..
)

)


Guess what the output would be?
Bat files suck big time :D

The good thing is that this above problem has a solution even though its rather dirty considering its such an elementary problem if someone wants to script batch files.

Solution:
  1. check the registry key "HKLM\Software\Microsoft\Command Processor\DelayedExpansion"
  2. If it does'nt exist then add the registry key by using regedit or by using this command: reg add "HKLM\Software\Microsoft\Command Processor" /v DelayedExpansion /t REG_DWORD /d 1
  3. Just in case u think that the above script should be working logically when u want it to is to invoke cmd.exe with the flag /v:ON i.e. cmd.exe /v:ON .. On all the other times the default Windows behavior of sucking with bat files would continue :P
  4. To enable the logical behavior only for a particular scope in a batch file we can use setlocal ENABLEDELAYEDEXPANSION. This way logical behavior would be reflected until the bat file execution is over.
The Hkey_Current_User hive can also be changed instead of HKLM if your machine is a multi user machine and u dont want this change to affect other users.

There's one more gotcha:

Once the Delayed Expansion behavior is enabled by using the above methods. To refer to the variables in a different scope we use retrieve the value of the variable by enclosing it with ! instead of %

So the batfile also needs to be changed and it becomes this:

@echo off

setlocal ENABLEDELAYEDEXPANSION
set TESTVARIABLE=init

if "%TESTVARIABLE%"=="init" (

set TESTVARIABLE=used

if "!TESTVARIABLE!"=="used" (

echo This was logical
) else (
echo Bat files suck big time..
)




So that was one of the hopeless default setting of Windows XP. There are many other hopeless ways in which Windows bat file interpreter makes life bad for people scripting in Bat files.. Hence Python and other scripting languages are a requirement..