Add Scroogle to your search area in Firefox 2.0 Install the 'Scroogle Scraper' search plugin.

software


Here’s a quick example of weighted round robin in php.

//weighted round robin
 
define("START_WEIGHT", 1);
class printer
{
  private $name;
  private $weight;
  private $normalizedWeight;
  public function printer($name,$weight=START_WEIGHT)
  {
    $this->name=$name;
    $this->weight=$weight;
  }
  public function getName() { return $this->name; }
  public function getWeight() { return $this->weight; }
  public function setWeight($weight) { $this->weight=$weight; }
  public function getNormalizedWeight(){ return $this->normalizedWeight; }
  public function setNormalizedWeight($weight) { $this->normalizedWeight=$weight; }
 
}
 
$printerList=array();
$printerList[]=new printer("printer1",1);
$printerList[]=new printer("printer2",2);
$printerList[]=new printer("printer3",4);
$printerList[]=new printer("printer4",1);
 
$jobList=array('job1','job2','job3','job4','job5','job6','job7','job8','job9','job10','job11','job12','job13','job14','job15','job16');
 
$min=2147483647; //a large number
foreach($printerList as $printer)
{
  $min=($printer->getWeight()<$min)?$printer->getWeight():$min;
}
foreach($printerList as $printer)
{
  $printer->setNormalizedWeight($printer->getWeight()/$min);
}
 
$jobCount=count($jobList);
while($jobCount>0)
{
  foreach($printerList as $printer)
  {
    $jobCount=count($jobList);
    if ($jobCount>0)
    {
      $jobList=jobPush($printer,$jobList,$jobCount);
    }
  }
}
 
function jobPush($printer,$jobList,$jobCount)
{
  for($x=0;$x<$printer->getNormalizedWeight();$x++)
  {
    if ($jobCount>0)
    {
      $job=array_shift($jobList);
      $jobCount--;
      echo($printer->getName()." getting ".$job."\n");
    }
  }
  echo("\n");
  return $jobList;
}

Google just released their new browser, Chrome. You can read all about it, comic-style, on Google Books.

I just downloaded it. I’ll let you know how it goes

As you probably know, Microsoft released its long awaited XP successor, Vista. Some have asked what I think of it. I’ve played around with Vista a bit at work and my firm recommendation is to NOT UPGRADE TO VISTA. There is no compelling advantage. Indeed, I’m aware of many negative effects of upgrading: programs not running, device drivers not working etc.

As well, Microsoft recently released Office 2007, which contains new versions of Excel and Word. Here’s the catch: the default file format .xlsx and .docx ARE NOT BACKWARD COMPATIBLE! That is the epitome of stupidity. Purely retarded. Why would they do that?!?!?

My next desktop operating system will surely not be Vista. It will be a version of Linux. Linux has not, in my opinion, been ready for the desktop for some time, but it’s becoming better and better all the time. Stay tuned!

Over on my other site I just posted a blog entry about a Dominos pizza ad campaign where each day they release a word puzzle and if you solve the puzzle you get a link to an eBay auction where the first ten people that day (for only $9.99) can buy pretty cool stuff, like an iPod or a year’s worth of pizza.

The puzzles are one of three forms: Word Jumbles, CryptoQuips or Domino’s Trivia. The Word Jumble is just as it sounds; they scramble the letters of some Domino’s themed sentence around and you get to unscramble it. For example: MOIODSN HITNNYGA SOGE ALED

Here’s the link to my Word Jumble solver Domino’s Pizza Anything Goes Deal Helper Script

And here is the code:

if (isset($_REQUEST["word_jumble"])&&$_REQUEST["word_jumble"]!='')
{
 
$vocabArray=array('2-liter','a',...,'Vine-Ripened','wings');
 
$lookuptable=array();
foreach($vocabArray as $vocab)
{
  $str=strtoupper($vocab);
  $tempArray= array();
  for($i=0; $<strlen($str); $i++)
    {
      $tempArray[]=$str[$i];
    }
  sort($tempArray);
  $tempStr=implode('',$tempArray);
  $lookuptable[$tempStr]=$vocab;
}
$wordArray=explode(' ',$word_jumble);
foreach ($wordArray as $word)
{
  $str=strtoupper($word);
  $tempArray= array();
  for($i=0; $<strlen($str); $i++)
    {
      $tempArray[]=$str[$i];
    }
  sort($tempArray);
  $tempStr=implode('',$tempArray);
  $unscrambled = ($lookuptable[$tempStr]=='')?'?????':$lookuptable[$tempStr];
  echo($word." = ".$unscrambled."\n ");
}

We all know that my laptop harddrive crashed. I ordered a new one and have been reinstalling my sofftware. Here’s a list of things I’ve installed so far:

  • all latest drivers
  • windowsupdate.microsoft.com
  • www.getfirefox.com
    • webdeveloper extension
    • add tabs for frequently used sites
      • gmail.google.com
      • www.google.com
      • www.slashdot.org
  • www.textpad.com
  • AVG
  • adaware
  • spybot search and destroy
  • hijack this
  • GAIM (if it ever stops crashing) or MSN IM
  • microsoft antispyware
  • putty
  • winscp
  • winrar or 7zip
  • googletalk
  • treenotes
  • badboy
  • microsoft office
    • setup outlook rules
  • sqlyog
  • oracle instant client
  • toad for oracle
  • adobe reader
  • adobe flash
  • quicktime

Send to a friend * Print this page * Join the club * Talk with my robot * Advertise here * Search this Site * Donate * Link to me


Web hosting by Utah Hub *  Powered by CreativeTap *  In association with Segomo
Unless otherwise noted, Copyright 2004-2006, Ryan Byrd. All Rights Reserved.
Ryan Byrd dot net -- probably the coolest site in Utah