Chris X Edwards

The "nanotechnology" I'm familiar with is really in Angstrom scale (=nm*.1). Roughly like filling a car with so many barrels of gasoline.
2020-11-18 07:18
I'm pretty sure tear gas would work. And no need to be gentle when you put him in the car.
2020-11-13 09:06
I love it when on-line answers to a simple question point to the 8000 page manual as if reading it was easier than knowing of its existence.
2020-11-11 06:31
Essentially a real headline that you do not need to worry about at all: "Drug Company Says Drug Company's Products May Be Very Effective".
2020-11-09 11:15
You're fired!
2020-11-07 18:49
Blah Blah

Autumn 2020

2020-10-27 17:03

I’ve really been enjoying the autumn colors this year. I’ve been going for walks in our community’s forest every day and I wanted to preserve and share a little of what that’s like.

On today’s walk I happened by the polling place where early voting is underway. While this photo shows some lovely trees, what it doesn’t show — which is why I’m telling you — is that the line actually snakes around the back of the parking lot and all the way to the far right of the photo.


Interestingly there is exactly one executive function of the government that has taken the pandemic very seriously — perhaps more than any other entity on earth. Thanks to the USCIS, that’s a line I will still be disenfranchised enough to not stand in. And no, Fox viewers, I’m not compelled to stand in the cold for hours because I can’t resist getting high on some sweet sweet voter fraud.

I’m quite terrified of the reason my neighbors seem so serious about voting. All I can say is I hope they do not fuck this up.

All very stressful, isn’t it? Well, let’s get back to putting that shit show out of our minds and enjoying the nicer part of the walk.


I do love living in a forest!


2020-10-20 23:09

Here’s a fun story that involves Tyler Cowen. He’s a professor of economics — which is not too interesting. What’s interesting is that he’s also the main force behind one of the smartest, most interesting websites on the internet, Marginal Revolution. Back when I was scraping the internet every night to compile a corpus of blogs and news that I felt might have predictive power Marginal Revolution stood out (from thousands) as a thoughtful blog that I actually found interesting to read. The fact that it has persisted for well over a decade (where I’ve been a faithful reader) is quite unusual. That uniqueness is compounded by the prolific content. Normal influential bloggers might put out something interesting a couple of times a week if they’re very active, but Cowen publishes half a dozen things pretty much every day. He also is a prolific writer for Bloomberg — for example here’s one today. To summarize — Tyler Cowan is kind of a titan among public intellectuals. I’m a fan.

I was reading his stuff like I do and I saw him link to a story about some C19 vaccine snafu involving the FDA and, of all things, data formats. Well, I don’t usually know anything Tyler Cowen doesn’t already know but in this case, I’m kind of a minor expert on this exact weird topic. I sent Professor Cowan an email pointing out that I’ve had some experience with messes from the FDA and I’m not surprised to hear about a problem as banal as this. To demonstrate my ever so slightly elevated experience with this topic, I sent him a link to my old FAERSFix Github repo. Obviously he (and all other humans) have no idea about this obscure project so it was intended to just be another data point for him on the topic.

Yet the next day I’m making my normal rounds of the internet and I find he has posted this.

And it features my README from that project and a link to its Github repo.

This GitHub repository is a back up of my FAERSFix scripts.

The FDA Adverse Event Reporting System is a horrifically dysfunctional quagmire of shockingly bad data. The data is not just bad for severe epistemological reasons, it is also poorly organized and riddled with flagrant absurd errors.

These scripts smooth over the very messy process of acquiring and basic debugging of the data. At the end of the process a user can arrive at a local repository of the FAERS data that is sane enough to begin to think about some kind of sensible analysis. To understand the disastrous state of the original source data, see the source code of the scripts which is designed to be a readable self-documenting manual demonstrating how to correct this mess.

Since the FDA’s gremlins never rest, these scripts will become obsolete. If you would like to contribute updates or fixes, feel free to send me a patch or a pull request. Good luck!


