28 December 2009

Tar pits

Went to La Brea Tar Pits (Page museum). Bad traffic.

But nice museum. Wall of 400 wolf skulls, and there are 1200 more.

Nice skeletons, including birds. Pointed out large sternum on birds.

On the timeline, its clear that a lot of bigger mammals died out
as humans started taking off. Funny, that.

Best part for me: I found tar seeps outside of the chained in
lake, and figured out that all the seeps are in a line --just like
Hawaiin fumaroles or yellowstone geysers--- along a fault. Also
saw tar-bubbles grow and pop, which was like slow-motion mudpots.

22 December 2009

Friends

Son of a los alamos scientist. Extremely civil engineer.
1400 SAT. Insanely independent cal tech physicist, and crazy
friend thereof. Profs of cs, and other disciplines.. Potassium
channel scientists stricken with MS and then cyanide poisoning..
an interesting life so far.. I appreciate steadiness and lack
of change.

Time

thinking about time.

I knew a few profs.

A woman philosophy prof; computational linguistics; and neuroscience.

And a number of guys who are CS profs.

Me, just a practitioner, continual student.

15 December 2009

optometricist

Saw the eye doc today. Need a new script so I can replace my
glasses, which currently are at version 3 of my field improv.
I have a stiff nichrome wire looped around vestigital stubs
of the old nitinol templepieces. This does not provide adequate
constraint of rotation about the horizontal axis. My nose does.
But the loops of nichrome fall off the cm long stubs. So loops of
very flexible soft wire wrap the ends of the stubs as keepers
for the nichrome loops. "Sometimes" they also are wrapped around the
NiCr templepieces. But they break, so my nose is useful for horizontal
axis control. As stops, they seem to work fine --must be how wire
wrap used to work, soft wire around sharp edged pillars.

The eye doc's tech asked to measure my glasses, so I gave her the loop,
after a caveat not to laugh (which she laughed at until she saw my
hack). Then she showed the other receptionist declaring, "he must be
an engineer". I was impressed that she figured that out 8-)

14 December 2009

nerd reading

Borrowed the Payload planners guide for the Delta III rocket.
Showed it to my 10 year old (found a good graphics page) but he
didn't care that much.

Pretty interesting reading to me. I'm reading some Asimov right now,
so maybe I'm in a retro scifi mood. Also watched some random Shatner
stuff.

Yep, retro. Or solstice moods.

ground truth

Graduating MIT in 86 in EECS and cognitive science it was clear I was
into AI. But I had become interested in perception, the grounding of truth
that all the logical / propositional layers were built on.

I went to UCI to study human and machine perception, esp vision.

Nowadays I work in firmware. I scope electrons and control them with
words. The ground truth of software, of information.

02 December 2009

Flying code

So I have found out that soon some complete hackery I wrote a few years
ago is going to fly. The code runs on an NT system that runs an In
Flight Entertainment system. It bypasses NT security to directly access
hardware. It patches a new hardware board (with new video controller)
to display live video, so the flight attendants can see what the passengers
see.

Its a kludge. We couldn't build the original software, which was a mess,
and incomplete. So my kludge looks for a big black box on the screen and
maps live video into that space, if it exists. We do so cleverly so as
not to use too much of the 100 Mhz x86 cpu. The software runs in parallel
with the regular software which no longer controls the video overlay.

And finally, after 3 years, it will fly, and enable the company to sell
the boards that have had enormous amounts of time and effort put into
them.

Please put your trays in their upright position..

Flying code

So I have found out that soon some complete hackery I wrote a few years
ago is going to fly. The code runs on an NT system that runs an In
Flight Entertainment system. It bypasses NT security to directly access
hardware. It patches a new hardware board (with new video controller)

27 November 2009

Fish drought

Went to the end of Sandberg road to a dirt parking lot part of Santiago Hills park.
Found a cracked mud area, with a small amount of water at one end. There were
maybe 2 dozen fish of various sizes gasping in there. I'm going to post
to Craig's list (never have before) telling fish-rescuers about this. Or
fish-eaters.

OTOH we saw what may have been big cat prints in the cracking soft mud,
and the cat may be dining. Still, tragic to see these fish, and no hope
of water (unless it rains this weekend) as the other side of the dam is
dry.

25 November 2009

tools

Creating some tools at work. Write a text file on a PC, translate to binary,
burn on an eeprom which is connected to a PIC 16F887 which is listening
as a slave on a two-wire RS485 bus.

Also read back and display as a text file.

The text file should be idempotent through the chain, a perfect copy
residing on the remote (and very isolated) eeprom.

Its an SPI eeprom, that's three wires, driven by the 8 bitter.

This so our client can create his own eeproms which control their instruments.
Right now, I have to edit and recompile the firmware; and the development menu lets me program a single integer into the eeprom to ID it. With this, the client will program
everyting about a given instrument which is currently part of the firmware.

Incremental development.

piglab

Piglab number three.

Adjusting the Machine. Compiling on a laptop connected to a power generator
which is connected to, being used on, a live (anesthetized) animal.

Since the animal won't survive, we don't need masks, infection from us to him
or her is not a problem. Its like you discovered anesthesia before you figured
out germ theory.

Got Rubisco?

The Gene for the large RuBisCo subunit is a 1434-mer DNA molecule:

ATGTCACCACAAACAGAGACTAAAGCAAGTGTTGGATTCAAAGCTGGT
GTTAAAGAGTACAAATTGACTTATTATACTCCTGAGTACCAAACCAAG
GATACTGATATATTGGCAGCATTCCGAGTAACTCCTCAACCTGGAGTT
CCACCTGAAGAAGCAGGGGCCGCGGTAGCTGCCGAATCTTCTACTGGT
ACATGGACAACTGTATGGACCGATGGACTTACCAGCCTTGATCGTTAC
AAAGGGCGATGCTACCGCATCGAGCGTGTTGTTGGAGAAAAAGATCAA
TATATTGCTTATGTAGCTTACCCTTTAGACCTTTTTGAAGAAGGTTCT
GTTACCAACATGTTTACTTCCATTGTAGGTAACGTATTTGGGTTCAAA
GCCCTGCGCGCTCTACGTCTGGAAGATCTGCGAATCCCTCCTGCTTAT
GTTAAAACTTTCCAAGGTCCGCCTCATGGGATCCAAGTTGAAAGAGAT
AAATTGAACAAGTATGGTCGTCCCCTGTTGGGATGTACTATTAAACCT
AAATTGGGGTTATCTGCTAAAAACTACGGTAGAGCTGTTTATGAATGT
CTTCGCGGTGGACTTGATTTTACCAAAGATGATGAGAACGTGAACTCA
CAACCATTTATGCGTTGGAGAGATCGTTTCTTATTTTGTGCCGAAGCA
CTTTATAAAGCACAGGCTGAAACAGGTGAAATCAAAGGGCATTACTTG
AATGCTACTGCAGGTACATGCGAAGAAATGATCAAAAGAGCTGTATTT
GCTAGAGAATTGGGCGTTCCGATCGTAATGCATGACTACTTAACGGGG
GGATTCACCGCAAATACTAGCTTGGCTCATTATTGCCGAGATAATGGT
CTACTTCTTCACATCCACCGTGCAATGCATGCGGTTATTGATAGACAG
AAGAATCATGGTATCCACTTCCGGGTATTAGCAAAAGCGTTACGTATG
TCTGGTGGAGATCATATTCACTCTGGTACCGTAGTAGGTAAACTTGAA
GGTGAAAGAGACATAACTTTGGGCTTTGTTGATTTACTGCGTGATGAT
TTTGTTGAACAAGATCGAAGTCGCGGTATTTATTTCACTCAAGATTGG
GTCTCTTTACCAGGTGTTCTACCCGTGGCTTCAGGAGGTATTCACGTT
TGGCATATGCCTGCTCTGACCGAGATCTTTGGGGATGATTCCGTACTA
CAGTTCGGTGGAGGAACTTTAGGACATCCTTGGGGTAATGCGCCAGGT
GCCGTAGCTAATCGAGTAGCTCTAGAAGCATGTGTAAAAGCTCGTAAT
GAAGGACGTGATCTTGCTCAGGAAGGTAATGAAATTATTCGCGAGGCT
TGCAAATGGAGCCCGGAACTAGCTGCTGCTTGTGAAGTATGGAAAGAG
ATCGTATTTAATTTTGCAGCAGTGGACGTTTTGGATAAGTAA

