<?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:posterous="http://posterous.com/help/rss/1.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
  <channel>
    <title>Jiaaro (on life, the universe, and everything)</title>
    <link>http://jiaaro.com</link>
    <description>Topic: hacking stuff - by James Robert</description>
    <generator>posterous.com</generator>
    <link xmlns="http://www.w3.org/2005/Atom" href="http://posterous.com/api/sup_update#cc8accb3e" type="application/json" rel="http://api.friendfeed.com/2008/03#sup" />
    
    
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/Jiaaro" /><feedburner:info xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" uri="jiaaro" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://posterous.superfeedr.com/" /><item>
      <pubDate>Mon, 07 Nov 2011 09:39:00 -0800</pubDate>
      <title>Why do we still hate Microsoft but love Apple?</title>
      <link>http://jiaaro.com/why-do-we-still-hate-microsoft-but-love-apple</link>
      <guid>http://jiaaro.com/why-do-we-still-hate-microsoft-but-love-apple</guid>
      <description>
        <![CDATA[<p>
	<p>Apple has grown larger than Microsoft. This is old news. Steve Jobs (RIP) never became a philanthropist like Bill Gates. So why do the technorati hold Jobs in such high regard will still harboring resentment for Gates?</p>
<p>I think the differentiation is in the context under which we use their products.</p>
<p>I find myself with other options in every arena in which I use Apple's products. I <strong>choose</strong> to use them because I want to.</p>
<p>Let's compare this with Microsoft. I often find myself using Microsoft products because I have no other choices.</p>
<p>I use Excel because Google docs wasn't able to open a complex spreadsheet created with Excel.</p>
<p>I use Word because Open Office couldn't display the track changes recorded in Word.</p>
<p>I use Windows to test my websites in Internet Explorer because IE isn't available anywhere else.</p>
<p>The one <strong>notable exception</strong> is Xbox; I love my Xbox. I chose it over playstation.</p>
<p>I wasn't strong-armed into using Xbox through anti-competitive practices, it's a good product that I <em>wanted</em> to use.</p>
<p>I don't think profit, or good vs. evil has anything to do with it. We simply like companies when we&nbsp;<strong>choose</strong> to use their products -- over and over -- because they're better.</p>
	
</p>

<p><a href="http://jiaaro.com/why-do-we-still-hate-microsoft-but-love-apple">Permalink</a> 

	| <a href="http://jiaaro.com/why-do-we-still-hate-microsoft-but-love-apple#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Thu, 11 Aug 2011 16:41:00 -0700</pubDate>
      <title>960gs Reference</title>
      <link>http://jiaaro.com/960gs-reference</link>
      <guid>http://jiaaro.com/960gs-reference</guid>
      <description>
        <![CDATA[<p>
	<p>I am sick of the <a href="http://960.gs">960.gs webpage</a>&nbsp;I have shit to get done and I don't want to be sold on 960 -- just remind me what the damn css classes are.</p>
<p>Here is my own personal 960.gs documentation :)</p>
<p><strong>note</strong>: In the list below XX is used to denote a number of columns</p>
<p>Quick reference:</p>
<ul>
<li>container_XX</li>
<li>grid_XX</li>
<li>prefix_XX</li>
<li>suffix_XX</li>
<li>push_XX</li>
<li>pull_XX</li>
<li>alpha</li>
<li>omega</li>
<li>clear</li>
</ul>
<p><strong><span style="font-size: large;">container_XX</span></strong></p>
<p>All elements in the page should be inside one of these -- it tells the grid system how many columns your layout should be.</p>
<p><strong><span style="font-size: large;">grid_XX</span></strong></p>
<p>Makes the element XX columns wide</p>
<p><span style="font-size: large;"><strong>prefix_XX</strong></span></p>
<p>Shift the element XX columns to the right (take up XX more columns on the left)</p>
<p><strong><span style="font-size: large;">suffix_XX</span></strong></p>
<p>Push the next element XX columns to the right (take up XX more columns on the right)</p>
<p><strong><span style="font-size: large;">push_XX</span></strong></p>
<p>Shift this element XX columns to the <strong>right</strong> without affecting any other elements</p>
<p><strong><span style="font-size: large;">pull_XX</span></strong></p>
<p>Shift this element XX columns to the <strong>left</strong> without affecting any other elements</p>
<p><strong><span style="font-size: large;">alpha / omega</span></strong></p>
<p>When using grid_XX inside another grid_XX element. use <strong>alpha and omega</strong> on the <strong>first and last element</strong> respectively to avoid doubling the gutter padding.</p>
<p><strong><span style="font-size: large;">clear</span></strong></p>
<p>clears floated elements in a way that doesn't suck</p>
	
</p>

<p><a href="http://jiaaro.com/960gs-reference">Permalink</a> 

	| <a href="http://jiaaro.com/960gs-reference#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sun, 24 Jul 2011 16:47:00 -0700</pubDate>
      <title>Google Plus is good, but don't switch to it</title>
      <link>http://jiaaro.com/google-plus-is-good-but-dont-switch-to-it</link>
      <guid>http://jiaaro.com/google-plus-is-good-but-dont-switch-to-it</guid>
      <description>
        <![CDATA[<p>
	<p>I'm going to assume that since you're reading this, you're a technophile and you're already in the Google+ beta. I'm not going to talk about why Google+ is good, or how google finally "got social right", or why I love it more than life itself or any such nonsense. I'm going to talk about facebook.</p>
<p><div class='p_embed p_image_embed'>
<img alt="Google-plus-logotransparent" height="315" src="http://posterous.com/getfile/files.posterous.com/temp-2011-07-24/lpqCfujwcGfodlCjvDooFBfgkfDqDktHBBGbCwqoprfrDiHtJycilqExDIBl/google-plus-logotransparent.png.scaled500.png" width="315" />
</div>
</p>
<p>Please don't misunderstand the title, I think you should try google+ out. If you like it (I do) then great! keep using it to your hearts content.</p>
<p><span style="font-size: large;"><strong>It's still about search</strong></span></p>
<p>I'm pretty sure the primary reason for google+ is the +1 button. All this +1 action is going to give Google's search team a HUGE dataset to mine; no more scraping twitter for "social data". <a href="http://blog.facebook.com/blog.php?post=33443992130">Facebook talked about doing this years ago</a>.</p>
<p>It's good to understand Google's motivation before we pass judgement.&nbsp;</p>
<p>Now about switching: <strong>don't</strong>.</p>
<p>Google is a very powerful company and they've (finally) created a good social network with some profound insights. One that I personally enjoy using more than facebook and twitter. Facebook is also a powerful company, let's not kid ourselves but they are *much* smaller than google.</p>
<p><span style="font-size: large;"><strong>Competition works</strong></span></p>
<p>If everyone switches away from facebook and uses google+ instead, what we will have is facebook again, except owned by google (remember myspace). That isn't great.</p>
<p>Remember when Firefox started getting traction and over time started getting slow and bloated? And then Google released their own web browser, and all of a sudden Firefox was <a href="http://arewefastyet.com/">getting HUGE speed improvements</a>? Right now we have 4 browsers with significant marketshare (sorry opera) all competing to be fast. <strong>That <em>was</em> great</strong>.</p>
<p><div class='p_embed p_image_embed'>
<a href="http://posterous.com/getfile/files.posterous.com/temp-2011-07-24/hkqBztwIJpwyIkyFohbmcguFDFeigffpGmCcIpqbmmgcJJzusaGIehjgllCk/browser_wars.jpg.scaled1000.jpg"><img alt="Browser_wars" height="273" src="http://posterous.com/getfile/files.posterous.com/temp-2011-07-24/hkqBztwIJpwyIkyFohbmcguFDFeigffpGmCcIpqbmmgcJJzusaGIehjgllCk/browser_wars.jpg.scaled500.jpg" width="500" /></a>
</div>
</p>
<p>Well right now facebook has lost focus. They're the biggest by a lot and, frankly, they've got a bad case of slow-and-bloated syndrome (and a case of doing evil as well, but the degree to which they are doing it on purpose has been debated).</p>
<p>I'd like to see facebook have a change of heart on their <a href="http://www.readwriteweb.com/archives/facebooks_zuckerberg_says_the_age_of_privacy_is_ov.php">crazy policies</a>, and I hope Google+ is the catalyst. But it'd be a day when google controls our search, email, phones, photos, AND social graph.</p>
<p>Let's keep the Social Web <strong>competitive</strong>: let's force them not to be evil (and I don't just mean Google).</p>
	
</p>

<p><a href="http://jiaaro.com/google-plus-is-good-but-dont-switch-to-it">Permalink</a> 

	| <a href="http://jiaaro.com/google-plus-is-good-but-dont-switch-to-it#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
      <media:content type="image/jpeg" height="300" width="550" url="http://getfile5.posterous.com/getfile/files.posterous.com/temp-2011-07-24/hkqBztwIJpwyIkyFohbmcguFDFeigffpGmCcIpqbmmgcJJzusaGIehjgllCk/browser_wars.jpg">
        <media:thumbnail height="273" width="500" url="http://getfile6.posterous.com/getfile/files.posterous.com/temp-2011-07-24/hkqBztwIJpwyIkyFohbmcguFDFeigffpGmCcIpqbmmgcJJzusaGIehjgllCk/browser_wars.jpg.scaled500.jpg" />
      </media:content>
      <media:content type="image/png" height="315" width="315" url="http://getfile9.posterous.com/getfile/files.posterous.com/temp-2011-07-24/lpqCfujwcGfodlCjvDooFBfgkfDqDktHBBGbCwqoprfrDiHtJycilqExDIBl/google-plus-logotransparent.png">
        <media:thumbnail height="315" width="315" url="http://getfile2.posterous.com/getfile/files.posterous.com/temp-2011-07-24/lpqCfujwcGfodlCjvDooFBfgkfDqDktHBBGbCwqoprfrDiHtJycilqExDIBl/google-plus-logotransparent.png.scaled500.png" />
      </media:content>
    </item>
    <item>
      <pubDate>Wed, 16 Mar 2011 14:58:00 -0700</pubDate>
      <title>Decoding facebook's base64url signed_request</title>
      <link>http://jiaaro.com/decoding-facebooks-base64url-signedrequest</link>
      <guid>http://jiaaro.com/decoding-facebooks-base64url-signedrequest</guid>
      <description>
        <![CDATA[<p>
	<p>In python:</p>
<p><code>
 import base64

 def signed_request_to_json(s):
 &nbsp;&nbsp;&nbsp;&nbsp;sig, encoded_json = s.split(".",2)
 &nbsp;&nbsp;&nbsp;&nbsp;encoded_json += (len(encoded_json) % 4) * "="
 &nbsp;&nbsp;&nbsp;&nbsp;return {
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'sig': sig,
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'json': base64.b64decode(encoded_json)
 &nbsp;&nbsp;&nbsp;&nbsp;}
</code>&nbsp;</p>
	
</p>

<p><a href="http://jiaaro.com/decoding-facebooks-base64url-signedrequest">Permalink</a> 

	| <a href="http://jiaaro.com/decoding-facebooks-base64url-signedrequest#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 15 Mar 2011 15:41:00 -0700</pubDate>
      <title>SSL Certificates are Miserable</title>
      <link>http://jiaaro.com/ssl-certificates-are-miserable</link>
      <guid>http://jiaaro.com/ssl-certificates-are-miserable</guid>
      <description>
        <![CDATA[<p>
	<p>So... I was tasked with setting up https for a website recently. I was setting up Nginx with an ssl certificate from thawte. <p />Pretty normal. Pretty standard. Pretty aweful.<p />Here's to helping the next guy get through the process quicker than I did.<p /> <strong><span style="font-size: large;">Testing</span></strong></p>
<p />
<div>Before you start. <strong>Don't use a browser or openssl</strong> to test your config. It will waste your time and make you unhappy.&nbsp;</div>
<p />
<div>Use this tool to test your ssl config:<br /> 
<ul>
<li><a href="http://www.digicert.com/help/">http://www.digicert.com/help/</a></li>
</ul>
<p />
<h2>Certificate Signing Requests (*.csr), PEM Files, Intermediary Certificates, root CACertificate, Secondary Certificate BS, and more</h2>
<p>You should know Apache and several other web servers expect your ssl certificate to be in a separate file from the intermediary certificates Like this <a href="http://www.apache-ssl.org/httpd.conf.example">example http.conf</a></p>
<code>
 # your key file (often called www.example.com.key or privatekey.pem)
 SSLCertificateKeyFile /www/certs/ssl.fictional.co.key

# your ssl certificate (often called www.example.com.crt or certificate.pem)
SSLCertificateFile /www/certs/ssl.fictional.co.cert

#intermediary certificates (often a *.crt or *.pem file)
SSLCACertificateFile /www/certs/CA.cert
 </code>
<p>ok great... but some other web servers expect <strong>your intermediary certificates to be concatenated with your ssl certificate</strong> (i.e. the one you paid for). So open up notepad and copy/paste that CA.cert into the end of your ssl.fictional.co.cert and hit save.</p>
<p>&nbsp;</p>
<h2>What about Nginx?</h2>
<p>now your nginx config for ssl (<a href="http://wiki.nginx.org/HttpSslModule">documentation here</a>) will look like this:</p>
<code>
http {
&nbsp;&nbsp;server {
 &nbsp;&nbsp; &nbsp;listen 443;
&nbsp;&nbsp; &nbsp;ssl on;

&nbsp;&nbsp; &nbsp;# this file contains the ssl.fictional.co.cert AND CA.cert from
&nbsp;&nbsp; &nbsp;# the apache example
&nbsp;&nbsp; &nbsp;ssl_certificate /usr/local/nginx/conf/cert.pem;

&nbsp;&nbsp; &nbsp;# this file corresponds to the ssl.fictional.co.key from the apache example
&nbsp;&nbsp; &nbsp;ssl_certificate_key /usr/local/nginx/conf/cert.key;

&nbsp;&nbsp;}
}
</code>
<p>Conclusion. SSL<br /> is a pain in the ass.</p>
</div>
	
</p>

<p><a href="http://jiaaro.com/ssl-certificates-are-miserable">Permalink</a> 

	| <a href="http://jiaaro.com/ssl-certificates-are-miserable#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sat, 12 Feb 2011 14:58:00 -0800</pubDate>
      <title>Making Python Objects that act like Javascript Objects</title>
      <link>http://jiaaro.com/making-python-objects-that-act-like-javascrip</link>
      <guid>http://jiaaro.com/making-python-objects-that-act-like-javascrip</guid>
      <description>
        <![CDATA[<p>
	<p>Been writing a lot of javascript and I thought this was neat:</p>
<p><code>


class JsObject(dict):
&nbsp;&nbsp; &nbsp;def __init__(self, *args, **kwargs):
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;super(JsObject, self).__init__(*args, **kwargs)
&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;self.__dict__ = self&nbsp;


</code></p>
	
</p>

<p><a href="http://jiaaro.com/making-python-objects-that-act-like-javascrip">Permalink</a> 

	| <a href="http://jiaaro.com/making-python-objects-that-act-like-javascrip#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Thu, 03 Feb 2011 10:33:00 -0800</pubDate>
      <title>OS X Devs Fail Usability: Tabbing Hotkeys</title>
      <link>http://jiaaro.com/os-x-devs-fail-usability-tabbing-hotkeys</link>
      <guid>http://jiaaro.com/os-x-devs-fail-usability-tabbing-hotkeys</guid>
      <description>
        <![CDATA[<p>
	<p>This is going to be short; I just want to point out how bad a user <br />experience this is on OSX. <p /> On windows (and linux) there is ONE default hotkey for cycling through tabs in any UI: Ctrl + Tab <p /> So why does OSX have so many? Here are just a few: <p /> Adium: <br />Cmd + left/right arrows <p /> Firefox, Chrome: <br />Cmd + Option + left/right arrows <p /> Safari, Skype, Terminal: <br />Cmd + Shift + left/right arrows <p /> The worst part about this is that it confuses the text editing options...<p /> If I want Cmd + arrow to go to the beginning or end of the current <br />line of text and be able to hold shift to select then the Apple <br />endorsed default (via safari and terminal - e.g. Cmd + Shift + arrows) is already accounted for. <p /> The Current state of things is not good :(</p>
<p><strong>Edit: Things that should be reserved for consistant text editing:</strong></p>
<p>Cmd + Arrow: (go to beginning/end of the current line)</p>
<p>Cmd + Shift + Arrow: (go to beginning/end of current line while selecting)</p>
<p>Opt + Arrow: move one word to the left or right</p>
<p>Opt + Shift + Arrow: move one word to the left or right while selecting</p>
<p>Shift + Arrow: move cursor one char while selecting</p>
<p>&nbsp;</p>
<p>As far as I can tell, you can't edit the Safari or terminal hot keys either :(</p>
	
</p>

<p><a href="http://jiaaro.com/os-x-devs-fail-usability-tabbing-hotkeys">Permalink</a> 

	| <a href="http://jiaaro.com/os-x-devs-fail-usability-tabbing-hotkeys#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sun, 05 Dec 2010 00:23:59 -0800</pubDate>
      <title>Software is all about context</title>
      <link>http://jiaaro.com/software-is-all-about-context</link>
      <guid>http://jiaaro.com/software-is-all-about-context</guid>
      <description>
        <![CDATA[<p>
	In the early days, the context was the world, and you went to a computer and gave it some information to crunch and then returned to the world. Now as we move into an era dominated by computing, context is often completely within your computing experience. <p /><div>You don&#39;t do your taxes at your desk and type the mathematical computations into your computer anymore. You download your bank statements, import them into your tax software, and submit your tax returns over the internet. </div> <p /><div>If this is how things are going to be (I would bet on it). The context created by the software we create needs to be smarter.<p /> I don&#39;t need to know about restaurants in 23rd and Park Ave (New York) when I&#39;m alone in my apartment. I need to know about them when a group of friends and I spontaneously decide to go out for lunch on a thursday.</div> <div> <br />Computers have taken us a long way in terms of reducing the amount of time it takes to get information, but I think the real power is when it&#39;s fast enough to effectively become augmented intelligence. Basically where internet access is fast enough that your brain going to the internet for info is more like hitting ram than hitting the hard disk (which is <a href="http://i.imgur.com/X1Hi1.gif" target="_blank">slow as hell</a>). We&#39;re pretty close already - probably within an order or magnitude in terms of network speed.<p /> I don&#39;t know about you, but the real problem I have, is knowing how to ask for exactly the information I want.<p />As it stands, just about anyone can find the wikipedia article that contains a given bit of information without much trouble (a few minutes at most), but It could take you half an hour to read some of the articles on wikipedia enough to find the information you need. </div> <p /><div>This is the opportunity. </div><p /><div>If there was some kind of system tracking your context the computer could do the scanning for you, and I&#39;m not talking about ctrl+f.<b><br /></b><br /> What I really want to see is for the information to be prefetched and displayed automatically. The computer should be able to eliminate the: (1) google search, (2) clicking on the wikipedia result, and (3) scanning the article. </div> <p /><div>It should just skip to showing you <a href="http://en.wikipedia.org/wiki/Mark_Twain#Legacy" target="_blank">that paragraph about how mark twain used his childhood friend as inspiration for a character</a> so you can use him as an example for your next blog post/term paper. </div> <div> <br />Don&#39;t force us to remember this stuff.<p />Don&#39;t force us to go look for it.<p />You should be able to half remember it. Vaguely describe it, and then have your computer go through your history and show you similar things you&#39;ve come across that could be the thing you mean.<p /> You know... the same thing your friend would do in conversation... that takes 20 minutes of both of your time to finally figure out what was on the tip of your tongue.</div><p /><div>That&#39;s how people work, and the goal is for computers to help us get things done. right?<p /> Computers should do that for us. They&#39;re much better at these types of tasks, as long as we can write the software to figure out what info you need <b>right now</b>.<br /> </div><p /><div>That&#39;s a hard example though, so here&#39;s one you can implement tonight:</div><p /><div>Let&#39;s say you build software with users. Let&#39;s also say that these users interact with each other.</div> <p /><div>When you start typing into a field, try to autocomplete using first OR last name OR email address OR any other identifier in your system. And make sure people I&#39;ve typed in this field before get sorted to the top. I probably mean them. Also any people I&#39;ve recently connected with should get extra weight as well.</div> <p /><div>This is pretty specific and probably wrong in your application so here is the most important part: measure your success rate. Keep track of how often I pick on of your autocomplete suggestions and keep tweaking the algorithm for better suggestive power.</div> <p /><div>Measure --&gt; update --&gt; start over</div>
	
</p>

<p><a href="http://jiaaro.com/software-is-all-about-context">Permalink</a> 

	| <a href="http://jiaaro.com/software-is-all-about-context#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 02 Nov 2010 21:38:00 -0700</pubDate>
      <title>Drop.io was killed by facebook... what do I do?</title>
      <link>http://jiaaro.com/dropio-was-killed-by-facebook-what-do-i-do</link>
      <guid>http://jiaaro.com/dropio-was-killed-by-facebook-what-do-i-do</guid>
      <description>
        <![CDATA[<p>
	<p>So you had all kinds of stuff on drop.io, eh? Well my friend, lend me your ear. A few of my buddies and I are in a band. We make music. We hassle our friends to come see us play shows on facebook, and try to get our music out there any way we can.</p>
<p>We're not beholden to some evil company, peddling our records, desperately trying to stop fans from downloading the music we make. But sometimes it's just not ready yet. During the process of creation we like to send each other different mixes and ideas, and we used to use a vanilla FTP server to do it.</p>
<p>At some point I got tired of explaining how to use FTP to all my friends and put together a file uploading service (very similar to drop.io ;)) so we could exchange files.</p>
<p>Anyway I guess what I'm getting at is this, it's in alpha right now. It's free to use, and the files are stored on amazon s3, so they're not at risk of getting lost.</p>
<p>The idea is to provide more and more collaboration features as the site grows, and eventually become something like a github for everyone else (if you're unfamiliar with github, it is a site that facilitates collaboration on software projects).</p>
<p>For anyone interested, you can email me (<a href="mailto:jiaaro+ps1469492@gmail.com">jiaaro on gmail</a>)&nbsp;and I'll personally help you migrate your files to esploded (and give you 6 months of service for free once we do start charging)</p>
	
</p>

<p><a href="http://jiaaro.com/dropio-was-killed-by-facebook-what-do-i-do">Permalink</a> 

	| <a href="http://jiaaro.com/dropio-was-killed-by-facebook-what-do-i-do#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Fri, 08 Oct 2010 14:23:00 -0700</pubDate>
      <title>Idea: Auto-syncing internet radio</title>
      <link>http://jiaaro.com/idea-auto-syncing-internet-radio</link>
      <guid>http://jiaaro.com/idea-auto-syncing-internet-radio</guid>
      <description>
        <![CDATA[<p>
	<p>I think it would be a neat project to make an html5 internet radio (like <a href="http://mixest.com">mixest.com</a> which I love) that automatically time syncs all the clients.</p>
<p>That way you could have everyone in an office go to a certain url and all the computer's speakers combined become the house sound system.</p>
<p>Not especially useful, but it would make a fun little<a href="http://nodejs.org/"> node.js</a> project.</p>
	
</p>

<p><a href="http://jiaaro.com/idea-auto-syncing-internet-radio">Permalink</a> 

	| <a href="http://jiaaro.com/idea-auto-syncing-internet-radio#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Sat, 02 Oct 2010 08:30:00 -0700</pubDate>
      <title>Give it to me straight</title>
      <link>http://jiaaro.com/give-it-to-me-straight</link>
      <guid>http://jiaaro.com/give-it-to-me-straight</guid>
      <description>
        <![CDATA[<p>
	<p>Let's start with first principles. I want to know things; I want to know almost everything I can. In all but a select few scenarios I'll put in the time to learn something vs not.</p>
<p>I'm not sure how this all got started, but it feels like nobody wants to explain anything anymore. I see it among friends, strangers, between parents and their children, all over.</p>
<p>Let's take a ride in the <a href="http://www.archive.org/web/web.php" title="I'm a robot">wayback machine</a>.... *whirrrrrrr*</p>
<p>Way back in the day, when I was a wee little high school student, I played the guitar. We all did. If you want to get laid in high school, you join the football team or you play guitar. I played guitar.</p>
<p>There's actually one more step: you have to play for somebody.</p>
<p>So there I was.</p>
<p>Some kind soul had agreed to let us, a rowdy group of suburban teens, make loud, awesome noise for a few hours. And the guitar slingers among us were getting ready to melt faces.</p>
<p>I doubt this particular individual understood the complex set of motives for our playing guitars (scene cred, getting laid, or both), but that's a story for another time.</p>
<p>One particular guy, let's call him Jake, was sitting alone with his guitar doing something I'd never seen before, tuning with harmonics. It's really nothing special, but I was young and stupid and my motives were more than a little misplaced.</p>
<p>Even despite that, I like to know things. I asked about it.</p>
<p>"It's just a dumb trick," Jake tells me.</p>
<p>We went back and forth for a while, him telling me it's nothing and trying to get me to leave, and my pressing for more information.</p>
<p>I eventually got him to tell me it was the 5th and 7th fret harmonics, and you can use them to tune a guitar (in so many words). At the risk of being a huge hypocrite, I'm going to skip over that for now as it's not relevant to my story, but you can <a href="http://www.youtube.com/watch?v=kSth9bmDFGg" title="Learn to tune a guitar using harmonics">learn how on youtube</a>.</p>
<p>That isn't a particularly uncommon <span>occurence</span>. Some people just don't want to explain anything.</p>
<p>I have a couple ideas why.</p>
<p>Maybe Jake is impatient and he doesn't want to waste his time teaching whenever he knows anything.</p>
<p>Maybe he's shy, and embarrassed by suddenly becoming the authority on this one infinitesimally small topic.</p>
<p>Whatever it is, he'd have saved us both some time by just spitting out the one sentence explanation. If it's the former he's doing a disservice to the world, and in the case of the latter, to himself.</p>
<p>Google is great, but half the battle is knowing what to search for in the first place. It's usually the hardest step and presents a pretty big barrier to entry when you're first learning about anything.</p>
<p>Until google can read minds, we still need other people to help us along the way. So don't dumb it down for me. Give it to me straight.</p>
<p><span style="font-size: x-small;">(In other news, it turns out communication skills are useful for all kinds of things)</span></p>
	
</p>

<p><a href="http://jiaaro.com/give-it-to-me-straight">Permalink</a> 

	| <a href="http://jiaaro.com/give-it-to-me-straight#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Fri, 13 Aug 2010 09:31:00 -0700</pubDate>
      <title>Python/Javascript Trick - Hacky Error Handling</title>
      <link>http://jiaaro.com/pythonjavascript-trick-hacky-error-handling</link>
      <guid>http://jiaaro.com/pythonjavascript-trick-hacky-error-handling</guid>
      <description>
        <![CDATA[<p>
	<p>So I discovered an interesting way to run some code AFTER your return statement... get this (same idea works in both python and javascript)</p>
<p><code>
(function x() {
&nbsp;&nbsp;try {
&nbsp;&nbsp;&nbsp;&nbsp;var x = 7;
&nbsp;&nbsp;&nbsp;&nbsp;throw "run catch block";
&nbsp;&nbsp;}
&nbsp;&nbsp;catch (err) {
&nbsp;&nbsp;&nbsp;&nbsp;x += 1;
&nbsp;&nbsp;&nbsp;&nbsp;return x;
&nbsp;&nbsp;}
&nbsp;&nbsp;finally {
&nbsp;&nbsp;&nbsp;&nbsp;// if you return here it will override the return
&nbsp;&nbsp;&nbsp;&nbsp;// value from the catch block if it was run
&nbsp;&nbsp;&nbsp;&nbsp;x += 1;
&nbsp;&nbsp;&nbsp;&nbsp;alert(x); // 9
&nbsp;&nbsp;}
})();
// returns 8, but x === 9 !
</code></p>
<p>or in python...</p>
<p><code> class FakeError(Exception): pass
 def my_func():
 &nbsp;&nbsp;&nbsp;&nbsp;try:
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 7
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;raise FakeError
 &nbsp;&nbsp;&nbsp;&nbsp;except FakeError:
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x += 1
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return x
 &nbsp;&nbsp;&nbsp;&nbsp;finally:
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if you return here it will override any value
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# returned by the except block if it was run.
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x += 1
 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print x
 
 my_func() # prints "9" and THEN returns 8
 </code></p>
<p>pretty neat... kind of hard to read though</p>
	
</p>

<p><a href="http://jiaaro.com/pythonjavascript-trick-hacky-error-handling">Permalink</a> 

	| <a href="http://jiaaro.com/pythonjavascript-trick-hacky-error-handling#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Fri, 11 Jun 2010 13:00:00 -0700</pubDate>
      <title>FizzBuzz</title>
      <link>http://jiaaro.com/2010/06/fizzbuzz.html</link>
      <guid>http://jiaaro.com/2010/06/fizzbuzz.html</guid>
      <description>
        <![CDATA[<p>
	<p>Fizzbuzz seemed like fun... My 5 min attempt in python:</p>
<p><code> for i in range(1, 101):
 &nbsp;&nbsp;&nbsp; fizz = "Fizz" if not (i%3) else ""
 &nbsp;&nbsp;&nbsp; buzz = "Buzz" if not (i%5) else ""
 &nbsp;&nbsp;&nbsp; print (fizz + buzz) or i
 </code></p>
<div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/1087162989855557355-7682374118592403463?l=roborobert.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2010/06/fizzbuzz.html">Permalink</a> 

	| <a href="http://jiaaro.com/2010/06/fizzbuzz.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Mon, 03 May 2010 14:18:00 -0700</pubDate>
      <title>Why Hacker News/Webfaction was down</title>
      <link>http://jiaaro.com/2010/05/why-hacker-newswebfaction-was-down.html</link>
      <guid>http://jiaaro.com/2010/05/why-hacker-newswebfaction-was-down.html</guid>
      <description>
        <![CDATA[<p>
	<p><span style="font-size: 85%;">Jiaaro (</span><a href="http://twitter.com/Jiaaro/status/13305978016" title="twitter"><span style="font-size: 85%;">twitter</span></a><span style="font-size: 85%;">): </span><span style="font-family: georgia;"><span style="color: #333333;"><span style="font-size: 85%;">oh boy... the datacenter where all my websites are hosted is down :(</span></span></span></p>
<p><span style="font-family: georgia; color: #333333;"><span style="font-size: 85%;">mikegoldense (</span><a href="http://twitter.com/Jiaaro/status/13306294070" title="twitter"><span style="font-size: 85%;">twitter</span></a><span style="font-size: 85%;">): </span><span style="font-family: georgia;"><span style="color: #333333;"><span style="font-size: 85%;">@</span><a href="http://twitter.com/Jiaaro" class="tweet-url username" title="Jiaaro" rel="nofollow"><span style="text-decoration: underline;"><span style="font-size: 85%;">Jiaaro</span></span></a><span style="font-size: 85%;"> Sorry, Jim. I tripped over the extension cord the datacenter was plugged into this morning. </span><a href="http://twitter.com/search?q=%23mybad" class="hashtag tweet-url" title="#mybad" rel="nofollow"><span style="font-size: 85%;">#mybad</span></a></span></span></span></p>
<p><span style="font-family: georgia; color: #333333;"><span style="font-size: 85%;">jiaaro (<a href="http://twitter.com/Jiaaro/status/13306294070" title="twitter">twitter</a>): @</span><span style="font-family: georgia;"><span style="color: #333333;"><a href="http://twitter.com/mikegoldense" class="tweet-url username" title="mikegoldense" rel="nofollow"><span style="font-size: 85%;">mikegoldense</span></a><span style="font-size: 85%;"> damn... I knew we should've used more duct tape on that extension cord</span></span></span></span></p>
<p><span style="font-family: georgia; color: #333333;"><span style="font-size: 85%;">mikegoldense (<a href="http://twitter.com/mikegoldense/status/13306698318" title="twitter">twitter</a>): </span><span style="font-family: georgia;"><span style="color: #333333;"><span style="font-size: 85%;">@</span><a href="http://twitter.com/Jiaaro" class="tweet-url username" title="Jiaaro" rel="nofollow"><span style="font-size: 85%;">Jiaaro</span></a><span style="font-size: 85%;"> Next time, PLEASE DO. You know how clumsy I am. And you've got all these dang blasted datacenters just lying around. YOUKIDSTODAY!</span></span></span></span></p>
<p />
<div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/1087162989855557355-992861508507767449?l=roborobert.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2010/05/why-hacker-newswebfaction-was-down.html">Permalink</a> 

	| <a href="http://jiaaro.com/2010/05/why-hacker-newswebfaction-was-down.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 17 Mar 2010 13:04:00 -0700</pubDate>
      <title>Pythonic Decorators in Javascript</title>
      <link>http://jiaaro.com/2010/03/decorators-in-javascript.html</link>
      <guid>http://jiaaro.com/2010/03/decorators-in-javascript.html</guid>
      <description>
        <![CDATA[<p>
	<p>I've found plenty of examples of the Class decorator around the internets, but none of the function decorator I've come to know and love in python, so here it is:</p>
<p><code>
x = function(msg) {
 alert(msg);
 return msg;
}
my_decorator = function(fn) {
 var that = this;
 return function() {
 msg = "Message: " + msg;
 return fn.apply(that, arguments);
 }
}
x = my_decorator(x);
x('qwery');

// result: an alert that says, "Message: querty"
</code></p>
<div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/1087162989855557355-6310338034028681538?l=roborobert.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2010/03/decorators-in-javascript.html">Permalink</a> 

	| <a href="http://jiaaro.com/2010/03/decorators-in-javascript.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Thu, 18 Feb 2010 19:25:00 -0800</pubDate>
      <title>Automatically Update the Copyright Year with Django</title>
      <link>http://jiaaro.com/2010/02/automatically-update-copyright-year.html</link>
      <guid>http://jiaaro.com/2010/02/automatically-update-copyright-year.html</guid>
      <description>
        <![CDATA[<p>
	<p>Ever get tired of updating the copyright year on your webpage? Why not update it programmatically? Django templates make it incredibly painless:<p /></p>
<p />
<p><code> &amp;copy; {% now "Y" %} YOUR_NAME_HERE </code></p>
<div>Yeah... it's that easy ;)</div>
<div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/1087162989855557355-8160782164887682962?l=roborobert.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2010/02/automatically-update-copyright-year.html">Permalink</a> 

	| <a href="http://jiaaro.com/2010/02/automatically-update-copyright-year.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Fri, 12 Feb 2010 14:35:00 -0800</pubDate>
      <title>Welcoming a DDOS</title>
      <link>http://jiaaro.com/2010/02/welcoming-ddos.html</link>
      <guid>http://jiaaro.com/2010/02/welcoming-ddos.html</guid>
      <description>
        <![CDATA[<p>
	<p>David M Beazley, a very talented pythonista is gathering data for his talk at pycon. He's doing a little research on the GIL and has asked the community for some help.<p />You can see some interesting initial data <a href="http://ec2-174-129-96-143.compute-1.amazonaws.com/index.html">on his test web page</a> (the one whose server he is asking the community to slam).</p>
<div>If you'd like to contribute, just copy/paste this code into a python interpreter :)</div>
<p><code>

import urllib2
from time import time
&nbsp;
def slamit(url, seconds):
&nbsp;&nbsp;&nbsp; start = time()
&nbsp;&nbsp;&nbsp; count = 0
&nbsp;&nbsp;&nbsp; while time() &lt; start+seconds:
&nbsp;&nbsp;&nbsp; try:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; urllib2.urlopen(url)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; count += 1
&nbsp;&nbsp;&nbsp; except:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass
&nbsp;&nbsp;&nbsp; print count

# 6 hours
slamit('http://ec2-174-129-96-143.compute-1.amazonaws.com/index.html', 60*60*6)

</code></p>
<p>Forgive my lazy exception handling. On occasion you'll get various networking errors as a result of the massive load his server is under like timeouts, or reset-by-peer type stuff. This isn't exactly mission critical code :)<p />Can't wait to hear his talk (I'm hoping to get it online since I won't be able to make it to pycon)</p>
<div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/1087162989855557355-1338832017759627106?l=roborobert.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2010/02/welcoming-ddos.html">Permalink</a> 

	| <a href="http://jiaaro.com/2010/02/welcoming-ddos.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 29 Dec 2009 20:41:00 -0800</pubDate>
      <title>An Example of Python Generators in Action</title>
      <link>http://jiaaro.com/2009/12/example-of-python-generators-in-action.html</link>
      <guid>http://jiaaro.com/2009/12/example-of-python-generators-in-action.html</guid>
      <description>
        <![CDATA[<p>
	<p>Here is an interesting example of using a python generator to generate prime numbers<p /></p>
<p><code>
&gt;&gt;&gt; def is_prime(num, primes):
...    for prime in primes:
...        if num % prime == 0:
...            return False
...    return True

&gt;&gt;&gt; def make_primes():
...    current_num = 3
...    primes = [2]
...    while True:
...        if is_prime(current_num, primes):
...            primes.append(current_num)
...            yield current_num
...        current_num +=1

&gt;&gt;&gt; mp = make_primes()
&gt;&gt;&gt; mp.next()
... 3
&gt;&gt;&gt; mp.next()
... 5
&gt;&gt;&gt; mp.next()
... 7

</code></p>
<p><p />There is still some low hanging fruit as far as speed optimization goes, but I'll leave that as an exercise to the reader.<p />As for performance as is, I was able to calculate all the prime numbers up to 10,000,000 using ~20MB of RAM.<p />Note that for speed reasons, it is still storing the prime numbers so it WILL eat RAM as you go, but it saves many CPU cycles since there is no need to check against non-prime factors</p>
<p>&nbsp;</p>
<div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/1087162989855557355-1857169660895141420?l=roborobert.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2009/12/example-of-python-generators-in-action.html">Permalink</a> 

	| <a href="http://jiaaro.com/2009/12/example-of-python-generators-in-action.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Wed, 23 Dec 2009 14:33:00 -0800</pubDate>
      <title>Interators vs list comprehensions</title>
      <link>http://jiaaro.com/2009/12/interator-vs-list-comprehensions.html</link>
      <guid>http://jiaaro.com/2009/12/interator-vs-list-comprehensions.html</guid>
      <description>
        <![CDATA[<p>
	<p>So I made a discovery today... I was profiling iterators against their list comprehension counterparts and discovered that iterators are actually slower.<p />Not always slower though. They're slower if you're evaluating every object in the list.<p />Here is my test code:</p>
<p><code>
def iters():
&nbsp;&nbsp;&nbsp; x = (x+1 for x in xrange(1,10000))
&nbsp;&nbsp;&nbsp; y = (y/1.5 for y in x)
&nbsp;&nbsp;&nbsp; z = [z**2 for z in y]

def listcomps():
&nbsp;&nbsp;&nbsp; x = [x+1 for x in xrange(1,10000)]
&nbsp;&nbsp;&nbsp; y = [y/1.5 for y in x]
&nbsp;&nbsp;&nbsp; z = [z**2 for z in y]

&gt;&gt;&gt; %timeit iters()
100 loops, best of 3: 5.38 ms per loop

&gt;&gt;&gt; %timeit listcomps()
100 loops, best of 3: 4.06 ms per loop
</code></p>
<p><br />I guess I shouldn't be surprised. There has to be some overhead to setting up the iterator, and if there were more elements, or if they were bigger (like django ORM objects), it probably wouldn't be as noticable.<p />I'd be interested to hear about practical applications though, so leave a comment =D<p /><span style="font-weight: bold; font-size: 130%;">Advantages of the Iterator (even though it's slower)</span></p>
<ul>
<li>Uses less memory, since you don't store those lists in RAM</li>
<li>May actually be faster if you don't operate on all it's elements (useful if you don't know how many you'll use)</li>
</ul>
<p><br /><span style="font-weight: bold;">Another note</span>: You can't use those iterators again. Once you've cycled through the elements... that's it. You'll need to re-declare it.<p />The RAM saving and deferred execution will probably come in handy in my always-RAM-strapped django apps =D</p>
<div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/1087162989855557355-6087722671934883748?l=roborobert.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2009/12/interator-vs-list-comprehensions.html">Permalink</a> 

	| <a href="http://jiaaro.com/2009/12/interator-vs-list-comprehensions.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
    <item>
      <pubDate>Tue, 03 Feb 2009 18:09:00 -0800</pubDate>
      <title>Song Writing Workshops - Design by Committee</title>
      <link>http://jiaaro.com/2009/02/song-writing-workshops-design-by.html</link>
      <guid>http://jiaaro.com/2009/02/song-writing-workshops-design-by.html</guid>
      <description>
        <![CDATA[<p>
	Last night I found myself in front of a small crowd, listening to 'feedback' regarding a song I wrote with my band, <a href="http://fortuneandspirits.com/">Fortune and Spirits</a>. The feedback was legitimate and honest, and I want to say up front, that I appreciate the time and effort of the individuals involved.<p />However...<p />I don't think I'll be acting on <strong>any of this feedback</strong>.<p />The fact of the matter is: song writing workshops are like <a href="http://www.underconsideration.com/speakup/archives/003600.html">design</a> <a href="http://en.wikipedia.org/wiki/Design_by_committee">by</a> <a href="http://c2.com/cgi/wiki?DesignByCommittee">committee</a>. If I put together a song curtailed to the acceptability of all 25 of the people in the room the result is <strong>boring, lifeless, and sterile</strong>. Universally tolerable, but definately not something I'd want to listen to.<p />The effects of this type of song writing are hugely prolific though. It's all over top 40 radio stations, and some people even think they like it (those people don't listen to much music).<p />I'll <a href="http://explore.twitter.com/codinghorror/statuses/809809628">quote jeff atwood</a>, of <a href="http://codinghorror.com/">coding horror</a> and <a href="http://stackoverflow.com/">stack overflow</a> fame,<p /><blockquote class="posterous_short_quote">well, if you're not pissing *someone* off, then you're not very<br />interesting. C'est la vie.</blockquote>I intend to stick to my guns. I <strong>may</strong> use some of the advice they gave in future writing - the ideas themselves weren't necessarily bad - but I'll be maintaining my quirks, and you should too.<p />I'm <strong>not saying you shouldn't get feedback</strong>, just that you need to get it from the right people. The first people who give feedback from will have the most impact so choose them carefully. They should be...<p /><ol>
<li>
<strong>Someone who's writing you think is better than yours</strong> - If you want to get better, that is.<br />
</li>
<li>
<strong>Someone who is at least open to your style/genre</strong> - It's preferrable that they have experience writing in the genre too, but most important is that they will respect the choices you've already made and focus on helping you improve the song.<br />
</li>
<li>
<strong>Someone willing to put in a little time and effort</strong> - It takes time get get to know a song. The first impression is very important, but you want to find out how the song holds up to repeated listening as well... which means this 'someone' is going to have to listen to it quite a bit over a period of time.</li>
</ol><p>Finding someone who will do number 3 is gonna take some searching, and it's definitely ok to have a small group of people who you rotate so that you don't have to ask one person to spend so much time on your music.</p><p>Get to work on those songs! Good luck!</p><p><span style="font-weight: bold;">**edit**: </span>I found <a href="http://sivers.org/songfeedback">this post</a> by derek sivers (of cdbaby) on where people go to get feedback. <a href="http://sivers.org/songfeedback#comment-10299">The comments</a> are the part you care about ;)<br /></p><div class="blogger-post-footer"><img class="posterous_download_image" src="https://blogger.googleusercontent.com/tracker/8547568058334781866-4986076546073731057?l=deathbyprotools.com" height="1" alt="" width="1" /></div>
	
</p>

<p><a href="http://jiaaro.com/2009/02/song-writing-workshops-design-by.html">Permalink</a> 

	| <a href="http://jiaaro.com/2009/02/song-writing-workshops-design-by.html#comment">Leave a comment&nbsp;&nbsp;&raquo;</a>

</p>]]>
      </description>
      <posterous:author>
        <posterous:userImage>http://files.posterous.com/user_profile_pics/669728/What_s_wrong_with_robots.png</posterous:userImage>
        <posterous:profileUrl>http://posterous.com/users/5AafWFpp2Rjj</posterous:profileUrl>
        <posterous:firstName>James</posterous:firstName>
        <posterous:lastName>Robert</posterous:lastName>
        <posterous:nickName>jiaaro</posterous:nickName>
        <posterous:displayName>James Robert</posterous:displayName>
      </posterous:author>
    </item>
  </channel>
</rss>

