Skip to main content

Ralsina.Me — Roberto Alsina's website

Posts about python (old posts, page 63)

Free software is good for me.

I make a liv­ing work­ing with free soft­ware (BTW, if you need sysad­mins that know what they do, con­tact us:­man­ager­s.­

But that's not that big a deal, I could make a liv­ing do­ing some­thing else. I am sure I would be com­pe­tent at some­thing else, even if I have no idea what that would be right now.

It does, how­ev­er give me free­dom to play, which is much more im­por­tan­t. There­fore, this post is sort of a sta­tus up­date on things I play with. Not games, those are not re­al­ly my thing, but things that I do for fun.

Yes, some of these may mean I am a very strange per­son.

I'll lim­it my­self to the last cou­ple of weeks or so.

There's been sort of a bump in in­ter­est in Mar­ave, my dis­trac­tion free ed­i­tor and it's be­cause it has been re­viewed in Lin­ux Jour­nal!

I have read the ar­ti­cle (sad­ly I can't link to it) and it was a su­per pos­i­tive re­view, here are some choice quotes:

"mar­ave makes the dull world of text edit­ing ro­man­tic and im­mer­sive with beau­ti­ful min­i­mal­is­m"

"... it does­n't just have min­i­mal­ism and sim­plic­i­ty, it has min­i­mal­ism and sim­plic­i­ty com­bined with beau­ty and a pal­pa­ble de­sign eth­ic. mar­ave has soul, and I love that."

So thanks for the kind words to the au­thor, and some­thing I no­ticed: you ran in­to a big bug in mar­ave and did­n't no­tice :-)

The "crick­et bat" icon (it's a screw­driv­er ;-) should show you the con­fig di­a­log. How­ev­er, it seems in Ubun­tu (and maybe in oth­er dis­tros, I don't know) the con­fig is not vis­i­ble,and all you see is the text move around a bit. This is what he should have seen:


I have nev­er been able to re­pro­duce it, but I am go­ing to in­stall a Ubun­tu VM just for this, so maybe soon.

On re­lat­ed news, mar­ave was al­so re­viewed in a ger­man mag­a­zine a cou­ple of months ago, and I have not been able to get a copy of the ar­ti­cle. (BTW, is­n't it rea­son­able to send a copy of these to the au­thor of the pro­gram you are re­view­ing? Nei­ther mag­a­zine even men­tioned it to me!)

In any case, if any­one has this mag­a­zine and can tell me what the ar­ti­cle about dis­trac­tion-free ed­i­tors say, you will make my day:

Here's the ar­ti­cle teas­er

And this seems to be the mag­a­zine is­sue:

On new projects (yes, I al­ways have new pro­ject­s), I ran in­to this awe­some blog post by Roger Als­ing about ap­proach­ing Mona Lisa with just 50 poly­gons <http://roger­als­ing.­com/2008/12/07/­ge­net­ic-pro­gram­ming-evo­lu­tion-of-­mon­a-lisa/ > and be­ing a nerd and hav­ing awe­some pro­gram­ming tools at my com­mand... I wrote a frame­work to test that kind of al­go­rithm­s.

I called it evo­lu­to and it's at http://evo­lu­to.­google­code.­com.

I on­ly did a very sim­ple al­go­rith­m, based on translus­cent tri­an­gles, but it did work... for some def­i­ni­tion of work!

You can even see the lo­cal min­i­mum that does­n't let her right eye form right :-)

Evo­lu­to has a li­brary of al­go­rithms (cur­rent­ly emp­ty) and you can ed­it and reap­ply on-the-fly the one you wan­t, and see the gen­er­a­tions change on-screen.

It would take some work to make it a pol­ished pro­gram, but it does work.

I folled around a bit with cre­at­ing a nice PDF pre­sen­ta­tion play­er but it's still very ear­ly:


In what's per­haps my most es­tab­lished pro­jec­t, rst2pdf. I have fixed a bunch of bugs, and a re­lease is a bit over­due:

Issue 186: Text not wrapping around images when specified

I fixed this by adding a new CLI op­tion, so be­hav­iour was not changed, but now you can have im­ages with text flow­ing be­side it. It will not look great but it work­s.

Issue 307: Replace directive doesn't replace text in header/footer in some cases

This was an in­ter­est­ing prob­lem! It was very en­ter­tain­ing.

Made it work with Sphinx 1.*

There is a piece bro­ken stil­l, but what I fixed was not ter­ri­bly hard.

Unbroken bookrest

I need to work much more with this, but at least what worked be­fore works again. If you don't know what bookrest is, it's a rst2pdf graph­i­cal fron­tend / word pro­ces­sor, here's a taste:

I al­so made sev­er­al re­leas­es for my AUR pack­ages

Plus I worked, and some oth­er stuff. All in al­l, not a bad stretch.

Random photos from my phone

A few days ago I fi­nal­ly got my 89 cents blue­tooth don­gle (now $1.85, but still with free ship­ping from chi­na!) and got a bunch of pic­tures I had in my phone.

The qual­i­ty is crap be­cause my phone is crap, but trust me, there must be one thing here you have nev­er seen be­fore.

Here they are: weird stuff that made me take out my phone and grab a pic­ture, with ex­pla­na­tion­s.


This, from Mar del Plata, is the most badass pop­up book I ev­er saw.



And open:


I'm Mark Shuttleworth!

Imagen024 Imagen025

In a free soft­ware event in Buenos Aires, Canon­i­cal's boss and for­mer space car­go was sup­posed to de­liv­er the key­note. He can­celed at the last minute. So Mad­dog Hall of­fered to re­place him... in char­ac­ter.

Some­one found a re­al­ly, re­al­ly awe­some (and/or crap­py!) as­tro­naut cos­tume, and Mad­dog gave a key­note shout­ing "I'm Mark Shut­tle­worth! I'm an as­tro­naut!" and claim­ing to have come from the fu­ture to ex­am­ine some slides re­cent­ly found, writ­ten by some un­known dude named Mad­dog. Re­al­ly fun­ny stuff.

Python vs. Ruby

Same even­t, take a look:

Imagen023 Imagen022

Yes, I swear they are tak­en with less than 10 sec­onds of one an­oth­er.


Imagen018 Imagen026

I was buy­ing gro­ceries in San Isidro's Dis­co su­per­mar­ket. Yes, usu­al­ly buy­ing a large pack­age of but­ter is cheap­er per ki­lo than a small one. But here, a 200g pack­age cost­ed al­most the same as a 100g! That's just steal­ing mon­ey from those who don't use much but­ter. Me? I'm not at risk.

Visa discount!


This was a shop in Aveni­da Alem in Buenos Aires. It was un­usu­al to see a "VISA is sus­pend­ed, 20% dis­coun­t" sign. Much more un­usu­al was to see the small let­ter­s: "p­re­sent your visa card". I mean, was­n't it sus­pend­ed?

And then I saw the rest:


It says "p­re­sent your visa card and pay us­ing any­thing else".

That guy must re­al­ly have been pissed off at Visa!

I got a bunch more for some oth­er time.

What's wrong with this dialog?

I am writ­ing a book. And I am writ­ing a chap­ter about UI de­sign. And why not use the In­ter­net?

So, go ahead and tell me all that's wrong with this di­alog!


For ex­am­ple, I don't like the dead space at the bot­tom-left, the dif­fer­en­t-­size of the "Close" but­ton, and the mis­align­ment of the icon­s.

Are those valid con­cern­s? Are there many more? Would you do it com­plete­ly dif­fer­en­t?

The book is open source, and avail­able at http://no­­man­ager­s.­ (In span­ish, sor­ry!)

I am posting very little because I am writing a lot.

I am just not writ­ing here. I am writ­ing a book in­stead.

What book am I writ­ing? A book about python pro­gram­ming, of course! It's called "Python No Muerde" (Python Does­n't Bite) and it's in span­ish.

Now, I am the first to ad­min: I am not a great pro­gram­mer. And I am not a great writ­er. But I have lots of things to say. If I can or­ga­nize them cor­rect­ly, they even make sense some­times!

So, I am giv­ing this write-­long-stuff thing a try.

Of course since I am an open source nerd, I can't do things the usu­al way, there­fore, the book is un­der Cre­ative Com­mon­s. And be­cause I am a pro­gram­mer, I hacked to­geth­er a (if I may say so my­self) de­cent struc­ture to han­dle book-writ­ing.

  1. I write in re­struc­­tured text

  2. I use rst2pdf to cre­ate PDFs both of in­­di­vid­u­al chap­ters and the whole thing.

  3. I use rest2web to cre­ate a we­b­site

  4. I use mer­cu­ri­al (at google­­code) to han­­dle re­vi­­sion con­trol and his­­to­ry.

  5. I use make to con­trol re­build­ing of chap­ters when code changes, or im­ages get up­­­dat­ed, etc.

Of course it's more com­pli­cat­ed than that, the PDFs are in the site, the site is up­load­ed via rsync, the up­loads and re­builds are trig­gered by hg push, and so on.

In any case, I may post a few times about how this whole thing work­s, here is the out­put of the ma­chin­ery:


Contents © 2000-2024 Roberto Alsina