Older blog entries for ralsina (starting at number 341)

Myckey Mouse explains the Large Hadron Collider problems

You may have heard about the possibility that the Large Hadron Collider is being sabotaged from the future.

That may sound preposterous, but it really is quite reasonable, once you think about it a little.

Let's start with the obvious:

Suppose you travel back in time and kill your grandfather. Then you wouldn't exist. And you couldn't travel back in time. And that's a paradox.

Then there is the anti-paradox:

Suppose you can't travel back in time. Because you didn't save him, your grandfather died. Ergo you don't exist.

That's not a paradox, but suppose time travel is possible: that means you can go back in time, save your grandfather, and thus make your own existence possible, ergo allowing you to save him.

As soon as you allow for time traveling to be possible, the solution for paradoxes is obvious: you can´t change change the past because the future won't let you. The future "faction" that tries to preserve the past will always win, because the past is fixed.

So, if you travel back in time and try to kill your grandfather by shooting him in the head, another person from the future will appear behind you and disarm you. Or appear behind you and kill you as soon as you had the idea to travel in time in the first place.

Or your kid will drop a coke bottle on your time machine just before you used it to kill his great-gramps.

The exact mechanism used to prevent you from becoming a paradox is unknown to you because you need to go further "forward" to know it.

Now, back to the LHC: if in the future there is knowledge about time travel, and there is knowledge about how the LHC may destroy the world[1]_ then maybe some time tourist decided to see how humanity dressed in the pre-ice-age era, comes to 2009 and while eating a sandwich, somehow spooks a bird which then drops a piece of bread in the machinery.

Which of course, brings me to the best time-travel show on TV: "Mickey Mouse Clubhouse".

If you don't have an under-4 kid, grandson or nephew, you probably don't know it, but let me give you a summary of each darn episode.

  1. Something "bad" happens (Goofy has a cold)
  2. A solution is proposed (Give Goofy some Minniestrone soup)
  3. A flying ideogram of a mouse called Toodles shows a collection of tools:
    • Giant candy cane
    • Roller skates
    • Picnic basket
    • Seesaw
  4. Something else "bad" happens (Pete wants the soup)
  5. The tools are exactly what's needed to solve the problems presented to accomplish the proposed solution (You can use the seesaw to move giant rocks blocking your path).

This is obviously a case of the future preventing something from happening. How else would Toodles know what tools to choose before they are needed? There was no way to guess that a giant rock would block the ravine through which Mickey and Minnie would try to escape from Pete! [2]

So, whenever you need to think about paradox prevention, remember Mickey and his friends and just call Toodles.

[1] No, I don't think the LHC would destroy the world.
[2] Also, that part shows a complete ignorance of how leverage works.


Syndicated 2009-11-06 12:00:25 from Lateral Opinion

24-hour app #1: Die Schere, a video editor

I have long known that application development is an arduous process. I have also long suspected one of the reasons it's arduous is the developer. I should be more specific, I am one of the reasons.

That's because I don't know what I am doing, and I don't mean that in the "I am a lame programmer" sense (even if that's also true somewhat), but in the sense that I literally don't know what the app should look like, or what its feature set should be.

So, I have decided to embark on a series of experiments I will call 24-hour apps.

Here are the rules:

  • I shall create a neat application, stable, useful, usable and decent-looking.
  • I shall do it in no more than 24 hours. After that time, it should be at least good enough for a preview release, if not a beta.
  • Those 24 hours can be split in two or three sessions
  • Time spent doing icons, docs, etc, counts.
  • All development shall be public (I am using github)
  • I must have a use for the resulting application, and it should be at least an adequate solution for that problem.

So, what's the first project? I call it Die Schere (The Scissors in german) and it's a video editor.

It's not a kdenlive replacement, it's just the video editor I wish I had when I needed to glue a piece of one video with a piece of another.

In the old, pre-digital world, that was done using a cutter and scotch tape. I want Die Schere to be as useful and comprehensible as that was, but useful for clumsy people like myself.

Here is a video after today's session, which lasted 8 hours:

The basic functions are there, even if lots of work is still needed.

  • You can load clips to work with them
  • You can cut clips (like using a cutter!)
  • You can choose the cut points interactively or by editing a time
  • You can arrange them (like using scotch tape!)
  • You can generate the output video

As a backend it's using mencoder, but there's no reason it shouldn't work with ffmpeg or melt if someone writes 20 lines of code.


Syndicated 2009-10-23 23:27:27 from Lateral Opinion

Simple KDE Trick #2: using remote desktops with avahi, krfb and krdc

Most people nowadays have more than one computer. Often, you are using one, and would like to do something in another. In this video, I will explain how trivial it is to do that without leaving your seat in a modern Linux using KDE.

We will use the following:

  • Avahi, a zeroconf implementation to let you find your computers in your network without worrying about IP addresses, DNS, etc.
  • krfb, the KDE Remote Frame Buffer. This is a program to share your desktop over the network.
  • krdc, the KDE Remote Desktop Client, a VNC, RDP client, which is what you use to see a desktop shared via krfb.

I am sure users of other operating systems or desktop environments will say they can do it just as easily. In that case, feel free to do your own videos ;-)

Keep in mind that accessing remote desktops over the internet is a whole different beast, and this solution is not meant for that case.

As usual, this video was recorded using qt-recordmydesktop. There was minor editing using mencoder.

The computer used is the original Asus eee PC 701 4G, so you can see this is not exactly a hardware-intensive operation. I find the eee's small screen is great for this kind of full-screen demo, because it's not big enough to drown the important parts.


