<?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>Derek Gathright &#187; Web Development</title>
	<atom:link href="http://www.derekville.net/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.derekville.net</link>
	<description>Scribbles &#38; Bits</description>
	<lastBuildDate>Thu, 09 Sep 2010 00:37:33 +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>Book Review: High Performance JavaScript (Part 1)</title>
		<link>http://www.derekville.net/2010/book-review-high-performance-javascript-part-1/</link>
		<comments>http://www.derekville.net/2010/book-review-high-performance-javascript-part-1/#comments</comments>
		<pubDate>Wed, 08 Sep 2010 05:44:48 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=769</guid>
		<description><![CDATA[When I saw Nicholas C. Zakas blog that he was writing a new book on JavaScript performance techniques, I instantly went to pre-order it as I hoped it would be another top-notch book from Zakas &#38; Yahoo! Press. Having partially &#8230; <a href="http://www.derekville.net/2010/book-review-high-performance-javascript-part-1/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="float:right; padding:20px;"> <img src="http://covers.oreilly.com/images/9780596802806/lrg.jpg" width="200" /></div>
<p>When I saw Nicholas C. Zakas blog that he was <a href="http://www.nczonline.net/blog/2010/02/09/announcing-high-performance-javascript/">writing a new book</a> on JavaScript performance techniques, I instantly went to pre-order it as I hoped it would be another top-notch book from Zakas &amp; Yahoo! Press.  Having partially read through <em><a href="http://www.amazon.com/gp/product/059680279X?ie=UTF8&#038;tag=deresblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=059680279X">High Performance JavaScript</a></em> by now, I wasn&#8217;t let down.</p>
<p>Since JavaScript is such an expressive language, there are dozens of different ways to do the same thing.  Some of them good, some mediocre, and a lot of them bad.  It&#8217;s amazing how much awful JS info is on the web, all leftover from the dark ages of JS (&#8217;96 &#8211; &#8217;05). Up until this point, we haven&#8217;t had an authoritative source on the topic of how to write JavaScript that performs well, both in and out of the browser.  Sure we&#8217;re had great books about web performance (<a href="http://www.amazon.com/gp/product/0596529309?ie=UTF8&#038;tag=deresblog-20&#038;linkCode=as2&#038;camp=1789&#038;creative=390957&#038;creativeASIN=0596529309">High Performance Web Sites</a> is my favorite), but we haven&#8217;t had anything specific to JavaScript.  Now we do.</p>
<p>Nicholas is widely known as one of the best minds in the JavaScript world today.  He joined Yahoo! in 2006 as a front end engineer and has been working on one of the most trafficked pages on the interwebs, the Yahoo! home page.  His blog (<a href="http://nczonline.net">nczonline.net</a>) is a treasure trove of information on all things JavaScript &#038; web performance.  Some recent gems include <a href="http://www.nczonline.net/blog/2010/01/05/interviewing-the-front-end-engineer/">Interviewing the front-end engineer</a> &amp; <a href="http://www.nczonline.net/blog/2009/12/15/writing-maintainable-code/">Writing maintainable code</a>.  It goes without saying that he knows his stuff when it comes to JavaScript &#038; performance.  As his books and blog posts have shown, he&#8217;s also a very skilled technical writer, keeping topics fresh, concise, &#038; relevant.</p>
<p>I&#8217;m writing this as I read along, so the verbosity of this post is due to me taking reference notes on interesting things as I go.</p>
<hr />
<h2>Chapter 1: Loading &#038; Execution</h2>
<p>Nick doesn&#8217;t waste any time getting into what the reader wants, fresh tips! Right away we begin to learn the specifics of how browsers react depending on where &#038; how you include your JS.  There are many ways that work, but few ways that work <strong>well</strong>.</p>
<p>Specifically:</p>
<ul>
<li>Why is it important to put your &lt;script&gt; includes just above the closing &lt;/body&gt; tag?</li>
<li>What is the browser doing while loading those external files?</li>
<li>Why should you put all your in-page JS code <strong>above</strong> your CSS includes? <em>(A: If you put it after a &lt;/link&gt; tag referencing an external stylesheet, the browser will block execution while waiting for that stylesheet to download)</em></li>
<li>How you can use the <em>defer</em> attribute in &lt;script&gt; tags to delay non-essential execution of code.</li>
<li>A thorough look at dynamic script loading to import &#038; execute your JS without blocking the browser.</li>
<li>An overview of some of the common JS loaders used today (YUI3, LazyLoader, &#038; LABjs).</li>
</ul>
<p>While much of the content in this chapter contains common knowledge among experienced developers, it is important knowledge to cover as it serves as the foundation for the rest of the book.  Don&#8217;t worry, we&#8217;ll get more advanced.</p>
<hr />
<h2>Chapter 2: Data Access</h2>
<p>Here&#8217;s where the sexy parts come into play; diagrams, graphs, and benchmarks!  This second chapter is where you&#8217;ll learn about how exactly the JS engine accesses data depending on how you store it.  The steepest learning curve within JavaScript for beginning developers is understanding variable scope.  This is the first time I&#8217;ve ever come across an explanation of JavaScript&#8217;s <a href="http://www.jibbering.com/faq/faq_notes/closures.html#clScCh">[[Scope]]</a> property, now all the scoping &#038; speed issues make perfect sense!</p>
<p>Major topics covered in this chapter:</p>
<ul>
<li>Why do global variables perform so slowly?</li>
<li>Why creating data as local variables as opposed to object properties is 10%-50% faster (depending on the browser).</li>
<li>Why is it a good idea to create local instances of global variables?</li>
<li>Why <em>with</em>, <em>try/catch</em>, and <em>eval</em> are bad ideas from a performance perspective. (<em>A: they augment the scope by inserting themselves first on the tree</em>)</li>
<li>What truly happens under the hood when a variable is found to be <em>undefined</em>?</li>
<li>Closure scope and why they can cause memory leaks.</li>
<li>How prototype&#8217;s work and performance issues related to traversing up the prototype chain.</li>
<li>Why is it bad to use deeply nested object members (i.e. foo.bar.baz.bop())?</li>
</ul>
<p>There were so many &#8220;Ah hah! I get it now!&#8221; moments in this chapter for me that it alone was worth the price of the book.  It took me about 5x as long as it should have to get through this chapter because I was too busy playing with Firebug as I began to learn some of these concepts.</p>
<hr />
<h2>Chapter 3: DOM Scripting</h2>
<p>This book contains a few guest author chapters, and this is one of them.  In this chapter we learn about DOM scripting by another Yahoo, Stoyan Stefanov.</p>
<p>Many web developers don&#8217;t understanding what exactly &#8220;DOM scripting&#8221; is, even though they likely do it on a daily basis.  Many could tell you what the acronym stands for and that it represents the structure of an (X)HTML/XML document, but most don&#8217;t know that it also represents the API part of how you interact with the document.  When you are using <em>document.getElementById(&#8220;foobar&#8221;)</em> or <em>myelement.style.color = &#8220;blue&#8221;</em>, you are utilizing a DOM API function accessible via JavaScript, but it has nothing to do with the ECMAScript (aka: JavaScript) standard.</p>
<p>This chapter is chalk-full of great best practices &#038; overviews of DOM principles.  The first thing we learn is that accessing the DOM is so slow because we&#8217;re crossing the bridge between JavaScript and native browser code.  Jumping between the two is expensive, and should be kept to a minimum.  There are a lot of tricks &#038; tips that are very under-utilized by most developers when DOM scripting.  </p>
<p>For example:</p>
<ul>
<li>Using the non-standard <em>innerhtml</em> is way faster than creating nodes via the native <em>document.createElement()</em> method.</li>
<li>When looping through a NodeCollection you should cache the length of the node in a local variable because it&#8217;s own <em>length</em> property is very slow.</li>
<li>Iterating through <em>nextSibling()</em> can be 100x faster than using <em>childNodes()</em></li>
</ul>
<p>This chapter also goes into a detailed explanation of what repaint &amp; reflow are, when they occur, and how understanding them will improve your application performance.  The realization I had after reading the R&#038;R explanation is we do stupid stuff all the time simply because we don&#8217;t understand how the browser renders and updates our pages.  You know how you&#8217;ve always heard using <em>margin-left</em> &amp; <em>margin-right</em> as separate styles is a bad idea? Well, here you find out why.  Oh, and did you know there was a <em>cssText</em> property you can use to batch your CSS modifications? I didn&#8217;t.</p>
<p>As JS libraries get more &amp; more popular, knowledge of good DOM scripting is becoming increasingly rare.  Take event delegation for example. Many developers just presume jQuery&#8217;s <em>live()</em> or YUI3&#8242;s <em>delegate()</em> methods are just magic.  They&#8217;re far from it, and are actually easy to understand concepts. When interviewing candidates for front end jobs at Yahoo!, this is one of the primary concepts we expect candidates to understand.  They may have never used it, but the good ones will figure it out as they are whiteboarding and we walk them through the challenges.</p>
<p>JS libraries are awesome, but it&#8217;s because they abstract out the cross-browser differences &amp; fix a flawed language, not because they allow you to forget what it actually going on under the hood.</p>
<hr />
<h2>Chapter 4: Algorithms &#038; Flow Control</h2>
<p>Chapter 4 kicks off with a quick overview of the 4 different types of loops in JavaScript (<em>while</em>, <em>do-while</em>, <em>for</em>, <em>for-in</em>).  The first 3 have equivalent performance, but <em>for-in</em> is the one to watch out for and should only be used when iterating an unknown number of elements (i.e. object properties). We then learn about important concepts like length caching and various other optimization techniques focused on reducing the number of operations per iteration.</p>
<p>Next up are conditionals, such as <em>if-else</em> and <em>switch</em>.  We learn when it is appropriate to use each one, and when they can be ditched for a much faster method, like using arrays as lookup tables.</p>
<p>Finally we come to the topic of recursion.  We skip the basics of &#8220;What is recursion&#8221; and jump straight into browser limitations with call stacks and advanced recursion topics such as memoization to cut out the fat in your stack.</p>
<p>Since the majority of our time spent coding is inside of loops, conditionals, and (if we really want to optimize) recursion, this chapter has great, basic information on efficient shortcuts that will set you apart from the other developers on your team.  Techniques learned in this chapter extend beyond the scope of JavaScript and can be used in just about every other programming language.</p>
<hr />
<h2>Chapter 5: Strings and Regular Expressions</h2>
<p><em>Another guest author chapter, this time by regex guru Steve Levithan</em></p>
<p>Along with loops, another very common task in JavaScript is string manipulation, most commonly one by concatenation or regular expressions, so it makes sense to have a whole chapter to itself.</p>
<p>When most people start out with JS, their concatenation method is likely <em>var str = &#8220;foo&#8221;; str = str + &#8220;bar&#8221;; //str = &#8220;foobar&#8221;</em>, then they discover the += operator and it becomes <em>var str = &#8220;foo&#8221;; str += &#8220;bar&#8221;; //str = &#8220;foobar&#8221;</em>.  It turns out that one of those is more efficient when it comes to memory usage, and it happens to not be the latter.  This chapter provides some memory allocation table diagrams to explain the difference and how different browsers perform that operation. It should also be noted that another alternate method of concatenation, <em>['foo','bar'].join(&#8221;);</em> is the preferred method in IE 6 &amp; 7, so that should be considered depending on your userbase.</p>
<p>The second half of this chapter covers regular expressions, which usually make me cringe. I have no problem writing them, but they&#8217;re an absolute nightmare to maintain sometimes.  Douglas Crockford has a saying, &#8220;If a regular expression is longer than 2 inches, find another method.&#8221;  I couldn&#8217;t agree more.</p>
<hr />
<p>In Part 2 of this review, I&#8217;ll look at the remaining five chapters of this book:</p>
<ul>
<li>Chapter 6: Responsive Interfaces</li>
<li>Chapter 7: Ajax</li>
<li>Chapter 8: Programming Practices</li>
<li>Chapter 9: Building and Deploying high performance JavaScript applications</li>
<li>Chapter 10: Tools</li>
</ul>
<p>If you like what you&#8217;ve seen so far, go buy it!</p>
<div><iframe src="http://rcm.amazon.com/e/cm?lt1=_blank&#038;bc1=000000&#038;IS2=1&#038;bg1=FFFFFF&#038;fc1=000000&#038;lc1=0000FF&#038;t=deresblog-20&#038;o=1&#038;p=8&#038;l=as1&#038;m=amazon&#038;f=ifr&#038;md=10FE9736YVPPT7A0FBG2&#038;asins=059680279X" style="width:120px;height:240px;" scrolling="no" marginwidth="0" marginheight="0" frameborder="0"></iframe>
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2010/book-review-high-performance-javascript-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Node-YQL</title>
		<link>http://www.derekville.net/2010/node-yql/</link>
		<comments>http://www.derekville.net/2010/node-yql/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 20:29:04 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[node]]></category>
		<category><![CDATA[yql]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=676</guid>
		<description><![CDATA[The more I play around with Node.js, the more I love server-side JavaScript. Once you get over the weirdness of writing JavaScript outside of the browser, it feels very natural. And the bonus is that it is blazing fast. Also, &#8230; <a href="http://www.derekville.net/2010/node-yql/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div align="center" style="float:left; padding:20px;"><img src="http://farm3.static.flickr.com/2601/3858500752_9c3a39e4af.jpg" height="200" /></div>
<p>The more I play around with <a href="http://nodejs.org/">Node.js</a>, the more I love server-side JavaScript.  Once you get over the weirdness of writing JavaScript outside of the browser, it feels very natural.  And the bonus is that it is blazing fast.  </p>
<p>Also, as I&#8217;ve been playing around with <a href="http://developer.yahoo.com/yql/">YQL</a> (Yahoo Query Language) more lately, I realized I wanted to be able to access YQL data from within my Node app.  So, I created a <a href="http://github.com/drgath/node-yql">node-yql </a> module.  </p>
<p>Now you can do something like&#8230;</p>
<div style="clear:both"></div>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">YQL.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;SELECT * FROM weather.forecast WHERE location=90066&quot;</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>response<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #003366; font-weight: bold;">var</span> location  <span style="color: #339933;">=</span> response.<span style="color: #660066;">query</span>.<span style="color: #660066;">results</span>.<span style="color: #660066;">channel</span>.<span style="color: #660066;">location</span><span style="color: #339933;">,</span>
	    condition <span style="color: #339933;">=</span> response.<span style="color: #660066;">query</span>.<span style="color: #660066;">results</span>.<span style="color: #660066;">channel</span>.<span style="color: #000066; font-weight: bold;">item</span>.<span style="color: #660066;">condition</span><span style="color: #339933;">;</span>
&nbsp;
	sys.<span style="color: #660066;">puts</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;The current temperature in &quot;</span> <span style="color: #339933;">+</span> location.<span style="color: #660066;">city</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; is &quot;</span> <span style="color: #339933;">+</span> condition.<span style="color: #660066;">temp</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; degrees&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #006600; font-style: italic;">// Output: The current temperature in Los Angeles is 57 degrees</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2010/node-yql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>jsFiddle: A JavaScript playground</title>
		<link>http://www.derekville.net/2010/jsfiddle-a-javascript-playground/</link>
		<comments>http://www.derekville.net/2010/jsfiddle-a-javascript-playground/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 05:59:24 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jsfiddle]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=669</guid>
		<description><![CDATA[Ajaxian had a story yesterday about a brand-new JavaScript playground called jsFiddle. A write and execute web-based JavaScript IDE is nothing new, but this is much, much more than that. The real power of jsFiddle is that you have the &#8230; <a href="http://www.derekville.net/2010/jsfiddle-a-javascript-playground/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Ajaxian had <a href="http://ajaxian.com/archives/jsfiddle" target="_blank">a story</a> yesterday about a brand-new JavaScript playground called <a href="http://jsfiddle.net">jsFiddle</a>. A write and execute web-based JavaScript IDE is nothing new, but this is much, much more than that.</p>
<p><a href="http://s89997654.onlinehome.us/screencaps//YQL_YUI3_Twitter_example_-_jsFiddle_-_Online_Editor_for_the_Web_%28JavaScript%2C_MooTools%2C_jQuery%2C_Prototype%2C_YUI%2C_Glow_and_Dojo%2C_HTML%2C_CSS%29-20100224-215440.jpg"><img width="100%" src="http://s89997654.onlinehome.us/screencaps//YQL_YUI3_Twitter_example_-_jsFiddle_-_Online_Editor_for_the_Web_%28JavaScript%2C_MooTools%2C_jQuery%2C_Prototype%2C_YUI%2C_Glow_and_Dojo%2C_HTML%2C_CSS%29-20100224-215440.jpg"></a></p>
<p>The real power of jsFiddle is that you have the option to include any of the most popular JS libraries, including; Mootools, jQuery, Prototype, YUI2.8, YUI3, Glow, Vanilla, Dojo, Processing.js, &#038; ExtJS.  This feature gives anyone the ability to try out any of these libraries without going through the task of downloading, extracting, and coded up some examples.  With a few mouse-clicks you can view example snippets from any of the major JS libraries, and start editing them to see how they work.</p>
<p>As if that wasn&#8217;t enough, jsFiddle also includes social features that give you the ability to write a snippet, save it, and share the URL.  As I was hanging out in various JavaScript IRC chatrooms tonight, I continually found myself using jsFiddle to code up snippets to answer questions.  In the past, everyone would always just use Pastebin.com, but that lacks any interactive features.  Now you can use jsFiddle as a replacement to Pastebin for any JS, HTML, or CSS snippets and the user will have the ability to actually edit, execute, and view the output.</p>
<p>As icing on the cake, you can take your snippets, copy the embed code, and paste them anywhere.  Here&#8217;s a snippet that I was able to code up in about 15 minutes (writing this blog post took longer than that!) to demonstrate the power of YUI3, YQL, and the Twitter API.  In this iframe, you&#8217;ll find all the JS, CSS, and HTML you need to create a simple little Twitter widget.</p>
<p>In all, this is an amazing product that I&#8217;ll likely find myself using on a daily basis.</p>
<p><iframe style="width: 100%; height: 500px" src="http://jsfiddle.net/derek/Vjxt2/embedded/"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2010/jsfiddle-a-javascript-playground/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>On: Programmable Twitter Clients</title>
		<link>http://www.derekville.net/2009/on-programmable-twitter-clients/</link>
		<comments>http://www.derekville.net/2009/on-programmable-twitter-clients/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 16:51:31 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Social Media]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[seesmic]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=600</guid>
		<description><![CDATA[Loic Lemuer (CEO of Seesmic) recently announced at Microsoft&#8217;s Developer Conference that he&#8217;ll be releasing a new version of Seesmic that supports plugins. This is huge for developers, as well as users. Up until now the Twitter developer ecosystem has &#8230; <a href="http://www.derekville.net/2009/on-programmable-twitter-clients/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Loic Lemuer (CEO of Seesmic) recently announced at Microsoft&#8217;s Developer Conference that he&#8217;ll be <a href="http://www.loiclemeur.com/english/2009/11/more-on-seesmics-vision-of-programmable-twitter-clients.html">releasing a new version of Seesmic</a> that supports plugins.  This is huge for developers, as well as users.  </p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/Ql_PR6WtbGw&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/Ql_PR6WtbGw&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en_US&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p>
<p>Up until now the Twitter developer ecosystem has been very closed.  Sure the Twitter APIs are as open as possible, but all the clients out there are largely closed platforms.  There are a few exceptions, including <a href="http://code.google.com/p/spaz/">Spaz</a> and <a href="http://github.com/drgath/tweenky/">Tweenky</a> (my client) which are open-source.  It is great to have a starting point (aside from raw libraries) that gives developers a place to start with when building a Twitter application.  With Seesmic Desktop invading Windows with a programmable version that you can write plugins for, this is a huge step that hopefully will push other developers/companies towards the same model.  </p>
<p>When I launched Tweenky about 18 months ago, I hadn&#8217;t event thought about making it programmable, but pretty quickly afterwards I realized the potential it could have if it were programmable, and so I began a rewrite, and coded it in 99% JavaScript with two plugins out of the box, Twitter and Identi.ca.  I had plans for other plugins (Facebook), but the problem with developing a platform, and not just an application, is that it takes a loooot of time.  For one guy working in his spare time, it just wasn&#8217;t going to be possible to abstract out a platform and develop a community around it.  So, I started with another rewrite and only focused support for Twitter.  I still think it was the right move given the limited amount of time I can spend developing it.</p>
<p>What I&#8217;m really waiting for is an easy way for Twitter developers to monetize their applications.  We&#8217;ve all seen what the Apple has accomplished with the App Store and the ecosystem they created overnight.  While most iPhone developers have made very little, others have won the lottery and struck it rich.  While Twitter (the company) has been very supportive of the developer community, they should really look at giving it a push and figuring out a way to monetarily reward Twitter developers.  Nothing gets developers going like a big, fat, diamond crusted carrot dangling in front of their noses.  Afterall, Twitter wouldn&#8217;t be Twitter if it weren&#8217;t for the developers.  The various clients are what made the service usable for the hard-core Twitter users that create most of the valuable content.</p>
<p>P.S. You can still view the programmable version at <a href="http://beta.tweenky.com">beta.tweenky.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/on-programmable-twitter-clients/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP: A Better Random String Function</title>
		<link>http://www.derekville.net/2009/php-a-better-random-string-function/</link>
		<comments>http://www.derekville.net/2009/php-a-better-random-string-function/#comments</comments>
		<pubDate>Fri, 30 Oct 2009 20:57:25 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=570</guid>
		<description><![CDATA[Often times you&#8217;ll come across the need to generate a random string. When you search for something like &#8220;PHP random string function&#8221; which will probably just be cut &#038; pasted into your code, you&#8217;ll typically find something like this function: &#8230; <a href="http://www.derekville.net/2009/php-a-better-random-string-function/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Often times you&#8217;ll come across the need to generate a random string.  When you search for something like &#8220;PHP random string function&#8221; which will probably just be cut &#038; pasted into your code, you&#8217;ll typically find something like this function:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> genRandomString<span style="color: #009900;">&#40;</span><span style="color: #000088;">$length</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">10</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$characters</span> <span style="color: #339933;">=</span> ‘0123456789abcdefghijklmnopqrstuvwxyz’<span style="color: #339933;">;</span>
    <span style="color: #000088;">$string</span> <span style="color: #339933;">=</span> ”<span style="color: #339933;">;</span>
    <span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$p</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$p</span> <span style="color: #339933;">&lt;</span> <span style="color: #000088;">$length</span><span style="color: #339933;">;</span> <span style="color: #000088;">$p</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$string</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$characters</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">mt_rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$characters</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
&nbsp;
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$string</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>While that&#8217;s great and all, don&#8217;t you just feel like there&#8217;s some better, simpler way to generate a random string?  Preferably something done all in one line, so you don&#8217;t even need a function inside your code?</p>
<p>There is a way.  Actually, there are lots of ways.  There are numerous functions in PHP that can be used to generate a string of random characters, and the one I typically use here is something you&#8217;ve probably used quite a bit&#8230; md5().  </p>
<p>If you aren&#8217;t familiar with it, <a href="http://en.wikipedia.org/wiki/MD5">MD5</a> is a commonly used hashing technique that can be used to generate a unique 32-character &#8220;fingerprint&#8221; of a string. While it has been shown to have some security holes and not be collision proof, that isn&#8217;t really a concern the majority of the time you need to generate a random string.  So, we&#8217;ll go ahead and use it here.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #990000;">MD5</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// PHP Warning:  md5() expects at least 1 parameter, 0 given</span></pre></div></div>

<p>So, we need to pass in something, anything, but try to be unique.  microtime() is a good choice.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #990000;">MD5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 5959e4c551ee3a91d89449437b681ead</span></pre></div></div>

<p>Great, now we have a random 32 character string.  But what if you only want a slice of that, like 5 characters?  substr() is your answer.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">MD5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 5959e</span></pre></div></div>

<p>If you are concerned about security and making this string as random as possible, just shuffle it with str_shuffle().</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">echo</span> <span style="color: #990000;">substr</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">str_shuffle</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">MD5</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">microtime</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">5</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 6c468</span></pre></div></div>

<p>Now wasn&#8217;t that easy?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/php-a-better-random-string-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dynamic function names in JavaScript</title>
		<link>http://www.derekville.net/2009/dynamic-function-names-in-javascript/</link>
		<comments>http://www.derekville.net/2009/dynamic-function-names-in-javascript/#comments</comments>
		<pubDate>Wed, 14 Oct 2009 01:48:13 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=553</guid>
		<description><![CDATA[If you are doing some more advanced JavaScript applications, you&#8217;ll likely run into the problem at one point or another when you need to dynamically generate the name of a function you wish to call. This is the equivalent of &#8230; <a href="http://www.derekville.net/2009/dynamic-function-names-in-javascript/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you are doing some more advanced JavaScript applications, you&#8217;ll likely run into the problem at one point or another when you need to dynamically generate the name of a function you wish to call. This is the equivalent of PHP&#8217;s <a href="http://php.net/manual/en/function.call-user-func.php" target="_blank">call_user_func()</a>.  </p>
<p>Here&#8217;s how you can do it.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #006600; font-style: italic;">// Define some vars</span>
<span style="color: #003366; font-weight: bold;">var</span> foo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;hello&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> bar <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;world&quot;</span><span style="color: #339933;">;</span>
<span style="color: #003366; font-weight: bold;">var</span> function_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;say_&quot;</span> <span style="color: #339933;">+</span> foo <span style="color: #339933;">+</span> bar<span style="color: #339933;">;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Since its name is being dynamically generated, always ensure your function actually exists</span>
<span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">typeof</span><span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#91;</span>function_name<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">===</span> <span style="color: #3366CC;">&quot;function&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	window<span style="color: #009900;">&#91;</span>function_name<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot; World!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000066; font-weight: bold;">else</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">throw</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Error.  Function &quot;</span> <span style="color: #339933;">+</span> function_name <span style="color: #339933;">+</span> <span style="color: #3366CC;">&quot; does not exist.&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> say_helloworld<span style="color: #009900;">&#40;</span>the_word<span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">&quot;Hello &quot;</span> <span style="color: #339933;">+</span> the_word<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// Browser will alert &quot;Hello World!&quot;</span></pre></div></div>

<p>When you think about it, it makes a lot of sense considering all global objects in JavaScript are actually properties of the &#8220;window&#8221; object.  Take a look at this example to understand that concept a bit more.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> foo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;apple&quot;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> foobar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #003366; font-weight: bold;">var</span> foo <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;orange&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;foo&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// alerts &quot;apple&quot;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>foo<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// alerts &quot;orange&quot;</span>
	<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span>window<span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;foobar&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// alerts the foobar function</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
foobar<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Here&#8217;s another example of when using a string to call a function could come in handy.  This time we&#8217;re calling the property of an object we&#8217;ve created.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> Person<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">message</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;Hello World!&quot;</span><span style="color: #339933;">;</span>
	<span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">say_hello</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>to<span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000066;">alert</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">message</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> Derek <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> Person<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
function_name <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;say_hello&quot;</span><span style="color: #339933;">;</span>
Derek<span style="color: #009900;">&#91;</span>function_name<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>See how it looks pretty much the same as the method above using a global function?  </p>
<p>Hope that shed some light on your problem.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/dynamic-function-names-in-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Opacity supports &#8220;Export to Canvas&#8221;</title>
		<link>http://www.derekville.net/2009/opacity-supports-export-to-canvas/</link>
		<comments>http://www.derekville.net/2009/opacity-supports-export-to-canvas/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 19:38:21 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=549</guid>
		<description><![CDATA[Looks like I may be able to soon replace Adobe Fireworks as my image editing tool of choice for the web. Ajaxian recently featured a new tool called Opacity, and if you follow through to their website, you&#8217;ll find a &#8230; <a href="http://www.derekville.net/2009/opacity-supports-export-to-canvas/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Looks like I may be able to soon replace Adobe Fireworks as my image editing tool of choice for the web. Ajaxian <a href="http://ajaxian.com/archives/opacity-fancy-a-design-tool-with-save-as-canvas">recently featured a new tool</a> called <a href="http://likethought.com/opacity/">Opacity</a>, and if you follow through to their website, you&#8217;ll find a great video tutorial that shows how you can create great looking icons and simple images.  </p>
<p>But, the best feature in my eyes could be their JavaScript export option that can be dumped inside HTML5&#8242;s <a href="http://en.wikipedia.org/wiki/Canvas_%28HTML_element%29">&lt;canvas&gt;</a> tag to render &#038; animate the image. I haven&#8217;t yet seen the source code this generates, but it seems logical that you could translate layer based vector art into JavaScript.  </p>
<div style="text-align:center;"><img src="http://www.derekville.net/wp-content/uploads/2009/09/opacity-export.jpg" alt="opacity-export.jpg" border="0" width="304" height="214" /></div>
<p>Another feature I also love is the integration with the various OSX FTP clients like CyberDuck and Transmit, as well as the dynamic web preview option.</p>
<p>With &lt;canvas&gt; being relatively new on the scene, a tool like this could really bridge the gap between designers &#038; developers and accelerate the adoption of another open standard that can help push the &#8220;open web&#8221; forward.  </p>
<p>You can read more about Opacity at <a href="http://www.webmonkey.com/blog/Turn_Your_Vector_Art_Into_Canvas-based_Animations_With_Opacity">WebMonkey&#8217;s review</a> or check out Opacity&#8217;s <a href="http://likethought.com/opacity/"> product page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/opacity-supports-export-to-canvas/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Reason RSS Cloud Can Work Now</title>
		<link>http://www.derekville.net/2009/the-reason-rss-cloud-will-catch-on/</link>
		<comments>http://www.derekville.net/2009/the-reason-rss-cloud-will-catch-on/#comments</comments>
		<pubDate>Wed, 09 Sep 2009 04:23:23 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[pubsubhubbub]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[rsscloud]]></category>
		<category><![CDATA[syndication]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=515</guid>
		<description><![CDATA[Rogers Cadenhead recently wrote a post &#8220;The Reason RSS Cloud Failed to Catch On&#8220;. In this he argues that RSS Cloud is not sustainable when it begins to scale to thousands of users needing to receive pings every time a &#8230; <a href="http://www.derekville.net/2009/the-reason-rss-cloud-will-catch-on/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<div style="text-align:center;"><img src="http://www.derekville.net/wp-content/uploads/2009/09/cloud.jpg" alt="cloud.jpg" border="0" width="506" height="275" /></div>
<p>Rogers Cadenhead recently wrote a post &#8220;<a href="http://workbench.cadenhead.org/news/3555/theres-reason-rsscloud-failed-catch/0">The Reason RSS Cloud Failed to Catch On</a>&#8220;.  In this he argues that RSS Cloud is not sustainable when it begins to scale to thousands of users needing to receive pings every time a post is made.  While he has a point, I believe his argument is much more accurate when put into the context of 1999 as opposed to 2009, and it is even more irrelevant a few years from now.  This points to one thing&#8230; <strong>RSS Cloud was ahead of its time</strong>.</p>
<p>Today, supporting RSS Cloud is cheap.  Bandwidth is a fraction of a percent now compared to what is was 10 years ago along with cloud based virtual servers available for ~$10 / month.  I&#8217;d suspect a properly tweaked VPS at the Rackspace Cloud or EC2 could handle millions of pings / day without issue.  Unlike PubSubHubBub, the content of the post is not delivered with RSS Cloud, it is just a body-less ping, so bandwidth isn&#8217;t even an issue.  A server supporting these types of capabilities back in 1999 would have cost thousands of dollars per month.  Now?  Just a few bucks.  5 years from now I suspect it will be free (example: Google App Engine is currently free and could be configured for this service).</p>
<p>Let&#8217;s go ahead and take into consideration the dream scenario with RSS Cloud, and that is that we have completely replaced Twitter.  In this scenario Ashton Kutcher will have 5 million followers and will need to notify each of those followers when he tweets out 100 mundane posts / day.  Let&#8217;s not kid ourselves and <strong>not</strong> think there is a middle man in there somewhere.  These services are the &#8220;Cloud&#8221; portion of whole term.  Just like Feedburner and Google Reader are proxies between publisher and reader now (by storing local caches of RSS feeds), there will be many services that would be happy to host the feeds, providing a web client to the reader and analytics to the publisher in turn receiving all the statistics they chew on.  Proof?  Twitter purchased Summize (search.twitter.com) and Google bought FeedBurner because they saw the value of this type of service.  Afterall, the analytics portion of that is the whole business model that Twitter is rumored to be building.</p>
<p>But ok&#8230; let&#8217;s assume those &#8220;Cloud&#8221; services never pop up because, hell&#8230; I don&#8217;t see any reason why they wouldn&#8217;t, but let&#8217;s just imagine they don&#8217;t exist.  Solution? TURN OFF THE NOTIFICATIONS!  That&#8217;s the beauty of RSS Cloud feeds, it&#8217;s completely backwards compatible with non-Cloud enabled feeds.  If the Cloud server fails to send out notifications, then their subscribers will simply revert back to the old method of routine polls looking for new content.  But, failing to notify your subscribers of new content in a sea of real-time has drastic consequences.  Even if you are the first to report information, you will always be &#8220;scooped&#8221; by others because the lag caused by your inability to notify your subscribers.  That alone will be enough to even the playing field.  As a compromise, you could get away with just notifying a few dozen RSS aggregators (Google, Yahoo, Feedburner) to take care of the majority of your subscribers, and those using readers you don&#8217;t notify will revert to polls.</p>
<p>So as you can see, RSS Cloud is currently gaining traction because it wasn&#8217;t until now that it was a viable service for the masses.  Even now there is very little support within the client portion of RSS Cloud, but I suspect that will be a battleground many will fight for in the next couple years.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/the-reason-rss-cloud-will-catch-on/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>Cloud Enabled</title>
		<link>http://www.derekville.net/2009/cloud-enabled/</link>
		<comments>http://www.derekville.net/2009/cloud-enabled/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 03:23:30 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cloud]]></category>
		<category><![CDATA[rss]]></category>
		<category><![CDATA[rsscloud]]></category>
		<category><![CDATA[syndication]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=503</guid>
		<description><![CDATA[Today WordPress.com announced RSS Cloud support for all their hosted blogs. Not to be left out of the party, I also installed the RSS Cloud plugin on this blog. RSS Cloud is an ancient RSS element (in web 2.0 years) &#8230; <a href="http://www.derekville.net/2009/cloud-enabled/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Today WordPress.com <a href="http://en.blog.wordpress.com/2009/09/07/rss-in-the-clouds/">announced RSS Cloud support</a> for all their hosted blogs.  Not to be left out of the party, I also installed the <a href="http://wordpress.org/extend/plugins/rsscloud/">RSS Cloud plugin</a> on this blog.</p>
<p><a href="http://rsscloud.org/">RSS Cloud</a> is an ancient RSS element (in web 2.0 years) that has been given new life recently as the &#8220;realtime web&#8221; in exploding (thanks to Twitter and Facebook).  Basically, it allows RSS readers the ability to be notified when a feed has been updated instead of waiting minutes, hours, or days before that client has a chance to check the feed.  Now, an RSS Cloud supported reader that is subscribed to an RSS Cloud enabled feed can be notified within seconds that the feed has been updated.  RSS now has a realtime element.</p>
<p>RSS Cloud support is still in it&#8217;s infancy with only 1 RSS reader supporting RSS Cloud notifications (<a href="http://newsriver.org/river2">River2</a>), but within the coming year, it could become a game-changing technology that can give rise to self hosted Twitter-like publishing platforms.  There&#8217;s a number of people (myself included) that are working on such platforms, and hopefully I&#8217;ll be able to make an announcement in the coming weeks.  My feeling is, as great as WordPress is for blogging, it&#8217;s not the ideal platform for micro-blogging.  What the community needs is a microblog version of WordPress that has a real-time element, and I think this RSS Cloud element fits the bill.</p>
<h3>Related Articles</h3>
<ul>
<li>WordPress: <a href="http://en.blog.wordpress.com/2009/09/07/rss-in-the-clouds/">RSS in the Clouds</a></li>
<li>TechCrunch: <a href="http://www.techcrunch.com/2009/09/07/wordpress-enables-rsscloud-in-post-feeds/">WordPress.com Enables RSSCloud In Post Feeds</a></li>
<li>ReadWriteWeb: <a href="http://www.readwriteweb.com/archives/wordpress_just_made_millions_of_blogs_real-time_wi.php">WordPress Just Made Millions of Blogs Real-Time With RSSCloud</a></li>
<li>Scripting.com: <a href="http://www.scripting.com/stories/2009/09/07/teaseTeaseTease.html">Tease! Tease! Tease!</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/cloud-enabled/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Auto-versioning JavaScript &amp; CSS files</title>
		<link>http://www.derekville.net/2009/auto-versioning-javascript-and-css-files/</link>
		<comments>http://www.derekville.net/2009/auto-versioning-javascript-and-css-files/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 16:45:26 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[versioning]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=438</guid>
		<description><![CDATA[As JavaScript becomes a more integral part to the core functionality of websites, ensuring that a user has a fresh copy of the latest code is as important as ever. Normally a browser will cache certain filetypes (CSS, JS, JPG, &#8230; <a href="http://www.derekville.net/2009/auto-versioning-javascript-and-css-files/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>As JavaScript becomes a more integral part to the core functionality of websites, ensuring that a user has a fresh copy of the latest code is as important as ever.  Normally a browser will cache certain filetypes (CSS, JS, JPG, etc&#8230;) for an indefinite period of time.  If the code within one of these cached files is updated, sometimes a browser will not know to reload that file.  So, if those changes are important for the functionality of your website, your users may run into issues and not be able to use your site properly.  Worse, they likely won&#8217;t have any idea what the issue is and will eventually give up and go elsewhere. But have no fear, there&#8217;s a solution to this problem&#8230; versioning your static files.</p>
<p>By &#8220;versioning&#8221; these files, I&#8217;m referring to changing their filenames from &#8220;my_styles.css&#8221; to &#8220;my_styles.version274.css&#8221; for example.  The problem with that example is it relies on you renaming the file and updating your includes <strong>every time</strong> you make a change.  That sounds like an nightmare, right?  Luckily there&#8217;s a neat tactic you can you to make it appear to the browser to be a new file, but it will actually be the same file and will require no effort on your part.  This variation of the versioning tactic is often referred to as &#8220;Auto-versioning&#8221;.  Here&#8217;s an example&#8230;</p>
<p>First, we use the following rewrite rule in .htaccess:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">RewriteEngine on
RewriteCond %<span style="">&#123;</span>REQUEST_FILENAME<span style="">&#125;</span> !-s # Make the file doesn't actually exist
RewriteRule ^<span style="">&#40;</span>.*<span style="">&#41;</span>\.<span style="color: #000066; font-weight:bold;"><span style="">&#91;</span>\d<span style="">&#93;</span>+\.<span style="">&#40;</span>css|js<span style="">&#41;</span>$ $1.$<span style="">2</span> <span style="">&#91;</span>L<span style="">&#93;</span></span> # Strip out the version number</pre></div></div>

<p>Now, we write the following PHP fuction:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
 *  Given a file, i.e. /css/base.css, replaces it with a string containing the
 *  file's mtime, i.e. /css/base.1221534296.css.
 *  
 *  @param $file  The file to be loaded.  Must be an absolute path (i.e.
 *                starting with slash).
 */</span>
<span style="color: #000000; font-weight: bold;">function</span> auto_version<span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">strpos</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$file</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">!==</span> <span style="color: #cc66cc;">0</span> <span style="color: #339933;">||</span> <span style="color: #339933;">!</span><span style="color: #990000;">file_exists</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
    <span style="color: #b1b100;">return</span> <span style="color: #000088;">$file</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #000088;">$mtime</span> <span style="color: #339933;">=</span> <span style="color: #990000;">filemtime</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'DOCUMENT_ROOT'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #b1b100;">return</span> <span style="color: #990000;">preg_replace</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'{\\.([^./]+)$}'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;.<span style="color: #006699; font-weight: bold;">$mtime</span>.<span style="color: #000099; font-weight: bold;">\$</span>1&quot;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$file</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now, wherever you include your CSS, change it from this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;/css/base.css&quot; type=&quot;text/css&quot; /&gt;</pre></div></div>

<p>To this:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;&lt;?=auto_version('/css/base.css')?&gt;&quot; type=&quot;text/css&quot; /&gt;</pre></div></div>

<p>And when rendered, will appear as:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;/css/base.1251992914.css&quot; type=&quot;text/css&quot; /&gt;</pre></div></div>

<p>How does this work?  Because that mod_rewrite rule above will strip out the timestamp, your server will deliver /css/base.css as the requested file.  But to the user&#8217;s browser, it will appear as a different file whenever it is updated.</p>
<p>Neat!</p>
<p></p>
<hr />
</p>
<p><strong>Note</strong>: Some strategies to fix this caching issue is to append a version # onto the end of the css or JavaScript file with a querystring, such as:</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;link rel=&quot;stylesheet&quot; href=&quot;/css/base.css?version=1234&quot; type=&quot;text/css&quot; /&gt;</pre></div></div>

<p>This method will actually prevent the file from being cached, period!  This is bad.  You want the benefits of caching.  You don&#8217;t want to make your users pull down 100k of JavaScript &#038; CSS files on every page load.  More importantly, your servers could start to strain under the additional load.</p>
<p>Why is it not cached?  See <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec13.html">Section 13 from the HTTP Specification</a>, in particular Section 13.9</p>
<blockquote><p>
<strong>13.9 Side Effects of GET and HEAD</strong></p>
<p>Unless the origin server explicitly prohibits the caching of their responses, the application of GET and HEAD methods to any resources SHOULD NOT have side effects that would lead to erroneous behavior if these responses are taken from a cache. They MAY still have side effects, but a cache is not required to consider such side effects in its caching decisions. Caches are always expected to observe an origin server&#8217;s explicit restrictions on caching.</p>
<p>We note one exception to this rule: since some applications have traditionally used GETs and HEADs with query URLs (those containing a &#8220;?&#8221; in the rel_path part) to perform operations with significant side effects, caches MUST NOT treat responses to such URIs as fresh unless the server provides an explicit expiration time. This specifically means that responses from HTTP/1.0 servers for such URIs SHOULD NOT be taken from a cache. See section 9.1.1 for related information.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/auto-versioning-javascript-and-css-files/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Upcoming events for Kansas City developers/designers</title>
		<link>http://www.derekville.net/2009/upcoming-events-for-kansas-city-developersdesigners/</link>
		<comments>http://www.derekville.net/2009/upcoming-events-for-kansas-city-developersdesigners/#comments</comments>
		<pubDate>Sat, 07 Feb 2009 04:45:35 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Kansas City]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Palm Pre]]></category>
		<category><![CDATA[PreDevCamp]]></category>
		<category><![CDATA[StartupWeekend]]></category>

		<guid isPermaLink="false">http://www.derekville.net/?p=332</guid>
		<description><![CDATA[I&#8217;m involved with organizing two upcoming events in the Kansas City area for web developer/designers. PreDevCamp &#8211; Kansas City This is an event we just announced today that will be a &#8220;bootcamp&#8221; for developing on Palm&#8217;s new Mojo SDK platform, &#8230; <a href="http://www.derekville.net/2009/upcoming-events-for-kansas-city-developersdesigners/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m involved with organizing two upcoming events in the Kansas City area for web developer/designers.</p>
<p><span style="text-decoration: underline;">PreDevCamp &#8211; Kansas City</span></p>
<p>This is an event we just announced today that will be a &#8220;bootcamp&#8221; for developing on Palm&#8217;s new Mojo SDK platform, which is the development toolkit for the upcoming Palm Pre phone.</p>
<p>Website: <a href="http://kansascity.predevcamp.org/">PreDevCamp &#8211; Kansas City</a>.</p>
<p><span style="text-decoration: underline;">StartupWeekend &#8211; Kansas City</span></p>
<p>StartupWeekends are events that have been occuring nationwide for the past couple years, and it is Kansas City&#8217;s first  chance to host one.  These events typically take place over a weekend, starting Friday afternoon, and ending Sunday evening.  During this event, teams of developers, designers, project managers, marketing peeps, etc&#8230; will break off into teams and at the weekend the goal is to have a company up &amp; running with a prototype product built to demo to potential investors.</p>
<p>Website: <a href="http://kansascity.startupweekend.com/">http://kansascity.startupweekend.com/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/upcoming-events-for-kansas-city-developersdesigners/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using Git on 1&amp;1 (or any &#8216;shared&#8217;) hosting</title>
		<link>http://www.derekville.net/2009/using-git-on-11-or-any-shared-hosting/</link>
		<comments>http://www.derekville.net/2009/using-git-on-11-or-any-shared-hosting/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 05:05:19 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://www.derekville.net/2009/01/10/using-git-on-11-or-any-shared-hosting/</guid>
		<description><![CDATA[Here&#8217;s another &#8220;How-to&#8221; with 1and1 hosting, and this time I want to get the source code control/versioning program &#8220;Git&#8221; installed on my shared host with 1&#38;1.  This was actually remarkably easy. Go download Git from http://git-scm.com/download.  At the time of &#8230; <a href="http://www.derekville.net/2009/using-git-on-11-or-any-shared-hosting/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s another &#8220;How-to&#8221; with 1and1 hosting, and this time I want to get the source code control/versioning program &#8220;Git&#8221; installed on my shared host with 1&amp;1.  This was actually remarkably easy.</p>
<ol>
<li> Go download Git from http://git-scm.com/download.  At the time of this posting, the latest version can be found at http://kernel.org/pub/software/scm/git/git-1.6.1.tar.gz</li>
<li>SSH into your 1&amp;1 account</li>
<li>&#8220;wget http://kernel.org/pub/software/scm/git/git-1.6.1.tar.gz&#8221;, and that will download the package</li>
<li>&#8220;tar -xvzf git-1.6.1.tar.gz&#8221; which will decompress the gzip file into a subdirectory</li>
<li>&#8220;cd git*&#8221; to change into the subdirctory</li>
<li>&#8220;make&#8221; to begin compiling the source.  You won&#8217;t be able to do &#8220;make install&#8221; because you likely won&#8217;t have permission to install anything to the system.</li>
<li>Now Git is ready to rock with the exception of needing to add it to your $PATH.  This can be done by typing &#8220;echo &#8216;PATH=$PATH:~/git-1.6.1/&#8217; &gt; ~/.profile&#8221;</li>
</ol>
<p>Done!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2009/using-git-on-11-or-any-shared-hosting/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Tweenky, Zendcon, vacations, CCCKC, DotNext, etc&#8230;</title>
		<link>http://www.derekville.net/2008/tweenky-zendcon-vacations-ccckc-dotnext-etc/</link>
		<comments>http://www.derekville.net/2008/tweenky-zendcon-vacations-ccckc-dotnext-etc/#comments</comments>
		<pubDate>Fri, 26 Sep 2008 04:51:55 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ccckc]]></category>
		<category><![CDATA[dotnext]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[openweb podcast]]></category>
		<category><![CDATA[tweenky]]></category>
		<category><![CDATA[zendcon]]></category>

		<guid isPermaLink="false">http://www.derekville.net/2008/09/26/tweenky-zendcon-vacations-ccckc-dotnext-etc/</guid>
		<description><![CDATA[Blogging is something that comes in waves for me, and once I get out of the habit, it is tough to get back into it.  I enjoy it, but sometimes there’s just so much going on that it completely escapes &#8230; <a href="http://www.derekville.net/2008/tweenky-zendcon-vacations-ccckc-dotnext-etc/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Blogging is something that comes in waves for me, and once I get out of the habit, it is tough to get back into it.  I enjoy it, but sometimes there’s just so much going on that it completely escapes me.  The last few months have been one of those periods.  So let’s start from the top…</p>
<p>I’ve been working on a new project recently.  <a href="http://www.tweenky.com">Tweenky</a> is a micro blogging client I am developing that is mostly used with Twitter, but also supports Identi.ca, and hopefully more micro-blogging services soon.  The concept behind it was the lack of any good web clients out there for Twitter, and especially ones that brought back the “track” feature that Twitter took away from us a few weeks back.  It’s still very much a work in progress and I just have to find the time to work on some of the new features and further improve stability.  I’m having a blast with pushing the boundaries of JavaScript and what it should/shouldn’t be used for.  So, if you are a Twitter user, go check it out, and if it is still requiring an invite code, use “derekville”.</p>
<p>So I just returned from a convention out in Santa Clara called Zendcon.  As a web developer, my primary language of choice is PHP, and Zend is the company puts most of the work into the PHP project, so this was kind of their little yearly shindig.  It was 4 days of 1-2 hour training sessions on all topics related to PHP and web development.  I saw some presentations from engineers and developers from companies such as IBM, Google, Mozilla, Digg, Yahoo, and tons more.  I met a ton of really interesting people too and had a great time at Yahoo HQ for Hackday &#8217;08.  (note to self: Don&#8217;t wear &#8220;Hackday &#8217;08&#8243; shirt to airport, it leads to hacker questioning from TSA agents)</p>
<p>Vacation #1 was on the front &amp; back end of the Zendcon trip as I had a few days before &amp; after the conference to play around in San Francisco.  It’s such a cool city and I had a blast driving around in the Pontiac G6 convertible I rented for the week.  I’ve never had so much fun driving a car!</p>
<p>Vacation #2 is coming up next month with Katye &amp; I flying up to Seattle where we’ll also head up to Vancouver &amp; Victoria.  I haven’t been to Seattle in about 10 years, so I’m really excited as I love that city.  Everyone I’ve talked to raves about Vancouver too, so I’m pretty excited about my first trip north of the border.</p>
<p>If you are a web developer in the Kansas City area, you need to check out two emerging groups.  The first being <a href="http://webstandards.meetup.com/121/">DotNext</a>, a group in the KC area that gets together every month or so to give sessions on anything web development related.  Last month was a series of presentations of Amazon Web Services.  This month is going to be on various database related technologies. The second group is <a href="http://cowtowncomputercongress.org/index.php/Main_Page">Cowtown Computer Congress</a> who is setting up a hacker space in North Kansas City.  For those not too familiar with what a “hacker space” is (myself included), it is a place for technologists to get together to work on  various hardware &amp; software projects, share costs on equipment, and actually socialize (something most geeks never do much of).  So should be an awesome place to convene when it officially opens in the next couple months.</p>
<p>And finally, a new podcast from some rather influential people in the web development world has launched that I’d like to mention.  <a href="http://openwebpodcast.com/">Open Web Podcast</a> was created by Google engineer <a href="http://almaer.com/blog/">Dion Almaer</a> (of the Ajaxian podcast as well), <a href="http://alex.dojotoolkit.org/">Alex Russell</a> of Dojo, and <a href="http://ejohn.org/">John Resig</a> of Mozilla/jQuery.  So if you are into web standards and JavaScript, definitely check it out.</p>
<p>Finally, I recently discovered the FX show &#8220;It&#8217;s Always Sunny in Philadelphia&#8221;.  Hilarious!  Check out all the episodes on <a href="http://www.hulu.com/its-always-sunny-in-philadelphia">Hulu</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2008/tweenky-zendcon-vacations-ccckc-dotnext-etc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Issue when compiling FFMPEG on RHEL4</title>
		<link>http://www.derekville.net/2008/issue-when-compiling-ffmpeg-on-rhel4/</link>
		<comments>http://www.derekville.net/2008/issue-when-compiling-ffmpeg-on-rhel4/#comments</comments>
		<pubDate>Wed, 25 Jun 2008 09:18:53 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[rhel4]]></category>

		<guid isPermaLink="false">http://www.derekville.net/2008/06/25/issue-when-compiling-ffmpeg-on-rhel4/</guid>
		<description><![CDATA[A user uploaded a Quicktime video to my website the other day and the server ran into a problem transcoding it to FLV. I hit up #ffmpeg and it was suggested that I upgrade my install of FFMPEG and libfaad. &#8230; <a href="http://www.derekville.net/2008/issue-when-compiling-ffmpeg-on-rhel4/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>A user uploaded a Quicktime video to my website the other day and the server ran into a problem transcoding it to FLV.  I hit up #ffmpeg and it was suggested that I upgrade my install of FFMPEG and libfaad.  Alrighty, no big deal, done it before.  So first thing this morning was going to be update the sources and recompile.</p>
<p>Before I get on with that, first I&#8217;ll describe the environment.  We&#8217;re running on RHEL4 and have an install of FFMPEG that works fine (aside from that 1 user uploaded video).  The last upgrade of FFMPEG to get h264 support wasn&#8217;t done by me, but rather our sysadmin, when we actually had a sysadmin. I believe he used rpms for the libraries and compiled FFMPEG from the SVN repo.</p>
<p>So I did a quick search just to remind myself what libraries I needed and I came across <a href="http://pixels-and-politics.blogspot.com/2008/03/compile-ffmpeg-on-rhel4.html">this post</a> about compiling on RHEL4, our distro. Perfect.  I followed directions to a T (aside from upgrading SVN) and it compiled fine.  Now, time to run a test transcode&#8230;</p>
<blockquote><p>
		[root@140859-www1 ~]# /home/derek/ffmpeg_sources/ffmpeg/ffmpeg -y -i /media/v2-prod/atlas/8102/20206 -ab 64k -ar 22050 -b 700K -r 15 -y -s 640&#215;480 -ac 1 -padtop -padbottom -s vga /home/derek/blah.flv<br />
		FFmpeg version SVN-r13977, Copyright (c) 2000-2008 Fabrice Bellard, et al.<br />
		  configuration: &#8211;enable-libmp3lame &#8211;enable-libvorbis &#8211;enable-libfaac &#8211;enable-libfaad &#8211;enable-gpl &#8211;enable-libtheora &#8211;enable-libx264 &#8211;enable-shared<br />
		  libavutil version: 49.7.0<br />
		  libavcodec version: 51.57.2<br />
		  libavformat version: 52.16.0<br />
		  libavdevice version: 52.0.0<br />
		  built on Jun 25 2008 14:49:55, gcc: 3.4.6 20060404 (Red Hat 3.4.6-9)<br />
		Input #0, mov,mp4,m4a,3gp,3g2,mj2, from &#8216;/media/v2-prod/atlas/8102/20206&#8242;:<br />
		  Duration: 00:10:55.2, start: 0.000000, bitrate: 406 kb/s<br />
		    Stream #0.0(und): Audio: mpeg4aac, 44100 Hz, stereo<br />
		    Stream #0.1(und): Video: h264, yuv420p, 320&#215;240 [PAR 0:1 DAR 0:1], 30.00 tb(r)<br />
		Output #0, flv, to &#8216;/home/derek/blah.flv&#8217;:<br />
		    Stream #0.0(und): Video: flv, yuv420p, 640&#215;480 [PAR 0:1 DAR 0:1], q=2-31, 700 kb/s, 15.00 tb(c)<br />
		    Stream #0.1(und): Audio: libmp3lame, 22050 Hz, mono, 64 kb/s<br />
		Stream mapping:<br />
		  Stream #0.1 -> #0.0<br />
		  Stream #0.0 -> #0.1<br />
		Press [q] to stop encoding<br />
		/home/derek/ffmpeg_sources/ffmpeg/ffmpeg: symbol lookup error: /home/derek/ffmpeg_sources/ffmpeg/ffmpeg: undefined symbol: av_fifo_generic_write<br />
		You have new mail in /var/spool/mail/root
		</p></blockquote>
<p>Well shit.  Ok, so I hit up #ffmpeg again, but don&#8217;t get any help, so I try recompiling without any config options and it works fine.  So I slowly start added on config options and it works until I add &#8220;&#8211;enable-share&#8221;, and which point it compiles a version of FFMPEG that throws the &#8220;undefined symbol&#8221; error.  So that gives me a pretty good idea it has something to do with that.  I go through the symlinks in the guide (linked above) and notice that /usr/lib/libavformat.so.50 is symlinked to a file that doesn&#8217;t exist.  And that&#8217;s where I&#8217;m at now, kinda stumped.  Am I missing libraries?  how can I ensure any old libraries installed before are cleaned out and not conflicting with new ones?  I&#8217;m a developer, not a linux admin.  I know my way around the OS, but when it comes to this type of stuff, I&#8217;m stumped.</p>
<p>Any ideas? post a comment or email/gtalk me at drgath at gmail.com.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2008/issue-when-compiling-ffmpeg-on-rhel4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reddit fighting with its developers</title>
		<link>http://www.derekville.net/2008/reddit-fighting-with-its-developers/</link>
		<comments>http://www.derekville.net/2008/reddit-fighting-with-its-developers/#comments</comments>
		<pubDate>Thu, 19 Jun 2008 06:14:11 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[reddit]]></category>

		<guid isPermaLink="false">http://www.derekville.net/2008/06/19/reddit-fighting-with-its-devs/</guid>
		<description><![CDATA[Day #1 of Reddit going open source, and they are already fighting with their developers. C&#8217;mon guys, you clearly don&#8217;t understand what is being requested, so ask for clarification instead of being so stubborn. We understand you are busy getting &#8230; <a href="http://www.derekville.net/2008/reddit-fighting-with-its-developers/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Day #1 of Reddit <a href="http://blog.reddit.com/2008/06/reddit-goes-open-source.html">going open source</a>, and they are already <a href="http://groups.google.com/group/reddit-dev/browse_thread/thread/82b3608b7c351106">fighting with their developers</a>.  C&#8217;mon guys, you clearly don&#8217;t understand what is being requested, so ask for clarification instead of being so stubborn.  We understand you are busy getting this project off the ground, but you need to understand that you can&#8217;t fight with your own developers, especially this early in the game.  If you can&#8217;t manage that, they why did you open source it in the first place?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2008/reddit-fighting-with-its-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First AJAX script</title>
		<link>http://www.derekville.net/2005/first-ajax-script/</link>
		<comments>http://www.derekville.net/2005/first-ajax-script/#comments</comments>
		<pubDate>Sat, 28 May 2005 23:03:06 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://blog.derekville.net/?p=13</guid>
		<description><![CDATA[Well, I finally got around to giving Ajax (Asynchronous JavaScript and XML) a whirl. I wasn&#8217;t trying to do anything spectacular, just something functional to wet my appetite. I started out just wanting to allow people to send me text &#8230; <a href="http://www.derekville.net/2005/first-ajax-script/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Well, I finally got around to giving <a href="http://en.wikipedia.org/wiki/AJAX">Ajax</a> (Asynchronous JavaScript and XML) a whirl.  I wasn&#8217;t trying to do anything spectacular, just something functional to wet my appetite.  I started out just wanting to allow people to send me text messages via the side bar.  I got it all set up using PHP in about 2 minutes, and I thought&#8230; &#8220;It works, but I hate reloading the page for something so simple.&#8221;  And then Ajax popped in my head and thought it would be a great first script.</p>
<p>So off I went to grab the latest version of <a href="http://www.modernmethod.com/sajax/">SAJAX</a> (Simple Ajax), and boy were they right about the &#8220;simple&#8221; part.  Within about 30 minutes, I had a functional script that you can now find on the side bar.  Before you try it out, please use the <a href="http://www.derekgathright.com/ajax_send_mail.php">demo page</a>, as I don&#8217;t need everyone sending me text messages just to see how it works.</p>
<p>Next step, getting my responses to show up. =)</p>
<p>Edit:  At first that last comment was a joke, <a href="http://www.derekgathright.com/chat_full.php">but two hours later&#8230;</a>, that was shockingly easy.  I&#8217;d like to get it integrated into the side bar, but out of time tonight.  I&#8217;ll post the code when I have a bit more time to work on it.  So feel free to send a message or two, as I can respond rather easily.  If you get annoying, I can turn it off via my cell phone too.  <img src='http://www.derekville.net/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2005/first-ajax-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blast from the past</title>
		<link>http://www.derekville.net/2005/blast-from-the-past/</link>
		<comments>http://www.derekville.net/2005/blast-from-the-past/#comments</comments>
		<pubDate>Sun, 08 May 2005 16:34:18 +0000</pubDate>
		<dc:creator>Derek</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[soccer]]></category>

		<guid isPermaLink="false">http://blog.derekville.net/?p=5</guid>
		<description><![CDATA[I came across these files earlier today and have decided to throw them up here. This is basically what you do with your time living in a college town during the summer, unemployed. I don&#8217;t even think at this point &#8230; <a href="http://www.derekville.net/2005/blast-from-the-past/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I came across <a href="http://www.derekgathright.com/soccer/jsp.htm">these files</a> earlier today and have decided to throw them up here.  This is basically what you do with your time living in a college town during the summer, unemployed.  I don&#8217;t even think at this point 6 years ago I had any idea what MySQL or PHP was, because if I did, it would have made everything a whole lot easier.  For my MLS simulator, I was using Java arrays containing about 10,000 items.  Something tells me that isn&#8217;t the most efficient way to move data.  Also this was back in the day when I used Word and Excel to make webpages, how embarrassing!  Check it out @ <a href="http://www.derekgathright.com/soccer/jsp.htm">The Java Soccer Page</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.derekville.net/2005/blast-from-the-past/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