That’s kind of cool but a bit more public than I’m used to. However that’s actually why I uncharacteristically put it on Github — I was hoping to make it easy for someone else to use. I actually think the topic is pretty important.

Let’s back up and answer the question, what exactly is this data? And why should we care?

Let’s back up even more. You’ve heard about "clinical trials". They test some drugs and if they seem ok, they’re "approved", right? But when those drugs get deployed, they get prescribed to orders of magnitude more people than were in the trials. That shouldn’t seem surprising. But what is shocking to me is that after literally billions of people eat these magic beans, the FDA does not really have any intellectual curiosity about what actually happened in real usage situations and scales. Were the drugs seriously flawed? Well, if the trials were too, then we’ll never know!

Checking up on how drugs really are working out is a hobby called pharmacovigilance. The fact that it is kind of a newish idea is horrifying to me.

And this brings us back to FAERS. When you, your doctor, your lawyer, or, well, anyone really, feels like submitting a report about an "adverse event" related to some therapeutic substance, you can submit it to FAERS. Is it required? Something that doctors are obliged to do? Heavens no! So let me repeat — anyone can submit anything any time. Not off to a great start.

And that’s where I come in. Let’s say you want to do some analysis on this ugly data. (Incidence Rate Ratios are probably your best hope by the way.) It turns out that it’s not just of questionable provenance. The actual format and technical arrangement of the data is also terrible. It is so terrible that I had to write this software which simply acquires the data from its hiding places and patches up the most egregious errors. It’s been a long time since I played with this but with my software I could start with an internet connection and wind up with a reasonably formatted collection of questionable data. Doesn’t sound like much but it beats unreasonably formatted!

One final fun thing to point out. Because Professor Cowen’s post got quite a lot of comments, I actually got a lot more feedback on this project than ever. One commenter misunderstood some important points, but definitely caught an error I found very interesting.

A small thing, but this criticism of the FDA software would carry a little more credibility if the author used the correct name - it is the FDA Adverse EVENT Reporting System.

They are referring to the fact that I incorrectly referred to the source data as the "FDA Adverse Effect Reporting System". I never noticed that was incorrect. (And I’m not 100% sure it was 4 years ago, but anyway…) It is definitely incorrect and should be the "FDA Adverse Event Reporting System". So I stand corrected! Stupid me. But I wondered why would I think that? I didn’t have to dig far. Most of the source data URLs (77 of them when I worked on it) looked like this.

It’s been a few years since I tracked this data and the bigger irony is that looking at the FDA’s website today, I see they’ve cleaned some things up quite a bit. They at least put all the data in one coherent place which is good. Who knows, maybe they used my code and fixed the other problems. I hope so. I’ve at least done everything I can do to help them.

Unicon - A Unit Conversion Tool

2020-10-14 23:47

I recently had a crazy idea about how engineers should be educated. They should be coached until they have reimplemented from scratch the software inside the Hewlett Packard HP48 calculator. It’s that simple.


I discovered the HP48 just after graduating from engineering school and I was sickened. I couldn’t believe this device which very clearly was designed to help kids claw their way to an engineering diploma existed. Every topic in my engineering studies was in that machine ready to help. I had struggled through the entire ordeal unarmed, oblivious to the existence of this heavy weapon.

You might think that a rewrite of all of that device’s superb software would be especially heavy on the programming. Yes. That is precisely why it is the perfect exercise for a modern engineer. And at the end of it all, the graduate would have a magnificent collection of self-made technology with which any engineering problem could be tamed.

Ya… Funny story. So it turns out that’s kind of what I’m doing.

I loved that HP48’s architecture so much that it was one of the main inspirations for my programming language, Geogad, which I have used every day for about 15 years as my personal calculator and heavy hitting math tool. Recently I’ve been getting into electronics more than ever and I’ve also been hitting a lot of broad topics in other kinds of engineering. This all means that I’ve been doing a lot of conversions from, say, picoFarads to microFarads and knots to meters per second, etc. All of this has made me nostalgic for the superb units handling features of the HP48. Of course I could not resist the overly clever impulse to reimplement all of that functionality.

