Marcos Dione: ayrton-0.8-Home-Sweet-New-Home

Long time for this release. A couple of hard bugs (which fix was just moving a line down a little), a big-ish new feature, and moving in a new city. Here's the ChangeLog:

  • You can import ayrton modules and packages!
  • Depends on Python3.5 now.
  • argv is not quite a list: for some operations (len(), iter(), pop()), argv[0] is left alone.
  • option() raises KeyError or ValueError if the option or its 'argument' is wrong.
  • makedirs() and stat() are available as functions.
  • -p|--pdb launches pdb when there is an unhandled exception.
  • Fix for line in foo(...): ... by automatically adding the _bg=True option.
  • Better Command() detection.
  • A lot of internal fixes.

Get it on github or pypi!


python ayrton

Juanjo Conti: Goodreads review: Crímenes imperceptibles (Guillermo Martínez)

Muy bueno.

Lo considero una continuación de otra novela del autor: Acerca de Roderer. Y la supera en varios cuerpos.

Uno de los detalles más brillantes es que en varias partes de la novela, cuando se habla de los crímenes, se está hablando en realidad del libro.

La próxima novela del autor que pienso leer es Yo también tuve una novia bisexual. Libro que sospecho como una tercera parte de estas historias donde confundo al autor con el protagonista.

UPDATE: vi la película. La novela es superior en todos los aspectos excepto en uno. SPOILER ALERT. Cuando leen el perfil psicológico del asesino, se da a entender que el protagonista es sospechoso y que lo hace como una forma de cortejo hacia el matemático Seldom. Es muy divertido.

Rating: 4/5

Original: https://www.goodreads.com/review/show/1727226022

Mariano Guerra: Ricardo Forth: a Forth implemented in C, JS, WebAssembly and compiled from C to asm.js and WebAssembly

It comes a time in the life of everyone when you implement a Forth.

The time has come for me.

Presenting Ricardo Forth:

A Forth dialect implemented in C, Javascript, WebAssembly and compiled from C to asm.js and WebAssembly.

This project is based on the 1992 IOCCC entry buzzard.2 (design notes: buzzard.2.design), prettified and then compiled to:

Also reimplemented by translating the C code into Javascript and WebAssebly.

Go check it out if you are curious about asmjs, WebAssembly, Forth or Emscripten/Binaryen.

Mariano Guerra: Ricardo Forth: a Forth implemented in C, JS, WebAssembly and compiled from C to asm.js and WebAssembly

It comes a time in the life of everyone when you implement a Forth.

The time has come for me.

Presenting Ricardo Forth:

A Forth dialect implemented in C, Javascript, WebAssembly and compiled from C to asm.js and WebAssembly.

This project is based on the 1992 IOCCC entry buzzard.2 (design notes: buzzard.2.design), prettified and then compiled to:

Also reimplemented by translating the C code into Javascript and WebAssebly.

Go check it out if you are curious about asmjs, WebAssembly, Forth or Emscripten/Binaryen.

Juanjo Conti: Semana de trabajo en México

Ya hace casi 6 meses que estoy trabajando, muy contento, para Mozio.

La semana pasada nos juntamos en México para trabajar y vernos las caras los que no nos conocíamos. Una experiencia invaluable. Dejo algunas fotos:

PS: tomé notas que eventualmente servirán para una novela.

Juanjo Conti: Estuve posteando en Facebook

Este post tendría que haber salido antes de viajar, pero no salió. Los últimos 3 textos que escribí con "vuelo literario" no los publiqué acá, sino en Facebook.

(aca iría un meme gracioso, te lo debo)

Dejo los links para no perderlos:

PS: este blog se va convirtiendo en una reserva de notas para mí.

Damián Avila: RISE 4.0.0b1 is available, please test it!

Quick post! I have beta packages available for you to test RISE, if you can test it that would be awesome!!

In case you don't know about it, with RISE you get your Jupyter notebook rendered as a Reveal.js-based slideshow, where you can execute code on the fly or show to the audience whatever you can show/do inside the notebook itself (but in a "slidy" way).

How you can get it?

Read more… (1 min remaining to read)

Marcos Dione: adding-columns-from-osm-to-postgis-with-osmium

My latest Europe import was quite eventful. First, I run out of space several times during the import itself, at indexing time. The good thing is that, if you manage to reclaim some space, and reading a little of source code[1], you can replay the missing queries by hand and stop cursing. To be fair, osm2pgsql currently uses a lot of space in slim+flat-nodes mode: three tables, planet_osm_node, planet_osm_way and planet_osm_relation; and one file, the flat nodes one. Those are not deleted until the whole process has finished, but they're actually not needed after the processing phase. I started working on fixing that.

