Redneck Antenna Design

August 29th, 2010

The problem: Really crappy cell modem signal strength at a site in rural Virginia.
The solution (for now): About 1m2 of aluminum foil, made into a rough parabolic shape.
It ain’t pretty, until you look at the signal strength meter. -115dBm to -100dBm, which means the difference between being online or not. I’ll take it.

(Click for larger)

Redneck Cell Antenna
Redneck Cell Antenna - Closeup

Malware blamed for plane crash

August 22nd, 2010

A recent article notes that apparently the crash of Spanair flight 5022 had as a major contributing factor a compromised warning system computer, which resulted in no audible alarm when the pilots attempted to take off with the flaps and slats retracted. (This is a Bad Thing.)

Here’s the scary part: The computer had apparently been compromised due to malware that had somehow been installed (suggesting to me that it was likely running Windows or another popular consumer operating system.)

I’m all for the use of modern technology in aircraft; engine management computers and other systems can make aircraft safer, more reliable, and much more efficient. Of course, as with all aviation systems, they ought to be thoroughly checked out before being allowed to control critical aircraft functions. One corollary to this is that large, complex, unverified operating systems should *not* be used to run systems in charge of essential functions. I sincerely hope that there has been a misunderstanding in this case. We don’t yet know all there is to know about aviation safety, of course — but not using consumer-grade software in critical systems should be as big a no-brainer as making sure that the wings are bolted on securely.

Old-school BASIC

August 3rd, 2010

We need more programming languages like BASIC. Not the thoroughly modernized, object-oriented, jazzed-up descendants of the language — I mean the original BASIC. Specifically, a language which can be readily understood by anyone reading it who has a background in algebra — and one which can be easily learned in a few minutes’ time.

I recently came across (okay, went looking for and found) the original paper describing 1964 Dartmouth BASIC. It’s amazing how clear the example code is — and how well-thought-out the stated goals of the language are.
Compare the following “Hello, World!” programs in BASIC and JAVA…


BASIC:
10 print "Hello, World!"
20 end


Java (Android code):
package com.paad.HelloWorld;

import android.app.Activity;
import android.os.Bundle;

public class HelloWorld extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}//onCreate
}

Java (required XML for Android):
<?xml version="1.0" encoding="utf-8"?>

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello, World!"
/>
<LinearLayout>


That’s a LOT of crap, just to put “Hello, World” on the screen! Not only that, but how would a beginning Java programmer know all of the names of the required functions, and which parameters they take? Java is supposed to, among other things, shield programmers from the “complexity” of languages like C. I think I’ll stick with the “complexity,” thanks.

Not only that, but an additional point of failure has been introduced: the code now depends on a schema that resides on a webserver at schemas.android.com. Should this webserver go offline (for instance, the Android platform goes out of fashion, the organization running the site goes bankrupt or just doesn’t have a good backup policy in place, or whatever), the code is now broken — dependent on an external reference that is no longer there.

Party (or program) like it’s 1981!

July 24th, 2010

Probably every computer geek has fond memories of his or her first computer. I know I do. I’ve had many computers over the years, including many which I’ve built — but your first computer is always special; it opens the door to the magical world of programming.

My first encounter (as far as I can remember) with a computer was through a teletype terminal that my uncle (a Ph.D student at the time) had set up in his apartment. After dialing in to the school mainframe, it played a mean game of Tic-Tac-Toe.

A few years later, my parents bought me a Timex-Sinclair 1000 for my birthday. I might have been dimly aware of the TS1000’s existence, but was surprised to actually have one. After hooking it up to the TV and reading a few pages of the manual, I had written my first BASIC program. I don’t remember the exact listing, but it was essentially a version of the ubiquitous “Hello, World!” program — writing text to the screen in an endless loop.

Flash forward to 2010; my homebuilt Core i7 is far faster and more capable — not to mention connected to the Internet — but sometimes I still miss the Sinclair.

Apparently, though, I’m not the only one. I recently came across “EightyOne” — an amazing freeware Sinclair emulator from chuntey.com. It was done right, too. All of the Sinclair quirkiness is there — the oooold-school BASIC, complete with line numbers and LET statements; the multipurpose keys on the keyboard (what you get depends on which mode you’re in); the “Fast” and “Slow” video modes (more like “slow” and “slower,” but hey.) There’s even a whole set of NTSC TV signal options so it *really* looks like the real deal — video degradation and all — even on a modern LCD monitor. (Non-purists fear not; these effects can be disabled — but they really do add to the ambiance.)

The EightyOne Sinclair emulator

