<?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>Defining Terms</title>
	<atom:link href="http://definingterms.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://definingterms.com</link>
	<description></description>
	<lastBuildDate>Tue, 20 Dec 2011 15:49:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Windows Shell Bug</title>
		<link>http://definingterms.com/2009/11/25/windows-shell-bug/</link>
		<comments>http://definingterms.com/2009/11/25/windows-shell-bug/#comments</comments>
		<pubDate>Wed, 25 Nov 2009 23:43:36 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://definingterms.com/?p=205</guid>
		<description><![CDATA[At work, we build one of our projects with Makefiles. In one of these Makefiles, we have this line: This should create the output directory if it doesn&#8217;t exist. The line would hang the build on my development box from time to time, so I decided to track down what the problem was. It turns [...]]]></description>
			<content:encoded><![CDATA[<p>At work, we build one of our projects with Makefiles.  In one of these Makefiles, we have this line:</p>
<pre class="brush: batch; title: ; notranslate">
IF NOT EXIST &quot;$(OUTDIR)&quot; mkdir &quot;$(OUTDIR)&quot;
</pre>
<p>This should create the output directory if it doesn&#8217;t exist.  The line would hang the build on my development box from time to time, so I decided to track down what the problem was.  It turns out, IF NOT EXIST will sometimes hang if there are quotes around the filepath, at least on Windows XP.  You can verify this with a simple perl script:</p>
<pre class="brush: perl; title: ; notranslate">
for (;;) {
    system(&quot;cmd /c IF NOT EXIST \&quot;\\Windows\&quot; echo nodir&quot;);
}
</pre>
<p>Running that script will cause the cmd to hang after a short amount of time (usually less than a minute).</p>
<p>But, if you run this script, it will continue forever:</p>
<pre class="brush: perl; title: ; notranslate">
for (;;) {
    system(&quot;cmd /c IF NOT EXIST \\Windows echo nodir&quot;);
}
</pre>
<p>In our case, the filepath will never contain any spaces, so the solution was to just remove the quotes from the IF NOT EXIST command in the Makefile.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2009/11/25/windows-shell-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>EngineYard SHA-1 Competition</title>
		<link>http://definingterms.com/2009/08/19/engineyard-sha-1-competition/</link>
		<comments>http://definingterms.com/2009/08/19/engineyard-sha-1-competition/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 23:16:52 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://definingterms.com/?p=164</guid>
		<description><![CDATA[A few weeks ago, EngineYard held a programming competition. Basically, the contest was to see who could get a SHA-1 hash closest to a given hash. I thought it might be fun to see how well I could do with a minimal implementation, so I coded up something in C. My goal was not to [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago, EngineYard held <a href="http://www.engineyard.com/blog/2009/programming-contest-win-iphone-3gs-2k-cloud-credit/">a programming competition</a>.  Basically, the contest was to see who could get a SHA-1 hash closest to a given hash.  I thought it might be fun to see how well I could do with a minimal implementation, so <a href="http://github.com/aag/engineyard_sha1/tree">I coded up something in C</a>.</p>
<p>My goal was not to write the most efficient program possible, but to see what results I could get from a reasonable design and no major optimizations.  So, I wrote about 160 lines of C code, using OpenSSL for the hashing and the old <a href="http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan">K&#038;R bit counting method</a>.  Depending on how long the message plaintext was, this got me about 1 to 1.5 million attempts per second per core on my 3.0 Ghz Core 2 Duo.  <a href="http://www.win.tue.nl/cccc/sha-1-challenge.html">The winning CPU-based entry</a>, which was written by <a href="http://cr.yp.to/djb.html">D. J. Bernstein</a>, contained an optimized SHA-1 implementation and got around 10 million hashes per second per core.  So, I was about an order of magnitude off, which seems reasonable to me.</p>
<p>It turns out the really fast implementations were all on GPUs.  Both the winner and the runner up <a href="http://forums.nvidia.com/index.php?showtopic=102349">used Nvidia&#8217;s CUDA</a> for fast GPGPU processing, which was cool to see.</p>
<p>I ran my program for most of the 30 hours of the competition.  How did I do?  <a href="http://twitter.com/adamgoforth/status/2767713639">My best result</a> was 37 bits off of the goal, which put me 7 away from the winner.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2009/08/19/engineyard-sha-1-competition/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>C#, The Ternary Operator, and Mono</title>
		<link>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/</link>
		<comments>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 02:59:53 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://definingterms.com/?p=162</guid>
		<description><![CDATA[The Quiz One of my coworkers recently sent out this C# programming quiz: What is printed out? Try it. Explain why you were wrong. If you run the code, you get this output: System.Int32 The code snippet as it stands doesn&#8217;t make it clear exactly where the unexpected behavior is. This is a little more [...]]]></description>
			<content:encoded><![CDATA[<p><strong>The Quiz</strong><br />
One of my coworkers recently sent out this C# programming quiz:</p>
<pre class="brush: csharp; title: ; notranslate">
static void Main(string[] args)
{
    object x = null;
    object y = (short)4;
    x = (y is System.Int32) ? (System.Int32)y : (System.Int16)y;
    Console.WriteLine(x.GetType());
}
</pre>
<blockquote><p>
What is printed out?<br />
Try it.<br />
Explain why you were wrong.
</p></blockquote>
<p>If you run the code, you get this output:</p>
<pre>System.Int32</pre>
<p>The code snippet as it stands doesn&#8217;t make it clear exactly where the unexpected behavior is.  This is a little more clear:</p>
<pre class="brush: csharp; title: ; notranslate">
static void Main(string[] args)
{
    object x = null;
    object y = (short)4;
    x = false ? (System.Int32)y : (System.Int16)y;
    Console.WriteLine(x.GetType());
}
</pre>
<p>This code outputs the same thing as the above snippet.  So why does this snippet output System.Int32, when x clearly gets set to (System.Int16)4 ?  The answer is in the C# implementation of the ternary operator.</p>
<p><strong>The Answer</strong><br />
In line 5 of the second example above, x is set to the result of the <em>expression</em> on the right side of the equals sign.  Since the thing on the right is an expression, it must have a single type.</p>
<p>The <a href="http://www.ecma-international.org/publications/standards/Ecma-334.htm">C# Language Specification</a>, in section 14.13, spells out how the type of the expression is determined:</p>
<blockquote><p>The second and third operands of the ?: operator control the type of the conditional expression. Let X and Y be the types of the second and third operands. Then,</p>
<ul>
<li>If X and Y are the same type, then this is the type of the conditional expression.</li>
<li>Otherwise, if an implicit conversion exists from X to Y, but not from Y to X, then Y is the type of the conditional expression.</li>
<li>Otherwise, if an implicit conversion exists from Y to X, but not from X to Y, then X is the type of the conditional expression.</li>
<li>Otherwise, no expression type can be determined, and a compile-time error occurs.</li>
</ul>
</blockquote>
<p>In our example, since there&#8217;s an implicit cast from an Int16 to an Int32, but not an implicit cast from an Int32 to an Int16, the compiler says the type of the expression must be Int32.  Then, when our Int16 is returned, it&#8217;s typecast to an Int32.</p>
<p><strong>More Types</strong><br />
The spec makes it pretty clear what is supposed to happen if there&#8217;s an implicit conversion from one of the operands to the other, but not the other way around.  But what happens if there&#8217;s an implicit conversion in both directions?  According to the spec, none of the first three conditions are met, so the compiler must output an error.  There is an implicit conversion from a byte to int, and also one from const int to byte, as long as the int is small enough to fit into the byte.  So, let&#8217;s try compiling this:</p>
<pre class="brush: csharp; title: ; notranslate">
static void Main(string[] args)
{
    const int i = 1;
    const byte b = 2;

    object x = null;
    x = true ? i : b;

    Console.WriteLine(x.GetType());
}
</pre>
<p><strong>The Bug</strong><br />
If you compile this with the .NET 3.5 compiler, it compiles without errors.  There&#8217;s a warning about hardcoding true into the ternary operator, but nothing about the types.  So, the compiler does not conform to the C# language spec.  That&#8217;s a bug, but it&#8217;s not that shocking.  <a href="https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=91646">There are other</a> places where the .NET compiler doesn&#8217;t conform to the spec.  It seems that Microsoft <a href="http://blogs.msdn.com/ericgu/archive/2003/10/10/52732.aspx">has a policy</a> to leave such bugs in, so as to not break compatibility with existing code, so it will probably stay that way for the foreseeable future.</p>
<p><strong>Mono</strong><br />
This got me wondering if the Mono compiler properly supports the spec.  So, I tried compiling with the Mono 2.0 C# compiler.  Here&#8217;s what you get:</p>
<blockquote><p>Program.cs(13,17): error CS0172: Can not compute type of conditional expression as `int&#8217; and `byte&#8217; convert implicitly to each other<br />
Compilation failed: 1 error(s), 0 warnings
</p></blockquote>
<p>So it looks like Mono conforms to the spec in this case.  It&#8217;s a bit amusing that an open source project supports the spec better than Microsoft itself, but there are probably also cases where it goes the other way.  However, this means that the Mono implementation is incompatible with the .NET implementation of C#.  Now, this particular incompatibility is unlikely to come up that often, since there aren&#8217;t many types that have two-way implicit conversions with each other, but it&#8217;s something to consider.</p>
<p><strong>The Law</strong><br />
The legal implications of this bug are perhaps the most interesting part.  A few weeks ago, there was a lot of talk about the Mono patent situation.  This has now been largely resolved with Microsoft putting C# and the CLR under its <a href="http://www.microsoft.com/interop/cp/default.mspx">Community Promise</a>.  However, the Community Promise only applies to a given implementation &#8220;to the extent it conforms to one of the Covered Specifications.&#8221;  If an implementation does not conform to the specification, it is not covered by the promise.</p>
<p>You can probably see where I&#8217;m going with this.  If Mono decided to support compatibility with the .NET compiler by breaking from the spec and implementing the ternary type bug the same way Microsoft has, it might be giving up its protection against patent lawsuits.  In order to be legally safer, it&#8217;s probably wiser for Mono to stick to the spec and break compatibility with the .NET compiler.  This is significant, because the more situations like this crop up, the harder it will be for programmers to port their .NET code to Mono.  There&#8217;s not much that the mono project can do about this, but it&#8217;s unfortunate that the legal situation forces their hand on compatibility.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2009/08/18/c-the-ternary-operator-and-mono/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Moving from Apache to Nginx</title>
		<link>http://definingterms.com/2009/04/21/moving-from-apache-to-nginx/</link>
		<comments>http://definingterms.com/2009/04/21/moving-from-apache-to-nginx/#comments</comments>
		<pubDate>Wed, 22 Apr 2009 01:02:20 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://definingterms.com/?p=136</guid>
		<description><![CDATA[I&#8217;ve been having problems with too much memory usage on the 256 slice I use to serve my web pages. I was using Apache and mod_php, and the Apache processes were growing large enough that I could only have 4 of them running at once, which killed any hope of decent concurrency. I decided to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been having problems with too much memory usage on the <a href="http://www.slicehost.com/">256 slice</a> I use to serve my web pages.  I was using Apache and mod_php, and the Apache processes were growing large enough that I could only have 4 of them running at once, which killed any hope of decent concurrency.  I decided to switch to using PHP with FastCGI and after some research decided to go with <a href="http://nginx.net/">nginx</a>.  The switch has now been made and page generation is faster, the server can handle greater concurrency, and memory usage is under control.</p>
<p>I actually ended up using nginx, PHP, PHP-FPM, and xcache.  I&#8217;m running 8 instances of PHP and 2 nginx worker processes.  First, I got started by using the <a href="http://www.yawn.it/2008/04/30/nginx-php-php-fpm-on-debian-etch-40/">step-by-step instructions</a> I found on someone&#8217;s blog.  After the initial setup, there was still a lot of configuration to do, some of which was not trivial.  Below are some notes from my experience:</p>
<p><strong>1.</strong> When setting up FastCGI processes for PHP, make sure the firewall isn&#8217;t blocking access to the port the FastCGI servers are listening on.  If your firewall is filtering packets to the port, you&#8217;ll get a &#8220;504 Gateway Time-out&#8221; page from nginx whenever you try to access a PHP page.  To open up the port, if you&#8217;re using iptables, add something to your iptables startup script like this:<br />
<code>iptables -A INPUT -p tcp -s localhost --dport 9000 -j ACCEPT</code></p>
<p><strong>2.</strong> Somewhere I saw a redirect example to eliminate the www from URLs that caused me to add this to the config file:</p>
<pre>
server {
    listen          80;
    server_name     www.definingterms.com;
    rewrite         ^/(.*) http://definingterms.com/%1 permanent;
}

server {
    listen          80 default;
    server_name     definingterms.com;
    [...]
}
</pre>
<p>I&#8217;m not sure why I thought I needed this, but it was messing up the loading of static images on this blog.  The right thing to do is just list multiple server_names for the host, and let WordPress handle the redirect:</p>
<pre>
server {
    listen          80 default;
    server_name     definingterms.com www.definingterms.com;
    [...]
}
</pre>
<p><strong>3.</strong> Moving most of my sites from Apache to nginx was easy, but there was the problem of rewrite rules.  A lot of the software I use (e.g. WordPress, Mediawiki, Gallery) needs rewrite rules.  If you&#8217;re using Apache, there&#8217;s always an example .htaccess file either in the documentation, or in some user forum.  However, the nginx rewrite rules work differently, and you can&#8217;t always find an example config, so it took some time and brain power to get them all right.  Actually, this is true for all parts of the nginx configuration.  The English documentation is sparse and it&#8217;s sometimes hard to find examples of what you want to do.</p>
<p><strong>4.</strong> nginx doesn&#8217;t have CGI support.  If you&#8217;ve got those one or two sites that use non-PHP CGI, you&#8217;ll have to set up a FastCGI instance for each language you want to support.  For example, I had a copy of ViewVC running, which is written in Python.  With Apache, it was just using CGI.  With nginx, I&#8217;d have to constantly run a whole Python FastCGI process for the rare event when someone wants to browse ViewVC.</p>
<p>In the end, I think the move to nginx was worth it purely for the performance gains, since it keeps me from having to pay for a heftier VM every month.  But, it did take a fair amount of work and if I had slightly more complex needs, it might not have been a good fit for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2009/04/21/moving-from-apache-to-nginx/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Secure Passwords Not Allowed</title>
		<link>http://definingterms.com/2009/04/11/secure-passwords-not-allowed/</link>
		<comments>http://definingterms.com/2009/04/11/secure-passwords-not-allowed/#comments</comments>
		<pubDate>Sat, 11 Apr 2009 14:54:58 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://definingterms.com/?p=129</guid>
		<description><![CDATA[For quite a while now, I&#8217;ve been using a tiered password system for all of the websites where I have accounts. I knew this was bad practice, but it was easy. Recently there have been a number of stories about websites&#8217; databases being leaked, which made me seriously consider doing something better. Password managers have [...]]]></description>
			<content:encoded><![CDATA[<p>For quite a while now, I&#8217;ve been using a <a href="http://www.which.co.uk/advice/protect-your-online-id/passwords/index.jsp">tiered password system</a> for all of the websites where I have accounts.  I knew this was bad practice, but it was easy.  Recently there have been a number of stories about websites&#8217; databases being leaked, which made me seriously consider doing something better.  Password managers have never impressed me much, both because of the security issues of storing all of your passwords in a central location and the danger of losing the database and not being able to reconstruct it.  But, when I came across <a href="http://passwordmaker.org/">PasswordMaker</a>, I liked what I saw.</p>
<p>Instead of storing the passwords, they&#8217;re generated on the fly using a cryptographically secure method.  The software is all open source, so you know what&#8217;s going on and can reconstruct it if you need to.  Finally, there&#8217;s also a very convenient browser plugin for Firefox that I can install everywhere.  So, I finally bit the bullet and got away from my tiered password system by moving all of my online accounts to using passwords generated by PasswordMaker.</p>
<p>If I&#8217;m going to go through all of that trouble, I might as well use a secure password, right?  So I decided to use passwords with letters, numbers, and punctuation.  That shouldn&#8217;t be anything special, it&#8217;s just the standard recommendation for password security.  Some systems even have that as a minimum requirement.</p>
<p>What surprised me was that a huge number of websites I use don&#8217;t allow passwords with punctuation, 20% in fact.  Out of the 97 sites where I tried to update my account, 19 of them would not allow it.  These ranged from hip web 2.0 sites like <a href="http://www.digg.com/">digg.com</a> to big, corporate sites like <a href="http://www.geico.com/">geico.com</a>.  Here&#8217;s the full list:</p>
<ul>
<li><a href="http://www.aadl.org">aadl.org</a></li>
<li><a href="http://www.aareced.com">aareced.com</a></li>
<li><a href="http://www.blockbuster.com">blockbuster.com</a></li>
<li><a href="http://www.briarcoveapts.com">briarcoveapts.com</a></li>
<li><a href="http://www.digg.com">digg.com</a></li>
<li><a href="http://www.etsy.com">etsy.com</a></li>
<li><a href="http://www.geico.com">geico.com</a></li>
<li><a href="http://www.godaddy.com">godaddy.com</a></li>
<li><a href="http://www.hewitt.com">hewitt.com</a></li>
<li><a href="http://www.movietickets.com">movietickets.com</a></li>
<li><a href="http://my.dteenergy.com">my.dteenergy.com</a></li>
<li><a href="http://www.mycigna.com">mycigna.com</a></li>
<li><a href="http://www.novell.com">novell.com</a></li>
<li><a href="http://www.nytimes.com">nytimes.com</a></li>
<li><a href="http://www.projecteuler.net">projecteuler.net</a></li>
<li><a href="http://www.ticketmaster.com">ticketmaster.com</a></li>
<li><a href="http://www.transunion.com">transunion.com</a></li>
<li><a href="http://www.worldogl.com">worldogl.com</a></li>
<li><a href="http://www.zipzoomfly.com">zipzoomfly.com</a></li>
</ul>
<p>So now I have to use a different set of characters for my passwords at these sites.  Fortunately, PasswordMaker lets me configure different profiles for different sites, so I can set it up once and forget about it.  But, why should I have to do that, especially when it makes my account less secure?</p>
<p>It seems like it just requires <em>more</em> work from the website makers to restrict certain characters, and I can&#8217;t think of any good reason to do so.  It might make sense to restrict passwords to ASCII characters if their system doesn&#8217;t fully support Unicode.  But disallowing all punctuation just doesn&#8217;t make any sense.  The programmers might be worried about allowing escape characters in passwords, but it seems like it would be just as much work to protect the system against them internally as making an additional demand on the user.</p>
<p>If we&#8217;re going to expect users to have secure passwords, we need to allow them to do so.  I&#8217;d like to see the above sites change their password policies, and I want any new sites to allow long, complex passwords.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2009/04/11/secure-passwords-not-allowed/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Dinosaur Remix</title>
		<link>http://definingterms.com/2009/04/02/dinosaur-remix/</link>
		<comments>http://definingterms.com/2009/04/02/dinosaur-remix/#comments</comments>
		<pubDate>Thu, 02 Apr 2009 22:09:02 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://definingterms.com/?p=125</guid>
		<description><![CDATA[I like Dinosaur Comics. Since the drawings and panels are the same in every comic, I thought of the idea of trying to mix and match panels from different comics to see what comes out. It turns out, Ryan North had already done something similar, but I decided to implement my idea anyway. Here&#8217;s the [...]]]></description>
			<content:encoded><![CDATA[<p>I like <a href="http://www.qwantz.com">Dinosaur Comics</a>.  Since the drawings and panels are the same in every comic, I thought of the idea of trying to mix and match panels from different comics to see what comes out.  It turns out, Ryan North had already <a href="http://qwantz.com/random.html">done something similar</a>, but I decided to implement my idea anyway.  Here&#8217;s the result:</p>
<p><strong><a href="http://definingterms.com/dinoremix/">Dinosaur Remix</a></strong></p>
<p>Dinosaur Remix lets you randomly mix together panels, but also lock in certain panels to make a comic you like.  Then you can add clever alt text and save it or send it to a dinosaur-loving friend!</p>
<p>It&#8217;s written in Python, PHP, and JavaScript.  It was my first chance to really use jQuery, which is just about as awesome as everyone says it is.  All of the code is available <a href="http://github.com/aag/dinoremix">on GitHub</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2009/04/02/dinosaur-remix/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Translation Hacks</title>
		<link>http://definingterms.com/2008/10/03/translation-hacks/</link>
		<comments>http://definingterms.com/2008/10/03/translation-hacks/#comments</comments>
		<pubDate>Fri, 03 Oct 2008 21:40:08 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.definingterms.com/?p=105</guid>
		<description><![CDATA[Not so long ago, the only help available when translating text from one language to another was a dictionary and a grammar book. That&#8217;s how it was when I started learning German. Now, there are a number of tools online to help you in your bilingual quest, but you have to be clever to get [...]]]></description>
			<content:encoded><![CDATA[<p>Not so long ago, the only help available when translating text from one language to another was a dictionary and a grammar book.  That&#8217;s how it was when I started learning German.  Now, there are a number of tools online to help you in your bilingual quest, but you have to be clever to get the most use out of them.  My examples will be in German, but these techniques can be applied to most languages that have a strong online presence.</p>
<ul>
<li><b>A Good Dictionary</b> &#8211; This is still your first line of defense against the hostile hoards of foreign words.  For German, the best is clearly <a href="http://dict.leo.org/">LEO</a>.  The reason it&#8217;s better than your trusty Langenscheidt&#8217;s or Oxford-Duden is that it&#8217;s user created and maintained, so you get <a href="http://dict.leo.org/ende?lp=ende&#038;lang=de&#038;searchLoc=0&#038;cmpType=relaxed&#038;sectHdr=on&#038;spellToler=on&#038;chinese=both&#038;pinyin=diacritic&#038;search=to+skate+on+thin+ice&#038;relink=on">idioms</a>, <a href="http://dict.leo.org/ende?searchLoc=-1&#038;searchLocRelinked=-1&#038;lp=ende&#038;search=rad&#038;lp=ende&#038;lang=de&#038;searchLoc=0&#038;searchLocRelinked=1&#038;search=">slang</a>, and <a href="http://dict.leo.org/forum/viewUnsolvedquery.php?idThread=256054&#038;idForum=1&#038;lp=ende&#038;lang=de">current events</a>.</li>
<p></p>
<li><b>Google for Grammar</b> &#8211; If you don&#8217;t know which of two or three possible variants is the correct one, Google all of them and see if one has many more hits than the rest.  Important here: put the phrase in quotes.  This is especially good for things like which preposition to use with more common words.  Let&#8217;s say you want to translate &#8220;I&#8217;m going to Chicago.&#8221;  Which preposition do you use?  Try searching for a similar phrase (in this case, altered for geographic relevance) and see if one stands out.  Go to <a href="http://www.google.de">google.de</a> and click the &#8220;Seiten auf Deutsch&#8221; (Pages in German) button.  Then try three reasonable guesses:
<ol>
<li><a href="http://www.google.de/search?hl=de&#038;q=%22gehe+zu+berlin%22&#038;btnG=Suche&#038;meta=lr%3Dlang_de">&#8220;gehe zu Berlin&#8221;</a>: 7 hits</li>
<li><a href="http://www.google.de/search?hl=de&#038;q=%22gehe+nach+berlin%22&#038;btnG=Suche&#038;meta=lr%3Dlang_de">&#8220;gehe nach Berlin&#8221;</a>: 2,890 hits</li>
<li><a href="http://www.google.de/search?hl=de&#038;q=%22gehe+bei+berlin%22&#038;btnG=Suche&#038;meta=lr%3Dlang_de">&#8220;gehe bei Berlin&#8221;</a>: 1 hit</li>
</ol>
<p>It looks like we have a clear winner.  You can be pretty confident translating your sentence as &#8220;Ich gehe nach Chicago&#8221;.  However, this isn&#8217;t always foolproof.  If you had searched for <a href="http://www.google.de/search?hl=de&#038;q=%22gehe+in+berlin%22&#038;meta=lr%3Dlang_de">&#8220;gehe in Berlin&#8221;</a> you would have gotten 576 hits and the results wouldn&#8217;t have been quite as clear.  But, after reading the first few hits, you&#8217;d have realized that it&#8217;s not what you&#8217;re looking for.</li>
<p></p>
<li><b>Wikipedia</b> &#8211; This is especially good for technical terms.  Suppose you want to talk about the famous Quicksort algorithm in German.  <a href="http://dict.leo.org/ende?lp=ende&#038;lang=de&#038;searchLoc=0&#038;cmpType=relaxed&#038;sectHdr=on&#038;spellToler=on&#038;relink=on&#038;search=quicksort">LEO won&#8217;t help you</a>.  So, go to <a href="http://en.wikipedia.org/wiki/Quicksort">the English Wikipedia page for Quicksort</a>.  Then, look down on the left side of the page in the &#8220;languages&#8221; box.  Click &#8220;Deutsch&#8221; (if it exists) and you&#8217;ll be taken to the equivalent German page.  In this case, you find out that Quicksort is the same in English and German, so now you can (not) translate it with confidence.</li>
<p></p>
<li><b>Names</b> &#8211; You read a foreign name and you&#8217;re not sure what gender it is.  Sometimes that doesn&#8217;t matter, but if you want to talk about this person, it sure is useful to be able to use pronouns.  So, to figure it out, do a Google image search, preferably at the Google site for the country, and look at the results.  Example: <a href="http://images.google.de/images?gbv=2&#038;hl=de&#038;q=johannes&#038;btnG=Bilder-Suche">Johannes</a> vs. <a href="http://images.google.de/images?gbv=2&#038;hl=de&#038;q=johanna&#038;btnG=Bilder-Suche">Johanna</a> (I read this somewhere online, but I&#8217;m not sure where.  It&#8217;s especially helpful for Asian names.)</li>
<p></p>
<li><b>Machine Translation</b> &#8211; I list this one last because it&#8217;s generally the least helpful.  The two main free sites are <a href="http://translate.google.com/">Google Translate</a> and <a href="http://babelfish.yahoo.com/">Babelfish</a>.  These sites are slowly getting better, but right now they&#8217;re still of limited value.  They&#8217;re good if you want to read something in a language you don&#8217;t know at all or it would take you a long time to do the translation yourself and you just want to get the gist of the text.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2008/10/03/translation-hacks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Adventures in Translation</title>
		<link>http://definingterms.com/2008/07/25/adventures-in-translation/</link>
		<comments>http://definingterms.com/2008/07/25/adventures-in-translation/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 16:04:40 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.definingterms.com/2008/07/25/adventures-in-translation/</guid>
		<description><![CDATA[Yesterday, I came across this wonderful sentence while reading &#8220;Das Parfum&#8221; by Patrick Süskind: Und wenn er auch wußte, daß er den Besitz dieses Duftes mit seinem anschließenden Verlust würde entsetzlich teuer bezahlen müssen, so schienen ihm doch Besitz und Verlust begehrenswerter als der lapidare Verzicht auf beides. This can be roughly translated as: And [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I came across this wonderful sentence while reading &#8220;<a href="http://de.wikipedia.org/wiki/Das_Parfum">Das Parfum</a>&#8221; by Patrick Süskind:</p>
<blockquote><p>Und wenn er auch wußte, daß er den Besitz dieses Duftes mit seinem anschließenden Verlust würde entsetzlich teuer bezahlen müssen, so schienen ihm doch Besitz <em>und</em> Verlust begehrenswerter als der lapidare Verzicht auf beides.</p></blockquote>
<p>This can be roughly translated as:</p>
<blockquote><p>And even knowing that the possession of this scent would require him to subsequently pay the terribly high price of its loss, the possession and loss seemed more desirable than the lapidary relinquishment of both.</p></blockquote>
<p>The interesting part of the sentence is &#8220;daß er den Besitz dieses Duftes mit seinem anschließenden Verlust würde entsetzlich teuer bezahlen müssen&#8221;.  In a word-for-word translation, this is &#8220;that he the possession of this scent with its subsequent loss would terribly expensive pay have to&#8221;.</p>
<p>In general, English and German have similar sentence structure and word order.  But occasionally you see a German sentence that makes you think the author took a sentence, tied it in a knot, and threw it onto the page.  Translation of such sentences requires not only translating the meaning into English, but untying the knot so that the English-speaking reader can parse it.  And that&#8217;s the fun part.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2008/07/25/adventures-in-translation/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Simple Canvas Example</title>
		<link>http://definingterms.com/2008/03/31/simple-canvas-example/</link>
		<comments>http://definingterms.com/2008/03/31/simple-canvas-example/#comments</comments>
		<pubDate>Tue, 01 Apr 2008 03:00:03 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.definingterms.com/2008/03/31/simple-canvas-example/</guid>
		<description><![CDATA[Here is a simple example of drawing pixels (rather than paths) to a canvas element with JavaScript. The algorithm goes left to right and draws across the canvas, and for each pixel column draws two blue pixels, one for the top half of the circle and one for the bottom half. Then, because this results [...]]]></description>
			<content:encoded><![CDATA[<p>Here is a simple example of drawing pixels (rather than paths) to a canvas element with JavaScript.  The algorithm goes left to right and draws across the canvas, and for each pixel column draws two blue pixels, one for the top half of the circle and one for the bottom half.  Then, because this results in sparse drawing for the far left and right edges of the circle, it does another pass from top to bottom, doing the same thing with red pixels.  The result is a circle with gradient colors, showing which pass drew more of the circle.</p>
<p>It&#8217;s been tested in Firefox 2 and 3, and I think it should work in recent versions of Safari and Opera.</p>
<div style="margin-left: 100px"><a href="/Files/circle_on_canvas.html" title='circle.png'><img src='http://www.definingterms.com/wp-content/uploads/2008/03/circle.png' alt='circle.png' /></a><br />
<a href="/Files/circle_on_canvas.html">Click the image to see the example</a></div>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2008/03/31/simple-canvas-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>RT Update</title>
		<link>http://definingterms.com/2008/03/25/rt-update/</link>
		<comments>http://definingterms.com/2008/03/25/rt-update/#comments</comments>
		<pubDate>Tue, 25 Mar 2008 13:00:50 +0000</pubDate>
		<dc:creator>Adam</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.definingterms.com/2008/03/25/rt-update/</guid>
		<description><![CDATA[I wrote a few weeks ago about how Rotten Tomatoes did a redesign of their site that broke my primary use case. Since then, they have done an update that makes things a lot better for me, though it&#8217;s still not as convenient as the original design. Right now, if you hover over any of [...]]]></description>
			<content:encoded><![CDATA[<p>I <a href="http://www.definingterms.com/2008/01/20/rotten-tomatoes-redesign/">wrote</a> a few weeks ago about how Rotten Tomatoes did a redesign of their site that broke my primary use case.  Since then, they have done an update that makes things a lot better for me, though it&#8217;s still not as convenient as the original design.  Right now, if you hover over any of the tabs for different groups of ratings, you get a popup that tells you that group&#8217;s percentage of positive reviews.  In my case, I&#8217;m interested in the Top Critics group:</p>
<p><img src='http://www.definingterms.com/wp-content/uploads/2008/03/hover_percent.png' alt='Hovering over the Top Critics tab on RT' /></p>
<p>While this does allow you to compare the percentages much more easily, it&#8217;s not quite perfect.  On the plus side, it displays both percentages at the same time and it&#8217;s quite easy to discover.  Anyone who is interested in the Top Critics information will move to click on the tab header, and when they move the pointer over it, they&#8217;ll see the popup.</p>
<p>On the downside, it does require fairly precise mousing (and holding the mouse still) for the whole time you want to read the number.  This makes it much less accessible to those who have trouble acquiring small targets and keeping the pointer still, such as the elderly or disabled using a mouse.  Additionally, you have to use the pointer to see it, which makes it inaccessible to those navigating with just the keyboard.</p>
]]></content:encoded>
			<wfw:commentRss>http://definingterms.com/2008/03/25/rt-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

