Slashdot is powered by your submissions, so send in your scoop

 



Forgot your password?
typodupeerror
Spam

Journal Journal: Fighting Spam: Testing for Human Beings

I wrote a script to test whether a web visitor is a human being or not. For background info and technical nitty-gritty, read below.

Programs known as "robots" have been masquerading as real web surfers since the beginning of the Web. Robots can navigate between web pages and servers using hyperlinks just as people do, and can do so very quickly. Most commonly, robots are used to search out data to include in search engines.

Robots can also be used to more nefarious ends, like gathering e-mail addresses or signing up for thousands of e-mail accounts for use in spamming. The key to fighting spam robots is by including a question or problem in the sign-up process that only a human being can easily answer. This problem has to be easy for a computer to generate, but difficult for a computer to solve.

For the most part, websites that want to inhibit automated sign-ups include an image in the page containing a code or key. The text in the image is obfuscated to make digital recognition of the key more difficult for OCR software. Check out an example from AOL's AIM sign-up page or one from Yahoo's.

What other questions can computers create that they themselves can't easily solve, and are simple enough to use to verify the humanity of web surfers? I asked myself this question, and the result is a PHP script illustrating one approach that uses Google's vast image search feature.

My script queries Google Image Search for a group of thumbnail images that match a search for something like "3 kittens." It may also try other nouns and other numbers, for searches like "4 pots" or "5 women." Out of the group of thumbnails Google returns, one is randomly chosen and displayed to the user. The script already knows how many of the object are supposed to be in the picture, because the script originally asked for the image. For the client, though, the question of how many objects are in the picture is technically very computationally difficult. Not only must the would-be robot know what the object looks like, it must know what it looks like from all angles and in all sizes.

My method is limited by the number of objects a person would be willing to count, which I suspect is somewhere around 10. This means that at the very least, a brute-force attempt of the script would yield a success rate of 10%. It's also limited by the "inaccuracy" of Google Image Search; sometimes the random thumbnail that's chosen has nothing to do with the query. I have yet to collect data as to what percentage of the Google results are relevant, and whether or not this statistic makes the approach viable when the potential for brute-forcing is considered.

I hope to develop the method and keep track of what thumbnails are presented. Future versions may ask the user whether or not he or she was able to recognize the object. There may be other ways to exploit Google Image Search's potential to test for real people, which I also hope to explore.

Operating Systems

Journal Journal: Screenshots: Who Cares?

Developers of free software operating systems seem obliged to provide screenshots of their releases. Most of the time, these screenshots show nothing more than a themed or thinly customized KDE or Gnome setup. Except for OSes aimed directly at Windows switchers, these efforts are worthless and silly.

Your OS runs a window manager. Congratulations.

Utilities (Apple)

Journal Journal: Writing Floppy Images in Mac OS 10.3

An interest in legacy hardware led me to buy a handy USB floppy drive for my Powerbook for creating boot disks for and transferring data to and from machines that for whatever reason don't have a workable CD-ROM or network connection.

In OS 10.3, Apple merged most of the functionality of "Utilities/Disk Copy" into "Utilities/Disk Utility," though I've found that Disk Utility will not write floppy images. The venerable command-line Unix utility "dd" is required.