Yes, I do know about thousands of simplistic online conversion utilities (e.g. "hey Google"). I also know about GNU Units — it is an incredible tool and if you have unit conversion problems, you should know about it too. But I needed something that was going to ultimately be a better fit with my programming language and so I got started writing a quick study to see how feasible it was.

And wow, that was quite a rabbit hole. Eventually I got something I feel good about and I thought that maybe I should also make it a standalone program so that people can check it out. Maybe it will prove to be helpful for someone. I packaged it up and called it Unicon.


You can check out its project page here.

You never know quite how many problems you can run into until you get a computer to help you uncover them; the number of bugs I had to deal with on this project was impressively high. Just typing in the entire HP48 units catalog by hand is going to produce more bugs than an anthill. There were subtle weird problems all over the place. Finally as I was starting to feel more confident that it was going to start working pretty reliably, I stumbled across this question: what is an electronVolt converted into kilocalories?

Fortunately I found this example on some random website that was demonstrating how to use Google to do units conversions. I put that value in my test harness and Unicon came back… wrong. Nothing shocking there, but it was slightly wrong.

Unlike in the real world, in computer work when you’re wrong but close, that is often quite weird. Usually when you’ve made a computer mistake, you’re way off. But here I was getting a similar looking answer that was not at all the right one. I checked some other online resources. Google reaffirmed. Wolfram Alpha concurred.


For me, the last word on these questions is always my beloved HP48. What did the old master say?


Amazingly, the HP48 and the new Unicon agreed! It’s fine if I am wrong but the HP48? No. The HP48 is immaculate! It is never wrong! So that was a puzzle.

Pause here if you’d like to contemplate the answer to this conundrum before I tell you what the source of the error was.

I don’t know how I ever figured this out but I suspect a good deal of internet research was going on when I happened upon this wikipedia article: 2019 redefinition of the SI base units. [Yes, sic, just like that with weird capitalization.]


And sure enough, it turns out that an electronVolt had changed value in May of last year. Apparently all kinds of major changes were going on in the standards of fundamental physics. I may have to stop making fun of the philosophical problems with Avogadro’s number now.

How’s that for very weird? And the lesson there I guess is that even if your software is so badass and perfect that it never needs any updates ever, the universe in general is not so stable. So when people wonder why I don’t just stick with my old HP48 (or a very clever emulator thereof), this is as good of an answer as any.

There are no doubt more such mysteries to be solved and if you’re an engineer or physics person, I’d love some help. Go to the Unicon project page and give it a whirl. You just need some late-ish Python (probably 3.7+) and it’s easy to play with. I’d love to hear about your serious units conversion problems. If you find anything interesting, especially interestingly stupid, definitely let me know!

Thermal Cameras Are Interesting

2020-09-30 10:15

Thermal imaging is interesting and potentially quite useful. Though working examples of it have been around since the 1920s, I think that it will become much more prevalent in the next decade. For example, for between $250 and $500, you can buy a neat accessory for telephones. Or you can even buy a $350 telephone with it built in these days.

On my autonomous boat, I’ve collected a lot of video from a thermographic camera designed for marine use. The fact that anything that produces heat is usually glaringly obvious makes this kind of sensor very compelling for boat use. Check out how well I stand out in a typical water scene.


(Let’s save reflections for another discussion.)

Or how about this shot showing me tying up the boat at the dock.


If you’re in the business of rescuing people who are in the water, there is a 99% chance that this camera will be incredibly valuable and you should probably have one. But look again at the previous photo — that image shows a strange day where the sky, land, and water are all practically the same temperature. If you want to use this kind of imagery to choose where navigable water might be, there are plenty of difficult situations.

Check out the amazing ability of the camera to pick out ducks far away in the background.


