<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss 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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Rob Searles</title>
	
	<link>http://www.robsearles.com</link>
	<description>Musing on the business of and development for "The Web"</description>
	<lastBuildDate>Thu, 03 Dec 2009 23:14:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/RobSearles" /><feedburner:info uri="robsearles" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Understanding Bitwise Operators (hopefully)</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/dQ91q5OuDZg/</link>
		<comments>http://www.robsearles.com/2009/12/04/understanding-bitwise-operators-hopefully/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 23:13:02 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=256</guid>
		<description><![CDATA[After the trouble I had with bitwise operators yesterday I found some time to really sit down and get my head properly around them. Let&#8217;s dive straight in.
We need to initially define our flags:

define&#40;'BASE', 0&#41;; // binary 00000000
define&#40;'F1', 1&#41;;   // binary 00000001
define&#40;'F2', 2&#41;;   // binary 00000010
define&#40;'F3', 4&#41;;   // binary 00000100

To start with we have no [...]]]></description>
			<content:encoded><![CDATA[<p>After the <a href="http://www.robsearles.com/2009/12/02/bitwise-operators-used-for-flagging-items-part-1/">trouble I had with bitwise operators yesterday</a> I found some time to really sit down and get my head properly around them. Let&#8217;s dive straight in.</p>
<p>We need to initially define our flags:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'BASE'</span><span style="color: #339933;">,</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span>; <span style="color: #666666; font-style: italic;">// binary 00000000</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'F1'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>;   <span style="color: #666666; font-style: italic;">// binary 00000001</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'F2'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>;   <span style="color: #666666; font-style: italic;">// binary 00000010</span>
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'F3'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span>;   <span style="color: #666666; font-style: italic;">// binary 00000100</span></pre></div></div>

<p>To start with we have no flags set, so if we set F1 using the following:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$f1_set</span> <span style="color: #339933;">=</span> BASE <span style="color: #339933;">+</span> F1; <span style="color: #666666; font-style: italic;">// $f1_set = 1</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;F1 set = $f1_set<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>All is well and good, $f1_set = 1 as expected.</p>
<p>However, what if we set F1 again?</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$f1_set_twice</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_set</span> <span style="color: #339933;">+</span> F1; <span style="color: #666666; font-style: italic;">// $f1_set_twice = 2 !!! wrong !!!</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;F1 set twice = $f1_set_twice<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>As you can see, if we set F1 twice, it effectively &#8220;unsets&#8221; F1 and sets F2. Not what we were after.</p>
<p>So why is this? Well, it&#8217;s kind of obvious and I was being a bit of a muppet for not spotting it yesterday. The reason is pretty simple: 1 + 1 = 2. (I told you it was obvious!)</p>
<p>Clearly this is not what we want, but how can we solve this? By using the bitwise OR. If we change the statements slightly as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$f1_or_set</span> <span style="color: #339933;">=</span> BASE | F1; <span style="color: #666666; font-style: italic;">// $f1_or_set = 1</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;F1 OR set = $f1_or_set<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$f1_or_set_twice</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_or_set</span> | F1; <span style="color: #666666; font-style: italic;">// $f1_or_set_twice = 1 - huzzah!</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;F1 OR set twice = $f1_or_set_twice<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>As far as &#8220;unsetting&#8221; the flags if we use my original method we fall (again) into trouble.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">=</span> BASE | F1 | F3; <span style="color: #666666; font-style: italic;">// $f1_and_f3 = 5;</span>
<span style="color: #000088;">$unset_f3</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">-</span> F3; <span style="color: #666666; font-style: italic;">// $unset_f3 = 1</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Unset F3 = $unset_f3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$unset_f1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">-</span> F1; <span style="color: #666666; font-style: italic;">// $unset_f1 = 4;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Unset F1 = $unset_f1<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>Now, if we try to &#8220;unset&#8221; F1 twice, we arrive at the problem.</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$unset_f1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">-</span> F1; <span style="color: #666666; font-style: italic;">// $unset_f1 = 3;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Unset F1 = $unset_f1<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>Unsetting F1 twice here effectively turns off F3 and sets F1 and F2 &#8211; completely wrong!</p>
<p>Instead, if we use the &amp;~ binary operator mentioned in <a href="http://www.robsearles.com/2009/12/02/bitwise-operators-used-for-flagging-items-part-1/#disqus_thread">Jesper&#8217;s comment</a> all works as expected. (note: I can&#8217;t find mention of this operator in the PHP docs, please someone help me out)</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">=</span> BASE | F1 | F3; <span style="color: #666666; font-style: italic;">// $f1_and_f3 = 5;</span>
<span style="color: #000088;">$unset_f3</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">&amp;</span>amp;~ F3; <span style="color: #666666; font-style: italic;">// $unset_f3 = 1</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Unset F3 = $unset_f3<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$unset_f1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">&amp;</span>amp;~ F1; <span style="color: #666666; font-style: italic;">// $unset_f1 = 4;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Unset F1 = $unset_f1<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>Even if we try to &#8220;unset&#8221; a flag twice, it still has the same results:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$unset_f1</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_and_f3</span> <span style="color: #339933;">&amp;</span>amp;~ F1; <span style="color: #666666; font-style: italic;">// $unset_f1 = 4;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Unset F1 = $unset_f1<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$unset_f1_twice</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$unset_f1</span> <span style="color: #339933;">&amp;</span>amp;~ F1; <span style="color: #666666; font-style: italic;">// $unset_f1_twice = 4;</span>
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Unset F1 twice = $unset_f1_twice<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>Also in Jesper&#8217;s comment and <a href="http://noehr.org/2009/08/27/bitwise-permissions-in-python-and-django/">original post</a> was the use of the left shift operator: &lt;&lt;. After playing around with this it seems very simple to use, as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$f1</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>;    <span style="color: #666666; font-style: italic;">// 00000001</span>
<span style="color: #000088;">$f2</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">1</span>; <span style="color: #666666; font-style: italic;">// 00000010</span>
<span style="color: #000088;">$f3</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">2</span>; <span style="color: #666666; font-style: italic;">// 00000100</span>
<span style="color: #000088;">$f4</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">3</span>; <span style="color: #666666; font-style: italic;">// 00001000</span></pre></div></div>

<p>Or to put it another way:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #000088;">$f1</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span>;      <span style="color: #666666; font-style: italic;">// 00000001</span>
<span style="color: #000088;">$f2</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">1</span>; <span style="color: #666666; font-style: italic;">// 00000010</span>
<span style="color: #000088;">$f3</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f2</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">1</span>; <span style="color: #666666; font-style: italic;">// 00000100</span>
<span style="color: #000088;">$f4</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f3</span><span style="color: #339933;">&lt;&lt;</span><span style="color: #cc66cc;">1</span>; <span style="color: #666666; font-style: italic;">// 00001000</span></pre></div></div>

<p>After all this I think I am a little closer to understanding Bitwise operations, hopefully! Tomorrow I&#8217;ll have a crack at testing to see if a flag is turned on or not. Until then&#8230;</p>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=256&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=dQ91q5OuDZg:yqfrZtPbZcQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/dQ91q5OuDZg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/12/04/understanding-bitwise-operators-hopefully/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/12/04/understanding-bitwise-operators-hopefully/</feedburner:origLink></item>
		<item>
		<title>Bitwise Operators used for Flagging Items</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/BQ1FFmwhb7g/</link>
		<comments>http://www.robsearles.com/2009/12/02/bitwise-operators-used-for-flagging-items-part-1/#comments</comments>
		<pubDate>Wed, 02 Dec 2009 17:34:21 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=245</guid>
		<description><![CDATA[I have always wondered what the point of Bitwise Operators were,to me they seem to belong to a distant past. However, after reading a couple of great blog posts I have at last an understanding of how they can be put to use, and have started playing around with them a bit (ba dum!).]]></description>
			<content:encoded><![CDATA[<p><strong>Update</strong>: Thanks to <a href="http://noehr.org/">Jesper Noehr</a> of <a href="http://bitbucket.org/">BitBucket</a> fame for pointing out <strong>gaping flaws</strong> in my post below (<a href="/2009/12/02/bitwise-operators-used-for-flagging-items-part-1/#disqus_thread">see his comment</a>). I strongly advise you disregard all I have said below, because it will get you into a mess, in much the same way it has me. I&#8217;m going to sit down when I have a spare 1/2 hour and try to work out exactly what is going on! Many thanks and big kudos to Jesper, I really appreciate the time you took to correct me.</p>
<hr />
<p>I have always wondered what the point of <a href="http://en.wikipedia.org/wiki/Bitwise_operation">Bitwise Operators</a> were,to me they seem to belong to a distant past. However, after reading a couple of great blog posts I have at last an understanding of how they can be put to use, and have started playing around with them a bit (ba dum!).</p>
<p>Jesper Noehr has written about using <a href="http://noehr.org/2009/08/27/bitwise-permissions-in-python-and-django/">bitwise operators for a flexible permissions scheme</a> within Python  and Jonathan Snook has taken the bitwise concept further creating a <a href="http://snook.ca/archives/javascript/creative-use-bitwise-operators">great calendar app in Javascript</a>. After reading these I thought I better dive in, and an opportunity came along yesterday when I had to code a flagging system within PHP.</p>
<p><span id="more-245"></span></p>
<p>For the benefit of this post I have greatly simplified the problem but hopefully it should be enough to get an understanding and allow you to get started with playing around with bits.</p>
<p>The problem is as follows. I have a number of items and each item has 3 different flags associated with it. We&#8217;ll call these flags F1, F2 and F3. A single item can have none, some or all flags set, and needs to have the ability to turn each flag on or off independently. The &#8220;base&#8221; state for each item is that no flags are set.</p>
<p>Each flag is a boolean, on or off, or to put it another way, 1 or 0. This translates perfectly into binary numerals. If we visualise this with a number of examples:</p>
<p><strong>No flags switched on</strong></p>
<table class="tbl-border" border="1" cellspacing="2" cellpadding="2" width="50%">
<tbody>
<tr>
<td valign="top">F1</td>
<td valign="top">F2</td>
<td valign="top">F3</td>
<td valign="top">Binary Number</td>
</tr>
<tr>
<td valign="top">0</td>
<td valign="top">0</td>
<td valign="top">0</td>
<td valign="top">0</td>
</tr>
</tbody>
</table>
<p><strong>Just F1 switched on</strong></p>
<table class="tbl-border" border="1" cellspacing="2" cellpadding="2" width="50%">
<tbody>
<tr>
<td valign="top">F1</td>
<td valign="top">F2</td>
<td valign="top">F3</td>
<td valign="top">Binary Number</td>
</tr>
<tr>
<td valign="top">1</td>
<td valign="top">0</td>
<td valign="top">0</td>
<td valign="top">001 or 1</td>
</tr>
</tbody>
</table>
<p><strong>Just F2 switched on</strong></p>
<table class="tbl-border" border="1" cellspacing="2" cellpadding="2" width="50%">
<tbody>
<tr>
<td valign="top">F1</td>
<td valign="top">F2</td>
<td valign="top">F3</td>
<td valign="top">Binary Number</td>
</tr>
<tr>
<td valign="top">0</td>
<td valign="top">1</td>
<td valign="top">0</td>
<td valign="top">010 or 10</td>
</tr>
</tbody>
</table>
<p><strong>Just F3 switched on</strong></p>
<table class="tbl-border" border="1" cellspacing="2" cellpadding="2" width="50%">
<tbody>
<tr>
<td valign="top">F1</td>
<td valign="top">F2</td>
<td valign="top">F3</td>
<td valign="top">Binary Number</td>
</tr>
<tr>
<td valign="top">0</td>
<td valign="top">0</td>
<td valign="top">1</td>
<td valign="top">100</td>
</tr>
</tbody>
</table>
<p><strong>F1 and F3 switched on</strong></p>
<table class="tbl-border" border="1" cellspacing="2" cellpadding="2" width="50%">
<tbody>
<tr>
<td valign="top">F1</td>
<td valign="top">F2</td>
<td valign="top">F3</td>
<td valign="top">Binary Number</td>
</tr>
<tr>
<td valign="top">1</td>
<td valign="top">0</td>
<td valign="top">1</td>
<td valign="top">101</td>
</tr>
</tbody>
</table>
<p>The reason we have translated the binary number for just F1 switched on to 001 and not 100 is because from a text point of view, we read F1, F2 then F3 from left to right, but from a numeric point of view we read numbers right to left, i.e. 1s then 10s then 100s then 1000s etc.</p>
<p>From the above examples, we can see that if F1 is already switched on, we can easily switch on F3 as well by simply turning on the F3 bit. We accomplish this by simply adding the F3 bit:<br />
Base + F1 + F3 = 0 + 1 + 100 = 000 + 001 + 100  = 101</p>
<p>We can also remove flags, for example if we have F3 and F1 set, but then remove F1 we have:<br />
101 &#8211; 001 = 101 &#8211; 1 = 100<br />
But even though these are all ones and noughts we can translate these into decimal. PHP has a handy little utility function for this: decbin() [http://php.net/manual/en/function.decbin.php]</p>
<table class="tbl-border" border="1" cellspacing="2" cellpadding="2" width="50%">
<tbody>
<tr>
<td valign="top">State</td>
<td valign="top">Binary</td>
<td valign="top">Decimal</td>
</tr>
<tr>
<td valign="top">All off</td>
<td valign="top">0</td>
<td valign="top">0</td>
</tr>
<tr>
<td valign="top">F1 on</td>
<td valign="top">1</td>
<td valign="top">1</td>
</tr>
<tr>
<td valign="top">F2 on</td>
<td valign="top">10</td>
<td valign="top">2</td>
</tr>
<tr>
<td valign="top">F3 on</td>
<td valign="top">100</td>
<td valign="top">4</td>
</tr>
<tr>
<td valign="top">F1 and F3 on</td>
<td valign="top">101</td>
<td valign="top">5 (1 + 4)</td>
</tr>
<tr>
<td valign="top">All on</td>
<td valign="top">111</td>
<td valign="top">7 (1 + 2 + 4)</td>
</tr>
</tbody>
</table>
<p>So now this makes it really easy to turn flags on an off.<br />
In PHP it would be as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="php php" style="font-family:monospace;"><span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'BASE'</span><span style="color: #339933;">,</span> <span style="color:#800080;">0</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'F1'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'F2'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span>;
<span style="color: #990000;">define</span><span style="color: #009900;">&#40;</span><span style="">'F3'</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">4</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;No flags = &quot;</span><span style="color: #339933;">.</span>BASE<span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;:&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">decbin</span><span style="color: #009900;">&#40;</span>BASE<span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// switching flags on</span>
<span style="color: #000088;">$f1_on</span> <span style="color: #339933;">=</span> BASE<span style="color: #339933;">+</span>F1;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Turn on F1 = $f1_on:&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">decbin</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f1_on</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$f2_on</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f1_on</span><span style="color: #339933;">+</span>F2;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Turn on F2 = $f2_on:&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">decbin</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f2_on</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$f3_on</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f2_on</span><span style="color: #339933;">+</span>F3;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Turn on F3 = $f3_on:&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">decbin</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f3_on</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #666666; font-style: italic;">// switching flags off</span>
<span style="color: #000088;">$f2_off</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f3_on</span><span style="color: #339933;">-</span>F2;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Turn off F2 = $f2_off:&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">decbin</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f2_off</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;
&nbsp;
<span style="color: #000088;">$f1_off</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$f2_off</span><span style="color: #339933;">-</span>F1;
<span style="color: #990000;">echo</span> <span style="color: #0000ff;">&quot;Turn off F1 = $f1_off:&quot;</span><span style="color: #339933;">.</span><span style="color: #990000;">decbin</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$f1_off</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">.</span><span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span>;</pre></div></div>

<p>Save this as bits.php and then run it from the command line with:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">$ php .<span style="color: #000000; font-weight: bold;">/</span>bits.php
No flags = 0:0
Turn on F1 = <span style="color: #000000;">1</span>:<span style="color: #000000;">1</span>
Turn on F2 = <span style="color: #000000;">3</span>:<span style="color: #000000;">11</span>
Turn on F3 = <span style="color: #000000;">7</span>:<span style="color: #000000;">111</span>
Turn off F2 = <span style="color: #000000;">5</span>:<span style="color: #000000;">101</span>
Turn off F1 = <span style="color: #000000;">4</span>:<span style="color: #000000;">100</span></pre></div></div>

<p>All good so far, but now we need to see if a particular flag is switched on or off. I&#8217;ll publish that in my next blog post. So stay tuned.</p>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=245&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=BQ1FFmwhb7g:fk9FrOr-lgE:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/BQ1FFmwhb7g" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/12/02/bitwise-operators-used-for-flagging-items-part-1/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/12/02/bitwise-operators-used-for-flagging-items-part-1/</feedburner:origLink></item>
		<item>
		<title>First Steps with Node.js: exciting stuff</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/-YaOSteZJ3U/</link>
		<comments>http://www.robsearles.com/2009/11/29/first-steps-with-node-js-exciting-stuff/#comments</comments>
		<pubDate>Sun, 29 Nov 2009 12:28:02 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Opinion]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=231</guid>
		<description><![CDATA[Ryan Dahl's Node.js is very exciting stuff, with lots of potential. Something to keep close track of. ]]></description>
			<content:encoded><![CDATA[<p>During my <a href="http://www.robsearles.com/2009/11/28/3-days-without-the-interwebs/">Saturday morning reading yesterday</a> I fell over something called <a href="http://nodejs.org/">Node.js</a>.  According to the website</p>
<blockquote><p>Node&#8217;s goal is to provide an easy way to build scalable network         programs.</p></blockquote>
<p>which is kind of exciting, but not mind blowing, however, Ryan Dahl&#8217;s <a href="http://github.com/ry/node">GitHub page</a> describes it as</p>
<blockquote><p><span id="repository_description">evented I/O for v8 javascript</span></p></blockquote>
<p><span>Which is slightly more exciting. However, it is when you start to play around with it that things begin to get very exciting indeed.</span></p>
<p><span><span id="more-231"></span></span></p>
<p><a href="http://simonwillison.net/2009/Nov/23/node/ ">Simon Willison&#8217;s latest blog post</a> was the first I&#8217;d heard of Node and he offers a very good introduction and tutorial, bringing in a Djanjo slant. Towards the end of the post he mentions database connectivity and when I think about the possibilities with <a href="http://couchdb.apache.org/">CouchDB</a> my mind explodes with possibilities!</p>
<p>Over at Naked Javascript, there is <a href="http://www.nakedjavascript.com/going-evented-with-nodejs">another great post</a>, offering a more detailed tutorial, including a client that gets a Twitter search. Again, this article is very enthused about Node and its future direction.</p>
<p>Ryan Dahl&#8217;s presentation on Node is hugely compelling, and provides excellent insights into the philosophy behind Node: <a href="http://s3.amazonaws.com/four.livejournal/20091117/jsconf.pdf">PDF download</a>.</p>
<p>With all this excitement in the air, I thought I better download me a copy and see what all the fuss is about.</p>
<p>Downloading and installing both <a href="http://code.google.com/apis/v8/.">Google&#8217;s V8 JavaScript Engine</a> (which Node is built upon) and Node was effortless. I won&#8217;t go into the details of installation here as it is covered in both the articles above and the Node homepage, needless to say that and I had them up and running on a clean Debian <a href="http://www.virtualbox.org/">VirtualBox</a> install in about 5 &#8211; 10 minutes.</p>
<p>I copied and pasted the &#8220;Hello World&#8221; example from Simon Willison&#8217;s article, ran it and I was away.</p>
<p>The code used is extremely simple, as you can see</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> sys <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sys'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>   http <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
http.<span style="color: #660066;">createServer</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>req<span style="color: #339933;">,</span> res<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 res.<span style="color: #660066;">sendHeader</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'Content-Type'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'text/plain'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>;
 res.<span style="color: #660066;">sendBody</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hello World'</span><span style="color: #009900;">&#41;</span>;
 res.<span style="color: #660066;">finish</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">8000</span><span style="color: #009900;">&#41;</span>;
&nbsp;
sys.<span style="color: #660066;">puts</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Server running at http://127.0.0.1:8000/'</span><span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>To run I simply ran</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">$ node hello.js
Server running at http:<span style="color: #000000; font-weight: bold;">//</span>127.0.0.1:<span style="color: #000000;">8000</span><span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>and then navigated to the page in my browser where I was greeted with a rather plain but not boring &#8220;Hello World&#8221;</p>
<p>The res.finish() call tells the client that the server has finished and it should consider the message complete.</p>
<p>This started me thinking, it would be possible to complete all the stuff that needs to be sent to the client, finish the conversation with the client, but then still carry on, without losing any efficiency. So I hacked apart the &#8220;hello world&#8221; app to see what happened if you did stuff after the send. The new code looks like this:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> sys <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'sys'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>   http <span style="color: #339933;">=</span> require<span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'http'</span><span style="color: #009900;">&#41;</span>;
&nbsp;
<span style="color: #003366; font-weight: bold;">var</span> test_func <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>
 setTimeout<span style="color: #009900;">&#40;</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>
 sys.<span style="color: #660066;">puts</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Called func'</span><span style="color: #009900;">&#41;</span>;
 <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">5000</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span>
&nbsp;
http.<span style="color: #660066;">createServer</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>req<span style="color: #339933;">,</span> res<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
 res.<span style="color: #660066;">sendHeader</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">200</span><span style="color: #339933;">,</span> <span style="color: #009900;">&#123;</span><span style="color: #3366CC;">'Content-Type'</span><span style="color: #339933;">:</span> <span style="color: #3366CC;">'text/plain'</span><span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>;
 res.<span style="color: #660066;">sendBody</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Hello World'</span><span style="color: #009900;">&#41;</span>;
 res.<span style="color: #660066;">finish</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
 test_func<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>;
<span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #CC0000;">8000</span><span style="color: #009900;">&#41;</span>;
&nbsp;
sys.<span style="color: #660066;">puts</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'Server running at http://127.0.0.1:8000/'</span><span style="color: #009900;">&#41;</span>;</pre></div></div>

<p>I added the timeout to represent time needed to execute other processes, such as connecting to a  database etc. It is heavily exaggerated but it should give me an idea what&#8217;s going on. Running the program now starts off as before:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">$ node hello.js
Server running at http:<span style="color: #000000; font-weight: bold;">//</span>127.0.0.1:<span style="color: #000000;">8000</span><span style="color: #000000; font-weight: bold;">/</span></pre></div></div>

<p>But then when navigating to the page, 5 seconds later the command line reported:</p>

<div class="wp_syntax"><div class="code"><pre class="bash bash" style="font-family:monospace;">Called func</pre></div></div>

<p>So it is clearly completing the conversation with the client first, then executing the function.</p>
<p>I have played around with <a href="http://httpd.apache.org/docs/2.0/programs/ab.html">Apache Benchmarking</a> to see how this handles large requests, and it seems to hold up, but obviously more stringent tests are required before including this technology into a production environment.</p>
<p>However, this is still very exciting. It opens up the possibility of having an HTTP server that waits for requests, getting the key information and saying &#8220;bye&#8221; before processing the request. Something like a queue server, but very fast and very efficient. And when coupled with CouchDB or similar, well, things start to get very interesting.</p>
<p>So I am going to spend the rest of this weekend hacking around with Node, I want to know everything about it, and you should too.</p>
<p>Node is definitely something to keep an eye on.</p>
<p><strong>Update</strong>: Just found another <a href="http://britg.com/2009/07/01/server-side-javascript-continued-node-js-plus-example/">good blog post</a>, this time with an example for Long Polling.</p>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=231&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=-YaOSteZJ3U:Ck_odjuShaM:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/-YaOSteZJ3U" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/11/29/first-steps-with-node-js-exciting-stuff/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/11/29/first-steps-with-node-js-exciting-stuff/</feedburner:origLink></item>
		<item>
		<title>3 days without the Interwebs</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/ZvZ96pu0fPU/</link>
		<comments>http://www.robsearles.com/2009/11/28/3-days-without-the-interwebs/#comments</comments>
		<pubDate>Sat, 28 Nov 2009 08:24:20 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=226</guid>
		<description><![CDATA[We had a bit of a nightmare over at ibrow Towers recently. Some bright spark at the building site down the road managed to cut the pipe supplying our interweb!
Disaster!
Fortunately the culprit managed to refrain from slicing all the way through, stopping just at the point to give us the drip feed equivalent of roughly [...]]]></description>
			<content:encoded><![CDATA[<p>We had a bit of a nightmare over at ibrow Towers recently. Some bright spark at the building site down the road managed to cut the pipe supplying our interweb!</p>
<p>Disaster!</p>
<p>Fortunately the culprit managed to refrain from slicing all the way through, stopping just at the point to give us the drip feed equivalent of roughly a modem circa 1997. i.e. r e a l l y slow.</p>
<p>Did we really ever live with that? How did we cope?</p>
<p>But now it is the weekend, meaning that I have some spare time at home to explore the internet again. So here are a few links that I&#8217;m going to spend my morning reading.</p>
<p><span id="more-226"></span></p>
<p>Seeing that I&#8217;ve been living like it was 1997, the first thing I thought I better read was a great TechCrunch post: <a title="What If Steve Jobs Hadn’t Returned To Apple In 1997?" rel="bookmark" href="http://www.techcrunch.com/2009/11/26/steve-jobs-apple-1997/">What If Steve Jobs Hadn’t Returned To Apple In 1997?</a> The title says it all, but it is great to think of all the &#8220;what ifs&#8221; scenarios, not just for Steve Jobs and Apple, but also what if Larry hadn&#8217;t met Sergey? Bill hadn&#8217;t met Paul? Linus favourite types of animal wasn&#8217;t a penguin? The mind boggles.</p>
<p>(Tenuous link coming up&#8230;) Talking of Larry and Sergey, now we have a larger office, we&#8217;re thinking of getting involved with the <a href="http://code.google.com/soc/">Google Summer of Code</a>, so I&#8217;m trying to find some info about 2010 and how to sign up.</p>
<p>At last! The <a href="http://linuxcritic.wordpress.com/2009/11/23/up-close-and-personal-with-lxde/">LinuxCritic(s) have posted another article</a>. Their posts normally go pretty indepth, so I&#8217;ll be reading this after hitting the &#8220;publish&#8221; button.</p>
<p>Other blogs I&#8217;m going to have a quick read over include:</p>
<ul>
<li><a href="http://caseysoftware.com/">Keith Casey</a>. I&#8217;ve been reading his blog for years, and it&#8217;s always good to catch up.</li>
<li>Another blog I&#8217;ve been reading for years is Patrick McKenzie&#8217;s <a href="http://www.kalzumeus.com/">Micro ISV on a Shoe String</a>.</li>
<li><a href="http://ma.tt/">Matt Mullenweg</a>&#8217;s (of Wordpress fame) blog can be pretty good, especially the artwork!</li>
<li>There are many more, but I need to start reading them otherwise my morning will be over.</li>
</ul>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=226&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=ZvZ96pu0fPU:gdsfG6dBo_I:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/ZvZ96pu0fPU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/11/28/3-days-without-the-interwebs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/11/28/3-days-without-the-interwebs/</feedburner:origLink></item>
		<item>
		<title>RobSearles: 1 Year Old!</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/K6iPXoCyN94/</link>
		<comments>http://www.robsearles.com/2009/11/20/one-year-ol/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 14:36:08 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=221</guid>
		<description><![CDATA[This is just a quick post to say Happy Birthday this blog. Yes, I began my little journey into the Blogosphere one year ago today. Looking back on that first article, now is a good time to see if I managed to stay focused on the topics that I laid out in the beginning, as [...]]]></description>
			<content:encoded><![CDATA[<p>This is just a quick post to say Happy Birthday this blog. Yes, I began my <a href="http://www.robsearles.com/2008/11/20/welcome-to-the-blog-of-rob-searles/">little journey into the Blogosphere</a> one year ago today. Looking back on that first article, now is a good time to see if I managed to stay focused on the topics that I laid out in the beginning, as well as looking at some stats for the year and why I&#8217;m doing this.</p>
<p><span id="more-221"></span></p>
<p>My first big regret is that I haven&#8217;t spent nearly as much time as I would have liked on Open Source and in particular <a href="http://www.timesheetng.org/" target="_blank">Timesheet NG</a>. There are a number of reasons for this. Firstly, yet again we&#8217;ve had a hectic year here at <a href="http://www.ibrow.com" target="_blank">ibrow</a>, which has consumed the majority of my time. However I think mainly it is bad organisation my end. I&#8217;m currently living a little &#8220;out of my inbox&#8221; (something that Sup is helping me to put right) without doing much forward planning.  I&#8221;m getting better at that, but it is clearly not one of my strengths! However, I am aiming to change that all, with Open Source becoming a core fixture at ibrow, and this is something we are all very keen on.</p>
<p>My lack of organisation skills have also put a dent in my consistency and frequency of posting. Some months I&#8217;ve posted nothing much, where as other months (read <a href="http://www.robsearles.com/2009/10/">October</a>) I have posted a huge amount. This is something I&#8217;m looking to put right and will be trying to consistently post at least once a week.</p>
<p>I haven&#8217;t posted nearly as enough code up here as I wanted. I think it is because of the sheer amount of time needed to create a decent blog post that is both useful, informative and the has a large amount of code in it &#8211; the formatting is a bit of a nightmare. However, again this is something I&#8217;ll be addressing over this next year.</p>
<p>Finally I&#8217;ve moved away from <a href="http://www.xfce.org/" target="_blank">XFCE4</a> (in the form of <a href="http://www.xubuntu.org/" target="_blank">Xubuntu</a>) and am now running <a href="http://www.fluxbox.org/" target="_blank">Fluxbox</a> instead. This is a truly great Window Manager, even if it still has a few glitches on my system still. I&#8217;ll definitely be posting some Fluxbox related stuff up here soon.</p>
<p>I have to admit, I was a bit disappointed in my stats as I started doing this. I had a frankly pathetic amount of visitor to this blog and I looked on whilst <a href="http://linuxcritic.wordpress.com/2009/09/29/wow-15000-hits-in-one-month/" target="_blank">others were getting thousands</a> (interesting to note that they haven&#8217;t posted for almost a month now, I wonder what&#8217;s going on). I honestly don&#8217;t know what the secret is of getting loads of visitors to a blog. This is probably why I don&#8217;t call myself a &#8220;marketing guru&#8221; and spout crap on Twitter all day long. Little dig there (<a href="http://www.robsearles.com/2009/07/15/twitter-is-bollocks/">again</a>).</p>
<p>In total I&#8217;ve had 5,634 visitors over the last year (this is according to Google Analytics). The busiest month was last month with a whopping 1,067 visits, so almost a fifth of all visitors for the year visited in October alone and November looks like it will top that. Event though this is continuing a general trend or increasing visitors each month (December only had 213!) I think there is no surprise that October was my busiest month for posting articles as well.</p>
<p>One thing I&#8217;m worried about are the pages-per-visit, bounce-rate and time-on-site &#8211; basically if visitors, once they find there way onto my blog, stay around. Looking at the evidence, clearly they are not finding much to do here, with an average for each visitor staying just over a minute.  Clearly I need to do something about the &#8220;<a href="http://www.webanalyticsworld.net/2006/07/are-you-measuring-visitor-engagement.html" target="_blank">visitor engagement</a>&#8221; as people who know more about this than me call it</p>
<p>So is it worth it? All this time and effort to create a blog that not very many people read?</p>
<p>Obviously it is disappointing that not more people are visiting my site, and those that are run screaming for the hills, but in total I&#8217;d say yes, it is worth it.  And it is worth it for these three reasons:</p>
<ol>
<li>I&#8217;m not doing this to become some sort of famous blogger and make a living out of it, I&#8217;m doing it <em>because</em> I&#8217;m making a living doing something else.</li>
<li>I find it relaxing, and when an article is finished and goes live I get a tremendous feeling of satisfaction.</li>
<li>I&#8217;m primarily writing this blog to share ideas and thoughts, and if people find them useful then, well, that&#8217;s pretty good all round.</li>
</ol>
<p>Onward to the next year!</p>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=221&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=K6iPXoCyN94:fqYhWNX3unw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/K6iPXoCyN94" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/11/20/one-year-ol/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/11/20/one-year-ol/</feedburner:origLink></item>
		<item>
		<title>Sony PRS-300 Pocket eReader Review</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/nx5OOTTnbBg/</link>
		<comments>http://www.robsearles.com/2009/11/18/sony-prs-300-pocket-ereader-review/#comments</comments>
		<pubDate>Wed, 18 Nov 2009 15:13:22 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[Reviews]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=218</guid>
		<description><![CDATA[You may have noticed I haven&#8217;t posted in a while. One of the reasons is because I have been immersed in the world of digital books. In my previous post I mentioned that I purchased myself a new toy, namely the Sony PRS-300 Pocket eReader. Now I&#8217;ve had it almost 3 weeks so I feel [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-214" title="Sony Pocket Reader PRS-300" src="http://www.robsearles.com/wp-content/uploads/2009/10/729001.jpeg" alt="Sony Pocket Reader PRS-300" width="136" height="193" />You may have noticed I haven&#8217;t posted in a while. One of the reasons is because I have been immersed in the world of digital books. In my previous post I mentioned that I purchased myself a new toy, namely the <a href="http://www.sony.co.uk/product/rd-reader-ebook/prs-300" target="_blank">Sony PRS-300 Pocket eReader</a>. Now I&#8217;ve had it almost 3 weeks so I feel I&#8217;m in a position to write a fairly accurate review and not one based solely on first impressions.</p>
<p>I&#8217;ll start with all the fluff that don&#8217;t relate to actually reading a book, then I&#8217;ll move on to what it is actually like to read.</p>
<p>I bought my Pocket Reader <a href="http://www.whsmith.co.uk/CatalogAndSearch/ProductDetails-Sony+Pocket+Reader++Silver-34170731.html" target="_blank">online from WHSmiths</a> for a very reasonable £159. I had weighed up getting the more expensive PRS-600, but decided against it as I don&#8217;t need my book to play me music, and whilst it can hold 8000 books compared to &#8220;only&#8221; 350 of the PRS-300 I&#8217;ll be impressed if I read 350 books a year!</p>
<p><span id="more-218"></span></p>
<p>Without actually ever seeing or using the larger PRS-600 I can still say that I made the right choice. The size is ideal, weight is about as much as a DVD in it&#8217;s case and it is comfortable to touch. I doesn&#8217;t have a touch screen, but this is not needed as the navigation system is very simple.</p>
<p>One other thing, the Sony PRS-300 is a beautifully designed bit of kit. I find it a joy to read because it is quite stunning to look at. They have clearly put a lot of time and effort into making a solid, attractive product.</p>
<p>When it first arrived I had to plug it in and charge it up for at least 40 minutes. It doesn&#8217;t come with a power cable (which is optional) but it uses the small USB socket similar to the HTC and Motorola mobile phones, so I simply used that charger. Once charged I connected it to my laptop running Vista (boo hiss) as it is not compatible with Linux. It didn&#8217;t come with any CDs, instead the software is on the Reader itself. Once I connected it asked me if I wanted to install it, which naturally I did, and it proceeded to download the installation files to my computer. This took a surprisingly long amount of time, probably 15-20 minutes.</p>
<p>First fail, the installation process crashed in Vista. After much searching around on the internet using the error code I managed to sort it out, but I had to re-download the installation files two or three times more. Overall it took me about an hour to get Sony&#8217;s software on to Vista.</p>
<p>At this point I was starting to think &#8220;Oh dear&#8221;!</p>
<p>It turns out that this software is actually only needed to really connect to Sony&#8217;s store. When I connected the eReader to my Ubuntu laptop it came up as an external hard drive (two external hard drives actually: Launcher and Reader). After some digging around I located where it stores it books and could copy them over no problem at all.</p>
<p>So as far as Linux users go, all is not lost!</p>
<p>Battery life appears good. The Reader is almost 3 weeks old, but it is still on 3 out of 4 bars since my first full charge the night it arrived. I have obviously had it connected to my laptop a few times to transfer books, but I am impressed with it&#8217;s endurance.</p>
<p>The navigation around your books is simple, and it has a couple of neat tricks. Firstly it remembers where you were up to for every book you are currently reading, so you can jump straight to it. Secondly you can &#8220;bookmark&#8221; pages &#8211; it quite literally &#8220;folds&#8221; the corner of the page over so you know you&#8217;ve book marked it.</p>
<p>Now, onto the meat &#8211; reading.</p>
<p>The size of the screen is good &#8211; not huge, but it is a good compromise between size of screen and size of the actual unit. The screen itself is crystal clear. There is a tiny issue that text on the far right hand side fads out slightly, but I don&#8217;t know if this is for all Sony Pocket eReaders or if it is just this one. However, it isn&#8217;t an issue I just thought I&#8217;d mention it in case anyone else has experienced this.</p>
<p>A lot of people have mentioned about the speed of changing the page. On most pages, especially plain text and ePub files, this is not normally a problem. You have to press the &#8220;turn page&#8221; button when you are on the penultimate line of the screen, but this is much the same as getting read to turn the page with a normal book.</p>
<p>However, some pages take ages to turn. I don&#8217;t know why this is. It mostly happens with PDFs, and it doesn&#8217;t seem to have anything to do with the amount of text or images on the page. I think it is something to do with the layout, being restructured. One of the worst examples I&#8217;ve seen is in the <a href="http://catb.org/esr/writings/taoup/html/graphics/taoup.pdf" target="_blank">PDF</a> of  <a href="http://catb.org/esr/writings/taoup/" target="_blank">The Art of Unix Programming.</a> The normal content pages are fine, it is the content pages that take ages, sometimes up to about 30 seconds to &#8220;turn&#8221;. There is a good trick I found out about after I managed to plough my way through every contents page of the book, and that is if you press the numbers down the right hand side, you can enter a page number to jump to.</p>
<p>That is handy!</p>
<p>Another slight irritation is that it doesn&#8217;t handle PDFs too well. I can understand why it does this, but more often than not it doesn&#8217;t format the carriage returns well enough so you could be halfway though a line and then it jumps to the next one. Also, there are quite a few times it has only one or two lines on a page.</p>
<p>Apart from the minor irritants the reading itself is fabulous! I love it. It is clear, crisp, and easy to read. The lighter your environment, the easier it is to read. It is just like a book. And the best thing of all is that it doesn&#8217;t hurt your eyes.</p>
<p>There are 3 levels of zoom, and so far I have never not been able to read anything as long as I have selected the correct zoom level for the size of the text.</p>
<p>I am so pleased I purchased the Sony PRS-300 Pocket eReader, it has revolutionised the way I am reading. It has saved my eyes from squinting at PDF on my laptop. It is very attractive, a good size and has it&#8217;s now little protective case. And possibly the single best thing with the Sony is that I finally feel that I am in the 21st Century, (and apparently I am being very smug about it!)</p>
<p>If you like reading, get this eReader.</p>
<p>Here are some other reviews:</p>
<ul>
<li><a href="http://www.the-ebook-reader.com/sony-prs-300.html" target="_blank">The-eBook-Reader.com</a></li>
<li><a href="http://kamigoroshi.net/commentary/sony-prs-300-ebook-reader-review" target="_blank">Footsteps in the Mirror</a></li>
<li><a href="http://www.teleread.org/2009/09/19/a-readers-review-of-the-sony-prs-300/" target="_blank">TeleRead: Bringing eBooks Home</a></li>
<li><a href="http://www.mobileread.com/forums/showthread.php?t=54727" target="_blank">Mobile Read: Forum</a></li>
</ul>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=218&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=nx5OOTTnbBg:994ehytDyhw:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/nx5OOTTnbBg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/11/18/sony-prs-300-pocket-ereader-review/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/11/18/sony-prs-300-pocket-ereader-review/</feedburner:origLink></item>
		<item>
		<title>Two New Toys: First Impressions</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/n6-ByqqJi7A/</link>
		<comments>http://www.robsearles.com/2009/10/31/two-new-toys-first-impressions/#comments</comments>
		<pubDate>Sat, 31 Oct 2009 18:27:44 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=210</guid>
		<description><![CDATA[First impressions of two new toys: the Microsoft Natural Ergonomic 4000 keyboard and the Sony Pocket Reader PRS-300 e-reader.]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-211 alignright" title="Microsoft Natural Ergonomic 4000 Keyboard" src="http://www.robsearles.com/wp-content/uploads/2009/10/mk_otherviews_nek4k_01.jpg" alt="Microsoft Natural Ergonomic 4000 Keyboard" width="358" height="228" />This week I purchased myself two new toys. I always do something like this around this time of year because it&#8217;s my birthday! This year I decided to get an ergonomic keyboard and an e-reader.</p>
<p>The ergonomic keyboard was the easier decision and I went with the <a href="http://www.microsoft.com/hardware/mouseandkeyboard/productdetails.aspx?pid=043" target="_blank">Microsoft Natural Ergonomic 4000</a>.One of the main reasons for this was the <a href="http://www.codinghorror.com/blog/archives/000400.html" target="_blank">Jeff Atwood blog post</a>.</p>
<p>The e-reader was much harder to choose. After much deliberation, googling, reading of reviews etc I eventually landed myself a <a href="http://www.sony.co.uk/product/rd-reader-ebook/prs-300" target="_blank">Sony Pocket Reader PRS-300</a>. I chose this over other e-readers for a number of reasons. Firstly the price was right, I didn&#8217;t really want to spend over £200 on what is effectively a fancy book. Secondly I only wanted it for reading, I didn&#8217;t care about taking notes, listening to music that kind of stuff. Finally I wanted to to be portable &#8211; obviously all readers are portable, but I wanted something that I could easily keep in a coat pocket for when I&#8217;m on a bus etc. or generally waiting around for something to happen.</p>
<p><strong>First Impressions</strong></p>
<p>The keyboard was huge! Much more so then I expected, but fortunately I have a big desk, so there was no problem there. I&#8217;ve never used an ergonomic keyboard before and I was suprised how comfortable it felt. I really thought I&#8217;d be able to enjoy typing. However, the space bar is a nightmare. Really sticky, hard to press down and very &#8220;clacky&#8221; Others have experienced this problem, but most suggested it gets &#8220;broken in&#8221; within a few days or week, so I&#8217;m not overly worried (yet).</p>
<p><img class="alignleft" title="Sony Pocket Reader PRS-300" src="../wp-content/uploads/2009/10/729001.jpeg" alt="Sony Pocket Reader PRS-300" width="136" height="193" />The Sony e-reader is just beautiful. The text is clear, navigation simple, weight nothing to speak of and the size is perfect. I am in love with it. One problem was I said I had to use Windows to connect to it, so I fired up Vista for the first time in about half a year, and after about 20 minutes of installing it crashed. It did this again a couple of times, until I found out a fix &#8211; something so do with VB script and premissions. Rather stupidly I forgot to save the link  that helped me fix the problem otherwise I would have posted it here. Sorry about that. However, it turns out I can connect to it within Ubuntu, and transfer books onto it &#8211; so that is good news.</p>
<p>I&#8217;m going to write a more substantial review for both after a couple of weeks usage, so stay tuned &#8211; <a href="http://feeds.feedburner.com/RobSearles">sign up to my RSS feed</a>.</p>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=210&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=n6-ByqqJi7A:FIb_6UAoabA:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/n6-ByqqJi7A" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/10/31/two-new-toys-first-impressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/10/31/two-new-toys-first-impressions/</feedburner:origLink></item>
		<item>
		<title>Emacs CSS-Mode Fix (adding to the chain!)</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/0VYAmnIE-K0/</link>
		<comments>http://www.robsearles.com/2009/10/29/emacs-css-mode-fix/#comments</comments>
		<pubDate>Thu, 29 Oct 2009 13:52:25 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Tutorials]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=202</guid>
		<description><![CDATA[After my week with Emacs I&#8217;m still struggling along. One of my main annoyances is the default way some of the modes indent the code. I think the worst offender of this is the default CSS-mode. After frustration when, yet again, I hit the tab key and the cursor rockets about 80 places to the [...]]]></description>
			<content:encoded><![CDATA[<p>After my <a href="http://www.robsearles.com/2009/10/19/a-week-with-emacs/" target="_blank">week with Emacs</a> I&#8217;m still struggling along. One of my main annoyances is the default way some of the modes indent the code. I think the worst offender of this is the default <a href="http://www.emacswiki.org/emacs/css-mode.el" target="_blank">CSS-mode</a>. After frustration when, yet again, I hit the tab key and the cursor rockets about 80 places to the right I decided to Google for a fix.</p>
<p><em>The internet is great!</em> Clearly it wasn&#8217;t just me having a problem, <a href="http://transcyberia.info/archives/50-fixing-emacs-css-mode.html" target="_blank">Guido Stevens</a> was also suffering and posted a fix, which he himself found on another <a href="http://www.chrisamiller.com/blog/2009/01/20/fix-css-mode-indention-in-emacs/" target="_blank">blog post by Chris Miller</a>, which Chris in turn <a href="http://www.stokebloke.com/wordpress/2008/03/21/css-mode-indent-buffer-fix/" target="_blank">found on StokeBloke.com</a> which had been found originally on a now dead post.</p>
<p>Not bad! Four people all having problems with the same thing and posting a fix for others to share. So I thought I&#8217;d join the chain, and write this blog post.</p>
<p>Oh yes, and the fix itself:</p>
<pre>;; fix css mode
(require 'css-mode)
(setq cssm-indent-level 2)
(setq cssm-newline-before-closing-bracket t)
(setq cssm-indent-function #'cssm-c-style-indenter)
(setq cssm-mirror-mode t)</pre>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=202&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=0VYAmnIE-K0:cnTf71zKm2A:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/0VYAmnIE-K0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/10/29/emacs-css-mode-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/10/29/emacs-css-mode-fix/</feedburner:origLink></item>
		<item>
		<title>A week with Emacs: one week later</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/1SnkZhUy_Ao/</link>
		<comments>http://www.robsearles.com/2009/10/25/a-week-with-emacs-one-week-later/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 22:05:59 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=196</guid>
		<description><![CDATA[I spent a week using Emacs. I wasn't easy but I survived. Read more to find out how I did.]]></description>
			<content:encoded><![CDATA[<p>As promised in <a href="http://www.robsearles.com/2009/10/19/a-week-with-emacs/" target="_blank">my last post</a>, I have spent a whole week using <a href="http://www.gnu.org/software/emacs/" target="_blank">Emacs</a>.   Apart from the odd foray with <a href="http://www.nano-editor.org/" target="_blank">Nano</a> and <a href="http://www.xfce.org/projects/mousepad/" target="_blank">Mousepad</a> I  haven&#8217;t touched <a href="http://www.eclipse.org/" target="_blank">Eclipse</a> or <a href="http://www.netbeans.org/" target="_blank">Netbeans</a> or any other IDE and  managed to stick to Emacs for the full week.</p>
<p><strong>How did it go?</strong></p>
<p>To start off it was slow. Emacs has a <a href="http://xahlee.org/emacs/emacs_fun.html" target="_blank">notoriously high learning curve</a>, and I pretty much started at the bottom. One of the reasons for doing this was so I could move away from the mouse and it turns out that the mouse is an extremely hard habit to break. So to are the keyboard arrow keys. I kept on finding my hands would instinctively  jump off the keyboard and try to double click on something, or try to navigate around the page with the arrows. This is clearly <a href="http://www.gnu.org/software/emacs/manual/html_node/emacs/Moving-Point.html#Moving-Point" target="_blank">not the way it is done</a> in Emacs!</p>
<p>The next thing I found is that Emacs doesn&#8217;t let you indent code files as you want. It seems to have a preferred method and forces it on you. This is very annoying and being a n00b I still haven&#8217;t found a way around this.</p>
<p>However, after a couple of days I began to get the hang of it. Still painfully slow, but navigating around the page, buffers and windows was becoming gradually quicker. I began to enjoy using Emacs, even though my right hand kept on unceremoniously lurching to the right from time to time.</p>
<p>By a complete coincidence, on Wednesday I was invited to <a href="http://www.c-base.org/" target="_blank">C-Base here in Berlin</a> for a beginners&#8217; introduction to Emacs. Even though it was all in German, and my Deutsch ist nicht so gut I was blown away by not only the speed but also the huge amount of functionality within Emacs. To see someone who actually knew Emacs inside out was a revelation. I made a huge amount of notes (within Emacs before you ask!) ready to test out for myself. This insight into the &#8220;how the pros use Emacs&#8221; has really been an eye-opener and I am determined to learn just a fraction of what was on display at the tutorial.</p>
<p><strong>Summing up my week with Emacs.</strong></p>
<p>It was hard work, there was much and is even more left to learn. It is a vast landscape to negotiate, with many nooks and crannies. But once it is mastered I have no doubt that my productivity will be greatly increased.</p>
<p><strong>Other people diving into Emacs</strong></p>
<ul>
<li><a href="http://sodonnell.wordpress.com/2007/06/12/choosing-an-editor/" target="_blank">Stephen O’Donnell &#8211; Choosing an Editor</a></li>
<li><big><a href="http://johnbokma.com/mexit/2008/04/16/" target="_blank">John Bokma &#8211; Emacs it is</a><br />
</big></li>
</ul>
<p><strong>Some useful sites</strong></p>
<ul>
<li><a href="http://www.gnu.org/software/emacs/manual/" target="_blank">http://www.gnu.org/software/emacs/manual/</a></li>
<li><a href="http://www.emacswiki.org/" target="_blank">http://www.emacswiki.org/</a></li>
<li><a href="http://emacsblog.org/" target="_blank">http://emacsblog.org/</a></li>
</ul>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=196&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=1SnkZhUy_Ao:V8Vqh7YheyQ:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/1SnkZhUy_Ao" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/10/25/a-week-with-emacs-one-week-later/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/10/25/a-week-with-emacs-one-week-later/</feedburner:origLink></item>
		<item>
		<title>A week with Emacs</title>
		<link>http://feedproxy.google.com/~r/RobSearles/~3/Yxndv54nbY0/</link>
		<comments>http://www.robsearles.com/2009/10/19/a-week-with-emacs/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 22:42:05 +0000</pubDate>
		<dc:creator>Rob Searles</dc:creator>
				<category><![CDATA[General]]></category>

		<guid isPermaLink="false">http://www.robsearles.com/?p=191</guid>
		<description><![CDATA[I have been toying around with the idea of using Emacs for a few months now. Emacs isn&#8217;t exactly a stranger to me, as I&#8217;ve been using it on and off for years, but I&#8217;ve never really tried to fully know it properly. However, recently I have been in front of the computer so long [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-medium wp-image-192" title="Emacs" src="http://www.robsearles.com/wp-content/uploads/2009/10/emacs-300x271.png" alt="Emacs" width="300" height="271" />I have been toying around with the idea of using <a href="http://www.gnu.org/software/emacs/" target="_blank">Emacs</a> for a few months now. Emacs isn&#8217;t exactly a stranger to me, as I&#8217;ve been using it on and off for years, but I&#8217;ve never really tried to fully <strong>know</strong> it properly. However, recently I have been in front of the computer so long I feel like my <a href="http://en.wikipedia.org/wiki/Repetitive_strain_injury" target="_blank">hands are going to fall off</a>! Which is why I&#8217;ve decided to try to move away from this point and click mouse nonsense towards a more streamline keyboard only work environment.</p>
<p>So I have decided to give Emacs a go for a <strong>full week</strong> as my single development editor. Previously I&#8217;ve been using <a href="http://www.eclipse.org/pdt/" target="_blank">Eclipse PDT</a> &#8211; which became so slow &#8211; and <a href="http://www.netbeans.org/features/php/" target="_blank">Netbeans</a> &#8211; which I like a lot, but it is still point and click. One of my inspirations for this was a <a href="http://intranation.com/entries/2009/06/week-using-emacs/" target="_blank">blog post by </a><span><a href="http://intranation.com/entries/2009/06/week-using-emacs/" target="_blank"><span>Bradley</span> </a><span><a href="http://intranation.com/entries/2009/06/week-using-emacs/" target="_blank">Wright</a>. Poor Bradley&#8217;s experience must have been so horrifying that he hasn&#8217;t posted a follow up for his weeks usage, and this is from several months ago. Brad, if you can hear me, please let me know how it went, I am dying to know! But until then, I am going to try it out for myself.</span></span></p>
<p><span><span>Wish me luck, and if you have any tips for <a href="http://sourceforge.net/projects/php-mode/" target="_blank">PHP development within</a> Emacs, please drop a comment below and help me along. </span></span></p>
<p><span><span>See you in a week.</span></span></p>
<p><span><span><strong>Update:</strong> My week is up &#8211; <a href="http://www.robsearles.com/2009/10/25/a-week-with-emacs-one-week-later/">read how I did</a>.<br />
</span></span></p>
<p><span><span><br />
</span></span></p>
<img src="http://www.robsearles.com/?ak_action=api_record_view&id=191&type=feed" alt="" /><div class="feedflare">
<a href="http://feeds.feedburner.com/~ff/RobSearles?a=Yxndv54nbY0:yoBFsgW77M0:yIl2AUoC8zA"><img src="http://feeds.feedburner.com/~ff/RobSearles?d=yIl2AUoC8zA" border="0"></img></a>
</div><img src="http://feeds.feedburner.com/~r/RobSearles/~4/Yxndv54nbY0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.robsearles.com/2009/10/19/a-week-with-emacs/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.robsearles.com/2009/10/19/a-week-with-emacs/</feedburner:origLink></item>
	</channel>
</rss>
