Made in China

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.)

 

Posted in Analog, Current Events, Digital Citizenship, Toys | Leave a comment

Desktop Supercomputing

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.

Posted in Digital, Digital Citizenship, System Administration | Leave a comment

Quick iPad review

Two of my colleagues from IT and I stopped by the Apple Store today; several faculty members have requested iPads, and we received authorization to get one for ourselves, to become familiar with it. We weren’t able to take delivery today, though. (The Apple sales rep at the store actually said that “because of the demand” it “didn’t make sense to stock product.” I kid you not.)

I’m glad I’m not from Planet Cupertino.

We did, however, get to try the iPad, since they did have a couple dozen or so demonstrator units on display for people to play with. As with everything Apple, there’s a lot of good, but mixed in with some bad and some downright ugly.

First of all, hardware-wise, I think Apple has a winner. Apple’s engineering has nearly always been quite good (we’ll forgive them the original iMac, since they seem to have learned their lesson.) The iPad feels solid and professionally made, while still being light and usable. Apple claims that the battery life is ten hours. I’m guessing that they mean ten hours reading a single page of an eBook with brightness set to minimum and WiFi off — more like four or five hours, the way I’d probably use it.

The good:

  • The display is gorgeous. Bright, crisp, and (mostly) easy to see. The glossy screen does mean that if you’re viewing dark images, you will tend to see a distinct reflection, which hurts the experience. It’s generally pretty dark in my Geek Cave, though, so this isn’t a big deal.
  • It has an accelerometer, and puts it to good use just like the iPhone does; most apps will rotate around to follow the way the iPad is being held, switching smoothly from portrait to landscape mode and back within a few seconds. The demonstrators at the Apple Store included a really fun ball-in-the-maze game, complete with all kinds of obstacles and puzzles only possible in a computer game.
  • Pinch-zoom and scroll are generally very snappy; the Google-powered Maps app that it comes with makes a great demonstration. Whatever Apple has under the hood, it gets the job done nicely.
  • As with most Apple offerings these days, it feels like a solid, quality product. Apple’s hardware engineers do tend to “do it right.”

Some drawbacks:

  • 3G isn’t available until a few weeks from now; the iPads available now (well, “now” being “in a few business days since we at the Apple store can’t be bothered to stock product”) are WiFi-only.
  • There’s no real keyboard (unless perhaps a Bluetooth one will work), and the onscreen keyboard is about on par with the iPhone’s — that is to say, slightly south of a “meh” in my book. I had expected faster, more accurate response, especially since there is so much more screen real estate to work with.
  • As mentioned above, the screen is glossy and therefore very reflective. This made it difficult to see at times, when darker content was being viewed. (The environment was the Apple Store, lit similarly to a modern office.)
  • The sound was just barely audible in the (admittedly somewhat noisy) store. The (very cool if a bit unresponsive) Piano app that I tried (a great use of multitouch if I ever saw one) was very difficult to hear, even with the app and system volume controls set to max.
  • It runs Apple iPhone OS. This does make it easy and fairly intuitive to use, but to someone used to “real” computers (Linux, and even Windows), it has the distinct Apple mindset of “you’re-not-supposed-to-be-using-this-for-things-that-Apple-doesn’t-want-you-to.”
  • It’s too big to put in your pocket — even in cargo pants. Size-wise, it’s definitely in netbook territory, only a lot thinner.
  • The screen could possibly be a bit larger (but that’s personal preference). This would allow more touchscreen apps like a full-size, playable piano, or a much easier-to-use onscreen keyboard.

