A random collection of things I come across.

Saturday, February 24, 2007

Multi-lingual code!

Apparently, the following code compiles in ten different languages (shell scripting included)! The cool part is that it produces different output in all of them. Can someone verify this? The languages are C, C++, Perl, TeX, LaTeX, PostScript, sh, bash, zsh and Prolog.

Of course, hats off the the original coder!!

%:/*:if 0;"true" +s ||true<</;#|+q|*/include<stdio.h>/*\_/
{\if(%)}newpath/Times-Roman findfont 20 scalefont setfont(
%%)pop 72 72 moveto(Just another PostScript hacker,)show((
t)}. t:-write('Just another Prolog hacker,'),nl,halt. :-t.
:-initialization(t). end_of_file. %)pop pop showpage(-: */
int main(){return 0&printf("Just another C%s hacker,\n",1%
sizeof'2'*2+"++");}/*\fi}\csname @gobble\endcsname{\egroup
\let\LaTeX\TeX\ifx}\if00\documentclass{article}\begin{doc%
ument}\fi Just another \LaTeX\ hacker,\end{document}|if 0;
/(J.*)\$sh(.*)"/,print"$1Perl$2$/"if$_.=q # hack the lang!
/
sh=sh;test $BASH_VERSION &&sh=bash;test $POSIXLY_CORRECT&&
sh=sh;test $ZSH_VERSION && sh=zsh;awk 'BEGIN{x="%c[A%c[K"
printf(x,27,27)}';echo "Just another $sh hacker," #)pop%*/


-Source: http://weblog.raganwald.com/2006/12/just-because-we-can.html

Wednesday, February 21, 2007

A right to cheat

See the full article here.


Students and their guardians are demanding that cheating be allowed during the ongoing +2 examination in the state. The administration has been taken aback by the sheer "immoral force" of this demand and had to use guns at some places to ensure students don't cheat.

Students went on the rampage at several places this month, "enraged" by the strict arrangements made by the administration at exam centres. They set ablaze government vehicles, threw stones at the police, ransacked college buildings and, in one case, even fired guns. Guardians fought shoulder-to-shoulder with their children at most places.



Monday, February 19, 2007

Searching for tigers in Bangalore

Census goes where no tiger has ever gone before

Can you spot a tiger on the streets of Bangalore? You won't, but apparently forest minister C Chennigappa can!

If one were to go by his reply in the legislative council last week, tigers do roam about in IT city Bangalore, mining hub Bellary, arid Gulbarga and tourist spot Hassan.

And thereby hangs a tail! Chennigappa said the census was conducted in Bangalore, Bellary, Hassan and Gulbarga forest circles during 2005-06 and the expenditure incurred in these places has added up to Rs 5.41 lakh.

But none of these forest circles are home for tigers! Corroborating this information is the annual census report of the Wild Animals of Karnataka for 1997-98, which incidentally was also furnished by Chennigappa himself in the council.

Wildlife enthusiasts are not amused. "Has anyone seen a tiger in any of these places? What is the need to spend money and do a tiger census here?"

Wildlife conservationists have started questioning the government's motive. Chennigappa had said Rs 25 lakh was earmarked for tiger census in the state after PM Manmohan Singh directed the setting up of a Tiger Task Force, which was mandated with estimating the tiger status.

But to spend that money, the forest department has gone in for a census even in places where they know for certain there is no animal present, let alone tigers.

The government has spent Rs 2.18 lakh on Bangalore circle, Rs 2.18 lakh in Bellary, Rs 1.16 lakh in Hassan and Rs 82,640 in Gulbarga -- totalling Rs 5.41 lakh.

"There needs to be a prey base for tigers to survive in any area, but Bangalore doesn't even have an effective green cover! Pray,why will a tiger roam around Bangalore when there are no deer, wild pigs or sambars for it to prey upon?" a conservationist asked.

"They are spending lakhs of rupees in areas from where tigers have retreated some 60 years ago because of depletion of prey base," the conservationist added.

A forest department official, however, defended: "The money was used to conduct workshops and pay wages for those associated with the census work."

The forest officer, however, didn't have an explanation for undertaking such activities in non-tiger habitats.

Conservationists cry foul: "The money could have been used for some productive purpose, at least in addressing the man-animal conflict which is taking a heavy toll on wildlife population in the state."

But the official maintained: "We will get a clear picture of tiger population in the state after the ongoing survey by the Wildlife Institute of India (Dehra Dun) is completed."

Sources stated that the census is conducted to ascertain tiger population in national parks and Project Tiger areas and not in urban areas.

Thursday, February 08, 2007

Flexi-Couch




May not be the most comfortable one... but given that it can be 'folded' into a very small package, I can imagine its usefulness.

Monday, February 05, 2007

Sharp Edges

An Inconvenient Truth

Ever wondered why the weather has become extreme in the last couple of years? Watch Al Gore's documentary "An Inconvenient Truth". It puts some science behind your intuitions. The increased CO2 levels in the recent years and the close relationship between the CO2 level and the temperature, the world-wide occurence of drastic weather changes, etc. all make a compelling argument. The images in the documentary are stunning.

It is easy to confuse the global warming issue with the drive to use alternate fuels. I'm not an expert, but I think even using ethanol based fuels doesn't help.... any combustion based process releases carbon dioxide. May be the answer lies in a process/product that converts
CO2 to something less harmful.

Go Green!