Creative Commons License
This weblog is licensed under a Creative Commons License.

« June 2006 | Main | August 2006 »

July 22, 2006

Cool Banners Revisited

I've had the cool auto-built banners up on our family blog for four months now. I noticed that I kept clicking on the pictures when I wanted to see the collection associated with it, to no avail. So last night I set out to make it work.

I vaguely remembered something about image maps in HTML, and after some Googling, found it the right syntax. The trick was to build the image map dynamically when the banner loaded, and to build a map for each banner. More googling on what functions I needed, and I was off to the races.

The following javascript functions.js.txt (1 KB) goes with the RandomLogo() (from the first banner blog) function inside the <HEAD> tag. Random logo gets replaced as well, as I needed a global variable for which banner had been selected - I wanted to add the map at the end of the page loading so that there wouldn't be a pause while the banner map script loaded, and so I needed to have the banner # selected be a global variable.

Next step is to add the below snippet to the bottom of each page with a logo (this adds the appropriate map to the banner):


<SCRIPT language="JavaScript">
<!--
AddMap();
//-->
</SCRIPT>


Also, replace the banner image at the top of the pages with the following (which adds an image map with no areas to the banner):

<MAP name="logomap"></MAP>
<span style="margin-left:4px" id="bannerimage" >
<img border=0 style="margin-top:4px" name="logoimage" usemap="#logomap">
<SCRIPT language="JavaScript">
<!--
RandomLogo();
//-->
</SCRIPT>


I updated newbanner.php to generate a script file mapX.js for each newlogoX.jpg that was generated. These scripts map all the image areas and link back to the original set associated with the image. A sample auto-generated script:


map = getMap(document.images.item("logoimage"));
addArea( map, "0,0,136,110","http://www.theeislers.com/Collections/2005-05-14_Here_Chicken_Chicken_Chicken", "Here Chicken Chicken Chicken" );
addArea( map, "136,0,294,110","http://www.theeislers.com/Collections/2005-09-09_Outside_At_Em_at_6am", "Outside & At 'Em at 6am!" );
addArea( map, "294,0,430,110","http://www.theeislers.com/Collections/2005-09-10_Rock_Piling", "Rock Piling" );
addArea( map, "430,0,588,110","http://www.theeislers.com/Collections/2005-04-06_Angus_and_Earl", "Angus and Earl" );
addArea( map, "588,0,746,110","http://www.theeislers.com/Collections/2005-02-17_Fun_with_Towels_and_Masks", "Fun with Towels and Masks" );
addArea( map, "746,0,904,110","http://www.theeislers.com/Collections/2004_12_07_Two_Brothers_Having_Fun", "Two Brothers Having Fun" );
addArea( map, "0,110,969,129","http://theboys.theeislers.com","Home" );


Note that the final line adds a map for the bottom 20 pixels all the way across that links back to the blog home page. To be honest, I don't know what would happen if there wasn't some extra bottom pixels the way I do my banners - I haven't tested it.

Here is the newbanner.php code. The other files etc are found in the previous blog. newbanner.php.txt (8 KB)

Comments

July 21, 2006

Hot DIGGITY!

Meet the Barabus TKR. 1005 BHP. 0-60: 1.67 seconds. Top speed: 270mph. It has a full carbon fibre body and ceramic brakes - and at 270mph, it is going to freaking need them. For interior features, they list leather, suede, and air conditioning. Oh, and a rear view mirror that shows you the video from the camera in the rear of the car since you can't see out the back.

At a mere £360,000, I expect to see one in every garage in Virginia.

Comments

July 17, 2006

Sony SZ281P laptop reviewed

It's only been a year since I got my Sony T370, but I decided to update for two reasons. One (more minor): I was tired of traveling with my giant Dell XPS laptop and my T370 every time I wanted to play Rise of Legends or Age of Empires III with one of my friends and secondly and more importantly, I figured after over two years of using my own laptop for business, I should have a laptop that was actually a company laptop, not my personal one (a giant ding in my T370 after a business trip is what pushed me over the edge).

