Embedded Software Development for Safety-Critical Systems

Chris Hobbs is a safety engineer who works on the QNX real-time operating system. I discovered him while reading QNX documentation and that led to reading his book Embedded Software Development for Safety-Critical Systems. This book is a practical introduction for software engineers who need to develop software that is compliant to functional safety standards such as IEC 61508 and ISO 26262.

I picked up the book precisely because these IEC/ISO standards are incredibly hard to digest. This book turned out to be truly a breath of fresh air. It cut through so much of the jargon used in the above standards giving simple and elegant meanings and illustrations for all of them. For example, normal English words like fault, error and failure have distinct and precise meanings in the safety world. And when reading and writing in this space one needs to be clearly aware of these meanings.

The author has loads of experience in the safety systems field and that helps when he gives his personal opinion of many of the recommendations and procedures set forth by these standards. There is a large section of the book given to fault analysis and formal verification which I am not sure how most software would undergo.

Minor quibbles aside, I found this book to be truly enlightening and only wished it was longer and covered more of the software development process for general and more complex software that cannot undergo formal verification. If you are looking to comply to standards such as IEC/ISO this book seems like a perfect no-nonsense introductory text.

Advertisements

Microsoft Outlook 2016 for Dummies

For most of my life, email was managed in either one of the free email providers (Yahoo and later Gmail) or POP/IMAP that I pulled into a simple email client. So, when I had to work with Microsoft Outlook recently, I was completely lost. Outlook when combined with Exchange is a powerful tool that handles email, calendars, meetings, tasks and notes for individuals and organizations. Quite frankly I was lost in the complex GUI of Outlook and all its features.

To get a quick idea of what is possible in Outlook and how to use it I turned to a familiar friend: Microsoft Outlook 2016 for Dummies. People like to ridicule the Dummies series of books, but Dan Gookin and his kind made software accessible to a lot of people like me. Dummies books, especially by veteran Dummies authors, are funny and fun to read. Bill Dyszel thankfully is no different, having been the author of all editions of the Outlook Dummies books.

This book covered all the important applications of Outlook 2016, only missing out on the notes feature. Earlier chapters cover the basics of using a email client, which can be skipped. Later chapters got into what I was looking for: Outlook specific features, scheduling, tasks and features related to Exchange. On the way I learnt a lot of tips and tricks which I probably would not have discovered otherwise. The only gripe I have about this book are that there are no cartoons by Rich Tennant. This is an easy and fun read full of screenshots.

Rating: 4
ISBN: 9781119076889

Some of the Outlook features I learnt from this book:

  • You can drag and drop anything to anywhere in the UI. For example, drag an email into the calendar icon at the bottom-right to create a calendar event.
  • Clean Up feature on email conversations and email folders can be used to move out emails that repeat in conversations to a specific folder. Reduces the number of emails you need to read.
  • Quick Steps are actions that you can create and add to the ribbon or right-click menu. For example, move to a certain folder is a builtin Quick Step.
  • Quick Parts can be used to reinsert repeatedly used text into emails.
  • You can create your own groups in contacts.
  • Appointments and events are different when it comes to calendars.
  • You can add holidays calendar for any country into your calendar.
  • Regenerating task is a type of task that recur after a task is completed.
  • Items of any tabular view of data can be grouped by one of the fields. Right-click on the column header and choose Group by.
  • Default categories in emails have colors and color names. These color names can be renamed to something more meaningful.
  • Merge to email can be used to create email mailers addressed to the receiver.
  • Scheduling assistant can be used to compare schedules of attendees. Suggested times at the bottom-right shows open timeslots.
  • When responding to a meeting request, you can propose a new time.
  • Voting feature is similar to meeting request, but to take count from a group of people.
  • Use Tracking to check responses from folks on meeting requests and votes.
  • You can assign task to someone else.
  • Out of office message can be set for your vacations with a start and end date. You can have different message for folks inside and outside your organization.
  • MailTips shows by colors and tooltips if any of the folks being addressed in email are on vacation.
  • Quick Access toobar can be customized by adding any function you want.

JIRA 7 Essentials

JIRA seems like a great issue management system. However, I found myself terribly inept when it came to using its features, especially because I was not familiar with agile software development practices. Wanting to get a quick introduction to JIRA I read JIRA 7 Essentials by Patrick Li. This short read is in its 4th edition and this latest edition covers the latest JIRA 7.x, which is also what I wanted to learn about.

