<?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>SameShirtEveryDay.com &#187; Web Development</title>
	<atom:link href="http://sameshirteveryday.com/category/web-development/feed/" rel="self" type="application/rss+xml" />
	<link>http://sameshirteveryday.com</link>
	<description>Personal blog of the one called Alex Gorbatchev, from Toronto, Canada.</description>
	<lastBuildDate>Wed, 30 Dec 2009 20:00:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Discovering Erlang #1</title>
		<link>http://sameshirteveryday.com/2009/10/24/discovering-erlang-1/</link>
		<comments>http://sameshirteveryday.com/2009/10/24/discovering-erlang-1/#comments</comments>
		<pubDate>Sat, 24 Oct 2009 23:03:02 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Erlang]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[beginning]]></category>

		<guid isPermaLink="false">http://sameshirteveryday.com/?p=207</guid>
		<description><![CDATA[I&#8217;m starting to research Erlang as a possible language to go with for my future web development and so I will be posting occasional Erlang posts with links and thoughts. This first post will include a large-ish number of Erlang links that&#8217;s I&#8217;m aggregating mostly consisting of existing web frameworks. HTTP Servers These are servers commonly used [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;"><img class="size-full wp-image-206 alignleft" title="erlan_logo" src="http://sameshirteveryday.com/wp-content/uploads/2009/10/erlan_logo.jpg" alt="erlan_logo" width="180" height="160" />I&#8217;m starting to research <a href="http://www.erlang.org" target="_blank">Erlang</a> as a possible language to go with for my future web development and so I will be posting occasional <a href="http://erlang.org/">Erlang</a> posts with links and thoughts.</p>
<p style="text-align: left;">This first post will include a large-ish number of <a href="http://erlang.org/">Erlang</a> links that&#8217;s I&#8217;m aggregating mostly consisting of existing web frameworks.</p>
<p style="text-align: left;">
<h2>HTTP Servers</h2>
<p>These are servers commonly used for deployment, similar to Ngnix, Lighttpd, Apache and so on.</p>
<ul>
<li><a href="http://code.google.com/p/mochiweb/" target="_blank">Mochiweb</a> is a very lightweight HTTP server written in Erlang.</li>
<li><a href="http://yaws.hyber.org/" target="_blank">Yaws</a> is a HTTP high perfomance 1.1 webserver particularly well suited for dynamic-content web applications.</li>
<li><a href="http://www.erlang.org/doc/apps/inets/part_frame.html" target="_blank">Inets</a> is a container for Internet clients and servers. Currently, an <a href="http://www.erlang.org/doc/apps/inets/part_term.html#HTTP">HTTP</a> client and server, a TFPT client and server, and a FTP client has been incorporated into Inets. The HTTP server and client is HTTP 1.1 compliant as defined in <a href="http://www.erlang.org/doc/apps/inets/part_term.html#RFC">RFC</a> 2616.</li>
</ul>
<h2>Web Frameworks</h2>
<p>These are actual web frameworks which make developer&#8217;s lives easier, similar to Ruby, Merb, Sinatra and so on.</p>
<ul>
<li><a href="http://nitrogenproject.com/" target="_blank">Nitrogen</a> uses an event-driven model built on top of <a href="http://erlang.org/">Erlang</a> pattern matching. Nitrogen allows you to tag elements with any <a href="http://erlang.org/">Erlang</a> term, and then act on the tag in server-side code when the user clicks on, hovers over, or otherwise interacts with the element. Catching the event is as simple as writing an <a href="http://erlang.org/">Erlang</a> function.</li>
<li><a href="http://bitbucket.org/justin/webmachine/wiki/Home" target="_blank">Webmachine</a> is not much like the Web frameworks you&#8217;re used to. It is an application layer that adds HTTP semantic awareness on top of the excellent bit-pushing and HTTP syntax-management provided by mochiweb, and provides a simple and clean way to connect that to your application&#8217;s behavior.</li>
<li><a href="http://erlyweb.org/" target="_self">ErlyWeb</a> is a component-oriented web development framework written in <a href="http://erlang.org/">Erlang</a> and designed to work with <a href="http://yaws.hyber.org/">Yaws</a>, a high-performance Erlang web server. ErlyWeb simplifies building database-driven webapps that follow the tried and true MVC pattern using a great language with many outstanding strengths.</li>
<li><a href="http://www.erlang-web.org/" target="_blank">The Erlang Web</a> is an open source framework for applications based on HTTP protocols, giving the developer better control of content management. With Erlang Web&#8217;s simple but extensible concept of including dynamic content in pages, libraries of reusable components can be built. Currently it supports <a href="http://www.erlang.org/doc/apps/inets/part_frame.html" target="_blank">INETS</a> and <a href="http://yaws.hyber.org/" target="_blank">Yaws</a> webservers, but others are planned in the future.</li>
<li><a href="http://www.chicagoboss.org/" target="_blank">Chicago Boss</a> is fully asynchronous, using one single process to handle hundreds or thousands of simultaneous requests, and thus it solves the classic c10k problem. All other web frameworks will break down and cry if you ask them to process more than a few dozen simultaneous requests on a single machine. <a href="http://www.chicagoboss.org/" target="_blank">Chicago Boss</a> is built with <a href="http://erlang.org/">Erlang</a>, the same platform used by banks and telecoms to achieve unprecendented scalability and (no exaggeration) 99.9999999% reliability.</li>
</ul>
<h2>Other Erlang Projects</h2>
<p>This is a list of interesting <a href="http://erlang.org/">Erlang</a> projects that i&#8217;ve found on the web so far.</p>
<ul>
<li><a href="http://github.com/KirinDave/fuzed" target="_blank">Fuzed</a> is an <a href="http://erlang.org/">Erlang</a>-based clustering system designed to let several single-threaded processes (which may or may not be reliable) form<br />
into a pool which can serve requests to remote hosts. These resources need not be homogeneous, Fuzed breaks them up into homogeneous pools<br />
internally and serves out requests without &#8220;crossing the streams&#8221; of different software/versions of software.</li>
<li><a href="http://code.google.com/p/erlydtl/" target="_blank">ErlyDTL</a> is an <a href="http://erlang.org/">Erlang</a> implementation of the <a href="http://www.djangoproject.com/documentation/templates/">Django Template Language</a>. The erlydtl module compiles Django Template source code into Erlang bytecode. The compiled template has a &#8220;render&#8221; function that takes a list of variables and returns a fully rendered document.</li>
<li><a href="http://www.erlang.org/doc/apps/eunit/chapter.html" target="_blank">EUnit</a> is a unit testing framework for <a href="http://erlang.org/">Erlang</a>. It is very powerful and flexible, is easy to use, and has small syntactical overhead.</li>
<li><a href="http://couchdb.apache.org/" target="_blank">Apache CouchDB</a> is a document-oriented database that can be queried and indexed in a MapReduce fashion using JavaScript. CouchDB also offers incremental replication with bi-directional conflict detection and resolution.</li>
<li><a href="http://github.com/mujaheed/erlang-amf" target="_blank">Erlang-AMF</a> is an AMF0 and AMF3 library (ActionScript data exchange).</li>
</ul>
<h2>Interesting Reads</h2>
<ul>
<li><a href="http://highscalability.com/blog/2008/5/14/new-facebook-chat-feature-scales-to-70-million-users-using-e.html" target="_self">New Facebook chat feature scales to 70m users using Erlang</a></li>
<li><a href="http://www.sics.se/~joe/apachevsyaws.html" target="_blank">Apache vs. Yaws</a></li>
<li><a href="http://thestaticvoid.com/post/2009/08/04/replacing-apache-with-yaws/" target="_blank">Replacing Apache with Yaws</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2009/10/24/discovering-erlang-1/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Missing &#8216;a&#8217; character on Windows with rspec and cucumber</title>
		<link>http://sameshirteveryday.com/2009/04/18/missing-a-character-on-windows-with-rspec-and-cucumber/</link>
		<comments>http://sameshirteveryday.com/2009/04/18/missing-a-character-on-windows-with-rspec-and-cucumber/#comments</comments>
		<pubDate>Sat, 18 Apr 2009 17:21:32 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[cucumber]]></category>
		<category><![CDATA[windows]]></category>

		<guid isPermaLink="false">http://sameshirteveryday.com/?p=190</guid>
		<description><![CDATA[Trying to get a windows rails environment going this morning I stumbled upon something interesting &#8211; all &#8216;a&#8217; characters were missing from cucumber and rspec output. This has something to do with UTF-8 encoding and there&#8217;s a ticket and wiki post on cucumber about it, but no solution that I found acceptable. Everything comes down [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-192" title="cucumber_a_characters_missing" src="http://sameshirteveryday.com/wp-content/uploads/2009/04/cucumber_a_characters_missing.png" alt="cucumber_a_characters_missing" width="800" height="127" /></p>
<p>Trying to get a windows rails environment going this morning I stumbled upon something interesting &#8211; all &#8216;a&#8217; characters were missing from cucumber and rspec output.</p>
<p>This has something to do with UTF-8 encoding and there&#8217;s a <a href="https://rspec.lighthouseapp.com/projects/16211/tickets/81-windows-all-the-a-characters-in-the-output-have-gone-on-strike">ticket</a> and <a href="http://wiki.github.com/aslakhellesoy/cucumber/troubleshooting">wiki post</a> on cucumber about it, but no solution that I found acceptable.</p>
<p>Everything comes down to having change encoding in the current cmd window. This is achieved via a simple call to <code>chcp 1252</code>, but nobody want&#8217;s to do this every time, right?</p>
<p>To get this executed automaticaly and without resorting to serious registry editing, simply add this line to your <code>cucmber.bat</code> and any other batch files that are exhibiting this problem. You can find <code>cucumber.bat</code> in your <code>/ruby/bin</code> folder.</p>
<p>Here&#8217;s what it looks like:</p>
<pre>chcp 1252
@ECHO OFF
IF NOT "%~f0" == "~f0" GOTO :WinNT
@"ruby.exe" "c:/ruby/bin/cucumber" %1 %2 %3 %4 %5 %6 %7 %8 %9
GOTO :EOF
:WinNT
@"ruby.exe" "%~dpn0" %*</pre>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2009/04/18/missing-a-character-on-windows-with-rspec-and-cucumber/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Skinning WordPress is easy</title>
		<link>http://sameshirteveryday.com/2009/02/22/skinning-wordpress-is-easy/</link>
		<comments>http://sameshirteveryday.com/2009/02/22/skinning-wordpress-is-easy/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 03:53:05 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[themes]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://sameshirteveryday.com/?p=166</guid>
		<description><![CDATA[This was my first more or less serious attempt at creating a new theme for WordPress and it turned out to be a pretty trivial task, or at least as far as WordPress itself is concerned.  I love the fact that it doesn&#8217;t get in the way and there&#8217;s very little PHP required to create [...]]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter size-full wp-image-168" title="theme-thumbnail" src="http://sameshirteveryday.com/wp-content/uploads/2009/02/theme-thumbnail.jpg" alt="theme-thumbnail" width="800" height="202" /></p>
<p>This was my first more or less serious attempt at creating a new theme for WordPress and it turned out to be a pretty trivial task, or at least as far as WordPress itself is concerned.  I love the fact that it doesn&#8217;t get in the way and there&#8217;s very little PHP required to create a brand new theme. I took out most of the typical blog stuff like linkrolls, calendar, pages, etc and just left what it is &#8211; just a blog.</p>
<p>For this design I tried to use some <a href="http://en.wikipedia.org/wiki/Golden_ratio" target="_blank">golden ratio</a> here and there and it seems to do the trick. I found an <a href="http://www.markuswelz.de/software2/index.html" target="_blank">awesome freeware tool</a> by <a href="http://www.markuswelz.de/" target="_blank">Markus Slewz</a> which helped tremendously.</p>
<p>Overall this took about a day and a half, from design to launch, so a weekend well spent. And yes, I do love <a href="http://en.wikipedia.org/wiki/Damask" target="_blank">damask</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2009/02/22/skinning-wordpress-is-easy/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How I build CSS layouts.</title>
		<link>http://sameshirteveryday.com/2007/09/14/how-to-build-css-layouts/</link>
		<comments>http://sameshirteveryday.com/2007/09/14/how-to-build-css-layouts/#comments</comments>
		<pubDate>Fri, 14 Sep 2007 21:14:53 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sameshirteveryday.com/2007/09/14/how-to-build-css-layouts/</guid>
		<description><![CDATA[This is my set up when building CSS layouts. I save a layout copy in Photoshop or Fireworks as a 50% transparent PNG which is then displayed on the page with a high z-index. This overlays my actual HTML layout and allows me to test for pixel precision. On the screenshot I&#8217;m testing a layout [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://farm2.static.flickr.com/1043/1383102412_4133eb3b76_b.jpg"><img src="http://farm2.static.flickr.com/1043/1383102412_4133eb3b76.jpg" alt="testing-on-3-browsers" border="0" height="156" width="500" /></a></p>
<p>This is my set up when building CSS layouts. I save a layout copy in Photoshop or Fireworks as a 50% transparent PNG which is then displayed on the page with a high z-index. This overlays my actual HTML layout and allows me to test for pixel precision. On the screenshot I&#8217;m testing a layout simultaneously in all browsers required by the project &#8211; IE6, IE7 and Firefox.</p>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2007/09/14/how-to-build-css-layouts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Facts &#8211; first Facebook application.</title>
		<link>http://sameshirteveryday.com/2007/08/23/my-facts-first-facebook-application/</link>
		<comments>http://sameshirteveryday.com/2007/08/23/my-facts-first-facebook-application/#comments</comments>
		<pubDate>Thu, 23 Aug 2007 20:07:19 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sameshirteveryday.com/2007/08/23/my-facts-first-facebook-application/</guid>
		<description><![CDATA[I just finished my first Facebook application called My Facts. Basically, it allows you to post a quick fact on your profile page and find out who of your friends knew it and who didn&#8217;t. Took me a couple of days to figure it out. The Facebook API is pretty amazing. I&#8217;m especially impressed by [...]]]></description>
			<content:encoded><![CDATA[<p>I just finished my first Facebook application called <a href="http://www.facebook.com/apps/application.php?id=5445496510">My Facts</a>. Basically, it allows you to post a quick fact on your profile page and find out who of your friends knew it and who didn&#8217;t.</p>
<p>Took me a couple of days to figure it out. The Facebook API is pretty amazing. I&#8217;m especially impressed by the total sandboxing of hosted applications. The styles, the JavaScript, everything gets sandboxed. It&#8217;s pretty amazing as a platform.</p>
<p>The hardest part was simply learning the <a href="http://wiki.developers.facebook.com/index.php/FBML">FBML</a> and figuring out what works and what doesn&#8217;t.</p>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2007/08/23/my-facts-first-facebook-application/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hello Facebook in Rails</title>
		<link>http://sameshirteveryday.com/2007/08/17/hello-facebook-in-rails/</link>
		<comments>http://sameshirteveryday.com/2007/08/17/hello-facebook-in-rails/#comments</comments>
		<pubDate>Sat, 18 Aug 2007 01:00:56 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sameshirteveryday.com/2007/08/17/hello-facebook-in-rails/</guid>
		<description><![CDATA[I&#8217;ve signed up for Facebook today to check out how the whole application development works. Setting up a development server at home which is accessible from Facebook is pretty straight forward. Here&#8217;s what you need: Facebook account Local box with Apache Domain name pointing to your home IP. I use No-Ip. Here are the steps [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve signed up for Facebook today to check out how the whole application development works. Setting up a development server at home which is accessible from Facebook is pretty straight forward.</p>
<p>Here&#8217;s what you need:</p>
<ol>
<li>Facebook account</li>
<li>Local box with Apache</li>
<li>Domain name pointing to your home IP. I use <a href="http://www.no-ip.com">No-Ip</a>.</li>
</ol>
<p>Here are the steps I took.</p>
<ol>
<li>Setting up development application on Facebook. Follow <a href="http://developers.facebook.com/step_by_step.php">the guide</a>, it&#8217;s pretty straight forward.</li>
<li>Set up No-Ip to point <code>*.dev.mydomain.com</code> to my local box. This allows me to create as many Rails applications as I need to.</li>
<li>Configured Apache to forward all calls to <code>fbtest.dev.mydomain.com</code> to <code>localhost:3000</code> using <a href="http://httpd.apache.org/docs/2.0/mod/mod_proxy.html">mod_proxy</a> like so:
<pre name="code" class="xml">&lt;VirtualHost *:80&gt;
  ServerName fbtest.dev.mydomain.com
  ProxyPass / http://127.0.0.1:3000/
&lt;/VirtualHost&gt;</pre>
</li>
<li><code>gem install rfacebook</code></li>
<li><code>cd /anywhere/fbtest</code></li>
<li><code>rails .</code></li>
<li><code>ruby script/plugin install svn://rubyforge.org/var/svn/rfacebook/plugins/rfacebook_on_rails</code></li>
<li><code>rake facebook:setup</code></li>
<li>Go to <a href="http://www.facebook.com/developers/apps.php">http://www.facebook.com/developers/apps.php</a></li>
<li>Copy and paste API key and secret to <code>config/facebook.yml</code>. Set <code>canvas_path</code> to the local path on Facebook, ie <code>/myfacebookapp/</code> and <code>callback_path</code> to local path on your server, ie <code>/facebook/</code>.</li>
<li><code>ruby script/generate controller facebook index</code></li>
<li>Edit index method in Facebook controller, like so:
<pre name="code" class="ruby">
class FacebookController &lt; ApplicationController
  def index
    @result = fbsession.friends_get.uid_list
  end
end</pre>
</li>
<li>Edit index.rhtml like so:
<pre name="code" class="xml">&lt;% @result.each do |uid| %&gt;
  &lt;fb:name uid="&lt;%= uid %&gt;" /&gt;
&lt;% end %&gt;</pre>
</li>
<li>Start Apache</li>
<li><code>ruby script/server</code></li>
<li>Now you should be able to hit your Facebook application page at <code>http://apps.facebook.com/myfacebookapp</code></li>
</ol>
<p>You should see a list of your friends. Took me about 30 minutes to figure all this out.</p>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2007/08/17/hello-facebook-in-rails/feed/</wfw:commentRss>
		<slash:comments>12</slash:comments>
		</item>
		<item>
		<title>iPhone as the next mobile platform?</title>
		<link>http://sameshirteveryday.com/2007/06/29/iphone-as-the-next-mobile-platform/</link>
		<comments>http://sameshirteveryday.com/2007/06/29/iphone-as-the-next-mobile-platform/#comments</comments>
		<pubDate>Sat, 30 Jun 2007 00:24:20 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sameshirteveryday.com/2007/06/29/iphone-as-the-next-mobile-platform/</guid>
		<description><![CDATA[I&#8217;m currently in San Francisco and have a flight back to Toronto in 5 hours. I&#8217;m considering trying my luck at picking up an iPhone even though there would be no service for me in back in Canada. The reason why I want to do that is simple &#8211; I believe that iPhone will become [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently in San Francisco and have a flight back to Toronto in 5 hours. I&#8217;m considering trying my luck at picking up an iPhone even though there would be no service for me in back in Canada. The reason why I want to do that is simple &#8211; I believe that iPhone will become the next mobile platform.</p>
<p>Apple has a history of creating infrastructure around its products and there&#8217;s no reason to think that iPhone will be any different. Developing web applications which specifically target the iPhone could, and probably will be the next big thing. As a web developer it&#8217;s a good idea to get on this early in the game.</p>
<p>My opinion is even further solidified by <a href="http://video.msn.com/v/us/fv/msnbc/fv.htm??g=d66af039-706e-450a-b1b4-9f1767b9601c&amp;f=00&amp;fg=">this video</a>. Seems like Microsoft has already lost the battle. The best quote from the video is &#8220;[iPhone] doesn&#8217;t change our strategy, it doesn&#8217;t change our approach&#8221;. Great, that means Windows Mobile will stay the same and 3rd party partners will continue putting out crappy cellphones.</p>
<p>Windows Mobile is not just an unfriendly OS, it hates its users. I can&#8217;t stand using it.</p>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2007/06/29/iphone-as-the-next-mobile-platform/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Storing data localy with JavaScript</title>
		<link>http://sameshirteveryday.com/2007/06/02/storing-data-localy-with-javascript/</link>
		<comments>http://sameshirteveryday.com/2007/06/02/storing-data-localy-with-javascript/#comments</comments>
		<pubDate>Sat, 02 Jun 2007 17:48:34 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sameshirteveryday.com/2007/06/02/storing-data-localy-with-javascript/</guid>
		<description><![CDATA[Sometimes you just want to store some data on the client to access it later. Sometimes you don&#8217;t even want to send it to the server. In this case, you can use something called &#8216;local storage&#8217;. In Firefox it utilizes window.globalStorage which is a part of HTML 5 draft. Internet Explorer, unsurprisingly had this ability [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes you just want to store some data on the client to access it later. Sometimes you don&#8217;t even want to send it to the server. In this case, you can use something called &#8216;local storage&#8217;.</p>
<p>In Firefox it utilizes <a href="http://developer.mozilla.org/en/docs/DOM:Storage">window.globalStorage</a> which is a part of <a href="http://">HTML 5 draft</a>. Internet Explorer, unsurprisingly had this ability since version 5 using <a href="http://msdn2.microsoft.com/en-us/library/ms531424.aspx">#default#userData behavior</a> and unsurprisingly it&#8217;s somewhat awkward. Unfortunately, <strong>Safari/Webkit don&#8217;t seem to support local storage</strong> at all as of now, so this is more of a demo.</p>
<pre name="code" class="js">&lt;html&gt;
&lt;body&gt;

&lt;script&gt;
LockBox = {
	ensureStorage: function()
	{
		if(LockBox.storage != null)
			return;

		var storage;

		if(document.all)
		{
			storage = document.createElement("span");
			storage.style.behavior = "url(#default#userData)";

			if(document.body)
				document.body.appendChild(storage);
			else
				throw new Error("DomStorage works only after dom loaded");

			storage.load("lockbox");
		}
		else
		{
			storage = globalStorage[location.hostname];
		}

		LockBox.storage = storage;
	},

	set: function(name, value)
	{
		LockBox.ensureStorage();

		if(document.all)
		{
			LockBox.storage.setAttribute(name, value);
			LockBox.storage.save("lockbox");
		}
		else
		{
			LockBox.storage[name] = value;
		}
	},

	get: function(name, defaultValue)
	{
		LockBox.ensureStorage();

		var result = document.all
			? LockBox.storage.getAttribute(name)
			: LockBox.storage[name]
		;

		return result || defaultValue;
	}
}

//
// Here's a little demo.
//
var value = parseInt(LockBox.get('count', 0));
alert(value);
LockBox.set('count', value + 1);
&lt;/script&gt;

&lt;/body&gt;
&lt;/html&gt;</pre>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2007/06/02/storing-data-localy-with-javascript/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Generate Google sitemap with Rails and RXML</title>
		<link>http://sameshirteveryday.com/2007/05/26/generate-google-sitemap-with-rails-and-rxml/</link>
		<comments>http://sameshirteveryday.com/2007/05/26/generate-google-sitemap-with-rails-and-rxml/#comments</comments>
		<pubDate>Sat, 26 May 2007 14:33:40 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sameshirteveryday.com/2007/05/26/generate-google-sitemap-with-rails-and-rxml/</guid>
		<description><![CDATA[It occurred to me that a good idea would be to add a Google sitemap to Noobkit, especially because it&#8217;s using frames. Here&#8217;s how I went about it: In a regular controller I load up all my @packages but instead of a plain sitem_map.rhtml, I have a site_map.rxml file which looks like this: xml.instruct! xml.urlset [...]]]></description>
			<content:encoded><![CDATA[<p>It occurred to me that a good idea would be to add a <a href="https://www.google.com/webmasters/tools/docs/en/protocol.html">Google sitemap</a> to <a href="http://www.noobkit.com">Noobkit</a>, especially because it&#8217;s using frames. Here&#8217;s how I went about it:</p>
<p>In a regular controller I load up all my <code>@packages</code> but instead of a plain <code>sitem_map.rhtml</code>, I have a <code>site_map.rxml</code> file which looks like this:</p>
<pre name="code" class="ruby">xml.instruct!
xml.urlset "xmlns" =&gt; "http://www.google.com/schemas/sitemap/0.84" do
  xml.url do
    xml.loc         "http://test"
    xml.lastmod     w3c_date(Time.now)
    xml.changefreq  "monthly"
  end
  @packages.each do |package|
    xml.url do
      xml.loc         "http://www.noobkit.com/page/ref/#{package.full_name}"
      xml.lastmod     w3c_date(package.created_at)
      xml.changefreq  "monthly"
    end
  end
end</pre>
<p><code>w3c_date</code> goes into <code>your_controller_helper.rb</code>.</p>
<pre name="code" class="ruby">def w3c_date(date)
  date.utc.strftime("%Y-%m-%dT%H:%M:%S+00:00")
end</pre>
<p>That&#8217;s all to it. Packages provide entry points to their entire API trees and should be enough information for Google to start crawling there.</p>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2007/05/26/generate-google-sitemap-with-rails-and-rxml/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>In search of a Digg rating algorithm</title>
		<link>http://sameshirteveryday.com/2007/05/17/in-search-of-a-digg-rating-algorithm/</link>
		<comments>http://sameshirteveryday.com/2007/05/17/in-search-of-a-digg-rating-algorithm/#comments</comments>
		<pubDate>Thu, 17 May 2007 20:19:35 +0000</pubDate>
		<dc:creator>Alex Gorbatchev</dc:creator>
				<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.sameshirteveryday.com/2007/05/17/in-search-of-a-digg-rating-algorithm/</guid>
		<description><![CDATA[I&#8217;m not sure why, but all of a sudden I got interested in how Digg works. In particular how it decides which links get to be featured on the landing page. There&#8217;s quite a bit of thinking that goes behind that algorithm that drives it. There doesn&#8217;t seem to be that much available out there. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure why, but all of a sudden I got interested in how <a href="http://www.digg.com">Digg</a> works. In particular how it decides which links get to be featured on the landing page. There&#8217;s quite a bit of thinking that goes behind that algorithm that drives it.<span id="more-21"></span></p>
<p>There doesn&#8217;t seem to be that much available out there. Here are a few interesting links that I found online:</p>
<ul>
<li><a href="http://vallery.net/2007/03/26/scalable-story-promotion/">Scalable story promotion</a></li>
<li><a href="http://www.webcodr.com/4/writing-a-digg-style-popularity-algorithm/">Writing a Digg-Style Popularity Algorithm</a></li>
<li><a href="http://web.archive.org/web/20041209040106/http://digg.com/">Archive</a> &#8211; the first day of Digg that&#8217;s in <a href="http://www.archive.org">Archive.org</a> has SQL in HTML comments. It&#8217;s obviously very simple and trivial, but does give a couple of hints about early inner-workings.I formatted it myself, the original source is all on one line.</li>
</ul>
<pre name="code" class="sql">select
  items.id as id,
  title,
  ctitle,
  url,
  bodytext,
  username,
  category_id,
  top_flag,
  category_autopost_threshold,
  dig_count,
  obscene_count,
  users.id as userid,
  approved,
  deleted,
  obscene_flag,
  sdelete_flag,
  catdaysback
from
  (items inner join users on userid = users.id)
where
  (approved = 1 and deleted = 0  and obscene_flag != 1) and
  (top_flag = 1 or (items.dig_count &gt;= category_autopost_threshold)) and
  (sdelete_flag != 1)
order by date_promoted desc</pre>
]]></content:encoded>
			<wfw:commentRss>http://sameshirteveryday.com/2007/05/17/in-search-of-a-digg-rating-algorithm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

