Archive for the ‘Uncategorized’ Category

Social Networking for Engineers

Friday, February 4th, 2011 Michael Barr

Would your best friend describe you as a particularly “social” person? Do you like to “network” and meet new people? If you’re an engineer, your answer is probably something like,

“Um, no and no. Now can I slink back to my cube, Mr. Nosy McSales Guy?”

The growth of “social networking” in its many forms is a remarkable phenomenon that’s proving powerful enough to reshape the economic landscape and trouble despotic regimes. For example, if (6 year old!) Facebook were a country it would already be the world’s 3rd most populous.

That we the engineers–who ultimately make stuff like this possible–are mostly a loose band of individuals self-selected for our lack of people skills (a key trait that allows us to sit in cubes all day focusing deep-deep-deep on new technology) may explain why so many of us are luddites when it comes to using this “social” technology.

Some of us rationalize that we don’t like connecting with people offline, so why would we do that online. Others that reading status updates from other people will take valuable time away from more important stuff. This fun video sums it all up,

“Until recently, wasting time on computers was the domain of engineers alone. Now even my Nana wants to keep me up to date on the status of her cats!”

But there’s a lot of value in social networking for engineers. Here’s how I use three social networking websites and why you should join them too.

LinkedInmy cloud-based self-updating address book

Every user on LinkedIn creates a “public profile page”, which is something like a resume. Your profile gives your current job title, the name of your employer, and the nearest big city. If you want, your public profile also has space for you to expand on what you do in your current job or in your career generally. You can also list where you went to University, what you majored in, and your past employment history–complete with praise quotes from former colleagues and managers.

When you “connect” to another LinkedIn user, they get to see your private information too. This includes (by default) your e-mail address and phone number, as well as the names of your other connections. The majority of LinkedIn users seem to have on the order of 100 connections once they get setup. Your “in” list consists mostly of current and past colleagues, perhaps some classmates or other chums, etc.

Although it is not specifically advertised this way and has many other valuable features, I think of LinkedIn as primarily my cloud-based self-updating address book. It’s an address book in that I can easily search for your phone number or e-mail address once we connect. If I can’t remember or spell your last name, I can search by first name and anything else I can remember about you, like the name of an employer. And, as long as you take the few minutes to update your profile page and contact info each time you change jobs, we’ll never lose touch with each other. Wow!

I’ve used LinkedIn to easily reconnect with old friends as well as to stay connected to colleagues, friends, and pretty much anyone who hands me their business card. Although I also have an offline address book, that’s now much smaller than it used to be–and just for tracking those phone numbers and e-mail addresses that I use on a weekly or monthly basis.

There are smartphone apps for LinkedIn and I have one on my iPhone, but I rarely use it. I don’t visit LinkedIn every day or even every week. Instead I visit the LinkedIn website in little bursts–such as just after a conference–or when I want to find someone’s phone number. I’ve also turned off most of their automatic e-mails at this point, though those can be useful prompts when you’re just getting started.

You can view my public profile at http://linkedin.com/in/netrinomike. If we’ve met somewhere (online or off), feel free to send me an invitation.

Twittermy own private specialized news service

Twitter is something completely different. In fact, it is hard to describe what twitter is. That’s partly because it is many different things to many different people. For example, I often hear people say they don’t use twitter because they don’t want to know what their friend Joe had for lunch. But I’ve been using Twitter almost two years and have never learned what anyone had for lunch there.

Thus rather than try to describe Twitter or its capabilities, I’ll just tell you how I use it as an engineer. I currently “follow” 276 twitter users. Just a handful of these are “friends”, though a larger set are “acquaintances”; most I’ve never met. When one of the users that I follow writes something (in the lingo, “tweets”), I see it in a timeline of recent posts. All of the posts are short text (maximum 140 characters). I usually check in on this timeline 1 or 2 times a day, at which point I scan them for interesting bits of information; except for sometimes following links to longer articles, this activity takes on the order of 15 minutes a day tops.

I DON’T follow users who tweet a lot–say more than ten times per day (a quick look suggests they collectively average less than one per day)–for long. And I DON’T follow users that tweet what they ate for lunch. In fact, I ONLY follow users that typically include a link in every tweet. That is, what they are doing is feeding me a headline of possible interest; if it is of interest and I have time, then I follow the link to read more.

The vast majority of the users I follow are in the embedded systems design community. Some are engineers. Some are marketers. Some sell tools that I use. Some are just in software or engineering more broadly. A few cover hobby interests of mine. The best tweeters always stay on topic, in their area of expertise–just as I try to do by posting from a narrower topic area than I read.

From reading these streams of short headlines I stay vastly more up to date on the technologies and products and subjects of most interest to me than was ever possible before. I’ve basically stopped reading newspaper websites and some blogs and read twitter instead. (But just like printed newspapers, when you don’t have time to keep up, the old stuff just drifts to the bottom of the stack where you may never get to it.)

