Older blog entries for shlomif (starting at number 678)

Book Report: Catch 22

The book Catch-22 by Joseph Heller has a reputation as one of the greatest books of the 20th century. One of my family members bought it, and I recently finished reading it, and would like to state my opinion.

While the book is well-written, I didn't really find it enjoyable. On the other hand, there wasn't any particular obstacle to stop me from finishing to read it (unlike some books I recently tried to read by Tom Wolfe), so I guess it could have been worse. The humour in the book is sarcastic and dry, and I usually did not find it funny.

At least now I can boast that I have read Catch-22, and other people may find it more enjoyable. Bye for now.

Syndicated 2012-10-15 10:55:16 from shlomif

What does “Simple” mean in the context of software?

A lot of computer programs, and especially many open-source applications like to boast that they are “simple”. But what does it mean? Given the various applications and misapplications of this word, I can think of several meanings:

  1. Easy to use.

  2. Lacks complexity (whatever that means and implies).

  3. Simplistic.

  4. Minimalistic.

  5. Lacks extraneous features.

Very often, these meanings are at conflict with one another. For example, the GNOME developers have been keen on making the feature set as minimalistic (in accordance to meaning #4) as possible, which has taken the project to spiraling depths of unusability (opposing meaning #1). Furthermore, Arch Linux taglines itself as “a lightweight and flexible Linux® distribution that tries to Keep It Simple”. However, during one day, I spent three incredibly vexing hours in trying to install it on a Virtual Box virtual machine, due to the installer's lack of usability, and if I had to do it on live hardware, it would have taken me much longer. You call that simple? I joked that it would take an engineering degree from a prestigious university to figure it out. I have that, but it did not help me much.

As a result, I have become incredibly suspicious and weary of any software that prides itself on its “simplicity”, even though “simplicity” should be a good thing.

Bjarne Stroustrup (the creator of C++) has this to say about Java on his FAQ:

Much of the relative simplicity of Java is - like for most new languages - partly an illusion and partly a function of its incompleteness. As time passes, Java will grow significantly in size and complexity. It will double or triple in size and grow implementation-dependent extensions or libraries. That is the way every commercially successful language has developed. Just look at any language you consider successful on a large scale. I know of no exceptions, and there are good reasons for this phenomenon. [I wrote this before 2000; now (2012), the language part of the Java 7 specification is slightly longer in terms of number of pages than the ISO C++11 language specification.]

So simplicity is often a function of immaturity and incompleteness.

Of course, some things that call themselves “simple” are not simple in any of the meanings, for example SOAP, the so-called “Simple Object Access Protocol” (see the S stands for Simple), is not simple in any of the meanings I have given, but it is still called like that.

I feel that like the word “Zionism” no one is no longer sure what “simplicity” means, and as a result, some people no longer consider it a good quality to have. It’s a shame, but that’s life.

Syndicated 2012-10-08 15:08:52 from shlomif

“Like A Bad White Guy Party Gangnam Style” Mirrored

The YouTube video “Like A Bad White Guy Party Gangnam Style - PSY, LMFAO, Dev, Offspring, Bloodhound Gang (Mashup)”, which I have been greatly enjoying has now been mirrored on my personal web site. Follow the link to download it and view it.

The YouTube original is no longer available due to a copyright claim by YG Entertainment Inc. (whoever they may be). I wish all copyright cartels will be banished to the tenth level of hell (which was created especially for them because the first nine levels were too mild).

For related reading, see:

Syndicated 2012-10-04 08:03:08 from shlomif

What’s New on Shlomi Fish’s Homepage

Here are the recent updates for Shlomi Fish’s Homepage. The first item of note is that I implemented an automated test suite for the site, with a test for lack of trailing whitespace, and a spell checking test (powered by Text::Hunspell and Hunspell). The many problems pointed by these checkers were fixed, resulting in a very large patch to review this time.

Aside from the spelling corrections, here are the items of interest:

The meta section now has a section navigation menu.

I added the incomplete geek parody song “I’m the Real Tim Toady”:

May I have your attention, please?
May I have your attention, please?
Will the real Tim Toady please match up?
I repeat: will the real Tim Toady please match up?
We’re going to have two problems here.

jnoakes’ page about Graduate Student Jokes, which I have enjoyed, and which has gone offline, has been restored on the site:

You know you’re a grad student when…

  • you can identify universities by their internet domains.
  • you are constantly looking for a thesis in novels.
  • you have difficulty reading anything that doesn't have footnotes.
  • you understand jokes about Foucault.
  • the concept of free time scares you.
  • you consider caffeine to be a major food group.
  • you've ever brought books with you on vacation and actually studied.
  • Saturday nights spent studying no longer seem weird.

A page with a List of Text Processing Tools has been added to the software resources sub-section.

There are new additions to the Aphorisms and quotes collection:

If it isn’t in my E-mail, it doesn’t exist. And if the whole world says one thing and E-mail says another, Email will conquer

(Said to me in a private conversation by an Israeli Linux enthusiast.)

There are also some new quotes in the Chuck Norris Facts page:

Chuck Norris is the reason why the Knights who until Recently Said “Ni”, are no longer saying “Ni”.

Finally, there are some new fortune cookies:


Syndicated 2012-10-03 17:15:39 from shlomif

Yom Kippur 2012 Summary

This Yom Kippur, I again went over my blogs from the last year, and tried to draw some conclusions. Most of my blog posts were in my technical blogs: shlomif-tech, and my blogs.perl.org blog. Nevertheless, I did not blog too much. Instead, I worked a lot on code, wrote E-mails, chatted on IRC, and helped maintain such projects as the Mageia Linux distribution. So I guess it's not so bad, because writing and publishing essays has a tendency to make me nervous.

I was employed for about 7 months this year in a part-time job, which I expected to be more permanent and turned out to be more temporary. I also did not have substantial hypomanias, though I had some periods of stress or anger, and annoyingly, I got into a short period of hypomania yesterday, but luckily was quickly able to recover from it.

I still maintained some sites such as my home-site or the Perl Beginners’s site, and it often kept me busy.

So overall a good year.


Syndicated 2012-09-26 16:59:05 from shlomif

The Ultimate Irrational Homework Assignment

As someone who has been chatting on programming-related IRC (Internet Relay Chat) for a while, I have witnessed my share of people coming up with unreasonable needs due to homework. However, some days ago, someone on Freenode's #perl came and ask for help in parsing a semicolon that does not occur inside shell quotes (e.g: echo "Semicolon in string - ; foobar" ; ls -l ; ) using regular expressions. I suggested him to use a parser generator, and then said that his teacher has forbidden him from using it or any other external CPAN module and that he could only use regular expressions, in order to, get this: write some Perl code that will convert Bash to Python. Yes! His teacher expects them to learn those three languages at once. And apparently without making a judicious use of the proper APIs.

Teaching three languages at the same time (in what may be a introductory course) is wrong and should be avoided, as learning one language is hard enough, and with three the students may become extremely confused. In response to my Thoughts about the Best Introductory [Programming] Language, a friend suggested that one should teach three introductory languages, and if I were remember correctly, they were something like C, a convenient dynamic language such as Perl or Python, and a very "mind expanding" language like Lisp or Haskell. I noted the same thing back then, that it would confuse the heck out of the students, and here the motivation is even more flimsy.

I wonder if we ever top this homework assignment that we are being asked for help with. Will a professor ask his students to implement a Strong AI in a weekend?

Syndicated 2012-09-17 16:05:08 from shlomif

C++ Joke

Here is a joke I had heard which I decided to import for C++:

In a press conference for the publishing of Accelerated C++, one of the authors, Andrew Koenig, was asked “Is it true that there are only three people in the world who truly understand C++?”. To which he replied “Really? Who’s the third?”.


More C++ Fun

Syndicated 2012-09-06 13:01:47 from shlomif

Two Freecell Solvability Report for the First 400,000 Deals

With some help from some people on the fc-solve-discuss list and off the list (namely Amadiro from the University of Oslo and someone else that I met on IRC , I ran my solvers on the first 400,000 Windows Freecell deals with only two available freecells to see how many of them can be solved.

Here is the report:

Start Index End Index Solved Impossible Intractable
1 32,000 25,381 6,619 0
32,001 50,000 14,302 3,698 0
50,001 100,000 39,775 10,225 0
100,001 400,000 238,415 61,584 1 (No. 384243)
Total 317,873 82,126 1

So about 79.47% of the deals can be solved and the rest are impossible. The only intractable deal that none of my solvers could yield a verdict for is No. 384,243, and it spans a very large number of states:

  • The dbm_fc_solver got into Reached 12,821,000,000 ; States-in-collection: 13,620,999,440 before it failed to produce more results due to a limitation of the hardware where it was deployed on.

  • The depth_dbm_fc_solver yielded this:

    Reached 13,763,700,000 ; States-in-collection: 16,226,294,490 ; Time: 1345126456.520408 Queue Stats: inserted=16,226,294,490 items_in_queue=2,462,594,490 extracted=13,763,700,000

    with a curr_depth of 38. However, that solver may have some yet undiscovered bugs.

So what's next? I’d like to investigate some ways to scale to a larger number of states, perhaps by creating a distributed solver. A google search for distributed breadth first search yields some results:

I hope you enjoy the statistics for the time being.

Syndicated 2012-09-02 09:19:00 from shlomif

Bash Function for Caching Results

In this blog I’d like to blog about the newest edition to my Bash (the UNIX shell) aliases file: the cache() function. What it does is cache the result of a lengthy command in a file in a common place, and then simply output this file if it already exists. I found it of use when I compiled a report which involved some lengthy recursive grep operations which were time consuming, and required a lot of waiting. Another upside to caching is the fact that one can monitor its progress by following the file on disk.

Here is the cache function, available under the MIT/X11 licence:

# What this function does is cache the result of a command in a file, and
# use the file to output the results in case it exists.
# Format is: cache "$basename_to_cache_in" $cmd $arg1 $arg2 $arg3...
    local cache_fn="$1"

    local dir="${CACHE_DIR:-.}"

    if ! test -d "$dir"; then
        mkdir -p "$dir"

    local fn="$dir/$cache_fn"
    if ! test -f "$fn" ; then
        "$@" > "$fn"
    cat "$fn"

Hope you find it useful.

(Note: part of the reason why I'm writing this post is to see if it shifts away the spam comments from my previous post, which attracted a lot of spam in the past days. It's an experiment to see how spam behaves.).

Syndicated 2012-09-01 15:05:58 from shlomif

Tech Tip: debugging Ruby’s rspec scripts

This post will cover how to debug test scripts (and their equivlent production code) of the Ruby programming language’s RSpec framework using an interactive debugger, which was a problem I've ran into lately when working on some Ruby code. Most of the other posts I found about the topic were either incomplete or out-of-date, but I got some help from #ruby-lang on Freenode, so I was able to figure it out.

What you should do is:

  1. install the ruby-debug gem: gem install ruby-debug.

  2. Add require 'ruby-debug' to the top of the test script.

  3. Add a debugger statement to lines where you want to place a breakpoint. This is important because otherwise the debugger will never stop. (I am unhappy with it.)

  4. Use the --debug flag in rspec: rspec --debug t/parse-board.rb.

After doing all that it worked for me, so now I'm happy.

Copyright and License

The text is copyrighted by Shlomi Fish, and is made available under the Creative Commons Attribution License 3.0 Unported (or at your option, any later version). In order to attribute the text to me (= Shlomi Fish), please link to this page and to my homepage.

Syndicated 2012-08-18 11:13:06 from shlomif

669 older entries...

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!