Jan. 2, 2009 at 10:43amVisual Studio 2005 and Crystal Reports

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 →

Dec. 1, 2008 at 8:26amASP.net 2.0 and .htm or .html files

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 →

Oct. 27, 2008 at 12:01pmHow to use jQuery in a Prototype world

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 →

Oct. 10, 2008 at 10:43amGoto Code in PHP

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 →

Sep. 25, 2008 at 4:43pmJSCommandlet Released

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 →

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. 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. 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 →

Jun. 5, 2008 at 9:43am'M' is for Model, 'V' is for View . . .

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 →

Jun. 4, 2008 at 10:50amGoogle's Search Appliance

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 →

Jan. 29, 2008 at 3:15pmPHP Patterns, Part III

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 →

Nov. 30, 2007 at 1:05pmWhy is AOL denying email?

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 →

Nov. 14, 2007 at 3:48pmPHP Patterns, Part II

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 →

Oct. 29, 2007 at 10:48amPowered by Coffee

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?

Sep. 12, 2007 at 4:52pmAJAX & IE Caching Issues

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 →

Aug. 9, 2007 at 4:14pmGetting the Client’s IP Address

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 →

Jul. 27, 2007 at 2:56pmPHP Code in The Background Part 2

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 →

Jul. 23, 2007 at 5:29pmASP.net 2.0 Gridview vs. Custom Coding

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 →

Jun. 4, 2007 at 11:31amASP.NET 2.0 Tips - Shared Functions

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 →

Apr. 18, 2007 at 1:08pmPHP PEAR and include_path

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 →

Apr. 13, 2007 at 2:19pmHow To Run PHP Code In The Background

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 →

Apr. 9, 2007 at 4:36pmPrinting without the Dialog

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 →

Apr. 2, 2007 at 2:36pmPHP cURL and SSL Connection Timeout

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 →

Feb. 20, 2007 at 2:53pmOptimizing GROUP BY with Multiple LEFT JOINS

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 →

Jan. 19, 2007 at 4:52pmEmulating Form POST in PHP

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 →

Nov. 3, 2006 at 10:51amHow To Full-Text Search

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 →

Oct. 30, 2006 at 1:04pmWhy We Build Our Stuff from Scratch

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 →

Oct. 27, 2006 at 11:25amMS SQL Server 2005 text and ntext

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 →

Oct. 17, 2006 at 11:33amSmart Keyword Searching

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 →

Oct. 12, 2006 at 11:13pmUsing What We Build

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 →