<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>There's no Place Like ::1</title>
    <link>http://blog.0x82.com/posts.rss</link>
    <description />
    <language>en-us</language>
    
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TheresNoPlaceLike1" /><feedburner:info uri="theresnoplacelike1" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Gowalla spots Google Maps mashup</title>
      <category>api, gowalla, ruby</category>
      <description>&lt;p&gt;Sunday monday fun: &lt;a href="http://github.com/pengwynn/gowalla"&gt;gowalla gem&lt;/a&gt;, &lt;a href="http://maps.google.com"&gt;google maps&lt;/a&gt;, some Javascript stuff, and a Rails app.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://gowallamaps.heroku.com"&gt;Gowalla spots Google Maps Mashup&lt;/a&gt; [http://gowallamaps.heroku.com]&lt;/p&gt;
&lt;p&gt;It tries to use HTML5 geo location to get a position on the map (defaults to somewhere on &lt;span class="caps"&gt;USA&lt;/span&gt;). Probably best used on the iphone (tried on a friend&amp;#8217;s Android and it failed :S). Screenshot:&lt;/p&gt;
&lt;p&gt;&lt;img src="http://0x82.blog.s3.amazonaws.com/01032010/gowalla.png" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;Simple hack, and a reminder for &lt;a href="http://www.gowalla.com"&gt;Gowalla&lt;/a&gt; to open up their &lt;span class="caps"&gt;API&lt;/span&gt; :) Thnks @pengwynn for the awesome gem :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/rI9kWd8o4mwr7m_ivdsUeK8glgw/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rI9kWd8o4mwr7m_ivdsUeK8glgw/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/rI9kWd8o4mwr7m_ivdsUeK8glgw/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/rI9kWd8o4mwr7m_ivdsUeK8glgw/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheresNoPlaceLike1/~4/e7BZz4GzBNE" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 01 Mar 2010 09:29:00 -0800</pubDate>
      <link>http://feedproxy.google.com/~r/TheresNoPlaceLike1/~3/e7BZz4GzBNE/gowalla-spots-google-maps-mashup</link>
      <guid isPermaLink="false">http://blog.0x82.com/2010/3/1/gowalla-spots-google-maps-mashup</guid>
    <feedburner:origLink>http://blog.0x82.com/2010/3/1/gowalla-spots-google-maps-mashup</feedburner:origLink></item>
    <item>
      <title>ActivityStreams parser Ruby gem</title>
      <category>activitystreams, json, ruby, xml</category>
      <description>&lt;p&gt;&lt;a href="http://activitystrea.ms/"&gt;ActivityStreams&lt;/a&gt; is the next big thing &lt;sup&gt;TM&lt;/sup&gt;. It defines a protocol to syndicate activities taken from web applications (mainly social ones) and services. Just imagine a common spec for describing the activities a user do on Facebook, FriendFeed, Delicious, etc.&lt;/p&gt;
