<?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>fredericiana &#187; OSU OSL Crosspost</title>
	<atom:link href="http://fredericiana.com/category/english/osl/feed/" rel="self" type="application/rss+xml" />
	<link>http://fredericiana.com</link>
	<description>Open Source, The Web, And German-American Oddities</description>
	<lastBuildDate>Fri, 27 Jan 2012 16:14:39 +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>Day 329 &#8211; Ready for the Sunset</title>
		<link>http://fredericiana.com/2011/11/25/day-329-ready-for-the-sunset/</link>
		<comments>http://fredericiana.com/2011/11/25/day-329-ready-for-the-sunset/#comments</comments>
		<pubDate>Sat, 26 Nov 2011 07:39:24 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Project 365]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=4677</guid>
		<description><![CDATA[A family of tourists, getting ready to watch the sun set on the Pacific coast. I love silhouette photos like this: It&#8217;s fun to see the different characters with their body shapes and postures.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/freeed/6403985255/" title="Day 329 - Ready for the Sunset by Fred​, on Flickr"><img src="http://farm8.staticflickr.com/7034/6403985255_e34eabba52.jpg" width="500" height="333" alt="Day 329 - Ready for the Sunset"/></a></p>
<p>A family of tourists, getting ready to watch the sun set on the Pacific coast. I love silhouette photos like this: It&#8217;s fun to see the different characters with their body shapes and postures.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2011/11/25/day-329-ready-for-the-sunset/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Day 15 &#8211; Open Your Mind, Open Your Heart, Open Your Source</title>
		<link>http://fredericiana.com/2011/01/15/day-15-open-your-heart-open-your-mind-open-your-source/</link>
		<comments>http://fredericiana.com/2011/01/15/day-15-open-your-heart-open-your-mind-open-your-source/#comments</comments>
		<pubDate>Sat, 15 Jan 2011 21:58:15 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Project 365]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=3175</guid>
		<description><![CDATA[This is one of my favorite coffee mugs: I bought it back in 2002 at the LinuxTag open source conference in Karlsruhe, Germany. The motto of that year&#8217;s conference &#8212; &#8220;Open Your Mind, Open Your Heart, Open Your Source&#8221; &#8212; hints at what this conference was still very much about: Convincing decision makers, in particular [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/freeed/5358331340/" title="Day 15 - Open Your Heart, Open Your Mind, Open Your Source by Fred​, on Flickr"><img src="http://farm6.static.flickr.com/5285/5358331340_1d683d4c7c.jpg" width="500" height="333" alt="Day 15 - Open Your Heart, Open Your Mind, Open Your Source" /></a></p>
<p>This is one of my favorite coffee mugs: I bought it back in 2002 at the <a href="http://en.wikipedia.org/wiki/LinuxTag">LinuxTag open source conference</a> in Karlsruhe, Germany. The motto of that year&#8217;s conference &#8212; &#8220;Open Your Mind, Open Your Heart, Open Your Source&#8221; &#8212; hints at what this conference was still very much about: Convincing decision makers, in particular in government organizations, to recognize the potential in open source software and treat it as an opportunity rather than a threat. Luckily, we&#8217;ve come a long way since then.</p>
<p>This is a simple, Saturday-morning sun, &#8220;portrait&#8221; photo, with no alterations whatsoever.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2011/01/15/day-15-open-your-heart-open-your-mind-open-your-source/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Better web forms with HTML5 and Firefox 4</title>
		<link>http://fredericiana.com/2010/12/14/better-web-forms-with-html5-and-firefox-4/</link>
		<comments>http://fredericiana.com/2010/12/14/better-web-forms-with-html5-and-firefox-4/#comments</comments>
		<pubDate>Mon, 13 Dec 2010 23:51:51 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=3078</guid>
		<description><![CDATA[Surely, you&#8217;ve heard of many fancy new features that HTML5 and related technologies bring to the Web now and in the future: open video on the web, canvas, transitions, what have you. But sometimes it&#8217;s the smallest things that have the biggest impact. Besides these hyped features, HTML5 also introduces a number of semantic form [...]]]></description>
			<content:encoded><![CDATA[<p>Surely, you&#8217;ve heard of many fancy new features that HTML5 and related technologies bring to the Web now and in the future: open video on the web, canvas, transitions, what have you.</p>
<p>But sometimes it&#8217;s the <em>smallest things</em> that have the biggest impact. Besides these hyped features, HTML5 also introduces a number of <strong>semantic form fields</strong>. Before, the only textual input the web knew was, well, <em>plain text</em>. It was up to the web application developer to enforce certain rules around that, like making sure the input is a number, or not empty, or even a valid website address (URL).</p>
<p>Firefox 4 <strong>understands</strong> these new input types and helps the user by <strong>enforcing correct values</strong> even before the users submits the form. By handling validation on the client, this enables a consistent form validation UI across websites and keeps the user from constantly submitting forms and wait for the server-side form validation to pass or fail. (NB: This does not relieve the developers of performing server-side checks in order to ensure the security of their web application).</p>
<p>Here is what this looks like in a recent prototype of the <a href="http://input.mozilla.com">Firefox Input</a> site:</p>
<p><a href="http://fredericiana.com/wp-content/uploads/2010/12/html5-feedback-forms-1.jpg"><img src="http://fredericiana.com/wp-content/uploads/2010/12/html5-feedback-forms-1-570x400.jpg" alt="" title="HTML5 Feedback Forms" width="570" height="400" class="aligncenter size-large wp-image-3079" /></a></p>
<p>Another fun little feature, also pictured, is the <strong>placeholder</strong> text attribute. The grayed-out placeholder in a text box shows you an example of what you might enter into this field. Rather than explaining correct values in a huge label or a side note next to the field, developers can show their users much more easily what data they would like them to enter into the form fields.</p>
<p>All of this makes for fewer mistakes entering data into web forms, which is both beneficial to the user (getting the job done faster) and the developer (collecting better data). Win-win!</p>
<p>For much more detailed on HTML5 forms, placeholders, validation, etc., take a look at Mark Pilgrim&#8217;s excellent <a href="http://diveintohtml5.org/forms.html">Dive Into HTML5</a>. Also, don&#8217;t miss out on Anthony Ricaud&#8217;s <a href="http://hacks.mozilla.org/2010/11/firefox-4-html5-forms/">in-depth description of HTML5 forms in Firefox</a> on the Mozilla Hacks blog.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/12/14/better-web-forms-with-html5-and-firefox-4/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Adding Support for Stronger Password Hashes To Django</title>
		<link>http://fredericiana.com/2010/10/12/adding-support-for-stronger-password-hashes-to-django/</link>
		<comments>http://fredericiana.com/2010/10/12/adding-support-for-stronger-password-hashes-to-django/#comments</comments>
		<pubDate>Tue, 12 Oct 2010 17:28:21 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[crypto]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=2987</guid>
		<description><![CDATA[Cryptographic hash functions play an important part in application security: Usually, user passwords are hashed and stored in the database. When someone logs in, their input is hashed as well and compared to the database content. A weak hash is almost as bad as no hash at all: If someone steals (part of) your user [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Cryptographic_hash_function">Cryptographic hash functions</a> play an important part in application security: Usually, user passwords are hashed and stored in the database. When someone logs in, their input is hashed as well and compared to the database content. A weak hash is almost as bad as no hash at all: If someone steals (part of) your user database, they can analyze the hashed values to detect the actual password&#8211;and then use it, without the owner&#8217;s knowledge, to log into your application on their behalf.</p>
<p>As part of a proactive web application security model, it is therefore important to stay ahead of the game attackers play and use sufficiently strong encryption to store passwords. Since <a href="http://en.wikipedia.org/wiki/Cryptanalysis">cryptanalysts</a> are spending great efforts on breaking encryption algorithms (with the help of increasingly fast and cheap computers), SHA-1 is meanwhile considered only <em>borderline</em> in strength. Not a good position to be in if you want to write future-proof apps.</p>
<p><a href="http://djangoproject.com">Django</a> (our web app framework of choice at Mozilla) does not support anything stronger than its default, SHA-1, and has, in the past, <a href="http://code.djangoproject.com/ticket/5600">WONTFIXed attempts to increase hash strengths</a>, citing strong backwards compatibility as the reason. As long as Django targets Python 2.4 as its greatest common denominator, this is unlikely to change. Writing a full-blown, <a href="http://docs.djangoproject.com/en/dev/topics/auth/#writing-an-authentication-backend">custom authentication backend</a> for the purpose is an option (the Mozilla Add-ons project <a href="http://github.com/jbalogh/zamboni/blob/master/apps/users/models.py">chose to do that</a>),  but it seemed overkill to me, given that with the exception of the hash strength, Django&#8217;s built-in authentication code works just fine.</p>
<p>So I decided to monkey-patch their auth model at run time, to add SHA-256 support to my application (while staying backwards-compatible with older password hashes possibly existing in the database).</p>
<p>The code is simple, and I made an effort to keep it as uninvasive as possible, so that it can be removed easily in case Django ever <em>does</em> get support for stronger hashes down the road. Let me know what you think:<br />
<script src="http://gist.github.com/622519.js"> </script><br />
(Embedded from a <a href="http://gist.github.com/622519">Gist on Github</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/10/12/adding-support-for-stronger-password-hashes-to-django/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Decoding HTML Entities to Text in Python</title>
		<link>http://fredericiana.com/2010/10/08/decoding-html-entities-to-text-in-python/</link>
		<comments>http://fredericiana.com/2010/10/08/decoding-html-entities-to-text-in-python/#comments</comments>
		<pubDate>Fri, 08 Oct 2010 08:42:37 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=2969</guid>
		<description><![CDATA[A while ago, I had to import some HTML into a Python script and found out that—while there is cgi.escape() for encoding to HTML—there did not seem to be an easy or well-documented way for decoding HTML entities in Python. Silly, right? Turns out, there are at least three ways of doing it, and which [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago, I had to import some HTML into a Python script and found out that—while there is <code>cgi.escape()</code> for <em>encoding to</em> HTML—there did not seem to be an easy or well-documented way for <em>decoding</em> HTML entities in Python.</p>
<p>Silly, right?</p>
<p>Turns out, there are at least three ways of doing it, and which one you use probably depends on your particular app&#8217;s needs.</p>
<h2>1) Overkill: BeautifulSoup</h2>
<p><a href="http://www.crummy.com/software/BeautifulSoup/">BeautifulSoup</a> is an HTML parser that will also decode entities for you, like this:</p>
<pre>soup = BeautifulSoup(html, convertEntities=BeautifulSoup.HTML_ENTITIES)</pre>
<p>The advantage is its fault-tolerance. If your input document is malformed, it will do its best to extract a meaningful DOM tree from it. The disadvantage is, if you just have a few short strings to convert, introducing the dependency on an entire HTML parsing library into your project seems overkill.</p>
<h2>2) Duct Tape: htmlentitydefs</h2>
<p>Python comes with a list of known HTML entity names and their corresponding unicode codepoints. You can use that together with a simple regex to replace entities with unicode characters:</p>
<pre>import htmlentitydefs, re
mystring = re.sub('&#038;([^;]+);', lambda m: unichr(htmlentitydefs.name2codepoint[m.group(1)]), mystring)
print mystring.encode('utf-8')</pre>
<p>Of course, this works. But I hear you saying, <em>how in the world is this not in the standard library?</em> And the geeks among you have also noticed that this will not work with <em>numerical</em> entities. While <code>&amp;copy;</code> will give you <code>&copy;</code>, <code>&amp;#169;</code> will fail miserably. If you&#8217;re handling random, user-entered HTML, this is not a great option.</p>
<h2>3) Standard library to the rescue: HTMLParser</h2>
<p>After all this, I&#8217;ll give you the option I like best. The standard lib&#8217;s very own <a href="http://docs.python.org/library/htmlparser.html">HTMLParser</a> has an <em>undocumented</em> function <code>unescape()</code> which does exactly what you think it does:</p>
<pre>>>> import HTMLParser
>>> h = HTMLParser.HTMLParser()
>>> s = h.unescape('&amp;copy; 2010')
>>> s
u'\xa9 2010'
>>> print s
© 2010
>>> s = h.unescape('&amp;#169; 2010')
>>> s
u'\xa9 2010'
</pre>
<p>So unless you need the advanced parsing capabilities of BeautifulSoup or want to show off your mad regex skills, this might be your best bet for squeezing unicode out of HTML snippets in Python.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/10/08/decoding-html-entities-to-text-in-python/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Next Steps for the Copy ShortURL Addon</title>
		<link>http://fredericiana.com/2010/07/20/next-steps-for-the-copy-shorturl-addon/</link>
		<comments>http://fredericiana.com/2010/07/20/next-steps-for-the-copy-shorturl-addon/#comments</comments>
		<pubDate>Tue, 20 Jul 2010 18:13:25 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[copyshorturl]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=2885</guid>
		<description><![CDATA[The Copy ShortURL Add-on has been on AMO for a week now and was recently approved to be public, so now I have a user base to please I am inclined to drop the code onto github, where I&#8217;d get a proper version history along with a bug tracker. Update: It&#8217;s on github now! For [...]]]></description>
			<content:encoded><![CDATA[<p>The <a href="https://addons.mozilla.org/en-US/firefox/addon/197224/">Copy ShortURL Add-on</a> has been on AMO for a week now and was recently approved to be public, so now I have a user base to please <img src='http://fredericiana.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I am inclined to drop the code onto github, where I&#8217;d get a proper version history along with a bug tracker. <strong>Update:</strong> <a href="http://github.com/fwenzel/copy-shorturl/">It&#8217;s on github now!</a></p>
<p>For now though, here are a few <strong>ideas</strong> I have for the add-on, in no particular order and with no promise that I&#8217;m about to implement any of this right away:</p>
<ul>
<li><strong>Allow other URL shortening services.</strong> tinyURL is all fun and games, and I chose it over bit.ly because it does not require an API key &#8212; but if you have one at hand, you should be able to use any service you like. Even if only by setting an about:config preference.</li>
<li><strong>Incorporate selected sites</strong> that support short URLs but do not publish them as a header. Zappos (zapp.me), for example. Others seem to have a short URL available (such as: NY Times (nyti.ms), Amazon (amzn.to),  ESPN (es.pn)) but only use them on their twitter account and not on every webpage, so there might be nothing we can do <img src='http://fredericiana.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</li>
<li>When shortening, need to make sure not to use the <em>current</em> URL but the <strong>canonical URL</strong> if such a header exists. (<a href="http://github.com/fwenzel/copy-shorturl/issues/issue/3">Fixed!</a>)</li>
</ul>
<p>Let me know what you think! I&#8217;d like to know if any other things come to your minds, or which of the above you&#8217;d find especially useful.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/07/20/next-steps-for-the-copy-shorturl-addon/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Copy Short URL Add-on</title>
		<link>http://fredericiana.com/2010/07/10/copy-short-url-add-on/</link>
		<comments>http://fredericiana.com/2010/07/10/copy-short-url-add-on/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 17:25:33 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[addons]]></category>
		<category><![CDATA[copyshorturl]]></category>
		<category><![CDATA[jetpack]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=2874</guid>
		<description><![CDATA[Update: The add-on is now on AMO! Check it out! Also, feedback is greatly appreciated! This week during the Mozilla Summit in Whistler, British Columbia, there was a &#8220;Rocket Your Firefox&#8221; Jetpack contest: The idea, make a new add-on using the Jetpack SDK, submit it, win a prize. So I went ahead and made a [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update:</strong> The add-on is now on AMO! <a href="https://addons.mozilla.org/en-US/firefox/addon/197224/">Check it out!</a> Also, feedback is greatly appreciated!</p>
<hr />
<p>This week during the <a href="https://wiki.mozilla.org/Summit2010">Mozilla Summit</a> in Whistler, British Columbia, there was a <a href="https://wiki.mozilla.org/Summit2010/Rocket_Your_Firefox">&#8220;Rocket Your Firefox&#8221;</a> <a href="http://jetpack.mozillalabs.com/">Jetpack</a> contest: The idea, make a new add-on using the Jetpack SDK, submit it, win a prize.</p>
<p>So I went ahead and made a jetpack called &#8220;Copy Short URL&#8221; and it does what it sounds like:</p>
<blockquote><p>On any webpage, you get a new item in the right click menu called &#8220;copy short URL&#8221;. When you click it, the add-on looks for a canonical short URL exposed in the page header. Currently, a number of major websites expose their own short URLs for any entry on their webpages, among these: youtube (&#8220;youtu.be/&#8230;&#8221;), flickr (&#8220;flic.kr/&#8230;&#8221;), Arstechnica, Techcrunch, and many more.</p>
<p>If, however, the site does not name its own short URL, the add-on automatically falls back to making a short URL using tinyurl.com.</p>
<p>Either way, after a fraction of a second, you end up with a short URL in your clipboard, ready to be used in forum posts, tweets, or wherever else you please.</p></blockquote>
<p>My add-on won the contest in the &#8220;most useful&#8221; category. The prize was an awesome jetpack sweatshirt:</p>
<p><img src="http://fredericiana.com/wp-content/uploads/2010/07/jetpack-sweatshirt-front-278x300.jpg" alt="" title="Jetpack Sweatshirt" width="278" height="300" class="alignleft size-medium wp-image-2876" /></p>
<p><img src="http://fredericiana.com/wp-content/uploads/2010/07/jetpack-sweatshirt-back-249x300.jpg" alt="" title="Jetpack Sweatshirt" width="249" height="300" class="alignnone size-medium wp-image-2875" /></p>
<p>If you want to check out the add-on, it is currently available (open source, of course) on the <a href="https://builder.mozillalabs.com/addons/by/112675/">add-ons builder website</a>. I also uploaded the <a href="https://addons.mozilla.org/en-US/firefox/addon/197224/">add-on</a> to AMO.</p>
<p>Hope you find it useful!</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/07/10/copy-short-url-add-on/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>Under the Hood of Firefox Input</title>
		<link>http://fredericiana.com/2010/06/23/under-the-hood-of-firefox-input/</link>
		<comments>http://fredericiana.com/2010/06/23/under-the-hood-of-firefox-input/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 16:03:08 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[feedback]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[input]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=2834</guid>
		<description><![CDATA[Note: Several people asked where the link is to actually add feedback to the site. This is, of course, a good point. As mentioned in the comments: The designated entry point for the feedback application is going to be an extension bundled with Firefox 4 Beta. For more information, please read Aakash&#8217;s blog post. To [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Note:</strong> Several people asked where the link is to actually <em>add feedback</em> to the site. This is, of course, a good point. As mentioned in the comments: The designated entry point for the feedback application is going to be an extension bundled with Firefox 4 Beta. For more information, please read <a href="http://aakash.doesthings.com/2010/06/25/hi-my-name-is-firefox-input/">Aakash&#8217;s blog post</a>. To <strong>try out</strong> the application already, feel free to add <a href="http://input.stage.mozilla.com/happy">happy</a> or <a href="http://input.stage.mozilla.com/sad">sad</a> feedback to the test site.</p>
<hr />
<p>This morning, we published the <a href="http://input.mozilla.com">Firefox Input</a> application. It is a little web application soliciting feedback from our <a href="http://www.mozilla.com/en-US/firefox/all-beta.html">Firefox Beta Program</a> users. The aim is to make it as easy as possible for people to tell us what specifically they like or dislike about an upcoming version of Firefox.</p>
<p><a href="http://fredericiana.com/wp-content/uploads/2010/06/fx-input-dashboard.jpg"><img src="http://fredericiana.com/wp-content/uploads/2010/06/fx-input-dashboard-300x210.jpg" alt="" title="Firefox Input: Dashboard" width="300" height="210" class="aligncenter size-medium wp-image-2835" /></a></p>
<p>The application was, as far as software goes, developed very rapidly: We made it from requirements to production in a mere three weeks. What made this possible was a number of reusable components that allowed us to avoid reinventing the wheel and stay focused on making the application awesome.</p>
<p><a href="http://fredericiana.com/wp-content/uploads/2010/06/fx-input-happy.jpg"><img src="http://fredericiana.com/wp-content/uploads/2010/06/fx-input-happy-300x100.jpg" alt="" title="Firefox Input: Happy Feedback" width="300" height="100" class="aligncenter size-medium wp-image-2842" /></a></p>
<p><a href="http://fredericiana.com/wp-content/uploads/2010/06/fx-input-sad.jpg"><img src="http://fredericiana.com/wp-content/uploads/2010/06/fx-input-sad-300x110.jpg" alt="" title="Firefox Input: Sad Feedback" width="300" height="110" class="aligncenter size-medium wp-image-2843" /></a></p>
<p>A few key components of the Input application:</p>
<ul>
<li><strong><a href="http://www.djangoproject.com/">Django</a>.</strong> I can&#8217;t stress this enough, but Django is a fantastic web application framework. It makes it incredibly easy to set up a web application quickly and securely. Their built-in admin pages save me days of work that I would otherwise have to spend to allow project admins to edit the application data.</li>
<li><strong><a href="http://jinja.pocoo.org/2/">Jinja2</a> and <a href="http://github.com/jbalogh/jingo/">Jingo</a>.</strong> The only big drawback of Django is its template language: The instant you make nontrivial web applications, it gets in your way. Luckily, like all parts of Django it is replaceable: Jinja2 and Jeff Balogh&#8217;s <em>jingo</em> interface comes to the rescue. The two of them are already in use over at <a href="https://addons.mozilla.org">AMO</a> and also serve us well on Input.</li>
<li><strong>Term extraction.</strong> Firefox Input extracts key words from all feedback. Sure, you can just split the sentences into words, but if you want to avoid collecting all sorts of meaningless particles (&#8220;the&#8221;, &#8220;a&#8221;, &#8220;if&#8221;, &#8230;), it becomes a little more complicated. We are using the <a href="http://pypi.python.org/pypi/topia.termextract/">topia.termextract</a> library, which gladly does the heavy lifting for us. Only caveat: It only works for English, so once the application is localized, we need a different solution for the other languages.</li>
<li><strong>Search.</strong> For the longest time, there was no generic way to do search in a Django app (other than straight SQL queries). In the meantime, <a href="http://haystacksearch.org/">haystack</a> has started to fill that gap. We use it on Input in conjunction with <a href="http://bitbucket.org/mchaput/whoosh/wiki/Home">Whoosh</a>, a pure-Python search library. That is very easy to set up, at the expense of scalability &#8212; if we outgrow it, however, it will be easy to switch search engines with virtually no code changes at all. Thumbs up!</li>
<li><strong>Product details.</strong> Only very recently we released a <a href="http://blog.mozilla.com/webdev/2010/06/01/django-mozilla-product-details-because-short-library-names-are-for-wimps/">Mozilla product details library</a> for Django, and this is the first application to rely intimately on up-to-date product data: Input only lets users of the latest beta versions of Firefox add feedback, so it auto-updates its product data periodically to gather feedback for the newest versions as quickly as possible.</li>
</ul>
<p>As always, the <a href="http://github.com/fwenzel/reporter">source code</a> of Firefox Input is openly and freely available. If you notice any problems with it, feel free to fork it on github, or <a href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Webtools&#038;component=Input">file a bug</a> in our <a href="https://bugzilla.mozilla.org/buglist.cgi?resolution=---&#038;query_format=advanced&#038;component=Input&#038;product=Webtools">bug tracker</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/06/23/under-the-hood-of-firefox-input/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Hot-plugging a SATA drive under Linux</title>
		<link>http://fredericiana.com/2010/06/15/hot-plugging-a-sata-drive-under-linux/</link>
		<comments>http://fredericiana.com/2010/06/15/hot-plugging-a-sata-drive-under-linux/#comments</comments>
		<pubDate>Tue, 15 Jun 2010 08:14:39 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=2812</guid>
		<description><![CDATA[Hard drives (or controllers, rather) capable of hot-swapping (that is, plugging and un-plugging a drive into a running system) used to be a feature reserved for expensive professional RAID installations. With the advent of SATA in the mainstream, that has changed. Supposedly any SATA hard drive can be hot-plugged now. But what if you actually [...]]]></description>
			<content:encoded><![CDATA[<p>Hard drives (or controllers, rather) capable of <a href="http://en.wikipedia.org/wiki/Hot_swapping">hot-swapping</a> (that is, plugging and un-plugging a drive into a running system) used to be a feature reserved for expensive professional RAID installations.</p>
<p>With the advent of SATA in the mainstream, that has changed. <em>Supposedly</em> any SATA hard drive can be hot-plugged now. But what if you actually try and nothing happens? Chances are your controller doesn&#8217;t let the OS know about the newly found drive on its own.</p>
<p>Try this to rescan the SCSI hosts (each SATA port appears as a SCSI bus):</p>
<pre><code>echo "0 0 0" >/sys/class/scsi_host/host&lt;n&gt;/scan</code></pre>
<p>and to remove a drive:</p>
<pre><code>echo x > /sys/bus/scsi/devices/&lt;n&gt;:0:0:0/delete</code></pre>
<p>Replace <code>&lt;n&gt;</code> with the right numbers for your system, respectively.</p>
<p>Also, just to state the obvious, don&#8217;t do that to a mounted drive, ever. Especially not the one that holds your system partition <img src='http://fredericiana.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p class="credits">(<a href="http://forums.whirlpool.net.au/forum-replies-archive.cfm/1041574.html">via</a>.)</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/06/15/hot-plugging-a-sata-drive-under-linux/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Three ways to add a robots.txt to your Django project</title>
		<link>http://fredericiana.com/2010/06/09/three-ways-to-add-a-robots-txt-to-your-django-project/</link>
		<comments>http://fredericiana.com/2010/06/09/three-ways-to-add-a-robots-txt-to-your-django-project/#comments</comments>
		<pubDate>Wed, 09 Jun 2010 11:40:51 +0000</pubDate>
		<dc:creator>Fred</dc:creator>
				<category><![CDATA[Mozilla Crosspost]]></category>
		<category><![CDATA[OSU OSL Crosspost]]></category>
		<category><![CDATA[Tech Talk]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[robots]]></category>
		<category><![CDATA[seo]]></category>

		<guid isPermaLink="false">http://fredericiana.com/?p=2791</guid>
		<description><![CDATA[Need to add a robots.txt file to your Django project to tell Google and friends what and what not to index on your site? Here are three ways to add a robots.txt file to Django. 1) The (almost) one-liner In an article on e-scribe.com, Paul Bissex suggest to add this rule to your urls.py file: [...]]]></description>
			<content:encoded><![CDATA[<p>Need to add a <a href="http://en.wikipedia.org/wiki/Robots_exclusion_standard">robots.txt</a> file to your Django project to tell Google and friends what and what not to index on your site?</p>
<p>Here are three ways to add a robots.txt file to Django.</p>
<h2>1) The (almost) one-liner</h2>
<p>In an <a href="http://news.e-scribe.com/431">article</a> on e-scribe.com, Paul Bissex suggest to add this rule to your <code>urls.py</code> file:</p>
<pre><code>from django.http import HttpResponse

urlpatterns = patterns('',
    ...
    (r'^robots\.txt$', lambda r: HttpResponse("User-agent: *\nDisallow: /", mimetype="text/plain"))
)
</code></pre>
<p>The advantage of this solution is, it is a simple one-liner disallowing all bots, with no extra files to be created, and no clutter anywhere. It&#8217;s as simple as it gets.</p>
<p>The disadvantage, obviously, is the missing scalability. The instant you have more than one rule to add, this approach quickly balloons out of hand. Also, one could argue that <code>urls.py</code> is not the right place for <em>content</em> of any kind.</p>
<h2>2) Direct to template</h2>
<p>This one is the most intuitive approach: Just drop a <code>robots.txt</code> file into your main templates directory and link to it via <code>direct_to_template</code>:</p>
<pre><code>from django.views.generic.simple import direct_to_template

urlpatterns = patterns('',
    ...
    (r'^robots\.txt$', direct_to_template,
     {'template': 'robots.txt', 'mimetype': 'text/plain'}),
)
</code></pre>
<p>Just remember to set the MIME type appropriately to <code>text/plain</code>, and off you go.</p>
<p>Advantage is its simplicity, and if you already have a robots.txt file you want to reuse, there&#8217;s no overhead for that.</p>
<p>Disadvantage: If your robots file changes somewhat frequently, you need to push changes to your web server every time. That can get tedious. Also, this approach does not save you from typos or the like.</p>
<h2>3) The django-robots app</h2>
<p>Finally, there&#8217;s a full-blown django app available that you can install and drop into your <code>INSTALLED_APPS</code>: It is called <a href="http://pypi.python.org/pypi/django-robots">django-robots</a>.</p>
<p>For small projects, this would be overkill, but if you have a lot of rules, or if you need a site admin to change them without pushing changes to the web server, this is your app of choice.</p>
<h2>Which one is right for me?</h2>
<p>Depending on how complicated your rule set is, either one of the solutions may be the best fit for you. Just choose the one that you are the most comfortable with and that fits the way you are using robots.txt in your application.</p>
]]></content:encoded>
			<wfw:commentRss>http://fredericiana.com/2010/06/09/three-ways-to-add-a-robots-txt-to-your-django-project/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

