You hungry?
jQuery Namespace Workarounds

Prototype and jQuery conflict over the $ function. In the entry, I will show you how you can start to include jQuery code in the an environment that is already Prototype heavy.
Read more →
Or: Things you don't know until you do them on accident
I was working on a content retrieval procedure recently, and hit a snag. I needed to retrieve the content of one field, do some other processing, then compare that content to a field in another table. That middle processing step was preventing me from just doing a JOIN between the two.
Logically, what I wanted to do was this:
BEGIN
-- set up variable to store name of table
DECLARE storedValue VARCHAR(64);
-- query to grab the value used later
SELECT firstValue
INTO storedValue
FROM FirstTable
WHERE id = 1;
-- other stuff happens here
DECLARE tableCur CURSOR FOR
SELECT *
FROM SecondTable
WHERE secondValue = storedValue;
OPEN tableCur;
tableLoop: LOOP
-- process results
END LOOP tableLoop;
CLOSE tableCur;
END
Read more →
It's not as bad as you'd think
Sometimes, you just need a way to GOTO. Here is a little trick that will duck out of a section of code using break
Read more →
Not as snazzy-looking as my last two, but a useful query nonetheless. One the applications we built over the years, among other things, takes a list of names and addresses (currently a little over 2600), and selects around 200 of them at random. The client has been keeping track of the alphabetical distribution of last names with each random batch, and was concerned that the apparent weighting of the list toward the beginning of the alphabet was evidence that the lists were not truly random.
Fortunately I was able to get a quick statistical breakdown of the overall list, using the following:
Read more →
JavaScript Development Made Easier

We're happy to announce a new bookmarklet called JSCommandlet. It is a JavaScript console developed for use within SiteCrafting. If you do any kind of JavaScript development, especially working with Internet Explorer, JSCommandlet is for you.
Read more →
Real World to Web Done Right

Leave it to Disney to get it right. We've all heard the stories. We all know about the legendary service, cleanliness, and fun. This story is a bit different as it is about all of those things, but more in my area of interest.
Here's the set up. I spent a week at Disneyland with my family. Fun was had by all. I enjoyed seeing my kids enjoy the rides, the characters and the fun that is Disneyland. All in all, I took over a thousand photos and a lot of video. Where the story gets interesting is in the photos I didn't take.
Read more →
A handy developer community launched yesterday.

Today marks the first day Stack Overflow opens its doors to the public. In case you're not in the know, Stack Overflow is essentially a Q&A site geared towards developers of all kinds. It takes a language/technology agnostic approach and simply provides a framework within which the community can ask and answer techincal questions. Think of it as ExpertsExchange.com except free and much more community driven.
Read more →
PHP now comes with a carry-on!

Today I discovered a very powerful addition to the PHP world. Phar is an archive extension for PHP that allows an entire PHP application to be packaged into a single file. It's basically PHP's answer to Java's .jar archive format. Don't get excited yet, it gets better...
Read more →
The Browser Wars Expandeth

Though adding another browser to our already rigorous bevvy of website testing doesn't appeal to me, having new such programs help drive web innovation is always welcome. Case in point: today's beta release of Google Chrome.
Read more →
Fun with ASCII graphs!

