<?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>Austin Matzko&#039;s Blog &#187; Computers</title>
	<atom:link href="http://austinmatzko.com/category/computers/feed/" rel="self" type="application/rss+xml" />
	<link>http://austinmatzko.com</link>
	<description>A blog about philosophy, Christianity, web development and whatever else I feel like writing about.</description>
	<lastBuildDate>Wed, 16 Mar 2011 17:14:59 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2-RC4-18391</generator>
		<item>
		<title>I Am an Official Regex Day Winner</title>
		<link>http://austinmatzko.com/2008/06/06/happy-regex-day-to-me/</link>
		<comments>http://austinmatzko.com/2008/06/06/happy-regex-day-to-me/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 03:38:34 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Perl]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Regular Expressions]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=478</guid>
		<description><![CDATA[Ben Nadel declared June 1, 2008 the first National Regular Expression Day, and to celebrate he hosted a giveaway of regex-related prizes, including Jeffrey Friedl&#8217;s Mastering Regular Expressions. As you can see, I won the book and got it in the mail yesterday. I use regular expressions all the time&#8212;in PHP, JavaScript, Perl, sed, grep, [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://bennadel.com/index.cfm?dax=blog:1243.view">Ben Nadel declared June 1, 2008 the first National Regular Expression Day</a>, and to celebrate he hosted a giveaway of regex-related prizes, including Jeffrey Friedl&#8217;s <a href="http://www.amazon.com/Mastering-Regular-Expressions-Jeffrey-Friedl/dp/0596528124"><i>Mastering Regular Expressions</i></a>.  As you can see, I won the book and got it in the mail yesterday. I use <a href="http://en.wikipedia.org/wiki/Regular_expressions">regular expressions</a> all the time&#8212;in PHP, JavaScript, Perl, sed, grep, and vi&#8212;and they&#8217;re so essential to my work that I can&#8217;t wait to &#8220;master&#8221; them.  </p>
<p>I think I may have sunk to new lows of geekiness. </p>
<p><img src="http://www.ilfilosofo.com/wp-content/uploads/regex_book.jpg" alt="" title="regex_book" width="300" height="245" class="alignnone size-full wp-image-481" /></p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/06/06/happy-regex-day-to-me/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Webmonkey.com Returns</title>
		<link>http://austinmatzko.com/2008/05/22/webmonkeycom-returns/</link>
		<comments>http://austinmatzko.com/2008/05/22/webmonkeycom-returns/#comments</comments>
		<pubDate>Thu, 22 May 2008 15:04:17 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[DHTML]]></category>
		<category><![CDATA[Webmonkey]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=466</guid>
		<description><![CDATA[When I was first learning web development about ten years ago, I frequently consulted Webmonkey.com for tutorials about how to do all things &#8220;DHTML.&#8221; I still remember how an article comparing frames to a cafeteria tray made it all click for me, for some reason. I also picked up some bad habits that I had [...]]]></description>
			<content:encoded><![CDATA[<p>When I was first learning web development about ten years ago, I frequently consulted Webmonkey.com for tutorials about how to do all things &#8220;DHTML.&#8221;  I still remember how an article comparing frames to a cafeteria tray made it all click for me, for some reason. I also picked up some bad habits that I had to unlearn later, such as using table elements for page layout. But that&#8217;s no slam against Webmonkey: they were just explaining the common web practices of the day.</p>
<p>Webmonkey stopped producing new content in the early 2000s and was sold by Wired to Lycos, I think, but much of the old content remained, such as the <a href="http://www.webmonkey.com/reference/Special_Characters">special characters reference</a>, which I consult occasionally.     Now <a href="http://www.webmonkey.com/blog/Welcome_to_the_All_New_Webmonkey">the site has been re-purchased by Wired</a>, which has decided to re-publish the tutorials on a wiki.  That&#8217;s probably the best approach if you can&#8217;t spare the staff to manage the old content, but the historian in me is bothered that <a href="http://web.archive.org/web/20030124061147/hotwired.lycos.com/webmonkey/programming/javascript/tutorials/tutorial1.html">Thau&#8217;s JavaScript tutorial</a> is gone, replaced by <a href="http://www.webmonkey.com/tutorial/JavaScript_Tutorial">something generic</a>.  Why couldn&#8217;t Webmonkey have kept the old articles intact, perhaps with a notice suggesting that a piece might be outdated and a link to the new wiki?  That&#8217;s sort of what <a href="http://www.quirksmode.org/resources.html">PPK does at Quirksmode</a>; he separates articles into &#8220;active&#8221; and &#8220;archived.&#8221;  I&#8217;m sure we can live without knowing how to code for Netscape Navigator 4, but it&#8217;s good to remember where we&#8217;ve come from, to remember how and why things have changed since then.  </p>
<p>However, Webmonkey promises to start creating new content relevant to today&#8217;s web, and that will be good news for those starting into web development.</p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/05/22/webmonkeycom-returns/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>OpenID Servers: Allow Redundant Means of Access</title>
		<link>http://austinmatzko.com/2008/05/08/openid-servers/</link>
		<comments>http://austinmatzko.com/2008/05/08/openid-servers/#comments</comments>
		<pubDate>Thu, 08 May 2008 14:43:57 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[OpenID]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=460</guid>
		<description><![CDATA[That&#8217;s the lesson I take from Kyle Neath&#8217;s critique of OpenID (HT: Ma.tt), from his first point, the one that I think has the most traction. OpenID servers should allow users to associate their account with several OpenID providers, if they want, and/or an email address.]]></description>
			<content:encoded><![CDATA[<p>That&#8217;s the lesson I take from <a href="http://warpspire.com/features/open-id/">Kyle Neath&#8217;s critique of OpenID </a> (HT: <a href="http://ma.tt/2008/05/kyle-skips-openid/">Ma.tt</a>),  from his first point, the one that I think has the most traction.  <a href="http://openid.net/">OpenID</a> servers should allow users to associate their account with several OpenID providers, if they want, and/or an email address. </p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/05/08/openid-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>sed and Multi-Line Search and Replace</title>
		<link>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/</link>
		<comments>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/#comments</comments>
		<pubDate>Sat, 26 Apr 2008 17:21:15 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[grep]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[sed]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=458</guid>
		<description><![CDATA[I&#8217;ve been experimenting with getting regular expression patterns to match over multiple lines using sed. For example, one might want to change &#60;p&#62;previous text&#60;/p&#62; &#60;h2&#62; &#60;a href=&#34;http://some-link.com&#34;&#62;A title here&#60;/a&#62; &#60;/h2&#62; &#60;p&#62;following text&#60;/p&#62; to &#60;p&#62;previous text&#60;/p&#62; No title here &#60;p&#62;following text&#60;/p&#62; sed cycles through each line of input one line at a time, so the most [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been experimenting with getting regular expression patterns to match over multiple lines using <a href="http://en.wikipedia.org/wiki/Sed"><code>sed</code></a>.  For example, one might want to change</p>
<div class="filosofo-highlight-light html4strict" style="font-family: monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></span>previous text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;h2&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;a</span> <span style="color: #000066;">href</span><span style="color: #66cc66;">=</span><span style="color: #ff0000;">&quot;http://some-link.com&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>A title here<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/a&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/h2&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></span>following text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
<p>to </p>
<div class="filosofo-highlight-light html4strict" style="font-family: monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></span>previous text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span><br />
No title here<br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;p&gt;</span></span>following text<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/p&gt;</span></span></div>
<p><code>sed</code> cycles through each line of input one line at a time, so the most obvious way to match a pattern that extends over several lines is to concatenate all the lines into what is called <code>sed</code>&#8216;s &#8220;hold space,&#8221; then look for the pattern in that (long) string.  That&#8217;s what I do in the following lines:</p>
<div class="filosofo-highlight-light bash" style="font-family: monospace;"><span style="color: #808080; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #c20cb9; font-weight: bold;">sed</span> -n <span style="color: #ff0000;">'<br />
# if the first line copy the pattern to the hold buffer<br />
1h<br />
# if not the first line then append the pattern to the hold buffer<br />
1!H<br />
# if the last line then ...<br />
$ {<br />
&nbsp; &nbsp; &nbsp; &nbsp; # copy from the hold to the pattern buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; g<br />
&nbsp; &nbsp; &nbsp; &nbsp; # do the search and replace<br />
&nbsp; &nbsp; &nbsp; &nbsp; s/&lt;h2.*&lt;/h2&gt;/No title here/g<br />
&nbsp; &nbsp; &nbsp; &nbsp; # print<br />
&nbsp; &nbsp; &nbsp; &nbsp; p<br />
}<br />
'</span> sample.php <span style="color: #000000; font-weight: bold;">&gt;</span> sample-edited.php;</div>
<p>A more compact version: </p>
<div class="filosofo-highlight-light bash" style="font-family: monospace;"><br />
<span style="color: #c20cb9; font-weight: bold;">sed</span> -n <span style="color: #ff0000;">'1h;1!H;${;g;s/&lt;h2.*&lt;/h2&gt;/No title here/g;p;}'</span> sample.php <span style="color: #000000; font-weight: bold;">&gt;</span> sample-edited.php;<br />
&nbsp;</div>
<p>As far as I can tell, that&#8217;s the most efficient way to match general multi-line patterns.  I initially thought it might be more efficient not to keep the complete input in the hold buffer, so I modified the algorithm to print out the string whenever a match is found:</p>
<div class="filosofo-highlight-light bash" style="font-family: monospace;"><br />
<span style="color: #808080; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #c20cb9; font-weight: bold;">sed</span> -n <span style="color: #ff0000;">'1h <br />
1!{<br />
&nbsp; &nbsp; &nbsp; &nbsp; # if the sought-after regex is not found, append the pattern space to hold space<br />
&nbsp; &nbsp; &nbsp; &nbsp; /&lt;h2.*&lt;/h2&gt;/ !H<br />
&nbsp; &nbsp; &nbsp; &nbsp; # copy hold space into pattern space<br />
&nbsp; &nbsp; &nbsp; &nbsp; g<br />
&nbsp; &nbsp; &nbsp; &nbsp; # if the regex is found, then...<br />
&nbsp; &nbsp; &nbsp; &nbsp; /&lt;h2.*&lt;/h2&gt;/ {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # the regular expression<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; s/&lt;h2.*&lt;/h2&gt;/No title here/g<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # print <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; p<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # read the next line into the pattern space<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; n<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; # copy the pattern space into the hold space<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; h<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; # copy pattern buffer into hold buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; h<br />
}<br />
# if the last line then print<br />
$p<br />
'</span> sample.php <span style="color: #000000; font-weight: bold;">&gt;</span> sample-edited.php;<br />
&nbsp;</div>
<p>In the last example, <code>sed</code> concatenates lines only until it finds a match, and then it prints the line (after substituting the text).  Then, it starts again to concatenate the following lines.  </p>
<p>However, that approach is usually massively inefficient, as the regex work increases logarithmically.  Unless a <code>sed</code> guru can point out a better way, I&#8217;m going to continue using the first approach.  </p>
<p>I&#8217;ve put the following script, which I call &#8220;<code>sedml</code>,&#8221; for <code>sed</code> multi-line, in my bash path.</p>
<div class="filosofo-highlight-light bash" style="font-family: monospace;"><span style="color: #808080; font-style: italic;">#!/bin/sh</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">$</span>#&quot;</span> -lt <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <br />
<span style="color: #000000; font-weight: bold;">then</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span>;<br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<br />
<span style="color: #808080; font-style: italic;"># change the input file if no 3rd argument</span><br />
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> -z <span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">$</span>3&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
<span style="color: #000000; font-weight: bold;">then</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">outputfile=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">$</span>1&quot;</span><br />
<span style="color: #000000; font-weight: bold;">else</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #007800;">outputfile=</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">$</span>3&quot;</span><br />
<span style="color: #000000; font-weight: bold;">fi</span><br />
<span style="color: #c20cb9; font-weight: bold;">sed</span> -n <span style="color: #ff0000;">'<br />
# if the first line copy the pattern to the hold buffer<br />
1h<br />
# if not the first line then append the pattern to the hold buffer<br />
1!H<br />
# if the last line then ...<br />
$ {<br />
&nbsp; &nbsp; &nbsp; &nbsp; # copy from the hold to the pattern buffer<br />
&nbsp; &nbsp; &nbsp; &nbsp; g<br />
&nbsp; &nbsp; &nbsp; &nbsp; # do the search and replace<br />
&nbsp; &nbsp; &nbsp; &nbsp; '</span><span style="color: #ff0000;">&quot;<span style="color: #000099; font-weight: bold;">$</span>2&quot;</span><span style="color: #ff0000;">'<br />
&nbsp; &nbsp; &nbsp; &nbsp; # print<br />
&nbsp; &nbsp; &nbsp; &nbsp; p<br />
}<br />
'</span> $<span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&gt;</span> $<span style="color: #000000;">1</span>.tmp;<br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> -f $<span style="color: #000000;">1</span>.tmp <span style="color: #007800;">$outputfile</span>;<br />
&nbsp;</div>
<p>So I can replace multi-line patterns in multiple files like so:</p>
<div class="filosofo-highlight-light bash" style="font-family: monospace;">&nbsp;<span style="color: #c20cb9; font-weight: bold;">grep</span> -rl <span style="color: #ff0000;">'&lt;h2'</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">while</span> <span style="color: #c20cb9; font-weight: bold;">read</span> i; <span style="color: #000000; font-weight: bold;">do</span> sedml <span style="color: #007800;">$i</span> <span style="color: #ff0000;">&quot;s/&lt;h2.*&lt;/h2&gt;/No title here/g&quot;</span> <span style="color: #007800;">$i</span>.tmp; <span style="color: #000000; font-weight: bold;">done</span>;</div>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/04/26/sed-multi-line-search-and-replace/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>A Good Enough addEvent</title>
		<link>http://austinmatzko.com/2008/04/14/addevent-preserving-this/</link>
		<comments>http://austinmatzko.com/2008/04/14/addevent-preserving-this/#comments</comments>
		<pubDate>Tue, 15 Apr 2008 03:48:00 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[addEvent]]></category>
		<category><![CDATA[addEventListener]]></category>
		<category><![CDATA[attachEvent]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=441</guid>
		<description><![CDATA[Several years ago, PPK of Quirksmode sponsored a contest to come up with a new version of the trusty JavaScript addEvent function. The original addEvent was created by Scott Andrew LePera in 2001 as a way to merge Internet Explorer&#8217;s attachEvent with the W3C&#8217;s addEventListener. Both addEventListener and attachEvent allow you to attach a JavaScript [...]]]></description>
			<content:encoded><![CDATA[<p>Several years ago, PPK of Quirksmode sponsored <a href="http://www.quirksmode.org/blog/archives/2005/10/_and_the_winner_1.html">a contest to come up with a new version of the trusty JavaScript addEvent function</a>.  The original addEvent was <a href="http://www.scottandrew.com/weblog/articles/cbs-events">created by Scott Andrew LePera in 2001</a> as a way to merge Internet Explorer&#8217;s <code>attachEvent</code> with the W3C&#8217;s <code>addEventListener</code>.  Both <code>addEventListener</code> and <code>attachEvent</code> allow you to attach a JavaScript event to a DOM object, but they differ in important ways.  In particular, IE&#8217;s <code>attachEvent</code> doesn&#8217;t maintain the scope of the <code>this</code> keyword: <code>this</code> refers to the <code>window</code> object instead of the object on which you&#8217;re attaching the event, as in the case of <code>addEventListener</code>.  </p>
<p>PPK&#8217;s contest itself ended up falling flat, as even the winner, John Resig (who later created the <a href="http://jquery.com/">jQuery library</a>),  later <a href="http://my.opera.com/hallvors/blog/2007/03/28/a-problem-with-john-resigs-addevent#comment2703457">repudiated it himself</a>. That&#8217;s probably because PPK&#8217;s contest requirements were like asking for all three of good, fast, and cheap.</p>
<p>So seven years later, there&#8217;s no widely-adopted replacement to the original addEvent that:</p>
<ol>
<li>Is short</li>
<li>Maintains the <code>this</code> scope in IE</li>
<li>Has a corresponding removeEvent</li>
</ol>
<p>The various libraries do a good job of 2 and 3, but not 1, and since I often find myself needing 1 and 2 but not 3, I came up with my own good-enough version of addEvent:</p>
<div class="filosofo-highlight-light javascript" style="font-family: monospace;"><span style="color: #003366; font-weight: bold;">var</span> addEvent = <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span> obj, type, fn <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#41;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span>type, fn, <span style="color: #003366; font-weight: bold;">false</span><span style="color: #66cc66;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #66cc66;">&#40;</span>obj.<span style="color: #006600;">attachEvent</span><span style="color: #66cc66;">&#41;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; obj.<span style="color: #006600;">attachEvent</span><span style="color: #66cc66;">&#40;</span><span style="color: #3366CC;">'on'</span> + type, <span style="color: #003366; font-weight: bold;">function</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#123;</span> <span style="color: #000066; font-weight: bold;">return</span> fn.<span style="color: #006600;">apply</span><span style="color: #66cc66;">&#40;</span>obj, <span style="color: #003366; font-weight: bold;">new</span> Array<span style="color: #66cc66;">&#40;</span>window.<span style="color: #006600;">event</span><span style="color: #66cc66;">&#41;</span><span style="color: #66cc66;">&#41;</span>;<span style="color: #66cc66;">&#125;</span><span style="color: #66cc66;">&#41;</span>;<br />
<span style="color: #66cc66;">&#125;</span><br />
&nbsp;</div>
<p>It&#8217;s short, which is just what I need when I&#8217;m trying to keep the JavaScript size low.  (Whenever size isn&#8217;t so much of an issue, such as on the administrative side of a website, I&#8217;m more likely to use a library which will have a much more robust way of assigning events to objects.)  And my addEvent also makes <code>this</code> refer to object in question, even for IE.  </p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/04/14/addevent-preserving-this/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>How I Rip and Encode MP3s on the Ubuntu Linux Command Line</title>
		<link>http://austinmatzko.com/2008/04/10/shell-mp3-encoding/</link>
		<comments>http://austinmatzko.com/2008/04/10/shell-mp3-encoding/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 11:00:03 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[cdparanoia]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[lltag]]></category>
		<category><![CDATA[mp3]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=438</guid>
		<description><![CDATA[I like to know how to use the command line for everything I can. Here are the tools and commands I use to make mp3s. First, I rip from the CDROM to a wav file. cdparanoia 1 prokofiev1.wav cdparanoia lets me specify the input device, but I don&#8217;t need to, since the default&#8212;/dev/cdrom&#8212;is what I [...]]]></description>
			<content:encoded><![CDATA[<p>I like to know how to use the command line for everything I can.  Here are the tools and commands I use to make mp3s.</p>
<p>First, I rip from the CDROM to a <code>wav</code> file.  </p>
<p><code>cdparanoia 1 prokofiev1.wav</code></p>
<p><code>cdparanoia</code> lets me specify the input device, but I don&#8217;t need to, since the default&#8212;<code>/dev/cdrom</code>&#8212;is what I want.  The line above just says to rip the first track to a <code>wav</code> file named <code>prokofiev1.wav</code>.</p>
<p><code>lame -h prokofiev1.wav prokofiev1.mp3</code></p>
<p>Encode the <code>wav</code> file to a <code>mp3</code> file, in high quality (128 kb).</p>
<p><code>lltag --cddb prokofiev1.mp3</code></p>
<p><code>lltag</code> helps me look up the <a href="http://en.wikipedia.org/wiki/Cddb">CDDB</a> data about the track and then add it to the mp3. I&#8217;m first prompted to make a CDDB query:</p>
<p><strong><code>Enter CDDB query [<query>q] (no default, h for help) ?</code></strong></p>
<p>I&#8217;ve tried entering the hexadecimal strings I get from <code>cd-discid</code>, but I&#8217;ve never gotten it to return any results.  Instead, I enter &#8220;prokofiev violinsonaten&#8221; verbatim from the CD&#8217;s title.  I get one matching result, which I select, and then I choose the appropriate track and save the CDDB data. </p>
<p><code>id3ed -i prokofiev1.mp3</code> and <code>id3v2 -l prokofiev1.mp3</code> let me verify that the data has been saved. </p>
<p>Now I&#8217;m all set to import the mp3 to Banshee and then to my iPod. </p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/04/10/shell-mp3-encoding/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>CSS Naked Day</title>
		<link>http://austinmatzko.com/2008/04/09/no-css/</link>
		<comments>http://austinmatzko.com/2008/04/09/no-css/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 14:37:50 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Web development]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[CSS Naked Day]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=437</guid>
		<description><![CDATA[If you think things look odd here today, it&#8217;s because I&#8217;ve disabled my blog&#8217;s styling for &#8220;CSS Naked Day.&#8221; The idea is to emphasize that styling on the web&#8211;particularly, that done with CSS, or &#8220;cascading style sheets&#8221;&#8211;should be separate from the structure, or markup. In part, one should separate style from content because a number [...]]]></description>
			<content:encoded><![CDATA[<p>If you think things look odd here today, it&#8217;s because I&#8217;ve disabled my blog&#8217;s styling for &#8220;<a href="http://naked.dustindiaz.com/">CSS Naked Day</a>.&#8221;</p>
<p>The idea is to emphasize that styling on the web&#8211;particularly, that done with CSS, or &#8220;cascading style sheets&#8221;&#8211;should be separate from the structure, or markup.  In part, one should separate style from content because a number of people and services read your site without styling: people who have disabilities, search engine spiders, etc.  It&#8217;s also much easier to change styling if it&#8217;s not mixed up with the structure of the content. </p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/04/09/no-css/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Cell Tower in Your House</title>
		<link>http://austinmatzko.com/2008/04/03/domestic-femtocells/</link>
		<comments>http://austinmatzko.com/2008/04/03/domestic-femtocells/#comments</comments>
		<pubDate>Thu, 03 Apr 2008 17:37:03 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cell Phones]]></category>
		<category><![CDATA[femtocells]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=436</guid>
		<description><![CDATA[This is what I need: my own &#8220;femtocell,&#8221; a cellular phone base station that you can put in your home. It connects through your broadband Internet to give your phone a strong signal. I don&#8217;t use a landline, and despite being in Boston my connections are sometimes embarrassingly poor, often losing the signal mid-call. So [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://apnews.myway.com/article/20080402/D8VQ0H180.html">This</a> is what I need: my own &#8220;<a href="http://en.wikipedia.org/wiki/Femtocell">femtocell</a>,&#8221; a cellular phone base station that you can put in your home.  It connects through your broadband Internet to give your phone a strong signal.  I don&#8217;t use a landline, and despite being in Boston my connections are sometimes embarrassingly poor, often losing the signal mid-call.  So what I <em>really</em> need is for Sprint to put up more towers.  But that&#8217;s not likely.</p>
<p>Even better would be if my <a href="http://money.cnn.com/magazines/business2/business2_archive/2007/03/01/8401024/index.htm">phone could just switch to Wi-Fi</a> and make <a href="http://en.wikipedia.org/wiki/Voip">VoIP</a> calls whenever possible.  </p>
<p>But all these things involve involve giving the customer more and better choices, something cellular phone manufacturers and service providers seem reluctant to do.</p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/04/03/domestic-femtocells/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Death of WiFi?</title>
		<link>http://austinmatzko.com/2008/03/17/death-of-wifi/</link>
		<comments>http://austinmatzko.com/2008/03/17/death-of-wifi/#comments</comments>
		<pubDate>Mon, 17 Mar 2008 14:20:27 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Internet]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/?p=434</guid>
		<description><![CDATA[An Ericsson executive recently predicted that WiFi&#8217;s time has passed: &#8220;In Austria, they are saying that mobile broadband will pass fixed broadband this year. It&#8217;s already growing faster, and in Sweden, the most popular phone is a USB modem,&#8221; said Bergendahl, who was the keynote speaker at the European Computer Audit, Control and Security Conference [...]]]></description>
			<content:encoded><![CDATA[<p>An Ericsson executive recently predicted that <a href="http://www.computerworld.com/action/article.do?command=viewArticleBasic&#038;taxonomyName=wireless_networking&#038;articleId=9067479&#038;taxonomyId=79&#038;intsrc=kc_top">WiFi&#8217;s time has passed</a>:</p>
<blockquote cite="http://www.computerworld.com/action/article.do?command=viewArticleBasic&#038;taxonomyName=wireless_networking&#038;articleId=9067479&#038;taxonomyId=79&#038;intsrc=kc_top"><p>&#8220;In Austria, they are saying that mobile broadband will pass fixed broadband this year. It&#8217;s already growing faster, and in Sweden, the most popular phone is a USB modem,&#8221; said Bergendahl, who was the keynote speaker at the European Computer Audit, Control and Security Conference in Stockholm.</p>
<p>As more people start using mobile broadband, hot spots will no longer be needed. &#8220;Hot spots at places like Starbucks are becoming the telephone boxes of the broadband era,&#8221; said Bergendahl.</p></blockquote>
<p>The last couple of weeks I was doing a lot of traveling, and I ended up needing to connect to the Internet  where there wasn&#8217;t any broadband available.  So for the first time I tethered my phone to the laptop as a USB modem and &#8220;dialed&#8221; in to my cellular company&#8217;s data network using PPP.  It was surprisingly fast (near DSL speeds), and also very reliable, staying up for hours.  It won&#8217;t replace WiFi for large bandwidth uses, but it turned out to be a great supplement when I needed it.</p>
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2008/03/17/death-of-wifi/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Internet Explorer 7 Float Bug</title>
		<link>http://austinmatzko.com/2007/07/25/internet-explorer-7-float-bug/</link>
		<comments>http://austinmatzko.com/2007/07/25/internet-explorer-7-float-bug/#comments</comments>
		<pubDate>Wed, 25 Jul 2007 04:49:00 +0000</pubDate>
		<dc:creator>filosofo</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[Internet]]></category>
		<category><![CDATA[Web development]]></category>
		<category><![CDATA[Internet Explorer 7]]></category>

		<guid isPermaLink="false">http://www.ilfilosofo.com/blog/2007/07/25/internet-explorer-7-float-bug/</guid>
		<description><![CDATA[Today while developing a WordPress theme for a client, I ran into a vexing Internet Explorer 7 bug. Anyone who&#8217;s done any website design is familiar with Internet Explorer 6 (or earlier) wreaking havoc with standards-compliant work that looks good in, say, Firefox. But thankfully IE 7 has for the most part been a big [...]]]></description>
			<content:encoded><![CDATA[<p>Today while developing a WordPress theme for a client, I ran into a vexing Internet Explorer 7 bug.  Anyone who&#8217;s done any website design is familiar with Internet Explorer 6 (or earlier) wreaking havoc with standards-compliant work that looks good in, say, Firefox.  But thankfully IE 7 has for the most part been a big improvement over its predecessor.  That&#8217;s what made this bug so strange: it didn&#8217;t affect IE 6, just IE 7.</p>

<img src='http://www.ilfilosofo.com/wp-content/uploads/ie7_float_problem.jpg' alt='Internet Explorer 7 Float Bug' />

<p>The first image shows a screenshot of the problem: the title of the post is drooping into the post.  Usually when you see something like this, it means that the containing element has not been cleared.  There are a number of ways to clear an element: <a href="http://www.positioniseverything.net/easyclearing.html">a popular fix these days uses a pseudo class</a>; the classic approach has been to put a cleared element within the same element as the floating element, but after it.  Neither fix works for this bug.</p>

<p>Thankfully, I found <a href="http://www.brunildo.org/test/fenc7.html">a demonstration of a similar problem with IE 7</a>.  Apparently if the element containing the floating element has a set height or a maximum height, it confuses IE 7.  According to the standard, a browser should obey the CSS height of the element (and IE 7 does&#8212;good job!&#8212;unlike IE 6). But every cleared element after the floater should be pushed down, not overlapped, by the floater.</p>

<p>The solution is to remove the height assignment from the container element, if you can.  In my case, for another part of the site experiencing the same problem, I needed the element to have enough height to show a background image.  The solution was to use the min-height property, which doesn&#8217;t trigger the bug.</p>

<p>The final image shows what it should look like, as rendered by Firefox.</p>

<img src='http://www.ilfilosofo.com/wp-content/uploads/firefox_no_float_problem.jpg' alt='Firefox does not have IE 7âs float bug' />
]]></content:encoded>
			<wfw:commentRss>http://austinmatzko.com/2007/07/25/internet-explorer-7-float-bug/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
	</channel>
</rss>