Syndicated 2009-10-20 21:31:54 from Lateral Opinion

rst2pdf 0.12.2: minor bugfix release

I just uploaded rst2pdf 0.12.2 to http://rst2pdf.googlecode.com Rst2pdf is a tool to generate PDF files directly from restructured text sources via reportlab.

This release fixes a major bug (incompatibility with reportlab 2.1) as well as several minor ones and adds a minor feature (better styling of list items).

For more details, you can see the changelog


Syndicated 2009-10-19 11:30:17 from Lateral Opinion

rst2pdf 0.12.1: minor bugfix release

I just uploaded rst2pdf 0.12.1 to http://rst2pdf.googlecode.com

Rst2pdf is a tool to generate PDF files directly from restructured text sources via reportlab.

This release has no new features, just a few bugs fixed.

For more information, see the changelog


In another rst2pdf-related note: someone at the Universitat Politecnica de Catalunya likes rst2pdf :-)


Syndicated 2009-10-13 23:21:42 from Lateral Opinion

rst2pdf 0.12 released!

It's my pleasure to announce the release of rst2pdf version 0.12, available at http://code.google.com/p/rst2pdf/downloads/list

Rst2pdf is a tool to generate PDF files directly from restructured text sources via reportlab.

Rst2pdf aims to support the full restructured text feature set, and is very close to that goal, while also including some of the more experimental features, like a source code directive with syntax highlighting and math notation support with LaTeX-like syntax.

It supports embedding arbitrary fonts, both True Type and PS Type 1, both raster and vector images (including SVG and PDF), page transition effects, multiple, flexible page layouts, cascading styles, and much, much more.

This version includes many bugfixes and MANY new features compared to the previous 0.11 version, including but not limited to better styling, integration with sphinx, a very raw, preliminar graphical frontend called bookrest, kerning support (via wordaxe), and a much more powerful table implementation.

In fact, this release has so much new code it needs testers! I would consider it beta quality, and may (probably will) have some rough spots.

You can find more information about rst2pdf in its home page ( http://rst2pdf.googlecode.com), and ask anything you want in the rst2pdf-discuss mailing list (http://groups.google.com/group/rst2pdf-discuss)

A list of improvements and changes in this version is just too long, but is available at the changelog

I hope you enjoy this program!


In other news, Google just found me two nice things related to rst2pdf:

  1. A tutorial to use sphinx and rst2pdf for japanese texts: http://d.hatena.ne.jp/MiCHiLU/20091009/1255065687
  2. It looks like a rst2pdf 0.11 binary for windows is shipped by pythonxy here: http://code.google.com/p/pythonxy/downloads/detail?name=rst2pdf-0.11_py26.exe I will link to that!

I love when people do things like these :-)


Syndicated 2009-10-09 23:12:31 from Lateral Opinion

Bookrest: the stylesheet editor in action

As usual, a video showing it:

The current status is that the infrastructure required for the stylesheet editor is in place:

  • I figured out how to turn the StyleSheet object back into a JSON stylesheet.
  • The changes are done and merged back into the same file.
  • There is UI for 3 of the 6 required pieces. The missing ones are text styles, embedded fonts, and config options (like, break subsections to odd pages)
  • The UI for the whole app is pretty rough, I am in full make-it-functional mode right now. It will be rethought later on.


Syndicated 2009-10-02 22:58:02 from Lateral Opinion

Video: My lightning talk about Peter Norvig's spellchecker (in spanish)

Thanks to Nicolás Pace, I got a video of the Pycon Argentina 2009 lightning talks.

So, after fighting my ignorance of video editing, here is my own talk, about Peter Norvig's spellchecker, spliced with the slides.

If you want a better quality version of the slides, they are here

There is a problem in that no matter how I cut the original hour-long video, regardless of what tool I use, the sound gets out of sync, so I look kinda odd. I will try to do another version from the original video later on.

So, here it is:

Edited with kdenlive: crashy but cool and easy


Syndicated 2009-10-02 12:27:32 from Lateral Opinion

Dear Lazyweb, what's the pythonic cross-platform fc-match?

Here's what fc-match does:

$ fc-match "Droid Sans"
DroidSans.ttf: "Droid Sans" "Regular"

Or even:

$ fc-match "Droid Sans" -v | grep file:
      file: "/usr/share/fonts/TTF/DroidSans.ttf"

So, how does one do that, going from a font family name or font name to a font file, where there's no fontconfig?

I found code for this in matplotlib's font_manager module but it looks hard to untangle, and requiring matplotlib is a bit over the top.

If there's no portable solution, I would be happy enough with three standalone solutions instead, and promise to publish an abstraction layer over them ;-)

So, dear windows and mac pythonistas, any pointers?


Syndicated 2009-09-30 00:07:31 from Lateral Opinion

Bookrest: it was meant to be a stylesheet editor.

In my original post about it I was referring to Bookrest as a stylesheet editor for rst2pdf, because that's what I wanted, a way to test style changes and see what they did.

Of course, one thing lead to another and it's starting to look more like a word processor than anything else, but ... well, how about a stylesheet editor?

Sure, you can use the "Style" tab, and edit at will, but that's not exactly fun for everyone.

So, let's work on one. Here's the video of the current status:

Of course, this is about 1/20th of the stylesheet editor, but at least the dialog is there, and most of the remaining work is wiring dialogs, which is quick using designer.


Syndicated 2009-09-28 11:24:05 from Lateral Opinion

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