<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
    <title>Shlomi Fish</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/" />
    <link rel="self" type="application/atom+xml" href="http://blogs.perl.org/users/shlomi_fish/atom.xml" />
    <id>tag:blogs.perl.org,2009-11-03:/users/shlomi_fish//422</id>
    <updated>2013-06-02T15:09:55Z</updated>
    <subtitle>A blog about the Perl programming language</subtitle>
    <generator uri="http://www.sixapart.com/movabletype/">Movable Type Pro 4.38</generator>

<entry>
    <title>The &quot;sky&quot; command-line application and other Recent hacktivity</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2013/06/the-sky-command-line-application-and-other-recent-hacktivity.html" />
    <id>tag:blogs.perl.org,2013:/users/shlomi_fish//422.4735</id>

    <published>2013-06-02T07:55:38Z</published>
    <updated>2013-06-02T15:09:55Z</updated>

    <summary> If you have a good web hosting, you may have run into a pattern, where you are uploading files to it for other people to download and need to find the URL where they were uploaded to. Thing is...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
        <category term="Recent Hacktivity" scheme="http://www.sixapart.com/ns/types#category" />
    
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacking" label="hacking" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacktivity" label="hacktivity" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="rsync" label="rsync" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="uploading" label="uploading" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
If you have a good web hosting, you may have run into a pattern, where you
are uploading files to it for other people to download and need to find the
URL where they were uploaded to. Thing is - recalling the exact
<a href="http://en.wikipedia.org/wiki/Rsync">Rsync</a> (= a file
uploader) command and then going to the web browser to access the URL
is time-consuming, and repetitive.
<a href="http://www.shlomifish.org/open-source/projects/sky/">sky</a>,
written in Perl using Moo and available on CPAN, aims to fix all that.
</p>

<p>
Here is a sample invocation from the web-site:
</p>

<pre>
shlomif@telaviv1:~$ sky up /home/music/Music/mp3s/Thierry\ de\ Massia/Elements\ essentiels/01\ -\ Le\ vent.ogg
X11 forwarding request failed on channel 0
sending incremental file list
01 - Le vent.ogg
     5271287 100%  147.24kB/s    0:00:34 (xfer#1, to-check=0/1)

sent 5272011 bytes  received 31 bytes  87141.19 bytes/sec
total size is 5271287  speedup is 1.00
Got URL:
http://www.shlomifish.org/Files/files/music/mp3-ogg/01%20-%20Le%20vent.ogg
shlomif@telaviv1:~$
</pre>

<p>
As you can see, we just specified the file, and it divined the rsync
command and gave us the resultant URL. Convenient.
</p>
]]>
        <![CDATA[
<p>
sky requires a configuration file in <code>~/.config/Perl/App-Sky/app_sky_conf.yml</code> such as this one:
</p>

<pre>
---
default_site: homepage
sites:
    homepage:
        base_upload_cmd:
            - 'rsync'
            - '-a'
            - '-v'
            - '--progress'
            - '--inplace'
        dest_upload_prefix: 'hostgator:public_html/'
        dest_upload_url_prefix: 'http://www.shlomifish.org/'
        sections:
            code:
                basename_re: '\.(?:pl|pm|c|py)\z'
                target_dir: 'Files/files/code/'
            music:
                basename_re: '\.(?:mp3|ogg|wav|aac|m4a)\z'
                target_dir: 'Files/files/music/mp3-ogg/'
            video:
                basename_re: '\.(?:webm|flv|avi|mpeg|mpg|mp4|ogv)\z'
                target_dir: 'Files/files/video/'
</pre>

<p>
And it uses the <code>basename_re</code> to figure out where to upload it
later. The next features I would like to see added are an ability to specify
the target directory or alternatively override the target section, and naturally
- better documentation. But I'm happy with what I have so far.
</p>

<h2>CPAN Cleanups</h2>

<p>
I have been going over many of <a href="https://metacpan.org/author/SHLOMIF">my
CPAN distributions</a>
and doing various cleanups such as removing trailing whitespace (with tests
based on
<a href="https://metacpan.org/release/Test-TrailingSpace">Test-TrailingSpace</a>),
or converting the <code>Changes</code> file to be compliant with
<a href="https://metacpan.org/release/CPAN-Changes">CPAN-Changes</a>. It was
kinda fun, though time consuming.
</p>

<h2>New Version of Freecell Solver</h2>

<p>
There's a
<a href="http://fc-solve.blogspot.co.il/2013/05/freecell-solver-3180-was-released.html">new
stable version of Freecell Solver</a>, 3.18.0 released with some improvements
including a port to JavaScript.
</p>

<h2>Black Hole Solitaire Solver</h2>

<p>
I have done a lot of work on
<a href="http://www.shlomifish.org/open-source/projects/black-hole-solitaire-solver/">Black
Hole Solitaire Solver</a>, and it can now also solve All-in-a-Row-Solitaire,
and has some other improvements.
</p>

<h2>Binary Puzzle Solver</h2>

<p>
The
<a href="http://www.shlomifish.org/open-source/projects/japanese-puzzle-games/binary-puzzle/">Binary
Puzzle Solver</a> (written in Ruby) is now at version 0.0.3, with some bug
fixes, several new moves and a convenient command line application.
</p>
]]>
    </content>
</entry>

<entry>
    <title>Copied from Slashdot.org: &quot;Heroic people make any job they take awesome.&quot;</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2013/04/heroic-people-make-any-job-awesome.html" />
    <id>tag:blogs.perl.org,2013:/users/shlomi_fish//422.4569</id>

    <published>2013-04-14T19:04:24Z</published>
    <updated>2013-04-14T19:06:57Z</updated>

    <summary> First of all, I have written my recent hacktivity log over on my new dreamwidth.org blog, and I am not posting it here, because it involves a lot of non-code hacktivity, which I expect to do quite a lot...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="employment" label="employment" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacktivitylog" label="hacktivity log" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="jobs" label="jobs" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="work" label="work" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
First of all, I have written my
<a href="http://shlomif.dreamwidth.org/464.html">recent hacktivity log</a>
over on my new dreamwidth.org blog, and I am not posting it here, because
it involves a lot of non-code hacktivity, which I expect to do quite a lot
more of from now.
</p>

<p>
That put aside, I am copying here something that I wrote
<a href="http://news.slashdot.org/comments.pl?sid=3619331&amp;cid=43371075">in
a Slashdot comment</a> about why I am looking for a job not in IT. Especially
of note there are my frustrations with employers being too domineering and
control-freaks, and not letting the good developers do things the way they
most prefer to do it. Here goes:
</p>

<p>
I'll put it on the table: I have a Bachelor of Science (B.Sc. - 4 year degree)
in Electrical Engineering (more like a mixed CE/EE/CS degree) from <a
href="http://en.wikipedia.org/wiki/Technion_%E2%80%93_Israel_Institute_of_Technology"
title="wikipedia.org" rel="nofollow">The Technion in their Haifa, Israel
Campus</a> [wikipedia.org], and graduated cum laude, and I have a qualified
engineer certificate which theoretically allows me to write software for
guiding missiles (or other flaw-free software) and give my signature that it is
flaw-free. Nevertheless, right now I'm looking for part-time jobs as a
seller/vendor in icecream parlours, candy/snack stores,
caf&#233;s/restaurants/bars/etc. or even as a street sweeper. Lots of places in
Tel Aviv, Israel are now advertising for this, and this seems like a good way
to earn some money, as well as interact with other people and get inspired
which will really help me with my <a href="http://www.shlomifish.org/humour/"
title="shlomifish.org" rel="nofollow">creative writing</a> [shlomifish.org] and
my <a href="http://www.shlomifishorg/philosophy/" title="www.shlomifishorg"
rel="nofollow">essays</a> [www.shlomifishorg]. And I can buy an Android
smartphone (nothing really better now and some people have successfully
installed GNU/Linux chroots there) so I can type stuff for later incoporation
into my desktop and laptop devices.
</p>