&lt;p&gt;The protocol originally targeted the Atom &lt;span class="caps"&gt;XML&lt;/span&gt; Standard, via an extension. Later, some work has been done on standardizing a &lt;span class="caps"&gt;JSON&lt;/span&gt; format too.&lt;/p&gt;
&lt;p&gt;With that in mind, I&amp;#8217;ve tried to implement a Ruby parser that defines a common &lt;span class="caps"&gt;API&lt;/span&gt; to access both the Atom and the &lt;span class="caps"&gt;JSON&lt;/span&gt; specification. Is is now available on &lt;a href="http://github.com/webcracy/activity_streams"&gt;github&lt;/a&gt; and also as a &lt;a href="http://rubygems.org/gems/activity_streams"&gt;Ruby gem&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here&amp;#8217;s a simple demonstration on how it works. We take the excellent &lt;a href="http://feedproxy.cliqset.com/"&gt;Cliqset feed proxy&lt;/a&gt; and get an activity streams annotated Twitter Atom feed:&lt;/p&gt;
&lt;script src="http://gist.github.com/314594.js?file=activity_streams_example.rb"&gt;&lt;/script&gt;&lt;p&gt;The &lt;span class="caps"&gt;JSON&lt;/span&gt; &lt;span class="caps"&gt;API&lt;/span&gt; is very similar. Some documentation is up on &lt;a href="http://rdoc.info/projects/webcracy/activity_streams"&gt;rdoc.info&lt;/a&gt; and it is worth checking the spec too. Have fun :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/lntePzwNq1iqcmXrt9YMKJzIR9A/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lntePzwNq1iqcmXrt9YMKJzIR9A/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/lntePzwNq1iqcmXrt9YMKJzIR9A/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/lntePzwNq1iqcmXrt9YMKJzIR9A/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheresNoPlaceLike1/~4/1jewlJ-BZbc" height="1" width="1"/&gt;</description>
      <pubDate>Thu, 25 Feb 2010 07:02:00 -0800</pubDate>
      <link>http://feedproxy.google.com/~r/TheresNoPlaceLike1/~3/1jewlJ-BZbc/activitystreams-ruby-parser-gem</link>
      <guid isPermaLink="false">http://blog.0x82.com/2010/2/25/activitystreams-ruby-parser-gem</guid>
    <feedburner:origLink>http://blog.0x82.com/2010/2/25/activitystreams-ruby-parser-gem</feedburner:origLink></item>
    <item>
      <title>OpenCL in MacRuby (hack, not very useful)</title>
      <category>macruby, opencl</category>
      <description>&lt;p&gt;Quick post to let you know about my latest hack: basic support for &lt;a href="http://en.wikipedia.org/wiki/OpenCL"&gt;OpenCL&lt;/a&gt; on &lt;a href="http://macruby.org"&gt;MacRuby&lt;/a&gt; and Snow Leopard.&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;it is my first Ruby C extension ever	&lt;li&gt;it is my first OpenCL approach ever	&lt;li&gt;it is my first MacRuby hack (ever)&lt;/ul&gt;
&lt;p&gt;With this in mind, don&amp;#8217;t expect real world usage from this code, nor that it will get merged into upstream: it was just written for fun!&lt;/p&gt;
&lt;p&gt;The MacRuby branch with the changes is located &lt;a href="http://github.com/rubenfonseca/macruby"&gt;here&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;Example&lt;/h4&gt;
&lt;p&gt;The hello world on OpenCL is probably &amp;#8220;calculate each element&amp;#8217;s square on a given array&amp;#8221;. The code below shows how this can be done in MacRuby:&lt;/p&gt;
&lt;script src="http://gist.github.com/284779.js?file=test_macruby_opencl.rb"&gt;&lt;/script&gt;&lt;p&gt;This code runs the same computation on all available OpenCL devices on your hardware. The results on my hardware (2 GPUs, 1CPU) are:&lt;/p&gt;
&lt;script src="http://gist.github.com/284792.js?file=gistfile1.txt"&gt;&lt;/script&gt;&lt;p&gt;It was fun, and maybe it can inspire someone :) The OpenCL &lt;span class="caps"&gt;API&lt;/span&gt; is kinda complex and I&amp;#8217;m not sure if there&amp;#8217;s a good way of making it Rubyish enough. Suggestions are welcome! Have fun :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/AU4M8Py5kmNuFXNRSihzL2qqlfM/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AU4M8Py5kmNuFXNRSihzL2qqlfM/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/AU4M8Py5kmNuFXNRSihzL2qqlfM/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/AU4M8Py5kmNuFXNRSihzL2qqlfM/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheresNoPlaceLike1/~4/Oh8Pk6Ef5EA" height="1" width="1"/&gt;</description>
      <pubDate>Sat, 23 Jan 2010 12:39:00 -0800</pubDate>
      <link>http://feedproxy.google.com/~r/TheresNoPlaceLike1/~3/Oh8Pk6Ef5EA/opencl-in-macruby-hack-not-very-useful</link>
      <guid isPermaLink="false">http://blog.0x82.com/2010/1/23/opencl-in-macruby-hack-not-very-useful</guid>
    <feedburner:origLink>http://blog.0x82.com/2010/1/23/opencl-in-macruby-hack-not-very-useful</feedburner:origLink></item>
    <item>
      <title>Twitter AMQP WebSocket Example (no polling)</title>
      <category>amqp, ruby, twitter, websocket</category>
      <description>&lt;p&gt;HTML5 is here! Urray!&lt;/p&gt;
