Ahmed Mohamed’s Clock and the Evolution of an Engineer

I missed an important part of the story of Ahmed’s clock, and the public misunderstanding.

I heard about it when it happened. Rather than an encouraging word, the school meeting Ahmed with suspension and suspicion. Fear. Mishandling by police seeing the world through a terrorism prism and incapable of understanding the curiosity and accomplishment of a tinkerer through their fear. Even President Obama’s attempt to restore rationality by inviting Ahmed to the White House.

I tripped over this blog posting today: https://medium.com/absurdist/ahmed-mohamed-after-the-clock-stopped-b9f796e268b6#.9w1076aev. In case you don’t want to read the whole thing, this paragraph upset me, and took me back to my earlier days:

The second wave of attention was less friendly. Pictures surfaced of his clock, the internet analyzed it, and decided that it was in fact a commercial clock with the outside hacked off and placed in a pencil case that looked like a fancy metal suitcase. People got upset, saying he had not “made” the clock since he really only took it apart and put it in the case. Since he had not personally wired the clock together (like all nerds tell themselves they had the patience and motivation to do when they were 14) it was decided that he had willfully lied about making it. I personally feel you’d be hard-pressed to find a 14-year-old child who did not exaggerate their personal accomplishments, and that many adults have the same failing, but it broke the illusion of this child being the perfect victim of circumstance, the child prodigy held down by the ignorance and racism of adults.

I celebrate that I am part of a virtuous community of people who see through the skin of products, and engage with the parts — by repurposing, changing, enhancing, reusing, studying, seeking to understand, and simply playing. So many people in the world don’t see the parts — seeing only a computer, or a radio, or an automobile. Or a clock. They aren’t motivated by the urgent curiosity, even the compulsion to understand, to modify, and ultimately to invent and contribute.

In the developing story about Ahmed and his clock, I had missed that some in the community of makers condemned Ahmed because he had not made enough of the clock himself. They state that he lied about making the clock, because all he did was repackage a manufactured clock in a different box. I find this inexcusable. I also take issue with Katy Levinson‘s comments. She further asserts that Ahmed was exaggerating his accomplishment.

Although I respect Richard Dawkins for his creativity and objectivity, he join the multitudes against Ahmed — perhaps led the charge — with this chain of tweets: http://www.huffingtonpost.com/entry/richard-dawkins-accuses-ahmed-mohamed-of-committing-fraud_55fed260e4b08820d918fe9b?ncid=txtlnkusaolp00000592. I can only take this as proof that brilliant people can be wrong.

Underneath the criticism that Ahmed had “lied” about making the clock is a judgment about what it means to “make” something. This seems simple to answer… did I make something or did I not make it. But every engineer knows that everything is made of things that are, themselves, made by others. If I construct a circuit, I may have wired the components, but I didn’t make the components. I didn’t etch the transistors. I didn’t wind the foil in the capacitors. Or, one level deeper, I didn’t refine the aluminum to make the foil, or grow the silicon crystals upon which the transistors are etched.

Is it cheating to assemble a kit, and say one has made it? Some kits are simply parts to mount in a box, just as Ahmed may have done, yet we honor the effort with the tag “maker”.

I did nearly the same thing as Ahmed as a kid. I found a “broken” transistor radio. Nothing was really wrong with it, but the case was shattered. I removed the parts, mounted them in a box I made of Masonite(R), and proudly showed off the radio I had “made”. Was I lying?

I built some Heathkit equipment back in the day. I carefully followed detailed instructions, and although I cut and soldered, I didn’t really understand what I was doing. Did I make it?

Over time, I began to understand more, and design more, and fill in more of the details myself. If I wasn’t making then, when did I start?

Everything is “made” by transforming one thing into another. The miracle is the transformation. The bit of “smarts” is to understand that transformation is possible, and to have the drive to realise it. The impulse to transform is the energy that drives engineering progress. That impulse must be nourished through camaraderie and community. Through knowing other engineers, other “makers”, we expand our craft, increase our understanding, and have a wider pallet of ideas and experience. In this community I found my peers, my mentors, and my home.

I am pained that a budding spirit, just beginning on the “making” life, was disowned and shamed by my community. I can’t tell if it was racism, or the competitive “I make it better than you do” attitude that constitutes one of the hazing rituals so many of us have to overcome.

Either way, we have lost.

How many others, outside the context of Islamophobia or racism, do we lose from this work because the dream is crushed? How many girls? How many boys?

For the sake of the next engineers, for the sake of a world needing creative attention, let’s recognize and nourish any flicker of “making”.

Thread Synchronization

I came across a good tutorial post of thread synchronization tonight, http://www.tutorialsdaddy.com/2015/10/understanding-kernel-synchronization/. Reading this covered the standard problems and measures to prevent the problems of race conditions, simultaneous access, and hard-to-diagnose timing errors. It was good for what it is. My issue is that one of the best and perhaps least used, most universally applicable, simplest to understand, and most rarely taught in college.