<p>
So why not work as a software developer? I don't mind getting a job as a
software developer or a hardware developer or whatever, but lately employers in
Tel Aviv and vicinity have become extremely picky: you go to an interview,
answer most technical questions nicely, and don't get hired. Furthermore, even
if they like you they are often very domineering: don't work from home, work
10-12 hours a day, only full time, don't play computer games at all (I only
played some card Patience/Solitaire and Sokoban and not for long and still got
flack), don't go to Facebook/Twitter/Google-Plus, we don't want you accessing
imgur.com (too muchu traffic to there so let's firewall it) etc. etc. Thing is
- <a
href="http://www.avc.com/a_vc/2012/02/the-management-team-guest-post-from-joel-spolsky.html"
title="avc.com" rel="nofollow">the junior developers are kings</a> [avc.com]
(see the link for the Joel article), and you should leave them alone to their
elements to get shit done at their own pace, and using their own resources
instead of being a control freak. If, as a boss, my developer watched porn for
6 hours a day, while still being available on the forums for questions, and
spent 2 hours creating great code that is functional and beautiful, I would be
happy, and give him a full salary. But finding such enlightened employers is a
big problem.
</p>

<p>
Software was the first field where workers were in constant demand, but now it
seems that other fields are headed the same way here in Tel Aviv and other
major centres of commerce worldwide: the food outlets, the music industry,
photography, and soon - writing, acting/drama/film and then hopefully also
modelling, and then if we can get past the normal and silly legal barriers -
also more brick-and-mortar industries. Right now I've decided to make a <a
href="http://blogs.perl.org/users/shlomi_fish/2013/03/ann-my-transition-from-software-developer-to-writerentertaineramateur-philosopherinternet-celebrity.html"
title="perl.org" rel="nofollow">transition</a> [perl.org]
from a software developer to a writer/Internet-entertainer/amateur-philosopher
- a field where I feel I produce better results and also something that people
will find cooler and sexier (although like I note in the article, the fact that
I wrote a Freecell solver has impressed some really cute and intelligent
chicks), and will have a larger influence. I still see knowing programming and
other software development as an absolutely necessary means for that, just like
I can no longer survive without knowing how to read and write English. Everyone
should know at least HTML/XHTML/etc.
</p>

<p>
What I'm trying to say is that one should avoid Fatalism. People can improve
for the better. I spent six and a half year doing my Elec. Eng. degree in the
Technion and it cost me a lot of frustrations, but I'm still alive and have
constantly become a better person - more competent, more able, smarter, wiser,
and with a greater capacity for love and friendship. As long as you're not dead
and still have some health in you, you will do fine. My suggestion to someone
who got a Ph.D. in literature is to realise that that may make them a really
awesome programmer , or a bartender, or a candy store vendor, or a secretary,
or a sys admin, or anything else that they will find a job at. Don't think "I'm
too good for that" because like they say in Hollywood "There are no small roles
- only small (= small-minded) actors." You can be an awesome superheroic person
even if you're just a factory worker.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>XML-Grammar-Screenplay: Alternative Format for Hollywood Screenplays</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2013/03/screenplay-text-alternative.html" />
    <id>tag:blogs.perl.org,2013:/users/shlomi_fish//422.4465</id>

    <published>2013-03-24T04:45:09Z</published>
    <updated>2013-03-24T04:47:02Z</updated>

    <summary> A short time after I posted a message about XML-Grammar-Screenplay to a Perl forum, a Perl enthusiast sent me a message reading like that: I would think that a proper screenplay grammar would be useful (I&apos;ve thought of writing...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="hacking" label="hacking" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hollywood" label="hollywood" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="screenplays" label="screenplays" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="scripts" label="scripts" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
A short time after I posted a message about
<a href="http://www.shlomifish.org/open-source/projects/XML-Grammar/Fiction/">XML-Grammar-Screenplay</a>
to a Perl forum, a Perl enthusiast sent me a message reading like that:
</p>

<blockquote>
<p>
I would think that a proper screenplay grammar would be useful (I've thought
of writing one myself). Though I've looked through your screenplay examples, I
can't see any of them, anywhere, which is actually rendered in correct
screenplay format (<a
href="http://en.wikipedia.org/wiki/File:Screenplay_example.svg">example</a>),
nor anything which appears to directly support the special directives often
found in screenplays, such as sluglines.  Am I missing something?
</p>

<p>
(Poor) Directions for formatting a screenplay are
<a href="http://www.scriptfrenzy.org/howtoformatascreenplay">here</a>.
That really doesn't cover the *extremely* rigid formatting rules involved (a
reader can often <b>toss</b> a script with <b>bad margins</b> and get paid for it anyway).
</p>
</blockquote>

<p>
Screenplay-Text looks something like this:
</p>

<pre>
&lt;s id=&quot;humanity&quot; title=&quot;&#39;Humanity&#39; - The Movie&quot;&gt;

[Note: This screenplay was written by
&lt;a href=&quot;http://www.shlomifish.org/&quot;&gt;Shlomi Fish&lt;/a&gt;, and is original artwork.]

&lt;s id=&quot;the-well&quot; title=&quot;The Well&quot;&gt;

[ The Well is shown. Several women are standing nearby with large pots near
them. They are chatting. Three men approach. ]

Man #1: OK. Let&#39;s move it.

Man #2: You know, I heard of a guy called Moses who could move a stone like
this all by himself.

The Inventor&#39;s Voice from outside the frame: That&#39;s because he was using the
Mosesiom 3000!

Man #3: I beg your pardon?

[ The Inventor enters the frame with his invention that looks suspiciously
like a lever. ]

The Inventor: With this ingenious invention one man can move this stone
all by himself. Wanna try?

Man #1: OK. I&#39;ll try.

The Inventor: OK. First we tie the stone to the ropes here.

[ He ties the stone]

The Inventor: Now lift the other hand.

Man #1: [After lifting the stone.] Wow, it&#39;s so easy, look I can move the
stone here [moves it to the left], and here [ moves it to the right].

The Inventor: No! No! Don&#39;t misuse it.

[The stone falls down on the well, splits into two pieces which both fall down
the well. The men are amazed. ]

The Inventor: Don&#39;t worry, I can get down and tie the ropes to each stone and
we can lift it up in a flash...

Man #1: I&#39;ll get the ropes.

Man #2: I&#39;ll get the horses.

[ They leave the frame ]

The Inventor: This is not my day.

Woman #1: Who is John Galt?

&lt;/s&gt;

&lt;/s&gt;
</pre>

<hr />

<p>
Why is it important? Because it seems that with this pedantic and perfectionist
attitude, Hollywood has left its original rebellious and
<a href="http://en.wiktionary.org/wiki/insurgent">insurgent</a> roots (the
film production companies were located around Los Angeles to avoid litigation
from Edison's patent trolling machine; and Henry Ford voiced some anti-semitic
concerns about the Jewish dominance of Hollywood, which he claimed was
part of their conspiracy to take over the world), and became more strict.
How many good films did not take off because of badly formatted or malformed
screenplays?
</p>

<p>
This is why I now think that the format of
<a href="http://www.shlomifish.org/open-source/projects/XML-Grammar/Fiction/#demo-screenplay1">Screenplay-Text</a> is
better simply because it is validated to conform with it and is easier to
write (being based on scripts for drama that I read, as well as some
Internet screenplays such as
<a href="http://www.shlomifish.org/humour/by-others/hitchhiker-guide-to-star-trek-tng.html">"The Hitchhiker's Guide to Star Trek - The Next Generation"</a>).
XML-Grammar-Screenplay still has many issues like the fact that its
error messages can be unhelpful, or that it is still lacking many features,
but these should be relatively easy to resolve (possibly by a refactoring,
or partial or complete rewrites).
</p>

<p>
As I note in the
<a href="http://www.shlomifish.org/philosophy/philosophy/putting-all-cards-on-the-table-2013/#david_and_goliath">"David and Goliath" section</a> of my
<a href="http://www.shlomifish.org/philosophy/philosophy/putting-all-cards-on-the-table-2013/">"Putting all the Cards on the Table (2013)" essay</a>,
a hacker knows the rules, plays by them, but is not afraid to bend them, or
make up his own rules and that is what
<a href="http://unarmed.shlomifish.org/2396.html">action heroes</a> is all
about. So now I'm trying to promote Screenplay-Text and Screenplay-XML
as hackier alternatives to the traditional screenplays of Hollywood which
became more "professional" and "tragic hero"-like.
</p>

<p>
Naturally, "reality, to be conquered, must be obeyed", and I think we can use
a manual conversion to the more traditional Hollywood screenplays at first
as a way to challenge the status quo.
</p>

<p>
I can be reached as <tt>rindolf</tt> on <a href="http://freenode.net/">the
Freenode IRC network</a> in a private message or in several channels (
see <tt>/whois rindolf rindolf</tt>) to further discuss the vision for
Screenplay-Text and Screenplay-XML. But I think it is a noble goal, which
I would like to pursue.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>ANN: My Transition From Software Developer to Writer/Entertainer/Amateur Philosopher/Internet Celebrity</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2013/03/ann-my-transition-from-software-developer-to-writerentertaineramateur-philosopherinternet-celebrity.html" />
    <id>tag:blogs.perl.org,2013:/users/shlomi_fish//422.4407</id>

    <published>2013-03-09T15:34:16Z</published>
    <updated>2013-03-09T15:35:21Z</updated>

    <summary> I&apos;d like to make an announcement: after some serious thought, I decided that from now on, being a software developer (which I am not too bad at) will only be the means (but the absolutely necessary ones) to me...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacking" label="hacking" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="humor" label="humor" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="humour" label="humour" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="philosophy" label="philosophy" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
I'd like to make an announcement: after some serious thought, I decided that
from now on, being a software developer (which I am not too bad at) will only
be the means (but the absolutely necessary ones) to me being a writer /
entertainer / philosopher / Internet celebrity (a little bit of all those
and then some) whose main pride and passion is
<a href="http://www.shlomifish.org/">his personal web site</a>, which is full
of a lot of material, and various pages and material is constantly added to it.
</p>

<p>
Note: I am not going to "quit" from the Perl world or am going to
stop programming completely. In fact, programming in HTML, XHTML, CSS, XSLT,
Website Meta Language, Perl 5, Bash, Vim/gvim, and many other general
purpose and/or domain-specific languages, is
absolutely necessary for what I do on a daily basis. Furthermore, I have
little
patience for
laymen who do not wish to learn HTML, and just require more and more of our
(= my peers and mine's) time to be wasted in a typical
<a href="http://en.wikipedia.org/wiki/Parable_of_the_broken_window">"Parable
of the broken window"</a> fashion. I think even most of our sisters,
mothers (and yes, I'm being facetiously sexist on purpose, because a lot of
the most clueless people we can think of are male), etc. can learn some basic
programming skills and even be good at that with the right attitude. When put
in a corner, they will be forced to learn it. and that programming is becoming
more and more essential for everyone to know. Furthermore, clients who wish to
remain ignorant (and often hostile) forever should be avoided, with a clear
honest and sincere explanation telling them why and how to improve.
</p>

<p>
Anyway, as is evident from
<a href="http://www.shlomifish.org/humour/TheEnemy/">my first story</a>,
I have already made a gradual transition from being a mathematician and
a mathematical logician, to being a software developer and web developer,
so now it's another transition. It took me a lot of time to hone my skills
as a writer of stories, screenplays, aphorisms, Chuck Norris/etc. factoids,
etc. etc. so it's now much easier for me. It took me over a year to write
my first story, but now I can whip up text fairly quickly, and find it
enjoyable. Moreover, I now also have not one - but two ideas for new
stories - both of which I have not started writing.
</p>

<p>
One implication is that I decided to <b>transfer the maintenance</b> of
<a href="https://metacpan.org/release/XML-LibXML">XML::LibXML</a> to someone
else, because while I believe I proved myself of utility in maintaing
it, I find it hard to keep with its ongoing maintenance. One can easily
fork
<a href="https://bitbucket.org/shlomif/perl-xml-libxml">its bitbucket
repository</a>, or given enough motivation, one can set up a similar one
on GitHub or wherever (I recall receiving several patches with "--git" there)
so if you have the skills, time, and motivation - just do it, and I'll just
upload the archives on your behalf (and eventually ask for giving you COMAINT).
I have mentioned some ideas about what I have in mind for XML-LibXML elsewhere
and you can always ask me on IM or IRC.
</p>

<h2>"Putting all the cards on the table - 2013"</h2>

<p>
I have started to write <a href="http://unarmed.shlomifish.org/2109.html">an
essay</a> on my "Unarmed but still Dangerous" blog titled "Putting all the
Cards on the Table" - I start from the Technion, M.I.T., the film
<a href="http://en.wikipedia.org/wiki/Silver_Linings_Playbook"><i>Silver
Linings Playbook</i></a>
and <a href="http://en.wikipedia.org/wiki/Jennifer_Lawrence">its lead
actress - Ms. Jennifer Lawrence</a> (♥!) and goes on to discuss lots of other
stuff including David vs. Goliath, computer networking, the second major
battle that Chuck Norris lost, and to why we should initiate action (any
action) instead of letting things go from bad to worse on their own, and
there is much more to come. Hopefully, it will be amateur philosophy (
where amateur is someone who: 1) Loves what he does. 2) Is not professional.
3) Does not play by the same rules as professionals. - i.e: what we often
call today as "hackers") at the best I can do.
</p>

