Small code with powerful results, the occasional opinion … and beer. 

12 Dec 2011
Task Manager: wherefore art thou?

I’ve observed a stange behavior in Windows XP with the Task Manager, which apparently is also rearing its ugly head in Windows 7.  The symptoms appear sometime after a few defaults are changed, and a few reboots and application installations or uninstallations occur– just like in XP.

After opening Task Manager, the options menu has the following options, with those selected by default marked with an asterisk.

  • Always On Top  (*)
  • Minimize on Use (*)
  • Hide When Minimized

Most users don’t use this tool, other than accidentally discovering it in the task bar’s context menu, and marveling at the pretty graph that rolls by in the performance tab.  Sometimes, it is to purposely kill off some stuck process (as instructed by the web help page that Google found for them).

As a developer, I like having Always on Top set to off, and Hide When Minimized set to on.  With the latter, the CPU usage is visible in the tray when Task Manager is minimized.  This way, I get to look at the pretty graph while testing my application, and have a quick way to open the Task Manager by double-clicking it.  Seriously, it is a quick way to monitor memory consumption patterns when processing large amounts of data.

After these modified settings have been in effect for some time, the lower one (Hide When Minimized) “kind of” stops working.  This setting will remove the Task Manager from the task bar itself, and leave only graph in the tray.  When it “kind of” stops working, it removes it from both the task bar and the tray. A clue that this will happen is the tray icon does not appear when Task Manager is launched with these settings.

The only way I have found to reset them is to do the following:

  • With Task Manager open, change the option settings back to their defaults.
  • Close Task Manager (don’t minimize it).
  • Wait about 1-2 seconds
  • Relaunch Task Manager
  • Change the settings on options back to the custom setting (Always on top set to off, Hide When Minimized to on).
  • Close Task Manager
  • Wait about 1-2 seconds
  • Relaunch Task Manager

YMMV, but this is what it took for mine to begin working again as desired.  I have no clue what caused it to break in the first place.  It’s just weird.

 

 

 

 

 

05 Dec 2011
Shakespeare was a Million Monkeys’ Uncle?

I received a wonderful email a few weeks ago about the Shakespeare Million Monkeys problem.  This problem is actually a statistical challenge embraced by the computing community, and solved with advanced computing techniques like parallelism.  The problem is described well in this Wikipedia article:

Infinite Monkey Theorem (Wikipedia),
Weasel Program, a similar concept (Wikipedia)

There is also some additional information on the results of various attempts to automate the solution. They are quite fascinating and worth reading for any software developer.

A few million monkeys randomly re-create the works of Shakespeare (Jessie Anderson–uses Hadoop)

Solving The Shakespeare Million Monkeys Problem In Realtime With Parallelism And SignalR

There is even a Google open-source project for this: http://code.google.com/p/million-monkeys-project/

Basically, the theory says that if an infinite number of monkeys type an infinite number of keys on keyboards, they will eventually write Shakespeare.  The odds are astronomically small, but still possible.  It is an extension of the Weasel program, which uses a similar concept with the simple goal of generating only one phrase from a Shakespeare novel: “Methinks it is like a weasel”

My focus here is not on the technical nature of the problem, but what is revealed about human thinking by the decisions made in the various software applications written to test the theory. Why?  Because somehow the theme of a pure statistical probability is altered as the application developers impose what they interpret as the basic rules of evolution to guide the monkeys.. at least, in code.

All of the examples I have seen for these applications start with creating one or more monkeys who type keys randomly.  This follows the theorem, as long as we don’t ask who made the typewriter and left it there.  (Yes, yes, it’s the software guys.. I know).

So these monkeys who have been randomly typing away on their keyboards, reproduce other monkeys who also type, and the cycle endlessly repeats to create massive amounts of monkeys typing random keys.  This also follows the guidelines of the theorem and evolution, and evolution implies that the monkeys reproduced (the next generation) also inherit traits from the parents, and even some mutations can occur.  In software, it can be as simple as giving each random number generator (i.e. each monkey) a different seed, however slightly altered from the original.  If you write an algorithm to randomly mate two monkeys, a hybrid seed could be calculated from the mating, with the occasional unexpected seed value to represent a mutation.

So at this point, the monkeys are staying within the boundaries of evolution.  If you grant them an unlimited lifespan, they can continue to type forever alongside the multitude of generations of their offspring, allowing for a great variety of comparison among the generations to see if certain mutations or genetic lines are increasing the quality of work toward the desired Shakespearian result.