Back in January at CES, Sony announced their VAIO SZ Premium. It was supposed to ship in March, but like all new cutting edge things, was a little late. I decided to go with the Sony VAIO SZ281P because it was still light (3.7 pounds with the standard battery), fast (2ghz Intel Core Duo), had lots of RAM (2gb), a huge hard drive (120gb), a bigger display for my aging eyes (13.3" @ 1280x800) and could play games pretty decently thanks to the NVIDIA GeForce Go 7400 chipset. I've had it for a month now, and I have to say I am delighted, although there were a couple of gotchas.

First gotcha (minor) - at the time, I couldn't order the 2.16ghz Intel Core Duo. Had to "settle" for 2.0 ghz. Like I said, a minor gotcha. Bigger gotcha - the alleged 7 hours of battery life on the standard battery was a drug-induced hallucination some marketing person had. Standard battery is 3 hours at best of real usage. The good news is that by switching to the extended battery and pushing the weight of the laptop up to 4.1 pounds (still acceptable, although a full pound heavier than my T370), I could get the same performance as my T370 - 5+ hours of DVD playback, 7+ hours of office work.

My favorite thing about the Sony SZ is the dual video chipset, which I didn't even notice when I first blogged about the SZ series. You can switch between a decently fast (and power hungry) NVIDIA GeForce Go 7400 with 128MB TurboCache and a putt-putt slow but power sipping Intel Graphics Media Accelerator 950 with 128MB of shared memory. I switch it to the power saving Intel chipset whenever I am on a plane, and it adds an hour or so to my usage (thus the 5ish hours of DVD playback instead of 4ish which having the NVIDIA chipset enabled gives). And the NVIDIA chipset and the 2ghz Core Duo combine to give awesome performance (at 1280x800, the native resolution of the laptop) for my two games of choice.

Finally, the docking station: I'm glad I have it, because now I don't have separate desktop and laptop, which was a huge pain in the rear. The docking station is pretty standard, with an upside of supporting DVI and 1920x1200 displays (although you have to turn on the NVIDIA card to use it). The only weird thing about the docking station is that you can't plug in any speakers. Weird, weird, weird. Luckily, I found some pretty decent USB speakers from Altec Lansing (XT1) - they are designed as portable, but they sound great and are plenty loud if you plug in the power supply (not required, but the volume is limited on USB only power).

Bottom line - this laptop makes a great business, gaming, and day to day use laptop. I love it!

Comments

July 16, 2006

750gb bargoon

I am thinking of updating my ReplayTV's from 400gb (which are pretty darned full) to 750gb drives. Froogle to the rescue - 360 bucks from ewiz.com. Un-freaking believable - these things were just leaked by Seagate back in April, first appeared at $500, and now you can get them for a bargoon price of $360. Soon, free harddrives with every box of Cheerios.

Comments

July 13, 2006

On Morale

A buddy of mine went to Mexico, and brought me back a great tee shirt. I had never seen this phrase before, and I have to say, it appealed

Comments

Geez, Eyes, that shirt and the motto contained within, was your modus operandi back in the day, you know, when you were a CANADIAN!!!

How come I don't see "Live Wire" on that posted resume of yours, eh? I STILL have the "light show" boxed and ready back in the 'Bay.

Glad to see you are still alive and kicking (with kids too!). Come up to BC and buy an island or something.

Talk to you later,
DICK!

July 12, 2006

William Shatner: I am Canadian!

Found this on Google Video - William Shatner doing a great take off of the "I am Canadian" Molson commercial that came out 5 or 6 years ago.

Hey.
I'm not a Starfleet commander,
or T.J. Hooker.
I don't live on Starship NCC dash seventeen oh...
or own a phaser.
And I don't know anybody named Bones,
Sulu,
or Spock.
And no, I've never had green alien sex,
but I'm sure it would be quite an evening.
I speak English
and French,
not Klingon!
I drink Labatt's, not Romulan ale!
And when someone says to me 'Live long and prosper',
I seriously mean it when I say, 'Get a life'.
My doctor's name is not McCoy,
it's Ginsberg.
And tribbles were puppets, not real animals.
PUPPETS!
And when I speak, I never, ever talk like every.
Word.
Is.
Its.
Own.
Sentence.
I live in California, but I was raised in Montreal.
And I believe in Priceline.com,
Where you never have to pay full price for airline tickets, hotels and car rentals.
I've appeared on stage at Stratford,
at Carnegie Hall,
Albert Hall,
and the Monkland Theatre in NDG.
And yes, I've gone where no man has gone before, BUT
I was in Mexico and her father gave me permission!
My name is William Shatner, and I am Canadian!

Comments

July 9, 2006

Dynamic Movable Type Calendar

I was never able to find a satisfactory solution to having a calendar in the sidebar of my Movable Type blogs, so a while back I set about to build one that I liked (you can see it at work on this blog). Thanks to some great code from Kevin Devens, I didn't have to figure out how to render a calendar, so I just needed to solve the problem of figuring out what days had blogs. The PHP code to do this is here: calendar.php.txt (6 Kb).

After the break are examples of using this in the various MovableType template types.

In the category & archive templates:

<div class="module-calendar module" id=calendar_module>
<?php
<MTENTRIES lastn="1">
$month = "<$MTEntryDate format="%m"$>";
$year= <$MTEntryDate format="%Y"$>;
</MTENTRIES>
include ("http://www.yoursite.com/calendar.php?month=$month&year=$year&rootdir=yourblog" );
?>
</div>

In the date-based templates:

<div class="module-calendar module" id=calendar_module>
<?php
$month = "<$MTArchiveDate format="%m"$>";
$year= <$MTArchiveDate format="%Y"$>;
include ("http://www.yoursite.com/calendar.php?month=$month&year=$year&rootdir=yourblog" );
?>
</div>

In the individual entry template:

<div class="module-calendar module" id=calendar_module>
<?php
$month = "<$MTEntryDate format="%m"$>";
$year= <$MTEntryDate format="%Y"$>;
include ("http://www.yoursite.com/calendar.php?month=$month&year=$year&rootdir=yourblog" );
?>
</div>

In the main index template:

<div class="module-calendar module" id=calendar_module>
<?php
$month = "<$MTDate format="%m"$>";
$year= <$MTDate format="%Y"$>;
include ("http://www.yoursite.com/calendar.php?month=$month&year=$year&rootdir=yourblog" );
?>
</div>

Comments

July 7, 2006

The Wonder Computer

Okay, this is just darn funny: William Shatner pitching the Vic 20 - the wonder computer of the 1980s! I had Commondore 64 and a Commodore PET and I still own (sadly) a Commodore Super PET, but I never had the wonder computer of the 1980's. I feel cheated. Ebay to the rescue!

Comments

July 5, 2006

Samsung launches the SGH-i320

Samsung announced the launch of their SGH-i320 yesterday - due out in Europe this month. I got my hands on one last Thursday and I've been using for the past 5 days straight. First and foremost, you have to tip your hat the design team at Samsung - the device is incrediblely well made, and I am still amazed every time I pick it up at how small and light it is (111 x 59 x 11.5 mm, 95 g).

The device is a delight to use day to day, especially for messaging: XT9 is a kick-ass feature, and the Picsel file viewer for mail attachments is pretty hot. All my extra software works well (except for the beta version of Slingbox mobile for Windows Mobile smartphone which gets really confused by the landscape mode of the display). The stereo speakers sound pretty good, and thanks to T-Mobile now supporting EDGE, I can even stream high quality music from my MusicNow account (albeit the web site is annoying to navigate on a320x240 display). The camera is pretty decent, and the ability to shoot 320x240 movies is really cool (athough the movies are little jerky sometimes). After 5 full days of usage, I give it the official two tired thumbs up!

I expect Samsung to kick some serious global butt with the i320. Sadly, it lacks the 850 band and there isn't a CDMA version (yet), so the only major carrier that could take it in the US is T-Mobile.

Comments

July 4, 2006

You don’t see this every day

The headline says it all: Doctors Remove Lightbulb From Man's Anus. Yikes!!

Comments

Get prayed for and get heart arrhythmia

Found this article on the Scientific American web site. This paragraph sums it up nicely.

The three-year Study of the Therapeutic Effects of Intercessory Prayer (STEP), published in the April 4 American Heart Journal, was the largest-ever attempt to apply scientific methods to measure the influence of prayer on the well-being of another. It examined 1,800 patients undergoing heart-bypass surgery. On the eve of the operations, church groups began two weeks of praying for one set of patients. Each recipient had a praying contingent of about 70, none of whom knew the patient personally. The study found no differences in survival or complication rates compared with those who did not receive prayers. The only statistically significant blip appeared in a subgroup of patients who were prayed for and knew it. They experienced a higher rate of postsurgical heart arrhythmias (59 versus 52 percent of unaware subjects).

There you have it. Happy 4th of July, and watch out for strangers that appear to be surreptitiously praying for you.

Comments

July 3, 2006

Happy (belated) Canada Day

I'm a true blue Canadian - born in Regina, Saskatchewan, grew up in Thunder Bay, Ontario, and went to university and worked for a few years in southern Ontario (in and around Toronto) before moving to Seattle in 1993 to join Microsoft.

While my assimilation is pretty much complete (I became a US citizen in 2003), I still occasionally have to remind myself that I speak English, not American, that it is "colour", not "color" and that "Z" really is "Zed", not "Zee". And since Canadians are all about their beer, who best to explain Canada vs. America than Molson: Joe Canadian Rants.

Happy Canada Day and Happy Fourth of July.

And no, I don't drink Molson Canadian

Comments

July 2, 2006

The Unicorn

When I was a kid, I used to love the Irish Rovers. My favorite song was "The Unicorn" - and before the lyrics were lost from my wetware forever, I downloaded the song via MusicNow - and here are the lyrics... yes, it is true, I need a life.


A long time ago, when the Earth was still green,
There was more kinds of animals than you've ever seen;
They'd run around free while the earth was being born,
But the loveliest of all was the Unicorn.

There was green alligators and long-necked geese,
Some humpty-backed camels and some chimpanzees,
Some cats and rats and elephants, but sure as you're born,
The loveliest of all was the Unicorn.

Now God seen some sinnin' and it gave Him pain.
And He says, "Stand back, I'm going to make it rain."
He says, "Hey, brother Noah, I'll tell you what to do.
Build me a floating zoo."

"And take some of them green alligators and long-necked geese,
Some humpty-backed camels and some chimpanzees,
Some cats and rats and elephants, but sure as you're born,
Don't you forget my Unicorn."

Old Noah was there to answer the call,
He finished up making the Ark just as the rain started fallin',
He marched in the animals two by two
And he called out as they went through,
"Hey, Lord: I've got yer....

Green alligators and long-necked geese,
Some humpty-backed camels and some chimpanzees,
Some cats and rats and elephants, but Lord, I'm so forlorn,
I just can't see no Unicorn."

Then Noah looked out through the driving rain,
Them Unicorns was hiding, playing silly games,
Kicking and splashing while the rain was pouring,
Oh, them silly Unicorns.

There was green alligators and long-necked geese,
Some humpty-backed camels and some chimpanzees,
Noah cried, "Close the doors 'cause the rain is pourin',
And we just can't wait for no Unicorns."

The Ark started movin', it drifted with the tides,
Them Unicorns looked up from the rocks and they cried,
And the waters came down and sorta floated them away,
And that's why you've never seen a Unicorn, to this very day.

You'll see green alligators and long-necked geese,
Some humpty-backed camels and some chimpanzees,
Some cats and rats and elephants, but sure as you're born,
You're never gonna see no Un-i-corn.

Comments

July 1, 2006

Flexible Movable Type Archive Sidebar

Its been a while since a detailed nerdy posting, so I figured it was about time. As my boy's blog has gotten longer (and this one too), I began to dislike how long the archive listing got on the side. I wanted to be able to collapse years together, and after about an hour and half of screwing around this afternoon, I got it to work - code follows the break. You can see it working live on this site - all the entries for 2005 are grouped together in the Archive section of the sidebar.

These style tags need to go into the page stylesheet:

.thinghidden {display:none;}
.thingshown {display:inline;}

This script needs to be included in the page that gets built:

<script>
function expandcollapse (thing)
{
    whichthing = document.getElementById(thing);
    if (whichthing.className=="thingshown")
    {
        whichthing.className="thinghidden";
    }
    else
    {
        whichthing.className="thingshown";
    }
}
</script>

This PHP builds the archive list for the sidebar. It goes inside the div where the archive tags normally sit.

<?php
//
// build the array
//
$index=0;
<MTArchiveList archive_type="Monthly">
$date[$index] = "<$MTArchiveTitle$>";
$link[$index] = "<$MTArchiveLink$>";
$index=$index+1;
</MTArchiveList>

//
// run though each month, inserting year breaks where appropriate
//
$len = strlen( $date[0] );
$baseyear = substr( $date[0], $len-4 );
$hasspan = 0;
echo "<ul class='module-list'>";
for( $i=0;$i<$index;$i++ )
{
    //
    // if the year rolls over, insert a year tag and a hidden span
    //
    $year = substr( $date[$i], strlen($date[$i]) - 4 );
    if( $year != $baseyear )
    {
        echo "</ul>";
        if( $hasspan ) echo "</span>";
        echo "<b><a href=\"javascript:expandcollapse('MoreArchive$year')\">$year</a></b><br/>";
        echo "<span id='MoreArchive$year' class='thinghidden'><br/><ul class='module-list'>";
        $hasspan = 1;
        $baseyear = $year;
    }

    //
    // add a list item for this month
    //
    echo "<li class='module-list-item'><a href='$link[$i]'>$date[$i]</a></li>";
}

//
// closeout open tags
//
echo "</ul>";
if( $hasspan) echo "</span>";
?>

Comments