<?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>Fugato &#187; Tech</title>
	<atom:link href="http://fugato.net/category/tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://fugato.net</link>
	<description>Gunnlaugur Þór Briem</description>
	<lastBuildDate>Tue, 01 May 2012 13:18:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Mac display glitch in bright-white areas: color profile workaround</title>
		<link>http://fugato.net/2012/04/23/mac-display-glitch-in-bright-white-areas-color-profile-workaround/</link>
		<comments>http://fugato.net/2012/04/23/mac-display-glitch-in-bright-white-areas-color-profile-workaround/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 11:20:34 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Mac]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://fugato.net/?p=698</guid>
		<description><![CDATA[My MacBook Pro display started malfunctioning yesterday, exhibiting flickering vertical cyan stripes in all bright-white areas, and flickering red in pitch-black areas. This doesn&#8217;t go away on reboot, and happens on the laptop screen itself and not on external monitors. So probably a hardware failure. I&#8217;ll get it repaired, of course, but in the meantime [...]]]></description>
			<content:encoded><![CDATA[<p><!-- Is this thing still on? --></p>
<p>My MacBook Pro display started malfunctioning yesterday, exhibiting flickering vertical cyan stripes in all bright-white areas, and flickering red in pitch-black areas. This doesn&#8217;t go away on reboot, and happens on the laptop screen itself and not on external monitors. So probably a hardware failure.</p>
<p>I&#8217;ll get it repaired, of course, but in the meantime I have a workaround: I tweaked the color profile so that the brightest RGB values map to only 96.5% of the display&#8217;s full physical brightness, and the darkest to 3% instead of 0%. Works like a charm for me. If your machine is out of warranty, you might prefer this to an expensive repair job (assuming your display problem also affects only brightest-white and darkest-black areas).</p>
<p>Cons: this makes the display a little bit less bright and contrasty, and <em>might</em> cause color hue shifts perceptible to someone more chromatically delicate than me.</p>
<p>Here&#8217;s <a href="/wp-content/uploads/2012/04/GulliHack.icc">the tweaked color profile</a> (no warranty implied, may eat your computer alive, I am not liable, etc.). To try it out:</p>
<ol>
<li>download this file and put it in <code>/Library/ColorSync/Profiles/Displays</code></li>
<li>open System Preferences → Displays → Color</li>
<li>select the “GulliHack” display profile</li>
</ol>
<p>If the above steps do not seem easy to you, get someone technically minded to help.</p>
<p>How I made this (for the technically minded):</p>
<ol>
<li>Download <a href="/wp-content/uploads/2012/04/remapcolorprofile.py">remapcolorprofile.py</a>. This reads a hex dump of a brightness curve as expressed in ICC files, snips off the top end of the curve, and linearly interpolates the remainder to the original number of values, maintaining its overall shape.</li>
<li>In <code>/Library/ColorSync/Profiles/Displays</code>, find the default color profile for your laptop screen (on my machine the filename is <code>Color LCD-00000610-0000-A005-0000-000004280140.icc</code> on my machine) and copy it to another file.</li>
<li>Open <em>that</em> file in a hex editor, such as <a href="http://www.suavetech.com/0xed/0xed.html">0xED</a>.</li>
<li>Find the token <code>vcgt</code> (<code>0x76636774</code>) in this file. It appears in two places; go to the second (for me it was at offset 0x0A88).</li>
<li>18 bytes on from that, find a 512-byte long sequence of two-byte words, starting with <code>0x0000</code> and ending with <code>0xFFFF</code>. Select that (make sure you got exactly 512 bytes; bottom right of the window should show “Selection: 200”) and copy.</li>
<li>Run this in a terminal: <code>pbpaste | python remapcolorprofile.py 0.03 0.965 | pbcopy</code> (your particular problem may call for a different proportion; I tried a few and 3% and 96.5% were just right for my problem).</li>
<li>Go back to your hex editor and paste (making sure the “Write Mode” is “Overwrite”, not “Insert”). Make sure the length didn&#8217;t change.</li>
<li>Do the same for the next two 512-byte sequences (there&#8217;s one sequence for each primary color).</li>
<li>Save, and try out the color profile.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2012/04/23/mac-display-glitch-in-bright-white-areas-color-profile-workaround/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When in ROM &#8230;</title>
		<link>http://fugato.net/2007/09/10/when-in-rom/</link>
		<comments>http://fugato.net/2007/09/10/when-in-rom/#comments</comments>
		<pubDate>Mon, 10 Sep 2007 18:22:11 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Amusing]]></category>
		<category><![CDATA[Oops]]></category>
		<category><![CDATA[Sarcasm]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/09/10/when-in-rom/</guid>
		<description><![CDATA[Sales blurb for the HTC P3600 mobile phone: „Process applications faster and store more data with 256MB internal ROM &#8230;“]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.europe.htc.com/en/products/htcp6300.html">Sales blurb for the HTC P3600 mobile phone</a>:</p>
<blockquote><p>„Process applications faster and store more data with 256MB internal ROM &#8230;“</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/09/10/when-in-rom/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>project.ioni.st playli.st</title>
		<link>http://fugato.net/2007/05/28/projectionist-playlist/</link>
		<comments>http://fugato.net/2007/05/28/projectionist-playlist/#comments</comments>
		<pubDate>Mon, 28 May 2007 04:25:02 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Music]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Yum]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/05/28/projectionist-playlist/</guid>
		<description><![CDATA[Consolidated supply of music picked by project.ioni.st, that discriminating bastion of good taste: project.ioni.st.m3u (Yes, this will stay up-to-date.)]]></description>
			<content:encoded><![CDATA[<p>Consolidated supply of music picked by <a href="http://project.ioni.st/">project.ioni.st</a>, that discriminating bastion of good taste:</p>
<p><a href="/project.ioni.st.m3u" style="font-weight: bold; font-size: 140%;">project.ioni.st.m3u</a></p>
<p>(Yes, this will stay up-to-date.)</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/05/28/projectionist-playlist/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Diffing at 37,000 feet</title>
		<link>http://fugato.net/2007/04/18/diffing-at-37000-feet/</link>
		<comments>http://fugato.net/2007/04/18/diffing-at-37000-feet/#comments</comments>
		<pubDate>Wed, 18 Apr 2007 11:37:14 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Rant]]></category>
		<category><![CDATA[Team Foundation]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/04/18/diffing-at-37000-feet/</guid>
		<description><![CDATA[A brief feature comparison: in mid-flight I am impertinent enough to want to diff my checked-out code to see the changes I have made. Under (the free-of-charge and open-source) Subversion, that would have been &#8220;Sure, here you go.&#8221; Under (the $3,000 proprietary) Team Foundation Server, it is &#8220;be thankful I&#8217;m letting you work at all. [...]]]></description>
			<content:encoded><![CDATA[<p>A brief feature comparison: in mid-flight I am impertinent enough to want to diff my checked-out code to see the changes I have made.</p>
<p>Under (the free-of-charge and open-source) Subversion, that would have been &#8220;Sure, here you go.&#8221;</p>
<p>Under (the $3,000 proprietary) Team Foundation Server, it is &#8220;be thankful I&#8217;m letting you work at all. And when you get online, go download a separate utility and ask it politely to sort out which files you have changed.&#8221;</p>
<p>And here I was trying to break the rant habit. Dagnabbit!</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/04/18/diffing-at-37000-feet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reinventing The Wheel</title>
		<link>http://fugato.net/2007/04/10/reinventing-the-wheel/</link>
		<comments>http://fugato.net/2007/04/10/reinventing-the-wheel/#comments</comments>
		<pubDate>Tue, 10 Apr 2007 10:30:04 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Amusing]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/04/10/reinventing-the-wheel/</guid>
		<description><![CDATA[There are two rules of paramount importance in engineering innovation. never reinvent the wheel. always break the rules. So I guess this was only a matter of time. Presenting: TheWheel™.]]></description>
			<content:encoded><![CDATA[<p>There are two rules of paramount importance in engineering innovation.</p>
<ol>
<li>never reinvent the wheel.</li>
<li>always break the rules.</li>
</ol>
<p>So I guess this was only a matter of time. Presenting: <a href="http://www.e-traction.com/TheWheel.htm">TheWheel™</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/04/10/reinventing-the-wheel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Ayende retort</title>
		<link>http://fugato.net/2007/03/30/the-ayende-retort/</link>
		<comments>http://fugato.net/2007/03/30/the-ayende-retort/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 11:27:19 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[People]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/03/30/the-ayende-retort/</guid>
		<description><![CDATA[When you hear from software people (e.g. from yourself) things like &#8220;I don&#8217;t have time&#8221; or &#8220;it&#8217;s too much work&#8221;, there is a single-word slapdown response. Ayende. 2.07 posts a day on average over the last three years, mostly high-value software stuff. At the same time, he spews out useful, robust software. That&#8217;s all on [...]]]></description>
			<content:encoded><![CDATA[<p>When you hear from software people (e.g. from yourself) things like &#8220;I don&#8217;t have time&#8221; or &#8220;it&#8217;s too much work&#8221;, there is a single-word slapdown response.</p>
<p><a href="http://ayende.com/">Ayende</a>.</p>
<p>2.07 posts a day on average over the last three years, mostly high-value software stuff. At the same time, he spews out <a href="http://www.ayende.com/projects/projects.aspx">useful, robust software</a>. That&#8217;s all on top of his day job. And apparently he reads a lot.</p>
<p>Personally I suspect Ayende is a five-person software company masquerading as a single person. Even then he is not doing too badly.</p>
<p>The obvious question: how does he do this?</p>
<p>The <em>useful</em> question: why aren&#8217;t <em>you</em> doing it?</p>
<p>(Ouch.)</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/03/30/the-ayende-retort/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>In·sha&#8217;·Allah·tion</title>
		<link>http://fugato.net/2007/03/19/in-sha-allah-tion/</link>
		<comments>http://fugato.net/2007/03/19/in-sha-allah-tion/#comments</comments>
		<pubDate>Mon, 19 Mar 2007 11:23:40 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Coinage]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/03/19/in-sha-allah-tion/</guid>
		<description><![CDATA[In·shaʾ·Allah·tion (ĭn&#8217;shä-lä&#8217;shən) n. A software installation/upgrade performed as a leap of faith in the irrational hope that it might make things less terrible. [From Arabic in šaʾ Allāh (إن شاء الله), “God willing”]]]></description>
			<content:encoded><![CDATA[<div class="floatright" style="float: right; padding-left: 20px; width: 250px;"><a href='http://fugato.net/2007/03/19/in-sha-allah-tion/the-everlasting-miracle/' rel='attachment wp-att-430' title='The Everlasting Miracle'><img src='http://fugato.net/wp-content/uploads/2007/03/the-everlasting-miracle.jpg' alt='The Everlasting Miracle' /></a></div>
<dl>
<dt style="text-decoration: none;"><span style="text-decoration: underline;">In·shaʾ·Allah·tion</span> (ĭn&#8217;shä-lä&#8217;shən)</dt>
<dd>
<p style="margin: 0.2em 0 0.2em -1.7em;">n.</p>
<p style="margin-top: 0.2em;">A <a href="http://fugato.net/2006/12/15/moores-law-premier-partner-edition-for-software-developers-enu-service-pack-1-rtm/">software installation/upgrade</a> performed as a leap of faith in the irrational hope that it might make things less terrible.</p>
<p>[From Arabic <a href="http://en.wikipedia.org/wiki/Insha%27Allah"><em>in šaʾ Allāh</em> (إن شاء الله)</a>, “God willing”]</p>
</dd>
</dl>
<div style="clear: right;"></div>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/03/19/in-sha-allah-tion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>TeamCity: sgen.exe exited with code 1 because of C++ DLL</title>
		<link>http://fugato.net/2007/02/26/teamcity-sgen-exe-failed-with-error-code-1-because-of-cplusplus-dll/</link>
		<comments>http://fugato.net/2007/02/26/teamcity-sgen-exe-failed-with-error-code-1-because-of-cplusplus-dll/#comments</comments>
		<pubDate>Mon, 26 Feb 2007 13:37:28 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/02/26/teamcity-sgen-exe-failed-with-error-code-1-because-of-cplusplus-dll/</guid>
		<description><![CDATA[On our experimental TeamCity build machine, a build was failing in Release configuration (but not in Debug configuration) with the message: "sgen.exe" exited with code 1. The same project was building just fine on developer machines. Googling the failure message turned up some pages suggesting a sledgehammer fix: disable &#8220;Generate Serialization Assembly&#8221; in the project [...]]]></description>
			<content:encoded><![CDATA[<p>On our experimental <a href="http://www.jetbrains.com/teamcity/">TeamCity</a> build machine, a build was failing in Release configuration (but not in Debug configuration) with the message:</p>
<blockquote><p><code style="margin: 0px;">"sgen.exe" exited with code 1.</code></p></blockquote>
<p>The same project was building just fine on developer machines.</p>
<p>Googling the failure message turned up some pages suggesting a sledgehammer fix: disable &#8220;Generate Serialization Assembly&#8221; in the project file. But disabling something that may be valuable seems a little drastic just to appease a finicky build machine.</p>
<p>A better approach starts (as it always does) with getting more information about the failure. In TeamCity&#8217;s &#8220;All messages&#8221; view:</p>
<blockquote><p><code>- This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem. (Exception from HRESULT: 0x800736B1)</code></p>
<p><code>If you would like more help, please type "sgen /?".<br />
"sgen.exe" exited with code 1.</code></p>
</blockquote>
<p>This yields the eminently googleable HRESULT 0x800736B1, which led to a couple of <a href="http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=1240807&#038;SiteID=1">pages</a> pinpointing the problem:</p>
<ul>
<li>the project references a DLL that depends on the C++ runtime library</li>
<li><code>sgen.exe</code> needs to load referenced DLLs</li>
<li>loading a C++ DLL causes it to load the C++ runtime</li>
<li>The C++ runtime exists on my machine because it has Visual Studio installed; the build machine doesn&#8217;t.</li>
</ul>
<p><strong>Solution</strong>: install <a href="http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&#038;displaylang=en"><code>vcredist_x86</code></a>. The build is now fine.</p>
<p>I&#8217;m quite excited about TeamCity; go check out <a href="http://www.jetbrains.net/confluence/display/TW/TeamCity+EAP">their early access program!</a></p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/02/26/teamcity-sgen-exe-failed-with-error-code-1-because-of-cplusplus-dll/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The incomprehensible failure of disco</title>
		<link>http://fugato.net/2007/02/22/the-incomprehensible-failure-of-disco/</link>
		<comments>http://fugato.net/2007/02/22/the-incomprehensible-failure-of-disco/#comments</comments>
		<pubDate>Thu, 22 Feb 2007 13:00:24 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/02/22/the-incomprehensible-failure-of-disco/</guid>
		<description><![CDATA[Suddenly my MSBuild fails because somebody deleted Reference.cs and there&#8217;s only a Reference.map in the Web References\LT folder. So I try changing the reference&#8217;s URL Behavior from Dynamic to Static (just to make any change, to see if Visual Studio regenerates Reference.cs). That yields the error dialog pictured here. Pop quiz, hotshot: what is the [...]]]></description>
			<content:encoded><![CDATA[<p><img class="floatright" style="float: right; padding-left: 20px; padding-bottom: 20px;" src='http://fugato.net/wp-content/uploads/2007/02/disco-failed.png' alt='Disco failed' /></p>
<p>Suddenly my MSBuild fails because somebody deleted <code>Reference.cs</code> and there&#8217;s only a <code>Reference.map</code> in the <code>Web References\LT</code> folder.</p>
<p>So I try changing the reference&#8217;s URL Behavior from Dynamic to Static (just to make <em>any</em> change, to see if Visual Studio regenerates <code>Reference.cs</code>). That yields the error dialog pictured here.</p>
<p>Pop quiz, hotshot: what is the difference between OK and Cancel in this dialog?</p>
<p>None, apparently. I click OK and the property does change to Static. When I repeat the experiment, this time clicking Cancel, the property also changes to Static. Don&#8217;t know what else might be happening behind this error dialog &#8230;</p>
<p>&#8230; and that&#8217;s exactly the point. Where, pray tell, should I go to troubleshoot this error?</p>
<p>Well, silly, I&#8217;m a tech guy. I should figure it out for myself, rather than expect my tools to make it easy to find. Which brings me to my next question &#8230;</p>
<p>&#8230; how much did we pay for this IDE again?</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/02/22/the-incomprehensible-failure-of-disco/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Null coalescing and value type boxing</title>
		<link>http://fugato.net/2007/02/14/null-coalescing-and-value-type-boxing/</link>
		<comments>http://fugato.net/2007/02/14/null-coalescing-and-value-type-boxing/#comments</comments>
		<pubDate>Wed, 14 Feb 2007 00:00:55 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/02/14/null-coalescing-and-value-type-boxing/</guid>
		<description><![CDATA[Try calling this with a null argument. public double AndCastYeHimIntoAnInt(object o) { return (int) (o ?? 0); } It works as you would expect; returns 0.0 (implicitly cast from the integer 0). But we like our casts explicit, so now try this: public double AndCastYeHimIntoADouble(object o) { return (double) (o ?? 0); } Woe is [...]]]></description>
			<content:encoded><![CDATA[<p>Try calling this with a null argument.</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">double</span> AndCastYeHimIntoAnInt(<span class="kwrd">object</span> o)
{
    <span class="kwrd">return</span> (<span class="kwrd">int</span>) (o ?? 0);
}
</pre>
<p>It works as you would expect; returns <code>0.0</code> (implicitly cast from the integer <code>0</code>).</p>
<p>But we like our casts explicit, so now try this:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">double</span> AndCastYeHimIntoADouble(<span class="kwrd">object</span> o)
{
    <span class="kwrd">return</span> (<span class="kwrd">double</span>) (o ?? 0);
}
</pre>
<p>Woe is me; this fails with an <code>InvalidCastException</code> saying &#8220;Specified cast is not valid.&#8221;</p>
<p>But heavens, surely the integer zero can be cast to a <code>double</code>? For verily, <code>(double)0</code> works just fine, and a debugger verifies that that <code>(o ?? 0)</code> indeed evaluates to the integer <code>0</code>.</p>
<p>But put a watch on <code>(double) (o ?? 0)</code> and quoth the debugger: &#8220;Cannot unbox &apos;<code>o ?? 0</code>&apos; as a &apos;<code>double</code>&apos;&#8221;.</p>
<p>And lo, lift up now thine eyes and place a watch on <code>(o ?? 0).GetType()</code> and it shall prove to be the <code>struct</code> type <code>System.Int32</code>, a <em>boxed</em> integer, and <em>that</em> cannot be cast to a <code>double</code>.</p>
<p>It is a boxed integer <span class="deemph">unto the LORD</span>, because the compile-time type of the expression must be <code>object</code>, the only type to which both <code>object</code> and <code>int</code> have an implicit conversion.</p>
<p>But why does a boxed integer not convert to <del class="deemph" datetime="2007-02-13T23:32:27+00:00">Judaism</del>&nbsp;<code>double</code> in the obvious way, by unboxing to <code>int</code> and then implicitly converting to <code>double</code>? Probably because supporting that would require extra work at runtime for every unboxing conversion.</p>
<p>With few exceptions, value-type boxing can be ignored. This is one of those exceptions.</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/02/14/null-coalescing-and-value-type-boxing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Setting your sights low</title>
		<link>http://fugato.net/2007/02/10/setting-your-sights-low/</link>
		<comments>http://fugato.net/2007/02/10/setting-your-sights-low/#comments</comments>
		<pubDate>Sat, 10 Feb 2007 13:16:58 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/02/10/setting-your-sights-low/</guid>
		<description><![CDATA[I reported the Winforms Designer issue as a bug on Microsoft Connect. They swiftly marked it resolved &#8220;by design.&#8221; What&#8217;s by design, exactly? Here are the actual and expected results from my bug report: Actual Results A dialog box saying &#8220;Specified cast is not valid&#8221; with an OK button, displayed three times, and then information [...]]]></description>
			<content:encoded><![CDATA[<p>I reported the <a href="http://fugato.net/2007/02/08/quoth-winforms-designer-error-hresult-e_fail-from-a-call-to-a-com-component/">Winforms Designer issue</a> as a bug on <a href="http://connect.microsoft.com/">Microsoft Connect</a>. They swiftly marked it resolved &#8220;by design.&#8221;</p>
<p>What&#8217;s by design, exactly? Here are the actual and expected results from my bug report:</p>
<blockquote><h4>Actual Results</h4>
<p>A dialog box saying &#8220;Specified cast is not valid&#8221; with an OK button, displayed three times, and then information lost about control instances within the form.</p>
<h4>Expected Results</h4>
<p>A clear, specific indication of the invalid typecast problem encountered while saving the form. And minimal information loss when the form is saved anyway.</p></blockquote>
<p>So it is &#8220;by design&#8221; that instead of a clear, specific indication of the problem, we get a dialog box with only the exception message, and not even a mention that this message is coming from our own code? Just a quick and cheap <code>MessageBox.Show(ex.Message)</code> and their work is done?</p>
<p>Here is Microsoft&#8217;s exact response:</p>
<blockquote><p>I&#8217;m afraid this is largely a byproduct of the way in which the windows forms designer works. It is setting the properties on a live object. If this object throws an exception, the designer has the choice of either letting the object throw (which would crash Visual Studio) or catching the exception. When it catches the exception, it displays the Message from the exception. The message you&#8217;re describing is the typical one for invalid cast. Hooking up a debugger will find what line the exception happens on, which would make it easy to see what the exact issue is (not just type information, but values, state, etc.)</p>
<p>UIFX Team</p></blockquote>
<p>This misses the point completely.</p>
<p>I know full well that the designer works on live objects, and that bugs in controls therefore must cause problems. My complaint is about <em>how</em> those problems are handled, not <em>that</em> they come up. What&#8217;s &#8220;by design&#8221; is <em>that</em> they come up, sure. <em>How</em> they are handled is <em>not</em> &#8220;by design&#8221; (we should hope!) &#8212; it is a real usability issue that remains to be resolved. But Microsoft just shrugs it off, &#8220;you can attach a debugger to help find it.&#8221;</p>
<p>My point is that the exception they catch contains valuable information about the problem (the stack trace), and they do not give it to us.</p>
<p>Should we be grateful that at least we get a line number on compiler errors, without having to attach a debugger?</p>
<p>This product desperately needs competition.</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/02/10/setting-your-sights-low/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quoth Winforms Designer: Error HRESULT E_FAIL from a call to a COM component</title>
		<link>http://fugato.net/2007/02/08/quoth-winforms-designer-error-hresult-e_fail-from-a-call-to-a-com-component/</link>
		<comments>http://fugato.net/2007/02/08/quoth-winforms-designer-error-hresult-e_fail-from-a-call-to-a-com-component/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 18:53:29 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/02/08/quoth-winforms-designer-error-hresult-e_fail-from-a-call-to-a-com-component/</guid>
		<description><![CDATA[Eerie. This designer thing seems to know when I&#8217;m under schedule pressure and pull out all its tricks. Now I get &#8220;Error HRESULT E_FAIL has been returned from a call to a COM component.&#8221; Never seen this before, don&#8217;t know what it means, don&#8217;t know what caused it, and don&#8217;t know how to find out. [...]]]></description>
			<content:encoded><![CDATA[<div class="floatright" style="float: right; padding-left: 20px; width: 460px;"><img src='http://fugato.net/wp-content/uploads/2007/02/call-to-a-com-component.png' alt='Call to a COM component' /></div>
<p>Eerie. This designer thing seems to know when I&#8217;m under schedule pressure and pull out all its tricks.</p>
<p>Now I get &#8220;Error HRESULT E_FAIL has been returned from a call to a COM component.&#8221;</p>
<p>Never seen this before, don&#8217;t know what it means, don&#8217;t know what caused it, and don&#8217;t know how to find out.</p>
<p><strong>Yes</strong>, my changes were lost.<br />
<strong>No</strong>, I couldn&#8217;t repeat it by making (what I believe to be) the same changes again.<br />
<strong>Yes</strong>, I&#8217;m happy about being able to make the changes after all.<br />
<strong>No</strong>, I&#8217;m not happy about having no idea when this will happen again, or whether it might happen at runtime.</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/02/08/quoth-winforms-designer-error-hresult-e_fail-from-a-call-to-a-com-component/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Quoth Windows Forms Designer: Specified Cast Is Not Valid</title>
		<link>http://fugato.net/2007/02/08/quoth-windows-forms-designer-specified-cast-is-not-valid/</link>
		<comments>http://fugato.net/2007/02/08/quoth-windows-forms-designer-specified-cast-is-not-valid/#comments</comments>
		<pubDate>Thu, 08 Feb 2007 10:02:06 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Usability]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/02/08/quoth-windows-forms-designer-specified-cast-is-not-valid/</guid>
		<description><![CDATA[Let&#8217;s say you have a UserControl with a property like this: public double DoubleValue { get { return (double)NestedControl.EditValue; } set { Control.EditValue = value; } } where NestedControl.EditValue is of type object. Yeah, that&#8217;s careless handling of a possible typecast. But c&#8217;est la vie, sometimes that&#8217;s what you have, and you don&#8217;t know it, [...]]]></description>
			<content:encoded><![CDATA[<p>Let&#8217;s say you have a <code>UserControl</code> with a property like this:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="kwrd">public</span> <span class="kwrd">double</span> DoubleValue
{
    get { <span class="kwrd">return</span> (<span class="kwrd">double</span>)NestedControl.EditValue; }
    set { Control.EditValue = <span class="kwrd">value</span>; }
}</pre>
<p>where <code>NestedControl.EditValue</code> is of type <code>object</code>. Yeah, that&#8217;s careless handling of a possible typecast. But c&#8217;est la vie, sometimes that&#8217;s what you have, and you don&#8217;t know it, and that control is used in somebody else&#8217;s form that you&#8217;ve never seen before, and you are editing that form with the Windows Forms designer.</p>
<div class="floatright" style="float: right; padding-left: 20px; width: 225px;"><img src='http://fugato.net/wp-content/uploads/2007/02/specified-cast-is-not-valid.png' alt='Specified cast is not valid' /></div>
<p>The designer will work merrily until you close it and say &#8220;yes, save for me please.&#8221; At this point it will present you with a dialog box saying simply &#8220;Specified cast is not valid&#8221; and inviting you to misrepresent your feelings by clicking &#8220;OK.&#8221;</p>
<p>When you do, it will give you the same dialog box again. You will click &#8220;OK&#8221; again, even less truthfully. And you will get that dialog box once again.</p>
<p>After the third time, tender mercies: the designer lets you off the hook and closes, saving your form. Phew, you think, maybe that wasn&#8217;t so bad. That&#8217;s until you discover that the designer has thrown out all the information associated with the problematic control instance, its name, text, tooltip text, sizing information, everything.</p>
<p>When you set out to find the cause of the problem, what do you have to go on? &#8220;Specified cast is not valid.&#8221; And which control instances got messed up. There may be dozens of them, with dozens of properties each. Happy hunting.</p>
<p>The lesson: when I write a tool for developers, and do it under a schedule crunch, and write a catch-all handler to display unanticipated errors &#8230; I pledge to include whatever specific contextual information I can. At least the exception stack trace. Surely that&#8217;s the least I could do.</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/02/08/quoth-windows-forms-designer-specified-cast-is-not-valid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Impressions of that splash screen spec</title>
		<link>http://fugato.net/2007/02/07/impressions-of-that-splash-screen-spec/</link>
		<comments>http://fugato.net/2007/02/07/impressions-of-that-splash-screen-spec/#comments</comments>
		<pubDate>Wed, 07 Feb 2007 23:24:32 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Rant]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Usability]]></category>
		<category><![CDATA[Visuals]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/02/07/impressions-of-that-splash-screen-spec/</guid>
		<description><![CDATA[Microsoft has posted a splash screen spec for the Orcas version of Visual Studio, asking for our impressions. And here I was determined to start taking a more positive tack in my tech blog. Dear me. My impressions are as follows: The triviality They wrote a nine-page specification complete with &#8220;Microsoft Corporation Technical Documentation License [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft has posted a <a href="http://blogs.msdn.com/buckh/archive/2007/02/06/how-many-people-do-we-have-working-on-orcas.aspx">splash screen spec</a> for the Orcas version of Visual Studio, asking for our impressions.</p>
<p>And here I was <a href="http://fugato.net/2006/12/15/an-observation-on-the-presentation-of-criticism/">determined to start taking a more positive tack</a> in my tech blog. Dear me.</p>
<p>My impressions are as follows:</p>
<h3>The triviality</h3>
<p>They wrote a nine-page specification complete with &#8220;Microsoft Corporation Technical Documentation License Agreement (Standard)&#8221; and stamp of approval from Microsoft Law And Corporate Affairs and table of contents and overview and context and definitions and appeal-to-stereotype Elvis arguments &#8230;</p>
<p>&#8230; for a drop-shadow and rounded corners and <em>no</em> other changes?</p>
<p>And thought it would be a good idea to post it publicly?</p>
<h3>The specious claims</h3>
<blockquote><p>&#8220;[the splash screen] is <strong>no less critical</strong> than <strong>any</strong> other part of the Visual Studio User Experience.&#8221;</p></blockquote>
<p>They lost me right there on the front page. Let me rephrase this statement while retaining the precise meaning:</p>
<p>&#8220;There is <strong>no</strong> part of the Visual Studio User Experience that is <strong>more critical</strong> than the splash screen.&#8221;</p>
<p>Gee, I could have sworn there were a couple.</p>
<p>We don&#8217;t even <em>interact</em> with this thing. It&#8217;s not a <em>User</em> Experience, it&#8217;s a <em>Viewer</em> Experience. And that&#8217;s if we even bother to View it, instead of fetching a cup of coffee while Visual Studio loads, or starting it with <code>/nosplash</code>.</p>
<p>How could it possibly be <em>as critical as any other part</em> of the User Experience?</p>
<p>This is the kind of text that comes out when you are thinking &#8220;what would sound impressive here?&#8221; instead of &#8220;what&#8217;s the plain and useful truth here?&#8221;</p>
<blockquote><p>&#8220;The Splash Screen typifies some of the worst aspects of the Visual Studio User Experience.&#8221;</p></blockquote>
<p>No no no. The worst aspects of said User Experience are, unsurprisingly, things we Use. Such as:</p>
<ul>
<li><a href="http://fugato.net/2006/10/12/fixed-size-dialog-boxes/">tiny fixed-size dialog boxes around huge tabular data</a>.</li>
<li><a href="http://fugato.net/2006/09/25/team-shaky-foundation/">A source control client that blocks the entire IDE while waiting for the server</a>, and <a href="http://fugato.net/2006/11/30/ah-blessed-days-of-subversion/">hangs on Cancel</a>.</li>
<li><a href="http://fugato.net/2006/12/05/whats-in-a-rename/">A source control system that takes 38 <em>blocking</em> seconds to rename a file.</a></li>
<li><a href="http://fugato.net/2007/02/08/quoth-windows-forms-designer-specified-cast-is-not-valid/">A GUI designer that chokes on buggy nested controls with cryptic error messages.</a></li>
</ul>
<p>It&#8217;s OK to exaggerate the importance of your work in order to motivate yourself. But don&#8217;t go overboard.</p>
<h3>The singularly clueless marketing stereotype banter</h3>
<blockquote><p>When Elvis first heard about Visual Studio Orcas being released, he wasn&#8217;t convinced that it was worth upgrading to, especially since he felt as though he had just purchased a copy of Visual Studio 2005.</p>
<p>So, like any frugal developer, Elvis went and downloaded a trial copy of Orcas to test drive.</p>
<p>Elvis could see that Visual Studio Orcas was new and different from the moment he started the application. The changes in the Splash Screen suggested to him immediately that this release was, indeed, different.</p></blockquote>
<p>Well, wasn&#8217;t that a nice story.</p>
<p>Really, this Mort-and-Elvis stuff has to go. It pains me to see dinky little stories of these contrived stereotypes masquerading as product marketing wisdom.</p>
<h3>The inattention</h3>
<p>Chapter 6, &#8220;Feature Decisions / Q&#038;A&#8221; is not just blank; it consists entirely of the placeholder text from the document template: &#8220;Include a quick description [...] describe decisions and rationale here [...] We will do so and so&#8221;</p>
<p>This is the document equivalent of:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ --></p>
<pre class="csharpcode">
<span class="rem">/// &lt;summary&gt;</span>
<span class="rem">/// Insert summary description here</span>
<span class="rem">/// &lt;/summary&gt;</span>
<span class="kwrd">public</span> <span class="kwrd">class</span> Class1
{
    <span class="rem">/// &lt;summary&gt;</span>
    <span class="rem">/// Construct a new Class1 instance.</span>
    <span class="rem">/// &lt;/summary&gt;</span>
    <span class="kwrd">public</span> Class1()
    {
        <span class="rem">// Add initialization code here</span>
    }
}</pre>
<p>Do we post this kind of code for public review? For private review? Do we even check it in?</p>
<h3>The implied background</h3>
<p>One can&#8217;t help wondering whether this spec gives a glimpse of some contorted in-house dynamic, where people have to participate in a ritual Product Marketing dance by writing a Mort or Elvis &#8220;scenario&#8221; for every feature spec, and inflating the importance of their work with baseless hyperbole.</p>
<p>It sounds like the <code>FeatureSpec.dot</code> document template contained the placeholder text &#8220;Insert scenario involving Mort and Elvis here,&#8221; as a hoop for each feature spec writer to jump through.</p>
<p>It may not really be that way, but we&#8217;re talking impressions here.</p>
<h3>Summary</h3>
<p>Why did nobody&#8217;s nonsense detector go wild and prevent this embarrassment from publication? The splash screen improvements themselves are nice and understated, and should have been put in place without a word.</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/02/07/impressions-of-that-splash-screen-spec/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>LaTeX in WordPress</title>
		<link>http://fugato.net/2007/01/20/latex-in-wordpress/</link>
		<comments>http://fugato.net/2007/01/20/latex-in-wordpress/#comments</comments>
		<pubDate>Sat, 20 Jan 2007 16:25:19 +0000</pubDate>
		<dc:creator>GÞB</dc:creator>
				<category><![CDATA[Stuff I use here]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[Visuals]]></category>

		<guid isPermaLink="false">http://fugato.net/2007/01/20/latex-in-wordpress/</guid>
		<description><![CDATA[This: is called Tupper&#8217;s self-referential formula. If you graph it over particular values of x and y, it makes a picture of itself, and that is quite neat. Follow the link for details. And this is a property of the unit impulse: But that&#8217;s not really the point. The point is the mathematical notation; you [...]]]></description>
			<content:encoded><![CDATA[<p>This:</p>
<div style="text-align: center;">
<img src='/wp-content/plugins/latexrender/pictures/aa32f6e1bdb9f303987ae1b00c59de00_7.85951pt.gif' title='\displaystyle\frac12 &amp;lt; \left\lfloor \mathrm{mod} \left( \left\lfloor \frac{y}{17}\right\rfloor 2^{-17\lfloor x\rfloor -\mathrm{mod}(\lfloor y\rfloor , 17)},2\right)\right\rfloor' alt='\displaystyle\frac12 &amp;lt; \left\lfloor \mathrm{mod} \left( \left\lfloor \frac{y}{17}\right\rfloor 2^{-17\lfloor x\rfloor -\mathrm{mod}(\lfloor y\rfloor , 17)},2\right)\right\rfloor'  style="vertical-align:-7.85951pt;"  />
</div>
<p>is called <a href="http://mathworld.wolfram.com/TuppersSelf-ReferentialFormula.html">Tupper&#8217;s self-referential formula</a>. If you graph it over particular values of <em>x</em> and <em>y</em>, it makes a picture of itself, and that is quite neat. Follow the link for details.</p>
<p>And this is a property of the unit impulse:</p>
<div style="text-align: center;">
<img src='/wp-content/plugins/latexrender/pictures/523db25c440002d2e8c3a9ee0748c5bb_10.94456pt.gif' title='\displaystyle\int_{-\infty}^t\delta(\tau)d\tau = u(t)' alt='\displaystyle\int_{-\infty}^t\delta(\tau)d\tau = u(t)'  style="vertical-align:-10.94456pt;"  />
</div>
<p>But that&#8217;s not really the point. The point is the mathematical notation; you can integrate <span style="vertical-align: -2px;"><img src='/wp-content/plugins/latexrender/pictures/c51d7e23458ca0e7373a8ed6ab56b2b9_3.15277pt.gif' title='\LaTeX' alt='\LaTeX'  style="vertical-align:-3.15277pt;"  /></span> mathematical notation in your WordPress blog very easily, using <a href="http://www.sixthform.info/steve/wordpress/">Steve Mayer&#8217;s LatexRender plugin</a>.</p>
<p>And the point <em>here</em> is that you can install that plugin even more easily <em>and</em> correct a nasty bug in the offset beta functionality, using <a href="/wp-content/install-latexrender.bash">my LatexRender installation script</a> (or <a href="/wp-content/install-latexrender.bsd.bash">the BSD version</a>).</p>
<p>Go to the <code>wp-content/plugins</code> subdirectory of your WordPress installation, and then either:</p>
<blockquote><p><code>wget http://fugato.net/wp-content/install-latexrender.bash<br />
bash install-latexrender.bash</code></p></blockquote>
<p>or, if your webserver is running BSD (or anything with the same kooky version of <code>sed</code> as my hosting provider&#8217;s BSD installation):</p>
<blockquote><p><code>wget http://fugato.net/wp-content/install-latexrender.bsd.bash<br />
bash install-latexrender.bsd.bash</code></p></blockquote>
<p>and with any luck, the script will set everything up right. Then you&#8217;ll just need to activate the plugin <code>LatexRender</code> in your WordPress admin panel, and try it out by putting something like <code>[<span>tex</span>]e^{i\pi}=-1[/<span>tex</span>]</code> in a blog entry. That should render the classic <span style="vertical-align: -0.5px;"><img src='/wp-content/plugins/latexrender/pictures/74efedf498a3cab300eae408c273ffdb_1.83333pt.gif' title='e^{i\pi}=-1' alt='e^{i\pi}=-1'  style="vertical-align:-1.83333pt;"  /></span>.</p>
<p>This is tested working fine in WordPress versions 2.0 through 2.5.1 (the current stable version, which this blog is running).</p>
<p>The script assumes that your blog is located at the root of your website. If it isn&#8217;t, then you must provide the base path as an argument to the script. E.g. if your blog is at <code>http://o.com/all/ye/faithful/</code>, then you must run the script like this:</p>
<blockquote><p><code>bash install-latexrender.bash /all/ye/faithful</code></p></blockquote>
<p>and it should work right.</p>
<p>Some formulas may be slightly misaligned with the text baseline. You can work around this by manually surrounding them with stuff like <code>&lt;span style="vertical-align: -0.5px;"&gt; ... &lt;/span&gt;</code> on a case-by-case basis (assuming you edit your blog entries in straight HTML, not the rich text editor).</p>
]]></content:encoded>
			<wfw:commentRss>http://fugato.net/2007/01/20/latex-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>27</slash:comments>
		</item>
	</channel>
</rss>

