Warnings On Steroids – Static Code Analysis Tools

A little while back, we were talking about utilizing compiler warnings as first step to make our C code less error-prone and increase its general stability and quality. We know now that the C compiler itself can help us here, but we also saw that there’s a limit to it. While it warns us about the most obvious mistakes and suspicious code constructs, it will leave us hanging when things get a bit more complex.

But once again, that doesn’t mean compiler warnings are useless, we simply need to see them for what they are: a first step. So today we are going to take the next step, and have a look at some other common static code analysis tools that can give us more insight about our code.

You may think that voluntarily choosing C as primary language in this day and age might seem nostalgic or anachronistic, but preach and oxidate all you want: C won’t be going anywhere. So let’s make use of the tools we have available that help us write better code, and to defy the pitfalls C is infamous for. And the general concept of static code analysis is universal. After all, many times a bug or other issue isn’t necessarily caused by the language, but rather some general flaw in the code’s logic.

Continue reading “Warnings On Steroids – Static Code Analysis Tools”

Julius Lilienfeld And The First Transistor

Here’s a fun exercise: take a list of the 20th century’s inventions and innovations in electronics, communications, and computing. Make sure you include everything, especially the stuff we take for granted. Now, cross off everything that can’t trace its roots back to the AT&T Corporation’s research arm, the Bell Laboratories. We’d wager heavily that the list would still contain almost everything that built the electronics age: microwave communications, data networks, cellular telephone, solar cells, Unix, and, of course, the transistor.

But is that last one really true? We all know the story of Bardeen, Brattain, and Shockley, the brilliant team laboring through a blizzard in 1947 to breathe life into a scrap of germanium and wires, finally unleashing the transistor upon the world for Christmas, a gift to usher us into the age of solid state electronics. It’s not so simple, though. The quest for a replacement for the vacuum tube for switching and amplification goes back to the lab of  Julius Lilienfeld, the man who conceived the first field-effect transistor in the mid-1920s.

Continue reading “Julius Lilienfeld And The First Transistor”

ABS: Three Plastics In One

It would be really hard to go through a typical day in the developed world without running across something made from ABS plastic. It’s literally all over the place, from toothbrush handles to refrigerator interiors to car dashboards to computer keyboards. Many houses are plumbed with pipes extruded from ABS, and it lives in rolls next to millions of 3D-printers, loved and hated by those who use and misuse it. And in the form of LEGO bricks, it lurks on carpets in the dark rooms of children around the world, ready to puncture the bare feet of their parents.

ABS is so ubiquitous that it makes sense to take a look at this material in terms of its chemistry and its properties. As we’ll see, ABS isn’t just a single plastic, but a mixture that takes the best properties of its components to create one of the most versatile plastics in the world.

Continue reading “ABS: Three Plastics In One”

The Space Station Has A Supercomputer Stowaway

The failed launch of Soyuz MS-10 on October 11th, 2018 was a notable event for a number of reasons: it was the first serious incident on a manned Soyuz rocket in 35 years, it was the first time that particular high-altitude abort had ever been attempted, and most importantly it ended with the rescue of both crew members. To say it was a historic event is something of an understatement. As a counterpoint to the Challenger disaster it will be looked back on for decades as proof that robust launch abort systems and rigorous training for all contingencies can save lives.

But even though the loss of MS-10 went as well as possibly could be expected, there’s still far reaching consequences for a missed flight to the International Space Station. The coming and going of visiting vehicles to the Station is a carefully orchestrated ballet, designed to fully utilize the up and down mass that each flight offers. Not only did the failure of MS-10 deprive the Station of two crew members and the experiments and supplies they were bringing with them, but also of a return trip which was to have brought various materials and hardware back to Earth.

But there’s been at least one positive side effect of the return cargo schedule being pushed back. The “Spaceborne Computer”, developed by Hewlett Packard Enterprise (HPE) and NASA to test high-performance computing hardware in space, is getting an unexpected extension to its time on the Station. Launched in 2017, the diminutive 32 core supercomputer was only meant to perform self-tests and be brought back down for a full examination. But now that its ticket back home has been delayed for the foreseeable future, NASA is opening up the machine for other researchers to utilize, proving there’s no such thing as a free ride on the International Space Station.

Continue reading “The Space Station Has A Supercomputer Stowaway”

The Evolution Of Wireless Game Controllers

The story goes that Atari was developing a premium model of their popular home video game console, the Atari 2600, for the 1981 fiscal year. Internally known as the Stella RC, this model revision promised touch sensitive game selection toggles, LED indicators, and onboard storage for the controllers. The focus of the project, however, was the “RC” in Stella RC which stood for remote control. Atari engineers wanted to free players from the constraints of the wires that fettered them to their televisions.