(Author's note: not necessarily actually a practical idea. But fun!)
So pictured here is a histogram of a moderately large set of random integers. Each vertical line represents the total number of entries at each particular integer. Since each number is made up of multiple random factors (10 different random numbers, each between 0 and 100, added together), the distribution tends toward a bell curve.
So how did I build the graph? Excel? PHP? Nope. Just a MySQL query.
Read more →
Finding spikes in your normal data

With most large sets of data, especially numerical data, statistical analysis plays a key role. You can't be bothered to look at every record yourself; that's what computers are for.
One useful tool in any statistical analysis is the identification of
outliers. Assuming you have a
normally distributed set of data, outliers can help to identify user error in the data entry process, or genuine spikes in the data. Once found, these numbers can be set aside for closer analysis or eliminated to normalize the data set.
There are many different methods for identifying outliers, with varying levels of rigor. Here I'll just demonstrate one of the simplest definitions: an outlier is any value greater than three
standard deviations away from the
mean.
Read more →
See how iPhones view your websites with iPhoney.

As mobile access to the web increases, it is becoming more and more important to ensure sites are usable on mobile devices. iPhoney attempts to address the iPhone camp with a desktop application that renders web pages within a virtual iPhone.
Read more →
Subscription Renewal Chaos

So I have a new car. Well three months old and I've been taking advantage of the FREE installed satellite radio. I have to say I was pretty certain that I'd let the system expire once the trial was over, but after commercial free radio with good music, I have to say I'm hooked.
So, when the extend your service email arrived in my Inbox Saturday, you bet I clicked to extend my service.
Read more →
No Animated Gifs here
As a company brand evolves, it's often easy to forget about little things such as the email signature. The email signature, which appears at the close of a message, is usually where contact information exists, consisting of info like your name, title, dept, website, address, and phone number. I say "usually" because many people feel this is a spot to showcase a little bit about themselves. They do this with such things as banners, animated gifs, inspirational quotes, and even their photo.
Read more →
Websites have sure grown up
As one of the "older" employees at SiteCrafting, and as I get ever closer to the birth of my first child, I find myself mirroring my father's sentimentality by reminiscing about the "good 'ol days". Sometimes the "they don't build 'em like they used to" adage can be a wistful lament, whereas other times it can be joyful proclamation. Gone are the days of the sturdy, craftsman house with rough-cut timber and spacious attics, as we now build with prefabricated trusses, foam-filled roof sections, and 4x2 lumber that's really 3 1/2 x 1 1/2.
Read more →
Lettermans Club

Changing the way an entire industry works is never easy. It can take a lot of time to get people used to doing things in a new way. Fortunately, during the past few years we have witnessed entire industries become disrupted by innovation. The Internet has changed the rules in so many industries - digital music, travel, banking - the list goes on and on. So one of our customers asked, why not Letterman jackets?
We all remember (at least those of us that were jocks) receiving our letter and going to the nearest sporting goods store and ordering our jackets. Typically, we chose from a limited set of styles, got measured, paid some money, and then waited 4-6 weeks for delivery. It's a process that still plays itself out in most of the country. Enter Lettermansclub.com...
Read more →
Aug. 20, 2008 at 3:57pmInnovation
Why are we doing this?
So I came across a great blog post on innovation posted by Peter Dixon -
When Super is Just Plain Superfluous and I have to say he just nailed it.
So much has been made of the need for innovation that people have lost track of what the word even means, they just know they need to do it. Which I guess is good if you are in the business of providing solutions that help people "innovate".
Unfortunately, every day people are "selling" innovations that ultimately serve no purpose or are just enormous time wasters.
Read more →
Why yes, you can log in with an invalid username
Stefan over at
Suspekt brought up some
interesting security vulnerabilities based on MySQL's column truncation tendencies (when not in
strict mode), so I thought I'd add my own to the pile, this one right in the grant tables.
MySQL's user table restricts
user names to 16 characters (and hosts to 60). Any attempt to create a user with a longer login results in an error. However, unlike Stefan's example where a field is compared, then truncated and then inserted, MySQL actually truncates a login attempt before processing it.
Read more →
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 →
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 →
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 →
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 →
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 →
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 →
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 →
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 →
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 →
Four hilarious programming videos!
During my morning blog-scan I came across four videos that really set my day off on the right foot. And that song! Oh that song! As much as I can't stand it, I'll be humming it all afternoon today. If you're familiar with the MVC model, then these videos were made for you.
Read more →
The Mini in a Nutshell

I recently had the opportunity to work with one of Google's latest search applances, the Mini. Having no previous experience with any of Google's search hardware, this seems an excellent opportunity to offer a newcomer's first impressions.
Read more →
A Place to Think - For Health Care
I was honored to be asked to present at Jay Ray's Think Lab earlier this month. The day long event was focused on marketing / technology solutions for regional health care providers and was held at
The Inn at Gig Harbor.
The program included practical tips and discussion on a variety of topics, including my presentation, How to Wow! Website Innovation. Other presenters included
Andrew Fry and
JayRay staff.
My presentation, of course begged the question...How does one wow with the web?
Read more →
Deleting all semi-matching rows in MySQL
One of the more recent additions to the SiteCrafting CMS arsenal is a comprehensive error logger, tracking all PHP and MySQL errors (by default... other error types can be created on a case by case basis) that occur in new sites we build. Errors are stored in our own intranet system with a timestamp, error body and a site ID (assigned to each client at a different stage of our project workflow). The table looks something like this:
+----+---------------------+---------------+---------+
| id | logTime | text | project |
+----+---------------------+---------------+---------+
| 2 | 2008-05-14 14:42:15 | A PHP Error | 1 |
| 3 | 2008-05-14 14:42:26 | A PHP Error | 1 |
| 4 | 2008-05-14 14:42:34 | A PHP Error | 1 |
| 5 | 2008-05-14 14:42:47 | A MySQL Error | 1 |
| 6 | 2008-05-14 14:42:56 | A MySQL Error | 1 |
| 7 | 2008-05-14 14:43:05 | A PHP Error | 2 |
| 8 | 2008-05-14 14:43:10 | A PHP Error | 2 |
| 9 | 2008-05-14 14:43:21 | A MySQL Error | 2 |
+----+---------------------+---------------+---------+
8 rows in set (0.00 sec)
Obviously sometimes we get duplicate errors coming through. Aside from being mere mortals who aren't always fast enough to correct an error before it recurs, one of the first stages of debugging is to try and replicate the error. These are often pretty easy to manage. It's pretty trivial to search for all matching errors, check them all, and delete them. Sometimes, though, this just doesn't cut it. Like when there are a few different errors with 10,000 occurrences apiece.
Read more →
An Honor and a Challenge...

