While HTML5 has yet to achieve wide spread browser support, there's no reason why you can't start using some of the features described in its specification today. Many of the features described are putting words to what people are already doing, for example giving
input elements placeholder text, or the introduction or the
email and
date types.
Another useful new element in HTML5 is
mark. The mark element is used do denote "a run of text in one document marked or highlighted for reference purposes, due to it's relevance in another context." Instead of waiting for global adoption and support for the mark element, we can start using it today, with just a simple PHP function.
Example of marking or highlighting words in action:
Read more →
SoapUI-3.5 can help

I've worked with a number of different web services, some define their own
XML through DTDs or schema's, some use
SOAP,
WSDL (Web Services Description Language), or a combination of both. In all cases I prefer working with the XML directly, and if you're working with WSDL, you have to figure out the XML structure for requests/responses. I recently starting using
SoapUI-3.5 to help me with this.
Read more →
Another Friday Fun Bookmarklet

Happy Friday! For all you Unix lovers out there, we have a treat. Do you miss the days of "more" and "man"? Do you often miss the pleasure of knowing right where you are at in a document? Introducing the Man Scroll bookmarklet!
Read more →
Choosing the keyboard for your user
While running through my morning blogs, I came across one by Jon Snook on
HTML5 Form Elements. He talks about some interesting, future-looking elements that will hopefully be in the browser of tomorrow. But the part I found most interesting was talking about Mobile Safari and how it handles input elements.
Read more →
What jQuery delegate does and why you care
jQuery 1.4.2 added a set of new functions: $.delegate() and $.undelegate(). $.delegate() is a hybrid between $.bind() and $.live(). Here is an example of how the three functions differ, and how to implement $.delegate() in existing code.
Read more →
Bookmarklet to Reveal All!
You have a beautiful website. You have filled it with love and content. You know your website better then anyone else. But have you ever seen your website naked?
Read more →
Using static variable as a function's cache
Web apps become notoriously slow when running database queries. Often times we find ourselves writing a useful look up as a function, and then forget that it requires a query each time. This is where caching comes in. And PHP has a really clean way to do it.
Read more →
Need List of File Since a Revision
An SVN command that gives a list of modified files between revisions. It is very useful when uploading files to a live server and when running through quality assurance. Another command to keep in your bag of tricks.
Read more →
and not letting it ruin your day
Usually, it's a bad idea to allow elements in a tree to be parents of themselves, because that creates problems with trying to add other children to those elements, or even listing out the tree's structure.
But, sometimes things
have to be their own parent. For example, if you want to report details of an element's children to the parent element, what happens at the top level of the tree? You can't outright exclude a tree element from the reporting, you can't create a placeholder element because that would skew the tree, and you can't add in a special case in your code base for that single item.
Well, you
could, but you
don't want to. You'd rather have a simple and elegant solution that doesn't require lots of special cases for tree levels, and that doesn't require maintenance. So what do you do?
Read more →
The web design and development blog Smashing Magazine published an article today about a problem when using a Subversion checkout to deploy files to a live webserver. In short, anyone could browse to a directory on your website, and see all the source code, including database connection information. (Don't worry, at SiteCrafting we don't do this. We have a much better system.)
The Smashing Magazine article includes tips on how to secure common web servers. Here's another way to secure a site using two simple htaccess rules.
Read more →
Dyslexic Developers Cry Shenanigans

Firefox 3.5 and PHP 5.3 were released today, making a challenge for our lysdextic developers.
Read more →
Leaner CSS with LESS

A new module for Ruby was recently released which shows a promise for what CSS could be. It expands on the ideas every developer has
Read more →
PHP IBM DB2 iSeries Database Connection
I'm not going to go into details into the hardships I suffered while researching ways to make a PHP database connection to an IBM AS/400 Server and the hundreds of pages and blog postings I read during the process. I'm going to concentrate on what worked for us.
Read more →
2001 was the year of the snake. People born in the year of the Snake are romantic and deep-thinking, wise and charming, although they tend to dismiss others too quickly and are a bit stingy with money. Ideal jobs for them include teaching or psychiatry. In this entry, we take a quick look at what was cool back in the year of the Snake, 2001.
Read more →
Do I win the prize for longest title?
Internet Explorer has its share of bad bugs. IE6 in particular is well known for it laundry list of CSS bugs. While troubleshooting some code for a newsletter I discovered a rather bizarre one. After testing, I found that it affects everything from IE6 to the recently released IE8. It is mostly just for fun because the chances of running into it are pretty slim.
Read more →
The Phantom Menace
Using intervals in JavaScript for pausing/unpausing events can sometimes cause a phantom interval which you can't control. Learn how to stop that phantom in it's tracks with one line of code.
Read more →
IIS tips and tricks

