<?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>Henrik Falck&#039;s blog &#187; web apps</title>
	<atom:link href="http://henrikfalck.com/blog/tag/web-apps/feed" rel="self" type="application/rss+xml" />
	<link>http://henrikfalck.com/blog</link>
	<description>reinventing web 3.0</description>
	<lastBuildDate>Mon, 12 Apr 2010 00:33:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Localization support for language identifier</title>
		<link>http://henrikfalck.com/blog/2010/04/localization-support-for-language-identifier.html</link>
		<comments>http://henrikfalck.com/blog/2010/04/localization-support-for-language-identifier.html#comments</comments>
		<pubDate>Sun, 11 Apr 2010 03:18:40 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[improvements]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[language analyzer]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog/?p=370</guid>
		<description><![CDATA[Something&#8217;s wrong when a language identifier doesn&#8217;t have localization support. So I cooked up a little localization code for What Language Is This?, which proved to be not as easy as one might guess. That&#8217;s because some of the textual content of the web app is in HTML, other is generated by PHP, and yet [...]]]></description>
			<content:encoded><![CDATA[<p>Something&#8217;s wrong when a language identifier doesn&#8217;t have localization support. So I cooked up a little localization code for <a href="http://whatlanguageisthis.com/" title="What Language Is This? Online language identifier"  target="_blank">What Language Is This?</a>, which proved to be not as easy as one might guess. That&#8217;s because some of the textual content of the web app is in HTML, other is generated by PHP, and yet other is generated in JavaScript. I wanted to have one single source of localized strings for all three output paths to simplify overviewing, translating, changing, and adding strings to the web app.</p>
<p>I&#8217;m not sure if there&#8217;s any good solution for this out there, but I cooked up my own. Each language translation has its strings in a text file formatted like an ini file with id keys and localized strings separated by an equals sign. You can view the <a href="http://whatlanguageisthis.com/strings-en.txt"  target="_blank">English</a> and <a href="http://whatlanguageisthis.com/strings-ja.txt"  target="_blank">Japanese</a> raw text files if you like. These are read into a PHP array (i.e. dictionary), after first looking at what language is specified by the URL (/en for English, /ja for Japanese or any other code), and if that is not specified then looking at what languages the browser is set to prefer via the <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.4"  target="_blank">Accept-Language</a> HTTP header. If the requested language is not available then default to English.</p>
<p>To get the html output localized, the php script that reads through and configures the app (the plain html file itself is set up to run offline for debugging purposes only) looks for string ids enclosed in percent signs, i.e. like %strings id%. These are then replaced with the localized strings from the dictionary. The php-generated content is trivially changed to look up strings from the dictionary. On the JavaScript side, I wanted access to the same string dictionary that I had on the php side, so this is inserted into a &lt;script&gt; block of the generated html output as a JavaScript object (i.e. dictionary). String id lookups can then be done on this object from the JavaScript code just like on the php side. In other words, the php string dictionary is converted into JSON, which is used from the JavaScript side.</p>
<div id="attachment_371" class="wp-caption aligncenter" style="width: 310px"><a href="http://henrikfalck.com/blog/wp-content/uploads/2010/04/wlit-japanese.jpg" ><img class="size-medium wp-image-371" title="あれ何語？ What Language Is This? in 日本語" src="http://henrikfalck.com/blog/wp-content/uploads/2010/04/wlit-japanese-300x186.jpg" alt="あれ何語？ What Language Is This? in 日本語" width="300" height="186" /></a><p class="wp-caption-text">あれ何語？ What Language Is This? in 日本語</p></div>
<p>It all works pretty well and meets my goals. The only downside is that it relies on the server to do some processing, so when I develop on the offline version the strings aren&#8217;t available, instead I get to see the raw string ids, which can be useful too, but you have to rely on imagination to envision the end result. Isn&#8217;t programming always like that anyway, though?</p>
<p>The first translated version of What Language Is This? is of course <a href="http://whatlanguageisthis.com/ja" title="ウェブ上言語識別サービス"  target="_blank">Japanese</a>, done by myself and my wife (初めての共同作業? lol), not just because it&#8217;s easy for me to do, but also because when looking at the <a href="http://addthis.com/"  target="_blank">AddThis</a> stats, Japan is the top ranking country, and also as you know the average English skills in Japan are pretty bad, so I suspect there is a demand for a Japanese translation. Looking at the access stats, and discounting those with good English skills (India, Netherlands, Scandinavia, for example), next in line would most likely be Spanish, French, and German, in that order. Anyone feel like helping? Please drop me a comment in that case. I can offer proper credit and a link back from the site in return.</p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2010/04/localization-support-for-language-identifier.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New Feedback Feature for What Language Is This?</title>
		<link>http://henrikfalck.com/blog/2009/02/new-feedback-feature-for-what-language.html</link>
		<comments>http://henrikfalck.com/blog/2009/02/new-feedback-feature-for-what-language.html#comments</comments>
		<pubDate>Sun, 01 Feb 2009 13:03:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[improvements]]></category>
		<category><![CDATA[language analyzer]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2009/02/new-feedback-feature-for-what-language-is-this.html</guid>
		<description><![CDATA[I got around to implementing a feature I&#8217;ve been planning for What Language Is This? today: feedback. Not the comments &#8211; that&#8217;s been there from the start &#8211; but a way of sending immediate feedback on specific results. So that if you disagree with the result, or you know the correct language but it&#8217;s not [...]]]></description>
			<content:encoded><![CDATA[<p>I got around to implementing a feature I&#8217;ve been planning for <a href="http://whatlanguageisthis.com/" style="font-weight: bold; font-style: italic;" >What Language Is This?</a> today: <span style="font-weight: bold;">feedback</span>. Not the comments &#8211; that&#8217;s been there from the start &#8211; but a way of sending immediate feedback on specific results. So that if you disagree with the result, or you know the correct language but it&#8217;s not yet supported, just click on <span style="font-style: italic;">&#8220;send feedback&#8221;</span> that appears with each result, and a simple form pops up that where you can indicate what the problem with that result is.</p>
<p><a href="http://henrikfalck.com/blog/uploaded_images/language-identifier-feedback-782126.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px; height: 261px;" src="http://henrikfalck.com/blog/uploaded_images/language-identifier-feedback-782122.jpg" alt="" border="0" /></a><br />The entered text can also be sent with the feedback, allowing me to gather more sample texts to use as material for the statistical analysis used as a basis when identifying the language, and for testing (there&#8217;s an automatic test feature built in to <a href="http://whatlanguageisthis.com/" >What Language Is This?</a>, just run <span style="font-family: courier new;">selftest()</span> from a JavaScript console on the page and it&#8217;ll test all supported languages to check for regressions &#8211; very handy when updating the database, since it&#8217;s easy to accidentally break some of the fine tuning).</p>
<p>Anyway, I think it&#8217;ll be useful, and I hope everyone will use it a lot since it&#8217;ll help me improve the site. I&#8217;m already getting a lot of useful and encouraging comments so it&#8217;s really fun to keep on developing it. For the next update I&#8217;ll probably add more languages.</p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2009/02/new-feedback-feature-for-what-language.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What Language Is This? Dot Com!</title>
		<link>http://henrikfalck.com/blog/2008/07/what-language-is-this-dot-com.html</link>
		<comments>http://henrikfalck.com/blog/2008/07/what-language-is-this-dot-com.html#comments</comments>
		<pubDate>Sat, 05 Jul 2008 07:40:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[language analyzer]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2008/07/what-language-is-this-dot-com.html</guid>
		<description><![CDATA[http://whatlanguageisthis.com/
Since the language analyzer is becoming one of the most used web services that I run, the other day I was thinking that it would be cool get it its own domain (and a .com domain costs just 50 SEK (around 850 yen in normal times) anyway). So I was thinking about what domain name [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-size:130%;"><a href="http://whatlanguageisthis.com/" >http://whatlanguageisthis.com/</a></p>
<p></span>Since the <a href="http://henrikfalck.com/languageanalyzer/" style="font-weight: bold;" >language analyzer</a> is becoming <span style="font-weight: bold; font-style: italic;">one of the most used web services</span> that I run, the other day I was thinking that <span style="font-style: italic;">it would be cool get it its own domain</span> (and a .com domain costs just 50 SEK (around 850 yen in normal times) anyway). So I was thinking about what domain name to get &#8211; that isn&#8217;t already taken &#8211; and well, one of the most common search phrases people use to find the language analyzer is &#8220;what language is this webpage/blog/text/whatever&#8221; and luckily <a href="http://whatlanguageisthis.com/" style="font-weight: bold;" >whatlanguageisthis.com</a> was available, <span style="font-style: italic; font-weight: bold;">so there it is!</span> I think it&#8217;s quite easy to remember and very easy to tell people. 4 stars out of 5, perhaps? Pretty good.</p>
<p><a href="http://www.spamula.net/blog/i17/babel1.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer; width: 400px;" src="http://www.spamula.net/blog/i17/babel1.jpg" alt="" border="0" /></a><br />Setting up the new site was pretty easy; it&#8217;s essentially just a php script that chdirs into the language analyzer directory and continues from there as before.</p>
<p>I also did another nice update: the data file that the app uses to identify the language is now downloaded after the page and all the application javascript files have loaded. That means the page should load much faster, and the user can start reading the instructions or entering text while the data is being downloaded in the background. If the user clicks &#8220;Go&#8221; before the data file is downloaded, it will stop and wait, while displaying a typical web 2.0-ish loading indicator.</p>
<p>I&#8217;m planning to add support for more languages soon, and improve identification of similar-looking languages even further. Anyway, here&#8217;s the url for the new site again:<br /><span style="font-size:130%;"><a href="http://whatlanguageisthis.com/" >http://whatlanguageisthis.com/</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2008/07/what-language-is-this-dot-com.html/feed</wfw:commentRss>
		<slash:comments>55</slash:comments>
		</item>
		<item>
		<title>Updated the Language Identifier with ranking of most popular languages right now</title>
		<link>http://henrikfalck.com/blog/2008/05/updated-language-identifier-with.html</link>
		<comments>http://henrikfalck.com/blog/2008/05/updated-language-identifier-with.html#comments</comments>
		<pubDate>Sat, 10 May 2008 04:07:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[language analyzer]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2008/05/updated-the-language-identifier-with-ranking-of-most-popular-languages-right-now.html</guid>
		<description><![CDATA[Over time I&#8217;ve been making some smaller changes to the language analyzer (my language identification web app), like manually tuning it to better distinguish between hard-to-distinguish languages, like the Scandinavian languages, Serbian-Bosnian-Croatian-Slovenian, Afrikaans and Dutch, and Czech and Slovak.
But I&#8217;ve been wondering what languages people use it for, so yesterday evening, while drinking shochu (in [...]]]></description>
			<content:encoded><![CDATA[<p>Over time I&#8217;ve been making some smaller changes to the <a href="http://henrikfalck.com/languageanalyzer/" >language analyzer</a> (my language identification web app), like manually tuning it to better distinguish between hard-to-distinguish languages, like the Scandinavian languages, Serbian-Bosnian-Croatian-Slovenian, Afrikaans and Dutch, and Czech and Slovak.</p>
<p><span style="font-weight: bold; font-style: italic;">But I&#8217;ve been wondering what languages people use it for</span>, so yesterday evening, while drinking <span style="font-weight: bold;">shochu</span> (in spite of which I could only find one bug today! but I did write a processing and database-intensive function, n00b style, which I replaced with a single SQL query today&#8230;), I added <span style="font-weight: bold;">logging of the results</span>. Only when the language identification certainty is reasonably high is it logged, and only the result; the actual text inputted is not sent. This, of course, happens in the background. A language is only logged once per client, and results from clicking the &#8220;example&#8221; button (Tower of Babel extracts &#8211; I like that story) are not logged.</p>
<p>This morning I added the <span style="font-weight: bold;">top ranking</span> to the page. It&#8217;s generated on the server side in order for the search engines to see it. The top 5 languages for the past seven days are printed. At this time, i.e. about 15 hours after the result logging started, these are <span style="font-weight: bold;">Spanish</span>, <span style="font-weight: bold;">Korean</span>, <span style="font-weight: bold;">Portuguese</span>, and <span style="font-weight: bold;">Thai</span><span style="font-weight: bold;"></span>.</p>
<p>You can see the currently most inputted languages live: <a href="http://henrikfalck.com/languageanalyzer/" >http://henrikfalck.com/languageanalyzer/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2008/05/updated-language-identifier-with.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Amazing Language Analyzer Web Application</title>
		<link>http://henrikfalck.com/blog/2008/01/amazing-language-analyzer-web.html</link>
		<comments>http://henrikfalck.com/blog/2008/01/amazing-language-analyzer-web.html#comments</comments>
		<pubDate>Sun, 27 Jan 2008 06:52:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[language analyzer]]></category>
		<category><![CDATA[web apps]]></category>
		<category><![CDATA[widgets]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2008/01/the-amazing-language-analyzer-web-application.html</guid>
		<description><![CDATA[&#8220;Have you ever wondered what language a blog entry you glanced at might be in?&#8221; was the question I set out to work on more than two years ago, if memory serves me right. I always get curious when I see a blog post in an unknown language. I mean not just a language I [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-weight: bold; font-style: italic;">&#8220;Have you ever wondered what language a blog entry you glanced at might be in?&#8221;</span> was the question I set out to work on more than two years ago, if memory serves me right. I always get curious when I see a blog post in an unknown language. I mean not just a language I don&#8217;t speak &#8211; <span style="font-style: italic;">a language I can&#8217;t identify</span>.</p>
<p><a href="http://henrikfalck.com/blog/uploaded_images/languageanalyzer-screenshot-740993.png" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://henrikfalck.com/blog/uploaded_images/languageanalyzer-screenshot-740989.png" alt="" border="0" /></a><br />I thought it would be a really hard problem to solve &#8211; writing a piece of software that could figure that out. It turned out not to be so hard though. Just hours of programming, and probably a lot of luck. Because my initial hunches on how to tune the algorithms proved to be pretty right, and I was, and still am, really startled at how good the software became.</p>
<p>I released it as the <a href="http://widgets.opera.com/widget/detail/5619/" >Wørd &#8211; Language Analyzer</a> Opera widget. Unfortunately the target audience for Opera widgets is quite small, so I always thought of making it into a web page. I don&#8217;t know why it took so long, but <a href="http://henrikfalck.com/languageanalyzer/" >here it is</a>!</p>
<p>The web page version has some new, cool improvements. It will try to detect as you&#8217;re typing, for instance. It also has improved support for Swedish, Serbian, and Afrikaans. And the UI is in my opinion better than the widget version.</p>
<p>So please try it yourself and see how it works. It&#8217;s pretty fun to just copy-paste any piece of text your can find on the Internet into it, or just type something in a language you know yourself and see when it gets it right. Here&#8217;s the address again:</p>
<p><a href="http://henrikfalck.com/languageanalyzer/" ><span style="font-size:130%;">http://henrikfalck.com/languageanalyzer/</span></a></p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2008/01/amazing-language-analyzer-web.html/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Online Sudoku Alpha Release!</title>
		<link>http://henrikfalck.com/blog/2007/09/online-sudoku-alpha-release.html</link>
		<comments>http://henrikfalck.com/blog/2007/09/online-sudoku-alpha-release.html#comments</comments>
		<pubDate>Mon, 24 Sep 2007 05:38:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[sudoku]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2007/09/online-sudoku-alpha-release.html</guid>
		<description><![CDATA[I tried to fight the urge to make a web-based sudoku, but well I just couldn&#8217;t keep it up, so after I released Minesweeper I got started. Actually one of the reasons I wanted to do it was to see how much could be reused from Minesweeper to Sudoku &#8211; after all the basics are [...]]]></description>
			<content:encoded><![CDATA[<p>I tried to fight the urge to make a <span style="font-weight: bold; font-style: italic;">web-based sudoku</span>, but well I just couldn&#8217;t keep it up, so after I released <a href="http://henrikfalck.com/minesweeper/" >Minesweeper</a> I got started. Actually one of the reasons I wanted to do it was to see how much could be reused from Minesweeper to <a href="http://henrikfalck.com/sudoku/" >Sudoku</a> &#8211; after all the basics are the same: a grid game field that the player modifies until it reaches a goal configuration.</p>
<p><a href="http://henrikfalck.com/sudoku/" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0px auto 10px; display: block; text-align: center; cursor: pointer;" src="http://henrikfalck.com/blog/uploaded_images/sudoku-777872.png" alt="" border="0" /></a><br />But there are big differences as well. Where minesweeper starts with a randomly generated field, sudoku requires a puzzle to be correct, i.e. soluble with only one valid solution. The greatest challenge though, is to rate the difficulty of a given puzzle. Fortunately, I found <a rel="nofollow" href="http://www.research.att.com/%7Egsf/sudoku/sudoku.html" >one good program</a> that can both generate and rate puzzles. My Sudoku game has an <span style="font-weight: bold; font-style: italic;">online database of thousands of puzzles</span>, separated into <span style="font-weight: bold; font-style: italic;">five difficulty levels</span>. Of course, it also has <span style="font-weight: bold; font-style: italic;">online high scores</span>, just like Minesweeper.</p>
<p>I&#8217;m calling it an &#8220;alpha&#8221; though, because I actually suck at sudoku, so I can&#8217;t really test it myself yet. I&#8217;ve invited people whom I know like solving sudoku puzzles to test it, and <span style="font-weight: bold; font-style: italic;">you&#8217;re invited as well!</span> Please <span style="font-weight: bold;">add your comments</span> to this blog post, and I will be extremely thankful. Things I&#8217;m looking at specifically are:
<ul>
<li>Are the difficulty levels correctly rated?</li>
<li>Are the puzzles &#8220;good&#8221;?</li>
<li>How can the interface be improved? I know sudoku software usually has some methods for making notations as you solve the puzzle. The next step will be to add that, but how should they be designed?</li>
<li>Any improvements you&#8217;d like to see.</li>
<li>Any bugs you find.</li>
</ul>
<p>So please, <span style="font-style: italic;">start solving those puzzles!</span> <img src='http://henrikfalck.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br /><span style="font-size:130%;"><a href="http://henrikfalck.com/sudoku/" >http://henrikfalck.com/sudoku/</a></span></p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2007/09/online-sudoku-alpha-release.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>What is Web 3.0?</title>
		<link>http://henrikfalck.com/blog/2007/09/what-is-web-30.html</link>
		<comments>http://henrikfalck.com/blog/2007/09/what-is-web-30.html#comments</comments>
		<pubDate>Tue, 18 Sep 2007 04:43:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[mysticism]]></category>
		<category><![CDATA[web 3.0]]></category>
		<category><![CDATA[web apps]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2007/09/what-is-web-3-0.html</guid>
		<description><![CDATA[I found this video today where Eric Schmidt (of Google) answers the question &#8220;what is web 3.0?&#8221;. The guy (with The Christian Look) who asks the question boldly asserts that we know what web 2.0 is&#8230; do we? Anyway,

&#8220;Web 2.0 is a term that corresponds to Ajax.&#8221;My standard answer to &#8220;what is web 2.0?&#8221; would [...]]]></description>
			<content:encoded><![CDATA[<p>I found this video today where Eric Schmidt (of <span style="font-weight: bold;">Google</span>) answers the question <span style="font-weight: bold; font-style: italic;">&#8220;what is web 3.0?&#8221;</span>. The guy (with <span style="font-style: italic;">The Christian Look</span>) who asks the question boldly asserts that <span style="font-weight: bold; font-style: italic;">we know what web 2.0 is</span>&#8230; do we? Anyway,</p>
<p><a rel="nofollow" href="http://www.youtube.com/v/T0QJmmdw3b0" style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" ></a><a rel="nofollow" href="http://www.youtube.com/v/T0QJmmdw3b0" style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" ></a><a rel="nofollow" href="http://www.youtube.com/v/T0QJmmdw3b0" style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" ></a><a rel="nofollow" href="http://www.youtube.com/v/T0QJmmdw3b0" style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" ></a><a rel="nofollow" href="http://www.youtube.com/v/T0QJmmdw3b0" style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" ></a><a rel="nofollow" href="http://www.youtube.com/v/T0QJmmdw3b0" style="left: 0px ! important; top: 15px ! important;" title="Click here to block this object with Adblock Plus" class="abp-objtab visible ontop" ></a><object height="350" width="425"><param name="movie" value="http://www.youtube.com/v/T0QJmmdw3b0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/T0QJmmdw3b0" type="application/x-shockwave-flash" wmode="transparent" height="350" width="425"></embed></object></p>
<p><span style="font-size:130%;"><span style="font-weight: bold; font-style: italic;">&#8220;Web 2.0 is a term that corresponds to Ajax.&#8221;</span></span><br />My standard answer to <span style="font-style: italic;">&#8220;what is web 2.0?&#8221;</span> would be something along the lines of &#8220;it&#8217;s about <span style="font-weight: bold;">control of users and data</span>&#8220;, i.e. you build a big web site where users can generate the content, market it, and pray you&#8217;ll be among the 1% that are somewhat successful. Then you capitalize on providing pieces of that data. <span style="font-weight: bold; font-style: italic;">Google if anyone should know that.</span> <span style="font-weight: bold;">Ajax</span> (or whatever you choose to call it) is a technology that is certainly a part of the modern web, but really, aren&#8217;t pastel colors and rounded corners more important for a web 2.0 site? even if you build it with old-fashioned server-side scripts only. Ajax as a technology is an enabler, not a necessity.</p>
<p><span style="font-size:130%;"><span style="font-weight: bold; font-style: italic;">&#8220;[Web 3.0] is a different way of building applications.&#8221;</span><br /></span>Yes, maybe that too. The web by the time 3.0 comes around is bound to have some new technology &#8211; or rather some new uses of the technologies we have. And this will allow us to make applications in a different way. So the statement is trivially true, but it does not provide a definition or even a speculation of what web 3.0 will be like. Let&#8217;s move on&#8230;</p>
<p>
<div style="text-align: center;"><a href="http://henrikfalck.com/blog/uploaded_images/2007-09-16-19.03.16-793770.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer;" src="http://henrikfalck.com/blog/uploaded_images/2007-09-16-19.03.16-792942.jpg" alt="" border="0" /></a></div>
<p><span style="font-size:130%;"><span style="font-weight: bold; font-style: italic;">&#8220;Web 3.0 will be applications that are pieced together.&#8221;</span><br /></span>This is more interesting. Like <span style="font-weight: bold;">mashups</span>? I&#8217;m sure all of us computer software users would like to have that. But I&#8217;ll believe it when I see it: applications from different vendors cooperating. So far unix system tools are the only ones to come close to this ideal. Unfortunately, I don&#8217;t think this is realistic for web apps.</p>
<p><span style="font-size:130%;"><span style="font-weight: bold; font-style: italic;">&#8220;The applications are relatively small&#8221; </span><br /></span>Now this is one of my favorite pet peeves. I nagged a bit about this on my <a href="http://henrikfalck.com/blog/2007/06/css-nite-vol-19-recap-and-sequel.html" >CSS Nite presentation </a>as well: Right now, many people, and especially <span style="font-weight: bold;">Apple</span>, are thinking of web apps/widgets/gadgets as small, more-or-less useless applications for trivial tasks such as analog clocks or calculators, or something that in the very least is separated from the tasks of &#8220;real&#8221; applications. <span style="font-style: italic;">I don&#8217;t agree with this at all</span>&#8230;</p>
<p>Consider Mac OS with its <span style="font-weight: bold;">Dashboard</span> (even though it is a great reification of the ideal of web tech-based apps): you have a &#8220;normal&#8221; mode; your normal apps, running along in their windows as usual, and a &#8220;widgets&#8221; mode; your normal apps&#8212;no wait, these aren&#8217;t normal apps &#8211; these are <span style="font-style: italic;">widgets</span>, special kind of apps made in a special, even naive, kind of way, to be run in a sandbox isolated from your normal desktop working environment. Even Opera has copied this thinking.</p>
<p>This is definitely how it is right now, so I can understand Apple&#8217;s decision. But <span style="font-style: italic;">I don&#8217;t think it&#8217;s how it will be</span>, in the future, boys and girls. <span style="font-style: italic;">Web technology-based application will be just as common as other applications</span>, I think. And in a few years they will be just as big as well. Many have tried to achieve this before &#8211; Java and Dotnet come to mind &#8211; but <span style="font-weight: bold; font-style: italic;">web technology has already won</span>. I thought a lot about this, and I&#8217;ll write about it some time.
<div style="text-align: center;"><a href="http://henrikfalck.com/blog/uploaded_images/2007-09-16-11.10.25-775612.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer;" src="http://henrikfalck.com/blog/uploaded_images/2007-09-16-11.10.25-774818.jpg" alt="" border="0" /></a></div>
<p><span style="font-size:130%;"><span style="font-weight: bold; font-style: italic;">&#8220;The data is in the cloud&#8221;</span></span><br />I want some of what you&#8217;re smoking too dude, but <span style="font-style: italic;">there is no cloud</span>. Data belongs to somebody, access is restricted, bandwidth is limited. <span style="font-weight: bold; font-style: italic;">The Internet is not a cloud</span> (it&#8217;s a series of tubes).</p>
<p>There are a few more goodies in the video. Anyway, <span style="font-weight: bold; font-style: italic;">what will the web 3.0 be like?</span> I mean, if you can figure that out now, <span style="font-style: italic;">you&#8217;ll be a billionaire</span>. I think I have pretty decent idea, and I&#8217;ll continue writing about <a href="http://henrikfalck.com/blog/labels/web%203.0.html" >web 3.0</a> here in this blog. I think and hope that <span style="font-style: italic;">Google won&#8217;t be playing a big part in it</span>. (<a rel="nofollow" href="http://www.pbs.org/cringely/pulpit/2007/pulpit_20070914_002928.html" >They might be absorbed into something bigger</a>, though).</p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2007/09/what-is-web-30.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Reducing Bandwidth Usage when Deploying Web Applications</title>
		<link>http://henrikfalck.com/blog/2007/08/reducing-bandwidth-usage-when-deploying.html</link>
		<comments>http://henrikfalck.com/blog/2007/08/reducing-bandwidth-usage-when-deploying.html#comments</comments>
		<pubDate>Mon, 13 Aug 2007 10:44:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[uncategorized]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[tricks]]></category>
		<category><![CDATA[web apps]]></category>
		<category><![CDATA[www]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2007/08/reducing-bandwidth-usage-when-deploying-web-applications.html</guid>
		<description><![CDATA[&#8230; by serving your JavaScript source code files as one big gzipped file. Nowadays when we&#8217;re getting more and more nice applications (and widgets, gadgets, mashups, and whatnots) running on the web, there&#8217;s a lot of talk about user experience and stuff, which involves the whole experience of using a web site. Good content, design, [...]]]></description>
			<content:encoded><![CDATA[<p><a rel="nofollow" href="http://media.urbandictionary.com/image/large/internet-24591.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0pt 0pt 10px 10px; float: right; cursor: pointer; width: 200px;" src="http://media.urbandictionary.com/image/large/internet-24591.jpg" alt="" border="0" /></a><br />&#8230; <span style="font-weight: bold; font-style: italic;">by serving your JavaScript source code files as one big gzipped file</span>. Nowadays when we&#8217;re getting more and more nice applications (and widgets, gadgets, mashups, and whatnots) running on the web, there&#8217;s a lot of talk about <span style="font-weight: bold;">user experience</span> and stuff, which involves the whole experience of using a web site. Good content, design, and fancy programming, of course make up the core of a good user experience. But we all wants sites to be quick and responsive to load too, right?</p>
<p>This trick is so simple and incredibly easy to pull off that you have no reason not to do it. There are essentially three things involved:
<ol>
<li>Make apache serve .gz.js files with gzip transfer encoding</li>
<li>Bundle up all your JavaScript files into one (or a few) big file(s)</li>
<li>Gzip your One Big File(s)</li>
</ol>
<p>Let&#8217;s go through these step by step&#8230;</p>
<p><span style="font-size:130%;">1. Make apache serve .gz.js files with gzip transfer encoding<br /></span><span style="font-weight: bold; font-style: italic;">Gzip transfer encoding is great!</span> The only bad thing about it is that on dynamic content, the web server will have to use up some processing power to compress the files on the fly, but in this case, we&#8217;re serving static JavaScript source files, so that&#8217;s not even an argument! (As for the client, if it&#8217;s got enough CPU to run your web app, it&#8217;s not gonna have any trouble doing a little unzipping&#8230;)</p>
<p>The easiest way to do this is to edit the <span style="font-weight: bold;">.htaccess</span> config file in the directory where you put your JavaScript files, or any directory above that one to make it more global. The only thing you have to do is <span style="font-weight: bold;">add the following line</span>:<br /><span style="font-family:courier new;">AddEncoding x-gzip gz</span></p>
<p>This adds the gzip transfer encoding to apache for files with a &#8220;gz&#8221; file extension.</p>
<p>Notice the title says &#8220;.gz.js&#8221; though: by adding &#8220;.js&#8221; at the end, <span style="font-weight: bold; font-style: italic;">the files will be served correctly with the text/javascript mime type</span>. Otherwise the browser might go berserk. That&#8217;s also why I wouldn&#8217;t recommend using &#8220;.js.gz&#8221;; it&#8217;ll get served with gzip transfer encoding alright, but not with the JavaScript mimetype.</p>
<p>This solution works even with clients that don&#8217;t support the gzip transfer encoding, because web browsers send an &#8220;accept-encoding&#8221; header that tells the server which encodings the client supports, so apache won&#8217;t use gzip transfer encoding if it&#8217;s not supported by the client.</p>
<p><span style="font-size:130%;">2. Bundle up your JavaScript source file into one (or a few) big file(s)</span><br />This means simply appending all your source files to one file. Or a few files. I usually bundle up the libraries/utility code etc, i.e. code that you don&#8217;t change very often, into one file and the rest of the app into one file that gets updated more often. You can do this by copy-pasting in your text editor if you like, or make a script that does it. I usually have the whole deployment process automated on the server, which I&#8217;ll write about some other time perhaps.</p>
<p>Another good way to do it is using <a href="http://alex.dojotoolkit.org/shrinksafe/" >Dojo ShrinkSafe</a>. ShrinkSafe will not only append all your source files into one big file, but also reduce the size even further by optimizing the JavaScript code. However, I have had problems with scripts not running correctly (in all browsers) after running them through ShrinkSafe, despite their claims of it being &#8220;safe&#8221;. I would especially recommend not using the &#8220;strip newline chars?&#8221; option. Anyway, the file size reduction the results from using ShrinkSafe is small compared to just gzipping the files (I&#8217;ll show you some numbers later) so if you&#8217;re afraid of regressions, don&#8217;t use it.</p>
<p><span style="font-size:130%;">3. Gzip your One Big File(s)</span><br />Now that you&#8217;ve got one or two or so JavaScript files, you need to gzip them into a gzip file. You can use the command-line gzip tool on the server to do this, like:<br /><span style="font-family:courier new;">gzip -n9c <span style="font-style: italic;">scriptfile</span>.js > <span style="font-style: italic;">scriptfile</span>.gz.js</span></p>
<p>The -n option means to not store the the original file name in the gzip file. No big deal if you do, but there&#8217;s no reason to do it either. -9 means maximum compression. I like doing things to the extreme! And -c means to write to standard output instead of modifying the source file, so we need to pipe it &#8220;>&#8221; to a .gz.js file at the end. Or you can use a UI tool such as <a href="http://www.7-zip.org/" >7-Zip</a> that supports gzip compression. That&#8217;s just damn easy.</p>
<p>Then upload the .gz.js script file to your server, and change all your old <span style="font-family:courier new;">&lt;script&gt;</span> tags for every file you had to one pointing to it. I.e. like:<br /><span style="font-family:courier new;">&lt;script type=&#8221;text/javascript&#8221; src=&#8221;<span style="font-style:italic;">scriptfile</span>.gz.js&#8221;&gt;&lt;/script&gt;</span><br />That&#8217;s all there is to it!</p>
<p><span style="font-size:130%;">Show Me The Numbers!</span><br />Let&#8217;s use my <a href="http://henrikfalck.com/minesweeper/" >Minesweeper</a> game for comparison. The code is served in two files: libs.gz.js containing Prototype and Scriptaculous core and Effects libraries, and minesweeper.gz.js containing the actual game. The breakdown of the files in these libraries before combining them is as follows (at the time of writing):</p>
<p><span style="font-weight: bold;">Original</span><br />libs.js: 95 kB + 3 kB + 38 kB = 135 kB<br />minesweeper.js: 3 + 9 + 9 + 4 + 2 = 25 kB</p>
<p><span style="font-weight: bold;">Shrunk</span><br />libs.js: 92 kB (32% smaller)<br />minesweeper.js: 13 kB (48% smaller)</p>
<p><span style="font-weight: bold;"></span><span style="font-weight: bold;">Gzipped</span><br />libs.js: 30 kB (78% smaller)<br />minesweeper.js: 7 kB (72% smaller)</p>
<p><span style="font-weight: bold;"></span><span style="font-weight: bold;">Shrunk + gzipped</span><br />libs.js: 27 kB (80% smaller)<br />minesweeper.js: 4 kB (84% smaller)</p>
<p><a href="http://www.stalltheball.com/media/users/johnstal/series_of_tubes.jpg" onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" ><img style="margin: 0pt 10px 10px 0pt; float: left; cursor: pointer; width: 200px;" src="http://www.stalltheball.com/media/users/johnstal/series_of_tubes.jpg" alt="" border="0" /></a>Now, add to that the fact that <span style="font-weight: bold; font-style: italic;">every HTTP request for a file incurs a 1 kB overhead</span> in HTTP headers, and you get an original total amount transferred of 135 + 25 + 8 = 168 kB compared to 27 + 4 + 2 = 33 kB, i.e. a total saving of 135 kB, i.e. <span style="font-size:130%;"><span style="font-weight: bold; font-style: italic;">80% less bandwidth used</span></span>, not to mention that making <span style="font-weight: bold; font-style: italic;">two http requests is much faster than making eight</span> http requests!</p>
<p>The next step would be to bundle up html, css, scripts, and everything you possibly can into one request&#8230; (In fact, I have scripts doing that automatically at runtime on some sites&#8230;) But you have to draw the line somewhere. There&#8217;s a definite trade off in maintainability, <a href="http://henrikfalck.com/blog/2007/07/caching-in-php.html" >cachability</a>, and compatibility of the site. So I&#8217;ll stop here.</p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2007/08/reducing-bandwidth-usage-when-deploying.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Minesweeper!</title>
		<link>http://henrikfalck.com/blog/2007/08/minesweeper.html</link>
		<comments>http://henrikfalck.com/blog/2007/08/minesweeper.html#comments</comments>
		<pubDate>Thu, 02 Aug 2007 14:39:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[games]]></category>
		<category><![CDATA[minesweeper]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2007/08/minesweeper.html</guid>
		<description><![CDATA[Finally! My Minesweeper game is ready for the web! It&#8217;s the classic game in a web 2.0 costume. Why did I do that? when surely it&#8217;s been done before. Because I like minesweeper.
Developing this game has taught me one something about the time it can take from prototype to somewhat finished product: Developing the completely [...]]]></description>
			<content:encoded><![CDATA[<p>Finally! My <a href="http://henrikfalck.com/minesweeper/" ><span style="font-weight: bold;">Minesweeper</span></a> game is ready for the web! It&#8217;s the classic game in a web 2.0 costume. Why did I do that? when surely it&#8217;s been done before. Because I like minesweeper.</p>
<p>Developing this game has taught me one something about <span style="font-style: italic; font-weight: bold;">the time it can take from prototype to somewhat finished product</span>: Developing the completely playable &#8220;offline&#8221; prototype version was quick and easy &#8211; after all, I developed minesweeper already in <span style="font-weight: bold;">high school</span> on my programmable Casio calculator. So I thought it would take about trice the time to finish it, but in the end it took about <span style="font-weight: bold;">ten times that time</span>.</p>
<p>One reason for this is the <span style="font-weight: bold;">online highscore</span> functionality. <span style="font-style: italic;">But T-rex, online highscores just means keeping a list of the best times on the server and sending it to the client.</span> Yes, but then it wouldn&#8217;t take much to figure that all you need to do is type &#8220;register_highscore.php?time=0&#038;name=script%20kiddie&#8221; into your browser&#8217;s address field to get an <span style="font-weight: bold;">instant all-time high</span>. So how did I solve that?</p>
<p><span style="font-weight: bold; font-style: italic;">The game is played simultaneously on the client</span> (i.e. in the web browser) <span style="font-weight: bold; font-style: italic;">and on the server</span> (in php). Sweeps are sent at regular intervals to the server, which then plays the same moves and checks the results. So in the end it&#8217;s <span style="font-weight: bold;">the server that decides</span> that a game is over, how long it took, and whether that&#8217;s a new highscore or not. That, ideally, is not so complicated either, but well there are lots of opportunities to make <span style="font-weight: bold;">stupid mistakes</span>. (Especially when you&#8217;re having a shochu on the rocks while coding (I did it during my vacation).)</p>
<p><span style="font-weight: bold; font-style: italic;">The other reason</span> is that it&#8217;s <span style="font-weight: bold; font-style: italic;">hard to make a web app behave like a nifty game</span>. You need graphics, animations, and that kind of stuff that often causes you to run into problems with layout positioning and, most of all, <span style="font-weight: bold;">browser inconsistencies</span>. <span style="font-style: italic;"><span style="font-weight: bold;">Web browsers just aren&#8217;t ideal for making applications yet</span>.</span> (Well, tell me a platform that is, anyway&#8230;) The game runs best, as always, in Firefox. Although I admit I haven&#8217;t tried IE 6 yet. I&#8217;ll tackle that beast tomorrow. <img src='http://henrikfalck.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  IE 7 works good, though.</p>
<p>I still have a number of features planned that I&#8217;ll implement during the coming weeks, but at least now it&#8217;s good enough to play. Try and beat my times! Here&#8217;s the url again:</p>
<p><a href="http://henrikfalck.com/minesweeper/" >http://henrikfalck.com/minesweeper/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2007/08/minesweeper.html/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A JavaScript messaging library</title>
		<link>http://henrikfalck.com/blog/2007/07/javascript-messaging-library.html</link>
		<comments>http://henrikfalck.com/blog/2007/07/javascript-messaging-library.html#comments</comments>
		<pubDate>Thu, 05 Jul 2007 12:03:00 +0000</pubDate>
		<dc:creator>Henrik Falck</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[messagelib]]></category>
		<category><![CDATA[paintmyblog]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web apps]]></category>

		<guid isPermaLink="false">http://henrikfalck.com/blog2/2007/07/a-javascript-messaging-library.html</guid>
		<description><![CDATA[I&#8217;m working on a library for sending messages between browsers using JavaScript, XMLHttpRequest, and PHP/sqlite on a server. The idea is that even though it&#8217;s not possible to open a connection of sorts directly between the clients (i.e. web browsers viewing a page, or even different pages, or running a widget), you can pull for [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a library for sending messages between browsers using JavaScript, XMLHttpRequest, and PHP/sqlite on a server. The idea is that even though it&#8217;s not possible to open a connection of sorts directly between the clients (i.e. web browsers viewing a page, or even different pages, or running a widget), you can pull for updates in a way that will make it seem like you have a connection open. Not only that, but all client listening on the same channel, so to speak, will receive the messages, so it&#8217;s like broadcasting. Technically this is nothing fancy, it&#8217;s just that you don&#8217;t see it much, and if implemented and packaged nicely I think it&#8217;ll be useful and fun to use.</p>
<p>How do I know this works? Because it&#8217;s based on a much cleaned up version of the code used on <a href="http://paintmyblog.com/" >paintmyblog.com</a> &#8211; which has proven itself already. I look forward to writing some cool apps using this library, and I hope other people will use it as well. Expect the first release next week.</p>
]]></content:encoded>
			<wfw:commentRss>http://henrikfalck.com/blog/2007/07/javascript-messaging-library.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
