Monday, January 31, 2005

Mac Mini

Not a Macker, but, dude, that's a small footprint. Right on.

Safe Drunken Dialing

This could come in handy for a lot of people -- on both sides of the issue.

Sunday, January 30, 2005

PHP Validation

A page of validation classes from phpclasses.org

Friday, January 28, 2005

Thunderbird

That's it. I'm doing it. I'm so sick of MS products. And I love Firefox. So I've decided to roll with Thunderbird. Going to hitch it up with Gmail POP. And curious to see how this RSS thing works. Here goes.

PHP WTF

This site is so god-damned geeky. I love it.

Thursday, January 27, 2005

Flickr

Just came across this. Could come in handy, if you can really link to blogs AND it's free.

PHP: get absolute path to current directory

This is just handy enough to put down here, as I'm sure I'll need this like 3 weeks from now and won't know quite where to find it:

$dir_path = str_replace( $_SERVER['DOCUMENT_ROOT'], "", dirname(realpath(__FILE__)) ) . DIRECTORY_SEPARATOR;

Hopefully I'll remember I put it here.

It returns the path for an include file when used in an included file. For the main file calling the script, I think you use $_SERVER['SCRIPT_NAME'] in place of __FILE__. Something like that

Sunday, January 23, 2005

Amazon Book Cover Link

An example:



The snippet provide seems to dead-link the image -- oh, you're supposed to save the image to your own server. Interesting.

Monday, January 17, 2005

Bad Review for New Tivo ToGo

From today's Washington Post. Among other complaints:

"Transferred TiVo recordings play back in Windows Media Player. They looked and sounded fine when played in full-screen mode, save a rare outbreak of blotchiness caused by TiVo's video-compression routines.

"But Windows Media Player is missing two key features. When you scan forward or backward in a recording, you can't see the footage flashing past, as you would on a VHS or DVD recording; you have to guess how far you've moved before resuming playback. And you can't bookmark a spot in a recording to watch later."

Love Tivo, but sounds like I could live without this. A better idea, as the author suggests, is get the TiVo with the built-in DVD recorder. That'd be pretty sweet.

Friday, January 14, 2005

Mary Cassatt Stamps

I just have to say: these are beautifully designed stamps.

See if this link holds:



If not, find the sample here.

Thursday, January 13, 2005

Average Characters per Word (English)

From Wikipedia:

"All Word to number of letters calculations are done on the basis of an average word length of five, plus a space (5+1) = 6 characters per word."

Monday, January 10, 2005

Amazon Book Rec Widget

Between HEAD tags (for easier updating):

<!-- Array of ASINs for Amazon Book Rec Snippet -->
<script type="text/javascript">
<!--
// An array containing the asins for books

books = new Array(3);

books[0] = "0688172172";

books[1] = "0140434453";

books[2] = "0140433872";

// -->
</script>


Between BODY tags:

<!-- Amazon Code Snippet (author: tatwell@gmail.com) -->

<script language="JavaScript"><!--

// An array containing the asins for books

index = Math.floor(Math.random() * books.length);

document.write("<iframe src='http://rcm.amazon.com/e/cm?t=YOURTAG&o=1&p=8&l=as1&asins="
+ books[index] +
"&fc1=666666&lc1=cbc1a3&bc1=cbc1a3&npa=1&lt1=_blank&IS2=1&bg1=ffffff&f=ifr'width='120' height='240' scrolling='no' marginwidth='0' marginheight='0'frameborder='0'></iframe>");

//done

// --></script>
<!-- END tatwell's Amazon snippet -->

GET variables:

t = your Amazon Associates tag
o = ?
p = ?
l = ?
fc1 = font color
lc1 = link color
bc1 = border color
lt1 = link target
bg1 = background color


What it produces is a display like this that will randomly choose a selection from your array:

Friday, January 07, 2005

PHP User Authentication

Looking for something off-the-shelf. Some options:

Mambo

phpGACL

PEAR LiveUser

phpSecurityAdmin

mtWeb
    mtWeb setup

PHP Guard Dog $40

phpSecurePages $20

PHP Nuke $10

Many of these are CMS. Think I'll start with Mambo and see what I can do.

Tsunami Videos

A bit unseemly, perhaps, but I've been waiting for something like this. Sublime in the technical 18th century sense of the word.

PHP File Extension Scope

Just figured this out:

.inc - variables in file have global scope
.php - variables in file have local scope

Seems peculiar. But I just tested it again. And sure enough.

The problem is that .inc files can often be parsed by the browser revealing the code, unless the server is set specifically to prevent it from doing so.

The solution might be a simple key variable that the include checks to make sure is set before proceeding.

Wednesday, January 05, 2005

Image Rollovers

Never figured out how to do image rollovers outside Dreamweaver. Haven't test it out yet, but I think this site explains it.

Axelrod Tournament

I'm really coming to love Wikipedia -- for certain topics. Was shocked to learn that Tit for Tat lost an Axelrod Tournament. But it was only after a couple controversial calls:

The Iterated Prisoner's Dilemma

Implementing Bayesian Inference using PHP

Would really love to be able to say I did that someday.