the world is a pixel
Miojo Script
O pre-requisito é o notify-send, um utilitário de linha de comando do libnotify. No Ubuntu:
sudo aptitude install libnotify-bin
E aqui o script em si:
sleep 5m; notify-send "aviso" "tirar o miojo do fogo"
Pronto, depois de cinco minutos isso vai aparecer:

You must be logged in to post a comment.
No trackbacks yet.
Python, flatten a list
Surprisingly python doesn’t have a shortcut for flatten a list (more generally a list of lists of lists of…). I made a simple implementation that doesn’t use recursion and tries to be written clearly. I get a element from a “bad” list (a list that can have another lists). If the element is not a [...]
Heroku on Ubuntu 11.04 (Natty Narwhal)
28 September, 2011 - 11:43 pm
Tags: configuration, Heroku, Ruby, ubuntu
Posted in english | 1 comment
As root execute: apt-get update apt-get install build-essential ruby rails rubygems1.8 apt-get install ruby1.8-dev libopenssl-ruby Chance PATH at /etc/environment: PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/var/lib/gems/1.8/bin" Update your current environment: source /etc/environment Install the Heroku gem: sudo gem install heroku Run Heroku authentication configuration: heroku auth:login Enter the credentials for your Heroku account. Done!
OpenPixels: simple sprite sheet with Processing
22 August, 2011 - 10:54 pm
Tags: Openpixels, Pixelart, Processing, programming
Posted in english | No comments
/** * Openpixels example in Processing. * This simple example of how to get a sprite * from a sprite sheet. */ PImage bg; PImage sprite_sheet; PImage player; void setup() { // load images bg = loadImage("kitchen.png"); sprite_sheet = loadImage("guy.png"); /* The sprite size is 32×49. Look guy.png, the "stand position" is [...]
Atiaia early releases
23 July, 2011 - 9:57 pm
Tags: Atiaia, C, Marco Diego, programming, Ray Tracying
Posted in english | 1 comment
This was a project that me and Marco Diego created during our graduation for the Computer Graphics course. It is a ray tracing engine build from scratch in C. It was great exercise of experimentation on how implement object-oriented design patterns in ANSI C. Later Marco continued it in his master’s degree thesis implementing more [...]
AVCHD (.MTS) video files
10 June, 2011 - 12:48 am
Tags: avchd, Panasonic Lumix DMC-TS3, ubuntu
Posted in english | 1 comment
I’m dealing with video format of my new camera (Panasonic Lumix DMC-TS3). It’s the AVCHD format (.MTS file extension). You can convert it to other formats using HandBrake on Ubuntu.
Android screen height and width
12 March, 2011 - 9:30 pm
Tags: Android, Java, mobile, programming, screensize
Posted in english | 1 comment
Context ctx = getContext(); Display display = ((WindowManager)ctx.getSystemService(ctx.WINDOW_SERVICE)).getDefaultDisplay(); int width = display.getWidth(); int height = display.getHeight(); Yes, there are easier ways to retrieve the screen width on Android but there are cases that this long code is the only solution. You may already have the Context. WindowManager or the Display and so it would be [...]
PHP: array, all elements but first
9 March, 2011 - 12:52 pm
Tags: array, array_shift, PHP, programming
Posted in english | No comments
$bric = array("Brazil", "Russia", "India", "China"); $ric = $bric; // array copy $br = array_shift($ric); // left shift at $ric. $br stores "Brazil" print_r($bric); // $bric remains the same print_r($ric); // $ric lost "Brazil" Output: Array ( [0] => Brazil [1] => Russia [2] => India [3] => China ) Array ( [0] => Russia [...]
DIY recycle your old tv
20 February, 2011 - 10:18 pm
Tags: Linux
Posted in english | No comments
When I came here to this room I found this old big tv laying around. Old but perfectly functional. First I put a tv cable on it with hundreds of channels but after one month I realized that mostly of them are crap and I was watching everything on my laptop (mostly shows from Netflix [...]
substitution on a XML file shell script snippet
13 May, 2010 - 10:55 am
Tags: Shell Script, XML
Posted in english | No comments
One more Shell script snippet. Scenario: I have several directories, each one with a file called strings.xml. The problem with those files is that they are like: <string desc="whatever">"text"</string> I’d like to remove those double quotation marks inside the string element. I’m already in the directory which contains all others directories with the xml files. [...]
Java: invoking a method by name
29 April, 2010 - 10:29 am
Tags: Class, Java, method, programming, Reflection
Posted in english | 2 comments
import java.lang.reflect.*; public class Foo { public void bar(int param){ System.out.println(param); } public static void main(String args[]){ Object f = new Foo(); try { Method m = f.getClass().getMethod("bar", int.class); m.invoke(f, 42); } catch (Exception e){ System.err.println(e); } } } $ java Foo 42













28 January, 2010 - 8:30 am
Valeu! Te mando uma dica para parar os terminais de 3 a 6, não é mais no /etc/event.d
sudo sed -i ‘/ACTIVE_CONSOLES/s/1-6/1-2/g’ /etc/default/console-setup