Posts

Showing posts from June, 2009

goto in PHP 5.3

It appears that the goto statement is being added to PHP 5.3. Considering its bad reputation the move seems like a strange feature to be adding. Especially since one of the main benefit of a goto, exception handling, appears to have been introduced in PHP 5.

Hopefully all the web programmers out there will tread cautiously with their new power.

Taking Stuff Apart: Nikko NA-550

Image
From time to time I come across an old piece of electronics that I want to harvest some parts from. Stepping motors from floppy disk drives, Solenoids from zip drives, small DC motors from CD drives to name a few of my favorites. Audio Amplifiers in particular are my very favorit. They have lots of interesting and hard to find pieces.





Without further adieu, here's a before shot of this vintage 80's "Nikko NA-550 Integrated Amplifier" that I picked up at a landfill a few weeks ago. For anyone curious, the power button was jammed in the off position, which is probably what earned it a spot at the dump.



Got a bunch of nice metal knobs, some dB meters, some very nice Alps selector switches, some Alps potentiometers, a 2.5A breaker and some other misc parts.

Ant AI

I've been toiling away trying to come up with an algorithm which will make ants move in a believable manner while only using a very limited view (the 4 adjacent tiles which they can move to). This was much more difficult than I was expecting, it sounds too easy to say "the ants wander around randomly, then once they found food they could head home following the chemicals they left behind". Implementing it like that not only doesn't work, but the ants end up congregating around the ant hill and don't accomplish much of anything.

The final algorithm is a set of rules that look like this:
1. If carrying food, call go home AI.
2. If carrying food and in base, drop food (or wander until there is a spot to drop the food), set chemical output to low.
3. If not on surface, wander until on surface.
4. If on surface, check for food, pickup, change chemical output to high.
5. If on surface and no food, try to follow a chemical trail.
6. If no trail to follow search for foo…