Skip to content

Tag: Douglas Adams

1) everything that’s already in the world when you’re born is just normal;

2) anything that gets invented between then and before you turn thirty is incredibly exciting and creative and with any luck you can make a career out of it;

3) anything that gets invented after you’re thirty is against the natural order of things and the beginning of the end of civilisation as we know it until it’s been around for about ten years when it gradually turns out to be alright really.

Apply this list to movies, rock music, word processors and mobile phones to work out how old you are.

by Douglas Adams in “How to Stop Worrying and Learn to Love the Internet”, August 29th 1999.

Java: Accessing Private Members

Using reflection to change the accessibility of a private object field and access it at runtime.

import java.lang.reflect.Field;

class Life {
    private int meaning = 42;
}

class Hack {
    public static void main(String args[]){
        Life life = new Life();
        try {
            Field field = life.getClass().getDeclaredField("meaning");
            field.setAccessible(true);
            System.out.println(field.get(life));
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e){
            e.printStackTrace();
        }
    }
}

Output:

42

A trilogia de cinco livros

Os cinco livros da trilogia dos mochileiros das galáxias de Dougla Adams

Terminei de ler os cinco livros da “trilogia” do Guia Do Mochileiro das Galáxias do Douglas Adams. É uma série que eu já queria ler a um bom tempo e que eu não me arrependi.

Excelente para quem gosta de ficção científica, crítica a sociedade e muito humor.

Recomendo fortemente, principalmente porque são livros que foram lançados no Brasil a preços bem acessíveis.