What an honor and at the same time, what a challenge. SiteCrafting is thrilled to be named by
The Business Examiner as the Top Place to Work in the category of Employee Appreciation, but --- and here's the big but --- it means we have to live up that honor. A challenge I am glad to take on, given the dedication, commitment, and selflessness shown on a daily basis by our people who truly make SiteCrafting a top place to work.
Sure, we have a lot of very smart, technically minded people working here, but what's more important and worthy of recognition is the fact that we have incredible human beings working here. We have individuals committed to our customers, to our vision, to our community and to each other.
So how did this happen? And how do I live up to the challenge?
Read more →
Find out what's next for the high-growth company...

Seeing the time as ripe for expansion, SiteCrafting has launched a new venture in an effort to expand into prescription eyewear. SightCrafters, LLC will bring to the eyewear world what SiteCrafting has brought to the web development business.
Read more →
Mar. 31, 2008 at 11:40amGot API?
An API reference does a method's body good...

gotAPI.com is one of the most useful online resources I've come across, primarily because it places resources spread all over the internet into one simple site. I've been using this for quite some time, and have for the most part I have taken its usefulness for granted. Then it occurred to me that I might not be the only one that could find this tool useful (I know, it was a big 'DUH!' moment). So now I will share this gem with others...
Read more →

Normally government websites tend to be pretty dry and information-oriented, so I was expecting more of the same when I checked the Snoqualmie Pass traffic cameras from the WSDOT this morning. All the standard stuff that I've come to expect from years of checking the site before driving across the pass was there. However, there was one part of the site that gave me a good laugh this morning. Camera 2 was wiped out in an avalanche over the winter, but rather than a simple "Camera Unavailable" message that I've seen in the past, I saw this:
Read more →
. . . but in a good way!

I stumbled upon a fantastic PHP class today and felt compelled to comment on it. Originally written by Tyler Hall, this class allows you to send notifications to any system running Growl from a PHP script. For those of you that don't know, Growl is an application written for Mac OS X that is intended to act as a universal notification tool (much like the taskbar notification bubbles we've all come to know and love in Windows XP/Vista).
Read more →
PHP's next major release is just that, major!

The evolution of PHP into an object-oriented programming language has been a very exciting process to watch. I'll admit its advancement seems to move at a glacial pace at times, but looking back we certainly have come a long way. With the release of 5.0 we saw PHP leave its childhood and enter its awkward adolescent stage. At this point there is evidence of a mature and complex object-oriented language while stilll exhibiting many of its younger habits.
So what's in store for us next? Find out after the jump . . .
Read more →
Rock it as well, if you must

This time of year you either get hooked or get sick of everything politics. That's right, it's a Presidential election season and the 24-hour news cable channels are firing out tons of info both via your TV and online. Some worthy strides in web development practices have also come about on one news site in particular that may help political junkies get their fix anytime, anywhere.
Read more →
The TO Pattern

The Template Object (or TO) is a design pattern of my own that I developed to fill the role of the View layer in the MVC model. As you have probably figured out, the purpose of the TO is to handle everything related to the user interface. The idea here is to separate the interface as much as possible from the rest of the application, so that we could do a complete rewrite of an application without ever touching (or accidentally "breaking") the
view portion.
Read more →
So this is a post I've been working on in my mind for a very long time. I only recently realized that it needed to be written. You see, small business is anything but small. The services and products that businesses like SiteCrafting provide add value to their customers in such a way that small business has become, essentially, everything.
Read more →
Let's say you've got a website, and you're considering whether or not to advertise on it. Or maybe you've already got a website with advertising, and you're wondering if a particular kind of ad is appropriate to display on your site. The only problem is, you don't have a concrete set of guidelines to filter out what is acceptable, and what isn't. These are the kinds of questions you should ask yourself to resolve this dilemma.
Read more →
Use open-source with more confidence

When meeting with prospective new clients, we tell them that SiteCrafting uses PHP and MySQL as the development platform. Invariably this leads some of them to ask us what PHP and MySQL are and if they are safe and fast. Sometimes, this can lead to interesting conversations, where we explain to them why we think PHP and MySQL are safe and fast.
Occasionally, there's a client who remembers reading an article 4 or 5 years ago about PHP 3 having some security issues. We refer them to current articles on PHP and mention our own experiences, but the latter argument can come across as "Because we say so," which isn't a good way to get the point across.
Read more →
A new way of solving an old problem
A nice feature of JavaScript is that functions are objects. As such, they do not need a name if they are used right away. But what if you need a short anonymous recursive function? arguments.callee becomes your new best friend.
Read more →
What the heck am I talking about?