The process is complicated by 10.3's auto mounter, which automatically mounts inserted floppies to /Volumes. An attempt to dd an image to the floppy device, which is registered somewhere in /dev as disk*, will fail as the system considers the device "in use." The workaround is to unmount the disk from /Volumes while retaining its /dev entry. As far as I know, this is not possible through Apple's provided GUI utilities. The process I used to dd an image to a floppy follows.

  1. Determine the USB Floppy Drive's /dev Entry

    On *nix systems, system devices are represented in /dev. Disks, floppy or otherwise, have names like "/dev/disk4." I won't get into the the details of device naming, but suffice to say that in order to write an image to floppy, you must first discover the name of the floppy device.

    To do this, unplug your USB floppy drive and open a Terminal. Navigate to the /dev directory with a command like cd /dev. Next, determine what disks are present by typing ls disk*. A list of connected drives and partitions will show up.

    Now, plug in your USB floppy. It should be recognized by the system. Do ls disk* again. Comparing the output of the commands before and after you plugged in the drive, you should notice a new entry listed. For me, it's "disk4." For the purposes of this tutorial, I will consider the name of the floppy device /dev/disk4, but it may be different on your machine.

  2. Unmount the Floppy Volume

    You can open a new Terminal window with Cmd+N. Navigate to /Volumes with cd /Volumes. Execute an ls, and the name of the floppy volume should be evident. For the brand of DOS-formatted floppies I have on hand, the name is "UNTITLED." The name of the disk in this directory is also the name of the mounted floppy as it appears in the Finder.

    Now, unmount the /Volumes mount with a command like sudo umount UNTITLED, where UNTITLED is the name of the floppy. You should now be able to write directly to the floppy device, as it is no longer mounted.

  3. Write the Image

    You can now write the image with a command like sudo dd if=/Users/alan/Desktop/image.dsk of=/dev/disk4 bs=32k where "if" equals the location of the image you'd like to write and "of" is the path to the floppy device you determined in step 1.

    Voila! Following the dd, your disk is ready. It's safe to eject the disk manually or unplug the USB drive. You'll get a warning message about unsafe removal of a device, but it's not a big deal.

User Journal

Journal Journal: Wear-Evolving Tools

"An escalator can never break. It can only become stairs. You would never see an 'Escalator Temporarily Out Of Order' sign, just 'Escalator Temporarily Stairs. Sorry for the convenience.'" -Mitch Hedberg

There are simple examples of what might be called "wear-evolving tools" everywhere. A lot of the tools one encounters in the world amount to combinations of other tools. As use takes its toll on a tool, the underlying tools which compose the original emerge. However, the simple tools that emerge can rarely compete with equivalent, new tools designed from the start with a specific purpose. A broken-down car might be considered, at best, a piece of furniture. At the very least it is an ungainly paperweight. Mitch Hedberg's escalator-to-staircase idea is perhaps one of the most elegant examples.

What if designers accounted for the wear of a tool in its initial design, so that as it became ineffective when used for its original purpose, it became more valuable as some other kind of tool? Often, for safety reasons, they do. The autogyro, for instance, is a powered helicopter-like craft. Should its engine fail, it becomes a maneuverable glider.

I think that the effect of use and the effect of the environment on most objects can be fairly accurately predicted. I have a hunch that if enough effort were put into the design of something, it would be possible to manufacture things which, instead of becoming totally useless with age, simply become something different.

Imagine engines with only a few "high-level" parts. As these parts wear, they can be used to replace smaller parts in the same engine. The engine could be run indefinitely as long as the highest-level components are replaced as they are worn and shift function.

Hardware Hacking

Journal Journal: Mechanical Logic Gates and the Tinkertoy Computer

I'm on Christmas break and have been spending part of my time reading through AK Dewdney's "The Tinkertoy Computer," a collection of Dewdney's writings and articles from Scientific American and elsewhere.

Of particular fascination to me is the idea of constructing computers without silicon. Dewdney points out that all matter can be fashioned into a computer. The only variables are size and speed. Silicon and electricity are currently in vogue; they supersede mechanical and electromechanical, and may be replaced by the light or quantum.

In the 20th century before the transistor, computers were made predominantly from either electrical relays or or vacuum tubes. Konrad Zuse's Z3 was perhaps the most advanced of the relay machines, whereas ENIAC is champion of the vacuum tube.

In the spirit of Stibitz's Model K and Zuse's Z2, I ventured to RadioShack on a quest to build a binary addition machine using relays.

The electronics hobbyist is a dying breed. Visit your local RadioShack and wander towards the parts aisle, and note how the salespeople shy away from you. They won't be selling you a cell phone or a new stereo today. You're on a mission.

