Wednesday, December 22, 2004

The Winter Warmer

Ingredients:

* 1 oz. Dark Rum
* 1/2 oz. Cognac
* Milk (Hot)
* Maple Syrup

This isn't bad. But it can't hold a candle to my perfect hot buttered rum.

Tuesday, December 21, 2004

html>body : hiding css from IE

How do you hide CSS from IE? The link above gives the details.

The most elegant way is probably the url() with media import rule. Example:

@import url(../hide1b.css) screen;

The simplest is the child hack. Example:

.cat_box li {
list-style-type:none;
margin:0 0 0 10px;
}
html>body .cat_box li {
list-style-type:none;
padding:0 0 0 20px;
}

Monday, December 20, 2004

My Father (by The Bwaz)

My sister showed this to me -- a journal she had kept briefly last year. I guess he's my father, too. She let me post them here to my blog. Here's the complete index

12/22/03 8:00am

12/22/03 9:00am

12/22/03 11:30am

12/23/03 5:00pm

12/22/03 5:30pm

12/22/03 7:30pm

12/23/03 8:00am

12/23/03 2:30pm

12/27/03

12/28/03

12/29/03

01/01/04

01/02/04

01/03/04

01/28/04

Anyway, it's sure to be an instant holiday classic.

Schultz's Anatomy

Found a link to this on this site. Disturbingly funny.

Monday, December 13, 2004

Hosting Services

Pricing hosting services at the moment -- this CNET site proved useful.

The basic plans are listed here: CNET basic hosting plans

Right now, the team to beat is CyberTec Hosting

Friday, December 10, 2004

What I Really Want for Christmas (along with about 600 other guys)

A nice, warm 4-6' December day at Swami's all to myself.

New Yorker Cartoon Caption Contest


That's a pretty good trick. Now turn him into Lindsey Lohan.

Thursday, December 09, 2004

Another Zeitgeisty Kind of Site

What's happening on the Web right now

* 4,966,970 weblogs watched.
* 715,532,811 links tracked.

(according to their home page)

New Yorker Cartoon Caption Contest


We met on Squidster.

Wednesday, December 08, 2004

New Yorker Cartoon Caption Contest


This is just temporary. He'll be replacing Dan Rather at the anchor desk come Spring.

Tuesday, December 07, 2004

New Yorker Cartoon Caption Contest


Squidzilla will happily replace your chopsticks, sir.

Sunday, December 05, 2004

Error-Handling in PHP

My goal for today: master error-handling in PHP. I've been patching together my own error-handling procedures in my scripts, but I get the feeling I'm reinventing the wheel for certain things and missing a lot of useful built-in functionality for others.

Good advice for debugging :

In your init.php script:

if (_DEBUG_) {
set_error_handler ('debug_error_handler');
}
else {
set_error_handler ('nice_error_handler');
}


_DEBUG_ would then be a constant equating to 1 or true, I take it.

Example of an error-handler (this one suppresses messages for unset array indicis):

function error_handler($errno, $errstr, $errfile, $errline, $errctx) {
if ($errno == E_NOTICE && substr($errstr, 0, 17) == "Undefined index: ") return;
echo "\nerror_handler:\n\terrno=$errno\n\terrstr=$errstr\n";
echo "\terrfile=$errfile\n\terrline=$errline\n";
if ($errno & (E_ERROR | E_CORE_ERROR | E_COMPILE_ERROR | E_USER_ERROR)) die();
}
set_error_handler("error_handler");
error_reporting(E_ALL);


Also, note this:

jernberg at fairytale dot se
27-Feb-2003 03:27
tip: if you want your error_reporting()-setting to work with your own error handler you could simply check the error number against the current error bitmask.

function myErrorHandler( $errno, $errstr, $errfile, $errline )
{
$replevel = error_reporting();
if( ( $errno & $replevel ) != $errno )
{
// we shall remain quiet.
return;
}
echo( "error....." );
}


A nice tutorial: Devshed
Useful links

Saturday, December 04, 2004

Make Your Own Global Array in PHP

That's what I want to do. That is, something like this:

make_global($_MYARRAY); (or global $_MYARRAY;)

Then anywhere in code (inside or outside function scope):

$_MYARRAY['this_var'] = "Whatever value I want to give it";

Doesn't appear to be possible. Rather, I can do this:

$sample = array("var1"=>"value1","var2!=>"value2");
/* created within the script or created in a function using the global keyword/scope */


Then, inside a function:

<?php
function this_function()
{
$array_value = $GLOBALS['sample'][0];
}
?>


Explained here.