And that would be a great test of the theorem.  But whether it is motivated by lack of resources (or a lack of patience) to let the virtual monkeys continue on for a potentially infinite amount of time, or a desire to test how the result can be driven, some unnatural algorithm to enforce a form of selection or filtering is applied.  The algorithm is designed to either prevent the reproduction of those monkeys not producing desired patterns, or blatantly kill them off.  The end goal of this reduction is to improve the output of the remaining monkeys, so that progressive generations have a better chance to produce outputs closer and closer to the desired result.

And how is the decision made to determine which monkeys are allowed to reproduce (or even live)?  If the spirit of the statistical theorem were being  followed, we would have to choose numerous random ways of determining the monkeys to bless or curse with a virtual fate.  We could write an algorithm to simulate disease and accidents, with both leading to injuries and fatalities among the monkeys–even accounting for mutations/adaptions resulting from the accidents among the survivors.  These mutations themselves could also be represented as beneficial or detrimental.

To keep the code from becoming overly complex, we would disregard things like geographic relocation and separation of groups of monkeys, sporadic reunions of individual monkeys within groups after time has passed (intercultural interaction), and other things that living creatures experience that mold their thinking.  The random occurrences of life or death due to random circumstance would be the sole cardinal rule to prevent prejudicial influence on the reproduction of the monkeys.  A storm could kill a monkey with no talent, or the next monkey Einstein (or, more topical to the discussion, the next monkey Ralph Waldo Emerson).  No one could know who would be affected.

But the filter chosen for the selection process is anything but random.  It does follow one rule of evolution, in that there is a penalty/reward altering the behavior of the next generation of monkeys.  The penalty is the monkey dies, or isn’t allowed to reproduce.  The reward is the monkey creates offspring, which inherits its traits.  But the ultimate determining factor used for determining this penalty or reward scenario is quite amusing: How close is your output to Shakespeare?

If the pure random output was simply tested against the Shakespearian phrase or work, the theorem is being tested.  But if a decision is made on how (or whether) a new monkey is created, demoted or promoted based on that test result, the end result is being prejudiced. Ironically, that type of filtering is actually creating an answer, instead of an answer naturally evolving.

To better understand this statement, imagine if the monkeys type randomly through the generations and, despite random storms, diseases, wars, personal tragedies, criminal acts, etc, one monkey in the vast array of generations reproduces a work of Shakespeare. That is truly astonishing.  Shakespeare was only a measuring stick at interim points in the generations and at the end of the test: it had no influence on the monkeys. A monkey producing a Shakespearian output in this scenario was due to pure chance, and is de facto (i.e. concerning fact).  It evolved despite all the circumstances thrown against it.  De Facto is the expected result of the theorem.

When the works of Shakespeare are used to test the output, for the purpose of altering future generations in some way to direct them to better Shakespeare-like results, the method of selection becomes de jure (i.e. concerning law).   It is in this scenario that Shakespeare is a million monkeys’ uncle: his works are reflected in his virtual offspring, because he is enforcing his standard at every stage of reproductive events.

One thing that is important to keep in mind: in both scenarios, the monkeys are not aware of why they are being killed off or not reproducing. They just keep moving on, typing regardless of the circumstance.  The question is whether the great Shakespeare God  (in the virtual sense) is intervening in their destiny, or if that Shakespeare output is truly the logical conclusion of random circumstance.

I guess that is up to the monkeys to decide for themselves…  and that would be the really interesting algorithm.

Follow-up: I received feedback from several people that the exercise of the theorem is to see if an application can “teach” the monkeys how to progressively get better at writing Shakespeare, until they are writing actual Shakespeare.  And a baseline of a Shakespearean final product is needed to do so. I am aware of that.

My commentary here is to point out the “thinking”, so maybe I should point out mine.  It is a dangerous thing to mix the terms evolution, monkeys and math together.  It introduces the risk of prejudicing a reader’s concept with their preconceived ideas of evolution and monkeys into your theorem.  Personally, I question the motive of choosing the word monkey as the symbol, and the word evolution as the process, therefore implying that the math-based theorem is somehow trying to prove evolution.  Is it a wrong perception.. of course, but it takes reading the whole article in detail (requiring a technical background to understand the process) to realize that it is not a true evolutionary methodology.

This is where sticking with weasels, or even using dogs or goldfish, works better for the theorem.  Each of these are just being taught tricks to produce a desired outcome, and no inference to (de facto) evolution is implied.

 

 

