1. summer readings

    August 15, 2008 by pierre

    Ian M. Banks, Consider Phlebas (thanks Jérôme!), The Algebraist. First time I read a book from the Culture cycle. The Algebraist is sci-fi as well but not from the same cycle.

    William Gibson, Pattern Recognition and Spook Country.

    Greg Egan, Riding the Crocodile and the serie Oracle | Singleton. Via Tom Moody

    Three lectures by Per Martin-Löf. “On the Meanings of the Logical Constants and the Justifications of the Logical Laws.” Nordic Journal of Philosophical Logic, 1(1): 11-60, 1996 http://www.hf.uio.no/filosofi/njpl/vol1no1/meaning/meaning.html

    Uh… this is not what I read all the time, but it happened like this.


  2. next bigger interger

    August 12, 2008 by pierre

    I’m working on PDF templates using FPDF, the templates are based on a grid and I had to find how much of the grid’s units different images are using, e.g. if an image width is 1.3 units I need to make 2 units space for it in the the grid.

    In other words I needed to “round” a floating point number, but always to a bigger number so the round php function would not be usefull :

    echo round(1.2); // 1
    echo round(1.6); // 2

    Then I thought that what I wanted was the “next bigger integer”, and it felt in place : change the float to an integer and add one.

    echo ((int) 1.2) + 1; // 2
    echo ((int) 1.6) + 1; // 2

    This is super simple but it seem to me a good exemple of how formulating what you want to do in english can help when programming.