Sunday, September 07, 2008

blah-002

Nature is a tinker and not an inventor
Jacob, F. 1977. Evolution and tinkering. Science 196:1161-1166

1278: Pondi and Tranquebar

Finally, back home.

What an amzing week this was. I am quite sure 1278 would be etched in my memory for quite some time. After finishing off gsoc, I figured i should take a short break ( sic. from what? ) and ease of a bit. My basic plan was to visit a few Pondi and Tranquebar and visit a few of the projects as well as the general work of INTACH or Indian National Trust for Architecture and Cultural Heritage. The plan started when a mail was forwarded regarding an opportunity to work with INTACH on the projects in Pondi and Tranquebar. Though not very financially rewarding considering their NGO-esque stature, the work description and information from the website seemed extremely satisfying and interesting. And after 5 days of being there, I am all the more impressed. I would be speaking about Intach Pondi in particular considering my lack of access to first hand information regarding other cells, but I am hopeful that if anything they must be as rigorous and refined in their approach.

Intach shatters conventional assumptions about "Conservation", "Restoration", "Heritage Architecture" and a host of similar words and ideas. They operate in a niche they have created for themselves, exemplifying the role that an architect or more so the practice of architecture could have in socio-economic dynamics. The basic idea of Intach ofcourse is to protect and conserve heritage structures. But at Pondicherry, I saw a passion towards focusing the same energy in a microcosm ( consider residential structures rather than forts and castles or a medium sized bungalow being converted into a hotel in a small panchayat) This increases public participation to a great extent and provides interesting models for captial generation as well as public private partnership. I was impressed by how Intach was able to break many barriers and reach the people with a medium like heritage conservation.

Pondicherry is definitely much more heard about that Tranquebar, a small panchayat around kms south of Pondi. It was a danish colony during the 17th, 18th and 19th century. More information is ofcourse available on the web. What was really impressive was that, there was so much employment generation simply due to the work being done by INTACH and in the next few years, the whole topography is going to change in this small village ( town? ) thanks to the Master's thesis of Asai, enthusiasm of INTACH and funding of Governement as well as Bestseller Foundation. I guess it is true that the world is indeed changed in small ways , somewhere every single moment.

Pictures from Pondi and Tranquebar at Picasa (Disclaimer: My first digicam and even otherwise suck at photography.. most of these taken due to severe power-battles with mom and sis after returning from Paris without pics)

--

More details about INTACH Pondicherry is available at their website . For more general information regarding INTACH see this.

Saturday, August 30, 2008

blah-001

The efficient programmer is a lazy programmer
Gibas, Cynthia, and Per Jambeck. Developing Bioinformatics Computer Skills
--
Explanation for dummies: she never wastes effort writing a program if someone else has already made it.

1277: Tinkering with Plotrave

Maybe many of you already know about it , but arduino NG based Flexi is availabe in India from techsouls. I have given an order. Hopefully it comes in the next few days.

I have never really been a web guy and have never found web development interesting, never ventured into web-based programming? err.. whatever it is called..
Completely useless statistics though has always interested me. And when you do think about it, when is statistics really useful?
The above image was generated using google charts api, using data extracted from workrave statistics files using a perl script. As you can clearly see, I don't even know the equivalent in Perl of backslash in C. The scipt is a modification of this one, which just extracts data from the file into columns. 3 types of data are plotted and a line is drawn to denote the average computer usage. In particular, most things are hardcoded, like the date and scale . Maybe sometime later I can write a more parametric extractor.
#!/usr/bin/perl -w

use strict;
use integer;
use POSIX qw(strftime);
use Time::Local;

$ENV{'PATH'} = "/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin";

my $timestring = "";
my $keystring = "";
my $averagestring ="";
my $average=0;
my $count=0;

sub dumpactivetime($)
{
my ($misc) = @_;

die "No misc at line $.\n" if !defined($misc);

no integer;
my $t = "@$misc{activetime}";
$count = $count + 1;
$average = $average + ($t-$average)/$count;
$timestring = $timestring.sprintf("%.2f",$t/540.0).",";
$averagestring = $averagestring.sprintf("%.2f",$average/540.0).",";
}

