<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>randys.org &#187; General Nerdery</title>
	<atom:link href="http://www.randys.org/category/general-nerdery/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.randys.org</link>
	<description>Wasting your precious bandwidth since 1999</description>
	<lastBuildDate>Thu, 03 Jun 2010 02:43:39 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Lightty Cake: CakePHP + Lighttpd Rewrite Rules</title>
		<link>http://www.randys.org/2010/01/05/lightty-cake-cakephp-lighttpd-rewrite-rules/</link>
		<comments>http://www.randys.org/2010/01/05/lightty-cake-cakephp-lighttpd-rewrite-rules/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 04:57:25 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Code Chunks]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://www.randys.org/2010/01/05/lightty-cake-cakephp-lighttpd-rewrite-rules/</guid>
		<description><![CDATA[This little snippet will also allow you to capture your query string variables should the need arise. url.rewrite-once = ( "^/(css&#124;files&#124;img&#124;js)/(.*)" =&#62; "/$1/$2", "^/([^?]*)(?:\?(.+))?$" =&#62; "/index.php?url=$1&#38;$2" ) Posted via email from shakeit]]></description>
			<content:encoded><![CDATA[<p>This little snippet will also allow you to capture your query string variables should the need arise.</p>

<pre><code>url.rewrite-once = (    
    "^/(css|files|img|js)/(.*)" =&gt; "/$1/$2",
    "^/([^?]*)(?:\?(.+))?$" =&gt; "/index.php?url=$1&amp;$2"
)
</code></pre>

<p style="font-size: 10px;">
    <a href="http://posterous.com">Posted via email</a> from <a href="http://shakeit.randys.org/lightty-cake-cakephp-lighttpd-rewrite-rules">shakeit</a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2010/01/05/lightty-cake-cakephp-lighttpd-rewrite-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Prototype: It&#8217;s Not Just a JavaScript Library</title>
		<link>http://www.randys.org/2009/05/14/prototype-its-not-just-a-javascript-library/</link>
		<comments>http://www.randys.org/2009/05/14/prototype-its-not-just-a-javascript-library/#comments</comments>
		<pubDate>Fri, 15 May 2009 05:08:25 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[Code Chunks]]></category>
		<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.randys.org/2009/05/14/prototype-its-not-just-a-javascript-library/</guid>
		<description><![CDATA[Used to be that writing front-end code (HTML, CSS, JavaScript) wasn&#8217;t terribly complex. The syntax of HTML and CSS isn&#8217;t all that difficult to get the hang of and JavaScript (back in the day) was just a tool to validate form fields and play funny tricks on poor unsuspecting visitors. These days, JavaScript has become [...]]]></description>
			<content:encoded><![CDATA[<p>Used to be that writing front-end code (HTML, CSS, JavaScript) wasn&#8217;t terribly complex. The syntax of HTML and CSS isn&#8217;t all that difficult to get the hang of and JavaScript (back in the day) was just a tool to validate form fields and play funny tricks on poor unsuspecting visitors. These days, JavaScript has become <em>the</em> language for front-end development and it&#8217;s not just for printing the &#8216;lastModifiedDate&#8217; of a document.</p>

<script src="http://static.randys.org/js/prototype-date.js" type="text/javascript"></script>

<p>Anyone who has kept up with the advancements of JavaScript knows the <a href="http://www.prototypejs.org/">Prototype</a> library. For those who don&#8217;t know, it&#8217;s a JavaScript library that wraps a whole bunch of functionality into easy to use (and remember) &#8220;shortcuts&#8221; for doing things like getting elements on a page, manipulating said elements, and dealing with data. It&#8217;s all written in <a href="http://www.json.org/">JSON</a> notation and allows you do things like:</p>

<pre><code>$('element-id').addClassName('active').show();
</code></pre>

<p>Instead of</p>

<pre><code>var element = document.getElementById('element-id');
    element.className = 'active';
    element.style.display = 'block';
</code></pre>

<p>Anyway, things like Prototype, <a href="http://jquery.com/">jQuery</a>, <a href="http://www.dojotoolkit.org/">Dojo</a>, and <a href="http://developer.yahoo.com/yui/">YUI</a> all provide some convenience to writing custom JavaScript applications. I haven&#8217;t dug super deep into any of the frameworks&#8217; source (mostly because the code has been somewhat obfuscated and &#8220;compressed&#8221; to save space), but I imagine that they all have one thing in common; they make use of the <a href="http://phrogz.net/JS/Classes/ExtendingJavaScriptObjectsAndClasses.html#prototype">prototype</a> property to extend both existing and custom built objects/classes in JavaScript.</p>

<h3>The prototype Property</h3>

<p>Even if you don&#8217;t make heavy use of one of the afforementioned framework/toolkits, using the <em>prototype</em> property to extend existing JavaScript objects and/or classes can be quite useful. Say you want an easy way to print out a date. Rather than createing a separate function, just extend the <code>Date</code> object itself.</p>

<pre><code>Date.prototype.months = new Array(
    {name: "January",   abbrev: "Jan", number: "01"},
    {name: "February",  abbrev: "Feb", number: "02"},
    {name: "March",     abbrev: "Mar", number: "03"},
    {name: "April",     abbrev: "Apr", number: "04"},
    {name: "May",       abbrev: "May", number: "05"},
    {name: "June",      abbrev: "Jun", number: "06"},
    {name: "July",      abbrev: "Jul", number: "07"},
    {name: "August",    abbrev: "Aug", number: "08"},
    {name: "September", abbrev: "Sep", number: "09"},
    {name: "October",   abbrev: "Oct", number: "10"},
    {name: "November",  abbrev: "Nov", number: "11"},
    {name: "December",  abbrev: "Dec", number: "12"}
);
Date.prototype.dow = new Array(
    {name: 'Sunday',    abbrev: 'Sun', number: "01"},
    {name: 'Monday',    abbrev: 'Mon', number: "02"},
    {name: 'Tuesday',   abbrev: 'Tue', number: "03"},
    {name: 'Wednesday', abbrev: 'Wed', number: "04"},
    {name: 'Thursday',  abbrev: 'Thu', number: "05"},
    {name: 'Friday',    abbrev: 'Fri', number: "06"},
    {name: 'Saturday',  abbrev: 'Sat', number: "07"}
);
Date.prototype.getShortDate = function() {
    return this.months[this.getMonth()].abbrev + ' ' + this.getDate() + ' ' + this.getFullYear();
};
Date.prototype.getLongDate = function() {
    return this.dow[this.getDay()].name + ', ' + this.months[this.getMonth()].name + ' ' + this.getDate() + ', ' + this.getFullYear();
};
Date.prototype.getValueDate = function() {
    var d = (this.getDate() &lt; 10) ? '0'+this.getDate():this.getDate();
    return this.getFullYear() + '/' + this.months[this.getMonth()].number + '/' + d;
};

var now = new Date();
document.write(now.getLongDate());
</code></pre>

<p>And you get something like this <script type="text/javascript">var now = new Date();document.write(now.getLongDate());</script>. Handy.</p>

<p>Now, there&#8217;s a couple of issues with the above script. One, the names aren&#8217;t localized and two, there&#8217;s probalby a more efficient way to formatting a date (much like the example on <a href="http://phrogz.net/JS/Classes/ExtendingJavaScriptObjectsAndClasses.html#example2">this page</a>). But, it works in all the browsers I tested (Chrome, Firefox, IE7, Safari [Mac]).</p>

<p>You can prototype most of the default objects in JavaScript. Say you have an application the has to validate a bunch of text fields. Prototype the <code>String</code> objects to add built in parsing methods for various fields.</p>

<pre><code>String.prototype.isValidEmail = function() { ... }
String.prototype.isValidPhone = function() { ... }
</code></pre>

<p>You get the idea.</p>

<p>The <code>prototype</code> property is a handy little tool. There maybe some limitations between browsers, but overall, it should help simplify your code and prevent repetitive and reduntant methods.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2009/05/14/prototype-its-not-just-a-javascript-library/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Google Chrome: Second Impression</title>
		<link>http://www.randys.org/2008/09/12/google-chrome-second-impression/</link>
		<comments>http://www.randys.org/2008/09/12/google-chrome-second-impression/#comments</comments>
		<pubDate>Fri, 12 Sep 2008 19:39:05 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Internet Explorer]]></category>

		<guid isPermaLink="false">http://www.randys.org/?p=130</guid>
		<description><![CDATA[After a couple of days with Chrome, I&#8217;ve decided to abandon it. Why? Every time I used it, I always experienced some kind of slowness, delay, or complete freezing. And not just with Chrome. It would lock up my entire machine for several seconds at a time. Now, I&#8217;m not working on the latest and [...]]]></description>
			<content:encoded><![CDATA[<p>After a couple of days with Chrome, I&#8217;ve decided to abandon it. Why? Every time I used it, I always experienced some kind of slowness, delay, or complete freezing. And not just with Chrome. It would lock up my entire machine for several seconds at a time. Now, I&#8217;m not working on the latest and greatest hardware, and it&#8217;s been several years since this particular machine had a fresh install of XP so it could be something else causing the conflict with Chrome. Nonetheless, it was painful to use on a regular basis.</p>

<p>Does this mean it&#8217;s a bad browser. Absolutely not. It&#8217;s certainly better than Internet Exploder and when it was working, it seemed to render a little faster than Firefox (perceptual, no hard evidence of this). Chrome&#8217;s UI is far better than IE and even a leg up on Firefox (at least the default theme for the Windows version). It will definitely take some wind out of Firefox&#8217;s usage numbers.</p>

<p>Until I get a new machine and/or fresh install of the OS, I&#8217;m going to stick with Firefox for everyday use. Waiting for my machine to wake up from a Chrome coma while shopping at the Gap is seriously hindering my productivity at work!</p>

<p><strong>Update 1</strong>: 
I just got around to installing Chrome at home and there must be something on my work machine conflicting with Chrome. It&#8217;s considerably faster on this machine (AMD Athlon 64&#215;2 4200+ / 2GB Ram / XP SP3) and doesn&#8217;t experience the hangs like my work machine does. Very queer. I wish my work machine wasn&#8217;t such a turd.</p>

<p><strong>Update 2</strong>:
I don&#8217;t know what exactly Chrome does behind the scenes, but I hear an awful lot hard drive activity when it&#8217;s the only application running. Interesting.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2008/09/12/google-chrome-second-impression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Google Chrome: First impressions</title>
		<link>http://www.randys.org/2008/09/02/google-chrome-first-impressions/</link>
		<comments>http://www.randys.org/2008/09/02/google-chrome-first-impressions/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 01:14:01 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[Browsers]]></category>
		<category><![CDATA[Chrome]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://www.randys.org/?p=126</guid>
		<description><![CDATA[I must be really busy these days. I wouldn&#8217;t call my self a complete nerd, but I try to stay up on recent web trends and technologies related to such things. I just found out about Google Chrome, the new web browser for Windows. It appears to be using WebKit, the same rendering engine as [...]]]></description>
			<content:encoded><![CDATA[<p>I must be really busy these days. I wouldn&#8217;t call my self a complete nerd, but I try to stay up on recent web trends and technologies related to such things. I just found out about <a href="http://www.google.com/chrome/">Google Chrome</a>, the new web browser for Windows. It appears to be using WebKit, the same rendering engine as Apple&#8217;s Safari web browser. I had heard recently that Google&#8217;s <a href="http://code.google.com/android/">Android</a> was rumored to be using WebKit for  its browser so this sounds logical to me.</p>

<p>I use a Mac at home, so I&#8217;m used to Safari. In fact, until I recently started a side job, I used Safari exclusively for about a year. It&#8217;s fast to start up and fast to render. It has some developer tools built in so figuring out which styles apply to which elements is easy to decipher. Safari on Windows isn&#8217;t quite as quick as Safari on Mac. At least, it&#8217;s not on my work machine; an aging Pentium 4 with a measly 2GB of memory. This is the one thing kills Safari for Windows for me. I tried using it as a daily browser, but it was painfully slow on this machine. I think what kills it is Apple&#8217;s desire to make the application look like OS X and not Windows. Yes, it looks one million times better than windows, but at what cost? I&#8217;d rather it run fast on this machine than look pretty. It&#8217;s funny how Apple is somewhat hypocritical in this respect as they have <a href="http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/chapter_1_section_1.html">strict guidelines</a> for applications built for their own OS.</p>

<p>I digress&#8230;</p>

<p>So far (and this is a very short testing period) it&#8217;s a very fast and responsive application. It starts right up and renders quickly too. Its interface is minimal and clean yet functional (like most Google apps). It looks like it&#8217;s kind of modeled after IE7&#8242;s interface in that it does&#8217;t have a menu bar like most Windows applications. There are two icons to the right of the &#8220;OmniBox&#8221; (Chrome&#8217;s URL/search box all rolled into a single field); one to handle things like cut/copy/paste, new tab/window, etc and one for global features like options, history, and downloads. Of course there&#8217;s the obligatory back, forward and reload buttons and a place for your bookmarks, standard with any browser.</p>

<p>Tabs can be moved around easily for ordering and can be dragged completely out of the current container to create it&#8217;s own new Chrome window (a handy feature Firefox doesn&#8217;t support out of the box).</p>

<p>For developers, it has the same developer tools found in Safari. You can view source, debug JavaScript, monitor the JavaScript console, inspect elements on a page (which brings up a similar window to Safari&#8217;s). You can also view a Task Manager related to Chrome and it&#8217;s tabs that shows you how much memory and CPU are being used for each tab/window you have open. It even tells you how much memory is being used for any installed plugins. The Task Manager allows you to kill specific tabs if they are misbehaving as well.</p>

<p>I&#8217;m going to use it as my default for a while to see how it stacks up on a daily basis. I am optimistic at the moment, but I did notice some system hangs though those could be related to this massive pile of Java code running under Weblogic 8&#8230; which is an entirely different story.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2008/09/02/google-chrome-first-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Heinen $2.2M poorer, wants to put sugar in Jobs&#8217; gas tank</title>
		<link>http://www.randys.org/2008/08/14/heinen-22m-poorer-wants-to-put-sugar-in-jobs-gas-tank/</link>
		<comments>http://www.randys.org/2008/08/14/heinen-22m-poorer-wants-to-put-sugar-in-jobs-gas-tank/#comments</comments>
		<pubDate>Fri, 15 Aug 2008 05:37:26 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[SEC]]></category>

		<guid isPermaLink="false">http://www.randys.org/2008/08/14/heinen-22m-poorer-wants-to-put-sugar-in-jobs-gas-tank/</guid>
		<description><![CDATA[Remember a while back the whole backdating thing at Apple? You know, where the CFO and former general counsel, Nancy Heinen, backdated stocks in 2001? Yeah, that one. I didn&#8217;t really pay much attention to it when it came out. I figure, someone making that kind of dough can handle whatever it is they dish [...]]]></description>
			<content:encoded><![CDATA[<p>Remember a while back the whole backdating thing at Apple? You know, where the CFO and former general counsel, <a href="http://en.wikipedia.org/wiki/Nancy_R._Heinen">Nancy Heinen</a>, <a href="http://bit.ly/HrPrA">backdated stocks in 2001</a>? Yeah, that one. I didn&#8217;t really pay much attention to it when it came out. I figure, someone making that kind of dough can handle whatever it is they dish out for themselves. Well, Heinen and SEC &#8220;settled&#8221; on an agreement that she pay some $2.2 million which includes more than $400K in interest and a $200K civil penalty. She released a statement today (through her lawyers of course).</p>

<blockquote>
  <p>I cherish the great people I worked with at Apple, and am proud of my contributions to its historic turnaround and current success. With this lawsuit behind me, I look forward to addressing the greater challenges of social justice and economic disparity.</p>
  
  <p>From <a href="http://www.bizjournals.com/eastbay/stories/2008/08/11/daily67.html">Former Apple general counsel Heinen agrees to $2.2M backdating settlement &#8211; East Bay Business Times</a></p>
</blockquote>

<p>Hmmm, interesting. I don&#8217;t really think she feels that amicable about the whole ordeal. I actually have a copy of the <em>real</em> statement she wanted to release before her lawyers got a hold of it.</p>

<blockquote>
  <p>I loath those pretentious freaks I worked with at Apple, and am pissed that those assholes didn&#8217;t have my back after all of my contributions to its historic turnaround and current success. With this bullshit behind me, I look forward to harassing Steve in the name of social justice and wish nothing but economic disparity on his whole family. Thanks for nothing asshat!</p>
</blockquote>

<p>You heard it here first&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2008/08/14/heinen-22m-poorer-wants-to-put-sugar-in-jobs-gas-tank/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Apple&#8217;s iPhone 3G Not So Cheap Afterall, AT&amp;T Gets The Skins</title>
		<link>http://www.randys.org/2008/06/09/apples-iphone-3g-not-so-cheap-afterall-att-gets-the-skins/</link>
		<comments>http://www.randys.org/2008/06/09/apples-iphone-3g-not-so-cheap-afterall-att-gets-the-skins/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 01:49:21 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[AT&T]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://www.randys.org/?p=109</guid>
		<description><![CDATA[Today saw the announcement of the new 3G iPhone from Apple. It looks very promissing and the price cut to $199 USD sounds like a really good price point to get more people to jump on the iPhone bandwagon. Afterall, this thing is twice as fast, but half the cost. What was not mentioned in [...]]]></description>
			<content:encoded><![CDATA[<p>Today saw the announcement of the new 3G <a href="http://www.apple.com/iphone/" title="The new Apple iPhone 3G">iPhone</a> from <a href="http://www.apple.com/">Apple</a>. It looks very promissing and the price cut to $199 USD sounds like a really good price point to get more people to jump on the iPhone bandwagon. Afterall, this thing is <a href="http://www.apple.com/iphone/features/wireless.html">twice as fast</a>, but <a href="http://www.apple.com/iphone/gallery/ads/hallway/">half the cost</a>.</p>

<p>What was not mentioned in Job&#8217;s keynote was <a href="http://www.att.com/gen/press-room?pid=4800&amp;cdvn=news&amp;newsarticleid=25791">AT&amp;T&#8217;s iPhone <em>3G</em> plan pricing</a>. And, why should they; AT&amp;T and Apple have severed their revenue sharing deal they had with the initial iPhone release one year ago. However, don&#8217;t let the $200 discount on a new iPhone fool you. Let&#8217;s do some math&#8230;</p>

<p>The old iPhone plans started at $59.99/mo. If you signed a two year contract you would pay roughly $1,440 over the life of the contract. The new plans, according to the press release, start at $39.99 voice plan PLUS $30 per month for unlimited data. Now you&#8217;re looking at $1,680 over the live of the contract. That&#8217;s $240 <em>more</em> (per contract) than the previous iPhone plans. Still feel like you&#8217;re getting a good deal? You just spent $240 to save $200. No word on family plan pricing or if they have family plans for the iPhone.</p>

<p>Will I get one? Probably. :\</p>

<p><strong>Update</strong>: Looks like there&#8217;s <a href="http://gizmodo.com/5014764/iphone-3g-pricing-and-activation-details-30-unlimited-data-activated-in-store-only">no special treatment for new iPhone users</a> and the standard plans and rates apply. It makes it a little easier to swallow a family plan at $59.99/mo for two lines of service but I have yet to find out if the family plan is available for the iPhone 3G. Interesting thing I found looking for <a href="http://www.porcinefund.com/catranch/catranchx.htm">answers</a> to the question <a href="http://www.wireless.att.com/answer-center/main.jsp?t=solutionTab&amp;ft=searchTab&amp;ps=solutionPanels&amp;locale=en_US&amp;_dyncharset=UTF-8&amp;solutionId=60986&amp;isSrch=Yes"><em>What plans are available for the iPhone?</em></a> I Suppose they should update this if it&#8217;s not true.</p>

<p><strong>Update #2</strong>: I just spoke with a Karen George in AT&amp;T customer service and from what she told me the iPhone plan is the same, just going up in price $10/mo (this kind of contradicts the press release though). She also confirmed that the family plans <em>are</em> available for the new iPhone. I asked if the new iPhone plans will still include the 200 text messages and she said yes. I also asked if the MEdia(TM) Max Unlimited data plan (which, at $35/mo includes unlimited data and texts, seems to be a better deal) would be available for the iPhone and she said yes. I&#8217;m a little skeptical about what some random customer service rep says at this point, so take it with a grain of salt. Especially when she tells me they (customer service?) are not being told ANYthing about the details of the new iPhone and/or plans.</p>

<p><strong>NB</strong>: If you&#8217;re wondering about the &#8216;AT&amp;T Gets the Skins&#8217; bit of the title, I&#8217;m referring to the <a href="http://www.porcinefund.com/catranch/catranchx.htm">San Bromista Cat Ranch</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2008/06/09/apples-iphone-3g-not-so-cheap-afterall-att-gets-the-skins/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How-not-to: Normalize Your Data</title>
		<link>http://www.randys.org/2008/06/04/how-not-to-normalize-your-data/</link>
		<comments>http://www.randys.org/2008/06/04/how-not-to-normalize-your-data/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 00:49:46 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[SQL Server]]></category>

		<guid isPermaLink="false">http://www.randys.org/?p=104</guid>
		<description><![CDATA[Disclaimer: I am not a database architect nor a certified database programmer. I might not be database guru, but I have been working with SQL Server long enough to know what works and what doesn&#8217;t. I&#8217;m not a database programmer per say, but I&#8217;m expected to be one at work (even though I&#8217;m a code [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Disclaimer</strong>: <em>I am not a database architect nor a certified database programmer. I might not be database guru, but I have been working with SQL Server long enough to know what works and what doesn&#8217;t.</em></p>

<p>I&#8217;m not a database programmer per say, but I&#8217;m expected to be one at work (even though I&#8217;m a code jockey). I don&#8217;t mind it most of the time, but there are times when it becomes really frustrating. Especially when you come across some schema that is poorly implemented. Normalization is a double edged sword. On one side, normalization is good for data integrity. On the other, it becomes a pain in the arse to get at your data. There are ways around the later (Views, de-normalized tables), but, a pain in the arse it still is. The one thing that <em>really</em> bugs me is normalization done wrong. We use Microsoft SQL server at work, but this should apply to any relational database.</p>

<p>Recently, at my day job, I&#8217;ve been working on a particular project which involved consuming data from a third party for use in a .NET web service. We were already consuming data from this vendor but they recently changed the schema (and data) and are deprecating the old format. The new feed is basically a complete dump of their data <strong>and</strong> schema. Not <em>all</em> of their data, just data we subscribe to (about 1M records total).  Instead of modifying our import process to accommodate the current (old) schema (which would have been a huge effort on our part), we just created a new import process and modified the web service.</p>

<p>After working with this new schema for a couple weeks, I have come to the conclusion that, well, it&#8217;s crap. First and foremost, it&#8217;s not normalized properly. If you have an column in a table that looks like it should be a foreign key, then by all means, make it so. For example, say I have a table called Widgets with several columns. One of those columns is called WidgetTypeId and another called WidgetTypeDisplayName. There&#8217;s a prime candidate for another table. I don&#8217;t care if you only have two WidgetTypes, it belongs in its own table. Here&#8217;s why: When selecting records out of the table and filtering on WidgetTypeDisplayName, it gets really expensive. Sure, you could add an index on that column, but it still would be slower compared to joining on a WidgetType table.  If I had ten million widgets and only 100 widget types, I&#8217;m only filtering 100 records vs. ten million.</p>

<p>What about filtering on the WidgetTypeId column? <strong>BZZZZZ</strong>. Where did you get that ID? Did you select it from the same table? Guess what, same difference. Maybe you hard-coded it in the query. That&#8217;s not smart either, especially if you have multiple environments that could possibly be out of sync (i.e. WidgetTypeId 4 in development might not be associated to the same thing in production). Put it in it&#8217;s own table.</p>

<p>I ran into this several times with this new schema at work and it was a complete pain. For one thing, in development, the queries were always relatively quick to return. In production, however, not the same. This database sat on the same server as another production database so there was more load on it. Enough to make the queries perform poorly. On the order of 10 to 40 seconds to return data in some cases. That&#8217;s not good. My solution: create a single de-normalized table (for some reason, we don&#8217;t use views) of commonly used data points. The result was millisecond returns and simple queries. Furthermore, instead of filtering/joining on tables with half a million records, it now filters on less than 20 thousand, <em>properly indexed</em> records.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2008/06/04/how-not-to-normalize-your-data/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Microsoft is in Your Airport, Causing Havoc</title>
		<link>http://www.randys.org/2008/04/29/microsoft-is-in-your-airport-causing-havoc/</link>
		<comments>http://www.randys.org/2008/04/29/microsoft-is-in-your-airport-causing-havoc/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 06:32:00 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[Computers]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.randys.org//2008/04/29/microsoft-is-in-your-airport-causing-havoc</guid>
		<description><![CDATA[And you wonder why people have a fear of flying. The failure was ultimately down to a combination of human error and a design glitch in the Windows servers brought in over the past three years to replace the radio system&#8217;s original Unix servers, according to the FAA. Full article]]></description>
			<content:encoded><![CDATA[<p>And you wonder why people have a fear of flying.</p>

<blockquote>
  <p>The failure was ultimately down to a combination of human error and a design glitch in the Windows servers brought in over the past three years to replace the radio system&#8217;s original Unix servers, according to the FAA.</p>
</blockquote>

<p><a href="http://www.techworld.com/opsys/news/index.cfm?newsid=2275">Full article</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2008/04/29/microsoft-is-in-your-airport-causing-havoc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Greenspun on The Old Timers</title>
		<link>http://www.randys.org/2008/02/16/greenspun-on-the-old-timers/</link>
		<comments>http://www.randys.org/2008/02/16/greenspun-on-the-old-timers/#comments</comments>
		<pubDate>Sat, 16 Feb 2008 06:41:00 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[internet]]></category>
		<category><![CDATA[patents]]></category>

		<guid isPermaLink="false">http://www.randys.org//2008/02/16/greenspun-on-the-old-timers</guid>
		<description><![CDATA[Really good article on Internet software patents and how &#8220;the old timers&#8221; already thought of most of the things we do today. They couldn&#8217;t build our modern world for us back in the 1960s because the hardware hadn&#8217;t caught up. If you&#8217;d given them 50 million quad-core 2 GHz Pentium with 4 GB of RAM [...]]]></description>
			<content:encoded><![CDATA[<p>Really good article on <a href="http://philip.greenspun.com/business/internet-software-patents">Internet software patents</a> and how &#8220;the old timers&#8221; already thought of most of the things we do today.</p>

<blockquote>
    <p>They couldn&#8217;t build our modern world for us back in the 1960s because the hardware hadn&#8217;t caught up. If you&#8217;d given them 50 million quad-core 2 GHz Pentium with 4 GB of RAM and 30 Mbps Verizon FiOS connections to every home, they would have built you all of the services of the modern Internet and probably many that would have been better.</p>

    <p>What would happen if you gave present-day computer programmers those same powerful hardware gifts? We did that experiment. Our modern day best-and-brightest built Microsoft Windows Vista (TM). </p>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2008/02/16/greenspun-on-the-old-timers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Good Read:  The Accidental Businessman &#8211; Rule #10 should really be rule #1</title>
		<link>http://www.randys.org/2007/12/06/good-read-the-accidental-businessman-rule-10-should-really-be-rule-1/</link>
		<comments>http://www.randys.org/2007/12/06/good-read-the-accidental-businessman-rule-10-should-really-be-rule-1/#comments</comments>
		<pubDate>Thu, 06 Dec 2007 04:41:00 +0000</pubDate>
		<dc:creator>randy</dc:creator>
				<category><![CDATA[General Nerdery]]></category>
		<category><![CDATA[Home]]></category>
		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.randys.org//2007/12/06/good-read-the-accidental-businessman-rule-10-should-really-be-rule-1</guid>
		<description><![CDATA[Unfortunately, the complexity of a feature is usually inversely proportional to its simplicity from a user&#8217;s perspective. Dealing with this on a project at work. So true.]]></description>
			<content:encoded><![CDATA[<blockquote>
    <p>Unfortunately, the complexity of a feature is usually inversely proportional to its simplicity from a user&#8217;s perspective.</p>
</blockquote>

<p><a href="http://mtabini.blogspot.com/2007/12/rule-10-should-really-be-rule-1.html">Dealing with this</a> on a project at work. So true.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.randys.org/2007/12/06/good-read-the-accidental-businessman-rule-10-should-really-be-rule-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
