<?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>klog</title>
	<atom:link href="http://verens.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://verens.com</link>
	<description>klog - Kae&#039;s Log</description>
	<lastBuildDate>Tue, 08 Nov 2011 23:49:29 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>FB and G+, the new OS-wars</title>
		<link>http://verens.com/2011/11/08/fb-and-g-the-new-os-wars/</link>
		<comments>http://verens.com/2011/11/08/fb-and-g-the-new-os-wars/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 23:43:47 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1216</guid>
		<description><![CDATA[Back when Linux was a gangly youth, there was a great excitement every time you did an update. Unlike Windows and Mac with their expensive three-year-nothing-then-a-service-pack-with-cool-stuff routines, in Linux, there were so many cool free packages around, and /every one/ &#8230;<p class="read-more"><a href="http://verens.com/2011/11/08/fb-and-g-the-new-os-wars/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.stickycomics.com/computer-update/"><img src="http://verens.com/files/2011/11/update_for_your_computer-300x182.jpg" alt="" title="update_for_your_computer" width="300" height="182" class="alignnone size-medium wp-image-1217" /></a></p>
<p>
Back when <a href="http://en.wikipedia.org/wiki/Linux">Linux</a> was a gangly youth, there was a great excitement every time you did an update. Unlike <a href="http://www.youtube.com/watch?v=7eTguZ5OzJ4">Windows and Mac</a> with their expensive three-year-nothing-then-a-service-pack-with-cool-stuff routines, in Linux, there were so many cool free packages around, and /every one/ of them would have something new almost every week.
</p>
<p>So, I spent quite a lot of time compiling and recompiling, everything from <a href="http://www.gnu.org/s/wget/">wget</a> up to the <a href="http://kde.org/">KDE</a> behemoth. And I&#8217;d be reading the weekly release notes as well to see if there was any new trick out that week.</p>
<p>
I can&#8217;t tell you how excited I was when I first installed a copy of Linux where I didn&#8217;t have to configure <a href="http://x.org/">X11</a> using a text-mode <a href="http://linuxcommand.org/man_pages/Xconfigurator1.html">Xconfigureateur</a>!
</p>
<p>
Or when I recompiled my <a href="http://kernel.org/">kernel</a> the first time, or when I recovered from a bad update straight from the <a href="http://www.gnu.org/software/grub/">GRUB</a> command-line. Or the first time I ejected a CD from across the room (logged in <a href="http://en.wikipedia.org/wiki/Secure_Shell">remotely</a>), or freaking out the wife by playing some music on her laptop from a different room.
</p>
<p>
In the last few years, Linux development has matured, though, so there&#8217;s not the same edge-of-the-seat excitement that there used to be, but I think there&#8217;s still hope for the techadrenaline junkies out there, because <a href="http://facebook.com/">Facebook</a> and <a href="http://plus.google.com/">Google+</a> are the new cool, and there&#8217;s a /ton/ of stuff that can be done with that!
</p>
<p>
My eyes are on how FB and G+ evolve. now that FB has competition, I expect some /really/ cool stuff is going to come out of the woodwork.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/11/08/fb-and-g-the-new-os-wars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>first and last saturday of a month</title>
		<link>http://verens.com/2011/10/21/first-and-last-saturday-of-a-month/</link>
		<comments>http://verens.com/2011/10/21/first-and-last-saturday-of-a-month/#comments</comments>
		<pubDate>Fri, 21 Oct 2011 21:47:39 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1212</guid>
		<description><![CDATA[I&#8217;m working on an expenses application. In order to do it, I need to display the entire month, with full weeks in each (from Saturday to Friday). To do this, I need to know what date the Saturday in the &#8230;<p class="read-more"><a href="http://verens.com/2011/10/21/first-and-last-saturday-of-a-month/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on an expenses application. In order to do it, I need to display the entire month, with full weeks in each (from Saturday to Friday).</p>
<p>To do this, I need to know what date the Saturday in the first week falls, and the date of the first Saturday in the following month.</p>
<p>Here&#8217;s the code (assuming <code>year</code> is a 4-digit year, and <code>month</code> is a 1-12 number):</p>
<pre class="brush: jscript; title: ; notranslate">
      // { start date
      var start=new Date(year, month-1, 1);
      var day=start.getDay();
      day=(day+1)%7; 

      start=new Date(start-3600000*24*day);

      // }
      // { end date
      month++;
      if (month==13) {
        month=1;
        year++;
      }
      var end=new Date(year, month-1, 1);
      var day=end.getDay();
      day=7-((day+1)%7);

      end=new Date((+end)+3600000*24*day);

      // }
</pre>
<p>can&#8217;t be bothered explaining it &#8211; just trust that it&#8217;s right <img src='http://verens.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/10/21/first-and-last-saturday-of-a-month/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>separating buttons in jquery-ui dialog</title>
		<link>http://verens.com/2011/10/12/separating-buttons-in-jquery-ui-dialog/</link>
		<comments>http://verens.com/2011/10/12/separating-buttons-in-jquery-ui-dialog/#comments</comments>
		<pubDate>Wed, 12 Oct 2011 11:45:21 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1206</guid>
		<description><![CDATA[By default, the jQuery-UI dialog will place buttons on the right side of the popup: This causes a problem because if you have &#8220;OK&#8221; right next to &#8220;Delete&#8221;, and you click the wrong one, well &#8230; The obvious solution is &#8230;<p class="read-more"><a href="http://verens.com/2011/10/12/separating-buttons-in-jquery-ui-dialog/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>By default, the <a href="http://jqueryui.com/demos/dialog/">jQuery-UI dialog</a> will place buttons on the right side of the popup:</p>
<p><a href="http://verens.com/files/2011/10/screen1.jpg"><img src="http://verens.com/files/2011/10/screen1-300x177.jpg" alt="" title="screen1" width="300" height="177" class="alignnone size-medium wp-image-1209" /></a></p>
<p>This causes a problem because if you have &#8220;OK&#8221; right next to &#8220;Delete&#8221;, and you click the wrong one, well &#8230;</p>
<p>The obvious solution is to move the &#8220;Delete&#8221; to the opposite side.</p>
<p>To do that, add the following two lines after creating the dialog:</p>
<pre class="brush: jscript; title: ; notranslate">
$('.ui-dialog-buttonset').css('float','none');
$('.ui-dialog-buttonset&gt;button:last-child').css('float','right');
</pre>
<p>Now the buttons are on opposite sides:</p>
<p><a href="http://verens.com/files/2011/10/screen2.jpg"><img src="http://verens.com/files/2011/10/screen2-300x177.jpg" alt="" title="screen2" width="300" height="177" class="alignnone size-medium wp-image-1208" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/10/12/separating-buttons-in-jquery-ui-dialog/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>installing WebME in Fedora 16</title>
		<link>http://verens.com/2011/10/05/installing-webme-in-fedora-16/</link>
		<comments>http://verens.com/2011/10/05/installing-webme-in-fedora-16/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 19:32:57 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webme]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1193</guid>
		<description><![CDATA[I got a new laptop today, and as I&#8217;ve still got work to do, I need to get the system up and running so it can install WebME. Here&#8217;s a minimal instruction set for installing WebME on your Fedora computer. &#8230;<p class="read-more"><a href="http://verens.com/2011/10/05/installing-webme-in-fedora-16/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I got a new laptop today, and as I&#8217;ve still got work to do, I need to get the system up and running so it can install <a href="http://kvweb.me/">WebME</a>.</p>
<p>Here&#8217;s a <em>minimal</em> instruction set for installing WebME on your Fedora computer.</p>
<p>As &#8216;root&#8217;, run this in a console:</p>
<pre class="brush: bash; title: ; notranslate">
yum install httpd mysql-server php php-gd php-mysql php-pear-Log php-xml svn
echo &quot;127.0.0.1 kvwebme&quot; &gt;&gt; /etc/hosts
</pre>
<p>Then edit <code>/etc/selinux/config</code>, change &#8220;enabled&#8221; to &#8220;disabled&#8221; and restart your machine.</p>
<p>Login as your normal user, run this in the console:</p>
<pre class="brush: bash; title: ; notranslate">
mkdir ~/websites &amp;&amp; cd ~/websites
svn co https://kv-webme.googlecode.com/svn/trunk/ kv-webme
chmod 755 /home/kae
</pre>
<p>&#8216;su&#8217; to &#8216;root&#8217; again. Add this to <code>/etc/httpd/conf/httpd.conf</code>:</p>
<pre class="brush: xml; title: ; notranslate">
NameVirtualHost *:80
&lt;Directory /home/kae/websites&gt;
  AllowOverride All
&lt;/Directory&gt;
&lt;VirtualHost *:80&gt;
  ServerName kvwebme
  DocumentRoot /home/kae/websites/kv-webme
&lt;/VirtualHost&gt;
</pre>
<p>And finally, in the console again:</p>
<pre class="brush: bash; title: ; notranslate">
service httpd start
service mysqld start
chkconfig --level 35 mysqld on
chkconfig --level 35 httpd on
</pre>
<p>That&#8217;s it &#8211; your system is set up. From that point, just go to <code>http://kvwebme/</code> and follow the instructions from there!</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/10/05/installing-webme-in-fedora-16/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>onchange in ckeditor</title>
		<link>http://verens.com/2011/08/31/onchange-in-ckeditor/</link>
		<comments>http://verens.com/2011/08/31/onchange-in-ckeditor/#comments</comments>
		<pubDate>Wed, 31 Aug 2011 09:46:02 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[ckeditor]]></category>
		<category><![CDATA[fckeditor]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1190</guid>
		<description><![CDATA[I needed to track changes to source in a CKeditor instance, as my recent work uses a lot of &#8220;on-the-fly&#8221; updating. Using Alfonso&#8217;s onChange plugin, it was a simple matter to capture changes when in WYSIWYG mode. But that doesn&#8217;t &#8230;<p class="read-more"><a href="http://verens.com/2011/08/31/onchange-in-ckeditor/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I needed to track changes to source in a CKeditor instance, as my recent work uses a lot of &#8220;on-the-fly&#8221; updating.</p>
<p>Using Alfonso&#8217;s <a href="http://alfonsoml.blogspot.com/2011/03/onchange-event-for-ckeditor.html">onChange plugin</a>, it was a simple matter to capture changes when in WYSIWYG mode.</p>
<p>But that doesn&#8217;t work in source mode.</p>
<p>Assuming you&#8217;re using the jQuery extension for CKeditor (and if not, why not?), you can capture source mode changes by adding this to your CKeditor&#8217;s config.js:</p>
<pre class="brush: jscript; title: ; notranslate">
$('textarea.cke_source').live('keyup', function() {
  $(this)
    .closest('.cke_wrapper')
    .parent()
    .parent()
    .prev()
    .ckeditorGet()
    .fire('change');
});
</pre>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/08/31/onchange-in-ckeditor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery maskImage plugin</title>
		<link>http://verens.com/2011/08/25/jquery-maskimage-plugin/</link>
		<comments>http://verens.com/2011/08/25/jquery-maskimage-plugin/#comments</comments>
		<pubDate>Thu, 25 Aug 2011 14:17:07 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[jquery.maskImage]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1182</guid>
		<description><![CDATA[I had a need today to write some code which involved masking one image with another, dynamically. There is no simple way to do this in JavaScript. The nearest I came to finding working code online that does it was &#8230;<p class="read-more"><a href="http://verens.com/2011/08/25/jquery-maskimage-plugin/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I had a need today to write some code which involved masking one image with another, dynamically.</p>
<p>There is no simple way to do this in JavaScript. The nearest I came to finding working code online that does it was <a href="http://www.netzgesta.de/edge/">edge.js</a>, but that&#8217;s not free.</p>
<p>So, I wrote my own.</p>
<p><a href="http://demo.verens.com/jquery.maskImage/jquery.maskImage.html">demo</a></p>
<p>Download: <a href="http://demo.verens.com/jquery.maskImage.zip">zip (25k)</a>, <a href="http://demo.verens.com/jquery.maskImage.tar.bz2">bz2 (24k)</a></p>
<p>In the demo, what&#8217;s happening is that an image such as this:</p>
<p><img src="http://demo.verens.com/jquery.maskImage/images/hello-world.png" alt="" /></p>
<p>is being used as a mask for another image:</p>
<p><img src="http://demo.verens.com/jquery.maskImage/images/black-to-yellow.png" alt="" /></p>
<p>to create a masked image:</p>
<p><img src="http://verens.com/files/2011/08/blended.png" /></p>
<p>For Firefox and Chrome and other recent browsers, it works using pure JavaScript (even works on the iPhone).</p>
<p>For Internet Explorer (sigh) you need to do a little bit of server-side setup.</p>
<p>Basically, on the server-side, make sure you have PHP installed, with the <a href="http://php.net/manual/en/book.imagick.php">iMagick</a> extension, then make the &#8216;cache&#8217; directory writable by the server.</p>
<p>To use, insert an image into your document:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;img id=&quot;image-id&quot; src=&quot;an-image.png&quot; alt=&quot;&quot; /&gt;
</pre>
<p>And then apply the mask using jQuery:</p>
<pre class="brush: jscript; title: ; notranslate">
$('#image-id').maskImage({src:&quot;the-mask.png&quot;});
</pre>
<p>Simple, innit! That&#8217;s a few hours of my own life dedicated to saving a few minutes of yours <img src='http://verens.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/08/25/jquery-maskimage-plugin/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>immortality and the multi-verse</title>
		<link>http://verens.com/2011/08/17/immortality-and-the-multi-verse/</link>
		<comments>http://verens.com/2011/08/17/immortality-and-the-multi-verse/#comments</comments>
		<pubDate>Wed, 17 Aug 2011 18:41:57 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[areyoumad]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[philosophy]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1175</guid>
		<description><![CDATA[Hello kiddies &#8211; it&#8217;s madness time! Don&#8217;t worry &#8211; these are just idle thoughts. I&#8217;m not going over the hill into the twilight zone. The science madness A number of ideas in recent (last 100 years) physics revolve around the &#8230;<p class="read-more"><a href="http://verens.com/2011/08/17/immortality-and-the-multi-verse/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Hello kiddies &#8211; it&#8217;s madness time!</p>
<p>Don&#8217;t worry &#8211; these are just idle thoughts. I&#8217;m not going over the hill into the twilight zone.</p>
<h2>The science madness</h2>
<p>A number of ideas in recent (last 100 years) physics revolve around the idea that there are <a href="http://en.wikipedia.org/wiki/Multiverse">multiple universes</a>, or that the same universe keeps splitting into separate universes every time a quantum decision must be made.</p>
<p>As far as I know, these ideas are not testable, but a lot of physicists think that a multi-verse is the simplest solution to a lot of questions, and as <a href="http://en.wikipedia.org/wiki/Occam%27s_razor">Occam&#8217;s Razor</a> says, the simplest solution is usually the right one.</p>
<p>The idea that&#8217;s bandied about most often is that the universe splits every time a choice is made, so that both choices actually happen &#8211; one in one universe, and the other in another universe.</p>
<p>This has the effect that every possible configuration of the universe&#8217;s contents exists at some point. In other words, &#8220;<a href="http://answers.yahoo.com/question/index?qid=20100804141602AAhmNeC">in an infinite universe, anything is possible</a>&#8220;.</p>
<p>What this means, is that at any point in your life where you had to make a decision &#8211; get on the plane, talk to the girl, take the job &#8211; a version of you exists for every possible decision.</p>
<p>Personally, I don&#8217;t believe that the universe splits at each decision &#8211; it seems a bit silly. But, I do believe that in infinite time and space, if the &#8220;big bang&#8221; can happen once, it can happen again, and each time, it just has to be the tiniest bit different, so <i>in effect</i>, there is a universe somewhere for every single moment of this one&#8217;s existence, which differs in just one respect. A consequence of this is that even if the universe doesn&#8217;t physically divide at each decision, a universe exists for each decision anyway, so it&#8217;s as if it happened anyway.</p>
<h2>What is you?</h2>
<p>In a lot of those universes, a version of you exists. For all purposes, <a href="http://en.wikipedia.org/wiki/Identity_%28philosophy%29">it <i>is</i> you</a>. It has your memories, is built of exactly the same molecules, and lives in a world exactly like yours.</p>
<p>You can ignore all of the universes that <i>don&#8217;t</i> have a you in them (and there are an infinite number of those!), because if you paraphrase the <a href="http://en.wikipedia.org/wiki/Anthropic_principle">anthropic principle</a>, you realise that they really don&#8217;t matter &#8211; the only universes you could ever experience are those that you exist in (history is written by the victors. In other words, your present you is only possible because all of the failed &#8220;you&#8221;s are dead and therefore can be written out of history).</p>
<p>In each of these universes, you had a load of different experiences &#8211; you lived, died, were rich, poor, etc., which is interesting to think about intellectually (Remember all those times that you wish you&#8217;d done something different? Well, you <i>did</i> in at least one other universe.), but not very useful to dwell on, because that&#8217;s them, and you&#8217;re more interested in <i>you</i>.</p>
<p>You.</p>
<p>I&#8217;m writing this post because I&#8217;ve survived some interesting things in the past &#8211; self-harming during my late teens, standing on the edge of a 5-storey building pissing off the edge while totally drunk, all the narrow misses while skateboarding, getting beaten to a pulp a number of times, breaking my skull when I was 2.</p>
<p>Every one of those events had an alternative where things went the other way. But I&#8217;m here right now, which means that in this universe, I&#8217;ve survived.</p>
<p>The fact that you&#8217;re reading this is very interesting. You have survived all of the events of your past, and have gotten to this point.</p>
<p>What <i>is</i> &#8220;you&#8221;? The grammar-nazi in me complains about that sentence, but I mean it that way.</p>
<p>&#8220;You&#8221; is the sum of experiences that makes up your identity &#8211; your &#8220;soul&#8221;.</p>
<p>Here&#8217;s an interesting question: when you go to sleep at night, and you don&#8217;t dream, there are a few hours during which you are essentially dead to the world. What if you were transported at this point to another universe during those hours which was exactly the same &#8211; when you woke up, it would be as if you simply continued living from the previous day in the previous universe and you would be none-the-wiser.</p>
<p>The multi-verse idea says that this happens all the time, that every moment that you experience could very possibly be in a totally different universe that has been rebuilt from scratch.</p>
<h2>Quantum immortality</h2>
<p>Now we get to the <a href="http://en.wikipedia.org/wiki/Quantum_suicide_and_immortality">freaky shit</a>.</p>
<p>What if an accident were to happen <i>right now</i> &#8211; a meteorite drops through your ceiling, or a microwave explodes, or your partner slips in the middle of knitting and impales you.</p>
<p>In some universes, you would die, and in some, the event would be narrowly missed (and in some, not occur at all).</p>
<p>The <b>important thing</b> to note is that the only &#8220;you&#8221; that would experience the event is the &#8220;you&#8221; that survived. You may be damaged by the event, but you would survive and live another day (otherwise, you would not, and that universe can be ignored).</p>
<p>Please dwell on that thought &#8211; the only possible you that is reading this article is a you that has survived all previous experiences, but as a consequence of this crazy logic, you will also survive all future events as well.</p>
<p>Let&#8217;s look at the logic again:</p>
<ul>
<li>There are an infinite number of universes.</li>
<li>There are an infinite number of universes that have &#8220;you&#8221;s living in them.</li>
<li>Every time there is the slightest chance that you would survive an event, there are an infinite number of universes in which you <i>do</i> survive that event.</li>
</ul>
<p>A very weird consequence of this is that you, the you that is reading this, will never die. Every time an event happens that might lead to your death &#8211; a choice you made, a decision someone else made, a natural accident &#8211; there are infinite universes in which that event does <i>not</i> happen, and so &#8220;you&#8221; survive.</p>
<h2>No-one else, though</h2>
<p>Unfortunately, because of the probabilistic nature of physics, everyone else will die in time. Yes, there are an infinite number of universes in which your loved ones will survive with you, which there are many &#8220;bigger&#8221; infinities in which they die, and those win out.</p>
<p>This is another mind-bender, because it makes everything very subjective.</p>
<p>From <i>my</i> point of view, I am immortal, and you will eventually die, but that&#8217;s because my own experience leads me through a different set of infinities where I am the immortal one.</p>
<p>Every other person that exists has their own set of infinities as well that leads them to immortality.</p>
<h2>Conclusion</h2>
<p>Well &#8211; that&#8217;s my moment of madness concluded for today.</p>
<p>In short &#8211; shit will happen, but you&#8217;ll get over it, a million million times over the next load of centuries.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/08/17/immortality-and-the-multi-verse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>new API for WebME</title>
		<link>http://verens.com/2011/08/13/new-api-for-webme/</link>
		<comments>http://verens.com/2011/08/13/new-api-for-webme/#comments</comments>
		<pubDate>Sat, 13 Aug 2011 19:56:24 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webme]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1161</guid>
		<description><![CDATA[As I said in the last post, an API would be required to make the system more testable and more consistent. I started straight away and wrote up something quickly. Over the next week, it solidified into something that appears &#8230;<p class="read-more"><a href="http://verens.com/2011/08/13/new-api-for-webme/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>As I said in the <a href="http://verens.com/2011/08/06/testing-kv-webme/">last post</a>, an API would be required to make <a href="http://kvweb.me/">the system</a> more testable and more consistent.</p>
<p>I started straight away and wrote up something quickly. Over the next week, it solidified into something that appears to cover <a href="http://20eu.com">any needs that I have</a>.</p>
<p>So here&#8217;s how the API works:</p>
<p>Requests are sent to a URL which is generated like this:</p>
<pre>/a
[/p=<i>plugin-name</i>]
/f=<i>function-name</i>
[/other-parameters]</pre>
<p>The plugin name is optional. Leaving it out means you want to call a core function.</p>
<p>Parameters can be added by adding <code>/<i>key</i>=<i>value</i></code> pairs to the URL.</p>
<p>An example URL might be this:</p>
<pre>/a/f=login/email=kae@verens.com</pre>
<p>Sending that, with a POST parameter for the password, will log me in.</p>
<p>To log out, I can use this URL:</p>
<pre>/a/f=logout</pre>
<p>Simple!</p>
<h2>Function Names</h2>
<p>mod_rewrite is used to direct a request through a script which tears the URL apart into parameters.</p>
<p>If a <code>p</code> parameter is given, the function is named after the plugin, rewritten to match the WebME coding standard.</p>
<p>For example, if the URL is <code>/a/p=comments/f=editComment</code>, then the &#8220;comments&#8221; part is rewritten as Comments, and &#8216;_&#8217; and &#8220;editComment&#8221; are appended to form the function name &#8220;Comments_editComment&#8221;, which is called and the result returned to the browser.</p>
<p>For double-barrel plugin names, such as &#8220;image-gallery&#8221;, the name is rewritten to &#8220;ImageGallery&#8221;.</p>
<p>If no <code>p</code> parameter is given, then the request is a core function, and &#8220;Core_&#8221; is prepended to the function name.</p>
<p>For example, the login URL above, <code>/a/p=login</code> calls the function <code>Core_login</code>.</p>
<p>If a function name begins with &#8220;admin&#8221;, it is an admin function (see below for more on this).</p>
<h2>File names</h2>
<p>If no plugin name is supplied, then the core API file, /ww.incs/api-funcs.php is loaded. This contained common API functions that might be used by any core script or plugin.</p>
<p>If a plugin name is supplied, then the API file is expected to be located at /ww.plugins/<i>plugin-name</i>/api.php for common functions, and /ww.plugins/<i>plugin-name</i>/api-admin.php for admin functions.</p>
<p>For core functions, common functions are at /ww.incs/api-funcs.php and admin functions are at /ww.incs/api-admin.php</p>
<h2>Security things</h2>
<p>Having a central point for RPC means that we can apply security rules in one place and know that they cover all scripts. Before-hand, I would sometimes come across scripts and realise that they were open for abuse if someone knows that magic URL incantation. I would silently curse myself or whoever had written the script and fix it up. Now, though, having one single point of entry means I can secure everything at once.</p>
<p>If a function name starts with &#8220;admin&#8221;, then the script checks to see if the user is logged in and is a member of the administrators group. If not, the API will return an error. It&#8217;s as simple as that!</p>
<p>Of course, this doesn&#8217;t stop abuse by people that are logged in as admins or who are victims of XSS, but it helps stop a few problems caused by developers not noticing their scripts were open to use by anyone at all.</p>
<h2>Conclusion</h2>
<p>So now, when people are creating new plugins for WebME, the following could be used as a bare-bones directory structure:</p>
<pre>
/ww.plugins/<i>plugin-name</i>/plugin.php    <i>details, server-side functions</i>
/ww.plugins/<i>plugin-name</i>/api.php       <i>common RPC functions</i>
/ww.plugins/<i>plugin-name</i>/api-admin.php <i>admin RPC functions</i>
/ww.plugins/<i>plugin-name</i>/admin.js      <i>admin scripts in JS</i>
</pre>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/08/13/new-api-for-webme/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>testing KV-WebME</title>
		<link>http://verens.com/2011/08/06/testing-kv-webme/</link>
		<comments>http://verens.com/2011/08/06/testing-kv-webme/#comments</comments>
		<pubDate>Sat, 06 Aug 2011 10:20:47 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webme]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1155</guid>
		<description><![CDATA[I&#8217;ve been working on my CMS for about 10 years. It&#8217;s monstrously huge (41,000 lines, not including external libraries), and for most of those 10 years, I&#8217;ve been too busy building it to concentrate on niceties such as comments, testing, &#8230;<p class="read-more"><a href="http://verens.com/2011/08/06/testing-kv-webme/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working on <a href="http://kvweb.me/">my CMS</a> for about 10 years. It&#8217;s monstrously huge (<a href="https://www.ohloh.net/p/kv-webme">41,000 lines</a>, <em>not</em> including external libraries), and for most of those 10 years, I&#8217;ve been too busy building it to concentrate on niceties such as comments, testing, code formatting, etc.</p>
<p>This has caused problems in the past. As most programmers know, when you change any one thing, it has a ripple effect and can break things in places that don&#8217;t seem obvious at all.</p>
<p>Recently I&#8217;ve been remedying this. I&#8217;ve been religiously using <a href="http://pear.php.net/package/PHP_CodeSniffer/redirected">PHPCS</a> to make sure my code is neat and consistent, and I&#8217;ve started writing a test suite.</p>
<p>The most difficult part of the testing is that the CMS is composed of many separate technologies. If it was just a plain old HTML and PHP application, then <a href="www.phpunit.de">PHPUnit</a> would be enough, or maybe <a href="http://seleniumhq.org/">Selenium</a>.</p>
<p>The problem is, though, that the system uses a large amount of AJAX &#8211; especially in the administration areas. No single testing system would do it all.</p>
<p>Another problem has to do with AJAX itself. In jQuery, you can speak to the server by writing something like this:</p>
<pre class="brush: jscript; title: ; notranslate">$.post('/a/server/script.php', {
  &quot;id&quot;: 2
}, function(res) {
  // do stuff
}, 'json');</pre>
<p>This makes it incredibly simple to speak to any server-side script at all on the server, and promotes it. It becomes tempting when writing new functionality to build new server-side scripts specifically for the new client-side stuff.</p>
<p>This has the effect that there is no single point for RPC (remote procedure calls) which can be tested, making it very difficult to be sure you have covered all potential problems.</p>
<p>To help solve this problem, I&#8217;ve recently started converting WebME&#8217;s coding style so all RPC is done through a single API (application programming interface) script.</p>
<p>This has a few extra effects which are beneficial:</p>
<ul>
<li>Having a single point of entry into the system makes it easier to secure it.</li>
<li>Having an API promotes the construction of a solid method of adding functionality to it &#8211; there&#8217;s no need to start from scratch anymore, potentially building disparate scripts that are hard to abstract. Instead, it&#8217;s now easy to force the code to match a minimum spec.</li>
<li>APIs tend to have specific rules for how parameters are passed into it, making it easier to remember what the right parameters are when writing new client-side code. Also, it makes it easier to &#8220;guess&#8221; what the right parameters are if you&#8217;ve forgotten.</li>
</ul>
<p>The main benefit, though, is that it makes it much easier to test. The URL of the API always stays the same, and the only thing that changes is the parameters sent to the URL. Previously, each separate script would have a different URL and could have any parameter scheme at all.</p>
<p>So, currently, I&#8217;m writing tests that use the API directly, speaking to the server directly through URL calls. After I&#8217;ve finished writing all of those (hah! if ever), I can get on to testing that JavaScript.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/08/06/testing-kv-webme/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>growing up</title>
		<link>http://verens.com/2011/06/23/growing-up/</link>
		<comments>http://verens.com/2011/06/23/growing-up/#comments</comments>
		<pubDate>Thu, 23 Jun 2011 10:55:25 +0000</pubDate>
		<dc:creator>Kae Verens</dc:creator>
				<category><![CDATA[ajax]]></category>
		<category><![CDATA[business]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[web development]]></category>
		<category><![CDATA[webme]]></category>

		<guid isPermaLink="false">http://verens.blogs.kvsites.ie/?p=1142</guid>
		<description><![CDATA[For a long time, whenever I did something that I thought was interesting, I would write it in an article. I don&#8217;t write as much as I used to. Not because what I&#8217;m doing is not interesting, but because it&#8217;s &#8230;<p class="read-more"><a href="http://verens.com/2011/06/23/growing-up/">Read more &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>For a long time, whenever I did something that I thought was interesting, I would write it in an article.</p>
<p>I don&#8217;t write as much as I used to. Not because what I&#8217;m doing is not interesting, but because it&#8217;s taking a lot longer now to complete the interesting jobs, now that they&#8217;re basically full projects and not just little snippets here and there.</p>
<p>As an example, we&#8217;re doing some interesting work over in the <a href="http://kvweb.me/">KV WebME</a> project. The most recent is an upgrade to image galleries allowing the gallery layouts to be defined using templates, instead of saying &#8220;you want layout 1, or layout 2?&#8221;. This work is then also used in the products plugin to let people sell images in their online stores.</p>
<p>There are a number of bits in that project that deserve full posts themselves, but as I basically commissioned the piece and got others to do the work, it&#8217;s no longer mine to describe. For me, the cool little tricks are now just a smaller part of a bigger picture.</p>
<p>The bigger picture right now is <a href="http://20eu.com/">20eu.com</a>, where you can create your own online store within literally minutes for only €20 (compare that to the &#8220;free&#8221; <a href="http://www.gettingbusinessonline.ie/">getting business online</a> project, which <strong>doesn&#8217;t have an e-commerce aspect</strong>).</p>
<p>It&#8217;s now harder for me to write about, because there are no longer single cool aspects that I can point to that can be re-used by other people.</p>
<p>I was walking to work today with Conor (an employee), discussing stuff along these lines, and these points stood out:</p>
<ul>
<li>In the beginning, I was a programmer, and every task had something new to me but nothing I could write about that would interest experienced programmers.</li>
<li>After a few years, I was a good programmer, and I did less tasks, but they were larger, and there were often aspects to them that were brand new, so I ended up being one of the first to build them (it helps that my field is Ajax, which is basically new-born).</li>
<li>And now, I&#8217;m tired of being just a programmer and have started branching into managing other programmers. I&#8217;m more interested now in getting full projects done than in the nitty-gritty.</li>
</ul>
<p>Unfortunately, this means there is less to talk about that is even vaguely techie. I feel like I&#8217;m shifting focus into marketing and project management.</p>
<p>Ick!</p>
<p>On the plus side (for me), it means that eventually, I&#8217;ll have enough resources that I can get the projects done that I&#8217;ve always wanted to do.</p>
<p>So, I plan on starting to write about the business end of my work.</p>
<p>Don&#8217;t worry &#8211; I&#8217;ll categorise it correctly, so if you&#8217;re only interested in my PHP or Linux posts, then just change your reader settings to only read from those RSS feeds.</p>
]]></content:encoded>
			<wfw:commentRss>http://verens.com/2011/06/23/growing-up/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

