<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>Emmanuel.Pozo
A mix of randomness, contemplation, music, code and an occasional update on the state of current projects.hello at pozo dot me
Find me
Pikchur
Facebook
Twitter
LinkedIn
Blip.fm
FriendFeed

var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-8408857-5");
pageTracker._trackPageview();
} catch(err) {}
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-8408857-9");
pageTracker._trackPageview();
} catch(err) {}</description><title>ls -a</title><generator>Tumblr (3.0; @emmanuelp)</generator><link>http://emmanuelpozo.com/</link><item><title>Inkage?</title><description>&lt;p&gt;Contemplating a tattoo. Something witty/geeky, but not sure what to get yet. I’ll be adding to this list but so far here are my choices in no particular order. Reply with any helpful suggestions :)&lt;/p&gt;
&lt;p&gt;1. Hello World&lt;/p&gt;
&lt;p&gt;2. Mushroom or turtle from super mario bros.&lt;/p&gt;
&lt;p&gt;3. &lt;img src=”tattoo.jpg” /&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/483462635</link><guid>http://emmanuelpozo.com/post/483462635</guid><pubDate>Tue, 30 Mar 2010 00:57:04 -0400</pubDate></item><item><title>Stuff I want</title><description>&lt;p&gt;&lt;a title="Fireball Island" target="_blank" href="http://www.fireballisland.com/"&gt;Fireball Island&lt;/a&gt; (Purchasing on Ebay as I’m posting this)&lt;/p&gt;
&lt;p&gt;&lt;a title="Fireball Island" target="_blank" href="http://www.fireballisland.com/"&gt;&lt;img src="http://i46.tinypic.com/20iat7b.jpg" alt="Fireball Island" width="500" height="483"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Forbidden Bridge" target="_blank" href="-%20http://www.boardgamegeek.com/boardgame/3945/forbidden-bridge."&gt;Forbidden Bridge&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Forbidden Bridge" target="_blank" href="http://www.boardgamegeek.com/boardgame/3945/forbidden-bridge."&gt;&lt;img src="http://i48.tinypic.com/2rh1fso.jpg" alt="Forbidden Bridge" width="500" height="374"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="this puzzle" target="_blank" href="-%20http://www.thingsofcolour.com/HTML/prod_puzzle.html"&gt;This puzzle&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="This Puzzle" target="_blank" href="http://www.thingsofcolour.com/HTML/prod_puzzle.html"&gt;&lt;img src="http://i45.tinypic.com/2lves8x.jpg" alt="Puzzle" width="480" height="380"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="table" target="_blank" href="http://www.apartmenttherapy.com/dc/look/xylophone-table-106099"&gt;This table&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="This Table" target="_blank" href="http://www.apartmenttherapy.com/dc/look/xylophone-table-106099"&gt;&lt;img src="http://i46.tinypic.com/k9ja7n.jpg" alt="Table" width="444" height="235"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Converted Barn" target="_blank" href="http://www.apartmenttherapy.com/sf/house-tours/105-yearold-converted-barn-on-bainbridge-island-house-tour-107850"&gt;This converted barn&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Barn" target="_blank" href="http://www.apartmenttherapy.com/sf/house-tours/105-yearold-converted-barn-on-bainbridge-island-house-tour-107850"&gt;&lt;img src="http://i46.tinypic.com/e63chv.jpg" alt="Converted Barn" width="500" height="345"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Glider" target="_blank" href="http://www.curiosityshoppeonline.com/bawogl.html"&gt;This Glider&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Glider" target="_blank" href="http://www.curiosityshoppeonline.com/bawogl.html"&gt;&lt;img src="http://i47.tinypic.com/dewxht.jpg" alt="Glider" width="500" height="504"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Mad Balls" target="_blank" href="http://www.madballs.com/shop.action"&gt;Any of these madballs&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a title="Mad Balls" target="_blank" href="http://www.madballs.com/shop.action"&gt;&lt;img src="http://i48.tinypic.com/s6qb95.jpg" alt="Mad Balls" width="500" height="320"/&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/372960988</link><guid>http://emmanuelpozo.com/post/372960988</guid><pubDate>Fri, 05 Feb 2010 17:42:00 -0500</pubDate><category>stuff</category></item><item><title>New hotness</title><description>&lt;p&gt;&lt;img align="top" src="http://img.skitch.com/20100202-ebeijqnrs5d1dcfsikdafjat5c.jpg" alt="SquarePik" width="352" height="104"/&gt;&lt;/p&gt;
&lt;p&gt;Hey guys,&lt;/p&gt;
&lt;p&gt;Just wanted to inform you of a new project I’ve been working on with &lt;a title="davidedicillo twitter" target="_blank" href="http://twitter.com/davidedicillo"&gt;@Davidedicillo&lt;/a&gt; and &lt;a title="Peter's twitter" target="_blank" href="http://twitter.com/orical"&gt;@orical&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As you may or may not know, location based services are the hotness right now. &lt;a title="Foursquare" target="_blank" href="http://foursquare.com"&gt;Foursquare&lt;/a&gt; is one of them, and it’s gaining traction reminiscent of Twitter circa 2007. The idea is that you go around and check-in to different venues with an application that resides on your phone. As you do this, your friends can see what you are up to and choose to join you. The one problem is that check-ins are text based and you can’t drop a photo or video at that location. What if you want to show everyone this great beer you’re drinking as opposed to just describing it.&lt;/p&gt;
&lt;p&gt;We aim to solve that by providing an iPhone application that allows people to check-in with a photo or video, in addition the app will show users all photos and videos dropped at a particular venue. The app is called &lt;a title="SquarePik" target="_blank" href="http://squarepik.com"&gt;SquarePik&lt;/a&gt; it’s built on top of our &lt;a title="Pikchur GeoSocial API" target="_blank" href="http://groups.google.com/group/pikchur-api/web/geosocial-api-documentation"&gt;API&lt;/a&gt; and will be available shortly in the iTunes store for just $1.99&lt;/p&gt;
&lt;p&gt;Let me know what you think. I’ll post some redemption codes here as soon as it drops in the store.&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/369005323</link><guid>http://emmanuelpozo.com/post/369005323</guid><pubDate>Wed, 03 Feb 2010 12:28:00 -0500</pubDate><category>projects</category><category>foursquare</category><category>pikchur</category></item><item><title>Menomena - Wet &amp; Rusting</title><description>&lt;p&gt;
&lt;object height="40" width="600" data="http://listen.grooveshark.com/songWidget.swf" type="application/x-shockwave-flash"&gt;
&lt;param name="data" value="http://listen.grooveshark.com/songWidget.swf"&gt;&lt;param name="wmode" value="window"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="flashvars" value="hostname=cowbell.grooveshark.com&amp;widgetID=19260874&amp;style=metal&amp;p=0"&gt;&lt;param name="src" value="http://listen.grooveshark.com/songWidget.swf"&gt;&lt;/object&gt;
&lt;/p&gt;
&lt;p&gt;Found this tune courtesy of&lt;a title="marie lucas twitter" target="_blank" href="http://twitter.com/marielucas"&gt; Marie Lucas&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Sort of feel like dipping myself in and out of water when I listen to this.&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/358358797</link><guid>http://emmanuelpozo.com/post/358358797</guid><pubDate>Thu, 28 Jan 2010 15:43:00 -0500</pubDate><category>menomena</category></item><item><title>Best cheesy inspirational songs</title><description>&lt;p&gt;Decided to bring in the weekend with some kick ass motivational tunes. I still can’t believe &lt;a title="Ralph Macchio" target="_blank" href="http://www.google.com/search?sourceid=chrome&amp;ie=UTF-8&amp;q=ralph+macchio"&gt;Ralph Macchio&lt;/a&gt; is 50!&lt;/p&gt;
&lt;p&gt;
&lt;object height="480" width="610" data="http://listen.grooveshark.com/widget.swf" type="application/x-shockwave-flash"&gt;
&lt;param name="wmode" value="window"&gt;&lt;param name="allowScriptAccess" value="always"&gt;&lt;param name="flashvars" value="hostname=cowbell.grooveshark.com&amp;widgetID=18821650&amp;style=metal&amp;bbg=FFFFFF&amp;bfg=D6D6D6&amp;bt=7A7A7A&amp;bth=FFFFFF&amp;pbg=7A7A7A&amp;pbgh=D6D6D6&amp;pfg=FFFFFF&amp;pfgh=7A7A7A&amp;si=7A7A7A&amp;lbg=7A7A7A&amp;lbgh=D6D6D6&amp;lfg=FFFFFF&amp;lfgh=7A7A7A&amp;sb=7A7A7A&amp;sbh=D6D6D6&amp;p=0"&gt;&lt;param name="src" value="http://listen.grooveshark.com/widget.swf"&gt;&lt;/object&gt;
&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/323937243</link><guid>http://emmanuelpozo.com/post/323937243</guid><pubDate>Fri, 08 Jan 2010 17:25:20 -0500</pubDate><category>karate kid</category><category>rocky</category><category>joe esposito</category><category>survivor</category><category>cheesy songs</category></item><item><title>Had this song in my head all day.</title><description>&lt;p&gt;By far amongst the best lyrics in history.&lt;/p&gt;
&lt;p&gt;
&lt;object height="505" width="610" data="http://www.youtube.com/v/h-S90Uch2as&amp;hl=en_US&amp;fs=1&amp;" type="application/x-shockwave-flash"&gt;
&lt;param name="allowFullScreen" value="true"&gt;&lt;param name="allowscriptaccess" value="always"&gt;&lt;param name="src" value="http://www.youtube.com/v/h-S90Uch2as&amp;hl=en_US&amp;fs=1&amp;"&gt;&lt;param name="allowfullscreen" value="true"&gt;&lt;/object&gt;
&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/320378506</link><guid>http://emmanuelpozo.com/post/320378506</guid><pubDate>Wed, 06 Jan 2010 17:18:00 -0500</pubDate><category>Simon and Garfunkel</category><category>Epic Afros</category></item><item><title>Cassandra Messaging Tutorial - Part 1</title><description>&lt;p&gt;I am currently working on developing the basic architectural components for a project me and my buddies are putting together. Since forming relationships via  communication is going to be our core business, the internal messaging system needs to be built on something solid that can scale out horizontally without the need for replication. Enough about that, the goal is to show how how to build out a simple internal messaging system using &lt;a title="Cassandra" target="_blank" href="http://wiki.apache.org/cassandra"&gt;Cassandra&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Before anyone goes on a rant about the fact that I am thinking scale here, I want to make one thing clear. &lt;b&gt;Yes, it is way to early to think about ways to scale a service before even testing out the waters. I am fully aware of this fact, and I am in no way endorsing you to think that your service will eventually scale before even putting a minimum viable product out there&lt;/b&gt;. In fact, research has shown that it probably will never scale beyond a couple hundred thousand http requests a day and about the same amount of read/write storage transactions.&lt;/p&gt;
&lt;p&gt;This is more of a learning experience for me and also an excuse to start getting in to some more in depth hacking on distributed data storage systems using Cassandra as a means to achieve this.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Loose Pre-requisite&lt;/b&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You are using Rails for your front facing presentation layer. (Or are familiar with it)&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;b&gt;Strict Pre-requisite&lt;/b&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;You have read &lt;a title="Evan Weaver - Getting started with cassandra" target="_blank" href="http://blog.evanweaver.com/articles/2009/07/06/up-and-running-with-cassandra/"&gt;this&lt;/a&gt;, and you know how to fire up an instance of Cassandra server running on at least 1 node. The aforementioned post is by far the best quick start guide I’ve found on Cassandra. Props to &lt;a target="_blank" href="http://twitter.com/evan"&gt;Evan Weaver&lt;/a&gt;for writing it.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;b&gt;Mindset&lt;/b&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Remember, unlike RDBMS’s you have to think carefully of modeling the data to suit your application. You can’t just model relationships and add indexes to support queries that will be needed as you progress. Therefore de-normalization is absolutely necessary. Just remember any college level DB course you had and do the exact opposite when it comes to data normalization.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;b&gt;Messaging System Supported Use Cases&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1. &lt;/b&gt;A user should be able to compose a message and send it to another user.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2. &lt;/b&gt;A user&lt;b&gt; &lt;/b&gt;should be able to view incoming messages via an inbox, ordered by most recent.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;3.&lt;/b&gt; A user should be able to view outgoing messages, ordered by most recent first.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;4.&lt;/b&gt; A user should be able to view a detailed message thread including any of it’s replies.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;5.&lt;/b&gt; A user should be able to reply to a message thread.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;* For the time being, a user will not be able to search through messages. Search will be implemented later, probably with &lt;a title="lucene" target="_blank" href="http://lucene.apache.org/java/docs/"&gt;lucene&lt;/a&gt;. Not sure on this yet, but will write about it when I decide to implement.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;* This also doesn’t cover attaching objects such as virtual gifts and images to messages. I Will be covering this in a later post, but it’s pretty straight forward.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1 - Data Model&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;I decided to stick with a simple construct and use a single ColumnFamily. There are many ways to do this, including using a multi column family to structure the data. But I chose to keep it as simple as possible to store and display messages.&lt;/p&gt;
&lt;p&gt;I set up 1 main Keyspace for the project and  2 ColumnFamily’s for the messaging system. The Columnfamilys are ordered with the &lt;code&gt;TimeUUIDType&lt;/code&gt; comparator since we want them ordered by time.&lt;/p&gt;
&lt;p&gt;Contents of&lt;code&gt;storage-conf.xml:&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;Keyspace Name="MainProject"&gt;&lt;/code&gt;&lt;br/&gt;&lt;code&gt;&lt;ColumnFamily CompareWith="TimeUUIDType" Name="Messages"/&gt;&lt;/code&gt;&lt;br/&gt;&lt;code&gt;&lt;ColumnFamily CompareWith="TimeUUIDType" Name="MessageReplies"/&gt;&lt;/code&gt;&lt;br/&gt;&lt;code&gt;&lt;/Keyspace&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;Messages -&lt;/code&gt; This will hold user ids as keys and associate a unique sortable column name with a JSON hash containing the message details.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;MessageReplies -&lt;/code&gt; Messages ids as keys with an associative unique sortable column name containing a JSON hash that will hold reply details.&lt;/p&gt;
&lt;p&gt;This modeling will easily allow us to list Messages for a given user as well as details and replies to a given message, if any are present.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2 - Usage and examples&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To illustrate usage, I’ll fire up a ruby interactive prompt, and populate/retrieve data. (just type ‘irb’ in your terminal to get a shell going)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;require 'rubygems'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;require 'cassandra'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;include Cassandra:Constants&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;require 'rubygems'&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Instantiate a Cassandra client object:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;messages = Cassandra.new('MainProject')&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;A few insertions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Let’s assume Jennifer, user id 1200 is sending Emmanuel, user id 1120 a message. What we do, is insert the message once postfixing ‘_in’ to Emmanuel’s user id, and then once more postfixing ‘_out’ to Jennifer’s user id. These two will be our keys. (Remember that a user can view both an inbox and outbox of messages and there is no notion of easily querying over values, therefore redundancy in this case is good). Notice that we are doing two successive insertions so some level of transaction control is needed when this is put in to production code.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;uuid = UUID.new&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;messages.insert(:Messages, '1120_in', {uuid=&gt;'{"username":"Jennifer", "age":"24", "location":"Aventura Florida", "subject":"Hey there","body":"Cool profile. Drinks sometime?", "read":"0"}'})&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;messages.insert(:Messages, '1200_out', {uuid=&gt;'{"username":"Emmanuel", "age":"26", "location":"Miami Florida", "subject":"Hey there", "body":"Cool profile. Drinks sometime?", "read":"0"}'})&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Let’s insert another message to the same user, but this time from Natalie:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;uuid = UUID.new&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;messages.insert(:Messages, '1120_in', {uuid=&gt;'{"username":"Natalie", "age":"25", "location":"San Francisco CA", "subject":"Do you like Ninjas?", "body":"It might be a dumb question. Just wanted to know if you did :-)","read":"0"}'})&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;messages.insert(:Messages, '1320_out', {uuid=&gt;'{"username":"Emmanuel", "age":"26", "location":"Miami FL", "subject":"Do you like Ninjas?", "body":"It might be a dumb question. Just wanted to know if you did :-)", "read":"0"}'})&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;So far we took care of use case #1. Next, let’s assume Emmanuel replied to Natalie’s message:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;messages.insert(:MessageReplies, uuid, {UUID.new=&gt;'{"username":"Emmanuel", "age":"26", "location":"Miami FL", "body":"I love Ninjas! OK we can officially go grab a drink now!"}'})&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This takes care of use case #5. Next we’ll move on to cover the last 3 use cases via some basic retrieval operations.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;And now for retrieval&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Now I can easily retrieve all messages for a given user based on user id’s and a postfix of ‘_in’ or ‘out’. After that I can iterate over them and display messages however I want. This takes care of use cases #2, and #3.&lt;/p&gt;
&lt;p&gt;For Emmanuel’s &lt;b&gt;Inbox:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;collection = messages.get(:Messages, '1120_in', :reversed=&gt;'true').to_a&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;For Emmanuel’s &lt;b&gt;Outbox:&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;collection = messages.get(:Messages, '1120_out', :reversed=&gt;'true').to_a&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Onto covering use case #4, let’s say you listed out a user’s messages on a page and upon clicking on an entry you want to display message details and replies, a sort of permalink for a message.&lt;/p&gt;
&lt;p&gt;All we need now is the messages UUID, we can get this by calling to_guid, which will generate a readable representation of a Cassandra UUID.&lt;/p&gt;
&lt;p&gt;For simplicity, let’s access Emmanuel’s first result, and get it’s message guid:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;guid = collection[0].first.to_guid&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Now you can use the guid to retrieve message details and any replies associated with it. We can make use of the only supported range query Cassandra has (Return a range of ids and limit the result set)&lt;/p&gt;
&lt;p&gt;&lt;code&gt;msg_details = messages.get(:Messages, '1120_in', :start=&gt;UUID.new(guid), :count=&gt;'1', :reversed=&gt;'true').to_a&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Last step is to retrieve all replies for this message, and to illustrate limiting  the result set lets return 20 latest replies.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;guid = msg_details.to_a.first[0].to_guid&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;replies = messages.get(:MessageReplies, guid, :count =&gt;'20', :reversed=&gt;'true').to_a&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That’s pretty much it. I’ll respond to the comment thread if anything needs clarification.&lt;/p&gt;
&lt;p&gt;Next post will be about adding attachments to the message structure, which is going to be fairly easy, given that the meat of the module is done.&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/317479418</link><guid>http://emmanuelpozo.com/post/317479418</guid><pubDate>Mon, 04 Jan 2010 23:27:00 -0500</pubDate><category>cassandra</category><category>microdate.me</category><category>messaging system</category><category>distributed data store</category></item><item><title>Really re-thinking certain key things in my life for 2010....</title><description>&lt;embed type="application/x-shockwave-flash" src="http://emmanuelpozo.com/swf/audio_player.swf?audio_file=http://www.tumblr.com/audio_file/316514676/tumblr_kvqe9u5yAQ1qa0uhv&amp;color=FFFFFF" height="27" width="207" quality="best"&gt;&lt;/embed&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Really re-thinking certain key things in my life for 2010. Embracing change.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Bear&lt;/i&gt; - &lt;a title="The Antlers" target="_self" href="http://www.google.com/search?hl=en&amp;q=the+antlers+&amp;aq=f&amp;oq=&amp;aqi=g10"&gt;The Antlers&lt;/a&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/316514676</link><guid>http://emmanuelpozo.com/post/316514676</guid><pubDate>Mon, 04 Jan 2010 11:39:00 -0500</pubDate><category>Bear</category><category>Monday</category><category>The Antlers</category></item><item><title>This song is pure bliss, with an overtone of despair.
Wildcat -...</title><description>&lt;embed type="application/x-shockwave-flash" src="http://emmanuelpozo.com/swf/audio_player.swf?audio_file=http://www.tumblr.com/audio_file/310238769/tumblr_kvjcuj4iCf1qa0uhv&amp;color=FFFFFF" height="27" width="207" quality="best"&gt;&lt;/embed&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This song is pure bliss, with an overtone of despair.&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Wildcat&lt;/i&gt; - &lt;a title="Ratatat" target="_blank" href="http://www.google.com/search?hl=en&amp;q=ratatat"&gt;Ratatat&lt;/a&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/310238769</link><guid>http://emmanuelpozo.com/post/310238769</guid><pubDate>Thu, 31 Dec 2009 16:25:52 -0500</pubDate><category>ratatat</category><category>Wildcat</category></item><item><title>Listening to some new additions to my collection courtesy of...</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_kv9x68uEnW1qa0uhvo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Listening to some new additions to my collection courtesy of &lt;a title="Marie Twitter" target="_blank" href="http://twitter.com/marielucas"&gt;Marie&lt;/a&gt;. My favorite holiday gift thus far.&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/301567019</link><guid>http://emmanuelpozo.com/post/301567019</guid><pubDate>Sat, 26 Dec 2009 14:08:00 -0500</pubDate></item><item><title>Spam</title><description>Me: I just got an email: "Your zoosk matches are waiting", we need to start spamming people! This stuff works.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Peter: Spam people... Check. You can't spell success without spam.&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Me: gem install mail_spammer&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Peter: Error : Dependency Check... "It seems you have morals, this gem requires you to run 'gem remove morals' before you continue."&lt;br /&gt;&#13;
&lt;br /&gt;&#13;
Me: Weird.. I don't get that error.</description><link>http://emmanuelpozo.com/post/289331293</link><guid>http://emmanuelpozo.com/post/289331293</guid><pubDate>Fri, 18 Dec 2009 16:18:00 -0500</pubDate></item><item><title>Scaling on up [part 1]</title><description>&lt;p&gt;For a recent ongoing project, I realized that I had to begin offloading a sub-system from mySQL to a key/value store for efficient retrieval. We all know that mySQL heavily depends on power to read as opposed to write. Therefore, when dealing with joins, and sometimes IN’s on non trivial queries, it can become fairly expensive. Not to mention my budget is finite, so I can’t (and wouldn’t, even if I could) just throw metal at the DB.&lt;/p&gt;
&lt;p&gt;The sub-system in question is a user’s activity stream. A user has friend’s those friends perform activities such as post photos, comments, be-friend other people etc. Naturally to display all this data from mySQL, lots of joins are required from various tables Users,Friends,Photos,Comments. An alternate solution is to employ a mySQL strategy which keeps track of redundant fields in a separate table that is populated asynchronously. With this method, all data can be pulled in a simple SELECT, again this is nothing more than just a patch, and not really a viable long term solution for scaling.&lt;/p&gt;
&lt;p&gt;The real way to alleviate this, is to replace the way activities are displayed, and persisted with an alternate key/value store that is quick to serve data from even when sometimes retrieving non-cached content. In addition, it has to be an augmented key/value store, so that it somewhat facilitates basic relationships.&lt;/p&gt;
&lt;p&gt;So now which one do I choose? There are a couple of factors that lead to my decision:&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1.&lt;/b&gt; Something with very low latency on reads.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2.&lt;/b&gt; Something that plays nice with THRIFT or HTTP.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;3.&lt;/b&gt; A system that is truly distributed and fault tolerant.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;4.&lt;/b&gt; Eventually consistent system, since availability is more important than inconsistent reads.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;5.&lt;/b&gt; Decent developer community contributing to the project.&lt;/p&gt;
&lt;p&gt;After looking at a couple of options, I narrowed it down to two; &lt;a title="Cassandra" target="_blank" href="http://wiki.apache.org/cassandra/"&gt;Cassandra&lt;/a&gt;, or &lt;a title="riak" target="_blank" href="http://riak.basho.com/"&gt;Riak&lt;/a&gt;. Both great distributed systems, one system battle tested (Cassandra), the other not so much, but both very much still experimental. I am familiar with Cassandra from a previous endeavor, so I know what it can do. It is also proven to handle well in production (Facebook,Twitter,Digg), so it’s a solid contender, but I’m not going to go with it until I experiment with Riak a bit more. Right off the bat, I was impressed by some of RIAK’s core features, such as virtual node replication and linking between documents, just to mention the attractive ones. The only drawback so far is the lack of documentation and community, since it is so new.&lt;/p&gt;
&lt;p&gt;I will have to make a decision soon, and when I do, a post will follow with some more technical details about the move and which system I eventually chose. Until then I’ll be hacking away at Riak to see if it’s a viable option for putting something like this in production, if not then good ol’ Cassandra it is :-)&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/233230340</link><guid>http://emmanuelpozo.com/post/233230340</guid><pubDate>Wed, 04 Nov 2009 17:05:00 -0500</pubDate><category>cassandra</category><category>riak</category><category>distributed</category><category>scaling</category></item><item><title>A new addition to the family. My 1972 Raleigh Super Course with...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_ks8bsh1jC31qa0uhvo1_500.jpg"/&gt;&lt;br/&gt; View #1&lt;br/&gt;&lt;br/&gt; &lt;img src="http://27.media.tumblr.com/tumblr_ks8bsh1jC31qa0uhvo2_500.jpg"/&gt;&lt;br/&gt; View #2&lt;br/&gt;&lt;br/&gt; &lt;img src="http://24.media.tumblr.com/tumblr_ks8bsh1jC31qa0uhvo3_500.jpg"/&gt;&lt;br/&gt; Rear Tire View&lt;br/&gt;&lt;br/&gt; &lt;img src="http://29.media.tumblr.com/tumblr_ks8bsh1jC31qa0uhvo4_500.jpg"/&gt;&lt;br/&gt; Front Tire View&lt;br/&gt;&lt;br/&gt; &lt;img src="http://25.media.tumblr.com/tumblr_ks8bsh1jC31qa0uhvo5_500.jpg"/&gt;&lt;br/&gt; Brooks Saddle&lt;br/&gt;&lt;br/&gt; &lt;p&gt;A new addition to the family. My 1972 Raleigh Super Course with a fresh coat of old English racing green. Wondering what I should name it..&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/225950573</link><guid>http://emmanuelpozo.com/post/225950573</guid><pubDate>Wed, 28 Oct 2009 10:48:00 -0400</pubDate><category>Bikes</category><category>fixies</category><category>fixed gear</category><category>english racing green</category><category>1972</category><category>raleigh super course</category></item><item><title>The Bucket List</title><description>&lt;p&gt;Here is a list of the 10 things I’d like to do in my lifetime, in no particular order.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1. Write a book&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;I have no idea what I would write about, but it would definitely be gratifying.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;&lt;b&gt;2. Write a horror movie screen play&lt;/b&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;As some of you may know, I have a passion for all things gore and horror, I have tons of sick ideas that could really be put to good use. &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;3. Be involved in a music project&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Wether directly or indirectly I want to be involved in a music based project. I have no musical talent whatsoever but that doesn’t stop modern day artists does it!?&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;4. Sky dive&lt;br/&gt;&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Because I wanna come as close to flying without attempting a base jump.&lt;br/&gt;&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;5. Travel the world for at least a year&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;Live and experience everything through different perspectives is the goal here. &lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;6. Live in San Francisco, NYC, or Paris&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;These are my 3 favorite cities, all for different reasons, I don’t know if one stands above the rest as of now.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;7. Open a restaurant or small bookstore&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;The minute I have a sizable amount of disposable income this is what it would go in to. I have always wanted to do this at some point in my life.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;8. Get invited to TED&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;By far some of the brightest minds in science, business, social issues, technology and more. This is one conference I would love to attend just for the sake of absorbing.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;9. Finish my PHD&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;I am currently on leave from my PHD, I left because I wasn’t ready to dedicate myself to a life of research and academia. I do however want to revisit my studies because I know I have so much more to contribute and learn.&lt;/i&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;10. Be more of a humanitarian&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;i&gt;I definitely lack in this department, and would like to make up for it down the line.&lt;/i&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/211647163</link><guid>http://emmanuelpozo.com/post/211647163</guid><pubDate>Mon, 12 Oct 2009 23:42:00 -0400</pubDate></item><item><title>CakePHP Error Handling</title><description>&lt;p&gt;So a couple of people asked me about the correct way of handling errors in CakePHP, and defining custom error pages for websites, so I decided to not explain this any more and just hand out a url to this post.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Using standard error messages&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;For common errors such as 404, Controller not found etc, you could easily use CakePHP’s built in cakeError function. So if you wanted to define a 404 error you would simply call the following from your controller or component:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; $this-&gt;cakeError('error404');&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Ok, this is all good, but what if we want more control over error handling, what if we want to define our own error handlers.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Creating custom error messages&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;1. &lt;/b&gt;Extend the default error handler by creating a file: &lt;code&gt;app/app_error.php &lt;/code&gt;with the following definition:&lt;/p&gt;
&lt;p&gt;&lt;code&gt; &lt;?php&lt;br/&gt; class AppError extends ErrorHandler {&lt;br/&gt; }?&gt;&lt;br/&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;2.&lt;/b&gt; Now that you have this class all you have to do is define custom error handling functions. Include as many custom errors in this class. So lets take a situation where a user is not found in the database when people try to access domain.com/username from your site root.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;function userNotFound($params) {&lt;br/&gt; $this-&gt;controller-&gt;set('file', $params['username']);&lt;br/&gt; $this-&gt;_outputMessage('user_not_found');&lt;br/&gt;}&lt;br/&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$this-&gt;_outputMessage(&lt;view-filename&gt;)&lt;/code&gt; will just display the view found in &lt;code&gt;views/errors/&lt;view-filename&gt;.ctp&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;3.&lt;/b&gt; Next create the views and override the default layout.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;app/views/user_not_found.ctp&lt;br/&gt;&lt;h2&gt;User not found&lt;/h2&gt;&lt;br/&gt;&lt;p&gt;Sorry, but we couldn't find &lt;?php echo $username ?&gt; &lt;br/&gt;in the system.&lt;/p&gt;&lt;br/&gt;&lt;br/&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;If you want to customize the layout for your errors, simply create &lt;code&gt;app/views/layouts/default.ctp&lt;/code&gt; and include any custom css you want. Don’t forget to include the standard  &lt;code&gt;$content_for_layout&lt;/code&gt; and &lt;code&gt;$title_for_layout &lt;/code&gt; variables in your layout.&lt;/p&gt;
&lt;p&gt;&lt;b&gt;4.&lt;/b&gt; Call your custom functions from your controllers or components:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;$this-&gt;cakeError('userNotFound', array('username'=&gt;$username));&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That’s pretty much it, you can now handle errors easily and elegantly :-)&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/199752116</link><guid>http://emmanuelpozo.com/post/199752116</guid><pubDate>Mon, 28 Sep 2009 23:14:00 -0400</pubDate><category>php</category><category>cakePHP</category><category>cake php error handling</category></item><item><title>This always reminds me of sitting in a car, outside of certain a bowling alley in 2006.</title><description>&lt;p&gt;&lt;object height="385" width="480" data="http://www.youtube.com/v/-7mZkt4bP5I&amp;hl=en&amp;fs=1&amp;" type="application/x-shockwave-flash"&gt;
&lt;param value="true" name="allowFullScreen"&gt;&lt;param value="always" name="allowscriptaccess"&gt;&lt;param value="http://www.youtube.com/v/-7mZkt4bP5I&amp;hl=en&amp;fs=1&amp;" name="src"&gt;&lt;param value="true" name="allowfullscreen"&gt;&lt;/object&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/196362835</link><guid>http://emmanuelpozo.com/post/196362835</guid><pubDate>Fri, 25 Sep 2009 00:38:30 -0400</pubDate><category>rise against</category><category>swing life away</category><category>nostalgia</category></item><item><title>One rough pigeon.</title><description>&lt;img src="http://29.media.tumblr.com/tumblr_kqhuybUG5L1qa0uhvo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;One rough pigeon.&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/196062301</link><guid>http://emmanuelpozo.com/post/196062301</guid><pubDate>Thu, 24 Sep 2009 17:13:23 -0400</pubDate></item><item><title>Some Cardboard Lovin</title><description>&lt;p&gt;&lt;a href="http://archives.cardboardlove.com" target="_blank"&gt;&lt;img alt="cardboard love" src="http://i37.tinypic.com/28aqrk9.jpg" align="top" width="423" border="0" height="215"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I came across a great find today. Cardboard love, it’s by a buddy of mine &lt;a target="_blank" href="http://bloodtasteslikepennies.tumblr.com/"&gt;Joey Hall&lt;/a&gt; who also happens to be the &lt;a target="_blank" title="http://kingofallfashion.com" href="http://kingofallfashion.com"&gt;king of all fashion&lt;/a&gt;, just in case you need any glamor advice.&lt;/p&gt;
&lt;p&gt;So hit up &lt;a target="_blank" href="http://archives.cardboardlove.com"&gt;Cardboard Love&lt;/a&gt; and let me know what you think.&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/193446153</link><guid>http://emmanuelpozo.com/post/193446153</guid><pubDate>Mon, 21 Sep 2009 12:35:00 -0400</pubDate><category>cardboard</category><category>brilliant</category></item><item><title>Great fashion resource IMO</title><description>&lt;a href="http://nerdboyfriend.com/"&gt;Great fashion resource IMO&lt;/a&gt;: &lt;p&gt;&lt;a target="_blank" title="nerd boyfriend" href="http://nerdboyfriend.com/"&gt;&lt;img src="http://nerdboyfriend.com/wp-content/uploads/2009/09/robertcrumb31.jpg" align="middle" width="480" height="500"/&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/191082977</link><guid>http://emmanuelpozo.com/post/191082977</guid><pubDate>Fri, 18 Sep 2009 12:34:00 -0400</pubDate><category>nerd boyfriend</category><category>fashion</category><category>pimpage</category></item><item><title>Abnormality at it’s finest. Via Pikchur user...</title><description>&lt;img src="http://27.media.tumblr.com/tumblr_kq4rhwg7QN1qa0uhvo1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Abnormality at it’s finest. Via Pikchur user &lt;a target="_blank" title="dashingclaire" href="http://pikchur.com/people/dashingclaire"&gt;@dashingclaire&lt;/a&gt;&lt;/p&gt;</description><link>http://emmanuelpozo.com/post/190390300</link><guid>http://emmanuelpozo.com/post/190390300</guid><pubDate>Thu, 17 Sep 2009 15:29:00 -0400</pubDate></item></channel></rss>
