<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/atom10full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:thr="http://purl.org/syndication/thread/1.0">
    <title>Home of the Spider</title>
    
    
    <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/" />
    <id>tag:typepad.com,2003:weblog-533618</id>
    <updated>2009-08-23T08:59:07-07:00</updated>
    <subtitle>A journal of web development</subtitle>
    <generator uri="http://www.typepad.com/">TypePad</generator>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/atom+xml" href="http://feeds.feedburner.com/HomeOfTheSpider" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="homeofthespider" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://hubbub.api.typepad.com/" /><entry>
        <title>iPhone and Web Development</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2009/08/iphone-and-web-development.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2009/08/iphone-and-web-development.html" thr:count="2" thr:updated="2010-01-28T02:27:49-08:00" />
        <id>tag:typepad.com,2003:post-6a00d8341fc55453ef0120a5e6bd16970b</id>
        <published>2009-08-23T08:59:07-07:00</published>
        <updated>2009-10-14T19:51:05-07:00</updated>
        <summary>So I bought an iPhone. After being tortured with a BlackBerry that I could never get to work right, I think I deserved it. It definitely is a cute toy, but my real justification for buying it is business. Having...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="iPhone" />
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Development" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>So I bought an iPhone. After being tortured with a BlackBerry that I could never get to work right, I think I deserved it. </p>
<p>It definitely is a cute toy, but my real justification for buying it is business. Having recently gone into business for myself (developing websites - if you need somebody, I'm your guy :),) I needed a tool to stay in touch with clients as much as possible. I also wanted something that would allow me to deal with emergencies, without constantly dragging a laptop around. I hoped the iPhone would allow me to make minor edits and possibly restart a server. </p>
<p>So does it live up to expectations? It does. There are two amazing apps that make the iPhone an icredibly useful business tool. Every web developer and server admin must have them. </p>
<p>The first is ezShare (on iTunes here: <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=301589535&amp;mt=8">link to app</a>) This app can connect to an FTP server, download files to your iPhone, and edit ASCII files. For emergency fixes it's great. The support provided by the developers was excellent, my emails were replied to quickly and intelligently. </p>
<p>The second is Jaduu RDP (available on iTunes here: <a href="http://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=299002339&amp;mt=8">link to app</a>) This app simply blew me away. You can login to your windows server and it does a very effective job of giving you a very usable UI on the tiny screen. Great if you are need to restart or diagnose issues. </p>
<p>I also use the iPhone to read (and write!) blogs, keep track of my finances, scan barcodes (with an app called RedLaser - very cool,) chat &amp; IM, and follow my favorite teams. Overall, it's a great combination of business tool and fun toy.</p></div>
</content>



    </entry>
    <entry>
        <title>Design &amp; Development</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/10/design-development.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/10/design-development.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-57625257</id>
        <published>2008-10-27T12:39:25-07:00</published>
        <updated>2008-10-27T12:39:25-07:00</updated>
        <summary>There's software design, and then there is design. I enjoy software design. It's challenging and fun, testing new ideas and theories, and creativity abounds. Past the design stage, you have to work within the framework of your design. Your creativity...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Design" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>There's software design, and then there is design. I enjoy software design. It's challenging and fun, testing new ideas and theories, and creativity abounds. Past the design stage, you have to work within the framework of your design. Your creativity and ideas are bounded by that design.</p>
<p>Part of my love for software design, and software development, comes from my experiences as an artist. While I may not be much of an artist, there is nothing like taking a blank sheet of paper (or photoshop canvas) and turning it into something beautiful. </p>
<p>It's like watching your program grow from nothing into a complete program. </p>
<p>So when the opportunity arose to design a new website, I jumped at it. Oh, I'm sure that "professional" designers would find a million things wrong with it. And honestly, I can find plenty wrong with it as well. But I like it, and more importantly, so does my boss.</p>
<p>I spent years focusing on the development end of websites. Its been a great experience doing a little bit of design.</p>
<p>I'll post a link to the site, along with a brief overview of the site, when it goes live.</p>
<hr />

<p>Item of the Day: <a href="http://www.homeandstone.com/detail.cfm?Group_ID=1399&amp;Product_ID=9355">QBIX-ART 12.253.151.006</a> - <a href="http://www.homeandstone.com/cats.cfm?Group_ID=44">Bathroom Faucet</a> by <a href="http://www.homeandstone.com/shop/brand.cfm/kwc">KWC</a></p></div>
</content>



    </entry>
    <entry>
        <title>Auto-fixing and Firebug</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/08/auto-fixing-and.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/08/auto-fixing-and.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-54482790</id>
        <published>2008-08-20T16:15:32-07:00</published>
        <updated>2008-08-20T16:15:32-07:00</updated>
        <summary>HTML is very forgiving. Its forgiveness is one of the main reasons the web became so successful, as the bar is set very low. You can just throw some text and HTML on the page, and something will display. This...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Development" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;HTML is very forgiving. Its forgiveness is one of the main reasons the web became so successful, as the&lt;span style="mso-spacerun: yes"&gt;&amp;nbsp; &lt;/span&gt;bar is set very low. You can just throw some text and HTML on the page, and something will display. This is very different than programming, where the bar is pretty high. You throw some text at a compiler, it'll give 954 fatal errors.&lt;/p&gt;

&lt;p&gt;Of course, its not HTML itself that’s forgiving, it’s the browsers. The browser is fixing your crummy HTML behind the scenes. Forgot a &amp;lt;/table&amp;gt;? No problem, the browser guesses where to add it. While it may guess wrong, its better to display the page wrong, than to not display it at all.&lt;/p&gt;

&lt;p&gt;Most web pages on the internet take advantage of this. We don’t make our pages perfect, we just get them to display correctly. As soon as it looks correct, we're done, and we don’t worry about how much work the browser is doing to fix up our work.&lt;/p&gt;

&lt;p&gt;This auto-fixing, as I call it because I don’t know the technical term, can lead to some quite subtle bugs. When the browser guesses wrong, its difficult to know how the browser fixed your HTML, making it difficult to know where you went wrong. Validation would work in many cases, but then I'd have to fix the other 954 validation errors, which I'm not really interested in doing.&lt;/p&gt;

&lt;p&gt;Enter &lt;a href="http://getfirebug.com/"&gt;Firebug&lt;/a&gt;. Firebug can show you the HTML, after the browser fixes it! Nice. What wasn't so nice was what the browsers were doing to my HTML. &lt;/p&gt;

&lt;p&gt;First, what I did wrong. The header and footer of my site is table based, but the page content I'm creating is styled Div's. I forgot to put the &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; and &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; to complete the table for the layout. &lt;/p&gt;

&lt;p&gt;Here is the HTML:&lt;/p&gt;

&lt;p&gt;&amp;lt;table&amp;gt;&lt;br /&gt;&amp;lt;div class=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;h1&amp;gt;title&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;div class=&amp;quot;content&amp;quot;&amp;gt;content&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;div class=&amp;quot;morecontent&amp;quot;&amp;gt;more content&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/table&amp;gt;&lt;/p&gt;

&lt;p&gt;The problem I was having was that the CSS was not styling this page properly. The H1 tag and Div.content were style correctly, but not Div.morecontent.&lt;/p&gt;

&lt;p&gt;Firebug to the rescue! Take a look at how the browser fixed my HTML:&lt;/p&gt;

&lt;p&gt;&amp;lt;table&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;div class=&amp;quot;page&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;h1&amp;gt;title&amp;lt;/h1&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;div class=&amp;quot;content&amp;quot;&amp;gt;content&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;div class=&amp;quot;morecontent&amp;quot;&amp;gt;more content&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/table&amp;gt;&lt;/p&gt;

&lt;p&gt;Huh?! It chopped my Div.page in half, and created 2 rows in my layout table, instead of one! Simply adding the &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt; and &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt; fixed it, but that is one unexpected fix.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;Item of the Day: &lt;a href="http://www.homeandstone.com/detail.cfm?Group_ID=1280&amp;amp;Product_ID=8216"&gt;American Themes 117-V36&lt;/a&gt; - &lt;a href="http://www.homeandstone.com/shop/bathroom-vanities.cfm"&gt;Bathroom Vanity&lt;/a&gt; by &lt;a href="http://www.homeandstone.com/shop/brand.cfm/fairmont-designs"&gt;Fairmont Designs&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
</content>



    </entry>
    <entry>
        <title>Query of Queries in Coldfusion MX</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/07/query-of-querie.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/07/query-of-querie.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-53513030</id>
        <published>2008-07-30T12:46:13-07:00</published>
        <updated>2008-07-30T12:46:13-07:00</updated>
        <summary>I recently started working on converting my messy, legacy, procedural code to CFC's. Lets just say I love CFC's. It makes coding a joy, and maintenance a breeze. I wrote one component for categories. When you load this component, it...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="ColdFusion" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;I recently started working on converting my messy, legacy, procedural code to CFC's. Lets just say I love CFC's. It makes coding a joy, and maintenance a breeze.&lt;/p&gt;

&lt;p&gt;I wrote one component for categories. When you load this component, it loads all information for this category, including a list all sub-categories and products in this category. The number of products in the category are used in various places throughout the site when I render a link to the category, so I pull the products when the category is loaded.&lt;/p&gt;

&lt;p&gt;One of the features of the site is a price filter, allowing you to view products within a specific price range. Because I load all the products when the category is loaded, rather than going back to the database to get the products matching the filter, I use Query of Queries to get only the matching products from the original query.&lt;/p&gt;

&lt;p&gt;However, a customer pointed out that the price filter returning incorrect results. Say you filtered the results to view products under $20, it would show all products where the price began with a 1. The customer, who is a web developer for a large accouting firm, suggested that the price was being stored as a text string, and this result was because it was doing a text comparison, not a numeric comparison. I know that the database is storing it as a decimal, but it got me thinking about my Query of Queries, and how Coldfusion is assigning data types to the columns.&lt;/p&gt;

&lt;p&gt;A little research showed me a big issue. Coldfusion MX does not allow you to assign the data type of the columns in a query (later versions do allow you to, but I haven't tested it with Query of Queries.) There is also almost no documentation about which Coldfusion functions can be used in QoQ, aside from UPPER() and LOWER(). And for reasons I'm not quite sure about, possibly because the field had 4 numbers after the decimal??, Coldfusion decide my price was a text field, and there was nothing I could do about it.&lt;/p&gt;

&lt;p&gt;To solve this, I have to something thats truly a last resort. I actually loop through all the products, build a list of matching products and the QoQ pulls only those products. I know thats not the &amp;quot;right&amp;quot; way to do things, but I really wanted to avoid having to run another query to pull the products from the database.&lt;/p&gt;

&lt;hr&gt;
&lt;p&gt;Item of the Day: &lt;a href="http://www.homeandstone.com/detail.cfm?Group_ID=2718&amp;amp;Product_ID=22039"&gt;Blancodiamond 511-709&lt;/a&gt; - &lt;a href="http://www.homeandstone.com/shop/brand.cfm/blanco-america"&gt;Blanco Sink&lt;/a&gt; &lt;a href="http://www.homeandstone.com/shop/buy.cfm/kitchen/sinks/silgranit"&gt;Silgranit&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
</content>



    </entry>
    <entry>
        <title>Guided Navigation, the Wrong Way</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/06/guided-navigati.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/06/guided-navigati.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-51255342</id>
        <published>2008-06-12T10:53:50-07:00</published>
        <updated>2008-06-12T10:53:50-07:00</updated>
        <summary>We sell sinks, kitchen sinks and bathroom sinks. Shopping for sinks is not easy, there are many choices and its sometimes hard to know if a sink matches your needs. Guided navigation is the perfect answer for this. By specifying...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Development" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>We sell sinks, <a href="http://www.homeandstone.com/shop/buy.cfm/kitchen/sinks">kitchen sinks</a> and <a href="http://www.homeandstone.com/shop/buy.cfm/bath/sinks">bathroom sinks</a>. Shopping for sinks is not easy, there are many choices and its sometimes hard to know if a sink matches your needs.</p>

<p>Guided navigation is the perfect answer for this. By specifying exactly what you need, we display to you only the matching results. This is how we do it on our <a href="http://www.homeandstone.com/shop/bathroom-vanities.cfm">bathroom vanity</a> finder and <a href="http://www.homeandstone.com/shop/air-tubs-whirlpools.cfm">air tubs</a> &amp; whirlpool finder.</p>

<p>However, the results returned by the finder are only as good as the data entered, and data entry can be a big job. Updating close to 900 kitchen sinks with the navigation data is a big job. Enter my big idea.</p>

<p>Our static navigation (thats what I call my previous navigation) was hierarchal, and forced you to choose category after category before showing you products. For kitchen sinks, you would first choose the material, e.g. <a href="http://www.homeandstone.com/shop/buy.cfm/kitchen/sinks/stainless-steel">Stainless Steel Sinks</a>, then you'd choose a brand, e.g. <a href="http://www.homeandstone.com/shop/brand.cfm/elkay">Elkay</a>, then you'd choose the mounting, e.g. Undermount, then you'd choose how many bowls you want, e.g. Single Bowl, and then you'd finally get a list of sinks to choose from.</p>

<p>Certainly a pain in the neck. But if you look closely, those categories give you alot of information about the product. My idea was to collapse all the categories into a set of combinable categories that act as a pseudo guided navigation. You can choose to view all <a href="http://www.homeandstone.com/shop/buy.cfm/kitchen/sinks/single-bowl">Single Bowl Sinks</a>, and you'll see all sinks in a category "Single Bowl", regardless of brand or any other sub or parent category that may exist. Or you can view <a href="http://www.homeandstone.com/shop/buy.cfm/kitchen/sinks/single-bowl/stainless-steel">Stainless Steel Single Bowl Sinks</a>, and then change your view to <a href="http://www.homeandstone.com/shop/buy.cfm/kitchen/sinks/double-bowl/stainless-steel">Stainless Steel Double Bowl Sinks</a>. And you're always seeing products that match your choices.</p>

<p>In a way, the categories became tags, giving information about the sinks, not forcing you to navigate with them.</p>

<p>How do I do this? Using my two favorite MySQL functions, <a href="http://homeofthespider.typepad.com/webdevelopment/2006/11/mysql_group_con.html">GROUP_CONCAT</a> and <a href="http://homeofthespider.typepad.com/webdevelopment/2006/10/mysql_find_in_s.html">FIND_IN_SET</a>. GROUP_CONCAT allows me to group the categories by name, and get a list of the CategoryID's for all the matching categories. For example, Double Bowl. There are say 15 categories named "Double Bowl" (remember there is one for each manufacturer,) GROUP_CONCAT will give me a comma delimited list of all of them. </p>

<p>FIND_IN_SET I use to pull the products in categories matching the ones currently selected. For example, say you want to see all <a href="http://www.homeandstone.com/shop/buy.cfm/kitchen/sinks/apron">Apron sinks</a>. There are no products directly in the category Apron sinks, they are all in sub-categories (about 3 levels down.) Using FIND_IN_SET to match the selected category or categories to the category tree saved in each category, I can get all products that match. </p><hr /><p>Item of the Day: <a href="http://www.homeandstone.com/detail.cfm?Group_ID=1074&amp;Product_ID=6492">Hatbox 12</a> - <a href="http://www.homeandstone.com/shop/buy.cfm/bath/sinks/above-counter">Vessel Sink</a> by <a href="http://www.homeandstone.com/shop/brand.cfm/waterdecor">Waterdecor</a></p></div>
</content>



    </entry>
    <entry>
        <title>Coldfusion CFC Local Variables</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/coldfusion-cf-1.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/coldfusion-cf-1.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-50526908</id>
        <published>2008-05-28T12:48:03-07:00</published>
        <updated>2008-05-28T12:48:03-07:00</updated>
        <summary>I'm embarrassed to admit that I haven't done much development with CFC's. Considering my background as a Java developer, there really is no excuse. So I'm trying to make up for lost time. Almost all the development I'm doing these...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="ColdFusion" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;I'm embarrassed to admit that I haven't done much development with CFC's. Considering my background as a Java developer, there really is no excuse.&lt;/p&gt;

&lt;p&gt;So I'm trying to make up for lost time. Almost all the development I'm doing these days involves CFC's. Many times I'm moving existing code in to new CFC's, but the benefits are great. Its the single most important feature in the language.&lt;/p&gt;

&lt;p&gt;Of course, my CFC honeymoon came to a crash ending. I have a component that certain information on each link on the site. The data is stored in a database, but because there are many lookups for each page rendered, I didn't want to do a database lookup. Instead, I created a component that stores the data in a struct, keyed on the URL. The component is stored in the Application scope, so the data is pulled once, and the lookup happens in the component.&lt;/p&gt;

&lt;p&gt;Each element in the struct is actually another struct with a bunch of information regarding that link. The function urlLookup first initializes the return variable called &amp;quot;info&amp;quot;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;cfset info = &amp;quot;&amp;quot;&amp;gt;&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;then does the lookup &lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;cfif structKeyExists(urls, key)&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;cfset info = urls[&amp;quot;#key#&amp;quot;]&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;cfset info.foundResult = true&amp;gt; &amp;lt;!--- flag this as a valid result ---&amp;gt;&lt;br /&gt;&amp;lt;/cfif&amp;gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;because I'm expecting a struct from this function, if no URL was found, I create a struct and set the foundResult to false&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;cfif info is &amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;cfset info = StructNew()&amp;gt;&lt;br /&gt;&amp;nbsp; &amp;nbsp; &amp;lt;cfset info.foundResult = false&amp;gt;&lt;br /&gt;&amp;lt;/cfif&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;then return info&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;cfreturn info&amp;gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Mysteriously, I kept getting errors &amp;quot;Element FOUNDRESULT is undefined in URLS&amp;quot;. Can you spot the error? Remember, this object is in the application scope, so many requests are hitting it at once.&lt;/p&gt;

&lt;p&gt;The problem is in this line&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;cfset info = &amp;quot;&amp;quot;&amp;gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;the variable &amp;quot;info&amp;quot; is a global variable, not local to the function. If a second request enters the function before a previous request finishes, it re-initializes the global variable &amp;quot;info,&amp;quot; which is then returned. FOUNDRESULT will not be found because the variable is an empty string!&lt;/p&gt;

&lt;p&gt;The solution is a to add a little keyword &amp;quot;var,&amp;quot; so the line of code looks like this&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;cfset var info = &amp;quot;&amp;quot;&amp;gt;&lt;code&gt;&lt;/code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;this makes the variable local to the function, so each call to the function creates a new variable local to that call. It is recommended that all variables, including query names, be initialized with the var keyword (referred to as &amp;quot;varing&amp;quot; your variables.)&amp;nbsp; &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Item of the Day: &lt;a href="http://www.homeandstone.com/detail.cfm?Group_ID=2671&amp;Product_ID=9352"&gt;KWC Domo 10.061.033&lt;/a&gt; - &lt;a href="http://www.homeandstone.com/cats.cfm?Group_ID=26"&gt;Kitchen Faucet&lt;/a&gt; from &lt;a href="http://www.homeandstone.com/shop/brand.cfm/kwc"&gt;KWC&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
</content>



    </entry>
    <entry>
        <title>Generating CSS for Firefox</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/generating-css.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/generating-css.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-50470326</id>
        <published>2008-05-27T11:27:17-07:00</published>
        <updated>2008-05-27T11:27:17-07:00</updated>
        <summary>There are many reasons why you want to keep the CSS in a separate file. The benefits are clear, easier to manage, easier to apply to multiple pages, cacheable, etc. Recently, we redid our Hansgrohe page. See the left side...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Development" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;There are many reasons why you want to keep the CSS in a separate file. The benefits are clear, easier to manage, easier to apply to multiple pages, cacheable, etc.&lt;/p&gt;

&lt;p&gt;Recently, we redid our &lt;a href="http://www.homeandstone.com/shop/brand.cfm/hansgrohe"&gt;Hansgrohe&lt;/a&gt; page. See the left side column with all the categories? The width of that column changes depending on whether you're viewing the main Hansgrohe page, or a category page. Because the style is exactly the same and the only difference is the width, I didn't want to create another stylesheet just for the category page.&lt;/p&gt;

&lt;p&gt;Instead, I made the CSS page a ColdFusion page, and I pass along a flag to indicate what the width should be. There is one &amp;lt;cfif&amp;gt; tag looking at that flag and setting the appropriate width. The resulting CSS is the exact same, just the URL now ends in &amp;quot;.cfm&amp;quot; instead of &amp;quot;.css&amp;quot;.&lt;/p&gt;

&lt;p&gt;In IE, everything is wonderful. It parses the file and applies the styles. In FireFox, not so good. No good at all. It refuses to look at the file as a stylesheet.&lt;/p&gt;

&lt;p&gt;The solution is to tell FireFox that it's a CSS file. You do this by adding this line of code:&lt;/p&gt;

&lt;p&gt;&amp;lt;cfcontent&amp;nbsp; type=&amp;quot;text/css&amp;quot; &amp;gt;&lt;/p&gt;

&lt;p&gt;Thats all. You can translate that line to the language of your choice.&lt;/p&gt;&lt;hr /&gt;&lt;p&gt;Item of the Day: &lt;a href="http://www.homeandstone.com/detail.cfm?Group_ID=1188&amp;amp;Product_ID=7400"&gt;Iperbole Monoblock 5131.101&lt;/a&gt; - &lt;a href="http://www.homeandstone.com/cats.cfm?Group_ID=44"&gt;Bathroom Faucets&lt;/a&gt; by &lt;a href="http://www.homeandstone.com/shop/brand.cfm/porcher"&gt;Porcher&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;
</content>



    </entry>
    <entry>
        <title>Coldfusion CFC in Sub-folders</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/coldfusion-cfc.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/coldfusion-cfc.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-50221890</id>
        <published>2008-05-21T10:33:41-07:00</published>
        <updated>2008-05-21T10:33:41-07:00</updated>
        <summary>Its one of those little things that can make the all the difference. I manage a bunch of websites. By far the most confusing one is the one that has all the files stored in the root folder. Why is...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="ColdFusion" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;Its one of those little things that can make the all the difference.&lt;/p&gt;

&lt;p&gt;I manage a bunch of websites. By far the most confusing one is the one that has all the files stored in the root folder. Why is this so confusing? Because you cannot gain any understanding of the relationship between the files just by looking at the files and directory structure.&lt;/p&gt;

&lt;p&gt;A properly structured directory structure can tell me so much about the files without reading them. I can guess what a file in &amp;quot;webroot/shopping-cart/google-checkout/callback&amp;quot; should do, even without opening the file. Finding and fixing bugs is so much easier in a properly structured directory.&lt;/p&gt;

&lt;p&gt;As I began doing more and more of my new development in CFC's, this issue bothered me. I know how to instanciate an CFC in the root folder. Say you have a CFC &amp;quot;shoppingCart.cfc&amp;quot; in the root, you instanciate it like this: &amp;lt;cfset cart = CreateObject(&amp;quot;component&amp;quot;, &amp;quot;shoppingCart&amp;quot;)&amp;gt;. But I didn't know how to instanciate a CFC in sub-folders.&lt;/p&gt;

&lt;p&gt;As it turns out, its quite simple (that seems to be a ColdFusion mantra.) Say our shopping cart CFC is located in &amp;quot;webroot/siteComponents/cart/shoppingCart.cfc&amp;quot;. To instanciate, you do this: &lt;br /&gt;&amp;lt;cfset cart = CreateObject(&amp;quot;component&amp;quot;, &amp;quot;siteComponents.cart.shoppingCart&amp;quot;)&amp;gt; &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Item of the Day: &lt;a href="http://www.homeandstone.com/detail.cfm?Group_ID=2719&amp;Product_ID=22038"&gt;Blancodiamond 511-708&lt;/a&gt; - &lt;a href="http://www.homeandstone.com/cats.cfm?Group_ID=1791"&gt;Silgranit Kitchen Sink&lt;/a&gt; by &lt;a href="http://www.homeandstone.com/shop/brand.cfm/blanco-america"&gt;Blanco&lt;/a&gt;&lt;/div&gt;
</content>



    </entry>
    <entry>
        <title>Hansgrohe Showers &amp; Faucets</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/hansgrohe-showe.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2008/05/hansgrohe-showe.html" thr:count="0" />
        <id>tag:typepad.com,2003:post-50147280</id>
        <published>2008-05-20T09:51:10-07:00</published>
        <updated>2008-05-20T09:51:10-07:00</updated>
        <summary>I always enjoyed a little bit of design. Being a programmer, design work stimulates a different part of my brain, one that I dont use on a daily basis. However, professional web design takes experience and practice and I had...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Design" />
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Development" />
        
        
<content type="html" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
&lt;div xmlns="http://www.w3.org/1999/xhtml"&gt;&lt;p&gt;I always enjoyed a little bit of design. Being a programmer, design work stimulates a different part of my brain, one that I dont use on a daily basis. However, professional web design takes experience and practice and I had neither, so my meager design skills were relegated to my own websites. I'll show you 2, so you understand what I'm talking about:&lt;/p&gt;

&lt;p&gt;1. MP3 Shiur: &lt;a href="http://www.mp3shiur.com/"&gt;www.mp3shiur.com&lt;/a&gt;&lt;br /&gt;2. XDS Tech: &lt;a href="http://www.xdstech.com/"&gt;www.xdstech.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;As I said, not too impressive. &lt;/p&gt;

&lt;p&gt;Luckily for me, I managed to convince my boss to let me try my hand at designing a page for &lt;a href="http://www.homeandstone.com/shop/brand.cfm/hansgrohe"&gt;Hansgrohe, a high-end faucet and shower&lt;/a&gt; company. Our standard brand page is pretty boring, so we wanted something more engaging.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://www.homeandstone.com/shop/brand.cfm/hansgrohe"&gt;This is our new Hansgrohe page&lt;/a&gt;.&amp;nbsp; &lt;/p&gt;

&lt;p&gt;I like to think that I was successful. Not that I think its the webs most beautiful page, but its a pleasant engaging page. Have any ideas on how I can improve the page? Let me know in the comments.&lt;/p&gt;

&lt;p&gt;But the real question is, does it sell? &lt;/p&gt;
&lt;hr&gt;
&lt;p&gt;Item of the Day: &lt;a href="http://www.homeandstone.com/detail.cfm?Group_ID=2506&amp;Product_ID=20520"&gt;Hansgrohe Axor Starck 10111&lt;/a&gt; by &lt;a href="http://www.homeandstone.com/shop/brand.cfm/hansgrohe"&gt;Hansgrohe&lt;/a&gt; - Designed by &lt;a href="http://www.homeandstone.com/shop/brand.cfm/hansgrohe/series/axor-starck"&gt;Axor Starck&lt;/a&gt;&lt;/div&gt;
</content>



    </entry>
    <entry>
        <title>Managed Price Settings</title>
        <link rel="alternate" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2007/09/managed-price-s.html" />
        <link rel="replies" type="text/html" href="http://homeofthespider.typepad.com/webdevelopment/2007/09/managed-price-s.html" thr:count="1" thr:updated="2008-01-17T14:18:36-08:00" />
        <id>tag:typepad.com,2003:post-38556157</id>
        <published>2007-09-06T08:17:07-07:00</published>
        <updated>2007-09-06T08:17:07-07:00</updated>
        <summary>As our websites get more complex, our need for pricing rules grew as well. Simply displaying the price wouldn't cut it, as some manufacturers enforce a MAP - minimum advertised price. For some products, we do not display any price,...</summary>
        <author>
            <name>Arnie</name>
        </author>
        <category scheme="http://www.sixapart.com/ns/types#category" term="Web Development" />
        
        
<content type="xhtml" xml:lang="en-US" xml:base="http://homeofthespider.typepad.com/webdevelopment/">
<div xmlns="http://www.w3.org/1999/xhtml"><p>As our websites get more complex, our need for pricing rules grew as well. Simply displaying the price wouldn't cut it, as some manufacturers enforce a MAP - minimum advertised price. For some products, we do not display any price, only to call to purchase. And some brands need to be excluded from sales.</p>

<p>And some of these settings change depending on other settings. For example, we don't want to display "Call for Pricing" when there is nobody manning the phones.</p>

<p>Rather than changing these settings on a product by product basis, I built a system that applies rules based on brand and department. The appropriate rule is selected when the product is displayed, and the price is calculated in real-time off of the product list price.</p>

<p>Sounds good, but there was a problem. When exporting our entire product line for the Froogle feed, the rule selection was causing the script to run for way too long. Rule selection involves knowing the brand and department tree (e.g. <a href="http://www.homeandstone.com/cats.cfm?Group_ID=54">bath » faucets » single hole</a>,) then selecting the most specific rule.</p>

<p>I needed a way to retrieve the appropriate rule in the original database query result, not looking up the rules product by product. So I do something I dislike doing, I save the key of the appropriate rule on the product record. Why do I dislike doing that? Saving that key on the product record makes it difficult to debug when something goes wrong. You have no when of knowing when that key was saved, or why. Selecting the appropriate rule in real-time makes it much easier to fix problems with prices, as you can know exactly which rule was selected, why the system selected it, and what effect it had. </p><hr /><p>Item of the Day: <a href="http://www.homeandstone.com/detail.cfm?Group_ID=2096&amp;Product_ID=16261">Minimal Floor Mount Tub Filler 0475</a> - <a href="http://www.homeandstone.com/cats.cfm?Group_ID=52">Bath Tub Filler</a> by <a href="http://www.homeandstone.com/shop/brand.cfm/lacava-design">Lacava Design</a> </p></div>
</content>



    </entry>
 
</feed><!-- ph=1 -->

