Saturday, June 19, 2010

Proper handling of Proper Names

Proper handling of Proper Names

Patrick McKenzie recently wrote a blog entry Falsehoods Programmers Believe About Names, based on the understandable rant by John Graham-Cumming, on databases not handling proper names. John's proper last name contains a hyphen.

Patrick gives a list forty assumptions that are wrong when handling the entry of proper names into a system. This article on Slash Dot Org further elaborates and amends Patrick's list.

Alas in my experience the problem of not handling non-alphanumeric characters is not limited web forums. I've wanted to use "+5" and "-5" as net labels in CAD packages in the past. The leading numeric signs caused the program to explode because it did not know how to handle an arithmetic operation in a net label. Which leads to the next problem, that all inputs must be sanitized in some fashion to prevent crashing systems.

What do you do to trade off making inputs secure verses allowing what should be valid proper names and addresses? Unicode and International Components for Unicode can be a help, but they don't always fit into the memory space of small embedded systems. Is there a smaller solution?

Tuesday, June 8, 2010

FTC wants to save News Papers by taxing our electronic designs. Watch live June 15th.

On June 15th the Federal Trade Commission is going to hold a live web cast entitled "How Will Journalism Survive the Internet Age?". Details on the event are listed here. Comments on this event can be left here.

By now you are wondering what this has to do with Embedded Systems or Software Safety. That is explained by this document: POTENTIAL POLICY RECOMMENDATIONS TO SUPPORT THE REINVENTION OF JOURNALISM.

