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

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

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

<item>
<title>Tech Tip: Checking the Latest Build in Travis CI</title>
<link>http://shlomif-tech.livejournal.com/72971.html</link>
<description>&#x3C;p&#x3E;
If you are using
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Travis_CI&#x22; rel=&#x22;nofollow&#x22;&#x3E;Travis CI&#x3C;/a&#x3E;, you can check
the latest build after a failed build by going to the &#x201C;Build History&#x201D; tab
in your project&#x2019;s main page (= https://travis-ci.org/shlomif/fc-solve or
equivalent), and selecting the new commit.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Copyright by Shlomi Fish, 2016.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
on how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<category>open-source</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/72971.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/72971.html</guid>
<pubDate>Fri, 27 May 2016 12:43:21 GMT</pubDate>
</item>
<item>
<title>Freecell Solver 4.2.0 was Released</title>
<link>http://fc-solve.blogspot.com/2016/03/freecell-solver-420-was-released.html</link>
<description>
&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://fc-solve.shlomifish.org/&#x22;&#x3E;Freecell Solver&#x3C;/a&#x3E; version 4.2.0,
has been released. It is available in
the form of a source archive, from
&#x3C;a href=&#x22;http://fc-solve.shlomifish.org/download.html&#x22;&#x3E;the
    download page&#x3C;/a&#x3E;. Freecell Solver is an open source library
