unethical blogger blogs http://unethicalblogger.com/blog en Catch me at SCALE! http://unethicalblogger.com/posts/2011/01/catch_me_scale <p><center><em>This is a <a href="http://omgsuse.com/content/catch-me-scale">cross-post</a> from another silly blog I run called<a href="http://www.omgsuse.com">OMG! SUSE!</a></em></center></p> <p>Let's all pretend I have a Geeko-related pun for "SCALE." Anyhoo, <a href="http://www.socallinuxexpo.org/scale9x/">SCALE</a>, otherwise known as the Southern California Linux Expo, is coming up in February (25th - 27th) and yours truly will be present and accounted for.</p> <p><center><a href="http://www.flickr.com/photos/agentdero/5380855797/" title="Tickets to SCALE! by agentdero, on Flickr"><img src="http://farm6.static.flickr.com/5043/5380855797_1cb16be43c.jpg" width="500" height="376" alt="Tickets to SCALE!" /></a></center></p> <p>Yes, those are <strong><em>bus tickets</em></strong> you see there. I will be heading down from Oakland to Los Angeles by <strong><em>bus</em></strong> instead of flying for ideological reasons, so I'll <em>try</em> to be in a good mood when I arrive!</p> <p>At this year's SCALE, the openSUSE project is making a <a href="http://www.socallinuxexpo.org/scale9x/exhibitors/opensuse"><em>big</em> splash</a>. Contributors and ambassadors will be showing up from all over the globe to show off openSUSE, talk nerdy, socialize and eat tasty snacks supplied by Cruise Director, GNOME Accessibility contributor and openSUSE Board Member <a href="http://twitter.com/BryenY">Bryen Yunashko</a>, who just got his <a href="http://twitter.com/omgsuse/status/26004394378010624">annual haircut</a> in preparation for the momentous occasion! ;) <!--break--> If you're in the area, check out this <a href="http://www.socallinuxexpo.org/scale9x/speakers">amazing speakers listing</a> and be sure to <strong><a href="https://www.socallinuxexpo.org/reg7/">register</a></strong> as soon as possible!</p> <p>I'll be covering the specifics of SCALE more in the coming weeks on <a href="http://www.omgsuse.com">OMG! SUSE!</a>, so stay tuned and I hope to see you there!</p> <hr /> http://unethicalblogger.com/posts/2011/01/catch_me_scale#comments Linux Mon, 24 Jan 2011 19:00:00 +0000 R. Tyler Croy 307 at http://unethicalblogger.com S.A.D. - Seasonal Ada Disorder http://unethicalblogger.com/posts/2011/01/sad_seasonal_ada_disorder <p>Last Sunday, I announced the "0.1" release of my <a href="http://adacommons.org/Memcache">memcache-ada</a> project on <a href="http://groups.google.com/group/comp.lang.ada/browse_thread/thread/c70dc869310ffb51#">comp.lang.ada</a>, thus ending a 2 month experiment with the Ada programming language.</p> <p>In my <a href="http://unethicalblogger.com/posts/2010/12/ada_surely_you_jest_mr_pythonman">previous post</a> on the topic, I mentioned some of the things that interested me with regards to Ada and while I didn't use all the concepts that make Ada a powerful language, I can now confidentally say that I know enough to be dangerous (not much more though).</p> <p><center><img src="http://agentdero.cachefly.net/unethicalblogger.com/images/terminaloperator.png" alt="Old school"/><br><em>This is what my coworkers thought of me, learning Ada.</em></center></p> <p>All said and done I spent <em>less than</em> two months off and on creating memcache-ada, mostly on my morning and evening commutes. The exercise of beginning and ending my day with a language which tends to be incredibly strict was interesting to say the least. Due to the lack of an REPL such as Python's, I found myself writing more and more unit and integration tests to get a <em>feel</em> for the language and the behavior of my library. <!--break--> Due to my "fluency" in Python, I tend to think in Python when scratching out code, similar to how a native speaker of a language will write or speak "from the hip" instead of doing large amount of mental work to construct statements. With Ada, not only am I not yet "fluent", the langauge won't let me get away with as much as Python allows me.</p> <p>The overhead of writing Ada, in my opinion, is a double-edged sword, I can very quickly informally test, debug and rewrite Python but with Ada such a process is (in my opinion) onerous. My 20 minute walk to the train station would be spent contemplating how and what I wanted to write and where. By the time I sat down on the train, I had thought out and designed things internally, so I would immediately write out tests around my ideas and assumptions before writing code to pass the tests. The time spent writing code was minimal since I rarely had to rewrite code, I can think of only one function that had to be rewritten after it had passed tests (botched some socket reading) in the whole project.</p> <p>I'm not yet sure what will be my next project in Ada, I am certain that I don't want to build anything of consequence in C again. Working with a language, like C, that not only gives you the rope with which to hang yourself but will often times push you off the chair is more masochism than I feel comfortable with these days. Ada on the other hand will allow you to hang yourself, but it'll make damn certain that have the perseverence to go through with it. Frankly, I don't have that kind of drive to really shoot myself in the foot anymore. I want to build software that works with a language that doesn't want to make me suffer, which means I'll be in a weird Ada + Python love triangle until future notice.</p> http://unethicalblogger.com/posts/2011/01/sad_seasonal_ada_disorder#comments Ada Opinion Software Development Mon, 24 Jan 2011 15:00:00 +0000 R. Tyler Croy 306 at http://unethicalblogger.com Twenty Eleven http://unethicalblogger.com/posts/2011/01/twenty_eleven <p>I wanted to wish everybody foolish enough to keep my RSS feed in their news reader a happy twenty eleven from Victoria, Canada. While I won't do a big 2010 "year in review" style post, I wanted to point out some milestones the year has had for me:</p> <ul> <li>In 2010, I became a married man. Hooray new tax status!</li> <li>In 2010, <a href="http://www.slide.com">Slide</a> was acquired by Google, giving me the liquidity to use previously purchased stock to buy a <strong><em>nice</em></strong> BLT sandwich on Wed. September 15th.</li> <li>In 2010, my lovely wife finished her paralegal studies. Bringing her degree count to <strong>two</strong>, eclipsing my <strong>zero</strong>.</li> <li>In 2010, I moved from San Francisco to Berkeley, adding two more modes of transportation to my morning commute</li> <li>In 2010, I managed to not die in any fashion, comically or otherwise.</li> </ul> <p><center><a href="http://www.flickr.com/photos/agentdero/5313976306/" title="Empress by Night by agentdero, on Flickr"><img src="http://farm6.static.flickr.com/5083/5313976306_425f66e738.jpg" width="500" height="376" alt="Empress by Night" /></a></center> <!--break--></p> http://unethicalblogger.com/posts/2011/01/twenty_eleven#comments Miscellaneous Sat, 01 Jan 2011 23:09:06 +0000 R. Tyler Croy 305 at http://unethicalblogger.com Ada? Surely you jest Mr. Pythonman http://unethicalblogger.com/posts/2010/12/ada_surely_you_jest_mr_pythonman <p><a href="http://www.amazon.com/gp/product/0070116075?ie=UTF8&tag=unethicalblog-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0070116075"><img hspace="10" align="right" border="0" src="http://ecx.images-amazon.com/images/I/41HUUCwx7%2BL._SL160_.jpg"></a><img src="http://www.assoc-amazon.com/e/ir?t=unethicalblog-20&l=as2&o=1&a=0070116075" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> The past couple weeks I've been spending my <a href="http://bart.gov">BART</a> commutes learning the <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Ada_(programming_language)">Ada programming language</a>. Prior to starting to research Ada, I sat in my office frustrated with Python for my free time hackery. Don't get me wrong, I <strong>love</strong> the Python language, I have enjoyed the ease of use, dynamic model, rapid prototyping and expressiveness of the Python language, I just fall into slumps occasionally where some of Python's "quirks" utterly infuriating. Quirks such as its loosey-goosey type system (which I admittedly take advantage of often), lack of <strong>good</strong> concurrency in the language, import subsystem which has driven lesser men mad and its difficulty in scaling organically for larger projects (I've not yet seen a large Python codebase that hasn't been borderline "clusterfuck".)</p> <p>Before you whip out the COBOL and Fortran jokes, I'd like to let it known up front that Ada is a <em>modern</em> language (as I <a href="http://www.reddit.com/r/programming/comments/eh462/ada_surely_you_jest_mr_pythonman/c181zqy">mentioned on reddit</a>, the first Ada specification was in 1983, 11 years after C debuted, and almost 30 years after COBOL and Fortran were designed). It was most recently updated with the "Ada 2005" revision and supports a lot of the concepts one expects from modern programming languages. For me, Ada has two strong-points that I find attractive: extra-strong typing and built-in concurrency.</p> <h3>Incredibly strong typing</h3> <p>The typing in Ada is unlike anything I've ever worked with before, coming from a C-inspired languages background. Whereas one might use the plus sign operator in Python to add an <code>int</code> and a <code>float</code> together without an issue, in Ada there's literally <strong>zero</strong> auto-casting (as far as I've learned) between types. To the inexperienced user (read: me) this might seem annoying at first, but it's fundamental to Ada's underlying philosophy of "no assumptions." If you're passing an <code>Integer</code> into a procedure that expects a <code>Float</code>, there will be no casting, the statement will error at compile time.</p> <h3>Concurrency built-in</h3> <p>Unlike C, Java, Objective-C and Python (languages I've used before), Ada has concurrency defined as part of the language, as opposed to an abstraction on <a href="http://www.amazon.com/gp/product/0521866979?ie=UTF8&tag=unethicalblog-20&linkCode=as2&camp=1789&creative=390957&creativeASIN=0521866979"><img border="0" hspace="10" align="right" src="http://ecx.images-amazon.com/images/I/41FMkfK74-L._SL160_.jpg"></a><img src="http://www.assoc-amazon.com/e/ir?t=unethicalblog-20&l=as2&o=1&a=0521866979" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /> top of an OS level library (pthreads). In Ada this concept is called "<a href="https://secure.wikimedia.org/wikibooks/en/wiki/Ada_Programming/Tasking">tasking</a>" which allows for building easily concurrent applications. Unlike OS level bindings built on top of pthreads (for example) Ada provides built in mechanisms for communicating between "tasks" called "rendezvous" along with scheduling primitives.</p> <p>Being able to define a "task" as this concurrent execution unit that uses this rendezvous feature to provide "entries" to communicate with it is something I still haven't wrapped my head around to be honest. The idea of a language where concurrency is a core component is so new to me I'm not sure how much I can do with it.</p> <p>For my first "big" project with Ada, I've been tinkering with a <a href="https://github.com/rtyler/memcache-ada">memcached client in Ada</a> which will give me the opportunity to learn some Ada fundamentals before I step on to bigger projects. Disregarding the condescending jeers from other programmers who one could classify as "leet Django haxxorz", I've been enjoying the experience of learning a new <strong><em>vastly</em></strong> different language than one that I've tried before.</p> <p>So stop picking on me you big meanies :( <!--break--></p> http://unethicalblogger.com/posts/2010/12/ada_surely_you_jest_mr_pythonman#comments Ada Opinion Software Development Mon, 06 Dec 2010 15:00:00 +0000 R. Tyler Croy 304 at http://unethicalblogger.com GNU/Parallel changed my life http://unethicalblogger.com/posts/2010/11/gnuparallel_changed_my_life <p><a href="http://www.flickr.com/photos/agentdero/5082431682/" title="The @Apture Elephants by agentdero, on Flickr"><img src="http://farm5.static.flickr.com/4025/5082431682_0fef51e059_m.jpg" width="240" height="180" alt="The @Apture Elephants" align="right" /></a>Over the past month or so I've fallen in love with an incredibly simple command line tool: <a href="http://www.gnu.org/software/parallel/">GNU/Parallel</a>. Parallel has more or less replaced my use of <a href="https://secure.wikimedia.org/wikipedia/en/wiki/xargs">xargs</a> when piping data around on the many machines that I use. Unlike <code>xargs</code> however, Parallel lets me make use of the <strong>many</strong> cores that I have access to, either on my laptop or the many quad and octocore machines we have lying around the <a href="http://twitter.com/apture">Apture</a> office.</p> <p>Using Parallel is <em>incredibly</em> easy, in fact the <a href="http://savannah.gnu.org/projects/parallel/">docs</a> enumerate just about every possible incantation of Parallel you might want to use, but starting simple you can just pipe stuff to it:</p> <blockquote> <p><code>cat listofthings.txt | parallel --max-procs=8 --group 'echo "Thing: {}"'</code></p> </blockquote> <p>The command above will run at most eight concurrent processes and group the output of each of the processes when the entire thing completes, simple and in this case not too much different than running with <code>xargs</code></p> <p>With some simple Python scripting, Parallel becomes infinitely more useful:</p> <blockquote> <p><code>python generatelist.py | parallel --max-procs=8 --group 'wget "{}" -O - | python processpage.py'</code></p> </blockquote> <p>There's not really a whole lot say about GNU/Parallel other than <strong>you should use it</strong>. I find myself increasingly impatient when a single process takes longer than a couple minutes to complete, so I've been using GNU/Parallel in more and more different ways across almost all the machines that I work on to make things <em>faster</em> and <em>faster</em>. So much so that I've started to pine for a quad-core notebook instead of this weak dual core Thinkpad of mine :)</p> <h3>GNU/Parallel Demo</h3> <p><center><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/OpaiGYxkSuQ?fs=1&amp;hl=en_US"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/OpaiGYxkSuQ?fs=1&amp;hl=en_US" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></center> <!--break--></p> http://unethicalblogger.com/posts/2010/11/gnuparallel_changed_my_life#comments Linux Software Development Thu, 11 Nov 2010 17:48:32 +0000 R. Tyler Croy 303 at http://unethicalblogger.com Experimenting with reddit's self-serve ads http://unethicalblogger.com/posts/2010/11/experimenting_reddits_selfserve_ads <p>A couple weeks ago I decided to try out reddit's self-serve advertising system for one of our products at Apture: the <a href="http://apture.com/extension/">Apture Highlights</a> browser extension. While I am an Apture employee, I've also turned into a rabid user of our browser plugin while browsing the web, I've found it to be perfect at answering a number of quick questions like "what does this word mean?" or "who the hell is this?" In a mix of curiosity regarding reddit's advertising system and advocacy for our browser extension, I decided to run a trial campaign on reddit.</p> <p><img src="http://agentdero.cachefly.net/unethicalblogger.com/images/voyager_def.jpg" align="right" hspace="10" alt="Looking up 'Voyager' with Apture"/></p> <p>If you've not been exposed to reddit's self-serve advertising platform, here's a quick overview. The entire system is bid-based, with minimum bids starting at 20 USD a day. Ads are created by users (like me) and submitted for approval with tentative dates. Once the ad is approved by reddit, it is scheduled to run on a particular day. From my understanding of the system, the number of impressions given to your advertisement is based on your bid and the demand for ad impressions on the given day. On top of this basic structure, you can run advertisements "targeted" to a specific <a href="https://secure.wikimedia.org/wikipedia/en/wiki/Reddit#Subreddits">subreddit</a> or reddit-wide.</p> <p>For the purposes of my campaign, I wanted to try both reddit-wide and targeted ads, for my targeted portion of the campaign I ran my ad for two days on the <a href="http://www.reddit.com/r/todayilearned">/r/todayilearned</a>, a subreddit with nearly 80,000 subscribers who all are looking to share an interesting nugget of information that they have learned today. <!--break--> In addition to targeting the ad to the specific subreddit, I tried to make the copy of the advertisement as compelling as possible for my potential clickers: <br clear="all"/> <center><a href="http://www.reddit.com/comments/duh72/add_more_til_to_every_thread_on_reddit_with_the/"><img src="http://agentdero.cachefly.net/unethicalblogger.com/images/reddit_ad_grey.jpg" hspace="10" alt="Add more TIL to every thread on reddit with the Apture Highlights browser extension"/></a></center></p> <p>(<em>note:</em> The acronym "TIL" generally is used as a substitute for "today I learned" in threads on reddit)</p> <p>This ad ran for two days on <a href="http://www.reddit.com/r/todayilearned">/r/todayilearned</a> and for one day reddit-wide, bringing my total campaign expenditure to $60. The breakdown in numbers is as follows:</p> <p><strong>Impressions (unique -> total)</strong>: 21,420 -> 141,037<br /> <strong>Clicks (unique -> total)</strong>: 146 -> 157</p> <p>While the click-through rate is frustratingly low, what I found astonishing was the huge disparity between unique and non-unique impressions. What that indicates to me is that readers have a tendency to refresh a page (such as the subreddit homepage) a number of times during the day.</p> <p>What you cannot tell from those numbers above is how many of the clicks came from the targeted placement (/r/todayilearned) versus the reddit-wide run. When the ad ran reddit-wide it received <strong>zero-clicks</strong>, not only did the targeting to /r/todayilearned garner more repeated (non-unique) impressions, it received <strong>all</strong> of the clicks received throughout the entire campaign.</p> <p>The big take-away lesson for me from this brief trial advertising on reddit was: <strong>avoid reddit-wide advertising</strong>. Finding a subreddit with a large number of passionate users isn't that difficult, so you should be able to identify a subreddit that overlaps with your target market and advertise to them specifically. Other than that, I don't have any great "analysis" to offer, it was an interesting experiment but not a rigorously scientific one.</p> <p>If you'd like to download the CSV with the data from the campaign, <a href="http://agentdero.cachefly.net/unethicalblogger.com/reddit_ad_results.csv">you can grab that here</a>. The columns are: date, impression_unique, impression_total, click_unique, click_total, clickrate_unique, clickrate_total.</p> http://unethicalblogger.com/posts/2010/11/experimenting_reddits_selfserve_ads#comments Apture Opinion Mon, 08 Nov 2010 14:00:00 +0000 R. Tyler Croy 302 at http://unethicalblogger.com So. I'm married. http://unethicalblogger.com/posts/2010/11/so_im_married <p>A few weeks ago I finally tied the knot after a rather long engagement, putting my relationship with then-fiance&eacute; into a legally binding relationship. While a wedding should hold a very special place in the bride and groom's heart forever, I feel like it is safe to say that our wedding <strong>objectively rocked.</strong></p> <p>I don't want to dive too much into the nitty-gritty details of the entire weekend which culminated in a great ceremony and reception at the phenomenal <a href="http://madronamanor.com/">Madrona Manor</a> Restaurant and Inn. The entire atmosphere, from both families having a great time together, to impeccable weather and the fantastically prepared dinner, was damned near perfect. Cue a brief slideshow of pictures taken by my good friends <a href="http://twitter.com/stuffonfire">Dave Young</a> and <a href="http://twitter.com/Artichoke13">Annika Lindner</a>:</p> <p><center><object width="600" height="450"> <param name="flashvars" value="offsite=true&lang=en-us&page_show_url=%2Fphotos%2Fagentdero%2Fsets%2F72157625143811546%2Fshow%2F&page_show_back_url=%2Fphotos%2Fagentdero%2Fsets%2F72157625143811546%2F&set_id=72157625143811546&jump_to="></param> <param name="movie" value="http://www.flickr.com/apps/slideshow/show.swf?v=71649"></param> <param name="allowFullScreen" value="true"></param><embed type="application/x-shockwave-flash" src="http://www.flickr.com/apps/slideshow/show.swf?v=71649" allowFullScreen="true" flashvars="offsite=true&lang=en-us&page_show_url=%2Fphotos%2Fagentdero%2Fsets%2F72157625143811546%2Fshow%2F&page_show_back_url=%2Fphotos%2Fagentdero%2Fsets%2F72157625143811546%2F&set_id=72157625143811546&jump_to=" width="600" height="450"></embed></object></center></p> <p>Now that we're properly married, and no longer engaged, the typical annoying question has changed from "<strong>When are you getting married?</strong>" to "<strong>When are you having children?</strong>"</p> <p>Considering I can barely take care of our <a href="http://www.flickr.com/photos/agentdero/tags/cat/">big moron of a cat</a>, I don't think children are in the cards anytime soon. I'm curious what milestone comes after children though, "when are you going to retire" might be next and then perhaps "when are you going to die" after that.</p> <p>Either way, I think it's safe to say, it's all down hill from here.</p> http://unethicalblogger.com/posts/2010/11/so_im_married#comments Opinion Thu, 04 Nov 2010 14:45:00 +0000 R. Tyler Croy 301 at http://unethicalblogger.com Being a Croy http://unethicalblogger.com/posts/2010/09/being_croy <p>The name change that I mentioned in <a href="http://www.unethicalblogger.com/posts/2010/08/whats_name">my previous post</a> is now official. This means I now have to update <strong>everything</strong>. I'm in for a world of hurt between the DMV, banks, brothels and strip-Parcheesi clubs.</p> <p>The only thing you need to do is update your address book, lucky you! I know at least one friend of mine has, who messaged me to say:</p> <blockquote> <p><em>I put your old surname in the "Maiden Name" field in Address Book. Just thought you'd want to know.</em></p> </blockquote> <p>I spoke to my step-dad George on the phone immediately after the hearing was over and asked if there are "any perks to being a Croy?"</p> <p>Still haven't gotten a response to that one yet.</p> http://unethicalblogger.com/posts/2010/09/being_croy#comments Miscellaneous Opinion Fri, 03 Sep 2010 16:00:00 +0000 R. Tyler Croy 300 at http://unethicalblogger.com What's in a name? http://unethicalblogger.com/posts/2010/08/whats_name <p>Tomorrow morning I will be in court, hopefully finalizing a process I started earlier this year. I will be changing my name.</p> <p>When I was first considering it, I found the entire idea a bit scary. I have worked tremendously hard to make a name for myself, from my work in the open source community to conferences I've spoken at and interactions with numerous companies and people who have been instrumental in my whittling out a career in software engineering. I have been very particular about being referred to as "R. Tyler Ballance," ensuring that my "self-branding" remains consistent, netting me somewhere north of <strong>36,000</strong> results when <a href="http://www.google.com/search?ie=UTF-8&amp;q=%22R.+Tyler+Ballance%22">searching Google</a>.</p> <p>Tomorrow I intend on throwing all that out the window, there are more important things in life than Google results (as shocking as that may sound).</p> <p>I'm hesitant to go too much into the motivations for the change, knowing full well that everything I publish might as well be set in stone on the internet.</p> <p>Those close to me know that my parents divorced when I was young. After a particularly nasty divorce, my mother and my three sisters parted ways with my father who I have since only had sporadic contact with. After a couple dark years for my sisters and I, my mother married another Navy man, George P. Croy, III. George came into the marriage with his daughter, bringing my sister-count up to four.</p> <p>Over the past fifteen years or so, I have become George's son. Successfully exploring his emotional spectrum from tears of joy to turning him a bright crimson shade of pissed-off, never once treating me as if I were anything less than his kin. I'm convinced my attitudes towards family, women and friends not to mention my strong opinions on honor and integrity have all been heavily influenced by him</p> <p>Plainly put, I would not be the man I am today without his guiding hand.</p> <p>Provided everything goes well at the courthouse, I enter as R. Tyler Ballance and leave as R. Tyler Croy.</p> <p>Might as well update your address books. <!--break--></p> http://unethicalblogger.com/posts/2010/08/whats_name#comments Miscellaneous Opinion Mon, 30 Aug 2010 15:00:00 +0000 R. Tyler Croy 299 at http://unethicalblogger.com Unclog the tubes; blocking detection in Eventlet http://unethicalblogger.com/posts/2010/08/unclog_tubes_blocking_detection_eventlet <p>Colleagues of mine are all very familiar with my admiration of <a href="http://eventlet.net">Eventlet</a>, a Python concurrency library, built on top of <a href="http://pypi.python.org/pypi/greenlet">greenlet</a>, that provides lightweight "greenthreads" that naturally yield around I/O points. For me, the biggest draw of Eventlet besides its maturity, is how well it integrates with standard Python code. Any code that uses the built-in <code>socket</code> module can be "monkey-patched" (i.e. modified at runtime) to use the "green" version of the socket module which allows Eventlet to turn regular ol' Python into code with asynchronous I/O.</p> <p>The problem with using libraries like Eventlet, is that some Python code just <strong>blocks</strong>, meaning that code will hit an I/O point and <em>not</em> yield but instead block the entire process until that network operation completes.</p> <p>In practical terms, imagine you have a web crawler that uses 10 "green threads", each crawling a different site. The first greenthread (GT1) will send an HTTP request to the first site, then it will yield to GT2 and so on. If each HTTP request blocks for 100ms, that means when crawling the 10 sites, you're going to block the whole process, preventing anything from running, for a whole second. Doesn't sound too terrible, but imagine you've got 1000 greenthreads, instead of everything smoothly yielding from one thread to another the process will lock up very often resulting in painful slowdowns.</p> <p>Starting with Eventlet 0.9.10 "blocking detection" code has been incorporated into Eventlet to make it far easier for developers to find these portions of code that can block the entire process.</p> <div class="geshifilter"><pre class="geshifilter-python"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #ff7700;font-weight:bold;">import</span> eventlet.<span style="color: black;">debug</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> eventlet.<span style="color: black;">debug</span>.<span style="color: black;">hub_blocking_detection</span><span style="color: black;">&#40;</span><span style="color: #008000;">True</span><span style="color: black;">&#41;</span></div></li></ol></pre></div> <p>While using the blocking detection is fairly simple, its implementation is a bit "magical" in that it's not entirely obvious how it works. The detector is built around signals, inside of Eventlet a signal handler is set up prior to firing some code and then after said code has executed, if a certain time-threshhold has passed, an alarm is raised dumping a stack trace to the console. I'm not entirely convinced I'm explaining this appropriately so here's some pseudo-code:</p> <div class="geshifilter"><pre class="geshifilter-python"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #ff7700;font-weight:bold;">def</span> runloop<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #ff7700;font-weight:bold;">while</span> <span style="color: #008000;">True</span>:</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #dc143c;">signal</span>.<span style="color: black;">alarm</span><span style="color: black;">&#40;</span>handler, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> execute_next_block<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">time</span>.<span style="color: #dc143c;">time</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - start<span style="color: black;">&#41;</span> <span style="color: #66cc66;">&lt;</span> resolution:</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> clear_signal<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #808080; font-style: italic;"># Clear the signal if we're less than a second, otherwise it will alarm</span></div></li></ol></pre></div> <p>The blocking detection is a bit crude and can raise false positives if you have bits of code that churn the CPU for longer than a second but it has been instrumental in incorporating <strong>non-blocking DNS</strong> support into Eventlet, which was also introduced in 0.9.10 (ported over from Slide's <a href="http://github.com/slideinc/gogreen">gogreen</a> package).</p> <p>If you are using Eventlet, I highly recommend running your code periodically with blocking detection enabled, it is an invaluable tool for determining whether you're running as fast and as asynchronous as possible. In my case, it has been the difference between web services that are fast in development but slow under heavy stress, and web services that are fast <strong>always</strong> regardless of load.</p> http://unethicalblogger.com/posts/2010/08/unclog_tubes_blocking_detection_eventlet#comments Python Software Development Sat, 28 Aug 2010 22:12:07 +0000 R. Tyler Croy 298 at http://unethicalblogger.com Paw paw? http://unethicalblogger.com/posts/2010/07/paw_paw <p>I feel like I'm slowly starting to blog like <a href="http://twitter.com/cansar">@cansar</a> with just excerpts of other stuff that other people have said on the internet, so this is the last non-technical post for a little bit, promise.</p> <p><strong><a href="http://www.reddit.com/r/WTF/comments/cpcv5/i_just_found_out_my_grampa_is_a_redditor_wtf_i/">This thread</a></strong> on reddit just about made my morning, well, in addition to that delicious peach I ate.</p> <p>The mere thought of my own grandfather on reddit or any other online community I frequent is a pretty big stretch, but to have him be a <em>notable member</em> of the community is unfathomable (not to mention, run a part of it like <a href="http://www.reddit.com/r/mayonnaise/">r/mayonnaise</a>).</p> <p>I suggest you read the whole thread and enjoy a hearty belly laugh, only so long as you're not doing anything important like driving a bus or performing a colonoscopy.</p> <hr /> <p><strong>Updated:</strong> As with most things, <a href="http://www.reddit.com/r/reddit.com/comments/cpl94/i_hate_to_do_this_but_our_beloved_grandapwiggly/">too good to be true</a>. Although, I must say one of the most well done trolling performances I've seen yet. I remain unrepentant in my enjoying of a good belly laugh however</p> http://unethicalblogger.com/posts/2010/07/paw_paw#comments Miscellaneous Wed, 14 Jul 2010 14:32:27 +0000 R. Tyler Croy 297 at http://unethicalblogger.com LeBron James http://unethicalblogger.com/posts/2010/07/lebron_james <p>Saving this thread for posterity</p> <p><a href="http://twitter.com/cansar/status/18141321484" id="aptureLink_cYmpNQpOTP" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by Can Sar"></a> <!--break--> <a href="http://twitter.com/cansar/status/18149417912" id="aptureLink_qsLL9ejfHJ" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by Can Sar"></a></p> <p><a href="http://twitter.com/agentdero/status/18149640745" id="aptureLink_y3FX8u2rCM" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by R. Tyler Ballance"></a></p> <p><a href="http://twitter.com/cansar/status/18150545314" id="aptureLink_fiHbLetlPF" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by Can Sar"></a></p> <p><a href="http://twitter.com/agentdero/status/18150989737" id="aptureLink_Pj7ycFb2j8" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by R. Tyler Ballance"></a></p> <p><a href="http://twitter.com/rabois/status/18151243182" id="aptureLink_7yVwOanbU3" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by Keith Rabois"></a></p> <p><a href="http://twitter.com/tristanharris/status/18151945560" id="aptureLink_ZXc2Le8iM2" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by Tristan Harris"></a></p> <p><a href="http://twitter.com/rabois/status/18152173135" id="aptureLink_zH9M5q9dpq" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by Keith Rabois"></a></p> <p><a href="http://twitter.com/agentdero/status/18152612189" id="aptureLink_sLIYmwSRtS" style="margin-top: 0px; margin-right: auto; margin-bottom: 0px; margin-left: auto; text-align: center; display: block; padding-top: 0px; padding-right: 6px; padding-bottom: 0px; padding-left: 6px; "><img style="border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px; border-style: initial; border-color: initial; " src="http://placeholder.apture.com/ph/355x210_TwitterArticle/" width="355px" height="210px" title="Tweet by R. Tyler Ballance"></a></p> http://unethicalblogger.com/posts/2010/07/lebron_james#comments Miscellaneous Sun, 11 Jul 2010 17:51:30 +0000 R. Tyler Croy 296 at http://unethicalblogger.com I love Sonic.net already http://unethicalblogger.com/posts/2010/07/i_love_sonicnet_already <p>Thanks to <a href="http://twitter.com/pemullen">@pemullen</a>, I was introduced to <a href="http://sonic.net">Sonic.net</a> some time ago. Unfortunately I never took the time in my old apartment to switch out my AT&amp;T DSL for Sonic.net's Fusion service; the thought of home internet downtime was just too dreadful to even contemplate changing, despite AT&amp;T's absolutely awful service.</p> <p>Now that I've left that apartment, I can finally take the dive into some delightful Sonic.net service, and while it's not even installed yet, I can tell this is going to be a wonderful relationship just by some of the support emails I've been exchanging with their folks.</p> <p><strong>From me:</strong></p> <blockquote> <p>Like an idiot I moved in last weekend instead of this upcoming weekend, so I'm now in the unenviable position of zero home internet service. In the interest of time, can you guys just ship the kit instead of sending some poor tech to Berkeley? :)</p> <p>I understand that AT&amp;T still needs to install a line, but after that I'm hoping to get up and running as soon as possible, I'm almost to the point of considering opening a book to read.</p> <p>Oh the horror.</p> </blockquote> <p>After only a couple hours <strong>Kelly R.</strong> got back to me:</p> <blockquote> <p>Sorry to hear that you've been driven to such desperate measures. I know the lead time takes a while from AT&amp;T, but we here at Sonic.net have been working on expediting our end of the install process as much as possible. I'll keep my fingers crossed that this installation process doesn't result in a library membership.</p> </blockquote> http://unethicalblogger.com/posts/2010/07/i_love_sonicnet_already#comments Miscellaneous Opinion Thu, 08 Jul 2010 03:05:06 +0000 R. Tyler Croy 295 at http://unethicalblogger.com Pride http://unethicalblogger.com/posts/2010/07/pride <p>This fourth of July I find myself thinking a great deal about being an American in the 21st century, and pride. In the back of my head I have that hokey country song "<a id="aptureLink_OES0eNh50a" href="http://en.wikipedia.org/wiki/God%20Bless%20the%20USA">God Bless the USA</a>" with its chorus:</p> <blockquote> <p>That I'm proud to be an American, where at least I know I'm free. And I wont forget the men who died, who gave that right to me.</p> </blockquote> <p>The concept comes off so comical to me, "proud to be an American." What does that even mean? I am no more proud to be an American than I am:</p> <ul> <li>Proud to have been born in California</li> <li>Proud to be white</li> <li>Proud to be tall</li> <li>Proud to have four sisters</li> <li>Proud to have a grandpa named Bob</li> </ul> <p>I had no control in <em>any</em> of it, I won the birth lottery and just <em>happened</em> to be born in the United States. I just happened to have grown up to be a tall, white guy with four sisters and a grandpa named Bob, I didn't select this configuration, it just happened to me. What's to be proud of?</p> <p>Taking pride in one's country however, I entirely understand. I feel that one should take pride in the positive actions that we undertake as a nation, since it's actions are theoretically comprised of our collective wills, by the same token, I think one should feel ashamed of the negative actions.</p> <p>That said, I'm struggling to find things to be proud of America lately, there's certainly a good bit to be angry and ashamed of:</p> <ul> <li>Our participating in the secret <a id="aptureLink_SKMk8e6ttw" href="http://en.wikipedia.org/wiki/Anti-Counterfeiting%20Trade%20Agreement">ACTA treaty</a> negotiations </li> <li>The tarring of the Gulf of Mexico, a body of water I've spent nearly 40% of my life around.</li> <li><a id="aptureLink_b7jnFE35Wy" href="http://en.wikipedia.org/wiki/Guantanamo%20Bay%20detention%20camp">Guantanamo</a></li> <li><a href="http://en.wikipedia.org/wiki/Household_income_in_the_United_States">The shrinking middle class</a></li> <li>Shutting down Shuttle service without a viable Shuttle replacement</li> <li>Four horrifically expensive failed wars: <ul> <li>Drugs</li> <li>Terror</li> <li>Afghanistan</li> <li>Iraq</li> </ul></li> <li>A bloated federal government, with representatives who've forgotten who they represent (looking at you <a id="aptureLink_wbLX4QyXEl" href="http://projects.washingtonpost.com/congress/members/h000338">Orrin Hatch</a>)</li> <li>Irrational fear of nuclear power</li> </ul> <p>I could go on, I could even start a whole new list of all the things we've screwed up here in California too, but it just makes angry, then sad, and then sleepy.</p> <p>I'm sure there are plenty of things that Americans have done lately that one could take pride in, but none are coming to mind.</p> <p>We have a mighty big hole to dig ourselves out of.</p> http://unethicalblogger.com/posts/2010/07/pride#comments Opinion Sun, 04 Jul 2010 23:18:10 +0000 R. Tyler Croy 291 at http://unethicalblogger.com Fatso Adventures: "I wonder what's down here?" http://unethicalblogger.com/posts/2010/06/fatso_adventures_i_wonder_whats_down_here <p>Quite the mixed bag today has been, I went to court (more on that later), I signed a lease (more on that later too), and I worked from home. Since ET and I are leaving this apartment soon, the management company has been showing the apartment during the day. Not a big deal, strangers walk around the apartment, all the windows are opened, all the lights are turned on, doors are opened and closed and if you're lucky enough to be around, you get to field questions.</p> <p>About an hour or two after the showing of the apartment was over, ET looks up from the couch and asks "Where's Buddy" (a.k.a. Fatso). After looking in all of the usual hiding places, she grabs a can of food and taps the lid and listens. A faint meowing is heard. She opens the closet door and taps the lid again. Meow, meow, meow. I think to myself "no way in hell is that cat in the closet, so I hold the can out the window and tap, tap, tap. Meows are coming from outside of the bathroom window. <a href="http://www.flickr.com/photos/agentdero/4747139465/" title="The window by agentdero, on Flickr"><img src="http://farm5.static.flickr.com/4115/4747139465_c46fbcf4a1_m.jpg" width="240" height="180" alt="The window" align="right" /></a> Our bathroom window opens onto this tiny area between two buildings, and is rarely opened because the view sucks, and we don't stink up our bathroom too much.</p> <p>Not entirely sure where the cat is, I go to the other side of this little area, in the buildings stairwell and open the window, climb out, and poke around for Fatso, a.k.a Buddy, a.k.a Missing Kitty #1. I can't see Fatso at all but I can <em>hear</em> him. I tapped on the hood for the ventilation shaft and I hear meowing. I tap again, meowing. Reaching my hand around under the hood, I hear more meowing but I don't feel anything.</p> <p>Thanks to a flashlight and mirror loaned from a friendly neighbor, who's more earthquake prepared than ET and I, I was able to look down the ventilation shaft. and I see Fatso's stupid little face, all the way at the bottom.</p> <p><center><a href="http://www.flickr.com/photos/agentdero/4747137655/" title="The inlet by agentdero, on Flickr"><img src="http://farm5.static.flickr.com/4078/4747137655_43cf79b08c_m.jpg" width="240" height="180" alt="The inlet" /></a></center></p> <hr /> <p>Running down to the basement confirms two things, this cat is stuck, secondly, he's stuck in the ventilation inlet to the heating system for the building. <em>Stupid cat</em>. While I continue to investigate possible exit strategies, something Fatso clearly hadn't considered, ET is on telephone duty. First we call the management company, who are characteristically useless, then it's on to the fire department's non-emergency line. <a href="http://www.flickr.com/photos/agentdero/4747138561/" title="From the garage by agentdero, on Flickr"><img src="http://farm5.static.flickr.com/4114/4747138561_85521bf4e3_m.jpg" width="240" height="180" alt="From the garage" align="right"/></a></p> <p>When the calvary (see: firemen) arrive, the first thing we do is rip the hood off the ventilation shaft to determine whether we can fish the stupid cat from the depths, which after removing the hood, turns out to be about 15ft. To add insult to injury, there are a couple pieces of wood fastened into place at the top, preventing any beings larger than a 12 pound stupid cat from fitting down the shaft. Looks like we'll have to attack it from the basement, and be "we" I mean the firemen, I'm useless.</p> <p>The good boys from the SFFD find a seam in the sheet metal where the shaft attaches to the furnace and using some basic tools (pick) and their hands, are able to tear back some sheet metal so I can poke my head in the bottom of the buildings furnace, only to see our stupid cat, a.k.a Fatso, a.k.a Buddy, a.k.a Missing Cat #1, as far away as possible, entirely unwilling to exit the dark bowels of the furnace he's occupied for nigh three hours now.</p> <p>I explain to the firemen, that I can probably handle it from here since they likely have "real shit to do", but they are unwilling to budge, waiting on "verification" of the cat; they had not actually <em>seen</em> the cat at all up until this point. I shove my head back in the furnace, this time with an arm and grab Fatso by the neck and drag him, against his will, from the furnace to greet the four smiling faces of the SFFD's finest (and ET). <a href="http://www.flickr.com/photos/agentdero/4747780668/" title="The escape route by agentdero, on Flickr"><img src="http://farm5.static.flickr.com/4099/4747780668_679dd746c5_m.jpg" width="240" height="180" alt="The escape route" align="left" /></a></p> <p>The firemen are kind enough to seal the now warped sheet metal enough to hold the system over until the management company can repair the damage, and after thanking them they were on their merry way, ideally to save somebody's life, but most likely to watch Real Housewives of New Jersey back at the station while they wait for something to catch on fire or some stupid cat to poke its head where it doesn't belong.</p> <p>Fatso's favoring his hind-legs a little right now but is all and all in good condition. I want to say he's learned his lesson, but I'm certain he hasn't.</p> http://unethicalblogger.com/posts/2010/06/fatso_adventures_i_wonder_whats_down_here#comments Miscellaneous Opinion Photos Wed, 30 Jun 2010 02:06:05 +0000 R. Tyler Croy 290 at http://unethicalblogger.com Silly Problems http://unethicalblogger.com/posts/2010/06/silly_problems <p>In the next few weeks, ET and I will be moving out of San Francisco, perhaps for good. I am living up on the promise I <a href="http://unethicalblogger.com/posts/2010/04/san_francisco_transit_sucks">made back in April</a> and leaving. Over the past weekend I was struck by how picky I've become, particularly with where I live.</p> <p>For starters, living in San Francisco, I live in a place with:</p> <ul> <li>A thriving bicycle culture, which is <a href="http://sf.streetsblog.org/2010/06/21/judge-poses-questions-to-attorneys-on-eve-of-final-bike-injunction-hearing/">only looking to get better</a></li> <li><em>Hundreds</em> of restaurants with all sorts of delicious food stuffs</li> <li>Surprisingly few douchebags (hipsters and Mission bartenders not-withstanding) </li> <li>Fantastic weather</li> <li>Low violent crime</li> </ul> <p>And I'm still not happy with it.</p> <p>In the past, I've lived in places where enormous cars are a status symbol, giant belt buckles that double as shields are accepted; truck nuts. Moving here from Texas I left, stale, windless 100+ degree heat, random people shouting "faggot" at pedestrians from their cars, no tolerance drug policies coupled with binge drinking and drunk driving. To its credit however, Texas is <em>cheap</em> and areas like Austin are wonderful (not counting traffic). When I lived in eastern Germany, I was constantly confused, cold and more than once crashed a bike due to black ice on the roads. Before that, Northern Virginia, living dangerously close to the "south will rise again" group of folks, an area of the country where the Ku Klux Klan is still surprisingly strong, albeit more hidden than before.</p> <p>Every place that I have lived has had its own unique set of problems, San Francisco included; the lack of progress for a progressive city still irritates the hell out of me.</p> <p>There are so many parts of this country that unabashedly <strong>fucking suck</strong> compared to San Francisco, and I'm still not satisfied. What a silly problem to have.</p> http://unethicalblogger.com/posts/2010/06/silly_problems#comments Opinion Tue, 22 Jun 2010 15:45:00 +0000 R. Tyler Croy 289 at http://unethicalblogger.com Keyboard Synergy http://unethicalblogger.com/posts/2010/06/keyboard_synergy <p>Over the past year or two I've become quite fond of tiled window managers, the jump to Awesome (which I've <a href="http://unethicalblogger.com/posts/2009/07/awesomely_bad">since dropped</a>) to <a href="http://xmonad.org">XMonad</a> was a logical one. My gratuitous use of GNU/screen and <a href="http://vim.org">Vim</a>'s tabs and split window support, already provided a de-facto tiled window manager within each one of my many terminals. The tiled window manager on top of all those terminals has served to improve my heavily-terminal biased workflow.</p> <p>One computer has never been enough for me, at the office my work spans three screens and two computers, I've not yet discovered a Thinkpad that can drive three screens alone; at home I typically span three screens and two laptops (let's conveniently ignore the question of <em>why</em> I feel I need so much screen real estate). Tying these setups together I use <a href="http://synergy2.sourceforge.net">synergy</a> to provide my "software KVM" switch. As long as I've used synergy, I've had to switch from one screen to the other with a mouse, which is one of the <strong>few</strong> reasons I still keep one on the desk.</p> <p>Until I discovered a way around that, thanks to Jean Richard (a.k.a <a href="http://github.com/geemoo">geemoo</a>) who posted <a href="http://geemoo.ca/blog/241/synergy-tricks-switch-screens-with-a-keyboard-shortcut">this little configuration change</a> to <code>synergy.conf</code>:</p> <div class="geshifilter"><pre class="geshifilter-bash"><ol><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">section: options</div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> keystroke<span style="color: #7a0874; font-weight: bold;">&#40;</span>control+alt+l<span style="color: #7a0874; font-weight: bold;">&#41;</span> = switchInDirection<span style="color: #7a0874; font-weight: bold;">&#40;</span>right<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal"> keystroke<span style="color: #7a0874; font-weight: bold;">&#40;</span>control+alt+h<span style="color: #7a0874; font-weight: bold;">&#41;</span> = switchInDirection<span style="color: #7a0874; font-weight: bold;">&#40;</span>left<span style="color: #7a0874; font-weight: bold;">&#41;</span></div></li><li style="font-family: monospace; font-weight: normal;"><div style="font-family: monospace; font-weight: normal; font-style: normal">end</div></li></ol></pre></div> <p>With this minor configuration change, combined with XMonad, <a href="http://github.com/philc/vimium">Vimium</a> (Vim-bindings for Chromium) and my usual bunch of terminal-based applications, I can go <em>nearly</em> mouse-less for almost everything I need to do during the day.</p> http://unethicalblogger.com/posts/2010/06/keyboard_synergy#comments Linux Miscellaneous Mon, 14 Jun 2010 16:45:00 +0000 R. Tyler Croy 288 at http://unethicalblogger.com Another video of the cat http://unethicalblogger.com/posts/2010/06/another_video_cat <p><center></p> <object width="500" height="405"><param name="movie" value="http://www.youtube-nocookie.com/v/tdEM3XREqyU&hl=en_US&fs=1&color1=0x3a3a3a&color2=0x999999&border=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/tdEM3XREqyU&hl=en_US&fs=1&color1=0x3a3a3a&color2=0x999999&border=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="405"></embed></object><p></center></p> <p>Reasons the cat meows:</p> <ul> <li>Hungry</li> <li>Too Cold</li> <li>Annoyed</li> <li>Preparing to jump off the bed</li> <li>Jumping off the bed</li> <li>Successfully landed on the floor</li> <li>Happy</li> <li>Welcoming you home</li> <li>Appreciating being petted</li> <li>Hungry</li> <li>Sleepy</li> <li>Too Warm</li> <li>Unhappy</li> <li>Hungry</li> </ul> http://unethicalblogger.com/posts/2010/06/another_video_cat#comments Miscellaneous Sun, 06 Jun 2010 17:00:00 +0000 R. Tyler Croy 287 at http://unethicalblogger.com Being a Libor, Addendum http://unethicalblogger.com/posts/2010/05/being_libor_addendum <p>A couple of weeks ago I wrote a post on how to "<a href="http://unethicalblogger.com/posts/2010/04/be_libor">Be a Libor</a>", trying to codify a few points I feel like I learned about building a successful engineering team at Slide. Shortly after the post went live, I discovered that Libor had been promoted to <a href="http://www.slide.com/corp/about-us.html">CTO at Slide</a>.</p> <p>Over coffee today Libor offered up some finer points on the post in our discussion about building teams. It is important, according to Libor, to maintain a "mental framework" within which the stack fits; guiding decisions with a consistent world-view or ethos about building on top of the foundation laid. This is not to say that you should solve all problems with the same hammer, but rather if the standard operating procedure is to build small single-purpose utilities, you should not attack a new problem with a giant monolithic uber-application that does thirty different things (hyperbole alert!).</p> <p>Libor also had a fantastic quote from the conversation with regards to approaching new problems:</p> <blockquote> <p>Just because there are multiple right answers, doesn't mean there's no wrong answers</p> </blockquote> <p>Depending on the complexity of the problems you're facing there are likely a number of solutions but you still can get it wrong, particularly if you don't remain consistent with your underlying mental framework for the project/organization.</p> <p>As usual my discussions with Libor are interesting and enjoyable, he's one of the most capable, thoughtful engineers I know, so I'm interested to see the how Slide Engineering progresses under his careful hand as the new CTO. I hope you join me in wishing him the best of luck in his role, moving from wrangling coroutines, to herding cats.</p> <p><a href="http://icanhascheezburger.com/2007/05/13/god-speed-moon-cat/">God speed mooncat</a></p> http://unethicalblogger.com/posts/2010/05/being_libor_addendum#comments Apture Opinion Python Slide Software Development Tue, 18 May 2010 16:00:00 +0000 R. Tyler Croy 286 at http://unethicalblogger.com I get lippy when I drink http://unethicalblogger.com/posts/2010/05/i_get_lippy_when_i_drink <p>Most folks that know me, either virtually or otherwise, know I have opinions. Plenty of opinions, regardless of whether or not I'm qualified to comment on the subject, chances are, I will. At <a id="aptureLink_l1nPo1jdAq" href="http://twitter.com/21stAmendment">21st Amendment</a> last Friday, I was in quite a "mood" and poking fun at a few people, of course Can dutifully posted them to twitter, all of which I feel need explaining.</p> <blockquote> <p>"no, they just apply synergy to paradigms!" - <a href="http://twitter.com/cansar/status/14008678069">via @cansar</a></p> </blockquote> <p>Some how Chris Messina and David Recordon came up in the conversation, I'm not afraid to say that I've known of them both for almost three years now, and I still don't have a clue what they actually <em>do</em>.</p> <blockquote> <p>"yeah, well he shops at [El] Pollo Loco" - <a href="http://twitter.com/cansar/status/14009034255">via @cansar</a></p> </blockquote> <p>Apparently Can doesn't know you can buy Bison meat (a tasty alternative to beef), Can also thinks 6 sushi rolls are enough for lunch, suffice to say he has the eating habits of a <a id="aptureLink_FaTjmnoIvu" href="http://www.youtube.com/watch?v=pRLkcmkSUG4">Maury Povich baby</a>.</p> <blockquote> <p>"the UK has very lax [child] labor laws, before that he was a chimney sweep" - <a href="http://twitter.com/cansar/status/14009034514">via @cansar</a></p> </blockquote> <p>When discussing Apture's advisors, <a id="aptureLink_0lKAauLo8Y" href="http://twitter.com/dotben">Ben Metcalfe</a> came up, smart guy, fun to hang out with but apparently worked for the BBC in his teens, which I didn't know before Friday evening.</p> <p>In the interest of full-disclosure, I was drinking.</p> <p>If you're interested in hearing me poke fun at myself, you, your startup, your colleagues or your investors, do join me at 21st Amendment next friday at 5 p.m.</p> http://unethicalblogger.com/posts/2010/05/i_get_lippy_when_i_drink#comments Miscellaneous Mon, 17 May 2010 16:00:00 +0000 R. Tyler Croy 285 at http://unethicalblogger.com The slow death of the indie mac dev http://unethicalblogger.com/posts/2010/05/slow_death_indie_mac_dev <p>Once upon a time I was a Mac developer. I <em>loved</em> Cocoa, I <em>loved</em> building Mac software, Mac OS X was once upon a time the greatest thing <strong>ever</strong>. I recall writing posts, and even founding a mailing list in the earlier days of <a id="aptureLink_XXGfUEOvqS" href="http://en.wikipedia.org/wiki/Core%20Data">Core Data</a>, which I was using in tandem with <a id="aptureLink_tTNWKSVsHe" href="http://developer.apple.com/mac/library/documentation/cocoa/conceptual/CocoaBindings/CocoaBindings.html">Cocoa Bindings</a>, which themselves were almost a black art. I was on a couple of podcasts talking about <a href="http://unethicalblogger.com/posts/tyler/im_on_another_podcast">web services with Cocoa</a> or <a href="http://unethicalblogger.com/posts/tyler/cocoa_radio_im_almost_relevant">MacWorld</a>. I loved the Mac platform, and would have gladly rubbed Steve Jobs' feet and thanked him a thousand times for saving Apple from the despair of the late 1990's. As Apple grew, things slowly started to change, and we started to grow apart.</p> <p>As I started to drift away, I gave a presentation at <a href="http://unethicalblogger.com/posts/tyler/cocoaheads_silicon_valley">CocoaHeads</a> presenting some of the changes and improvements to the Windows development stack, not supremely keen on the idea of building Windows applications, I was clearly on the market for "something else". Further and further I drifted, until I eventually traded my MacBook Pro in for a Thinkpad, foregoing any future I might have developing Mac software. My decade long journey of tinkering and learning on Macintosh computers had ended.</p> <p>When Mac OS X was in it's original Rhapsody-phase, in the weird nether-world between Platinum and Aqua, Apple realized that it had been held back by not giving developers tools to build for the platform. Apple began to push Project Builder which became <a id="aptureLink_swydUdyeZv" href="http://en.wikipedia.org/wiki/Xcode">Xcode</a>, which became the <strong>key</strong> to the Intel-transition and has helped transform Mac OS from a perennial loser in the third-party software world to a platform offering the absolute best in third-party software. Third-party applications of impressive quality were built and distributed by the "indie mac devs", <a id="aptureLink_5aNmJQju9n" href="http://en.wikipedia.org/wiki/Adium">Adium</a>, Voodoo Pad and Acorn from <a id="aptureLink_eJ9uu2MQ3K" href="http://twitter.com/FlyingMeat">Flying Meat</a>, Nicecast and Audio Hijack Pro from <a id="aptureLink_02KaUAf1q9" href="http://twitter.com/RogueAmoeba">Rogue Amoeba</a>, FuzzMeasure Pro from <a id="aptureLink_zzeQ82Xigx" href="http://www.supermegaultragroovy.com/">SuperMegaUltraGroovy</a>, Growl, NetNewsWire or MarsEdit originally from <a id="aptureLink_JhNPNMLWfy" href="http://twitter.com/brentsimmons">Brent Simmons</a> (NetNewsWire is now owned by NewsGator, while MarsEdit was acquired by <a id="aptureLink_iQz8tXYk37" href="http://twitter.com/danielpunkass">Daniel Jalkut</a> of Red Sweater Software), Yojimbo and BBEdit from <a id="aptureLink_uTlAfmYT0e" href="http://www.barebones.com/">BareBones</a>, even Firefox, Camino and Opera filled the gap while Apple pulled Safari out of it's craptastic version 2 series. Applications were used on Mac OS X instead of web applications because the experience was better, faster and integrated with Address Book, iPhoto, Mail.app, iMovie and all of Apple's own stack.</p> <p>Then came the iPhone, with its "<a id="aptureLink_Gd4RKGYWAa" href="http://37signals.com/svn/posts/459-iphone-sdk-its-called-safari">Web SDK</a>" nonsense. The story, at least at the time, was clear to me. Apple didn't care about me. Apple didn't care about its developers. Build a web application using JavaScript and AJAX (a Microsoft innovation, I might add) over AT&amp;T's <strong>EDGE network</strong>? Fuck you! <!--break--> A number of months later, back-tracking on the "Web SDK" concept, the iPhone SDK came out at WWDC with a ridiculous NDA, forbidding developers from talking about it publicly. Then the App Store was bundled with iTunes and iPhone OS, with Apple becoming the gatekeeper between indie developer, and Joe User. Of course, more recently in the long line of iPhone/developer related tragedies, the infamous <a href="http://www.maclife.com/article/news/apple_facing_federal_probes_over_section_331_iphone_sdk">Section 3.3.1</a>. There's also some hub-ub about the Apple Design Awards 2010, <a href="http://www.loopinsight.com/2010/04/28/wwdc-apple-design-awards-eschew-mac-os-x/">only focusing on iPhone and iPad apps</a> which is quite disconcerting for indie mac devs, who routinely compete and win awards for the <em>best</em> Mac applications.</p> <p>The message is clear, Apple wants to completely own users on its platform and sit between developers and their users, dictating terms.</p> <p>It's no wonder that <a href="http://twitter.com/rentzsch">@rentzsch</a>, a major voice in the indie mac dev community, and organizer of the <a id="aptureLink_YzJSA1Egyg" href="http://en.wikipedia.org/wiki/C4%20%28conference%29">C4 conference</a> is throwing in the towel on organizing C4 entirely (discussed in <a href="http://rentzsch.tumblr.com/post/592949476/c4-release">this post</a>).</p> <p>It's not entirely clear whether the "indie mac dev" community will continue to exist for too much longer, there is some speculation that a "Mac App Store" is brewing in Cupertino right now or perhaps modifications to Mac OS X similar to what is present on the iPhone. If I were still part of the "indie mac dev" tribe, I'd feel <em>very</em> nervous right now about what will happen at this year's WWDC, as <a id="aptureLink_oN0VOqyn0t" href="http://twitter.com/DanWood">Dan Wood</a> from <a id="aptureLink_cWiF9biNCa" href="http://twitter.com/karelia">Karelia</a> knows, Apple feels no remorse with stomping on Mac developers.</p> <p>Worst comes to worst, I sincerely invite indie Mac developers to bring their user-experience talent and software-building energy to the weird but exciting world of web software, so long as Google keeps Facebook in check, the web should remain open for a good long while.</p> http://unethicalblogger.com/posts/2010/05/slow_death_indie_mac_dev#comments Cocoa Opinion Software Development Thu, 13 May 2010 16:30:00 +0000 R. Tyler Croy 284 at http://unethicalblogger.com Is programming with Twisted really as awful as it sounds? http://unethicalblogger.com/posts/2010/05/programming_twisted_really_awful_it_sounds <p>Early this week <a href="http://twitter.com/cansar">Can</a> forwarded <a href="http://www.quora.com/Is-programming-with-Twisted-really-as-awful-as-it-sounds">this post on Quora</a> to me, which asks the question:</p> <blockquote> <p>Is programming with Twisted really as awful as it sounds?</p> </blockquote> <p>Yes. <em>Yes</em>. <strong>YES IT IS</strong>. <strong><em>HOLY CRAP IT'S AWFUL</em></strong></p> <p>Here's some good alternatives:</p> <ul> <li><a href="http://eventlet.net">Eventlet</a>, my preference</li> <li><a href="http://gevent.org">gevent</a>, an alternative to Eventlet tied to libevent</li> <li><a href="http://www.java.com/">Java</a>. because let's face it, if you're using Twisted, you've already decided not to write Python, so use something with proper threading support.</li> </ul> <p>That is all.</p> http://unethicalblogger.com/posts/2010/05/programming_twisted_really_awful_it_sounds#comments Opinion Python Wed, 12 May 2010 16:45:00 +0000 R. Tyler Croy 283 at http://unethicalblogger.com How-to: Using Avro with Eventlet http://unethicalblogger.com/posts/2010/05/howto_using_avro_eventlet <p>Working on the plumbing behind a sufficiently large web application I find myself building services to meet my needs more often than not. Typically I try to build single-purpose services, following in the unix philosophy, cobbling together more complex tools based on a collection of distinct building blocks. In order to connect these services a solid, fast and easy-to-use RPC library is a requirement; enter <a href="http://hadoop.apache.org/avro/">Avro</a>.</p> <hr /> <p><em>Note:</em> You can skip ahead and just start reading some source code by cloning my <a href="http://github.com/rtyler/eventlet-avro-example">eventlet-avro-example</a> repository from GitHub.</p> <hr /> <p>Avro is part of the Hadoop project and has two primary components, data serialization and RPC support. Some time ago I chose Avro for serializing all of <a id="aptureLink_LDwxZTTwKh" href="http://www.apture.com">Apture's</a> metrics and logging information, giving us a standardized framework for recording new events and processing them after the fact. It was not until recently I started to take advantage of Avro's RPC support when building services with <a id="aptureLink_a4wlc7Bdkp" href="http://eventlet.net/doc/">Eventlet</a>. I've talked about Eventlet <a href="http://unethicalblogger.com/posts/2010/01/new_years_python_meme">before</a>, but to recap:</p> <blockquote> <p>Eventlet is a concurrent networking library for Python that allows you to change how you run your code, not how you write it</p> </blockquote> <p>What this means in practice is that you can write highly concurrent network-based services while keeping the code "synchronous" and easy to follow. Underneath Eventlet is the "<a id="aptureLink_FICZSkfldQ" href="http://pypi.python.org/pypi/greenlet">greenlet</a>" library which implements coroutines for Python, which allows Eventlet to switch between coroutines, or "green threads" whenever a network call blocks.</p> <p>Eventlet meets Avro RPC in an unlikely (in my opinion) place: WSGI. Instead of building their own transport layer for RPC calls, Avro sits on top of HTTP for its transport layer, POST'ing binary data to the server and processing the response. Since Avro can sit on top of HTTP, we can use <a href="http://eventlet.net/doc/modules/wsgi.html">eventlet.wsgi</a> for building a fast, simple RPC server. <!--break--></p> <h3>Defining the Protocol</h3> <p>The first part of any Avro RPC project should be to define the protocol for RPC calls. With Avro this entails a JSON-formatted specification, for our echo server example, we have the following protocol:</p> <pre><code>{"protocol" : "AvroEcho", "namespace" : "rpc.sample.echo", "doc" : "Protocol for our AVRO echo server", "types" : [], "messages" : { "echo" : { "doc" : "Echo the string back", "request" : [ {"name" : "query", "type" : "string"} ], "response" : "string", "errors" : ["string"] }, "split" : { "doc" : "Split the string in two and echo", "request" : [ {"name" : "query", "type" : "string"} ], "response" : "string", "errors" : ["string"] } }} </code></pre> <p>The protocol can be deconstructed into two concrete portions, type definitions and a message enumeration. For our echo server we don't need any complex types, so the <code>types</code> entry is empty. We do have two different messages defined, <code>echo</code> and <code>split</code>. The message definition is a means of defining the actual remote-procedure-call, services supporting this defined protocol will need to send responses for both kinds of messages. For now, the messages are quite simple, they expect a <code>query</code> parameter which should be a string, and are expected to return a string. Simple.</p> <p>(This is defined in <a href="http://github.com/rtyler/eventlet-avro-example/blob/master/protocol.py">protocol.py</a> in the Git repo)</p> <h3>Implementing a Client</h3> <p>Implementing an Avro RPC client is simple, and the same whether you're building a service with Eventlet or any other Python library so I won't dwell on the subject. A client only needs to build two objects, an "HTTPTransceiver" which can be used for multiple RPC calls and grafts additional logic on top of <code>httplib.HTTPConnection</code> and a "Requestor".</p> <pre><code>client = avro.ipc.HTTPTransceiver(HOST, PORT) requestor = avro.ipc.Requestor(protocol.EchoProtocol, client) response = requestor.request('echo', {'query' : 'Hello World'}) </code></pre> <p>You can also re-use for same <code>Requestor</code> object for multiple messages of the same protocol. The three-line snippet above will send an RPC message <code>echo</code> to the server and then return the response.</p> <p>(This is elaborated more on in <a href="http://github.com/rtyler/eventlet-avro-example/blob/master/client.py">client.py</a> in the Git repo)</p> <h3>Building the server</h3> <p>Building the server to service these Avro RPC messages is the most complicated piece of the puzzle, but it's still remarkably simple. Inside the <code>server.py</code> you will notice that we call <code>eventlet.monkey_patch()</code> at the top of the file. While not strictly necessary inside the server since we're relying on <code>eventlet.wsgi</code>for writing to the socket. Regardless it's a good habit to get into when working with Eventlet, and would be required if our Avro-server was also an Avro-client, sending requests to other services. Focusing on the simple use-case of returning responses from the "echo" and "split" messages, first the WSGI server needs to be created:</p> <pre><code>listener = eventlet.listen((HOST, PORT)) eventlet.wsgi.server(listener, wsgi_handler) </code></pre> <p>The <code>wsgi_handler</code> is a function which accepts the <code>environment</code> and <code>start_response</code> arguments (per the WSGI "standard"). For the actually processing of the message, you should refer to the <code>wsgi_handler</code> function in <code>server.py</code> in the example repository.</p> <pre><code>def wsgi_handler(env, start_response): ## Only allow POSTs, which is what Avro should be doing if not env['REQUEST_METHOD'] == 'POST': start_response('500 Error', [('Content-Type', 'text/plain')]) return ['Invalid REQUEST_METHOD\r\n'] ## Pull the avro rpc message off of the POST data in `wsgi.input` reader = avro.ipc.FramedReader(env['wsgi.input']) request = reader.read_framed_message() response = responder.respond(request) ## avro.ipc.FramedWriter really wants a file-like object to write out to ## but since we're in WSGI-land we'll write to a StringIO and then output the ## buffer in a "proper" WSGI manner out = StringIO.StringIO() writer = avro.ipc.FramedWriter(out) writer.write_framed_message(response) start_response('200 OK', [('Content-Type', 'avro/binary')]) return [out.getvalue()] </code></pre> <p>The only notable quirk with using Avro with a WSGI framework like <code>eventlet.wsgi</code> is that some of Avro's "writer" code expects to be given a raw socket to write a response to, so we give it a <code>StringIO</code> object to write to and return that buffer's contents from <code>wsgi_handler</code>. The <code>wsgi_handler</code> function above is "dumb" insofar that it's simply passing the Avro request object into the "responder" which is responsible for doing the work:</p> <pre><code>class EchoResponder(avro.ipc.Responder): def invoke(self, message, request): handler = 'handle_%s' % message.name if not hasattr(self, handler): raise Exception('I can\'t handle this message! (%s)' % message.name) return getattr(self, handler)(message, request) def handle_split(self, message, request): query = request['query'] halfway = len(query) / 2 return query[:halfway] def handle_echo(self, message, request): return request['query'] </code></pre> <p>All in all, minus comments the server code is around 40 lines and fairly easy to follow (refer to <a href="http://github.com/rtyler/eventlet-avro-example/blob/master/server.py">server.py</a> for the complete version). I personally find Avro to be straight-forward enough and enjoyable to work with, being able to integrate it with my existing Eventlet-based stack is just icing on the cake after that.</p> <p>If you're curious about some of the other work I've been up to with Eventlet, <a href="http://github.com/rtyler">follow me on GitHub</a> :)</p> http://unethicalblogger.com/posts/2010/05/howto_using_avro_eventlet#comments Apture Python Software Development Fri, 07 May 2010 16:45:00 +0000 R. Tyler Croy 282 at http://unethicalblogger.com Be a Libor http://unethicalblogger.com/posts/2010/04/be_libor <p>I reflect occasionally on how I've gotten to where I am right now, specifically to how I made the jump from "just some kid at a Piggly Wiggly in Texas" as <a id="aptureLink_7fpgpX6rLb" href="http://twitter.com/stuffonfire">Dave</a> once said, to the guy who knows <em>stuff</em> about <strong>things</strong>. I often think about what pieces of the <a id="aptureLink_CJpdUZmrfu" href="http://twitter.com/slideinc">Slide</a> engineering environment were influential to my personal growth and how I can carry those forward to build as solid an engineering organization at <a id="aptureLink_jd3j6BSrUf" href="http://www.apture.com">Apture</a>.</p> <p>The two pillars of engineering at Slide, at least in my naive world-view, were Dave and <a id="aptureLink_xrzzjPhkPZ" href="http://www.facebook.com/libor.michalek">Libor</a>. I joined Dave's team when I joined Slide, and I left Libor's team when I left Slide. Dave ran the client team, and did exceptionally well at filling a void that existed at Slide bridging engineering prowess with product management. Libor often furrowed his brow and built some of the large distributed systems that gave Slide an edge when dealing with incredible growth. In my first couple years I did my best to emulate Dave, engineers would always vie for Dave's time, asking questions and working through problems until they could return to their desk with the confidence that they understood the forces involved and solve the task at hand. Now that I'm at Apture, I'm trying to emulate Libor.</p> <p>(<em>Note</em>: I do not intend to idolize either of them, but cite important characteristics)</p> <p>To understand the Libor role, the phrase "the buck stops here" is useful. A Libor is the end of the line for engineering questions, unlike some organizations the "question-chain-of-command" is not the same as the org-chart. If a problem or question progressed up the stack to a Libor, and between an engineer and a Libor the pair cannot solve the problem, <em>you're screwed</em>.</p> <p>What does it take to be a Libor you may be thinking: <!--break--> * <strong>No Guessing:</strong> When acting as a Libor, <em>knowing</em> is crucial. That is not to say you must understand everything about all the nooks and crannies of the code-base, but when you give an answer it is crucial you actually know what the hell you are talking about. The consequences of being wrong are far worst than the consequences of not knowing, if a fellow engineer builds on your guess, when that code ships live in a few days/weeks there is a serious risk of everything falling over.</p> <ul> <li><p><strong>Grok the stack:</strong> A Libor is expected to hold a wealth of information internally, much like a clock maker, a Libor should understand where every single gear and spring fit together in a large complex system. It is not necessary to understand how each component individually works but instead, understand how all the pieces operate in concert. Some amount of acting as a Libor requires direct discussions with the operations team as well as the rest of engineering, when all that JavaScript and Python rolls out to 10, 20, 100, or 1,000 machines, somebody should have at least considered the ramifications of adding 3 more database calls to every request, that's the Libor.</p></li> <li><p><strong>Maintenance and accountability:</strong> Typically working at the lower ends of the stack, a Libor has to relive and tolerate last month's and last year's short-sighted decisions over and over. A Libor should not let himself nor colleagues "fire and forget" code, poor judgement will haunt a Libor for much longer than most people's New Year's resolutions. Because of this mistake-longevity, a Libor should be quite concerned with how well thought-out and tested new changes, particularly drastic ones, are.</p></li> <li><p><strong>Focus on Engineering:</strong> Code quality and extendability are Libor's primary focus, that is not to say that a Libor's role is to impede product development, but rather ensure that it is properly framed. While a product manager's primary concern may be to get a feature deployed as soon as possible, the primary concern of a Libor is to ensure that once that feature is shipped it doesn't break or otherwise degrade the quality of service of the rest of the site. When interfacing with other engineers a Libor should be asking questions about code, intentions and implementation. Code review is as important as communication with the team, flatly rejecting code is unacceptable, but discussing with engineers the potential pitfalls of certain approaches ensures that the group moves forward.</p></li> </ul> <p>Playing the Libor character at Apture has been interesting to say the least, I've done a lot of work getting a number of systems in place to help educate my decisions, particularly in our production environment. Focusing on the entire stack as a complex system has allowed us to make some adjustments here and there that have literally started to pay dividends the day after they ship.</p> <p>Non-engineering also benefits from having a Libor character in the organization, at Apture the product development narrative has changed, I find myself emphasizing:</p> <blockquote> <p>Tell me what you want, we'll find a way to do it</p> </blockquote> <p><em>That's</em> <a href="http://twitter.com/tristanharris/status/8355935929">a breakthrough</a>.</p> http://unethicalblogger.com/posts/2010/04/be_libor#comments Apture Opinion Python Slide Software Development Fri, 30 Apr 2010 14:45:00 +0000 R. Tyler Croy 281 at http://unethicalblogger.com San Francisco (Transit) Sucks http://unethicalblogger.com/posts/2010/04/san_francisco_transit_sucks <p>I was reading <a href="http://www.sfgate.com/cgi-bin/blogs/cityinsider/detail?entry_id=62259&amp;tsp=1">this article</a> on some of the debates going on with the SF <a href="http://www.sfbos.org/index.aspx?page=1616">Board of Supervisors</a>, where one of the supervisors suggested his intention on bringing a ballot initiative up this November to "<em>force Muni operators to negotiate their salary, benefits and work rules through collective bargaining.</em>" Currently, despite the fact that Muni faces service cuts and a budget shortfall, Muni operators are <strong>guaranteed no less than the second-highest transit operator salaries in the nation.</strong></p> <p>If you ask <em>anybody</em> who knows <strong>anything</strong> about say, capitalism, economics or even <em>math</em>, they'll tell you that the arrangement is <strong>batshit insane</strong>.</p> <p>So let's recap, a supervisor suggests the Muni union be forced to use collective bargaining to determine wages, which seems reasonable, and what happens in City Hall?</p> <blockquote> <p>Daly jumped in to respond to Elsbernd's comments, saying that if the city wants to save money, it should look at agreements with all unions, beginning with the police. ''Supervisor Elsbernd targeting basically what amounts to a largely black and/or African American union not only has the issue of racial undertones''</p> </blockquote> <p>Holy race card Batman! Bargaining, a fundamental tenet of our capitalist society gets one deemed a racist by <a href="http://www.sfbos.org/index.aspx?page=1686">Supervisor Daly</a>? He's clearly preoccupied with race, which will sure help bail Muni, and the city, out of their budget deficits this year.</p> <p>For those of you unfamiliar with San Francisco city budgets, this city somehow pisses away an annual budget of <a href="http://articles.sfgate.com/2009-04-01/bay-area/17192422_1_midyear-cuts-budget-analysts-city-s-rainy-day-fund">over 6 billion dollars</a> a year, and our streets are terrible, homelessness continues to be a big issue, Muni is a mess and Market St still smells like urine.</p> <p>When my lease is up in June, I'm leaving San Francisco. <!--break--></p> http://unethicalblogger.com/posts/2010/04/san_francisco_transit_sucks#comments Opinion Wed, 28 Apr 2010 14:30:00 +0000 R. Tyler Croy 280 at http://unethicalblogger.com Regarding Blippy http://unethicalblogger.com/posts/2010/04/regarding_blippy <p>While I wish my friend <a href="http://twitter.com/rromanchuk">Ryan</a> all the luck in the world at Blippy, I <em>loved</em> <a href="http://www.reddit.com/r/programming/comments/bv7if/blippy_leaks_users_credit_card_numbers_ouch/c0opphy">this comment</a> on <a id="aptureLink_M2QkA0F8Rs" href="http://www.reddit.com/">Reddit</a> regarding the startup from <a href="http://www.reddit.com/user/jacques_chester">jacques_chester</a></p> <blockquote> <p>Blippy is a company which turns the urges of widely available trendoids at the forefront of the hipster web into venture capital investments for its founders.</p> </blockquote> <p>I still don't understand what the point is though.</p> http://unethicalblogger.com/posts/2010/04/regarding_blippy#comments Opinion Sat, 24 Apr 2010 15:00:00 +0000 R. Tyler Croy 279 at http://unethicalblogger.com A great platform does not make yours a good product http://unethicalblogger.com/posts/2010/04/great_platform_does_not_make_yours_good_product <p>As I sit here writing, burnt out from the incredible hype surrounding Apple's <a id="aptureLink_LiOsazLOc6" href="http://en.wikipedia.org/wiki/IPad">iPad</a> launch and I cannot help but have flashbacks. Flashbacks to 2004/2005 when "Web 2.0" was at its peak, "ajax" and "<a id="aptureLink_bDGg14iQC7" href="http://en.wikipedia.org/wiki/Mashup%20%28web%20application%20hybrid%29">mashup</a>" were quite trendy. Flashbacks to mid-2007 when the <a id="aptureLink_MvB60hlwfp" href="http://en.wikipedia.org/wiki/Facebook%20Platform">Facebook Platform</a> was gaining steam, words like "FBML" and "social applications" became the new lingo. Flashbacks to early 2008 when the <a id="aptureLink_ijomSI5OcN" href="http://en.wikipedia.org/wiki/IPhone%20OS">iPhone SDK</a> launched and hoards of developers rushed to submit their apps to the <a id="aptureLink_DsKSkKet8H" href="http://www.apple.com/iphone/apps-for-iphone/">App Store</a>. All bore a resemblance to today, with the iPad, the newest, hottest thing in the world with everybody and their mother vying for one.</p> <p>Every step of the way, beneath the almost overwhelming marketing and hype, lies actual technological innovation. With "Web 2.0", the underlying core innovation was the rise of the web as a formidable platform, browsers became capable of supporting immersive applications built in JavaScript, the web "came alive", no longer a lexicon of static pages. With the launch of the Facebook Platform, products could engage not just on a one-to-one level with a user, but with a user's social circle. The iPhone SDK made developers re-think building applications, touch, motion and then location became fundamental building blocks for products. The iPad represents a slightly different innovation, the introduction of "casual computing" to the masses. Personal computers are becoming omnipresent, the smartphone in your pocket, the laptop on your desk and now the tablet on the coffee table.</p> <p>It comes as no surprise that just as with every other hyped innovation over the past few years, there's a rush of gold-diggers trying to latch onto somebody else's innovation, using it to rocket them to the top. The announcement of a <a href="http://techcrunch.com/2010/03/31/kleiner-perkins-ipad-fund/">$200m "iFund" for iPad apps</a> reminds me a <em>lot</em> of the crazy venture capitalists <a href="http://www.insidefacebook.com/2007/07/10/first-venture-capital-fund-for-facebook-applications-launches/">establishing Facebook app funds</a> or even the <a href="http://techcrunch.com/2008/03/06/kleiner-perkins-anounces-100-millioin-ifund-for-iphone-applications/">$100m "iFund" for iPhone apps</a> (from the same group no less).</p> <p>Venture Capitalists aren't alone in their attempts to ride Apple's innovating coat tails, companies building products are falling for it too, with <a id="aptureLink_qwK3O4IqBx" href="http://en.wikipedia.org/wiki/App%20Store#Number_of_launched_applications">hundreds of thousands of apps in the iPhone App Store</a> or the hundreds of thousands of Facebook applications, one could deceive themselves into believing tens of thousands of companies are printing money on these platforms!</p> <p>I would estimate that for every 1000 applications, on any of these platforms, only one is a <strong>good</strong> product. The same thing is going to happen on the iPad, for the exact same reason that it occurred with Web 2.0 sites, the Facebook Platform and the iPhone.</p> <blockquote> <p>It's like X, but for the Web / Facebook Platform / iPhone / iPad!</p> </blockquote> <p>Platform innovation is no substitute for product innovation. The <a href="http://techcrunch.com/2010/04/02/the-new-york-times-launches-free-ipad-app-for-real-now-paid-app-on-the-way/">iPad app for the New York Times</a> comes to mind, which apparently does nothing but format the New York Times and show the user interstitial ads. There is really no added value over using something like <a href="http://www.newsgator.com/individuals/netnewswireiphone/default.aspx">NetNewsWire</a> or god forbid, browsing to <a href="http://newyorktimes.com">newyorktimes.com</a> with Safari for consuming content.</p> <p>Supporting the iPad is <em>not</em> a product, it's a feature, if your product isn't already compelling there is nothing intrinsic about the iPad that will make it more compelling just as it was with the launch of the other platforms.</p> <p>While I won't be buying an iPad, I wish all those jumping on the bandwagon luck. With a word of caution, bring features because your presence on the iPad alone will not be enough.</p> http://unethicalblogger.com/posts/2010/04/great_platform_does_not_make_yours_good_product#comments Opinion Sat, 03 Apr 2010 13:45:00 +0000 R. Tyler Croy 277 at http://unethicalblogger.com A rebase-based workflow http://unethicalblogger.com/posts/2010/04/rebasebased_workflow <p><a href="http://agentdero.cachefly.net/unethicalblogger.com/images/branch_madness.jpeg" target="_blank"><img src="http://agentdero.cachefly.net/unethicalblogger.com/images/branch_madness.jpeg"width="200" align="right"/></a>When I first started working with Git in <a href="http://unethicalblogger.com/posts/2008/07/experimenting_with_git_slide_part_13">mid 2008</a> I was blissfully oblivious to the concept of a "rebase" and why somebody might ever use it. While at Slide we were <strong>crazy</strong> for merging (<em>see diagram to the right</em>), everything pretty much revolved around merges between branches. To add insult to injury, development revolved around a single central repository which <em>everyone</em> had the ability to push to. Merges compounded upon merges led to a frustratingly complex merge history.</p> <p>When I first arrived at Apture, we were still using Subversion, similar to Slide when I arrived (I have a Git-effect on companies). In order to work effectively, I <em>had</em> to use git-svn(1) in order to commit changes that weren't quite finished on a day-to-day basis. Rebasing is fundamental to the git-svn(1) workflow, as Subversion requires a linear revision history; I would typically work in the <code>master</code> branch and execute <code>git svn rebase</code> prior to <code>git svn dcommit</code> to ensure that my changes could be properly committed at the head of trunk.</p> <p>When we finally switched from Subversion to Git we adopted an "integration-manager workflow" which is far more conducive to rebase being useful than the purely centralized repository workflow I had previously used at Slide.</p> <p><center><img src="http://agentdero.cachefly.net/unethicalblogger.com/images/integration_manager_workflow.png"/></center> <center><small>From the <a href="http://progit.org/book/ch5-1.html">Pro Git</a> site</small></center></p> <p>In addition to the publicly readable repositories for each developer, we use Gerrit religiously which I'll cover in a later post.</p> <p>We use rebase heavily in this workflow to accomplish three main goals:</p> <ul> <li>Linear revision history</li> <li>Concise commits covering a logical change</li> <li>Reduction of merge conflicts</li> </ul> <p>Creating a solid linear revision history, while not immediately important, is nicer in the longer term allowing developers (or new hires) to walk the history of a particular file or module and see a clear progression of changes.</p> <p><img src="http://agentdero.cachefly.net/unethicalblogger.com/images/qgit_apture_graph.png" align="right" hspace="4" vspace="4"/>Creating concise commits is probably the <strong>most</strong> important reason to use rebase, when working in a topic branch I will typically commit every 20-40 minutes. In order to not break my flow, the commit messages will typically be brief and cover only a few lines of changes, atomic commits are great when writing code but they're lousy at informing other developers about the changes. To do this, an "interactive rebase" can be used, for example, collapsing the commits in a topic branch <code>ticket-1234</code> would look like:</p> <ul> <li><code>git checkout ticket-1234</code></li> <li><code>git rebase -i master</code></li> </ul> <p>This will bring up an editor with a list of commits, where you can "squash" commits together and re-write the final commit message to be more informative.</p> <h3>The Workflow</h3> <p>For the purposes of the example, let's use the topic branch from above (<code>ticket-1234</code>) which we'll assume has 3 commits unique to it.</p> <ol> <li>Fetch the latest changes from the upstream "master" branch <ul> <li><code>git fetch origin</code></li> </ul></li> <li>Rebase the topic branch, effectively piling the 3 commits on top of the latest tip of the upstream "master" branch <ul> <li><code>git rebase origin/master</code></li> </ul></li> <li>Collapse the 3 commits in the topic branch down into one commit <ul> <li><code>git rebase -i origin/master</code></li> </ul></li> <li>(<em>Later</em>) Bringing those commits down into the "master" branch <ul> <li><code>git checkout master &amp;&amp; git rebase ticket-1234</code></li> </ul></li> </ol> <p>With an interactive rebase, you can chop commits up, re-order them, squash them, etc, with the non-interactive rebase you can pile your commits on top of an upstream head making your changes apply cleanly to the latest code in the upstream repository.</p> <p><a href="http://www.gitready.com/">git ready</a> has a few nice articles on the subject as well, such as an <a href="http://www.gitready.com/intermediate/2009/01/31/intro-to-rebase.html">intro to rebase</a> and an article on <a href="http://www.gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html">squashing commits with rebase</a></p> http://unethicalblogger.com/posts/2010/04/rebasebased_workflow#comments Git Software Development Fri, 02 Apr 2010 13:00:00 +0000 R. Tyler Croy 276 at http://unethicalblogger.com Sometimes Software as a Service Sucks http://unethicalblogger.com/posts/2010/03/sometimes_software_service_sucks <p>Being a big fan of "continuous integration", particularly with <a id="aptureLink_PmOzQb3Bo7" href="http://twitter.com/hudsonci">Hudson</a>, I've often thought about the possibilities of turning it into a business. It's no surprise really, my first commercial application as a rogue Mac software developer was a product called <a href="http://bleepsoft.com/buildfactory/">BuildFactory</a> which, while fun to build, never sold all that many licenses. With the advent of Amazon's <a id="aptureLink_SLPMEfLHeR" href="http://en.wikipedia.org/wiki/Amazon%20Elastic%20Compute%20Cloud">EC2</a> service and the transition of these cloud computing resources into a building block for many businesses, I've long thought about the idea of building "continuous integration as a service."</p> <p>At face value the idea sounds incredibly fun to build, I'll build a service that integrates with <a id="aptureLink_q5Kr8iq6a2" href="http://twitter.com/gIthub">GitHub</a>, <a id="aptureLink_BLDvLKGYwy" href="http://www.crunchbase.com/product/google-code">Google Code</a>, <a id="aptureLink_z9njtjnyXs" href="http://en.wikipedia.org/wiki/SourceForge">SourceForge</a> and private source control systems. The end (paying) user would "plug-in" to the "continuous integration grid", they'd work throughout the day, committing code and then the CI grid would pick up those changes, build releases and run tests against a number of different architecture, automatically detecting failures and reporting them back to the developers. It involves some of my favorite challenges in programming:</p> <ul> <li>Scaling up</li> <li>Efficiently using cycles, and only when needed</li> <li>Building and testing cross-architecture and cross-platform</li> </ul> <p>Unfortunately, it's a crap business idea, I now have second-hand confirmation from a group of guys who've attempted the concept. The folks behind <a id="aptureLink_Yb3agfhs2a" href="http://runcoderun.com/">RunCodeRun</a> are <a href="http://blog.runcoderun.com/post/463439385/saying-goodbye-to-runcoderun">shutting down the service</a>. In the post outlining why they're shutting down, they've hit the nail on the head on why "continuous integration as a service" can <strong>never</strong> work:</p> <blockquote> <p>Large scale hosted continuous integration is consumed as a commodity but built as a craft, and the rewards, both emotional and financial, are insufficient to support the effort.</p> </blockquote> <p>Elaborating further on their point, continuous integration by itself is a relatively basic task: build, test, repeat. The biggest problem with continuous integration as a service however, is that no two projects are alike. My build targets or requirements might be vastly different from project to project, let alone customer to customer, making the amount of tweaking and customization per-job too large such that at some point the only benefit that one derives from such a service is the hosting of the machines to perform the task. If you're just taking care of that, why wouldn't your customers just use Hudson in "the cloud" themselves? The CI grid at that point offers no exceptional value.</p> <p>As much as I regret letting a fun idea die, I think I'll have to file this one under "To do after becoming so rich I'll care about capital gains taxes."</p> http://unethicalblogger.com/posts/2010/03/sometimes_software_service_sucks#comments Hudson Opinion Software Development Tue, 23 Mar 2010 14:00:00 +0000 R. Tyler Croy 275 at http://unethicalblogger.com Hypocrites on Bikes! http://unethicalblogger.com/posts/2010/03/hypocrites_bikes <p>Typically I read at least one news story a day that irritates me, usually I either don't care enough to gripe about them further, or I forget. After griping at ET about driving in the car with a phone in her hand, I remembered an article I read the <a href="http://sf.streetsblog.org">SF Streets Blog</a> titled: "Advocates Concerned That Cyclists Are Included in Distracted Driving Bill" (<a href="http://sf.streetsblog.org/2010/03/03/advocates-concerned-that-cyclists-are-included-in-distracted-driving-bill/">link</a>)</p> <p>One of the choice quotes from the article being:</p> <blockquote> <p>The California Bicycle Coalition (CBC), which was an early supporter of the original distracted driving legislation, was not thrilled about the inclusion of cyclists in the bill. CBC Communications Director Jim Brown said that he was confused about the motivation for extending the same level of fines to cyclists, particularly absent data showing distracted cycling as a public safety hazard.</p> <p>"The consequences of a distracted driver are considerably more serious than the consequences of distracted cycling," said Brown, adding that safe riding should be encouraged at all times and that talking on a cell phone or any other practice that distracted a cyclist from riding would not be advisable.</p> </blockquote> <p>As a member of the San Francisco Bicycle Coalition, I'm partially annoyed by Mr. Brown's comments, but I don't particularly care. Reading further through the article, I found this:</p> <blockquote> <p>Andy Thornley, Program Director for The San Francisco Bicycle Coalition, agreed with Winter that lumping cyclists with motorists in this law was not good policy. While the SFBC "teaches and preaches safe, respectful, and mindful bicycling," said Thornley, "we're very leery of any equivalence of penalty when punishing a guilty cyclist or driver for the same offense."</p> <p>"Even worse, we wonder whether bicyclists would be cited more often than motorists because it's so much easier to spot someone texting while pedaling," he added. "It's already a problem of perception that individual bicycle riders seem to be noticed being naughty more than motorists, comfortably anonymous within their glass and steel boxes."</p> </blockquote> <p>What a hypocrite! Riding your bike while on the phone or worse, <strong>texting</strong> is just as stupid as some of the <a href="http://unethicalblogger.com/posts/2010/02/i_hope_you_bump_your_head">no-helmet, no-light nonsense I was incensed over a few weeks ago</a>, but the fact that these two gentlemen from Bike Coalitions want preferential treatment for cyclists in the most idiotic way possible blows my mind. To be honest, I'm entirely in favor of bicyclists being cited more often than motorists for breaking the law (running red lights or not using signals comes to mind).</p> <p>This kind of no-distractions law makes a lot of sense to me, and should be applied to just about anybody operating a moving vehicle, bikes, trikes, motorcycles, mopeds, cars, tractors, law mowers, you name it. If you are operating a vehicle distracted you raise your chances of hurting yourself or others on public roads (ever been hit while walking by a cyclist?).</p> <p>Inside of the San Francisco cycling community, I think we can do our part by shunning or otherwise pushing cyclists into light posts who are on their cell phones while riding. They are clearly morons and in my opinion the CBC or the SFBC has no place defending their idiocy. <!--break--></p> http://unethicalblogger.com/posts/2010/03/hypocrites_bikes#comments Opinion Fri, 05 Mar 2010 14:00:00 +0000 R. Tyler Croy 274 at http://unethicalblogger.com