• Uncategorized

    How to switch “\” with “<" keys in linux

    When using the Apple Magic Keyboard with linux and certain keyboard layout, some key may be exchanged with some other key. In my case, I have an Italian Magic Keyboard and a Ubuntu 20.10 running on VmWare Fusion and the “\” and “<” keys are switched. The fix is pretty easy, but not easy to find on the net. This is the recipe: you need to force xmodmap to exchange the two keystrokes. It can be done in the terminal with the following two lines: xmodmap -e "keycode 49 = less greater guillemotleft \ guillemotright guillemotleft guillemotright" xmodmap -e "keycode 94 = backslash bar notsign brokenbar \ notsign brokenbar" This…

  • Uncategorized

    Blockchains, istruzioni per l’uso

    Il seguente articolo è stato pubblicato nel numero 1/2-2019 del Notiziario dell’Ordine degli Ingegneri della Provincia di Verona.Viene pubblicato qui grazie alla gentile concessione della Redazione. Come funzionano le criptovalute, l’e-voting e le altre applicazioni di un sistema informatico ancora poco conosciuto Negli ultimi tempi non trascorre giorno senza che un articolo, un programma televisivo o un comizio citi le “blockchain” come soluzione ultima di un qualche problema tecnico od organizzativo. Tali promesse in realtà fanno sollevare più di qualche sopracciglio nel settore degli esperti di questa tecnologia. Pare quasi che la blockchain sia una cosiddetta oracle machine che genera verità e certezze indipendentemente dal suo uso e dai suoi…

  • Uncategorized

    A C++ Smart Pointer wrapper for use with JNI

    Introduction In this article, I'll propose a solution for managing native C++ resources from JNI using smart pointers. While Smart Pointers can't be useful from Java, because of the limits of the Java memory management, it may be required by the native library to maintain allocated resources through shared_ptr or unique_ptr, for example because classes derive from std::enable_from_this. Since there is a fixed pattern to maintain native objects in Java classes, a utility C++ class is proposed. The problem of memory management when integrating Java and C++ code Recently, I had to port a library I wrote for Linux to Android. For instance, the library is aimed at implementing an…

  • c++,  Code,  Linux,  Uncategorized

    The dbus-cpp Library, introduction

    While working on a bluetooth based embedded device, I needed to deal with the somehow infamous dbus. DBus and Bluez5 have a very steep learning curve, and if you are don't have access to either Qt framework or glib framework, you have indeed a problem. Glib are very complex C libraries that mimick some of the built-in feature of the C++ language, while on the other hand, Qt are very vast and sometime a big overkill. The stunning news is that it seems there aren't many options if you need a C++ only lightweight solution. It is not true, indeed. Somehow well hidden in the creases of the web, I…

  • Uncategorized

    Tech blog

    Welcome to my tech blog. Here you’ll enjoy articles about all the fields related to my work, especially Linux, Embedded systems, Programming, Software and Hardware design and Engineering. All posts will be, hopefully, in English, some will be in Italian when the argument will suggest that only Italian people will have interest on that. Sorry guys 😉 If something isn’t clear, or if you feel that some should be corrected, please write me a comment. Comments are welcome, but due to spamming issues, they will be moderated.