If you need to have an extensionless URL map to ASP.net 2.0, here are three options.
- Add a Wildcard mapping in Internet Information Services for your website
- 3rd party software, such as ISAPI 2.7 or higher
- Redirect 404 errors to 404.aspx and use Global.asax to capture the URL that caused the 404 error
Example:
Have http://www.mywebsite.com/calendar/
map to http://www.mywebsite.com/calendar.aspx
Read more →
Actions without JavaScript!
A concept of how to define actions using classes. Best part is, there's no need to know JavaScript!
Read more →
Adding/Deploying Crystal Reports to the Web Server
When you install Visual Studio 2005 Professional on your development computer, you get everything you need for adding Crystal Reports to your ASP.net 2.0 project or web site. However, your web server does not have Visual Studio 2005 Professional installed on it, which it shouldn't, which means your nice new reports will not work. What should you do?
Read more →
Methods for page redirects
We have a CMS that generates static html files and some of those pages redirect to a different web page. When that occurs the static page has a combination of meta-refresh, javascript, and a paragraph with a link to the redirected page to handle all possible scenarios. Unfortunately, this combination poses some issues, such as a blank page being displayed while the redirection is occurring, if the page is slow loading the user will see the paragraph text, and once the redirection is completed, the back-button will not work in IE. To avoid these issues, here are a couple of solutions for handling those redirects, the first is to have ASP.net serve .htm files, the second is to install ISAPI Rewrite version 2 or 3.
Read more →
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 →
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 →
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 →
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 →
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 →
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 →
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 →
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 →
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 →
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 →
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'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 →
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 →
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 →
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 →
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 →
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 →
There's small choice in rotten apples.
Recently, I had a need to POST a form, using PHP script, to a remote url. As I started to research a solution, I soon realized there were very few limited options.
Read more →
Inspired by Joe's MySQL Cross Table Content Search
Here's a quick how-to on implementing Full-Text Searching using Microsoft SQL Server 2005. Originally, I planned on just using LIKE statements in the WHERE clause of an sql query, however, this would not be possible since, as I posted earlier in
MS SQL Server 2005 text and ntext, that string functions do not work on text and ntext data types.
That's when I remembered Joe's blog entry about
Cross Table Content Search, which he also mentioned in the office a couple of times before his entry. After that, I've been wanting to implement the Cross Table Content Search, and did not get the opportunity until developing the search page for the
Pierce County Library.
Read more →
It's never the same twice.
I had an interesting conversation with a potential client last Friday and it prompted me to think or at least explain our development rational. He was looking to hire SiteCrafting to assemble a robust application for his client consisting of a design he came up with as well as some "open-source" technologies, and a few custom scripts generated by us. Long and the short of it...it seemed a disaster in the making.
I mentioned to him that SiteCrafting builds our Web applications from the ground up, for each customer as an individual. We do not offer one-size fits all solutions, because just like anything one-size fits all it never fits anyone quite right.
Read more →
text, ntext, and image data types have been deprecated
How I discovered that text, ntext, and image data types have been deprecated and replaced by varchar(max), ntext(max), and varbinary(max).
Recently, I needed to perform a query to update a number of links for the Pierce Count Library website. I thought I could use a simple REPLACE() string function, unfortunately, this turned out not to be the case. In order to update text and ntext datatypes using a query you're limited to a few functions, in my case I would be forced to use SUBSTRING() or UPDATETEXT().
Read more →
Earlier this week the brand new
Pierce County Library website officially launched. It was a pretty complex build that took a lot of effort between ourselves and the library's staff to make sure that everything worked right for the site's users. One of the more important features on any website with a large amount of content is a solid search function, and this site was no different. With over 300 pages (and still growing), a user could easily have some difficulty tracking down the information that they are looking for. So what can you do to make finding information easier?
Read more →
AKA Avoiding Lines at the Health Department
It's not often that I use the stuff we build. It's not that I don't support the businesses we do business with, it's more that I spend so much time online thinking of
how we build things for our customers that I don't generally get a chance to actually
use the websites we build in the way a customer would.
Read more →