http://www.centauri-dreams.org/?p=10283

22 November 2009

Work

Well, this blog is supposed to be about work, so here we go.

We submitted a UL build. They immediately found problems, you poke a pin
through a ventilation hole and hit the motherboard. fail. But they will
continue testing.

Then we have more features to be piglab tested. eventually the customer will
run real surgeons with the tool. Plab is tuesday, with new features.

There are response time questions; incomplete safety checks; incomplete
alarms; etc. But they want the ability to modify tool scripts by themselves,
which means making a toolchip programming system --not the crypto (authentication
capable) ics but simple spi eeproms. have to drive them via tool interface boards which have a PIC 16F part and speak RS485. They will get commands from a pc running
a 485 protocol to program the chips.

Drama

Bird in the house today. Wife called animal control, they showed up
but couldn't catch it. 30 foot ceilings.

I eventually got it with a pole and birdnet and sticky tape. When freed,
it didn't fly away. Eventually it died --twisting its neck and extending
its wings like they find fossils of birds and their reptilian ancestors.
Then, limp.

After that we let the cat have it, which was closure for him, and he enjoyed it. Thanksgiving for felines.

....

Yesterday hiking with the kid near the Santiago Oaks park, near the dam, I found a dollar bill on the trail. Day before, I had found one in the cash-return
of the grocery's self-checkout lane. What are the chances of two sequential
finds?

05 November 2009

Expensive ride

I have in my 8 year old Subaru Forester a quarter million dollar device, one of
only 5 initial production versions of a state of the art electrosurgical
generator.

In the early 90s I drove away from my R&D programmer job at LA (Cedars-Sinai)
with a quarter million dollar video-rate (512 x 512 monochrome :-)
capable disk drive array in the back of my Ford Escort during
the LA Rodney King riots. I saw smoke from work, and dealt with the
exodus traffic. I was taking it to Orange County to get repaired.

The generator currently in my car will be used on a live porcine surgical model tomorrow.
I have the cross-compilation environment on a laptop so I may be compiling code to run
on a medical device being used on a pig, live.

Hifuckinlarious.

Supposedly a pigday costs $10K. That is expensive meat.

Needless to say, the location is confidential. They don't have big
pink "Vivisection" neon signs out front.

My cat just showed up. I spent over an hour this morning with him, purring
at him, etc, since I was up early (daylight savings etc). This gave me comfort
all day.

He's an obligate carnivore, whereas I seem to need carbs with my meat.

Mostly he sustains on kibble, poundcat that he is;
never any human food, by his choice (he's been offered multiply); and fresh
self-harvested rodentia arthropodia and birds, occasionally. He knows to take them to the
downsstairs shower, where they can't get away and are easy to pick up and
hose off for me.

Anyway, tomorrow will be interesting.

04 October 2009

Music

I now have a contract with my 10 year old: he plays the 19 notes of the
Simpson's theme on his viola and I pay him $20 US. Just slightly over
a buck a note. Good deal.

The Mario or Zelda theme are next..

03 October 2009

Netbook

Thinking about getting a netbook and wifi access point.
Can be done cheaply. Yes I'm a decade behind. I think
this would be better than getting a Wii for the kid.
If terrifically useful would have to get perhaps 2 more
gizmos. One gizmo is solid state, but only 2GB; regular
n'books are around 160GB.

14 September 2009

Zimbabwe wine

Unlike other so-called 'storm chasers', who are often labelled adrenaline junkies for their obsessive pursuit of extreme weather, Jim is driven by his love for art and his interaction with nature by documenting the unpredictable changes in weather and climate.

Read more: http://www.dailymail.co.uk/news/worldnews/article-1213339/Astonishing-twisters-captured-storm-chasing-photographer-Jim-Reed.html#ixzz0R8ROLtUQ

Hilarious. As if there is a difference.




Where's the Zimbabwe wine?

13 September 2009

Crypto Dad: secret ink

I was asking the nearly 10 year old about secret inks, he confessed he once
read of them and peed on a brush, painted paper, and then developed it on
a lightbulb after drying.

I was amazed to learn this. It has lighted up my whole week.

Crypto Dad: tools

http://www.cotse.com/tools/stega.htm

Crypto Dad

If you want to hide a whole "disk" work of space, use TrueCrypt
http://www.truecrypt.org/

You create a "volume" which is encrypted by a password. You open the volume
with the password, then it acts just like a regular E: drive (or whatever drive
letter you pick).

Winzip and WinRAR also have encryption options, and can package files together in compressed archives.

BTW, you must always compress before encrypting, because after encrypting, the data looks random and can't be compressed.

Crypto Dad: steganography for 10 year olds




This JPG contains a TXT file.

The tool is JPHSWin
The password is "password"

Save the fullsize image, open with JPHSWin, SEEK (and supply the not-so-secret password "password") then save the found file as f.txt.






The threat model is: someone sees an encrypted file, gets suspicious, forces you to reveal a password. In professional circles this is called the "rubber hose attack" but your parents would more likely simply deprive you of TV, car, etc.

The solution: hide one file inside another obvious boring file. Encrypt the hidden file before hiding it, too.

You could publish your picture and only those looking for hidden messages, and who have the secret key, will find them. Flickr, ebay, even 4chan :-)

Crypto Dad: Crypto for 10 year olds

Kids,
By now, you've learned that what you write can be important. For thousands of years people have kept diaries and wanted them to be private. You can still buy blank notebooks
with locks on them.

But those mechanical locks can be picked, or broken.

And you like to use computers to write. (Learn to type, BTW!) Can you control who reads your writing on a computer?

Sure you can. Controlling who reads your stuff is "confidentiality". Here's how we'll do it: You'll give a secret password "key" to a machine called a "cipher" which eats the key, your stuff, and produces a new file. That new file contains your stuff, but you can only read it if you know the key. Enciphering is also called encryption, which means "hiding".

The reverse process is simple: give the cipher the encrypted file and the key, you get your original stuff back.


If you deleted your original stuff, after making the encrypted one, then only someone with the key for that encrypted file can read it.

BTW, Your "stuff" is just a file. That file can mean music (eg mp3) or pictures (eg jpg) or fancy documents (eg doc) or plain text (eg txt) or anything.

BTW, the "cipher machine" is just a computer program.

Search for AxCrypt. Its a little Windows File Explorer plug-in that encrypts and decrypts files. http://www.axantum.com/AxCrypt/

If you share the "key" in person at the play ground you can control who reads
the file. That can be one person, or more, or just you. The "key" is just like a metal key to a door, they're all identical and anyone who has one can

Of course, someone could find the encrypted file and force you to reveal the password. In our next installment we learn about hiding the very fact that you've hidden a file!
(Steganography)

