Acho que já testei antes… mesmo assim. Alô, testando.
Acho que já testei antes… mesmo assim. Alô, testando.
/**
* 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 32x49.
Look guy.png, the "stand position" is at (36,102). */
player = createImage(32, 49, ARGB);
player.copy(sprite_sheet, 36, 102, 32, 49, 0, 0, 32, 49);
// set screen size and background
size(bg.width, bg.height);
background(bg);
frameRate(30);
}
void draw() {
background(bg);
image(player, 100, 50);
}
See more at OpenPixels.
Openpixels is a project of mine to create a free and open source artistic framework for game projects in any language or platform. It is going pretty well.
You can just download a zip or tar.gz of the latest version.
You may want fork it or get a git working copy of it to later make your own contributions to the project. In this case:
apt-get install git-core
cd ~
git clone git://github.com/silveira/openpixels.git
You will see something like this:
Cloning into openpixels...
remote: Counting objects: 129, done.
remote: Compressing objects: 100% (126/126), done.
remote: Total 129 (delta 17), reused 0 (delta 0)
Receiving objects: 100% (129/129), 784.52 KiB, done.
Resolving deltas: 100% (17/17), done.
And now you have a repository clone at ~/openpixels and you can start hacking.
When I came back from my last travel my 3G connection stopped working and seems that a lot of people already had the same problem. It was after I reactivated my plan when I came back to the US. Apparently they forgot to activate my data plan I’m paying for.
How to solve
I tried different things but finally I tried to simply activate the phone again using the Activate application (probably the first application on the list). After a few tries It worked and I got my 3G connection back.
Improve your battery life
One interesting thing is that during my days without 3G my battery life was quite better. So when you want to save battery, in travels for example, you can manually activate/deactivate your data plan on the Setting -> Wireless & networks settings -> Mobile Networks -> Data Enabled option.
See the demo.
CSS Sprites + JavaScript
— We are not gifs!
Credits and notes:
Code:
var canvas;
var ctx;
var background;
var width = 300;
var height = 200;
var cloud;
var cloud_x;
function init() {
canvas = document.getElementById("cloud_demo_canvas");
width = canvas.width;
height = canvas.height;
ctx = canvas.getContext("2d");
// init background
background = new Image();
background.src = 'http://silveiraneto.net/wp-content/uploads/2011/06/forest.png';
// init cloud
cloud = new Image();
cloud.src = 'http://silveiraneto.net/wp-content/uploads/2011/06/cloud.png';
cloud.onload = function(){
cloud_x = -cloud.width;
};
return setInterval(main_loop, 10);
}
function update(){
cloud_x += 0.3;
if (cloud_x > width ) {
cloud_x = -cloud.width;
}
}
function draw() {
ctx.drawImage(background,0,0);
ctx.drawImage(cloud, cloud_x, 0);
}
function main_loop() {
draw();
update();
}
init();
HTML code:
Credits and notes:
I saw it once back in Brazil and I got fascinated with the concept of a folding bike. Marcelo Siqueira introduced me a bike you could fold and carry.
Here in the US I was waiting the snow and cold go away to go back biking. I’d like a bike that I would not keep on the garage and I could bring to work and commute sometimes. I got a Citizen Gotham2 20″, 7-Speed with alloy frame.
Unfolding steps:
The Citizen 20″ bike bag:
After using the bag to store the bike it also folds and can be kept in the steam or rack:
I’ve been using it for some months and it is really good. Now I want to put some more accessories to make it safer like a night flashlight.
Rules for Metro (DC)
The general rule for bikes in the DC’s metro is on  WMATA‘s “Cyclists on Metrorail” document:
Bicycles are permitted on Metrorail (limited to two bicycles per car) weekdays except 7-10 a.m. and 4-7 p.m. Bicycles are permitted all day Saturday and Sunday as well as most holidays (limited to four bicycles per car). Bicycles are not permitted on Metrorail on July 4th or other special events or holidays when large crowds use the system.
There is an exception for folding bikes from WMATA‘s “Bike ‘N Ride Policy“:
Folding bicycles and non-collapsible bicycles of all types that are folded or disassembled and enclosed in carrying bags, cases or boxes are deemed “luggage” items and are permitted inside railcars at all times. The carrying bags or cases must be made of a sturdy material such as canvas, nylon or leather-type materials.
Update in September 17th, 2012: WMATA has announced that a bag is no longer required.