<?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>RuddWire &#187; tech</title>
	<atom:link href="http://www.ruddwire.com/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ruddwire.com</link>
	<description>Ruddwire.com: food, book, theatre reviews, data presentation projects, code snippets, millisecond date calculators</description>
	<lastBuildDate>Sat, 17 Jul 2010 00:45:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Perl script make MySQL query, binds variables, outputs JSON</title>
		<link>http://www.ruddwire.com/1049/tech/perl-script-make-mysql-query-binds-variables-outputs-json/</link>
		<comments>http://www.ruddwire.com/1049/tech/perl-script-make-mysql-query-binds-variables-outputs-json/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 00:40:11 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=1049</guid>
		<description><![CDATA[An example of a Perl script that is called by an ajax request.  The script takes in just one parameter, opens a MySQL DB connection, binds the parameter to the query, and sends the query.  The result is then formatted into JSON and returned to the browser.
This can be seen in action on [...]]]></description>
			<content:encoded><![CDATA[<p>An example of a Perl script that is called by an ajax request.  The script takes in just one parameter, opens a MySQL DB connection, binds the parameter to the query, and sends the query.  The result is then formatted into JSON and returned to the browser.</p>
<p>This can be seen in action on this page: <a href="http://www.ruddwire.com/friendly-data/naics-explorer/">http://www.ruddwire.com/friendly-data/naics-explorer/</a>, in the NAICS search box.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;">&nbsp;
<span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">:</span>standard<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mySQL</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$result</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'({&quot;failure&quot;:1})'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#QUERY PARAMS</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$q</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$table</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$tableRow</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CGI<span style="color: #339933;">;</span>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
&nbsp;
    <span style="color: #0000ff;">$q</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'q'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$q</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/\s+/%/</span><span style="color: #339933;">;</span>  <span style="color: #666666; font-style: italic;"># REPLACE SPACES WITH WILD CARD CHARACTER, CAUSES TO SEARCH FOR ALL WORDS, NOT JUST PHRASE</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">### Connect to the database.</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$dbh</span> <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;DBI:mysql:database=***DBNAME***;host=localhost&quot;</span><span style="color: #339933;">,</span>
                         <span style="color: #ff0000;">&quot;***USERNAME***&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;***PASSWORD***&quot;</span><span style="color: #339933;">,</span>
                         <span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'RaiseError'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    	<span style="color: #666666; font-style: italic;">### GET INDUSTRY NAME AND CODE</span>
    	<span style="color: #0000ff;">$mySQL</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT code,industry FROM naics2007IndustryIndex WHERE industry LIKE ? ORDER BY industry&quot;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
     <span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$mySQL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;%&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$</span><span style="color: #009900;">&#123;</span><span style="color: #000066;">q</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">.</span><span style="color: #ff0000;">&quot;%&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ref</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetchrow_hashref</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span><span style="color: #339933;">,</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">%$ref</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		  	  <span style="color: #0000ff;">$value</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/&quot;/\\&quot;/g</span><span style="color: #339933;">;</span>
			  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>${value}<span style="color: #000099; font-weight: bold;">\&quot;</span>,&quot;</span><span style="color: #339933;">;</span>
		  <span style="color: #009900;">&#125;</span>
&nbsp;
		  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/,$//</span><span style="color: #339933;">;</span>
		  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;[${tableRow}],&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		  <span style="color: #0000ff;">$table</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$tableRow</span><span style="color: #339933;">;</span>
		  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #0000ff;">$table</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/,$//</span><span style="color: #339933;">;</span>
&nbsp;
	  	<span style="color: #0000ff;">$result</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'{&quot;failure&quot;:0,&quot;result&quot;:['</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$table</span><span style="color: #339933;">.</span><span style="color: #ff0000;">']}'</span><span style="color: #339933;">;</span>         
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">### END IF QUERY</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Content-type: text/javascript; charset=iso-8859-1<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$result</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/1049/tech/perl-script-make-mysql-query-binds-variables-outputs-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Perl script makes MySQL query; outputs to JSON</title>
		<link>http://www.ruddwire.com/1025/tech/perl-script-makes-mysql-query-outputs-to-json/</link>
		<comments>http://www.ruddwire.com/1025/tech/perl-script-makes-mysql-query-outputs-to-json/#comments</comments>
		<pubDate>Mon, 21 Jun 2010 01:37:34 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[mySQL]]></category>
		<category><![CDATA[perl]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=1025</guid>
		<description><![CDATA[<p>An example of a perl script that is called by an ajax request.  The script takes in a few parameters, opens a mySQL DB connection, and then makes a rather tortuous query.  The result is then formatted in to JSON and returned to the browser.</p>]]></description>
			<content:encoded><![CDATA[<p>An example of a Perl script that is called by an ajax request.  The script takes in a few parameters, opens a MySQL DB connection, and then makes a rather tortuous query.  The result is then formatted into JSON and returned to the browser.</p>
<p>This can be seen in action on this page: <a href="http://www.ruddwire.com/friendly-data/naics-explorer/">http://www.ruddwire.com/friendly-data/naics-explorer/</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="perl" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/perl</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">use</span> strict<span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> DBI<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">use</span> CGI <span style="color: #000066;">qw</span><span style="color: #009900;">&#40;</span><span style="color: #339933;">:</span>standard<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$mySQL</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$result</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'({&quot;failure&quot;:1})'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">#QUERY PARAMS</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$strLn</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$classification</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$getDef</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$getIndus</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$naicsMatch</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$countMatch</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">@subClasses</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$ref</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$table</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$tableRow</span><span style="color: #339933;">;</span>
&nbsp;
&nbsp;
<span style="color: #000000; font-weight: bold;">sub</span> scrubInputText <span style="color: #009900;">&#123;</span>
&nbsp;
   <span style="color: #b1b100;">my</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$it</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">@_</span><span style="color: #339933;">;</span>
   <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$shellChars</span> <span style="color: #339933;">=</span> q<span style="color: #339933;">-</span><span style="color: #009900;">&#91;</span><span style="color: #339933;">&amp;;</span><span style="color: #ff0000;">`'<span style="color: #000099; font-weight: bold;">\\</span><span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #000099; font-weight: bold;">\|</span><span style="color: #000099; font-weight: bold;">\*</span><span style="color: #000099; font-weight: bold;">\?</span><span style="color: #000099; font-weight: bold;">\~</span>&lt;&gt;<span style="color: #000099; font-weight: bold;">\^</span><span style="color: #000099; font-weight: bold;">\(</span><span style="color: #000099; font-weight: bold;">\)</span><span style="color: #000099; font-weight: bold;">\[</span><span style="color: #000099; font-weight: bold;">\]</span><span style="color: #000099; font-weight: bold;">\{</span><span style="color: #000099; font-weight: bold;">\}</span><span style="color: #000099; font-weight: bold;">\$</span><span style="color: #000099; font-weight: bold;">\\</span>n<span style="color: #000099; font-weight: bold;">\\</span>r]-;    #`</span>
&nbsp;
    <span style="color: #0000ff;">$it</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/$shellChars//g</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$it</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/^\s+|\s+$//g</span><span style="color: #339933;">;</span>
&nbsp;
   <span style="color: #000066;">return</span> <span style="color: #0000ff;">$it</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> CGI<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #0000ff;">$strLn</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&amp;scrubInputText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'strLn'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$classification</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&amp;scrubInputText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'cls'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$getDef</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&amp;scrubInputText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'getDef'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
    <span style="color: #0000ff;">$getIndus</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&amp;scrubInputText</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">param</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">'getIndus'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">###HANDLE GROUPED SECTOR CODES, IE: 31-33</span>
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$classification</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">/-/</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    	<span style="color: #0000ff;">@subClasses</span> <span style="color: #339933;">=</span> <span style="color: #000066;">split</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;-&quot;</span><span style="color: #339933;">,</span><span style="color: #0000ff;">$classification</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #0000ff;">$naicsMatch</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;AND (&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$subClass</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$subClasses</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$subClass</span> <span style="color: #339933;">&lt;=</span> <span style="color: #0000ff;">$subClasses</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span> <span style="color: #0000ff;">$subClass</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    		<span style="color: #0000ff;">$naicsMatch</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;code LIKE '${subClass}%' OR &quot;</span><span style="color: #339933;">;</span>
    		<span style="color: #0000ff;">$countMatch</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;code LIKE '${subClass}%' OR &quot;</span><span style="color: #339933;">;</span>
    	<span style="color: #009900;">&#125;</span>
    	<span style="color: #0000ff;">$countMatch</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/ OR $//</span><span style="color: #339933;">;</span>
    	<span style="color: #0000ff;">$naicsMatch</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/ OR $//</span><span style="color: #339933;">;</span>
    	<span style="color: #0000ff;">$naicsMatch</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;)&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
       <span style="color: #0000ff;">$naicsMatch</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;AND code LIKE '${classification}%'&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$strLn</span> <span style="color: #339933;">!=</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><span style="color: #0000ff;">$countMatch</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;code LIKE Concat(naics2007.code,'%')&quot;</span><span style="color: #339933;">;</span><span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">### Connect to the database.</span>
	<span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$dbh</span> <span style="color: #339933;">=</span> DBI<span style="color: #339933;">-&gt;</span><span style="color: #006600;">connect</span><span style="color: #009900;">&#40;</span><span style="color: #ff0000;">&quot;DBI:mysql:database=***DBNAME***;host=localhost&quot;</span><span style="color: #339933;">,</span>
                         <span style="color: #ff0000;">&quot;***USERNAME***&quot;</span><span style="color: #339933;">,</span> <span style="color: #ff0000;">&quot;***PASSWORD***&quot;</span><span style="color: #339933;">,</span>
                         <span style="color: #009900;">&#123;</span><span style="color: #ff0000;">'RaiseError'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$getDef</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    	<span style="color: #0000ff;">$mySQL</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT definition FROM naics2007definitions WHERE code='${classification}'&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">elsif</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$getIndus</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
    	<span style="color: #666666; font-style: italic;">### GET FINAL INDUSTRY NAME</span>
    	<span style="color: #0000ff;">$mySQL</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT code,industry FROM naics2007IndustryIndex WHERE code LIKE '${classification}' ORDER BY industry&quot;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
    	<span style="color: #666666; font-style: italic;">### GET INDUSTRY CLASSIFICATIONS</span>
&nbsp;
&nbsp;
 		<span style="color: #0000ff;">$mySQL</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;SELECT code,title, &quot;</span><span style="color: #339933;">.</span>
     	<span style="color: #ff0000;">&quot;(SELECT COUNT(code) FROM naics2007IndustryIndex WHERE &quot;</span><span style="color: #339933;">.</span>
     	<span style="color: #ff0000;">&quot;CASE naics2007.code &quot;</span><span style="color: #339933;">.</span>
     	<span style="color: #ff0000;">&quot;WHEN '31-33' THEN (code LIKE '31%' OR code LIKE '32%' OR code LIKE '33%') &quot;</span><span style="color: #339933;">.</span>
     	<span style="color: #ff0000;">&quot;WHEN '44-45' THEN (code LIKE '44%' OR code LIKE '45%') &quot;</span><span style="color: #339933;">.</span>
     	<span style="color: #ff0000;">&quot;WHEN '48-49' THEN (code LIKE '48%' OR code LIKE '49%') &quot;</span><span style="color: #339933;">.</span>
     	<span style="color: #ff0000;">&quot;ELSE code LIKE Concat(naics2007.code,'%') END) AS c&quot;</span><span style="color: #339933;">.</span>
     	<span style="color: #ff0000;">&quot; FROM naics2007 WHERE (CHAR_LENGTH(code) = $strLn OR code LIKE '__-__')&quot;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$naicsMatch</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #009900;">&#125;</span>
&nbsp;
&nbsp;
     <span style="color: #0000ff;">$sth</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$dbh</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">prepare</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$mySQL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
     <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
      <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">$ref</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$sth</span><span style="color: #339933;">-&gt;</span><span style="color: #006600;">fetchrow_hashref</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
		  <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$key</span><span style="color: #339933;">,</span> <span style="color: #b1b100;">my</span> <span style="color: #0000ff;">$value</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #000066;">each</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">%$ref</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		  	  <span style="color: #0000ff;">$value</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/&quot;/\\&quot;/g</span><span style="color: #339933;">;</span>
			  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">.=</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">\&quot;</span>${value}<span style="color: #000099; font-weight: bold;">\&quot;</span>,&quot;</span><span style="color: #339933;">;</span>
		  <span style="color: #009900;">&#125;</span>
&nbsp;
		  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/,$//</span><span style="color: #339933;">;</span>
		  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;[${tableRow}],&quot;</span><span style="color: #339933;">;</span>
&nbsp;
		  <span style="color: #0000ff;">$table</span> <span style="color: #339933;">.=</span> <span style="color: #0000ff;">$tableRow</span><span style="color: #339933;">;</span>
		  <span style="color: #0000ff;">$tableRow</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">&quot;&quot;</span><span style="color: #339933;">;</span>
      <span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #0000ff;">$table</span> <span style="color: #339933;">=~</span> <span style="color: #009966; font-style: italic;">s/,$//</span><span style="color: #339933;">;</span>
&nbsp;
	  	<span style="color: #0000ff;">$result</span> <span style="color: #339933;">=</span> <span style="color: #ff0000;">'{&quot;failure&quot;:0,&quot;result&quot;:['</span><span style="color: #339933;">.</span><span style="color: #0000ff;">$table</span><span style="color: #339933;">.</span><span style="color: #ff0000;">']}'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #009900;">&#125;</span><span style="color: #666666; font-style: italic;">### END IF QUERY</span>
&nbsp;
&nbsp;
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #ff0000;">&quot;Content-type: application/json; charset=iso-8859-1<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">print</span> <span style="color: #0000ff;">$result</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000066;">exit</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/1025/tech/perl-script-makes-mysql-query-outputs-to-json/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>macbook pro turns on but screen stays black &#8212; my solution</title>
		<link>http://www.ruddwire.com/1017/tech/macbook-pro-turns-on-but-screen-stays-black-my-solution/</link>
		<comments>http://www.ruddwire.com/1017/tech/macbook-pro-turns-on-but-screen-stays-black-my-solution/#comments</comments>
		<pubDate>Sat, 05 Jun 2010 17:26:24 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[apple]]></category>
		<category><![CDATA[black screen]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macbook pro]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=1017</guid>
		<description><![CDATA[The Apple Macbook Pro would turn on, but the screen would not.  The screen would stay black.  I could tell the computer was on because when I hit the &#8220;caps lock&#8221; key, the green light on the key would turn on and off.
I fixed this the following way (this is basically resetting the Power Management [...]]]></description>
			<content:encoded><![CDATA[<p>The Apple Macbook Pro would turn on, but the screen would not.  The screen would stay black.  I could tell the computer was on because when I hit the &#8220;caps lock&#8221; key, the green light on the key would turn on and off.</p>
<p>I fixed this the following way (this is basically resetting the Power Management Unit &#8212; PMU):</p>
<p>I disconnected the computer from the power cord, and from all other cables.</p>
<p>I held down the power button for several seconds to turn off the computer.</p>
<p>I let it sit 5 minutes.</p>
<p>I restarted the laptop while holding down the Shift key.  This restarted the computer in Safe Mode, with the screen visible again.</p>
<p>After I logged in (in Safe Mode) to make sure everything was ok, I simply restarted the computer the normal way, and the screen behaved normally again.</p>
<p>=================================</p>
<p>If that doesn&#8217;t work for you, you could try these steps, documented at apple.com:</p>
<p><a href="http://support.apple.com/kb/ht1379">Holding down Command, Option, P, and R to reset your PRAM and NVRAM</a></p>
<p><a href="http://support.apple.com/kb/HT1431?viewlocale=en_US">Resetting PowerBook and iBook Power Management Unit (PMU)</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/1017/tech/macbook-pro-turns-on-but-screen-stays-black-my-solution/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>UNIX/AWK Tricks: How to copy a long list of files into a directory</title>
		<link>http://www.ruddwire.com/999/tech/unixawk-tricks/</link>
		<comments>http://www.ruddwire.com/999/tech/unixawk-tricks/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 22:39:40 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[AWK]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=999</guid>
		<description><![CDATA[

Make your list of files, with complete paths, call it &#8220;imgList.txt&#8221;. Put every file on a new line.
Write a small awk script with the following 1 line:
{ printf(&#8221;cp %s images/\n&#8221;,$0);}

Save the script as &#8220;copyList.awk&#8221;
Do the following command:
awk -f copyList.awk imgList.txt &#124; sh


Brief explanation of the awk script:

%s means you&#8217;re putting a string in that spot [...]]]></description>
			<content:encoded><![CDATA[<div class="mtb">
<ol>
<li>Make your list of files, with complete paths, call it &#8220;imgList.txt&#8221;. Put every file on a new line.</li>
<li>Write a small awk script with the following 1 line:
<div class="code">{ printf(&#8221;cp %s images/\n&#8221;,$0);}</div>
</li>
<li>Save the script as &#8220;copyList.awk&#8221;</li>
<li>Do the following command:
<div class="code">awk -f copyList.awk imgList.txt | sh</div>
</li>
</ol>
<p>Brief explanation of the awk script:</p>
<ul>
<li>%s means you&#8217;re putting a string in that spot of your output,</li>
<li>$0 is the string you&#8217;re putting there</li>
<li>$0 is a match for each line in the file &#8220;imgList.txt&#8221;</li>
<li>images/ is the directory to copy your files to (in this example relative to where the command will be run from &#8211; can be absolute, of course)</li>
<li>\n stands for new line</li>
</ul>
<p>brief explanation of the command:</p>
<ul>
<li>awk executes the awk code found in &#8220;copyList.awk&#8221; on the lines found in &#8220;imgList.txt&#8221; and pipes the output to the shell ( | sh).</li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/999/tech/unixawk-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>HTML Character Entities in Javascript</title>
		<link>http://www.ruddwire.com/994/tech/html-character-entities-in-javascript/</link>
		<comments>http://www.ruddwire.com/994/tech/html-character-entities-in-javascript/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 22:34:23 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=994</guid>
		<description><![CDATA[Sometimes you need to write html character entities in javascript, but html character entities can&#8217;t be used, because they don&#8217;t get interpreted by javascript. In javascript, you need to use the equivalent unicode character codes instead.
HTML character entity, wrong:
formElement.value = "Direcci&#38;#243;n";
You get: Direcci&#38;#243;n
Unicode character code, correct:
formElement.value = "Direcci\u00F3n";
You get: Dirección
Unicode character charts are located here: [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you need to write html character entities in javascript, but html character entities can&#8217;t be used, because they don&#8217;t get interpreted by javascript. In javascript, you need to use the equivalent unicode character codes instead.</p>
<p><span style="font-weight: bold;">HTML character entity, wrong:</span><br />
<code>formElement.value = "Direcci&amp;#243;n";</code><br />
You get: Direcci&amp;#243;n</p>
<p><span style="font-weight: bold;">Unicode character code, correct:</span><br />
<code>formElement.value = "Direcci\u00F3n";</code><br />
You get: Dirección</p>
<p>Unicode character charts are located here: <a href="http://www.unicode.org/charts/">http://www.unicode.org/charts/</a>.  The chart you will most likely need is the <a href="http://www.unicode.org/charts/PDF/U0080.pdf">Latin-1</a> chart.   Character codes must be preceded by \u.  That is, character code 00F3 is written in JavaScript as \u00F3.</p>
<p>Hope this helps.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/994/tech/html-character-entities-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Handy MySQL Commands</title>
		<link>http://www.ruddwire.com/991/tech/handy-mysql-commands/</link>
		<comments>http://www.ruddwire.com/991/tech/handy-mysql-commands/#comments</comments>
		<pubDate>Sun, 25 Apr 2010 22:30:20 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[mySQL]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=991</guid>
		<description><![CDATA[To reset an auto_increment field to 1:
ALTER TABLE tbl_name AUTO_INCREMENT = 1;

To load a local csv file into an empty existing table:
LOAD DATA LOCAL INFILE &#8216;/completePathToLocalData.csv&#8217; INTO TABLE tableName FIELDS TERMINATED BY &#8216;,&#8217; ENCLOSED BY &#8216;&#8221;&#8216; LINES TERMINATED BY &#8216;\n&#8217; IGNORE 1 LINES;
This assumes you&#8217;ve already created your empty table with the same number of [...]]]></description>
			<content:encoded><![CDATA[<div class="mtb">To reset an auto_increment field to 1:</p>
<div class="code">ALTER TABLE tbl_name AUTO_INCREMENT = 1;</div>
</div>
<div class="mtb">To load a local csv file into an empty existing table:</p>
<div class="code">LOAD DATA LOCAL INFILE &#8216;/completePathToLocalData.csv&#8217; INTO TABLE tableName FIELDS TERMINATED BY &#8216;,&#8217; ENCLOSED BY &#8216;&#8221;&#8216; LINES TERMINATED BY &#8216;\n&#8217; IGNORE 1 LINES;</div>
<p>This assumes you&#8217;ve already created your empty table with the same number of fields that your csv file has.</p></div>
<p><a name="js"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/991/tech/handy-mysql-commands/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery parsererror: clean up your JSON objects</title>
		<link>http://www.ruddwire.com/904/tech/jquery-parsererror-clean-up-your-json-objects/</link>
		<comments>http://www.ruddwire.com/904/tech/jquery-parsererror-clean-up-your-json-objects/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 03:49:23 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[parsererror]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=904</guid>
		<description><![CDATA[Has your JSON using jQuery web app suddenly stopped working?  Getting a parsererror on your JSON objects, where you got none before?  This is what happened to me when my site upgraded to jQuery 1.4.
I use the Google API&#8217;s jQuery, and it automatically upgraded my whole site to jQuery 1.4.   In jQuery 1.4, they [...]]]></description>
			<content:encoded><![CDATA[<p>Has your JSON using jQuery web app suddenly stopped working?  Getting a parsererror on your JSON objects, where you got none before?  This is what happened to me when my site upgraded to jQuery 1.4.</p>
<p>I use the <a href="http://code.google.com/apis/ajaxlibs/documentation/">Google API&#8217;s jQuery</a>, and it automatically upgraded my whole site to jQuery 1.4.   In jQuery 1.4, they decided to tighten up the JSON parsing engine, so that it is now unforgiving of any lax standards.  You have to follow the JSON standard <a href="http://json.org/">spelled out here</a> &#8212; to the letter.  In my case, that meant changing any single quoted values or names to double quotes, and getting rid of opening and closing parentheses.  Like most fixes, it was an easy fix, once I figured it out.  Hope this helps.</p>
<p>-Colin</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/904/tech/jquery-parsererror-clean-up-your-json-objects/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why would a tablet be better for magazines?</title>
		<link>http://www.ruddwire.com/861/tech/why-would-a-tablet-be-better-for-magazines/</link>
		<comments>http://www.ruddwire.com/861/tech/why-would-a-tablet-be-better-for-magazines/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 21:54:12 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[hardware]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Bonnier]]></category>
		<category><![CDATA[magazines]]></category>
		<category><![CDATA[tablet]]></category>
		<category><![CDATA[Time Inc]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/?p=861</guid>
		<description><![CDATA[Time Inc, publisher of Sports Illustrated, has shown us a vision of its future on tablet devices: A magazine application that readers buy and download each week.  Bonnier, publisher of Popular Science, has created a similar demo.
But I have to ask: if the magazine app wasn&#8217;t a hit on PCs, why would it be a [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://sportsillustrated.cnn.com/2009/magazine/12/02/tablet/index.html" target="_blank">Time Inc, publisher of Sports Illustrated, has shown us a vision of its future on tablet devices:</a> A magazine application that readers buy and download each week.  <a href="http://www.bonnier.com/en/content/digital-magazines-bonnier-mag-prototype" target="_blank">Bonnier, publisher of Popular Science, has created a similar demo.</a></p>
<p>But I have to ask: if the magazine app wasn&#8217;t a hit on PCs, why would it be a hit on tablets?  The same problem will exist on tablets:  readers will be able to get their news and pictures from other normal web sites that don&#8217;t charge, just like they can on a PC.</p>
<p>So what if the tablet will have dimensions more like those of a magazine?  So what if it will make for a better &#8220;lean back&#8221; experience?  These qualities will make reading the same old free internet from the comfort of your couch a much better experience, too.</p>
<p>Web page designers will redesign their sites to fit the tablet format better, just like they created smart phone versions of their sites.</p>
<p>Basically, on tablets like on PCs, if you can get if for free, why ever would you pay?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/861/tech/why-would-a-tablet-be-better-for-magazines/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>IE 8 inPrivate Filtering on by Default</title>
		<link>http://www.ruddwire.com/280/tech/ie-8-inprivate-filtering-on-by-default/</link>
		<comments>http://www.ruddwire.com/280/tech/ie-8-inprivate-filtering-on-by-default/#comments</comments>
		<pubDate>Thu, 07 May 2009 19:31:14 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[software]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[default]]></category>
		<category><![CDATA[IE8]]></category>
		<category><![CDATA[inPrivate Filtering]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/reviews/?p=280</guid>
		<description><![CDATA[NOTE:  A better way to block ads, popups, cookie setters, and profile trackers is to edit your hosts file, which will block such annoyances on all browsers and web applications.  Go here for more info on hosts files.
IE 8 inPrivate Filtering mode can be set to on/enabled by default by doing the following:

Open IE 8.
Click [...]]]></description>
			<content:encoded><![CDATA[<p>NOTE:  A better way to block ads, popups, cookie setters, and profile trackers is to edit your hosts file, which will block such annoyances on all browsers and web applications.  <a href="http://www.ruddwire.com/199/tech/software/block-ads-with-hosts-files/">Go here for more info on hosts files.</a></p>
<p>IE 8 inPrivate Filtering mode can be set to on/enabled by default by doing the following:</p>
<ol>
<li>Open IE 8.</li>
<li>Click on the InPrivate Filtering button in the status bar (lower right) to enable inPrivate Filtering.</li>
<li>Leaving your IE 8 browser open, go to and click on your Windows Start button.  Click on the &#8220;Run..&#8221; button, found below the Search button. (this is for Windows XP users.  I don&#8217;t know yet how to open the Registry Editor on Windows Vista, since I don&#8217;t have Windows Vista)</li>
<li>type &#8220;regedit&#8221; in the run box.  Hit &#8220;Ok&#8221;.</li>
<li>The Windows Registry Editor tool will open.</li>
<li>In the tool, open this folder:  My Computer\HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Safety\PrivacIE</li>
<li>Once this folder is open, click on:  Edit &gt; New &gt; DWORD Value</li>
<li>Give the new value that appears this name:  &#8221;StartMode&#8221;.  Hit enter</li>
<li>Right click on the new StartMode, choose &#8220;Modify&#8221;.</li>
<li>In the field &#8220;Value Data&#8221;, type &#8220;1&#8243;.  Hit &#8220;Ok&#8221;.</li>
<li>That&#8217;s it.  Close the Registry Editor.  Close and restart your IE 8 browser, you&#8217;ll see that inPrivate Filtering is on by default.</li>
</ol>
<div>If anyone wants to add instructions on how the Registry Editor is most quickly opened in Windows vista, please leave the info in a comment.</div>
<div>Cheers,</div>
<div>Colin</div>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/280/tech/ie-8-inprivate-filtering-on-by-default/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>New Salary Guide, Salary Comparison Tool</title>
		<link>http://www.ruddwire.com/222/money/new-salary-guide-salary-comparison-tool/</link>
		<comments>http://www.ruddwire.com/222/money/new-salary-guide-salary-comparison-tool/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 23:05:48 +0000</pubDate>
		<dc:creator>Colin</dc:creator>
				<category><![CDATA[money]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[salary comparison]]></category>
		<category><![CDATA[salary search]]></category>

		<guid isPermaLink="false">http://www.ruddwire.com/reviews/?p=222</guid>
		<description><![CDATA[I just finished coding up a salary guide tool.
The salary data is taken from the Bureau of Labor Statistics.  Of course the data is searchable on the BLS site, but I thought I could give it a more user-friendly interface, using AJAX and jQuery.
Give it a visit, give it a search, and let me know [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished coding up a <a title="Go to the Salary Guide" href="http://www.ruddwire.com/friendly-data/salary-search/">salary guide tool</a>.</p>
<p>The salary data is taken from the Bureau of Labor Statistics.  Of course the data is searchable on the BLS site, but I thought I could give it a more user-friendly interface, using AJAX and jQuery.</p>
<p><a title="Give the Salary Guide a search" href="http://www.ruddwire.com/friendly-data/salary-search/">Give it a visit, give it a search</a>, and let me know if you have any suggestions.</p>
<p>Cheers,</p>
<p>Colin</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ruddwire.com/222/money/new-salary-guide-salary-comparison-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