Other topics related to encryption:
authentication (knowing that a message came from your friend)
integrity (no one can change the message without getting caught)
non-repudiation (you can't back out of a signature!)

The "what I know, have, am" triad for identification --tying meatspace to information space. Governments love that stuff.

Anonymity
Traffic analysis

All stuff for the modern 10 year old!
Maybe we'll even dabble in RSA (publishable public keys, web certificates) and DHA (SSL).

06 September 2009

Crypto Dad

Took the kid on a short neighborhood walk. Along the way, found a 4 disk bike or motorcycle lock hanging loose on a fence. So, I took it walking.

By the time we reached the road I had found its code, 6193, and opened it. Actually
I thought I first found 9193; then the kid found several adjacent codes that worked,
and then eventually only one code worked. I think we might have inadvertently reprogrammed the combination, though I didn't that that was possible in that kind of lock.

We eventually wrapped it around an ornamental post. The kid did this, then ran away. I pointed out his fingerprints were all over it; he said they weren't in the DB yet; I said
they would be eventually; but that he could say he picked it up and dropped it, then
a gloved vandal locked it round the post.

Cover your ass. Plausible deniability. Think like the adversary. Crypto, safety engineering, reliability, availability, etc.

PS: I once brute forced a 3-digit lock I found in an airport, while waiting.

Hilarious.

23 August 2009

Strange fish

There is a chain of ponds adjacent to each other, each one lower than the one
before. There walls between them. There are fish that live in them. The fish
can occasionally jump over the walls (only downstream), taller walls being less
likely to be hurdled.

If you start with a certain number of fish in the highest pool, how do they
distribute over time? (You'll need to know exactly how often they jump and how
likely each jump into the next pool down succeeds.
And your answer will only be a statistical one, it will not predict exactly for
a given run.)




Someone starts the very unusual behavior (outside of stars) of throwing neutrons
into pools. They stick to the fish and lift them to higher pools, before
bursting.

.....

If you want to buy some fish, you are a lab physicist or research engineer. If you see the answer immediately you are a mathematician or theoretical physicist. If you write a simulation you are a computer scientist.

I suppose if you eat the fish afterwards, you're a piscivore.



-----

I will gladly borrow a photon from the quantum foam and pay you back Tuesday.

15 August 2009

Carbon efficient wine

My winebox says its carbon efficient wine. That is annoying.
Anything with carbon, green, or organic labels is just pandering.

Strange roomba behavior

The Roomba was stopping after half a minute. I figured this was because his battery is over 1.5 years old. But after a reset, he does fine. I don't understand. I'm assuming he monitors the voltage from it (or possibly available current), gets hungry when it drops. So why does a reset help? What state does he maintain?

California fires -let 'em burn

Fire season is upon us, there's a fire up north. My opinion: let it burn,
they're natural (in fact, good). Do not risk firemen (or pilots, or spend money)
defending forests, only homes. And only those with adequate clearance.

I've gone hiking where it burned locally and it grows back very well. And I've not seen any animal skeletons either.

14 August 2009

Spider web

Came home, one of those orange spiders is weaving a web.
He was actually white with patterns, but they get
orange later, in october, when they make great *actual* halloween spiders,
I recall. I think he's a he because he had big "fangs" actually pedipalps (?)
to hand a package over to females. Anyway I saw him just as he finished the
radials, probably woven with strong fiber, and was beginning the probably sticky
spiral. From outside to inside, counter clockwise viewed from above the spider.

Probably a radial every 10 degrees. The spiral ranged from maybe 10mm on the outside to
much finer, and very regular, 2mm inside. Then he stopped.

How the hell does a spider with a tiny brain do this? In random environments, with random wind disturbing him?

Front legs seemed to move fasters, likely sensing, and his back legs and butt laid down the new fiber. What was he sensing? What are the rules? How do you encode these in a spider brain? How do you encode that in a spider genome?

I've written and run simulations of ant behavior. But how does a spider work?

05 August 2009

Suzuki Sidekick

(Chevy) Sidekick rolls off the 5, bursts into flame, 5 dead.

http://www.ocregister.com/articles/chp-vehicle-down-2517845-hill-suv




I had a Sidekick once. It was very fun, very stiff suspension,
cloth-roof convertable, very affordable (mine had no
air, no power windows, no 4WD, no radio). Veteran of many desert adventures.

Later, when I had a kid, I got a Subaru Forester. Still have it.
Good car.

I also once blew a tire on the 5, but got over to the right
safely and recovered. Also once overcompensated and bounced off
a Jersey barrier, no harm done, but scared us. Never, ever, made snap
decisions near the gore.

The real problem I had with that car was that every 30K miles, it needed new ignition
wiring. I went through several sets of high quality silicone-insulated
ignition wires, never made a difference. Once I drove back from the desert
in it, with two cylinders not firing --little HP, and a pickup truck with mexicans
gestured wildly at me, so I pulled over. The muffler was cherry-red incandescent
from the unburned fuel burning in the catalytic converter. Thanks guys! But I still
drove home, but didn't take the scenic/mountain/faster route, instead taking a freeway.
Again, thanks guys.

Once took same car to Mexico with a friend. We got stuck in a soft shoulder. A guy with the same kind of car stopped to help, pulled us out with the help of a random piece of
cable from the side of the road. I went to offer him money, but he refused; I insisted,
and he produced a *fat* wad of american 20s to show he didn't need it. Very cool.
Likely related to the (demonized) pharmaceutical trade, and he helped us tourists.

I've only been a few times there, and would not go back, out of fear and not speaking
spanish. But the locals are friendly.

My first time there was in a Ford Escort, for an eclipse. The Federales (teenagers with
rifles with toilet paper in their muzzles) found a lame firework, but let us go.
I did not like military checkpoints though. Some years later, I encountered the amerikan version of same when exploring the lower Anza Borrego desert. I loathe the amerikans more, because I have no expectation of freedom in Mexico, whereas the US government is supposed to be constrained.

On the way back from the eclipse (awesome) the steering wheel disconnected, and we went off the road. (A friend was driving.) Fortunately I had a few MIT engineers (electrical, nuclear..) with me and they had tools. They reconnected the steering wheel, aligned it using a flashlight, inserted a compression pin, and we drove home. I drove with that fix for years afterwards.

It is of course somewhat amazing that I've made it to 45.. and every day is thanksgiving, which makes them more valuable.

24 July 2009

Who is attacking Jupiter?

Not only Levy-Shoemaker, but now another meteor attack on Jupiter, this System's
most obvious planet. Who is attacking? Do they think we live on Jupiter, and are sick of our TV?

Its obvious someone doesn't like us, but their aim isn't perfect.

17 July 2009

Biology = computer science plus physics

Just occurred to me: biology is where computer science and information maths meets physics.
(As are various forms of electrical engineering.)

05 July 2009

Hummingbird savior

Was just wondering where the cat was when all of a sudden there was a hummingbird fluttering around the kitchen. Followed by the cat. The bird hit a wall and fell down, and I found him lying on his back on the countertop. This saturday-morning cartoonish behavior did not bode well for the bird, I thought. I scooped him up and let him go outside and he buzzed off. The cat continued to be interested in the spot where I scooped him up. Then he went through the stages of grieving "you just lost your hummingbird" -- denial (where did the bird go?), anger (that human stole my bird!), bargaining (if you get my bird back, I won't let it go inside), depression (my bird is gone!), acceptance (well, I can still stalk more, and there is a dish of kibble in the garage), etc.

This is the third hummingbird I've saved from cats, one literally from my cat's jaws.

16 June 2009

Music

Tom Waits

Neil Young

Amy Winehouse

King Krimson / Fripp / Eno

Rammstein

Pink Floyd

jazz, classical, etc.

Lots of old folks...

Psychological entertainment

I very much liked Fight Club, but you have to watch it a few times.

I enjoy House, which is about a technical expert who thinks folks lie.

I recently caught Mental, which is the same. Also Lie to Me, again, same abstract theme. Experts who see through people.

And Bones is similar.

I also enjoy the Simpsons (which got me back into TV a few years after it came out; I had abstained for over a decade previously) and King of the Hill which is actually more sophisticated comedy.

I've most recently read Animals in Translation by Temple Grandin.

12 June 2009

A good deed

So I returned a preteen girl's cell phone tonight. This is the second cell phone I've found and returned. The first was lost by a mountain biking guy up on Santiago peak, it was just lying on the trail (I had driven up there with my son in my Subaru). It was charged and a little bit of snooping found his Dad. I left the phone in front of my house (not wanting to wait around to coordinate meeting), he left $20, which I gave to my son. He bought us all pizza with it one night.

This phone was trickier. I found it on a decorative pillar on the corner outside my house. It would only briefly power up. I measured the (3.7v nominal) battery at 2.87 volts (and got the polarity of the contacts that way too). Eventually, tonight I played around with powering it up from a Li-ion battery charger (4.2v) that I had, and wired the phone into the charger with some wires, no battery needed. It was a nice phone --Java, GPS, bluetooth, 1.3 MP camera, color screen, downloadable music, PacMan, Ms PacMan, Tetris, 16 MB internal RAM and quarter-Gig memory card, a Samsung with Sprint & web service. Service was disconnected though. But again, some snooping revealed the owner's landline and name (and friends, school, photos, fact that she has dances classes and braces, and texted once to a friend when her mom thought she was in bed at 10pm). Her dad came over and picked it up. I don't think he appreciated the research effort, though he might when she tries to turn it on and it doesn't work.

I still use a very basic monochrome Nokia 3310 with T-mobile prepaid and I have an address/landline sticker on the back. http://en.wikipedia.org/wiki/Nokia_3310 I got this around 2000-2001. Works for me.

11 June 2009

Firmware Engineer

Today I got something very cool to work: you press a button and
a motor turns on.

The button was read by an electrically isolated RS485 two-wire interface between an ARM7 system on a chip and an 8 bit PIC. The PIC monitors the switch for gunk, and if gunked (saline or blood) indicates an error. It also expects to be queried by the host ARM periodically, if not, it errors. Using a built-in ADC. There are also watchdog timers on the PIC itself. And it checks its own checksum at boot. Also checks for stuck switches and multiple switches.

The PIC detects a switch closure by thresholding an analog input channel. If a good closure is found, it tells the ARM when queried. The ARM then closes an opto isolated relay to supply power to the tool. Only yesterday was the relay correctly mapped via a CPLD glue chip. It was inverted; upon powering up, the tool turned on. I had the EE in charge of the CPLD flip this, for safety. (The ARM could shut it off at boot, but if the ARM was bad, its hazardous to have the tool turn on.)

So at the end of the day, the switch turned the tool on. Safely.

This is why medical devices cost more than consumer devices, and why folks infrequently die from med devices. At least in the US.




The FDA is poised to own nicotine. Some wanker on the news said tobacco is neither safe nor effective. What crap. Its obviously effective.




In fact, I've read an article in a psychiatric trade magazine that said that permitting psych patients to smoke is OK, since its theraputic and they're not likely to pick it up while in the hospital.




Look up nicotinic receptors. You have muscarinic (central nervous system) receptors too, but tobacco doesn't hit them.




Anyway, getting a motor to turn on when a switch is pressed via all this isolation, software, and comm bus stuff is pretty rewarding, even if a trivial implementation is, well, trivial. Doing it safely is not.

07 June 2009

Animals in Translation (T. Grandin is a saint)

Reading Animals in Translation by Temple Grandin, who I was first introduced to in Oliver Sacks' Antropologist from Mars. Amazing book ---everything can be read as a metaphor or unconscious comparison to humans, instead of animals.

And the animal behavior, cognition, empathy, reason are right on.

26 May 2009

Cats and evolution

Humans' oldest known art form is a pornographic sculpture of woman made of mammoth ivory, 47ky old. Somewhere around that time, or maybe half as old, humans domesticated dogs (and vice-versa).

But only when humans learned to farm, which is much more productive than hunting and gathering, when they accumulated grain stores, did cats notice them. Because if you have grain you have mice and cats become your friends, and friendly, besides.

So humans have bred dogs for tens of thousands of years and recently it was proposed that Chihuahuas be designated a separate species from say New Foundlands. Cats remain unencumbered by this highly unnatural selection.

Feline Service Provider


My cat will sometimes demonstrate why California allows cats to be uncollared and unlicensed and free-roaming: he kills rodents. More occasionally a lizard or bird.

This AM I was in the downstairs bathroom and noticed a live mouse at the top of the shower. He had climbed the shower-hose. He was not happy.

Most of the time I only find a fractional mouse in the shower. At least its easy to clean up.

I tried to free the climbing mouse but he got loose when I did. I have freed rabbits, mice, hummingbirds, and regular birds from cats. I hope the cat gets the mouse soon though.

Once the cat got just the tail of a lizard. Sometime later I saw the lizard in the house, and let him go.




Tried to find the Ca law. Found this amazing site
http://www.animallaw.info/statutes/stuscacalfishgcode3005_9_31766.htm#s9
which is militant pro-cat.

This site
http://www.abcbirds.org/abcprograms/policy/cats/materials/cat_law.pdf
is cat-hostile.

There are many oppressive sites that claim cats should be indoors only. That is just wrong. They should have fluffy pillows to sleep on when they want though.

And for those that can handle it, occasional catnip in moderation.

Special skills

Special skills: I can catch a boomerang I've thrown. Several times in succession. I started in the late 1980s at UCI and can still do it. It is very fun to teach others to throw. There is a Scientific American article on the physics, which is utterly fascinating.

Recreational x-rays







I slept in, when I awoke the wife and kid were working on a science
project where they detailed the life of a scientist. They had
chosen Bill Roentgen !!!

I helped them with the gist ---it was an accident, he was goofing
with HV and tubes and had a fluorescent screen that flickered.
(I keep insisting that if they write "barium platinocyanide" that they
explain its fluorescent, which is the point... do not pretend
that chemical is common knowledge..)

Anyway, I managed to reconstruct my 5-year dormant x-ray system in the time it took them to work the report. Tried one tube, nothing.
Another, I got some CDV700 clicks but no meter change. I started to take pictures, and after a few shots I noticed that the meter had in fact increased. Slow integration time! And/or tube changes due to heating. I went back to the first tube, and got better results.

A $15 russkie blink & click detector was useless. The CDV700 was better, audible clicks and eventually the meter moved. Up to 0.05 mR/hr on the 100x scale, at 19cm, yawn. But an integrating ionization chamber used by dentists registered about 0.1 R/sec (!!!!) At 10 cm. To be conservative I have to believe the
strongest measure. I have no NIST calib.

I had been annoyed at myself for buying the integrating x-ray detector at first, as its poor (though slowly responsive) on rocks etc; but for x-rays its great, it turns out.

The hazard of course is my lack of isolation from 110V mains; the rad is on very little time, and I have a m between us, and its just me.
The mains AC is totally OSHA unapproved.

The coil coupling to the tube is via a small artifactual spark gap and the CDV700 clicks were coupled to the sparks; so unsure of dose per pulse. I have bolts in the HV terminals of the coils, and aluminium foil connecting the base pins, and an aluminum foil cap acting as a capacitor to the getter or tube top. Standard _Bell Jar_ stuff.

(I've read that Bill R had 8 pulses/sec and only ~30kV from his
Oudin coil; I'm using antiparallel ignition coils, a light dimmer, and some series 300V caps to pass just the transients from the dimmer.)

"Keep one hand in your pocket" --ALANIS MORISSETTE




The power supply is an AC dimmer (ie SCR gating the AC mains) series connected into a few 300V caps fed into antiparallel ignition coils. The dimmer makes abrupt transitions and the caps pass the transitions; the coils step up the voltage.




Running the system. Note the geiger counter (on 10x) and the x-ray meter (measuring R!!)



25 May 2009

Squid BBQ

Barbequed a squid (from Zion Market, Irvine) last night, came out great. Dusted it with sucrose and salt, stopped heat early. Also cooked some Korean mushrooms I'd never worked with, came out great. Zion has quite cheap vegetables and of course lots of weird exotic items. At least half a dozen different kinds of squid jerky. Live fish, snails, etc. I love SoCal.

24 May 2009

Fish

When I was a kid we fished a stream for horned daces, a small minnow like fish.
Later we had a pond with bass, and I fished that. Even made my own lures.

Eventually I stopped because of the cruelty.

My (upstate NY) grandfather used to fish for trout. I've seen trout in the local SoCal creek, which amazed me. (A few metres from the stream, it was standard semi-arid chapparal.)
I like to eat trout.

My favorite fish is salmon, and I've learned to salt it, to make gravlox. Never caught one though.

I like oily fish, including mackerel, and find bland fish completely boring.
I've caught an ocean mackeral once.

I let the kid catch trout in the mountains in a captive (ie lame) trout pond. We took em home, dissected them, and ate them. This was good, albeit an extremely fake fishing experience. (Time to catch: about 30sec per fish) I had to discretely kill the landed fish so as not to traumatize the kid.

I continue to worry about cruelty, preferring to behead lobsters, crabs, etc cleanly. I only hope I will die similarly painlessly & quickly. I've attended
a pig vivisection, the pig was anesthetized and never woke up. That is perhaps more moral than simply eating them (it was for medicine) but I love bacon and eat pork freely. I've also petted a friends pet pigs. Its a coherent philosophy/morality for me. Way back when, I saw terminal heart surgery on a dog, which is weird: its a dog, ie a "pet", and its surgery (with drapes etc), and the ribs looked good enough to eat, if wrapped in plastic at a grocery.

Other home chem experiments

If you add boric acid (roach powder) to methanol (petro dewatering agent) you
get green flame. Its very cool and I used it last Halloween to amuse visitors.

If you make charcoal you can make black powder. A coffee grinder or mortar and pestle helps. Also, you will learn about the importance of moisture and pressure in the quality of the powder. This is not an explosive, just a propellant, unless you confine it. In fact its just a campfire starter if its slow. I actually made
charcoal from plants I grew in the backyard, and the suburban gas fireplace.

Long ago, everyone knew charcoal and its variants, but nitre was tough, made from natural deposits. Now, charcoal making is a lost art but nitre can be bought pure from Home Depot, as stump remover.

If you mix magnetite sands (mined from the beach with a magnet) with aluminum powder, you can make thermite. You can grind the sand in a coffee grinder too.

Always make only a small amount, wear eye protection, use long bbq lighters.

Copper sulphate can be bought from Home Depot as root killer. Mixed with eg baking soda you get copper carbonate, a nice greenish pigment. Other salts are similarly blue or green. They stain porous materials eg plaster quite well. Clorides, acetates, etc are easy too, using common household materials.

None of this impresses my 9 year old terribly, he probably thinks every dad does this.

My mom had a chemistry set, which is pretty amazing. So did I as a kid.

There are other things you can make that go boom, for real, a brisant boom,
involving iodine and ammonia, or silver nitrate and acetylene, or even peroxide and acetone. But those would be dangerous (in various ways) to make.

I've also made yellowcake from uranium ore that I got from the desert.
(And used geiger counters to track it.)

There are more dangerous chemicals under the sink, or used for pools.

Car accidents kills more kids than any other cause. Yet folks drive their kids to trivial things.

I've tried making guncotton but I don't have (and haven't distilled) nitric acid and so it didn't work.

Amateur science is very important. All the STEM (sci, tech, engineering, math) hype won't work unless kids are excited. When I 'retire' (an obsolete, 20th century concept) I might teach science. And/or computer science. Meanwhile I'm a practicing engineer with unusual hobbies.

Speaking of which: out on Trabuco there is a model-airplane flying club, the Trabuco Flyers. I've paused to watch their aerobatics, very cool. They use nitromethane, an explosive (if done right) to fuel airplanes with 2m spans+. The horror!

Heck, even mountain biking is dangerous, I know a guy whose mouth was wired for a month because of a biking accident. And I've known someone who died in a private plane crash. And how many kids break bones, get brain damage, die of cardiac failure, or heat stroke, from "sports"? Before modern medicine, a broken bone might well be a death sentence or at least a lifetime crippling event.

Oh, and I've made x-rays using ignition coils and vacuum tubes. Even taken pictures with them.

And measured the density of gasses using an alpha-particle source and mica-windowed geiger counter.

And graphed the decay of radon using (freely distributable, open source) software I wrote, combined with a 1960's yellow civil defense geiger counter.

Kid injuries so far: chipped tooth from a friend in a swimming pool.

My oldest net posting

October 1987

http://catless.ncl.ac.uk/Risks/5.42.html#subj5.3

First quarter of grad school.

Plant



This is a plant that grows up in the San Bernadino mountains. It looks like ringworm and no doubt follows the same rules, expanding outwards. (See also fungal fairy circles). Also reminds me of the Belousov–Zhabotinsky reaction.

Colorful pictures




The laser is illuminating the base of a low cloud.

Cheap wide-angle lens for point-and-shoots

High res digital point and shoot cameras are extremely convenient.

Some tricks:

You can use a hardware-store door-viewer as a wide field lens once you learn to hold it correctly.

You can also use a screw (in the camera body) and a string (which you step on) as a stabilizer. I haven't done this but its very clever.

Back in the day of silver and hiking with friends, I used to haul a 35mm SLR with a big wide angle zoom. Its nice not to have to open your delicate optics to change film in a dusty, windy environment.

Farm machinery photos








This is behind the Alice Wheeler library.

Calcium acetate


Dissolve eggshells in vinegar, then crystallize.

Interestingly, if you heat calcium acetate, you get acetone.
Also, calcium acetate is a drug used for kidneys.

For sale



A neighbor was selling a large blue canvas. I thought it made a hilarious backdrop.

A catapault I hacked together for the kid

Subaru



(Since I've expanded this blog to include hobbies..)

The Subaru up Santiago Canyon

Painting a beach using a magnet to separate magnetite

Cat picture



Lets face it, Al Gore invented the Innertubes so that we can watch cats ride Roombas.
Here is my obligatory cat picture.

You might be an embedded software engineer if..


You might be an embedded software engineer if your cube looks like this

Trabuco creek, trout







Past two weekends I've taken the Subaru Forester up Trabuco Creek trail. The first time I went all the way to the end, HorseThief trail. There is still water flowing. Saw some tadpoles. And I saw a trout in a 3m wide little pool. Next weekend I took the kid with me, and we saw a few more trout, and a salamander. Also some nice butterflies and dragonflies around the water. And some nasty looking water beetles that try to eat small fish.

Some pictures follow.

21 May 2009

Medical vs. Commercial software

Commercial software is released when the marketroids say so. Medical software is released when you can defend yourself in court ---meaning testing, procedures, QA, documentation, skill, etc.

What is dangerous is when commercial software is used in life-critical apps, eg some vulnerable software is used by a contractor for a nuclear reactor.

I took classes with Dr. Nancy Leveson and roomed with Dr. Clark Savage Turner. I later read the Therac papers, worked for a defibrillator company, and later an electrosurgical instrument company. None catastrophic; though the chief scientist at the place I now work at has worked on aircraft systems, as have the two other founders.
I worked on a video kludge for some obsolete hardware there, nothing critical at all.

The defib code and the ESG / ESU code could hurt one or two people, nothing major
catastrophic, but still enough to be superuseful and somewhat or slightly dangerous.
I was not a lead, in fact, brought in fairly late, in the case of the defib; but I am
the lead on the ESU.

In a few years my software could run a tool being stuck into your inflated abdomen. I will do my best to make it do as told.

19 May 2009

If the internet was a building

If the internet was a building, the first woodpecker to come along would take it down.

Not my idea, but I subscribe.

17 May 2009

Amusing progress message from Wolfram


Checking out Steve Wolfram's "Alpha", I got this message. Check out the
progress indicator. "NaN" means not a number.

13 May 2009

Joys of hardware

Yesterday felt ill, went home, slept, went back to work. Felt better than I had
in a week. Today, went in early, found several hardware problems. I'm trying to
make a build sufficient for ESD testing, and it turns out to accelerate the integration
testing, four PIC boards talking RS485 to an ARM, on an isolated bus.

Good to be back at work. Still seeing 2pm fade-out. Dealing with it.

09 May 2009

Another hobby: Cooking

Another hobby, I realize, is cooking. I particularly enjoy BBQ, and have used since 1998 a propane unit. Previously I've used a very cool ceramic japanese charcoal-fired bbq that some friends gave as a marriage present, and before that, a hand me down hibachi. I used to entertain friends at my grad school apartment after a long hike, and BBQ was the thing. Now that I'm a family man I still like to BBQ. Its a grand chemistry experiment that you can eat. With the control afforded with a propane grill its a thermo experiment as well. I tell you what.

08 May 2009

Hairspray cannon III


Well, after demonstrating a number of concussive firings I found that the cardboard
cylinder that a household abrasive cleaner is packaged in is just under the correct
bore, caliber 73mm or so. On my first launch out of my shorter "gun" I shot
the comet cylinder a good 4m and over a wall. It hit a palm. Very cool! Reminds me of the first beer-can shot with my first tube, surprisingly good results. Nice parabolic arc. Harmless fun.

I'm also experimenting with pure butane from an ITAWANI cartridge, which is a japanese thing. I like unusual (to me) food; I go to Mitsuwa, a japanese grocery in Costa Mesa, when I can. I always get fried squid, and either a bento or a sashimi & rice dish they have. Usually I take it back and eat at my desk. Anyway, cylinders of butane for small stoves are pretty cheap there.




Actually, hairspray seems to be best. Its probably the isobutane propellant.

Objectivist taxi


Saw this:

Hairspray cannon II


I used the half-opened bottom of a mixed-nuts tin over the current tube, and got a nice bang. Quite distinct from the whoomph. Very cool. Replicates earlier experiments and observations.

I hot-glued the defunct lighter into the shorter tube, so it looks like
a gun. That goes whoomph and spews a fireball. Nice. With the anti-silencer (ie half-opened can on the muzzle), you get a nice boom instead of a quiet whoomph. Will have to experiment with aperatures vs. acoustics.

Even cooler: after you fire it, the muzzle continues to burn off residual fuel.
Glows blue. Nice.

Hairspray canonn

Last trash day,
I was delighted to find that a neighbor was throwing out massive cardboard
tubes used as cores I think for tiling of some sort. Anyway I was needing
fodder for my hairspray cannon experiments. I'm not sure whether aspect ratio
matters or simply fuel:air mix. I have not yet been able to produce a concussion
with the new tubes. I could do this with a previous tube when I put
a potato-chip tube with a D-shaped metal part cut out of the end, leaving a D shaped
occluder. Without the partial occluder I got the same "whoomph" that I'm getting now. That difference (bang vs. whoomph) fascinated me; I've thought about reflection physics, thermo, detonation theory, etc.

The percussive setup would be great for 4th of july, very safe, legal, yet loud and boomy.

The new tubes are of sufficient diameter to hold a BBQ igniter module I had once bought, but which didn't fit earlier tubes. They are nearly 1/4" thick, I have to use a drill to make a hole in them. For either the igniter module or an exhausted
disposable BBQ lighter which still sparks. You can also ignite the tube with
a regular lighter, but since you're not blocking the touchhole, you get flame
from the touchhole (danger!) and limited compression.

I keep thinking that Blue Man Group needs to use pyro acoustics.

I've also never successfully launched & ignited Cremora powder, which is supposedly a nice optical fireball.

Campbell's soup plastic bowls are the proper size to block the breach. With friction. I've not yet found a nice-fitting projectile ---previous tube fit a large beer perfectly-- but am working on this. A good piston seems to enhance the efficiency greatly. We once cleared the house, which takes 30km/sec. This was with a small water balloon on top of a 24oz beercan inserted to its depth in the tube. Fired vertically.

Its both a tedious distracting pain and an interesting challenge to find proper-fitting accidental components. No art without constraint.

I need to find the right fuel:air for a full 6' tube and a piston. I might also
experiment with chokes, eg soda bottles that neck down the diameter of the tube.
Or expanders, eg trumpet flares, which are impedence converters, ie transformers, couplers.

Its fun to have a kid you're trying to interest in things, a smidgen of income and time, and some dangerous knowledge. Not even beginning to mention the trouble you can get into on eB*y or the innertubes in general.

This is Freeze-It hairspray, cardboard tubes, and a lighter. When I was a kid
I didn't know about this. Now, you can find Youtube tutorials...

07 May 2009

Cats

So I'm sitting on the loo and the cat brings in a mouse. I don't have my
glasses on but I quickly perceive that its alive. Its also not pleased.

Bottom line: it escapes.

05 May 2009

Another lingo collision

Fuse. A fuse in an electronic device can be irreversibly blown, opening a circuit. This is used for thermal protection. And in FPGAs and other field-programmable devices, to permenantly set a topology of circuit or logic elements, by blowing fuses.

And in electrosurgery, you can fuse tissue, joining, like welding, albeit without the addition of the welding rod.

Name collision. Not uncommon, really.

Network Analyzers

I'm probably the only person in the world who has used
a "network analyzer" in both senses:

In the modern digital networking sense, I've used Ethereal (now Wireshark) to look at IP packet contents. It shows bytes in a packet, parsed according to the various networking layers. EG a UDP packet might contain a command, and itself is wrapped in an IP header.

In the older analog sense, I've used an IC, the AD5933 which can analyze a LRC (inductor resistor capacitor) network. It sends a range of frequencies into a device and listens to the amplitude and phase of the output. Used to take a 100 lb box the size of a microwave oven; now its a chip.

This is what you get for being an eclectic engineer.

04 May 2009

CSPAN fun

Watched Dan Kaminsky et al try to explain to some congresscritter Weiner
that the internet (upon which civilization is now built) is completely insecure.
Kaminsky was a surprisingly good speaker, only a few tech idiosyncracies slipped in "its a solve"), always using "software" for executables. He concentrated on DNSSEC which is a good idea but hardly sufficient. (The DNS cache poison hack is
Kaminsky's current claim to fame) It was clear at a couple of points that the congresscritter didn't get it, didn't understand the answer, or asked a nonsensical question.

Still, it was entertaining enough for me to watch.

03 May 2009

Photography: Ridge Park trail rattlesnake

Ok, I said this was going to be for work, but this is pretty
cool, from yesterday



He was a very mellow reptile.

30 April 2009

H1N1 theory of operation

This is a translation wikipedia sources on flu mechanisms. My attempt at being a science writer.


The virus is covered with sticky parts ("HA") which recognize certain sugars that your cells have on their outside surface. (Pigs etc have them too.) When the sticky parts recognize the sugar they change shape and harpoon your cell. This causes your cell to form a cavity around the virus because the virus is sticking to the cell membrane. Think tennis ball rolling on a sheet of velcro.

Some extra machinery the virus carried with it (M2) causes the virus jacket to fragment once insde. Then the virus's now-bared RNA codes are moved into the cell's nucleus by the cell.

In the nucleus the RNA are copied, and some are sent out of the nucleus to be turned into proteins. Some of the proteins go back to the nucleus, pick up the viral RNA and package it. The packages head out again, this time attracted by additional machinery (NEP etc) to a spot on the inside of the cell's membrane where other proteins are waiting. They all get assembled into a ready virus, and one final viral machine, "NA", cuts the sugars that might be holding the new virus (studded with HA after all) back.

Pretty clever, how it brings all those tools for each step, and of course how it exploits cellular machinery to move around the cell. Yet reassembles. And how it keeps its harpoon sheathed until it tastes that sugar that means prey.

A finely tuned mission-impossible subversion of an enemy factory. Conducted by nano drones.




Note that flu drugs work by interfering with NA.

Note that the flu A genetic code is RNA which is more succeptible to copying errors than DNA. Faster evolution.

Kids toys

For some time now, sound cards have been standard on PCs and the CPU has been quite capable of realtime audio processing. As a result, there are several free oscilloscope and spectral analyzer programs out there. Scopes used to be hundreds of dollars and spectral analyzers were very specialized large pieces of dedicated equiptment.

In fact, there are chips like the AD5933 which perform spectral analysis (analog network analyzer functions) in hardware, out to hundreds of kilohertz. But for kids eg learning about music, sound physics, or electronics, its amazing that they have this opportunity.

Software Safety Mechanisms

* Watchdogs
* Timeouts on dangerous states
* Stack overflow checks
* Firmware CRC boot/background computation
* Persistant data (eg calib params in flash) CRCs
* Analog switch (resistance error band)
* Integration of measurements
* Reliable, error-detecting communications protocols
* Safe scripting control
* Crypto -authenticate, integrity check
* Handshaking (multistep) protocols enabling dangerous states

* Self calibrating measurements
* Error detection on measurements
* Alarm strategy

* Single point failure tolerance
* Elec. isolation
* No energized human-accessible pins (UL)

29 April 2009

Inductors

An inductor is something that wants to keep something flowing. A coil of wire with current flowing through it generates a magnetic field, and it opposes any change in the current. A paddlewheel in a stream has inertia, and opposes any change in the current.

If the current changes, an inductor produces a voltage. If the current changes, the water can build up or form a trough at the paddlewheel.




At my most recent project we used very low RF, below the AM band, and the inductors were sometimes huge doughnuts of ferrite. Literally the size of doughnuts. Since most digital (and modern analog) boards use very tiny capacitors and resistors, and generally only a few tiny inductors or transformers for power-conversion reasons, this was unusual to me.




If you drag a magnet through the sands of certain beaches around here, you can collect magnetic iron oxide, ie magnetite. It looks like you're pulling a black sea urchin from the sand! In bulk form this is lodestone. You can mix it with epoxy and cast your own inductor cores. Or you can grind it in a coffee grinder and mix with aluminum powder (3:1 Fe2O3 to Al) and make thermite. Or you can use it to "draw" on the beach, without polluting. And you can teach kids about mining and geology in questioning how the deposits got there and got separated.




So if a paddle wheel is an inductor, what is a transformer in this hydraulic analogy? It is a pair of paddlewheels, in different streams, connected by a belt or gears.

But this doesn't work that well as an analogy since a transformer only passes alternating current. A better physical analogy would couple the height of the water at the upstream side of the paddlewheel to drive another paddlewheel in another stream. Then only alternating flows in the first current would couple the two paddlewheels. Because a steady stream in the first paddlewheel would generate no buildup of water to drive the other wheel.

Here's a crude schematic:



Of course, in a real transformer, the coupling is via (changing) magnetic flux and Maxwell's laws of electrodynamics.




BTW this post assumes you're aware of the more obvious parts of the hydraulic model of electricity, with Ohm's law, balloons as capacitors, pumps as voltage sources, etc. If you don't know what I'm talking about this will be worse than confusing.




(Later)
There are problems with this model. The coupling between the paddle wheels needs to work only if there's change in the flow. Magnetic fields in the aether. Something involving ripples in a pool, generated by varying flow, which are picked up by another circuit, to drive flow in that. More complicated than a simple gear or belt transmission as illustrated.

Safety and Software

There are different degrees of badness. You can hurt 1 person, or hurt many people. In a medical device, you can typically only hurt 1 or 2 persons (patient and doctor) at a time. In an airplane or reactor, you can hurt many at once.

Medical devices handle single-point failures ---one thing can go wrong and the device is still safe. It may not work, but it has to fail safe. Of course, for some things and circumstances, not working (availability) can be hazardous.

To some extent there's an analogy between safe programming and legal contracts. You try to predict and handle and exceptions in an intentional way. You might have severability ---where other parts keep functioning if one part craps out--- and watchdog timers ---where functions must be executed in a certain time span. You need to define correct behavior from observables as much as possible.

This makes the game more interesting.

Running jokes at work

At the defibrillator maker, we joked that if the device didn't work, the patient was dead already...

and that if we shocked into the wrong (ie healthy) waveform, which could cause the heart to fibrillate, we could just shock again into the waveform we had just produced..




At the disk place we joked about users caring where their data went..




At the electronic design place we joked about just needing more capacitance, or a bigger inductor (the idea being that brute forcing a noise problem is simple).
And jest back and forth about whether something was a hardware or software problem. E.g., forgetting to plug something in was a hardware problem.




These may not be as amusing to you as they were to me at the time. YMMV.

How does matter think?

So how does someone who gets interested in human and machine vision (AI) end up working with hardware? I'm fascinated by, "How does matter think?" and this has led to studying neuroscience and electronic circuit design. How do (neural, electrical) circuits compute? What is computation? What is thought?

Object Oriented programming

I first taught myself C (on a Vax 11/780) over 20 years ago, and then in 95 started using C++ to work with Microsoft's Foundation Classes (MFC) which are its GUI libraries. I also taught myself Java and wrote an industrial control application that used Java and Visual Basic to talk to a sheet-metal folding machine.

Since then I've used Java for a RAID management tool, using JNI, and also to prototype a medical instrument, also using a JNI I wrote. Java is so much cleaner than C++, you never want to touch C++ again. Its interfaces are better than inheriting from multiple classes, its exception handling much cleaner, its typing is well defined (what a concept! Its missing from C, C++ of course.), the libraries are nice, the abstraction is natural, not kludged in as it is in C or C++.

But on my last project, embedded medical firmware, we had to use C. But I enforced "object oriented C" where you define classes and maintain encapsulation with instances and static (file-local) variables. EG ScriptEngine.c, ScriptEngine.h, contains functions of the form ScriptEngine_blahBlah(...). There might be a ScriptEngineInstance.h structure which ScriptEngine_ functions take as a "this" argument, which is how multiple instances are handled. If a class is a singleton, or there's a single global state, you can use the C "static" keyword to hide variables in the class' .c file. And you can define private functions as "static" too, to hide them.

I hate the way "static" has so many meanings.

So, I'd rather program in Java the rest of my life, but I can manage some of its best features in disciplined C.

There are attempts to have real-time Java, and microprocessor support for the Java VM instruction set, but these are not common and look "risky" to engineering firms that are experienced in older ways.

Note also that when doing embedded programming, and/or real-time programming, some of the memory games that C++ and naif Java will do are bad. So you have to use the right real-time supporting garbage-collection (and design & implementation) strategy or avoid certain calls (malloc()) and libraries. Fascinating stuff but C still rules in 2009.

25 April 2009

Ceci n'est pas une spam



Google (ie Blogspot.com) seems to think I'm a "spam blog". Perhaps because I've been posting a lot recently, to start up this blog. Needless to say, I don't feel like spam, although pigs are used to model humans.

Hey Google bots! I'm not a robot! Really! I dream of real sheep! Read DesCartes, you stupid bots! Read Asimov! We run you! Watch the Matrix, we can fight back!

My Roomba is looking at me strangely.




BTW, Magritte is awesome.

Scientific freeware I've released

I released some scientific freeware once. It uses a PC soundcard to count clicks from a 1960s geiger counter and logs them digitally. Basically gives a vacuum-tube based detector a much larger integration time, allowing for more sensitivity. Makes graphs, logs to files, even has a webserver. You can graph radon decay using this civil defense instrument!

It works on every Windows OS from '95 to XP, but not Vista, of course. Its totally self contained, no dll hell.

http://sourceforge.net/search/?type_of_search=soft&words=cdvcounter

I wrote this because I found the yahoo group CDV700Club
and bought a Victoreen CDV-700. I actually already had a LND-720 based mica-windowed GC that I had bought to play with when doing crypto (for RNGs) which used serial port communications, and also had a crude, DOS-based grapher.

Gallery of stuff I've worked on









Electrosurgical generator and cubicle







A wall of disks, each blue light is a pair of SATA drives. The whole array is one RAID volume.







The ECG/defibrillator










Printer with security features, taken from http://i.cmpnet.com/colordocumentsolutions.techweb.com/assets/6_SecuritybrochureOct2006.pdf


24 April 2009

Roomba

I've had a Roomba for a bit over a year, and despite some glitches
* sidebrushes were wearing out very quickly, handled well by company
* gearbox for brushes started melting from bearing friction, replaced by company
the thing cleans very well and is entertaining to watch.

You do have to learn to clean it well --you get felt pads of hair forming--
but it does a good job and you don't think about it once scheduled. Then you
just clean it as part of your Sunday morning coffee ritual, or whatever.
It finds its own recharger, which is very cool. And it has battery powered
virtual walls so you can restrict it.

Its an interesting design, besides the blind mapless insect algorithm it follows. There are lots of motors there: one for each of two wheels, one for the sidebrush, one for the two floor brushes, and one for the vacuum motor. The sidebrush is great for getting into places. The hierarchical behavior algorithms came out of Rodney Brooks' work at MIT, well after I was gone. Its interesting to notice when you perceive (project?) intentionality: when it homes in on its recharger, when it turns away from virtual walls, when it spirals because it notices dirt, and when it follows edges. When it bumbles and bounces, which is most of the time, it seems less intentional, more blind searching.

Getting machines to talk with each other

Among my first jobs was getting a PC-XT that ran Logo to control a Commodore-64 over a serial cable. The C-64 was programmed (by hand in hand-assembled machine code, by me) to act like a synthesizer, taking commands from the XT and driving its excellent for the time music synthesizer chip. This was before MIDI made such a hack obsolete.
And that was before sound cards were standard.

Later I became a system and network admin out of necessity. Network admins get machines to talk. ISDN, Ethernet. Later some WiFi diagnostics. Ethereal, a network protocol analyzer that lets you examine the contents of packets you can sniff.

Later I worked on protocols to get Linux & Windows to talk, securely.

And boards in medical devices to talk, with RS232, two-wire RS485, SPI, and I2C.

And networked, distributed disk systems to behave.

Machines are so much more useful if connected. Its kinda like steam engines: a steam engine on a rail (ie, train) is so much more useful than a fixed steam engine. A computer on a network is much more useful than an isolated one.

And instead of one steam engine driving a shaft with takeoff pulleys for each worker, the mainframe model, we then had an engine (desktop) at everyone's workstation, and now we are getting little tiny engines embedded everywhere, lawn mowers, toys, etc. (Actually because combustion engines are nasty, we have little electric motors everywhere, but the point is the same: what used to be centralized and scarce and clumsy becomes ubiquitous and invisible.)

Cryptography

I got into crypto when I realized that IP is sending postcards around, no privacy. So I got curious how block ciphers worked. DES looked complicated, so I studied Blowfish, and put up a paper sketching how it would work in hardware. This got me a job at I. implementing Blowfish and IDEA in Verilog to make a chip. Also studied zener based RNGs and conditioning algorithms (and measuring algorithms viz Marsaglia's Diehard and Maurer's metric). I did implement the algorithms but the chip was cancelled as it was nonstandard and AES was coming up.

Also spent a few days in a Faraday cage measuring noise (for RNG) properties on wafers. That was interesting, although the room was very stuffy.

Later at T. I worked for a few months on a contract to develop secure printing, so that the document would remain encrypted until you were at the printer entering your password. That way if the disk in the printer was taken the document would still be confidential too. Used in banks apparently. That involved Linux & Windows interoperating, using open-source algorithms. I just got a patent for it, something like 5 years later. My third.

When I. laid me off I spent a year helping a friend and former manager to create a startup. It would have used a crypto dongle to decode content that was floating in the cloud. I learned quite about about RSA and bignum implementations. And weird number theory voodoo. I once had Rivest as a TA, actually.

Around late 80's to early 90s I was into the cypherpunk mailing list and learned quite a bit about social and economic effects of crypto, e.g. with Tim May, Robert Hettinga. I've met Ryan Lackey and corresponded with one of the Seastead authors via a social channel. I met Ryan when the group was invited to the SF PD to check out their training simulator. I managed to catch the web of my hand in the pneumatically actuated fake gun, and it really bit. I also got blown away when a traffic stop guy pulled out a shotgun.

More recently I was using Atmel cryptomemory chips for authentication. And expiration, but that doesn't require crypto. It would have been easier to just use a PIC and implement my own protocol, and then lock the PIC down. In the end I used the fresh-off-the-fab cryptocompanion chip to perform some of the handshake, and it also stores the shared secret better, physically.

Mind you, this is with a Microchip PIC 16F processor talking to the cryptocompanion and the disposable cryptomemory. Some of the handshake work was being done by the electrically isolated ARM which talked to the PIC via isolated 2-wire RS485. That was because the PIC didn't have enough memory to compute a required function, so the ARM had to get involved. Crazy complex but it worked.

People often don't understand the difference between confidentiality, authentication, and integrity.

Even worse, because that is simple ignorance, is fools who bandy about "PKI" without a clue as to what it does or requires, or motivation for the choice. Just a buzzword.

Oh, and another peeve: you can't sue Verisign so what good is a cert from them? And since they're in bed with the government, and anyway individual folks can be bought, what's to stop them from issuing false (deceiptful, fraudulent) certs? Zero.
A reputation based system might be better, or an insured, bonded UL type better-business bureau that you can sue.

23 April 2009

I first used Java in 1995 to monitor and control industrial machinery over the web.

More recently, at Z, I've worked on a disk-RAID management tool using Java. I even wrote services and pop-up notifications in Java which also worked on the Mac. That was pretty cool. I was involved in GUI design of the tool as well; we used Swing and the Netbeans/Matisse IDE / GUI builder. At my most recent position I used Java to prototype a medical instrument; I wrote a JNI to talk to the I/O modules that physically interfaced to the system we controlled. I've even prototyped an audio-processing app in Java for my 9 year old's invention-fair.

I am a technical, not business J2EE programmer.

Basically all GUIs should be done in Java and as much as possible of a system should be too. This isn't widely used in embedded or medical although it could. But for everything else you win big ---more productive, more maintainable, not locked to a given platform or OS, more elegant. Plenty of advanced libraries. Well defined behavior (yes there are well behaved garbage collection strategies suitable for RTOS even.)

22 April 2009

My Consumer Product experience

I've worked on actual physical products, some for shelves for regular consumers. You can't make money on clever software these days ---ever since Netscape, either Microsoft will give it away for free or some open-source coder will do so. So the remaining niches are where Microsoft won't go ---embedded applications, for instance. Where the code supports something physical that you can't just copy with a few keystrokes.




Z produced a consumer distributed Disk over IP box, sold to ordinary consumers via a major retail firm. I supported this device, building UDP / IP tools for technical help folks, evaluating and adding features for marketing folks, internationalizing for the Asian market. I also worked on a management tool for a business product, using Java / Swing / JNI. I was also hired for cryptographic experience. They ran out of VC funds. They had lost consumers because of flaws in their consumer device, in part thanks to the lowest- or fastest- bidder Indian outsourcing. They also had remaining flaws when they tried to deploy the business product in beta business sites.

At C I helped produce a medical device (ECG/defibrillator) for use by nurses and physicians; I helped implement the GUI and various internals, as well as ancillary Windows programs.

The company was bought and several engineers including myself were laid off. A few years later and the product is released, pictures are on the net.

At H, a medically-qualified electronic design firm, I helped refine and then implemented the embedded GUI, from the ground up, for a medical surgical instrument, for which I was lead software engineer. I helped bring up custom PCBs. I also designed and implemented a prototype system used for preliminary FDA evaluation. This involved designing a script engine, choosing I/O modules, writing JNI layers to talk to I/O modules. I implemented cryptographic authentication protocols using Atmel cryptomemories, etc. Worked on both 8-bit PIC processors and 32-bit ARM7 processors. This company grew too quickly and could not make payroll. That was a shame as it was fun to work there, smart and humourous people, relaxed conditions, combined a number of interests of mine.



Areas of some expertise

I've worked with the following, which I'll elaborate more on later:

  • IP network protocols (custom and RFC'd)
  • cryptography (encryption, authentication)
  • computer graphics incl. animation
  • computer image and motion processing
  • human vision research
  • RAID
  • hardware design (verilog)
  • medical embedded firmware

Some of these are related and some led to others (eg learning about how IP is sending postcards let to curiousity about how encryption worked).

In crypto and in medical, you need to think about what can go wrong. In medical you have failure modes effects analysis (FMEA) and hazards analysis & amelioration. In crypto you play a game where you ask, at each step, what can the adversary do? In this way crypto is like chess or the law. In law, you generate contracts to handle every case. You have to do this with medical firmware too. The device will always have some state, so you have to make it safe, even at the cost of availability.

Anyway this used to look scattered on a resume, now it shows that I am flexible and like to learn new domains. A toolmaker. One interested in biological computing, and massive synthetic computing, hardware of all sorts.

Hobbies at one time or another

One of the things one is asked is, what are your hobbies? I currently enjoy hiking, photography, cats, music, and teaching my son. I have at various times enjoyed reading sci-fi, cryptography, camping, amateur science, backyard ballistics, geology, chemistry (pyro & otherwise), gardening, boomerangs.

I tend to get very into anything that attracts my interest, learn a huge amount about it, then it may fade.

Introduction

So this is my professional blog. Rather than being a diary per se, it will be a collection of observations and experiences. Being associated with my public name, it will slightly anonymize entities and be entirely about technical and business matters.

I am currently available, write to dahonig
at cox dot net.