[Hack a Day] 6 New Entries: Simulated annealing

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.

DS1822 Economy Digital Thermometer (Digikey #DS1822+-ND, $3.87) We found a footprint in the 1-wire library for Eagle on the Cadsoft download page.

The 1-Wire protocol uses a single wire for data transfer, and sometimes power. Data is transferred in time-sensitive ’slots’ because there isn’t a separate clock to delineate bit periods.

ds1822cct

Bus Pirate
DS1822
SDA
DQ
+5volts Vdd
Ground
GND

The DS1822 connections are shown in the table. We used the Bus Pirate’s 5volt supply to power the DS1822, but it also works at 3.3volts. A resistor (R1, ~5K) holds the bus high.

All 1-Wire commands start with a reset procedure, followed by one of five ROM commands.

Command Description
0×33 READ ROM. Read single device address.
0×55 MATCH ROM. Match device address, followed by 64bit address.
0xCC SKIP ROM. Address all devices together.
0xEC ALARM SEARCH. Search for alarm condition.
0xF0 SEARCH ROM. Part of address enumeration procedure.

ROM commands are described on page 10 of the datasheet. All ROM commands are available as macros in the Bus Pirate 1-Wire library, see (0) for a menu. ROM command macros include the 1-Wire bus reset procedure.

Single device

singli-4501

All 1-Wire devices have a unique 64bit (8 byte) address, and some 1-Wire devices are used exclusively to give electronics a unique tracking number. When a single device is connected to a 1-Wire bus, the READ ROM command will extract its address.

1-WIRE>{ 0×33 r:8 <–command
xxx 1WIRE BUS RESET OK
xxx 1WIRE WRITE: 0×33 <–READ ROM
xxx 1WIRE BULK READ, 0×08 BYTES:
0×22 0×47 0×45 0×22 0×00 0×00 0×00 0×29 <–ID#
1-WIRE>

The command sends a bus reset ({), the READ ROM command (0×33), and reads the 64bit address (r:8, 8 bytes *8bits/byte=64bits).

The first byte (0×22) identifies this as a DS1822 thermometer. The next 6 bytes are unique to this device, and the final byte is a CRC of the previous 7 bytes.

Now we can address the device with the MATCH ROM command and send it further instructions.

1-WIRE>{ 0×55 0×22 0×47 0×45 0×22 0×00 0×00 0×00 0×29 0×44
xxx 1WIRE BUS RESET OK
xxx 1WIRE WRITE: 0×55<–MATCH ROM command
xxx 1WIRE WRITE: 0×22<–start address
xxx 1WIRE WRITE: 0×47
xxx 1WIRE WRITE: 0×45
xxx 1WIRE WRITE: 0×22
xxx 1WIRE WRITE: 0×00
xxx 1WIRE WRITE: 0×00
xxx 1WIRE WRITE: 0×00
xxx 1WIRE WRITE: 0×29
xxx 1WIRE WRITE: 0×44 <–start conversion
1-WIRE>

First, we send the MATCH ROM command (0×55) and the device address (8 bytes).  Next is the CONVERT T command (0×44, datasheet page 11) that starts the temperature conversion.

A second command sequence retrieves the temperature reading from the DS1822.

1-WIRE>{ 0×55 0×22 0×47 0×45 0×22 0×00 0×00 0×00 0×29 0xbe r:9
xxx 1WIRE BUS RESET OK
xxx 1WIRE WRITE: 0×55
xxx 1WIRE WRITE: 0×22
…long 1-Wire address…
xxx 1WIRE WRITE: 0×29
xxx 1WIRE WRITE: 0xBE <–read scratchpad command
xxx 1WIRE BULK READ, 0×09 BYTES:
0×71 0×01 0xFF 0×00 0×7F 0xFF 0×0F 0×10 0xF8
1-WIRE>

The READ SCRATCHPAD command (0xBE, datasheet page 11) returns 9 bytes. We only care about the first two bytes, the rest can be decoded according the the table on page 7 of the datasheet. Temperature is calculated according to page 4 of the datasheet: 0×0171 HEX=369 DEC, 369*0.0625=23C  (74F).

Multiple devices

multi-450

When multiple 1-Wire devices share a bus it’s more difficult to determine all the addresses. The fastest way to find attached devices is with the SEARCH ROM command (0xF0) and a binary branching procedure. The Bus Pirate automates this with macro (240).

1-WIRE>(240) <–macro 240
xxx 1WIRE ROM COMMAND: SEARCH (0xF0)
Found devices at:
Macro     1-WIRE address
1.0×22 0×50 0×28 0×22 0×00 0×00 0×00 0×0A <–address
*DS1822 Econ Dig Therm <–type according to family code
2.0×22 0xD0 0xC7 0×1A 0×00 0×00 0×00 0×01
*DS1822 Econ Dig Therm
3.0×22 0×47 0×45 0×22 0×00 0×00 0×00 0×29
*DS1822 Econ Dig Therm
Found 0×03 devices.
The first 10 device IDs are available by MACRO, see (0).
1-WIRE>

The SEARCH ROM command shows the devices it found, and the type according to the family code.

We think typing 8 byte 1-Wire addresses is really tedious, so the first 10 device addresses are stored in memory and can be accessed with the macros (1)…(10). A buffer for up to 50 device addresses can be defined in the 1-Wire library at compile time. Ideally, this data will be stored in a global scratch buffer shared by all modules in a future firmware update.

1-WIRE>(0) <–show macro list
0.Macro menu
Macro     1-WIRE address <–enumerated device addresses
1.0×22 0×50 0×28 0×22 0×00 0×00 0×00 0×0A
*DS1822 Econ Dig Therm
2.0×22 0xD0 0xC7 0×1A 0×00 0×00 0×00 0×01
*DS1822 Econ Dig Therm
3.0×22 0×47 0×45 0×22 0×00 0×00 0×00 0×29
*DS1822 Econ Dig Therm
1-WIRE ROM COMMAND MACROs:<–normal commands
51.READ ROM (0×33) *for single device bus
85.MATCH ROM (0×55) *followed by 64bit address
204.SKIP ROM (0xCC) *followed by command
236.ALARM SEARCH (0xEC)
240.SEARCH ROM (0xF0)
1-WIRE>

The macro menu (0) will also include the device addresses stored in the roster. Now we can just address devices by macro, rather than typing the whole 64bit address every time.

1-WIRE>(85) (1) 0×44 <–start conversion
xxx 1WIRE BUS RESET OK
xxx 1WIRE WRITE ROM COMMAND: MATCH (0×55) *follow with 64bit address
xxx 1WIRE ADDRESS MACRO 1: 0×22 0×50 0×28 0×22 0×00 0×00 0×00 0×0A
xxx 1WIRE WRITE: 0×44
1-WIRE>(85) (1) 0xbe r:9 <–fetch reading
xxx 1WIRE BUS RESET OK
xxx 1WIRE WRITE ROM COMMAND: MATCH (0×55) *follow with 64bit address
xxx 1WIRE ADDRESS MACRO 1: 0×22 0×50 0×28 0×22 0×00 0×00 0×00 0×0A
xxx 1WIRE WRITE: 0xBE
xxx 1WIRE BULK READ, 0×09 BYTES:
0×81 0×01 0×4B 0×46 0×7F 0xFF 0×0F 0×10 0×71
1-WIRE>

(85) is a shortcut for a bus reset and MATCH ROM command. (1) is the device address macro, and 0×44 is the command to begin a temperature conversion. Retrieving the reading involves the same macros, but substitutes the command to read the device (0xBE) and grabs 9 bytes (r:9). The temperature is 0×0181, or 24C next to the PC fan.

Taking it further

We used the Bus Pirate to give a visual demonstration of the 1-Wire protocol, but the real challenge is integrating it into your own design. Maxim provides example code, Microchip has an app note (PDF), and you can check out the example code we used.

Firmware download: buspirate.vod.zip

      

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.

      

You received this email because you are subscribed to the real_time feed for http://hackaday.com/feed/. To change your subscription settings, please log into RSSFWD.

[Download Squad] 6 New Entries: Microsoft Live Labs releases online bulletin board called Thumbtack

Microsoft Live Labs releases online bulletin board called Thumbtack

Filed under: , ,

Thumbtack
The Microsoft Live Labs team has unveiled a new web based bulletin board called Thumbtack that allows you to collect text, links, and photos from across the web and gather them in collections. You can tag and search items and you can share your collections with other users who can leave comments on items.

Of course, when people talk about bulletin boards online, they usually mean discussion forums, so perhaps we should call this more of a refrigerator door that you can plaster with items from around the web.

You can either copy and paste text and images directly into Thumbtack or you can use a browser bookmarklet to automatically add content from any web page without leaving that page. The best way to do this is to highlight the text on the page that you want to save before pressing the bookmarklet, as the tool doesn't handle web pages with a lot of funky HTML and scripts very well and you'll wind up with a lot of unnecessary code in your clipping if you try to capture a whole web page.

Microsoft Live Labs releases online bulletin board called Thumbtack originally appeared on Download Squad on Wed, 10 Dec 2008 17:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments

file ai turns your web browser into a file server

Filed under: , ,

file ai
There are plenty of services out there that will let you send files to someone even if they're too large to fit in an email attachment. But YouSendIt, FileMail and similar services typically require you to upload the file before the recipient can begin downloading it. You can save time by allowing someone to copy the file straight from your computer using file ai.

Here's how it works. You visit the file ai site and click the send files button. A Java applet opens up allowing you to drag and drop files to a folder on the web page. When you're done adding files and folders just send the unique URL to your receipient and they can begin downloading the files using any Java enabled browser.

The service uses a BitTorrent-like file transfer protocol so that if you send the files to multiple recipients, they can download data from multiple sources simultaneously which speeds up the download process.

In case you're worried about the security issues of opening up files on your computer to remote downloaders, file ai uses 128 bit AES encryption on the files before sending them. But to be honest, there's still a gaping security hole - the unique URLs file ai generates aren't really all that unique. I'm pretty certain that if you plug enough numbers into the end of the URL eventually you'll be able to download files from a stranger's computer. it really seems like file ai should allow you to password protect your file transfers so that recipients need to have the correct URL and a password.

Update:
If I'd poked around a little longer, I'd have noticed that you can choose to password protect a file transfer before adding files to the folder. Once you've added files or folders there's no way to password protect them.

[via MakeUseOf]

file ai turns your web browser into a file server originally appeared on Download Squad on Wed, 10 Dec 2008 16:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments

Teacher confiscates Linux CDs, claims no software is free

Filed under: , , , ,

If you're not familiar with it, the HeliOS project is an effort to get computers into the hands of kids who might not otherwise be able to afford them. To date this year, they've distributed over 300 machines. Apparently that's not enough to keep them from making an enemy.

A middle school teacher named Karen observed one of her students demonstrating the abilities of his Linux-powered laptop to his classmates. What a great thing, a student exposing his peers to technology they probably weren't familiar with before....Right?

Wrong. Karen sprang into action, confiscated the CDs the student had brought to share, and unleashed the Spanish Inquisition.

Who is the charlatan who convinced this poor, misguided student that "free software" is something that actually exists?

Who could be so evil as to distribute non-Microsoft software to children? How can that person expect our children to survive in an MS-powered world? Once she had her answer, she sent Ken an email.

In her own words:
At this point, I am not sure what you are doing is legal. No software is free and spreading that misconception is harmful. These children look up to adults for guidance and discipline.

Continue reading Teacher confiscates Linux CDs, claims no software is free

Teacher confiscates Linux CDs, claims no software is free originally appeared on Download Squad on Wed, 10 Dec 2008 14:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments

First on Mars - Flashy web TV aggregator

Filed under: ,

First on Mars
There's no shortage of places to find online video these days. Most TV networks offer full length episodes of at least a few shows, and video portals like Hulu and Joost offer content from a wide range of sources. First on Mars wants a piece of that pie, and has taken an interesting approach that's more akin to FanCast or AOL Video's strategy of aggregatings programs from multiple sources including Hulu, CBS, PBS, and other network sites.

First on Mars has an attractive, if busy interface built on Flash. You can browse a long list of shows and networks and add favorite programs or shows to a playlist with the click of a button. Unfortunately there's no easy way to search, which means things can get unwieldy.

The site also lets you browser programs based on "mood." For example, if you select "Bleak," you see tiles for shows like American Gothic, Battlestar Galactica, and Jericho. If you're in a "Financial" mood you get an odd choice of programs including The Colbert Report, Cribs, and My Super Sweet Sixteen. I'm not sure what that says about our culture -- or about the number of programs available online.

First On Mars displays videos by loading web sites in a frame, which means you'll see the videos exactly as they appear on the original web page. But for some reason the selection seems to be a bit more limited than what you'd find on some of those original pages. For example, clicking on the PBS icon brings up Nova, but not Frontline.

[via VentureBeat]

First on Mars - Flashy web TV aggregator originally appeared on Download Squad on Wed, 10 Dec 2008 13:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments

Open++ is a Windows context menu tweaker's dream

Filed under: , , ,

I've seen plenty of context menu enhancement apps before. Most of the free ones, however, offer a standard set of actions and only allow a few minor tweaks.

Open++ is another story. Virtually any command or file your computer knows how to execute can be set up as a right-click action using its customize window. Arguments are also supported, and can either be pre-configured or requested via a prompt. You can even pick an icon to display next to your entries.

Roll Open++ with NirCMD, for example, and you can embed functions like volume control, display resolution switching, and shutdown options. Create a few simple "move to" commands with Open++ to simplify hard drive organizing chores. If you're willing to invest some time and get creative, there's really no limit to what Open++ can do with your context menu.

The author's download page was inaccessible when I tried, but you can find the file on both Softpedia and Tucows. It's freeware for Windows only, but didn't work with Vista x64.

[ via Freeware Genius ]

Open++ is a Windows context menu tweaker's dream originally appeared on Download Squad on Wed, 10 Dec 2008 12:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments

Thunderbird 3 Beta 1 open source email client released

Filed under: , , , , ,

Thunderbird 3 beta 1
More than half a year since the folks at Mozilla Messaging released the first alpha version of Thunderbird, the team has released Thunderbird 3 Beta 1. The latest release features a bunch of bug fixes and some new features, including:
  • A tabbed interface for mail
  • Integration with Windows Vista Search
  • Integration with the Mac OS X Address Book
  • IMAP improvements for faster message viewing
You can also use the Add-ons Manager to search for, download, and install plugins and themes much the same way you can with the Firefox 3 Add-ons manager. You can find more improvements in the release notes.

Thunderbird 3 Beta 1 is available for Windows, Mac, and Linux.

Thunderbird 3 Beta 1 open source email client released originally appeared on Download Squad on Wed, 10 Dec 2008 11:00:00 EST. Please see our terms for use of feeds.

Read | Permalink | Email this | Comments

You received this email because you are subscribed to the real_time feed for http://www.downloadsquad.com/rss.xml. To change your subscription settings, please log into RSSFWD.