<p>
My main issue is that I felt the truly amateuristic intellectuals like me
have been speaking too much in riddles, and that even I have been lying
to myself and hiding many things from other people, and I want to offload
everything I know as of March, 2013 (and it may be very different 10 years
from now or even a year from now). And I want to do it in a truly honest,
sincere, and putting all the cards I have now on the table fashion. There is
a lot of humour in the essay, and a lot of personal analogies and references,
some sex talk, (even sexism) and personal reflections (and my typical
self-promotion), but it's still serious, honest, and sincere, and
hopefully enjoyable.
</p>

<p>
Please comment on it on the blog, where you should be able to register using
any OpenID provider, but anonymous comments, that are not spam, and where you
give a link to identify yourself can also be done (just <b>please</b> preview
the comment before sending it). I am planning on working on further publicity.
</p>

<h2>How to Achieve World Domination</h2>

<p>
A lot of people think that the proper way to achieve world domination is
to create an
<a href="http://www.joelonsoftware.com/articles/fog0000000018.html">architecture
that will solve the whole world's problems and then some</a>. We've been seeing
quite a few of them since <i>Joel on Software</i> wrote this article: Ruby,
Google Go, Node.js, Mozilla's Rust, Clojure, Scala, Perl 6, etc. Some of them
have or will mature to something truly nice, or have inspired a lot of
features in other languages, but it's hard for
plain-old-single-you to compete with them, and here is something interesting:
not too many people want them.
</p>

<p>
What do people want? Chuck Norris/etc. factoids, lolcats and other captioned
images, funny cat videos, parodies of
<i>My Little Pony: Friendship is Magic</i> (♥), photos of attractive (or even
not too attractive) men and women, screencasts of games or other programs
(including many open source programs), photos of scenery, new and improved
recipes for preparing food (and of course - tasty food itself), new, old or
renovated jokes, and some interesting tales and anecdotes from your life. And
naturally - programs that can will scratch an itch - however small.
</p>

<p>
Some people told me that my solver for Freecell and other solitaire games,
simply called
<a href="http://fc-solve.shlomifish.org/">Freecell Solver</a> is useless, but
it's not - it's just a niche program. And I received hundreds of E-mails
about it. Furthermore, given that Freecell is (or used to be) a big phenomenon
in Israel, where many boys and girls starting from 18 found themselves
playing it
on the <a href="http://en.wikipedia.org/wiki/Israel_Defense_Forces">Israeli
military</a> computers out of boredom, then the fact that I have written a
solver for it,
has impressed many people I talked with or met, including some attractive
(both physically and intellectually) young ladies (or what people may
refer to as "hot chicks"), and they ended up asking me about how it was
written, and which algorithms it employed.
</p>

<p>
So Freecell Solver was one of my most successful programs, not despite being
a niche program, but because of it. Niche programs own. Not only that,
but niche everything is great. Many people whom I referred to
<a href="http://www.shlomifish.org/humour/stories/">my stories</a> helped
themselves to the screenplay
<a href="http://www.shlomifish.org/humour/Star-Trek/We-the-Living-Dead/">Star Trek:
"We, the Living Dead"</a> <b>because</b> it contained Star Trek in the name,
and because there are quite a few fans of the <i>Star Trek</i> franchise and
worlds.
</p>

<p>
The more of a niche artwork you write, the more a large subset of those
who like it, are likely to pay attention to it, try it out, and enjoy it.
For more information, see
Eric Sink's excellent and inspiring essay
<a href="http://www.ericsink.com/articles/Buzz.html">"How to get
people talking about your product"</a>.
For example,
<a href="http://en.wikipedia.org/wiki/DuckDuckGo">DuckDuckGo</a> was originally
marketed as a search engine by Perl geeks, and for Perl geeks, and it was
a good marketing decision because the Perl community is small, cohesive and
is at a good strategical position to influence other communities. Now, many
people who are not Perl programmers, are using it, as well as, or even in
preference to Google, but choosing Perl was a good strategical decision.
We can expect that with the future growth of DuckDuckGo, that it will
use more performant technologies than Perl more and more, but it will still
owe some of its initial success to be a Perl product.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>Essay: &quot;Just write the God-damn tests, motherfucker!&quot;</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2013/02/essay-just-write-the-god-damn-tests-motherfucker.html" />
    <id>tag:blogs.perl.org,2013:/users/shlomi_fish//422.4250</id>

    <published>2013-02-03T18:02:18Z</published>
    <updated>2013-02-03T18:03:13Z</updated>

    <summary> (I originally wrote this in a post to qa@perl.org, and I apologise for the profanity in the title, but I felt it is needed in this case.) So why am I writing this? I used to feel guilty about...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="essay" label="essay" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="philosophy" label="philosophy" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tdd" label="tdd" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tests" label="tests" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
(I originally wrote this in
<a href="http://www.nntp.perl.org/group/perl.qa/2013/01/msg13350.html">a post to qa@perl.org</a>, and I apologise for the profanity in the title, but I felt
it is needed in this case.)
</p>

