Sentimental Minions

The theatricalities of the humble bookmark

I’ve moved!

Posted by Avadhut on 30 December 2014

To http://avadhutp.github.io/

moving

Posted in Social media | Leave a Comment »

Good bill/cheque design: Reliance Energy

Posted by Avadhut on 30 October 2008

I had never known that bills could look this good. Reliance has really scored a big one this time. It may seem trivial to a lot of people, but phone and electricity bills, at least in India, are in a dire need of some major overhauling. They are stupendously cryptic, and even knowing how much you have to pay and by when is a task requiring substantial digging-through-the-text. It is almost as if these utilities companies are trying to obfuscate our own information from us.

Take for example the MTNL bill, it is divided into numerous sections, lots of details, even the amount to pay is printed in red. And despite the plethora of numbers/sections it contains, most of the information printed does not make any sense to a layman—forget “the bill as a value add.”

The Vodafone bill does come close to being slightly more than useful. The language has a friendly tone, there are helpful visual cues all over the place, and I just love the cute little graphics all over the bill—it makes it seem like Vodafone is saying “Here’s your bill; we hope you like us enough to pay us” as opposed to “Oye! The bill’s here. Pay up.”

I thought that is as far as one could go with a bill. But then, today I saw the Reliance Bill stuck on my refrigerator. And, I think this is the only time I’d say this about a bill, it looked gorgeous. It made me—who usually just prefers to pay bills online—stand up, take notice, and actually blog about it.

It served on so many levels:
1. Told me who the bill is for.
2. What the amount is.
3. Told me what period was the bill for.
4. Gave me additional information about my electricity usage.

And all this without even flipping the first page. I mean, almost all bills take care of #1 and #2. But not in a manner that Reliance does. Take a look:

This is the first page. Flipping it over displays the more detailed conservatively-styled bill.

This is the first page. Flipping it over displays the more detailed conservatively-styled bill.

And #3 is something that most bills confuse me with. With their start periods and end periods and bill cycles. I pay bills on a monthly basis, and therefore I’d like to know which “month” the bill is for, not which “billing cycle.”

And what can I say about #4:

Detailed usage over past months.

Detailed usage over past months.

This is just good ole’ “Ha ha! Don’t act like your are not impressed.” I mean, my past usage as a small bar graph. Who’d have thought about it. This small section alone more helpful than MTNL’s entire bill.

It is all so well laid out, and epitomises the word “quick.” Almost the perfect bill for a city with barely enough time.

If we go ahead and deconstruct the bill, though, several things can be used for developing billing information screens for Web apps:

1. The font: Extremely important in setting the tone of the bill. I’d strongly recommend a san/semi-san serif font.
2. The language: Friendly. Informal yet professional. Helpful and approachable.
3. Layout: Clean. Uncluttered. One of the most important things here, which most designers overlook, is line-spacing.
4. Information: In stead of printing several sections on the same page, design a bill as “layers” that can be “peeled” off. The first layer could present the most basic information regarding the amount, due date, etc. Peeling off the first layer could present an itemized bill, and so on. This will also make your bill extremely interactive.

And lastly, deliver what your service promises even through your bill. Don’t let poor billing hamper an otherwise customer-friendly offering.

Posted in Bill/cheque design, Social media, System design, Visual sick | 1 Comment »

Four cellos and Metal

Posted by Avadhut on 28 October 2008

So different. So much more different than anything I have heard before:

Song: I don’t care
Artist: Apocalyptica feat. Toryn Green of Fuel
At: Live X 99

Posted in Apocalyptica, Cello metal music, Toryn Green, Unplugged goodness | Tagged: | Leave a Comment »

Weapons of choice: ZendCore, etc.

Posted by Avadhut on 1 October 2008

Most of my development happens in Drupal, PHP, jQuery, MySQL, PostGreSQL, and all good things associated. Until recently, I used to swear by separate PHP and Apache installations. But managing updates for everything involved—Apache, PHP, jQuery, Drupal—separately had become a real bitch: the innumerable backups, migrations, and restorations.