But that was not the most difficult part. The most difficult part was that I forgot, somehow, to add a column to the import.style file. Elevation, my own style, renders different icons for different types of castles (and forts too), just like the Historic Place map of the Hiking and Bridle map[2]. So today I sat down and tried to figure out how to reparse the OSM extract I used for the import to add this info.

The first step is to add the column to the tables. But first, which tables should be impacted? Well, the line I should have added to the import style is this:

node,way   castle_type  text         polygon

That says that this applies to nodes and ways. If the element is a way, polygon will try to convert it to a polygon and put it in the planet_osm_polygon table; if it's a node, it ends in the planet_osm_point table. So we just add the column to those tables:

ALTER TABLE planet_osm_point   ADD COLUMN castle_type text;
ALTER TABLE planet_osm_polygon ADD COLUMN castle_type text;

Now how to process the extract? Enter pyosmium. It's a Python binding for the osmium library with a stream-like type of processing à la expat for processing XML. The interface is quite simple: one subclasses osmium.SimpleHandler, defines the element type handlers (node(), way() and/or relation()) and that's it! Here's the full code of the simple Python script I did:

#! /usr/bin/python3

import osmium
import psycopg2

conn= psycopg2.connect ('dbname=gis')
cur= conn.cursor ()

class CastleTypes (osmium.SimpleHandler):

    def process (self, thing, table):
        if 'castle_type' in thing.tags:
            try:
                name= thing.tags['name']
            # osmium/boost do not raise a KeyError here!
            # SystemError: <Boost.Python.function object at 0x1329cd0> returned a result with an error set
            except (KeyError, SystemError):
                name= ''
            print (table, thing.id, name)

            cur.execute ('''UPDATE '''+table+
                         ''' SET castle_type = %s
                            WHERE osm_id = %s''',
                         (thing.tags['castle_type'], thing.id))

    def node (self, n):
        self.process (n, 'planet_osm_point')

    def way (self, w):
        self.process (w, 'planet_osm_polygon')

    relation= way  # handle them the same way (*honk*)

ct= CastleTypes ()
ct.apply_file ('europe-latest.osm.pbf')

The only strange part of the API is that it doesn't seem to raise a KeyError when the tag does not exist, but a SystemError. I'll try to figure this out later. Also interesting is the big amount of unnamed elements with this tag that exist in the DB.


[1] I would love for GitHub to recognize something like https://github.com/openstreetmap/osm2pgsql/blob/master/table.cpp#table_t::stop and be directed to that method, because #Lxxx gets old pretty quick.

[2] I just noticed how much more complete those maps are. more ideas to use :)


openstreetmap gis python

Juanjo Conti: Goodreads review: Acerca de Roderer (Guillermo Martínez)

Me gustó, pero no tanto. Se nota que es una primera novela, con partes que sobran y desarrollos apresurados.

Por ejemplo, el capítulo sobre la chica que muere de anorexia nerviosa y el capítulo en el que el protagonista va a pelear a Malvinas sin que antes se hubiese si quiera mencionado que el país estaba bajo una dictadura.

Me gustó toda la descripción del pueblo y las personas que lo habitan.

Rating: 3/5

Original: https://www.goodreads.com/review/show/1723954363

Marcos Dione: our-man-in-marseille

Remember this?

For a few months now I've been trying to have a random slideshow of images. I used to do this either with kscreensaver, which for completely different reasons I can't use now, or xscreensavers' glslideshow, which, even when I compiled it by hand, I can't find the way to give it the root dir of the images. So, based on OMIT, I developed my own.

The differences with OMIT are minimal. It has to scan the whole tree for finding the appropriate files (its definition of "appropriate" could be improved, it's true); it goes into full screen mode with black background; and it (more) properly handles EXIF rotation[1]. All that in 176 LOCs, including proper licensing (GPLv3), and developed in one day and refined the next one.

One interesting thing I found out is that pyexiv2 is deprecated, with is last release in 2011 (!!!). What this new app uses is its recommended replacement, gexiv2.

So, there you are. Like OMIT, it's in PyQt4, but this time in Python3 (that's why I used gexiv2 instead). Its TODO includes porting it to PyQt5 and a few other things. You can grab it here. I plan to do a proper release soon, but for the moment just drop it in your PATH and be happy with it.


[1] http://www.daveperrett.com/articles/2012/07/28/exif-orientation-handling-is-a-ghetto/


omit omim pykde python