The concept of
technical debt (first coined by Ward Cunningham) has been something that has wandered about my head without a name for quite some time. The other day I read an article that finally put it into words. It is what I have always seen as the reason writing beautiful code is not just an endeavor in aesthetics. At this point you're probably wondering what the heck I'm rambling on about. Don't give up on me yet, I'm about to explain . . .
Read more →
Being very fond of the analogy of web design/development-as-architecture, I was overjoyed with this article, by Jeffrey Zeldman, on
Alistapart:
Understanding web design.
There isn't much more to say; it's the usual
web-design-isn't-just-looks,-guys, but very eloquently and effectively worded. The kind of stuff to put on the wall.
Depending on how well of a response I get I might be doing this more. Figured since the holidays are right around the corner and you all have been pretty good lately I could give you a free mini button set. :) Enjoy
Download Buttons
Advertising Gone Wrong
I've been a Facebook user for quite some time - even before they had the facebook.com domain. One thing that I absolutely love about it is the control they give you to limit what other people see about you. I've adopted a very serious set of controlls that limits only people I actually know to see anything about me. However, this is a false sense of security. Everything I post online that anyone besides me can access is inherently public. This is what initially drew myself and countless other people to Facebook.
However, their new advertising platform - Beacon - throws all this out the window. Beacon is a system that allows Facebook to track what you do
on other websites. Let me reiterate that: Facebook tracks what you do online. They don't just track what you say you like on your profile, for example what movies you like; with Beacon they can track
what movies you're actually renting.
Read more →
Try adding a parameter to the mail() function
Email debugging is often frustrating and time consuming. There could be numerous reasons why the email you attempted to send out through your code fails: routing issues, firewalls, company servers blacklisting or blocking incoming emails, spam filters, bad DNS records, and email header requirements. The last one can definetely lead to infinite frustration, as I have experienced in the past, and was recently the cause of why AOL was denying emails generated by the php mail() function.
Read more →
A blast from the past

