Simplicity in Electrical Engineering

The most elegant solution to a complex problem is often the most simple.

The concept is a fundamental tenant of mechanical engineering. Though many engineers only add complexity, the select few - the ones worth remembering - come up with an ingeniously simple solution.

In the age of micro electronics, it can feel like we've lost touch with this wonderful lineage. Physical mechanisms made of wound springs and metal gears have been replaced with silicon boards.

But electrical engineering has its own elegant simplicity.

A single resistor and capacitor can create a high-pass filter. Just four diodes can convert alternating current to direct current. And a single transistor opens the door to a mind-blowing list of possibilities.

Watching a presentation by Kwabena Boahen, I was impressed at what they achieved by applying the concept of simplicity to a traditionally complex field: the simulation of a field of neurons. Typically multi-purpose CPU and GPU chips are tethered together to run computations.

Instead Kwabena Boahen and his team created a simple neuron model in analog transistor and capacitor components. The result is fascinating, achieving huge density of neurons on a single chip, scalable to millions of neurons. The solution achieves moderately faster computation, massively cheaper cost, and many orders of magnitude lower power consumption than a traditional general purpose CPU and GPU with comparable output. All born out of specialization and simplicity.

I'm not advocating against complexity. Specialized solutions are inherently rigid, and come with their own set of quirks that may not make them preferable to more complex solutions. But when they do work, applied to a complex problem, a simple solution can be remarkable. And if you ask me, quite beautiful.

Comment  |  Permalink

The Value of Unitasking

Over the last four months I've been cutting down on multitasking, and focusing my energy on one task at a time. It's been time well spent.

An adept mult-tasker, I was in the habit of constantly filling spare minutes trying to sate my appetite for learning new things; reading articles online while watching television; reading one last page while brushing my teeth before bed; writing code while conversing over what to make for dinner.

The results were mixed. I did accomplish a respectable volume of work, but the quality of code and knowledge retention was subpar.

Having been fascinated by the question of focused unitasking vs. multitasking for years, I decided to try things on the other side of the fence. Instead of cramming in tasks here and there, I now schedule blocks of time to focus on one task at a time. The idea is to delay working on a task until I can give it my complete attention. If I only have five minutes of spare, I won't even think of picking up the tech book I'm currently reading.

After four months, the result have been overwhelmingly positive. Not only has the quality of work has improved, but I get more done in less time.

More importantly, it leaves more time to enjoy other things without feeling like I'm wasting time I should be spending on learning. Instead of caving into the urge to read another article or write some more code, I can focus completely on other enjoyable tasks in life like cooking a meal together, or having a completely engaged conversation.

Like bunk-beds in Stepbrothers, there's I find I have so much more room for activities. And that my friends, is a good thing.

Comment  |  Permalink

Customer Service is About Relationships

I write letters to companies. My goal is to share an understanding. An Understanding where I'm coming from, how it affected me, and an opportunity for additional dialogue. Often times these are positive letters, thanking an employee and letting a supervisor know how much I appreciated it. Other times it's a complaint, written to be constructive, honest, and most of all without malice - unless of course the problem is egregious.

I'm perplexed at the common responses to complaints from customer service departments, be it a knee-jerk defensive stance, an over-reaction towards compensation, or simply a canned response. I'm not looking for a fight or prostrate apology. I'm looking for an understanding, a recognition and ownership of the problem. A human interaction. A firm handshake.

Mistakes happen, and they always will. But like any human relationship, the best ones are built on honesty and integrity, not on defensiveness or overly pleasing. Customer service departments are in the unique position to be that human face for an otherwise nebulous corporate entity.

I just wish more companies would see it this way. It's the little things, but over time they add up to a lot.

Comment  |  Permalink

Control Flow Keywords in PHP Loops

Too frequently I see PHP code that treats looping constructs (e.g. for, foreach, while) like runaway trains. Terminal conditions are set before entering the loop, but once the loop is started, it's all hands off until it finishes.

Unless there is an express need to iterate over every value, control flow keywords should be used to limit iterations. The most common of these is break, causing the loop to terminate when it is encountered.

Less common control flow keyword is continue. It too stops the current iteration, but instead of exiting the loop it simply begins the next loop iteration.

Depending on the situation, judicious use of continue and can prevent unneeded computation, flatten nested if statements, and increase code readability.

Finally, both break and continue take an optional numeric argument. Inside multiple nested loops, the argument defines how many looping constructs the command bubbles up.

Comment  |  Permalink

Edit Remote Files in Vim via SCP

One of the many neat features of VIM is support for remote editing. The Vim command is simply:

:edit scp://username@hostname/directory/path/starting/in/home

If the scp:// protocol wasn't already a give away, VIM uses secure copy (scp) to edit remote files. This means many of the same tricks used with scp on the command-line can be used inside the Vim command.

Instead of typing in a password every time, use ssh private/public keys and ssh-agent. Or utilize aliases and settings defined in ssh configuration files (~/.ssh/config).

So a quick edit of the hosts file on a remote server named tux is as simple as:

:e scp://tux//etc/hosts

Comment  |  Permalink