How do I know it isn’t taught? By interviewing graduates for positions at my company. It doesn’t matter if they were from a prestigious university or community college, Computer Science majors or Electrical Engineers, male or female, I didn’t find interviewees who understood the problem, or knew the simplest solution.

If you aren’t familiar with the problem, read the link above. It describes enough aspects of the problem to be useful.

To prevent data-induced timing problems without an additional locking mechanism, it is critical that only one thread can write to each variable. If only one thread will ever write, then there can be no conflict over invalid state or lost transitions. Many may read, but of writers there can be only one.

The best way to do this is with a circular buffer.

A circular buffer is a region of memory, usually contiguous, with two associated pointers. One pointer, the “out” pointer, points to the oldest entry containing data. The other, the “in” pointer, indicates the first empty space ready to receive data. If the pointers are equal, there is no data. To add data to the buffer, simply write the data to the location indicated by the “in” pointer, and then increment it. To remove data from the buffer, copy the data from the “out” pointer, then increment it. In both cases. the increment wraps to the from of the buffer it would go past the end.

This works on any processor architecture that provides coherent write — where the whole pointer is written in one cycle. This is true on most 32 bit processors1. This scheme does not require an atomic read-modify-write cycle. The pointers must be accessible to both the writer and the reader. The writer and reader may be threads, interrupt handlers, or even two separate processors — even asymmetric processors sharing a memory system.

What if one processor is an 8-bit processor, and can not atomically write pointers? Change the pointers to 8-bit indices, which can be atomically written.

What if the data is larger than a byte? Increment by the data size.

What if the data is variable size? Write what is needed, and increment to just after the data.

An interesting variation is a case where there is no data at all, other than the “pointers”. An example would be an event sender and an event receiver. Sending an event turns into an increment of the “in” counter. Receiving the event is an increment of the “out” counter. To know how many events are outstanding, subtract the “out” from the “in”. Notice that a counter violates the one-reader/one-writer criteria, but two counters does not.

Circular buffers are worth considering as a first solution. If a circular buffer isn’t powerful enough, then consider locks, mutexes, spinlocks, or other more exotic solutions. Or, re-frame the problem so that a circular buffer is exactly powerful enough.

This could be a fourth rule of programming.


1) It may be worth checking the machine code generated by the compiler. A 32-bit Pentium-Pro compiler (Metaware HI-C), optimized some 32-bit writes to be performed as two 16-bit writes. This gave better concurrent use of the two integer units and memory path, but may have been applicable to a limited set of x86 processor implementation. Bottom line: it is good to assure that writes are indeed atomic.

Hello Again!

I have been busy with so many new things.

New designs are on Etsy in my CarvingsbyCarl store. I haven’t been keeping this blog up up to date, nor have I been active enough here to have conversation with you I have hoped for. May this next year bring more!

Some good news: I’ve developed a process for making cutting boards (Challah boards) with a custom inlay pattern. I can work from your design, or create something special just for you. I enjoy working with you to capture your desire.

So far, the custom Challah boards have been most popular for weddings, and for special “thank you” gifts.

On the techy side, I am republishing some posts I made on my town’s STEAM (science, technology, engineering, arts, and mathematics) site, www.waylandstem.org. I’d love to hear from you if you agree, and especially if you don’t.

— Carl

Wayland, MA Maker/STEM Site

I am lucky. My son got involved in FIRST Robotics, and is now a Mechanical Engineering major at Clarkson University. During his time in Wayland, I saw that more could be done to expose students to the creative joy I find in engineering. Talking with others, we found a common concern, and have started a small group to explore how.

The group is Wayland STEM. We are just starting, so the web site will evolve. Stop by and give us your thoughts.

Gilding the Seder Plate

One aspect of Carvings by Carl that excites me is experimenting with new processes. Sometimes these are truly new, and sometimes they are simply new to me. The process I’m talking about today is as old as art.

The process is gilding — covering a surface with a thin layer of metal. Traditionally this has been gold, but the technique applies to other precious and semi-precious metals.

I applied copper leaf to an aged Cherry Seder plate, and I love the result. The Cherry had matured to a deep reddish-brown. The Copper balances perfectly with darkened Cherry, and adds some shine and elegance to the result.

I have 23K gold, copper, and aluminum (silver) leaf in my shop, and offer gilding in any of these materials.

I Love My Customers

It is such a thrill to make something for someone.

Really — every step makes me smile. The first contact, either an order for something I’ve already made, or a special request, opens a door. My pleasure is to greet the visitor, understand their request, and deliver to them the best I can make.

With order tracking, it doesn’t stop when I ship. I get to track the package as it meanders through the carrier’s network, and imagine that my customer is doing the same. I hope that when the package arrives, it is opened and met with satisfaction.

My customers should expect no less.