Older blog entries for shlomif (starting at number 684)

Tech Tip: Overriding the Audio Track of a Video using ffmpeg

In this tip I will cover how to use ffmpeg to override the audio track of a video from a different audio track (such as the one in a WAV, an OGG or an MP3 file). To do that use the following recipe (based on this out-of-date blog post and some help from ubitux on #ffmpeg, with a lot of trial and error):

ffmpeg -i in_audio.wav -i in_video.ogv -map 0:0 -map 1:1 -shortest \
    -c:a libvorbis -q:a 7 -c:v copy output.ogv

Some of these files are not needed if you're not dealing with Ogg Video files. -shortest is useful for making sure that the length of the output is trimmed to that of the shortest input.

I ended up using this command for the latest screencast I prepared. Cheers, and happy holidays.

Syndicated 2012-12-10 16:59:01 from shlomif

Freecell Solver 3.16.0 was Released + New Screencast

Freecell Solver version 3.16.0, has been released. Freecell Solver 3.16.0 is available in the form of a source archive, from the download page. Freecell Solver is an open source framework (library and some command line applications), for automatically solving several variants of card Solitaire / Patience games, including Freecell.

This new release took about a month to prepare, and also contains less profound changes than the previous release, but still quite a lot to look for. It features the -l micro-finance-improved and -l qualified-seed presets, which improve upon the average solution length (at the expense of speed). The --flares-choice flag was added and one can specify --flares-choice fcpro to choose based on the lenght of the Freecell Pro moves. Another additional flag is --flares-iters-factor which multiplies the time the flares run at by a factor for a speed/solution-length trade-off.

Finally, the inidividual flares are now recycled and their memory is reused when they are no longer needed which yields a RAM optimisation in certain cases.

More information about all these can be found in the distributed documents of Freecell Solver.

In addition to all that, a new screencast of PySolFC solving Freecell using Freecell Solver is now available on YouTube. Make sure you expand the details for all the credits of the software and other material that was used for its creation.

Enjoy and happy holidays.

Syndicated 2012-12-10 13:19:00 from shlomif

Why I Don’t Trust Non-Open Source Software

Today I’m going to explain in a dedicated entry, why I do not trust programs that are not Free and open-source software (FOSS) and instead are more restricted. I have previously told that story as part of a different essay, but it was easy to miss.

In any case, the BitKeeper version control system is now quite obscure, due to the advent of quality distributed open-source systems such as Git and Mercurial, but some years ago it was used by many developers of the Linux kernel, and the demise of its gratis version was in fact the impetus for the creation of Git, and later Mercurial. Some time, before Linus Torvalds adopted it, I ran into a limitation of CVS, an open-source version control system, that was then popular, and was looking for an alternative, and after reading an out-of-date article about BitKeeper (which said its source was available under a mostly open source licence), decided to use it and its bkbits.net service.

At first, I was quite happy using it for some of my projects, but then I posted a question to the mailing list, asking where I can find the source, which was implied to be available on the BitKeeper site. Larry McVoy (BitKeeper's main creator and maintainer) answered by saying that they decided for removing the source code, because some users modified it to remove the restrictions, and allowed them to abuse the licensing of the gratis version and prevent them from paying for the commercial version. He also noted that availability of source, meant that, in practice, your software was Public Domain, and that they provide the sources for people they can trust, in private.

At that point, I figured out that I don't have an immediate need for the source, and that perhaps in the future, I can win BitMover (= BitKeeper’s parent company) trust and gain access to it. So I continued using BitKeeper.

That changed, however, when Mr. McVoy announced a licence change to BitKeeper (while requiring all users of the gratis version to upgrade) that I found unacceptable, and caused me to seek a different alternative. This caused an unpleasant exchange between me and the BitKeeper developers, and made me lose some of the repositories I hosted on bkbits.net.

From that moment on, I realised that I cannot really trust non-open-source software, because even if I am allowed to continue to use its previous version after a licence change, then it may accumulate bugs or stop being runnable on my systems, or stop being supported, and I cannot risk it. To quote Richard Stallman: “Every non-free [= non-FOSS] program has a lord, a master — and if you use the program, he is your master”.

The end of the BitKeeper story, was that after evaluating a few open-source alternatives, I settled on using the open-source Subversion, and later on also started using Mercurial and Git. Furthermore, from then on, I often refused to look at and evaluate proprietary programs. Lately, many open-source developers have been infatuated with Sublime Text, but I am not willing to even try it, because it is not open-source, so I will never have to depend on it.

Despite all that, I still license my original software under non-Copyleft licences, because the GPLv2 and the GPLv3 are incompatible, both with one another, and with many other open-source licences, and because I know of at least three different interpretations to the GPL ( GNU’s one in the GPL FAQ, the Linux kernel's one, and the draconian Nmap interpretation), and because I want my code to be of the maximal available use without the need to consult a lawyer, and because I don't want to be worried about how it will possibly be abused, when I don't care if it will. I'm still using GPLed software, in the hope that I won't get sued.

To sum up, I do not wish to rely on non-FOSS, because it may mean these software applications later becomes unavailable to me, in a similar manner to what was the case with BitKeeper. I hope you can relate to that, and if not, you may likely run into a similar situation in the future, as well also the case for the Linux kernel project, with the demise of the gratis BitKeeper altogether.

Syndicated 2012-11-19 10:34:13 from shlomif

Freecell Solver 3.14.1 was Released

Freecell Solver version 3.14.0, shortly followed by Freecell Solver 3.14.1, which fixed a build problem on Microsoft Windows, have been released. Freecell Solver 3.14.1 is available in the form of a source archive, and a Win32 self-installing executable, from the download page. Freecell Solver is an open source framework (library and some command line applications), for automatically solving several variants of card Solitaire / Patience games, including Freecell.

This release features several new features: we added a 6th Best-First-Search weight of the inverse of the number of cards not above parents, which has proven useful. We now also allow test groups inside the --tests-order and --depth-tests-order with the random-dfs scan to be ordered using the function =asw(…) based on those BeFS weights.

As a result, the preset -l amateur-star or -l as for short has been added, that uses that and is our fastest preset yet. Another new preset is -l micro-finance (or -l mf for short), which yields especially short solutions.

There are also some not-as-major features: input boards can now contain a leading colon (":") at the beginning of the line of columns, so they can be copy-and-pasted directly from the output of fc-solve with the -p flag. The dbm_fc_solver and depth_dbm_fc_solver now store the positions more compactly (which aided in researching two-freecell deals), and the core libfreecell-solver code was made more 64-bit enabled and many of the limits were converted to 64-bit friendly ones.

A final note: we have dropped support for building Freecell Solver with Microsoft Visual C++ and other non-GCC compatible compilers, which do not support the newer C standards, and other useful features of GCC. Building Freecell Solver with GCC, clang and other compatible compilers will be continued to be supported on Microsoft Windows as well as on Linux and other UNIX-like systems.

More information about all these can be found in the distributed documents of Freecell Solver.

Enjoy!

Syndicated 2012-11-04 16:22:00 from shlomif

Why Java Sucks for Cross-Platform GUI

When the Java programming language first became publicised, it was heralded as the dawn of a new age of writing cross-platform programs. “Write once, run everywhere” they said. Now, 16 years after 1996, which was roughly when the Java hype started, I’d like to check if it delivered on this promise, by seeing if one can easily write a cross-platform GUI (= Graphical User-Interace) application using it. What I’m looking for is a Java GUI library that: 1. Compiles. 2. Is cross-platform. 3. Does not suck. Teaser: I was not able to find one.

The standard Java SWING toolkitis out-of-the-question due to its weird look and feel and crappy behaviour everywhere. Joel on Software has this to say about SWING:

If you still think that something as small as how long you hold down the Alt key when you activate a menu command doesn't matter, well, your software is going to make people unhappy. These tiny inconsistencies are what makes Swing applications so unbearably annoying to use, and in my opinion it's why there are virtually no commercially successful Java GUI applications.

(From the book reviews, there's more criticism of it in “Lord Palmerston on Programming”.)

I too have been frustrated by the unusable Java SWING GUIs, and in one of the latest projects I am contributing to, which has already been written in Java, I ran into a particularly buggy SWING UI.

The Eclipse people implemented something called SWT, but according to the wikipedia, it has several limitations, and require writing a lot of platform-dependent code.

Next are the Qt bindings to Java - Qt Jambi. These require customising the build.properties (whereas the error and documentation says one should edit the buildpath.properties file), and after that fails compiling with this error:

[make] ../../generator/out/cpp/com_trolltech_qt_core/
qtjambishell_QFutureIterator.cpp:21:15: error: no matching
function for call to ‘QFutureIterator::QFutureIterator()’

Next I looked into java-gnome, but apparently it does not work on Windows, so it's not cross-platform.

And the Java bindings for wxWidgets offer wxJava, which is Windows-only and unmaintained, and wx4j and jwx!, which are unmaintained and no longer build.

So I think that leaves us with nothing. How sad. Compare that to the comprehensive coverage of Mono’s GUI toolkits, many of which are cross-platform, and to the situation in other languages such as Perl or Python, and you'll see that Java sucks the most in this respect.

Syndicated 2012-10-20 10:49:19 from shlomif

Tech Tips: Vim, Facebook and Firefox’s Personas Rotator Extension

Here are three tech tips, that I felt did not necessitate their own entry.

In the Vim text editor(homepage), one can use the keybinding Ctrl+W ; O to close all windows except the current one, which will be the only one left open (hence the "O").

In Facebook (Wikipedia page) one can use Shift+Enter to start newlines in the messages you compose in the site’s composer. Press it twice to start a new paragraph.

If you are using Firefox’s Personas Rotator Extension ( Addons.mozilla.org page), then you can switch the currently shown persona ( in case you don't want it at the moment) using Ctrl+Alt+P or an alternate configurable keybinding. I discovered this latest tip by accident and can no longer imagine my life without it.

Cheers!

Syndicated 2012-10-18 21:11:55 from shlomif

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:

Enjoy!

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

675 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!