21 Oct 2011
The greatest business leader of our time..

Recently, I found myself mourning the loss of Steve Jobs, as millions of other people were. Unquestionably, he is one of the greatest influential business leaders of all time. He’s in a class with such influential leaders as Henry Ford (automobile), J. Paul Getty (oil), Cyrus Vanderbilt (railroads), J. P. Morgan (Steel), and others who didn’t invent their industry, but found a way to make it work directly for individual people in a way never before seen.  He has an indelible place in history and, for the current generations, in our minds.

Probably the best tribute I experienced was something Tom Brokaw said on NBC’s Today show the day after Steve’s death. Tom talked about how he was a big fan of jukeboxes as he was growing up, and how the iPod had brought the jukebox back to him. What Steve Jobs’ had led Apple to do affected Tom Brokaw personally. I loved the smile on Tom Brokaw’s face as he told that story: it was genuine and heart-felt.

I have also been seeing the expected cartoons about Steve Jobs encountering St. Peter at the Pearly Gates, and God himself, and offering to show them how they can improve things there.  While reading the tributes and quotes to Steve Jobs, something struck me in the oft-quoted extract of Steve’s 2005 commencement speech at Stanford University.

“Your time is limited, so don’t waste it living someone else’s life. Don’t be trapped by dogma – which is living with the results of other people’s thinking. Don’t let the noise of others’ opinions drown out your own inner voice. And, most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.”

Knowing Steve Job’s beliefs in Buddhism, and to some extent the occult, my heart sank even lower when I read this.  It was clear that, barring any last minute radical change in Steve Job’s beliefs, he had likely become a victim of a warning given by Jesus himself in the book of Mark.

“For what shall it profit a man, if he should gain the whole world and lose his own soul.”

Here’s the reason my heart is  heavy.  The world will remember Steve Jobs in a big way, and so will I.  When I compare the parables in the New Testament about the servants and the talents, Steve Jobs was a 10-talent investment who gave back at least 10 talents more.  To this, the master would say “well done, thou faithful servant.”  Steve Jobs was entrusted with a lot of skills, talents and resources, and he maximized them all. While the world marvels at Steve Jobs, I am sure God himself was pleased to see His own creation serve others through business and charity, and prosper so well–making a great life out of what he was given.  He loved Steve Jobs as much as any other person on this planet.

It is just sad to think that someone so talented, who had accomplished so much, would possibly end his life on Earth only to have a fate of being separated from God eternally: a fate that even God himself has stated he does not wish on anyone.  But that is the way it works.  Only the saving grace of Jesus Christ can bridge the gap between God in heaven and ourselves. All personal and professional success, and regret about our mistakes and transgressions,  have no impact on that gap–only Jesus can eliminate the sin that separates us from God, before we draw our last breath and that separation must become eternal.

I truly hope Steve Jobs changed his beliefs in the last hours or days of his life, and was able to accept Jesus’ personal offer of forgiveness and salvation.  But if not… it would be far from the first or last time it has happened.  And, it would be another reminder of our personal priorities: something God puts in front of us from time to time in our lives.

“Seek first the Kingdom of the Lord, and all these things shall be added unto you.” says the Lord.  Everything else is secondary.

 

21 Sep 2011
The relations between controls and idle states in a Windows Form

I recently wrote a code conversion project, with a simple windows form to review and adjust the results.  It had a list view container on the left to enumerate the scripts, and two text boxes on the right for the selected script in the list: the top for the original script, and the bottom for the result of the programmatic conversion.  The conversion was 100% correct in about 95% of the scripts, so the human element was needed to catch exceptions that the code converter missed and make adjustments.

I added code in the instantiation method to populate the listview control from its database source.  To save the user unnecessary mouse movement and clicks, I then added code to iterate through each script on the first pass, and convert the script.  This saved the user a few button presses to convert and save, where no script adjustment was needed–the vast majority of cases.  The user, while reviewing scripts, could also reconvert the script with a button press to reset to the original content if any change needed to be reset.

I wrote the load and update methods for the scripts to operate on the currently selected item in the ListView.  So the code to pre-populate the script conversions used the .selected property to select the script to operate on, then called the Load/Convert/Update methods to do the work.  These db-layer methods used the table  identity value, stored in the .Tag property of the item.   Afterwards, the .selected property was set back to false before the next iteration.