<p>
So why am I writing this? I used to feel guilty about not being conscious of
the distinction between the various scopes of tests, like unit tests vs.
integration tests vs. system tests vs. functional tests etc. when I wrote the
tests. I just noticed that I need a test here (as a regression test for a bug,
or to <a href="http://en.wikipedia.org/wiki/Test-driven_development">TDD</a> (=
test-driven develop a new feature, or after implementing a new feature,
etc.), and wrote it using Test::More or whatever. However, now I feel that
trying to philosophise about the distinction between all those is not so
useful for the people who are actually trying to write the tests.
</p>

<p>
<q>Tests are good, mmkay? Just freaking write them!</q>
</p>

<p>
chromatic has expressed <a href="http://modernperlbooks.com/mt/2012/04/what-testing-dsls-get-wrong.html">some sentiments</a> against the so-called "Behaviour
Driven Development" (BDD) Domain-specific-languages (DSLs) such as cucumber.
</p>

<p>
One thing that he notes in a comment there is:
</p>

<blockquote>

<p>
Our clients are the parents, guardians, and teachers of children between the
ages of eight and twelve inclusive.
</p>

<p>
The intent of Cucumber is to make readable testcases, just as the intent of
COBOL and AppleScript and visual component programming is to enable
non-programmers to create software without having to learn how to program.
</p>

</blockquote>

<p>
It is impossible to have people who are non-programmers write
structure code without learning how to program, at least until we get
sufficiently intelligent Sci-Fi-like artificial intelligence (not the current
crop of artificial ultra-stupidities) that will be able to perform
programming like humans do, and will be willing to do so, while not having
free will and still be obedient to us, and that will perform adequately. I
feel that you need to write <b>some</b> kind of code, however formatted, to
write tests, just like HTML and CSS and spreadsheet programs, involve writing
some kind of *code*.
</p>

<p>
If you want to have your clients write tests, my best suggestion is to either
instruct them in the proper methodology and discipline of coding, or
alternatively have them show you how to reproduce the problem (using
screenshots, screencasts, shared remote desktop sessions, etc.) and then
<b>you</b> should write a test for it.

<p>
Some people fear that teaching laymen how to code will create
competition for professional programmers, and dilute the profession. However,
this is not true, because there's always a difference between a casual dealer
in a craftsmanship or art, and someone who invested a substantial amount of
time doing it. E.g: lots of people can cook well, but not everyone is a
professional Chef, and Chefs still often teach other people cooking, or share
their recipes, because that does not dilute their profession.
</p>

<p>
So I think the distinction between the various tests may be useful for
methodologists and software engineering researchers (people who try to guide
other people how to code) more than the people who are actually coding. To quote
Picasso: "When art critics get together they talk about Form and Structure and
Meaning. When artists get together they talk about where you can buy cheap
turpentine."
( taken from <a href="http://orip.org/">Ori Peleg's blog</a> ).
</p>

<p>
Similarly, literature critics and researchers have very little to say that is
of use for most writers and even authors. I hated studying Literature (what
Americans might call "English" although naturally in Israel, we study Hebrew
texts) with a passion, and didn't do too well on the tests (in part because
out of personal honesty, I refused to write a lot of extraneous text, which
the teacher seemed to have preferred), only to become a writer of
<a href="http://www.shlomifish.org/humour/">fiction</a> and
<a href="http://www.shlomifish.org/philosophy/">essays</a> (see
<a href="http://www.paulgraham.com/essay.html">Paul
Graham's "The Age of the Essay"</a> for why they are not only about
literature) after graduation. Furthermore, most people I
talked with seem to have liked and appreciate the textual works I have
written (although I admit they are certainly not letter perfect), and I
could usually find some value in the criticisms of people who did not, even
if expressed very destructively, and often was able to improve my works
accordingly.
</p>

<p>
Similarly, I'm now struggling with <a href="http://www.amazon.com/xUnit-Test-Patterns-Refactoring-Code/dp/0131495054">this tome</a>
which seems like I cannot see the forest for the trees from it, while I
really enjoyed reading the much shorter and much more hands-on
<a href="http://en.wikipedia.org/wiki/Test-Driven_Development_by_Example"><i>Test Driven Development by Example</i> (by Kent Back)</a>.
</p>

<p>
The time we talk about how to write tests is often better spent writing tests
(or production code, which is, naturally, what tests are aimed to support and
are meaningless without it), so I think we should just "freaking write them".
</p>

<p>
<q>Just write the god-damn test, motherfucker!</q>
</p>

<p>
(
<b>Note:</b> the title of this essay was inspired by
the <a href="http://programming-motherfucker.com/">"Programming,
Motherfucker"</a> of Zed Shaw, which is very amusing, even if it seems
to be written in a somewhat ironic tone, and that contains the useful
<a href="http://programming-motherfucker.com/become.html">huge list of free
books for learning programming</a>.
)
</p>

<h3 id="license">Licence</h3>

<p>
As opposed to most of my previous essays, this work is Copyright by Shlomi
Fish, 2013, under the
<a rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">Creative
Commons Attribution-NonCommercial 3.0 Unported licence</a>, with a
deliberate exemption for using the text on web pages with web commercials.
For more information, see
<a href="http://www.shlomifish.org/meta/copyrights/">my interpretation of
the licence</a>.
If you wish to use it under any different licence, then
<a href="http://www.shlomifish.org/me/contact-me/">drop me a line</a>.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>Count-up to 100 CPAN Distributions: Quality *as well as* Quantity</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2013/01/count-up-to-100-cpan-distributions-quality-as-well-as-quantity.html" />
    <id>tag:blogs.perl.org,2013:/users/shlomi_fish//422.4181</id>

    <published>2013-01-07T20:53:26Z</published>
    <updated>2013-01-07T20:54:43Z</updated>

    <summary> Going over the previous count-ups to 100 CPAN distributions in this blog, I feel I have been carried away: I tried to release a lot of new distributions to the CPAN, while neglecting all the existing distributions I have,...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="100" label="100" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacktivity" label="hacktivity" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacktivitylog" label="hacktivity log" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sdlx" label="sdlx" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xml" label="xml" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
Going over the previous count-ups to 100 CPAN distributions in this
blog, I feel I have been carried away: I tried to release a lot
of new distributions to the CPAN, while neglecting all the existing
distributions I have, and not tending to their pending problems and their
lack of <b>software quality</b> in several aspects (See
<a href="http://www.shlomifish.org/philosophy/computers/high-quality-software/rev2/">an
older essay I have written about it</a>).
</p>

<p>
I was reminded of it when
working on a few new or existing distributions using
<a href="http://dzil.org/">Dist-Zilla</a>. I ran into a few places where some
of its plugins or features were underdocumented, and non-exemplified (in
the SYNOPSIS sections or wherever), which consumed many hours of my time,
sometimes made me need to read or grep the code, and made me frustrated. While
I sent the maintainers some pull requests for better documenting this (and
some of them were applied), I would have prefered for them to be
properly documented and exemplified in the first place.
</p>

<p>
While I believe most of my CPAN distributions are in better condition, there
are some aspects that are lacking, and I would like to fix them: more examples
outside the SYNOPSES, and better SYNOPSES; documenting all methods of the
super classes as well as the classes themselves for
<a href="http://metacpan.org/release/XML-LibXML">XML-LibXML</a>; adding
support for DTD introspection and the oft requested
<a href="http://code.activestate.com/lists/perl-xml/8953/">DOM elements
annotations</a> for it; more
<a href="http://cpants.cpanauthors.org/kwalitee.html">kwalitee</a>; etc. and
naturally also better publicity and advertising
(<a href="http://freecode.com/">Freecode.com</a> (formerly known
as Freshmeat.net), Reddit, blogs.perl.org, video screencasts, etc.) because
people should see how cool your code is. I'm
not sure if any of these things would be as blog worthy as new
CPAN distributions, but it will make CPAN a bit better.
</p>

<p>
(Now that I think of it, perhaps a CPAN janitors initiative, which will
submit pull requests and patches for existing distributions to improve
their quality will be a good idea.)
</p>

<p>
Anyway, I am going to split this report into sections:
</p>

<h2>XML-GrammarBase</h2>

<p>
After some work (and misunderstanding of some of the Moo / MooX
documentation, which resulted in some pull requests), I released
<a href="http://www.shlomifish.org/open-source/projects/XML-Grammar/Base/">XML-GrammarBase</a>
which aims provides roles and base classes for easily writing wrappers around
XML schema formats and XML translation languages. So far only RELAXNG and
XSLT are supported. Here is the synopsis from the docs:
</p>

<pre>
package XML::Grammar::MyGrammar::ToOtherStuff;

use MooX 'late';

use XML::GrammarBase::Role::RelaxNG;
use XML::GrammarBase::Role::XSLT;

with ('XML::GrammarBase::Role::RelaxNG');
with XSLT(output_format =&gt; 'html');
with XSLT(output_format =&gt; 'docbook');

has '+module_base' =&gt; (default =&gt; 'XML-Grammar-MyGrammar');
has '+rng_schema_basename' =&gt; (default =&gt; 'my-grammar.rng');

has '+to_html_xslt_transform_basename' =&gt; (default =&gt; 'mygrammar-xml-to-html.xslt');
has '+to_docbook_xslt_transform_basename' =&gt; (default =&gt; 'mygrammar-xml-to-docbook.xslt');

package main;

my $xslt = XML::Grammar::MyGrammar::ToOtherStuff-&gt;new(
    data_dir =&gt; "/path/to/data-dir",
);

# Throws an exception on failure.
my $as_html = $xslt-&gt;perform_xslt_translation(
    {
        output_format =&gt; 'html'
        source =&gt; {file =&gt; $input_filename, },
        output =&gt; "string",
    }
);
</pre>

<p>
perform_xslt_translation supports  myriad options and formats, and you
get it all for free.
</p>

<p>
I've also been contemplating something like
<code>App::XML::GrammarBase</code>
or <code>XML::GrammarBase::App</code> that will allow for easy registry
of such formats from the command line and for processing them.
</p>

<p>
At first, I believed that Moo was "almost-completely-unlike-Moose", but
«use MooX 'late';» makes it much more Moose-like and I enjoy it, and it is
now recommended over Any::Moose or maybe even plain Mouse. Mouse is very
fast as well and has a far smaller startup time than Moose, but it does not
interoperate very well with pure-Moose classes, which Moo does
well.
</p>

<h2>HTML-Widgets-NavMenu-ToJSON</h2>

<p>
As I was working on <a href="http://www.shlomifish.org/">my homepage</a>, I
noticed that after I placed all the sub-navigation menus inside the main
navigation menu, it increased the size of the navigation menu considerably,
having it consume over 40,000 bytes. I decided to put only a subset of it
as HTML, and load and populate the rest using an AJAX call to a common
and static .json file. So I needed a way to convert the input of
<a href="https://metacpan.org/release/HTML-Widgets-NavMenu">HTML-Widgets-NavMenu</a>
</p>

<p>
So enter
<a href="https://metacpan.org/module/HTML::Widgets::NavMenu::ToJSON">HTML::Widgets::NavMenu::ToJSON</a>,
which serialises a navigation menu structure as JSON. I also implemented a
persistence layer for it, currently with only one backend - a YAML file,
so the IDs which jqTree require would be, well, persisted. This is a bit of
an <a href="http://www.joelonsoftware.com/articles/fog0000000018.html">architecture
astronautics</a>, but I ended up with something concrete at the end so it's
under control.
</p>

<p>
Here is the synopsis:
</p>

<pre>
use HTML::Widgets::NavMenu::ToJSON;
use HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML;

my $persistence =
    HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML-&gt;new(
        {
            filename =&gt; &#39;/path/to/persistence_data.yaml&#39;,
        }
    );

my $obj = HTML::Widgets::NavMenu::ToJSON-&gt;new(
    {
        data_persistence_store =&gt; $persistence,
        # The one given as input to HTML::Widgets::NavMenu
        tree_contents =&gt; $tree_contents,
    }
);

use IO::All;

io-&gt;file(&#39;output.json&#39;)-&gt;println(
    $obj-&gt;output_as_json(
        {
            %args
        }
    )
);
</pre>

<p>
It could be made a bit simpler using an abstraction, but I feel it's not
too bad. You can write custom
<a href="http://metacpan.org/module/HTML::Widgets::NavMenu::ToJSON::Data_Persistence">HTML::Widgets::NavMenu::ToJSON::Data_Persistence</a>
child classes by implementing the <code>load()</code>
and <code>save()</code> methods - I did not document the process yet,
but you can base your efforts on
<a href="http://metacpan.org/module/HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML">HTML::Widgets::NavMenu::ToJSON::Data_Persistence::YAML</a>.
</p>

<h2>Dist-Zilla-Plugin-TestRun</h2>

<p>
Since I'm used to running <kbd>./Build runtest</kbd> instead of
<kbd>./Build test</kbd> for my distributions, I sought a way of doing the
same using Dist-Zilla. It turned out there wasn't an easy way, and
<a href="http://metacpan.org/release/Dist-Zilla-Plugin-TestRun">Dist-Zilla-Plugin-TestRun</a>
is the best I could do. I hope to write a patch to make the <kbd>test</kbd>
command more configurable.
</p>

<h2>Test-XML-Ordered</h2>

<p>
<a href="http://metacpan.org/module/Test::XML::Ordered">Test::XML::Ordered</a>
makes a non-"semantic" diff of XML files and tells you if they are
equivalent (up to differences of whitespace and namespace prefixes). It grew
out of my frustration with
<a href="http://metacpan.org/module/XML::SemanticDiff">XML::SemanticDiff</a>,
upon which Test::XML is based, and which I maintain. A quick CPAN search
revealed other modules for testing XML in a similar manner, but since I have
already written my code, I decided to release it.
</p>

<p>
One tip is that with the current API, one should use something like:
</p>

<pre>
my @common = (validation =&gt; 0, load_ext_dtd =&gt; 0, no_network =&gt; 1);

is_xml_ordered (
    [ string =&gt; normalize_xml($results_buffer), @common, ],
    [ location =&gt; "./t/data/xhtml-results/$fn_base.xhtml", @common, ],
    "Testing for Good XSLTing of '$fn_base'",
);
</pre>

<p>
In order to test XHTML documents for equivalency.
</p>

<h2>Vered-XML</h2>

<p>
I thought that Vered-XML (currently only available in the
<a href="http://bitbucket.org/shlomif/perl-begin">Perl Beginners' Site's
repository</a> was probably the most ad-hoc and tailored to match
XML grammar I have ever created, and was used to convert the markup of
<a href="http://perl-begin.org/tutorials/bad-elements/">the "Perl Elements
to Avoid" page</a> from hacky Website META Language markup to XML, so it
will be easier to translate to different (human) languages and also somewhat
easier to maintain and render. Currently it renders to DocBook/XML, which
allows translation to many other formats.
</p>

<p>
So why did I call it Vered? Since it was so ad-hoc, and I didn't know what
else it would be useful for, I wanted to give it an artsy name, and considered
using a random Hebrew feminine name. Then I thought that "a rose by any other
name would smell as sweer", and thought of calling it Rose, but translated
to Hebrew it was "Vered", which is also a Hebrew feminine name. I still have
to tie up some loose ends, but expect XML-Grammar-Vered at a CPAN mirror
near you Real Soon Now™.
</p>

<p>
Vered-XML supports a subset of XHTML, as well as some specialised tags such
as <code>&lt;pdoc /&gt;</code> (perldoc),
<code>&lt;pdoc_f /&gt;</code> (perldoc -f),
<code>&lt;cpan_self_mod /&gt;</code> (CPAN self link to module), etc. and
contains a RELAX NG schema and an xsltproc/libxslt2-compatible
XSLT 1.0 stylesheet. Here is an excerpt from
<a href="http://bitbucket.org/shlomif/perl-begin/src/d183a648b865a223c353b16664e05b6046bd478d/src/tutorials/bad-elements/perl-elements-to-avoid.xml-grammar-vered.xml?at=default">the "Perl Elements to Avoid" source XML</a>:
</p>

<pre>
&lt;item xml:id=&quot;slurp&quot;&gt;
&lt;info&gt;
&lt;title&gt;Slurping a file (i.e: Reading it all into memory)&lt;/title&gt;
&lt;/info&gt;
&lt;p&gt;
One can see several bad ways to read a file into memory in Perl. Among them
are:
&lt;/p&gt;
&lt;code_blk syntax=&quot;perl&quot;&gt;
# Not portable and suffers from possible
# shell code injection.
my $contents = `cat $filename`;
# Wasteful of CPU and memory:
my $contents = join(&quot;&quot;, &amp;lt;$fh&amp;gt;);
# Even more so:
my $contents = &#39;&#39;;
while (my $line = &amp;lt;$fh&amp;gt;)
{
    $contents .= $line;
}
&lt;/code_blk&gt;
&lt;p&gt;
You should avoid them all. Instead the proper way to read an entire file
into a long string is to either use CPAN distributions for that such as
&lt;cpan_self_dist d=&quot;File-Slurp&quot; /&gt; or
&lt;cpan_self_dist d=&quot;IO-All&quot; /&gt;, or alternatively
write down the following function and use it:
&lt;/p&gt;
&lt;code_blk syntax=&quot;perl&quot;&gt;
sub _slurp
{
    my $filename = shift;
    open my $in, &#39;&amp;lt;&#39;, $filename
        or die &quot;Cannot open &#39;$filename&#39; for slurping - $!&quot;;
    local $/;
    my $contents = &amp;lt;$in&amp;gt;;
    close($in);
    return $contents;
}
&lt;/code_blk&gt;
&lt;/item&gt;
</pre>

<p>
I'm not sure if Vered-XML will have much utility outside that use case, but
I think that putting it on CPAN won't hurt much.
</p>

<h2>Improving perlresume.org</h2>

<p>
I filed a few issues and sent some pull requests for
<a href="http://perlresume.org/">perlresume.org</a> for some problems
I ran into, and <a href="http://showmetheco.de/">vti</a> fixed or
applied them promptly. Thanks!
</p>

<h2>Beginners' Sites</h2>

<p>
I invested more work into <a href="http://perl-begin.org/">the Perl Beginners'
site</a>
and also, after some encouragement from the good people on
<a href="irc://irc.freenode.net/#vim">#vim</a> began work on
<a href="http://vim.begin-site.org/">the Vim Beginners's site</a>, which
I publicised on <a href="http://shlomif-tech.livejournal.com/65619.html">my
tech blog</a>,
on <a href="http://www.reddit.com/r/vim/comments/15o6v1/announcing_the_vim_beginners_site/">Reddit</a>,
and on some mailing lists. While in the past I used my own
<a href="http://web-cpan.shlomifish.org/latemp/">static site
generator called "Latemp"</a> based on Website Meta Language for sites
like that,
I used Jekyll this time, at least for the first prototype. I did so
in order to evaluate it for use in a different site
(<a href="http://www.linux.org.il/">The
Israeli Linux Portal</a> which is currently implemented using an awkward
custom PHP-based system, that mostly just reads stuff out of XML data
files and outputs a constant static HTML as XSLT.). While at first I was
impressed with Jekyll,
I then realised that it was quite opaque, often required many plugins to
get some basic functionality and that one plugin I looked at lacked examples
and was otherwise under documented.
</p>

<p>
There is <a href="http://iwantmyname.com/blog/2011/02/list-static-website-generators.html">a
list of many more static site generators / offline content-management
systems</a> around (which does not include my own Latemp), and it may be
easier to roll up something on my own based on Template Toolkit or its ttree.
All this just confirms my
(and <a href="http://blogs.perl.org/users/su-shee/">Su-Shee</a>'s) suspicion
that every self-respecting web programmer has written at least one.
</p>

<h2>Freecell Solver for JavaScript - ☺</h2>

<p>
I have been distracted for many hours trying to port Freecell Solver
to JavaScript using the very cool
<a href="https://github.com/kripken/emscripten">Emscripten</a> LLVM bitcode
to JavaScript compiler.
The <a href="http://fc-solve.shlomifish.org/js-fc-solve/text/">mostly
final result</a> could still use some work, and is still under optimised (in
large part due to what appear to be an Emscripten bug) but it's working.
</p>

<p>
The <a href="https://github.com/kripken/emscripten/wiki">Emscripten
wiki</a> contains links to many, much more impressive, demos including
<a href="http://kripken.github.com/meandmyshadow.web/mams.html">a
JavaScript version of the open-source graphical game "Me and My Shadow"</a>.
</p>

<h2>Two Anecdotes from ##programming</h2>

<p>
I enjoy chatting on
<a href="irc://irc.freenode.org/##programming">##programming (on Freenode)</a>
and along with all the rants about how much every popular programming langauge
in existence sucks, and trying to help various students with their often
badly indented and badly formatted homework code, there are often some
insightful discussions by some smart people. I'd like to share two Perl-related
anecdotes from there.
</p>

<p>
The first one was that someone there who has taken studying programming, before
starting to study in university, seriously, and also read the Camel book
and other books and resources about Perl, asked me to look at my code
to see how readable it is. I referred him to the
<a href="https://metacpan.org/source/SHLOMIF/HTML-Widgets-NavMenu-1.0701/lib/HTML/Widgets/NavMenu.pm">source
code</a> of HTML::Widgets::NavMenu, which will being an early code of
mine (and still not fully modernised), was written in a modular manner, and he
said he found it to be well-factored and yet very readable . He noted that he
suspected that Perl would be less believed to "hard to understand" or
"unreadable", if it sandardised on using my preferred style -
<a href="http://en.wikipedia.org/wiki/Indent_style#Allman_style">Allman
style</a> - instead of its default style with the opening braces on the
same line as the opening clause (e.g: <tt>if ( COND ) {</tt>).
</p>

<p>
The other anecdote was that someone else there, who is working in Visual
Basic and Visual Basic for Applications for a living (for lack of good
alternative for software development job prospects in his homeland), told us
that he found the CPAN documentation to usually be superior than the MSDN
(Microsoft Developers Network) one.
I found it a little strange, because I recall finding the MSDN documentation
to give detailed examples for almost every subroutine and a page of prose and
explanation for each one, and reportedly large parts of it were also
translated into some non-English languages by Microsoft. Then I showed him
the "SYNOPSIS" sections of some of the .pm files in CPAN and he was
even more impressed and said it was useful (because you can copy+paste it and
tweak it), but naturally commented that not all .pm files had those.
</p>

<h2>Conclusion</h2>

<p>
I currently stand at <a href="http://perlresume.org/SHLOMIF">87 CPAN
distributions</a>, some of which a bit lacking, and I still have some in the
pipe. One of them will require quite a lot of cleanup work to do, but it's
not a high priority. I also have to juggle some other endeavours, and also
recently started contracting for an Internet friend as a Drupal developer
(and in the future possibly one for Moodle as well), which may consume even
more of my time (but on the bright side pay a little money). It's no secret
that I am not a big fan of PHP, but Drupal seems impressive so far, and
hides away a lot of PHP's ugliness. It took me some time to get acquainted
with it, so I hope now things will be smoother and easier to do. It seems that
there's quite a bit of demand for converting sites into Drupal, setting up new
sites, or maintaining them in Israel (and possibly elsewhere as well) so it
is probably a useful skill to have under my belt.
</p>

<p>
Hope you enjoyed this hacktivity log, and see you next time. Byeeeee!
</p>
]]>
        
    </content>
</entry>

<entry>
    <title>Count-up to 100 CPAN Distributions: Test-XML-Ordered, SDLx-Betweener, and more</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/12/count-up-to-100-cpan-distributions-test-xml-ordered-sdlx-betweener-and-more.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.4107</id>

    <published>2012-12-06T17:49:23Z</published>
    <updated>2012-12-06T17:57:51Z</updated>

    <summary> Well, it&apos;s no longer a secret that I&apos;m craving to join the &quot;100 CPAN Distributions Club&quot; by releasing some code that is hopefully not too useless. Here I would like to blog about the two new additions to my...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="100" label="100" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacktivity" label="hacktivity" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="hacktivitylog" label="hacktivity log" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sdlx" label="sdlx" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="xml" label="xml" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
Well, it's no longer a secret that I'm craving to join the "100 CPAN
Distributions Club" by releasing some code that is hopefully not too useless.
Here I would like to blog about the two new additions to
<a href="http://metacpan.org/author/SHLOMIF">my CPAN page</a> which are
the 83rd and 84th distributions respectively. The story is a bit more
complicated than that.
</p>

<p>
The first upload is
<a href="https://metacpan.org/release/SDLx-Betweener">SDLx-Betweener</a>,
which allows for creating high-performance and smooth animations in SDL
by making use of Perl/XS. Almost all of the coding (and a related
YAPC::Israel talk) was done by
<a href="http://metacpan.org/author/EILARA">Ran Eilam</a>, who is a very
cool guy, a good friend and a former boss of mine, and I've just done
(with his permission) some last-minute cleanups and did the initial upload
to CPAN. So I kinda feel like the frog that sat on top of the elephant
who crossed the river and said "We did it!".
</p>

<p>
However, I needed SDLx::Betweener
for something I've been intending to work on, and wanted it on CPAN
and packaged in Mageia Linux, so I did that. If you run into any problems
with it, drop me a note or file a bug report, and hopefully I can resolve
these problems (possibly with some help from Ran).
</p>

<p>
The next distribution is original, but its story is more complicated.
It all started when I decided to resume work on Qantor, which aims
to eventually be a modern and saner alternative to TeX/LaTeX and Troff
(although it is still extremely far from that now). I noticed that the parsing
was still done by Regexp::Grammars, and so decided to convert it into
<a href="https://metacpan.org/module/Parser::MGC">Parser::MGC</a>.
Parser::MGC worked eventually and I was impressed from the straightforward
way to do stuff with it, but it was time consuming to get there (like most
other parser generators I tried, only a bit better), and involved writing
some Moose 'around' code to debug the method calls, and also sometimes delving
into the code. Parser::MGC is still not perfect (and some of the code I read
there had gems like
<tt>die $e if $committed or
not eval { $e-&gt;isa( "Parser::MGC::Failure" ) };</tt> which I found hard
to parse, and made me want to drown a kitten), but I think it sucks less
and is more transparent than other parser generators I tried.
</p>

<p>
Anyway, after I got it working, I noticed that the Test::XML::Ordered code
(then still unreleased), generated a some memory problems and I suspected
either XML::LibXML or libxml2 to be the culprit. This involved a long
investigation process with valgrind, gdb, <tt>perl -d</tt> and other tools
which culminated in a very small change and more lines of test code. This
was released in XML::LibXML. After that I received a report that the tests
got stuck, but that turned out to be due to external loading of DTDs and
was easily fixed. There's another
<a href="https://rt.cpan.org/Ticket/Display.html?id=81739">report</a> for
a problem with perl-5.8.8 (ouch!) on Red Hat Enterprise Linux (ouch again!),
but I'm not too motivated to do a lot about it (see
<a href="http://www.shlomifish.org/humour/fortunes/show.cgi?id=hamakor-discs-mozilla-1.1-1">this fortune cookie</a>).
</p>

<p>
Well, after I fixed the problem with XML::LibXML, I decided to release
Test::XML::Ordered. I'm well aware of
<a href="https://metacpan.org/module/Test::XML">Test::XML</a>, but found
it hard to rely on it, because it uses
<a href="https://metacpan.org/module/XML::SemanticDiff">XML::SemanticDiff</a>
(the latter I adopted) and which attempts to rearrange the order of the
nodes when it sees fit (so
<tt>&lt;ul&gt;&lt;li&gt;One&lt;/li&gt;&lt;li&gt;Two&lt;/li&gt;&lt;/ul&gt;</tt>
and
<tt>&lt;ul&gt;&lt;li&gt;Two&lt;/li&gt;&lt;li&gt;One&lt;/li&gt;&lt;/ul&gt;</tt>
may be considered the same), which was not what I want and not what other
people who contacted me about XML::SemanticDiff wanted.
</p>

<p>
After Test::XML::Ordered, I decided it would be a good idea to finally
work on the release of <tt>XML::GrammarBase</tt> which aims to provide
"base classes and roles" for facilitating creating XML validators
and processors. Work on it was pretty straightforward after I had
Test::XML::Ordered available, but required some refactoring the classes
from using <tt>Any::Moose</tt> to using <tt>Moo</tt> per advice of the
people on <tt>#moose</tt>, and I have yet to convert the XSLT role into
a parameterised role.
</p>

<p>
I have some other code I'd like to release on CPAN after all that.
</p>
<hr />

<p>
Another related hacktivity was a set of patches to the core Vim that I've
written to improve support for DocBook 5. Since I wanted to maintain
compatibility with DocBook 4 documents (because DocBook 4 is still popular),
this involved writing a Perl, Bash and Python Amalgam to generate the
Vim code in question with a list of common, DocBook 4-only and DocBook 5-only
tags. You can find it in
<a href="http://bitbucket.org/shlomif/vim-docbook-5-support">its BitBucket
repository</a>. It is very hacky, but it works. Using the Python code
gave me an idea for a missing XML::LibXML feature - DTD introspection - which
I'd like to implement in the future.
</p>

<p>
Well, that's all for now - just wanted to get it out of my system. Enjoy the
holidays, and Cheers!
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>Three Command-Line Utilities</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/11/three-command-line-utilities.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.4046</id>

    <published>2012-11-14T13:30:40Z</published>
    <updated>2012-11-14T13:41:02Z</updated>

    <summary> So, November is NaNoWriMo (&quot;National Novel Writing Month&quot;), and I was hoping to get some serious writing done (instead of coding), but I kept being distracted with coding and random writing in various Internet forums. Well, hopefully this blog...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="bash" label="bash" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cli" label="cli" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="command" label="command" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gnu" label="gnu" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="line" label="line" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="parallel" label="parallel" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="sleep" label="sleep" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
So, November is
<a href="http://en.wikipedia.org/wiki/National_Novel_Writing_Month">NaNoWriMo</a> ("National Novel Writing Month"), and I was hoping to get some serious
writing done (instead of coding), but I kept being distracted with coding
and random writing in various Internet forums. Well, hopefully this blog
post will compensate a little for that.
</p>

<p>
In this post, I'd like to cover three command-line utilities - two of them
new and were written by me, and one of them somewhat older, but also written
in Perl.
</p>

<p>
The first utility is
<a href="http://en.wikipedia.org/wiki/GNU_parallel">GNU Parallel</a>, which
allows one to run several command-line jobs in parallel, using forking and/or
ssh remote logins. I used it to speed up some processing I've been doing on
my computer. For more information and some examples of usage, see
<a href="http://zgp.org/pipermail/linux-elitists/2012-November/013428.html">my
post about it to the linux-elitists mailing list</a>, and also read
<a href="http://zgp.org/pipermail/linux-elitists/2012-November/013429.html">Thomas
Sattler's response</a> which provides some further insights.
</p>

<p>
The second utility is
<a href="http://www.shlomifish.org/open-source/projects/countdown/">countdown</a>, which is
similar to the UNIX command-line sleep command, but displays the remaining
time on the console. I wrote a prototype for it in Perl 6, only to discover it
consumed far too many resources. The second prototype, as a Perl 5 program
consumed close to zero resources of my computer. Yesterday, I converted it to
a modulino (a Perl application implemented as a module) and uploaded
several versions to the CPAN.
</p>

<p>
The third utility is something I have placed in my
<tt>~/.bashrc</tt> file in order to implement reminders when the shell
starts. The code for it is:
</p>

<pre>
reminder_file="$HOME/.local/share/shlomif/reminder/reminder.txt"
if [ -s "$reminder_file" ] ; then
    perl -Mstrict -Mwarnings -MTerm::ANSIColor -E 'my $x = colored("===", "bold red"); say "$x Reminders $x"'
    cat "$reminder_file"
fi

Cancel_reminder()
{
    rm "$reminder_file"
}
</pre>

<p>
I wrote it because I wasn't prompted in time by Thunderbird+Lightning
due to a strange bug, and because I had to ditch KOrganizer because it
consumed too many resources here. This displays the Reminders whenever you
start a new shell, which happens quite often with me, so it's OK. I use
cron jobs to append stuff into "$reminder_file", and the Perl code displays
a header in colour.
</p>

<p>
That's it for today.
<a href="https://metacpan.org/release/App-Countdown">App-Countdown</a> is one
step closer for the count-up (pun intended) towards the coveted 100
distributions under "SHLOMIF" on CPAN, so that's another plus.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>Please Publish Perl Events on the LWN.net Calendar</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/10/please-publish-perl-events-on-the-lwnnet-calendar.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.3967</id>

    <published>2012-10-18T11:07:00Z</published>
    <updated>2012-10-18T11:28:47Z</updated>

    <summary> As I read last week&apos;s LWN.net&apos;s Announcement Page (LWN.net is a news site for open-source-related news, formerly standing for &quot;Linux Weekly News&quot;), I noticed that there were few if any Perl events featured in its upcoming events calendar. However,...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="conferences" label="conferences" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="events" label="events" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="lwn" label="lwn" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="lwnnet" label="lwn.net" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="yapc" label="yapc" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
As I read last week's
<a href="http://lwn.net/Articles/518564/">LWN.net's Announcement Page</a>
(LWN.net is a news site for open-source-related news, formerly standing
for "Linux Weekly News"),
I noticed that there were few if any Perl events featured in its upcoming
events calendar. However, these events appear in
<a href="http://perlweekly.com/">the Perl Weekly</a>, and there are many
upcoming Python events featured in LWN.net.
</p>

<p>
So, please, if you are organising a Perl-related event (or any other major
open-source event), make sure you put it on
<a href="http://lwn.net/Calendar/">the LWN.net calendar</a>.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>Tech Tip: Overriding the C compiler with ExtUtils::MakeMaker</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/09/tech-tip-overriding-the-c-compiler-with-extutilsmakemaker.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.3804</id>

    <published>2012-09-09T12:34:44Z</published>
    <updated>2012-09-09T12:35:53Z</updated>

    <summary> In order to override the C compiler with ExtUtils::MakeMaker, one can do something like: perl Makefile.PL CC=/usr/bin/clang Which will make the &quot;CC&quot; variable in the generated makefile be set to /usr/bin/clang instead of the default. Apparently, setting the CC...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="clang" label="clang" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="compiler" label="compiler" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="eumm" label="eumm" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="gcc" label="gcc" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tech" label="tech" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="techtip" label="tech tip" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tip" label="tip" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
In order to override the C compiler with ExtUtils::MakeMaker, one can
do something like:
</p>

<pre>
perl Makefile.PL CC=/usr/bin/clang
</pre>

<p>
Which will make the "CC" variable in the generated makefile be set to
<tt>/usr/bin/clang</tt> instead of the default. Apparently, setting the
<tt>CC</tt> environment variable does not work like it does with CMake.
</p>

<p>
Thanks to <a href="http://www.mail-archive.com/makemaker@perl.org/msg03060.html">Sisyphus for the tip</a>.
</p>
]]>
        
    </content>