My RadioShack adventure was a success, but I was struck by the prices of the damned things. An individual 5v SPST reed relay cost me $2.69. I knew that transistors were faster, but cheaper too? Oldschoolism isn't cheap. I bought enough for a 1 bit adder. The XOR gate I designed required 5 relays, and a 1 bit adder is basically a glorified XOR gate. As it turned out, I used more relays than planned because the output LEDs required separate circuits. The single SPDT relay I bought, which is necessary as a boolean "not," uses 9V and would blow series-wired lights.

I'm proud of the finished product but I'm not sure if making a 4 or 8 bit adder is completely worth it. For an 8 bit adder, I'd be looking at over 40 relays costing over $100.00. Maybe I should build a Tinker Toy computer tic-tac-toe player instead.

Data Storage

Journal Journal: "You need to restart your computer."

Woops.

Today I picked up a wonderful 20GB bus-powered external hard drive, and it rocks. The only problem: its filesystem.

An enormous advantage of a USB drive is the fact that it can be plugged into a PC of any type as long as there's a USB connection. The big problem with thumb drives, which is intrinsic to their portability, is the fact that they're all based on FAT - an ancient, MS-DOS filesystem standard that, though ubiquitous, is far behind technologically. More modern filesystems, including Microsoft's own NTFS, employ much more robust error checking and are generally slower to accumulate faults, or "fragments."

And, though my Mac generally isn't at odds with the drive, I discovered today that with a lot of concurrent reads - say, when using the utility du - the OS has a tendency to just flip out and demand a restart. I've owned my computer for 8 months; this is the first time it's happened.

It would be possible to format the drive with Apple's journalling HFS+ filesystem, but then I couldn't pop the drive onto Windows machines. Because that's the reason I bought it, I guess there's no more intensive file access in my future.

Graphics

Journal Journal: Modern Opthamalogy: A Sham?

It's possible to correct "myopia," or near-sightedness, with what's known as a "pinhole lens;" by allowing only a small sliver of light enter the eye, the effects of distortion in the lens or cornea are mitigated and once can see clearly if dimly. You can cup your hand into a fist and make a pinhole to look through. Your vision will improve noticeably.

I was googling for "pinhole glasses" when I happened upon an interesting scientific backwater: theories that modern medicine's correction for myopia actually worsens vision over time and is not only an ineffective but a destructive approach to vision correction. As the site says: "The excessive amount of reading and other close work that we do in our modern society is the real cause of acquired myopia."

The generally accepted cause of myopia is that it's genetic, though no study has definitively ruled out environmental influence. The Wikipedia article on myopia mentions a few fringe theories regarding myopia. It is held in some circles that the myopia is caused by "a weakening of the ciliary muscle," as brought on by the need for humans in modern society to constantly read material at close distances such as books and computer screens. The proponents of this theory maintain that a vast conspiracy to hide this fact, perpetuated by the government and the medical institution, keeps the myopic in a state of continual vision degradation.

Are corrective lenses a sham? I like to think that modern medicine is above and beyond such blatant debilitation for the purpose of money. And, with all kinds of crazy studies floating around suggesting various reasons for myopia, I think I'll continue to use my corrective lenses but play it safe and wear my magnetic bracelet just in case.

Wireless Networking

Journal Journal: Open Broadcom Wireless Drivers

Broadcom makes a wireless chipset called the BCM4301. This chipset is in the Airport Extreme hardware from Apple, which is in turn in my Powerbook G4.

Broadcom has not released any GNU/Linux or otherwise open drivers or a development kit, so no driver for any open OS exists. Basically, this piece of hardware is the only thing preventing me from running a free OS on my laptop.

There's been a petition for quite a while, but I was happy to find out today that a group over at Sourceforge is actively hacking away. My hopes are high!

Programming

Journal Journal: Beginner Bash

I've been dabbling in shell scripting the past few weeks. My first project was a DynDNS record updater. My latest creation is what amounts to an alias for killall; it scans ps output and kills processes matched to a pattern with grep.

Software

Journal Journal: Multi-distro Linux LiveCD

