<?xml version="1.0" encoding="UTF-8"?>

<rss version="2.0"
 xmlns:blogChannel="http://backend.userland.com/blogChannelModule"
 xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
 xmlns:content="http://purl.org/rss/1.0/modules/content/"
 xmlns:atom="http://www.w3.org/2005/Atom"
 xmlns:dcterms="http://purl.org/dc/terms/"
>

<channel>
<title></title>
<link>http://www.shlomifish.org/me/blogs/</link>
<description></description>

<item>
<title>New Topical Pages and Pages for Perl Uses on Perl-Begin</title>
<link>http://community.livejournal.com/shlomif_tech/46426.html</link>
<description>&#x3C;p&#x3E;
This summarises the changes to &#x3C;a href=&#x22;http://perl-begin.org/&#x22;&#x3E;the Perl
Beginners&#x27; Site&#x3C;/a&#x3E; since the last update.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
We added a &#x3C;a href=&#x22;http://perl-begin.org/uses/email/&#x22;&#x3E;a page about using Perl for E-mail
processing&#x3C;/a&#x3E;, &#x3C;a href=&#x22;http://perl-begin.org/uses/multitasking/&#x22;&#x3E;a page about Perl for
multitasking and networking&#x3C;/a&#x3E;, a some topical pages:
&#x3C;/p&#x3E;
&#x3C;ul&#x3E;
&#x3C;li&#x3E;
&#x3C;a href=&#x22;http://perl-begin.org/topics/date-and-time/&#x22;&#x3E;Date and Time&#x3C;/a&#x3E;.
&#x3C;/li&#x3E;
&#x3C;li&#x3E;
&#x3C;a href=&#x22;http://perl-begin.org/topics/references/&#x22;&#x3E;References in Perl&#x3C;/a&#x3E;.
&#x3C;/li&#x3E;
&#x3C;li&#x3E;
&#x3C;a href=&#x22;http://perl-begin.org/topics/regular-expressions/&#x22;&#x3E;Regular Expressions&#x3C;/a&#x3E;.
&#x3C;/li&#x3E;
&#x3C;li&#x3E;
&#x3C;a href=&#x22;http://perl-begin.org/topics/hashes/&#x22;&#x3E;Hashes&#x3C;/a&#x3E;.
&#x3C;/li&#x3E;
&#x3C;/ul&#x3E;
&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://perl-begin.org/IDEs-and-tools/&#x22;&#x3E;The IDEs and Tools page&#x3C;/a&#x3E; now contains
screenshots.
&#x3C;/p&#x3E;
&#x3C;p&#x3E;
Many new links have been added and many typos have been corrected. Enjoy!
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Perl-Begin continues to be the most comprehensive first-stop for Perl Beginners.
Moreover , its content is distributed under the Creative Commons Attribution
License (CC-by), and &#x3C;a href=&#x22;http://perl-begin.org/source/&#x22;&#x3E;its source 
code is available&#x3C;/a&#x3E; to facilitate contributions.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>begin</category>
<category>open</category>
<category>perl</category>
<category>perl-begin</category>
<category>source</category>
<comments>http://community.livejournal.com/shlomif_tech/46426.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/46426.html</guid>
<pubDate>Tue, 16 Mar 2010 13:38:12 GMT</pubDate>
</item>
<item>
<title>A Perl-based &#x2192;with(...) method</title>
<link>http://community.livejournal.com/shlomif_tech/46303.html</link>
<description>&#x3C;p&#x3E;
Lately, I&#x27;ve been writing some &#x3C;a href=&#x22;http://pdl.perl.org/&#x22;&#x3E;PDL (Perl Data
Language)&#x3C;/a&#x3E; code and noticed that I&#x27;ve been doing the following:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
my $temp_pdl = $pdl-&#x26;gt;&#x2026;-&#x26;gt;final_expr();
my $result_pdl = $temp_pdl-&#x26;gt;where($temp_pdl &#x26;lt; 0);
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
I&#x27;ve been thinking if I could somehow write it like that:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
my $result_pdl = $pdl-&#x26;gt;&#x2026;-&#x26;gt;final_expr()-&#x26;gt;with(sub { $_-&#x26;gt;where($_ &#x26;gt; 0)});
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
Which seems cleaner and more elegant. I went on IRC asking about it and someone
suggested 
&#x3C;tt&#x3E;rindolf: (sub { local $_ = shift; $_ * $_ * $_})-gt;( $obj-&#x26;gt;... );&#x3C;/tt&#x3E; 
(up to an episolon, but naturally this reverses the order and messes with
the flow of the code). Eventually 
&#x3C;a href=&#x22;http://www.shadowcat.co.uk/blog/matt-s-trout/&#x22;&#x3E;Matt S. 
Trout (mst)&#x3C;/a&#x3E; proposed the following solutions:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
sub UNIVERSAL::with
{
    local $_ = shift;
    my $sub = shift;
    return $sub-&#x26;gt;($_,@_);
}

my $_with = sub {
    local $_ = shift;
    my $sub = shift;
    return $sub-&#x26;gt;($_,@_);
};

&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
(I had figured something like that was possible previously, but I was beating
around the bush.)
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
The $_with approach is covered in &#x3C;a href=&#x22;http://www.shadowcat.co.uk/blog/matt-s-trout/madness-with-methods/&#x22;&#x3E;one of Matt&#x27;s blog posts titled &#x22;Madness with
Methods&#x22;&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I wondered if it will work with 
&#x3C;a href=&#x22;http://search.cpan.org/dist/autobox/&#x22;&#x3E;autobox&#x3C;/a&#x3E; and mst said that
&#x3C;q&#x3E;I don&#x27;t know and I hope not since the UNIVERSAL approach is evil.&#x3C;/q&#x3E;. But
it does, out-of-the-box:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
#!/usr/bin/perl

use strict;
use warnings;

use autobox;

sub UNIVERSAL::with
{
    local $_ = shift;
    my $sub = shift;
    return $sub-&#x26;gt;($_,@_);
}

my $_with = sub {
    local $_ = shift;
    my $sub = shift;
    return $sub-&#x26;gt;($_,@_);
};

