Personal website of Pavan Keshavamurthy

Prepopulate Views Filters with args

Assuming that the argument is a node ID, being sent (say from a panel, under most circumstances)

// grab nid from referring node
<?php
$args[0]=arg(1);
if(is_numeric(arg(1))){
$nid = arg(1); //node id
$term = taxonomy_node_get_terms_by_vocabulary($nid, 3); // 3 is the vid. Use your own Vocabualary ID!
$tids=key($term);
return $tids;
}

$args[1]=$tids;

"An upgrade to Hardy from Intrepid is not supported by this tool"

If you run into this (amongst others, while trying to update your packages), like I did for various reasons (pauses while upgrading?, et al). You need to:

sudo apt-get autoremove
sudo apt-get install -f

and update packages all over again and possible do partial upgrades (or full) depending upon what you are prompted with.

Mapreduce sorts 1PB of data in 6 hours.

Long time no blog

February was the last I think. Quite a lot has changed since then

  • Moved the blog from WP unto this. Migration from WP -> Drupal6 proved to be a pain. But here we are, finally.
  • Lots of work. Although not a lot of money.
  • Quite a bit of Travel.
  • Misc funny things in life.

Useless, but...

Somebody wanted this.

function ripper($url) {
$page = appr_curl_function($url);
if ($page === false)
{
die("Something wack happened");
}
preg_match('/watch_fullscreen\?video_id=(.*?)&l=(.*?)+&t=(.*?)&/', $page, $match);
$match1 = "http://www.youtube.com/get_video?video_id=";
if(!$match[1]){

Syndicate content