The EightyOne Sinclair emulator (click for larger).
(The background is my Win7 desktop: Parc Jacques-Cartier, QC)

If you, like me, discovered programming (and all of the really bad-but-fun programming habits that old-school BASIC fosters) on a Sinclair, go download yourself a copy. It’s like stepping thirty years back in time. (…and yes, it *does* have the capability to save and load programs to a .wav-based “tape drive.” I’m sure someone out there has a collection of Sinclair tape programs…)

Here, too, is a great example of geek humor: it has a “RAM pack wobble” option! Many Sinclair programs required a memory expansion pack that would increase the default 2K memory to 16K. The problem was that this (relatively heavy) memory pack was attached to the computer via a flimsy card-edge connector in the back. It had an absolutely uncanny habit of wobbling (causing the system to freeze) at the worst possible times, like thirty minutes into a great Chess game. I swear that connector was designed by Murphy himself.

This isn’t just an emulator; it’s a work of art. Add a Sinclair mock-up keyboard and put the LCD into an old TV set, and it could easily pass for the real deal.

Khaaaaan!

July 22nd, 2010

There are a lot of cool websites out there, but how many provide free video tutorials (by a very knowledgeable and engaging teacher) on over a thousand topics? Check out the Khan Academy — this guy’s apparently a Harvard MBA, but fortunately realized his true calling was teaching! Where was this when I took Calculus back in the ’90s??

112 cylinders of Paleotechnology!

June 14th, 2010

Along with old computers, I feel a special affinity for classic airplanes. Modern planes are interesting, too — but when you take the time to look at the technology behind the classics, you can’t help but feel that they are perfectly-balanced combinations of art and science.

The Boeing 377 (click for larger): one of the finest three-engine planes ever made!

The Boeing 377 Stratocruiser is a good example of such a classic. As one of the last great propliners, it represented the pinnacle of radial reciprocating (piston) engine technology. Four Pratt & Whitney Wasp Major R-4360 engines provided a total of 14,000 horsepower*at full power (with ADI on).

I love having microcontrollers, the Internet, digital audio, GPS, and other technology available — but sometimes I wish I had been able to work as a propliner captain (or Flight Engineer) back in the day.

Not too long ago, though, I found the next best thing. A2A Simulations has created a highly accurate Boeing 377 simulation for Flight Simulator X — and they did it right. With many simulator aircraft, the emphasis is on making a product that looks good. Great attention is paid to aircraft markings and paint schemes, and then the default DC-3 panel and flight model is slapped on, with a few modifications as a grudging nod to the fact that this is actually a four-engine plane. Not so in this case! A2A’s Stratocruiser is truly a work of art worthy of the Stratocruiser name. Nearly all of the systems of the aircraft have been modeled in great detail; A2A’s intent was to produce a true simulation of the B377; not just something that looks the same.

Part of the Flight Engineer's panel on the 377 (click for larger). Note the cowl settings to keep #3 cool...

A bit of aircraft history is in order to set the stage. Back when the 377 was designed, jet engines were still experimental designs existing mostly on drawing boards and in military test labs. The dominant technology of the day was the reciprocating, air-cooled radial engine. These had been getting larger, more powerful, and more complex for years, culminating in the 28-cylinder Pratt & Whitney R-4360.

The Pratt & Whitney R-4360 Wasp Major engine (click for larger).

These were not your turn-it-on-and-forget-it, computer-controlled modern jet engines; a 28-cylinder air-cooled reciprocating radial engine required the full-time attention of a Flight Engineer to keep it operating efficiently without causing damage to its many parts. With 56 spark plugs (two per cylinder), 56 adjustable valves,  seven rows of four cylinders, supercharger and turbocharger, it was a formidable, demanding beast. The Flight Engineer needed to not only monitor fuel consumption, cabin pressurization, and electrical systems — he had to “think like an engine” and keep these four engines working efficiently through all the phases of flight.