The code worked fine when the user would click on an item in the list view, but the initial population would throw an error saying “index out of range”.  I discovered the problem when I single-stepped the code in the pre-population.  While the .selected property of the item was set to true, the .SelectedItems and .SelectedIndices properties both still showed a count of  zero on the next instruction.

I began to recognize that I had a state problem with the ListView object.  While the property is set to true, these other properties are not updated until the method completes, and the windows form thread bubbles its way out of your method through the various wrappers, and returns to an idle state.  The problem is similar to the orphaned tray icon problem (see Preventing the orphaned system tray icon in a Windows App). So to use the ListView as the indexer in my loop, I needed to implement an idle state, and move the work into a timer event. An example of the code is here.

One other approach is to write the GetScript() and UpdateScript() methods for the individual scripts to take the identity value as a parameter.  This would facilitate both a straight index from a loop, and a selected ListViewItem (i.e. passing the stored identity from the .Tag property, etc).  If you plan on doing bulk actions on your items in the ListView manifest, this is a better approach.  But if you are inheriting code that just needs to have bulk actions added where previously only actions on selected items occurred, and the code is highly intertwined, this is a way of using the existing windows control’s selection work when using iteration.

21 Sep 2011
Dead yeast make no bubbles.

The last several batches of beer I made had problems with carbonation after bottling, and the problem was eluding me.  I had a conversation with a fellow home brewer at work who helped me determine the cause: yeast dying before the bottling process was complete.

The problem started when my yeast starters were creating very active fermentation, reducing the fermentation time and increasing the alcohol content.  I also compounded the problem by waiting 1 or 2 days longer than I should have to bottle, after the fermentation was complete (i.e. over 1 minute between bubble bursts.

So in my last batch of beer (Stout), I tried something different: I saved some of the yeast I was pitching in a sanitized container, and stored it in my fridge.  As I was siphoning the wort into the bottling bucket, I added the stored yeast and the fermenting sugars to the wort.  It worked.  Only 5 days into conditioning, the bottles were producing the usual 1-2 inch head I expect.

Lesson learned: the very by-product produced by yeast (alcohol)  as it consumes its food (sugar) is toxic to the yeast itself.  So carefully watch for the time when the bubbling cycles go below 1 minute.  That means your yeast is gasping, and it needs new food to continue its life.

 

14 Aug 2011
The mysterious mutating power properties .. SOLVED !

Back in 2009, I wrote a post related to issues of mutating power settings in Windows XP Media Center (I’ve got the Power! … but not over power properties?!). Since then I have seen the problem also on Windows XP Professional, and on multiple manufacturers laptops (HP, Gateway and Dell). After digging a little further, it seems the problem is related to using a laptop as a host for  RDC connections for multiple user accounts, which exposes a design strategy in Windows XP that conflicts with this use.

The power properties are strange.  Instead of being stored at the local machine level in the registry, they are stored at the user level.  There is a setting for the default user, and an override for each user account (which initially is only the same as the default).  That means that user A can choose to enable hibernation, while user B can choose not to.  That’s a strange design choice to me.  I can only assume that a user case was drawn up that most laptops are “personal”, only one user account exists for it, and it’s predominant use will be on demand use (i.e. not continuously available).  So the default was designed around this case.

Since I use at least two laptops with multiple user accounts in a continously-on mode, and have them sitting under a desktop with the lid always closed, the default Microsoft chose is what is causing me continuing problems.  I can set the proper power properties while I am logged on but, without changing the global user defaults, the next user will inherit wrong settings.

Knowing this now, the best way to establish the power scheme on a freshly-paved laptop to be used in this mode is…

  • Setup the laptop with a new power scheme definition designed for its operation, and set that new power scheme as the active power scheme.
  • Open RegEdit, and export this branch to a file: HKEY_CURRENT_USER\Control Panel\PowerCfg
  • In the file just created, change all references of HKEY_CURRENT_USER\ ..to.. HKEY_USERS\.DEFAULT\
  • Import this file into the registry.

This will set the default to the proper value, and every user who initially logs on from this point forward will inherit those default setting into their account.

Still, this does not solve the problem of a user logging on, changing their settings, and causing the laptop to initiate sleep, standby or hibernation; thereby taking the laptop offline.  One way that can be addressed is with permissions on the registry branch.  Still, most people aren’t that interested in power settings, especially when they login to a computer they don’t see or manage.

FWIW: If you’d like to reset the power settings to a fixed profile every time a user logs on, you can set this batch script to execute at logon.  It will create a schema for the power settings, program the settings, and make that schema the active one.  It will at least undo any tinkering done by a user the next time they log off.

@echo off
REM
REM This script sets the power properties to prevent standby or
REM hibernation while the computer is running on AC power.
REM It creates a power scheme called AlwaysOn-RDC-Multiser, and
REM sets the system to use this power scheme.
REM
REM This script is intended for laptops or even desktops, which
REM are always running and are used as dev "slop-boxes" to test
REM prototype code or are doing heavy-duty R&D work in a "not 
REM ready for production" capacity.  It prevents the computer from
REM going into standby, sleep or hibernation, regardless of the
REM user's preference.
REM
REM ** This script needs to be run as a startup script
REM ** when a user logs in.  To do this:
REM  1) Start / Run
REM  2) gpedit.msc
REM  3) Drill down to Local Computer Policy /
REM       Computer Configuration /Windows Settings /
REM       Scripts (Startup / Shutdown)
REM  4) In right panel, double-click Startup.
REM  5) Click the Add button.
REM  6) In the Script Name, enter the full path for this file.
REM  7) Leave the Script Parameters blank and click OK.
REM
 
