<?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>Martin Wolf&#039;s weblog &#187; me</title>
	<atom:link href="http://mwolf.net/archive/category/me/feed/" rel="self" type="application/rss+xml" />
	<link>http://mwolf.net</link>
	<description>Software development and assorted geekery</description>
	<lastBuildDate>Sun, 08 Aug 2010 18:15:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>LASEK</title>
		<link>http://mwolf.net/archive/lasek/</link>
		<comments>http://mwolf.net/archive/lasek/#comments</comments>
		<pubDate>Sun, 07 Feb 2010 14:48:26 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[me]]></category>
		<category><![CDATA[lasek]]></category>
		<category><![CDATA[lasik]]></category>

		<guid isPermaLink="false">http://mwolf.net/archive/lasek/</guid>
		<description><![CDATA[This is a blog post about something which took place six months ago, so it could be considered somewhat belated. On the other hand, that gives me the opportunity to give the full story in one go, rather than just posting &#8220;well, I had the operation two hours ago and they didn&#8217;t actually blow up [...]]]></description>
			<content:encoded><![CDATA[<p>This is a blog post about something which took place six months ago, so it could be considered somewhat belated. On the other hand, that gives me the opportunity to give the full story in one go, rather than just posting &#8220;well, I had the operation two hours ago and they didn&#8217;t actually blow up my eyeball, so I guess it could have been worse, but I&#8217;m not really supposed to be staring at a computer screen just now and anyway I am doped up on painkillers so I&#8217;m leaving now, okthxbye.&#8221;<br />
<span id="more-93"></span></p>
<p>I have been wearing glasses since I was ten years old or so. My vision has been fairly constant over the years: around -4 in the left eye, -0.75 in the right. Because of the right eye being only mildly myopic, I was able to function without glasses when necessary (just don&#8217;t ask me to catch a ball) but I would get a headache after a while. Never tried contacts. I had been playing with the idea of getting laser eye surgery for some years already, but it took me a long time to work up the courage to go ahead and do it. It&#8217;s a pretty routine thing nowadays, but it is still very easy to find horror stories of people ending up with vision problems worse than they started out with, although complete blindness is fortunately very rare. I&#8217;m rather attached to my ability to see, and it was not an easy decision to risk that in exchange for the rather minor inconvenience of wearing glasses.</p>
<p>So, why did I eventually decide to go under the laser? Largely for convenience. In a lot of outdoor activities, needing glasses can be a hassle. You&#8217;re constantly swapping between regular glasses and sunglasses. They are fragile, they fog up, fall off and get scratched. Your options for finding <a href="http://www.serengeti-eyewear.com/">good-quality sunglasses</a> are greatly reduced when you need them to be prescription glasses. Snow goggles for glacier use, in particular, are almost impossible to get in combination with prescription lenses. The best I have been able to find are the Elevation and Evil Eye series from Adidas, which have room for a little clip-in set of prescription lenses. However, that clip-in tended to fog up easily and also it was not quite wide enough for my face, resulting in headaches after a while.</p>
<p>I would be lying if I did not admit that vanity also played a part. Until just a few years ago, I was your stereotypical non-athletic flabby  nerd; the beard and glasses served nicely to complete that picture. Over the last couple of years, however, I have been <a href="http://mwolf.net/archive/dam-tot-dam-2009/">running</a> and working out a bit, and while I will never have a movie star physique I am actually fairly pleased with what I see in the mirror nowadays. Hence, the aesthetic aspect of displaying my face to the world unobscured by the ophthalmic equivalent of a pair of crutches, started to play a role in a way which had never been relevant to me before.</p>
<p>I did have one big advantage over most other people considering a laser operation: because the vision in my right eye was pretty good already, I only needed the surgery in one eye. This not only meant that even in the worst-case scenario I would still have a spare eye to see through, but it was a lot cheaper as well. Without a single exception that I could find, all laser clinics seem to charge on a per-eye basis. This has always seemed a bit strange to me, because most of the procedure takes up just as much time for one eye as for two; the actual operation is only a small portion, time-wise, of the whole process. But apparently a large part of the clinic&#8217;s cost goes to the provider of the hardware, and they charge per eye lasered.</p>
<p>Prices vary a lot; typical costs in the Netherlands are between €1,000 and €2000 per eye. You can go a little below €1,000 if you go outside the country or if you really hunt for the best possible bargain, but I didn&#8217;t mind paying a little extra for peace-of-mind, so I did not even consider the foreign options. Please note, I&#8217;m not saying that foreign clinics are less competent or reliable; I have not reason to suspect that. It&#8217;s just that the whole idea of having a guy scrape away my cornea and start cutting into my iris with a laser beam, was stressful enough without the added inconveniences of travelling to another country. Eventually I selected <a href="http://www.eyescan.nl/">EyeScan</a> in Utrecht, mostly because they scored very high in a test done by the <a href="http://www.consumentenbond.nl">Dutch Consumer&#8217;s Organization</a>, and also because they offered a pretty complete set of techniques: <a href="http://en.wikipedia.org/wiki/LASEK">LASEK</a>, <a href="http://en.wikipedia.org/wiki/LASIK">LASIK</a> and <a href="http://en.wikipedia.org/wiki/IntraLASIK">IntraLASIK</a>, which gave me some extra confidence that they would honestly advise me on which option was best for me.</p>
<p>Before contacting a clinic, I did my homework pretty thoroughly. The main options for laser surgery are the three I listed in the previous paragraph. All three are identical in so far as they use a laser to reshape and thereby correct the imperfections in the lens of the eye; the difference between them lies in how part of the cornea is removed to give the laser access to the inner parts of the eye. LASIK is the most popular form used today. Basically, a cheesegrater-like microkeratome knife is used to create a little doggy-door flap in the cornea; this is then folded aside so that the laser can do its thing. IntraLASIK works the same way, except that the creation of the flap is done using a femtolaser (which is different from the laser used for the lens-correction operation itself) instead of a microkeratome blade. IntraLASIK is typically a few hundred Euros more expensive than regular LASIK. Opinions vary about its added value; clinics which have the hardware needed to offer it tend to claim that it greatly improves the quality of the result and the risk of the dreaded &#8216;halo effects&#8217; afterwards, while clinics which have not yet invested in a femtolaser will assure you that there is no proven difference and it&#8217;s the skill of the surgeon that matters.</p>
<p>The main reason for the popularity of LASIK is, I think, the &#8220;instant satisfaction&#8221; aspect of it. If all goes well, you can be enjoying your new and improved vision within a few hours of the operation, and it only gets better from there. When everything goes well there is also supposed to be very little discomfort, other than dry eyes. However, the big disadvantage of LASIK, which scared me away from it, is that the &#8220;doggy door&#8221; flap remains a weak spot on the eyeball for years afterwards. Getting hit in the eye by a blunt object is never a good idea, but when that eye has been the recipient of a LASIK operation in the past, the consequences can be really nasty. Also, from what I learned most of the unwanted side-effects of a LASIK operation did not come from the actual laser surgery, but from the flap not falling nicely back into place or otherwise causing trouble. The main problem seems to be that, unlike most parts of the human body, the cornea does not really have the ability to heal damage sustained as an adult. The flap eventually gets fixed into place because the <a href="http://en.wikipedia.org/wiki/Corneal_epithelium">epithelium</a> grows back over it, but the cuts that were made into the cornea itself may never fully heal, and neither will the nerves that ran through it.</p>
<p>Therefore, I decided to go with LASEK instead. LASEK, also called PRK, is the older approach to giving the laser access to the lens. Instead of cutting into the cornea, the surgeon scrapes away the epithelium. The epithelium is the uppermost layer of the cornea and it does have the ability to regenerate cleanly after being damaged. The main disadvantage of LASEK over LASIK, and probably the reason why the latter is more popular nowadays, is that the initial recovery period is a lot longer and more painful. With LASEK, the patient is recommended to take a week off in order to recover; with LASIK if all goes well you can be back in the office after a day or two. However, the risk of side effects is lower and after the initial recovery period the eye should heal so completely that after some months, even an ophthalmologist may have trouble seeing evidence that an operation ever took place. An illustrative incident is that when I had made the appointment for the operation with EyeScan, I was sent home with the legal forms for both types of operation; the list of potential complications for LASIK was three times as long as the one for LASEK!</p>
<p>There is also <a href="http://en.wikipedia.org/wiki/EPI-LASIK">Epi-LASIK</a>, which is the obvious combination of the two ideas: as with LASIK, the surgeon uses a &#8216;cheesegrater&#8217; microkeratome or a femto-laser to cut a flap out of the cornea, but as with LASEK he only cuts as deep as the epithelium and does not cut into the deeper layers of the cornea that do not have the ability to regenerate. However, EyeScan did not offer that option (yet) when I had the operation.</p>
<p>One other choice to be made was between regular and <a href="http://en.wikipedia.org/wiki/Lasik#Wavefront-guided_LASIK">wavefront-guided</a> laser correction. EyeScan calls this &#8220;Superior / CustomVue&#8221;, other laser clinics have their own marketing terms, and all of them try to suggest that they have some extra-special technique for giving you a better result than you&#8217;d get from their competitors. What it comes down to is that instead of just re-shaping your lens from e.g. -4 to approximately 0, the laser is programmed to apply specific corrections to carefully measured local aberrations in the lens, thereby achieving the optimal result for your eye instead of applying a one-size-fits-all approach. Most clinics offer something like this next to their standard offer nowadays, at a higher price of course, and they all suggest that it will give you a more perfect vision, although at the same time they also keep their standard disclaimer that the results can vary and you are not even guaranteed not to need glasses anymore. To be honest, it seems a bit fishy to me: the way I envision it is that there is a little switch on the laser machine, with settings labeled &#8220;decent quality&#8221; and &#8220;extra good quality&#8221;, and the surgeon charges several hundred € for putting the switch to the &#8220;extra quality&#8221; setting, even though it&#8217;s the same machine! It&#8217;s a textbook case of <a href="http://www.joelonsoftware.com/articles/CamelsandRubberDuckies.html">market segmentation</a>, of course: charging more money to people who can afford it, for basically the same service, by putting some extra features only in the more expensive version of the product, even though they cost you nothing extra to produce. How much did I really get for that extra money? I will never know for sure, but I would rather live with the vague feeling that maybe I got ripped off just a little bit, than spend the rest of my life wondering if my vision would have been better if I had checked the &#8220;wavefront-guided&#8221; box. So I paid up, and would pay up again if I had to, even though there is that niggling feeling that I am being played. Hopefully, in the future wavefront-guided will just be the standard, and the inferior option won&#8217;t even be offered anymore.</p>
<p>I had the operation on July 9, 2009. My parents drove me to the clinic and there was a brief, last check-up to make sure that my eyes still matched the measurements that were taken a few weeks earlier. Then there was a brief conversation with the eye surgeon, I was dressed in sterile clothing, and walked into the operation room. As is the case with most private clinics as I understand it, EyeScan is not connected to a hospital, so the operation room is simply a converted room in an otherwise ordinary office building. I was told to lie down, and a variety of different kinds of eye-drops were applied. One of them was a topical anaesthetic; other than that no anaesthesia was used so I was fully conscious during the operation. Then, the surgeon used a scalpel to move aside the epithelium, which looks <em>really</em> weird when you&#8217;re looking up at it from underneath!</p>
<p>After that preparation, the actual laser surgery was pretty much an anti-climax: all I had to do was stare at a blinking yellow light for a minute or so. There was no feeling, no way to confirm that anything was happening. Afterwards, a temporary lens was placed onto my eye to protect the lens while the epithelium was growing back, to be removed three days later. Then, I got up and was given a cocktail of painkillers with instructions on how to use them, plus a set of protective goggles to wear at night to keep myself from subconsciously rubbing my eyes. The surgeon and his two assistants were very professional and businesslike during the whole process, except that during the surgery they were having a conversation about some minor problem which worried me a bit, but which I was told afterwards was not about my case. Apparently, the surgeon is not employed full-time by the clinic but works at a hospital or something and is hired by EyeScan for a couple of days per week.</p>
<p>Immediately after the operation, my vision was already noticeably improved! Unfortunately that didn&#8217;t last, as things got blurry during the week after the operation. In hindsight, this was not surprising: at that point there was basically no epithelium at all obstructing my vision, so I had a very clear view but was at a hightened risk of UV damage from the sun. For the first two months or so after the operation, I was instructed to wear dark sunglasses whenever I went outside, even on cloudy days. I was also somewhat extra light-sensitive during the first weeks, but it wasn&#8217;t very bad &#8212; apparently some people can be very affected by this, to the point where they have to live in a completely darkened room for the first several days. Anyway, that period of clear vision immediately after the operation did not last; as the epithelium was growing back it formed some &#8217;scar tissue&#8217; which took a while to clear up again, so for a week or so my vision got worse than it was before, after which it slowly got better again.</p>
<p>Next to the painkillers, I was also given a large collection of eye-drops: a large amount of &#8216;comfort drops&#8217; to keep the eye moistened, which I had to use for the first two months and then gradually wean myself off, and some antibiotics to prevent inflammation during the healing process. Unfortunately, I turned out to be allergic to the preservative used in those eye-drops, and that allergy caused extra inflammation of my eyes and the skin around it. This is apparently a fairly common problem, but it was not noticed on my first check-up visit four days after the operation. So during the first week, whenever I used those drops I was actually making the situation worse! Fortunately, once the problem was diagnosed and I was given a preservative-free alternative, things started to improve quickly. I had taken a week of vacation following the operation; after that week I was able to go back to work, although the vision in my left eye was still far from perfect. I am glad that I still had my untreated right eye to look through, otherwise I would have been unable to work for another week or so.</p>
<p>Somewhere between two and three weeks after the operation, the vision in my left eye was roughly comparable to that in my right: hardly perfect, but good enough to get around without needing glasses. From there on, it slowly but gradually kept improving. I had several check-up meetings with EyeScan during the first half year, at increasing intervals, and was surprised to notice that even between the three-month and six-month check-up there was still a noticeable improvement. I think part of it was not so much the healing of my eye, but had more to do with my brain having to learn to deal with the changed situation. For example, initially it often happened that when I tried to make out some fine detail in the distance, I could improve the clarity by closing my right eye &#8212; apparently my brain was not yet used to the fact that suddenly, after more than 30 years, my left eye was now the better one for distance use! But I don&#8217;t seem to have that problem anymore.</p>
<p>So, how did I end up? Very well! On my last check-up, I scored a very pleasing 150% acuity in my left eye, with 100% apparently being a somewhat arbitrary reference point meaning &#8220;normal sight&#8221;. And indeed, I get around perfectly well without glasses, for close-up reading and computer work as well as making out small details in the distance. The fact that my right eye is still less than perfect, does not seem to hinder me in any way that I have noticed.</p>
<p>The only remaining side effect is that my eye is still sometimes more dry than it should be, especially when waking up in the morning. This can be painful when there is a piece of dirt in my eye but I am not producing enough tear fluid to get rid of it. I knew in advance that this was the most common side effect of laser surgery; it can take a long time to go away and can even be permanent to some degree. Fortunately, at its current level it is a fairly minor annoyance rather than a problem. Apart from that, I am very happy that I took the plunge, and if I had to make the same decision again I would definitely go with LASEK again.</p>
<div class="zemanta-pixie"><img class="zemanta-pixie-img" src="http://img.zemanta.com/pixy.gif?x-id=dbd159d1-499c-818e-812d-935389368711" alt="" /></div>
]]></content:encoded>
			<wfw:commentRss>http://mwolf.net/archive/lasek/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m a runner!</title>
		<link>http://mwolf.net/archive/dam-tot-dam-2009/</link>
		<comments>http://mwolf.net/archive/dam-tot-dam-2009/#comments</comments>
		<pubDate>Sun, 20 Sep 2009 19:04:06 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[me]]></category>
		<category><![CDATA[running]]></category>
		<category><![CDATA[dam-tot-dam loop]]></category>

		<guid isPermaLink="false">http://mwolf.net/?p=75</guid>
		<description><![CDATA[Today was the day of the 25th Dam-tot-Dam-loop, a 16.1km running event from Amsterdam to Zaandam. Yours truly was one of the 35,000 people who signed up for the event, and one of the 17,614 people who made it to the finish line!
Even though, in the eyes of real hard-core marathon runners, 16km is no [...]]]></description>
			<content:encoded><![CDATA[<p>Today was the day of the 25th <a href="http://www.damloop.nl">Dam-tot-Dam-loop</a>, a 16.1km running event from Amsterdam to Zaandam. Yours truly was one of the 35,000 people who signed up for the event, and one of the 17,614 people who made it to the finish line!<span id="more-75"></span></p>
<p>Even though, in the eyes of <a href="http://www.djcbsoftware.nl/ChangeLog/">real hard-core marathon runners</a>, 16km is no big deal, I&#8217;m quite proud and excited about this, as it was my first participation in an organized running event ever. Or my first 16.1km run at all, for that matter. I started running somewhere in the beginning of 2008, so this was kind of like an exam for myself.</p>
<p>Speaking of organized events, the organization was excellent as far as I could see, despite the unprecedented number of participants in this 25th year of the Dam-tot-Dam. Dealing with thirty-five thousand runners plus an enormous number of onlookers is no small challenge, but at least as far as I am concerned everything was prepared perfectly: bags were transported to the finish area (unlike most runs the Dam-tot-Dam is not a loop: you don&#8217;t finish anywhere near the starting point), there were water and first-aid stands everywhere along the route, etc. Unfortunately, despite the best efforts of the medical personnel, one person died of a fatal heart attack a few kilometers before the finish line.</p>
<p>Thanks to the wonders of modern surveillance technology (specifically, an RFID chip tied to every runner&#8217;s shoelace) my progress has been tracked in <a href="http://evenementen.uitslagen.nl/2009/damloop/details.php?t=&amp;s=24213">excruciating detail</a>. Most interesting is of course my total time for the whole run: 1:34:20, which comes out to an average speed of 10.2 km/h. Not quite up there with the panthenon of running gods, but a perfectly respectable time for a first-timer, if I do say so myself.</p>
<p>I&#8217;m glad it went as well as it did, since I&#8217;ve been battling a pretty heavy cold for the past week and it was by no means over yet today. But during the actual run, I didn&#8217;t seem to be too bothered by that &#8212; probably the adrenaline doing its work. Immediately afterwards, however, the hammer fell; my lungs felt as if a host of insects had taken up inside them, and I was limping so badly that the steps of Zaandam Station seemed to be as big a challenge as the run itself. Well, OK, not <em>that</em> bad. But it didn&#8217;t matter, because I was wearing around my neck the medal proclaiming that I&#8217;m officially a runner now! I just hope that my <a href="http://www.copacabanarunners.net/i-immune-system.html">immune system</a> is not going to punish me too badly over the coming weeks, for dumping so much abuse on it in its already weakened state..</p>
<p>I&#8217;m going to take it easy for the next week or so, but there&#8217;s definitely going to be a follow-up on this if I have anything to say about it! Perhaps next year&#8217;s Dam-tot-Dam, and see if I can get my time down towards 1:25 or so? Or maybe a half marathon? Three years ago, nobody among my aquaintances, least of all myself, would have predicted that I would ever take part in a long-distance running event. But with 16km in the bag, suddenly 22km does not seem quite as utterly impossible anymore as it once did..</p>
]]></content:encoded>
			<wfw:commentRss>http://mwolf.net/archive/dam-tot-dam-2009/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Golfing with prime factors</title>
		<link>http://mwolf.net/archive/golfing-with-prime-factors/</link>
		<comments>http://mwolf.net/archive/golfing-with-prime-factors/#comments</comments>
		<pubDate>Sun, 14 Jun 2009 13:57:53 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[hacks]]></category>
		<category><![CDATA[me]]></category>
		<category><![CDATA[code golf]]></category>
		<category><![CDATA[factoring]]></category>
		<category><![CDATA[hanoi]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[perl golf]]></category>
		<category><![CDATA[prime factors]]></category>
		<category><![CDATA[prime numbers]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[towers of hanoi]]></category>

		<guid isPermaLink="false">http://mwolf.net/?p=55</guid>
		<description><![CDATA[Dirk-Jan reminded me of the Perl Golf and Code Golf contests, both of which have the aim of solving a simple programming task in as few characters of source code as possible. See his post for a stunning example.
One of the open challenges is to work out the prime factors of a given number. To [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.djcbsoftware.nl/ChangeLog/2009/05/perl-golf.html">Dirk-Jan</a> reminded me of the <a href="http://perlgolf.sourceforge.net/">Perl Golf</a> and <a href="http://codegolf.com/">Code Golf</a> contests, both of which have the aim of solving a simple programming task in as few characters of source code as possible. See his post for a stunning example.</p>
<p>One of the <a href="http://codegolf.com/competition/browse">open challenges</a> is to <a href="http://codegolf.com/prime-factors">work out the prime factors</a> of a given number. To make things a little more difficult, the output must be printed in a specific format:</p>
<blockquote><p><span style="font-family: Courier New;"> 7000: 2^3 5^3 7<br />
123456789: 3^2 3607 3803</span></p></blockquote>
<p><span id="more-55"></span>Here is one of my attempts at a Ruby implementation, which is 97 bytes after removing the final trailing newline:</p>
<blockquote><p><span style="font-family: Courier New;"> print&#8221;#{n=gets.to_i}: &#8221;<br />
(2..n).each{|x|i=0;n,i=n/x,i+1while n%x&lt;1<br />
print x,i&lt;2?&#8217; &#8216;:&#8221;^#{i} &#8220;if i&gt;0}</span></p></blockquote>
<p>Then we switched to Perl, and together Dirk-Jan and I managed to come up with a version which is just 82 bytes after removing all the newlines (just pipe it through &#8220;<span style="font-family: Courier New;">perl -pe chomp</span>&#8220;).</p>
<blockquote><p><span style="font-family: Courier New;"> print$n=pop,&#8217;:';for(2..$n){<br />
$i=0;$n/=$_,$i++until$n%$_;<br />
print&#8221; $_&#8221;.&#8221;^$i&#8221;x($i&gt;1)if$i}</span></p></blockquote>
<p>(Be aware that the Ruby version takes its input from <span style="font-family: Courier New;">stdin</span>, while the Perl program looks at its first command-line argument.)</p>
<p>That&#8217;s pretty compact, right? Algorithmically, the code is actually fairly straightforward; probably the most evil trick we use is to employ the &#8216;<span style="font-family: Courier New;">x</span>&#8216; operator, which does string concatenation a given number of times, in combination with the fact that any Boolean expression can be treated as a numeric value of either 0 or 1, as in C (but not in Ruby).</p>
<p>Unfortunately, both of the versions given above are horrendously slow. They have a running time of <a href="http://en.wikipedia.org/wiki/Big_O_notation">O(<em>n</em>)</a>, while any self-respecting factorization algorithm should be at most proportional with the largest prime factor of <em>n</em>. It took my Pentium-4 system almost 45 minutes to calculate the factors of 2,000,000,000, which a reasonably intelligent high school student could probably have done in half a minute or so. Here is a version which can do it in a fraction of a second, but at the cost of being a whole 10 bytes larger:</p>
<blockquote><p><span style="font-family: Courier New;"> print$n=pop,&#8217;:';<br />
for($x=2;$n&gt;1;$x++){<br />
$i=0;$n/=$x,$i++until$n%$x;<br />
print&#8221; $x&#8221;.&#8221;^$i&#8221;x($i&gt;1)if$i}</span></p></blockquote>
<p>So, how are we doing in the contest? Well, we&#8217;re not even competing. The <a href="http://codegolf.com/leaderboard/competition/prime-factors/">leader</a> is currently at an astonishing 76 bytes! I have no idea how they do that. The winning programs are all in Perl, which tends to do very well in this type of contest despite the fact that all variable names are at least two characters. The best Ruby program is 82 bytes, with Python coming in at 100 and PHP at 122.</p>
<p>Another <a href="http://codegolf.com/tower-of-hanoi">task</a> in Code Golf is to write a program which can solve the famous <a href="http://en.wikipedia.org/wiki/Towers_of_hanoi">Towers of Hanoi</a> puzzle, given a random starting position with up to nine disks. The input consists of three lines of text, each giving the sequence of disks for one of the three pegs. For example:</p>
<blockquote><p><span style="font-family: Courier New;"> 975<br />
864<br />
321</span></p></blockquote>
<p>The goal is to print the series of moves needed to get all disks together on peg C, the third one, following the usual rule that at no time may a larger disk be on top of (to the right of) a smaller one. Here is a very simple example run with only three disks:</p>
<blockquote><p><span style="font-family: Courier New;"> $ cat simple.txt<br />
31</span></p>
<p>2</p>
<p><span style="font-family: Courier New;"> $ ruby hanoi.rb simple.txt<br />
2 to B<br />
1 to B<br />
3 to C<br />
1 to A<br />
2 to C<br />
1 to C</span></p></blockquote>
<p><span style="font-family: sans-serif;">We haven&#8217;t spent as much time yet on this one as on the prime factorization problem. Here is my best effort so far:</span></p>
<blockquote><p><span style="font-family: Courier New;"> T,D=[],[:A,:B,:C]<br />
D.each{|t|gets.chomp.each_byte{|x|T[x-48]=t}}<br />
def m s,t<br />
if s&gt;0<br />
m s-1,(D-[t,T[s]])[0]<br />
puts&#8221;#{s} to #{t}&#8221;<br />
m s-1,T[s]=t<br />
end<br />
end<br />
m T.size-1,:C</span></p></blockquote>
<p><span style="font-family: sans-serif;">This is an embarassing 157 bytes. In the actual <a href="http://codegolf.com/leaderboard/competition/tower-of-hanoi/">contest participants</a>, Ruby is leading the pack this time, with 104 bytes, while the best Perl entry so far is a whole six bytes larger. Go Ruby!</span></p>
<p><span style="font-family: sans-serif;">The Code Golf contest is open to participants using <a href="http://en.wikipedia.org/wiki/Ruby_%28programming_language%29">Ruby</a>, <a href="http://en.wikipedia.org/wiki/Perl">Perl</a>, <a href="http://en.wikipedia.org/wiki/Python_%28programming_language%29">Python</a> and <a href="http://en.wikipedia.org/wiki/PHP">PHP</a>. Nonetheless, <a href="http://blog.leenarts.net/">Jeroen</a>, <a href="http://blog.hendricksen.eu">Jeroen</a> and <a href="http://blogs.infosupport.com/blogs/raimondb/">Raimond</a>, I look forward to you trying to beat the above programs in Java or C#..Â  <img src='http://mwolf.net/wordpress/wp-includes/images/smilies/icon_razz.gif' alt=':-P' class='wp-smiley' /> </span></p>
]]></content:encoded>
			<wfw:commentRss>http://mwolf.net/archive/golfing-with-prime-factors/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Arco rocks</title>
		<link>http://mwolf.net/archive/arco-rocks/</link>
		<comments>http://mwolf.net/archive/arco-rocks/#comments</comments>
		<pubDate>Mon, 25 May 2009 18:41:12 +0000</pubDate>
		<dc:creator>martin</dc:creator>
				<category><![CDATA[me]]></category>
		<category><![CDATA[misc]]></category>
		<category><![CDATA[arco]]></category>
		<category><![CDATA[climbing]]></category>
		<category><![CDATA[italy]]></category>
		<category><![CDATA[vacation]]></category>

		<guid isPermaLink="false">http://mwolf.net/archive/arco-rocks/</guid>
		<description><![CDATA[A short report on my climbing vacation in Arco, Italy last week.]]></description>
			<content:encoded><![CDATA[<p>I got back this week-end from a nice week of rock climbing in <a href="http://en.wikipedia.org/wiki/Arco,_Italy" target="_blank">Arco, Italy</a> with <a href="http://blog.hendricksen.eu/">Jeroen</a> and <a href="http://blogs.infosupport.com/blogs/raimondb/default.aspx">Raimond</a>. We stayed at Camping Arco, a really nice and fairly luxurious camping if you can manage to get a place there (they refuse reservations lasting less than 7 nights, or made less than two weeks in advance). The weather was perfect; in fact it was almost too warm for the time of year, and we skipped some of our planned activities because of that. Lessons learned for next year: go in April, and don&#8217;t climb south-facing walls in the middle of the day.</p>
<p>A couple of pictures, made by Jeroen or at least with his camera:<span id="more-47"></span><img style="max-width: 800px;" title="Jeroen starting a tricky route, with Martin belaying" src="http://mwolf.net/images/arco1.jpg" alt="Jeroen starting a tricky route, with Martin belaying" /><img style="max-width: 800px;" title="Picture taken from above. Don" src="http://mwolf.net/images/arco2.jpg" alt="Raimond ascending a klettersteig (via ferrata)" /><img style="max-width: 800px;" title="Picture taken from above. Smile, but don't wave!" src="http://mwolf.net/images/arco3.jpg" alt="Picture taken from above. Smile, but don't wave!" /><br />
<img style="max-width: 800px;" title="Jeroen, with Arco in the background" src="http://mwolf.net/images/arco4.jpg" alt="Jeroen, with Arco in the background" /><img style="max-width: 800px;" title="Breakfast at the camping" src="http://mwolf.net/images/arco5.jpg" alt="Breakfast at the camping" /></p>
<p>Getting good photographs of the actual climbing is surprisingly tricky, as it turns out. When taking photos from below, you mostly get a lot of ass in the picture. Ideally, you want the photographer to be level with the climber, which generally means that he needs to climb another route first and then stay there while the &#8216;model&#8217; is doing the climb next to him. Rather tricky to accomplish when there&#8217;s only three of you, and of course a lot of the time we were simply having too much fun climbing to think of getting out the camera!</p>
<p>Most of our time was spent doing single-pitch sports climbing on the many great rocks around Arco. (Tip: if you have a car, go to <em>Croz de le Niere</em>, just outside the village of Preore at a bit less than 40km from Arco &#8212; great climbing on rock which isn&#8217;t too &#8220;climbed out&#8221; yet, and not too crowded, at least on the day we were there.) We also did a 100m multi-pitch route at Baone, which got interesting when we missed a relais and had to do some improvisation in order to reach the next one, which was more than half the lenght of our 70m rope away.</p>
<p>Apart from sports climbing, we did a <em>via ferrata</em>, or <em>klettersteig</em> as it&#8217;s called in Austria and Germany. And of course we spent an afternoon sunbathing at Lake Garda, which is only about 5km from Arco.</p>
<p>Good restaurants in Arco: <em>Pace</em> and <em>Alla Lega</em>, both on the village&#8217;s main street, are excellent, and <em>Al Fiume</em> on the other side of the bridge is quite good also. We were less impressed with <em>Cantina Marchetti</em>, on a side street from the main square, although to be fair we went there on what may well be the busiest day of the year from them (the Friday of the Ascension Day week-end, when apparently every climber in Germany goes to Arco) so we probably didn&#8217;t get to experience them at their best.</p>
]]></content:encoded>
			<wfw:commentRss>http://mwolf.net/archive/arco-rocks/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Wheeeeee!!!!</title>
		<link>http://mwolf.net/archive/wheeeeee/</link>
		<comments>http://mwolf.net/archive/wheeeeee/#comments</comments>
		<pubDate>Wed, 16 Apr 2008 21:28:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[me]]></category>
		<category><![CDATA[misc]]></category>

		<guid isPermaLink="false">http://mwolf.net/archive/wheeeeee/</guid>
		<description><![CDATA[So, this Saturday, I jumped out of an airplane.
The jump was a birthday present for my father, who has always been very interested in everything related to planes. But of course, when we gave him the gift certificate, it went without saying that me and my brother would jump as well.
And it was COOL! All [...]]]></description>
			<content:encoded><![CDATA[<p>So, this Saturday, I jumped out of an airplane.</p>
<p>The jump was a birthday present for my father, who has always been very interested in everything related to planes. But of course, when we gave him the gift certificate, it went without saying that me and my brother would jump as well.</p>
<p>And it was COOL! All three of us loved it.</p>
<p><span id="more-23"></span> Of course, it was a tandem jump &#8212; an experienced parachuteer does all the work, and you&#8217;re just along for the trip. Nonetheless, since the experienced guy needs to be on top for obvious reasons, that means that once the door opens, you get to do the honours of swinging your legs over the side and pushing off. After that, there is 30 seconds of free fall, which is really wild &#8212; imagine sticking your head out of the window of a car doing 200kmh, and you have a fair idea of what it feels like. The jump starts at a height of 3000m, and in those 30 seconds you cover roughly half that distance. Then there&#8217;s a brief shock as the parachute opens &#8212; and the next second you&#8217;re just hanging there, seemingly not moving at all, and it&#8217;s so quiet that the two of you can hold a conversation without raising your voice.</p>
<p>The view is incredible &#8212; you&#8217;re still high enough to see for miles around, and there&#8217;s nothing between you and the scenery. After a while however, you notice that you&#8217;re not completely motionless, and in fact the objects on the ground are getting larger quite rapidly. Moments later, the landing point comes into view. The landing was surprisingly soft; if it wasn&#8217;t for the inconvenience of being two people strapped together, it would be more like stepping off an escalator than jumping down from a height.</p>
<p>It was definitely exciting, but not quite as scary as I expected it to be. I felt some nerves as the airplane door opened, but then as I looked out, there was never really a feeling of &#8220;I&#8217;m three kilometers above the ground and if anything goes wrong I will die.&#8221; Rather, looking from the plane it seemed as if everything was weightless &#8212; as if, even without a parachute, I could just step out of the plane and float around a little. After that, there was too much to do to be scared: step out, grab harness with both hands, push off, hold head backwards, arc body, wait for a tap on the shoulder, move arms into the stabilizing position &#8212; and then the &#8216;chute opens and you&#8217;re seemingly weightless again. There&#8217;s just no time to be scared.</p>
<p>On the other hand, some of the other people doing tandem jumps on the same day, weren&#8217;t quite so stoic about it &#8212; some of our fellow jumpers seemed about to pass out beforehand, and the couple who were scheduled after us were still debating whether or not to go through with it, when we left them.</p>
<p>So, would I do it again? Definitely! Although, at 200 euros for four minutes of fun, it&#8217;s not something you do every week. But I have already been looking into the options for taking <a href="http://www.paracentrumteuge.nl/">solo jumping lessons</a>..</p>
]]></content:encoded>
			<wfw:commentRss>http://mwolf.net/archive/wheeeeee/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Hello, anybody there?</title>
		<link>http://mwolf.net/archive/mail-problem/</link>
		<comments>http://mwolf.net/archive/mail-problem/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 21:03:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[me]]></category>

		<guid isPermaLink="false">http://mwolf.net/archive/mail-problem/</guid>
		<description><![CDATA[Hi all,
I have reason to believe that some of my mail from my mwolf.net account is not reaching the intended recipients. If you sent me an e-mail recently and did not get a response from me, it may be that I sent one but it didn&#8217;t arrive. If this is the case, please re-send your [...]]]></description>
			<content:encoded><![CDATA[<p>Hi all,<br />
I have reason to believe that some of my mail from my mwolf.net account is not reaching the intended recipients. If you sent me an e-mail recently and did not get a response from me, it may be that I sent one but it didn&#8217;t arrive. If this is the case, please re-send your message and I will try to reach you though some other way. Alternatively, you can leave a comment on this post. Sorry for the inconvenience.</p>
<p>And yes, I am aware that I have not posted anything new on this blog for the past half year or so..</p>
]]></content:encoded>
			<wfw:commentRss>http://mwolf.net/archive/mail-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Five things you probably didn&#8217;t care about</title>
		<link>http://mwolf.net/archive/five-things/</link>
		<comments>http://mwolf.net/archive/five-things/#comments</comments>
		<pubDate>Mon, 08 Jan 2007 20:54:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[me]]></category>

		<guid isPermaLink="false">http://mwolf.net/archive/five-things/</guid>
		<description><![CDATA[Well, looks like I&#8217;ve been tagged for the latest blog fad, the &#8220;five things you didn&#8217;t know about me&#8221; chain letter. Thanks, Edward.
Here we go. Actually, some of these are things which you did know about me, if you are more than a passing acquaintance.

The first computer programs I wrote, in BASIC, were little sprite [...]]]></description>
			<content:encoded><![CDATA[<p>Well, looks like I&#8217;ve been tagged for the latest blog fad, the &#8220;five things you didn&#8217;t know about me&#8221; chain letter. Thanks, <a title="Edward Smit" href="http://blog.edwardsmit.com/">Edward</a>.</p>
<p>Here we go. Actually, some of these are things which you <em>did</em> know about me, if you are more than a passing acquaintance.</p>
<ol>
<li>The first computer programs I wrote, in BASIC, were little sprite animations on the <a title="BBC Micro (Wikipedia)" href="http://en.wikipedia.org/wiki/BBC_Micro">BBC Micro</a>, when I was in my early teens or maybe even younger than that. A typical scenario for such an animation would go like this: airplane flies over, drops a bomb, little stick-man walks up from the side of the screen and pushes a little trampoline under the bomb, which bounces back and hits the plane, causing it to burst into flames. Good times.</li>
<li>Later, I moved on the <a title="Atari ST (Wikipedia)" href="http://en.wikipedia.org/wiki/Atari_st">Atari ST</a>, the <a title="Amiga (Wikipedia)" href="http://en.wikipedia.org/wiki/Commodore_Amiga">Commodore Amiga</a>, and eventually the first PCs. Other machines that found their way into the Wolf household were the <a title="Sharp MZ-700 (Wikipedia)" href="http://en.wikipedia.org/wiki/Sharp_MZ">Sharp MZ-700</a>, the <a title="P2000 (Wikipedia)" href="http://en.wikipedia.org/wiki/Philips_P2000">Philips P2000</a> (that was before the BBC, actually, but I never programmed on it), a <a title="Canon X-07, which even Wikipedia has never heard about" href="http://www.old-computers.com/museum/computer.asp?c=258">Canon X-07</a> 1983-vintage ultraportable including a portable four-colour pen-plotter, and a <a title="Sharp PC-1248" href="http://www.promsoft.com/pc1248.htm">Sharp PC-1248</a> calculator-sized computer. Most of these were bought by my dad and eventually made it into my greedy hands; I still have the Canon and the PC-1248.  I also still have the Amiga, which was the first computer I bought for myself.</li>
<li>My dad is the one who got me started on the path to computer geekdom. He is, at least in some ways, a bigger geek than I am.</li>
<li>I have a pet snake, Billie.<br />
<a target="_blank" title="Billie 1" href="http://mwolf.net/images/billie1.jpg"><img align="bottom" alt="Billie, my pet snake, on the couch" title="Billie, my pet snake, on the couch" src="http://mwolf.net/images/billie1_thumb.jpg" /></a> <a title="http://mwolf.net/images/billie4.jpg" href="http://mwolf.net/images/billie4.jpg"><img align="bottom" alt="Billie, my pet snake, in his terrarium" title="Billie, my pet snake, in his terrarium" src="http://mwolf.net/images/billie4_thumb.jpg" /></a></li>
<li>Although never a Sporty Spice, I used to do quite a bit of swimming and horseback riding as a teenager, and during the summer vacations I have been known to disappear into the French Alps wearing a large backpack and not come back for several days. Since a bit more than a year ago I&#8217;ve taken up indoor climbing, which I do quite enthusiastically now one or two days a week.</li>
</ol>
<p>Well, it&#8217;s a chain letter, so let me do unto others as I have been done unto: <a title="Mark Hurley" href="http://hurley.wordpress.com">Mark</a> <a title="Dirk-Jan's ChangeLog" href="http://www.djcbsoftware.nl/ChangeLog">Dirk-Jan</a> <a title="Jeroen Leenarts" href="http://blog.leenarts.net">Jeroen</a> <a title="Bert Ertman" href="http://blogs.infosupport.com/berte/default.aspx">Bert</a><a title="Jeroen Leenarts" href="http://blog.leenarts.net" /></p>
]]></content:encoded>
			<wfw:commentRss>http://mwolf.net/archive/five-things/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
