<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>n0tw0rthy</title>
	<atom:link href="https://n0tw0rthy.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://n0tw0rthy.wordpress.com</link>
	<description>My $0.02.  Rather cheap really.</description>
	<lastBuildDate>Thu, 16 Feb 2012 21:12:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='n0tw0rthy.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s-ssl.wordpress.com/i/buttonw-com.png</url>
		<title>n0tw0rthy</title>
		<link>https://n0tw0rthy.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://n0tw0rthy.wordpress.com/osd.xml" title="n0tw0rthy" />
	<atom:link rel='hub' href='https://n0tw0rthy.wordpress.com/?pushpress=hub'/>
		<item>
		<title>From Java to Node.js</title>
		<link>https://n0tw0rthy.wordpress.com/2012/01/08/from-java-to-node-js/</link>
		<comments>https://n0tw0rthy.wordpress.com/2012/01/08/from-java-to-node-js/#comments</comments>
		<pubDate>Mon, 09 Jan 2012 04:51:13 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[node.js]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=137</guid>
		<description><![CDATA[I&#8217;ve been developing for quite a while and in quite a few languages.  Somehow though, I&#8217;ve always seemed to fall back to Java when doing my own stuff &#8211; maybe partly from habit, partly because it has in my opinion the best open source selection out there, and party because I liked its mix of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=137&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been developing for quite a while and in quite a few languages.  Somehow though, I&#8217;ve always seemed to fall back to Java when doing my own stuff &#8211; maybe partly from habit, partly because it has in my opinion the best open source selection out there, and party because I liked its mix of features and performance.</p>
<p>Specifically though, in the web arena things have been moving fast and furious with new languages, approaches, and methods like RoR, Play!, and Lift (and many others!).  While I &#8220;get it&#8221; regarding the benefits of these frameworks, I never felt the need to give them more than an initial deep dive to see how they work.  I nod a few times at their similarities and move on back to plain REST-ful services in Java with Spring, maybe an ORM (i try to avoid them these days), and a JS-rich front-end.</p>
<p>Recently, two factors made me deep dive into <a title="NodeJS" href="http://nodejs.org/" target="_blank">Node.js</a>.  First is my growing appreciation with the progress of the JavaScript front-end.  What used to be little JavaScript snippets to validate a form &#8220;onSubmit&#8221; have evolved to a complete ecosystem of technologies, frameworks, and stacks.  My personal favorite these days is <a title="Backbone.js" href="http://documentcloud.github.com/backbone/" target="_blank">Backbone.js</a> and try to use it whenever I can.</p>
<p>Second was the first hand feedback I got from a friend at <a title="Voxer" href="http://www.voxer.com" target="_blank">Voxer</a> about their success in using and deploying Node.js at real scale (they have a pretty big Node.js deployment).</p>
<p>So I jumped in.  In the short time I&#8217;ve been using it for some (real) projects, I can say that it&#8217;s my new favorite language of choice.</p>
<p>First of all, the event-driven (and non-blocking) model is a perfect fit for server side development.  While this has existed in the other languages and forms (Java <a title="Async Servlet 3.0" href="http://www.javaworld.com/javaworld/jw-02-2009/jw-02-servlet3.html">Servlet 3.0</a>, <a title="Event Machine" href="https://github.com/eventmachine/eventmachine/wiki" target="_blank">Event Machine</a>, <a title="Twisted" href="http://twistedmatrix.com/trac/" target="_blank">Twisted</a> to name a few), I connected with the easy of use and natural maturity of it in JavaScript.  We&#8217;re all used to using callbacks anyway from your typical run-of-the-mill AJAX work right?</p>
<p>Second is the community and how large its gotten in the short time Node has been around.  There are lots of useful <a title="NodeJS Modules" href="https://github.com/joyent/node/wiki/modules" target="_blank">open source libraries</a> to use to solve your problems and the quality level is high.</p>
<p>Third is that it was just so easy to pick up.  I have to admit that my core JavaScript was decent before I started using Node, but in terms of the <a title="NodeJS Docs" href="http://nodejs.org/docs/v0.6.6/api/index.html" target="_blank">Node core library</a> and feature set itself, it&#8217;s pretty lean and mean and provides a good starting point to build what you need in case you can&#8217;t find someone who already did (which you most likely can).</p>
<p>So having said all that, I wanted to share what resources helped me get up to speed in Node.js coming from a Java background.</p>
<h3>Getting to know JavaScript</h3>
<p>There are lots of good resources out there on Node.js and i&#8217;ve listed them below.  For me, the most critical piece was getting my JavaScript knowledge to the next level.  Because you&#8217;ll be spending all your time writing your server code in JavaScript, it pays huge dividends to understand how to take full advantage of it.</p>
<p>As a Java developer you&#8217;re probably trained to think in OO designs.  With me, this was the part that I focused the most on.  Fortunately (or unforunately), JavaScript is not a classic OO language.  It can be if you shoehorn it, but i think that defeats the purpose.</p>
<p>Here is my short list of JavaScript resources:</p>
<ol>
<li><a title="JavaScript: The Good Parts" href="http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742" target="_blank">JavaScript: The Good Parts</a> - Definitely a requirement.  Chapters 4 and 5 (functions, objects, and inheritance) are probably the most important part to understand well for those with an OO background.</li>
<li><a title="Learning JavaScript with Object Graphs" href="http://howtonode.org/object-graphs" target="_blank">Learning Javascript with Object Graphs</a> (<a title="Learning JavaScript with Object Graphs pt 2" href="http://howtonode.org/object-graphs-2" target="_blank">part 2</a>, and <a title="Learning Javascript with Object Graphs pt3 " href="http://howtonode.org/object-graphs-3" target="_blank">part 3</a>) &#8211; howtonode.org has lots of good Node material, but this 3 part post is a good resource to top off your knowledge from the book.</li>
<li><a title="Simple &quot;Class&quot; Instantiation" href="http://ejohn.org/blog/simple-class-instantiation/" target="_blank">Simple &#8220;Class&#8221; Instantiation</a> &#8211; Another good post I read recently.  Worth digesting.</li>
</ol>
<h3>Learning Node.js</h3>
<p>With a good JavaScript background, starting to use Node.js is pretty straightforward.  The main part to understand is the asynchronous nature of the I/O and the need to produce and consume events to get stuff done.  Here is a list of resources I used to get up to speed:</p>
<ol>
<li><a title="DailyJS Node Tutorials" href="http://dailyjs.com/tags.html#lmawa" target="_blank">DailyJS&#8217;s Node Tutorial</a> - A multipart tutorial for Node on DailyJS&#8217;s blog.  It&#8217;s a great resource and worth going through all the posts.</li>
<li><a title="Mixu's Node Book" href="http://book.mixu.net/" target="_blank">Mixu&#8217;s Node Book</a> - Not complete, but still worth it.  I look forward to reading the future chapters.</li>
<li><a title="Node Beginner Book" href="http://www.nodebeginner.org/" target="_blank">Node Beginner Book</a> &#8211; A good starter read.</li>
<li><a title="How To Node" href="http://howtonode.org/" target="_blank">How To Node</a> &#8211; A blog dedicated to Node.js.  Bookmark it.</li>
</ol>
<p>I felt that going through these was more than enough to give me the push I needed get started.  Hopefully it does for you too (thanks to the authors for taking the time to share their knowledge!).</p>
<h3>Frameworks?</h3>
<p>Java is all about open source frameworks.  That&#8217;s part of why it&#8217;s so popular.  While Node.js is much newer, lots of people have already done quite a bit of heavy-lifting and have shared their code with the world.  Below is what I think is a good mapping of popular Java frameworks to their Node.js equivalents (from what I know so far).</p>
<h4>Web MVC</h4>
<p><strong></strong>In Java land, most people are familiar with Web MVC frameworks like Spring MVC, Struts, Wicket, and JSF.  More recently though, the trend towards client-side JS MVC frameworks like <a title="Ember.js" href="http://emberjs.com/" target="_blank">Ember.js</a> (SproutCore) and <a title="Backbone.js" href="http://documentcloud.github.com/backbone/" target="_blank">Backbone.js</a> reduces the required feature-set of some of these frameworks.</p>
<p>Nonetheless, a good comparable Node.js web framework is <a title="Express" href="http://expressjs.com/" target="_blank">Express</a>.   In a sense, it&#8217;s even more than a web framework because it also provides most of the &#8220;web server&#8221; functionality most Java developers are used to through Tomcat, Jetty, etc (more specifically, Express builds on top of <a title="Connect" href="https://github.com/senchalabs/connect" target="_blank">Connect</a>)  It&#8217;s well thought out and provides the feature set needed to get things done.</p>
<h4>Application Lifecycle Framework (DI Framework)</h4>
<p>Spring is a popular framework in Java to provide a great deal of glue and abstraction functionality.  It allows easy dependency injection, testing, object lifecycle management, transaction management, etc.  It&#8217;s usually one of the first things I slap into a new project in Java.</p>
<p>In Node.js&#8230; I haven&#8217;t really missed it.  JavaScript allows much more flexible ways of decoupling dependencies and I personally haven&#8217;t felt the need to find a replacement for Spring.  Maybe that&#8217;s a good thing?</p>
<h4>Object-Relational Mapping (ORMs)</h4>
<p>I have <a title="ORM’s hidden cost" href="http://n0tw0rthy.wordpress.com/2011/05/28/orms-hidden-cost/" target="_blank">mixed feelings</a> regarding ORMs in general, but it does make your life easier sometimes.  There is no shortage of ORM librares for Node.js.  <a title="Node.js Modules (Database)" href="https://github.com/joyent/node/wiki/modules#wiki-database" target="_blank">Take your pick</a>.</p>
<h4>Package Management Tools</h4>
<p>Maven is probably most popular build management tool for Java.  While it is very flexible and powerful with a wide variety of plug-ins, it can get very cumbersome.  <a title="npm" href="https://github.com/isaacs/npm" target="_blank">Npm</a> is the mainstream package manager for Node.js.  It&#8217;s light, fast, and useful.</p>
<h4>Testing Framework</h4>
<p>Java has lots of these for sure, jUnit and company as standard.  There are also mock libraries, stub libraries, db test libraries, etc.  Node.js has quite a few as well.  <a title="Node.js Modules (Testing)" href="https://github.com/joyent/node/wiki/modules#wiki-testing" target="_blank">Pick your poison</a>.  I see that <a title="nodeunit" href="https://github.com/caolan/nodeunit" target="_blank">nodeunit</a> is popular and is similar to jUnit.  I&#8217;m personally testing <a title="Mocha" href="http://visionmedia.github.com/mocha/" target="_blank">Mocha</a>.  Testing tools are a more personal and subjective choice, but the good thing is that there definitely are good choices out there.</p>
<h4>Logging</h4>
<p>Java developers have quite a list of choices when choosing a logger library.  Commons logging, log4j, logback, and slf4j (wrapper) are some of the more popular ones.  Node.js also has a few.  I&#8217;m currently using <a title="Winston" href="https://github.com/flatiron/winston" target="_blank">winston</a> and have no complaints so far.  It has the logging levels, multiple transports (appenders to log4j people), and does it all asynchronously as well.</p>
<p>Hopefully this will help someone save some time when peeking into the world of Node.  Good luck!</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/137/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/137/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/137/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=137&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2012/01/08/from-java-to-node-js/feed/</wfw:commentRss>
		<slash:comments>26</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
		<item>
		<title>Mergers and Acquisitions Insight From an Ex-Googler</title>
		<link>https://n0tw0rthy.wordpress.com/2011/10/12/mergers-and-acquisitions-insight-from-an-ex-googler/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/10/12/mergers-and-acquisitions-insight-from-an-ex-googler/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 22:29:18 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=126</guid>
		<description><![CDATA[I recently attended the Silicon Valley Code Camp at Foothill College and it was pretty interesting.  Lots of sessions to choose from this year. One specific session stood out for me.  Ashish Kelkar gave a great talk about his experiences in Mergers and Acquisitions in the Consumer Internet &#8211; specifically about his 6 years at [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=126&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently attended the <a title="Silicon Valley Code Camp" href="http://www.siliconvalley-codecamp.com" target="_blank">Silicon Valley Code Camp</a> at Foothill College and it was pretty interesting.  Lots of sessions to choose from this year.</p>
<p>One specific session stood out for me.  Ashish Kelkar gave a great talk about his experiences in Mergers and Acquisitions in the Consumer Internet &#8211; specifically about his 6 years at Google being part of the team that did just that.</p>
<p>There is lots of good information on why they buy companies, how much they pay, how the process works, and when to negotiate.</p>
<p>Definitely good stuff.</p>
<p>Here is a <a title="Mergers and Acquisitions in Consumer Internet" href="http://www.slideshare.net/ashishkelkar1/mergers-acquistions-in-consumer-internet" target="_blank">link to the deck</a> or you can browse the embedded version below:</p>
<div id="__ss_9660752" style="width:425px;"><strong><a title="Mergers &amp; Acquistions in Consumer Internet " href="http://www.slideshare.net/ashishkelkar1/mergers-acquistions-in-consumer-internet" target="_blank">Mergers &amp; Acquistions in Consumer Internet </a></strong><iframe src='http://www.slideshare.net/slideshow/embed_code/9660752' width='425' height='348' scrolling='no'></iframe></p>
<div style="padding:5px 0 12px;">View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/ashishkelkar1" target="_blank">Ashish Kelkar</a></div>
</div>
<div style="padding:5px 0 12px;">Did you learn anything new from this?</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/126/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/126/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/126/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=126&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/10/12/mergers-and-acquisitions-insight-from-an-ex-googler/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
		<item>
		<title>When do you escape your data?</title>
		<link>https://n0tw0rthy.wordpress.com/2011/10/07/when-do-you-escape-your-data/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/10/07/when-do-you-escape-your-data/#comments</comments>
		<pubDate>Fri, 07 Oct 2011 18:31:47 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=110</guid>
		<description><![CDATA[I recently had an interesting discussion regarding escaping user-inputted data. When i mean escaping, i mean making sure that the data is modified so that any medium-specific special characters or symbols should be taken literally and not processed. Here&#8217;s a very common scenario: Your website allows users to submit text which you save in your [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=110&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I recently had an interesting discussion regarding escaping user-inputted data. When i mean escaping, i mean making sure that the data is modified so that any medium-specific special characters or symbols should be taken literally and not processed.</p>
<p>Here&#8217;s a very common scenario: Your website allows users to submit text which you save in your database and later display for other users to see. It could be comments, descriptions, names, addresses, etc.</p>
<p>You want to make sure that they don&#8217;t mess around with your system (security is important right?), so you want to make sure you escape any markup they include in their text. Escaping it should make sure that &lt;/body&gt; tag they put it by &#8220;mistake&#8221; or that accidental &lt;script&gt;&#8230;&lt;/script&gt; tag won&#8217;t fire when the text is displayed inline.</p>
<p>That brings me to my big question&#8230; when should you escape this data?</p>
<p>On the way in or the way out?</p>
<p>On the way in, like escaping the text before it&#8217;s saved in the database, might seem safer because you&#8217;re sure whichever way it leaves your system (or whichever developer uses that data), it will be escaped. But I think that&#8217;s the wrong approach.</p>
<p>I&#8217;ve always had the belief that your user-inputted data is sacred and should always be stored in its original form. You never know what you&#8217;ll be doing with it later.</p>
<p>Why does that help us here?</p>
<p><strong>It&#8217;s because escaping changes for each output medium and you might not know which medium it is ahead of time!</strong></p>
<p>Let&#8217;s go back to our original example. Let&#8217;s say you decided to escape any HTML tags before saving it to the database. Output should be easy now. You just dump the text on your webpage and call it a day.</p>
<p>But a few days later, your boss tells you a new output format should be supported in your system &#8211; for example, CSV files.</p>
<p>If you dump that escaped text to the CSV file, it will be escaped for HTML which is not what we want. Not only that, CSV files have their own escaping that is required.  You also have the possibility of double escaping when one medium isn&#8217;t compatible with the escaped field from another medium.</p>
<p>So escaping data on the way in has two problems. First, you can&#8217;t decide which medium to escape it to ahead of time. Second, escaping it could potentially lose data that is important to you by double escaping.</p>
<p>Doing it on the way out makes sure you are making the decision at the best possible time in the data&#8217;s lifecycle and keeps the system flexible to new requirements for data display.</p>
<p>The downside is discipline. Forgetting to escape something can be a problem from a security perspective and from a user experience perspective. As they say, with great power comes great responsibility.</p>
<p>Fortunately, popular frameworks and libraries already include escaping functionality. It just becomes the responsibility of the developers to make sure that happens.</p>
<p>What do you think?</p>
<p>Update: Some people have pointed out performance.  They&#8217;re absolutely right!  You could keep the original text and encode it as well in a separate field.  That way you have the freedom to use the original value or the pre-processed one.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/110/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/110/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/110/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=110&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/10/07/when-do-you-escape-your-data/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
		<item>
		<title>What would you learn if you had a week of paid time to do it?</title>
		<link>https://n0tw0rthy.wordpress.com/2011/08/30/what-would-you-learn-if-you-had-a-week-of-paid-time-to-do-it/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/08/30/what-would-you-learn-if-you-had-a-week-of-paid-time-to-do-it/#comments</comments>
		<pubDate>Tue, 30 Aug 2011 22:02:40 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=87</guid>
		<description><![CDATA[A while ago, I posted some of my thoughts on what I thought was a good job interview question (with quite a bit of constructive feedback). I wanted to share another question that I use which helps in a different way. It&#8217;s another open one that goes like this: If you got a full week [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=87&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A while ago, I posted some of my thoughts on what I thought was a <a title="What have you developed in your spare time?" href="http://n0tw0rthy.wordpress.com/2011/06/15/what-have-you-developed-in-your-spare-time/" target="_blank">good job interview question</a> (with quite a bit of constructive feedback). I wanted to share another question that I use which helps in a different way. It&#8217;s another open one that goes like this:</p>
<blockquote><p>If you got a full week of paid time-off to learn some new technical subject or improve an existing one, what would it be (and why)?</p></blockquote>
<p>In in other words, what have you been dying to try out, but didn&#8217;t have time to do it at work (and still get paid for it).</p>
<p>I like this question because:</p>
<ul>
<li>It&#8217;s time-boxed.  You only have a week, so it focuses on achievable goals in the eyes of the candidate.</li>
<li>There is no &#8220;spare-time&#8221; requirement and can be done during work hours.</li>
<li>It gives some interesting &#8211; and sometimes surprising &#8211; insight on the candidate.</li>
</ul>
<p>For example, were they interested in a new tool or language? That&#8217;s a great subject to discuss to understand what interests them.</p>
<p>How about improving some existing skill? Deep dive into it to see what they think they are missing and why.</p>
<p>How about to write up some prototype or POC of an idea they had? Ask them why they haven&#8217;t <a title="What have you developed in your spare time?" href="http://n0tw0rthy.wordpress.com/2011/06/15/what-have-you-developed-in-your-spare-time/">done it in their spare time</a>&#8230;</p>
<p>Some candidates literally are surprised by the fact that they haven&#8217;t really thought about it at all!</p>
<p>In the end, it leads to some great conversation and is surprisingly refreshing for a job interview setting. It can also be a great way for a candidate to stand out from the others in your memory. There is a sinister side to it though&#8230;</p>
<p>Candidates sometimes (inadvertedly) admit to not knowing some skills you think are important. Oops. Not good for them, but better to know early right?</p>
<p>In all, this question has been very helpful for me.  Hopefully it will be for you too.</p>
<p>What would you learn if you had a chance?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/87/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/87/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/87/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=87&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/08/30/what-would-you-learn-if-you-had-a-week-of-paid-time-to-do-it/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
		<item>
		<title>Graph Databases FTW</title>
		<link>https://n0tw0rthy.wordpress.com/2011/08/18/graph-databases-ftw/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/08/18/graph-databases-ftw/#comments</comments>
		<pubDate>Thu, 18 Aug 2011 14:36:28 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=70</guid>
		<description><![CDATA[I always try to slip in some new technology when working on some new idea or project to keep myself from doing the same &#8216;ol.  Recently, I&#8217;ve been working on my own (very many) weekend project.  Because this is a social website, I had to go through the paces of persisting the &#8220;social graph&#8221;.  Namely, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=70&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I always try to slip in some new technology when working on some new idea or project to keep myself from doing the same &#8216;ol.  Recently, I&#8217;ve been working on my own (very many) <a title="MyWaitingList" href="http://www.mywaitinglist.com" target="_blank">weekend project</a>.  Because this is a social website, I had to go through the paces of persisting the &#8220;social graph&#8221;.  Namely, who your friends are and who their friends are (rinse and repeat).</p>
<p>Having chosen MongoDB as my somewhat trusty back-end database, it would have been convenient to shoe-horn that fat social graph into the database.  I mean, blogs and books have written about how to do this in your typical relational database.   <a title="StackOverflow Question" href="http://stackoverflow.com/questions/2909558/best-way-to-store-11-user-relationships-in-relational-database" target="_blank">Some</a> are still figuring out the best way.  Some even got a <a title="Implementing Graph Pattern Queries" href="http://www.bearcave.com/misl/misl_tech/Implementing_Graph_Pattern_Queries.pdf" target="_blank">really big shoe-horn</a>.  Even MongoDB, which is a document db but similar enough, has its <a title="Trees in MongoDB" href="http://www.mongodb.org/display/DOCS/Trees+in+MongoDB" target="_blank">own solution page</a> for this common task.</p>
<p>Getting it right with one of these solutions isn&#8217;t easy.  Especially when you start to scale and new features demand deeper traversals into the social graph.  Not to mention is it quite the maintenance nightmare.</p>
<p>So from day one, I figured i&#8217;d go all out and get myself a shiny graph database to add to my technology stack and see what a difference it would make.  Neo4J seemed like a good a choice as any, so I downloaded it and plugged away.  Luckily, I caught it right in the transition to a REST-based server which is a much better design for my needs.</p>
<p>The first thing I noticed, having read through all the documentation and their cheat sheet on <a title="Neo4J IMDB Example" href="http://wiki.neo4j.org/content/IMDB_Example" target="_blank">reproducing IMDB</a>, is that designing a graph database schema is a pretty natural thought process.  I literally grabbed a piece of paper and was planning to rewrite my whole data layer to just use a Neo4J! I mean, it has: transactions, embedded Lucene for full-text search and indexing, solves my use-cases, and a nifty back-end management tool.</p>
<p>Having some sanity though, I stopped myself before actually doing it and scaled it back just to dealing with the social graph.  I figured i&#8217;d give MongoDB a chance to do what I already wrote it to do &#8211; which is persist all the crap I gave it &#8211; and I added Neo4J to only contain the social graph information, i.e. user identifiers and their relationships.  Each user document in MongoDB kept the node ID of the Neo4J node &#8211; and each node in Neo4J kept the user ID of the user document in MongoDB. That way I could look up any user node in the graph and start any traversals as needed.  And when I found what I was looking for, I could look it up in MongoDB to get all the details. (Side-note: the built-in Lucene in Neo4J is also a great solution for many lookup/search use-cases but I personally didn&#8217;t have any use for it since I&#8217;m using Solr already).</p>
<p>Honestly, it was a painless process and works pretty damn nicely.  It&#8217;s also very fast and flexible now.  Do I want to know who your friends are? No problem.  Do I want to know your friends&#8217; friends&#8217; friends&#8217; friends are?  I can do that too by changing a function parameter.  And the results will come back pretty much immediately.</p>
<p>Overall I think i&#8217;ll be using Neo4J &#8211; and graph databases in general &#8211; for those tasks involving non-trivial relationships.  For everything?  Probably not&#8230;.but getting it to <a title="Neo4J Rest Paging" href="http://www.xydo.com/toolbar/23140229-neo4j_1_4_m05_-_autoindexing_rest_paging_cypher_aggregates" target="_blank">support paging</a> is a good start.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/70/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/70/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/70/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=70&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/08/18/graph-databases-ftw/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
		<item>
		<title>What have you developed in your spare time?</title>
		<link>https://n0tw0rthy.wordpress.com/2011/06/15/what-have-you-developed-in-your-spare-time/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/06/15/what-have-you-developed-in-your-spare-time/#comments</comments>
		<pubDate>Thu, 16 Jun 2011 06:15:58 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=57</guid>
		<description><![CDATA[Throughout the years, I&#8217;ve interviewed quite a few developers and I&#8217;ve recently been reflecting on what single question can give me the most information about the ability and passion someone has for programming. I&#8217;ve concluded that this one gives me the best ammo to work with: What have you developed in your spare time? I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=57&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Throughout the years, I&#8217;ve interviewed quite a few developers and I&#8217;ve recently been reflecting on what single question can give me the most information about the ability and passion someone has for programming.</p>
<p>I&#8217;ve concluded that this one gives me the best ammo to work with:</p>
<p><span class="Apple-style-span" style="font-weight:bold;">What have you developed in your spare time?</span></p>
<p>I love this question because it touches a few areas at once.  Spare time is a valuable resource which you usually dedicate to what you enjoy most.  Dedicating that to development is a huge indicator of where your passions lie. On the other hand, getting a &#8220;Huh?&#8221; or &#8220;In my SPARE time?&#8221; in return is probably a good indicator that this person isn&#8217;t what i&#8217;m looking for.</p>
<p>What they&#8217;ve been working on is also an interesting indicator.  Did they contribute to an open source project? Port a popular tool to a new language? Build some nifty tool to try out some new tech? Reading into the type of development they did and why can really give some insight into what motivates or challenges them.</p>
<p>It also touches on is their ability to stay up to date and be self-taught.  So much new tech and ideas are being made available and it&#8217;s hard to keep up.  It&#8217;s almost impossible to do so at your &#8220;day job&#8221;.</p>
<p>That&#8217;s why I like that question and use it as often as i can when interviewing candidates.</p>
<p>What is your favorite one?</p>
<p><span style="text-decoration:underline;">Update:</span></p>
<p>I very much appreciate all the reactions and opinions regarding this specific topic.  In no way does it try to pigeon hole people one way or the other and is my humble opinion on my personal experiences.  The main point I want to stress is that I like to know where someone&#8217;s passions lie. If someone says &#8220;After working at my job all day, why should I work more at home?&#8221;  I totally agree!  It shouldn&#8217;t be considered &#8220;work&#8221;.</p>
<p>It also can (or should) be an occasional thing.  I try to spend 2-3 hours a week on average working on some idea, or testing out some new technology, or just reading a good book.  That&#8217;s hardly overwhelming.</p>
<p>I&#8217;d also argue that over time it becomes more important.  When you build a deep body of knowledge and experience in one field, it becomes your prism to view new problems.  Expanding your horizon can create some interesting (and sometimes surprising) ideas for new projects, ideas to solve stubborn problem from the past, or just some personal enjoyment.</p>
<p>The point is to have an itch regarding programming and feel the need to scratch it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/57/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/57/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/57/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=57&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/06/15/what-have-you-developed-in-your-spare-time/feed/</wfw:commentRss>
		<slash:comments>57</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
		<item>
		<title>Scale using your users</title>
		<link>https://n0tw0rthy.wordpress.com/2011/06/08/scale-using-your-users/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/06/08/scale-using-your-users/#comments</comments>
		<pubDate>Thu, 09 Jun 2011 05:38:02 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=41</guid>
		<description><![CDATA[I&#8217;ll use an example scenario to show what i mean. As part of your site functionality, you allow users to create, update, search for, and view &#8220;thingies&#8221;.  This thingie has an address. When people look at your thingie (er, that doesn&#8217;t really sound right), you want to display a nice dynamic map of the address [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=41&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ll use an example scenario to show what i mean.</p>
<p>As part of your site functionality, you allow users to create, update, search for, and view &#8220;thingies&#8221;.  This thingie has an address.</p>
<p>When people look at your thingie (er, that doesn&#8217;t really sound right), you want to display a nice dynamic map of the address with a cute little red marker.  You don&#8217;t have the coordinates for that address and therefore want to do some <a title="Geocoding" href="http://en.wikipedia.org/wiki/Geocoding" target="_blank">geocoding</a>.</p>
<p>Having those coordinates would allow you to support all types of fancy location-based searches to tell if someone is near your thingie.  Even better, your cute little red marker would be in the right place.</p>
<p>So how do you go about doing this?  Well, some possible solutions could be:</p>
<p><span style="text-decoration:underline;">1) Send a geocode request when saving/updating your thingie</span></p>
<p>A good first start, but probably not the best.  This has a few disadvantages, but for the sake of simplicity, let&#8217;s say the main reason  is you don&#8217;t want users waiting for unnecessary synchronous steps to complete.  Factor in network uncertainly, timeouts, etc. and you have a nice set of disasters waiting as your site grows.</p>
<p>You also realize that these geocoding services have limits on daily usage!  Too many thingie&#8217;s a day will be great for you, but you&#8217;d be tied to the limitations on your geocoding daily allowance and throttling requirements.  What to do?</p>
<p>So you come up with:</p>
<p><span style="text-decoration:underline;">2) Create a queue to batch your geocoding requests</span></p>
<p>Better idea! When you create new thingies &#8211; and assuming you don&#8217;t have the addresses cached somewhere &#8211; you queue them in your uber geocoding async job.  It chugs away in the background sending nicely throttled requests and stops after reaching the daily limit.  Unfortunately, unless you want to pay lots of cash to up your daily limit, your queue will start getting longer and longer as it can&#8217;t keep up with new thingies.  Also, the geocoding might not even be done for thingies that your users are viewing right now.</p>
<p>Fortunately, this is a great scenario of how you can take advantage of your users to help you grow.  And you do it by leveraging client-side JavaScript.  Each user using your site is a potential resource which you can use to offload some of your work.  Help your users help you!</p>
<p>So why not have the users geocode for you?</p>
<p><span style="text-decoration:underline;">3) Have the first user who views your map geocode it for you</span></p>
<p>I personally like this solution best because it&#8217;s being lazy.  When you have to display your map and that thingie has no coordinates yet, have the user send out a geocoding request from their client machine and use the results to show the map.  More importantly, send another async request afterwards to your server to save that value for future users!  Now you both get what you want at the right time.</p>
<p>Now assuming the geocoding API you&#8217;re using allows anonymous requests (like Google),  you don&#8217;t have to worry about daily limits, throttling issues, and other headaches.</p>
<p><span style="text-decoration:underline;">The point of it all</span></p>
<p>Now this was all a hypothetical scenario to stress a point.  Lots of services today have an HTTP API accessible via JavaScript and this will probably grow and grow.  Align that with the increased horsepower of modern machines and improved browser JavaScript engines and you have an army of resources waiting to be tapped if you can figure out how to do so.  The great part is this resource scales linearly with demand.</p>
<p>The tricky part though is changing your frame of mind when writing features to consider this new option.  Why use server bandwidth and resources to do it when the client can do it just as well?</p>
<p>Have you had any scenarios like this?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/41/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/41/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/41/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=41&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/06/08/scale-using-your-users/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
		<item>
		<title>Queue like in Vegas</title>
		<link>https://n0tw0rthy.wordpress.com/2011/05/31/queue-like-in-vegas/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/05/31/queue-like-in-vegas/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 02:30:36 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=26</guid>
		<description><![CDATA[I just got back from Las Vegas.  From the second you land there, you can smell the alcohol in the air.  It&#8217;s also probably the only place i know where you can gamble while waiting in baggage claim&#8230;.and people do! At any rate, we gambled, we lost, we left.  Statistically, that&#8217;s about right so no [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=26&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I just got back from Las Vegas.  From the second you land there, you can smell the alcohol in the air.  It&#8217;s also probably the only place i know where you can gamble while waiting in baggage claim&#8230;.and people do!</p>
<p>At any rate, we gambled, we lost, we left.  Statistically, that&#8217;s about right so no hard feelings.</p>
<p>One thing that I did notice while there was how queues are serviced.  I&#8217;m not normally that observant, but it was pretty easy considering that:</p>
<p>a) I just finished a great book on the subject called &#8220;<a title="The Principles of Product Development Flow" href="http://www.amazon.com/gp/product/1935401009" target="_blank">The Principles of Product Development Flow</a>&#8221; (the book is much better than the title suggests).</p>
<p>b) You spend half your time in Las Vegas standing in lines.</p>
<p>One particular incident involved me standing in line at the MGM Grand Concierge to pick up some show tickets.  This was how the line looked:</p>
<div id="attachment_28" class="wp-caption aligncenter" style="width: 165px"><a href="http://n0tw0rthy.files.wordpress.com/2011/05/queue-per-server.png"><img class="size-full wp-image-28 " title="Queue Per Server" src="http://n0tw0rthy.files.wordpress.com/2011/05/queue-per-server.png?w=450" alt=""   /></a><p class="wp-caption-text">Queue Per Server</p></div>
<p style="text-align:left;">Each server / concierge (the dots) has its own queue of people.  It this a good solution?  Of course not!  This is the perfect situation that breeds line-choice-remorse.  It&#8217;s that well known phenomenon which occurs after choosing a line &#8211;  you soon realize the line next to you is faster while you&#8217;re stuck behind a guy that is buying tickets for twenty five people, a restaurant reservation, maps for all of Nevada, a limousine, some shoe string, an igloo, and a towel.  At least that is what it seemed like at the time.</p>
<p style="text-align:left;">In short, having a Queue Per Server doesn&#8217;t account for variation.  Assuming that each person has the same priority, they join the lines at random intervals, and each person takes a random amount of time to service, this is the perfect recipe for some queues to be blocked up for long periods of time while other queues might be empty.  It also doesn&#8217;t serve people in the order they joined.</p>
<p style="text-align:left;">Luckily, most of the other lines in Las Vegas were like this:</p>
<div id="attachment_32" class="wp-caption aligncenter" style="width: 164px"><a href="http://n0tw0rthy.files.wordpress.com/2011/05/multiple_servers.png"><img class="size-full wp-image-32" title="Single Queue with Multiple Servers" src="http://n0tw0rthy.files.wordpress.com/2011/05/multiple_servers.png?w=450" alt=""   /></a><p class="wp-caption-text">Single Queue, Multiple Servers</p></div>
<p>While these lines might look longer, they are actually more efficient.  These queues have one line which includes all the people in the order joined, and multiple servers each taking a person from the front of the queue.  Making the same assumptions as the previous example, this method is actually more resistant to variation.  If one person takes a much longer time, only one server will be blocked and the queue will continue to flow.  In addition, it&#8217;s better for your mental health.</p>
<p>The perfect example of this is the Taxi line at the airport.  The line was literally hundreds of people and if you didn&#8217;t know better you&#8217;d think it was going to take hours to get a taxi to your hotel.  In reality it took 10 minutes.  We were literally walking non-stop in the line.  They had a system where 15 taxis would drive in and predetermined spots and drive off with the soon-to-be poor vacationers.  Pure awesomeness.</p>
<p>These decisions happen in software development too, especially in multi-threaded environments and Message Queues.  I wonder where they got the idea from&#8230;.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=26&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/05/31/queue-like-in-vegas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>

		<media:content url="http://n0tw0rthy.files.wordpress.com/2011/05/queue-per-server.png" medium="image">
			<media:title type="html">Queue Per Server</media:title>
		</media:content>

		<media:content url="http://n0tw0rthy.files.wordpress.com/2011/05/multiple_servers.png" medium="image">
			<media:title type="html">Single Queue with Multiple Servers</media:title>
		</media:content>
	</item>
		<item>
		<title>ORM&#8217;s hidden cost</title>
		<link>https://n0tw0rthy.wordpress.com/2011/05/28/orms-hidden-cost/</link>
		<comments>https://n0tw0rthy.wordpress.com/2011/05/28/orms-hidden-cost/#comments</comments>
		<pubDate>Sat, 28 May 2011 17:43:12 +0000</pubDate>
		<dc:creator>matan</dc:creator>
				<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://n0tw0rthy.wordpress.com/?p=10</guid>
		<description><![CDATA[I think my first post will start with some venting so bear with me. ORM solutions have really made a huge impact on software development with relational databases.  It&#8217;s pretty much expected from any modern object oriented language to have a built-in ORM solution and/or multiple 3rd party implementations of one. You could even write [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=10&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I think my first post will start with some venting so bear with me.</p>
<p>ORM solutions have really made a huge impact on software development with relational databases.  It&#8217;s pretty much expected from any modern object oriented language to have a built-in ORM solution and/or multiple 3rd party implementations of one.</p>
<p>You could even write a pretty impressive list of benefits of ORMs like productivity, avoidance of vendor lock-in (except DB specific ORMs), and maintenance.  But in spite of all this, I do find that ORMs have a very real and prevalent hidden cost:</p>
<p><strong>ORMs set the bar too low for who gets to write data access code</strong></p>
<p>You might have seen this happen, or you may been that person once, but time and again i&#8217;ve seen how the lack of understanding of what&#8217;s happening &#8220;behind the scenes&#8221; cause very painful performance, stability, and design issues: 1-n problems, fetching too much data, ignoring batch updates, etc. to name just a few common ones.</p>
<p>ORMs take the discipline of fine-tuned and precise database interaction and takes a huge warm dump on it.</p>
<p>Now don&#8217;t be mistaken, the elite can and will use ORMs in the best possible way and in all the right places, but let&#8217;s be honest about the majority.  I&#8217;ve seen the blank stare with eyes glazed when I asked a developer why they wrote 3 nested loops to find a specific value of the child of the child of a mapped ORM entity instead of just writing a specific query for it. Or why they retrieved and iterated over all 5 million items to set the same value of of the same field instead of writing an update statement.</p>
<p>Somehow people assume that writing specific queries for specific cases when using an ORM is an admission of defeat when they can easily just traverse the object graph and call their setters and getters.  It all comes crashing down though when you have enough data.</p>
<p>In the end using ORMs properly requires even more knowledge and ability and it should be entrusted to those people who can get it right.</p>
<p>Those of you have passed this hurdle should congratulate yourselves. There aren&#8217;t many of you.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/n0tw0rthy.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/n0tw0rthy.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/n0tw0rthy.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/n0tw0rthy.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/n0tw0rthy.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/n0tw0rthy.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/n0tw0rthy.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/n0tw0rthy.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/n0tw0rthy.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/n0tw0rthy.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/n0tw0rthy.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/n0tw0rthy.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/n0tw0rthy.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/n0tw0rthy.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=n0tw0rthy.wordpress.com&amp;blog=22995727&amp;post=10&amp;subd=n0tw0rthy&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>https://n0tw0rthy.wordpress.com/2011/05/28/orms-hidden-cost/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
	
		<media:content url="https://secure.gravatar.com/avatar/a7e0aafcdc261db1ae047829869276a2?s=96&#38;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">matanamir</media:title>
		</media:content>
	</item>
	</channel>
</rss>
