<?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/"
	>

<channel>
	<title>Arin Sarkissian</title>
	<atom:link href="http://arin.me/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://arin.me/blog</link>
	<description>My Blog about Code, PHP, Music, Punk Rock, Guitars, Basses &#38; Other Random Stuff</description>
	<lastBuildDate>Wed, 01 Sep 2010 22:28:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Blekko&#8217;s Pretty Rad</title>
		<link>http://arin.me/blog/blekkos-pretty-rad</link>
		<comments>http://arin.me/blog/blekkos-pretty-rad#comments</comments>
		<pubDate>Wed, 01 Sep 2010 22:04:05 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Blekko]]></category>
		<category><![CDATA[Search]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=1071</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><iframe src="http://player.vimeo.com/video/14593120?title=0&amp;byline=0&amp;portrait=0" width="400" height="300" frameborder="0"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/blekkos-pretty-rad/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Let&#8217;s Build an Amp</title>
		<link>http://arin.me/blog/lets-build-an-amp</link>
		<comments>http://arin.me/blog/lets-build-an-amp#comments</comments>
		<pubDate>Tue, 08 Jun 2010 06:12:51 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Guitar & Bass]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[amp]]></category>
		<category><![CDATA[guitar]]></category>
		<category><![CDATA[JMP 2204]]></category>
		<category><![CDATA[Marshall]]></category>
		<category><![CDATA[Project]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=1052</guid>
		<description><![CDATA[My dad&#8217;s gonna build a guitar amp This is pretty cool. I&#8217;ve been playing guitars few a while now and have gotten pretty familiar with the ins &#8216;n outs of guitars; I have no problem taking &#8216;em apart, modifying them, putting them back together&#8230; and, I&#8217;ve even built a couple. However, through all these years [...]]]></description>
			<content:encoded><![CDATA[<p>My dad&#8217;s gonna build a guitar amp <img src='http://arin.me/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  </p>
<p>This is pretty cool. I&#8217;ve been playing guitars few a while now and have gotten pretty familiar with the ins &#8216;n outs of guitars; I have no problem taking &#8216;em apart, modifying them, putting them back together&#8230; and, <a href="/blog/built-a-guitar-project-telecaster">I&#8217;ve even built a couple</a>. However, through all these years I&#8217;ve remained blissfully ignorant to amplifier technology; I have no idea how they work, what the internal components do or anything like that&#8230; that&#8217;s my dad&#8217;s world.</p>
<p>My dad&#8217;s taken a petty decent interest in my gear. Whenever I get new stuff he&#8217;s always checking it out, has done dozens of electronics (pickups etc) mods for me &#038; has taught me how to solder and do some of this stuff myself.</p>
<p>A couple weeks ago I was playing a bit and wasn&#8217;t too happy with any of my amps (I have 4 at home). They all left something to be desired. I figured I&#8217;d look for something new and started doing some research, checked out prices and read a ton of reviews. After a while I was pretty frustrated, pinged my dad and said &#8220;hey, dude, you wanna build me an amp?&#8221;. He lit up.</p>
<p>As far as I&#8217;m concerned my dad&#8217;s an electronics genius. He&#8217;s worked on all sorts of electronics for 40+ years &#038; I&#8217;ve never heard of him not being able to mod or fix something that has wires. So, I&#8217;m pretty stoked.</p>
<p>Right after bringing up the idea my dad started flipping through schematics for various <a href="http://www.marshallamps.com/">Marshall amps</a>. A few days later he declared he needed a physical amp too. Due to their popularity we decided that we&#8217;d use a <a href="http://www.marshallamps.com/product.asp?productCode=JCM800">JCM800</a> as a reference. But, after reading up on some forums I decided to go with a late <a href="http://www.youtube.com/watch?v=b3xS-vKET1A">70&#8242;s JMP 2204</a> w/ master volume instead. A couple hours of hunting later I found a sweet &#8217;78 in pretty awesome condition &#038; bought it.</p>
<p>Here&#8217;s dad w/ his new toy:</p>
<div class="img"><img alt="Dad with his 1978 JMP 2204 w/ master volume" src="http://farm5.static.flickr.com/4025/4681331262_dd0bcaa7b9.jpg" /></div>
<p>Oh, the irony: I just bought my dad a Marshall for him to take apart and dissect&#8230; 15 years ago when I asked for 1/2 stack his reaction was &#8220;um, no!&#8221;. LoL</p>
<p>This should be pretty sweet. Dad&#8217;s been going off and telling me all sorts of stuff he&#8217;s <a href="http://www.amazon.com/History-Marshall-Illustrated-Story-Sound/dp/0793525098/ref=sr_1_1?ie=UTF8&#038;s=books&#038;qid=1275977499&#038;sr=1-1">learned about Marshalls</a>, expressed some discontent with some of their designs &#038; is flat out stoked to take on this challenge. He&#8217;s already been sketching out some ideas &#038; had the JMP opened up minutes after it arrived. LoL.</p>
<p>I&#8217;m sure we&#8217;ll have a working amp pretty soon. I&#8217;ve got a pretty good idea for where I want this project to go &#038; am positive dad can make it happen. It&#8217;s gonna be pretty rad.</p>
<p>Rock &#8216;n Roll</p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/lets-build-an-amp/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Worthless Commenting</title>
		<link>http://arin.me/blog/worthless-commenting</link>
		<comments>http://arin.me/blog/worthless-commenting#comments</comments>
		<pubDate>Thu, 21 Jan 2010 18:50:09 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rant]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=1030</guid>
		<description><![CDATA[Writing comments in your code is fine and dandy but sometimes its just a fucking waste of time. Here&#8217;s an example: So, yay &#8211; that chunk of code passes PHPCS (using the PEAR standard). All the parameters are documented, there&#8217;s a line of text explaining what the function does and the docblock even states the [...]]]></description>
			<content:encoded><![CDATA[<p>Writing comments in your code is fine and dandy but sometimes its just a fucking waste of time. Here&#8217;s an example:</p>
<div id="gist-283042" class="gist">
  
  
    
            

      <div class="gist-file">
        <div class="gist-data gist-syntax">
          
          
          
            <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span></div><div class='line' id='LC2'><span class="k">class</span> <span class="nc">UserDataAccessClass</span></div><div class='line' id='LC3'><span class="p">{</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="sd">/**</span></div><div class='line' id='LC5'><span class="sd">     * Get the number of followers a user has</span></div><div class='line' id='LC6'><span class="sd">     *</span></div><div class='line' id='LC7'><span class="sd">     * @param string $userID The user id</span></div><div class='line' id='LC8'><span class="sd">     *</span></div><div class='line' id='LC9'><span class="sd">     * @return int</span></div><div class='line' id='LC10'><span class="sd">     */</span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="k">function</span> <span class="nf">getNumFollowers</span><span class="p">(</span><span class="nv">$userID</span><span class="p">)</span></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">valueFromAServiceCallOrQueryEtc</span><span class="p">(</span><span class="nv">$userID</span><span class="p">)</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC15'><span class="p">}</span></div><div class='line' id='LC16'><span class="cp">?&gt;</span><span class="x"></span></div></pre></div>
          
        </div>

        <div class="gist-meta">
          <a href="http://gist.github.com/raw/283042/089f505529e12cc23b95cc77a921f78124c560fe/stupidComments.php" style="float:right;">view raw</a>
          <a href="http://gist.github.com/283042#file_stupid_comments.php" style="float:right;margin-right:10px;color:#666">stupidComments.php</a>
          <a href="http://gist.github.com/283042">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
    
  
</div>

<p>So, yay &#8211; that chunk of code passes <a href="http://pear.php.net/package/PHP_CodeSniffer/redirected">PHPCS</a> (using the PEAR standard). All the parameters are documented, there&#8217;s a line of text explaining what the function does and the docblock even states the return type&#8230; how cute!</p>
<p>But why? Why do I have to type all that crap? The function&#8217;s name is self documenting &#038; its sole parameter is obvious. The return type makes sense to me but the rest is bullshit. God forbid your function takes multiple parameters; then you&#8217;d have to line up the <code>@param</code>&#8216;s types and descriptions &#8217;cause PHP people have a strange hardon for lining shit up.</p>
<p>The truth is the only reason I do all that stuff is cuz we run <a href="http://pear.php.net/package/PHP_CodeSniffer/redirected">PHPCS</a> on our code at work and I don&#8217;t wanna be &#8220;that guy&#8221;. If it wasn&#8217;t a &#8220;standrad&#8221; at work there&#8217;s no way in hell id ever bother. </p>
<p>I&#8217;d much have the documentation go like this instead:</p>
<div id="gist-283048" class="gist">
  
  
    
            

      <div class="gist-file">
        <div class="gist-data gist-syntax">
          
          
          
            <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span></div><div class='line' id='LC2'><span class="k">class</span> <span class="nc">UserDataAccessClass</span></div><div class='line' id='LC3'><span class="p">{</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="sd">/**</span></div><div class='line' id='LC5'><span class="sd">     * @return int</span></div><div class='line' id='LC6'><span class="sd">     */</span></div><div class='line' id='LC7'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">public</span> <span class="k">function</span> <span class="nf">getNumFollowers</span><span class="p">(</span><span class="nx">string</span> <span class="nv">$userID</span><span class="p">)</span></div><div class='line' id='LC8'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">{</span></div><div class='line' id='LC9'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">return</span> <span class="nx">valueFromAServiceCallOrQueryEtc</span><span class="p">(</span><span class="nv">$userID</span><span class="p">)</span></div><div class='line' id='LC10'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="p">}</span></div><div class='line' id='LC11'><span class="p">}</span></div><div class='line' id='LC12'><span class="cp">?&gt;</span><span class="x"></span></div></pre></div>
          
        </div>

        <div class="gist-meta">
          <a href="http://gist.github.com/raw/283048/501e7979bfa3da43d3099fd43307cd615df4fa40/stupidPHPCS2.php" style="float:right;">view raw</a>
          <a href="http://gist.github.com/283048#file_stupid_phpcs2.php" style="float:right;margin-right:10px;color:#666">stupidPHPCS2.php</a>
          <a href="http://gist.github.com/283048">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
    
  
</div>

<p>&#8230;And to be 100% honest the only reason I&#8217;d include the <code>@return</code> is &#8217;cause I&#8217;m an Eclipse &#038; it helps PDT&#8217;s static analysis (aka autocomplete gets more better).</p>
<p><!-- 035e8067c6fb4f97859ca75b0513d7b8 --></p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/worthless-commenting/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Brian  Setzer is a Pimp</title>
		<link>http://arin.me/blog/brian-setzer-is-a-pimp</link>
		<comments>http://arin.me/blog/brian-setzer-is-a-pimp#comments</comments>
		<pubDate>Mon, 21 Dec 2009 22:20:48 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Guitar & Bass]]></category>
		<category><![CDATA[Music]]></category>
		<category><![CDATA[Brian Setzer]]></category>
		<category><![CDATA[Gretsch]]></category>
		<category><![CDATA[Sleepwalk]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=1011</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div class="video"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/ZZuHREUIVz8&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/ZZuHREUIVz8&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="344"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/brian-setzer-is-a-pimp/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Joe Bonamassa Shows Off a Few Guitars</title>
		<link>http://arin.me/blog/joe-bonamassa-shows-off-a-few-guitars</link>
		<comments>http://arin.me/blog/joe-bonamassa-shows-off-a-few-guitars#comments</comments>
		<pubDate>Sat, 12 Dec 2009 09:19:07 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Guitar & Bass]]></category>
		<category><![CDATA[Gibson]]></category>
		<category><![CDATA[Joe Bonamassa]]></category>
		<category><![CDATA[Music Man]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=1002</guid>
		<description><![CDATA[He shows off a bunch of Gibsons then busts out a few of his Music Man guitars about 2 minutes in. He had great things to say about his MM axes: They really are the nicest stuff - Joe Bonamassa]]></description>
			<content:encoded><![CDATA[<div class="video"><object width="560" height="340"><param name="movie" value="http://www.youtube.com/v/Kco8BEcClyQ&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/Kco8BEcClyQ&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="560" height="340"></embed></object></div>
<p>He shows off a bunch of Gibsons then busts out a few of his Music Man guitars about 2 minutes in. He had great things to say about his MM axes:</p>
<blockquote><p>They really are the nicest stuff</p>
<div>- Joe Bonamassa</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/joe-bonamassa-shows-off-a-few-guitars/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Indexing Nodes in Neo4J</title>
		<link>http://arin.me/blog/indexing-nodes-in-neo4j</link>
		<comments>http://arin.me/blog/indexing-nodes-in-neo4j#comments</comments>
		<pubDate>Fri, 11 Dec 2009 21:36:29 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Code]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Neo4J]]></category>
		<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=986</guid>
		<description><![CDATA[I&#8217;ve been playing with #neo4j quite a bit lately. It&#8217;s a great &#038; fun project. It&#8217;s a graph database that mitigates all the bullshit you have to deal with when trying to, ya know, do graph stuff. Example: find all User Nodes who&#8217;s gender property is set to female, have an outgoing likes relationship to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been playing with <a href="http://neo4j.org/">#neo4j</a> quite a bit lately. It&#8217;s a great &#038; fun project. It&#8217;s a graph database that mitigates all the bullshit you have to deal with when trying to, ya know, do graph stuff. Example: find all <code>User Nodes</code> who&#8217;s <em>gender</em> property is set to <em>female</em>, have an outgoing <em>likes</em> relationship to the <code>Node</code> <em>punk music</em> and are less than 3 degrees of separation from <code>Node #4</code>. Stuff like that. Its super good at doing this.</p>
<p>But here&#8217;s the deal&#8230; each <code>Node</code> is gettable via ID which is nice &#8211; but the ID&#8217;s are Neo4J&#8217;s internal ID; you don&#8217;t get to set &#8216;em when you create a <code>Node</code>. So, what if I want to get a <code>Node</code> who&#8217;s <em>username</em> property is <em>phatduckk</em> &#038; start the traversal from there? The problem lies in the fact that you don&#8217;t know that <em>phatduckk</em> is <code>Node #4</code> so you need a simple &#038; efficient way to do that lookup &#038; grab that <code>Node</code>.</p>
<p>If your dataset is small, I guess, you can just use a <code>Map</code> and store the mapping yourself but that solution will fall over pretty quickly. You could also toss info into MySQL but why would you do that? It just doesn&#8217;t feel right to use 2 different stores. So, checking out some of the docs you&#8217;ll see that Neo4J&#8217;s got some indexing capabilities.</p>
<p>Initially I tried out the <a href="http://gist.github.com/253569"><code>SingleValueIndex</code></a> which <a href="http://gist.github.com/253569">fell over</a> in a multi-threaded scenario. So, I hit up the list and was advised to check out the <a href="http://components.neo4j.org/index-util/apidocs/index.html"><code>LuceneIndexService</code></a>. This worked like a charm. Even with multiple threads constantly indexing the same <code>Node</code>.</p>
<p>Here&#8217;s a little test app. It&#8217;s a brute force, little hack that creates a single <code>Node</code> and indexes it by its <em>username</em> property 100,000 times using 10 threads. This is a pretty unrealistic situation but I really wanted to make sure it behaved well in a multi-threaded scenario and didn&#8217;t frustrate me like the <code>SingleValueIndex</code> did.</p>
<div id="gist-254435" class="gist">
  
  
    
            

      <div class="gist-file">
        <div class="gist-data gist-syntax">
          
          
          
            <div class="highlight"><pre><div class='line' id='LC1'><span class="kn">package</span> <span class="n">com</span><span class="o">.</span><span class="na">digg</span><span class="o">.</span><span class="na">tmp</span><span class="o">;</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="kn">import</span> <span class="nn">org.neo4j.api.core.*</span><span class="o">;</span></div><div class='line' id='LC4'><span class="kn">import</span> <span class="nn">org.neo4j.util.index.IndexService</span><span class="o">;</span></div><div class='line' id='LC5'><span class="kn">import</span> <span class="nn">org.neo4j.util.index.LuceneIndexService</span><span class="o">;</span></div><div class='line' id='LC6'><br/></div><div class='line' id='LC7'><span class="kn">import</span> <span class="nn">java.util.concurrent.ExecutorService</span><span class="o">;</span></div><div class='line' id='LC8'><span class="kn">import</span> <span class="nn">java.util.concurrent.Executors</span><span class="o">;</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'><span class="kd">public</span> <span class="kd">class</span> <span class="nc">LuceneIndex</span> <span class="o">{</span></div><div class='line' id='LC11'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">String</span> <span class="n">USERNAME_INDEX</span> <span class="o">=</span> <span class="s">"usernameIndex"</span><span class="o">;</span></div><div class='line' id='LC12'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="kt">int</span> <span class="n">NUM_THREADS</span> <span class="o">=</span> <span class="mi">10</span><span class="o">;</span></div><div class='line' id='LC13'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="kt">int</span> <span class="n">NUM_LINES</span> <span class="o">=</span> <span class="mi">1000000</span><span class="o">;</span></div><div class='line' id='LC14'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">private</span> <span class="kd">static</span> <span class="kd">final</span> <span class="n">String</span> <span class="n">USERNAME</span> <span class="o">=</span> <span class="s">"phatduckk"</span><span class="o">;</span></div><div class='line' id='LC15'><br/></div><div class='line' id='LC16'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">public</span> <span class="kd">static</span> <span class="kt">void</span> <span class="nf">main</span><span class="o">(</span><span class="n">String</span><span class="o">[]</span> <span class="n">args</span><span class="o">)</span> <span class="o">{</span></div><div class='line' id='LC17'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// always use a new store</span></div><div class='line' id='LC18'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">NeoService</span> <span class="n">neo</span> <span class="o">=</span> <span class="k">new</span> <span class="n">EmbeddedNeo</span><span class="o">(</span><span class="s">"test-"</span> <span class="o">+</span> <span class="n">System</span><span class="o">.</span><span class="na">currentTimeMillis</span><span class="o">());</span></div><div class='line' id='LC19'><br/></div><div class='line' id='LC20'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// now create the node we want indexed:</span></div><div class='line' id='LC21'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Transaction</span> <span class="n">txUser</span> <span class="o">=</span> <span class="n">neo</span><span class="o">.</span><span class="na">beginTx</span><span class="o">();</span></div><div class='line' id='LC22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Node</span> <span class="n">userNode</span> <span class="o">=</span> <span class="n">neo</span><span class="o">.</span><span class="na">createNode</span><span class="o">();</span></div><div class='line' id='LC23'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">userNode</span><span class="o">.</span><span class="na">setProperty</span><span class="o">(</span><span class="n">USERNAME_INDEX</span><span class="o">,</span> <span class="n">USERNAME</span><span class="o">);</span></div><div class='line' id='LC24'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">txUser</span><span class="o">.</span><span class="na">success</span><span class="o">();</span></div><div class='line' id='LC25'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">txUser</span><span class="o">.</span><span class="na">finish</span><span class="o">();</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// now create the index &amp; setup a pool</span></div><div class='line' id='LC28'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IndexService</span> <span class="n">idxServ</span> <span class="o">=</span> <span class="k">new</span> <span class="n">LuceneIndexService</span><span class="o">(</span><span class="n">neo</span><span class="o">);</span></div><div class='line' id='LC29'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">final</span> <span class="n">ExecutorService</span> <span class="n">executorService</span> <span class="o">=</span> <span class="n">Executors</span><span class="o">.</span><span class="na">newFixedThreadPool</span><span class="o">(</span><span class="n">NUM_THREADS</span><span class="o">);</span></div><div class='line' id='LC30'><br/></div><div class='line' id='LC31'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// now let&#39;s index that same node NUM_LINES times</span></div><div class='line' id='LC32'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// the reason we&#39;re indexing the same node is cuz i&#39;m checking for thread safety during indexing issues</span></div><div class='line' id='LC33'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// otherwise you&#39;d normally be indexing new nodes who&#39;s data you got from some external source</span></div><div class='line' id='LC34'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">for</span> <span class="o">(</span><span class="kt">int</span> <span class="n">i</span> <span class="o">=</span> <span class="mi">0</span><span class="o">;</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">NUM_LINES</span><span class="o">;</span> <span class="n">i</span><span class="o">++)</span> <span class="o">{</span></div><div class='line' id='LC35'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"line: "</span> <span class="o">+</span> <span class="n">i</span><span class="o">);</span></div><div class='line' id='LC36'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IndexRunner</span> <span class="n">command</span> <span class="o">=</span> <span class="k">new</span> <span class="n">IndexRunner</span><span class="o">(</span><span class="n">userNode</span><span class="o">,</span> <span class="n">neo</span><span class="o">,</span> <span class="n">idxServ</span><span class="o">);</span></div><div class='line' id='LC37'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">executorService</span><span class="o">.</span><span class="na">execute</span><span class="o">(</span><span class="n">command</span><span class="o">);</span></div><div class='line' id='LC38'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">}</span></div><div class='line' id='LC39'><br/></div><div class='line' id='LC40'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// should do a clean neo.shutdown() at some point ;-)</span></div><div class='line' id='LC41'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">}</span></div><div class='line' id='LC42'><br/></div><div class='line' id='LC43'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">static</span> <span class="kd">class</span> <span class="nc">IndexRunner</span> <span class="kd">implements</span> <span class="n">Runnable</span> <span class="o">{</span></div><div class='line' id='LC44'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">NeoService</span> <span class="n">neo</span><span class="o">;</span></div><div class='line' id='LC45'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IndexService</span> <span class="n">idxServ</span><span class="o">;</span></div><div class='line' id='LC46'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Node</span> <span class="n">userNode</span><span class="o">;</span></div><div class='line' id='LC47'><br/></div><div class='line' id='LC48'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">IndexRunner</span><span class="o">(</span><span class="n">Node</span> <span class="n">userNode</span><span class="o">,</span> <span class="n">NeoService</span> <span class="n">neo</span><span class="o">,</span> <span class="n">IndexService</span> <span class="n">idxServ</span><span class="o">)</span> <span class="o">{</span></div><div class='line' id='LC49'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="o">.</span><span class="na">userNode</span> <span class="o">=</span> <span class="n">userNode</span><span class="o">;</span></div><div class='line' id='LC50'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="o">.</span><span class="na">neo</span> <span class="o">=</span> <span class="n">neo</span><span class="o">;</span></div><div class='line' id='LC51'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">this</span><span class="o">.</span><span class="na">idxServ</span> <span class="o">=</span> <span class="n">idxServ</span><span class="o">;</span></div><div class='line' id='LC52'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">}</span></div><div class='line' id='LC53'><br/></div><div class='line' id='LC54'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="kd">public</span> <span class="kt">void</span> <span class="nf">run</span><span class="o">()</span> <span class="o">{</span></div><div class='line' id='LC55'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Transaction</span> <span class="n">nodetx</span> <span class="o">=</span> <span class="n">neo</span><span class="o">.</span><span class="na">beginTx</span><span class="o">();</span></div><div class='line' id='LC56'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">Node</span> <span class="n">nodeFromIndex</span> <span class="o">=</span> <span class="n">idxServ</span><span class="o">.</span><span class="na">getSingleNode</span><span class="o">(</span><span class="n">USERNAME_INDEX</span><span class="o">,</span> <span class="n">USERNAME</span><span class="o">);</span></div><div class='line' id='LC57'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC58'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">if</span> <span class="o">(</span><span class="n">nodeFromIndex</span> <span class="o">!=</span> <span class="kc">null</span><span class="o">)</span> <span class="o">{</span></div><div class='line' id='LC59'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">System</span><span class="o">.</span><span class="na">out</span><span class="o">.</span><span class="na">println</span><span class="o">(</span><span class="s">"found "</span> <span class="o">+</span> <span class="n">USERNAME</span> <span class="o">+</span> <span class="s">" in the "</span> <span class="o">+</span> <span class="n">USERNAME_INDEX</span></div><div class='line' id='LC60'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">+</span> <span class="s">" index. Node ID is: "</span> <span class="o">+</span> <span class="n">nodeFromIndex</span><span class="o">.</span><span class="na">getId</span><span class="o">());</span></div><div class='line' id='LC61'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">}</span> <span class="k">else</span> <span class="o">{</span></div><div class='line' id='LC62'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">idxServ</span><span class="o">.</span><span class="na">index</span><span class="o">(</span><span class="n">userNode</span><span class="o">,</span> <span class="n">USERNAME_INDEX</span><span class="o">,</span> <span class="n">USERNAME</span><span class="o">);</span></div><div class='line' id='LC63'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">}</span></div><div class='line' id='LC64'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div class='line' id='LC65'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">nodetx</span><span class="o">.</span><span class="na">success</span><span class="o">();</span></div><div class='line' id='LC66'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="n">nodetx</span><span class="o">.</span><span class="na">finish</span><span class="o">();</span></div><div class='line' id='LC67'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">}</span></div><div class='line' id='LC68'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="o">}</span></div><div class='line' id='LC69'><span class="o">}</span></div></pre></div>
          
        </div>

        <div class="gist-meta">
          <a href="http://gist.github.com/raw/254435/913da7ecb1094e016b33848530c7729e57da5118/LuceneIndex.java" style="float:right;">view raw</a>
          <a href="http://gist.github.com/254435#file_lucene_index.java" style="float:right;margin-right:10px;color:#666">LuceneIndex.java</a>
          <a href="http://gist.github.com/254435">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
    
  
</div>

<p>Although this is an off the wall example it can also serve as a simple example of how to index a <code>Node</code>. Anywho &#8211; hope this helps out a few folks that ran into the same needs/problems/scenarios I did. In hindsight it&#8217;s all pretty simple &#038; straightforward  &#8211; I just went down the wrong path with the <code>SingleValueIndex</code>&#8230; when browsing <a href="http://components.neo4j.org/index-util/">the docs</a> it sounded like the right tool for the job but, from what I can tell, you should avoid it and use the <code>LuceneService</code> instead.</p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/indexing-nodes-in-neo4j/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick &#8216;n Dirty App Store API Search</title>
		<link>http://arin.me/blog/quick-n-dirty-app-store-api-search</link>
		<comments>http://arin.me/blog/quick-n-dirty-app-store-api-search#comments</comments>
		<pubDate>Wed, 09 Dec 2009 07:09:52 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[App Store]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=976</guid>
		<description><![CDATA[More info here.]]></description>
			<content:encoded><![CDATA[<div id="gist-252317" class="gist">
  
  
    
            

      <div class="gist-file">
        <div class="gist-data gist-syntax">
          
          
          
            <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span></div><div class='line' id='LC2'><br/></div><div class='line' id='LC3'><span class="k">if</span> <span class="p">(</span><span class="o">!</span> <span class="nb">isset</span><span class="p">(</span><span class="nv">$argv</span><span class="p">[</span><span class="m">1</span><span class="p">]))</span> <span class="p">{</span></div><div class='line' id='LC4'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">echo</span> <span class="s2">"enter a search term:</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span></div><div class='line' id='LC5'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">echo</span> <span class="s1">&#39;php &#39;</span> <span class="o">.</span> <span class="k">__FILE__</span> <span class="o">.</span> <span class="s2">" &lt;search_term&gt;</span><span class="se">\n</span><span class="s2">"</span><span class="p">;</span></div><div class='line' id='LC6'>&nbsp;&nbsp;&nbsp;&nbsp;<span class="k">exit</span><span class="p">;</span></div><div class='line' id='LC7'><span class="p">}</span></div><div class='line' id='LC8'><br/></div><div class='line' id='LC9'><span class="nv">$term</span> <span class="o">=</span> <span class="nb">urlencode</span><span class="p">(</span><span class="nv">$argv</span><span class="p">[</span><span class="m">1</span><span class="p">]);</span></div><div class='line' id='LC10'><span class="nv">$url</span>  <span class="o">=</span> <span class="s2">"http://ax.phobos.apple.com.edgesuite.net/WebObjects/MZStoreServices.woa/wa/wsSearch?limit=10&amp;entity=software&amp;term=</span><span class="si">$term</span><span class="s2">"</span><span class="p">;</span></div><div class='line' id='LC11'><span class="nv">$json</span> <span class="o">=</span> <span class="nb">file_get_contents</span><span class="p">(</span><span class="nv">$url</span><span class="p">);</span></div><div class='line' id='LC12'><br/></div><div class='line' id='LC13'><span class="nb">print_r</span><span class="p">(</span><span class="nx">json_decode</span><span class="p">(</span><span class="nv">$json</span><span class="p">,</span> <span class="k">true</span><span class="p">));</span></div><div class='line' id='LC14'><br/></div><div class='line' id='LC15'><span class="cp">?&gt;</span><span class="x"></span></div></pre></div>
          
        </div>

        <div class="gist-meta">
          <a href="http://gist.github.com/raw/252317/bbc623bdeaf8a792ee7c01504916c191602b3885/appsearch-example.php" style="float:right;">view raw</a>
          <a href="http://gist.github.com/252317#file_appsearch_example.php" style="float:right;margin-right:10px;color:#666">appsearch-example.php</a>
          <a href="http://gist.github.com/252317">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
    
  
</div>

<p>More info <a href="http://www.apple.com/itunesaffiliates/API/AffiliatesSearch2.1.pdf">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/quick-n-dirty-app-store-api-search/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Embed a Gist in Your WordPress Blog</title>
		<link>http://arin.me/blog/embed-a-gist-in-your-wordpress-blog</link>
		<comments>http://arin.me/blog/embed-a-gist-in-your-wordpress-blog#comments</comments>
		<pubDate>Mon, 07 Dec 2009 09:10:01 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Geek]]></category>
		<category><![CDATA[Gist]]></category>
		<category><![CDATA[Gistson]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=958</guid>
		<description><![CDATA[I stumbled upon Paul William&#8217;s plugin for embedding a Gist into a WordPress blog. Its a quick &#8216;n clean plugin but it relies on a JS &#60;script&#62; tag to render the Gist&#8217;s content&#8230; so, I made a quick tweak to get the plugin to actually put the Gist&#8217;s content into your HTML source. There may [...]]]></description>
			<content:encoded><![CDATA[<p>I stumbled upon <a href="http://www.entropytheblog.com/blog/2008/12/wordpress-github-gist-shortcode-plugin/">Paul William&#8217;s</a> plugin for embedding a <a href="http://gist.github.com">Gist</a> into a WordPress blog.</p>
<p>Its a quick &#8216;n clean plugin but it relies on a JS &lt;script&gt; tag to render the Gist&#8217;s content&#8230; so, I made a quick tweak to get the plugin to actually put the Gist&#8217;s content into your HTML source. There may already be something similar but, eh, it was just a quick hackjob.</p>
<p>The plugin&#8217;s code and instructions for installation &amp; usage are in the Gist below.</p>
<div id="gist-250722" class="gist">
  
  
    
            

      <div class="gist-file">
        <div class="gist-data gist-syntax">
          
          
          
            <div class="highlight"><pre><div class='line' id='LC1'><span class="cp">&lt;?php</span></div><div class='line' id='LC2'><span class="cm">/*</span></div><div class='line' id='LC3'><span class="cm">Plugin Name: Gistson - Embedded Gist WP Plugin</span></div><div class='line' id='LC4'><span class="cm">Plugin URI: http://arin.me/blog/tag/gistson</span></div><div class='line' id='LC5'><span class="cm">Description: Use a shortcode [gist id="12345"] to embed A Gist from http://gist.github.com into your blog</span></div><div class='line' id='LC6'><span class="cm">Version: 0.1</span></div><div class='line' id='LC7'><span class="cm">Author: Arin Sarkissian</span></div><div class='line' id='LC8'><span class="cm">Author URI: http://arin.me</span></div><div class='line' id='LC9'><br/></div><div class='line' id='LC10'><span class="cm">Copyright 2009 Arin Sarkissian</span></div><div class='line' id='LC11'><br/></div><div class='line' id='LC12'><span class="cm">This program is free software; you can redistribute it and/or modify</span></div><div class='line' id='LC13'><span class="cm">it under the terms of the GNU General Public License as published by</span></div><div class='line' id='LC14'><span class="cm">the Free Software Foundation; either version 2 of the License, or</span></div><div class='line' id='LC15'><span class="cm">(at your option) any later version.</span></div><div class='line' id='LC16'><br/></div><div class='line' id='LC17'><span class="cm">This program is distributed in the hope that it will be useful,</span></div><div class='line' id='LC18'><span class="cm">but WITHOUT ANY WARRANTY; without even the implied warranty of</span></div><div class='line' id='LC19'><span class="cm">MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span></div><div class='line' id='LC20'><span class="cm">GNU General Public License for more details.</span></div><div class='line' id='LC21'><br/></div><div class='line' id='LC22'><span class="cm">You should have received a copy of the GNU General Public License</span></div><div class='line' id='LC23'><span class="cm">along with this program; if not, write to the Free Software</span></div><div class='line' id='LC24'><span class="cm">Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA</span></div><div class='line' id='LC25'><span class="cm">*/</span></div><div class='line' id='LC26'><br/></div><div class='line' id='LC27'><span class="cm">/*</span></div><div class='line' id='LC28'><span class="cm">CREDIT:</span></div><div class='line' id='LC29'><span class="cm">    Heavily based on Paul William&#39;s plugin:</span></div><div class='line' id='LC30'><span class="cm">        http://www.entropytheblog.com/blog/    </span></div><div class='line' id='LC31'><span class="cm">        http://www.entropytheblog.com/blog/2008/12/wordpress-github-gist-shortcode-plugin/</span></div><div class='line' id='LC32'><span class="cm">        </span></div><div class='line' id='LC33'><span class="cm">    Main difference is that this version doesn&#39;t do a JS, &lt;script&gt;, embed... the code from your gist is</span></div><div class='line' id='LC34'><span class="cm">    actually in the HTML source.</span></div><div class='line' id='LC35'><br/></div><div class='line' id='LC36'><span class="cm">INSTALL:</span></div><div class='line' id='LC37'><span class="cm">    Toss the gistson.php file into your blogs wp-content/plugins folder. Login to WP and enable the plugin.</span></div><div class='line' id='LC38'><br/></div><div class='line' id='LC39'><span class="cm">USE:</span></div><div class='line' id='LC40'><span class="cm">    Put this &lt;LINK&gt; tag in &lt;HEAD&gt; of header.php</span></div><div class='line' id='LC41'><span class="cm">        &lt;link rel="stylesheet" href="http://gist.github.com/stylesheets/gist/embed.css"/&gt;</span></div><div class='line' id='LC42'><span class="cm">    </span></div><div class='line' id='LC43'><span class="cm">    When you wanna embed a gist just type in:</span></div><div class='line' id='LC44'><span class="cm">        [gist id="gist-id-from-gist.github.com-here"]        </span></div><div class='line' id='LC45'><span class="cm">        example:</span></div><div class='line' id='LC46'><span class="cm">        [gist id="250709"]</span></div><div class='line' id='LC47'><span class="cm">        </span></div><div class='line' id='LC48'><span class="cm">    You can exclude the attribution by doing this:        </span></div><div class='line' id='LC49'><span class="cm">        [gist id="250709" nometa="true"]    </span></div><div class='line' id='LC50'><span class="cm">        </span></div><div class='line' id='LC51'><span class="cm">        This is useful for when you have multiple gists. But for big chunks of code etc</span></div><div class='line' id='LC52'><span class="cm">        I&#39;d encourge you to keep the attribution cuz those guys have a business to run</span></div><div class='line' id='LC53'><span class="cm">*/</span>    </div><div class='line' id='LC54'><br/></div><div class='line' id='LC55'><span class="k">function</span> <span class="nf">gist_shortcode_func</span><span class="p">(</span><span class="nv">$atts</span><span class="p">,</span> <span class="nv">$content</span> <span class="o">=</span> <span class="k">null</span><span class="p">)</span> <span class="p">{</span></div><div class='line' id='LC56'>	<span class="nv">$url</span>   <span class="o">=</span> <span class="s1">&#39;http://gist.github.com/&#39;</span> <span class="o">.</span> <span class="nb">trim</span><span class="p">(</span><span class="nv">$atts</span><span class="p">[</span><span class="s1">&#39;id&#39;</span><span class="p">])</span> <span class="o">.</span> <span class="s1">&#39;.json&#39;</span><span class="p">;</span></div><div class='line' id='LC57'>	<span class="nv">$json</span>  <span class="o">=</span> <span class="nb">file_get_contents</span><span class="p">(</span><span class="nv">$url</span><span class="p">);</span></div><div class='line' id='LC58'>	<span class="nv">$assoc</span> <span class="o">=</span> <span class="nx">json_decode</span><span class="p">(</span><span class="nv">$json</span><span class="p">,</span> <span class="k">true</span><span class="p">);</span></div><div class='line' id='LC59'><br/></div><div class='line' id='LC60'>	<span class="k">if</span> <span class="p">(</span><span class="nb">isset</span><span class="p">(</span><span class="nv">$atts</span><span class="p">[</span><span class="s1">&#39;nometa&#39;</span><span class="p">]))</span> <span class="p">{</span></div><div class='line' id='LC61'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="c1">// you&#39;ll end up with 2 1px borders at the bottom =(</span></div><div class='line' id='LC62'>	   <span class="nv">$assoc</span><span class="p">[</span><span class="s1">&#39;div&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">preg_replace</span><span class="p">(</span><span class="s1">&#39;/&lt;div class="gist\-meta"&gt;.*?(&lt;\/div&gt;)/is&#39;</span><span class="p">,</span> <span class="s1">&#39;&#39;</span><span class="p">,</span> <span class="nv">$assoc</span><span class="p">[</span><span class="s1">&#39;div&#39;</span><span class="p">]);</span></div><div class='line' id='LC63'>	<span class="p">}</span></div><div class='line' id='LC64'><br/></div><div class='line' id='LC65'>	<span class="k">return</span> <span class="nv">$assoc</span><span class="p">[</span><span class="s1">&#39;div&#39;</span><span class="p">];</span></div><div class='line' id='LC66'><br/></div><div class='line' id='LC67'><span class="p">}</span></div><div class='line' id='LC68'><span class="nx">add_shortcode</span><span class="p">(</span><span class="s1">&#39;gist&#39;</span><span class="p">,</span> <span class="s1">&#39;gist_shortcode_func&#39;</span><span class="p">);</span></div><div class='line' id='LC69'><br/></div><div class='line' id='LC70'><span class="cp">?&gt;</span><span class="x"></span></div></pre></div>
          
        </div>

        <div class="gist-meta">
          <a href="http://gist.github.com/raw/250722/e1579fb44144def9879b0c0ab086c65a7162e20c/Gistson.php" style="float:right;">view raw</a>
          <a href="http://gist.github.com/250722#file_gistson.php" style="float:right;margin-right:10px;color:#666">Gistson.php</a>
          <a href="http://gist.github.com/250722">This Gist</a> brought to you by <a href="http://github.com">GitHub</a>.
        </div>
      </div>
    
  
</div>

<p>Oh ya &#8211; I named it Gistson &#8217;cause it grabs the Gist&#8217;s data via an HTTP GET to a JSON doc. Ya, I know, not too creative.</p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/embed-a-gist-in-your-wordpress-blog/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>I Want A More Better A3</title>
		<link>http://arin.me/blog/i-want-a-more-better-a3</link>
		<comments>http://arin.me/blog/i-want-a-more-better-a3#comments</comments>
		<pubDate>Mon, 07 Dec 2009 08:09:47 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Audi]]></category>
		<category><![CDATA[Audi A3]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=944</guid>
		<description><![CDATA[So, I&#8217;ve had my current A3 for about 2 years now and I love it but&#8230; There&#8217;s a lot to like about the car but I settled when I bought. I had an A4 Wagon before that and dug it but never really made peace with the fact that I was driving around in a [...]]]></description>
			<content:encoded><![CDATA[<div class="image"><img width="650" src="http://farm3.static.flickr.com/2787/4165826568_1513daa4da_o.jpg" alt="" /></div>
<p>So, I&#8217;ve had my current <a href="http://www.audiusa.com/us/brand/en/models/a3.html">A3</a> for about 2 years now and I love it but&#8230;</p>
<p>There&#8217;s a lot to like about the car but I settled when I bought. I had an A4 Wagon before that and dug it but never really made peace with the fact that I was driving around in a station wagon. So, one day, I randomly popped into the dealership and traded it in for the A3.</p>
<p>I was looking for something smaller and a bit less expensive so I didn&#8217;t pop for some features. One feature I was stoked on was the iPod integration &#038; did get that&#8230; unfortunately I didn&#8217;t bother trying it before I signed all the paperwork and it turns out it sucked.</p>
<p>Anyways &#8211; over the last couple years I&#8217;ve been mostly happy with the A3 but really wished I had the nav (better iPod integration), bigger wheels, <a href="http://en.wikipedia.org/wiki/Audi_Quattro">Quatro</a> &#038; a few other niceties that, at the time, I was convinced I didn&#8217;t want/need.</p>
<p>Well, I&#8217;m pretty close to deciding that I kinda want it all at this point. I don&#8217;t want a different car &#8211; just a &#8220;better&#8221; version of the one I already have. So, today I almost got the car above; things didn&#8217;t work at (dealer was a dick) so I didn&#8217;t get it. I&#8217;m glad I didn&#8217;t though&#8230; for now. That one had everything I wanted except the nav/ipod kit. Turns out there&#8217;s none in America w/ the config I want and ordering&#8217;s my only option.</p>
<p>I&#8217;m gonna think on this for a bit and see what happens. If you know me (even remotely) then you know the odds are pretty high that I&#8217;ll be placing an order pretty soon <img src='http://arin.me/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  .</p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/i-want-a-more-better-a3/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Video of My NoSQL East Talk</title>
		<link>http://arin.me/blog/video-of-my-nosql-east-talk</link>
		<comments>http://arin.me/blog/video-of-my-nosql-east-talk#comments</comments>
		<pubDate>Sun, 29 Nov 2009 21:46:41 +0000</pubDate>
		<dc:creator>phatduckk</dc:creator>
				<category><![CDATA[Work]]></category>
		<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[Digg]]></category>
		<category><![CDATA[NoSQL]]></category>

		<guid isPermaLink="false">http://arin.me/blog/?p=936</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p>
<div align="center">
<embed src="http://blip.tv/play/AYGxyC0C" type="application/x-shockwave-flash" width="480" height="300" allowscriptaccess="always" allowfullscreen="true"></embed></div></p>
]]></content:encoded>
			<wfw:commentRss>http://arin.me/blog/video-of-my-nosql-east-talk/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