By the way, I read and post Twitter messages almost exclusively from an app (Twitterific) on my iPhone. I hardly ever visit the Twitter website directly. I prefer the user experience of the app and can easily find spare minutes to read from my phone while away from my desk.

You can view a timeline of my tweets at http://twitter.com/netrinomike. If you find the kinds of links I post there interesting, feel free to “follow” me. Unlike most other social networking services, you can follow anyone on Twitter just for knowing their handle.

Deliciousmy Internet memory book

Delicious is an Internet bookmarking service that can be social if you want it to be. By bookmarking service I mean that it’s an alternative to the long list of bookmarks you’ve probably been keeping in your browser.

Rather, as I come across interesting web pages during Internet research, I save those I think I may want to come back to sometime later in delicious. There are a number of advantages of keeping bookmarks in this way:

  • you can add notes to each bookmark
  • you can categorize (“tag”) each bookmark in as many ways as you want (e.g., “embedded” + “bloggers”)
  • you can search for a previous bookmark by keyword or tag
  • your bookmarks are not tied to a specific browser on a specific computer

After using Delicious for more than five years, I now keep just 12 bookmarks in my web browser. These are links that I use daily or weekly. One of those is a shortcut to add the page I’m on to delicious; another to my delicious history.

Delicious can be social in that you can easily share links with friends and see what’s popular across all users and things like that. I never use any of those features. (For one thing, what’s popular on the whole site never includes the stuff about embedded software that I’m most passionate about.) But though I don’t connect to other delicious users much I do make the majority of my bookmarks public–so you can browse or search them too.

You can see my public bookmarks at http://www.delicious.com/frappucino.

Please share your experiences with social networking and suggestions for other useful services in the comments below. (I do use Facebook, by the way, but not for professional purposes.)

Is a Smartphone an Embedded System?

Thursday, January 27th, 2011 Michael Barr

When I wrote my first book about embedded programming, back in the late 1990′s, I carefully defined the term embedded system as follows:

An embedded system is a combination of computer hardware and software, and perhaps additional mechanical or other parts, designed to perform a dedicated function. In some cases, embedded systems are part of a larger system or product, as is the case of an anti-lock braking system in a car. Contrast with general-purpose computer.

I think this language still does a good job of capturing the difference between embedded and general-purpose computers. (In a sign of the times that is simultaneously uplifting and depressing to me, this exact language has been literally copied all over the Internet, mostly without any citation whatsoever.) But there have always been gray areas in the middle and the consumer electronics market is moving toward even greater blur.

Smartphones and tablet computers–like the Apple (Nasdaq:AAPL) iPhone and iPad, as well as the many Android-powered devices–clearly lie somewhere between embedded system and general purpose computer. Indeed, it has been helpful to me at times to think of Apple as a company that has profited by moving away from designing configurable and openable general purpose computers and toward designing more restricted and clearly physically closed embedded systems faster than its competitors.

So far this year, I’ve been finding time to play around with iPhone programming. (My first app has nothing to do with embedded systems, so won’t rate a mention in this blog even after it releases.) And I’m happy to report that in several ways the experience of writing iOS applications is similar to embedded programming. You program mostly in C (wrapped in a layer of Objective-C). And you must worry about writing code that uses the processor and memory efficiently. I feel right at home!

However, programming for iOS is also like programming for big general-purpose computers in that there are vast API libraries available to separate you from the hardware and low-level driver details. And there’s more memory and CPU available than in the vast majority of embedded systems.

Smartphones and tablet computers truly are at the crossroads between embedded systems and general purpose computers. If you are coming to them from the perspective of a firmware developer, you can think of them as merely very high end embedded systems. Or if you are coming from the world of general-purpose computing, you can think of them as resource-constrained computers reminiscent of an earlier era. Either way, you’re bound to find some things you like about these new programming platforms and others that you don’t.

P.S. I’ll have lots more to say about Objective-C in a later post.

Subscribing to this Blog’s Comments

Tuesday, November 16th, 2010 Michael Barr

I recently learned it’s possible to easily subscribe to all the comments posted on this blog. Given the quality of the comments that are posted here, I thought others may be interested too. The URL is feed://embeddedgurus.com/barr-code/comments/feed/.

Tools to Detect Software Copyright Infringement

Thursday, September 23rd, 2010 Michael Barr

An emerging class of tools makes it easy to automatically detect copying of copyrighted software source code, even if it came from one of the hundreds of thousands of open source packages.

I am presently providing litigation support in a case of alleged software copyright infringement.  In a nutshell, the plaintiff brought suit against the defendant for allegedly continuing to use plaintiff’s copyrighted software source code in defendant’s products after termination of a license agreement between the parties.  Fortunately, automated tools are making it easier than ever to quickly and inexpensively detect copying of software source code.

