<?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>numlock.ch - a changelog by Daniel Mettler &#187; Fun</title>
	<atom:link href="http://www.numlock.ch/news/category/fun/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.numlock.ch/news</link>
	<description>Make a diff!</description>
	<lastBuildDate>Tue, 01 Nov 2011 16:19:05 +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>Quick analysis of the first animated Google doodle (&#8220;Isaac Newton&#8217;s apple&#8221;)</title>
		<link>http://www.numlock.ch/news/it/quick-analysis-of-the-first-animated-google-doodle-isaac-newton-apple/</link>
		<comments>http://www.numlock.ch/news/it/quick-analysis-of-the-first-animated-google-doodle-isaac-newton-apple/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 23:26:50 +0000</pubDate>
		<dc:creator>Daniel Mettler</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[animated Doodle]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Doodle]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Isaac Newton]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://www.numlock.ch/news/?p=806</guid>
		<description><![CDATA[You probably noticed the funny animated logo on the Google search page today, January 4, 2010 (Isaac Newton&#8217;s birthday). It shows an apple falling from a tree reminding of the story that Isaac Newton was inspired to formulate his theory &#8230; <a href="http://www.numlock.ch/news/it/quick-analysis-of-the-first-animated-google-doodle-isaac-newton-apple/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>You probably noticed the funny animated logo on the <a href="http://www.google.com/" target="_blank">Google search page</a> today, January 4, 2010 (Isaac Newton&#8217;s birthday). It shows an apple falling from a tree reminding of the story that <a href="http://en.wikipedia.org/wiki/Isaac_Newton" target="_blank">Isaac Newton</a> <a href="http://en.wikipedia.org/wiki/Isaac_Newton#Newton.27s_apple" target="_blank">was inspired to formulate his theory of gravitation by watching the fall of an apple from a tree</a>.</p>
<p><a href="http://www.numlock.ch/news/wp-content/uploads/2010/01/google_search_page_apple_isaac_newton.png"><img class="aligncenter size-medium wp-image-809" title="Screenshot of Google's doodle in memory of Isaac Newton's birthday" src="http://www.numlock.ch/news/wp-content/uploads/2010/01/google_search_page_apple_isaac_newton-300x252.png" alt="Screenshot of Google's doodle in memory of Isaac Newton's birthday" width="300" height="252" /></a></p>
<p><a href="http://www.numlock.ch/news/wp-content/uploads/2010/01/2010-01-05_0016.swf">Animation of an apple falling from a tree in Google&#8217;s doodle in memory of Isaac Newton&#8217;s birthday</a></p>
<p>As this seems to be the first animated logo on Google&#8217;s home page ever, I wondered how it was implemented (in particular, how well the code simulates gravity on earth). Short explanation: As expected, it&#8217;s a mix of JavaScript code and CSS formatting. And not surprising either, the algorithm used is an acceptable simulation of gravity on earth (in vacuum).</p>
<p>Here&#8217;s a &#8220;reformatted&#8221; version of the JavaScript code for better readability, along with some explanations as <span style="color: #008000;">inline comments</span> (note that this &#8220;reformatted&#8221; code doesn&#8217;t work as-is due to the inserted comments):</p>
<blockquote>
<pre>window.lol&amp;&amp;lol();
setTimeout( <span style="color: #008000;">// execute this code once after a timeout of 2 seconds</span>
  function(){ <span style="color: #008000;">// an anonymous function</span>
    var h=0, <span style="color: #008000;">// initial horizontal offset (=0) of the apple's position</span>
    v=1, <span style="color: #008000;">// initial vertical offset ('delta_height' = b(t+1)-b(t)) of the apple's position</span>
    f=document.getElementById('fall'), <span style="color: #008000;">// get a reference to the apple image</span>
    i=setInterval( <span style="color: #008000;">// execute repeatedly in intervals of 25 msec</span>
      function(){ <span style="color: #008000;">// yet another anonymous function</span>
        if(f){ <span style="color: #008000;">// execute if the apple image exists</span><span style="color: #008000;"> (a safety net)</span>
          var r=parseInt(f.style.right)+h,<span style="color: #008000;"> // add the horizontal offset (will move apple left for h&gt;0)</span>
          b=parseInt(f.style.bottom)-v;<span style="color: #008000;"> // subtract the vertical offset (will move apple down for v&gt;0)</span>
          f.style.right=r+'px';<span style="color: #008000;"> // set the apple's new horizontal position</span>
          f.style.bottom=b+'px';<span style="color: #008000;"> // set the apple's new vertical position</span>
          if(b&gt;-210){ <span style="color: #008000;">// the apple is above ground level (i.e. falling down or bouncing up)</span>
            v+=2 <span style="color: #008000;">// increase 'delta_height' by 2 pixels per interval (accelerate the apple's free fall or slow down its rebound)</span>
          } else { <span style="color: #008000;">// the apple hit the 'ground'</span>
            h=(v&gt;9)?v*0.1:0; <span style="color: #008000;">// bounce apple to the left at 10% of the last 'delta_height' if speedy, else don't move it horizontally</span>
            v*=(v&gt;9)?-0.3:0 <span style="color: #008000;">// bounce apple up at 30% of the last 'delta_height' if speedy, else don't move it vertically</span>
          }
        }
      }
      ,25 <span style="color: #008000;">// the interval in msec</span>
    );
    google.rein&amp;&amp;
    google.rein.push(
      function(){
        clearInterval(i); <span style="color: #008000;">// disable the interval loop</span>
        h=0;v=1
      }
    )
  },2000 <span style="color: #008000;">// the timeout in msec</span>
)
</pre>
</blockquote>
<p>The apple&#8217;s initial position:<em> position: relative; right: 248px; bottom: 46px;</em></p>
<p>The apple&#8217;s final position (after the rebound):<em> position: relative; right: 286px; bottom: -210px;</em></p>
<p><strong>Some words about the physics:</strong></p>
<p>The simple algorithm used above reflects the constant <a href="http://en.wikipedia.org/wiki/Free_fall" target="_blank">acceleration during free fall</a> accurately, supposed we&#8217;re neglecting the effect of air drag. IOW: height(t) = height(t=0) &#8211; 0.5*g*t^2 = h(t=0) &#8211; k*t^2.</p>
<p>The rebound of the apple is less realistic though. I doubt an apple would rebound that high and the fact that it rebounds to the left seems to be rather arbitrary (given the image it&#8217;s difficult to judge where the apple&#8217;s center of gravity would be compared to the contact area when touching the ground on impact). Further, simulating rotational forces on the apple wouldn&#8217;t hurt the realism ;)</p>
<p><strong>Symbolism:</strong></p>
<p>It&#8217;s not without irony that Google shows a falling <a href="http://www.apple.com/" target="_blank">apple</a> on its main page, as one reader points out on <a href="http://mashable.com/2010/01/04/google-newton-animated-logo/" target="_blank">Mashable&#8217;s article about this animation</a> ;)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.numlock.ch/news/it/quick-analysis-of-the-first-animated-google-doodle-isaac-newton-apple/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bash script of the day: New .de domains</title>
		<link>http://www.numlock.ch/news/it/bash-scrip-of-the-day-new-de-domains/</link>
		<comments>http://www.numlock.ch/news/it/bash-scrip-of-the-day-new-de-domains/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 15:05:25 +0000</pubDate>
		<dc:creator>Daniel Mettler</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[.de]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[Deutschland]]></category>
		<category><![CDATA[dict]]></category>
		<category><![CDATA[domains]]></category>
		<category><![CDATA[germany]]></category>
		<category><![CDATA[registration]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[wordlist]]></category>

		<guid isPermaLink="false">http://www.numlock.ch/news/?p=786</guid>
		<description><![CDATA[The one-liner: for i in `echo {{a..z},{0..9}};echo {{a..z},{0..9}}{{a..z},{0..9}}`;do dict -d all -C ${i}de&#62;/dev/null 2&#62;&#38;1; if [ "$?" == "0" ];then echo $i.de; fi done or the equivalent multi-liner: for i in `echo {{a..z},{0..9}};echo {{a..z},{0..9}}{{a..z},{0..9}}`; do dict -d all -C ${i}de &#8230; <a href="http://www.numlock.ch/news/it/bash-scrip-of-the-day-new-de-domains/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>The one-liner:</p>
<pre>for i in `echo {{a..z},{0..9}};echo {{a..z},{0..9}}{{a..z},{0..9}}`;do dict -d all -C ${i}de&gt;/dev/null 2&gt;&amp;1; if [ "$?" == "0" ];then echo $i.de; fi done</pre>
<p>or the equivalent multi-liner:</p>
<pre>for i in `echo {{a..z},{0..9}};echo {{a..z},{0..9}}{{a..z},{0..9}}`;
  do
    dict -d all -C ${i}de &gt;/dev/null 2&gt;&amp;1;
    if [ "$?" == "0" ]; then
      echo $i.de;
    fi
  done</pre>
<p>No comment (*cough*)</p>
<p>(P.S. That&#8217;s for ASCII alphanumeric domains only)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.numlock.ch/news/it/bash-scrip-of-the-day-new-de-domains/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Security through obscurity</title>
		<link>http://www.numlock.ch/news/various/security-through-obscurity/</link>
		<comments>http://www.numlock.ch/news/various/security-through-obscurity/#comments</comments>
		<pubDate>Fri, 15 Feb 2008 18:58:36 +0000</pubDate>
		<dc:creator>Daniel Mettler</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[Various]]></category>

		<guid isPermaLink="false">https://www.numlock.ch/wordpress/2008/02/15/security-through-obscurity/</guid>
		<description><![CDATA[[..] bei Sportgrossveranstaltungen wie der UEFA EURO 2008™ ist es üblich, dass die Eintrittskarten erst wenige Wochen vor Turnierbeginn gedruckt und versandt werden. Dies ist im Sinne der Sicherheit und verkleinert das Risiko, dass die Tickets den Karteninhabern vor den &#8230; <a href="http://www.numlock.ch/news/various/security-through-obscurity/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<blockquote><p><em><font face="Century Gothic" size="2"><span style="font-size: 10pt; font-family: 'Century Gothic'" lang="DE-CH">[..] bei Sportgrossveranstaltungen   wie der UEFA EURO 2008™ ist es üblich, dass die Eintrittskarten erst   wenige Wochen vor Turnierbeginn gedruckt und versandt werden. Dies ist im   Sinne der Sicherheit und verkleinert das Risiko, dass die Tickets den   Karteninhabern vor den Spielen abhanden kommen.[..]</span></font></em></p></blockquote>
<p>Isn&#8217;t it nice how the <font color="#000000">&#8220;EURO 2008 SA&#8221; cares for us? ;)</font></p>
]]></content:encoded>
			<wfw:commentRss>http://www.numlock.ch/news/various/security-through-obscurity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Some practical advice for startups</title>
		<link>http://www.numlock.ch/news/it/some-practical-advice-for-startups/</link>
		<comments>http://www.numlock.ch/news/it/some-practical-advice-for-startups/#comments</comments>
		<pubDate>Thu, 31 Jan 2008 00:23:53 +0000</pubDate>
		<dc:creator>Daniel Mettler</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Fun]]></category>
		<category><![CDATA[IT]]></category>
		<category><![CDATA[printscreen.ch]]></category>
		<category><![CDATA[Startups]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">https://www.numlock.ch/wordpress/2008/01/31/some-practical-advice-for-startups/</guid>
		<description><![CDATA[&#8220;The Art of the Start&#8221; by Guy Kawasaki. Not the latest, but a courageous and entertaining presentation worthwhile watching.]]></description>
			<content:encoded><![CDATA[<p><a href="http://video.google.com/videoplay?docid=-3755718939216161559&amp;hl=en" target="_blank">&#8220;The Art of the Start&#8221; by Guy Kawasaki</a>. Not the latest, but a courageous and entertaining presentation worthwhile watching.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.numlock.ch/news/it/some-practical-advice-for-startups/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Windows Vista or The Holy Grail of Usability</title>
		<link>http://www.numlock.ch/news/it/windows-vista-or-the-holy-grail-of-usability/</link>
		<comments>http://www.numlock.ch/news/it/windows-vista-or-the-holy-grail-of-usability/#comments</comments>
		<pubDate>Wed, 28 Dec 2005 01:39:18 +0000</pubDate>
		<dc:creator>Daniel Mettler</dc:creator>
				<category><![CDATA[Fun]]></category>
		<category><![CDATA[IT]]></category>

		<guid isPermaLink="false">https://www.numlock.ch/wordpress/?p=449</guid>
		<description><![CDATA[Fine. After years (heck, even decades!) of staring into distorting, flickering, radiating and mirrorlike CRT screens we finally managed to banish those darn things from our desks and to use distortion-free, flicker-free, radiation-free, coated TFT screens instead. Time to put &#8230; <a href="http://www.numlock.ch/news/it/windows-vista-or-the-holy-grail-of-usability/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Fine. After years (heck, even decades!) of staring into distorting, flickering, radiating and <strong><em>mirrorlike CRT screens</em></strong> we finally managed to banish those darn things from our desks and to use distortion-free, flicker-free, radiation-free, <strong><em>coated TFT screens</em></strong> instead. <strong>Time to <a href="http://www.winsupersite.com/images/showcase/vista5270_041.jpg">put glares and reflections back into the GUI</a> (just try to read the labels on the taskbar)! Hallelujah! ;)</strong></p>
<p>(I bet Microsoft will get back to this once the dust has settled. Apple made a similar experience with Aqua&#8217;s transparency effect which was significantly reduced in later versions.)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.numlock.ch/news/it/windows-vista-or-the-holy-grail-of-usability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

