<?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>spleen &#187; computery stuff</title>
	<atom:link href="http://somniloquy.org/blog/category/left-brain/computery-stuff/feed/" rel="self" type="application/rss+xml" />
	<link>http://somniloquy.org/blog</link>
	<description>@ somniloquy.org</description>
	<lastBuildDate>Thu, 29 Jul 2010 04:19:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>One reason why books matter</title>
		<link>http://somniloquy.org/blog/2009/01/18/one-reason-why-books-matter/</link>
		<comments>http://somniloquy.org/blog/2009/01/18/one-reason-why-books-matter/#comments</comments>
		<pubDate>Sun, 18 Jan 2009 16:14:44 +0000</pubDate>
		<dc:creator>Preston</dc:creator>
				<category><![CDATA[computery stuff]]></category>
		<category><![CDATA[media / news]]></category>
		<category><![CDATA[rant]]></category>
		<category><![CDATA[theory]]></category>

	<!-- AutoMeta Start -->
	<category></category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://somniloquy.org/blog/2009/01/18/one-reason-why-books-matter/</guid>
		<description><![CDATA[Occasionally, I encounter someone who proclaims the death of books. The digital realm has deprecated the print realm, so the argument goes, and books are unwieldy/unsearchable/bad for the environment/etc. The same argument is more often applied (I think) to magazines and newspapers, which (so the argument goes) should be present these days only in museums [...]]]></description>
			<content:encoded><![CDATA[<p>Occasionally, I encounter someone who proclaims the death of books. The digital realm has deprecated the print realm, so the argument goes, and books are unwieldy/unsearchable/bad for the environment/etc. The same argument is more often applied (I think) to magazines and newspapers, which (so the argument goes) should be present these days only in museums that describe to us the medieval implements of yesteryear.</p>
<p>The counter-argument to this usually has to do with the virtues of bookishness. We counter with vaguely lofty discussions of the pedagogical advantages to doing research in print media, or the contemplative life and its long association with libraries and big dusty volumes, or the reliability of print sources versus digital sources. All of those things might be true, and they might not &#8212; but one thing that is generally true is that these counter-arguments do little to sway those who believe we should all own a Kindle and rely on Project MUSE for our research.</p>
<p>But there's a much more significant counter-argument, I think: class. The deprecation of print media in favor of the digital assumes access to computers and the internet. It assumes a level of wealth that permits ownership of at least one computer or similar device, and an infrastructure that permits digital distribution of information. According to <a href="http://www.ubergizmo.com/15/archives/2008/12/computer_ownership_statistics_shows_computer_per_inhabitant_per_country.html">International Telecommunication Union statistics</a>, there are 76.2 computers to every 100 people in the United States. Since nearly everyone I know owns more than one computer (I own five, not counting my PDA and cell phone), it stands to reason that there is a substantial minority of the U.S. population that doesn't have regular access to computers. These are the people you see in libraries and internet cafes; they are largely elderly, poor, and/or indigent. When I worked for a government employment agency in California, I encountered this portion of the population regularly &#8211; they came in to use our computers for resume preparation, typing tutorials and the like, and often they needed a good amount of basic computer training beforehand because, contrary to what we're told, computers weren't even remotely "intuitive" for them. The decline of print media means the exclusion of these people from the life of the mind, current events, and everything else that appears in books, newspapers and magazines. The poorest of us would be entirely reliant on the government or the wealthy for access to news and education. This might already be the case, but the celebration of the digital realm marks (in my experience) the first time intelligent people have argued that it's a good thing.</p>
<p>This doesn't take into consideration poorer countries, where computer ownership and literacy are much lower. The digital era has increasingly made the news something that happens <em>to</em> them, not something in which they participate.</p>
<p>The internet began as a great experiment, and early on, we envisioned this as the cornerstone to a "global village." Increasingly, we've seen it become a global gated community, permitting only those wealthy enough to participate in the experiment with vigor, regularity, and cultural and financial capital appropriate to the community. Consequently, the commons has declined, and the internet has steadily been dominated by commercial ventures at the cost of intellectual ones. The death of books would be an unjust and irresponsible continuation of this trend, widening the gap between the rich and the poor.</p>
]]></content:encoded>
			<wfw:commentRss>http://somniloquy.org/blog/2009/01/18/one-reason-why-books-matter/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>area code lookup tool</title>
		<link>http://somniloquy.org/blog/2008/02/29/area-code-lookup-tool/</link>
		<comments>http://somniloquy.org/blog/2008/02/29/area-code-lookup-tool/#comments</comments>
		<pubDate>Fri, 29 Feb 2008 17:05:19 +0000</pubDate>
		<dc:creator>Preston</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/somniloq/www/www/blog/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[computery stuff]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://somniloquy.org/blog/2008/02/29/area-code-lookup-tool/</guid>
		<description><![CDATA[For those of you who might be interested, I've slapped together a little command-line area code lookup tool. It's a really simple couple of scripts using grep to locate what you're searching for. It works on Unix-like systems with bash installed (Linux, OS X, etc). You can download it here. Follow the enclosed instructions to [...]]]></description>
			<content:encoded><![CDATA[<p>For those of you who might be interested, I've slapped together a little command-line area code lookup tool. It's a really simple couple of scripts using grep to locate what you're searching for.  It works on Unix-like systems with bash installed (Linux, OS X, etc).</p>
<p>You can download it <a href='http://somniloquy.org/blog/wp-content/uploads/2008/02/areacode.tar.gz' title='areacode.tar.gz'>here</a>. Follow the enclosed instructions to install and use it.</p>
]]></content:encoded>
			<wfw:commentRss>http://somniloquy.org/blog/2008/02/29/area-code-lookup-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>geek stuff &#8211; handling Microsoft Word text in web development</title>
		<link>http://somniloquy.org/blog/2007/11/13/geek-stuff-handling-microsoft-word-text-in-web-development/</link>
		<comments>http://somniloquy.org/blog/2007/11/13/geek-stuff-handling-microsoft-word-text-in-web-development/#comments</comments>
		<pubDate>Tue, 13 Nov 2007 13:29:08 +0000</pubDate>
		<dc:creator>Preston</dc:creator>
				<category><![CDATA[computery stuff]]></category>

	<!-- AutoMeta Start -->
	<category>apostrophe</category>
	<category>documents</category>
	<category>replace</category>
	<category>quote</category>
	<category>characters</category>
	<category>quotes</category>
	<category>browsers</category>
	<category>single</category>
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://somniloquy.org/blog/2007/11/13/geek-stuff-handling-microsoft-word-text-in-web-development/</guid>
		<description><![CDATA[Note: Please contribute to this code in comments, if you find mistakes or know of improvements. It's surprising to most people &#8211; especially computer programmers, it seems &#8211; that the English language actually has more than one kind of single quote and one kind of double quote. In fact, if you go back to single-quote [...]]]></description>
			<content:encoded><![CDATA[<p><b>Note:</b> Please contribute to this code in comments, if you find mistakes or know of improvements.</p>
<p>It's surprising to most people &#8211; especially computer programmers, it seems &#8211; that the English language actually has more than one kind of single quote and one kind of double quote. In fact, if you go back to single-quote characters in old-school typography, you find: (a) the opening single quote, (b) the closing single quote, (c) the possessive apostrophe, and (d) the contraction apostrophe. "Straight" quotes and apostrophes are a later invention, to reduce the number of keys on a keyboard.</p>
<p>Many modern word processing programs such as Microsoft Word automatically insert these special characters into text while the user is typing. Word calls them "smart quotes," and refers to fancy em dashes and the like as "symbols." These characters are very pretty in printed documents; in web development, however, they're a bit of a nightmare. It's something of a de facto workflow for users to copy Word documents and paste them into forms for blogs, content management systems and the like; smart quotes end up rendering as "question marks," because web browsers don't know what to make of them.</p>
<p>If you're experiencing this problem, you may hope for a nice "character set" solution in a meta tag (charset=xxx). <strong>Stop.</strong> Seriously. There's no character set at the moment that will both solve this problem <span style="font-style: italic;">and</span> render well in most browsers.</p>
<p>The ideal solution is to convert Word documents into plain text before copying and pasting; unfortunately, this has little to do with how most people work. Therefore, if you're a PHP developer, you might need a function to replace these special characters. There are many proposed functions out there for exactly this task; the one I'm posting here is just the one that works for me.</p>
<div class="VisualSyntax"><code><span style="color: #000000"></p>
<p><span style="color: #0000BB"><b><span style='color:#333333; background-color:#FFFF00'>&lt;?php</span></b><br />
</span><span style="color: #007700">function&nbsp;</span><span style="color: #0000BB">fixSmartQuotes</span><span style="color: #007700">(</span><span style="color: #0000BB">$string</span><span style="color: #007700">){&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pre&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">226</span><span style="color: #007700">).</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">128</span><span style="color: #007700">);<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$search&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #0000BB">$pre&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">152</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pre&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">153</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pre&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">156</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pre&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">157</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$pre&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">147</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">145</span><span style="color: #007700">),&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">146</span><span style="color: #007700">),&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">147</span><span style="color: #007700">),&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">148</span><span style="color: #007700">),&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">150</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">151</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">130</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">133</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">152</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">154</span><span style="color: #007700">),<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">chr</span><span style="color: #007700">(</span><span style="color: #0000BB">160</span><span style="color: #007700">)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;);&nbsp;<br />
&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">$replace&nbsp;</span><span style="color: #007700">=&nbsp;array(&nbsp;</span><span style="color: #DD0000">"'"</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"'"</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'"'</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'"'</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'-'</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"'"</span><span style="color: #007700">,&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"'"</span><span style="color: #007700">,&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'"'</span><span style="color: #007700">,&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'"'</span><span style="color: #007700">,&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'--'</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'-'</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"&amp;#8218;"</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">"&amp;#8230;"</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'-'</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #DD0000">'&nbsp;'&nbsp;</span><span style="color: #007700">);&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;</span><span style="color: #0000BB">str_replace</span><span style="color: #007700">(</span><span style="color: #0000BB">$search</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$replace</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">$string</span><span style="color: #007700">);&nbsp;<br />
}&nbsp;<br />
</span><span style="color: #0000BB"><b><span style='color:#333333; background-color:#FFFF00'>?&gt;</span></b><br />
</span><br />
</span><br />
</code></div>
<p>I'll explain this in detail a little later.</p>
]]></content:encoded>
			<wfw:commentRss>http://somniloquy.org/blog/2007/11/13/geek-stuff-handling-microsoft-word-text-in-web-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>geek stuff:  IE6 &#8220;Page cannot be displayed&#8221; fix in PHP</title>
		<link>http://somniloquy.org/blog/2007/09/20/geek-stuff-ie6-page-expired-fix-in-php/</link>
		<comments>http://somniloquy.org/blog/2007/09/20/geek-stuff-ie6-page-expired-fix-in-php/#comments</comments>
		<pubDate>Thu, 20 Sep 2007 15:31:19 +0000</pubDate>
		<dc:creator>Preston</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/somniloq/www/www/blog/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[computery stuff]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://somniloquy.org/blog/2007/09/20/geek-stuff-ie6-page-expired-fix-in-php/</guid>
		<description><![CDATA[If you're working with forms in PHP, and especially if you're working with forms that have multiple steps, you've probably run across the "back button" problem in IE6. Here's what it looks like: 1) you fill out a form and click the "submit" button &#8211; this takes you to another page. 2) you click the [...]]]></description>
			<content:encoded><![CDATA[<p>If you're working with forms in PHP, and <i>especially</i> if you're working with forms that have multiple steps, you've probably run across the "back button" problem in IE6.  Here's what it looks like:</p>
<p>1) you fill out a form and click the "submit" button &#8211; this takes you to another page.</p>
<p>2) you click the "back" button.</p>
<p>3) IE6 takes you to an error page that says:</p>
<p>"Page could not be displayed"</p>
<p>and/or:</p>
<p>Warning: Page has Expired<br />
"The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button."</p>
<p>The problem is this:  you want to be able to return to the previous page without resubmitting form data, AND with the form data still displayed as you've entered it.  This, of course, is a caching problem.  There are numerous proposed solutions for this online, but surprisingly few of them work well.  Here's the one that works for me:</p>
<div class="VisualSyntax"><code><span style="color: #000000"></p>
<p><span style="color: #0000BB"><b><span style='color:#333333; background-color:#FFFF00'>&lt;?php</span></b><br />
header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Expires:&nbsp;Mon,&nbsp;26&nbsp;Jul&nbsp;1997&nbsp;05:00:00&nbsp;GMT"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Last-Modified:&nbsp;"&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">gmdate</span><span style="color: #007700">(</span><span style="color: #DD0000">"D,&nbsp;d&nbsp;M&nbsp;Y&nbsp;H:i:s"</span><span style="color: #007700">)&nbsp;.&nbsp;</span><span style="color: #DD0000">"&nbsp;GMT"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Cache-Control:&nbsp;no-store,&nbsp;no-cache,&nbsp;must-revalidate"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Cache-Control:&nbsp;post-check=0,&nbsp;pre-check=0"</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">false</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB">session_start</span><span style="color: #007700">();<br />
</span><span style="color: #0000BB">header</span><span style="color: #007700">(</span><span style="color: #DD0000">"Cache-Control:&nbsp;private"</span><span style="color: #007700">);<br />
</span><span style="color: #0000BB"><b><span style='color:#333333; background-color:#FFFF00'>?&gt;</span></b><br />
</span><br />
</span><br />
</code></div>
]]></content:encoded>
			<wfw:commentRss>http://somniloquy.org/blog/2007/09/20/geek-stuff-ie6-page-expired-fix-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>geek stuff:  passing parameters to onreadystatechange in AJAX</title>
		<link>http://somniloquy.org/blog/2007/09/06/geek-stuff-passing-parameters-to-onreadystatechange-in-ajax/</link>
		<comments>http://somniloquy.org/blog/2007/09/06/geek-stuff-passing-parameters-to-onreadystatechange-in-ajax/#comments</comments>
		<pubDate>Thu, 06 Sep 2007 20:53:47 +0000</pubDate>
		<dc:creator>Preston</dc:creator>
		<br />
<b>Warning</b>:  Invalid argument supplied for foreach() in <b>/home/somniloq/www/www/blog/wp-content/plugins/autometa/autometa.php</b> on line <b>324</b><br />
		<category><![CDATA[computery stuff]]></category>

	<!-- AutoMeta Start -->
	<!-- AutoMeta End -->
	
		<guid isPermaLink="false">http://somniloquy.org/blog/2007/09/06/geek-stuff-passing-parameters-to-onreadystatechange-in-ajax/</guid>
		<description><![CDATA[Maybe everyone knows this, but I've seen very little about it online. The vast majority of AJAX-oriented functions looks something like this: var&#160;xmlHttp function&#160;showHint(str) { if&#160;(str.length==0) &#160;&#160;{&#160; &#160;&#160;document.getElementById("txtHint").innerHTML="" &#160;&#160;return &#160;&#160;} xmlHttp=GetXmlHttpObject() if&#160;(xmlHttp==null) &#160;&#160;{ &#160;&#160;alert&#160;("Browser&#160;does&#160;not&#160;support&#160;HTTP&#160;Request") &#160;&#160;return &#160;&#160;}&#160; var&#160;url="gethint.php" url=url+"?q="+str url=url+"&#38;sid="+Math.random() xmlHttp.onreadystatechange=stateChanged&#160; xmlHttp.open("GET",url,true) xmlHttp.send(null) }&#160; This function (taken from a w3schools tutorial) calls a function named stateChanged() [...]]]></description>
			<content:encoded><![CDATA[<p>Maybe everyone knows this, but I've seen very little about it online. The vast majority of AJAX-oriented functions looks something like this:</p>
<div class="VisualSyntax"><code><span style="color: #000000"></p>
<p>var&nbsp;xmlHttp</p>
<p>function&nbsp;showHint(str)<br />
{<br />
if&nbsp;(str.length==0)<br />
&nbsp;&nbsp;{&nbsp;<br />
&nbsp;&nbsp;document.getElementById("txtHint").innerHTML=""<br />
&nbsp;&nbsp;return<br />
&nbsp;&nbsp;}<br />
xmlHttp=GetXmlHttpObject()<br />
if&nbsp;(xmlHttp==null)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;alert&nbsp;("Browser&nbsp;does&nbsp;not&nbsp;support&nbsp;HTTP&nbsp;Request")<br />
&nbsp;&nbsp;return<br />
&nbsp;&nbsp;}&nbsp;<br />
var&nbsp;url="gethint.php"<br />
url=url+"?q="+str<br />
url=url+"&amp;sid="+Math.random()<br />
xmlHttp.onreadystatechange=stateChanged&nbsp;<br />
xmlHttp.open("GET",url,true)<br />
xmlHttp.send(null)<br />
}&nbsp;<br />
</span><br />
</code></div>
<p>This function (taken from a <a href="http://www.w3schools.com/php/php_ajax_suggest.asp">w3schools tutorial</a>) calls a function named <b>stateChanged()</b> when it receives data.  <b>stateChanged</b>  handles the display of response data, and looks like this:</p>
<div class="VisualSyntax"><code><span style="color: #000000"></p>
<p>function&nbsp;stateChanged()&nbsp;<br />
{&nbsp;<br />
if&nbsp;(xmlHttp.readyState==4&nbsp;||&nbsp;xmlHttp.readyState=="complete")<br />
&nbsp;{&nbsp;<br />
&nbsp;document.getElementById("txtHint").innerHTML=xmlHttp.responseText&nbsp;<br />
&nbsp;}&nbsp;<br />
}<br />
</span><br />
</code></div>
<p>Note that this function accepts no parameters, and for good reason &#8211; if you attempt to pass parameters to it in the first function, like so:</p>
<div class="VisualSyntax"><code><span style="color: #000000"></p>
<p>xmlHttp.onreadystatechange&nbsp;=&nbsp;stateChanged('hello&nbsp;world')<br />
</span><br />
</code></div>
<p>&#8230; everything will break. </p>
<p>If you need to pass parameters at onreadystatechange (and I often need to), here's how you do it:</p>
<div class="VisualSyntax"><code><span style="color: #000000"></p>
<p>xmlHttp.onreadystatechange&nbsp;=&nbsp;function(){&nbsp;stateChanged('hello&nbsp;world');&nbsp;};<br />
</span><br />
</code></div>
<p>and then you modify <b>stateChanged()</b> to take parameters as needed:</p>
<div class="VisualSyntax"><code><span style="color: #000000"></p>
<p>function&nbsp;stateChanged(param)&nbsp;{&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(xmlHttp.readyState==4&nbsp;||&nbsp;xmlHttp.readyState=="complete"){&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("txtHint").innerHTML=xmlHttp.responseText&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;else&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;document.getElementById("txtHint").innerHTML=param;<br />
&nbsp;&nbsp;&nbsp;&nbsp;}<br />
}<br />
</span><br />
</code></div>
<p>And Bob's your uncle.</p>
]]></content:encoded>
			<wfw:commentRss>http://somniloquy.org/blog/2007/09/06/geek-stuff-passing-parameters-to-onreadystatechange-in-ajax/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