The book is written for JIRA administrators, project managers and normal users. Administrators are the folks who install JIRA and configure it. Managers create projects and control the permissions for normal users. About half the chapters in the book covers topics for these two categories of users and I could conveniently skip those cause I am neither. The chapters for normal users covered everything I was hoping it would.

Chapter 2 covered the main project interface and it features. I found Chapter 3 on Agile Projects very useful since it showed how to use JIRA for both SCRUM and Kanban style of working. Chapter 4 was the most important one for me because it covered issues which are what you primarily work with in JIRA. Finally, Chapter 10 explained how to use both the simple and advanced JQL methods to search for issues and save and use them across JIRA.

I learnt a lot of useful things from this book that I would not have in daily usage of JIRA. For example, JIRA has keyboard shortcuts in the issue UI for the most common actions. I was also not aware of the share, export, vote and time log features in issues. I also learnt how to create SCRUM and Kanban boards for my epics and sprints. Also useful was the addition of gadgets to my dashboard. I found myself comfortable creating boards, saved search filters and with JIRA jargon in general. All in all, I got a satisfying bang-for-buck for the half day I spent leisurely reading through this book. If you are new to JIRA, I highly recommend getting a book like this one to learn how to use it effectively. In case you have access to O’Reilly Safari, this book can be accessed there.

Introducing Go

I had to work with some Go code recently and some of its networking code literally looked like Greek to me! In an attempt to get a rudimentary understanding of this language I chose Introducing Go by Caleb Doxsey. Go was introduced by Google with a big splash a few years ago in 2009. It had the name of computer science legends Rob Pike and Ken Thompson behind it. I had taken one cursory look at the language back then and since it had no traits of a systems programming language I had not bothered.

I must admit there was a certain pure joy as I learnt the syntax, keywords and design of Go now. There is an all-pervading simplicity to the language and its tools. (I am looking at you C++ and Rust.) It has all the hallmarks of being in the same lineage as C and Unix. This is not surprising considering the past achievements of its creators. Kudos to them for not getting distracted by the bloat of today’s languages. It can be seen that every design decision has been taken in keeping the language as simple, light and easy as possible. In the verbose age of modern C++, it was refreshing to note how ridiculously short the keywords in this language are. This language though is clearly meant for networking, communication and concurrency. I doubt some of these can be achieved in any other language with code that is this readable and yet short and performant. However, it is also clear how Go is woefully inadequate for other applications like systems programs and scientific computing.

This book of a 100-odd pages was really easy to read and follow. I do not think it can be used by someone with no programming knowledge. My opinion is from the viewpoint of someone who is familiar with C-like languages. I think it can be read and understood in a few hours. That is mostly because the Go language is so well designed. This book is a rewrite of the author’s first book An Introduction to Programming in Go. That was one of the first books on Go and came with an unforgettably cute cover! How I wish O’Reilly had retained that original cover art for this book!

Python for the Busy Java Developer

20150118-pybook

I use Python once in a while to get some simple work done, like read, write, process or plot some data. I inevitably end up Googling or looking up analogues to C++ constructs on StackOverflow to get the job done. On one such recent stint, I found it useful to refer to the book Python for the Busy Java Developer as I worked on object-orientifying a piece of Python code. On tweeting this, my friend Deepak Sarda, who is also the author of that book offered me a copy of the book for review.

