Monday, August 1, 2011

Desktop QR Code Reader for Ubuntu

So, for a long time, I wanted something that could go from this:

to this:

And, I was frustrated that no one made it. I would have made it but decoding QR codes is just so darn difficult... that is until ZBar came along with QR Code support. Now, I have a button I can click to move it over. Unfortunately, it isn't /that/ easy. I genned this app up by taking a Gtk demo for making a system tray applet, adding some screen shot capabilities, pumping it into ZBar, then using some of the xosc overlay stuff to draw the outlines. It was pretty straightforward. You can get the code here:

ZBar is just awesome, it even gets the bizarre QR Codes:

Also, for your enjoyment, here's a video demonstrating it:

sudo add-apt-repository ppa:charles-cnlohr/qroverlay
sudo apt-get install qroverlay

NOTE: I do not have a menu icon for this so you will need to run it either from a terminal (qroverlay) OR you can type Alt+F2 and type qroverlay and click run (once it's installed).

Anyone who can help me to make it have a menu icon would be really great.

Saturday, February 19, 2011

How to make an animal factory in Minecraft

So, I am sure there's a number of ways of doing this, some more reliable than others. I've had a lot of trouble making lava-based mob factories in Minecraft (the lava destroys the goodies). So, I found way of doing it entirely with water.

It goes like this:
1) Make your trap with the top about 12 cells below where ground level is. Plug the top of the death trap until ready.
2) Dig ditches with feeding streams into one another, all leading up to the death trap.
3) Activate the streams of water, and unplug your death trap.
4) Place lots of torches everywhere around to attract animals.
5) Animals and mobs will come, fall into your streams, get sucked into the trap and die.
6) Their parts will fall out of the death trap and come on the floor ready for you to just pick up and profit.

As an oddity, you get eggs from chickens since they don't get sucked under, and you get feathers from zombies.

OPTIONAL: You can make your trap even deeper, then make stream systems through underground caverns that are very dark. Zombies, creepers, and skeletons will spawn, fall into the streams and perish. If you do this, be sure to make everything double-wide with some cacuts sitting around places to get rid of the spiders else they'll clog everything up.

Making the trap is relatively easy. I would suggest making your trap two cells of water wide. I have had good luck with ones only one cell wide, though.

The first thing you need to understand is the basics of water physics. While you can use streams that flow down hill, it makes it much easier to make 8-wide stream segments. At the end of the segment, you can drop off into another stream. Be sure to have walls around the sides of your stream so animals can't hop out.

The next thing you need to think about is the death trap. I strongly suggest making the blocks that constitute your death trap out of glass. This makes it possible to see inside and see what broke if something went wrong. Below is my template death trap. I strongly suggest putting the doors on the bottom, and installing from the inside. This prevents animals from breathing in the space where the door is, but still lets you escape your own trap if you fall in. Also, it makes it possible to bat at sheep while inside the chamber, to get them to drop their wool.

The grass blocks indicate the blocks that are on the same plane as the water. The rock blocks are only there to indicate that you need something on the front/back of your trap to prevent the water or animals from flowing out.

The next thing you need to worry about is your system of channels leading the creatures to your death trap. I suggest you use this basic template. Streams of eight cells, condensing further to streams of 8 cells, finally coming together in your central area. Sometimes making these streams 2 cells wide is helpful, but not mandatory.

Be sure that all of your walls are AT LEAST two cells high, lest the creatures escape.

Below is an example of a double-wide one with a top exit. This can be useful, since it can accelerate the speed at which goodies can exit the kill chamber.

One last note - you cannot have the water come straight down and T out. If you do, all animals except pigs will be killed. If you have plans to do an animal sorter and kill pigs later, that may help, but you need to add the zigzag at the end pictures in my diagram above.

If all goes well, when you turn the water on, you'll get animals that get sucked under after a while, and get their goodies.

Here's a final view from the side: