<?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>porges &#187; Broken</title>
	<atom:link href="http://porg.es/blog/tag/broken/feed" rel="self" type="application/rss+xml" />
	<link>http://porg.es/blog</link>
	<description>... master of none</description>
	<lastBuildDate>Sat, 12 Sep 2009 07:57:51 +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>NullPointerException</title>
		<link>http://porg.es/blog/nullpointerexception</link>
		<comments>http://porg.es/blog/nullpointerexception#comments</comments>
		<pubDate>Thu, 24 May 2007 21:26:41 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Broken]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Critique]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Haskell]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Thought]]></category>
		<category><![CDATA[Types]]></category>

		<guid isPermaLink="false">http://porg.es/blog/nullpointerexception</guid>
		<description><![CDATA[Why is this such an insidious error in Java? (An opinion piece!) A Comparison Firstly, I&#8217;ll show a short comparison between some Java code and some code from a language that doesn&#8217;t have NullPointerExceptions, but does have something that allows you to accomplish anything you might want to do with null pointers. This Java code: [...]]]></description>
			<content:encoded><![CDATA[<p>Why is this such an insidious error in Java? (An opinion piece!)</p>
<h3>A Comparison</h3>
<p>Firstly, I&#8217;ll show a short comparison between some Java code and some code from a language that doesn&#8217;t have <code>NullPointerException</code>s, but does have something that allows you to accomplish anything you might want to do with null pointers.</p>
<p>This Java code:</p>
<pre><code>AnObject thing = someMethod();</code></pre>
<p>is equivalent to the following Haskell:</p>
<pre><code>let thing = Maybe AnObject</code></pre>
<p>That is, every Java object reference is possibly null. What this means is that (using the type notation mentioned in earlier posts) every Java reference has the type:</p>
<p><img src='/blog/wp-content/plugins/latexrender/pictures/80c7aa7402953bdabc5fcf23a7a9b406.gif' title='ObjectReference[Object] = 1 + Object' alt='ObjectReference[Object] = 1 + Object' align=absmiddle></p>
<p><small>(Every object reference for an object is either to &#8216;null&#8217; (<abbr title="also known as">AKA</abbr> &#8216;unit&#8217; or &#8216;singleton&#8217<img src="http://porg.es/blog/wp-content/plugins/wp-smiley-switcher/noktahhitam/icon_wink.gif" alt="" />, or the object itself.)</small></p>
<p>&#8230; and when you&#8217;re dealing with so many objects—Java is, after all, an object-oriented language, so (almost) everything is an object—this simple little &#8220;+1&#8243; gets lost easily.</p>
<h3>Why so bad?</h3>
<p>This wouldn&#8217;t seem to be such a big deal, but when contrasted against Java&#8217;s penchant for making things (sometimes painfully) explicit—think <code>public static void main (string argh!)</code>—a small, implicit item like this is easily overlooked. Conversely, one might say that the verbosity of Java <em>increases</em> the cognitive load of understanding its code; thus helping the chances of a small mistake like this sneaking through.</p>
<p>Either way, I think I can say that this is objectively A Bad Thing. C# has gone some of the way to a &#8216;correct&#8217; solution in its introduction of possibly-null primitives, which are explicitly marked with a <code>?</code> (such as <code>int?</code>), but unfortunately this hasn&#8217;t been &#8216;back-ported&#8217; to the rest of the language. If one were able to force between possibly-null and definitely-not-null references in C#—perhaps by the analogous <code>object?</code> vs. <code>object</code>, this would help to reduce the number of errors &#8216;hidden&#8217; by the syntax.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/nullpointerexception/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to say nothing</title>
		<link>http://porg.es/blog/how-to-say-nothing</link>
		<comments>http://porg.es/blog/how-to-say-nothing#comments</comments>
		<pubDate>Sat, 14 Apr 2007 23:36:34 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Broken]]></category>
		<category><![CDATA[Critique]]></category>
		<category><![CDATA[Enterprisey]]></category>

		<guid isPermaLink="false">http://porg.es/blog/how-to-say-nothing</guid>
		<description><![CDATA[Has no one told the people behind the Workflow Management Coalition that April Fool&#8217;s passed over two weeks ago? Intrigued at what I first thought was a joke, I downloaded one of the proudly-presented documents on the front page: Understanding the BPMN-XPDL-BPEL value chain. I chose it because of the three as-yet-unknown acronyms in the [...]]]></description>
			<content:encoded><![CDATA[<p>Has no one told the people behind the <a href="http://www.wfmc.org">Workflow Management Coalition</a> that April Fool&#8217;s passed over two weeks ago?</p>
<p>Intrigued at what I first thought was a joke, I downloaded one of the proudly-presented documents on the front page: <a href="http://www.wfmc.org/documents/palmer.BIJ.nov-dec06.pdf"><i>Understanding the BPMN-XPDL-BPEL value chain</i></a>. I chose it because of the three as-yet-unknown acronyms in the title&#8230; and I wasn&#8217;t disappointed.</p>
<p><span id="more-98"></span></p>
<p>I present you with the following gem, lifted from one paragraph of the article:</p>
<blockquote><p>Several BPM engines are able to run XPDL natively, which allows run-time modification and process migration to be readily supported. Where these processes focus on broader-scope collaboration among people, they can remain within XPDL/BPMN. Where pieces are decomposed into system-to-system interactions, these can be translated to BPEL for transmission to an EAI-oriented BPM engine. These are three very different and very compatible roles. But that’s the nature of the value chain—BPEL and XPDL are entirely different things for entirely different purposes.</p></blockquote>
<p>I suppose the warning sign should have been their slogan:</p>
<blockquote><p>Process Thought Leadership™</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/how-to-say-nothing/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Easy, persistent, local DNS cache to reduce lookup times</title>
		<link>http://porg.es/blog/easy-persistent-local-dns-cache-to-reduce-lookup-times-2</link>
		<comments>http://porg.es/blog/easy-persistent-local-dns-cache-to-reduce-lookup-times-2#comments</comments>
		<pubDate>Thu, 05 Oct 2006 02:26:15 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Broken]]></category>
		<category><![CDATA[Cool]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Reference]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://porg.es/blog/easy-persistent-local-dns-cache-to-reduce-lookup-times-2</guid>
		<description><![CDATA[Important Update! Don&#8217;t use this method any more! I have a much easier way to do it in a more recent post. But for posterity&#8230; First install resolvconf and pdnsd: sudo apt-get install pdnsd resolvconf. Resolvconf handles the messy interaction between different programs fighting over the /etc/resolv.conf file, and pdnsd provides a persistent DNS daemon, [...]]]></description>
			<content:encoded><![CDATA[<h3>Important Update!</h3>
<p>Don&#8217;t use this method any more! I have a much easier way to do it in a <a href="http://porg.es/blog/easier-local-dns-cache">more recent post</a>.</p>
<h3>But for posterity&#8230;</h3>
<p>First install resolvconf and pdnsd: <code>sudo apt-get install pdnsd resolvconf</code>. Resolvconf handles the messy interaction between different programs fighting over the <code>/etc/resolv.conf</code> file, and pdnsd provides a <b>p</b>ersistent <b>DNS</b> <b>d</b>aemon, which will cache the DNS lookups on your machine in order to make browsing faster.</p>
<p>Next, you just need to edit pdnsd&#8217;s configuration file, <code>/etc/pdnsd.conf</code> as root. Edit it to look like this:</p>
<pre><code>global {
        perm_cache=512;
        cache_dir="/var/cache/pdnsd";
        max_ttl=604800;
        run_as="pdnsd";
        paranoid=on;
#       next setting allows ppp/ip-up update the name servers -- ABa / 20040213
        status_ctl=on;
        server_port=53;
        server_ip="127.0.0.1";
}

#Edit these to be your own servers if wished:
server {
        label = "OpenDNS";
        ip=208.67.222.222,208.67.220.220;
        proxy_only=on;
        timeout=10;
}

# if you installed resolvconf, and status_ctl=on
server {
    label="resolvconf";
}

source {
        ttl=86400;
        owner="localhost.";
#       serve_aliases=on;
        file="/etc/hosts";
}</pre>
<p></code></p>
<p>And finally, restart pdnsd with <code>sudo /etc/init.d/pdnsd restart</code> to use the new settings. In the example above, I've used OpenDNS's servers, but you can change these to whatever you want. As far as actual results go:</p>
<blockquote><p><code>~$ dig example.com</p>
<p>; <<>> DiG 9.3.2 <<>> example.com<br />
;; global options:  printcmd<br />
;; Got answer:<br />
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 17447<br />
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0</p>
<p>;; QUESTION SECTION:<br />
;example.com.                   IN      A</p>
<p>;; ANSWER SECTION:<br />
example.com.            172800  IN      A       192.0.34.166</p>
<p><b>;; Query time: 513 msec</b><br />
;; SERVER: 127.0.0.1#53(127.0.0.1)<br />
;; WHEN: Thu Oct  5 15:24:19 2006<br />
;; MSG SIZE  rcvd: 45</p>
<p>$ dig example.com</p>
<p>; <<>> DiG 9.3.2 <<>> example.com<br />
;; global options:  printcmd<br />
;; Got answer:<br />
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19338<br />
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0</p>
<p>;; QUESTION SECTION:<br />
;example.com.                   IN      A</p>
<p>;; ANSWER SECTION:<br />
example.com.            172799  IN      A       192.0.34.166</p>
<p><b>;; Query time: 0 msec</b><br />
;; SERVER: 127.0.0.1#53(127.0.0.1)<br />
;; WHEN: Thu Oct  5 15:24:20 2006<br />
;; MSG SIZE  rcvd: 45<br />
</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/easy-persistent-local-dns-cache-to-reduce-lookup-times-2/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Unicode breaks Google search</title>
		<link>http://porg.es/blog/unicode-breaks-google-search</link>
		<comments>http://porg.es/blog/unicode-breaks-google-search#comments</comments>
		<pubDate>Mon, 26 Jun 2006 02:08:19 +0000</pubDate>
		<dc:creator>Porges</dc:creator>
				<category><![CDATA[Broken]]></category>
		<category><![CDATA[Critique]]></category>
		<category><![CDATA[Unicode]]></category>

		<guid isPermaLink="false">http://porg.es/blog/unicode-breaks-google-search</guid>
		<description><![CDATA[A search for the phrase &#34;It’s like a light of a new day,&#34; breaks in more than one way. Not only does Google search fail to recognize that &#8220;it&#8217;s&#8221; is a word, it also ignores the quote marks, searching for the phrase as individual words.]]></description>
			<content:encoded><![CDATA[<p>A <a href="http://www.google.com/search?q=%22It%E2%80%99s+like+a+light+of+a+new+day%2C%22&#038;start=0&#038;ie=utf-8&#038;oe=utf-8&#038;client=firefox&#038;rls=org.mozilla:en-US:unofficial">search for the phrase &quot;It’s like a light of a new day,&quot;</a> breaks in more than one way.</p>
<p>Not only does Google search fail to recognize that &#8220;it&#8217;s&#8221; is a word, it also ignores the quote marks, searching for the phrase as individual words.</p>
]]></content:encoded>
			<wfw:commentRss>http://porg.es/blog/unicode-breaks-google-search/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