</entry>

<entry>
    <title>Grant for Improving the Perl Debugger + New CPAN Distributions</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/09/grant-for-improving-the-perl-debugger-new-cpan-distributions.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.3776</id>

    <published>2012-09-01T16:20:55Z</published>
    <updated>2012-09-01T16:22:00Z</updated>

    <summary> First of all, I am glad to announce that the Perl Foundation grant committee has accepted my grant proposal for adding tests and refactoring the built-in perl debugger. Here is the announcement for which grant proposals were accepted. My...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="debugger" label="debugger" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="foundation" label="foundation" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="grant" label="grant" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="ruby" label="ruby" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tpf" label="tpf" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
First of all, I am glad to announce that the Perl Foundation grant
committee has accepted my
<a href="http://news.perlfoundation.org/2012/08/2012q3-grant-proposal-adding-t.html">grant
proposal for adding tests and refactoring the built-in perl debugger</a>.
Here is <a href="http://news.perlfoundation.org/2012/08/2012q3-grant-proposals---resul.html">the announcement</a> for which grant proposals were
accepted. My grant manager for this grant is
<a href="http://alanhaggai.org/">Alan Haggai Alavi</a>, whom I've been
talking with online and have collaborated on a few projects, so I'm really
happy to work with him again.
</p>

<p>
I have already made some progress with the grant (and this post is part
of it), and sent a log for Alan Haggai to post as a grant update.
</p>

