<?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>Sugus &#187; experiments</title>
	<atom:link href="http://diffract.me/category/experiments/feed/" rel="self" type="application/rss+xml" />
	<link>http://diffract.me</link>
	<description>Specifically Unwanted Gathering of Under-appreciated Stuff</description>
	<lastBuildDate>Wed, 10 Mar 2010 08:39:39 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Video speed controls on youtube&#8217;s HTML5 player</title>
		<link>http://diffract.me/2010/02/video-speed-controls-on-youtubes-html5-player/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2010/02/video-speed-controls-on-youtubes-html5-player/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 14:12:44 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[findings]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=740</guid>
		<description><![CDATA[<p>I don&#8217;t know if you noticed, but youtube introduced speed controls to their HTML5 video player. I have no idea if it was there from the beginning, actually, but it&#8217;s a really cool feature indeed  </p>
<p></p>


<p>Related posts:Friendfeed youtube favorites integration
Twitter Weekly Updates for 2010-02-19
</p>


Related posts:<ol><li><a href='http://diffract.me/2009/10/friendfeed-youtube-favorites-integration/' rel='bookmark' title='Permanent Link: Friendfeed youtube favorites integration'>Friendfeed youtube favorites integration</a></li>
<li><a href='http://diffract.me/2010/02/twitter-weekly-updates-for-2010-02-19/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-19'>Twitter Weekly Updates for 2010-02-19</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know if you noticed, but <a href="http://youtube.com">youtube</a> introduced speed controls to their <a href="http://www.youtube.com/html5">HTML5 video</a> player. I have no idea if it was there from the beginning, actually, but it&#8217;s a really cool feature indeed <img src='http://diffract.me/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p><a href="http://www.youtube.com/html5"><img class="alignleft size-full wp-image-741" title="Youtube HTML5 video speed controls" src="http://diffract.me/wp-content/uploads/2010/02/speed_youtube.png" alt="Youtube HTML5 video speed controls" width="468" height="302" /></a></p>


<p>Related posts:<ol><li><a href='http://diffract.me/2009/10/friendfeed-youtube-favorites-integration/' rel='bookmark' title='Permanent Link: Friendfeed youtube favorites integration'>Friendfeed youtube favorites integration</a></li>
<li><a href='http://diffract.me/2010/02/twitter-weekly-updates-for-2010-02-19/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-19'>Twitter Weekly Updates for 2010-02-19</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2010/02/video-speed-controls-on-youtubes-html5-player/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bomb This Country</title>
		<link>http://diffract.me/2010/02/bomb-this-country/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2010/02/bomb-this-country/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 08:08:15 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[jokes]]></category>
		<category><![CDATA[software development]]></category>

		<guid isPermaLink="false">http://diffract.me/2010/02/bomb-this-country/</guid>
		<description><![CDATA[ After an awesome Japanese dinner with my good friend  Luizzz , we came to the conclusion that the website that was missing was one where you could bomb any country in the world. ...  So over the course of about 8 hours - the next day - we came up with  bombthiscountry.com , a meaningless website where you can bomb any country in the world (yes, China, Tibet is a country). (...)<br/ >[<a href="http://diffract.me/2010/02/bomb-this-country/">continue reading</a>]


Related posts:<ol><li><a href='http://diffract.me/2010/02/twitter-weekly-updates-for-2010-02-19/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-19'>Twitter Weekly Updates for 2010-02-19</a></li>
<li><a href='http://diffract.me/2010/02/twitter-weekly-updates-for-2010-02-26/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-26'>Twitter Weekly Updates for 2010-02-26</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After an awesome Japanese dinner with my good friend <a href="http://twitter.com/luizsoarez">Luizzz</a>, we came to the conclusion that the website that was missing was one where you could bomb any country in the world. The motivation for this was part statistical curiosity and part plain bastardness (did i just make up another word?).</p>
<p>So over the course of about 8 hours &#8211; the next day &#8211; we came up with <a href="http://bombthiscountry.com">bombthiscountry.com</a>, a meaningless website where you can bomb any country in the world (yes, China, Tibet is a country). If you <a href="http://twitter.com/bombthiscountry">follow it on twitter</a> you get daily statistics on the most bombed countries in the world.</p>


<p>Related posts:<ol><li><a href='http://diffract.me/2010/02/twitter-weekly-updates-for-2010-02-19/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-19'>Twitter Weekly Updates for 2010-02-19</a></li>
<li><a href='http://diffract.me/2010/02/twitter-weekly-updates-for-2010-02-26/' rel='bookmark' title='Permanent Link: Twitter Weekly Updates for 2010-02-26'>Twitter Weekly Updates for 2010-02-26</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2010/02/bomb-this-country/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Websockets tutorial/example with pywebsocket</title>
		<link>http://diffract.me/2009/12/websockets-tutorialexample-with-pywebsocket/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2009/12/websockets-tutorialexample-with-pywebsocket/#comments</comments>
		<pubDate>Fri, 18 Dec 2009 12:37:24 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[code snipplets]]></category>
		<category><![CDATA[computers]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[software development]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=634</guid>
		<description><![CDATA[<p>As everyone already knows, Google Chrome now supports websockets. In essence, this allows you to keep a connection open with a webserver indefinitely (analogous to typical sockets) and send data bi-directionally. Unfortunately Chrome is the only browser currently supporting this, but I&#8217;m pretty sure this will change.</p>
<p>So I decided to (...)<br/ >[<a href="http://diffract.me/2009/12/websockets-tutorialexample-with-pywebsocket/">continue reading</a>]


Related posts:<ol><li><a href='http://diffract.me/2010/01/my-small-pywebsocket-tutorial/' rel='bookmark' title='Permanent Link: My small pywebsocket tutorial &#8230;'>My small pywebsocket tutorial &#8230;</a></li>
<li><a href='http://diffract.me/2009/11/android-location-provider-mock/' rel='bookmark' title='Permanent Link: Android location provider mock'>Android location provider mock</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>As everyone already knows, <a href="http://www.google.com/chrome">Google Chrome</a> now supports <a href="http://dev.w3.org/html5/websockets/#websocket">websockets</a>. In essence, this allows you to keep a connection open with a webserver indefinitely (analogous to typical sockets) and send data bi-directionally. Unfortunately Chrome is the only browser currently supporting this, but I&#8217;m pretty sure this will change.</p>
<p>So I decided to give this a try and experiment a bit with it. This is my step by step process on getting a web page opening a websocket to a server and receiving the server&#8217;s date and time every second. It is based on an <a href="http://armstrongonsoftware.blogspot.com/2009/12/comet-is-dead-long-live-websockets.html">article by Joe Armstrong</a>, though he uses <a href="http://ftp.sunet.se/pub/lang/erlang/">Erlang</a> for the server, while I decided to follow the easy road and use <a href="http://code.google.com/p/pywebsocket/">Google&#8217;s pywebsocket</a> &#8211; an apache module (uses mod_python) that allows you to create handlers for websocket connections in a easy-to-use fashion. The code also contains a way to start a standalone server (i.e. not requiring apache) for testing purposes.</p>
<p>So here are the steps I took to get this working:</p>
<h4>1. Create a web page</h4>
<p>This is the code I borrowed from Joe, though slightly modified to fit my purposes (it requires <a href="http://jquery.com/">jquery</a>, by the way):</p>
<pre>&lt;html&gt;

&lt;head&gt;

&lt;script src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;
&lt;script&gt;

$(document).ready(function(){

var ws;

if ("WebSocket" in window) {
debug("Horray you have web sockets. Trying to connect...");
ws = new WebSocket("ws://localhost:9998/echo");

ws.onopen = function() {
// Web Socket is connected. You can send data by send() method.
debug("connected...");
ws.send("hello from the browser");
ws.send("more from browser");
};

run = function() {
var val=$("#i1").val(); // read the entry
$("#i1").val("");       // and clear it
ws.send(val);           // tell erlang
return true;            // must do this
};

ws.onmessage = function (evt)
{
//alert(evt.data);
var data = evt.data;
var i = data.indexOf("!");
var tag = data.slice(0,i);
var val = data.slice(i+1);
$("#" + tag).html(val);
};

ws.onclose = function()
{
debug(" socket closed");
};
} else {
alert("You have no web sockets");
};

function debug(str){
$("#debug").append("&lt;p&gt;" +  str);
};

});
&lt;/script&gt;

&lt;/head&gt;

&lt;body&gt;

&lt;h1&gt;Interaction experiment&lt;/h1&gt;

&lt;h2&gt;Debug&lt;/h2&gt;
&lt;div id="debug"&gt;&lt;/div&gt;

&lt;fieldset&gt;
&lt;legend&gt;Clock&lt;/legend&gt;
&lt;div id="clock"&gt;I am a clock&lt;/div&gt;
&lt;/fieldset&gt;

&lt;/body&gt;

&lt;/html&gt;</pre>
<h4>2. Download and install pywebsocket</h4>
<p>Checkout the code with</p>
<pre><span>svn checkout http</span><span>:</span><span>//pywebsocket.googlecode.com/svn/trunk/ pywebsocket-read-only
</span></pre>
<p>Then do <strong>python setup.py build</strong> and <strong>sudo python setup.py install</strong> inside the <strong>src</strong> folder. This will install it into your python environment.</p>
<h4>3. Being lazy, means we will change an example handler</h4>
<p>The way pywebsocket works is delegating the connections to something they call handlers. In the <strong><span>pywebsocket-read-only/src/example</span></strong><span> folder you will find a file named <strong>echo_wsh.py</strong>. They have this convention where handlers are named <strong>&lt;entry_point&gt;_wsh.py</strong>. This means that when you later call (from your web page) the url <strong>http://localhost:9998/echo</strong> the server will delegate the processing of that connection to that file.</span></p>
<p><span>I modified that file to something like this:</span></p>
<pre># Copyright 2009, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
#     * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
#     * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

from mod_pywebsocket import msgutil
from datetime import datetime
import time

_GOODBYE_MESSAGE = 'Goodbye'

def web_socket_do_extra_handshake(request):
 print 'Connected.'
 pass  # Always accept.

def web_socket_transfer_data(request):
 while True:
 time.sleep(1)
 date = datetime.now()
 #try:
 #    line = msgutil.receive_message(request)
 #except Exception, e:
 #    print 'Foi com os porcos'
 #    raise e
 #print 'Got something: %s' % line
 #msgutil.send_message(request, line)
 msgutil.send_message(request, 'clock!%s' % date)
 #if line == _GOODBYE_MESSAGE:
 #    return</pre>
<p>So basically whenever a new connection is made to this entry point, a call to <strong>web_socket_do_extra_handshake</strong> is made. After that, <strong>web_socket_transfer_data</strong> is called and it&#8217;s your responsibility to create the loop that receives messages and handles the flow (as you can see in the commented lines). I don&#8217;t care about that right now, since I only want to push the date and time to the client every second.</p>
<h4>3. Start the standalone server</h4>
<p>Go to the <strong><span>pywebsocket-read-only/src/mod_pywebsocket</span></strong> folder and run the following command:</p>
<pre>sudo python standalone.py -p 9998 -w ../example/</pre>
<p>This will start the server in port 9998 and use the handlers directory specified by the -w option. That is where our echo_wsh.py lives.</p>
<h4>4. Test it <img src='http://diffract.me/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </h4>
<p>So now open your browser (remember, only chrome supports websockets currently) and open the html file your created in the beginning. Voilá, server&#8217;s date and time every second in the clock div.</p>


<p>Related posts:<ol><li><a href='http://diffract.me/2010/01/my-small-pywebsocket-tutorial/' rel='bookmark' title='Permanent Link: My small pywebsocket tutorial &#8230;'>My small pywebsocket tutorial &#8230;</a></li>
<li><a href='http://diffract.me/2009/11/android-location-provider-mock/' rel='bookmark' title='Permanent Link: Android location provider mock'>Android location provider mock</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2009/12/websockets-tutorialexample-with-pywebsocket/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>World&#8217;s deadliest ping pong cannon</title>
		<link>http://diffract.me/2009/11/worlds-deadliest-ping-pong-cannon/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2009/11/worlds-deadliest-ping-pong-cannon/#comments</comments>
		<pubDate>Wed, 11 Nov 2009 17:00:10 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[hardware]]></category>
		<category><![CDATA[toys]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=562</guid>
		<description><![CDATA[<p>I want one of these. I wonder who comes up with these things. Maybe the same guy that thought it was a good idea to shoot a satellite against the moon.</p>
<p></p>


<p>Related posts:Dutch break world domino record
</p>


Related posts:<ol><li><a href='http://diffract.me/2009/11/dutch-break-world-domino-record/' rel='bookmark' title='Permanent Link: Dutch break world domino record'>Dutch break world domino record</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>I want one of <a href="http://gajitz.com/ping-pong-pow-worlds-deadliest-pneumatic-ping-pong-gun/">these</a>. I wonder who comes up with these things. Maybe the same guy that thought it was a good idea to <a href="http://www.cnn.com/2009/TECH/space/10/09/probe.moon.crash/index.html">shoot a satellite against the moon</a>.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="344" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowScriptAccess" value="always" /><param name="src" value="http://www.youtube.com/v/glvIJLeepck&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="425" height="344" src="http://www.youtube.com/v/glvIJLeepck&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;hl=en&amp;feature=player_embedded&amp;fs=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>


<p>Related posts:<ol><li><a href='http://diffract.me/2009/11/dutch-break-world-domino-record/' rel='bookmark' title='Permanent Link: Dutch break world domino record'>Dutch break world domino record</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2009/11/worlds-deadliest-ping-pong-cannon/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Asimo robot&#8217;s adaptative learning</title>
		<link>http://diffract.me/2009/11/asimo-robots-adaptative-learning/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2009/11/asimo-robots-adaptative-learning/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 10:27:38 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[computers]]></category>
		<category><![CDATA[experiments]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=551</guid>
		<description><![CDATA[<p>Watch this video. Show some impressive developments on the artificial intelligence of the robot Asimo: Identifying objects, using features to extrapolate to other unknown ones.</p>
<p>The robot war is near  </p>


<p>Related posts:Working on something really cool
junaio &#8211; 3D mobile augmented reality for iphone
</p>


Related posts:<ol><li><a href='http://diffract.me/2009/07/working-on-something-really-cool/' rel='bookmark' title='Permanent Link: Working on something really cool'>Working on something really cool</a></li>
<li><a href='http://diffract.me/2009/11/junaio-3d-mobile-augmented-reality-for-iphone/' rel='bookmark' title='Permanent Link: junaio &#8211; 3D mobile augmented reality for iphone'>junaio &#8211; 3D mobile augmented reality for iphone</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><a href="http://hplusmagazine.com/articles/multimedia/videos/asimos-new-artificial-intelligence-asimo-learning">Watch this video</a>. Show some impressive developments on the artificial intelligence of the robot Asimo: Identifying objects, using features to extrapolate to other unknown ones.</p>
<p>The robot war is near <img src='http://diffract.me/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://diffract.me/2009/07/working-on-something-really-cool/' rel='bookmark' title='Permanent Link: Working on something really cool'>Working on something really cool</a></li>
<li><a href='http://diffract.me/2009/11/junaio-3d-mobile-augmented-reality-for-iphone/' rel='bookmark' title='Permanent Link: junaio &#8211; 3D mobile augmented reality for iphone'>junaio &#8211; 3D mobile augmented reality for iphone</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2009/11/asimo-robots-adaptative-learning/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dig a hole through Earth</title>
		<link>http://diffract.me/2009/11/dig-a-hole-through-earth/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2009/11/dig-a-hole-through-earth/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 23:01:07 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[time wasting]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=544</guid>
		<description><![CDATA[<p>Turns out that a hole made in my home country, Portugal, would end up in New Zealand:</p>
<p></p>
<p>Check the source website here, and figure out where your country leads to on the other side of the world  </p>


<p>Related posts:Bomb This Country
Weather issues, no jumping
</p>


Related posts:<ol><li><a href='http://diffract.me/2010/02/bomb-this-country/' rel='bookmark' title='Permanent Link: Bomb This Country'>Bomb This Country</a></li>
<li><a href='http://diffract.me/2009/11/weather-issues-no-jumping/' rel='bookmark' title='Permanent Link: Weather issues, no jumping'>Weather issues, no jumping</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Turns out that a hole made in my home country, Portugal, would end up in New Zealand:</p>
<p><a href="http://diffract.me/wp-content/uploads/2009/11/Screen-shot-2009-11-06-at-11.58.19-PM.png"><img class="alignnone size-medium wp-image-545" title="Screen shot 2009-11-06 at 11.58.19 PM" src="http://diffract.me/wp-content/uploads/2009/11/Screen-shot-2009-11-06-at-11.58.19-PM-300x151.png" alt="Screen shot 2009-11-06 at 11.58.19 PM" width="300" height="151" /></a></p>
<p>Check the source website <a href="http://www.freemaptools.com/tunnel-to-other-side-of-the-earth.htm">here</a>, and figure out where your country leads to on the other side of the world <img src='http://diffract.me/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>


<p>Related posts:<ol><li><a href='http://diffract.me/2010/02/bomb-this-country/' rel='bookmark' title='Permanent Link: Bomb This Country'>Bomb This Country</a></li>
<li><a href='http://diffract.me/2009/11/weather-issues-no-jumping/' rel='bookmark' title='Permanent Link: Weather issues, no jumping'>Weather issues, no jumping</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2009/11/dig-a-hole-through-earth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Shopping cart stunt failed</title>
		<link>http://diffract.me/2009/11/shopping-cart-stunt-failed/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2009/11/shopping-cart-stunt-failed/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 17:00:58 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[wtf]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=539</guid>
		<description><![CDATA[<p>Every daring endeavor is prone to small hiccups along the way  </p>
<p></p>


<p>Related posts:Shopping bicycle. I want one.
</p>


Related posts:<ol><li><a href='http://diffract.me/2009/07/shopping-bicycle-i-want-one/' rel='bookmark' title='Permanent Link: Shopping bicycle. I want one.'>Shopping bicycle. I want one.</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>Every daring endeavor is prone to small hiccups along the way <img src='http://diffract.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><object id="viddler" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="437" height="333" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="src" value="http://www.viddler.com/player/6a056190/" /><param name="name" value="viddler" /><param name="allowfullscreen" value="true" /><embed id="viddler" type="application/x-shockwave-flash" width="437" height="333" src="http://www.viddler.com/player/6a056190/" name="viddler" allowfullscreen="true" allowscriptaccess="always"></embed></object></p>


<p>Related posts:<ol><li><a href='http://diffract.me/2009/07/shopping-bicycle-i-want-one/' rel='bookmark' title='Permanent Link: Shopping bicycle. I want one.'>Shopping bicycle. I want one.</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2009/11/shopping-cart-stunt-failed/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>&#8220;Early riser&#8221; experiment conclusions</title>
		<link>http://diffract.me/2009/10/early-riser-experiment-conclusions/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2009/10/early-riser-experiment-conclusions/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 11:56:35 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[insomnia]]></category>
		<category><![CDATA[revelations]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=424</guid>
		<description><![CDATA[<p>In case you didn&#8217;t read my entry on becoming an &#8220;early riser&#8221; (i.e. someone that gets up every day at the same (early) hour), I started a 30 day experiment to see what would happen to me both physically and mentally if I did. These are the conclusions.</p>
<p>Let me start (...)<br/ >[<a href="http://diffract.me/2009/10/early-riser-experiment-conclusions/">continue reading</a>]


Related posts:<ol><li><a href='http://diffract.me/2009/09/trying-to-become-an-early-riser/' rel='bookmark' title='Permanent Link: Trying to become an early riser'>Trying to become an early riser</a></li>
<li><a href='http://diffract.me/2009/12/websockets-tutorialexample-with-pywebsocket/' rel='bookmark' title='Permanent Link: Websockets tutorial/example with pywebsocket'>Websockets tutorial/example with pywebsocket</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>In case you didn&#8217;t read my entry on <a href="http://diffract.me/2009/09/trying-to-become-an-early-riser/">becoming an &#8220;early riser&#8221;</a> (i.e. someone that gets up every day at the same (early) hour), I started a 30 day experiment to see what would happen to me both physically and mentally if I did. These are the conclusions.</p>
<p>Let me start by giving some background: I&#8217;ve always been one of those people that said they require &#8211; at least &#8211; 9 hours of sleep every night. The reason for this, for me, was that I always felt sleepy during my work days, so another purpose of the experiment was to try to refute this myth of mine.</p>
<p>During the 30 days there was only one when I broke the &#8220;always get up at the same time without hitting the snooze button&#8221; rule. And it was a Saturday, so don&#8217;t hold it against me <img src='http://diffract.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> . Just kidding. The reason why I did it was to demonstrate to myself how hard it is to give up on the infamous snooze button in the morning. I know it happens to everyone: &#8220;just 5 more minutes&#8221;. And then you just do the same 5 minutes later. Let me tell you: It&#8217;s bad!!! It&#8217;s evil!!! It will help crush your motivation for pretty much everything else.</p>
<p>But I digress, let&#8217;s go back. During the experiment the minimum amount of hours I slept in any given night was 5. It did, however, happen in one of the first nights so I will ignore it and assume the next value as the minimum: 6 hours and 30 minutes. The longest I slept was 9.30 (also in the first days, probably to recover from the previous 5). My average sleep time, all nights considered, was 7:35.</p>
<table border="0">
<tbody>
<tr>
<th>Minimum</th>
<th>Maximum</th>
<th>Average</th>
</tr>
<tr>
<td>6:30</td>
<td>9:30</td>
<td>7:35</td>
</tr>
</tbody>
</table>
<p>There are a couple of interesting small conclusions that I can take from a look at the complete sleep data:</p>
<ol>
<li>As you move along in the experiment, you body starts to regulate itself: Since you basically control your waking up time, your body will start asking to sleep when it&#8217;s actually really tired. This makes, in my opinion, a better way of regulating your sleep pattern (1). As a side effect, it seems that you will indeed start to get low sleeping time deviations. I.e., there are no &#8220;freak&#8221; sleep occurrences, like sleeping 20 hours, or 2 hours (2);</li>
<li>My actual sleep needs are actually less than what I had expected. And physically I don&#8217;t feel any more tired than before. If anything, I feel more awake and energized.</li>
</ol>
<p>Data apart, I am sure that you will:</p>
<ul>
<li>Feel more energized every morning after waking up instantly;</li>
<li>Usually wake up 1-2 minutes before the alarm clock triggers;</li>
<li>Experience a greater motivation, especially to work on personal stuff (pet projects, for instance);</li>
<li>Have a lot more time on your hands. Your weekends will feel like an entire week, with everything you can accomplish instead of being asleep for 4 more hours like I used to;</li>
</ul>
<p>I also read in <a href="http://www.google.de/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;url=http%3A%2F%2Fwww.stevepavlina.com%2Fblog%2F2005%2F05%2Fhow-to-become-an-early-riser%2F&amp;ei=yIzNSrrMOdWPsAayiK3jAQ&amp;usg=AFQjCNHVmLZ2qKQCyRnrYeigR75Lm-0O-g&amp;sig2=dAhrzXz1aJEcMb-8BkNOVg">the post that motivated this</a> that, generally, your mind would slowly start to give you a broader picture on your problems, instead of focusing so much on the details. I cannot say I have experienced this shift, but I do agree that a little more motivation goes a long way to make you think harder about the problems and their solutions, and that might have been what Steve referred to when he wrote that.</p>
<p>I hope you found the article interesting and I would definitely like to hear about your experiences on the subject <img src='http://diffract.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Peace.</p>
<p>NOTES:</p>
<p>(1) If you think about it the other way around you can understand it better. Imagine that you always go to bed at the same time. The problem with this is that you usually have a schedule of some sort to keep. Which forces you do one of two things: Either you don&#8217;t sleep enough or you go to bed when you still are not sleepy enough (and basically stay in bed wasting time). This approach makes it much harder for your body to regulate the sleep pattern. On the other hand, if you always wake up at the same time, you will never have problems with being on time for your appointments and you still make sure that you sleep enough (and only the required amount) because your body will be the one to tell you when it needs to sleep.</p>
<p>(2) Provided, of course, you don&#8217;t stay up getting hammered with friends at the local bar. But fear not, your body will ask to recover the next night, by making you sleep a lot earlier. The main thing to keep in mind is that you should never break the getting up rule.</p>


<p>Related posts:<ol><li><a href='http://diffract.me/2009/09/trying-to-become-an-early-riser/' rel='bookmark' title='Permanent Link: Trying to become an early riser'>Trying to become an early riser</a></li>
<li><a href='http://diffract.me/2009/12/websockets-tutorialexample-with-pywebsocket/' rel='bookmark' title='Permanent Link: Websockets tutorial/example with pywebsocket'>Websockets tutorial/example with pywebsocket</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2009/10/early-riser-experiment-conclusions/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Trying to become an early riser</title>
		<link>http://diffract.me/2009/09/trying-to-become-an-early-riser/?&amp;owa_from=feed&amp;owa_sid=</link>
		<comments>http://diffract.me/2009/09/trying-to-become-an-early-riser/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 09:34:02 +0000</pubDate>
		<dc:creator>Pedro Assuncao</dc:creator>
				<category><![CDATA[experiments]]></category>
		<category><![CDATA[revelations]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://diffract.me/?p=379</guid>
		<description><![CDATA[<p>After reading a post by Steve Pavlina I thought if  I could become a natural early riser, i.e, someone that gets up really early in the morning and has no problem with that. I felt curious when I read that, after turning into an early riser, he became more productive (...)<br/ >[<a href="http://diffract.me/2009/09/trying-to-become-an-early-riser/">continue reading</a>]


Related posts:<ol><li><a href='http://diffract.me/2009/10/early-riser-experiment-conclusions/' rel='bookmark' title='Permanent Link: &#8220;Early riser&#8221; experiment conclusions'>&#8220;Early riser&#8221; experiment conclusions</a></li>
<li><a href='http://diffract.me/2008/12/computers-and-jumps/' rel='bookmark' title='Permanent Link: Computers and jumps'>Computers and jumps</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>After reading a <a href="http://www.stevepavlina.com/blog/2005/05/how-to-become-an-early-riser/">post by Steve Pavlina</a> I thought if  I could become a natural early riser, i.e, someone that gets up really early in the morning and has no problem with that. I felt curious when I read that, after turning into an early riser, he became more productive and felt more refreshed throughout the day.</p>
<p>Being someone who always thought that I *really* need 9 hours of sleep everyday (no matter the time I get up or go to sleep), I just had to try for myself.</p>
<p>I must say that I&#8217;m usually not into that whole &#8220;personal development&#8221; thing that Steve Pavlina advertises and sells, but I decided to give his advice a try. In essence:</p>
<ol>
<li> Get up every day at the same time (I chose 7am), no matter the time you go to bed;</li>
<li>Go to bed only when you are really sleepy. Like when you can&#8217;t read one page of a book without dozing off.</li>
</ol>
<p>I&#8217;m currently in day 4 of the experiment and the first 2 days were &#8211; for obvious reasons &#8211; a bit chaotic. Although I was really productive, it felt like I didn&#8217;t sleep enough. Did I mention these 2 days were Saturday and Sunday? <img src='http://diffract.me/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Let me know if you tried something like this and what were your results.</p>


<p>Related posts:<ol><li><a href='http://diffract.me/2009/10/early-riser-experiment-conclusions/' rel='bookmark' title='Permanent Link: &#8220;Early riser&#8221; experiment conclusions'>&#8220;Early riser&#8221; experiment conclusions</a></li>
<li><a href='http://diffract.me/2008/12/computers-and-jumps/' rel='bookmark' title='Permanent Link: Computers and jumps'>Computers and jumps</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://diffract.me/2009/09/trying-to-become-an-early-riser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