It must have been one of the most interesting jobs, ever — and A2A’s simulated B377 does a good job at capturing the flavor of the Flight Engineer’s job. Here are some examples.

  • Starting the engines must be done in a specific sequence: Configure fuel flow to the engine including setting the engine fuel valve, boost pump, and mixture control; turn on the ignition switch; set the cowl flaps, intercooler flaps, and oil coolant flaps; prime the engine with five or six shots of primer; crack the throttle; spin up the engine with the starter motor; engage the ignition boost — and watch to see if the engine decides whether or not it’s going to start. If not, double-check your settings and try again — perhaps with less primer so as not to flood it.
  • The engines tend to run hot. When on the ground, the cowl flaps can be opened all the way, allowing the engines to stay relatively cool. In flight, though, these can be safely opened no more than 3″ (per the manual, anyway — I’ve been running the #3 engine at 3.5″ inches since it likes it better that way and haven’t had any parts fall off yet.) During takeoff and initial climb, the engines need all the cooling they can get, but at altitude, the cowl flaps can be partially closed.
  • The engines are carbureted, not fuel-injected — and the intake air temperature must be kept within the operating limits. In practice, this isn’t very difficult, since the intercooler flaps do a good job of cooling the air — and they can be closed and/or the heater turned on if more warmth is needed. When you’re the only one flying the plane, though, it’s hard to remember. (A2A does helpfully provide a copilot, who will warn you about such things.)
  • There are very specific power setting limits for the engines — and if you exceed them, the engines will be quickly damaged. (I actually experienced an engine fire on my second flight, before I knew what I was doing.) The 377 was made to be flown by-the-book, and running the engines at too high a torque and/or manifold pressure setting is a recipe for a premature engine overhaul — if not a complete in-flight engine failure and/or fire.
  • As precise and exquisitely made as the R4360s were, no two were ever quite alike. In most simulated aircraft, the engines are carbon copies of each other. Push all four engines on the default 747 to full throttle, and the flight computer will show exactly the same N1, N2, EPR, vibration, and temperature readings for each. Not so on the B377; each engine is a unique individual. The #3 engine I’m currently flying with, for example, always runs hot; I’ve learned to open its cowl flaps that extra half-inch before I even look at the temperature gauge. #1 might produce a bit more torque than #2 at the same MP and RPM settings — but that’s not a problem, that’s just how it is. Maybe the gauge is a bit off; maybe the engine actually does produce a bit more power — who knows.

* Yes, I would use kilowatts instead of horsepower these days — but that would be an anachronism here. The use of traditional units is part of the beauty and mystique of classic aircraft; discussing them in SI units would be blasphemy.

Digital Swiss Army Knife

June 7th, 2010

HTC Mogul

(An HTC Mogul smartphone)

The modern smartphone is (this week, anyway) the poster child of the Information Age. When certain technologies combine, the whole really is greater than the sum of the parts. Cell-based 3G/4G Internet connectivity, the GPS infrastructure, local device programmability and storage, the ability to take pictures and record and playback video and audio, and new features like accelerometers all add up to a device that is approaching the ideal Portable Information Appliance. You’re always just a few clicks away from all the information available on the Internet.

It’s impressive how many things such a small device can do, when you think about it. Here are just some of the uses that I’ve found for my phone (an HTC Mogul), so far:

  • Browsing websites,
  • Navigation via Google Maps Mobile,
  • Recording lectures for later study,
  • Remote desktop access via Terminal Services and VNC,
  • Website and email administration over SSH,
  • Listening to audiobooks,
  • Listening to mp3s,
  • Playing games (where there’s Windows, there’s Solitaire),
  • Watching YouTube videos,
  • Updating Facebook, Twitter etc,
  • Logging GPS tracks of my walks around the area,
  • Taking the occasional (crappy) picture or video,
  • Functioning as a makeshift flashlight,
  • Reminding me of appointments,
  • Creating and viewing small Excel spreadsheets, including charts,
  • Creating and viewing notes and Word documents,
  • Acting as an alarm clock,
  • Synchronizing Outlook contacts with my desktop and laptop,
  • Providing Internet connectivity to my laptop,
  • Searching for Geocaches,
  • Managing shopping lists (emailed to it via SMS gateway),
  • …and oh, yeah — apparently it’s a telephone, too.
  • About the only thing I haven’t found for it yet is a good version of portable BASIC. That’s kind of a shame, too, since I had *that* functionality in a pocket-size device way back in 1986!

WUBI

June 6th, 2010

WUBI logo

What’s a WUBI? Good question. It’s a Windows-based installer for Ubuntu Linux. Download it, run it, click the Next button a few times, and suddenly you have a Linux installation — without running the risk of hosing your Windows setup. Ubuntu gets set up in two virtual filesystems stored as regular (if large) files on a Windows partition of your choice (they can go in an \Ubuntu folder in the C: drive, for example.)
It’s a painless, easy way to check out Linux or to set up a dual-boot system without causing a bunch of headaches. Go try it out!

Made in China

June 1st, 2010

A lot of products are rip-offs. Recently, though, I’ve come across one that is especially galling; a fake that had obviously been specifically designed — as lawyers would say, “with malice aforethought” — to trick customers. Here’s the story:

A few years back, a “perpetual flashlight” was developed, with a captive magnet, a coil, and some electronics to change the mechanical force from the flashlight being shaken into electrical energy to power it. (White LEDs are much more efficient than incandescent lights, which made this feasible.) These don’t work as well as you might like, but they do work, and can sit on the shelf for many years and be recharged any time by shaking.

It didn’t take long for this to catch on, since shake-to-recharge flashlights were “green,” relatively easy and inexpensive to make, as well as new and innovative. For well under $20, you could pick one up at Wal-Mart and have — in theory, anyway — a flashlight that would always work, no matter what. They made decent stocking stuffers, and were a pretty good deal for the money. (The required electronics meant they cost a little more than basic flashlights.)

As I found out a few months later, it also didn’t take long for someone in China to realize that these “shake flashlights” were selling very quickly — and that a very similar effect could be produced for roughly one-tenth of the cost. (The original flashlight design isn’t that expensive, but the costs for the necessary supercapacitors, diodes, magnet, and sufficient wire to make an efficient coil do add up.) Soon, these “new generation flashlights” (a very clever usage of weasel words, when you think about it) came on the market. You might have seen them at flea markets and dollar stores. They look and feel very similar to actual “shake” flashlights, but are smaller and cost much less.

What the packaging doesn’t tell you, though, is that these are not generating flashlights like the originals. They don’t have a supercapacitor, Wheatstone bridge network of diodes for current rectification, or even a magnet and coil. What they *do* have is a simple circuit board, a few turns of copper wire for looks, and a cheap chunk of metal to rattle back and forth ineffectively.
These flashlights were *specifically designed* to fool the customer into thinking that they are actual shake-to-recharge flashlights. The coil and piece of metal serve no purpose other than to deceive. These flashlights have just the bare minimum of parts required to work as a flashlight at all: a white LED, a very simple metal switch, and two CR2025 batteries. The “new generation” marketing-speak is, in a legal sense, referring to chronology and not the source of electrical power.
I recently bought one at a flea market (knowing what it was; I’d seen these before). Here are some photos of the inside. Time permitting, I plan to investigate what is required to convert it to an actual generating flashlight — maybe this summer. I’ll post the results here if I do.

The flashlight in its packaging. Clear, translucent plastic; copper coil; moving “magnet” — looks like a shake flashlight.

I’m not sure what “Jiudu Xiangdi” means. Probably “Gullible Americans.”

The flashlight, removed from the packaging. An observant Electronics geek would be starting to wonder why it has so few turns of copper wire — and whether those two discs just behind the switch were really supercapacitors…

Yes, it actually does at least work as a flashlight. Not well, mind — but it does work. For now.

As Clara Peller would say, “Where’s the beef?”

Nothing up top (the wire snapped off as I disassembled the light. Nice construction)…

…and nothing hidden underneath.

Not only are there not enough turns to make an effective coil…

…the coil isn’t even connected to anything! Star Trek has a word for this: it’s a GNDN!

Power is provided by these two discs –

which are cheap CR2025 nonrechargeable batteries!

Everything about it says “lowest bidder.”

Bottom line: There are thousands of these things out there — maybe millions. Don’t be ripped off.
(One good way to tell if a flashlight is the real deal is to turn it on and observe the brightness for a few seconds, shake it, then look again quickly. If it brightens, it’s probably the real thing.) For what it’s worth, the larger flashlights that I’ve seen in Wal-Mart are genuine. The fakes are usually found at flea markets and antique /variety stores. (The store dealer may very well not know the difference, so he or she isn’t necessarily trying to rip you off.)

Desktop Supercomputing

May 19th, 2010

Sometimes modern technology is fun, too. Especially when it involves GPGPU video cards with 128 processor cores, which can be used for parallel-computing tasks. Even more so, when modern systems support up to three of them. The combination of an interesting course on parallel computer architectures (including nVidia’s CUDA) and the availability of good deals on eBay for two additional video cards of the same make and model as the one I already had turns out to be the perfect recipe for getting started in homebrew supercomputing.

So far, I have them running the SETI@home BOINC client. At first, there was some kind of configuration problem — the work units hardly seemed to progress at all (much slower than the CPU version of the code). Since the initial estimated time for the CUDA version was much less, I figured something was wrong.

A quick Google search came up with a possible solution — disable SLI (gotta remember to switch it back on for Oblivion and Flight Sim), add “dummy plugs” to the two secondary GPUs, and extend the desktop — with Aero disabled — across the two dummy monitors.

It worked — and now the three GPUs are each crunching SETI work units roughly 20x faster than the CPU version of the code. (Overall, the relative system throughput just went from ~8 to ~70 or so.) I’m starting to see what nVidia means about the benefits of manycore computing, on problems like this.