I got an IM today from a friend of mine with the question "I'd like to put multiple Linux LiveCD ISOs on one disc, and then be able to select at boot which one to start up."

Various micro and utility OSes might be stuffed onto a CD this way - Damn Small Linux, Slax, or Derek's Boot and Nuke are just a few that might be used.

I knew immediately that this was possible, but it took some research to determine exactly how it can be done.

This LinuxQuestions.org thread goes through the details of the process. It's possible to use the RIP Linux distro as a host OS and load the distros up at boot with a custom GRUB setup.

Ultimate Boot CD is a pre-made multiboot CD, and can be modified to payload Linux distros. CD Shell is another solution, and probably the best; it's a "scriptable menu-system" that can be tailored to load kernels from a selection screen at boot.

It's easiest to put together a multi-distro live cd if you have access to a Linux machine, but it's possible to accomplish on Windows using software like Daemon Tools.

I have yet to put together a CD of my own, but when I do it will probably have Boot and Nuke and Slax.

Books

Journal Journal: Calculating the Probability of God's Existence

Today in the car I heard an interview with Steven Unwin, a guy who in his new book claims to have come up with a number representing the probability of God's existence. That number? 67%.

The interviewer threw a lot at Unwin, and his responses were knowledgeable and coherent. He was familiar with Pascal's wager and Leibniz's take on theodicy.

I haven't read Unwin's book, but I'm prepared to dismiss it outright. I just don't think that there exists objective, quantitative data that can be plugged into some formula. This whole approach of Unwin's reminds me of something I read in Zen and the Art of Motorcycle Maintenence.

In Zen, Pirsig argues that the difference between good science and bad science is not the difference between applying the scientific method correctly and applying it incorrectly. His grand treatise on quality posits that an external, "prior-knowledge" - the ability of any given scientist to judge the quality of any observations he or she will plug into the Scientific Method - is what truly makes or breaks any scientific inquiry. Thus, even the seemingly most objective theories are really skewed by a force acting at a level higher than the tools of science.

My instinct tells me this Unwin fellow exerts "prior-knowledge" in the book and in his theories when picking and choosing data to apply, but I have yet to find out. I'll definitely be reading this book.

User Journal

Journal Journal: Numbers Stations

For nearly 40 years there have been recurring, odd broadcasts at shortwave frequencies. Called Numbers stations, they are presumed to be some technique for world governments to contact operatives. These kinds of broadcasts are characterized by extraneous, random blips and a synthesized voice speaking strings of seemingly random letters and numbers.

No government has commented officially on their existence or purpose.

Simon Mason, the author of a book on the subject, has listed on his site a number of recordings that listeners across the globe have submitted.

Programming

Journal Journal: Anti-Patterns: Common Programming Pitfalls

I did a little research today into the nature of "shared libraries," and the differences between static and dynamic libraries. In doing so, I stumbled upon a Wikipedia articled entitled "DLL-Hell", an article which describes in depth the problem of managing dynamic shared libraries, particularly on Windows systems.

Apparently, DLL-Hell is just one of many "anti-patterns," or programming practices that can lead to flawed software.

Examples of anti-patterns include God-objects, magic numbers, and my favorite: spaghetti code.

Netscape

Journal Journal: Running NCSA Mosaic on NetBSD

Last night I occupied myself with the process of compiling NCSA Mosaic.

Fortunately, this guy has modified the Makefile to work on most modern systems. He compiled on Linux, but I found that his version compiled painlessly on my system once I'd installed the OpenMotif package.

Browsing is quick and pages are tolerable yet mangled.

Mosaic, the development of which ended in 1997 at version 2.7, is the direct predecessor of Netscape and considered the grandfather of web browsers. Spyglass Inc., a commercial venture that marketed NCSA technologies, licensed its Mosaic version, Spyglass Mosaic, to Microsoft in 1995. The result was Internet Explorer.

Slashdot Top Deals

"If you lived today as if it were your last, you'd buy up a box of rockets and fire them all off, wouldn't you?" -- Garrison Keillor

Working...