Watching an interlaced DVD with MPlayer

Resuming my tech-notes blogging…

I’ve recently bought three Studio Ghibli’s movies. I don’t have a TV-set (yes, lenina, I’m still not watching any TV), so I’m watching DVDs on my laptop. DVDs I got are interlaced, when watching them on a computer, you can see small horizontal stripes along the sides of moving objects.

On a TV-set, this is not a problem, actually, interlacing makes animation on TV-set smoother. But on a computer, all you get from interlacing is stripes.

MPlayer comes with few deinterlacing plugins, from which yadif and kerndeint seem to work best (but I’m open to other suggestions). However, my video output is GL:

maciej@clover ~ $ cat .mplayer/config
vo = gl
autosync = 20
monitorpixelaspect = 1
af = volnorm=2:0.6
ao = pulse

The problem with those deinterlace filters is that they don’t cooperate with the gl video output. Fortunately, there’s an easy fix for that: append scale filter.

mplayer -vobsubid 1 -vf kerndeint,scale dvd://5

Replace 5 with your title number. The vobsubid option tells MPlayer to display subtitles. I like to watch Japanese movies with the original soundtrack and English subtitles. Usually, English dubbing reveals too much about the characters and lacks the original expression.

Scientists, share your source code

It’s a typical example: the paper is published, describing a new algorithm for data analysis. Mathematical background is described in the paper, roughly. A piece of software that implements it, is written and available for download from a web-site. You visit the web site, download it and run it. You get unexpected results. You wonder what’s happening. You go back to the site and look for the source code ― and it’s not there.

I’ve recently visited and tested two pieces of software doing basically the same thing: predicting missing genotypes. There is no source code for any of those two, and fastPHASE additionally needs you to register and accept an academic license to use it, introducing an annoying delay in obtaining the program.

By the way, why are all those scientific program names written in UPPERCASE? Because it creates an impression of IMPORTANCE? Just a side note.

Scientists work for the sake of humanity (I hope), striving to make our world a better place. Right? So why don’t they make the source code available?

Not releasing source code of scientific software is a Bad Thing, because it harms research in the field and is antisocial. The ones that lose, is the closed-source project itself, other projects in the field, and subsequently, everyone who could have benefit from the research. The only one who can possibly benefit from it, is only the author, but I highly doubt that they ever do.

Keeping the source code secret is a typical practice for corporations, who seek to profit from selling the binaries. I don’t know what business model can be built on restricted source code access in science, but I don’t think they’re every going to make any money on that.

What could be other reasons not to release the source code? Remaining the sole author, keeping all the credit? Keeping complete control? Hoping to sell license to business clients?

The main effect of making the source code unavailable is that the program internals cannot be inspected and analyzed. It’s only a binary that is available; people can obtain it and run it, without being able to modify it.

All the general arguments pro open-source software apply to the scientific software. Obstructing the software has several negative results.

  • Fewer people use the program.
  • None of the users can adapt or fix the program.
  • Other developers cannot learn from the program, or base new work on it.

I think that should be enough, but I would like to add two points that apply specifically to scientific software.

Loss of credibility

In scientific research, they key point is to prove and verify the results. With closed source, other scientists can only run the software and examine the output, without being able to check if the program really does what the paper describes. Being unable to do that, the rest of the world has to believe the authors. Do they have something to hide?

I don’t think scientists would actually question a paper as a whole because of the source code unavailability, but it certainly makes raises some concerns about its quality.

It’s antisocial

Scientific research is usually funded from government grants, which in turn come from tax payers. Scientists are not corporations who fund themselves. It’s the society, it’s the other people who effectively pay for the research (through various funding organizations), and I believe it’s a moral obligation to, if they share their research results, share them fully.

By not releasing the source code, they only make an impression of publishing their work. They can get away with that, because many people will think that, if they can download the program and run it, it’s “available”. But it’s not!

Please, dear scientists, do what guys from projects such as GNU Octave, or R project do: share your source code. Everybody will benefit from it, including your projects and yourselves.

