<?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>Josh Duff</title>
	<atom:link href="http://joshduff.com/feed" rel="self" type="application/rss+xml" />
	<link>http://joshduff.com</link>
	<description>A guy with a web site</description>
	<lastBuildDate>Mon, 22 Feb 2010 06:28:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Run a query for every table in a database</title>
		<link>http://joshduff.com/189/run-a-query-for-every-table-in-a-database</link>
		<comments>http://joshduff.com/189/run-a-query-for-every-table-in-a-database#comments</comments>
		<pubDate>Wed, 17 Feb 2010 20:16:12 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=189</guid>
		<description><![CDATA[Ever wished you could run a dangerous query like DROP TABLE or TRUNCATE against every table in a database in a single query?
No?
Well, how about something like CHECK or REPAIR table, then?
If you ever find yourself in the rare situation where you need to run the same query across every table in a database, this [...]]]></description>
			<content:encoded><![CDATA[<p>Ever wished you could run a dangerous query like DROP TABLE or TRUNCATE against every table in a database in a single query?</p>
<p>No?</p>
<p>Well, how about something like CHECK or REPAIR table, then?</p>
<p>If you ever find yourself in the rare situation where you need to run the same query across every table in a database, this procedure might make your life easier:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">DELIMITER $$
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">PROCEDURE</span> <span style="color: #008000;">`p<span style="color: #008080; font-weight: bold;">_</span>run<span style="color: #008080; font-weight: bold;">_</span>for<span style="color: #008080; font-weight: bold;">_</span>each<span style="color: #008080; font-weight: bold;">_</span>table`</span><span style="color: #FF00FF;">&#40;</span><span style="color: #990099; font-weight: bold;">IN</span> strDatabase <span style="color: #999900; font-weight: bold;">TEXT</span><span style="color: #000033;">,</span> <span style="color: #990099; font-weight: bold;">IN</span> strOperation <span style="color: #999900; font-weight: bold;">TEXT</span><span style="color: #FF00FF;">&#41;</span>
    <span style="color: #990099; font-weight: bold;">DETERMINISTIC</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> strQuery <span style="color: #999900; font-weight: bold;">TEXT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> strTable <span style="color: #999900; font-weight: bold;">VARCHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">255</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> bDone <span style="color: #999900; font-weight: bold;">INT</span> <span style="color: #990099; font-weight: bold;">DEFAULT</span> <span style="color: #008080;">0</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> TableCursor CURSOR FOR
		<span style="color: #990099; font-weight: bold;">SELECT</span> <span style="color: #008000;">`TABLE<span style="color: #008080; font-weight: bold;">_</span>NAME`</span>
		<span style="color: #990099; font-weight: bold;">FROM</span> <span style="color: #008000;">`information<span style="color: #008080; font-weight: bold;">_</span>schema`</span>.<span style="color: #008000;">`TABLES`</span>
		<span style="color: #990099; font-weight: bold;">WHERE</span> <span style="color: #008000;">`TABLE<span style="color: #008080; font-weight: bold;">_</span>SCHEMA`</span> <span style="color: #CC0099;">=</span> strDatabase <span style="color: #CC0099; font-weight: bold;">AND</span> TABLE_TYPE <span style="color: #CC0099;">=</span> <span style="color: #008000;">'BASE TABLE'</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> CONTINUE <span style="color: #990099; font-weight: bold;">HANDLER</span> FOR <span style="color: #CC0099; font-weight: bold;">NOT</span> FOUND <span style="color: #990099; font-weight: bold;">SET</span> bDone <span style="color: #CC0099;">=</span> <span style="color: #008080;">1</span><span style="color: #000033;">;</span>
&nbsp;
	OPEN TableCursor<span style="color: #000033;">;</span>
&nbsp;
	<span style="color: #000099;">REPEAT</span>
		FETCH TableCursor <span style="color: #990099; font-weight: bold;">INTO</span> strTable<span style="color: #000033;">;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">SET</span> @QueryThatWasPassedIn <span style="color: #CC0099;">:=</span> <span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>
			<span style="color: #000099;">REPLACE</span><span style="color: #FF00FF;">&#40;</span>strOperation<span style="color: #000033;">,</span> <span style="color: #008000;">'{?database}'</span><span style="color: #000033;">,</span> strDatabase<span style="color: #FF00FF;">&#41;</span>
			<span style="color: #000033;">,</span> <span style="color: #008000;">'{?table}'</span><span style="color: #000033;">,</span> strTable<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
		PREPARE Statement <span style="color: #990099; font-weight: bold;">FROM</span> @QueryThatWasPassedIn<span style="color: #000033;">;</span>
		EXECUTE Statement<span style="color: #000033;">;</span>
	UNTIL bDone <span style="color: #009900;">END</span> <span style="color: #000099;">REPEAT</span><span style="color: #000033;">;</span>
&nbsp;
	CLOSE TableCursor<span style="color: #000033;">;</span>
	DEALLOCATE PREPARE Statement<span style="color: #000033;">;</span>
<span style="color: #009900;">END</span>$$
DELIMITER <span style="color: #000033;">;</span></pre></div></div>

<h1>Useage</h1>
<p>The procedure takes two parameters.  The first one is the name of the database whose tables you want to run the query for.</p>
<p>The second is the query you would like to run.  The strings &#034;{?database}&#034; and &#034;{?table}&#034; will be replaced with the database and table names.</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">CALL</span> p_run_for_each_table<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'databasename'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'SELECT * FROM {?database}.{?table}'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>

<h1>What queries you can run</h1>
<p>You should be able to use any queries that can be run in a prepared statement &#8211; you can find the list about two-thirds of the way down <a href="http://dev.mysql.com/doc/refman/5.1/en/sql-syntax-prepared-statements.html">this page</a>.</p>
<p>As of MySQL 5.1, you can run these queries: &#034;ALTER TABLE, CALL, COMMIT, CREATE INDEX, CREATE TABLE, DELETE, DO, DROP INDEX, DROP TABLE, INSERT, RENAME TABLE, REPLACE, SELECT, SET, UPDATE, and most SHOW statements.&#034;</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/189/run-a-query-for-every-table-in-a-database/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Logical errors in queries: DO NOT WANT</title>
		<link>http://joshduff.com/173/logical-errors-in-queries-do-not-want</link>
		<comments>http://joshduff.com/173/logical-errors-in-queries-do-not-want#comments</comments>
		<pubDate>Wed, 03 Feb 2010 03:17:58 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=173</guid>
		<description><![CDATA[During my career developing database-driven software (teehee, I&#039;m a professional) I&#039;ve noted that the most horrific query errors are the logical ones &#8211; queries that parse correctly, and return reasonable-looking data, but make wrong assumptions about how different parts of the query relate to each other.
One particular error that I&#039;ve seen time and time again [...]]]></description>
			<content:encoded><![CDATA[<p>During my career developing database-driven software (teehee, I&#039;m a professional) I&#039;ve noted that the most horrific query errors are the logical ones &#8211; queries that parse correctly, and return reasonable-looking data, but make wrong assumptions about how different parts of the query relate to each other.</p>
<p>One particular error that I&#039;ve seen time and time again (even from people who have been writing queries for a while) can occur when summarizing data from multiple tables that have a one-to-many relationship.</p>
<p>&#8230;In other words, it could occur in queries written for most database-driven software.</p>
<h2>Solution: fix the problem by writing about it!</h2>
<p>I wrote <a href="http://wikido.isoftdata.com/index.php/The_GROUPing_pitfall">a page documenting</a> the cause of the logical error, doing my best to warn people against letting it slip into their own code.</p>
<p>I attempted to write it so it would be easy to read, possibly even entertaining (a lofty goal for a manual on writing database queries, perhaps) &#8211; there is some colorful language and plenty of juvenile humor mixed with the tech-speak.</p>
<p>The doc itself is part of the wiki of the company where I work.  I don&#039;t write a ton of documentation for our developers or customers (certainly not as much as I should), but whenever I do, I get this awesome feeling of usefulness.  Oh, and pride.  Sometimes, I feel so proud, that I feel compelled to link other people (who have no relationship to my company) to what I wrote!  Ridiculous, I know.</p>
<p>Remember: if you write queries, it is your responsibility to guarantee that they return true and accurate data!</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/173/logical-errors-in-queries-do-not-want/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Convert blocks of text to sentence case</title>
		<link>http://joshduff.com/156/convert-blocks-of-text-to-sentence-case</link>
		<comments>http://joshduff.com/156/convert-blocks-of-text-to-sentence-case#comments</comments>
		<pubDate>Thu, 21 Jan 2010 01:31:28 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[MySQL]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=156</guid>
		<description><![CDATA[You know what I hate?  Paragraphs of capital (or all lowercase) letters.
The other day a coworker was looking to beautify a large quantity of data spread across some MySQL tables.  I created this function to make his life easier:

DELIMITER $$
CREATE FUNCTION `f_sentence_case`&#40;strInput TEXT, nMinimumLength INT&#41; RETURNS TEXT
DETERMINISTIC
BEGIN
&#160;
	DECLARE result TEXT;
	DECLARE LastSpace INT;
	DECLARE NextSpace INT;
	DECLARE NextSlash [...]]]></description>
			<content:encoded><![CDATA[<p>You know what I hate?  Paragraphs of capital (or all lowercase) letters.</p>
<p>The other day a coworker was looking to beautify a large quantity of data spread across some MySQL tables.  I created this function to make his life easier:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;">DELIMITER $$
<span style="color: #990099; font-weight: bold;">CREATE</span> <span style="color: #990099; font-weight: bold;">FUNCTION</span> <span style="color: #008000;">`f<span style="color: #008080; font-weight: bold;">_</span>sentence<span style="color: #008080; font-weight: bold;">_</span>case`</span><span style="color: #FF00FF;">&#40;</span>strInput <span style="color: #999900; font-weight: bold;">TEXT</span><span style="color: #000033;">,</span> nMinimumLength <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #990099; font-weight: bold;">RETURNS</span> <span style="color: #999900; font-weight: bold;">TEXT</span>
<span style="color: #990099; font-weight: bold;">DETERMINISTIC</span>
<span style="color: #990099; font-weight: bold;">BEGIN</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">DECLARE</span> result <span style="color: #999900; font-weight: bold;">TEXT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> LastSpace <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> NextSpace <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> NextSlash <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> Word <span style="color: #999900; font-weight: bold;">TEXT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> NewSentence <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> PreviousCharacter <span style="color: #000099;">CHAR</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> TrimmedWord <span style="color: #999900; font-weight: bold;">TEXT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> NumberOfSpaces <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">DECLARE</span> Swap <span style="color: #999900; font-weight: bold;">INT</span><span style="color: #000033;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">SET</span> strInput <span style="color: #CC0099;">:=</span> <span style="color: #000099;">CONCAT</span><span style="color: #FF00FF;">&#40;</span>strInput<span style="color: #000033;">,</span> <span style="color: #008000;">' '</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">SET</span> result <span style="color: #CC0099;">:=</span> <span style="color: #008000;">''</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">SET</span> LastSpace <span style="color: #CC0099;">:=</span> <span style="color: #008080;">1</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">SET</span> NextSpace <span style="color: #CC0099;">:=</span> <span style="color: #000099;">LOCATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span> strInput<span style="color: #000033;">,</span> LastSpace <span style="color: #CC0099;">+</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
	<span style="color: #990099; font-weight: bold;">SET</span> NextSlash <span style="color: #CC0099;">:=</span> <span style="color: #000099;">LOCATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'/'</span><span style="color: #000033;">,</span> strInput<span style="color: #000033;">,</span> LastSpace <span style="color: #CC0099;">+</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
	<span style="color: #990099; font-weight: bold;">SET</span> NextSpace <span style="color: #CC0099;">:=</span> <span style="color: #009900;">IF</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">LEAST</span><span style="color: #FF00FF;">&#40;</span>NextSlash<span style="color: #000033;">,</span> NextSpace<span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">=</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> <span style="color: #000099;">GREATEST</span><span style="color: #FF00FF;">&#40;</span>NextSlash<span style="color: #000033;">,</span> NextSpace<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #000099;">LEAST</span><span style="color: #FF00FF;">&#40;</span>NextSlash<span style="color: #000033;">,</span> NextSpace<span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
	label1: WHILE NextSpace <span style="color: #990099; font-weight: bold;">DO</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">SET</span> Word <span style="color: #CC0099;">:=</span> SUBSTR<span style="color: #FF00FF;">&#40;</span>strInput<span style="color: #000033;">,</span> LastSpace<span style="color: #000033;">,</span> NextSpace <span style="color: #CC0099;">-</span> LastSpace<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> PreviousCharacter <span style="color: #CC0099;">:=</span> SUBSTR<span style="color: #FF00FF;">&#40;</span>strInput<span style="color: #000033;">,</span> LastSpace <span style="color: #CC0099;">-</span> <span style="color: #008080;">1</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> NewSentence <span style="color: #CC0099;">:=</span> LastSpace <span style="color: #CC0099;">=</span> <span style="color: #008080;">1</span> <span style="color: #CC0099; font-weight: bold;">OR</span> <span style="color: #FF00FF;">&#40;</span>NewSentence <span style="color: #CC0099; font-weight: bold;">AND</span> PreviousCharacter <span style="color: #CC0099;">=</span> <span style="color: #008000;">' '</span><span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099; font-weight: bold;">OR</span> PreviousCharacter <span style="color: #000099;">IN</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'.'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'!'</span><span style="color: #000033;">,</span> <span style="color: #008000;">'?'</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">SET</span> TrimmedWord <span style="color: #CC0099;">:=</span> <span style="color: #000099;">LTRIM</span><span style="color: #FF00FF;">&#40;</span>Word<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> NumberOfSpaces <span style="color: #CC0099;">:=</span> <span style="color: #000099;">LENGTH</span><span style="color: #FF00FF;">&#40;</span>Word<span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">-</span> <span style="color: #000099;">LENGTH</span><span style="color: #FF00FF;">&#40;</span>TrimmedWord<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> Word <span style="color: #CC0099;">:=</span> TrimmedWord<span style="color: #000033;">;</span>
&nbsp;
		<span style="color: #808080; font-style: italic;"># Make it lowercase if it is all uppercase</span>
		<span style="color: #990099; font-weight: bold;">SET</span> Word <span style="color: #CC0099;">:=</span> <span style="color: #009900;">IF</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">LENGTH</span><span style="color: #FF00FF;">&#40;</span>Word<span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">&gt;=</span> nMinimumLength <span style="color: #CC0099; font-weight: bold;">AND</span> Word <span style="color: #CC0099; font-weight: bold;">NOT</span> <span style="color: #CC0099; font-weight: bold;">REGEXP</span> <span style="color: #008000;">'[0-9]'</span><span style="color: #000033;">,</span> 
			<span style="color: #009900;">IF</span><span style="color: #FF00FF;">&#40;</span>NewSentence<span style="color: #000033;">,</span>
				<span style="color: #000099;">CONCAT</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">UCASE</span><span style="color: #FF00FF;">&#40;</span>SUBSTR<span style="color: #FF00FF;">&#40;</span>Word<span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #000033;">,</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #000099;">LCASE</span><span style="color: #FF00FF;">&#40;</span>SUBSTR<span style="color: #FF00FF;">&#40;</span>Word<span style="color: #000033;">,</span> <span style="color: #008080;">2</span><span style="color: #000033;">,</span> <span style="color: #000099;">LENGTH</span><span style="color: #FF00FF;">&#40;</span>Word<span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">-</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span>
				<span style="color: #000099;">LCASE</span><span style="color: #FF00FF;">&#40;</span>Word<span style="color: #FF00FF;">&#41;</span>
			<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> 
			Word<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">SET</span> result <span style="color: #CC0099;">:=</span> <span style="color: #000099;">CONCAT</span><span style="color: #FF00FF;">&#40;</span>result<span style="color: #000033;">,</span> <span style="color: #000099;">REPEAT</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span> NumberOfSpaces<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> Word<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
		<span style="color: #990099; font-weight: bold;">SET</span> Swap <span style="color: #CC0099;">:=</span> LastSpace<span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> LastSpace <span style="color: #CC0099;">:=</span> NextSpace<span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> NextSpace <span style="color: #CC0099;">:=</span> <span style="color: #000099;">LOCATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">' '</span><span style="color: #000033;">,</span> strInput<span style="color: #000033;">,</span> Swap <span style="color: #CC0099;">+</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> NextSlash <span style="color: #CC0099;">:=</span> <span style="color: #000099;">LOCATE</span><span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">'/'</span><span style="color: #000033;">,</span> strInput<span style="color: #000033;">,</span> Swap <span style="color: #CC0099;">+</span> <span style="color: #008080;">1</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
		<span style="color: #990099; font-weight: bold;">SET</span> NextSpace <span style="color: #CC0099;">:=</span> <span style="color: #009900;">IF</span><span style="color: #FF00FF;">&#40;</span><span style="color: #000099;">LEAST</span><span style="color: #FF00FF;">&#40;</span>NextSlash<span style="color: #000033;">,</span> NextSpace<span style="color: #FF00FF;">&#41;</span> <span style="color: #CC0099;">=</span> <span style="color: #008080;">0</span><span style="color: #000033;">,</span> <span style="color: #000099;">GREATEST</span><span style="color: #FF00FF;">&#40;</span>NextSlash<span style="color: #000033;">,</span> NextSpace<span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">,</span> <span style="color: #000099;">LEAST</span><span style="color: #FF00FF;">&#40;</span>NextSlash<span style="color: #000033;">,</span> NextSpace<span style="color: #FF00FF;">&#41;</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span>
&nbsp;
	<span style="color: #009900;">END</span> WHILE label1<span style="color: #000033;">;</span>
&nbsp;
RETURN result<span style="color: #000033;">;</span>
&nbsp;
<span style="color: #009900;">END</span>$$
DELIMITER <span style="color: #000033;">;</span></pre></div></div>

<h1>What it does</h1>
<p>It seems to perform generally as I hoped it would; which is to say that it formats text to be sentence case.</p>
<p>More specifically, it alters all the &#034;words&#034; (a set of non-numeric, non-whitespace characters) that are longer than the specified minimum length.</p>
<p>It changes the words to be all lowercase, unless they happen to be the first word after a punctuation mark (in which case the first character of the word is made uppercase).</p>
<h1>Useage</h1>
<p>To clean up a field so that it is formatted in sentence case (ignoring all words with less than 3 characters), simply run this query:</p>

<div class="wp_syntax"><div class="code"><pre class="mysql" style="font-family:monospace;"><span style="color: #990099; font-weight: bold;">UPDATE</span> <span style="color: #008000;">`table`</span> <span style="color: #990099; font-weight: bold;">SET</span> <span style="color: #008000;">`field`</span> <span style="color: #CC0099;">=</span> f_sentence_case<span style="color: #FF00FF;">&#40;</span><span style="color: #008000;">`field`</span><span style="color: #000033;">,</span> <span style="color: #008080;">3</span><span style="color: #FF00FF;">&#41;</span><span style="color: #000033;">;</span></pre></div></div>

<p>Other than that, my only specs for the query were for it to be functional and hopefully not break my brain when I went back to read it later.  If anyone has any significant improvements to it, let me know!</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/156/convert-blocks-of-text-to-sentence-case/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Running my first campaign!</title>
		<link>http://joshduff.com/145/running-my-first-campaign</link>
		<comments>http://joshduff.com/145/running-my-first-campaign#comments</comments>
		<pubDate>Thu, 14 Jan 2010 15:41:37 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Geekery]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=145</guid>
		<description><![CDATA[Less than a year ago, I jumped off the high-board of nerdiness into the deep end of the role-playing pool &#8211; and ran my very first campaign.
I wanted a fun campaign (duh) with rules and story that would be hard for me to mess up.  For most of the campaign, the only players were two [...]]]></description>
			<content:encoded><![CDATA[<p>Less than a year ago, I jumped off the high-board of nerdiness into the deep end of the role-playing pool &#8211; and ran my very first campaign.</p>
<p>I wanted a fun campaign (duh) with rules and story that would be hard for me to mess up.  For most of the campaign, the only players were two good friends with solid role-playing experience, so I was able to rely on the players to contribute a good amount of quality.</p>
<h1>The story</h1>
<p>I took a stab at running an old-west campaign, borrowing every western-movie trope I could think of.  The PCs played <a href="http://tvtropes.org/pmwiki/pmwiki.php/Main/TheGunslinger">gunslinging</a> lawmen for hire, riding into a town oppressed by a gang of n&#039;er-do-wells populated with plenty of tobacco-spitting, expendable, no-good <a href="http://tvtropes.org/pmwiki/pmwiki.php/Main/Outlaw">outlaws</a> to gun down.</p>
<p>Without going into too much detail: the players cleaned out a counterfeiting operation in an old widow&#039;s basement, were recruited to clean up the town, used aggressive negotiations to get rid of gang members harassing the mayor&#039;s house, and stopped another group of enforcers who were coercing money from some water-starved farmers.</p>
<p>Back in town, they took over the town prison, had a gun fight in a booby-trapped house, escaped just as it blew sky high, confronted the aristocratic gang leader on the porch of his ranch house, and finished with a gun battle on main street.</p>
<h1>The system</h1>
<p>At the recommendation of an experienced GM, I used the <a href="http://error420.com/documents/Boot%20Hill%202nd%20Edition.pdf">Boot Hill (second edition) rules</a>, a creation of <a href="http://en.wikipedia.org/wiki/Gary_Gygax">Gary Gygax</a> and <a href="http://en.wikipedia.org/wiki/Brian_Blume">Brian Blume</a>.</p>
<p>I was looking for super-lightweight rules, so I didn&#039;t even use the full rules set described by the Boot Hill book &#8211; the only dice rolling during the campaign happened during combat.  Boot Hill gun combat is simple:</p>
<ul>
<li>The fastest draw (based on weapon speed and personal speed) goes first</li>
<li>Roll percentile dice (based on your weapon, personal accuracy, and a relatively short list of modifiers) to see if you hit:</li>
</ul>
<p style="text-align: center;"><a href="http://joshduff.com/wp-content/uploads/2010/01/Hit-determination-chart.jpg"><img class="size-medium wp-image-146  aligncenter" title="Boot Hill hit determination chart" src="http://joshduff.com/wp-content/uploads/2010/01/Hit-determination-chart-231x300.jpg" alt="" width="231" height="300" /></a></p>
<ul>
<li>Roll percentile dice on a wound chart to see where you hit:</li>
</ul>
<p style="text-align: center;"><a href="http://joshduff.com/wp-content/uploads/2010/01/Wound-chart.jpg"><img class="size-full wp-image-147 aligncenter" title="Boot Hill wound chart" src="http://joshduff.com/wp-content/uploads/2010/01/Wound-chart.jpg" alt="" width="325" height="289" /></a></p>
<p>Mortal wounds kill you.</p>
<p>Any wound at all gives you a -5% chance at getting to shoot first, and also to hitting the other guy.</p>
<p>Once your strength drops below 50% of what it is normally (which can often be done with a single serious wound), you start getting -20% to shooting first, and hitting.</p>
<p>It&#039;s a simple system, but one that facilitates characters dying pretty often.  A couple good rolls, and a single shot can permanently take out any character &#8211; even if he just rolled into town with a new bandanna and a pocket full of hit points.</p>
<h2>Wait, easy character death?</h2>
<p>I wanted my players to enjoy a good old-fashioned movie version of the wild west.  They were supposed to play the heroes &#8211; the guys who go flying through bar windows and come up swinging!</p>
<p>I wanted quick and dirty combat, but I wanted my PCs to be a bit more survivable.  I tried a few things to counteract the cheapness of life:</p>
<h3>Giving the PCs slightly better stats</h3>
<p>Standard nerfing &#8211; most of my NPCs would drop below half strength after one serious wound (which severely limits a character for the rest of the combat).  The player characters could took at least two (non-mortal) wounds before things got really sticky.</p>
<h3>Making healing much more trivial than the rules suggested</h3>
<p>According to the rules, healing is a fairly slow process, taking days or weeks to recover from any sort of combat wound.  My player characters needed to be able to get into gun battles every few hours &#8211; they could be rejuvenated by a good night&#039;s sleep, or the restorative powers of a <a href="http://tvtropes.org/pmwiki/pmwiki.php/Main/ApronMatron">kindly old lady</a>&#039;s stew.</p>
<h3>Adding a new game mechanic</h3>
<p>I decided to take a hint from the awesome and successful video game <em>Left 4 Dead</em>.  In that universe, survivor characters who go down are immobilized, but can still fire handguns until their teammates pull them up (or the zombies fill up at the brain buffet).</p>
<p>Any time one of the PCs took mortal damage, I did something similar &#8211; instead of the characters dying, they dropped to the ground and could fire their handguns at a reduced rate.  If another player made it over to them and used a round to pull them up, that character could enter the fray with some of their strength restored.</p>
<p>It wasn&#039;t a mechanic that saw a lot of use, but it turned several potential defeats into narrow victories.  I was happy with this &#8211; narrowly beating the baddies is a lot more exhilarating than seeing one side gun down the other like dogs.</p>
<h1>Also, I&#039;m a noob</h1>
<p>I found it a highly enjoyable experience, but there were weak spots.  The campaign was fairly light on dialog, which isn&#039;t necessarily a bad thing &#8211; I just wish I were better at having a conversation in character, and thinking on my feet.</p>
<p>My weaknesses were most evident in the final session, where my PCs held the big baddy in prison and were looking around for a way to prove his guilt (they were lawful, after all) or uncover the next plot hook.</p>
<p>I left them wandering around looking for a clue far too long before I initiated the next action for them to deal with.  They grilled the prisoner for some time (good roleplaying, at least), looking for the magic words that would advance the plot.  Blah.</p>
<h1>I think I might try this again</h1>
<p>I was very glad to have such great (and forgiving) roleplayers in my campaign.  When the GM is fresh, there&#039;s a lot less room for noobs or troublemakers.</p>
<p>I&#039;m definitely sold on lightweight rules sets, especially when going for a more cinematic feel.  The less of a barrier there is between the players and the cool things they want their characters to do, the better.</p>
<p>I have a suspicion that we might try this (noobs GMs practicing with friends) again sometime soon &#8211; if you have any suggestions for easy-to-pick-up gaming systems, or good scenarios for some one-shot sessions, then surrender your knowledge to my gaping mind-hole!</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/145/running-my-first-campaign/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Sleep &quot;schedule&quot;</title>
		<link>http://joshduff.com/141/sleep-schedule</link>
		<comments>http://joshduff.com/141/sleep-schedule#comments</comments>
		<pubDate>Mon, 28 Dec 2009 13:28:35 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Personal stupidity]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=141</guid>
		<description><![CDATA[A week ago, I used up a stretch of vacation time to indulge in a week of personal productivity (and video gaming).  During this stretch of time (from one Saturday to the next Sunday) I managed to sleep one less times than there were nights.
That is to say, I did not sleep when it was [...]]]></description>
			<content:encoded><![CDATA[<p>A week ago, I used up a stretch of vacation time to indulge in a week of personal productivity (and video gaming).  During this stretch of time (from one Saturday to the next Sunday) I managed to sleep one less times than there were nights.</p>
<p>That is to say, I did not sleep when it was dark &#8211; I slept when I felt tired enough to do so.  This happened to occur less often than nighttime.  To see a similar sleep schedule displayed in a handy timeline, check out <a href="http://xkcd.com/320/">this XKCD comic</a>.</p>
<p>Over Christmas weekend (4 days), I tried the same thing &#8211; I fell asleep very late the evening of the first day, very early the morning of third day, and again the afternoon of the fourth day.</p>
<p>This is the end of that experiment &#8211; over 4 days, I have slept 3 times.  As I go to work right now, I have already been awake for 8 hours.  I will probably feel like sleeping not long after I leave work.</p>
<p>The odd sleep schedule has some benefits: it&#039;s not hard to fall asleep (because my bed time is defined by when I feel sleepy), and depending on my sleep patterns, there is the possibility of actually spending less time sleeping every week.</p>
<p>The abnormal waking hours definitely felt odd at times, though I feel that I started to get used to them a bit.  I&#039;m considering trying a similar schedule over the course of a work week some time.  If I do, I will report back with my findings.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/141/sleep-schedule/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>omgwtf espresso</title>
		<link>http://joshduff.com/135/omgwtf-espresso</link>
		<comments>http://joshduff.com/135/omgwtf-espresso#comments</comments>
		<pubDate>Fri, 18 Dec 2009 21:24:49 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Personal stupidity]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=135</guid>
		<description><![CDATA[I hate the taste of coffee.
It&#039;s bitter (not in a good way, like beer) and unpleasant to my tastory senses.
However, it is difficult to beat coffee&#039;s efficiency as a vehicle for caffeine.  I generally drink my coffee with several heaping doses of hot chocolate powder, but the burnt bean flavor still comes through.
That was then
I [...]]]></description>
			<content:encoded><![CDATA[<p>I hate the taste of coffee.</p>
<p>It&#039;s bitter (not in a good way, like <a href="http://theoatmeal.com/comics/beer">beer</a>) and unpleasant to my tastory senses.</p>
<p>However, it is difficult to beat coffee&#039;s efficiency as a vehicle for caffeine.  I generally drink my coffee with several heaping doses of hot chocolate powder, but the burnt bean flavor still comes through.</p>
<h3>That was then</h3>
<p>I recently discovered espresso &#8211; a drink that focuses on distilling the essence of coffee (CAFFEINE) into as tiny a beverage as possible, and then filling up the rest of the cup with things that taste good.</p>
<p>Sweeeeeet.</p>
<p>I&#039;ve been indulging pretty regularly lately.  The stuff is expensive when you buy retail, but I have a friend who is mastering the art of Making Espresso That Doesn&#039;t Suck, and I intend to exploit him to the fullest extent possible.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/135/omgwtf-espresso/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Why I still won&#039;t use Facebook for everything</title>
		<link>http://joshduff.com/106/why-i-still-wont-use-facebook-for-everything</link>
		<comments>http://joshduff.com/106/why-i-still-wont-use-facebook-for-everything#comments</comments>
		<pubDate>Wed, 16 Dec 2009 22:12:06 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Geekery]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=106</guid>
		<description><![CDATA[With their most recent update, Facebook has suddenly become a more viable place for me to post all my thoughts and opinions.
However, I&#039;m still not a big fan of it when it comes to seeing other people&#039;s content.
The problem
Facebook shoves too much information down my throat, even if it&#039;s about people I care for.
The way [...]]]></description>
			<content:encoded><![CDATA[<p>With their most recent update, <a href="http://joshduff.com/99/in-a-shocking-twist-im-interested-in-facebook-again">Facebook has suddenly become a more viable place for me to post all my thoughts and opinions</a>.</p>
<p>However, I&#039;m still not a big fan of it when it comes to seeing other people&#039;s content.</p>
<h1>The problem</h1>
<p>Facebook shoves too much information down my throat, even if it&#039;s about people I care for.</p>
<h2>The way it works on the rest of the internet</h2>
<p>The things that you can post on Facebook (blog posts/notes, status updates, photo albums, sharing links) can all be released on other services.</p>
<p>Other people can subscribe to each of those sites individually &#8211; if someone posts interesting status updates, I follow them on Twitter.  If they take cool pictures or write insightful blog posts, I add those respective feeds to my RSS reader.</p>
<p>I follow only the things I am interested in &#8211; and because I can be picky about what I follow, I end up reading everything that comes through those feeds.</p>
<h2>Facebook doesn&#039;t let me choose</h2>
<p>The recent Facebook update gives the content providers (you and your friends) control over who CAN see certain information.  This is definitely useful, and I appreciate it.</p>
<p>But I don&#039;t get many options about what information I see in my news feed &#8211; if someone else publishes information to their feed, my only options are to</p>
<ul>
<li>Block ALL information from that user, and not see anything they post</li>
<li>See every single thing they publish to their feed</li>
<li>In the case of third-party apps, I could block the application and not see any information from that app, for any user.</li>
</ul>
<p>If I have a friend who makes really funny status updates and posts a ton of photos to their Facebook album, it&#039;s all or nothing for me &#8211; Facebook doesn&#039;t let me select what I&#039;m interested in seeing from the other user.</p>
<p>As a result, my Facebook feed is full of information ranging from interesting content to wastes of pixels.</p>
<h1>I don&#039;t roll that way</h1>
<p>I consume a lot of information over the internet &#8211; My <a href="http://www.google.com/reader">feed reader</a> tracks over 150 feeds the last time I checked, and I follow over 100 people on Twitter.  And I read almost every piece of information that comes through those feeds!</p>
<p>I can do this because I am picky about what I follow.  If I&#039;m not sure that at least 95% of the posts in a feed are going to be interesting to me, I don&#039;t follow it.</p>
<p>If a blogger, Twitter user, or photo album is publishing more than a few new items per day, I don&#039;t follow it (no matter how interesting it is) because my feed reader would get too cluttered, too quickly.  I wouldn&#039;t be able to keep up.</p>
<h1>It&#039;s not the fault of my friends</h1>
<p>Well, not most of them, anyway.  Some of them do post really stupid stuff to their feeds.  But I can block those users without feeling bad.</p>
<p>Let&#039;s say I take pictures of local scenery fairly often, and upload them to Facebook photo albums.  Facebook photo permissions are set per-album &#8211; I would probably have an album set up to be publicly viewable to everyone (because why wouldn&#039;t I share those pictures with whoever was interested?).</p>
<p>Now, when I upload the pictures, I have an option to share them with people.  When I do this, the photo will show up in their feed (unless they&#039;ve blocked me).</p>
<p>At this point, the responsibility is all on me &#8211; which of my friends would be interested in a photo of a sunrise just starting to brighten O street? I can share it with a specific group of people &#8211; maybe I even set up a list of people who I know like photography, and only post the new pictures into their feeds.</p>
<p>But those people don&#039;t get any say in the matter &#8211; if I post my new photos in the feeds of everyone on my friends list (which is the way Facebook has worked historically, and still acts by default), then those photos will be cluttering up their feed.</p>
<p>And if I try to be considerate, and only announce my newly discovered art to the few people I think would be most interested, then other people could be missing out &#8211; if I have friends who are actually interested in these photos, but I am not aware, I could very easily leave them out of the loop. And there&#039;s nothing they can do about it.</p>
<h1>Facebook really wants to keep people happy</h1>
<p>They&#039;re trying so hard to give people the tools they need to share their information reasonably.</p>
<p>I can understand why they&#039;re making the security so granular (so much so that it&#039;s getting really confusing to administrate) &#8211; security is something that almost everyone is concerned with, and a small group of people complain VERY loudly about.</p>
<h2>But there&#039;s more to social networking than security</h2>
<p>For people who care about the information they consume (and want to consume as much as possible), security settings do nothing.  They don&#039;t even matter.</p>
<p>If I&#039;m not allowed to see someone&#039;s photo album, I don&#039;t care in the slightest &#8211; the only thing I do care about is whether or not I can filter the information that IS available to me, so that I only see things that are guaranteed to be worth my time.</p>
<p>And until Facebook lets me do that, there&#039;s no reason to consider using it as one of my primary social networking tools.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/106/why-i-still-wont-use-facebook-for-everything/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In a shocking twist, I&#039;m interested in Facebook again</title>
		<link>http://joshduff.com/99/in-a-shocking-twist-im-interested-in-facebook-again</link>
		<comments>http://joshduff.com/99/in-a-shocking-twist-im-interested-in-facebook-again#comments</comments>
		<pubDate>Tue, 15 Dec 2009 19:10:22 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Geekery]]></category>

		<guid isPermaLink="false">http://joshduff.com/?p=99</guid>
		<description><![CDATA[At the beginning of the month, the founder of Facebook published a happy post about some upcoming changes to the site.  About a week later, the changes were rolled out.
What did they do?
Facebook users get more choices about who will see the content they put online.  Here are my current settings:

However, there are still some [...]]]></description>
			<content:encoded><![CDATA[<p>At the beginning of the month, the founder of Facebook published a <a href="http://blog.facebook.com/blog.php?post=190423927130">happy post about some upcoming changes to the site</a>.  About a week later, <a href="http://blog.facebook.com/blog.php?post=196629387130">the changes were rolled out</a>.</p>
<h1>What did they do?</h1>
<p>Facebook users get more choices about who will see the content they put online.  Here are my current settings:</p>
<p><img class="alignnone size-full wp-image-119" title="Facebook Privacy Settings 2009-12-14" src="http://joshduff.com/wp-content/uploads/2009/12/Facebook-Privacy-Settings-2009-12-14-smaller.jpg" alt="Facebook Privacy Settings 2009-12-14" width="621" height="394" /></p>
<p>However, there are still some catches &#8211; third party applications have the ability to see all the users who you are currently friends with, and you can&#039;t do anything about it.</p>
<h1>Facebook used to be way lamer</h1>
<p>Until this change, Facebook wasn&#039;t (in my mind) a great place for me to put content on the internet.</p>
<p>When you&#039;re sharing information of any sort with other people, there are a few things you should take into account:</p>
<h2>You don&#039;t always want everyone to know</h2>
<p>Having trouble with the spouse?  Angry with your boss?  It&#039;s natural to look for a shoulder to cry on, but you really shouldn&#039;t be sharing those sorts of details with just anyone.</p>
<p>There are <a href="http://www.lamebook.com/">entire web sites</a> devoted to making fun of people who posted private or embarrassing information for all their Facebook acquaintances to see.  If you&#039;re wise, you keep those sorts of things to yourself.</p>
<h2>You might want EVERYONE to know</h2>
<p>Maybe you added a hilarious caption to a picture of a cat &#8211; maybe you wrote an eloquent post exposing the truth about that one professor everybody likes.  There are some things that just need to be shared with the world, you know?</p>
<p>In the past, Facebook was not the place for such coolness &#8211; that witty status update would only ever be seen by people who knew you in some fashion.</p>
<h2>Not everyone cares</h2>
<p>My Facebook status updates are currently pulled straight from my Twitter feed.  I try to make posts that have some kernel of interest to people with similar interests to mine &#8211; even if they don&#039;t know me personally.</p>
<p>This results in a lot of status updates that are confusing or uninteresting to people who actually are my friends &#8211; my mother really doesn&#039;t care if I&#039;m looking for someone to play L4D2 with (let alone know what it stands for).</p>
<p>In the interest of keeping my status feeds accessible, I also avoid posting things with a limited appeal.  I could announce every new band I discovered, but few people would actually care.</p>
<p>As an aside, I&#039;ve noted that most Facebook users seem to have no concept of this &#8211; they post any update that occurs to them, regardless of how little I may care.  (The nerve of some people, right?)</p>
<h1>Facebook finally reflects reality</h1>
<p>If you&#039;re one of those responsible people who are conscious about your audience when you say things on the internet, Facebook is now a lot more attractive.  Now, everything you add on that site can be filtered based on whether or not you want certain people to see it.</p>
<p>Until now, these aforementioned responsible people have generally taken this content elsewhere &#8211; either to a public site, where people who are interested in your content voluntarily choose to follow it, or by taking their private conversations to email or private chats.</p>
<h1>It&#039;s especially important that certain information be public</h1>
<p>I don&#039;t personally care that my friend list is publicly available to anyone who writes an application that accesses Facebook &#8211; though on principle, I am annoyed that there is no option to keep that private.</p>
<p>I do understand why Facebook would want to make this sort of information available to outside sources, though.</p>
<h2>Other people can do useful things with that information</h2>
<p>Since it&#039;s popularity explosion, Twitter&#039;s web site has had a pretty small feature set.  You could make posts, pick people to follow, and access other people&#039;s posts and follow lists.  You could even pick some posts to be your favorite posts &#8211; but not a lot else.</p>
<p>But Twitter has become highly popular (particularly to the nerdy crowd), in part because:</p>
<ul>
<li>Almost all the information is public &#8211; very few people choose to make their profiles private</li>
<li>All of that public information is easily accessible to anyone</li>
</ul>
<p>Anyone can write a handy application or web site that does something cool with the information people put on Twitter.  You have access to things people have said, and the the things that they&#039;re interested in seeing.</p>
<p>If you&#039;re the sort of person who likes to derive a useful meaning from large quantities of information, Twitter is a dream come true.</p>
<p>I haven&#039;t looked into Facebook&#039;s API at all &#8211; I don&#039;t know how simple it is to access information as a programmer.  But as a developer, having access to more information instantly makes Facebook more attractive to me when I&#039;m looking to write an application to analyze the differences between high school cliques and college cliques (or whatever).</p>
<p>Facebook wants to be the definitive social network &#8211; but for some time, Twitter has been the most attractive place to get social networking data from.  I can see why Facebook wants to draw the line where they have, and I don&#039;t blame them.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/99/in-a-shocking-twist-im-interested-in-facebook-again/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recent big news: cops beat up gay people</title>
		<link>http://joshduff.com/39/recent-big-news-cops-beat-up-gay-people</link>
		<comments>http://joshduff.com/39/recent-big-news-cops-beat-up-gay-people#comments</comments>
		<pubDate>Wed, 01 Jul 2009 22:55:00 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Deeper thoughts]]></category>

		<guid isPermaLink="false">http://joshduff.com/http:/joshduff.com/39/recent-big-news-cops-beat-up-gay-people</guid>
		<description><![CDATA[The short story: a group of Fort Worth police officers went into a local gay bar, and started &#034;restraining&#034; and arresting people for being too intoxicated (side note: being too intoxicated inside a bar is illegal? aieeeeee&#8230;)
Anyways, the cops got pretty rough, and by all accounts were really getting into throwing people around (focusing entirely [...]]]></description>
			<content:encoded><![CDATA[<p>The short story: <a href="http://donttasemeblog.com/2009/06/police-raid-gay-bar-beating-an.html">a group of Fort Worth police officers went into a local gay bar, and started &#034;restraining&#034; and arresting people for being too intoxicated</a> (side note: being too intoxicated inside a bar is illegal? aieeeeee&#8230;)</p>
<p>Anyways, the cops got pretty rough, and by all accounts were really getting into throwing people around (focusing entirely on the males), and now one of the patrons is in a coma after some nasty head trauma.</p>
<p>The justification for their over-the-top violence is that they claim one of the officers was felt up by a  male patron. As if any rational man would risk offending an authority figure backed by friends with guns.  The owner of the bar noted: &#034;We&#039;re gay, not stupid.&#034;</p>
<p><a href="http://slog.thestranger.com/slog/archives/2009/06/30/fort-worth-police-chief-that-faggot-had-it-coming">Many people are getting really angry about this</a>, assuming that the police officers were prejudiced against homosexual males and took pleasure in harassing them.  And you know what, it&#039;s probably true.</p>
<p>But that&#039;s not why we should all be indignant &#8211; we should be angry because there are places in our country where &#034;peace officers&#034; believe they have the right to use violence against citizens with little or no provocation. And, for all intents and purposes, they do.</p>
<p>We&#039;ve given all the responsibility for upholding the law to a group of armed, uniformed human beings.  Human beings are not perfect.</p>
<p>Imagine officers bursting into the home of a homeschooling family, throwing parents to the ground, and taking children away.</p>
<p>Imagine police breaking up a prayer meeting and dragging people off to jail for zoning issues.</p>
<p>Handcuffing a group of inoffensive hippies on their way to pick up some munchies.</p>
<p>Detaining a group of Mexicans without reason on their way home from work.</p>
<p>We all have our prejudices and stereotypes of other groups of people &#8211; it&#039;s just that some of us have the power to punish other people with little or no repercussions.</p>
<p>How do you feel about it?</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/39/recent-big-news-cops-beat-up-gay-people/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>If life isn&#039;t fair, should we make laws to fix it?</title>
		<link>http://joshduff.com/38/if-life-isnt-fair-should-we-make-laws-to-fix-it</link>
		<comments>http://joshduff.com/38/if-life-isnt-fair-should-we-make-laws-to-fix-it#comments</comments>
		<pubDate>Mon, 12 Jan 2009 16:36:00 +0000</pubDate>
		<dc:creator>Josh</dc:creator>
				<category><![CDATA[Deeper thoughts]]></category>

		<guid isPermaLink="false">http://joshduff.com/http:/joshduff.com/38/if-life-isnt-fair-should-we-make-laws-to-fix-it</guid>
		<description><![CDATA[My views on Intellectual Property have undergone some pretty drastic changes recently.  Just a few years ago I was downloading MP3s because I wanted to listen to music, and I had a vague idea that the laws that made the downloading illegal were somehow flawed.
At this date, my ideas have a bit more form, [...]]]></description>
			<content:encoded><![CDATA[<p>My views on <a href="http://en.wikipedia.org/wiki/Intellectual_property">Intellectual Property</a> have undergone some pretty drastic changes recently.  Just a few years ago I was downloading MP3s because I wanted to listen to music, and I had a vague idea that the laws that made the downloading illegal were somehow flawed.</p>
<p>At this date, my ideas have a bit more form, though I can&#039;t promise that they won&#039;t be changing in the future.  I invite those with opinions on the subject to help me form mine.</p>
<p>There seems to be a lot of argument going on over <a href="http://www.techdirt.com/blog.php?tag=copyright">copyrights</a> (giving an author exclusive rights to their work), <a href="http://www.techdirt.com/blog.php?tag=trademark">trademarks</a> (giving someone exclusive rights to a name or distinguishing feature), and <a href="http://www.techdirt.com/blog.php?tag=patents">patents</a> (giving someone exclusive rights to an invention or process) recently.</p>
<p>This is important to me in part because I deal in intellectual property fairly often.  I&#039;m a programmer by day, and a musician by night (and often a programmer by night, as well).</p>
<p>I get paid to take ideas (often thought up by me) and implement them as software.  For entertainment, I often take ideas (thought up by someone who is a better composer than me) and implement them as tasty drum beats in a song.</p>
<p>It is also worth noting that I am of the opinion that if a law or government function is not biblically supportable (based on Biblical case laws), it does not need to exist.</p>
<p>My statements here are based in the idea (which, to the best of my knowledge, is biblically based) that the best type of market is a free market, of the laissez-faire variety.  The biblical basis for this statement is subject for other posts and books (and I&#039;m open to more reading material!).</p>
<p>A free market means a general lack of government regulation of products and services.  This would include products and services based on &#034;intellectual property,&#034; or ideas and information.</p>
<p>Intellectual property laws are a government giving exclusive rights on a concept or piece of data to an individual or business.  The traditional argument in favor of these laws is that without them, inventors and creators would be afraid to create anything for fear that their works might be plagiarized.</p>
<p>I do not think that this would be the case in a world where the government did not fight for some sort of special rights for creators or inventors.  However, more relevantly, I do not know of any biblical basis for these sorts of laws.</p>
<p>The closest thing to biblical support for IP laws that I have seen is people making a shaky connection from the <a href="http://www.biblegateway.com/passage/?search=Exodus%2020:15;&amp;version=50;">eighth commandment</a> (do not steal) to the concept of &#034;stealing ideas.&#034;</p>
<p>So if intellectual property laws are not biblically supportable, what are they doing?  They are doing the same thing that every other man-conceived law is doing: enforcing someone&#039;s idea of fairness on others.</p>
<p>We all benefit from the creative works of others &#8211; we enjoy useful technology and entertaining media every day.  We appreciate the advances that have come at the price of hard work from talented individuals.  Our blood boils when we hear of some smart man getting <a href="http://www.imdb.com/title/tt1054588/">cheated out of the fruits of his labors</a> by others who use his ideas.</p>
<p>Why do we feel this way?  Because we believe that somebody is getting less than they deserve, and that makes us righteously indignant.  We believe that inventors deserve, at the very least, a comfortable life and the ability to keep inventing if they wish to.  And we&#039;re willing to write laws that infringe on the rights of others (the right to create what you can with what you own) to try to make it happen.</p>
<p>God is the decider of what man deserves.  At most, man should concern itself with enforcing the civil law given to us by God.  When it comes to enforcing fairness, we tend to muck it up.</p>
]]></content:encoded>
			<wfw:commentRss>http://joshduff.com/38/if-life-isnt-fair-should-we-make-laws-to-fix-it/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
