<?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>Atomized &#187; wtf</title>
	<atom:link href="http://atomized.org/tag/wtf/feed/" rel="self" type="application/rss+xml" />
	<link>http://atomized.org</link>
	<description>Fragmenting reality.</description>
	<lastBuildDate>Mon, 23 May 2011 23:46:29 +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>Why I’m Not Switching Back To Linux Any Time Soon</title>
		<link>http://atomized.org/2010/03/why-i%e2%80%99m-not-switching-back-to-linux-any-time-soon/</link>
		<comments>http://atomized.org/2010/03/why-i%e2%80%99m-not-switching-back-to-linux-any-time-soon/#comments</comments>
		<pubDate>Fri, 12 Mar 2010 17:52:14 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[usability]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://atomized.org/?p=695</guid>
		<description><![CDATA[This is the updated Ubuntu File Browser: Fully 30% of the window height is administrative debris. There are ten arrow buttons. The window close control is directly above the Edit menu. Complexity is not your friend. Fitt’s Law is not your enemy.]]></description>
			<content:encoded><![CDATA[<p>This is the <a href="http://www.jonobacon.org/2010/03/03/refreshing-the-ubuntu-brand/">updated</a> Ubuntu File Browser:</p>
<p><a href="http://atomized.org/wp-content/uploads/2010/03/ubuntu-wtf.png"><img src="http://atomized.org/wp-content/uploads/2010/03/ubuntu-wtf.png" alt="" title="Ubuntu’s new file manager." width="658" height="455" class="aligncenter size-full wp-image-696" /></a></p>
<p>Fully 30% of the window height is <a href="http://tomayko.com/writings/administrative-debris">administrative debris</a>. There are <strong>ten arrow buttons</strong>. The window close control is <a href="http://yokozar.org/blog/archives/194">directly above the Edit menu</a>.</p>
<p>Complexity is not your friend. <a href="http://en.wikipedia.org/wiki/Fitt's_law">Fitt’s Law</a> is not your enemy.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomized.org/2010/03/why-i%e2%80%99m-not-switching-back-to-linux-any-time-soon/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>When lexical scoping attacks</title>
		<link>http://atomized.org/2009/06/when-lexical-scoping-attacks/</link>
		<comments>http://atomized.org/2009/06/when-lexical-scoping-attacks/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 21:30:34 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[scope]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://atomized.org/?p=574</guid>
		<description><![CDATA[Consider the following Python code: bar = [] def test(): new = ['this', 'comes', 'from', 'test'] bar.extend(new) print bar print bar test() print bar This code generates this output: [] ['this', 'comes', 'from', 'test'] ['this', 'comes', 'from', 'test'] Which is to say, bar is empty before test(), has the contents of new inside of test(), [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following Python code:</p>
<pre language="python">
bar = []
def test():
    new = ['this', 'comes', 'from', 'test']
    bar.extend(new)
    print bar

print bar
test()
print bar
</pre>
<p>This code generates this output:</p>
<pre>
[]
['this', 'comes', 'from', 'test']
['this', 'comes', 'from', 'test']
</pre>
<p>Which is to say, <code>bar</code> is empty before <code>test()</code>, has the contents of <code>new</code> inside of <code>test()</code>, and continues to have that value when <code>test()</code> returns.</p>
<p>Now, look at this code:</p>
<pre language="python">
bar = []
def test():
    new = ['this', 'comes', 'from', 'test']
    bar = new
    print bar

print bar
test()
print bar
</pre>
<p>Which outputs:</p>
<pre>
[]
['this', 'comes', 'from', 'test']
[]
</pre>
<p>The value of <code>bar</code> is only changed inside <code>test()</code>. Upon further reflection, I realized that the assignment was assigning a new local variable inside the <code>test()</code> scope, whereas accessing <code>bar</code> returns the variable from the outer scope, which is then modified.</p>
<p>This behavior doesn’t make a whole lot of sense to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomized.org/2009/06/when-lexical-scoping-attacks/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Continues to Amaze Me</title>
		<link>http://atomized.org/2009/03/php-continues-to-amaze-me/</link>
		<comments>http://atomized.org/2009/03/php-continues-to-amaze-me/#comments</comments>
		<pubDate>Wed, 11 Mar 2009 21:10:57 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[broken]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://atomized.org/?p=520</guid>
		<description><![CDATA[I don’t know what it is, but I just keep finding new and interesting ways to break PHP. Consider: $db = new PDO('sqlite::memory:'); $stmt = $db-&#62;query('SELECT 1;'); $stmt-&#62;setFetchMode(PDO::FETCH_LAZY); $row = $stmt-&#62;fetch(); $class = get_class($row); // = "PDORow" var_dump($row instanceof $class) // false! What the hell. The object isn’t an instance of the class you just [...]]]></description>
			<content:encoded><![CDATA[<p>I don’t know what it is, but I just keep finding new and interesting ways to break PHP. Consider:</p>
<pre language="php">
$db = new PDO('sqlite::memory:');
$stmt = $db-&gt;query('SELECT 1;');
$stmt-&gt;setFetchMode(PDO::FETCH_LAZY);
$row = $stmt-&gt;fetch();

$class = get_class($row);        // = "PDORow"
var_dump($row instanceof $class) // false!
</pre>
<p>What the hell. The object isn’t an instance of the class <i>you just told me it was an instance of?</i></p>
<p>Or this lovely code I ran the other day, which crashes PHP:</p>
<pre language="php">
class Yippee extends AppendIterator {
    public function __construct() {}
}
$yip = new Yippee;
$yip-&gt;rewind();
</pre>
<p>This will crash PHP with a segfault (on Linux) or a bus error (on OS X). Awesome.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomized.org/2009/03/php-continues-to-amaze-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>More tough love from PHP</title>
		<link>http://atomized.org/2008/11/more-tough-love-from-php/</link>
		<comments>http://atomized.org/2008/11/more-tough-love-from-php/#comments</comments>
		<pubDate>Mon, 03 Nov 2008 22:28:47 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://atomized.org/?p=392</guid>
		<description><![CDATA[Consider the following: class Foo { private $var = 'avalue'; private function doStuff() { } } As you might expect, you can’t access $var or doStuff() from outside Foo, which is well and good. However, things get strange when you throw overloading into the mix. class Foo { private $var = 'avalue'; private function doStuff() [...]]]></description>
			<content:encoded><![CDATA[<p>Consider the following:</p>
<pre>
class Foo
{
    private $var = 'avalue';
    private function doStuff()
    {
    }
}
</pre>
<p>As you might expect, you can’t access <code>$var</code> or <code>doStuff()</code> from outside <code>Foo</code>, which is well and good. However, things get strange when you throw overloading into the mix.</p>
<pre>
class Foo
{
    private $var = 'avalue';
    private function doStuff()
    {
    }
    public function __get($var)
    {
        return $this-&gt;$var;
    }
}

$foo = new Foo;
var_dump($foo-&gt;var);
</pre>
<p>This works; if a variable isn’t accessible from the calling scope, it will invoke <code>__get()</code> instead. Too bad it’s not consistent:</p>
<pre>
class Foo
{
    private $var = 'avalue';
    private function doStuff()
    {
    }
    public function __get($var)
    {
        return $this-&gt;$var;
    }
    public function __call($func, array $args = array())
    {
        return call_user_func_array(array($this, $func), $args);
    }
}

$foo = new Foo;
var_dump($foo-&gt;doStuff());
</pre>
<p>This breaks with: “Fatal error: Call to private method Foo::doStuff() from context &#8221;.”</p>
<p>It would be <i>really</i> nice if PHP followed the same rules for overloaded methods as for overloaded variables.</p>
]]></content:encoded>
			<wfw:commentRss>http://atomized.org/2008/11/more-tough-love-from-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>iDisk inconsistency</title>
		<link>http://atomized.org/2008/04/idisk-inconsistency/</link>
		<comments>http://atomized.org/2008/04/idisk-inconsistency/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 22:46:39 +0000</pubDate>
		<dc:creator>Ian</dc:creator>
				<category><![CDATA[Apple]]></category>
		<category><![CDATA[dotmac]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://atomized.org/?p=250</guid>
		<description><![CDATA[I may have mentioned this before, but iDisk is strangely inconsistent when you switch it to Sync (offline) mode. In the normal (online) mode, the icon on your desktop is called “iDisk.” When you switch it to offline mode, it’s name changes to your .Mac username– “ieure” in my case. It’s weird and frustrating, and [...]]]></description>
			<content:encoded><![CDATA[<p>I may have mentioned this before, but iDisk is strangely inconsistent when you switch it to Sync (offline) mode. In the normal (online) mode, the icon on your desktop is called “iDisk.” When you switch it to offline mode, it’s name changes to your .Mac username– “ieure” in my case.</p>
<p>It’s weird and frustrating, and I wish it wouldn’t do that. Some of the consequences of this:</p>
<ol>
<li>OS X shares your home directory and all attached disks if you enable AFP. For some reason, the iDisk’s name takes precedence – the “ieure” share on my laptop is my iDisk, while “ieure_homeDir” is my home directory. Worse, if you toggle between the two modes, the name of your home directory share changes with it.</li>
<li>The path isn’t consistent. So if you have a link from your real disk to your iDisk, then change modes, your links break.</li>
<li>If you mount another share which has the same name as your username, such as a home directory on another machine (without offline iDisk), or a private directory on an AirDisk, the name gets a numeral appended. Perhaps a minor quibble, nonetheless irritating.</li>
</ol>
<p>I’m sure the mount point has to be defined somewhere, but I don’t know where. Anyone?</p>
]]></content:encoded>
			<wfw:commentRss>http://atomized.org/2008/04/idisk-inconsistency/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