powercfg.exe /C "AlwaysOn-RDC-Multiser"
 
powercfg.exe /H ON
 
REM ** CORE SETTINGS **
powercfg.exe /X "AlwaysOn-RDC-Multiser" /monitor-timeout-ac 0
powercfg.exe /X "AlwaysOn-RDC-Multiser" /disk-timeout-ac 0
powercfg.exe /X "AlwaysOn-RDC-Multiser" /standby-timeout-ac 0
powercfg.exe /X "AlwaysOn-RDC-Multiser" /hibernate-timeout-ac 0
powercfg.exe /X "AlwaysOn-RDC-Multiser" /processor-throttle-ac NONE
REM ** CORE SETTINGS **
 
powercfg.exe /X "AlwaysOn-RDC-Multiser" /monitor-timeout-dc 10
powercfg.exe /X "AlwaysOn-RDC-Multiser" /disk-timeout-dc 10
powercfg.exe /X "AlwaysOn-RDC-Multiser" /standby-timeout-dc 0
powercfg.exe /X "AlwaysOn-RDC-Multiser" /hibernate-timeout-dc 0
powercfg.exe /X "AlwaysOn-RDC-Multiser" /processor-throttle-dc NONE
 
powercfg.exe /G ON /OPTION BATTERYICON
powercfg.exe /G ON /OPTION MULTIBATTERY
powercfg.exe /G OFF /OPTION RESUMEPASSWORD
powercfg.exe /G ON /OPTION WAKEONRING
powercfg.exe /G ON /OPTION VIDEODIM
 
powercfg.exe /S "AlwaysOn-RDC-Multiser"

07 Aug 2011
Finally, Internet-based irrigation control for the tech-savvy homeowner

So that you know up front: I have neither purchased nor ordered the device yet.  I’m not promoting it.  I am just publishing this because so many people I talked to over the past few years really wanted what this device does and, like me, couldn’t find anything like it.

I’ve been repairing my 5-year old Irrigation system recently, and I am revisiting an idea to control and monitor the irrigation system via the internet. The first time I did my research, I could only find controller systems in the $300+ range that could do this, and they were mostly designed for commerial use instead of residential use. Even worse, they wanted a monthly subscription fee, because the device would only interface through a server provided by the seller.

Enter 2011, and I am revisiting the issue as I do my repairs and maintenance. After digging a bit through the forums, I found a link to Irrigation Caddy, and it is exactly what I am looking for.  It is a self-contained controller with a 10/100/1000Base-T interface (i.e. hard-wired Ethernet). It has the zone controller connections for the solenoids, and a built-in web server for configuring the device.  And the cost… a really cool $129.95.

So this device is half the price of the cheapest typical commercial units, and requires no monthly fees.  To connect this to a wireless router, since I have no way to get an ethernet cable to it, it only needs a cheap bridge to add wireless to it. This is a great solution for people who manage their network routers themselves, and want to interface their irrigation system control to it.

The company now also mentions an iPhone app written by a third party, which can control the application as well.  See thier blog for details.

I don’t know whether the device is capable of detecting and reporting a faulty zone controller (I would think it does).  The S1 version of this device ($149.95 instead of the $129.95 for the base model) also includes support for a rain sensor, which signals the controller to cancel the watering action when it has detected an adequate amount of rainfall.  This is a requirement in a number of places, including the area of Florida I live in (managed by the St. John’s Water Management District).