<p>
That put aside, I'd now like to publicise some of the new distributions
I have uploaded to CPAN, as I had some ideas for new ones, and am also
contemplating making enough uploads to have 100 CPAN distributions or more:
</p>

<ol>

<li>
<p>
<a href="https://metacpan.org/release/WWW-LinkChecker-Internal">WWW-LinkChecker-Internal</a>
is a distribution wrapping a script that checks for internal broken links. I
released the first three versions of it in a day, and it uses WWW::Mechanize.
The reason why I wrote it was that the WDG HTML validator reported some broken
links in one of my sites, but not their origins, so I had to trace them in
a different way, and ended up writing that.
</p>
</li>

<li>
<p>
<a href="https://metacpan.org/release/Inline-Ruby">Inline-Ruby</a> is
an Inline:: distribution I adopted that allows to embed Ruby code inside
Perl programs. I applied some fixes for it (some of which were not released
to CPAN yet and some are ugly workarounds), and am planning to maintain it
further down the road.
</p>
</li>

<li>
<p>
<a href="https://metacpan.org/release/Test-TrailingSpace">Test-TrailingSpace</a>
is a <tt>Test::</tt> namespace distribution for verifying that your code
does not contain trailing space. Death to trailing space!
</p>
</li>

</ol>

<p>
A final anecdote is that when working on one of my CPAN modules I found the
<tt>b [filename]:[line_num]</tt> feature that I implemented in the perl
debugger to be of great help, and can be content that I'm eating my own
dogfood.
</p>