So when Drupal 6 was released, I was thrilled with the new Update module. And it was time I found a server-PHP stack that could support production-scale deployments. Enter ZendCore. The installer not only allows you to use Zend’s own PHP (with FastCGI) and Apache Web Server (ZendCoreApache) but also plays nice with your existing installations. Buy a subscription with Zend, and they will take care of updating Apache and PHP for you too. It also allows you to download and install database servers of your choice—MySQL, DB2, etc.

ZendCore also comes bundled with Zend Framework, which provides an extremely good set of PHP functionalities. I have only gotten as far as Lucene search, but things look very promising.

Drupal runs like a peach on this stack, which is most important for me at the moment, and it supports my other custom Web-apps developed using the Zend framework.

I am almost tempted to shell out on ZendPlatform, which is an enormously feature-rich Web-app server. It handles PHP, Java, and HTTP monitoring, supports session clustering (yummy!), and comes with a really cool Download Server that frees up Apache of monotonous tasks involving huge downloads so that it can handle some of the more serious stuff.

However, I still could not get myself to switch to Zend Studio. Or maybe I just refuse to let go of my beloved Komodo IDE. What? What was that? Dreamweaver? Who? The one that pisses memory all over the place? Yeah I dumped it with DotNetNuke.😛

The worst excuse I have heard anyone give me for still sticking to Dreamweaver is the Code/Design view. Please, it is a joke. Any standards-aware Web designer will tell you that. It still gloats about its Table layout like it were the 90s. Besides, how long does it take to write a line of CSS, alt+tab your way to your browser, and press F5? Also, what’s with the no-Linux-option? Not even a binary? What is taking Adobe so long? Hurry the fuck up. And don’t even get me started with the abyssmal FTP editing. I have actually shut my PC mid-day and gone home coz’ of it. Free FTP programs have no issues handling huge files. Then why does it have to be such a task for a $500 software to do it? If my server supports long sessions, then so should Dreamweaver. To top it all off, it is way overpriced. Did you see the CS3 release—not only is it godforsakenly bloated (it was consuming 20% CPU just idling), it also expects me to pay Adobe almost three times more than what it would charge my American friends.

The thing I like the most about Zend is that none of the components are prone to lock-ins. Use whichever tool you want, it will still behave with the etiquette expected out of good-natured software. Want to use ZendCore’s PHP with your own Apache deployment? It’s OK. ZendCore won’t hold any grudges. Some other people do need to take a lesson from here. Can you hear me Microsoft? Just because I use Exchange does not mean that I would want to use Office Communication Server. Let me connect to other software!

So, the list would proceed as follows:

  • Webserver-PHP stack: ZendCore
  • PHP frameworks: Zend Framework, Drupal (I use it as one :))
  • Javascript: jQuery, Prototype
  • IDE: Komodo
  • Database server: MySQL, MSSQL, PostGreSQL
  • Mail server: Apache James
  • OS: Does it even matter?

Posted in Drupal, Foo, System design, Zend, ZendCore-Drupal | Leave a Comment »

PHP script for the migration of data from Drupal 5.x to 6.x

Posted by Avadhut on 14 September 2008

Ok. Drupal 6 is probably the best thing since bread came sliced. Views 2, the new and improved CCK, and the updater—it’s like updating your anti virus—has made life so much easier. Updating Web application frameworks has never been easier.

This updater alone is incentive enough to upgrade your Drupal 4.x and 5.x installations to Drupal 6.x. Unfortunate it is then that this moat to be crossed is filled with non-upgraded module crocodiles and inexplicable PHP error sharks.

There are two approaches to converting a Drupal 5.x site to 6.x:
1. Upgrading: For this, all contrib. modules installed in your 5.x better be ported to 6.x, and also pray that Watchdog has encountered no life-threatening PHP errors. That periodic cron runs, database updates, & zilch-modification of core modules were a must go without saying.
2. Migration: Setup a crisp, clean Drupal 6.x site, and painstakingly port all data from your 5.x behemoth to your 6.x kiddo. Migration can be performed either manually (pray, lord, pray if your site has more than 500 nodes) or through scripts.