Showstoppers (for me):

  • The Apple-way-or-no-way-at-all groupthink is in full force here. I was curious as to how well the iPad would work as a Remote Desktop client, and tried downloading a free RD client from the App Store. Unfortunately, you need to register with Apple, even to download free content. Contrast this with Linux or Windows, where you can download a tarball, zipfile, msi or exe installer, or Linux installation package of your choice from anywhere, anonymously. Registering shouldn’t even be required for payware content (other than to pay the developer) — let alone for free apps.
  • The lack of a keyboard would relegate the iPad to use as a eBook reader (which it admittedly is great at), casual game device (which it does okay at, especially with the accelerometer), and/or map device (which it also is great at.) Unless it were an emergency, though, I wouldn’t want to write code, documents, or emails, on it. Typing anything more than a very occasional search phrase was very aggravating (even typing in an address into the Maps app was painfully slow compared to using a real keyboard.)
  • The iPhone OS means, to me, that it isn’t a “real” computer — and therefore could never replace a laptop. If I had a laptop with me, I just don’t see using an iPad all that much.
  • Most importantly, Apple hasn’t seen fit to change their totalitarian ways. Guys, you build some awesome hardware — if the iPad ran Linux, I would seriously consider buying one at some point. By all means, make it available as it is with the iPhone OS or any other proprietary OS — but throw us hardcore geeks a bone and make a Linux distro for it (with proprietary hardware drivers, if you must.)

Finally, an idea — why not make a portable docking station for the iPad — where it could be used as a semi-intelligent monitor for a laptop platform, detachable to work on its own as a slate computer when needed? You would have the functionality of a netbook with a great touchscreen display, with the ability to disconnect it and use it as a native iPad whenever you wanted? This would seem to be the ideal way to bridge both worlds.

Posted in Current Events, Digital, Digital Citizenship, Internet, Toys | Leave a comment

Superscalar — The Easy Way!

I really enjoy taking courses with useful, practical content. It doesn’t happen all the time, but I’ve had a good run of luck recently. Tuesday’s lecture in the ECEC622 Parallel Computer Architecture course I’m taking was about OpenMP — a very easy-to-use, open-source API for C/C++ and Fortran.

OpenMP is what an API should be — both useful and very easy to incorporate into an application, even for programmers encountering it for the first time. Within a few minutes of learning the fundamentals, I was able to write a multithreaded version of the ubiquitous “Hello, World!” program.

Of course, whenever I want to really start to learn a language, architecture, or API, I use it to write a Mandelbrot Set program. Mandelbrot Set calculation lends itself extremely well to parallelization APIs like OpenMP — it’s what programmers refer to as “embarrassingly parallel.”

Here is the Mandelbrot Set calculation code. The OpenMP modifications are shown in blue. Omit them, and the code does exactly the same thing, but without the parallelization.

#include <stdio.h>
#include <omp.h>

//Mandelbrot Set calculation routine, to test
//speedup obtained from using OpenMP

//M. Eric Carr
//mec(eighty-two) .at. drexel (dot...) edu

int main(){
	const double rmin = -2.2;
	const double rmax = 1.4;
	const double imin = -1.8;
	const double imax = 1.8;
	const unsigned long long maxiter = 20000;
	const unsigned long long xres = 2000;
	const unsigned long long yres = 2000;

	double a, b, r, i, h;	//Private variables for threads

	unsigned long long totalcount=0;
	unsigned long long count=0;
	unsigned long long x,y;
	unsigned long long iter;

	double dx, dy;
	dx = (rmax-rmin)/xres;
	dy = (imax-imin)/yres;

	#pragma omp parallel for private(a,b,r,i,h,x,y,iter) reduction(+:count)
	for(y=0;y<yres;y++){
		b = imax-y*dy;
		for(x=0;x<xres;x++){
			r=0;
			i=0;
			a = rmin + x*dx;
			iter=0;
			while(iter<maxiter && r*r+i*i<=4.0){
				h=(r+i)*(r-i)+a;
				i=2*r*i+b;
				r=h;
				iter++;
				}
			if(iter>=maxiter-1){
				count++;}
			} //for x
		} //for y

	#pragma omp barrier

	printf("dx is: %F\n",dx);
	printf("dy is: %F\n",dy);
	printf("Total count is: %lld\n",count);

	dx=count*dx*dy;

	printf("Total area is: %F\n",dx);

	return(0);

	} //main

 

Three extra lines of code, to share the workload among however many CPU cores your system has (eight virtual cores, on a Core i7 CPU). Talk about a good return on your coding time!

Posted in Coding, Digital, Drexel | Leave a comment