<p>
Cheers for now.
</p>
]]>
        
    </content>
</entry>

<entry>
    <title>Tech Tip: How to Package and Maintain CPAN Distributions in Mageia</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/08/tech-tip-how-to-package-and-maintain-cpan-distributions-in-mageia.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.3697</id>

    <published>2012-08-16T19:17:06Z</published>
    <updated>2012-08-16T19:18:10Z</updated>

    <summary> Mageia Linux is an RPM-based Linux distribution, whose repositories contain over 3,000 CPAN packages, and part of the reason why it has so many is because Jerome Quelin and the other maintainers have worked on tools to facilitate creating...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="linux" label="linux" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="mageia" label="mageia" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tech" label="tech" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="techtip" label="tech tip" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="tip" label="tip" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
<a href="http://www.mageia.org/">Mageia Linux</a> is an RPM-based
Linux distribution, whose repositories contain
<a href="http://jquelin.blogspot.co.il/2012/07/more-than-3000-perl-packages-in-mageia.html">over
3,000 CPAN packages</a>, and part of the reason why it has so many is
because Jerome Quelin and the other maintainers have worked on tools to
facilitate creating Mageia packages for CPAN distributions and maintaining
them.
</p>

<p>
However, I was a little confused about using
<a href="https://metacpan.org/release/App-Magpie">magpie</a>, so I'd like
to share my findings here:
</p>

<ol>

<li>
<p>
In order to import, upload and submit a new CPAN package into Mageia,
along with all of its dependencies, one should not use magpie, but rather
<a href="https://metacpan.org/release/App-CPAN2Pkg">cpan2pkg</a>. Its use
is very simple: make <tt>rpm</tt> and <tt>urpmi</tt> sudoable, and type
<tt>cpan2pkg Package::Name</tt> from the command-line inside an X terminal.
This will start a Tk window where one can monitor the progress of preparing
new RPM packages and it has an entry box to create more packages (which
saves time on re-initialising CPAN.pm or CPANPLUS.pm).
</p>
</li>

<li>
<p>
In order to upgrade a package, one can type
<tt>eval $( magpie co -s perl-[PACKAGE_NAME] )</tt> and then
<tt>magpie update</tt>. magpie requires <a href="https://metacpan.org/release/CPAN-Mini">minicpan</a> to be installed and updated.
</p>
</li>

<li>
<p>
In order to install packages, one can do
<tt>sudo urpmi 'perl(Package::Name)'</tt>. My
<a href="https://metacpan.org/release/Module-Format">Module-Format module</a>
facilitates the translation from other notations for writing modules:
</p>

<pre>
up()
{
    sudo urpmi --auto $(perlmf as_rpm_colon "$@")
}
</pre>
</li>
</ol>

]]>
        
    </content>
</entry>