and some command line applications, for automatically solving several
variants of card Solitaire / Patience games, including Freecell.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
This release sports the new configuration theme &#x201C;-l conspiracy-theory&#x201D;
(or &#x201C;-l ct&#x201D;) which is somewhat faster than the best contender up to it,
&#x201C;-l amateur-star&#x201D;, some relatively minor bug fixes, new compile-time
options, and many small and somewhat larger code cleanups, refactorings, and
optimisations.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
&#x201C;conspiracy-theory&#x201D; is a reference to the Jewish holiday of
&#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Purim&#x22;&#x3E;Purim&#x3C;/a&#x3E;, which took place
around the time of its release and an
&#x3C;a href=&#x22;http://shlomif.livejournal.com/62243.html&#x22;&#x3E;old post&#x3C;/a&#x3E; of mine
about it.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Enjoy!
&#x3C;/p&#x3E;
</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>freecell</category>
<category>open source</category>
<category>release</category>
<category>solitaire</category>
<category>solver</category>
<category>solving</category>
<guid isPermaLink="false">tag:blogger.com,1999:blog-96099636168698788.post-3011534562121233530</guid>
<pubDate>Fri, 25 Mar 2016 16:14:00 +0000</pubDate>
<atom:updated>2016-03-25T09:14:51.183-07:00</atom:updated>
</item>
<item>
<title>Tech Tip: How to properly sync the clock using NTP on Linux</title>
<link>http://shlomif.livejournal.com/68825.html</link>
<description>&#x3C;p&#x3E;
In order to sync the clock using
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Network_Time_Protocol&#x22; rel=&#x22;nofollow&#x22;&#x3E;NTP&#x3C;/a&#x3E;, the network
time protocol so your computer clock won&#x27;t be skewed, one should run the
following command as root: &#x201C;&#x3C;code&#x3E;ntpd -q -g -x&#x3C;/code&#x3E;&#x201D;. This has been a
constant problem for me in part because SSL/HTTPS sites may not work if your
clock is out-of-date.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can find the meaning of the individual flags in the
&#x3C;a href=&#x22;http://linux.die.net/man/8/ntpd&#x22; rel=&#x22;nofollow&#x22;&#x3E;ntpd man page&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Cheers and happy upcoming
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Purim&#x22; rel=&#x22;nofollow&#x22;&#x3E;Purim&#x3C;/a&#x3E; in case you celebrate.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Copyright by Shlomi Fish, 2015.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
on how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>foss</category>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<comments>http://shlomif.livejournal.com/68825.html</comments>
<guid isPermaLink="true">http://shlomif.livejournal.com/68825.html</guid>
<pubDate>Thu, 10 Mar 2016 20:03:32 GMT</pubDate>
</item>
<item>
<title>Tech Tip: Speed up building perl 5 by not installing the man pages</title>
<link>http://shlomif-tech.livejournal.com/72917.html</link>
<description>

&#x3C;h2&#x3E;2015-12-03: Tech Tip: Speed up building perl 5 by not installing the man pages&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
When building &#x3C;a href=&#x22;http://dev.perl.org/perl5/source.html&#x22; rel=&#x22;nofollow&#x22;&#x3E;perl 5
from source&#x3C;/a&#x3E;, one can speed up the &#x22;make&#x22; and &#x22;make install&#x22; stages
significantly by not installing the man pages. To do so, pass the options
&#x201C;-Dman1dir=none -Dman3dir=none&#x201D; to &#x201C;sh Configure&#x201D;.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Cheers, and happy upcoming
&#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Hanukkah&#x22; rel=&#x22;nofollow&#x22;&#x3E;Chanukkah&#x3C;/a&#x3E;, and happy
Christmas and/or Yulth or whatever winter holiday you celebrate.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Call for action&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Creative Commons has set up
&#x3C;a href=&#x22;http://creativecommons.org/campaigns/stop-the-tpp&#x22; rel=&#x22;nofollow&#x22;&#x3E;a campaign&#x3C;/a&#x3E;
to stop &#x3C;a href=&#x22;http://creativecommons.org/weblog/entry/46455&#x22; rel=&#x22;nofollow&#x22;&#x3E;TPP -
the Trans-Pacific Partnership&#x3C;/a&#x3E;. Please consider signing it and spreading
the word.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Copyright by Shlomi Fish, 2015.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
on how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>perl</category>
<category>tech</category>
<category>open-source</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/72917.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/72917.html</guid>
<pubDate>Thu, 03 Dec 2015 16:37:51 GMT</pubDate>
</item>
<item>
<title>Tech Tip: Make Panes Equally Heighted in Tmux</title>
<link>http://shlomif-tech.livejournal.com/72545.html</link>
<description>&#x3C;p&#x3E;
When pressing &#xAB;Ctrl+B;&#x22;&#xBB; in
&#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Tmux&#x22; rel=&#x22;nofollow&#x22;&#x3E;tmux&#x3C;/a&#x3E;
to split a pane vertically there, one will
notice that tmux splits the existing pane into two which can result in
smaller and smaller panes. In order to fix this, one can type &#xAB;Ctrl+B;M-2&#xBB;
(where &#x201C;M&#x201D; is the &#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Meta_key&#x22; rel=&#x22;nofollow&#x22;&#x3E;Meta
key&#x3C;/a&#x3E; and is normally &#x201C;Alt&#x201D; on most keyboards.) which will make all
the panes equally heighted.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I found this feature after wondering whether it existed, and then searching
for it in the tmux man page.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Copyright by Shlomi Fish, 2015.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
on how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<category>open-source</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/72545.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/72545.html</guid>
<pubDate>Fri, 06 Nov 2015 10:19:27 GMT</pubDate>
</item>
<item>
<title>Freecell Solver 4.0.0 was Released</title>
<link>http://fc-solve.blogspot.com/2015/09/freecell-solver-400-was-released.html</link>
<description>&#x3C;p&#x3E;
&#x3C;a href=&#x22;http://fc-solve.shlomifish.org/&#x22;&#x3E;Freecell Solver&#x3C;/a&#x3E; version 4.0.0,
has been released. It is available in
the form of a source archive, from
&#x3C;a href=&#x22;http://fc-solve.shlomifish.org/download.html&#x22;&#x3E;the
    download page&#x3C;/a&#x3E;. Freecell Solver is an open source library
and some command line applications, for automatically solving several
variants of card Solitaire / Patience games, including Freecell.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
This release sports the integration of the scans of Tom Holroyd&#x2019;s patsolve
for improved atomic moves-based solving, some other new flags with bug fixes,
a transition of the Python code to Python 3, and some other changes that are
mentioned in
&#x3C;a href=&#x22;http://fc-solve.shlomifish.org/docs/distro/NEWS.html&#x22;&#x3E;the NEWS
file&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
The most significant digit was increased due to the integration of patsolve.
Enjoy!
&#x3C;/p&#x3E;
</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>freecell</category>
<category>open source</category>
<category>release</category>
<category>solitaire</category>
<category>solver</category>
<category>solving</category>
<guid isPermaLink="false">tag:blogger.com,1999:blog-96099636168698788.post-4449217081539455140</guid>
<pubDate>Mon, 28 Sep 2015 14:51:00 +0000</pubDate>
<atom:updated>2016-03-11T09:10:58.814-08:00</atom:updated>
</item>
<item>
<title>Tech Tip: Locally Host the Firefox&#x2019;s Personas Favourites File</title>
<link>http://shlomif-tech.livejournal.com/72415.html</link>
<description>&#x3C;p&#x3E;
A constant annoyance when trying to use the Firefox extension
&#x201C;&#x3C;a href=&#x22;http://barisderin.com/?p=120&#x22; rel=&#x22;nofollow&#x22;&#x3E;Personas Rotator&#x3C;/a&#x3E;&#x201D; was that
downloading the favourites file from the Firefox addons site failed, which made
it stop rotating. I recently found a solution for that which I&#x27;d like to share.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
First of all, login to
&#x3C;a href=&#x22;https://addons.mozilla.org/en-US/firefox/themes/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Mozilla
addons site&#x3C;/a&#x3E; and access and bookmark
&#x3C;a href=&#x22;https://addons.mozilla.org/en-US/firefox/collections/mine/favorites/format%3Ajson?src=&#x22; rel=&#x22;nofollow&#x22;&#x3E;the JSON data file&#x2019;s URL&#x3C;/a&#x3E;. Save it to a file and host it
using a local HTTP service (such as Apache,
&#x3C;a href=&#x22;http://www.garyrobinson.net/2004/03/one_line_python.html&#x22; rel=&#x22;nofollow&#x22;&#x3E;the
one line Python HTTP service&#x3C;/a&#x3E; command line, or
&#x3C;a href=&#x22;http://opensource.dyc.edu/sthttpd&#x22; rel=&#x22;nofollow&#x22;&#x3E;sthttpd&#x3C;/a&#x3E;&#x2019;s &#x201C;thttpd -p $PORT&#x201D;
invocation).
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Then, go to Firefox&#x2019;s &#x201C;about:config&#x201D;, access the
&#x201C;extensions.personas.favorites-feed.url&#x201D; key and change it to the locally
served one. It should work fine after restarting Firefox, and one upside to
it would be that you no longer need to be logged in to addons.mozilla.org
for it to work.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Remember to save the file again every once-in-a-while, after you have added new
favourites. A final note is that a &#x201C;file://&#x201D; URL may work fine as
well, but I have not tried it yet.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Happy rotating, and
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Rosh_Hashanah&#x22; rel=&#x22;nofollow&#x22;&#x3E;Shanah Tovah&#x3C;/a&#x3E; if
appropriate!
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Copyright by Shlomi Fish, 2015.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
on how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>firefox</category>
<category>tip</category>
<category>tech</category>
<category>mozilla</category>
<category>open-source</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/72415.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/72415.html</guid>
<pubDate>Tue, 15 Sep 2015 12:18:06 GMT</pubDate>
</item>
<item>
<title>&#x201C;HTML 6&#x201D; and a List of Graphics Applications</title>
<link>http://shlomif-hsite.livejournal.com/19649.html</link>
<description>&#x3C;p&#x3E;
Here are the recent updates for &#x3C;a href=&#x22;http://www.shlomifish.org/&#x22; rel=&#x22;nofollow&#x22;&#x3E;Shlomi
Fish&#x2019;s Homepage&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;

&#x3C;ol&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
A new bit
&#x3C;a href=&#x22;http://www.shlomifish.org/humour/bits/HTML-6/&#x22; rel=&#x22;nofollow&#x22;&#x3E;&#x201C;Announcing &#x2018;HTML 6&#x2019;,
the New Version of the Web&#x201D;&#x3C;/a&#x3E; was published on 1 April 2015:
&#x3C;/p&#x3E;

&#x3C;blockquote&#x3E;

&#x3C;p&#x3E;
&#x3C;b&#x3E;1 April, 2015, Tel Aviv, Israel:&#x3C;/b&#x3E; Today, the World Wide Web Consortium
(W3C) announced the immediate availability of the new version of the web &#x2014;
&#x3C;b&#x3E;HTML 6&#x3C;/b&#x3E; &#x2014; pronounced &#x201C;HTML Sicks [sic]&#x201D; with the motto &#x201C;HTML 6 is sick!&#x201D;.
&#x201C;We concluded that the previous version of the World Wide Web&#x2019;s standards
suite, HTML5, has exceeded its flexibility and usability, and we need to
start over&#x201D;, said Tim Berners-Lee, the director of the W3C.
&#x3C;/p&#x3E;

&#x3C;/blockquote&#x3E;

&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
There&#x2019;s a new
&#x3C;a href=&#x22;http://www.shlomifish.org/philosophy/computers/web/models-for-commerce/&#x22; rel=&#x22;nofollow&#x22;&#x3E;list
of &#x201C;Alternative&#x201D; commercial models&#x3C;/a&#x3E; for Web-based commerce that do not
involve intrusive advertising.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
There&#x2019;s a new &#x3C;a href=&#x22;http://www.shlomifish.org/open-source/resources/graphics-programs/&#x22; rel=&#x22;nofollow&#x22;&#x3E;list
of graphics software applications&#x3C;/a&#x3E;.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
We now mirror
&#x3C;a href=&#x22;http://www.shlomifish.org/humour/by-others/funroll-loops/&#x22; rel=&#x22;nofollow&#x22;&#x3E;funroll-loops.info
(&#x201C;Gentoo is Rice&#x201D;)&#x3C;/a&#x3E;, and the old feature
&#x3C;a href=&#x22;http://www.shlomifish.org/humour/by-others/how-to-make-square-corners-with-CSS/&#x22; rel=&#x22;nofollow&#x22;&#x3E;&#x201C;How
to Make Square Corners with CSS&#x201D;&#x3C;/a&#x3E;,
which disappeared from the Web.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
There are new factoids in &#x3C;a href=&#x22;http://www.shlomifish.org/humour/bits/facts/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the collections of factoids about people and thing&#x3C;/a&#x3E;:
&#x3C;/p&#x3E;

&#x3C;blockquote&#x3E;

&#x3C;p&#x3E;
A rose by a name picked by Chuck Norris, will smell sweeter.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
The reason the Messiah has not come yet, is because Chuck Norris keeps finding
faults in God&#x2019;s plan for his coming.
&#x3C;/p&#x3E;

&#x3C;/blockquote&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
There are
&#x3C;a href=&#x22;http://www.shlomifish.org/humour.html#dizzying_intellect&#x22; rel=&#x22;nofollow&#x22;&#x3E;new quotes&#x3C;/a&#x3E; in the collection of Aphorisms:
&#x3C;/p&#x3E;

&#x3C;blockquote&#x3E;

&#x3C;p&#x3E;
Some people grow older and wiser. Not I. I grow older and more foolish.
&#x3C;/p&#x3E;

&#x3C;/blockquote&#x3E;

&#x3C;/li&#x3E;

&#x3C;/ol&#x3E;

&#x3C;p&#x3E;
Hope you enjoy all that, and if you&#x2019;re Jewish, I hope you enjoy the upcoming
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Rosh_Hashanah&#x22; rel=&#x22;nofollow&#x22;&#x3E;Rosh Hashanah&#x3C;/a&#x3E;
and the rest of the Jewish Autumn holidays.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>quotes</category>
<category>facts</category>
<category>html5</category>
<category>chuck norris</category>
<category>open</category>
<category>humor</category>
<category>html 5</category>
<category>humour</category>
<comments>http://shlomif-hsite.livejournal.com/19649.html</comments>
<guid isPermaLink="true">http://shlomif-hsite.livejournal.com/19649.html</guid>
<pubDate>Thu, 03 Sep 2015 18:49:52 GMT</pubDate>
</item>
<item>
<title>Tech Tip: Don&#x2019;t pass the -j$N flag to make when building GNU guile2</title>
<link>http://shlomif-tech.livejournal.com/72038.html</link>
<description>&#x3C;p&#x3E;
In order to build
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/GNU_Guile&#x22; rel=&#x22;nofollow&#x22;&#x3E;GNU Guile&#x3C;/a&#x3E; (or at least its
version 2.x), it is important not to pass the &#x201C;-j$N&#x201D; flag to &#x201C;make&#x201D;. Without
the flag, the compilation will be faster (counterintuitively I admit), because
some of the build tasks spawn as many processes or threads as the CPU cores
on the machine, and with the flag, they get congested and the build is
slower. Cheers!
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Copyright by Shlomi Fish, 2015.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>speed</category>
<category>tech</category>
<category>open-source</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/72038.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/72038.html</guid>
<pubDate>Tue, 01 Sep 2015 15:22:55 GMT</pubDate>
</item>
<item>
<title>Tech Tip: Trimming Old Releases from minicpan Directories</title>
<link>http://shlomif-tech.livejournal.com/71746.html</link>
<description>&#x3C;p&#x3E;
&#x3C;a href=&#x22;https://metacpan.org/pod/distribution/CPAN-Mini/bin/minicpan&#x22; rel=&#x22;nofollow&#x22;&#x3E;minicpan&#x3C;/a&#x3E;
is a tool to create or update a minimal local mirror of CPAN (= the
&#x201C;Comprehensive Perl Archive Network&#x201D;), that contains only the latest releases
of CPAN distributions. Now, one problem I ran into when using it is that
&#x201C;minicpan&#x201D; did not seem to delete the older downloaded releases after they were
superseded by newer ones. A few days ago I found a solution to this problem.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
What you can do is:
&#x3C;/p&#x3E;

&#x3C;ol&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
Move away the minicpan&#x2019;s mirror&#x2019;s top directory (&#x3C;b&#x3E;do not delete it!&#x3C;/b&#x3E;)
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
Set up a localhost HTTP service on a high TCP port which will serve the moved
minicpan directory. For that you can use
&#x3C;a href=&#x22;http://www.garyrobinson.net/2004/03/one_line_python.html&#x22; rel=&#x22;nofollow&#x22;&#x3E;the
one line Python HTTP service&#x3C;/a&#x3E; command line or
&#x3C;a href=&#x22;http://opensource.dyc.edu/sthttpd&#x22; rel=&#x22;nofollow&#x22;&#x3E;shttpd&#x3C;/a&#x3E;&#x2019;s &#x201C;thttpd -p $PORT&#x201D;
invocation or whatever.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
Run the &#x201C;minicpan&#x201D; command while pointing the remote to the localhost mirror
of the old minicpan mirror, using the &#x201C;-r&#x201D; flag or by temporarily editing the
&#x201C;~/.minicpanrc&#x201D; file.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;/ol&#x3E;

&#x3C;p&#x3E;
Voila! Now the mirror will only contain the latest releases, and you can remove
the old, moved-away, minicpan directory, and cancel the HTTP service.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
Copyright by Shlomi Fish, 2015.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>perl</category>
<category>tech</category>
<category>open-source</category>
<category>tech tip</category>
<category>cpan</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/71746.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/71746.html</guid>
<pubDate>Mon, 20 Jul 2015 10:54:09 GMT</pubDate>
</item>
<item>
<title>Tech Tip: Skip Tests in RPM .spec Files conditionally-to-version</title>
<link>http://shlomif-tech.livejournal.com/71570.html</link>
<description>&#x3C;p&#x3E;
Let&#x2019;s suppose you are packaging a software application using
&#x3C;a href=&#x22;https://en.wikipedia.org/wiki/RPM_Package_Manager&#x22; rel=&#x22;nofollow&#x22;&#x3E;RPM&#x3C;/a&#x3E; or a similar
packaging system, and this application contains some automated tests that
can be run using &#x201C;make test&#x201D;, &#x201C;make check&#x201D; or similar. You may opt to put them
inside a &#x201C;%check&#x201D; section, but the problem now is that they may fail.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
The solution I used in this case (assuming fixing the tests was out of scope
of my work as a packager) was to comment out the command that ran the tests,
but this is not ideal because that way the tests will also be disabled in
subsequent versions of the application, unless the packager remembers to
reenable them.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Recently, I discovered a better way to do that, after inspecting the source
of a &#x3C;a href=&#x22;http://www.mageia.org/en/&#x22; rel=&#x22;nofollow&#x22;&#x3E;Mageia Linux&#x3C;/a&#x3E; package. One needs
do something like that:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
%define known_to_fail_version 1.82

%check

if test &#x22;%{version}&#x22; = &#x22;%{known_to_fail_version}&#x22; ; then
    true
else
    # Run the tests.
    make check
fi
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
This way, the tests will get run again for subsequent versions of the packaged
application, and if they fail again one can set &#x201C;known_to_fail_version&#x201D; to
a new value.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I hope you also find it a cool trick. Cheers!
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<category>open-source</category>
<category>rpm</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/71570.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/71570.html</guid>
<pubDate>Tue, 14 Jul 2015 08:53:24 GMT</pubDate>
</item>
<item>
<title>Tech Tip: How to Debug Firefox&#x2019;s UI Code Using the Debugging Tools</title>
<link>http://shlomif-tech.livejournal.com/71385.html</link>
<description>&#x3C;p&#x3E;
In order to debug Mozilla Firefox&#x2019;s User Interface code (so-called &#x201C;chrome&#x201D;
code), you should toggle the &#x201C;Enable chrome and add-on debugging&#x201D; checkbox
in the Developer Toolbar&#x2019;s setting and then go to &#x201C;Tools &#x2192; Web Developer
&#x2192; Browser Toolbox&#x201D;. Thanks to jdm on irc.mozilla.org for part of this
tip. Cheers and happy &#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Independence_Day_%28United_States%29&#x22; rel=&#x22;nofollow&#x22;&#x3E;United Stated Independence Day&#x3C;/a&#x3E; (4th of July)
in case you are an American.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>firefox</category>
<category>tip</category>
<category>tech</category>
<category>open-source</category>
<category>debugging</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/71385.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/71385.html</guid>
<pubDate>Fri, 03 Jul 2015 08:39:31 GMT</pubDate>
</item>
<item>
<title>Tech Tip: Fix Poor Internet Connectivity by Restarting the Router</title>
<link>http://shlomif-tech.livejournal.com/71047.html</link>
<description>&#x3C;p&#x3E;
I noticed that one can often fix poor home Internet connectivity (I have an
&#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Asymmetric_digital_subscriber_line&#x22; rel=&#x22;nofollow&#x22;&#x3E;ADSL
connection&#x3C;/a&#x3E; but it may apply to other types of Internet connection), by
powering off the router and starting it again (&#x201C;restart/reboot&#x201D;). So I&#x2019;ve made
a mental note to keep it in mind and now it&#x2019;s in this blog as a tip. Cheers!
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<category>open-source</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/71047.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/71047.html</guid>
<pubDate>Thu, 25 Jun 2015 09:48:32 GMT</pubDate>
</item>
<item>
<title>git Tip: How to Call &#x201C;git bisect start&#x201D;</title>
<link>http://shlomif-tech.livejournal.com/70747.html</link>
<description>&#x3C;p&#x3E;
&#x201C;git&#x201D; is an open-source distributed version control system that has recently
gained a lot of popularity. The &#x201C;git bisect start&#x201D; synopsis in &#x201C;git help
bisect&#x201D; is somewhat misleading:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
git bisect start [--no-checkout] [&#x26;lt;bad&#x26;gt; [&#x26;lt;good&#x26;gt;...]] [--] [&#x26;lt;paths&#x26;gt;...]
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
One has to specify both the &#x201C;bad&#x201D; and the &#x201C;good&#x201D; revisions explicitly or else
&#x201C;git bisect&#x201D; will wait for the missing ones to be specified, which will be
confusing. So specify them immediately at the &#x201C;git bisect start&#x201D; invocation.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Incidentally,
&#x3C;a href=&#x22;http://www.nntp.perl.org/group/perl.perl5.porters/2015/06/msg228300.html&#x22; rel=&#x22;nofollow&#x22;&#x3E;perl-5.22.0&#x3C;/a&#x3E;
was released a few days ago. Grab it while it&#x2019;s hot!
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<category>open-source</category>
<category>tech tip</category>
<category>foss</category>
<comments>http://shlomif-tech.livejournal.com/70747.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/70747.html</guid>
<pubDate>Sat, 06 Jun 2015 17:11:00 GMT</pubDate>
</item>
<item>
<title>Linux Tip: How to Determine Which Program is Emitting Sounds</title>
<link>http://shlomif-tech.livejournal.com/70518.html</link>
<description>&#x3C;p&#x3E;
Here&#x27;s a tip you may find useful about how to determine which program is
emitting sounds on a modern
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/Linux&#x22; rel=&#x22;nofollow&#x22;&#x3E;Linux&#x3C;/a&#x3E; system.
This tip requires
&#x3C;a href=&#x22;http://en.wikipedia.org/wiki/PulseAudio&#x22; rel=&#x22;nofollow&#x22;&#x3E;PulseAudio&#x3C;/a&#x3E; to be enabled
, and if that&#x27;s the case, just start up
&#x3C;a href=&#x22;http://www.kde.org/applications/multimedia/kmix/&#x22; rel=&#x22;nofollow&#x22;&#x3E;KDE&#x2019;s KMix&#x3C;/a&#x3E; and
see which applications spring up in the &#x201C;Playback Streams&#x201D; tab. Hope it helps,
and good luck.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version of
it.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<category>tech tip</category>
<comments>http://shlomif-tech.livejournal.com/70518.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/70518.html</guid>
<pubDate>Tue, 02 Jun 2015 15:02:25 GMT</pubDate>
</item>
<item>
<title>Vim Tip: Going to the top or bottommost window/viewport</title>
<link>http://shlomif-tech.livejournal.com/70256.html</link>
<description>&#x3C;p&#x3E;
In the &#x3C;a href=&#x22;http://www.vim.org/&#x22; rel=&#x22;nofollow&#x22;&#x3E;Vim&#x3C;/a&#x3E; and GVim text editors, one can
use &#x3C;code&#x3E;Ctrl+W;t&#x3C;/code&#x3E; (or &#x3C;tt&#x3E;Ctrl+w;Ctrl+t&#x3C;/tt&#x3E;) to go to the
topmost/most top window (= a section of the screen in Vim terminology) and
&#x3C;code&#x3E;Ctrl+W;b&#x3C;/code&#x3E; to go to the bottommost/most bottom one.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
Cheers!
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>tip</category>
<category>vim tip</category>
<category>tech</category>
<category>vim</category>
<category>tech tip</category>
<comments>http://shlomif-tech.livejournal.com/70256.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/70256.html</guid>
<pubDate>Fri, 29 May 2015 17:08:46 GMT</pubDate>
</item>
<item>
<title>Tech Tip: How to Configure Qt 5 Behaviour When Running on KDE4</title>
<link>http://shlomif-tech.livejournal.com/69991.html</link>
<description>&#x3C;p&#x3E;
Recently, I noticed that when running the VLC-2.2.0 prerelease, which
is based on Qt 5 for its GUI, on my
&#x3C;a href=&#x22;http://www.mageia.org/en/&#x22; rel=&#x22;nofollow&#x22;&#x3E;Mageia&#x3C;/a&#x3E;
Linux 5 system on top of KDE 4, then in the playlist a single-click immediately
played a file instead of selecting it, while reserving a double click for
activation. After a long amount of research and thought, I figured out a way
to configure Qt 5 on top of KDE.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
To do so:
&#x3C;/p&#x3E;

&#x3C;ol&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
Install lxqt-config and the &#x201C;lxqt-qtplugin&#x201D;.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
Add the line &#x201C;&#x3C;code&#x3E;export QT_QPA_PLATFORMTHEME=lxqt&#x3C;/code&#x3E;&#x201D; somewhere before
the desktop startup in your &#x201C;.Xclients&#x201D; or &#x201C;.xinitrc&#x201D; file (or in your
&#x201C;.bashrc&#x201D;).
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
Restart the X/KDE environment.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;li&#x3E;
&#x3C;p&#x3E;
Run &#x201C;lxqt-config&#x201D; to configure the appropriate behaviour.
&#x3C;/p&#x3E;
&#x3C;/li&#x3E;

&#x3C;/ol&#x3E;

&#x3C;p&#x3E;
This way one can use the Qt5 customisations of lxqt in KDE 4. Enjoy!
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>tech</category>
<category>tech tip</category>
<category>kde</category>
<comments>http://shlomif-tech.livejournal.com/69991.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/69991.html</guid>
<pubDate>Sat, 28 Feb 2015 12:12:47 GMT</pubDate>
</item>
<item>
<title>&#x201C;Out of the Strong, Something Sweet&#x201D; - How a Bug Led to a Useful Optimisation</title>
<link>http://shlomif-tech.livejournal.com/69835.html</link>
<description>&#x3C;p&#x3E;
The book &#x3C;a href=&#x22;http://www.amazon.com/Fortune-Failure-Missed-Opportunities-Discoveries/dp/0631160876/ref=sr_1_2?ie=UTF8&#x26;amp;qid=1424966727&#x26;amp;sr=8-2&#x26;amp;keywords=fortune+or+failure&#x22; rel=&#x22;nofollow&#x22;&#x3E;&#x3C;i&#x3E;Fortune
or Failure: Missed Opportunities and Chance Discoveries&#x3C;/i&#x3E;&#x3C;/a&#x3E; (which my family
used to own, but which I did not read) gives the case to
the important role of luck and chance in scientific discoveries. Recently,
when working on &#x3C;a href=&#x22;https://projecteuler.net/problem=146&#x22; rel=&#x22;nofollow&#x22;&#x3E;Project Euler
Problem No. 146&#x3C;/a&#x3E; I came up with a case of an accidental bug, that in turn
led to an idea for a significant optimisation.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
The C code with the bug (which was in turn translated from some Perl code)
looked something like that:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
#define DIV 9699690
#define NUM_MODS 24024
#define NUM_PRIMES 8497392

int primes[NUM_PRIMES];
int mods[NUM_MODS];

typedef long long LL;

static inline bool is_prime(LL n)
{
    LL lim = (LL)(sqrt(n));

    for (int p_idx=0; p_idx &#x26;lt; NUM_MODS ; p_idx++)
    {
        typeof (primes[p_idx]) p = primes[p_idx];
        if (p &#x26;gt; lim)
        {
            return true;
        }
        if (n % p == 0)
        {
            return false;
        }
    }
    return true;
}

.
.
.
            for (int y_idx=0;y_idx&#x26;lt;sizeof(y_off)/sizeof(y_off[0]);y_idx++)
            {
                if (! is_prime(sq + y_off[y_idx]))
                {
                    goto fail;
                }
            }
            for (int n_idx=0;n_idx&#x26;lt;sizeof(n_off)/sizeof(n_off[0]);n_idx++)
            {
                if (is_prime(sq + n_off[n_idx]))
                {
                    goto fail;
                }
            }
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
As you can notice eventually, the problem was that in the &#x3C;code&#x3E;p_idx&#x3C;/code&#x3E;
loop, &#x3C;code&#x3E;NUM_MODS&#x3C;/code&#x3E; should have been the larger &#x3C;code&#x3E;NUM_PRIMES&#x3C;/code&#x3E;.
This caused the test for primality to finish faster, but to sometimes return
true instead of false. As a result, I noticed that some numbers were erroneously
reported as suitable, but the program finished much faster.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I corrected it and reran the program which was now much slower, but this led me
to think that maybe the lower limit to the count of primes can be a pre-filter
for primality for the &#x201C;y_idx&#x201D;/&#x201C;y_off&#x201D; numbers, that will run quicker and
eliminate some numbers. As a result, I did this:
&#x3C;/p&#x3E;

&#x3C;pre&#x3E;
#define NUM_PRIMES__PRE_FILTER 24024

static inline bool is_prime__pre_filter(LL n)
{
    LL lim = (LL)(sqrt(n));

    for (int p_idx=0; p_idx &#x26;lt; NUM_PRIMES__PRE_FILTER ; p_idx++)
    {
        typeof (primes[p_idx]) p = primes[p_idx];
        if (p &#x26;gt; lim)
        {
            return true;
        }
        if (n % p == 0)
        {
            return false;
        }
    }
    return true;
}

.
.
.
            for (int y_idx=0;y_idx&#x26;lt;sizeof(y_off)/sizeof(y_off[0]);y_idx++)
            {
                if (! is_prime__pre_filter(sq + y_off[y_idx]))
                {
                    goto fail;
                }
            }
            for (int y_idx=0;y_idx&#x26;lt;sizeof(y_off)/sizeof(y_off[0]);y_idx++)
            {
                if (! is_prime(sq + y_off[y_idx]))
                {
                    goto fail;
                }
            }
            for (int n_idx=0;n_idx&#x26;lt;sizeof(n_off)/sizeof(n_off[0]);n_idx++)
            {
                if (is_prime(sq + n_off[n_idx]))
                {
                    goto fail;
                }
            }
&#x3C;/pre&#x3E;

&#x3C;p&#x3E;
This made the program finish in under a minute, while yielding the correct
solution. The original program, with the bug fix, was still running after
several minutes.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
So the bug proved to be useful and insightful. One possible future direction
is to merge the two &#x201C;y_idx&#x201D; loops into a single function that will accept an
array of numbers, and will check them all for primality using the same divisors
simultaneously, so as soon as one of them is found to be non-prime, a
verdict will be reached.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by-nc/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution Noncommercial 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>bug</category>
<category>optimize</category>
<comments>http://shlomif-tech.livejournal.com/69835.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/69835.html</guid>
<pubDate>Thu, 26 Feb 2015 18:23:14 GMT</pubDate>
</item>
<item>
<title>Optimisation Tip: Avoid Excessive Forks+EXECVEs to Processes</title>
<link>http://shlomif-tech.livejournal.com/69529.html</link>
<description>&#x3C;p&#x3E;
This will come as a surprise to few, but performing a separate
&#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Fork_%28system_call%29&#x22; rel=&#x22;nofollow&#x22;&#x3E;fork()&#x3C;/a&#x3E;
and &#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Exec_%28computing%29&#x22; rel=&#x22;nofollow&#x22;&#x3E;EXECVE&#x3C;/a&#x3E;
system calls (e.g: for &#x3C;code&#x3E;`factor &#x22;$n&#x22;`&#x3C;/code&#x3E; in Perl or &#x3C;code&#x3E;popen&#x3C;/code&#x3E;
in C), on each iteration of a loop can really kill performance. One option
to reduce that would be to read individual lines from a
&#x3C;code&#x3E;seq 2 999999 | xargs factor&#x3C;/code&#x3E; loop, or avoid forking altogether.
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
I discovered this issue while working on
&#x3C;a href=&#x22;https://projecteuler.net/problem=141&#x22; rel=&#x22;nofollow&#x22;&#x3E;Project
Euler problem #141&#x3C;/a&#x3E;, and I should have realised that the sub-100%
CPU utilisation of the program was caused by the excessive spawning of new
processes.
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>tip</category>
<category>optimize</category>
<category>tech</category>
<category>tech tip</category>
<comments>http://shlomif-tech.livejournal.com/69529.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/69529.html</guid>
<pubDate>Sun, 22 Feb 2015 13:33:16 GMT</pubDate>
</item>
<item>
<title>Tech Tip: Make Jamendo Playback Work in Firefox on Mageia Linux</title>
<link>http://shlomif-tech.livejournal.com/69336.html</link>
<description>&#x3C;p&#x3E;
If you&#x2019;re having a problem playing
&#x3C;a href=&#x22;https://en.wikipedia.org/wiki/Jamendo&#x22; rel=&#x22;nofollow&#x22;&#x3E;Jamendo&#x3C;/a&#x3E; tracks after
pressing the &#x201C;Listen&#x201D; button (such as on &#x3C;a href=&#x22;https://www.jamendo.com/en/list/a132792/nanofly&#x22; rel=&#x22;nofollow&#x22;&#x3E;this page&#x3C;/a&#x3E;) on Firefox running on Linux, then try to
install
the packages &#xAB;gstreamer0.10-plugins-bad gstreamer0.10-plugins-good
gstreamer0.10-plugins-ugly gstreamer0.10-mpeg  gstreamer0.10-ffmpeg&#xBB; (relevant
to Mageia; try their equivalent in other distributions), restart Firefox and
try again. The problem is that Firefox needs extra gstreamer plugins to
play proprietary formats in
&#x3C;a href=&#x22;https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats&#x22; rel=&#x22;nofollow&#x22;&#x3E;HTML
audio and video elements&#x3C;/a&#x3E;. Cheers!
&#x3C;/p&#x3E;

&#x3C;p&#x3E;
(Thanks to &#x201C;dolske&#x201D; from #firefox on irc.mozilla.org for their help.)
&#x3C;/p&#x3E;

&#x3C;h2&#x3E;Licence&#x3C;/h2&#x3E;

&#x3C;p&#x3E;
You can reuse this entry under
&#x3C;a href=&#x22;http://creativecommons.org/licenses/by/3.0/&#x22; rel=&#x22;nofollow&#x22;&#x3E;the Creative Commons
Attribution 3.0 Unported&#x3C;/a&#x3E; licence, or at your option any later version.
See the
&#x3C;a href=&#x22;http://www.shlomifish.org/meta/copyrights/#cc_by_intr&#x22; rel=&#x22;nofollow&#x22;&#x3E;instructions&#x3C;/a&#x3E;
of how to comply with it.
&#x3C;/p&#x3E;</description>
<author>Shlomi Fish ( shlomif@shlomifish.org )</author>
<category>linux</category>
<category>firefox</category>
<category>tip</category>
<category>tech</category>
<category>tech tip</category>
<comments>http://shlomif-tech.livejournal.com/69336.html</comments>
<guid isPermaLink="true">http://shlomif-tech.livejournal.com/69336.html</guid>
<pubDate>Thu, 05 Feb 2015 08:34:51 GMT</pubDate>
</item>
</channel>
</rss>