Python for the Busy Java Developer is a short book that enables folks familiar with Java to get started on reading and writing Python with ease. If you already have experience working with other object-oriented languages with a C-like syntax (like C# or C++), this might also be the right book for you. Following a short introduction, the meat of the book is essentially Chapter 2, which is pretty long and takes the reader on a trip through the syntax, lists, functions and classes. Chapter 3 lists the tools and libraries that any seasoned developer would be looking out for while writing code.

There is a big difference between Googling a problem and learning from an experienced person. It is just that kind of insight that I found at many places in this book. By just looking for analogues to C++, I had never realized of the alternate or extra possibilities for certain language constructs. As an example, it never occurred to me that attributes or methods of a class could be deleted outside the class. This is of course in the very nature of a dynamic language like Python, but the thought never occurs to a person coming from a statically typed language.

Though I’ve been writing short Python scripts for a few years, from this book I found myself learning many tiny details that are sure to help me write code that is more Pythonic. My familiarity is with C++, but I found the analogies to Java in the book quite straightforward to relate to. The concepts are introduced in a natural order and the book can be easily finished in a couple of hours. Places where Python might behave differently or in ways that is better than you except are pointed out. The book is beautifully typeset, which is a quality that seems to be sorely missing in tech books today. A book of this length has to leave out a lot and that is possibly the biggest downside of the book. I was left wanting to learn more of the Python analogues to the other C++ constructs I’m aware of.

I can easily recommend Python for the Busy Java Developer as a quick guide to learn Python if you are coming from C++. You can buy it here for the price of a cup of coffee. But wait! Deepak is offering the readers of this blog a 10% discount, just use this link to buy the book. 🙂

Document classes for book in LaTeX

Here are some of the document classes that can be used to create a book using LaTeX:

Book

The default class. Looks dated and ugly.

documentclass{book}

Memoir

Looks modern. Better than the default book.

documentclass{memoir}

AMSBook

Looks good, but can only be used for math books. This is because all headings are centered (not left-aligned) and all text is center-justified too.

documentclass{amsbook}

ScrBook

This is from the European designed KOMA package which looks modern and the fonts are nice. While their article class is nice, I did not like the book class that much.

documentclass{scrbook}

Tufte-LaTeX

Using this gave me compilation errors which I could not resolve. Thats a pity because this style looks almost like the books from Tufte.

Bookest

Beautiful book class and my favorite.

documentclass{bookest}

Octavo

Produces beautiful pocket books.

documentclass{octavo}

Caesar

Another nice looking book class.

documentclass{caesar_book}

Instant GLEW

Instant GLEW
Instant GLEW

I have written a small book titled Instant GLEW about deploying OpenGL extensions in graphics programs by using the GLEW library. The book is published by PacktPub and is available from 26 July 2013. It is available in both print and ebook formats. The book is available at PacktPubAmazon, Safari, Kobo and AbeBooks. You can rate and review it at Goodreads. Get this book if you are taking your first steps with using OpenGL extensions in your programs.

GLEW is a pretty simple library to use, but students who are studying computer graphics for the first time have a hard time using OpenGL and OpenGL extensions. This problem is all the more exacerbated by the archaic versions of OpenGL that ship with the various versions of Windows. Programmers are forced to use OpenGL extensions for features that are considered basic and essential in graphics programs. This is the problem that GLEW attacks successfully.

In the book, I explain how to install the GLEW library on Windows and customize your Visual Studio solution to use it for compiling and linking your programs. I illustrate the usage of GLEW by using it to apply vertex and fragment shader programs on a teapot in 3D. Using shaders in an OpenGL program is probably the most popular use of OpenGL extensions and that is the reason I picked this example. You do not need to know GLSL or shader programming to understand this example.

In later sections of the book, I explain the other useful APIs of GLEW which help you write clean and portable programs that can fallback on older rendering techniques when advanced methods are not available. I also introduce a few useful utilities that make using OpenGL extensions informative and fun. Finally, there might be times when you need to access a bleeding-edge OpenGL extension that is not yet supported in GLEW. I show how to use such a new extension in your programs. It can get messy, but I show you how to get it done.

All said, this tiny book should be useful to students and programmers to quickly start using GLEW in their programs. If you find yourself using OpenGL extensions, do try Instant GLEW! 🙂

Compares of Bottom-up Mergesort

It is fun to spot a mistake in a technical book. (Knuth has made it cool by sending out cheques to the error spotters.) Recently, I found a mistake while looking through the chapter on mergesort in Algorithms (4th Edition) by Robert Sedgewick and Kevin Wayne.

There is a proposition in the chapter which states that:

bottom-up mergesort uses between 0.5 N lg N and N lg N compares and 6 N lg N array accesses to sort an array of N items.

There is a small error in the proof. It states that:

the number of passes through the array is precisely floor( lg N ) which is precisely the value of n such that 2^n <= N < 2^n+1

This is wrong when N is not a power of 2. For example, if N is 7, then the array cannot be sorted in 2 passes, it needs at least 3, which is ceil( lg N ).

So, the correct statement in the proof should be:

the number of passes through the array is precisely ceil( lg N ) which is precisely the value of n such that 2^n-1 < N <= 2^n

I contacted the authors about this and was surprised when co-author Kevin Wayne promptly replied back confirming the error. He even added the correction to the errata webpage of their book 🙂