I am excited and pleased to see that someone finally built an irrigation controller for DIY’ers.

05 Aug 2011
The Federal Reserve and Transparency… Attempt #2

“The drive of the Rockefellers and their allies is to create a one-world government, combining super-capitalism and Communism under the same tent, all under their control … Do I mean conspiracy? Yes I do. I am convinced there is such a plot, international in scope, generations old in planning, and incredibly evil in intent.” — Congressman Larry McDonald, D-GA.

(Congressman McDonald was killed aboard Korean Airlines Flight 007 when it was shot down by a Soviet fighter pilot on September 1, 1983)

This NY Times Article appeared recently, authored by Congressman Ron Paul. It’s worth reading. He makes a call to enact legislation now to force transparency into the operations of the Federal Reserve Bank. He has good reason for it, as he explains in the article.

He’s not the first to do so. Congressman Larry McDonald also called for an audit and investigation into not only the Federal Reserve, but the Council on Foreign Relations (CFR) and the Trilateral Commission, who supposedly have a role in this plot to subdue all sovereign nations under a world government that they (Rockefellers et al) build and control. By implication, investigation of those organizations would reveal financial ties to the US Federal Reserve Bank–ties that the Federal Reserve would probably go out of its way to keep out of public knowledge.

I applaud Ron Paul’s courage to push this issue to the front of the American conscious. It’s late in the game of world domination, but there’s plenty of indicators that the Federal Reserve is not what Americans think it is.

It’s a hard sell, to say the least, especially to a country that generally looks at the Federal Reserve in a good light. After all, one of its most famous stewards, Alan Greenspan, was practically a household name. He guided the Federal Reserve during the Reagan, Bush 1, Clinton, and Bush 2 administrations, and lead the organization during extraordinary economic prosperity in the United States.

Still, the Federal Reserve is fascinating simply because it is such an oddity in the US Goverment’s structure.

  • It was created by an act of congress and passed into law on Dec 23, 1913.  Supposedly there were only 6 Congressmen there to vote (but I have no independent confirmation of this, and it would seem to be a violation of Article I, Section 5 of the US Constitution describing quorums).
  • The structure of the Federal Reserve makes it essentially a private corporation with privately-held stock, and only goverment approval of its Chairman.
  • Many Congressmen were suspicious of the bill since its promoter in Congress had close ties with J.D. Rockefeller and J.P. Morgan.

As Ron Paul points out, most of the money dolled out by the Federal Reserve has gone to people who are supposedly connected to the Rockefellers in some fashion.

Wikipedia.org has a good article on the Federal Reserve System here.

25 Jun 2011
1-2-3 … Red Light Camera !

MSNBC published an interesting article on the growing backlash against red light cameras in this country.

http://www.msnbc.msn.com/id/43521646/ns/us_news-life

The core issue I see in this debate is balancing automated enforcement against public trust, and I’ve got some suggestions for that… based on some experience.  What we are doing right now with automated red light camera enforcement is too simple and narrow-minded to be given the broad acceptance that governments are giving it.  These suggestions are on how to use the technology properly and fairly, and to reverse the damage to public trust which is causing the public backlash to gain such momentum.

I first was exposed to both red light cameras and speed enforcement cameras in Berlin, Germany, in the 1980’s while stationed there.  This was almost 10 years before any serious discussion of using them started in the United States.  While in Berlin, it was common to have a lunch room conversation occur with someone who received a citation in the mail from the German police with a picture from one of these devices.

The most common reaction to it was, “When did this happen, and where was I?  I don’t remember anything like this.”  This is my biggest problem with automated enforcement of red light cameras and speeding cameras.  By the time the citation arrives in the mail, so much time has elapsed since the incident that recalling the incident, let alone details, is hard for most people.

Additionally, it tends to engender a paranoia and distrust of public officials–instead of the intended behavior modification.  Imagine the difference between getting a ticket several days or weeks later in the mail, for an incident you barely remember, compared to a police officer stopping you on the spot and staring at you through those dark sunglasses asking, “Do you know why I stopped you?”  It’s possible you ran the light due to a momentary lapse of attention or something distracted you that did require immediate attention.  But it gets dealt with immediately, and personally with an authority.

As any parent will tell you, the closer you catch a child breaking a rule (both time wise and proximity), the more effective the scolding or other discipline will be.  But more importantly, you can also have a dialog with the child right away and find out if there was something going on you were not aware of, which was causing the behavior.  There might be a reason to not discipline the child because of something you were unaware of.  Let the child have his say, even if it does turn out to be somewhat ludicrous, and the child will accept (or comes to term with) the punishment much better.