Some of the most powerful tools for doing direct comparisons between a pair of source code sets are from S.A.F.E. Their CodeMatch tool works by comparing each file of source code in the first set with every file of code in the second set.  Results are presented in a table that is sorted by the relative amount of matching code in the files.  And CodeMatch is clever enough to detect copying in which variable and function names and other details were subsequently changed; CodeMatch can even detect code that was copied from one programming language into another.  The only weakness of CodeMatch is that you have to have the source code for each product, which is not always possible early in litigation.

Other tools from S.A.F.E. provide additional help.  For example, BitMatch can compare a pair of executable binary programs or one party’s source code against another’s executable code.  It works by matching strings that appear in both programs.  Meanwhile, SourceDetective helps rule out that the two programs are only similar because they both borrowed from some third program—by automatically searching the Internet for hundreds or thousands of matching phrases.  CodeMatch, BitMatch, and SourceDetective are part of a suite of related tools called CodeSuite.  CodeSuite is a free download that runs on Microsoft Windows, with license keys sold based on the amount of code to be compared.

Of course, sometimes code may be copied from open source software.  Open source software is subject to so-called copyleft licenses, which are a special type of copyright that makes the source code open to the public.  Copyleft language is drafted to ensure that the source code for certain categories of derived work are also open to the public.  This creates problems for companies that wish to keep their source code private but also rely upon open source software.

Fortunately, there are also tools to detect the presence of part of all of an open source software package within a proprietary program.  I have used such tools from Black Duck Software and Protecode.  Both work similarly: each company maintains a database of hundreds of thousands of known open source packages against which the source code you provide is tested. Results are presented as a list of open source packages from which code may have been copied. This testing can be done entirely on a personal computer running Microsoft Windows, so that proprietary source code need not be sent outside a trusted network.  Both tools are generally licensed for an expected level of use on an annual basis.

Unfortunately, the precision of CodeMatch is lost in trying to cast such a broad net for potential copying.  The tools from BlackDuck and Protecode don’t actually compare your code against each and every of the millions of source code files in their database.  Instead, they reduce each file of your source code to a simpler representation of its structure and then compute a unique mathematical signature for that new file.  This signature is subsequently compared to a similar representation of the files in their database.  In plain English, this means that you get lots of false positives.  Some open source packages that weren’t actually copied usually turn up in the results list.

When searching for potential copying of open source code, I recommend searching the database from BlackDuck or Protecode first.  Then, to eliminate the false positives, a more thorough analysis should be performed by obtaining the listed open source packages and using CodeMatch to compare the proprietary code against them file-by-file.

With the help of tools like those mentioned here, it is possible to quickly ascertain whether source code copying has taken place.  Prior to the appearance of these tools, it was necessary for an expert in software development to manual perform dozens of searching and comparison steps.  This strategy can be used early in litigation with the benefit of dramatically reducing the cost of such analysis.  The same tools can also be employed proactively by companies seeking to reduce their risks of copyright infringement litigation.

Design for the Worst Case

Wednesday, August 11th, 2010 Michael Barr

In real-time systems, as in life, anything that can go wrong will! A nurse could be using a GUI task to change system parameters on a ventilator just as the attached patient’s lungs demand the most help from another task. Or an interrupt signal could start acting funny, generating a stream of unexpected ISR invocations. Or all of those at once. And something else.

The designers of hard real-time systems must design for such a worst-case. They must ensure that sufficient CPU and memory bandwidth are present to handle the worst-case demands that could be placed on the software—simultaneously. In simple terms, we must size the processor bandwidth to the worst-case scenario.

Safety for the users of our products emerges as a side effect of buying a faster (read “higher priced”) CPU. Rate Monotonic Analysis helps ensure we’ve specified the right processor clock rate, so the users are safe. RMA is also the optimal fixed-priority scheduling algorithm, which prevents us from over-paying for clock rate. If a set of tasks cannot be scheduled using RMA, it can’t be scheduled using any fixed-priority algorithm.

The basics of RMA are well covered in many places, including my article Introduction to Rate Monotonic Scheduling. In summary, Rate Monotonic Analysis gives us mathematics to prove all deadlines are always met when you’ve followed the Rate Monotonic Algorithm to assign priorities.

Rate Monotonic Algorithm is a procedure for assigning fixed priorities to tasks and ISRs to maximize their schedulability. A particular set of tasks and ISRs is considered schedulable if all deadlines will be met even in the worst-case scenario.  The algorithm is simple: “Assign the priority of each task and ISR according to its worst-case period, so that the shorter the period the higher the priority.” For example if Task 1 and Task 2 have periods of 50 ms and 100 ms, respectively, then Task 1 is given higher priority. This ensures that a long Task 2 job can’t prevent Task 1 from missing its more frequent deadline.

Too many of today’s real-time systems built with an RTOS are working by luck. Excess processing power may be masking design and analysis sins or the worst-case simply hasn’t happened—yet.  Bottom line: You’re playing with fire if you don’t use RMA to assign priorities to safety-critical tasks; it might be just a matter of time before your product’s users get burned.  Perhaps your failure to use RMA to prioritize tasks and prove they’ll meet deadlines explains one or more of those “glitches” your customers have been complaining about?