&lt;p&gt;I was tired of hearing about one of the new innovation in HTML5: the &lt;a href="http://dev.w3.org/html5/websockets/"&gt;WebSocket &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;After reading the excelent blog post about &lt;a href="http://www.igvita.com/2009/12/22/ruby-websockets-tcp-for-the-browser/"&gt;WebSockets and Ruby&lt;/a&gt; by Ilya Grigorik I got inspired by &lt;a href="http://rfw.posterous.com/musictweets-a-rediswebsocket-powered-experime"&gt;this experiment&lt;/a&gt; which is a simple example of a &lt;em&gt;twitter-to-browser&lt;/em&gt; usage of websockets.&lt;/p&gt;
&lt;p&gt;Since the excelent &lt;a href="http://github.com/igrigorik/em-websocket"&gt;em-websocket&lt;/a&gt; was available on github, I decided to write my own &amp;#8220;from twitter to the browser&amp;#8221; real time updates, with no polling.&lt;/p&gt;
&lt;p&gt;You can check the final result on &lt;a href="http://github.com/rubenfonseca/twitter-amqp-websocket-example"&gt;my github repo&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;General overview&lt;/h3&gt;
&lt;p&gt;Twitter Stream &lt;span class="caps"&gt;API&lt;/span&gt; &amp;#8594; Filter &amp;#8594; RabbitMQ &amp;#8594; &lt;span class="caps"&gt;AMQP&lt;/span&gt; &amp;#8594; Eventmachine &amp;#8594; WebSocket &amp;#8594; HTML5 Brwser&lt;/p&gt;
&lt;p&gt;Too much buzzwords? Lets look at some code.&lt;/p&gt;
&lt;h3&gt;Filter&lt;/h3&gt;
&lt;p&gt;The filter is responsible for eating the &lt;a href="http://apiwiki.twitter.com/Streaming-API-Documentation"&gt;Twitter Stream &lt;span class="caps"&gt;API&lt;/span&gt;&lt;/a&gt; and puting the tweets on a queue (RabbitMQ in my case) using &lt;span class="caps"&gt;AMQP&lt;/span&gt;:&lt;/p&gt;
&lt;script src="http://gist.github.com/264450.js?file=gistfile1.rb"&gt;&lt;/script&gt;&lt;p&gt;Pretty easy right? Notice I am using a fanout exchange, which will allow me to broadcast the same message to all queues (clients) latter on.&lt;/p&gt;
&lt;h3&gt;Server&lt;/h3&gt;
&lt;p&gt;Now we just need to build a server that accepts websocket connections, and for each client deliver each message that arrives on the fanout exchange. The code will make this clear:&lt;/p&gt;
&lt;script src="http://gist.github.com/264453.js?file=gistfile1.rb"&gt;&lt;/script&gt;&lt;p&gt;So simple, yet so awesome!&lt;/p&gt;
&lt;h3&gt;Client&lt;/h3&gt;
&lt;p&gt;The client just have to connect the websocket, and for each &lt;span class="caps"&gt;JSON&lt;/span&gt; piece that arrives on the socket, present them on the screen:&lt;/p&gt;
&lt;script src="http://gist.github.com/264454.js?file=gistfile1.js"&gt;&lt;/script&gt;&lt;p&gt;It seems we&amp;#8217;ve ended writing almost more JS than Ruby :P Note that I&amp;#8217;ve only tested this on Webkit nightly and latest Google Chrome beta for Mac.&lt;/p&gt;
&lt;p&gt;Overall it was a great and easy experience building this simple system, but it allowed me to realize how simple we can build scalable push systems with the WebSocket &lt;span class="caps"&gt;API&lt;/span&gt;!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;update&lt;/strong&gt;: seems like &lt;a href="http://twitter.com/igrigorik/status/7107086085"&gt;Ilya Grigorik liked it&lt;/a&gt; :)&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/LXUk7EMqB0Sd3oI3UZ4fFeOsrpg/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LXUk7EMqB0Sd3oI3UZ4fFeOsrpg/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/LXUk7EMqB0Sd3oI3UZ4fFeOsrpg/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/LXUk7EMqB0Sd3oI3UZ4fFeOsrpg/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheresNoPlaceLike1/~4/Yp-j5xRdQlY" height="1" width="1"/&gt;</description>
      <pubDate>Mon, 28 Dec 2009 10:18:00 -0800</pubDate>
      <link>http://feedproxy.google.com/~r/TheresNoPlaceLike1/~3/Yp-j5xRdQlY/twitter-amqp-websocket-example-no-polling</link>
      <guid isPermaLink="false">http://blog.0x82.com/2009/12/28/twitter-amqp-websocket-example-no-polling</guid>
    <feedburner:origLink>http://blog.0x82.com/2009/12/28/twitter-amqp-websocket-example-no-polling</feedburner:origLink></item>
    <item>
      <title>Cheap calls to any Portuguese mobile network</title>
      <category>mobile voip</category>
      <description>&lt;p&gt;Are you tired of calling your friends and family at prices from the last century? Do you feel frustrated every time you have to top-up the credit of your mobile phone, just because you are obliged to? Do you hate the obvious portuguese &lt;em&gt;cartel&lt;/em&gt; around mobile operators?&lt;/p&gt;