Try this: put a camera up in your house, and leave the child a picture or video for them to watch several hours later of what they did, include what their punishment would be, and don’t be around for them to talk to you when they watch it.  The relationship with that child will immediately become very unhealthy.  The child will go out of his way to spend time outside the house and away from you.  Trust is gone, or if you are lucky… just seriously damaged.

Period spot checks (a real police officer) are a far better way to enforce traffic infractions, because the timeliness and the personal contact with the authority, even if the authority decides to issue you a ticket, maintains the public trust in an enforcement scenario.  There are three main problems that I have with this automated enforcement, which make me a strong opponent of the cameras and processes currently in use.  Address these, and I would change my mind.

#1: Get a better picture of the event, and a better prospective on what that picture does for enforcement

As it was in Berlin while I was stationed there, a red light camera usually has one view: from the rear.  It generally snaps a picture of the vehicle behind the limit line (that white line which you are not supposed to cross over while the light is red), and a second picture to capture the license plate number.  That view is particularly narrow: both snapshots are from the rear of the vehicle, and capture just the intersection and the vehicle.

One of the most unfair things about this view: since only the car and its license plate is visible, the ticket is issued to the vehicle’s owner… even if they were not driving the car.  If a police officer pulls a car over for running a red light and issues a citation, he issues it to the driver.

So change two things about this..

  • Make all photographic evidence of the event moving pictures (not still) so that 3-5 seconds prior to running the red light is recorded, and audio is included.
  • In addition to the rear view, record a view of the event that includes the front of the vehicle capable of capturing the drivers actions.  Include a 360 degree view of the insection, and that would be ideal.

As a motorcycle rider, I can tell you that I don’t just look for vehicles on the road. I pay attention to the driver’s head. It tells me the driver’s intentions: focused, engaged in conversation (phone or otherwise), checking the mirrors for objects to prepare for a lane change, enraged, singing along with the song on the radio, yelling at the kids in the mirror to be quiet or saying “we get there when we get there”, spooked by something on the side of the road, etc. It helps immeasurably in safe driving.

Yes, I can actually read these things from body language alone. They would be visible on the video from a front view as well.  And an infrared camera view could provide an adequate view of the driver at night. You see, red light cameras are really intended to catch one type of violation: the driver who sees the yellow light, knows the red light is coming, doesn’t care or consider that they have adequate distance to stop in time–and chooses to go through the intersection anyway. That’s the behavior that leads to some very serious and deadly accidents, which the automated enforcement is trying to curtail.

It’s the driver who, approaching the light as it turns yellow, doesn’t take their eyes off the light. In fact, the front end of the car might raise up a little as they apply the gas to quickly get through the intersection. You would see the body language on the tape to prove this intent: unwavering focus on the traffic light and the intersection, biting of the lip or clenching of the teeth, and maybe the utterance of a four-letter word.

This would be very clear on the video and easily determined as intent to run the light.

And what about those events that are not clearly intent to run the red light?  Well, police officers do have the option to issue a warning instead of a ticket.  What would you think if you received a letter of warning for running a red light in the mail.  Contained in it is a comment by the enforcement officer that he observed things in the video, indicating the event appeared unintentional, and requesting that the driver be more aware and careful in the future.  Would you continue to see the authority as being cold and harsh with technology?  I doubt it.

#2: Automatically set a court date to review the violation.

This is a step that is necessary right now, to restore the public trust. It basically means that an enforcement officer has reviewed the video, determined from all angles of the video that the intent indicated was to run the red light, and issued the citation. On the citation is a pre-scheduled court date with the time and location for the person receiving the citation to appear, but they are not required to appear if they choose not to challenge the citation.

Make it so that the person does not need to go through the trouble of scheduling a date. And there is an important part of this, at least in the first years of it. If the person shows up to challenge the citation, and loses, no penalty above the initial fine can be imposed for challenging the citation in court and losing.

By doing this, the court is actually encouraging the person to attend and review the video. The judge can also see it with the defendant, and hold a dialog. The judge becomes the oversight officer for the enforcement officer, as it should be, and the person being charged gets the opportunity to have face time with a real person in authority (since they didn’t have it directly with a police officer at the time). Some convictions will be naturally be overturned, but I am convinced that when people who just show up in court expecting to win worthless challenges see how strong the video evidence is, word will begin to spread that the automation is no longer narrowly focused on the back side of the car–and the enforcement officer issuing the citation had solid, overall evidence for it.