Gentoo installation feelings

Starting from my favorite Gentoo site, I came across this site, where I found this:

“The Gentoo install was like finding a forest, cutting down the trees, breaking a leg, getting out of the hospital, coming back, taking out the stumps and clearing the land of rocks, planting wheat, building a mill, making flower, making dough, then building an oven in which to burn it to a crisp, stealing a cow, milking it, churning the butter, picking berries, making jam. YUMMY! Breakfast is ready, but you don’t have time to eat because it’s time to update everything, including GCC, which also means a complete recompilation of everything.”

ROTFL! You’ve made a good point, to a degree. But do you know what has pushed me out of Slackware?

Continue reading “Gentoo installation feelings”

Why rewrite Wengophone?

I’m still using Wengophone Classic, which works well, it just has some annoying issues.  I would expect the developers to eventually fix them, but the whole development powers are invested in the Wengophone NG (a.k.a. 2.0). So those little things will keep bothering me until the new version of Wengophone is usable, which doesn’t seem to happen soon. They publish the betas, but I neither could run the binary version nor compile the source code.

The main three problems are not that big, but since they happen very often, they get more and more annoying.

Continue reading “Why rewrite Wengophone?”

snd_intel8x0 doesn’t block anymore

Since upgrade to Ubuntu 6.06 (Dapper Drake) on my Amilo Pro V2000D, the sound doesn’t block anymore. It’s nice that all the applications can use the sound at the same time, even after switching the user — the other session is able to use the sound as well.

There is one thing that got worse after the upgrade: the sound skips sometimes. While listening to the musisc, it sometimes suddenly skips few seconds of the music. This is annoying, because then the music misses the beat and it’s destroying the pleasure of listening.

I noticed that it always (I think…) happens in the same moment: about 3 minutes 40 seconds of the song.

UPDATE: I think it’s more like 3:38. And it’s not ALSA, it Rhythmbox 0.9.5 that does that.

Convert DBF to PostgreSQL

A friend of mine just released a converter of .dbf files to PostgreSQL, under the GPL license. He writes:

This document provides a step by step instruction how to convert DBase II, DBase III+, DBase IV and (to some extent) FoxProV2 files to PostgreSQL. This solution is based on the excellent Simple DBase SQL by Michael Lecuyer.

UPDATE 2013-05-18: The link above is still valid.

Vim, UTF-8 and ISO-8859-2

How to edit with Vim an ISO-8859-2 file when my system uses UTF-8?

About four years ago I had to fiddle with Vim to make it edit an UTF-8 encoded file, while my terminal (and system) used ISO-8859-2.

I use UTF-8 as the default encoding today. How to edit with Vim an ISO-8859-2 file when my system uses UTF-8?

The first thought was to make it the same way as before, just swapping the parameter values: set encoding to ISO-8859-2 and termencoding to UTF-8. Unfortunately, it doesn’t work!

After some RTFM’ing, I learned about the fileencoding parameter, but setting it to ISO-8859-2 didn’t fix the problem. This was to be solved in a different way.

Vim will automatically guess the file encoding, as long as the encoding is listed in the fileencodings parameter. I use only UTF-8 AND ISO-8859-2 (alias LATIN2) encodings, so adding following line to the ~/.vimrc file fixed the problem:

set fileencodings=utf-8,latin2

CLIPS expert system for Gentoo

I’ve created an ebuild for CLIPS, the tool for building expert systems. After submitting the ebuild to the Gentoo Bugzilla, I was told it was a duplicate and I should’ve searched. Well, I did, but I only found Eclipse related bugs and couldn’t filter them out to see this sole CLIPS bug.

The previously submitted CLIPS (for version 6.21) bug is written better than mine. However, it won’t compile because they released the new version with the same file names, so it’s impossible to emerge it. I updated this ebuild and if you want to install CLIPS on Gentoo, it’s available.
Continue reading “CLIPS expert system for Gentoo”