<entry>
    <title>Announcement: the App-Notifier CPAN Distributions</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/07/announcement-the-app-notifier-cpan-distributions.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.3595</id>

    <published>2012-07-22T11:17:48Z</published>
    <updated>2012-07-22T11:18:42Z</updated>

    <summary> I would like to announce two new CPAN distributions of mine: App-Notifier-Service and App-Notifier-Client. These are derived from a few simplistic scripts I&apos;ve written in shell and Perl, to allow me to notify when a task has finished (e.g:...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="cpan" label="cpan" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="dancer" label="dancer" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
I would like to announce two new CPAN distributions of mine:
<a href="https://metacpan.org/release/App-Notifier-Service">App-Notifier-Service</a>
and
<a href="https://metacpan.org/release/App-Notifier-Client">App-Notifier-Client</a>.
These are derived from a few simplistic scripts I've written in shell and
Perl, to allow me to notify when a task has finished (e.g:
<tt>make ; finish-client</tt>) or a certain time has elapsed (e.g:
<tt>sleep 240 ; finish-client</tt>), and I decided to create something
more serious as CPAN modules.
</p>

<p>
App-Notifier-Service implements an HTTP service (using Dancer), which
listens for requests, and once one arrives, implements a callback, which
notifies the user on the localhost that the event occured. App-Notifier-Client
complements it by implementing a client that connects to the service
and sends the event.
</p>

<p>
Currently documentation may be lacking, and there are almost no automated
tests in the distributions, but it appears to work nicely. To get started,
read the documentation and you may wish to peruse some of these files
from my home directory. First of all, the <tt>.app_notifier.yml</tt> file:
</p>

<pre>
commands:
    default:
        - /home/shlomif/bin/desktop-finish-cue
    cookie:
        - /home/shlomif/bin/desktop-finish-cue
        - "--song"
        - "/home/music/Music/dosd-mp3s/Cookie.mp3"
client:
    targets:
        default:
            url: "http://localhost:6300/"
        lap:
            url: "http://lap.shlomifish.org:6300/"

</pre>

<p>
The <tt>desktop-finish-cue</tt> file:
</p>

<pre>
#!/bin/bash

song="/home/music/Music/dosd-mp3s/Theme - Eurovision.mp2"

param="$1"
shift
if test "$param" = "--song"; then
    arg="$1"
    shift
    song="$arg"
fi

xmessage "Your task has been finished! Go check it out." &amp;
mplayer "$song"
</pre>

<p>
And the <tt>finish-server</tt> script:
</p>

<pre>
#!/bin/bash
cd "$HOME"/progs/perl/alert/http-based/hg/App-Notifier-Service &amp;&amp;
    perl ./bin/app.pl --port=6300
</pre>

<hr />

<p>
Otherwise, if you're in the Tel Aviv or vicinity, you are invited to
<a href="http://mail.perl.org.il/pipermail/perl/2012-July/012671.html">the
next Tel Aviv Perl Mongers meeting on Wednesday, 25 July 2012</a>. Otherwise,
I wish to note that I have written my first Java golf program as part
of <a href="http://golf.shinh.org/p.rb?Alphabet+texture+">Anarchy golf's
"Alphabet Texture" challenge</a> (Anarchy golf accepts challenges in many
languages). At 167 bytes, it is over 3 times longer than the shortest Perl
entry which is only 50 bytes (my Perl solution is 52 bytes). But it
was fun to write. For your information,
<a href="http://en.wikipedia.org/wiki/Code_golf">code golf</a> is a challenge
in which, participating programmers are challenged to write the shortest
program that achieves a certain objective. I find it fun and addictive.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>What&apos;s new on the Perl Beginners&apos; Site</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/07/whats-new-on-the-perl-beginnerss-site.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.3509</id>

    <published>2012-07-09T16:39:47Z</published>
    <updated>2012-07-09T16:45:14Z</updated>

    <summary> The last update on the news feed for The Perl Beginners&apos;s site was almost a year ago. While the site continued to improve, I neglected writing a new entry until now, so I hope this one will compensate for...</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="begin" label="begin" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="beginners" label="beginners" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="learn" label="learn" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perlbegin" label="perl-begin" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[
<p>
The last update on the news feed for
<a href="http://perl-begin.org/">The Perl Beginners's site</a> was almost a
year ago. While the site continued to improve, I neglected writing a new
entry until now, so I hope this one will compensate for that.
</p>

<p>
So without further ado, here is what is new:
</p>

<ol>

<li>
<p>
We now have a page about <a href="http://perl-begin.org/humour/">Perl
Humour</a>, which was restored from a page in the now offline perl.net.au
wiki.
</p>
</li>

<li>
<p>
Also originally from that wiki is the <a
href="http://perl-begin.org/FAQs/freenode-perl/">Freenode's #perl channel
Frequently Asked Questions (FAQ) List</a>, which is well worth a read.
</p>
</li>

<li>
<p>
Another restored page is
<a href="http://perl-begin.org/topics/cpan/wrappers-for-distributions/">the
list of CPAN Wrappers for Distributions</a>.
</p>
</li>

<li>
<p>
We added <a href="http://perl-begin.org/uses/web-automation/">a page</a>
about web automation in Perl, and <a
href="http://perl-begin.org/topics/files-and-directories/">one about
manipulating files and directories</a>.
</p>
</li>

<li>
<p>
The
<a href="http://perl-begin.org/platforms/windows/">Perl on Windows page</a>
was enhanced with new links to Strawberry Perl and DWIM Perl.
</p>
</li>


<li>
<p>
We have a new page about
<a href="http://perl-begin.org/training/">Perl Training Providers</a>, which
currently only contains a link to <a href="http://perltraining.org/">the Perl
Training Directory</a>.
</p>
</li>

<li>
<p>
<a href="http://perl-begin.org/tutorials/bad-elements/">The "Perl
Elements to Avoid" page</a> contains many new entries.
</p>
</li>

<li>
<p>
<a href="http://perl-begin.org/tutorials/modern-perl/">Our mirror of
the book <i>Modern Perl</i> by chromatic</a> was updated to its latest
edition.
</p>
</li>
</ol>

<p>
We hope you find these additions useful or enlightening.
</p>

]]>
        
    </content>
</entry>

<entry>
    <title>Tel Aviv Perl Mongers Meeting on 30 May, 2012</title>
    <link rel="alternate" type="text/html" href="http://blogs.perl.org/users/shlomi_fish/2012/05/tel-aviv-perl-mongers-meeting-on-30-may-2012.html" />
    <id>tag:blogs.perl.org,2012:/users/shlomi_fish//422.3259</id>

    <published>2012-05-19T09:32:37Z</published>
    <updated>2012-05-20T09:37:44Z</updated>

    <summary> Important Update! (20 May, 2012) There was a problem with the old building (where we usually meet). There are no available rooms there at all. As a result we&apos;re assigned to room 2205 in the new building (Mitchell building)....</summary>
    <author>
        <name>Shlomi Fish</name>
        <uri>http://www.shlomifish.org/</uri>
    </author>
    
    <category term="event" label="event" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="events" label="events" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="perl" label="perl" scheme="http://www.sixapart.com/ns/types#tag" />
    <category term="telaviv" label="telaviv" scheme="http://www.sixapart.com/ns/types#tag" />
    
    <content type="html" xml:lang="en" xml:base="http://blogs.perl.org/users/shlomi_fish/">
        <![CDATA[<p>
<b>Important Update! (20 May, 2012)</b> There was a problem with the old building (where we usually meet). There are no available rooms there at all.
</p>

<p>
As a result we're assigned to room 2205 in the new building (Mitchell building).
The entrance is through Yeda Am street, on the corner with HaMelakha street.
<p>

(The Hebrew text will be followed by an English one).
</p>

<div align="right" dir="rtl">

<p>
ב-30 במאי 2012 (יום רביעי) נערוך את מפגש הפרל החודשי שלנו.
אנו נפגשים ב-18:30 ומתחילים ב-19:00. 
כתובת: מכללת שנקר, הבניין חדש על שם מיטשל, רמת גן, חדר 2205 
</p>

<p>
פרטים נוספים ניתן למצוא
<a href="http://telaviv.pm.org/">באתר של שוחרי הפרל של תל אביב</a>,
<a href="http://perl.org.il/">ובדף הבית של פרל בישראל</a>.
</p>

<p>
במפגש זה יהיו ההרצאות הבאות:
</p>

<ul>
<li>
<p>
<b>מלקוח לביצוע</b> -  - עידו קנר
ההרצאה תסביר מה הוא Redis במילים אחדות, תוכנית הלקוח שכתבתי עבורו, ואילו
כלים יש בפרל כדי להשתמש בו. (40 דקות)
</p>
</li>

<li>
<p>
<b>פרל למתחילים חלק 5</b> - שלומי פיש -
שלומי ישתמש בקהל בתור שפני נסיונות לבדיקת ואימות החלק החמישי בסדרת ההרצאות שלו,
<a href="http://www.shlomifish.org/lecture/Perl/Newbies/">פרל למתחילים</a> 
, שעוסק בהרגלי תכנות טובים. השקפים מכסים נושאים כמו כתיבת בדיקות אוטומטיות,
שימוש במערכות ניהול גרסאות, שימוש ב-Class Accessors, כתיבת תיעוד בעזרת POD,
ושימוש ב-Module-Build ו-Module-Starter.
</p>
</li>

</ul>

<p>
המפגש הוא חינמי וכולם מוזמנים. נתראה שם!
</p>

</div>

<h3>English Version</h3>

<p>
On 30 May, 2012 (Wednesday), the Tel Aviv Perl Mongers will hold their
monthly meetup. We meet at 18:30 and the
talks begin at 19:00. The address is: Shenkar College, the new Mitchell building, Ramat Gan, Room 2205.
</p>

<p>
One can find more details on
<a href="http://telaviv.pm.org/">the web-site</a> of
the Tel Aviv Perl mongers, and <a href="http://perl.org.il/">on the homepage of
Perl in Israel</a>.
</p>

<p>
This meeting will hold the following talks:
</p>

<ul>
<li>
<p>
<b>From client to execution</b> - by Ido Kanner - this talk will explain what 
Redis is in a few words, the client Ido has written for it, and which Perl
tools are available to use it. (40 minutes)
</p>
</li>

<li>
<p>
<b>Perl for Newbies, Part 5</b> - by Shlomi Fish - Shlomi will use the 
audience as guinea pigs for testing and verifying the fifth part of his series
of talks,
<a href="http://www.shlomifish.org/lecture/Perl/Newbies/">Perl 
    for Perl Newbies</a>,
whose theme is "good programming practices". The slides cover such topics as
writing automated tests, using version control systems, using class accessors,
writing documentation using POD, and using Module-Build and Module-Starter.
</p>
</li>

</ul>

<p>
The entrance to the meeting is free-of-charge, and everyone are welcome to
attend. See you there!
</p>
]]>
        
    </content>
</entry>

</feed>
