Simulated Annealing

annealing

Here’s an update on our earlier post about genetic programming. Altered Qualia has posted a new implementation of [Ron Alsing]’s idea. It starts with 50 polygons and then randomly changes one parameter with each optimization step. If the the change results in fewer differences from the target image, it’s kept as the new best DNA. This search method is similar to simulated annealing. The image above is the result of 1500 good mutations out of 35900 possible. The implementation lets you choose any image, but smaller means the fitness calculation is faster. It’s written in JavaScript using the <canvas> environment. You’ll definitely get better performance using newer browser builds.

[Original image by R Stevens]

[via Waxy]

WordPress 2.7 Upgrade In One Line

wordpress

BadPoetry WordPress 2.7 has just been released and features a complete interface overhaul. Hack a Day runs on WordPress MU hosted by WordPress.com, so we got this update last week. We run standard WordPress.org on all of our personal blogs though. We recommend it because it’s free, has a massive userbase, and if you host it yourself, you can do whatever you want with it.

To make the upgrade process as simple as possible (and for the sheer rush of ‘rm -rf’), we use a one line command.

$ curl http://wordpress.org/latest.zip -o "wp.zip" && unzip wp.zip && rm -rf ./wordpress/wp-content/ && cp -r ./wordpress/* ~/www/

curl downloads the latest version from wordpress. unzip unpacks all of the files into a directory called ‘wordpress’. rm -rf removes everything in the ‘wp-content’ directory. Otherwise, you will overwrite your images, themes, and plugins. cp -r copies everything to your http document root, overwriting the previous install.

Naturally, you should back up your current install and database beforehand. We tend to use the one-liner with reckless abandon. If you’re wondering about the terseness, it was designed to fit inside the 140 character limit of Twitter.

[Thanks, Chris Finke]

Parts: 1-Wire Temperature Sensor (DS1822)

1wire

Download: buspirate.v0d.zip

Dallas/Maxim’s 1-Wire protocol is the most requested addition to the Bus Pirate.  We finally got some 1-Wire parts, and today we’ll demonstrate the DS1822 1-Wire digital thermometer. Grab the datasheet (PDF) and follow along.

This post is accompanied by release v.0d of the Bus Pirate firmware for hardware version 0. This includes the new 1-Wire protocol library, more configuration options, and other improvements.

Continue reading “Parts: 1-Wire Temperature Sensor (DS1822)”

Edge-lit Holiday Cards

edgelit

Got 30 minutes for a holiday project and don’t want to get wrangled into some sort of decoupage disaster? Evil Mad Scientist Laboratories can show you just how easy it is to do edge lighting effects. Pictured above are three holiday cards constructed using scored plastic. You can use many different types of clear plastic for this, not just acrylic. The lighting is just an LED on a coincell. Black tape is used to prevent light leaking from the edges. The red and green version above is two stacked layers. This looks like something fun to scale up for a larger project or just to kill some time.

GigaPixel Panorama

gigapixel

[Ewout] sent us some info on this Automated Gigapixel Panorama Acquisition system.  The system automates the process of taking the large amounts of images required to do gigapixel panoramics. You tell it key information, like what lens, and what percent overlap you want and the system will calculate how many images it will take, as well as the gigapixel count. The results are quite stunning, no visible seams with fantastic detail.  Interestingly, this was created for a class in embedded system design (ECE4180) at Georgia Institute of Technology and so was our post earlier today on Digitally Assisted Billiards. Is Hack a Day part of the class curriculum? It should be.

Digitally Assisted Billiards

pool

[Justin] sent in his Digitally Assisted Billiards project. Using a web cam, a computer and a projector, these guys have set up a system that shows you the trajectories of your current shot. It detects the angle of the cue and displays a glowing blue line showing where each ball would go and where the collisions would be. It is a bit slow right now, and made somewhat less accurate by a low resolution web camera. This could be a fantastic teaching tool if it were to get some more polish. The source code is available on the site, so you could try this one out at home.