<?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>Rexxars.com</title>
	<atom:link href="http://rexxars.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://rexxars.com</link>
	<description>A developers perspective on PHP, Android, MooTools and other awesomeness.</description>
	<lastBuildDate>Fri, 23 Jul 2010 13:47:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Android application: Agricola Buddy</title>
		<link>http://rexxars.com/android/agricola-buddy/</link>
		<comments>http://rexxars.com/android/agricola-buddy/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 13:37:42 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[agricola]]></category>
		<category><![CDATA[application]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=160</guid>
		<description><![CDATA[Yesterday, I released an Android application on the Android Market; Agricola Buddy. For months now, we&#8217;ve had regular games of the Agricola board game at work. It&#8217;s a real gem of a game, and in my opinion perfect for &#8220;thinkers&#8221; &#8211; like programmers usually are. The application helps you with calculating the score for each [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday, I released an Android application on the Android Market; <a href="http://agricola-buddy.rexxars.com/">Agricola Buddy</a>.</p>
<p>For months now, we&#8217;ve had regular games of the Agricola board game at work. It&#8217;s a real gem of a game, and in my opinion perfect for &#8220;thinkers&#8221; &#8211; like programmers usually are.</p>
<p><a href="http://rexxars.com/wp-content/uploads/2010/07/chart.png"><img src="http://rexxars.com/wp-content/uploads/2010/07/chart.png" alt="Scan to download" title="QR-code" width="140" height="140" class="alignright size-full wp-image-167" style="border:0;" /></a></p>
<p>The application helps you with calculating the score for each player in the game, which is done at the end of each game. While far from a necessity when playing, it provided me with an opportunity to create and release an application of limited size and complexity.</p>
<p>You can find the application on the Android Market, just search for &#8220;Agricola Buddy&#8221; or scan the QR-code to the right.</p>
<p>In the future, I hope to add lots of cool features to it &#8211; a way to store results over time, submit to a webservice, easily share the results with others, occupation/minor improvement reference and so on. If you have an Android phone, give it a go <img src='http://rexxars.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
<p>Here are some screenshots:</p>
<p><a href="http://rexxars.com/wp-content/uploads/2010/07/player.png" style="margin-right: 20px;"><img title="Choose player" src="http://rexxars.com/wp-content/uploads/2010/07/player-200x300.png" alt="" width="200" height="300" /></a><a href="http://rexxars.com/wp-content/uploads/2010/07/scoring.png"><img title="Scoring" src="http://rexxars.com/wp-content/uploads/2010/07/scoring-200x300.png" alt="" width="200" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/android/agricola-buddy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Android emulator skin: Sony Ericsson X10 Mini</title>
		<link>http://rexxars.com/android/emulator-skin-sony-ericsson-x10-mini/</link>
		<comments>http://rexxars.com/android/emulator-skin-sony-ericsson-x10-mini/#comments</comments>
		<pubDate>Thu, 08 Jul 2010 14:39:12 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[skin]]></category>
		<category><![CDATA[sonyericsson]]></category>
		<category><![CDATA[x10mini]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=151</guid>
		<description><![CDATA[Been a while since I made my Samsung Galaxy skin. Since then, a ton of Android phones have arrived and many of them with different resolutions than the &#8220;normal&#8221; HVGA. A popular one in Europe is the X10 Mini, from Sony Ericsson which has a QVGA resolution. When you are creating Android applications, you should [...]]]></description>
			<content:encoded><![CDATA[<p>Been a while since I made my <a href="http://rexxars.com/android/android-emulator-skin-samsung-galaxy/">Samsung Galaxy</a> skin. Since then, a ton of Android phones have arrived and many of them with different resolutions than the &#8220;normal&#8221; HVGA.</p>
<p>A popular one in Europe is the <em>X10 Mini</em>, from Sony Ericsson which has a QVGA resolution.</p>
<p>When you are creating Android applications, you should make sure that it works well on various resolutions, which the emulator helps you with. However, the built in QVGA skin is rather ugly, so I decided to try and whip up a skin based on the X10 Mini. Here&#8217;s what I ended up with:</p>
<p style="text-align: center;"><a href="http://rexxars.com/wp-content/uploads/2010/07/x10miniskin.jpg" target="_blank"><img class="aligncenter size-medium wp-image-152" title="Sony Ericsson X10 Mini Android Skin" src="http://rexxars.com/wp-content/uploads/2010/07/x10miniskin-300x237.jpg" alt="Sony Ericsson X10 Mini Android Skin" width="300" height="237" /></a></p>
<p>I quite like it, and it also works fairly well on low-resolution monitors, such as on netbooks (at least it does on mine). I zipped it up and <a href="http://rexxars.com/files/android/emulator-skins/X10Mini.zip">put it up for download</a>. To use it:</p>
<ol>
<li>Extract the zip file into your <strong>Android/platforms/android-&lt;version&gt;/skins</strong> folder.</li>
<li>Create a new AVD with the AVD Manager and select X10Mini from the skins dropdown.</li>
<li>If you want to get as close to the X10 Mini software, use the 1.6 image (<strong>android-4</strong>, I believe).</li>
<li>Enjoy!</li>
</ol>
<p><strong>Note</strong>: I forgot to include the hardware.ini file required for 1.6+. Should work better now <img src='http://rexxars.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/android/emulator-skin-sony-ericsson-x10-mini/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Calling Javascript from Silverlight</title>
		<link>http://rexxars.com/silverlight/calling-javascript-from-silverlight/</link>
		<comments>http://rexxars.com/silverlight/calling-javascript-from-silverlight/#comments</comments>
		<pubDate>Thu, 06 May 2010 20:49:54 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=120</guid>
		<description><![CDATA[Over the past month or two, I&#8217;ve been learning Silverlight at work, so I might put up a few posts when I encounter interesting topics. The solutions I post might not be the best way of doing things, obviously Integrating Silverlight into a rich, Javascript-driven website, I found myself wanting to call Javascript functions from [...]]]></description>
			<content:encoded><![CDATA[<p>Over the past month or two, I&#8217;ve been learning Silverlight at work, so I might put up a few posts when I encounter interesting topics. The solutions I post might not be the best way of doing things, obviously <img src='http://rexxars.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Integrating Silverlight into a rich, Javascript-driven website, I found myself wanting to call Javascript functions from Silverlight. A quick Google search told me this was possible, using the <a href="http://msdn.microsoft.com/en-us/library/system.windows.browser.scriptobject.invoke%28v=VS.95%29.aspx">HtmlPage.Window.Invoke</a> method. You could also use the Eval method, but it feels like a dirty hack,<br />
so let&#8217;s not go there.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p120code4'); return false;">View Code</a> CSHARP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1204"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p120code4"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF; font-weight: bold;">private</span> <span style="color: #6666cc; font-weight: bold;">void</span> displayDialog<span style="color: #008000;">&#40;</span><span style="color: #6666cc; font-weight: bold;">string</span> message<span style="color: #008000;">&#41;</span>
<span style="color: #008000;">&#123;</span>
	HtmlPage<span style="color: #008000;">.</span><span style="color: #0000FF;">Window</span><span style="color: #008000;">.</span><span style="color: #0000FF;">Invoke</span><span style="color: #008000;">&#40;</span><span style="color: #666666;">&quot;showSomeDialog&quot;</span>, message<span style="color: #008000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #008000;">&#125;</span></pre></td></tr></table></div>

<p>Easy, right? But like a good Javascript-coder, I like to &#8220;namespace&#8221; my methods, instead of leaving lots of global functions around. The invoke method seems to call global objects only, so I can&#8217;t do <strong>Invoke(&#8220;Rexxars.showSomeDialog&#8221;, &#8220;message&#8221;)</strong> &#8211; which is a shame. So I thought to myself, I&#8217;ll just create a &#8220;proxy&#8221; function which calls methods in my namespace. Simple:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p120code5'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1205"><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code" id="p120code5"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> slBridge<span style="color: #009900;">&#40;</span>method<span style="color: #339933;">,</span> arg<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>Rexxars<span style="color: #009900;">&#91;</span>method<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		Rexxars<span style="color: #009900;">&#91;</span>method<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#40;</span>arg<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Now I can do: <strong>HtmlPage.Window.Invoke(&#8220;slBridge&#8221;, &#8220;showSomeDialog&#8221;, message);</strong> &#8211; cool. But what if I want to call a function with more than one argument? I further improved my Silverlight-Javascript &#8220;bridge&#8221; to support a variable number of arguments:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p120code6'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1206"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code" id="p120code6"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> slBridge<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #006600; font-style: italic;">// Turn the arguments object into a regular, usable array</span>
	<span style="color: #003366; font-weight: bold;">var</span> args <span style="color: #339933;">=</span> Array.<span style="color: #660066;">prototype</span>.<span style="color: #660066;">slice</span>.<span style="color: #660066;">call</span><span style="color: #009900;">&#40;</span>arguments<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">// Method name is the first argument and should not be included</span>
	<span style="color: #003366; font-weight: bold;">var</span> method <span style="color: #339933;">=</span> args.<span style="color: #660066;">shift</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #006600; font-style: italic;">// Make sure the method exists inside our namespace</span>
	<span style="color: #000066; font-weight: bold;">if</span><span style="color: #009900;">&#40;</span>Rexxars<span style="color: #009900;">&#91;</span>method<span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #006600; font-style: italic;">// Call the method with the arguments passed</span>
		Rexxars<span style="color: #009900;">&#91;</span>method<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">apply</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">,</span> args<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Simple, eh? Now I can use the slBridge function to call any method inside my Rexxars namespace, with different number of arguments in each. Sweet! <img src='http://rexxars.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/silverlight/calling-javascript-from-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codename Eagle Nation is back online</title>
		<link>http://rexxars.com/cenation/codename-eagle-nation-back-online/</link>
		<comments>http://rexxars.com/cenation/codename-eagle-nation-back-online/#comments</comments>
		<pubDate>Tue, 30 Mar 2010 20:40:37 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[CE Nation]]></category>
		<category><![CDATA[codename-eagle]]></category>
		<category><![CDATA[gaming]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=100</guid>
		<description><![CDATA[9 years ago, I started a fan site dedicated to the game called Codename Eagle. In 2005, I shut the website down due to a lack of time. A couple of weeks ago, some friends of mine brought up the old game and we had a blast playing again. After searching for some info on [...]]]></description>
			<content:encoded><![CDATA[<p>9 years ago, I started a fan site dedicated to the game called Codename Eagle. In 2005, I shut the website down due to a lack of time. A couple of weeks ago, some friends of mine brought up the old game and we had a blast playing again. After searching for some info on it online, I found there was very little information available on the game, so I decided to quickly throw together a reference site on the game for anyone who was looking for information on it.</p>
<p>It&#8217;s now online at <a href="http://codenameeagle.net/">codenameeagle.net</a> &#8211; I suggest you check out the unofficial multiplayer demo &#8211; it&#8217;s a real blast at any LAN party. Definitely worth a try!</p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/cenation/codename-eagle-nation-back-online/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>MooTools IdleTimer</title>
		<link>http://rexxars.com/mootools/idletimer/</link>
		<comments>http://rexxars.com/mootools/idletimer/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 10:30:29 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Mootools]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[forge]]></category>
		<category><![CDATA[idletimer]]></category>
		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=81</guid>
		<description><![CDATA[Have you ever wanted to log a user out of your site if he is inactive for a given amount of time? Create a better user experience by dimming or hiding page elements while the user is watching a video? A couple of months ago I came across Nick Zakas&#8217; YUI approach to this problem, [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted to log a user out of your site if he is inactive for a given amount of time?<br />
Create a better user experience by dimming or hiding page elements while the user is watching a video?</p>
<p><img class="alignright" title="Mootools IdleTimer" src="http://rexxars.com/project/idletimer/title.png" alt="" width="185" height="78" /></p>
<p>A couple of months ago I came across Nick Zakas&#8217; <a href="http://www.nczonline.net/blog/2009/06/02/detecting-if-the-user-is-idle-with-javascript-and-yui-3/">YUI approach</a> to this problem, and recently I found Paul Irish&#8217;s <a href="http://paulirish.com/2009/jquery-idletimer-plugin/">jQuery plugin</a> which was based on Nick&#8217;s work.</p>
<p>This is my attempt at creating a Mootools class that uses the same approach. Quite simply, it fires a timer that activates a callback after a given amount of time. The timer is reset if the user moves the mouse, presses a key, scrolls using the scroll wheel or clicks any mouse button. This has to be done over the active document, obviously.</p>
<p>Key features:</p>
<ul>
<li>Can be attached to a single element on the page or the entire document/window.</li>
<li>Lets you set up multiple instances with different timeouts and events.</li>
<li>Easily retrieve the idle status from the instance using the isIdle property.</li>
<li>Find the number of milliseconds since the user was last active.</li>
<li>Allows you to call the active() method to manually reset the idle state &#8211; useful for Flash and other overlays that lets you communicate with Javascript.</li>
<li>Easily retrieve an IdleTimer instance using element.get(&#8216;idle&#8217;, { options });</li>
<li>Free and open source. MIT-licensed.</li>
</ul>
<p>Check out the <a href="http://rexxars.com/project/idletimer/">demo page</a> for more details. The source is available on <a href="http://github.com/rexxars/IdleTimer">Github</a> as well as in the recently opened <a href="http://mootools.net/forge/">MooTools Forge</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/mootools/idletimer/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ØnskerSeg.no is now live</title>
		<link>http://rexxars.com/%c3%b8nsker-seg/%c3%b8nskerseg-no-is-now-live/</link>
		<comments>http://rexxars.com/%c3%b8nsker-seg/%c3%b8nskerseg-no-is-now-live/#comments</comments>
		<pubDate>Mon, 07 Dec 2009 22:10:47 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Ønsker Seg]]></category>
		<category><![CDATA[project]]></category>
		<category><![CDATA[website]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=73</guid>
		<description><![CDATA[My new project, ØnskerSeg.no is now live. &#8220;Ønsker Seg&#8221; is a service that lets you create and share wishlists with people you know. Each user gets a simple and easy to remember URL, x.onskerseg.no. For now, the service is only available in Norwegian, but if I have enough time it would be fun to make [...]]]></description>
			<content:encoded><![CDATA[<p>My new project, <a href="http://onskerseg.no/">ØnskerSeg.no</a> is now live.</p>
<p>&#8220;Ønsker Seg&#8221; is a service that lets you create and share wishlists with people you know. Each user gets a simple and easy to remember URL, x.onskerseg.no. For now, the service is only available in Norwegian, but if I have enough time it would be fun to make it &#8220;international&#8221;.</p>
<p>It&#8217;s not often I have the time or dedication to finish a project like this, so I&#8217;m very happy to see it online and I&#8217;m going to keep adding features to it. So if you&#8217;re Norwegian and you&#8217;re looking for a simple way to create and share wishlists, <a href="http://onskerseg.no/">take a look</a>!</p>
<div id="attachment_74" class="wp-caption aligncenter" style="width: 310px"><img class="size-full wp-image-74" title="ØnskerSeg.no - the new Norwegian wish list service" src="http://rexxars.com/wp-content/uploads/2009/12/onskerseg.png" alt="My latest project, ØnskerSeg.no" width="300" height="181" /><p class="wp-caption-text">My latest project, ØnskerSeg.no</p></div>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/%c3%b8nsker-seg/%c3%b8nskerseg-no-is-now-live/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Selecting all checkboxes in a group with Mootools, one-liner</title>
		<link>http://rexxars.com/mootools/selecting-all-checkboxes-in-a-group-with-mootools/</link>
		<comments>http://rexxars.com/mootools/selecting-all-checkboxes-in-a-group-with-mootools/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 19:07:16 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Mootools]]></category>
		<category><![CDATA[html]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=57</guid>
		<description><![CDATA[How many times have you had to do one of these things? A group of items, each with a checkbox. You want a button/checkbox to select all the checkboxes within that group. I ran across this again today, and making the javascript to do the work I was once again reminded why I love Mootools [...]]]></description>
			<content:encoded><![CDATA[<div style="float: left;">
<div id="attachment_58" class="wp-caption alignleft" style="width: 264px"><img class="size-full wp-image-58 " title="checkboxes" src="http://rexxars.com/wp-content/uploads/2009/08/checkboxes.jpg" alt="Fairly common..?" width="254" height="275" /><p class="wp-caption-text">Fairly common..?</p></div>
</div>
<p>How many times have you had to do one of these things? A group of items, each with a checkbox. You want a button/checkbox to select all the checkboxes within that group.</p>
<p>I ran across this again today, and making the javascript to do the work I was once again reminded why I love Mootools so much:</p>
<p>With just three lines of code (1 line to do the actual checking/unchecking), I had this up and running. It couldn&#8217;t have taken longer than 30 seconds to write. I love quick snippets <img src='http://rexxars.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Obviously, this wouldn&#8217;t be hard to do in jQuery or any other JS framework, but I love how elegant and intuitive Mootools does it. I shudder when I think of how many times I&#8217;ve done things similar to this in plain old Javascript.</p>
<p>Anyway, there&#8217;s a <a href="http://rexxars.com/snippets/checkbox-magic/">demo page</a> available, and here&#8217;s the code I ended up with, for anyone interested:<br />
<br style="clear: left;" /></p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p57code8'); return false;">View Code</a> JAVASCRIPT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p578"><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code" id="p57code8"><pre class="javascript" style="font-family:monospace;">$$<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'li.head input[type=checkbox]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">addEvent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><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;">getParent</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'ul'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">getElements</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'input[type=checkbox]'</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">setProperty</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'checked'</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">checked</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></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/mootools/selecting-all-checkboxes-in-a-group-with-mootools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to make a bootable USB/thumb drive</title>
		<link>http://rexxars.com/hardware/how-to-make-a-bootable-usb-thumb-drive/</link>
		<comments>http://rexxars.com/hardware/how-to-make-a-bootable-usb-thumb-drive/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 23:10:02 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Hardware]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[floppy]]></category>
		<category><![CDATA[thumbdrive]]></category>
		<category><![CDATA[usb]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=52</guid>
		<description><![CDATA[My fileserver has 10 disks in a linear setup (JBOD, BIG, whatever you want to call it). I&#8217;ve been using software raid on Linux to do this. Today, one of the drives seemed to fail, giving me a read-only filesystem. Without too much experience in the field, I assume this harddrive is on it&#8217;s way [...]]]></description>
			<content:encoded><![CDATA[<p>My fileserver has 10 disks in a linear setup (JBOD, BIG, whatever you want to call it). I&#8217;ve been using software raid on Linux to do this. Today, one of the drives seemed to fail, giving me a read-only filesystem. Without too much experience in the field, I assume this harddrive is on it&#8217;s way out. I did a simple disk info and found it was 1 of 3 Samsung drives&#8230; Which one though? And is it really faulty?</p>
<p>I downloaded a utility from Samsung that lets you run a disk diagnostic, which would hopefully give me an answer to that question. However, I had to choose between a bootable CD and a floppy, neither of which works for me since I don&#8217;t have an optical drive or a floppy drive in the fileserver. So! Here&#8217;s how I made a bootable USB thumb drive:</p>
<p>Note: This will only give you a bootable MS DOS drive.</p>
<ol>
<li>Download the &#8220;HP USB Disk Storage Format Tool&#8221; from <a href="http://www.bootdisk.com/pendrive.htm">bootdisk.com</a> (it&#8217;s under &#8220;method 2&#8243;, first link, currently version 2.0.6)</li>
<li>Install the app.</li>
<li>You will need the files from a MS DOS boot floppy. You can get plenty of different versions from <a href="http://bootdisk.com/bootdisk.htm">bootdisk.com</a>. I chose the Windows 98 OEM version.</li>
<li>Most of these will want to write straight to a floppy (to get the boot sector right). If you&#8217;re like me and a don&#8217;t have a floppy drive anymore, you can download and run an awesome little app called <a href="http://chitchat.at.infoseek.co.jp/vmware/vfd.html">Virtual Floppy Drive</a>. This will emulate a floppy drive on your windows box. Pretty awesome for stuff like this.</li>
<li>Create the floppy using the downloaded boot disk creator.</li>
<li>Insert an appropriate USB thumb drive into the system. I&#8217;ve tried different drives and it handles most of them just fine. This time I used a simple MicroSD =&gt; USB adapter and a small memory card.</li>
<li>Run the HP USB Disk Storage Format Tool thingy, select your USB device, select FAT as the file system, choose a quick format and to create a DOS startup disk. Browse to your (virtual?) floppy drive and click OK, then Start.</li>
<li>When it&#8217;s done, feel free to copy any applications you want to run from it over to the thumb drive. I downloaded the bootable CD diagnostics from Samsung, opened the ISO file and extracted the application files onto my thumb drive.</li>
<li>Plug it into whatever system you want to boot, be sure to set the BIOS to boot from it and you should be good to go <img src='http://rexxars.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </li>
</ol>
<p>Hope this helps someone, it took me a little while to figure this out a while ago and figured I&#8217;d write a small howto.</p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/hardware/how-to-make-a-bootable-usb-thumb-drive/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Android emulator skin: Samsung Galaxy</title>
		<link>http://rexxars.com/android/android-emulator-skin-samsung-galaxy/</link>
		<comments>http://rexxars.com/android/android-emulator-skin-samsung-galaxy/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 19:13:24 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[emulator]]></category>
		<category><![CDATA[galaxy]]></category>
		<category><![CDATA[samsung]]></category>
		<category><![CDATA[skin]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=47</guid>
		<description><![CDATA[I&#8217;ve been developing some Android stuff lately, and finding it a real joy to work with. It gets rather tiresome to look at the same fake phone all the time though, so I decided to take a break and see if I could create a skin based on the upcoming Samsung i7500 (I believe they&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been developing some Android stuff lately, and finding it a real joy to work with.</p>
<p>It gets rather tiresome to look at the same fake phone all the time though, so I decided to take a break and see if I could create a skin based on the upcoming Samsung i7500 (I believe they&#8217;ve named it Galaxy now, at least in Germany). The screen position and such may not be spot on, but it has the right resolution at least. I mapped most of the buttons too, but the zones had to be cut off a little due to the emulator not supporting weird button shapes (afaik).</p>
<p>Should anyone be interested in downloading it, <a href="http://rexxars.com/files/android/emulator-skins/Galaxy.zip">feel free to get it</a>. Just extract this to your Android/platforms/android-&lt;version&gt;/skins folder and you should be good to go. Run the emulator with the flag &#8220;-skin Galaxy&#8221; (or if you&#8217;re using Android 1.5 or upwards, just select Galaxy as your skin in the AVD Manager). Here&#8217;s a screenshot of how it looks in action:</p>
<div class="wp-caption aligncenter" style="width: 129px"><a href="http://rexxars.com/files/android/emulator-skins/galaxy.jpg"><img title="Samsung Galaxy Android Emulator skin" src="http://rexxars.com/files/android/emulator-skins/galaxy-thumb.jpg" alt="Samsung Galaxy Android Emulator skin" width="119" height="232" /></a><p class="wp-caption-text">Samsung Galaxy Android Emulator skin</p></div>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/android/android-emulator-skin-samsung-galaxy/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Forcing files to be interpreted as PHP with Apache</title>
		<link>http://rexxars.com/apache/forcing-files-to-be-interpreted-as-php-with-apache/</link>
		<comments>http://rexxars.com/apache/forcing-files-to-be-interpreted-as-php-with-apache/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 15:25:57 +0000</pubDate>
		<dc:creator>Rexxars</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://rexxars.com/?p=44</guid>
		<description><![CDATA[I&#8217;ve been writing a couple of web services lately which returns XML data. If I&#8217;m on a deadline and just have to get it up and running, I usually don&#8217;t care for small details, but a hobby project is another matter. When I have the time, I like to sit and tweak the code to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been writing a couple of web services lately which returns XML data. If I&#8217;m on a deadline and just have to get it up and running, I usually don&#8217;t care for small details, but a hobby project is another matter. When I have the time, I like to sit and tweak the code to get the response looking as clean as possible, giving meaningful error messages, logging errors to files etc.</p>
<p>Let&#8217;s say I&#8217;m writing an application that retrieves a list of notes from a web service. The URL for retrieving the XML data would most often look something like:</p>
<pre style="padding-left: 30px;">http://whatever.webservice.com/feeds/latest.php?since=timestamp</pre>
<p>Which is fine, except one little aspect: it doesn&#8217;t tell me if I am getting data back as XML, JSON, CSV or in some other format. I would much rather prefer to have this specified in the URL. Examples of good, clean URLs would be any of the following:</p>
<pre style="padding-left: 30px;">http://whatever.webservice.com/feeds/<span style="color: #ff0000;">xml</span>/latest.php?since=timestamp
http://whatever.webservice.com/feeds/latest.php?<span style="color: #ff0000;">format=xml</span>&amp;since=timestamp
http://whatever.webservice.com/feeds/latest<span style="color: #ff0000;">.xml</span>?since=timestamp
</pre>
<p>I personally think the last one is the prettiest. There are reasons why the two first might be &#8220;better&#8221; from a code and performance perspective though:</p>
<ul>
<li>The subdirectory method could handle outputting of the data in that format and only that format, not needing any if-checks.</li>
<li>The query parameter method could handle a lot of different formats in the same file, and would simply call the correct function to retrieve the data in the correct format.</li>
</ul>
<p>The last one was what I went for in the end. The problem with that is making Apache understand that this &#8220;XML&#8221; file is really a PHP file. I solved this easily with this simple  .htaccess file, which forces every XML file within the directory you place it in to be run through PHP:</p>
<pre style="padding-left: 30px;">&lt;Files *.xml&gt;
ForceType application/x-httpd-php
&lt;/Files&gt;
</pre>
<p>Sending the correct headers is also a bonus:</p>
<pre style="padding-left: 30px;">&lt;?php
header('Content-Type: text/xml; charset=utf-8');
</pre>
<p>Worth the effort? You tell me <img src='http://rexxars.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://rexxars.com/apache/forcing-files-to-be-interpreted-as-php-with-apache/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
