<?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>Just wondering.... &#187; technical</title>
	<atom:link href="http://sworddance.com/blog/category/technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://sworddance.com/blog</link>
	<description></description>
	<lastBuildDate>Tue, 17 Jan 2012 05:07:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>10gui window management not innovative enough</title>
		<link>http://sworddance.com/blog/2011/11/02/10gui-window-management-not-innovative-enough/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=10gui-window-management-not-innovative-enough</link>
		<comments>http://sworddance.com/blog/2011/11/02/10gui-window-management-not-innovative-enough/#comments</comments>
		<pubDate>Wed, 02 Nov 2011 18:56:37 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=1183</guid>
		<description><![CDATA[A friend suggested that I look at the R. Clayton Miller&#8217;s 10gui video (2009) for ideas on window management and interaction. The video makes some interesting observations about human-computer interactions (HCI): mice excel at pointing on the screen without obstructing &#8230; <a href="http://sworddance.com/blog/2011/11/02/10gui-window-management-not-innovative-enough/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://sworddance.com/blog/wp-content/uploads/2011/11/10gui-interaction.jpg"><img src="http://sworddance.com/blog/wp-content/uploads/2011/11/10gui-interaction-300x205.jpg" alt="" title="10gui-interaction" width="300" height="205" class="alignright size-medium wp-image-1185" /></a><br />
<a href="http://sworddance.com/blog/wp-content/uploads/2011/11/10-finger-interaction.jpg"><img src="http://sworddance.com/blog/wp-content/uploads/2011/11/10-finger-interaction-300x164.jpg" alt="" title="10-finger-interaction" width="300" height="164" class="alignright size-medium wp-image-1186" /></a>A friend suggested that I look at the <a href="http://10gui.com/video/" target="_blank">R. Clayton Miller&#8217;s 10gui video (2009) for ideas on window management and interaction.</a></p>
<p>The video makes some interesting observations about human-computer interactions (HCI):</p>
<ul>
<li>mice excel at pointing on the screen without obstructing the screen</li>
<li>multi-touch should be extended to use all digits on the hand, not just 1 or 2 &#8211; but all 5.</li>
<li>both hands can create touch combinations that are interesting ( see 6:42 mark in the video )</li>
<li>New windows are overlaid on top of old windows in a rather cluttered manner.</li>
</ul>
<p>Clayton Miller&#8217;s proposal involves a medium-size touch surface placed in front of the keyboard.  All ten fingers are used to interact with the UI. Different combinations and number of fingers mean different operations. </p>
<p>Clayton Miller&#8217;s basic premise that HCI should no longer be confined to 2D interactions is quite correct. However, the proposal does not recognize the full extent of the mouse/keyboard limitations. As a result the proposal is at best an incremental improvement over what Apple offers currently. Furthermore, Clayton&#8217;s proposal assumes a desktop computer configuration. Mobile, tablet, and laptop compute configurations are ignored.</p>
<p>Additional limitations that Clayton must bring into the picture and address in order to be truly revolutionary:</p>
<ul>
<li>extensive mouse movement causes carpal tunnel syndrome</li>
<li>mouse/trackpad movement requires a dedicated surface</li>
<li>mouse is not useful for mobile devices</li>
<li>mobile devices use a touch screen with the downside that Clayton points out in his video.</li>
<li>physical handicaps of users:
<ul>
<li>lost digits,</li>
<li>diseases that impact muscle control</li>
<li>mouse and trackpad are still 2D surfaces and operations</li>
</ul>
</li>
</ul>
<p>Clayton needs to update this video to consider these technologies: </p>
<ul>
<li><a href="http://www.xbox.com/en-US/kinect" target="_blank">Microsoft Kinect</a>&#8216;s motion capture eliminates the need for direct device<br />
manipulation</li>
<li>Kinect and the Wii introduced acceleration, 3D motion and movement into the HCI arena.</li>
<li>Users&#8217; physical limitations</li>
<li>Eye motion and tracking to make computers more accessible to users.</li>
<li>Mobile devices in particular field use</li>
<li>Non-Desktop interactions</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/11/02/10gui-window-management-not-innovative-enough/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A criminal says trust is stupid but security &#8220;experts&#8221; trust</title>
		<link>http://sworddance.com/blog/2011/09/08/a-criminal-says-trust-is-stupid-but-security-experts-trust/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=a-criminal-says-trust-is-stupid-but-security-experts-trust</link>
		<comments>http://sworddance.com/blog/2011/09/08/a-criminal-says-trust-is-stupid-but-security-experts-trust/#comments</comments>
		<pubDate>Thu, 08 Sep 2011 22:21:19 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[broken]]></category>
		<category><![CDATA[rants]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=1127</guid>
		<description><![CDATA[Sam Antar, convicted white collar criminal, says trusting is stupid clearly and explicitly: President Ronald Reagan said: &#8220;Trust, but verify.&#8221; As a convicted felon, I say: &#8220;Don’t trust, just verify.&#8221; &#8220;Verify, verify, verify.” As a criminal, I considered people&#8217;s humanity &#8230; <a href="http://sworddance.com/blog/2011/09/08/a-criminal-says-trust-is-stupid-but-security-experts-trust/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><div id="attachment_1155" class="wp-caption alignright" style="width: 310px"><a href="http://sworddance.com/blog/wp-content/uploads/2011/09/trust_1.png"><img src="http://sworddance.com/blog/wp-content/uploads/2011/09/trust_1-300x133.png" alt="" title="Trust me" width="300" height="133" class="size-medium wp-image-1155" /></a><p class="wp-caption-text">Trust Me</p></div><a href="http://sworddance.com/blog/wp-content/uploads/2011/09/trust_2.jpeg"><img src="http://sworddance.com/blog/wp-content/uploads/2011/09/trust_2.jpeg" alt="" title="No, its cool - trust me!" width="296" height="170" class="alignright size-full wp-image-1156" /></a><div id="attachment_1157" class="wp-caption alignright" style="width: 294px"><a href="http://sworddance.com/blog/wp-content/uploads/2011/09/trust_3.jpeg"><img src="http://sworddance.com/blog/wp-content/uploads/2011/09/trust_3.jpeg" alt="" title="Seriously, why doubt?" width="284" height="177" class="size-full wp-image-1157" /></a><p class="wp-caption-text">Seriously, why doubt?</p></div></p>
<p><a href="http://whitecollarfraud.blogspot.com/2007/06/advice-about-trust-from-convicted-felon.html" title="Don't trust!">Sam Antar, convicted white collar criminal, says trusting is stupid clearly and explicitly</a>:</p>
<blockquote><p>President Ronald Reagan said:</p>
<blockquote><p>&#8220;Trust, but verify.&#8221;</p></blockquote>
<p>As a convicted felon, I say:</p>
<blockquote><p>&#8220;Don’t trust, just verify.&#8221;</p></blockquote>
<p>&#8220;Verify, verify, verify.”</p>
<p>As a criminal, I considered people&#8217;s humanity as a weakness to be exploited.</p>
<p>The inclination to trust first and then verify, gave me the upper hand.</p>
<p>The criminal always has the initiative.</p>
<p>While you initially trust us, we work on ways to solidify your trust before you verify.</p>
<p>Hopefully, you will never verify.</p>
<p>However, if you do verify, we will have corroded your skepticism to a large degree.</p>
<p>A word of advice from this convicted felon to the capital markets, securities analysts, journalists, the accounting profession, investors, and others:</p>
<blockquote><p>The word &#8220;trust&#8221; is a professional hazard you can leave at home before you go to work.</p></blockquote>
</blockquote>
<p><strong>A criminal says &#8220;Don&#8217;t trust&#8221;</strong>. Yet computer security experts talk about a <a href="http://www.google.com/search?ie=UTF-8&#038;q=trust+model">&#8220;trust&#8221; model</a>. When are we going to move beyond trust to verify? <a href="http://www.google.com/search?q=trust+content+image&#038;hl=en&#038;prmd=ivns&#038;source=lnms&#038;tbm=isch&#038;sa=X&#038;oi=mode_link&#038;ct=mode&#038;biw=1392&#038;bih=964" title="Trust search" target="_blank">A google search finds endless examples of sites reassuring users that they are &#8220;trustworthy&#8221;.</a> It should not be a surprise then that computer users are used to just entering their password or clicking o.k. when a security dialog comes up. Users are asked to always trust without any understanding. What does it mean when a certificate cannot be authenticated?</p>
<p>Furthermore, we now have &#8220;trusted&#8221; applications getting computer owners into trouble.</p>
<p>For example:</p>
<ul>
<li><a href="http://venturebeat.com/2011/07/29/who-will-pick-up-paying-customer-that-comcast-dropped-because-of-high-data-usage/" target="_blank">Andre Vrignaud is a such a victim</a>.<br />
<blockquote><p>Comcast cut off broadband access to Andre Vrignaud. A month earlier, Vrignaud said he had a “polite but irritated” conversation with Comcast’s Customer Security Department about how much data he was using. <u>He told them he had no idea how he used so much and wondered if his roommates may have hit the limit because they watched Netflix HD streaming movies and listened to Pandora’s internet-streamed music radio.</u></p></blockquote>
<p>Why can&#8217;t Vrignaud limit easily on his end?<br />
Once again, <a href="http://www.google.com/search?ie=UTF-8&#038;q=data+broadband+usage" target="_blank">a google search reveals how important being able to control and manage at the application level</a>.</li>
<li><a href="http://www.foxnews.com/story/0,2933,244009,00.html" target="_blank">How about the case of Matthew Brady?</a> <a href="http://www.google.com/search?&#038;ie=UTF-8&#038;q=child+porn+innocent+infected" target="_blank">He is an innocent victim, like many others, framed by a poor computer security model</a>.<br />
<blockquote><p>Until recently [story dated Tuesday, January 16, 2007], the 16-year-old Arizona boy faced life imprisonment for possessing child pornography; each of the nine images on his computer carried a possible 10-year sentence.</p>
<p>The caution: Your computer could be storing and distributing child pornography without your knowledge. It could be what is called &#8220;a zombie.&#8221; A virus, worm or &#8220;bot&#8221; may have almost invisibly infected your operating system, perhaps when you opened an email attachment or clicked on the &#8220;wrong&#8221; (not necessarily adult) website.<br />
The &#8220;infection&#8221; allows another person to remotely access your hard drive. Often, the third party tries to capture financial information such as bank account numbers. Often, he stores data on the hard drive and uses your computer to distribute spam, including pornography.</p>
<p>Benjamin Edelman, a computer security expert, indicates how quickly a computer can become infected. &#8220;I recently tested a WindowsMedia video file…On a fresh test computer, I pressed Yes once to allow the installation. My computer quickly became contaminated…All told, the infection added 58 folders, 786 files, and an incredible 11,915 registry entries to my test computer. Not one of these programs had showed me any license agreement, nor had I consented to their installation on my computer.&#8221;</p>
<p>The Bandy&#8217;s two-year nightmare might be winding down, but the family has been financially ruined by over $250,000 in legal costs.</p></blockquote>
</li>
</ul>
<p>Instead of trust, as Sam suggests: &#8220;Don&#8217;t trust, verify, verify, verify&#8221;. No application should be given a blanket &#8220;trust&#8221; but rather a conditional trust. An application should not even be allowed to ask for a blanket trust.</p>
<p>Instead the application must ask for permission and indicate why it is asking for the permission:</p>
<ul>
<li>write to a specific directory</li>
<li>send data to an internet site</li>
<li>receive data from an internet site</li>
<li>All data sent or received is logged</li>
<li>Any data the application wants to send or receive needs explicit permission from the user.</li>
</ul>
<p>The user must be able to <em>selectively</em> deny or condition a granted permission at <em>any time</em> (not just when an application is starting) :</p>
<ul>
<li>Granted for 10minutes</li>
<li>Data sent/received is logged</li>
<li>Data transmission rate is no more than 1mb/sec</li>
<li>Data transmission rate is no more than 10megabytes/month</li>
<li>Data stored for only 10 days</li>
<li>Data is stored is no more than 10megabytes</li>
<li>CPU usage is capped as a percentage.</li>
</ul>
<p>It is up to the application to behave well if the permission is  or it is denied permission. And if it doesn&#8217;t like the permissions then well &#8211; don&#8217;t run.</p>
<p><strong>The application is a guest and needs to respect the rules as a guest.</strong></p>
<p>Trust. is. stupid.</p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/09/08/a-criminal-says-trust-is-stupid-but-security-experts-trust/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Indifference to process leads to Mozilla contributor departing</title>
		<link>http://sworddance.com/blog/2011/08/30/indifference-to-process-leads-to-mozilla-contributor-departing/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=indifference-to-process-leads-to-mozilla-contributor-departing</link>
		<comments>http://sworddance.com/blog/2011/08/30/indifference-to-process-leads-to-mozilla-contributor-departing/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 17:46:43 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[management]]></category>
		<category><![CDATA[software design]]></category>
		<category><![CDATA[starting a company]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=1131</guid>
		<description><![CDATA[Tyler Downer announced he was no longer contributing to Mozilla because the Mozilla bug triaging process was being sacrificed on the altar of &#8220;rapid release&#8221;. Tyler likes the idea of the Rapid Release, but rather the tools to handle bug &#8230; <a href="http://sworddance.com/blog/2011/08/30/indifference-to-process-leads-to-mozilla-contributor-departing/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://tylerdowner.wordpress.com/2011/08/15/goodbye-mozilla/">Tyler Downer announced he was no longer contributing to Mozilla</a> because <a href="http://tylerdowner.wordpress.com/2011/08/27/some-clarification-and-musings/">the Mozilla bug triaging process was being sacrificed on the altar of &#8220;rapid release&#8221;</a>. Tyler likes the <em>idea</em> of the Rapid Release, but rather the tools to handle bug reports are failing under the new 6-week release cycle. </p>
<blockquote><p>I left because of a general lack of interest in doing anything substantial to improve the Triage process on BMO outside the QA community and a few others. Triage as we know it today is NOT ready to handle the Rapid Release process. </p></blockquote>
<p>Tyler then points out that:</p>
<blockquote><p>In Spring 2010, we hit roughly 13,000 UNCO bugs in the Firefox product on BMO. 13,000!!! We currently have 5934. This is several thousand contributors that we have told “Thank you for filing a bug report with us. We don’t really care about it, and we are going to let it sit for 6 months and just ask you to retest when you know it isn’t fixed, but thank you anyway. Oh, and Mozilla is run by the community.” <u>Even though nobody means this, that is what we tell an end-user who just submitted their first bug and is ignored.</u>[italics mine]</p></blockquote>
<p>Mozilla behavior toward this <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=18808">ancient feature request</a> is illustrative:</p>
<ul>
<li>The request was filed in 1999 (12 years ago)!</li>
<li>Numerous offered patches,</li>
<li><a href="https://addons.mozilla.org/en-US/firefox/addon/tab-history-redux/">A plugin to workaround this issue</a>,</li>
<li>Accounts that offered patches are labeled as &#8220;Please Ignore This Troll (Account Disabled)&#8221;</li>
</ul>
<p>Wow nothing says Go Away quite so effectively as being labeled a troll or being ignored.</p>
<hr/>
<h3>Questions</h3>
<ol>
<li>How many reported issues are latent security problems?</li>
<li>How can Mozilla bug fixing keep up with the community&#8217;s bug reporting? The community is vastly larger than the Mozilla development team.</li>
<li>How can Mozilla truly leverage the community? And avoid having responsive, assertive community members being labeled as trolls?</li>
<li>How can anyone feel good about closing 1 bug out of 13000, especially if the incoming rate is greater than the fix rate?</li>
</ol>
<h3>Thoughts</h3>
<p>This is something that every company or open-source project hopes to have: a community that overwhelms the product with love. Mozilla is doing the wrong thing if the love is unrequited.</p>
<p>With so many bugs churning in, developers are faced with a <a href="http://en.wikipedia.org/wiki/Sisyphus" rel="nofollow"  target="_blank">sisyphean</a> task. The bugs represent community love, the developers have to view the love as not burdensome.</p>
<p>These thoughts really apply to every company, product and project: </p>
<h4><em>Developer Bug Tool</em></h4>
<p>A developer-facing bug database must only hold bugs (broken code that <em>must</em> be fixed),</p>
<ol>
<li>NO Feature Requests</li>
<li>NO Project Plans</li>
<li>NO &#8220;technical debt removal&#8221; wishes,</li>
<li>NO minor bugs</li>
</ol>
<p>Developers like all humans need to feel the progress, and accomplishment. Fixing one bug out of 13000 does nothing, fixing one bug out of 100 feels meaningful.</p>
<p>Feature requests and refactoring or changes for the future belong in a project planning tool.</p>
<p>Any bug, that cannot or will not be fixed immediately, must be documented in the code:</p>
<ul>
<li>TODO flag</li>
<li>Date ( a TODO that is 10 years old not that useful &#8211; <a href="http://www.azulsystems.com/blog/cliff/2011-08-28-just-fixed-a-20-year-old-bug"  rel="nofollow"  target="_blank">with a few exceptions</a> )</li>
<li>Person who added this comment (not necessarily a full-time developer)</li>
<li>HACK flag if the code should not be an example of &#8220;how to do&#8221; things. This tells future developers to not use this bad code as a template to create more bad code.</li>
<li>Discussions can happen in the code same as they would in a separate bug database</li>
</ul>
<p>Documenting in the code not the bug database gives these benefits:</p>
<ul>
<li>Developers tracing a different bugs or adding new features are <em>proactively  notified without searching</em> that:
<ul>
<li>the code is questionable</li>
<li>the code may be the source of the bug he is tracing</li>
<li>he may be able to immediately fix the bug documented in the issue</li>
</ul>
</li>
<li>If the questionable code is deleted as part of a later refactoring feature change, the bug report is also deleted.</li>
<li>The bug database is not polluted with minor items that bury the truly critical issues.</li>
</ul>
<h4><em>Use Git</em></h4>
<p>Get away from the Open-source Cathedral where only a few are blessed committers.</p>
<p>Avoid frustrating people who want to patch the product. Let them patch the product and share their patch. If the main official release doesn&#8217;t include the patch, at least the person reporting the problem can fix the problem for themselves and move on.</p>
<h4><em>Prefilter bug reports</em></h4>
<ul>
<li><u>Incorrectly formatted html</u>: IE choose to format it one way, Firefox made a different guess. Just because FF made a different choice doesn&#8217;t make FF wrong, but that will not stop a bug report. FF should have a clear indicator that:<br />
<blockquote><p>The page in question has bad html and that it may not be displayed correctly. Click here to send a note to the webmaster about this page.</p></blockquote>
<p>Point the finger of blame at the webmaster so that FF does not get blamed (and avoiding the bogus resultant bug reports).
</li>
<li><u>Bad scripts</u>: If the javascript is not functioning correctly announce it. Its not FF&#8217;s problem that the script sucks, don&#8217;t let Firefox get the blame.</li>
</ul>
<h4><em>Make it easy to report issues</em></h4>
<ul>
<li>Built-in feedback tool</li>
<li>Built-in screen capture (with redaction ability)</li>
<li>Do not require registration in a bug database</li>
<li>Do the bug reporting within Firefox don&#8217;t make people navigate.</li>
<li>Ask if the last report by this person is related.</li>
<li>Do the bug database duplication search for the user and ask if any of the other reports look similar.</li>
</ul>
<h3>Final Question</h3>
<p>How can your product or service empower the community to self-help?</p>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/08/30/indifference-to-process-leads-to-mozilla-contributor-departing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Excellent Css tools</title>
		<link>http://sworddance.com/blog/2011/07/03/excellent-css-tools/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=excellent-css-tools</link>
		<comments>http://sworddance.com/blog/2011/07/03/excellent-css-tools/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 17:48:00 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=996</guid>
		<description><![CDATA[Here are some websites I have found useful when learning css: http://css-tricks.com/ http://quirksmode.org http://www.css3.info/ Css3 tutorial via Css Tricks: CSS3Please.com Border-Radius.com HTML-Ipsum.com Button Maker Update ( 28 July 2011 ) : Now for some excellent tools: Sass (http://sass-lang.com ) Compass &#8230; <a href="http://sworddance.com/blog/2011/07/03/excellent-css-tools/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here are some websites I have found useful when learning css:</p>
<ul>
<li><a href="http://css-tricks.com/">http://css-tricks.com/</a></li>
<li><a href="http://quirksmode.org/">http://quirksmode.org</a></li>
<li><a href="http://www.css3.info/">http://www.css3.info/</a></li>
<li><a href="http://www.w3schools.com/css3/default.asp">Css3 tutorial</a></li>
</ul>
<p>via <a href="http://css-tricks.com/12389-one-page-apps-i-actually-use/">Css Tricks</a>:</p>
<ul>
<li><a href="http://CSS3Please.com">CSS3Please.com</a></li>
<li><a href="http://Border-Radius.com">Border-Radius.com</a></li>
<li><a href="http://HTML-Ipsum.com">HTML-Ipsum.com</a></li>
<li><a href="http://css-tricks.com/examples/ButtonMaker/">Button Maker</a></li>
</ul>
<p>Update ( 28 July 2011 ) :</p>
<p>Now for some excellent tools:</p>
<ul>
<li><a href="http://sass-lang.com" title="Sass for easy css" target="_blank">Sass (http://sass-lang.com )</a></li>
<li><a href="http://compass-style.org" title="Compass framework" target="_blank">Compass (http://compass-style.org )</a> Compass builds off of Sass to provide cross browser frameworks.</li>
<li><a href="http://css3pie.com/" title="Css3 for IE6-8" target="_blank">Css3Pie</a> Provides Css3 support (of a sort) for IE 6-8. <a href="http://compass-style.org/reference/compass/css3/pie/" title="Compass Css3Pie integration" target="_blank">Compass integration is available.</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/07/03/excellent-css-tools/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing private ruby gem in rails project using heroku</title>
		<link>http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=installing-private-ruby-gem-in-rails-project-using-heroku</link>
		<comments>http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/#comments</comments>
		<pubDate>Fri, 17 Jun 2011 23:36:04 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[help notes]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=980</guid>
		<description><![CDATA[If you have a private gem, deploying to heroku can be frustrating.. In my case, I do not have even a server so I am not looking (yet) to set up a private rubygem server. I just have another project &#8230; <a href="http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you have a private gem, deploying to heroku can be frustrating.. In my case, I do not have even a server so I am not looking (yet) to set up a private rubygem server. I just have another project on my machine that I would like to reuse as a gem.</p>
<blockquote><p>Could not find gem &#8216;pgw&#8217; ( >= 0, runtime)&#8217; in any of the gem sources listed in your Gemfile</p></blockquote>
<p> I tried <a href="http://olemortenamundsen.wordpress.com/2010/09/13/working-with-private-rubygems-in-rails-3-deploying-to-heroku/">Ole Morten Amundsen&#8217;s method</a>, but it didn&#8217;t ( quite ) work (see below)</p>
<h3>Magic directory method</h3>
<ol>
<li><code>mkdir -p vendor/cache</code></li>
<li><code>bundle update</code></li>
<li><code>git add -A</code></li>
<li><code>git commit -m"whatever"</code></li>
<li><code>git push heroku master</code></li>
</ol>
<p>All the gems public or private are installed into the vendor/cache directory. </p>
<p>Pros:</p>
<ol>
<li>Simple.</li>
<li>It works.</li>
<li>Also allows for a locked down deployment  (? not completely certain on this because heroku does report &#8220;Installing &#8230;&#8221; for all the gems including the private gem)</li>
</ol>
<p>Cons:</p>
<ol>
<li>All the gems used are installed, not just the single gem that is not available on rubyforge.</li>
<li>Magicalness feels like a possible bug. (Note: I am using bundler 1.0.13) so it may not work in future</li>
<li>git bloat &#8211; all the external gems and dependencies are now part of your repo.</li>
<li>Possible issues with machine specific deployments with other gems? ( not certain about this &#8211; but flagging it as a possibility )</li>
</ol>
<h3>Ole Morten Amundsen variant</h3>
<ol>
<li><code>gem unpack pgw --target vendor/gems</code></li>
<li>edit Gemfile to explicitly list the gem version and supply the path <br/><code>gem "pgw", "0.0.3", :path =>"{#File.expand_path(__FILE__)}/../vendor/gems/"</code></li>
<li><code>bundle install --local</code></li>
<li><code>git add -A</code></li>
<li><code>git commit -m"whatever"</code></li>
<li><code>git push heroku master</code></li>
</ol>
<p>The resulting Gemfile.lock will have this:</p>
<pre><code>
PATH
  remote: vendor/gems
  specs:
    pgw (0.0.3)

GEM
...(everything else ) ...</code></pre>
<p>Pros:</p>
<ol>
<li>Feels more like the intended process</li>
<li>Only extra code is the private gem &#8216;pgw&#8217; &#8211; none of the standard ruby gems are added to the project.</li>
</ol>
<p>Cons:</p>
<ol>
<li>More typing</li>
<li>Have to include specific version number in the Gemfile &#8211; so harder to ensure against an accidental release with old version of gem.</li>
<li>&#8220;unpacking&#8221; seems lame. Is there a way to keep the &#8216;pgw&#8217; gem as a .gem file?</li>
</ol>
<h3>Questions</h3>
<ol>
<li>Is there an easy way to move the gems to my master project other than <code>gem unpack</code>?</li>
<li>should the gem be put in <code>vendor/bundle</code> since that is the default <code>BUNDLE_PATH</code>?</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/06/17/installing-private-ruby-gem-in-rails-project-using-heroku/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use Subclasses and alternative interface implementations to reduce &#8220;future&#8221; bugs</title>
		<link>http://sworddance.com/blog/2011/04/07/use-subclasses-and-alternative-interface-implementations-to-reduce-future-bugs/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=use-subclasses-and-alternative-interface-implementations-to-reduce-future-bugs</link>
		<comments>http://sworddance.com/blog/2011/04/07/use-subclasses-and-alternative-interface-implementations-to-reduce-future-bugs/#comments</comments>
		<pubDate>Thu, 07 Apr 2011 19:28:45 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[code review]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=939</guid>
		<description><![CDATA[One of the little-appreciated consequences of subclassing or alternative implementations of Java interfaces is to reduce or eliminate &#8220;future bugs&#8221;. &#8220;Future bugs&#8221; are bugs that are currently not wrong, but will cause problems in the future. Every conditional ( if, &#8230; <a href="http://sworddance.com/blog/2011/04/07/use-subclasses-and-alternative-interface-implementations-to-reduce-future-bugs/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>One of the little-appreciated consequences of subclassing or alternative implementations of Java interfaces is to reduce or eliminate &#8220;future bugs&#8221;.</p>
<p>&#8220;Future bugs&#8221; are bugs that are currently not wrong, but will cause problems in the future. Every conditional ( <code>if</code>, <code>? :</code>, or <code>switch</code> ) is a &#8220;future bug&#8221;.</p>
<p>For example, in this simplistic example code, there are multiple checks for <code>this.enableLogging</code>. If new code is added then the developer has to constantly remember to check for the <code>this.enableLogging</code>.</p>
<p><code>
<pre>public class Foo {
    private final boolean enableLogging;
    public Foo(boolean enableLogging) {
        this.enableLogging = boolean enableLogging; }

    public void stuff1() {
         .....
         if ( this.enableLogging ) {
             Log.warning("here in stuff1");
         }

         .....
         if ( this.enableLogging ) {
             Log.debug("still here in stuff1");
         }
    }
    public void stuff2() {
         .....
         if ( this.enableLogging ) {
             Log.info("here in stuff2");
         }

         .....
         if ( this.enableLogging ) {
             Log.debug("still here in stuff2");
         }
    }
}</pre>
<p></code></p>
<p>Of course sane developers will say that this is silly code, follow the <a href="http://en.wikipedia.org/wiki/Don&apos;t_repeat_yourself" rel="nofollow">DRY principle</a> and have something like this:</p>
<p><code>
<pre>public class Foo {
    private final boolean enableLogging;
    public Foo(boolean enableLogging) { this.enableLogging = boolean enableLogging; }

    public void stuff1() {
         .....
        warning("here in stuff1");
        .....
        debug("still here in stuff1");
        ....
    }
    public void stuff2() {
         .....
         info("here in stuff2");
         .....
         debug("still here in stuff2");
    }
    private void warning(String message) {
        if (this.enableLogging) {
            Log.warning(message);
        }
    }
    private void info(String message) {
        if (this.enableLogging) {
            Log.info(message);
        }
    }
    private void debug(String message) {
        if (this.enableLogging) {
            Log.debug(message);
        }
    }
}</pre>
<p></code></p>
<p>This is good enough for this simplistic example. However, consider a more realistic case with complex conditionals:</p>
<p><code>
<pre>public class Foo {
    private final boolean enableCall;
    private final boolean enableEmail;
    public Foo(boolean enableCall, boolean enableEmail) {
        this.enableCall =  enableCall;
        this.enableEmail =  enableEmail; }

    public void stuff1() {
         .....
         if ( this.enableCall ||  this.enableEmail) {
             doThing1();
         } else if (this.enableEmail || this.bigCheck() ) {
             ... lots of stuff1 lines  .....
        } else {
             .. some different things here....
         }
    }
    public void stuff2() {
         .....
         if ( this.enableCall ||  !this.enableEmail ) {
             doThing1();
         } else if (this.enableEmail || this.bigCheck() ) {
             ... lots of stuff2 lines .....
        } else {
             .. some different things for stuff2() here....
         }
    }
    private void doThing1() { ... }
    private boolean bigCheck() { .... }
}
...
public class Bar() {
    ....
    Foo foo = new Foo(true, false);
    ....
    Foo foo1 = new Foo(false, true);
}
</pre>
<p></code></p>
<p>Do you see the bugs?</p>
<ol>
<li>Notice that in stuff2() the first conditional is different than the first conditional in stuff1(). Is this a bug? Who knows? ( Lets assume it is )</li>
<li>Because the only users of Foo set either enableCall or enableEmail, the only actual code paths through Foo.stuff1() and Foo.stuff2() result in calls to doThing1()</li>
</ol>
<p>A developer just inspecting Foo can find neither issue easily. </p>
<p>Subclassing/alternative interface implementations solve this problem. <em>The subclass created decides, at object creation, all the conditionals</em>.</p>
<p>So the above code becomes:<br />
<code>
<pre>public interface Foo {
    void stuff1();
    void stuff2();
}

//  this.enableCall ||  this.enableEmail case ( The original stuff2() check was wrong )
public class Foo1Impl() implements Foo {
    public void stuff1() { doThing1(); }
    public void stuff2() { doThing1(); }
    private void doThing1() { .... }
}

// !this.enableCall &#038;&#038; this.enableEmail case
public class Foo2Impl() implements Foo {
    public void stuff1() { if (bigCheck() ) { ... lots of stuff1 lines  ..... } }
    public void stuff2() { if (bigCheck() ) { ... lots of stuff2 lines  ..... } }
    private boolean bigCheck() { .... }
}
public class Foo3Impl() implements Foo {
    public void stuff1() {
          .. some different things for stuff1() here.... }
    public void stuff2() {
         .. some different things for stuff2() here.... }
}

public class Bar() {
    ....
    Foo foo = new Foo1Impl();
    ....
    Foo foo1 = new Foo1Impl();
}
</pre>
<p></code></p>
<p>Note the consequences of this division, </p>
<ol>
<li>doThing1() can only be called by a Foo1Impl.</li>
<li>bigCheck() is isolated to Foo2Impl</li>
<li>depending on bigCheck()&#8217;s implementation, bigCheck() may be could be called once to determine if Foo2Impl or Foo3Impl is created.</li>
<li>There is no question about the stuff2() check being correct or incorrect. ( the conditional no longer exists! )</li>
<li>And it is now obvious that only Foo1Impl&#8217;s code path is used. If this is a bug, the bug is now obvious. If not then the Foo2Impl and Foo3Impl code can be eliminated.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/04/07/use-subclasses-and-alternative-interface-implementations-to-reduce-future-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t jump into a project, wade in</title>
		<link>http://sworddance.com/blog/2011/03/28/dont-jump-into-a-project-wade-in/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=dont-jump-into-a-project-wade-in</link>
		<comments>http://sworddance.com/blog/2011/03/28/dont-jump-into-a-project-wade-in/#comments</comments>
		<pubDate>Mon, 28 Mar 2011 23:25:02 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[software design]]></category>
		<category><![CDATA[starting a company]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=922</guid>
		<description><![CDATA[When starting a new programming task (or company ), it is very tempting to just plunge in and start coding (or doing) right away. The release early-and-often mentality encourages this approach. Documentation becomes optional and design is seat-of-the-pants. Hard-lessons learned &#8230; <a href="http://sworddance.com/blog/2011/03/28/dont-jump-into-a-project-wade-in/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>When starting a new programming task (or company <img src='http://sworddance.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  ), it is very tempting to just plunge in and start coding (or doing) right away. The release early-and-often mentality encourages this approach. Documentation becomes optional and design is seat-of-the-pants.</p>
<p>Hard-lessons learned here tell me this is very, very bad. </p>
<p>Take the time for these steps and minimize use of the computer, because it is very easy to give into the temptation to start coding. And when you are coding, you are thinking about implementation issues, not high-level design issues.</p>
<ol>
<li><em>Write down the goals:</em> This is the easiest trap to avoid and the trap that catches most people. If the developer knows the goals enough to write them down, they can be confident that they are building what was asked for ( just send the written description to the manager or client ). Equally important, the developer knows when they are <em>&#8220;done&#8221; </em>and what is <em>&#8220;good enough&#8221;</em> to satisfy the immediate need
</li>
<li><em>create the use Case tests:</em> Create pseudo-code showing the various operations needed by the project. Missing steps are discovered prior to implementation. Did a previously unknown piece of information just &#8220;magically&#8221; appear? How was that magic knowledge actually retrieved? Are operations out of order?
<p>To help clarify what is meant by a &#8220;Use Case Test&#8221;, here is an example of what I am currently working on:</p>
<p><em>Peter wishes to use Amplafi to upload an image to his website.</em></p>
<div>
From Peter&#8217;s perspective,</p>
<ol>
<li>Peter uploads a image to Amplafi</li>
<li>(Peter does other things)</li>
<li>Amplafi asks Peter about Ftp username/password</li>
<li>Amplafi ftp posts the file to Peter&#8217;s web site.</li>
</ol>
</div>
<div>
<br/>An equivalent Use Case test looks like:</p>
<ol>
<li>Create a ResourceLocation representing the local temporary place an uploaded file will be stored</li>
<li>upload the image from the user&#8217;s computer. (mocked, testing the use case &#8211; not the actual upload)</li>
<li>look up the (test) ftp authentication information for the customer&#8217;s website (<a href="http://mockftpserver.sourceforge.net/">the ftp server is mocked</a> as well, so username/password is fake)</li>
<li>Determine the location the image will be stored on the ftp server</li>
<li>create ResourceLocation holding the image&#8217;s ftp location</li>
<li>perform the upload from Amplafi&#8217;s computer to the ftp server (the actual upload is to the <a href="http://mockftpserver.sourceforge.net/">fake FTP server</a>)</li>
<li>validate that the ftp upload was successful</li>
<li>clean up the temporary copy on Amplafi&#8217;s server</li>
<li>update the ResourceLocations created</li>
<li>Notify the various statuslisteners about the transfer&#8217;s success.</li>
</ol>
</div>
<div><br/>This example Use Case test discovers issues like:</p>
<ul>
<li>The code not having access to the Ftp authentication information</li>
<li>Not being able to determine where the image should be stored temporarily on the Amplafi server</li>
<li>Not knowing when the temporary copy can be deleted.</li>
<li>No mechanism to handle a ftp upload failure ( ftp server dropped connection, had over quota error)</li>
<li>No mechanism for handling overly large files. ( 100TB anyone? )
</ul>
</div>
</li>
<li><em>create the diagrams ( use paper )</em> It is tempting to use a UML tool to create the diagrams; resist temptation. You want to be able to throw away ideas with abandon. Spending effort to create a nice looking UML diagram is wasted if the design concepts need revisiting. Save the tool for when the design has been validated.
</li>
<li><em>create the interfaces:</em> Create the interfaces needed by the pseudo-code in step 2. Define the purpose and nature of the interfaces and its implementors.
<ul>
<li>Are implementors expected to be stateless singleton services? Or are they database objects?</li>
<li>How are implementors created?</li>
<li>What services does an implementor have access to?</li>
<li>How much behavior should be the implementors have? For example, database objects should have minimal logic and have specialized managers do the business logic level operations.</li>
<li>What is the expected lifespan of implementors? Single transaction? Only for a session?</li>
<li>Life cycle control/ownership. Are implementors &#8220;owned&#8221; by another object and when the owner is removed so is this implementation?</li>
</ul>
<p>At this point, I have lots of interfaces, enumerations ( java enum ) that I am creating and destroying willy-nilly. With lots of TODO, FUTURE, and (yes even) HACK comments. Because I haven&#8217;t spent any time actually creating an implementation. I have no reluctance to discard, combine, or separate interfaces.
</li>
<li><em>create the test framework:</em> At this point, the interfaces are nailed down, the test pseudo-code can be converted to actual test code, and &#8230;
</li>
<li><em>create the implementation</em> Unlike true <a href="http://en.wikipedia.org/wiki/Test-driven_development" rel="nofollow">Test Driven Design</a> methodology, I tend to write the implementations in conjunction with the test code. Too many times, I have discovered that nasty little issues around implementation require rethinking the interfaces and the tests. I want to minimize my investment in tests until I am reasonably certain that the production code being tested will not have major API changes because of implementation issues. (Example of an implementation issue: an external library requires data in an order that my planned implementation cannot handle)
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/03/28/dont-jump-into-a-project-wade-in/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do &#8220;status meetings&#8221; right (aka avoiding &#8220;Death-by-Status&#8221;)</title>
		<link>http://sworddance.com/blog/2011/03/04/how-to-do-status-meetings-right-aka-avoiding-death-by-status/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-do-status-meetings-right-aka-avoiding-death-by-status</link>
		<comments>http://sworddance.com/blog/2011/03/04/how-to-do-status-meetings-right-aka-avoiding-death-by-status/#comments</comments>
		<pubDate>Fri, 04 Mar 2011 19:48:05 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[management]]></category>
		<category><![CDATA[starting a company]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://www.sworddance.com/blog/?p=368</guid>
		<description><![CDATA[A truism in the start-ups v. &#8220;big&#8221; company battle is that start-ups have a big advantage because they don&#8217;t have to waste time in internal communication. Status meetings are quick and focused; not long-drawn out off-site affairs. However, many startups &#8230; <a href="http://sworddance.com/blog/2011/03/04/how-to-do-status-meetings-right-aka-avoiding-death-by-status/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A truism in the start-ups v. &#8220;big&#8221; company battle is that start-ups have a big advantage because they don&#8217;t have to waste time in internal communication. Status meetings are quick and focused; not long-drawn out off-site affairs.</p>
<p>However, many startups ignore the underlying reason and value for status updates and many big companies can easily avoid status meetings with a little bit of effort.</p>
<blockquote><p>There is a value to status meetings!? What are you nuts?</p></blockquote>
<p>Nope! Not talking about status <em>meetings</em> &#8211; status <em>updates</em> is where it is at.</p>
<p>Status updates can and should be sent by email every day. By everyone. Including the CEO.</p>
<p>For a status update to have value, it must:</p>
<ul>
<li>Be explanatory as to the reasons work was done. If the reason can&#8217;t be articulated &#8212; why was it done? (&#8220;Did X so that Y feature could be turned on in the next release&#8221;)</li>
<li>Be forward looking. The status update must be usable as a planning document. When will the new feature be completed (in man-hours)</li>
<li>Enable bad process to be discovered. Is something impacting all 10 developers 30 minutes/day? Solving that annoyance will save 5 man-hours a week!</li>
</ul>
<p>The status email should have:</p>
<ul>
<li><u><em>successes</em></u> (include &#8220;in progress&#8221; work): Brag. Celebrate successes. <em>Explicitly</em> indicate if:
<ul>
<li>work is completed as far as the sender is concerned</li>
<li>work is at a good resting point/milestone. Many times a task does not need to be &#8220;completed&#8221;, because &#8220;completed&#8221; means completely done as opposed to &#8220;major roadblock removed&#8221;</li>
<li>work still needs to be done on the task.</li>
</ul>
</li>
<li><u><em>planned</em></u> work for next work period, with best guess time estimates/completion date.  Include next time available (very important for part-time people). Plan out tomorrow today.</li>
<li><u><em>frustrations</em></u> arose that caused time to be &#8220;wasted&#8221; &#8211; use this to help spot problems with processes. The sender is NOT asking for help, but rather is calling out process issues.</li>
<li><u><em>roadblocks</em></u> that help is needed to solve. The sender must provide enough detail to form an actionable question or request. All details that the sender has discovered about the roadblock must be written. Writing out the problem with all the known information:
<ul>
<li>anyone trying to help does not have to duplicate already done research</li>
<li>sometimes leads directly to an &#8220;obvious&#8221; next step</li>
<li>might enable someone else to immediately provide an answer with little to no additional questions.</li>
</ul>
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/03/04/how-to-do-status-meetings-right-aka-avoiding-death-by-status/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do a redirect after POST</title>
		<link>http://sworddance.com/blog/2011/01/25/how-to-do-a-redirect-after-post/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-do-a-redirect-after-post</link>
		<comments>http://sworddance.com/blog/2011/01/25/how-to-do-a-redirect-after-post/#comments</comments>
		<pubDate>Tue, 25 Jan 2011 21:45:50 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[code review]]></category>
		<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=817</guid>
		<description><![CDATA[Continuing an StackOverflow answer: Its a little non-obvious but: create a keyed-object in the user session. the value is a Request + java Future for the result return immediately with a client-side redirect. while the client-side redirect is being handled, &#8230; <a href="http://sworddance.com/blog/2011/01/25/how-to-do-a-redirect-after-post/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://stackoverflow.com/questions/1083357/do-you-always-redirect-after-post-if-yes-how-do-you-manage-it/1083645#1083645">Continuing an StackOverflow answer</a>:</p>
<p>Its a little non-obvious but:</p>
<ol>
<li>create a keyed-object in the user session.</li>
<li>the value is a Request + java Future for the result</li>
<li>return immediately with a client-side redirect.</li>
<li>while the client-side redirect is being handled, have a worker thread work on producing the answer.</li>
</ol>
<p>By the time the client browser completes the redirect, getting the new page&#8217;s images, etc&#8230; the results are waiting for the user.</p>
<p>The alternative is to make the user painfully aware of how long the database is taking.</p>
<p>*Security Update (2011 Jan 24 ) :*</p>
<p>The key is vulnerable to attack since it is part of the response to the client, so</p>
<ol>
<li>Generate a random key </li>
<li>Use user&#8217;s session id as a salt to create a SHA-1</li>
<li>Store both the random key and the SHA-1 in the database with (<RANDOMKEY>, <SHA-1>) as the primary key. (no separate indexing on just the RANDOMKEY.)</li>
<li>Use both RANDOMKEY and the SHA-1 as the db lookup.</li>
<li>Do not store the Session Id (avoid privacy issues with being able to corollate many entries to the same user)</li>
<li>Expire the results after 2-3 days. ( Allows a daily batch job to do the clean up and avoids creating problems for user sessions that are semi-long lasting )</li>
</ol>
<p>This method requires any hacker to know both the session id and the random key. </p>
<p>This approach may seem overkill, but a redirect-hardened mechanism can be used for situations like password resets.</p>
<p>A purely random result key is highly problematic because of the high (and untested) impact of any collisions.  I pick so strongly on this point because:</p>
<ol>
<li>the developer is lulled into complacency about the actual collision rate</li>
<li>the impact of a collisions is unknown and probably untested</li>
<li>when/if a problem shows up:
<ol>
<li>it will be in production</li>
<li>the problem will be intermittent</li>
<li>difficult to reproduce</li>
<li>be disguised as another issue</li>
<li>possibly cause data corruption</li>
<li>possibly result in private user data being exposed</li>
<li>difficult to retroactively correct.</li>
</ol>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/01/25/how-to-do-a-redirect-after-post/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>When to do asynchronous programming</title>
		<link>http://sworddance.com/blog/2011/01/20/when-to-asynchronous-programming/#utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=when-to-asynchronous-programming</link>
		<comments>http://sworddance.com/blog/2011/01/20/when-to-asynchronous-programming/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 22:56:27 +0000</pubDate>
		<dc:creator>patrick</dc:creator>
				<category><![CDATA[technical]]></category>

		<guid isPermaLink="false">http://sworddance.com/blog/?p=804</guid>
		<description><![CDATA[Jose Maria Arranz has a post up about The “joy” of asynchronous programming. Jose&#8217;s key point is programmers are &#8220;reinventing the wheel&#8221;. By manually breaking tasks into a multi-threaded asynchronous/callback paradigm, programmers are reinventing the thread scheduling that the operation &#8230; <a href="http://sworddance.com/blog/2011/01/20/when-to-asynchronous-programming/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.theserverside.com/discussions/thread.tss?thread_id=61693">Jose Maria Arranz has a post up about <em>The “joy” of asynchronous programming</em></a>. Jose&#8217;s key point is programmers are &#8220;reinventing the wheel&#8221;. By manually breaking tasks into a multi-threaded asynchronous/callback paradigm, programmers are reinventing the thread scheduling that the operation system is already doing. Jose&#8217;s point is that programmers should simply create as many threads as needed and let the operating system do its job. At the end of the day, everything funnels through the hardware and in practice the actual concurrency is dictated by the number of cores.</p>
<p>I agree with the thrust of Jose&#8217;s perspective. Programmers should operate at the highest level possible. Thread management is very low-level and best left to the operating system.</p>
<p>However, asynchronous programming is valuable when used correctly. The specific cases that come to mind are:</p>
<ol>
<li><em>Batch Operations</em> ( for example, sending email, or file transfers). Typically the user is not waiting on the completion of the operation. The user may no longer be logged in. So deferring actual execution of the operation is useful and does not create valueless complexity</li>
<li><em>Transferable Operations</em>: operations that can be transferred to another backend server for completion. For example, map/reduce operations with the eventual result being reported to the user.</li>
<li><em>Optional Operations</em>: Operations that give a better user experience, but under heavy load can be terminated and a default result returned. <a href="http://Netflix.com">Netflix</a> does this with user recommendations. When Netflix is under heavy load or if the user-specific recommendations are slow coming back, the operation is timed out and default recommendations re returned.</li>
<li><em>Speculative &#8220;Prefetch&#8221; Operations</em>: Operations that are done in anticipation that the result of the operation may be needed soon.
</li>
<li><em>Network Delayed Operations</em>: If the operation requires connection to an external service for example, sending a calendar item to upcoming.org. <a href="http://Upcoming.org">Upcoming.org</a> may be down or slow. Your site&#8217;s user experience should not be impacted because of delays outside of your control. There is nothing that can be done about upcoming.org&#8217;s behavior. So decoupling your users experience from external influences via an asynchronous programming model is useful.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://sworddance.com/blog/2011/01/20/when-to-asynchronous-programming/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