And after the first years, include a hyperlink directly in the citation where the person can go online to view all the video evidence supporting the citation. Then, if they show up in court and still challenge the citation, imposing an additional fine for losing the challenge is easily justified.

This step over time will help repair the damage to public trust that this camera-enforced method is causing.  Imagine, in the scenario with your child, that you left the video for them to watch with a note that said, “Because of what you did here, your punishment is {..fill in the blank..}.  However, I will be at home at 6:00PM.  If you don’t understand or disagree with the punishment, come talk to me.”  The reaction is a very different, because you’ve opened the door to personal contact in case they have something to tell you that changes your interpretation of what you saw.”

#3: Set firm standards for traffic light timing where red light cameras are installed.

This step is an anti-corruption step.  One of the things I observed and had confirmed in occasional discussions with my German friends who drove in Berlin, was the fact that certain lights at busy intersections had a very short duration for the yellow light during rush hour.  Those same traffic lights would have longer duration for the yellow light at non-peak hours.  It was never officially timed, but everyone observed it and knew it.  And those traffic lights had red light cameras installed.

This is a potential exploit of the automated red traffic light enforcement, which is just ugly.  Because of the money these automated enforcement devices can potentially generate, make no mistake that this is a temptation that exists for governmental organizations.  And the public perception of citations being issued unconditionally just to raise revenue is a HUGH contributor to the backlash against the devices.

So as part of the system, make sure the recording displays a time stamp down to 1/100th of  a second.  If the citation is challenged in court, an automatic part of the review is to check the duration of the yellow light against a chart for minimum duration times for the posted speed limit.  If the minimum duration is violated, the citation is automatically dismissed.


In conclusion…

I make these suggestions not only as someone who has had a citation in the past from these devices, but also as a software developer who has always had concerns about proper use of technology–especially in legal contexts.

I also make them from the perspective of a person who lived in West Berlin during the Cold War, and visited East Berlin where secret police and informers in crowds, as well as cameras on roof tops, were everywhere–for the purpose of controlling the masses for state security.  I am now living back in the United States, my home, the land of the free, which claims to do things better than that.

So my challenge to the government authorities here is this: if you use technology for enforcement, prove that principle in your enforcement process.

(03/20/2013) A follow up: As of the time of this posting, Los Angeles was weighing the decision to end the contract for its red light cameras. In the summer of 2012, they did not renew the contract for them. Who’s mostly to thank? A set of court judges who refused to enforce the citations. Bravo gentlemen and gentlewomen! We can only hope the rest of the country will follow your lead. Read the article here.

20 Jun 2011
Two-wheels or not two-wheels

Recently, I needed to get my motorcycle license endorsement in Florida.  In the process, I learned some things about how states are handling driver’s licenses and records which are worth passing on.

The state of Florida changed its laws in 2010 to require a beginner’s motorcycle safety course for anyone who wants to have a motorcycle driver’s license or endorsement. It is a very basic course for beginners who have virtually zero experience with a motorcycle.  The course is 14-hours and costs around $250 to take–and its a worthwhile course to take, only if you are a beginner.

I’ve had this basic motorcycle safety course in the Air Force while stationed in Texas.  I’ve had motorcycle licenses in California and with US Army Europe (while in the Air Force). Fortunately, Florida has a reciprocation clause in its law which lists the states, territories and other organizations for which it honors previous motorcycle licenses.  This is the “grand father” clause in the law which allows previous or existing licensed motorcycle riders to bypass the course.  Both California and US Army Europe are on the list.

When the Motor Vehicle office checked my records in the common database, no record of either license was found. Since both California and US Army Europe issued my licenses just before the national database was beginning to be populated, I needed to write to each organization directly to get a copy of my driving records.

US Army Europe had the records, which were available for a document processing fee.  Interestingly, I had first called California to ask if they had the records, and was informed that the California DMV now destroys all driving records and licenses after 10 years.  Whether that time frame is 10 years after expiration, or 10 years after last issue, I can not say since I didn’t ask.  I was just a little surprised that, in an era where electronic storage is available,  such a short time of availability would be imposed.

Because of this experience, I have a recommendation.  If you move to another state, and have your driver’s license reissued in the new state, order a copy of your driving records from the state you left and store them in your personal files.  This appears to be very important for motorcycle riders.

You never know if you will need them, after the state no longer wants to keep them.