In a recent The Code Project Insider email newsletter, there was a link to an animated ASCII art for Star Wars IV, A New Hope. This brought back fond memories of a bygone era, where I cruised the ASCII based bulletin boards on my trusty Color Computer, the CoCo, and played ASCII art games, such as Voyage of the Valkyries (a game written by my Keithley Jr HS teacher Mr. Leo Christopherson*) and Star Trek, on my school's TRS-80 Model 4, trash 80. I also had the experience of entering the code for several ASCII art games from a book, where I learned that the GOTO statement is very dangerous, especially if you put in the wrong line number.
Read more →
(but don't tell your boss!)

Having stumbled upon
RescueTime, I feel compelled to share my discovery as this concept is just too useful to keep to myself. The basic idea behind this website is to make it easier to keep track of where you spend your time while at your computer. If you find yourself filling out your timesheet at the end of the week only to realize you can't remember what you were doing all that time, this tool was made for you!
Read more →
To nerdly go...

That's what we did a couple Fridays ago here in the office. Brian's wife Julie is an avid Trekker and was excited to plan a Next Generation marathon with us. And we definitely put her complete series DVD collection to good use. From about 5:30pm on we watched episode after favorite episode. After a pile of snacks, some great pizza, sharing Star Trek memories, 7 episodes, it was half past midnight and time to wrap it up.
Thanks to Julie for making the trek (ha!) up and for those killer communicator cookies. We'll definitely have to do it again sometime.
Pics after the break.
Read more →
There's always plenty of tech-speak flying around among developers in the office. I certainly try to keep such language at a minimum when working with clients but sometimes it just works its way in there. DNS and other domain-related processes can be pretty confusing, period, let alone to someone anxious for their website to go live. So how to explain DNS propagation?
Read more →
The DAO and VO Patterns

In this installment, we will be looking at two patterns that have been 'borrrowed' from Java. If you've had any development experience with J2EE, you are probably well aware of how handy Data Access Objects and Value Objects can be. If you haven't, don't fret! This article was written especially for you!
If you've never heard these terms before, you may be wondering why I have chosen to group them together within one article. The simple explanation is ... well you'll see. For now just accept that they go hand-in-hand, much like salt and pepper or peanut butter and jelly or .
Excited? Let's dig deeper...
Read more →

If the iPhone is web apps to go, Google and the Open Handset Alliance's new open source mobile phone API, dubbed Android, is The Joy Of Cooking Webapps. Once again Google has seen a good idea (packing a cell phone full of convenient little apps and widgets that sync with websites and external systems) and figured out a way to make it a great one.
Read more →
More like turn back the clock
So, I'm pretty much online all the time. I'm constantly looking for innovative applications and web services. I thought, "I'm going to have a look at what the 'big guys' are doing."
We all know Google is creating some pretty great web applications like their maps or spreadsheet apps. Seems decision makers at the big "G" have squarely set their sites on building innovative tools for web users. Surely, I thought, Microsoft has its plan and it's called Windows Live.
Read more →
*web developers really like snacks*
Ahh.. where to begin? Greetings everyone. I'm Mandi and I'm wrapping up week 2 at SiteCrafting. I was informed that it might be interesting to get a new hire's perspective posted on the blog, and now that I'm here, Paul is no longer the new guy so it's all on me.
Read more →
Fully one-third of the staff at SiteCrafting participated in our office Halloween contest today. Though we dressed up to win today's prize a few of us even wandered about the streets of Tacoma on our way to and from a party at local design and architectural firm BCRA. A software pirate, blogging ninja, head-crab zombie, and "J" blockhead walking down Pacific Ave. certainly drew a bit of attention.
Read more →
We all know that design and development firms are really run on caffeine. Coffee, energy drinks, tea, and even energy beers now. I usually can be found with 2-3 coffee cups on my desk throughout the week but I will never forget about one developer who I worked with. Each day he would purchase 3-4 drip coffees from Starbucks and then would stack the cups creating a wall about 5 layers high creating his own cubical wall. It was all fine until one day when a few of them turned sour and his office buddy/management put an end to it.
What do you prefer to drink while working? I'm usually a fan of mochas or red bull. Have any ridiculous stories about coworkers caffeine habits?
I just finished installing Leopard on my computer, and my first impressions are that it's very slick and well thought out. One of my necessities as a developer is that I must have a webserver running on my personal computer, so I was dismayed when it wasn't functional after the upgrade. The main reason is that Leopard uses a different version of Apache than 10.4 did, and so some things get wonky. But it's easy to fix. Apache and PHP are included in Leopard, so the only thing missing is MySQL. To install that, go to
MySQL's site, and download the latest copy for OS X. It's incredibly simple to install.
After that comes setting up Apache. Open up a terminal window, and type in "sudo pico /etc/apache2/httpd.conf". (Note that you must be a computer administrator to access the files in etc/) OS X 10.4 had Apache in /etc/httpd/, and that's part of why it didn't work after the upgrade. Find the line in httpd.conf that looks like "#LoadModule php5_module libexec/apache2/libphp5.so", and remove the # sign at the beginning. Then search for AddType, and put the following somewhere around it.
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
Save the file, and exit. Then open up System Preferences in Finder, and click on Sharing. Then turn on Web Sharing. That's all you need do to to setup a webserver on Leopard, or upgrade from OS 10.4. You should be able to open up a browser, and enter http://localhost/YOUR_USERNAME/ and see that the server is running.
No One's Missing the Trust Falls & Human Pyramids

The SiteCrafting team spent the first weekend in October enjoying the Hood Canal area as part of this year's company retreat. Being as we suffer from a distinct lack of petty office politics and other Dilbert-esque characteristics, "company retreat" is not synonymous with "endless torture" for us here.
The getaway was designed to allow the team to take a break from the office routine and gain capacity to review and offer input on company strategy, successes and our roadmap for sustaining growth. As usual, our collective wit, insight and sarcastic humor made these discussions interesting, informative, motivating and memorable.
Read more →
Two weeks ago I had a chance to fly down to San Francisco and check out the Flickr HQ. What I found was a team and office culture that was extremely similar to what we have at SiteCrafting. If you have ever had a chance to visit our office I'm sure the first thing you noticed was how quiet it is. Just as in our office the flickr team rocks out with their headphones on too.
Here is a quick little Venn diagram comparing the two companies:
It was really cool seeing that all of the perks which make our company what it is comparable to the Yahoo funded Flickr group.

Are You Sure You Really Need That?

For the last 3 years I've worked on less and less "Brochure Sites" and more and more web applications. Clients have really taken it for granted as to what features a website should now have. Tag Clouds, CMS, Social Bookmarking, Send to Friend, Add as Friend, Digg It, Wiki and Blog are all things constantly being chanted by clients.
Don't get me wrong, there is a place for these features, but why do you need it all? How will a feature like this affect your company? What's the value add? Luckily, I've worked for ethical companies that have helped mentor clients through the process to help determine what a client really needs.
We could charge a client an arm and a leg for things they don't need, but what good is that? We are not in the business to have our clients fall. In no way is that beneficial to our Partnership.
Read more →
Unless they work here

Unless there's a Seahawks, Huskies, or Mariners game going on, it's pretty rare that I listen to the radio in my car, let alone anything on the AM band. Saturday was the exception as I was driving toward Seattle right after the Atlas Foundry explosion. I kept flipping between the local AM news stations, hoping to hear of any updates as I was just down the street visiting some friends about 10 minutes before the explosion. Hearing any updates required sitting through weather and traffic reports, as well as what seemed like an endless parade of commercials. One of those commercials hit upon one of my pet peeves.
Read more →
What's your take on the database admin debate?

While writing up a review on a database tool I discovered today, I was inspired to spark a discussion about database GUIs in general. The value of GUI tools for administering database systems like MySQL has been a topic of much debate.
Read more →
The Registry Pattern

This is the first in a planned series of articles discussing the application of various PHP patterns. If you're still getting your feet wet developing in PHP (or programming languages in general), you may be wondering what a "pattern" is in the first place. The best place to find a quick explanation is over in Wikipedia's article (which does a much better job than I could hope to do within the scope of this article).
Now, let's move on to the fun part . . .
Read more →
Current clients not surprised

Dan Voelpel begs the following question in yesterday's Tacoma News Tribune: "If I asked you to name the most underrated business in Tacoma, what would you say?"
First on Voelpel's list was SiteCrafting. The article defined "underrated" by those local firms that are either well-known but who's contributions are deeper than at first glance or others, like us, who fly somewhat under the radar but do great business.
Read more →
Sep. 20, 2007 at 9:32pmInteract
What's the big deal?

We want to stay connected with our customers. We want customers to meet other customers. We want our potential customers to see just how easy it is to take control of their website and make it more successful. We want to give you the chance to meet others that are using our tools, that is why we have created "Interact".
We realize that people are busy. In fact, most people, when they get to the office, don't have time to even think about much of anything other than the hottest potato that has been thrown in their lap on that particular day. Rarely do they have time to get a few minutes to update their websites, even more rare, the time to strategize ways to make their website make their lives easier. That is why we believe Interact is so important.
Read more →
Maybe next we'll break into song

Who knew a seemingly innocuous internal email would make for some good laughs and groans? I sure didn't when I invited folks from the office to join in a Friday after work pseudo-tradition.
Read more →
Translation: It's Programmers Day!
For those that aren't aware,
Programmers' Day is today and marks the 256th day of the year. If you just thought to yourself "wow, that's 1111 1111 in binary!" then consider today to be a day in your honor. In case you're wondering why this particular day was chosen, consider this: 1111 1111 is the last of the 256 possible values of a byte.
Read more →
I've been working on a project that involves using the jQuery javascript library and the Ajax methods. I've been happily using the Ajax jQuery.get() method to handle simple calls, such as a link that allows a user to view a list of words based on their selection, getting the contents of a tab when the user selects a tab, and finally getting the current weather after the person enters a new zip code, which is then saved to the database.
For the last operation, I got the JavaScript working great on Firefox and I thought it was working in Internet Explorer. However, after some testing, I noticed that the same weather data was being returned, even after a new zip code on the opposite coast was selected. Mmmm, I was rather baffled, especially since I've been using this jQuery.get() on the other functions, and encountered no problems like this.
Read more →
Fie on commas! Fie!

SiteCrafting is in the process of phasing out some of our older servers, and as an added bonus, the clients hosted on those servers are getting a MySQL jumpstart, leapfrogging over 4.1 to go straight from 4.0.24 to 5.0.32. Tragically, it's not quite as simple as dump | import. This is what I get for bothering my bosses for a few weeks not long after coming aboard about how nice stored procedures, updatable views, and triggers could be.
"The wonderful thing about standards," a wiser person than me once said, "is that there are so many of them." That's not the whole of it, though. One good thing about standards is that there are certain features one can generally rely upon to work, translate, port, etc. Assuming one works within them, rather than taking advantage of loopholes allowed by their not-entirely-compliant-but-we're-getting-there-and-anyway-isn't-this-way- easier-and-faster software. When people don't (and I'm not entirely innocent here), you run the risk of turning your simple upgrade into a serious project when your favorite software decides it's time to comply a bit more.
Read more →

In the process of trying to figure out what in the world was wrong with my stylesheet, I went to W3 to validate it (and, although it is irrelevant to this post, I found my problem in a typo. Isn't it always a typo?) Since I am lazy about these kinds of things, I did the validation by direct input rather than finding and uploading the actual file, and something entirely odd happened: the URL bar contained something that looked like a solid black mess. After one forced shutdown due to being worried that something had gone wrong, I copied and pasted the content of the bar into a text document and lo and behold! It was the URL (a 34 000 word one, no less, due to the direct-input validation's method of incorporating all the CSS into the URL) and because of its length, it had wrapped over itself.
Read more →
There are a number of reasons why you may want to capture a web user's IP address. You may want to only allow certain IP addresses to view your website, to allow only one vote per IP address, track unique clicks on links and buttons, a location of web users on Google Maps using MASHUP, and whatever else you can think of.
Below are a couple of examples to get the client's IP address in PHP and ASP.net, along with a couple of things to watch for.
Read more →
Question: What are my strengths?

So I mentioned earlier that I was reading the book Now Discover Your Strengths, and I have discovered mine, or at least mine as are determined by a 30 minute profile. What's strange is I never do well on these tests, I always find myself answering the questions the way I think they want me to and I wonder what that says about me...
Anyway, this is what my profile tells me. I am adaptable, have strong beliefs, believe everything is connected, thrive on coming up with ideas, and value action. My strengths are below:
Read more →
Passing Arguments To Command Line
The blog entry
How To Run PHP Code In The Background discussed how to run a php file through the command line using php's exec() command. Recently, I needed to pass a querystring to the php file, but this is not possible through the command line. If you try to pass a querystring, the exec() command will fail.
Fortunately, after some googling, I came across a
forum post that mentioned how the global array $_SERVER["argv"] can be used to get arguments being passed through php. I then followed the link on that page to
Chapter 43. Using PHP from the command line on the php.net website. Under the user contributed notes, I found a
nice little function for getting the arguments and placing them into an array, similar to $_GET, $_POST, and $_REQUEST.
Read more →
A balance of needs and time
I recently decided to try the Gridview control in asp.net 2.0. I read some documentation and decided that it would be very easy to implement. I started by following a step-by-step tutorial on creating a table using the Gridview control, which uses the SqlDataSource control. This step-by-step tutorial included details on how to add paging, column sorting, updating a record, and deleting a record. The tutorial can be found
here. I was actually excited when I got this to work and how easy it was to do. It would only take a few minutes to create a simple, paged, sortable table where a user can delete and update records right on the page. Please note that
simple is the operative word here.
Read more →
Feeding the Hype

OK, so I promised myself that I would wait until the second generation iPhone so I could let them work out the bugs and lower the price. Then I played with one and realized I had to retire my RAZR for one of these. Aesthetically, it is a knock out, but I can assure you it's beauty is way more than skin deep.
I have a hectic life, kids, business, and homebrew. All add up to a lot of demands and juggling. I've tried organizational tricks, Palm Pilot, Windows CE, Blackberry, and nothing, I mean nothing is even close to this. I'll stop gushing so that I can give you some practical examples.
Read more →
So, some people are interested in what others are reading at the current moment. So I thought I'd give you a view into the sorts of things that I focus on when I'm not working on conquering the web universe.
The fact is, I am always looking for new books and new things to learn. I recently finished a book that was recommended by a client called Indomitable Spirit by Chuck Ferguson which calls itself "The essential guidebook for a lifelong journey of leadership and the rewards of meeting them".
Read more →

With all the different
companies and organizations we work with, I'm bound to run into them in the "real world". Seeing people around is one thing. Seeing ads is another pretty common one. Lately, however, the signs of our clients I've been seeing are mobile ones.
Read more →

My search for the perfect web app testing environment yielded what I though would be a pretty ingenious setup. Stack up a couple Mac Mini's with a KVM and we could cover everything from XP to Vista and IE 6 to 7. The perfect solution, however, ended up being one Mini cheaper.
Read more →

SiteCrafting'er Joe and his band This Shirt Is Pants had a gig last Friday here in Tacoma at Hell's Kitchen. A gaggle of co-workers and friends showed up and had a great time playing some pool and listening to the band.
Read more →
Visual Basic for ASP.NET 2.0
When developing a recent project for ASP.NET, there was a need to migrate a large number of generic functions that were created in PHP into the .net web project. For .net 1.0, you were able to add a code page that could be used for creating a bunch of functions. However, in .net 2.0, you still had the ability to add a code page, but it had to be a class. This meant placing all of our migrated functions as methods inside a class. To use a generic function, such as generateNewPassword(), you would have to first create a new object for the class and then call the method.
Read more →
Why Les Schwab will never go out of business
I know, I know. We all know how great Les Schwab is (which is ultimately the point of this entry). Where else do you pull into a parking lot and have a guy (or girl) throw their tools down and sprint to your car to see how they can help you?
Before I begin, I should set the stage. I get home from work Wednesday, and my wife tells me that the check tire pressure light is still on in the car. I've been "solving" this problem by continually adding air to the tire - not a great long term solution, I'll admit. It's kinda like adding water to a lake with a leaking dam. Anyway, we are scheduled for a vacation tomorrow that involves driving, so I decide it's better to take care of it for real at this point.
Read more →
It's been quiet on the SiteCrafting blog lately, mostly because we've been very busy making websites for out great clients. I've been swamped for the last two weeks with one project, and I know Kevin, Ken, Reena, and... well, everyone has a full load.
My latest few projects have all been sites that have a defined content width, say 850px, but centered in the browser window. The usual way to accomplish centering with CSS is to make the margins of the content to automatically adjust to the window (margin: 0 auto;). Usually, that happens on the specific areas, so if you have three content areas to center, you either need a container for all of those areas, or set margins three times. The first option has problems with backgrounds, and the second results in more code than is needed.
Read more →
When attempting to use the SMTP library from PEAR for a project, I was having problems with including the file. I kept getting a file stream error for this code:
require 'Net/SMTP.php';
I figured the problem had to be related to the include_path setting in the configuration file.
Read more →
PHP Asynchronous Programming
If you have php code that would take longer than 5 minutes to run, what would you do?
You could update the configuration file for apache, or whatever web server you're running, to increase the amount of time a script page is allowed to run and then use php's
ini_set("max_execution_time", seconds) to increase the amount of time php will allow a script to run.
Or you could use a session variable to mark the last position of the script and then use meta-refresh to start the script at the last position.
Or you could try an asynchronous call by using php's exec command.
Read more →
One day, one of our clients came to us with a very unusual request - they wanted to be able to print something directly from the browser, but without displaying the usual print dialog box. I don't have much time in the webdev business, but I've never heard of this kind of request, and neither had anyone else in the office.
Read more →
I've been working on a web site that uses cURL for request/response transactions and I was encountering a number of problems with empty responses from the server. This caused some frustrations, since these empty responses caused entire sections of a web page to be empty, especially on searches. Well, I couldn't have that, since people using the website would be confused on why a search for an item only worked occasionally. Trust in the web application would drop dramatically.
Read more →
It's not a huge secret that I'm a rugby fan. There's a mystique about the rugby culture here in America. It's a lesser known sport in the US, and so when one rugby fan bumps into another fan, as they are prone to do, they usually spend a few moments swooning over the fact that someone else likes their sport. Just last night, I was out at JazzBones in my All Blacks jersey, and someone who I'd never met before started talking about rubgy with me. It was fantastic.
Read more →
Over the past few weeks, Reena has been building a new website off and on for a local Jesuit parish. Everything was going along smoothly until we hit a bump in the road when dealing with a particular page with some Vietnamese text. After some small (but not obvious) changes in configuration and more research than I cared to do on the subject of character sets, it's all working properly.
Read more →
I just finished coding a new photography contest application for a client, and our graphic designer alerted me to some weirdness that Safari has with PNG images. To make a long story quite short, Safari doesn't translate PNG colors to match CSS colors reliably; it darkens them just a bit. The details are beyond me, so instead check out
this article for those, and you can see an example in
this image. The example labeled "Your Version" is the Safari rendering, and the box labeled "Our Version" is the Firefox rendering.
For you, this means that you shouldn't use PNG images where color matching is important, use GIF instead. However, if PNG use becomes more widespread, hopefully the treatment of PNG images by browsers and OSs will become more standard and can replace GIFs - which have fewer colors and larger filesizes.
More form, less space
Some really large forms can be a bit of an eyesore especially to the people filling them out. One thing that always bothered me was how bulbous most textareas had to be just to make enough room for a user to feel they could type what they needed. So I set out to figure a good way to clean up my forms a bit while still allowing the multi-line input of textareas.
Read more →
Yesterday I was working with a script that saves an uploaded image to a database. If you've ever seen a binary file as a string, there's a ton of gobbelty-gook that is unreadable to people. For some very odd and inexplicible reason, my script only saved the first four character's worth of data to the database, and that's not very helpful. I did some digging, and revealed a weird gotcha in the way PHP treats strings.
Read more →
Creative use of temporary tables
At SiteCrafting, I enjoy working with a large number of different projects, each with their own requirements, technology, and problems to be solved, unfortunately, I sometimes forget about past solutions, until after I have finished writing a piece of code. Such is the case with a query that was eating up some serious processing time.
The problem was with a GROUP BY query with LEFT JOINs to several other tables and summing up totals from those joined tables. This query was taking about 4 minutes 45 seconds to run, and worse yet, it was affecting searches which had nothing to do with that query, and probably also eating up precious memory and cpu resources.
Read more →
Why it's important to listen

Here at SiteCrafting, we are quite busy with new projects. As such, we have realized that additional staff is necessary to meet the demands for our services. With the addition of new staff members comes the need for more furniture. We also decided that this would be a great time to rearrange the office, and create 3-4 person "pods" for team collaborative purposes. So, we headed off to the furniture store that supplied us with our current desks and chairs, hoping to place an order for 14 new tables.
Read more →
and neither is your website
When I was back in school, I would often tell people how my combined Art and Computer Science majors did not mean that I was doing graphic design, web design, or any other kind of mix of computers and art. To them, it was obvious that I would combine two usually separate majors into the usual combination. To me, however, art and computer science are totally separate. The purpose of art is in my mind to either 1) evoke an emotional response in your viewer or 2) create something beautiful. Computers are a communication medium, and the purpose of communication is to deliver information.
You can see examples of this every day - in websites of art schools that are impo