&lt;p&gt;Well, fell no more! Enter the VoIP world!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.betamax.com"&gt;Betamax&lt;/a&gt; created &lt;a href="http://backsla.sh/betamax"&gt;lots of&lt;/a&gt; providers specialized in VoIP. Although almost all of them offer free calls to Portuguese landline numbers, I never realized how competitive they were on the mobile side.&lt;/p&gt;
&lt;p&gt;So I dig a little, and found some pretty competitive Betamax VoIP providers:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;12voip.com &amp;#8211; 4.5 cent/min&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;voipraider.com &amp;#8211; 5.0 cent/min&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;webcalldirect.com &amp;#8211; 6.0 cent/min&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The best thing about these providers is&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;No required monthly payment&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;You can use your own phone number as Caller ID (so people still answer your calls).&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;They all support the &lt;span class="caps"&gt;SIP&lt;/span&gt; protocol (great for non-windows users like me)&lt;/li&gt;
&lt;/ul&gt;
&lt;ul&gt;
	&lt;li&gt;Same price for all the mobile operators (so you can jump the wall garden)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I hope that this information helps you lowering your phone bill. Spread the word, and maybe your mobile operator starts lowering the prices too!&lt;/p&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/7l8XpB68MWKRKj4YqbUontcTQvs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7l8XpB68MWKRKj4YqbUontcTQvs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/7l8XpB68MWKRKj4YqbUontcTQvs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/7l8XpB68MWKRKj4YqbUontcTQvs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TheresNoPlaceLike1/~4/nmkNEWWxcLg" height="1" width="1"/&gt;</description>
      <pubDate>Fri, 17 Jul 2009 13:18:00 -0700</pubDate>
      <link>http://feedproxy.google.com/~r/TheresNoPlaceLike1/~3/nmkNEWWxcLg/cheap-calls-to-any-portuguese-mobile-network</link>
      <guid isPermaLink="false">http://blog.0x82.com/2009/7/17/cheap-calls-to-any-portuguese-mobile-network</guid>
    <feedburner:origLink>http://blog.0x82.com/2009/7/17/cheap-calls-to-any-portuguese-mobile-network</feedburner:origLink></item>
  </channel>
</rss>