Problem with the prototypes was that the RF transmitters in the controllers were powerful enough to send a signal over a 1000 ft. radius, and they interfered with a number of the remote garage door openers on the market. Not to mention that if there were another Stella RC console on the same channel in an apartment building, or simply across the street, you could be playing somebody else’s Pitfall run. The mounting tower of challenges to making a product that the FCC would stamp their approval on were too great. So Atari decided to abandon the pioneering Stella RC project. Physical proof of the first wireless game controllers would have been eliminated at that point if it were created by any other company… but prototypes mysteriously left the office in some peculiar ways.

“Atari had abandoned the project at the time…[an Atari engineer] thought it would be a great idea to give his girlfriend’s son a videogame system to play with…I can’t [comment] about the relationship itself or what happened after 1981, but that’s how this system left Atari…and why it still exists today.”

Joe Cody, Atari2600.com

Atari did eventually get around to releasing some wireless RF 2600 joysticks that the FCC would approve. A couple years after abandoning the Stella RC project they released the Atari 2600 Remote Control Joysticks at a $69.95 MSRP (roughly $180 adjusted for inflation). The gigantic price tag mixed with the video game market “dropping off the cliff” in 1983 saw few ever getting to know the bliss of wire-free video game action. It was obvious that RF game controllers were simply ahead of their time, but there had to be cheaper alternatives on the horizon.

Out of Sight, Out of Control with IR Schemes

Nintendo AVS 1985 Display
Nintendo AVS console deck and IR controller on display.

Video games were a dirty word in America in 1985. While games themselves were still happening on the microcomputer platforms, the home console business was virtually non-existent. Over in Japan, Nintendo was raking in money hand over fist selling video games on their Famicom console. They sought to replicate that success in North America by introducing a revised model of the Famicom, but it had to impress the tech journos that would be attending its reveal at the Consumer Electronics Show (CES).

The prototype system was called the Nintendo Advanced Video System (AVS). It would feature a keyboard, a cassette tape drive, and most importantly two wireless controllers. The controllers used infrared (IR) communication and the receiver was built-into the console deck itself. Each controller featured a square metallic directional pad and four action buttons that gave the impression of brushed aluminum. The advancement in video game controller technology was too good to be true though, because the entire system received a makeover before releasing as the Nintendo Entertainment System (NES) that Christmas. The NES lacked the keyboard, the tape drive, and the IR controllers and its change in materials hardly captured the high-end flash of the AVS. The removal of IR meant the device was cheaper to manufacture. A decision that ultimately helped the NES to become a breakout success that in turn brought back dedicated video game consoles single-handedly.

Continue reading “The Evolution Of Wireless Game Controllers”

Fail Of The Week: A Candle Caused Browns Ferry Nuclear Incident

A colleague of mine used to say he juggled a lot of balls; steel balls, plastic balls, glass balls, and paper balls. The trick was not to drop the glass balls. How do you know which is which? For example, suppose you were tasked with making sure a nuclear power plant was safe. What would be important? A fail-safe way to drop the control rods into the pile, maybe? A thick containment wall? Two loops of cooling so that only the inner loop gets radioactive? I’m not a nuclear engineer, so I don’t know, but ensuring electricians at a nuclear plant aren’t using open flames wouldn’t be high on my list of concerns. You might think that’s really obvious, but it turns out if you look at history that was a glass ball that got dropped.

In the 1960s and 70s, there was a lot of optimism in the United States about nuclear power. Browns Ferry — a Tennessee Valley Authority (TVA) nuclear plant — broke ground in 1966 on two plants. Unit 1 began operations in 1974, and Unit 2 the following year. By 1975, the two units were producing about 2,200 megawatts of electricity.

That same year, an electrical inspector and an electrician were checking for air leaks in the spreading room — a space where control cables split to go to the two different units from a single control room.  To find the air drafts they used a lit candle and would observe the flame as it was sucked in with the draft. In the process, they accidentally started a fire that nearly led to a massive nuclear disaster.

Continue reading “Fail Of The Week: A Candle Caused Browns Ferry Nuclear Incident”

Your BOM Is Not Your COGS

“The prototype was $12 in parts, so I’ll sell it for $15.” That is your recipe for disaster, and why so many Kickstarter projects fail. The Bill of Materials (BOM) is just a subset of the Cost of Goods Sold (COGS), and if you aren’t selling your product for more than your COGS, you will lose money and go out of business.

We’ve all been there; we throw together a project using parts we have laying around, and in our writeup we list the major components and their price. We ignore all the little bits of wire and screws and hot glue and time, and we aren’t shipping it, so there’s no packaging to consider. Someone asks how much it cost, and you throw out a ballpark number. They say “hey, that’s pretty reasonable” and now you’re imagining making it in volume and selling it for slightly higher than your BOM. Stop right there. Here’s how pricing really works, and how to avoid sinking time into an untenable business.

Continue reading “Your BOM Is Not Your COGS”