Aug. 19, 2008 at 5:00pmFinding the Needle in your MySQL Haystack

Fun with stored procedures pt. I

(First in what will probably be a series of blogs as we move all our projects to a replicated, MySQL 5.0 environment, and I finally get to start playing with all the useful features that come with it)

Say you've got a client, Mystery Client A. Mystery Client A has hired a marketing consultant. As a part of their rebranding efforts, they have decided to refactor their company spelling convention to MysteryClientA!, for whatever reason. That's fine for replacing a few logos, but MCA has a database-driven content management system, and their name is riddled throughout the database in page content, event description, news headlines and so forth. Your job is now to sift through the entire system and apply the newly crafted spelling to the entire database. So what do you do?

Read more →

Aug. 18, 2008 at 2:48pmQuick Lost Content Recovery Option

Google cache as quick fix backup

No matter how protected your website may be, sometimes you still need a helping hand when an accident happens. Delete a page while fumbling with FTP? Someone else in your office write over your work on a webpage? Heck, maybe your entire site is down! Google Cache may be able to help.

Read more →

Aug. 15, 2008 at 11:24amWindow.Name experiment

Does anyone use it yet?

I am starting an experiment to see whether the recent blog chatter about window.name is actually being used. Included is some JavaScript that you can put in GreaseMonkey to help me in my search. Read more →

Aug. 12, 2008 at 4:39pmWeb Semantics of a Blog Comment

Yes we are that nerdy

So, whenever I meet up with good friend of mine, Scott Schiller from Flickr, we often talk about geeky things such as Web Semantics and the "proper" way to mark up different things. I know there are a few of you out there who enjoy this topic so here is my question to you.

What do you think is the "proper" way to markup a blog comment in this image?

Aug. 11, 2008 at 5:28pmSEO

Stop the Insanity!

I am amazed how many people are willing to ignore email solicitations from some mysterious contact in Nigeria that needs your help to get access to $15,000.000. All they need from you is for you to help. Your reward, you may keep two-thirds of the money. Yet these same people receive an email or phone call from someone they've never met promising search engine nirvana and they take it, hook line and sinker. Do these same people buy the stock picks recommended when they get an unsolicited FAX or email?

Look, we all want to be noticed. If we didn't we'd never buy flashy car rims that spin, add exhaust pipes that sound like F-16s, or wear perfume. Your website is no different, it wants to be seen and you want it be seen. Which is exactly what most Search Engine Optimization firms are counting on.
Read more →

Jul. 22, 2008 at 4:41pmOnload Collisions and How to Fix them

Harry Potter and the Onload Collisions

There is no other variable more fought over then the coveted window.onload. Its job is to run a function after a page has been loaded. The problem is that there is only one variable, and therefore only one function can run. Once you have set this you would think you are in the clear. That is until another script comes in and overwrites onload.

But all can be made well in JavaScript land once one of four choices is made. I give four ways to get around this problem, and suggest a way for modern browsers to be rid of this problem once and for all.
Read more →

Jul. 11, 2008 at 4:33pmMySQL Tidbits: The XOR Toggle

Fun with bitwise logic!

A web app full of data is often going to be full of tables (at least on the administration end). A listing of users here, all the recently created events there. Often for readability we will alternate rows between two slightly different background colors.

This can be handled on the PHP end with a bit of math and a counter, like so:

$count = 0;
while( $row = mysql_fetch_assoc($res) ) {
    if( $count % 2 == 0 )
        $background_color = 'white';
    else
        $background_color = 'gray';

    /* OUTPUT TABLE CONTENTS WITH GIVEN BACKGROUND */

    $count++;
}


However, it can also be done entirely in-database, via creative use of the XOR operator: Read more →

Jul. 10, 2008 at 3:36pmCoding Fonts

Not just an endeavor in aesthetics!

Having recently discovered the plethora of coding fonts available online, it occurred to me that quite a bit of thought has been put into something I have always seen as rather trivial. The more I read about it, the more I have come to realize that using a font specifically designed for software development can be extremely beneficial.

Read more →

Jun. 30, 2008 at 8:00amFaux Paw in the Footer

Why do we put a copyright in the footer? Why not a publish date?

In web design we commonly put footers in the bottom of the page which include links, legal information, and usually a copyright date. But why? And is there something else we should include?
Read on and I promise not to use any more bad puns.

Read more →

Jun. 16, 2008 at 8:56amWrite .NET Applications in PHP

Say what?!

That's right, you heard me! It's all thanks to a fantastic project called Phalanger, which adds a super-fast execution environment for a very large portion of the PHP scripting language. Certainly this was only a matter of time, combining one of the most popular open-source languages of the web with one of the most powerful enterprise-grade frameworks.
Read more →

Plenty more in the Archives