Skip to content

Blog

Book Review: “It Doesn’t Have to Be Crazy at Work” by Jason Fried and David Heinemeier Hansson

My favourite business book of 2018 is It Doesn’t Have to Be Crazy at Work by Jason Fried and David Heinemeier Hansson. The reason why people work crazy hours is not that there is

[…] more work to be done all of a sudden. The problem is that there’s hardly any uninterrupted, dedicated time to do it. People are working more but getting less done. It doesn’t add up – until you account for the majority of time being wasted on things that don’t matter.

The authors call out working crazy hours for not being “a badge of honor” but “a mark of stupidity”. Yes, it’s good to hear this from people who know what they are talking about. Jason is the CEO and David the CTO of Basecamp, which they have been running very successfully since 2003. They describe in the book how – at Basecamp – they replaced crazy at work with calm at work.

Read More »Book Review: “It Doesn’t Have to Be Crazy at Work” by Jason Fried and David Heinemeier Hansson

High-Speed-Data (HSD) Connectors in Heavy-Duty Vehicles

In a recent blog post, I suggested to replace multiple display computers in a driver cabin by one computer in a silver box with multiple displays. I didn’t specify which connectors and cables to use between computer and displays. I found the answer at Electronica 2018 last week: High-Speed-Data or HSD connectors. You can use HSD connectors for LVDS (including Display Port), APIX, CAN, USB 2.0, USB 3.0, Ethernet and Firewire.
Read More »High-Speed-Data (HSD) Connectors in Heavy-Duty Vehicles

Seminar “Open-Source Management in Software Supply Chains”

On 20 November 2018, the law firm Bird & Bird hosted a seminar about “Open-Source Management in Software Supply Chains – Effective and Consistent License Compliance” in their Frankfurt office. The seminar was organised by Miriam Ballhausen, who is Bird & Bird’s specialist in open-source Licensing.

The seminar offered the opportunity to meet two of Germany’s top lawyers for FOSS license compliance: Miriam Ballhausen and Catharina Maracke. If you have any questions about how to comply with FOSS licenses, Miriam and Catharina will give you invaluable counsel.

The roughly 25 attendees hailed from very different industries: automotive, agricultural, financial, medical, manufacturing and IT services. In late 2018, you cannot escape FOSS: Free open-source software has arrived in the mainstream.

Now, let me give you a summary of the four talks.
Read More »Seminar “Open-Source Management in Software Supply Chains”

Tremendous Speed-Up with SQL Transactions

The function CustomerDatabase::importCustomers reads 500 customers from the list c_customers, creates an SQL query cmd for each customer and inserts each customer into the Customers table of the SQL database db.

void CustomerDatabase::importCustomers() {
    auto db = QSqlDatabase::database("CustomerDB");
    for (auto row : c_customers) {
        auto cmd = QString{"INSERT INTO Customers "
                   "(fullName, street, postalCode, city, phone, email) "
                   "VALUES (\'%1\')"}.arg(row.join("\', \'"));
        auto query = QSqlQuery{cmd, db};
    }
}

On an NXP i.MX6 SoC with four Cortex-A9 cores, this function takes 17.5 seconds! Your user would have to wait more than 17.5 seconds for the import of a CSV file with 500 customers to finish. This is unacceptable. How can you speed up the import to 0.2 seconds?
Read More »Tremendous Speed-Up with SQL Transactions

What’s Wrong with Multiple Display Computers in Driver Cabins?

Three cabins with 2-4 display computers each.

Figure 1. Top left: Claas cabin with three terminals. Top right: Agco cabin with two terminals. Bottom: Continental concept cabin with four terminals.

The top row shows the status quo. Two or three display computers (a.k.a. terminals) are normal. Even four display computers are not unusual. The bottom row shows the cabin of the future with four display computers. The display computers at the left and right beam show the videos from the wing mirror cameras. The display computer in the middle is the instrument cluster. The small display computer on the right-hand side shows additional information. It would be bigger in a harvester.

Let us assume for simplicity that the cabin is equipped with two display computers, which have identical hardware and nearly identical software – except for the main application. When sourced from low-volume, high-customisation electronics manufacturing services (LVHC-EMS), the two display computers, the telematics unit and a switch will cost roughly 2750 Euros for 200 machines.

We will bring down the costs to 2350 Euros, if we replace the two display computers by one computer with two displays. The computer doesn’t have a display and the displays don’t have a computer inside. The telematics unit is folded into an M.2 or PCIe card, which is plugged into a slot of the computer.

We will reduce the costs by another 200 Euros to 2150 Euros, if we source the components from a value-added reseller (VAR) instead of an LVHC-EMS. VARs buy standard components from high-volume low-customisation EMSs (HVLC-EMS). They charge lower prices because of the higher volumes, but they allow only minimal customisations.

For 200 machines, the solution with one computer and two displays saves us 80,000 Euros and 120,000 Euros per year, respectively, when sourced from an LVHC-EMS and from a VAR. We save even more, if we replace more display computers by one computer with displays and if the display computers are more expensive like ISOBUS terminals. We do not only save costs on hardware but also on software, because we consolidate multiple diverse systems into one system.

A clever change of the system architecture leads to sizeable cost savings. It also leads to a system that can easily be extended in many directions – a competitive advantage.

Read More »What’s Wrong with Multiple Display Computers in Driver Cabins?

Emitting Signals during Construction or Destruction

In the beginning, the application shows the Main Screen. When the user clicks on the Open button, the application will show a second screen. The second screen creates a C++ model when opened and destroys this model when closed.

As zealous Qt developers, we use the pimpl idiom to hide private declarations from its clients. Hence, we move the write and read functions of Qt properties to the implementation class in the source file. When the value of the property changes, the write function emits a signal of the interface class.

When the signal emission occurs during the construction or destruction of the interface class, we end up in the land of undefined behaviour. At the point of the signal emission, the interface object does not exist yet or does not exist any more. A real-life application will most likely crash – right a way if we are lucky or much later if Old Murphy has his way.
Read More »Emitting Signals during Construction or Destruction

QML Engine Deletes C++ Objects Still In Use

Correction: In the original post, I stated that ownership is transferred from C++ to QML by READ functions of Q_PROPERTYs. This is wrong. Ownership is only transferred by Q_INVOKABLE functions and slots, which return a QObject pointer. I corrected my post and my code example. Now, the simple code example crashes as desired. Many thanks to Richard and Simon for pointing out my mistake.

I recently spent three days on a customer project to figure out why my QML application crashed with a segmentation fault. The crash happened after a long sequence of interactions, which was hard to reproduce. I finally managed to reproduce the crash reliably after going through the same six-step interaction four times.

After many hours of debugging and scrutinising my code, I had an epiphany about the stack trace leading to the crash. The stack trace originated from deep inside the QML engine and ended in calling the destructor of a C++ object, which was still in use on the C++ side. The trace never touched any of the application’s C++ code in between.

So far, I had only asked myself the question: Where in my C++ code do I corrupt the memory? After my little epiphany, I changed my question: Why does the QML engine delete a C++ object still in use? What do I overlook in the interaction between QML and C++?
Read More »QML Engine Deletes C++ Objects Still In Use