But in this cold water on a cold day, the contours of the terrain are completely lost. It’s not just cold days that can be problematic. Check out these images where the shore and the water have some ambiguous temperature readings.


As a general rule living things tend to glow pretty brightly but check out this shot of me on a day where swimming is cold but standing around in the wind and rain is colder.


It’s easy for humans to tell what’s going on and not impossible for computers to make some sense out of it with some machine learning effort. But naively assuming that the sensor itself will make the underlying situation as black and white as the image itself is not a safe assumption.

Oscilloscope Madness

2020-08-29 21:09

Sometimes I get a wild idea in my head - actually, I specialize in that. This week’s wild idea was that I need to learn more about oscilloscopes. I’ve been working on my electrical engineering notes and my newly appreciated ignorance about oscilloscopes was irking me.

Looking online for interesting resources that could educate me about the topic, I wondered if electrical engineers ever acquire electronics equipment the most honorable way possible: by making it themselves. I always found that the best machinists had a lot of tooling that they had machined themselves.

That sounded awesome. I had to give it a try and I ordered one. My expectations were reasonable. I figured it had about even chances to (A) be defective or missing a part, (B) fail because of some ineptitude on my part, or (C) actually work. At the very least, I expected that I would get some soldering practice. When it arrived, I set to practicing!

According to the instructions, a completed unit should look like this.


However what actually showed up was this.


Gulp! Some extreme attention to detail was required to make sure all the values were thoroughly checked and all components sorted. I actually used all of the functions on my multimeter for this project, several for the first time. Just knowing how to test transistors with my meter was worth $22.

Finally, after a lot meticulous work, I was ready to power it up. I did the preliminary assembly power checks and they came out good! Wow! I attached the display and powered it up and it was… iffy. After playing with it, I had seen it boot properly and sort of work and I had also seen it act completely rubbish. Hmm.

Carefully studying every connection, I found some dodgy soldering. I actually did all the resistors and capacitors with my beloved 25 year old gas powered soldering iron. Unfortunately, its tip was so worn that it wasn’t doing a great job. After fixing up some of that with a newer iron I discovered a single lead that I had missed — no solder at all. Oops. I fixed that and when I subsequently booted it, it came up fine and worked flawlessly! It was a euphoric feeling to pull off a correct execution and be so damn lucky.

Ok, cool. I built an oscilloscope. Uh, what now? What do I do with it? After playing around with it I got the very good idea to hook it up to a guitar. I just put the probes on one end of a 1/4" patch cable plug — other end on the guitar. Then I was able to see the sound waves. Amazing! So cool.


In this image you can see I’m holding down the 5th fret (note dot) on the E string which is an A (E - open, F - 1st fret, F# - 2nd, G - 3rd, G# - 4th, A - 5th). That A is actually the A440 pitch standard described in ISO 16:1975 used to standardize all of music to a certain pitch. Obviously if my guitar is in tune, the frequency of the sound wave should be 440. And you can see on the top left that it is reading Freq: 441.707Hz. You can also get a sense for the amount of voltage produced by a guitar pickup. Actually I have an unusual Yamaha SLG Series and I have no idea how its invisible magic pickups work — with nylon strings no less. But we can see that the voltage while this note rings goes between 16mV and -20mV, for (presumably) the Vpp (peak to peak?) of 36mV.

Although this would have been even more fun back when I had enviable eyesight, I’m still absolutely delighted with this project. I have learned a lot about a lot of different topics and have added a very powerful tool to my collection. What a cool little device!

UPDATE 2020-09-20

Having enjoyed that, I looked around for more such fun and found this signal generator kit. For only $12, I got to build this thing.


As you can see it does a nice job of giving my oscilloscope something to do. I think one of the main use cases for a signal generator (conceptually) is comparing this oscilloscope with a fancier, more accurate (?) one. But for now I’m just content that it generates square waves, sine waves, and the triangle waveform shown.


For older posts and RSS feed see the blog archives.
Chris X Edwards © 1999-2020