It comes down to the FTC in Government Double Speak is proposing many onerous Taxes and Fees (Taxes are not popular so raise the Fees that don't have the Tax stigma yet), on the products that you and I design.

Just a couple of highlights, of the many, many, new taxes to be discussed at the meeting:

Tax on consumer electronics. A five percent tax on consumer electronics would generate approximately $4 billion annually.
Advertising taxes. They note a considerable amount of our broadcast spectrum has been turned over to disseminating commercial advertisements, and a two percent sales tax on advertising would generate approximately $5 to $6 billion annually. In addition, they suggest that changing the tax write-off of all advertising as a business expense in a single year to a write-off over a 5-year period would generate an additional $2 billion per year.

It goes down hill from there with Them wanting to copyright "Facts" so only News Papers can use them...

Between approximately the year 1439 when Gutenberg invented the Printing Press and the year 1710 when the Copyright was created, information was controlled by the Printing Guilds. It seems that the FTC wants to turn the clock back by 300 years:

"...amending the copyright laws to create a content license fee (perhaps $5.00 to $7.00) to be paid by every Internet Service Provider on each account it provides."

Read this commentary on the report, mostly on how public input is being ignored by Them, by Jeff Jarvis of the New York Post, who tells them "Get of my lawn!". Mr. Jarvis raises the question who asked the FTC to 'help'?

About the FTC reads in part:

When the FTC was created in 1914, its purpose was to prevent unfair methods of competition in commerce as part of the battle to 'bust the trusts.'"

So now the FTC views Internet as the 'Trust' that needs busted. Is the FTC just killing off the trust they can not control, to support the trust that they can control?

I find it interesting that this event is being held at a 'Club', at our expense most likely, the National Press Club specifically. If you don't understand why Government meetings at clubs are bad for you and I, then you need to consider a speech given before the National Economists Club in Washington, D.C. on November 21, 2002 by Ben S. Bernanke:

"What has this got to do with monetary policy? Like gold, U.S. dollars have value only to the extent that they are strictly limited in supply. But the U.S. government has a technology, called a printing press (or, today, its electronic equivalent), that allows it to produce as many U.S. dollars as it wishes at essentially no cost. By increasing the number of U.S. dollars in circulation, or even by credibly threatening to do so, the U.S. government can also reduce the value of a dollar in terms of goods and services, which is equivalent to raising the prices in dollars of those goods and services. We conclude that, under a paper-money system, a determined government can always generate higher spending and hence positive inflation." - Ben S. Bernanke current chairmen of the Federal Reserve.

So we can see that as long as eight years ago it was already in the planing stages for Them to put the screws to you and I!

To wrap this all up watch this video and read 1984 by Gorge Orwell if you never have read it before.

I'm Taxed Enough Already, how about you?

Monday, May 31, 2010

High integrity software resources from the FAA

A frequently overlooked source of good material on high integrity software development is the Federal Aviation Administration's Air Software site.

For example right now you can get a free CD from them, while they last. Always nice to see that our taxes do, on a rare occasion, produce something that can be used:

"Presentations from the 2009 Software & Airborne Electronic Hardware (SW&AEH) Conference are still available on CD. To request a CD, send [the FAA] an email with your name and mailing address."

The item worth pointing out the most, on the Air Software site, is:

Object Oriented Technology in Aviation (OOTiA) Handbook, Published October 26, 2004.

The languages C++, Ada95 and Java are covered. However what is more important is the introductory material and reasoning behind Object Oriented Technology. This is Must Read material for someone pondering switching from C to C++.

The OOTiA is also an excellent introduction to proper software development mentods.

The Handbook does make the common error of confusing Concurrency with Simultaneity, giving the errant definition of: "Concurrency is the process of carrying out several events simultaneously."

'Concurrently' in the context of Embedded Systems means "Apparently at the same time", while 'Simultaneously' means "At the same time". The distinction is subtle but extremal important to creating correct real time code. A small single core Micro will never be executing different instructions simultaneously, yet it will be doing many things in hardware such as ticking timers and receiving characters via a serial port simultaneously.

Just because we might be able to use Object Oriented Methodologies in our systems, does that mean that we should? Volume Two of the OOTiA addresses this, as do a couple of articles from Embedded Systems magazine: Nuts to OOP and Michael Barr's rebuttal.

"Adoption of C++ does not suddenly transform C programmers into object-oriented programmers. A complete change of thinking is required, and C++ actually makes this difficult. Many of C’s problems affect the way that object-orientation is implemented and used in C++."
"Going object-oriented for the wrong reasons: There are "many more misunderstood, misguided, or just downright bad reasons for going object-oriented". These include (but are not limited to): wanting to cut back on development staff, thinking OOT will significantly reduce the need for testing, thinking that your project can be completed five to ten times faster using OOT, thinking the use of OOT will reduce project risk, and wanting to be able to build future products simply by plugging software components together."

Volume Two also covers one of my pet-peeves Identifying Dead and Deactivated Code. Volume Three gives details issue of dead object code. Seeing lines of dead source code, code commented out with "//" in C code, irritates me to no end. What is worse is there is no comment as to why the code was commented out, then left in the source file. If you do really need to comment out code use "#if 0 #endif when working in C.

There are two standards that try to illuminate some of the darker corners of C++, to make the language safe to use in Embedded Systems, MISRA C++ and Joint Strike Fighter Air Vehicle C++ Coding Standards. The fact that we have to have such standards implies that we are using the wrong tool for the job. The question becomes is there a safe tool, ie: language for hard real time systems? Erlang comes to mind for soft real time systems.

In looking around I did stumble across a 'safe' version of C# called Spec# from Microsoft Research. Alas it looks like a dead project, and the likely hood of it working on a small micro is zero.

Introduction to The Boost C++ Libraries

Boris Schäling has created a book that gives an introduction to the The Boost C++ Libraries.

Boost provides free peer-reviewed portable C++ source libraries. Many of which will be part of the new C++0x standard when it is released some year.

"This book is an introduction to the Boost C++ Libraries which complement the C++ standard by adding functions helpful in practice. As the Boost C++ Libraries are based on the C++ standard, they are implemented using state-of-the-art C++. They are platform independent and are supported on many operating systems including Windows and Linux by a large developer community.

The Boost C++ Libraries enable you to boost your productivity as a C++ developer. For example, you can benefit from smart pointers which help you to write more reliable code or use one of the many libraries to develop platform independent network applications. Since many Boost C++ Libraries are going to be incorporated into the next version of the C++ standard, you can prepare yourself starting today."

I use the Boost libraries extensively myself when developing Windows or Linux based code. Alas I've yet to find a C++ compiler that I'm happy with that will run on small embedded micros, that would allow me to take advantaged of Boost.

Just because we can, does that mean we should?

Some inventions like Voice Mail and the iPad Steering Wheel Mount, really should never have been invented.

One site claims this is the patent of the Steering Wheel Mount, however that time line does not fit.

Just because we can make dangerous and destructive products, does that mean that we should? Having been run off the road by a Texting-Teen, problems like these are all to real.

My personal view of Apple's products is more along the lines of this patent: GB1151321. If I'm going to fork out Big Bucks for a product, I'm going to use it anyway that I see fit, but Apple says I can only run their "Approved Apps". No thanks, I'll wait for something Open Source based.

Saturday, May 29, 2010

Life is short. Even shorter when you are disabled. Accessibility Considerations.

I had already planned on writing this blog entry today about the new GNU Accessibility Statement, when I found out last night that a friend and fellow hardware designer, firmware developer had passed on.

My friend was wheel chair bound, having no use of his legs, and almost no use of his arms, yet if you only knew him by email or the telephone you would have no knowledge of this.

The estate asked me to pass on this message, to anyone that might put his circuit board making equipment to good use:

LPKF ProtoMat S62 for sale

"I am looking to sell our circuit board plotter. I'm selling the plotter, press, computer, vacuum pump, UV lamp and miscellaneous consumables for $20,000.00."

Plotter and peripheral equipment produce multilayer PCBs, eight layers seems to be the max, up to 9 in x 12" in size, with plated through-hole support. It took me about four hours to make a four layer board the first time I used this system, myself.

I know the equipment was well take care of, and cost about $60k+ when it was bought new in 2006. Sold only as the complete set and you must pick it up in the Pittsburgh/Cleveland region, due to the weight, which is several hundred pounds for the press alone. May be able to get it delivered via one of the principles pickup truck if necessary.

Send email if you are interested.

For full disclosure I was offered a commission to sell this, which I declined, just want to see the family move on with their lives, and funerals are far more expensive than most people realize.

While you can have a $800 funeral prices that run into the thousands of dollars are more typical. These prices come as a surprise to the grieving, when they are not thinking clearly, and often do not have money set aside for this inevitable part of life.

Life is short, we never know when our number is going to be up...

The AxTk accessibility toolkit based on wxWidgets is also something I want to mention.

"AxTk is built on top of wxWidgets and will help you create a menu-based, highly accessible user interface with speech output, mainly for use by visually impaired people. The menu provides a very uniform method of navigation. By menu, I don't mean a menubar or context menu that you find in most applications; instead AxTk uses a list control, refreshed as required to reflect the underlying menu structure. The menus is dynamically extended as the user navigates through the application, and modal (blocking) menu selection is supported when necessary. An example of this is the AxFileMenuItem component, which shows a file hierarchy when clicked and sets a string value to the selected path."
"The GNU Project has published an initiative to create features that can be used by people with low vision, deafness, learning and reading disabilities, and for people with mobility and other physical issues who can use an on-screen keyboard."
"According to the United Nations in 2005, there were 600 million people with disabilities in the world. To use computers, many of them need special software known as “access technology”. Like other programs, these can be free software or proprietary. Those which are free software respect the freedom of their users; the rest, proprietary programs, subject those users to the power of the program's owner."

Sunday, May 23, 2010

Counterfeit ESD products. Guide on EMC for Functional Safety.

Interference Technology of ITEM Publications, has released their 2010 EMC Directory and Design Guide - Digital Edition. [Alas the Digital Edition is an annoying FlipBook that does not render correctly in Opera. Using FireFox you can find the link to the PDF version.]

Several interesting articles, but there are two in particular I wanted to bring to your attention:

  • The Dip Tube by Robert J. Vermillion.
  • The IET’s Guide on EMC for Functional Safety by Keith Armstrong.

To the first one you've got to be wondering whats a Dip Tube? Properly rendered as DIP, Dual Inline Package, it makes more sense to you I'm sure. Those long plastic rails that our ICs are supplied to us in from the factory. It seems that not only do we have to worry about counterfeit parts. We now have to also worry about real parts coming in counterfeit anti-static protection, making the real parts unusable junk. Also offers some words of wisdom on reusing anti-static protection. The words are "don't do it".

The lengthy second article is an introduction to the Guide on EMC for Functional Safety, August 2008, ISBN 978-0-9555118-2-0. Available from The Institution of Engineering and Technology as a PDF, or as a real book (colored chemicals on dead trees). Checklists are found here.

The guide is a 9-step Process to Functional Safety taking EMC in to account. It even includes useful checklists to aid project management, design and compliance assessment.

I'll quote Mr. Armstrong introduction directly:

"Electronic complexity is increasing with no end in sight, increasing self-generated noise levels, while the feature sizes in silicon integrated circuits continue to shrink, making them emit more noise while at the same time more susceptible to noise. The use of electronics in safety related applications is growing very rapidly indeed, with (once again) no end in sight.

We have already reached the point where the normal testing-based approach to electromagnetic compatibility (EMC) is totally inadequate where safety is concerned, as current media interest in automobiles with malfunctioning 'electronic throttles' shows. [The Toyota problem seems like a classic case of Priority Inversion to me.]

...

It comprehensively describes practical and cost-effective procedures for both management and engineering, and can be used immediately to help to save lives and reduce injuries, whenever electronic technologies are used in safety-implicated products, systems or installations of any kind. It is so practical that it even includes useful checklists to aid project management, design and compliance assessment.

...

The IET Guide can also be used to improve reliability, for example in high-reliability, mission-critical, or legal metrology applications.

...

EMC immunity testing is never sufficient on its own for safety I hope I have shown that EMC testing can never be sufficient - on its own - to demonstrate that functional safety risks are low-enough, or that risk-reduction will be high enough, over the life-cycle of an EFS, taking its physical and climatic environments (including wear and aging) into account. The number of variables is simply too large. Test plans could be drawn up which would provide the necessary design confidence, but no-one (even governments) could afford their cost, or the very long time they would take. But we’ve been here before! In the 1990s it was realised that testing was not sufficient to demonstrate that software programs were reliable enough for use in safety systems. After many hundreds of man-years of work by academia and industry, the result was Part 3 of IEC 61508."

While on the subject of EMC, Mr. Armstrong is a frequent contributor to the EMC Journal freely available from the Compliance Club. Do check out the past archives of the Journal.

Software Human Capital in DoD. Four year degrees not recommended. StartUp Visa Act.

The May/2010 issue of CrossTalk, the journal of Defense Software Engineering, just out, is all about "Software Human Capital". Articles cover Software Competencies, Software Practitioner Recruiting, and one on distinguishing between software professionals and "amateurs", among several others.

The overall theme of the issue is that the DoD can not find enough knowledgeable people to create and maintain the software and firmware of today's complex modern weapon systems.

The article on professionals vs. "amateurs" is the one I find of most interest. How many of us have seen the job ads that say "Must have knowledge of X" but never tells us what actually needed to be done?:

"On the topic of hiring competent staff, professionals must be dismayed at the high proportion of job advertisements, over a substantial period, focused on low-caliber skills. For instance, experiences with a specific programming language or a particular requirements management or design tool are often cited as essential skills. With regard to requirements, the major skill is always in the specification: Tool proficiency can inject quality into requirements management, not the specification thereof. A skilled engineer will be trained to specify atomic, consistent, structured, and testable requirements..."

I do fall in the 'dismayed' category myself.

Characteristics of Software Professionals versus Amateurs:

Professional Amateurs
Views the overall task as an engineering discipline. Describes the overall task as an art or carft.
Promotes a holistic, life cycle view. Holds an implementation, coding bias.
Places emphasis on the application or problem domain, and presents architectural solutions. Places emphasis on the technical details of the solution domain to the detriment of the customer or user.
Learns principally from published engineering literature. Learns principally by emulating colleagues.[All depends on the colleagues in my view.]
Encourages compliance with industry standards. Prefers improvised, local procedures.
Employs quality criteria to manage projects. Manages projects via schedule alone.
Conveys an outward, discipline focus. Conveys an inward, project focus.
Exhibits a balanced approach to risk. Adopts a naive approach to risk. [Always go with the lowest price, no mater the costs.]
Conclusion:

The legacies of Adam Smith and Robert Owen are an important reminder to us that people are at the heart of commercial and social success. In our rapidly changing technological world, it is worth considering their centuries-old wisdom. Perhaps there is an opportunity for our organizations to look again at the value, rather than the cost, of their people assets. When people are viewed truly as vital assets, then investment in them is sure to deliver a mutually beneficial corporate future. This will, in turn, lead to greater customer satisfaction.


To present opposing view points to professionals education, as Cass Sunstein: Internet Mandates, Spread the Link Love wants to force us bloggers to do, here are a couple differing views on our education system:

On this hand we have College for all? Experts say not necessarily: This graduation season, some experts challenge whether four-year degree is path to success:

"The notion that a four-year degree is essential for real success is being challenged by a growing number of economists, policy analysts and academics. They say more Americans should consider other options such as technical training or two-year schools, which have been embraced in Europe for decades [Isn't Europe's economy about to go under from massive debt? Seems like a poor reason to copy them.] ..."Our national system is, 'Do you have a degree or not?'" - John Reynolds, a Florida State sociology professor said. "That doesn't really measure if you have skills."

All the job ads I see always start or end with "must have BS degree". HR has no interest in finding out if you can really do the work or not if you don't have the BS. Does that make us professionals or amateurs?

On the other hand we have StartUp Visa Act of 2010 (Introduced in Senate) S 3029 IS, that says we don't have enough smart entrepreneurs in the US, that we have to bribe them to come here to start small businesses. "To establish an employment-based immigrant visa for alien entrepreneurs who have received significant capital from investors to establish a business in the United States."