sub dumpkeystrokes($)
{
my ($misc) = @_;

die "No misc at line $.\n" if !defined($misc);

#my $miscstr = join(" ", @$misc{@$miscstats});
no integer;
my $t = sprintf("%.2f",@$misc{keystrokes}/1000.0);
$keystring = $keystring.$t.","
}

#
# Initialize RRD
#

my @miscstats = qw(activetime keystrokes); #mousemovement clickmovement movementtime clicks
#keystrokes);

my $step = 24 * 3600; # 24-hr steps
my $heartbeat = 4 * $step;

my (@DS);
foreach my $miscstat (@miscstats) {
push @DS, "DS:$miscstat:GAUGE:$heartbeat:0:U";
}
umask(022);

#
# Populate data
#
my $source = "$ENV{HOME}/.workrave/historystats";
my $first = 1;
my ($tmdate, $break, $misc) = (undef, undef, undef);
open(SOURCE, $source) or die "open $source: $!\n";
print "http://chart.apis.google.com/chart?cht=lc&chg=7,33.33,2,4";
print "&chxt=x,y,r,x,y,r&chxr=0,8772,8877|1,0,15|2,0,100000";
print "&chxl=3:|Day|4:|Hours|5:|Number&chxp=3,50|4,50|5,50";
print "&chco=4d89f9,008000,fd0f0f";
print "&chtt=Computer+Usage+Statistics";
print "&chts=ff9900,15";
while () {
chomp;
if (/^WorkRaveStats 4$/) {
# Ignore header
next;
} elsif (m/^D\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)
\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s+(\d+)\s*$/x) {
if ($first) {
$first = 0;
} else {
dumpactivetime($misc);
dumpkeystrokes($misc);
}
$break = $misc = undef;
} elsif (m/^B\s+([012])\s+7
\s+(\d+)\s+(\d+)\s+(\d+)
\s+(\d+)\s+(\d+)\s+(\d+)
\s+(\d+)\s*$/x) {
next;
} elsif (m/^m\s+6\s+(\d+)\s+(\d+)\s+(\d+)
\s+([-0-9]+)\s+(\d+)\s+(\d+)\s*$/x) {
$misc = {
activetime => $1,
# mousemovement => $2,
# clickmovement => $3,
# movementtime => $4,
# clicks => $5,
keystrokes => $6,
};
} else {
die "Unrecognized line (line $.): [$_]\n";
}
}
close(SOURCE) or die "close $source: $!\n";
dumpactivetime($misc);
dumpkeystrokes($misc);
print "&chd=t:$timestring\b|$keystring\b|$averagestring\b";
no integer;
printf("&chm=r,f00000,0,%.3f,%.3f",$average/54000,$average/54000-0.002);
print "&chs=800x375&chdl=Activity|Keystrokes|Average Usage&chdlp=t\n";

--
Epilogue:

The subject (moi) is mostly a web-technology illiterate guy.

Let us substantiate the same.

Things the subject DOESN'T know : Javascript, VBScript, Java, CSS, CGI, Ruby, PHP, MySQL, AJAX etc . Beyond this, the subject is even unaware of the topic names , pointing to his complete ignorance.

The ONLY web services/technologies I use:
Mail : The subject was/is a great fan of gmx. But he mostly uses gmail via imap now. The author checks the mail approximately once a day.
IM: Jabber via talk.google.com using freetalk/gajim.
Social Networking-esque sites : Ohloh, LinkedIn
Blogging: blogger and wordpress
Games: chess.com, though active use is mostly a seasonal phenomenon.
Demonoid.com & textbooktorrents.com: The subject honestly hopes *they* don't send him to jail for this.

The subject also Passively uses
last.fm
sourceforge.net[1]


Valete
--
1. Due to the subject's involvement with open source he uses Subversion as per requirements.