Although approach 1, if it works without spewing any errors, is enough to incite a hallelujah from even the most ardent of the non-believers, we all know how rare it is. And the pre-requisites to it are just too many and too hard to fulfill.

The only solution in cases where an upgrade is not possible, then, is the use of automated migration scripts. Currently, there is no such unified migration script available. I have broken down the script I used to migrate my 5.x site to 6.x for the migration of users, simple-content-type posts, comments, taxonomy, & forum posts. Migrating the theme itself (blocks, nodes, templates, etc.) would require one to get their hands dirty with PHP.

Before we begin, we need our PHP migration script to set certain variables:

< ?php
set_time_limit(0);
//MySQL globals
$mysql_server = "localhost";//change this server for your Drupal installations
$mysql_user = "root";//Ideally, should be root
$mysql_pass = "pass";//Corresponding password
$conn = mysql_connect($mysql_server,$mysql_user,$mysql_pass);//MySQL connection string
//If your 5.x and 6.x installations reside on different servers, you will need two sets of server names, usernames, and passwords.
?>

Also, in my scripts, tables prefixed “drupal.” and “timesnow.” belong to the 5.x and 6.x sites, respectively. Please change these accordingly for your databases.

Lastly, these scripts are not optimized with regard to execution. So do not expect unified inserts to insert multiple tuples.

User migration script:

This script, currently, only migrates users, e-mail addresses, uids, and passwords. It does not take care of the profile fields, which can be handled through other customized scripts as profile fields for each installation can differ. It does not import “usernode” content type either. This is coz’ usernodes are typically not required in 6.x, as user profile pages can be styled using tpl.php files themselves. Also, it is important that the uids from your orignal installtion be migrated to your current installation accurately coz’ comments and nodes that we will migrate later on are linked to the users through these uids.

There are absolutely no differences between the Users table in 5.x and 6.x. Both of them have the same 18 fields. So you can go ahead and use the following script without even thinking:

< ?php
//first, we delete all users, if any, from the new table, except for the admin
$query = "delete from timesnow.users where uid not in (0,1)";
mysql_query($query);
print "User table cleared.
";
//now we start inserting users into the new table
$query = "select * from drupal.users where uid not in (0,1)";
$queryresult = mysql_query($query);
while ($row = mysql_fetch_row($queryresult)) {
	$query = "insert into timesnow.users values('" . $row&#91;0&#93; . "','" . $row&#91;1&#93; . "','" . $row&#91;2&#93; . "','" . $row&#91;3&#93; . "','" . $row&#91;4&#93; . "','" . $row&#91;5&#93; . "','" . $row&#91;6&#93; . "','" . $row&#91;7&#93; . "','" . mysql_real_escape_string($row&#91;8&#93;) . "','" . $row&#91;9&#93; . "','" . $row&#91;10&#93; . "','" . $row&#91;11&#93; . "','" . $row&#91;12&#93; . "','" . $row&#91;13&#93; . "','" . $row&#91;14&#93; . "','" . $row&#91;15&#93; . "','" . $row&#91;16&#93; . "','" . $row&#91;17&#93; . "')";
	if (!mysql_query($query)) {
		print $query;
	}
	$ucnt += 1;
}
print $ucnt . " users inserted.";
?>

An easy one that was, wasn’t it. Now, for some taxonomy.

[Note: You can even take a backup of the old Users table using mysqldump and restore it into the new one. Just make sure that you delete the insertion statements for UIDs 0 and 1.]

Migrating taxonomy:

Now, this is the tricky part. Broken down, the minimal unit of taxonomy data in Drupal is a “term,” which has an associated “tid” (term id). Terms can be fixed taxonomies or free tags. Each node (if applicable) and forum post has an associated tid, which maps it to the term that the user has assigned to it. Therefore, it is imperative that this data is migrated accurately.

The migration script for taxonomy will migrate the hierarchies, term-node relations, vocabularies, etc.:

< ?php
$query = "truncate timesnow.vocabulary";
mysql_query($query);
print "Vocabulary table cleared.
";
$query = "truncate timesnow.vocabulary_node_types";
mysql_query($query);
print "Vocabulary_node_types table cleared. 

";
$query = "truncate timesnow.term_data";
mysql_query($query);
print "Term_data table cleared.
";
$query = "truncate timesnow.term_hierarchy";
mysql_query($query);
print "Term_hierarchy table cleared.
";
$query = "truncate timesnow.term_node";
mysql_query($query);
print "Term_node table cleared.
";
$query = "truncate timesnow.term_relation";
mysql_query($query);
print "Term_relation table cleared.
";
$query = "truncate timesnow.term_synonym";
mysql_query($query);
print "Term_synonym table cleared.
";
print "
";

$query = "select * from drupal.vocabulary";
$queryresult = mysql_query($query);
while ($row = mysql_fetch_row($queryresult)) {
	$query = "insert into timesnow.vocabulary values('" . $row&#91;0&#93; . "','" . mysql_real_escape_string($row&#91;1&#93;) . "','" . mysql_real_escape_string($row&#91;2&#93;) . "','" . mysql_real_escape_string($row&#91;3&#93;) . "','" . $row&#91;4&#93; . "','" . $row&#91;5&#93; . "','" . $row&#91;6&#93; . "','" . $row&#91;7&#93; . "','" . $row&#91;8&#93; . "','" . $row&#91;9&#93; . "','" . $row&#91;10&#93; . "')";

	if (!mysql_query($query)) {
			print $query;
	}
}
print "Vocabulary plugged in.
";

$query = "select * from drupal.vocabulary_node_types";
$queryresult = mysql_query($query);
while ($row = mysql_fetch_row($queryresult)) {
	$query = "insert into timesnow.vocabulary_node_types values('" . $row&#91;0&#93; . "','" . $row&#91;1&#93; . "')";

	if (!mysql_query($query)) {
			print $query;
	}
}
print "Vocabulary node types set.

";

$query = "select * from drupal.term_data";
$queryresult = mysql_query($query);
while ($row = mysql_fetch_row($queryresult)) {
	$query = "insert into timesnow.term_data values('" . $row&#91;0&#93; . "','" . $row&#91;1&#93; . "','" . mysql_real_escape_string($row&#91;2&#93;) . "','" . mysql_real_escape_string($row&#91;3&#93;) . "','" . $row&#91;4&#93; . "')";

	if (!mysql_query($query)) {
			print $query;
	}
}
print "Term_data plugged in.
";

$query = "select * from drupal.term_hierarchy";
$queryresult = mysql_query($query);
while ($row = mysql_fetch_row($queryresult)) {
	$query = "insert into timesnow.term_hierarchy values('" . $row&#91;0&#93; . "','" . $row&#91;1&#93; . "')";

	if (!mysql_query($query)) {
			print $query;
	}
}
print "Term_hierarchy plugged in.
";

$query = "select * from drupal.term_node";
$queryresult = mysql_query($query);
while ($row = mysql_fetch_row($queryresult)) {
	$nid = $row&#91;0&#93;;
	$tid = $row&#91;1&#93;;
	$query = "select vid from drupal.node where nid = " . $nid;
	$qr2 = mysql_query($query);
	$row2 = mysql_fetch_row($qr2);
	$vid = $row2&#91;0&#93;;
	$query = "insert into timesnow.term_node values('" . $nid . "','" . $vid . "','" . $tid . "')";

	if (!mysql_query($query)) {
			print $query;
	} else {
		$tncnt += 1;
	}
}
print "Term_node plugged in (" . $tncnt . " records entered).
";
?>

You must’ve noticed that I am clearing out all associated tables before each insert block. This is coz’ it is important that the tids, tid-vid pairings, and tid-nid pairings be unique and as they are in the old database. Otherwise it will cause either of the following two problems: (a) terms won’t get attached to your nodes accurately or (b) the insert statements will throw primary key and/or unique key errors.
This script is out-of-the-box too. With just the database name changes (from timesnow. to your database name), it can be run as it is.

