Skip to content

Silveira Neto Posts

bug invaders

Sem dúvida os post-its nos tornam mais ágeis e são indispensáveis para metodologias que fazem uso de dashboards como Scrum. Mas o que fazer com as toneladas de post-its que são gerados e descartados? E o impacto ambiental? E o meio ambiente? E as araras-azuis?

Eis minha intervenção artística no escritório. Bug Invaders (sugestão de nome do Diego “Diegão” Andrade), nada mais justo já que umas das funcionalidades dos post-its é manter um rastro dos bugs e issues em aberto.

  • Lixo é ressignificado em arte (ao menos por um período antes de virar lixo outra vez).
  • Deixa o ambiente mais divertido.
  • Pixel art! Foram gastos 48 pixels.
  • Nostalgia.

Invictus

Poema de William Ernest Henley. Adaptação para português de André Masini retirado do casadacultura.org.

Out of the night that covers me,
Black as the pit from pole to pole,
I thank whatever gods may be
For my unconquerable soul.

In the fell clutch of circumstance
I have not winced nor cried aloud.
Under the bludgeonings of chance
My head is bloody, but unbowed.

Beyond this place of wrath and tears
Looms but the Horror of the shade,
And yet the menace of the years
Finds and shall find me unafraid.

It matters not how strait the gate,
How charged with punishments the scroll,
I am the master of my fate:
I am the captain of my soul.

Do fundo desta noite que persiste
A me envolver em breu – eterno e espesso,
A qualquer deus – se algum acaso existe,
Por mi’alma insubjugável agradeço.

Nas garras do destino e seus estragos,
Sob os golpes que o acaso atira e acerta,
Nunca me lamentei – e ainda trago
Minha cabeça – embora em sangue – ereta.

Além deste oceano de lamúria,
Somente o Horror das trevas se divisa;
Porém o tempo, a consumir-se em fúria,
Não me amedronta, nem me martiriza.

Por ser estreita a senda – eu não declino,
Nem por pesada a mão que o mundo espalma;
Eu sou dono e senhor de meu destino;
Eu sou o comandante de minha alma.

Life = Risk

A simple and beautiful video about the early failures, things and people that tries to put you down and we have to face before achieve what we really want.

“If you never failed, you never lived”

calling commands in Java

I don’t like the approach of calling native shell commands in any language instead of using multi platform libraries, but here is a little prof of concept Java program to call native commands.

import java.io.*;
import java.util.*;
public class Exec {
   public static void main(String args[]) throws IOException {
      Process proc = Runtime.getRuntime().e xec(args);
      BufferedReader br = new BufferedReader(new InputStreamReader(proc.getInputStream()));
      String line;
      while ((line = br.readLine()) != null) {
         System.out.println(line);
      }
   }
}

Usage:

java Exec VALID_COMMAND

Example:

$ java Exec echo hello
hello

ps: I had to write “e xec” instead of exec because it was triggering some very strange security protection in the blog engine here. If you need to compile this code change that. =P Also there’s no error handling, you should pass a valid command when executing this code.

Iterating over a HashMap

Iterating over a HashMap using the enhanced loop (foreach) in Java is a good way to keep your code smaller, more legible and usually more semantically coherent.

import java.util.HashMap;
import java.util.Map;

class Foo {}

public class Main {
	
   public static void main(String args[]){
      Map mHash;
		
      mHash = new HashMap();
      mHash.put((byte)1, new Foo());
      mHash.put((byte)2, new Foo());
      mHash.put((byte)3, new Foo());
		
      for(Foo f: mHash.values()){
         System.out.println(f.toString());
      }
   }
}