print +(10+1)-&#x26;gt;with(sub { $_ * $_; }), &#x26;quot;\n&#x26;quot;;
print +(10+1)-&#x26;gt;$_with(sub { $_ * $_; }), &#x26;quot;\n&#x26;quot;;
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
This prints 121 twice.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I now wonder what to do with this knowledge. I have some aspirations of
releasing it to the cpan as a mini-module. Still, it&#x27;s really cool.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Finally, I should note that it seems like I&#x27;m going to lose my current
Planet Perl Iron Man karma due to inadequate blogging. Oh well.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>perl</category>
<category>fun</category>
<comments>http://community.livejournal.com/shlomif_tech/46303.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/46303.html</guid>
<pubDate>Mon, 01 Mar 2010 17:22:55 GMT</pubDate>
</item>
<item>
<title>Purim Special: The Ultimate Conspiracy Theory Behind the Story of the Scroll of Esther</title>
<link>http://shlomif.livejournal.com/62243.html</link>
<description>&#x3C;p&#x3E;
It&#x27;s &#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Purim&#x22;&#x3E;Purim&#x3C;/a&#x3E; today, and
here is my own conspiracy theory for the events detailed in 
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Book_of_Esther&#x22;&#x3E;the Scroll of Esther&#x3C;/a&#x3E;
on which the holiday is based.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
In my conspiracy theory, Mordechai was very interested in the politics of the
Persian empire, and sought ways to influence it. He got in contact with Haman,
a close childhood friend of the King, and gave him a lot of advice for
how to run the empire, which Haman delivered to the king by proxy. The king
was so impressed by Haman&#x27;s good advice that he appointed him as prime
minister (or in Hebrew &#x22;second/vice to the king.&#x22;). Mordechai also had proposed
his cousin, Hadasah (afterwards renamed Esther) as the wife of the king as a 
way to further influence the king (or it is possible that Esther delivered 
Mordechai&#x27;s advice to Haman). 
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
However, Mordechai, Esther and Haman got tired of all the proxying and so
sought a way to make Mordechai second to the king instead of Haman. So they
staged the rest of what happened. Then, after the night the king could not 
sleep and requested that the royal records be read to him and then told Haman
that Mordechai should be honoured, was indicative that he also came to 
understand what was going on and agreed to play along.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Meir Shalev in 
&#x3C;a href=&#x22;http://bookme.co.il/Books/Item_Details.aspx?Barcode=40-10976&#x22;&#x3E;&#x5EA;&#x5E0;&#x22;&#x5DA; 
&#x5E2;&#x5DB;&#x5E9;&#x5D9;&#x5D5; (= &#x22;the Bible Now&#x22; in Hebrew)&#x3C;/a&#x3E; presents Mordechai as the master mind
behind the scenes of the plot, but acknowledged that there are many remaining
co-incidences. On the other hand, I go a step further, and make Esther and
Haman his co-conspirators, and so get rid of most of the remaining
co-incidences there.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Happy Purim, though it seems like it&#x27;s a particularly rainy one this year.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>bible</category>
<category>purim</category>
<comments>http://shlomif.livejournal.com/62243.html</comments>
<guid isPermaLink="true">http://shlomif.livejournal.com/62243.html</guid>
<pubDate>Sat, 27 Feb 2010 17:12:14 GMT</pubDate>
</item>
<item>
<title>Review: Alternative (to Firefox) Linux Web Browsers</title>
<link>http://community.livejournal.com/shlomif_tech/46078.html</link>
<description>&#x3C;p&#x3E;
Since I&#x27;ve been blogging about &#x3C;a href=&#x22;http://perl-begin.org/&#x22;&#x3E;Perl&#x3C;/a&#x3E;
a lot lately (trying to maintain and advance my
&#x3C;a href=&#x22;http://ironman.enlightenedperl.org/&#x22;&#x3E;Planet Perl Iron Man&#x3C;/a&#x3E;
status), I&#x27;ve been neglecting to blog about other things. So here&#x27;s a
new entry not about Perl, not even about programming - but about web-browsers.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I&#x27;ve been using Firefox (now at version 3.6) as my primary browser on my
Mandriva Linux Cooker system for a while now, and have been mostly happy
with it. Today I wanted to edit 
&#x3C;a href=&#x22;http://en.wikibooks.org/wiki/How_to_Write_a_Program&#x22;&#x3E;this wikibook
titled &#x22;How to Write a Program&#x22;&#x3C;/a&#x3E;. It had been written awfully
(see &#x3C;a href=&#x22;http://en.wikibooks.org/wiki/Talk:How_to_Write_a_Program&#x22;&#x3E;the
discussion page&#x3C;/a&#x3E;), but I was introduced to it after it was made 
&#x3C;a href=&#x22;http://en.wikibooks.org/wiki/Optimizing_Code_for_Speed&#x22;&#x3E;a 
prerquisite of a different wikibook which I&#x27;ve written&#x3C;/a&#x3E;, and decided 
that the dependency should be kept (assuming &#x22;How to Write a Program&#x22; would be 
written better). Now, I could either throw away &#x22;How to Write a Program&#x22;
and start from scratch, or revamp it to submission. Right now, it seems like
it would be a combination of both.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
In any case, after editing it, I&#x27;ve ran into a long-term 
&#x3C;a href=&#x22;https://qa.mandriva.com/show_bug.cgi?id=57864&#x22;&#x3E;bug in Mandriva, or
in my Mandriva setup&#x3C;/a&#x3E; (which is exhibited in any Firefox that is running 
directly on it.), which I&#x27;ve finally reported there (though I believe I had
reported it in the Firefox bugzilla too) and so had been unable to use Firefox
for it.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
So I&#x27;ve been looking for an alternative browser. I ruled out 
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Konqueror&#x22;&#x3E;Konqueror&#x3C;/a&#x3E; because
KHTML has been suffering from a lot of bug report, and Konqueror is just
plain annoying. (WebKit has been forked from KHTML, and it proved to be
more popular.). I initially ruled out 
&#x3C;a href=&#x22;http://www.opera.com/&#x22;&#x3E;Opera&#x3C;/a&#x3E; because it&#x27;s not open-source. So
that left me only with WebKit-based browsers. I asked for recommendations
and people on &#x3C;a href=&#x22;irc://irc.freenode.net/#ubnutu-uk&#x22;&#x3E;#ubuntu-uk (great 
channel, BTW)&#x3C;/a&#x3E; recommended &#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Chromium_%28web_browser%29&#x22;&#x3E;Chromium&#x3C;/a&#x3E; and
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Epiphany_%28web_browser%29&#x22;&#x3E;GNOME&#x27;s
Epiphany&#x3C;/a&#x3E;, and some other more obscure browsers. I&#x27;ve decided to check them
out.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I decided to go with 
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/SRWare_Iron&#x22;&#x3E;SRWare Iron&#x3C;/a&#x3E; as
my Chromium browser. The first thing I noticed was that the Linux download
link led to a web forum post - very unprofessional. After downloading and
unpacking the archive, it refused to run -
&#x3C;tt&#x3E;/home/shlomi/apps/iron-linux/iron: error while loading shared libraries:
libbz2.so.1.0: cannot open shared object file: No such file or directory&#x3C;/tt&#x3E;.
A symbolic link to libbz2.so.1.0.0 (done by root) fixed that problem, and
then it crashed with an X error. However, it started the second time and seemed
to run fine (don&#x27;t know what the problem was). I noticed Chromium 
was indeed very fast, but then I ran into a few glitches:
&#x3C;/p&#x3E;

&#x3C;ul&#x3E;

&#x3C;li&#x3E;
No menu bar. WTF? All desktop applications, including web browsers had menu
bars for generations. And I&#x27;m used to invoke the File menu and select
&#x22;New Window&#x22; and &#x22;New Tab&#x22;. But Chromium does not have any menus, and it appears
to be by intentional design (but probably a crappy one).
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
If this wasn&#x27;t enough, there was another more minor but still irritating
annoyance: after clicking on the URL bar and pressing double click, only
the current word is selected as opposed to the Firefox behaviour of selecting
the entire URL.
&#x3C;/li&#x3E;

&#x3C;/ul&#x3E;

&#x3C;p&#x3E;
So I decided to look at Epiphany. Slower than Chromium, but maybe it will
work. Or maybe it won&#x27;t. The first thing I noticed was that it looked 
ugly - very unaesthetic and several widgets in the main window were slightly 
out-of-place. Its URL bar also behaved unlike Firefox in the double click 
respect, which was also annoying.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
So what can I do? I eventually decided to use Opera for editing Wikimedia
wikis until the Firefox-influencing bug is resolved. It is fast, it has a 
menu bar, and double click in the URL bar selects the entire URL. Very nice.
It&#x27;s not open-source, so I&#x27;m trying not to get myself used to it, but seems
like I&#x27;ll need to use it.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
If you haven&#x27;t done so already, I suggest you read 
&#x3C;a href=&#x22;http://www.joelonsoftware.com/navLinks/fog0000000262.html&#x22;&#x3E;the 
&#x22;Joel on Software&#x22; &#x22;must-read&#x22; books recommendations page&#x3C;/a&#x3E;. I haven&#x27;t read
all the books there, but the page itself is also good. Quoting from it from 
our context:
&#x3C;/p&#x3E;

&#x3C;blockquote&#x3E;

&#x3C;p&#x3E;
A few months ago when we released CityDesk, I got an email from a customer
complaining that he was used to doing Alt+F, Alt+S to save files. Unfortunately
due to a tiny, unnoticed bug, that keyboard shortcut saved the file and then
closed it, irritatingly. I had never noticed because I&#x27;m in the habit of doing
Alt+F,S to save files, not Alt+F,Alt+S -- a tiny difference -- and Alt+F,S
worked fine.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Once you get into the habit of doing Alt+F,Alt+S to save, it becomes so
automatic you don&#x27;t think of it as Alt+F,Alt+S. You think of it as save. And
when you push the &#x22;save&#x22; button in your brain and the file you were working on
goes away, it makes you feel like you&#x27;re not in control of your environment.
It&#x27;s a small thing, but about the fourth time that it happens, you&#x27;re going to
be seriously unhappy. That&#x27;s why I spent several hours tracking down this bug
and fixing it. In a bizarre application of Murphy&#x27;s Law, this fix led to a
cascade of events that caused us to waste something like a week, but that&#x27;s
neither here nor there. It was worth the time spent. This is what it means to
be concerned about usability. If you still think that something as small as how
long you hold down the Alt key when you activate a menu command doesn&#x27;t matter,
well, your software is going to make people unhappy. These tiny inconsistencies
are what makes Swing applications so unbearably annoying to use, and in my
opinion it&#x27;s why there are virtually no commercially successful Java GUI
applications.
&#x3C;/p&#x3E;
&#x3C;/blockquote&#x3E;

&#x3C;p&#x3E;
If I can&#x27;t go to &#x22;File &#x2192; New Tab&#x22; in the menubar to start a new tab then I&#x27;m
going to be unhappy. If I have to triple click the URL bar in order to select 
the entire URL, then I&#x27;m going to be unhappy. These tiny things are why I can&#x27;t
use either Chromium or Epiphany. (And frankly, a lack of a menubar is a huge
UI screw-up, not a tiny one).
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
At the moment, I&#x27;m just ranting, but I am planning on reporting these bugs
to the bug trackers of the appropriate projects. I just hope Google won&#x27;t
think the lack of menu-bar in Chromium is a feature. &#x22;Welcome to Google UIs&#x22;.
(Welcome to Google Hell&#x2026;).
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>web browser</category>
<category>firefox</category>
<category>open source</category>
<comments>http://community.livejournal.com/shlomif_tech/46078.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/46078.html</guid>
<pubDate>Thu, 25 Feb 2010 21:21:42 GMT</pubDate>
</item>
<item>
<title>Etymology of the Word &#x22;Cat&#x22;</title>
<link>http://shlomif.livejournal.com/61969.html</link>
<description>&#x3C;p&#x3E;
According to &#x3C;a href=&#x22;http://en.wiktionary.org/wiki/cat#Etymology_1&#x22;&#x3E;the 
Wiktionary entry of the English word &#x22;Cat&#x22;&#x3C;/a&#x3E; (for domestic felines, etc.)
it is originally derived from the Late Egyptian &#x22;&#x10D;aute&#x22;, feminine of 
&#x22;&#x10D;aus &#x27;jungle cat&#x22;. I guess the Hebrew word for Cat,
&#x3C;a href=&#x22;http://en.wiktionary.org/wiki/%D7%97%D7%AA%D7%95%D7%9C&#x22;&#x3E;&#x22;Chatul&#x22;&#x3C;/a&#x3E;
has a similar origin, and I never noticed the similarity between the two
words until I&#x27;ve read the etymology in the Wiktionary. There are similar
words in other European languages: 
&#x3C;a href=&#x22;http://en.wiktionary.org/wiki/chat#French&#x22;&#x3E;the French chat&#x3C;/a&#x3E;,
and &#x3C;a href=&#x22;http://en.wiktionary.org/wiki/Katze#German&#x22;&#x3E;the 
German &#x22;Katze&#x22;&#x3C;/a&#x3E;, and the Arabic word for Cat is 
&#x3C;a href=&#x22;http://en.wiktionary.org/wiki/%D9%82%D8%B7&#x22;&#x3E;Qitt&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Make sure you avoid a 
&#x3C;a href=&#x22;http://www.shlomifish.org/humour/bits/Mastering-Cat/&#x22;&#x3E;useless use
of &#x22;cat&#x22;&#x3C;/a&#x3E;&#x2026;
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>linguistics</category>
<category>cats</category>
<category>etymology</category>
<comments>http://shlomif.livejournal.com/61969.html</comments>
<guid isPermaLink="true">http://shlomif.livejournal.com/61969.html</guid>
<pubDate>Tue, 23 Feb 2010 14:59:33 GMT</pubDate>
</item>
<item>
<title>New Perl Quiz-of-the-Whatever: Short Freecell Solutions</title>
<link>http://community.livejournal.com/shlomif_tech/45610.html</link>
<description>&#x3C;p&#x3E;
I published a new
&#x3C;a href=&#x22;http://article.gmane.org/gmane.comp.lang.perl.qotw.discuss/2655&#x22;&#x3E;Perl 
Quiz-of-the-Whatever about finding short Freecell solutions&#x3C;/a&#x3E;. Hope you enjoy
thinking about it. Here is the &#x3C;a href=&#x22;http://perl.plover.com/qotw/&#x22;&#x3E;Perl
Quiz-of-the-Whatever (formerly &#x22;Quiz of the Week&#x22;) information.&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>perl</category>
<category>fc-solve</category>
<category>freecell</category>
<comments>http://community.livejournal.com/shlomif_tech/45610.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/45610.html</guid>
<pubDate>Mon, 22 Feb 2010 21:57:30 GMT</pubDate>
</item>
<item>
<title>Solving gaal&#x27;s Circuit Riddle Using Perl</title>
<link>http://community.livejournal.com/shlomif_tech/45409.html</link>
<description>&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://gaal.livejournal.com/234795.html&#x22;&#x3E;gaal (= Gaal Yahas)
mentions a riddle&#x3C;/a&#x3E; on his blog:
&#x3C;/p&#x3E;

&#x3C;blockquote&#x3E;
&#x3C;p&#x3E;
There&#x2019;s a box with three input signals: A, B, C. It has three output signals:
~A, ~B, ~C (that is, the negation of each input).
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Design a circuit satisfying the above description. You have two NOT gates, and
as many AND and OR gates as you like.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
(If you solve this, don&#x2019;t tell me the answer &#x2014; I haven&#x2019;t solved it yet; I just
want to share the misery.)
&#x3C;/p&#x3E;
&#x3C;/blockquote&#x3E;

&#x3C;p&#x3E;
I decided that I will try to solve this riddle on my own
and then attempt to write a solution using a Perl 5 program, which I&#x27;ve
also thought about how to write. As it turned out, I ended up exploring
and eventually completely solving the riddle using a series of Perl programs.
I won&#x27;t mention the final solution here, but I&#x27;ll tell which programs
I wrote to solve them and how I wrote them. The code can be found in 
&#x3C;a href=&#x22;http://bitbucket.org/shlomif/riddle-not-a-not-b-not-c/src/&#x22;&#x3E;its
Mercurial repository&#x3C;/a&#x3E; under the MIT/X11 licence, as I mentioned
in &#x3C;a href=&#x22;http://gaal.livejournal.com/234795.html?thread=936235#t936235&#x22;&#x3E;a 
comment&#x3C;/a&#x3E; to gaal&#x27;s post.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Well, first of all I decided to write a program that will take two negated
expressions of AND and OR gates and see if one can arrive to the final solution
using them and the given inputs (A, B and C). To do this I represented every
such possible expression as its components of (A + ~A) &#xD7; (B + ~B) &#xD7; (C + ~C) - 
8 in total which fit in an 8-bit datum, and which I indexed using an array
of 256 items to see which ones exist in the population. After doing the coding
I realised none of the expressions I tried worked.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Then I decided to see if I there are any two possible expressions that when
added to A, B an C will yield all the necessary outputs. I ran it and indeed
found a single pair (and only a single pair) of such expressions (given as 
numbers) which I was able to analyse. I should note that the programs as 
I&#x27;ve written it using some functions and closures was too slow, so I ended
up writing another Perl script to preprocess the code, and inline the 
functions, which has made everything much faster. (You can find this 
preprocessor in the repository).
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Then I wanted to see if I can indeed construct these expressions from A
, B, and C using two negations. When I had thought about this, I believed
I needed to maintain a collection of expressions&#x27; populations, and to 
keep how many negations were in each. But when I got to code it I thought
of a simpler way: marry all the inputs using AND and OR until no more can
be married, then go over the existing ones and negate each one in turn, then
add the negated vector to the population and marry it with all the rest, and
then do it again for all the existing inputs. Using this I was able to
find a single solution.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Then I had to output the solution. For that, I wrote a recursive expression
dumper, which ended up outputting with many parentheses, so I had to post-
process it a bit.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
The solution I got to was very complicated and I believe it would have taken
me a long time to reach without resorting to programming. But at least
it saved me a lot of time and head-scratching. 
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>perl</category>
<category>fun</category>
<comments>http://community.livejournal.com/shlomif_tech/45409.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/45409.html</guid>
<pubDate>Fri, 19 Feb 2010 13:28:13 GMT</pubDate>
</item>
<item>
<title>&#x22;Escape from GNU Autohell&#x22;, List of Editors and IDEs and Factoids&#x27; Fortunes Collection</title>
<link>http://community.livejournal.com/shlomif_hsite/14312.html</link>
<description>&#x3C;p&#x3E;
There&#x27;s 
&#x3C;a href=&#x22;http://www.shlomifish.org/humour.html#english-spelling&#x22;&#x3E;a new
    joke in the aphorisms&#x27; collection&#x3C;/a&#x3E;:
&#x3C;/p&#x3E;

&#x3C;blockquote&#x3E;
    &#x3C;p&#x3E;
    English spelling aims to be consistent. Publicly and methodically. 
    &#x3C;/p&#x3E;
&#x3C;/blockquote&#x3E;

&#x3C;p&#x3E;
I added
&#x3C;a href=&#x22;http://www.shlomifish.org/humour/fortunes/shlomif-factoids.html&#x22;&#x3E;a
    new fortune cookies&#x27; collection with factoids about Chuck Norris/etc.&#x3C;/a&#x3E;,
concentrating the ones from
&#x3C;a href=&#x22;http://www.shlomifish.org/humour/bits/facts/&#x22;&#x3E;the collections
of facts section&#x3C;/a&#x3E;. There are also some new fortune cookies there:
&#x3C;/p&#x3E;

&#x3C;blockquote&#x3E;
    &#x3C;ul&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;BTW, have you read my stories yet?&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Sjors:&#x3C;/b&#x3E;I haven&#x27;t&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;Ah.&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;&#x22;If you read my stories, I&#x27;ll give you 1,000,000 virtual dollars.&#x22;&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Sjors:&#x3C;/b&#x3E;Causing me to have a lot of extra virtual time!&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;And be virtually rich.&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;And then you can virtually bribe virtual politicians.&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;And buy a lot of virtual goods.&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;LOL.&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Sjors:&#x3C;/b&#x3E;Then, I&#x27;d be virtually happy&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Sjors:&#x3C;/b&#x3E;Too bad... :P&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;It&#x27;s a virtual win-win situation.&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;You can hire many virtual programmers to write a lot of virtual code for KMess.&#x3C;/li&#x3E;
&#x3C;li&#x3E;&#x3C;b&#x3E;Shlomif:&#x3C;/b&#x3E;&#x22;My old virtual dad used to say to me: &#x27;virtual money does not bring you virtual happiness, my virtual son.&#x27;&#x22;&#x3C;/li&#x3E;
&#x3C;/ul&#x3E;
&#x3C;/blockquote&#x3E;

&#x3C;p&#x3E;
There&#x27;s 
&#x3C;a href=&#x22;http://www.shlomifish.org/open-source/resources/editors-and-IDEs/&#x22;&#x3E;a
    new page with a list of text editors and IDEs&#x3C;/a&#x3E;. I also added
&#x3C;a href=&#x22;http://www.shlomifish.org/open-source/anti/autohell/&#x22;&#x3E;a page
    titled &#x22;Escape from GNU Autohell!&#x22;&#x3C;/a&#x3E; explaining why the GNU Autotools
suck so much and why you should switch to CMake or a different 
better alternative.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I added 
&#x3C;a href=&#x22;http://www.shlomifish.org/open-source/bits-and-bobs/greasemonkey/grease.html#self-links-for-headers&#x22;&#x3E;a
    new Greasemonkey script&#x3C;/a&#x3E; for providing self-links for headers with
an &#x3C;tt&#x3E;id=&#x3C;/tt&#x3E; attribute.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://www.shlomifish.org/lecture/Freecell-Solver/project-intro/&#x22;&#x3E;The
    Freecell Solver project intro&#x3C;/a&#x3E; now contains
&#x3C;a href=&#x22;http://www.shlomifish.org/lecture/Freecell-Solver/project-intro/Summary.txt&#x22;&#x3E;a
    summary&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>facts</category>
<category>autotools</category>
<category>www</category>
<category>site</category>
<category>humour</category>
<category>fish</category>
<category>autohell</category>
<category>norris</category>
<category>web</category>
<category>homepage</category>
<category>jokes</category>
<category>chuck</category>
<category>shlomi</category>
<category>ides</category>
<category>cmake</category>
<category>factoids</category>
<category>text</category>
<category>editors</category>
<comments>http://community.livejournal.com/shlomif_hsite/14312.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_hsite/14312.html</guid>
<pubDate>Thu, 18 Feb 2010 15:40:22 GMT</pubDate>
</item>
<item>
<title>Article Recommendation: &#x22;What Every CSer Should Know about Floating-Point Arithmetic&#x22;</title>
<link>http://community.livejournal.com/shlomif_tech/45104.html</link>
<description>&#x3C;p&#x3E;
I&#x27;ve read the paper 
&#x3C;a href=&#x22;http://docs.sun.com/source/806-3568/ncg_goldberg.html&#x22;&#x3E;&#x22;What 
Every Computer Scientist Should Know About Floating-Point Arithmetic&#x22;&#x3C;/a&#x3E; and
can recommend it as it has many interesting insights. I had received quite a
lot of reports for bugs in 
&#x3C;a href=&#x22;http://search.cpan.org/dist/Statistics-Descriptive/&#x22;&#x3E;the
&#x22;Statistics-Descriptive&#x22; CPAN distribution&#x3C;/a&#x3E; that were caused by expected
floating-point behaviour. Some of them I was able to resolve using some
trickery, and some others possibly can be somewhat mitigated using the insights
I&#x27;ve learnt in the article.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>perl</category>
<category>recommendation</category>
<category>article</category>
<comments>http://community.livejournal.com/shlomif_tech/45104.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/45104.html</guid>
<pubDate>Thu, 11 Feb 2010 05:24:18 GMT</pubDate>
</item>
<item>
<title>NYTProf-3 is Out!</title>
<link>http://community.livejournal.com/shlomif_tech/44836.html</link>
<description>&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://blog.timbunce.org/2009/12/24/nytprof-v3-worth-the-wait/&#x22;&#x3E;Tim
Bunce writes on his blog about the new features in 
Devel-NYTProf version 3&#x3C;/a&#x3E;. Devel-NYTProf is a profiler for the 
&#x3C;a href=&#x22;http://perl-begin.org/&#x22;&#x3E;Perl programming language&#x3C;/a&#x3E;, which has
put all the previous attempts in profiling in the dust, and now it&#x27;s even 
better than before. Enjoy! (Thanks to 
&#x3C;a href=&#x22;http://mail.pm.org/pipermail/sanfrancisco-pm/2010-February/002704.html&#x22;&#x3E;Fred 
Moyer&#x27;s post&#x3C;/a&#x3E; on the San-Fransisco Perl Mongers mailing list).
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>3</category>
<category>version</category>
<category>perl</category>
<category>profiler</category>
<category>release</category>
<category>nytprof</category>
<comments>http://community.livejournal.com/shlomif_tech/44836.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/44836.html</guid>
<pubDate>Fri, 05 Feb 2010 16:31:51 GMT</pubDate>
</item>
<item>
<title>New Page about Text Editors and IDEs for Programmers</title>
<link>http://community.livejournal.com/shlomif_tech/44605.html</link>
<description>&#x3C;p&#x3E;
After answering the questions &#x22;Can anyone recommend a good text editor?&#x22; and 
&#x22;What is a good IDE?&#x22; a few times in the past, I set up 
&#x3C;a href=&#x22;http://www.shlomifish.org/open-source/resources/editors-and-IDEs/&#x22;&#x3E;a
page listing some prominent text editors and Integrated Development
Environments (IDEs)&#x3C;/a&#x3E; for development on my homepage. Currently it includes
only cross-platform open-source text editors and cross-platform open-source
IDEs, but I&#x27;m planning to expand it as time and interest permits. Additions
would be welcome.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://www.vim.org/&#x22;&#x3E;Vim&#x3C;/a&#x3E; is there and so are XEmacs and
&#x3C;a href=&#x22;http://www.eclipse.org/&#x22;&#x3E;Eclipse&#x3C;/a&#x3E;, and also
&#x3C;a href=&#x22;http://padre.perlide.org/&#x22;&#x3E;Padre, the Perl IDE&#x3C;/a&#x3E; and more 
specialised IDEs such as &#x3C;a href=&#x22;http://eric-ide.python-projects.org/&#x22;&#x3E;the
&#x22;Eric&#x22; Python IDE&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<comments>http://community.livejournal.com/shlomif_tech/44605.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/44605.html</guid>
<pubDate>Tue, 02 Feb 2010 19:59:14 GMT</pubDate>
</item>
<item>
<title>&#x5E4;&#x5D2;&#x5D9;&#x5E9;&#x5EA; &#x5E7;&#x5D5;&#x5D3; &#x5E4;&#x5EA;&#x5D5;&#x5D7; &#x5D1;&#x5EA;&#x5DC;-&#x5D0;&#x5D1;&#x5D9;&#x5D1;: 14 &#x5D1;&#x5E4;&#x5D1;&#x5E8;&#x5D5;&#x5D0;&#x5E8; - vtiger CRM</title>
<link>http://community.livejournal.com/shlomif_tech/44385.html</link>
<description>&#x3C;div dir=&#x22;rtl&#x22; align=&#x22;right&#x22;&#x3E;

&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://tel.foss.org.il/&#x22;&#x3E;&#x5DE;&#x5D5;&#x5E2;&#x5D3;&#x5D5;&#x5DF; &#x5D4;&#x5E7;&#x5D5;&#x5D3; &#x5D4;&#x5E4;&#x5EA;&#x5D5;&#x5D7; &#x5D4;&#x5EA;&#x5DC;-&#x5D0;&#x5D1;&#x5D9;&#x5D1;&#x5D9; (&#x5EA;&#x5DC;&#x5D5;&#x5E7;&#x5E1;)&#x3C;/a&#x3E;
&#x5D9;&#x5D9;&#x5E4;&#x5D2;&#x5E9; &#x5E9;&#x5D5;&#x5D1; &#x5DB;&#x5D3;&#x5D9; &#x5DC;&#x5E9;&#x5DE;&#x5D5;&#x5E2; &#x5D0;&#x5EA;
&#x3C;a href=&#x22;http://wiki.osdc.org.il/index.php/Tel_Aviv_Meeting_on_14_February_2010&#x22;&#x3E;&#x5D4;&#x5E8;&#x5E6;&#x5D0;&#x5EA;&#x5D5; &#x5E9;&#x5DC; 
&#x5E8;&#x5DE;&#x5D9; &#x5D4;&#x5D3;&#x5D3;&#x5D9; &#x5D0;&#x5D5;&#x5D3;&#x5D5;&#x5EA; &#x22;&#x5DE;&#x5E2;&#x5E8;&#x5DB;&#x5EA; &#x5E0;&#x5D9;&#x5D4;&#x5D5;&#x5DC; &#x5E7;&#x5E9;&#x5E8;&#x5D9; &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Fish ( shlomif@iglu.org.il )</author>
<comments>http://community.livejournal.com/shlomif_tech/44385.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/44385.html</guid>
<pubDate>Tue, 02 Feb 2010 18:47:42 GMT</pubDate>
</item>
<item>
<title>Escape from GNU Autohell!</title>
<link>http://community.livejournal.com/shlomif_tech/44103.html</link>
<description>&#x3C;p&#x3E;
I&#x27;ve set up &#x3C;a href=&#x22;http://www.shlomifish.org/open-source/anti/autohell/&#x22;&#x3E;a 
page on my web-site titled &#x22;Escape from GNU Autohell!&#x22;&#x3C;/a&#x3E; about the evils
of the GNU Autotools (GNU Autoconf/Automake/Libtool and other GNU 
auto-brain-damages) and why you should convert to a good alternative such as 
&#x3C;a href=&#x22;http://www.cmake.org/&#x22;&#x3E;CMake&#x3C;/a&#x3E;. The page contains a list of
the many disadvantages of the GNU Autotools, some refutation of common
arguments against CMake, and some links.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
And lo and behold, some time after writing the page I spent hours dealing
with yet another Autohell problem:
&#x3C;a href=&#x22;https://qa.mandriva.com/show_bug.cgi?id=57319&#x22;&#x3E;&#x22;Mandriva&#x27;s
libtool causes &#x22;make install&#x22; of xine-lib-1.1-hg to fail&#x22;&#x3C;/a&#x3E;. I actually
had to build the Mandriva libtool several times to find the offending
downstream patch, and libtool&#x27;s &#x22;./bootstrap&#x22; script was so slow that
I could finish running &#x22;make&#x22; and &#x22;make install&#x22; in xine-lib while waiting
for it to finish. And it says a lot because xine uses GNU Autohell
which slows down the build process considerably. Eventually, I found the
offending patch after several hours, and I wouldn&#x27;t have finished on time if I 
didn&#x27;t cancel the &#x22;make check&#x22; test in the .rpm.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Autohell must die!
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>rants</category>
<category>cmake</category>
<category>build</category>
<category>autohell</category>
<category>gnu</category>
<category>escape</category>
<category>rant</category>
<category>make</category>
<category>autotools</category>
<comments>http://community.livejournal.com/shlomif_tech/44103.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/44103.html</guid>
<pubDate>Sun, 31 Jan 2010 12:45:57 GMT</pubDate>
</item>
<item>
<title>Project Euler Problem #10 in Haskell, Perl and C</title>
<link>http://community.livejournal.com/shlomif_tech/44006.html</link>
<description>&#x3C;p&#x3E;
zerothorder told 
&#x3C;a href=&#x22;http://zerothorder.blogspot.com/2009/11/after-drinking-functional-immutable-and.html&#x22;&#x3E;how 
he found a solution for Project Euler&#x27;s Problem 10 in Haskell&#x3C;/a&#x3E;. The 
problem is &#x22;Find the sum of all primes less than 2,000,000&#x22;. It is given
here below:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
primes :: [Integer]
primes = 2 : filter isPrime [3, 5 ..]
    where
        -- only check divisibility of the numbers less than the square root of n
        isPrime n = all (not . divides n) $ takeWhile (\p -&#x26;gt; p*p &#x26;lt;= n) primes
        divides n p = n `mod` p == 0
 
result = sum $ takeWhile (&#x26;lt; 2000000) primes
 
main = do putStrLn( show result )
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
He says &#x22;If this doesn&#x27;t give you a nerdgasm, I don&#x27;t know what will.&#x22;. The
problem is that this nerdgasm will last a long time. Benchmarking this
program gives that 20 iterations of it run at 310 seconds - less
than - about 15 seconds each (on my Pentium 4 2.4GHz machine running
Mandriva Linux Cooker). So next I tried a better Haskell
implmenetation that I recalled from a thread I started in the Haskell Caf&#xE9;
mailing list about implementing
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes&#x22;&#x3E;a sieve of
Eratosthenes in Haskell&#x3C;/a&#x3E;:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
import Data.Int

primes :: Int64 -&#x26;gt; [Int64]

primes how_much = sieve [2..how_much] where
         sieve (p:x) = 
             p : (if p &#x26;lt;= mybound
                 then sieve (remove (p*p) x)
                 else x) where
             remove what (a:as) | what &#x26;gt; how_much = (a:as)
                                | a &#x26;lt; what = a:(remove what as)
                                | a == what = (remove (what+step) as)
                                | a &#x26;gt; what = a:(remove (what+step) as)
             remove what [] = []
             step = (if (p == 2) then p else (2*p)) 
         sieve [] = []
         mybound = ceiling(sqrt(fromIntegral how_much))

--main = print (length (primes 1000000))
main = print (sum (primes 2000000))
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
This does not involve costly operations such as modulo or division
and 20 iterations of it run at 135 wallclocks seconds - over two times faster
than zeroth&#x27;s Haskell version.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Now how about Perl? Since Perl has assignment, we have the advantage that
we can create a vector of bits that we will mark with the primes by iterating
over all numbers up to the root of the limit. Here is the code:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
#!/usr/bin/perl

use strict;
use warnings;

use Math::BigInt lib =&#x26;gt; &#x26;#39;GMP&#x26;#39;;

my $limit = 2_000_000;

my $primes_bitmask = &#x26;quot;&#x26;quot;;

my $loop_to = int(sqrt($limit));
my $sum = 0;
my $total_sum = Math::BigInt-&#x26;gt;new(&#x26;#39;0&#x26;#39;);

for my $p (2 .. $loop_to)
{
    if (vec($primes_bitmask, $p, 1) == 0)
    {
        $sum += $p;

        my $i = $p * $p;

        while ($i &#x26;lt; $limit)
        {
            vec($primes_bitmask, $i, 1) = 1;
        }
        continue
        {
            $i += $p;
        }

    }
}

for my $p ($loop_to .. $limit)
{
    if (vec($primes_bitmask, $p, 1) == 0)
    {
        if (($sum += $p) &#x26;gt; (1 &#x26;lt;&#x26;lt; 30))
        {
            $total_sum += $sum;
            $sum = 0;
        }
    }
}

$total_sum += $sum;
print &#x26;quot;$total_sum\n&#x26;quot;;
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
20 runs of it run at 95 walclock seconds - even faster than the Haskell
version. But it gets better. Since all the primes we encounter greater than
2 are not even, we can create a map of their pseduo-halves and conserve on
memory and iterations. This is the Perl version:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
#!/usr/bin/perl

use strict;
use warnings;

use Math::BigInt lib =&#x26;gt; &#x26;#39;GMP&#x26;#39;;

my $limit = 2_000_000;

my $primes_bitmask = &#x26;quot;&#x26;quot;;

my $loop_to = (int(sqrt($limit)))&#x26;gt;&#x26;gt;1;
my $half_limit = ($limit-1)&#x26;gt;&#x26;gt;1;

my $sum = 0+2;
my $total_sum = Math::BigInt-&#x26;gt;new(&#x26;#39;0&#x26;#39;);

for my $half (1 .. $loop_to)
{
    if (vec($primes_bitmask, $half, 1) == 0)
    {
        my $p = (($half&#x26;lt;&#x26;lt;1)+1);
        $sum += $p;

        my $i = ($p * $p)&#x26;gt;&#x26;gt;1;

        while ($i &#x26;lt; $limit)
        {
            vec($primes_bitmask, $i, 1) = 1;
        }
        continue
        {
            $i += $p;
        }

    }
}


for my $half ($loop_to .. $half_limit)
{
    if (vec($primes_bitmask, $half, 1) == 0)
    {
        if (($sum += (($half&#x26;lt;&#x26;lt;1)+1)) &#x26;gt; (1 &#x26;lt;&#x26;lt; 30))
        {
            $total_sum += $sum;
            $sum = 0;
        }
    }
}

$total_sum += $sum;
print &#x26;quot;$total_sum\n&#x26;quot;;
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
Running this 20 times takes 73 wallclock seconds, close to half that of my
Haskell version.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Then I wondered how long C will take. Here is a C implementation without
the halving:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
#include &#x26;lt;string.h&#x26;gt;
#include &#x26;lt;math.h&#x26;gt;
#include &#x26;lt;stdint.h&#x26;gt;
#include &#x26;lt;stdio.h&#x26;gt;

#define limit 2000000
int8_t bitmask[(limit+1)/8];

int main(int argc, char * argv[])
{
    int p, i;
    int mark_limit;
    long long sum = 0;

    memset(bitmask, &#x26;#39;\0&#x26;#39;, sizeof(bitmask));
    mark_limit = (int)sqrt(limit);
    
    for (p=2 ; p &#x26;lt;= mark_limit ; p++)
    {
        if (! ( bitmask[p&#x26;gt;&#x26;gt;3]&#x26;amp;(1 &#x26;lt;&#x26;lt; (p&#x26;amp;(8-1))) ) )
        {
            /* It is a prime. */
            sum += p;
            for (i=p*p;i&#x26;lt;=limit;i+=p)
            {
                bitmask[i&#x26;gt;&#x26;gt;3] |= (1 &#x26;lt;&#x26;lt; (i&#x26;amp;(8-1)));
            }
        }
    }
    for (; p &#x26;lt;= limit; p++)
    {
        if (! ( bitmask[p&#x26;gt;&#x26;gt;3]&#x26;amp;(1 &#x26;lt;&#x26;lt; (p&#x26;amp;(8-1))) ) )
        {
            sum += p;
        }
    }

    printf(&#x26;quot;%lli\n&#x26;quot;, sum);

    return 0;
}
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
This was too fast to measure with 20 runs alone, so 500 runs of it took 15
seconds, two or three orders of magnitude faster than the fastest Haskell
or Perl versions. But naturally, we can apply the halving paradigm there too:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
#include &#x26;lt;string.h&#x26;gt;
#include &#x26;lt;math.h&#x26;gt;
#include &#x26;lt;stdint.h&#x26;gt;
#include &#x26;lt;stdio.h&#x26;gt;

#define limit 2000000
int8_t bitmask[(limit+1)/8/2];

int main(int argc, char * argv[])
{
    int half, p, i;
    int half_limit;
    int loop_to;
    long long sum = 0 + 2;

    memset(bitmask, &#x26;#39;\0&#x26;#39;, sizeof(bitmask));

    loop_to=(((int)(sqrt(limit)))&#x26;gt;&#x26;gt;1);
    half_limit = (limit-1)&#x26;gt;&#x26;gt;1;
    
    for (half=1 ; half &#x26;lt;= loop_to ; half++)
    {
        if (! ( bitmask[half&#x26;gt;&#x26;gt;3]&#x26;amp;(1 &#x26;lt;&#x26;lt; (half&#x26;amp;(8-1))) ) )
        {
            /* It is a prime. */
            p = (half &#x26;lt;&#x26;lt; 1)+1;
            sum += p;
            for (i = ((p*p)&#x26;gt;&#x26;gt;1) ; i &#x26;lt; half_limit ; i+=p )
            {
                bitmask[i&#x26;gt;&#x26;gt;3] |= (1 &#x26;lt;&#x26;lt; (i&#x26;amp;(8-1)));
            }
        }
    }

    for( ; half &#x26;lt; half_limit ; half++)
    {
        if (! ( bitmask[half&#x26;gt;&#x26;gt;3]&#x26;amp;(1 &#x26;lt;&#x26;lt; (half&#x26;amp;(8-1))) ) )
        {
            sum += (half&#x26;lt;&#x26;lt;1)+1;
        }
    }

    printf(&#x26;quot;%lli\n&#x26;quot;, sum);

    return 0;
}
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
500 runs of it take 10 wallclock seconds - 54.35 times per second,
and 50% better than the previous C version. And I still haven&#x27;t applied
platform-specific gcc optimisations. 
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I should also note that the executables generated by ghc are extremely
large in comparison to their C ones:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
$ ls -l c_* haskell_*
-rwxr-xr-x 1 shlomi shlomi   6082 2009-12-04 07:46 c_mine
-rwxr-xr-x 1 shlomi shlomi   6103 2009-12-04 07:46 c_mine_half
-rwxr-xr-x 1 shlomi shlomi   6092 2009-12-04 07:46 c_mine_micro_opt
-rwxr-xr-x 1 shlomi shlomi 796825 2009-12-04 07:56 haskell_mine
-rwxr-xr-x 1 shlomi shlomi 571717 2009-12-04 07:46 haskell_zeroth
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
&#x3C;tt&#x3E;c_mine_half&#x3C;/tt&#x3E; is less than 1% the size of &#x3C;tt&#x3E;haskell_mine&#x3C;/tt&#x3E; (and
runs faster). When talking about this to other people, they said that Haskell
has a very optimised primes sequence generator, which I can try using (which
should be over 3 times as fast), and that it has two kinds of integers, which
the other type is faster, and that it has a better way to emulate assignment.
But the bottom line is that the na&#xEF;ve and intuitive way to write such
programs in Haskell is under-performant, even in comparison to Perl, and 100
or 1,000 times as much in comparison to C.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I&#x27;ve written this as a separate post and not as a comment to the original
blog post because I&#x27;m very limited with the markup in the commenting there
(I&#x27;m going to post a comment there with a link to this blog post, though). 
I should note that you can find all the code I mentioned inside 
&#x3C;a href=&#x22;http://github.com/shlomif/Project-Euler-Problem-10-Comparison&#x22;&#x3E;a
dedicated Github repository&#x3C;/a&#x3E;, and you can experiment with it further.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>problem</category>
<category>summary</category>
<category>primes</category>
<category>project</category>
<category>optimize</category>
<category>optimise</category>
<category>optimization</category>
<category>c</category>
<category>haskell</category>
<category>perl</category>
<category>10</category>
<category>speed</category>
<category>optimisation</category>
<category>euler</category>
<comments>http://community.livejournal.com/shlomif_tech/44006.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/44006.html</guid>
<pubDate>Sat, 30 Jan 2010 12:50:07 GMT</pubDate>
</item>
<item>
<title>Freecell Solver 2.40.0 was Released</title>
<link>http://fc-solve.blogspot.com/2010/01/freecell-solver-2400-was-released.html</link>
<description>&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://fc-solve.berlios.de/&#x22;&#x3E;Freecell Solver&#x3C;/a&#x3E; version 2.40.0
has been released. It is available in the form of a source tarball from 
&#x3C;a href=&#x22;http://fc-solve.berlios.de/download.html&#x22;&#x3E;the
    download page&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
This release contains a fix to a string overflow with processing the command 
line arguments, and an optimised command-line preset that can be invoked
as &#x3C;tt&#x3E;-l blue-yonder&#x3C;/tt&#x3E; (or &#x3C;tt&#x3E;-l by&#x3C;/tt&#x3E; for short) that solves the
Microsoft 32,000 deals in under 100 seconds on a Pentium 4 2.4GHz machine.
It also contains some more minor changes: there is now a &#x3C;tt&#x3E;Scan:&#x3C;/tt&#x3E; header 
with the name of the current soft thread, when debugging under 
&#x3C;tt&#x3E;-s -i&#x3C;/tt&#x3E;, an off-by-1 iterations count was fixed and the iteration
handling callback is now applied globally to all the instances. Finally,
&#x3C;tt&#x3E;make_pysol_freecell_board.py&#x3C;/tt&#x3E; has support for generating PySol&#x27;s
and PySolFC&#x27;s 
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Black_Hole_%28solitaire%29&#x22;&#x3E;&#x22;Black Hole&#x22;
    Solitaire&#x3C;/a&#x3E; deals, intended for my newly released
&#x3C;a href=&#x22;http://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/&#x22;&#x3E;Black Hole Solitaire Solver&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Enjoy!
&#x3C;/p&#x3E;&#x3C;div class=&#x22;blogger-post-footer&#x22;&#x3E;&#x3C;img width=&#x27;1&#x27; height=&#x27;1&#x27; src=&#x27;https://blogger.googleusercontent.com/tracker/96099636168698788-8433576534342073452?l=fc-solve.blogspot.com&#x27; alt=&#x27;&#x27; /&#x3E;&#x3C;/div&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>speed</category>
<category>release</category>
<category>optimization</category>
<category>security</category>
<category>minor</category>
<category>solving</category>
<category>pysolfc</category>
<category>overflow</category>
<category>version</category>
<category>freecell</category>
<category>2.40.0</category>
<category>pysol</category>
<category>buffer</category>
<category>solver</category>
<category>asciidoc</category>
<guid isPermaLink="false">tag:blogger.com,1999:blog-96099636168698788.post-8433576534342073452</guid>
<pubDate>Wed, 27 Jan 2010 20:33:00 +0000</pubDate>
<atom:updated>2010-01-27T12:34:13.248-08:00</atom:updated>
</item>
<item>
<title>XML-Grammar-Fortune version 0.0200 Was Released</title>
<link>http://community.livejournal.com/shlomif_tech/43620.html</link>
<description>&#x3C;p&#x3E;
I recently released version 0.0200 of the Perl 5 CPAN Module
&#x3C;a href=&#x22;http://web-cpan.berlios.de/modules/XML-Grammar-Fortune/&#x22;&#x3E;XML-Grammar-Fortune&#x3C;/a&#x3E;.
XML-Grammar-Fortune is a module to maintain a collection of Unix-like
fortune cookies as XML and convert them to XHTML and plain-text.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
New in this release are a heavily fixed and enhanced code for rendering the XML
to plaintext and a more enhanced META.yml file. XML-Grammar-Fortune was
successfully utilised for
&#x3C;a href=&#x22;http://www.shlomifish.org/humour/fortunes/&#x22;&#x3E;my collection of Fortune
Cookies&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>release</category>
<category>unix</category>
<category>text</category>
<category>fortune</category>
<category>grammar</category>
<category>hacktivity</category>
<category>xml-grammar-fortune</category>
<category>perl</category>
<category>xml</category>
<category>fortunes</category>
<category>cpan</category>
<comments>http://community.livejournal.com/shlomif_tech/43620.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/43620.html</guid>
<pubDate>Mon, 25 Jan 2010 15:49:53 GMT</pubDate>
</item>
<item>
<title>The CPAN Dependencies of Website Meta Language</title>
<link>http://community.livejournal.com/shlomif_tech/43345.html</link>
<description>&#x3C;p&#x3E;
In the past few days I resumed work on converting
the &#x3C;a href=&#x22;http://thewml.org/&#x22;&#x3E;Website Meta Language&#x3C;/a&#x3E; (WML) build-system
from the GNU Autotools (also known as &#x22;GNU Autohell&#x22;) to 
&#x3C;a href=&#x22;http://www.cmake.org/&#x22;&#x3E;CMake&#x3C;/a&#x3E;. This involved implementing a lot
of the existing makefile and autoconf logic in CMake and Perl. 
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Yesterday, I converted the &#x22;wml_common&#x22; sub-directory which turned out to
contain some ancient versions of CPAN distributions with a forced-upon way
to install under the WML prefix. I decided to forego installing all of them
and just check for their existence in the perl version that wml uses using 
some WML and &#x22;perl -MMyModule&#x22; code. 
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I was able to find all the needed modules in the Mandriva repository, except
one - 
&#x3C;a href=&#x22;http://search.cpan.org/dist/File-PathConvert/&#x22;&#x3E;File-PathConvert&#x3C;/a&#x3E;
, which I&#x27;ve never heard about.
I checked it on CPAN, and saw that it was deprecated and superseded by
File::Spec and Cwd. So I grepped the tree for its use and found it was used
only in one Perl program which I quickly converted to File::Spec and Cwd.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Now, the future build system of Website Meta Language will be simpler
and it won&#x27;t use deprecated modules.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Oh! And 
&#x3C;a href=&#x22;http://blog.mozilla.com/blog/2010/01/21/firefox-3-6-release/&#x22;&#x3E;Firefox
3.6 (Gamma) is out&#x3C;/a&#x3E;! I&#x27;ve been using the betas and RCs on Mandriva Cooker
for some time now, and now I&#x27;ve upgraded to the stable version and it&#x27;s
still great.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>eumm</category>
<category>wml</category>
<category>language</category>
<category>cmake</category>
<category>perl</category>
<category>firefox</category>
<category>gnu</category>
<category>autohell</category>
<category>website</category>
<category>meta</category>
<category>cpan</category>
<comments>http://community.livejournal.com/shlomif_tech/43345.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/43345.html</guid>
<pubDate>Fri, 22 Jan 2010 19:22:40 GMT</pubDate>
</item>
<item>
<title>Perl: Using Vim&#x27;s snipMate for Perl 5 snippets</title>
<link>http://community.livejournal.com/shlomif_tech/43262.html</link>
<description>&#x3C;p&#x3E;
I noticed that there was some Perl 5 code that I had to type or copy-and-paste
again and again on many occasions. So I decided to find a way to put it in
one place and then recall it. I thought of writing it myself, but then recalled
the &#x3C;a href=&#x22;http://www.vim.org/scripts/script.php?script_id=2540&#x22;&#x3E;snipMate
snippets extension for Vim&#x3C;/a&#x3E; (which 
&#x3C;a href=&#x22;http://www.catonmat.net/blog/vim-plugins-snipmate-vim/&#x22;&#x3E;Peteris
Krumins covered in a blog post&#x3C;/a&#x3E;), which allows that. After a little reading,
I was able to prepare the snippets.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I placed the following under &#x3C;tt&#x3E;~/.vim/snippets/perl/_slurp.snippet&#x3C;/tt&#x3E; :
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
sub _slurp
{
	my $filename = shift;

	open my $in, &#x22;&#x26;lt;&#x22;, $filename
		or die &#x22;Cannot open &#x27;$filename&#x27; for slurping - $!&#x22;;

	local $/;
	my $contents = &#x26;lt;$in&#x26;gt;;

	close($in);

	return $contents;
}
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
And now I can type &#x22;_slurp&#x26;lt;TAB&#x26;gt;&#x22; to recall it. The existing &#x22;slurp&#x22;
snippet in &#x3C;tt&#x3E;~/.vim/snippets/perl.snippets&#x3C;/tt&#x3E; is quite evil, with an
ugly inline line, typeglobs, and a two args open without a die statement. 
Thanks, but no thanks.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Afterwards I added the following in 
&#x3C;tt&#x3E;~/.vim/snippets/perl/_ltestb.snippet&#x3C;/tt&#x3E;
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
	local $Test::Builder::Level = $Test::Builder::Level + 1;
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
And now I can type &#x22;_ltestb&#x22; (short for &#x22;local Test::Builder&#x22;) and put this 
line there to create my own custom Test::More/Test::Builder tests.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Thus, using snipMate, you can create your own short-hands for commonly-used
snippets like that.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>test</category>
<category>tip</category>
<category>local</category>
<category>slurp</category>
<category>perl</category>
<category>snipmate</category>
<category>vim tip</category>
<category>builder</category>
<category>snippets</category>
<category>vim</category>
<comments>http://community.livejournal.com/shlomif_tech/43262.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/43262.html</guid>
<pubDate>Thu, 21 Jan 2010 16:26:13 GMT</pubDate>
</item>
<item>
<title>Report on the TelFOSS &#x22;Moose for Beginners&#x22; Meeting</title>
<link>http://community.livejournal.com/shlomif_tech/42895.html</link>
<description>&#x3C;p&#x3E;
Last Sunday, &#x3C;a href=&#x22;http://tel.foss.org.il/&#x22;&#x3E;Tel Aviv Open Source club
(TelFOSS)&#x3C;/a&#x3E; met to listen to Sawyer&#x27;s presentation about &#x22;Moose for
Beginners&#x22;. Despite the fact that the meeting was well-publicised, very
few people came. Sawyer did not prepare a lot of slides and since there were
not many questions he finished quickly. After all that, he went to demonstrate
how to implement several use cases that the audience has proposed as Moose
programs, and despite that we still finished early.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I asked about implementing an &#x22;XML parser&#x22;, but in fact I wanted to implement
a processor for a certain XML grammar. In any case, he misunderstood and told
me to use Parse-RecDescent for that. I&#x27;ve grown to dislike P-RD for most stuff
though.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
In any case, I&#x27;m getting tired of the low attendance in TelFOSS meetings. We
do so much work in organising and publicising the meetings, and most people
don&#x27;t bother to come. Are the people too busy? Did they run out of steam? Why
don&#x27;t they come? This makes me frustrating and unwilling to further organise
the TelFOSS meetings.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>telux</category>
<category>telfoss</category>
<category>meeting</category>
<category>open</category>
<category>perl</category>
<category>club</category>
<category>sawyer</category>
<category>moose</category>
<category>tel aviv</category>
<category>source</category>
<category>report</category>
<comments>http://community.livejournal.com/shlomif_tech/42895.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/42895.html</guid>
<pubDate>Wed, 20 Jan 2010 12:35:04 GMT</pubDate>
</item>
<item>
<title>The Quest for a Good Window Manager / Desktop Environment</title>
<link>http://community.livejournal.com/shlomif_tech/42522.html</link>
<description>&#x3C;p&#x3E;
I&#x27;m using Linux (Mandriva Cooker) and have been routinely starting many
window managers and desktop environments as the need arises. Lately, I&#x27;ve been
working a lot with KDE 4 and I happen to agree with
&#x3C;a href=&#x22;http://www.osnews.com/story/22662/Your_KDE4_Experiences&#x22;&#x3E;OSNews.com&#x27;s
assertion that it is slow, sluggish, and has frequent random crashes&#x3C;/a&#x3E;. I&#x27;d
like to move to something more usable until the KDE 4 programmers get their
act together. Now, I&#x27;ve traditionally used 
&#x3C;a href=&#x22;http://www.icewm.org/&#x22;&#x3E;IceWM&#x3C;/a&#x3E; but it no longer cuts it for me 
because it does not have a different wallpaper
for every virtual desktop. XFCE fails on the same premise. Enlightenment 17
has a different wallpaper per virtual desktop, but its task bar is
dysfunctional, if not completely non-existent, and it has many other very
annoying quirks. GNOME is just plain annoying (and doesn&#x27;t have a
different-wallpaper-per-virtual-desktop either), and KDE 3 is no longer present
on Mandriva. LXDE does not have it either.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Now I dislike the concept of 
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Tiling_window_manager&#x22;&#x3E;tiling 
window manangers&#x3C;/a&#x3E;, of which there has been an inflation, recently, and I am
looking for a window manager that has stacking. And like I said, it also needs
to have a usable task bar, a different wallpaper per virtual desktop
and be responsive and stable.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Do you have any recommendations?
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@iglu.org.il )</author>
<category>window</category>
<category>desktop</category>
<category>tiling</category>
<category>stacking</category>
<category>unix</category>
<category>kde</category>
<category>4</category>
<category>x11</category>
<category>wallpaper</category>
<category>environment</category>
<category>virtual</category>
<category>icewm</category>
<category>x</category>
<category>xfce</category>
<category>manager</category>
<category>windows</category>
<category>workspace</category>
<category>linux</category>
<comments>http://community.livejournal.com/shlomif_tech/42522.html</comments>
<guid isPermaLink="true">http://community.livejournal.com/shlomif_tech/42522.html</guid>
<pubDate>Mon, 18 Jan 2010 19:49:59 GMT</pubDate>
</item>
</channel>
</rss>