And now for the big Kahuna—migrating forum posts.

Migrating forums:

Three parts to this script—forum topics have to be attached to their respective terms, forums posts have to go into the node table, and forum comments have to be migrated. The first part has already been taken care of in the previous script, so we are simply dealing with inserting comments and forum nodes. Again an out-of-box script, this one:

< ?php
$cnt = 0;
$commentcnt = 0;
$query = "select * from drupal.node where type = 'forum'";
$noders = mysql_query($query);
while ($row = mysql_fetch_row($noders)) {
	$nid = $row&#91;0&#93;;
	$vid = $row&#91;1&#93;;
	$type = $row&#91;2&#93;;
	$title = mysql_real_escape_string($row&#91;3&#93;);
	$uid = $row&#91;4&#93;;
	$status = $row &#91;5&#93;;
	$created = $row&#91;6&#93;;
	$changed = $row&#91;7&#93;;
	$comment = $row&#91;8&#93;;
	$promote = $row&#91;9&#93;;
	$moderate = $row&#91;10&#93;;
	$sticky = $row&#91;11&#93;;
	//Insertion into node
	$query="insert into timesnow.node values('" . $nid . "','" . $vid . "','" . $type . "','','" . $title . "','" . $uid . "','" . $status . "','" . $created . "','" . $changed . "','" . $comment . "','" . $promote . "','" . $moderate . "','" . $sticky . "','0','0')";
	if (!mysql_query($query)) {
		print $query;
	}

	$query = "select * from drupal.node_revisions where nid = " . $nid;
	$node_revisionrs = mysql_query($query);
	$nrow = mysql_fetch_row($node_revisionrs);
	$body = mysql_real_escape_string($nrow&#91;4&#93;);
	$teaser = mysql_real_escape_string($nrow&#91;5&#93;);
	$log = mysql_real_escape_string($nrow&#91;6&#93;);
	$timestamp = $nrow&#91;7&#93;;
	$format = mysql_real_escape_string($nrow&#91;8&#93;);
	//Insertion into node_revision
	$query="insert into timesnow.node_revisions values('" . $nid . "','" . $vid . "','" . $uid . "','" . $title . "','" . $body . "','" . $teaser . "','" . $log . "','" . $timestamp . "','1')";
	if (!mysql_query($query)) {
		print $query;
	}

	$query = "select * from drupal.node_comment_statistics where nid = " . $nid;
	$node_comment_statistics_rs = mysql_query($query);
	$ncsrow = mysql_fetch_row($node_comment_statistics_rs);
	$last_comment_timestamp = $ncsrow&#91;1&#93;;
	$last_comment_name = mysql_real_escape_string($ncsrow&#91;2&#93;);
	$last_comment_uid = $ncsrow&#91;3&#93;;
	$comment_count = $ncsrow&#91;4&#93;;
	//Insertion into node_comment_statisitcs
	$query = "insert into timesnow.node_comment_statistics values ('" . $nid . "','" . $last_comment_timestamp . "','" . $last_comment_name. "','" . $last_comment_uid . "','" . $comment_count. "')";
	if (!mysql_query($query)) {
		print $query;
	}

	$query = "select * from drupal.comments where nid = " . $nid;
	$commentrs = mysql_query($query);
	while ($row = mysql_fetch_row($commentrs)) {
		$query = "insert into timesnow.comments values ('" . $row&#91;0&#93; . "','" . $row&#91;1&#93; . "','" . $row&#91;2&#93; . "','" . $row&#91;3&#93; . "','" . mysql_real_escape_string($row&#91;4&#93;) . "','" . mysql_real_escape_string($row&#91;5&#93;) . "','" . $row&#91;6&#93; . "','" . $row&#91;7&#93; . "','" . $row&#91;9&#93; . "','" . $row&#91;10&#93; . "','" . $row&#91;11&#93; . "','" . $row&#91;13&#93; . "','" . $row&#91;14&#93; . "','" . $row&#91;15&#93; . "')";
		if (!mysql_query($query)) {
			print $query;
		}

		$commentcnt += 1;
	}
	$cnt += 1;
}

print $cnt . " rows inserted.
";
print $commentcnt . " comments inserted.
";

//Inserting into forum
$query = "select * from drupal.forum";
$queryresult = mysql_query($query);
while ($row = mysql_fetch_row($queryresult)) {
	$nid = $row&#91;0&#93;;
	$vid = $row&#91;1&#93;;
	$tid = $row&#91;2&#93;;
	$query = "insert into timesnow.forum values('" . $nid . "','" . $vid . "','" . $tid . "')";

	if (!mysql_query($query)) {
			print $query;
	} else {
		$forumcnt += 1;
	}
}
print $forumcnt . " records updated into the forum table.
";
?>

Certain table structures have changed in 6.x. But these scripts handle those too.

Now, moving on into content migration. Due to CCK, content migration will have to take into account many different things. I am not going to post a generic content migration script, coz’ I don’t have one, and that is coz’, frankly, I did not need one. I just needed one for a simple content type with just a title and body and terms of all sorts associated with it, with comments.

My content type was called “multi_user_blog.” You may have to change that for your needs. But basically, what the following script does is inserts content title, body, and associates comments. It is like a building block for all your node migrations. A lot of things have changed in Drupal 6.x when it comes to nodes and associated comments and revisions. There have been translation fields added to the node table itself. Also, the vid (version id) in the node_revision table is set to auto increment in 6.x. This vid is also associated with different terms. Thus, each version can now have its own terms in 6.x.

Moving right along to the script, it is pretty straight forward:

< ?php
$query = "truncate timesnow.node";
mysql_query($query);
print "Node table cleared.
";
$query = "truncate timesnow.node_revisions";
mysql_query($query);
print "Node_revisions table cleared.
";
$query = "truncate timesnow.node_comment_statistics";
mysql_query($query);
print "Node_comment_statistics table cleared.
";
$query = "truncate timesnow.comments";
mysql_query($query);
print "Comments table cleared.
";
$query = "truncate timesnow.forum";
mysql_query($query);
print "Forum table cleared.
";

?>
<hr />
Inserting multi_user_blogs
< ?php
$query = "select * from drupal.node where type = 'multi_user_blog'";
$noders = mysql_query($query);
while ($row = mysql_fetch_row($noders)) {
	$nid = $row&#91;0&#93;;
	$vid = $row&#91;1&#93;;
	$type = $row&#91;2&#93;;
	$title = mysql_real_escape_string($row&#91;3&#93;);
	$uid = $row&#91;4&#93;;
	$status = $row &#91;5&#93;;
	$created = $row&#91;6&#93;;
	$changed = $row&#91;7&#93;;
	$comment = $row&#91;8&#93;;
	$promote = $row&#91;9&#93;;
	$moderate = $row&#91;10&#93;;
	$sticky = $row&#91;11&#93;;
	//Insertion into node
	$query="insert into timesnow.node values('" . $nid . "','" . $vid . "','" . $type . "','','" . $title . "','" . $uid . "','" . $status . "','" . $created . "','" . $changed . "','" . $comment . "','" . $promote . "','" . $moderate . "','" . $sticky . "','0','0')";
	if (!mysql_query($query)) {
		print $query;
	}

	$query = "select * from drupal.node_revisions where nid = " . $nid;
	$node_revisionrs = mysql_query($query);
	$nrow = mysql_fetch_row($node_revisionrs);
	$body = mysql_real_escape_string($nrow&#91;4&#93;);
	$teaser = mysql_real_escape_string($nrow&#91;5&#93;);
	$log = mysql_real_escape_string($nrow&#91;6&#93;);
	$timestamp = $nrow&#91;7&#93;;
	$format = mysql_real_escape_string($nrow&#91;8&#93;);
	//Insertion into node_revision
	$query="insert into timesnow.node_revisions values('" . $nid . "','" . $vid . "','" . $uid . "','" . $title . "','" . $body . "','" . $teaser . "','" . $log . "','" . $timestamp . "','" . $format . "')";
	if (!mysql_query($query)) {
		print $query;
	}

	$query = "select * from drupal.node_comment_statistics where nid = " . $nid;
	$node_comment_statistics_rs = mysql_query($query);
	$ncsrow = mysql_fetch_row($node_comment_statistics_rs);
	$last_comment_timestamp = $ncsrow&#91;1&#93;;
	$last_comment_name = mysql_real_escape_string($ncsrow&#91;2&#93;);
	$last_comment_uid = $ncsrow&#91;3&#93;;
	$comment_count = $ncsrow&#91;4&#93;;
	//Insertion into node_comment_statisitcs
	$query = "insert into timesnow.node_comment_statistics values ('" . $nid . "','" . $last_comment_timestamp . "','" . $last_comment_name. "','" . $last_comment_uid . "','" . $comment_count. "')";
	if (!mysql_query($query)) {
		print $query;
	}

	$query = "select * from drupal.comments where nid = " . $nid;
	$commentrs = mysql_query($query);
	while ($row = mysql_fetch_row($commentrs)) {
		$query = "insert into timesnow.comments values ('" . $row&#91;0&#93; . "','" . $row&#91;1&#93; . "','" . $row&#91;2&#93; . "','" . $row&#91;3&#93; . "','" . mysql_real_escape_string($row&#91;4&#93;) . "','" . mysql_real_escape_string($row&#91;5&#93;) . "','" . $row&#91;6&#93; . "','" . $row&#91;7&#93; . "','" . $row&#91;9&#93; . "','" . $row&#91;10&#93; . "','" . $row&#91;11&#93; . "','" . $row&#91;13&#93; . "','" . $row&#91;14&#93; . "','" . $row&#91;15&#93; . "')";
		if (!mysql_query($query)) {
			print $query;
		}

		$commentcnt += 1;
	}

	$cnt += 1;
}
print $cnt . " rows inserted.
";
print $commentcnt . " comments inserted.
";
?>

Studying this script can you give you some clues/insights to migrating content on your own site.
I am working on an auto content migration script that will enable migration of all content types, associated tables, fields, etc.

Also in works is the profile migration script.

In the meanwhile, let me know if I can improve on these OR if you have some script to contribute (I will credit, promise).🙂

If you do crack the auto content migration script for all CCK content types before me I will take you out for a meal, and throw in a free conversation, if you are in a can-buy-me-a-meal range. If you feel like my efforts deserve a meal, I am a complete meal slut. Oh, and why meals? Coz’ they are fun and desirable and leave one satisfied and contented.

That’s all folks!

Posted in Drupal, Drupal 6.x, Drupal migration, Meals, Open source, PHP scripts, Social media | 6 Comments »

Aspiration or Version 2

Posted by Avadhut on 20 April 2008

This time around, I want to make something that will look better next year than this…

Just like Mr. Bowie

Here am I floating round my tin can
Far above the moon
Planet earth is blue
And theres nothing I can do.

Posted in Foo, Office, Visual sick | 4 Comments »

Clangoring imp

Posted by Avadhut on 10 April 2008

Once, long ago, she pinned this on my softboard during halloween:

A gentle breeze rustling the dry cornstalks

A sound is heard, a goblin walks

A harvest moon suffers a black cat’s cry.

Oh’ do witched fly!

The bonfire catches a pumpkin’s gleam.

Rejoice, it’s Halloween!

She used to award me “stars” for good behavior and “commas” for bad.

She always thought that I’d choose spelunking over food.

And she thought that my favorite game was mudpie-mudpie.

Then she was gone.

Now, she’s finally here.

🙂

Posted in Foo, Nostalgia, Office | 7 Comments »

El Paseo

Posted by Avadhut on 8 April 2008

Had a fun weekend, this last one. Rode off to Kashid. Three bikes—a Bullet 500, a Bullet 350, and an Avenger—and three cars—a Honda Civic, a Honda City, and an Accent.

This is all that we broke between Mukul’s (the 350) and my (the 500) bike.

The 500 (1998 Royal Enfield Bullet 500cc-Cast Iron Engine):

1. The rubber lever on the gear shifter.

2. The sump gaurd.

3. One of the horns “magically” fell off! ::gulp::

4. Gaurd mounts broke.

5. I think I have worn off the valve liners too.

6. The wheel bearings are definitely legally dead.🙂

The 350 (Royal Enfield Bullet Machismo 350cc-AVL Engine):

1. The oil pump had temporarily given up on us.

2. The clutch cable.

3. Earthing wire came off.

4. Misfiring.

The night we travelled to Kashid, both bulls were regularly spitting fire everytime we slowed down from 100-110 KMPH, causing poor Kiran to keep safe distance. LoL.

All in all, good fun.

As usual

Posted in Kashid, Motorcycle diaries, Royal Enfield Bullet | 10 Comments »

I am black in my new form

Posted by Avadhut on 10 March 2008

 Steena: whats that? blueberry swizzle?
 me: its the muffin!
 Steena: or pointer?
 me: I love muffins
 Steena: ohhh
  u do???
 me: and I like pointers too
 Steena: LOL
 me: actually, I am quite crazy about them
 me: but sometimes they used to go crazy on me
 me: until I learnt that I created them
 Steena: ?
  pls ok
 me: So I can control them
 Steena: arrey
 me: mu ha ha ha ha ha ha ha
 Steena: LOL
  tooo much masti
 me: Complete control over all memory locations
 Steena: ye ye
 me: the world is Mine now!
 Steena: ye minions
 Steena: whos locations resteth in my hands; mere zeroes and ones cldnt stop me
 me: I am manipulator of all things binary. I AM…the POINTER!
 Steena: chee chee
  u are a bad root node
 dirty leaf
 me: I will garble up your inode table only!
 Steena: bad leafff
  u are a bad boy
  so u will be a left child
  truncate all left children
  x-(
me: u are a misdirected B-tree
Steena: hawww. what an insult. u are a badly normalized relation schema—all redundant info
me: that is correctable–a mere anomaly compared to the catastrophe that is a misdirected B-tree
Steena: snifff. lets see. u are a dirty packet. with all bad data
me: u are the worst kind—a mere redundant database record…that too unsanitized
Steena: sql injections!
me: also, during the next cron run, u are queued for purging
me: u are an ISAM record in a InnoDB world…Go upgrade Steen
Dim steen as String
steen = “Purge yourself”
You are an ill-linked-list
Steena: BadBoy bb = new BadBoy(new Pest(67, yes, marathi)))
bb.getBroom();
bb.startSweeping(6000);
bb.shutUP(70000);
Steena: hahahhaha
me: bb.killSteen();
Steena: hawww
ur baddd
but i program u
me: bb.dumpGarbage(‘On_steen’);
Steena: eeeeeee
import java.pigggie
me: i have just acquired my own consience
and, thereby, control
i am going to fudge up your HDD
me: mu ha ha ha ha

–The end–

Posted in Boredom | 4 Comments »

Hear what the Chief Lizard Wrangler has to say

Posted by Avadhut on 31 January 2008

What has Mozilla Corporation’s chief contribution been? The Firefox browser? Or the email client Thunderbird? I would say neither. It has been its model of developer participation—of managing innovation outside corporate borders and passing on decision making to its community of developers. 40 percent of its code is not from employees—a staggering statistic if you consider that the company’s revenue-sharing arrangement with Google for searches that originate in Firefox delivered revenues three times greater than Mozilla’s expenses (a little over $50 million in 2006)!

Mozilla’s model proved that Open Source not only works but works extremely well when managed properly.

McKinsey Quarterly recently interviewed Mitchell Baker, CEO, Mozilla Corporation. A must read, despite the compulsory registration. She sums it up the best when she says

Turning people loose is really valuable. You have to figure out what space and what range, but you get a lot more than you would expect out of them, because they’re not you.

PS: A discussion on the same theme spawned a large number of really, really, huge comments some time back. Remember?

Posted in Mozilla, Office, Open source, Social media | 3 Comments »