Mocking time and testing event loops in Go

Initially I wanted to write articles on those two topics separately (mocking time and testing event loops), but during the process I realized that the things I want to talk about are too interrelated: when I need to mock time, it's usually to test some event loop with it, and when I test event loops, typically mocked time is also involved in that.

So in the end, it felt better to just combine all that in a single article.

2021/09/30 09:15 · dfrank

Reliable, Secure and Universal Backup for U2F Token

I really love the security level U2F provides, but together with security, we have to think carefully about the backup and recovery plan. It would totally suck to get locked out of my accounts if something happens with my U2F token. At the same time, it doesn't make sense to have a backup which compromises U2F security.

→

2018/08/15 09:54 · dfrank

Why not improve error handling in our Go projects?

As I was saying already, I love Go, I really do. And in particular I like the minimalistic approach to error handling: no exceptions, each caller should check the error explicitly and deal with it as it wants.

2018/03/02 10:14 · dfrank

Here's why I love Go

Many years ago, I've been waiting for a language like Go. Back then, I was primarily working with C (for microcontrollers), and C++/Java/Python/etc (for bigger machines). These are great tools, but still I was longing for compiled, statically typed, memory-safe (and garbage collected) language, which compiles for the target platform machine code, and has a big enough community.

2018/03/02 10:12 · dfrank

I'm Tired of Makefiles

At Cesanta, we use Makefiles to build our firmwares, libraries, and perform other things. But the more I use make, the less I like it. I want my incremental builds to be reliable, and I want to be able to reuse my Makefiles as needed. make can't provide that, and builds just kinda-sorta work most of the time.

Most annoying issues are:

→

2016/12/11 17:33 · dfrank · 23 Comments

Docker Printable Quick Reference Card

I use Docker, but not often enough to memorize even basic Dockerfile instructions and CLI commands. After all I got so annoyed by being unable to quickly sketch some Dockerfile or to do something with the existing containers occasionally, so I decided to write a concise cheat sheet which I can print once and constantly keep on my desktop:

2016/08/01 12:59 · dfrank

Heap on Embedded Devices Analysis and Improvement

The heap on a device is usually a kind of black box: heap API rarely provides anything more than just returning free space size, and quite often it doesn't provide even that (since C standard doesn't oblige it to). We have little idea of the fragmentation (in particular, we're interested in longest contiguous free chunk of memory) and the behaviour of the allocator in general. But in the resource-limited circumstances we're highly concerned about being memory efficient, right?

Read more

2016/01/26 21:16 · dfrank

Standard interface between a text editor and an IDE?

You may probably consider this a rant post.

→

2015/10/09 17:56 · dfrank · 8 Comments

Microchip PICkit3, Don't Halloo Till You Are Out of the Wood

Microchip has a tool called MDB: Microchip command-line debugger. It's a very nice idea: we can automatize things; at least, we can program a hex from a script. Implementation, however, is far from perfect, but, well, it works somehow.

→

2015/10/07 00:05 · dfrank · 2 Comments

Unit-testing (embedded) C applications with Ceedling

Just like a lot of other embedded software engineers, I used to ship my embedded applications to production without testing them properly. Only some manual tests were done. I was under the impression that there's no real way to test them: you know, embedded applications run in a custom hardware and interact with this specific hardware heavily, which makes them not so easy to test automatically.

But the more I worked in this field, the more I thought that there should be some way to make my applications more reliable. Of course, I strive to develop right application design and write good implementation, but mistakes (sometimes very silly ones) happen. And one day, I've come across the awesome book: Test Driven Development for Embedded C by James W. Grenning. It is a very good book, and it explains the topic very thoroughly; highly recommended.

Although this article is based heavily on what I've learned from this book, it is not just a very short version of it: while trying to put my knowledge to practice, I found some new tools that simplify the process even more. I hope that the article will help you to start quickly.

Read more

2015/10/05 15:12 · dfrank

How I ended up writing new real-time kernel

I work with embedded stuff for several years: our company develops and manufactures car trip computers, battery chargers, and other car-related electronic devices.

The processors used for our designs are primarily 16- and 32-bit Microchip MCUs, with RAM from 8 to 32 KB, and ROM from 128 to 512 KB, without any kind of MMU. Sometimes, there are even more modest 8-bit chips.

read more

2015/09/20 22:02 · dfrank

Testing with authentication by Passport.socketio

The usage of real-time socket connection with authentication data seems quite regular thing to me. And, personally, I find it very strange that this topic receives so little interest.

2015/09/17 01:29 · dfrank · 0 Comments

How do JavaScript closures work under the hood

From my experience, a lot of JavaScript programmers, mine included, learned how to use closures without having clear understanding of how closures actually work, and what exactly is going on behind the scenes when we use them. What the closure actually is, to begin with? When it is created and deleted? What the implementation should look like?

So, I've written an article How do JavaScript closures work under the hood which explains the subject in a very intuitive way, with clear diagrams and examples.

2015/09/09 07:45 · dfrank · 0 Comments

Qt Creator in VirtualBox with Windows guest OS

I needed to develop an utility application in Qt, which should work in Windows. I use Linux, and this is no problem since Qt is crossplatform, but anyway, to make sure resulting application works in Windows as intended, I've installed Qt in Windows guest OS in VirtualBox.

Surprisingly, at the time of writing this, there were two issues running Qt Creator in Windows guest OS.

→

2015/07/16 10:28 · dfrank · 0 Comments

Usage of Ragel in Qt project

Recently I had an opportunity to work with Ragel State Machine Compiler in my Qt project (There was a requirement to parse binary protocol), and the question was, how to integrate Ragel source files in the project conveniently. After all, I've read about qmake's QMAKE_EXTRA_COMPILERS facility, which does the job very well.

→

2015/07/16 08:24 · dfrank · 0 Comments
blog.txt · Last modified: 2015/07/16 11:02 by dfrank
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0