<?xml version="1.0"?>
<rss version="2.0" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:yt="http://gdata.youtube.com/schemas/2007" xmlns:atom="http://www.w3.org/2005/Atom">
   <channel>
      <title>How Can I Explain This? - Perl 6</title>
      <description>Pipes Output</description>
      <link>http://pipes.yahoo.com/pipes/pipe.info?_id=c30fa6b5be32693af535b6e46c4fabd6</link>
      <atom:link rel="next" href="http://pipes.yahoo.com/pipes/pipe.run?_id=c30fa6b5be32693af535b6e46c4fabd6&amp;_render=rss&amp;page=2"/>
      <pubDate>Thu, 23 May 2013 16:40:57 +0000</pubDate>
      <generator>http://pipes.yahoo.com/pipes/</generator>
      <item>
         <title>Post-hackathon thoughts</title>
         <link>http://howcaniexplainthis.blogspot.com/2012/04/post-hackathon-thoughts.html</link>
         <description>It has been a few days, and we have (sort of) landed.&lt;br /&gt;&lt;br /&gt;I shall call this year's Oslo.pm Perl 6 Patterns hackathon a success, judging by how the participants seemed to enjoy themselves during the hackathon, and the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://planetsix.perl.org/&quot;&gt;inspired blogging&lt;/a&gt; afterwards.&lt;br /&gt;&lt;br /&gt;Salve (sjn) and Rune (krunen) have, on behalf of Oslo.pm, delivered to standards that I am a bit worried that guests now will come to expect ;), and although I did not have capacity to help with much, I am happy with how everything turned out, except for one thing:&lt;br /&gt;&lt;br /&gt;Damian caught a cold, and was essentially out of the loop for most of the hackathon.&lt;br /&gt;&lt;br /&gt;Darnit.&lt;br /&gt;&lt;br /&gt;But he delivered a kick-ass talk on Thursday, and was very helpful and a very good resource before he somewhat reluctantly accepted the thrown towel.&lt;br /&gt;&lt;br /&gt;I did not do much hacking this year myself, but I managed to revive some of my Perl 6 skills.  I even fiddled a bit with the cookbook (dormant for three years or so, and therefore slightly out-of-date in some respects). I hope to contribute more to that piece of documentation in the coming months.&lt;br /&gt;&lt;br /&gt;The bonus if I manage to work my way through it, is that I will be pretty much up to speed with the language. Win!&lt;br /&gt;&lt;br /&gt;My thanks go to all the participants of the Hackathon, without you, Perl 6 would be much the poorer!</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-1158293179092473124</guid>
         <pubDate>Wed, 25 Apr 2012 11:15:00 +0000</pubDate>
      </item>
      <item>
         <title>Oslo.pm Patterns Hackathon pictures</title>
         <link>http://howcaniexplainthis.blogspot.com/2012/04/oslopm-patterns-hackathon-pictures.html</link>
         <description>&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-l1rTPaVa8nk/T5QaVsIvVdI/AAAAAAAAAdo/ymJYeD57gyc/s1600/IMG_3932.jpg&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;214&quot; width=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/-l1rTPaVa8nk/T5QaVsIvVdI/AAAAAAAAAdo/ymJYeD57gyc/s320/IMG_3932.jpg&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Hacking: sjn, moritz (back), pmichaud, jnthn, masak, tadzik, sergot, bjarneh&lt;/p&gt;&lt;/div&gt;&lt;hr/&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-n5YyCh7Z6WQ/T5QaV7a2FqI/AAAAAAAAAdw/Veypcp-8nng/s1600/IMG_3934.jpg&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;214&quot; width=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/-n5YyCh7Z6WQ/T5QaV7a2FqI/AAAAAAAAAdw/Veypcp-8nng/s320/IMG_3934.jpg&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Hacking: imarcusthis, infosophy&lt;/p&gt;&lt;/div&gt;&lt;hr/&gt;&lt;div class=&quot;separator&quot; style=&quot;clear:both;text-align:center;&quot;&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://4.bp.blogspot.com/-0svqBX518-4/T5QaWftYr1I/AAAAAAAAAd8/mRlYKBZlkfc/s1600/IMG_3935.jpg&quot; style=&quot;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;222&quot; width=&quot;320&quot; src=&quot;http://4.bp.blogspot.com/-0svqBX518-4/T5QaWftYr1I/AAAAAAAAAd8/mRlYKBZlkfc/s320/IMG_3935.jpg&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;p&gt;Posing, back to front, left to right:&lt;br /&gt;infosophy, moritz, arnsholt, sjn, krunen, masak&lt;br /&gt;tadzik, jnthn, frettled, pmichaud&lt;/p&gt;&lt;/div&gt;</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-1443622212099747175</guid>
         <pubDate>Sun, 22 Apr 2012 16:59:00 +0000</pubDate>
         <media:thumbnail height="72" url="http://4.bp.blogspot.com/-l1rTPaVa8nk/T5QaVsIvVdI/AAAAAAAAAdo/ymJYeD57gyc/s72-c/IMG_3932.jpg" width="72" xmlns:media="http://search.yahoo.com/mrss/"/>
      </item>
      <item>
         <title>Oslo.pm Perl 6 Patterns Hackathon 2012</title>
         <link>http://howcaniexplainthis.blogspot.com/2012/04/oslopm-perl-6-patterns-hackathon-2012.html</link>
         <description>In one week (2012-04-20 – 2012-04-22), a bunch of bright people will attend the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://gist.github.com/1711730&quot;&gt;Perl 6 Patterns Hackathon&lt;/a&gt; in Oslo.&lt;br /&gt;&lt;br /&gt;Perl 6 – both its specification and implementations – will become one of the Great Ones. I admit that we are not quite there yet, but to me, Perl 6 is a language for the long term.&lt;br /&gt;&lt;br /&gt;In one of the meetings krunen, sjn and I had this winter, we discussed this, and how to get there. I hope the Perl 6 Patterns Hackathon will contribute significantly, and I also hope that in 30-60 years, we will look back and be happy about most of the choices made around this time! I truly believe that we can get there!&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Call for sponsor matching &lt;/h3&gt;In this spirit, Ingvoldstad IT decided to sponsor this hackathon with NOK 5,000 (≈ EUR 650), and I hereby call for other companies who develop software&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://howcaniexplainthis.blogspot.com/2012/04/oslopm-perl-6-patterns-hackathon-2012.html#note&quot;&gt;*&lt;/a&gt; to match this amount. &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://oslo.pm.org/&quot;&gt;Oslo.pm&lt;/a&gt; will put those money to good use!&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I hope to see you in Oslo in a week!&lt;br /&gt;&lt;br /&gt;&lt;hr /&gt;&lt;a rel=&quot;nofollow&quot; name=&quot;note&quot;&gt;&lt;/a&gt;* &lt;small&gt;&lt;i&gt;I did not write &quot;Perl&quot; here, because I think that is largely irrelevant. Perl 6 is an amalgam of many of the most interesting programming language features, and offers a very compelling path to those who want a next-generation language after the current versions of e.g. Perl, Python, and Ruby.&lt;/i&gt;&lt;/small&gt;</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-132283182020413800</guid>
         <pubDate>Fri, 13 Apr 2012 10:41:00 +0000</pubDate>
      </item>
      <item>
         <title>Community boost</title>
         <link>http://howcaniexplainthis.blogspot.com/2010/08/community-boost.html</link>
         <description>It is now three days since the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://rakudo.org/announce/rakudo-star/2010.07&quot;&gt;release of Rakudo Star&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;Everything has met my personal expectations, except for one major thing:&lt;br /&gt;&lt;br /&gt;There is a bunch of &lt;span style=&quot;font-weight:bold;&quot;&gt;new&lt;/span&gt; people on #perl6, who are actively engaged in trying out Rakudo Star/Perl 6, in testing, submitting bug reports, patch suggestions, asking for help, providing help, helping themselves…&lt;br /&gt;&lt;br /&gt;I really do not have anything profound to say, but I can say this:&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;font-weight:bold;&quot;&gt;Now we are really getting somewhere!&lt;/span&gt;</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-5931074280528415524</guid>
         <pubDate>Sun, 01 Aug 2010 15:05:00 +0000</pubDate>
      </item>
      <item>
         <title>Rakudo Star is here</title>
         <link>http://howcaniexplainthis.blogspot.com/2010/07/rakudo-star-is-here.html</link>
         <description>The wait is over, and a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://rakudo.org/announce/rakudo-star/2010.07&quot;&gt;usable Rakudo-based Perl 6 distribution is ready&lt;/a&gt; for early adopters. Yay!&lt;br /&gt;&lt;br /&gt;More and more of Perl 6 is implemented in Perl 6.  That is a very good tendency.</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-989376866050970965</guid>
         <pubDate>Thu, 29 Jul 2010 14:29:00 +0000</pubDate>
      </item>
      <item>
         <title>Missing feature</title>
         <link>http://howcaniexplainthis.blogspot.com/2010/02/missing-feature.html</link>
         <description>A few hours ago, I suddenly had a bright(?) idea, or desire if you will:&lt;br /&gt;&lt;br /&gt;Proper (Unicode) exponents in Perl.&lt;br /&gt;&lt;br /&gt;That is, I want to be able to write 2&lt;sup&gt;2&lt;/sup&gt;, 4&lt;sup&gt;137&lt;/sup&gt;, 3&lt;sup&gt;-9&lt;/sup&gt;, etc. &lt;em&gt;and have Perl understand them&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;For Perl 5, I suspect someone would use a source filter to implement it.&lt;br /&gt;&lt;br /&gt;For Perl 6, &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://perlpilot.blogspot.com/&quot;&gt;PerlJam&lt;/a&gt;++ suggested introducing each  of the exponents as postfix operators, using this example for squaring:&lt;pre&gt;our &amp;amp;postfix:&amp;lt;&lt;sup&gt;2&lt;/sup&gt;&amp;gt; := &amp;amp;infix:&amp;lt;**&amp;gt;.assuming(b =&amp;gt; 2);&lt;/pre&gt;But then a negative exponent would complicate things a bit.&lt;br /&gt;&lt;br /&gt;It's a thought, anyway, and not one that I'd want to distract more pressing implementation concerns.&lt;br /&gt;&lt;br /&gt;And ifwhen someone decides that this is a good idea to have in the language core, I'll start nagging about &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Knuth%27s_up-arrow_notation&quot;&gt;Knuth's up-arrow notation&lt;/a&gt;. Not that I'd want anyone attempt calculating 4&amp;uarr;&amp;uarr;&amp;uarr;&amp;uarr;4.</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-3639531009391075013</guid>
         <pubDate>Thu, 11 Feb 2010 01:33:00 +0000</pubDate>
      </item>
      <item>
         <title>Rakudo ng - what will it mean for us?</title>
         <link>http://howcaniexplainthis.blogspot.com/2010/01/rakudo-ng-what-will-it-mean-for-us.html</link>
         <description>If you've been hanging around the right blogs and the #perl6 IRC channel on Freenode, then you've probably seen references to a slightly mysterious &quot;ng&quot;, or &quot;Rakudo ng&quot;.&lt;br /&gt;&lt;br /&gt;That's the upcoming (next) version (generation) of Rakudo, which will form the basis for &lt;strong&gt;Rakudo *&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;In essence, this is a refactoring/rewrite of Rakudo for the purpose of better compliance with the specification and performance improvements (yay). The old Rakudo master made it difficult &amp;mdash; if not impossible &amp;mdash; to implement several essential parts of the Perl 6 spec and top priorities on the Rakudo roadmap.&lt;br /&gt;&lt;br /&gt;In January, this has led to less focus on the current Rakudo version's bugs and gotchas, and instead on working to prepare &lt;strong&gt;ng&lt;/strong&gt; as the new master branch &amp;mdash; that is, &lt;em&gt;the Rakudo that you will be downloading the next time&lt;/em&gt;. &lt;br /&gt;&lt;br /&gt;For those of us who do some Perl 6 coding in Rakudo, this means that we can expect a nice little bunch of incompatibilities as compared to the current master. And yes, it's very close, so it's time to prepare.&lt;br /&gt;&lt;br /&gt;Here's a list of the blindingly obvious things I think we need to watch out for:&lt;ul&gt;&lt;li&gt;Older Rakudo was not in line with parts of the spec that &lt;strong&gt;ng&lt;/strong&gt; will be.&lt;/li&gt;&lt;li&gt;The spec has changed. &lt;em&gt;&lt;small&gt;(&lt;strong&gt;ng&lt;/strong&gt; development has uncovered several necessary changes.)&lt;/small&gt;&lt;/em&gt;&lt;/li&gt;&lt;li&gt;Older Rakudo is in line with parts of the spec that &lt;strong&gt;ng&lt;/strong&gt; perhaps isn't.&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Rakudo ng&lt;/strong&gt; is, of course, not feature complete when it replaces older Rakudo as the master.&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;In other words: let's not fool ourselves into thinking that we all of a sudden have a new Rakudo that's both compatible with the older as well as being spec compliant.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;The good news about Rakudo ng&lt;/h2&gt;&lt;p&gt;If you judge by the above paragraphs, you'd think that Rakudo ng was bad for Perl 6 developers. But that's far off the mark. I prodded #perl6 and &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://use.perl.org/~pmichaud/journal/&quot;&gt;Patrick Michaud&lt;/a&gt; before publishing this post, and here's a brief summary of (most of) the improvements we can see coming with Rakudo ng as opposed to the current implementation.&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Most of the top priorities of the Rakudo roadmap will be implemented!&lt;/li&gt;&lt;li&gt;Laziness will mostly work (the spec is undergoing change)&lt;/li&gt;&lt;li&gt;Performance improvements, many due to laziness&lt;li&gt;Array/List/Parcel/etc. will be compliant with the updated spec&lt;/li&gt;&lt;li&gt;Protoregexes&lt;/li&gt;&lt;li&gt;Better longest token matching&lt;/li&gt;&lt;li&gt;Meta-operators are really meta, and generated on demand&lt;/li&gt;&lt;li&gt;The base object metamodel is far closer to the spec than before&lt;/li&gt;&lt;li&gt;Major portions of the metamodel are implemented in Perl 6&lt;/li&gt;&lt;li&gt;Array and hash vivification will work properly&lt;/li&gt;&lt;li&gt;Lexical subs and variables work properly&lt;/li&gt;&lt;li&gt;Operators have the correct names (with angles)&lt;/li&gt;&lt;li&gt;Subs have the correct sigils (with ampersands)&lt;/li&gt;&lt;li&gt;Phasers work, and the phaser model is much improved&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Our programs will need a bit of attention. I recommend &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://dev.perl.org/perl6/lists/&quot;&gt;subscribing to perl6-language&lt;/a&gt; for up-to-date information about changes to the specification and language discussions.&lt;br /&gt;&lt;br /&gt;There's still &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://wiki.github.com/rakudo/rakudo/ng-major-features-needed&quot;&gt;a lot of work to be done&lt;/a&gt;, and I'm sure the Perl 6 developers are happy for any help they can get.</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-7481565918768458989</guid>
         <pubDate>Fri, 29 Jan 2010 18:24:00 +0000</pubDate>
      </item>
      <item>
         <title>feather.perl6.nl - a Sysadminish Tale</title>
         <link>http://howcaniexplainthis.blogspot.com/2010/01/featherperl6nl-sysadminish-tale.html</link>
         <description>&lt;small&gt;&lt;pre&gt;&amp;lt;@Juerd&amp;gt; frettled: Blog about the mess you found when&lt;br /&gt;         you first logged in on feather yesterday :)&lt;/pre&gt;&lt;/small&gt;&lt;hr /&gt;Sure.&lt;br /&gt;&lt;br /&gt;This will, incidentally, also explain why Trac is kindof unavailable now.&lt;br /&gt;&lt;br /&gt;feather.perl6.nl is a Xen guest (a virtual machine, hereafter &quot;VM&quot;) that's hosting several important services for the Perl 6 community. There's SVN web access, a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://trac.edgewall.org/&quot;&gt;Trac&lt;/a&gt; installation, and a bunch of other stuff I honestly don't know the half of.&lt;br /&gt;&lt;br /&gt;Recently, the VM started running out of memory too often for comfort.  What was going on?  Juerd asked for help in tracking down the problem, as he didn't have the time to do so himself.  And needing some distraction from work -- something to help me procrastinate -- I volunteered.&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://jani.at.ifi.uio.no/pics/headbash.gif&quot;&gt;&lt;img style=&quot;margin:0pt 10px 10px 0pt;float:left;cursor:pointer;width:113px;height:113px;&quot; src=&quot;http://jani.at.ifi.uio.no/pics/headbash.gif&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/a&gt; By now, you're probably banging your head on your keyboard in sympathy with me for saying something that may have been slightly less than brilliant. You know the feeling; Matt Trout reaches his right hand towards you, the world is suddenly in slow-motion, you see his hand closing in on you, his grin widening, and a voice saying &lt;em&gt;&quot;thhhhhaaaaannnnnkssss ffffooooorrr vooooluuunnnteeeerrriiiinnnnng&quot;&lt;/em&gt;, and you're basically up that creek with all the mud and dirt in it.&lt;br /&gt;&lt;br /&gt;After handing over an SSH public key and getting sudo access (yeah, yeah, &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://jani.at.ifi.uio.no/pics/headbash.gif&quot;&gt;I know&lt;/a&gt;), I had a look anyway.&lt;br /&gt;&lt;br /&gt;First, I went on a brief but wild goose chase, finding some error messages regarding ConsoleKit which appeared to be more frequent just before the server went out of memory, checked the Debian version (an unholy mix of Debian unstable and Debian experimental with lots of package updates pending someone's attention), and generally tried to get a feel of how the system was configured.&lt;br /&gt;&lt;br /&gt;We already knew that Apache somehow might be responsible for gobbling up available memory, so my first action was to have a look at the last 100,000 lines of the Apache access log, using a simplistic log analysis script.&lt;br /&gt;&lt;br /&gt;But which log?  There were three Apache log directories to choose from.  I (correctly) guessed that the one called simply &lt;code&gt;/var/log/apache2&lt;/code&gt; might be the interesting one, the others seemed to be legacy directories which should have been removed ages ago.&lt;br /&gt;&lt;br /&gt;According to the script, there were 0 accesses in the last 100,000 lines.&lt;br /&gt;&lt;br /&gt;Knowing the script, that was not so strange, because it makes a few assumptions regarding the log format, using a regexp belonging to the days before named captures and whatnot:&lt;small&gt;&lt;pre&gt;while (&amp;lt;&amp;gt;) {&lt;br /&gt;  if (/^(&amp;#92;S+) (&amp;#92;S+) - - &amp;#92;[[^&amp;#92;]]*&amp;#92;] &amp;#92;&quot;(GET|POST) &amp;#92;S*&lt;br /&gt;       HTTP(|&amp;#92;/1&amp;#92;.[01])&amp;#92;&quot; &amp;#92;d{3} (&amp;#92;d+) &amp;#92;&quot;/) {&lt;/pre&gt;&lt;/small&gt;The regexp line has been split for the sake of the line width of this blog.  There's nothing to be proud of here.&lt;br /&gt;&lt;br /&gt;Anyway, I first had to remove the first capture; feather's logs weren't showing the virtualhost as the first column, and access types were most certainly not limited to only GET and POST:&lt;small&gt;&lt;pre&gt;frettled@feather:~$ sudo awk '{print $6}' /var/log/apache2/access.log|&lt;br /&gt;sort -u&lt;br /&gt;&quot;CHECKOUT&lt;br /&gt;&quot;CONNECT&lt;br /&gt;&quot;DELETE&lt;br /&gt;&quot;GET&lt;br /&gt;&quot;HEAD&lt;br /&gt;&quot;MERGE&lt;br /&gt;&quot;MKACTIVITY&lt;br /&gt;&quot;OPTIONS&lt;br /&gt;&quot;POST&lt;br /&gt;&quot;PROPFIND&lt;br /&gt;&quot;PROPPATCH&lt;br /&gt;&quot;PUT&lt;br /&gt;&quot;REPORT&lt;/pre&gt;&lt;/small&gt;Right.&lt;br /&gt;&lt;br /&gt;After straightening that up (and adding &lt;code&gt;%v&lt;/code&gt; to the &lt;code&gt;LogFormat&lt;/code&gt; specifications in the Apache config for future use), I got the following result:&lt;small&gt;&lt;pre&gt;Use of uninitialized value $size in addition (+)&lt;br /&gt;at /usr/local/sbin/bandwidthips line 39, &amp;lt;&amp;gt; line 1002.&lt;br /&gt;Use of uninitialized value $size in addition (+)&lt;br /&gt;at /usr/local/sbin/bandwidthips line 40, &amp;lt;&amp;gt; line 1002.&lt;br /&gt;Use of uninitialized value $size in addition (+)&lt;br /&gt;at /usr/local/sbin/bandwidthips line 44, &amp;lt;&amp;gt; line 1002.&lt;/pre&gt;&lt;/small&gt;AAAARRGH! Idiot! Imbecile! Inept half-wit! Yep, I'd forgotten to renumber my captures. See, this is why Perl should be in version &lt;strong&gt;5.10.1&lt;/strong&gt; or &lt;strong&gt;6&lt;/strong&gt; when fiddling with those bloody annoying regexps.&lt;small&gt;&lt;pre&gt;frettled@feather:~$ sudo tail -100000 /var/log/apache2/access.log|&lt;br /&gt;/usr/local/sbin/hitips|head&lt;br /&gt;193.200.132.146: Bytes = 14329487 (3.44%), Hits = 51503 (51.82%)&lt;br /&gt;66.249.71.2: Bytes = 132116084 (31.73%), Hits = 18111 (18.22%)&lt;br /&gt;66.249.71.37: Bytes = 50846948 (12.21%), Hits = 6236 (6.27%)&lt;br /&gt;93.158.149.31: Bytes = 54880221 (13.18%), Hits = 1894 (1.9%)&lt;br /&gt;71.194.15.106: Bytes = 460200 (0.11%), Hits = 1894 (1.9%)&lt;br /&gt;209.9.237.232: Bytes = 433388 (0.1%), Hits = 1686 (1.69%)&lt;br /&gt;193.200.132.135: Bytes = 1726871 (0.41%), Hits = 1635 (1.64%)&lt;br /&gt;193.200.132.142: Bytes = 429358 (0.1%), Hits = 1609 (1.61%)&lt;br /&gt;208.115.111.246: Bytes = 8461415 (2.03%), Hits = 1238 (1.24%)&lt;br /&gt;67.218.116.133: Bytes = 18945415 (4.55%), Hits = 1126 (1.13%)&lt;/pre&gt;&lt;/small&gt;So, uhm, around 52% of the hits come from feather3.perl6.nl, and nearly 25% from Google's indexer. Lovely.&lt;br /&gt;&lt;br /&gt;Looking at the accesses from feather3, I quickly saw that they mostly had to do with svnweb.&lt;br /&gt;&lt;br /&gt;Juerd had already stopped Apache, but someone -- I don't know who -- started it again at 12:00, probably anxious that SVN and such didn't work.&lt;br /&gt;&lt;br /&gt;I then followed the running processes using the &lt;code&gt;top&lt;/code&gt; command, updating each second (&lt;code&gt;top d1&lt;/code&gt;), sorting by memory usage (typing &lt;code&gt;M&lt;/code&gt; while top was running), hoping to catch some quickly growing processes.&lt;br /&gt;&lt;br /&gt;Nopes.  None, zilch, nada.  Nothing that appeared horribly wrong.  Sure, the &lt;code&gt;apache2&lt;/code&gt; processes used some memory (30-60 MB resident set, 50-100 virtual), but nothing appeared to be out of the ordinary.  I changed the update frequency to each third second -- &lt;code&gt;top&lt;/code&gt; sometimes uses an inordinate amount of CPU, depending on magic -- and waited.  After a while, a couple of &lt;code&gt;apache2&lt;/code&gt; processes were using more CPU and memory than the others, around 60-90 MB resident.  And they were growing.  And according to &lt;code&gt;lsof&lt;/code&gt;, they were active in the svnweb directory (and used a metric shitload of libraries).  And after growing, they didn't release memory, they just kept on using it.  But it wasn't enough to use up memory, there was still a bunch of free RAM.&lt;br /&gt;&lt;br /&gt;So that was perhaps svnweb's fault, then?&lt;br /&gt;&lt;br /&gt;Maybe.&lt;br /&gt;&lt;br /&gt;But then my time ran out, and I had to drop the ball, leaving the &lt;code&gt;top&lt;/code&gt; process running.&lt;br /&gt;&lt;br /&gt;Five minutes later, the memory ran out again.  It's just as if someone was waiting for me to go idle in order to produce the problem that I was looking for.&lt;br /&gt;&lt;br /&gt;Sigh.&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://jani.at.ifi.uio.no/blogpics/0c3af3a9a3ba054047f6fdeed41ef4ed.png&quot;&gt;&lt;img src=&quot;http://jani.at.ifi.uio.no/blogpics/0c3af3a9a3ba054047f6fdeed41ef4ed.png&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;svnweb kindof remained the main suspect, until Juerd caught whatever was happening at the right time.&lt;br /&gt;&lt;br /&gt;And catching what happens at the right time is bloody important.&lt;br /&gt;&lt;br /&gt;Here's what he found, using Apache's server status:&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://jani.at.ifi.uio.no/blogpics/5e6f1b41fb0beb7f878d01fe3b069776.png&quot;&gt;&lt;img src=&quot;http://jani.at.ifi.uio.no/blogpics/5e6f1b41fb0beb7f878d01fe3b069776.png&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Well, that's not svnweb.  That's Trac.  And the IP addresses belong to Google.&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://jani.at.ifi.uio.no/blogpics/837c8ca338c036903129875e8147f0c0.png&quot;&gt;&lt;img src=&quot;http://jani.at.ifi.uio.no/blogpics/837c8ca338c036903129875e8147f0c0.png&quot; width=&quot;400&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;And that's spam, effectively creating a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/DoS&quot;&gt;DoS&lt;/a&gt; or &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/DDoS#Distributed_attack&quot;&gt;DDoS&lt;/a&gt; attack on our services as a side effect when search engines try to index the Trac webpages.  It probably isn't intentional, but &lt;strong&gt;spammers just don't care&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;So, what can we do to protect feather from suffering from such attacks in the future?&lt;br /&gt;&lt;br /&gt;There's a lot that can be done.  It takes effort.  It takes time.  It takes someone.&lt;br /&gt;&lt;br /&gt;Here are a few suggestions on how to improve the robustness of the kind of services feather provides:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Add a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Captcha&quot;&gt;captcha&lt;/a&gt; to the web form. The disadvantage is that this does not really save processing resources, but it probably should be done anyway.&lt;/li&gt;&lt;li&gt;Add an unnecessary and bogus input field to the web form, e.g. &quot;Phone number&quot;. This input field should be hidden with CSS so that web browsers don't display it, and if someone submits anything with data with that field's name, then you can be nearly 100% certain it's spam from someone who's used a web scraper before automatically filling the form. Filter it out.&lt;/li&gt;&lt;li&gt;Change the webserver delegation architecture, so that each Apache process isn't loading tens of megabytes of libraries and keeping them in memory. Off-loading to shorter-living FastCGI daemons or similar solutions, or even sacrificing program startup speed by using CGI+suexec, etc., may be decent starting points.&lt;/li&gt;&lt;li&gt;Consider using a front-end proxy like &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://varnish.projects.linpro.no/&quot;&gt;Varnish&lt;/a&gt; to gloss over underlying nastiness.&lt;/li&gt;&lt;li&gt;Start with a new VM and migrate services to that one, gradually.&lt;/li&gt;&lt;li&gt;Document configuration choices and what each web service does/is there for, so that the next sysadmin coming along can make educated guesses quicker. :)&lt;/li&gt;&lt;/ul&gt;These tasks can rather easily be split into manageable one-person projects.&lt;br /&gt;&lt;br /&gt;Does this sound interesting to you, or did I lose you at the third line of this blog entry?&lt;br /&gt;&lt;br /&gt;Pop in on &lt;code&gt;#perl6&lt;/code&gt; on the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://freenode.net/irc_servers.shtml&quot;&gt;freenode IRC network&lt;/a&gt; and say so.</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-6433229299481615531</guid>
         <pubDate>Thu, 14 Jan 2010 16:45:00 +0000</pubDate>
      </item>
      <item>
         <title>Typing More Or Less</title>
         <link>http://howcaniexplainthis.blogspot.com/2010/01/typing-more-or-less.html</link>
         <description>Not too long ago, there was a bit of minor cleanup in the Perl 6 specification regarding the use of whatever (*); there were some inconsistencies in how it behaved, depending on context.&lt;br /&gt;&lt;br /&gt;The net result is that you now must use &lt;code&gt;@arr[*-1]&lt;/code&gt; to get the last element, you cannot get away with simply using &lt;code&gt;@arr[*]&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;Some may feel that this extra typing is bothersome, especially if you have a Unicode-friendly keyboard setup.&lt;br /&gt;&lt;br /&gt;However, we can sneak our way past this problem by using a &lt;code&gt;constant&lt;/code&gt;.&lt;br /&gt;&lt;br /&gt;This also works with the current release of Rakudo, so it's not quite science fiction:&lt;pre&gt;constant &amp;Omega; = *-1;&lt;/pre&gt;Or, if you're feeling Cyrillic rather than Greek:&lt;pre&gt;constant &amp;#1120; = *-1;&lt;/pre&gt;Now we can substitute our nice constant for &lt;code&gt;*-1&lt;/code&gt; anywhere in the following code:&lt;pre&gt;my @letters = 'a'..'z';&lt;br /&gt;say '&amp;rarr;'~@letters[*-1];&lt;br /&gt;&amp;rarr;z&lt;/pre&gt;Like so:&lt;pre&gt;constant &amp;Omega; = *-1;&lt;br /&gt;my @letters = 'a'..'z';&lt;br /&gt;say '&amp;rarr;'~@letters[&amp;Omega;];&lt;br /&gt;&amp;rarr;z&lt;/pre&gt;And, of course, you can do this with other things that are so tedious to type when you're dealing with maths:&lt;pre&gt;constant &amp;pi; = pi;&lt;br /&gt;say '&amp;rarr;'~&amp;pi;&lt;br /&gt;&amp;rarr;3.14159265358979&lt;/pre&gt;</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-8004013513556964090</guid>
         <pubDate>Tue, 05 Jan 2010 22:10:00 +0000</pubDate>
      </item>
      <item>
         <title>2009 In Perl</title>
         <link>http://howcaniexplainthis.blogspot.com/2009/12/2009-in-perl.html</link>
         <description>Repeat after me: I will not pretend to be an analyst or doomsayer, even though the end (of 2009) is nigh.&lt;br /&gt;&lt;br /&gt;In 2009, Perl grew up a bit more, both as a language and as a community.&lt;br /&gt;&lt;h2&gt;Language Development&lt;/h2&gt;Perl 5.10.1 came with a pony to those of us who fear the .0 releases.&lt;br /&gt;&lt;br /&gt;The Perl 5.11 development tree got started, and it looks like it is rolling on rails. At this rate, we will see 5.12.0 quicker than you can say antidisestablishmentarianism.&lt;br /&gt;&lt;br /&gt;... Perl 6 has made progress both on the specification side and in implementations -- yep, that is plural.  It is sometimes confusing when naming changes under your feet, but it is acceptable while the spec is still settling.&lt;br /&gt;&lt;h2&gt;Community&lt;/h2&gt;In 2009, I think I saw more openness regarding the internal conflicts in the Perl community as a whole; there were abundant admissions that we were not communicating nearly as well as we should, that there was at least a small amount of internal bickering over the present and future state of the onion -- onions, I must inject, tend to come in many shapes and flavours, and are not always the same inside -- really, which way we are going, are we having a conflict or not (yes we are -- no we are not -- huh, are we talking? -- pass the chips), and get off my lawn before I shoot or hug you.&lt;br /&gt;&lt;br /&gt;In brief, it looks to me like 2009 was the year when the community showed renews signs of self-awareness.&lt;br /&gt;&lt;br /&gt;But much more happened.  We got a closer focus on Perl visibility, from my POV mainly owing to Matt S. Trout's lightning talk challenge from NPW 2009, plus a whole range of people working on other PR aspects for ourselves.  And mst still keeps his hair colour.  Wow.&lt;br /&gt;&lt;h2&gt;Other Stuff&lt;/h2&gt;I made new friends, I learned a lot, I even got to help out a bit, and I hope that this will continue in 2010.&lt;br /&gt;&lt;br /&gt;I hope you will too.&lt;br /&gt;&lt;br /&gt;Happy new year!</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-8641755256383205181</guid>
         <pubDate>Thu, 31 Dec 2009 00:31:00 +0000</pubDate>
      </item>
      <item>
         <title>Dice Roller Deconstructed</title>
         <link>http://howcaniexplainthis.blogspot.com/2009/12/dice-roller-deconstructed.html</link>
         <description>As promised, here are the elements of last week's dice rolling code:&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;use v6;&lt;/pre&gt;&lt;/small&gt;This is a nice way to say that we are in Perl 6 land.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;subset D10 of Int where 1..10;&lt;/pre&gt;&lt;/small&gt;A &quot;D10&quot; is a 10-sided die, and it can only have integer values in the range 1..10. Subtyping Int is an acceptable way of taking care of that.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;sub is_success (D10 $roll, D10 $target) {&lt;/pre&gt;&lt;/small&gt;Here, I am already using the subtype D10 of Int. This subroutine compares the rolled die $roll with the target number $target, and is called from the subroutine &lt;code&gt;roll()&lt;/code&gt; for each die in the dice pool. I chose to create an explicit subroutine because it seems a bit clearer what happens in the special case of a rolled 10, which means that you get to re-roll that die for a potential new success.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    my $n = 0;&lt;br /&gt;    if ($roll == 10) {&lt;br /&gt;        say &quot;10 again&quot;;&lt;br /&gt;        $n += roll 1,$target;&lt;br /&gt;    }&lt;/pre&gt;&lt;/small&gt;If we roll a 10, then the &lt;code&gt;roll()&lt;/code&gt; subroutine is called with a dice pool of 1 and the same target number as we got originally for determining success.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    $roll &amp;gt;= $target ?? $n + 1 !! $n;&lt;br /&gt;}&lt;/pre&gt;&lt;/small&gt;We always return the number of successes from the roll for the &quot;10 again&quot; rule (if it happened), and in case this roll was a success, we return an additional success.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;sub roll (Int $poolsize where { $_ &amp;gt; 0 }, D10 $target? = 8) {&lt;/pre&gt;&lt;/small&gt;The dice pool size can of course not be negative, but it also cannot be zero; you always get to roll a die, so I have added a type constraint for that. The target number is optional, defaults to 8, and has to be possible with a D10.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    my D10 @rolls = (1..10).pick($poolsize, :replace);&lt;/pre&gt;&lt;/small&gt;From left to right:&lt;ul&gt;&lt;li&gt;&lt;code&gt;@rolls&lt;/code&gt; is an array that will contain the results of the normal die rolls&lt;/li&gt;&lt;li&gt;&lt;code&gt;(1..10).pick($poolsize&lt;/code&gt; is a way of picking &lt;code&gt;$poolsize&lt;/code&gt; dice having possible values in the range 1..10 and &quot;rolling&quot; (randomizing) each of them.&lt;/li&gt;&lt;li&gt;&lt;code&gt;pick($poolsize, :replace)&lt;/code&gt; means that we not only pick a result, but we also make it possible to achieve the same result again. Specifically, it is important for us that each die can have ANY value, not just values that have not been picked before. &lt;small&gt;The semantics of &lt;code&gt;pick()&lt;/code&gt; are explained in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://perl6advent.wordpress.com/2009/12/15/day-15-pick-your-game/&quot;&gt;.pick your game&lt;/a&gt; (the 15th gift in the Perl 6 Advent Calendar).&lt;/small&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    say &quot;Roll: &quot; ~ @rolls.sort.join(&quot;,&quot;);&lt;/pre&gt;&lt;/small&gt;&lt;code&gt;@rolls.sort.join(&quot;,&quot;)&lt;/code&gt; sorts the elements of the &lt;code&gt;@rolls&lt;/code&gt; array and stringifies them joined with a comma, e.g. &quot;1,2,3,3,4&quot; for &lt;code&gt;@rolls = 4,1,3,2,3&lt;/code&gt;&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    [+] @rolls.map: { is_success $_,$target };&lt;br /&gt;}&lt;/pre&gt;&lt;/small&gt;This piece of code maps &lt;code&gt;is_success $_,$target&lt;/code&gt; on every value in the &lt;code&gt;@rolls&lt;/code&gt; array and creates a sum of those results. In other words, it sums up the number of successfull die rolls.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;&lt;pre&gt;given @*ARGS.elems {&lt;/pre&gt;&lt;/small&gt;The &lt;code&gt;@*ARGS&lt;/code&gt; array contains the command line arguments to the program, and &lt;code&gt;.elems&lt;/code&gt; therefore is the number of arguments used.&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    when 2   {&lt;br /&gt;               say &quot;Target number: &quot; ~ @*ARGS[1];&lt;br /&gt;               continue;&lt;br /&gt;             }&lt;/pre&gt;&lt;/small&gt;This block only runs in case we have two arguments, but it explicitly says that we may not be done yet: the &lt;code&gt;continue&lt;/code&gt; statement counters the default implisit &lt;code&gt;break&lt;/code&gt; to ensure that we can match the input value against other tests.&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    when 1|2 {&lt;br /&gt;               my $n = roll |@*ARGS&amp;gt;&amp;gt;.Int;&lt;br /&gt;               say &quot;Successes rolled: &quot; ~ $n;&lt;br /&gt;               $n &amp;gt;= 5 and say &quot;Exceptional success!&quot;;&lt;br /&gt;             }&lt;/pre&gt;&lt;/small&gt;We start off with a &lt;em&gt;junction&lt;/em&gt; to say that either 1 or 2 is fine by us, we want both to match. Then we call &lt;code&gt;roll()&lt;/code&gt; with the same arguments we got in, but each converted to Int. &lt;em&gt;White magic.&lt;/em&gt; We store the value, and exclaim that the result is an exceptional success if it is.&lt;br /&gt;&lt;small&gt;&lt;pre&gt;    when *   {&lt;br /&gt;               $*ERR.say(&quot;roll.p6 poolsize [target]&quot;);&lt;br /&gt;               exit(64);&lt;br /&gt;             }&lt;br /&gt;}&lt;/pre&gt;&lt;/small&gt;This is the equivalent of C's &lt;code&gt;default&lt;/code&gt;, the catch-all that handles remaining uncaught cases. We print a helpful usage string to STDERR (&lt;code&gt;$*ERR&lt;/code&gt; in Perl 6) and exit with the correct Unix exit code, praying that nobody uses a different kind of system.</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-8740606379457704622</guid>
         <pubDate>Mon, 21 Dec 2009 21:56:00 +0000</pubDate>
      </item>
      <item>
         <title>Dice Rolls for Role-Players</title>
         <link>http://howcaniexplainthis.blogspot.com/2009/12/dice-rolls-for-role-players.html</link>
         <description>I realize that the title of this post is a bit of an oxymoron, because a &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.seiyuu.com/okamoto/gaming/realmen.htm&quot;&gt;Real Role-Player&lt;/a&gt; of course doesn't roll dice often. ;)&lt;br /&gt;&lt;br /&gt;But in the cases where the Real Role-Player &lt;em&gt;does&lt;/em&gt; roll dice, wouldn't it be nice to have a computer program to forget at home rather than some even more easily mislaid dice?&lt;br /&gt;&lt;br /&gt;The &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://perl6advent.wordpress.com/&quot;&gt;Perl 6 Advent Calendar&lt;/a&gt; provided some inspiration for this post.&lt;br /&gt;&lt;br /&gt;A problem with many minor programming examples you see on the net, is that they do not take into account the needs of a role-player.  Role-players play many different systems, with different criteria for &lt;em&gt;success&lt;/em&gt; in dice rolls.  D6 (the regular six-sided cubic dice used for playing Monopoly, Yahtzee, etc.) are not used much in the majority of systems.&lt;br /&gt;&lt;br /&gt;Therefore, I'll look at the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Storyteller_System&quot;&gt;Storyteller System&lt;/a&gt;, which is used in the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/World_of_Darkness&quot;&gt;World of Darkness&lt;/a&gt; series of games.&lt;br /&gt;&lt;br /&gt;The general principle is that you have a &lt;em&gt;pool&lt;/em&gt; of dice to roll, and you count your &lt;em&gt;successes&lt;/em&gt;, which in this system is the number of dice that have a value greater than or equal to a given &lt;em&gt;target number&lt;/em&gt; for the roll.  The standard target number is 8 in most implementations.  Five successes in the same roll is an &lt;em&gt;exceptional success&lt;/em&gt;.  Obviously, it's nice to have many dice to roll!&lt;br /&gt;&lt;br /&gt;Here's a real Perl 6 program &lt;em&gt;that works with Rakudo today&lt;/em&gt;: it accepts two command line parameters, the first being the size of the dice pool, the optional second parameter defines the target number for success:&lt;hr/&gt;&lt;small&gt;&lt;pre&gt;use v6;&lt;br /&gt;&lt;br /&gt;subset D10 of Int where 1..10;&lt;br /&gt;&lt;br /&gt;sub is_success (D10 $roll, D10 $target) {&lt;br /&gt;    my $n = 0;&lt;br /&gt;    if ($roll == 10) {&lt;br /&gt;        say &quot;10 again&quot;;&lt;br /&gt;        $n += roll 1,$target;&lt;br /&gt;    }&lt;br /&gt;    $roll &amp;gt;= $target ?? $n + 1 !! $n;&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;sub roll (Int $poolsize where { $_ &amp;gt; 0 }, D10 $target? = 8) {&lt;br /&gt;    my D10 @rolls = (1..10).pick($poolsize, :replace);&lt;br /&gt;    say &quot;Roll: &quot; ~ @rolls.sort.join(&quot;,&quot;);&lt;br /&gt;    [+] @rolls.map: { is_success $_,$target };&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;given @*ARGS.elems {&lt;br /&gt;    when 2   {&lt;br /&gt;               say &quot;Target number: &quot; ~ @*ARGS[1];&lt;br /&gt;               continue;&lt;br /&gt;             }&lt;br /&gt;    when 1|2 {&lt;br /&gt;               my $n = roll |@*ARGS&amp;gt;&amp;gt;.Int;&lt;br /&gt;               say &quot;Successes rolled: &quot; ~ $n;&lt;br /&gt;               $n &amp;gt;= 5 and say &quot;Exceptional success!&quot;;&lt;br /&gt;             }&lt;br /&gt;    when *   {&lt;br /&gt;               $*ERR.say(&quot;roll.p6 poolsize [target]&quot;);&lt;br /&gt;               exit(64);&lt;br /&gt;             }&lt;br /&gt;}&lt;/pre&gt;&lt;/small&gt;&lt;hr/&gt;Thanks to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://perlgeek.de/blog-en/&quot;&gt;moritz&lt;/a&gt;++ for ironing out two annoying mistakes!&lt;br /&gt;&lt;br /&gt;Here are a few usage examples:&lt;hr/&gt;&lt;pre&gt;&lt;b&gt;$ perl6 roll.p6&lt;/b&gt;&lt;br /&gt;roll.pl poolsize [target]&lt;br /&gt;&lt;br /&gt;&lt;b&gt;$ perl6 roll.p6 5&lt;/b&gt;&lt;br /&gt;Roll: 1,2,7,8,9&lt;br /&gt;Successes rolled: 2&lt;br /&gt;&lt;br /&gt;&lt;b&gt;$ perl6 roll.p6 5 2&lt;/b&gt;&lt;br /&gt;Target number: 2&lt;br /&gt;Roll: 1,2,2,4,9&lt;br /&gt;Successes rolled: 4&lt;br /&gt;&lt;br /&gt;&lt;b&gt;$ perl6 roll.p6 5 4&lt;/b&gt;&lt;br /&gt;Target number: 4&lt;br /&gt;Roll: 6,8,9,10,10&lt;br /&gt;10 again&lt;br /&gt;Roll: 8&lt;br /&gt;10 again&lt;br /&gt;Roll: 2&lt;br /&gt;Successes rolled: 6 - Exceptional success!&lt;/pre&gt;&lt;hr/&gt;There are no comments in this piece of code, I want people to try to understand it as-is, based on the &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://perl6advent.wordpress.com/&quot;&gt;Perl 6 Advent Calendar&lt;/a&gt;. If you have any questions, comments, corrections, etc., don't hesitate, just write!&lt;br /&gt;&lt;br /&gt;In my next blog entry, I'll pick the program apart and comment on what I've done and why, and who knows, maybe someone has come up with an elegant solution to the same problem.</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-7861456376297704474</guid>
         <pubDate>Wed, 16 Dec 2009 15:50:00 +0000</pubDate>
      </item>
      <item>
         <title>GCD - A Small Language Enthuser</title>
         <link>http://howcaniexplainthis.blogspot.com/2009/12/gcd-small-language-enthuser.html</link>
         <description>&lt;pre&gt;fun gcd (x:int,y:int) : int =&lt;br /&gt;    case x of 0 =&amp;gt; y&lt;br /&gt;  | _ =&amp;gt if x &amp;lt; 0 then gcd(y,0-x) else&lt;br /&gt;         if y &amp;lt; 0 then gcd(0-y,x) else&lt;br /&gt;         if y &amp;gt x then gcd(y-x,x) else gcd(x-y,y);&lt;/pre&gt;&lt;blockquote&gt;&lt;strong&gt;&lt;em&gt;&quot;But that's not Perl!&quot;&lt;/em&gt;&lt;/strong&gt;&lt;/blockquote&gt;Yeah, yeah, I hear you.&lt;br /&gt;&lt;br /&gt;I'll rectify that minor detail in a bit.&lt;br /&gt;&lt;br /&gt;But first, an anecdote.&lt;br /&gt;&lt;br /&gt;Back in the late &lt;span title=&quot;tee-hee&quot;&gt;nineteennineties&lt;/span&gt;, I was studying computer science, and one of the classes was about program specification and verification.&lt;br /&gt;&lt;br /&gt;Several of the students already had a background with several programming languages, some were &lt;em&gt;functional&lt;/em&gt;, some were &lt;em&gt;imperative&lt;/em&gt;, and other languages were a bit confused about what they really were.&lt;br /&gt;&lt;br /&gt;When studying program specification and verification, you either become rather obsessed with program correctness -- and hopefully elegance -- or you fail  spectactularly.&lt;br /&gt;&lt;br /&gt;There are several ways to muster enthusiasm when dealing with such studies; they can be rather, ehrm, theoretical.&lt;br /&gt;&lt;br /&gt;I therefore flitted about, flirting with various programming languages, comparing them with the eagerness that young idealists do.&lt;br /&gt;&lt;br /&gt;For some reason, I found Euclid's &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://en.wikipedia.org/wiki/Euclidean_algorithm&quot; title=&quot;Greatest Common Divisor&quot;&gt;GCD algorithm&lt;/a&gt; to be particularly fascinating, for reasons unknown to men to this day.&lt;br /&gt;&lt;br /&gt;The Perl version I saw was rather awful, and &lt;em&gt;technically incorrect&lt;/em&gt;:&lt;pre&gt;sub gcd {&lt;br /&gt;    if (!$_[0]) {&lt;br /&gt;        return $_[1];&lt;br /&gt;    }&lt;br /&gt;    if ($_[1] &amp;gt; $_[0]) {&lt;br /&gt;        return gcd ($_[1]-$_[0],$_[0]);&lt;br /&gt;    }&lt;br /&gt;    return gcd ($_[0]-$_[1],$_[1]);&lt;br /&gt;}&lt;/pre&gt;Yikes. I mean, eep. And Perl &lt;em&gt;does&lt;/em&gt; have a modulo operator.&lt;pre&gt;sub gcd {&lt;br /&gt;    my ($x, $y) = @_;&lt;br /&gt;    $y ? gcd ($y, $x % $y) : abs $x;&lt;br /&gt;}&lt;/pre&gt;I won't claim that the above code is the epitome of elegance, but it solves the problem in a general and easily read way &lt;small&gt;(I admit a prejudice against $_[N])&lt;/small&gt;, while retaining correctness.&lt;br /&gt;&lt;br /&gt;&lt;small&gt;This is, BTW, one place where some golfers miss the boat; the GCD cannot be a negative integer. That's why the ML code at the top is so verbose.&lt;/small&gt;&lt;br /&gt;&lt;br /&gt;Small challenges like these kept me going, and it can be an inspiring way to learn details in a new language. So, what would it look like in Perl 6?&lt;pre&gt;sub gcd (Int $x, Int $y) {&lt;br /&gt;    $y ?? gcd($y, $x % $y) !! $x.abs;&lt;br /&gt;}&lt;/pre&gt;What's your favourite algorithm for playtesting languages?</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-607178019070602280</guid>
         <pubDate>Wed, 09 Dec 2009 18:43:00 +0000</pubDate>
      </item>
      <item>
         <title>What stops me from using Perl 6, today?</title>
         <link>http://howcaniexplainthis.blogspot.com/2009/11/what-stops-me-from-using-perl-6-today.html</link>
         <description>Since I got hooked on the Perl community, and got a taste of Perl 6, I've been wondering about:&lt;ol&gt;&lt;li&gt;what, exactly, is it that I could use Perl 6 for, right now?&lt;/li&gt;&lt;li&gt;why am I not actively using Perl 6 now?&lt;/li&gt;&lt;/ol&gt;&lt;br /&gt;Those are easy questions, but answering is hard, so this may be a long post.&lt;br /&gt;&lt;br /&gt;Sure, the points listed below are not exactly Perl 6 specific; I could probably have picked some other programming language, but I somehow feel more comfortable in the way that Perl 6 &lt;em&gt;still is Perl&lt;/em&gt;.&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;What I could use Perl 6 for right now&lt;/h2&gt;&lt;br /&gt;I think it's fair to say that using Perl 6 today mostly means using Rakudo, and that I wouldn't use it in what we popularly call a &quot;production setting&quot;. But many of us programmers, sysadmins, geeks and nerds have perfectly suitable &lt;em&gt;hobby&lt;/em&gt; projects, where we won't have clients wringing our necks if there is three minutes of downtime in a month, or if we don't deliver the Speedy Gonzalez of services; we have projects that are neither computing performance constrained or stability constrained.&lt;br /&gt;&lt;br /&gt;So that's where I could have started using Perl 6 half a year ago, and of course still can.&lt;br /&gt;&lt;br /&gt;I know I can use Perl 6 for e.g. a fairly complex web site using Web.pm and Squerl for a SQLite backend. It will probably work just fine, for a lot of projects.&lt;br /&gt;&lt;br /&gt;I know I can use it for lots of one-liner scripts.&lt;br /&gt;&lt;br /&gt;I know that in some regards, Perl 6 will outperform classic Perl 5 in terms of &lt;em&gt;programmer time&lt;/em&gt; spent. An example is the &lt;code&gt;given-when&lt;/code&gt; control structure, which (to me) is semantically superior to &lt;code&gt;if-elsif-elsif-elsif&lt;/code&gt;. Programmer time is important to me, I hate coding too much for menial tasks. And I'm sorry to say that Perl 5.10 doesn't &lt;em&gt;do it yet for me&lt;/em&gt;, as I cannot rely on its presence, even for hobby projects.&lt;br /&gt;&lt;br /&gt;And I know I can use Perl 6 to refresh some of the knowledge about programming language specifics (terminology, technique, methodology, etc.) that I've allowed to rust since I left university in 2001.&lt;br /&gt;&lt;br /&gt;&lt;h3&gt;Concrete projects, in no particular order&lt;/h3&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;web page for registration of pool billiards tournament results; it's not performance critical, and the users could check and verify the dataset themselves after input&lt;/li&gt;&lt;br /&gt;&lt;li&gt;conversion of historical results data in CSV format to a database; one-time job, needs manual verification no matter what programming language I use to do it&lt;/li&gt;&lt;br /&gt;&lt;li&gt;contributing to the Temporal.pm specification and implementation in Perl 6&lt;/li&gt;&lt;br /&gt;&lt;li&gt;personal web gallery generation; I positively loathe most of the online galleries, because they sooner rather than later are discovered to have HUGE, GAPING security vulnerabilities&lt;/li&gt;&lt;br /&gt;&lt;li&gt;blogging tool; I'm not very comfortable with blog software running on servers, either, and whatever blogging I do, it's not actual &lt;em&gt;work&lt;/em&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;&lt;br /&gt;That's quite a lot, isn't it? It ought to have been enough to get me going in a jiffy!&lt;br /&gt;&lt;br /&gt;&lt;h2&gt;Why I'm not actively using Perl 6 now&lt;/h2&gt;&lt;br /&gt;This may be a surprise to some: it's not because of a lack of matureness in the tools, a lack of confidence in the language or tools, stability issues, etc. As I tangentially mentioned above, I believe there is no technical hindrance for me to start coding on a hobby project.&lt;br /&gt;&lt;br /&gt;I have plenty of hobby projects to choose from.  They are also quite manageable in terms of eventual lines of code.&lt;br /&gt;&lt;br /&gt;However, there is something holding me back, and that's a certain degree of perfectionism mixed with procrastination fever.&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.shadowcat.co.uk/blog/matt-s-trout/&quot; title=&quot;Matt S. Trout&quot;&gt;mst&lt;/a&gt; mentioned during the NPW hackathon this spring that perfectionism was a barrier against getting started.  If you're too obsessed with getting things right at first, at wanting to avoid failure, procrastinating is too easy.  Getting slightly intoxicated &lt;small&gt;(yup, drinking alcohol, which of course is only a recourse for adults)&lt;/small&gt; is a way of reducing your own perfection anxiety. This is almost exactly what Randall Munroe's xkcd calls the &lt;em&gt;Ballmer Peak&lt;/em&gt;:&lt;br /&gt;&lt;br /&gt;&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://xkcd.com/323/&quot;&gt;&lt;img src=&quot;http://imgs.xkcd.com/comics/ballmer_peak.png&quot; title=&quot;Ballmer Peak&quot; height=&quot;296&quot; width=&quot;326&quot;/&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;But I don't sleep too well after drinking alcohol, and I also tend to do hobby projects in my &quot;running breaks&quot; during work hours, in which case alcohol intake may be a &lt;strong&gt;very bad idea&lt;/strong&gt;.&lt;br /&gt;&lt;br /&gt;In addition, my time at work is a series of interruptions, which really isn't conductive to sitting down and learning something new and complex.&lt;br /&gt;&lt;br /&gt;When I get home from work, I'm usually so fed up with computers that I don't want to have anything to do with them.&lt;br /&gt;&lt;br /&gt;So my spare time, whatever is left of it, usually isn't spent on programming.  Note that I don't even do these projects in a programming language I already know well; they are on hold regardless of that.&lt;br /&gt;&lt;br /&gt;All in all, there's nothing much wrong with Perl 6.&lt;br /&gt;&lt;br /&gt;Blaming the immaturity of Rakudo would just be a silly excuse.  There's something wrong with my capacity for finding the time to get down and dirty with it, that's what; I'm apparently not currently capable of saying honestly:&lt;br /&gt;&lt;br /&gt;&lt;blockquote&gt;&lt;em&gt;This is my Perl 6 hour.  This hour, I'm going to do Perl 6 stuff, and this time is sacred.&lt;/em&gt;&lt;/blockquote&gt;</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-2986740577170024623</guid>
         <pubDate>Sun, 15 Nov 2009 23:56:00 +0000</pubDate>
      </item>
      <item>
         <title>What the #perl6 IRC bots do</title>
         <link>http://howcaniexplainthis.blogspot.com/2009/11/what-perl6-irc-bots-do.html</link>
         <description>Do you feel like a n00b on #perl6, like I do, and wonder what the different bots do?&lt;br /&gt;&lt;br /&gt;I keep forgetting what they are, so here's a list for you and me both:&lt;br /&gt;&lt;br /&gt;&lt;dl&gt;&lt;br /&gt;&lt;dt&gt;dalek&lt;/dt&gt;&lt;dd&gt;Announces commits (mainly to rakudo, nqp-rx and the Perl 6 book)&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;hugme&lt;/dt&gt;&lt;dd&gt;Used for hugging another user without &quot;direct&quot; contact: &lt;pre&gt;hugme: hug masak&lt;/pre&gt;&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;ilbot2&lt;/dt&gt;&lt;dd&gt;Near-realtime IRC logs with automatic link generation to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://irclog.perlgeek.de&quot;&gt;irclog.perlgeek.de&lt;/a&gt;. The original ilbot sucked, according to moritz.&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;ilogger2&lt;/dt&gt;&lt;dd&gt;Another logging bot&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;lambdabot&lt;/dt&gt;&lt;dd&gt;Keeps track of karma (&quot;moritz++&quot; adds one to moritz's karma score, &quot;frettled--&quot; subtracts one from mine)&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;lisppaste3&lt;/dt&gt;&lt;dd&gt;Announces entries pasted to &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://paste.lisp.org/new/perl6&quot;&gt;http://paste.lisp.org/new/perl6&lt;/a&gt; (which is where we paste code and other stuff, so that we avoid spamming the channel too much, and also don't have to worry about creating our own temporary web pages)&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;masak&lt;/dt&gt;&lt;dd&gt;Submits rakudo bugs. &lt;small&gt;Aw, okay, then, he's not a bot, just a really nice guy!&lt;/small&gt;&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;mubot&lt;/dt&gt;&lt;dd&gt;Also tracks karma, attempting to be slightly less annoying than lambdabot. mubot is clever enough to recognize that your nick may vary slightly from time to time and channel to channel. mubot is written in Perl 6!&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;p6eval&lt;/dt&gt;&lt;dd&gt;Perl 6 code evaluation bot. We use this for live testing of code that may be of interest to others; it chats back to the channel. &lt;code&gt;perl6: my $a;&lt;/code&gt; will result in a test against several Perl 6 interpreters (elf, mildew, mildew-js, pugs, rakudo, sprixel), &lt;code&gt;nqp: say('foo')&lt;/code&gt; tests nqp-rx, &lt;code&gt;std: my $a&lt;/code&gt; will parse the expression with &lt;strong&gt;STD.pm&lt;/strong&gt;.&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;phenny&lt;/dt&gt;&lt;dd&gt;Our secretary. Sample usage: &lt;pre&gt;phenny, tell frettled I'll get back to you on that&lt;/pre&gt;phenny will then let me know when I become active on the channel again.&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;pointme&lt;/dt&gt;&lt;dd&gt;Provides links to projects tracked by &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://github.com/masak/proto&quot;&gt;proto&lt;/a&gt;. Example usage: &lt;small&gt;&lt;pre&gt;&amp;lt; carlin&amp;gt; pointme: rssbot&lt;br /&gt;&amp;lt; pointme&amp;gt; carlins's rssbot is at &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://github.com/carlins/rssbot&quot;&gt;http://github.com/carlins/rssbot&lt;/a&gt;&lt;/pre&gt;&lt;/small&gt;pointme is written in Perl 6!&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;pugs_svn&lt;/dt&gt;&lt;dd&gt;Tracks commits to the pugs repository, most of which are changes to the test suite and spec.&lt;/dd&gt;&lt;br /&gt;&lt;dt&gt;zaslon&lt;/dt&gt;&lt;dd&gt;Tracks blog posts from a certain group of bloggers. Zaslon is written in Perl 6!&lt;/dd&gt;&lt;br /&gt;&lt;/dl&gt;&lt;br /&gt;&lt;br /&gt;Thanks to carlin, Juerd, jnthn and moritz for late night clarifications!</description>
         <author>bakkushan</author>
         <guid isPermaLink="false">tag:blogger.com,1999:blog-753668960778118906.post-2021623310401190365</guid>
         <pubDate>Mon, 09 Nov 2009 00:49:00 +0000</pubDate>
      </item>
   </channel>
</rss>
<!-- fe1.yql.bf1.yahoo.com compressed/chunked Thu May 23 16:40:57 UTC 2013 -->
