Remove Android system applications

Normally it is not possible to delete some system apps that came pre-installed on your Android phone. Some can be turned off so that they won’t start and show on the list of apps on your phone. Open your phone’s Settings app. Select Apps & notifications. Select the app you want to disable. Select Disable. Unfortunately, some preinstalled applications (for example Facebook on some phones, and mostly branding application of your phone or sim provider) cannot even be turned off even if they are non-essential for the phone to work.

Read more →

Immutable virtual machines with virtualbox

From time to time I need to use some Windows-only program. And from time to time, those programs are also relatively old. Normally I would first try the application under WINE. If it does not work, last time I even tried the newest version of ReactOS. The last and normally infallible approach is starting a virtual machine with Windows. It always feels like an abuse of resources.

Read more →

Custom static analysis with Cppcheck

A simple use case While working on some code, I noticed a disturbing pattern: std::endl followed by std::flush. For those that do not know it, std::endl flushes the buffer, so doing std::flush does not make any sense, unless you want to pessimize your program. As the newline character normally already flushes the buffer (unless something like tie and/or sync_with_stdio has been used), it would thus make even more sense to almost always replace std::endl with '\n'.

Read more →

Test failures in C++

When designing a library, or more generically an interface, we need to decide what are valid and invalid parameters. In compiled languages, it is possible to take advantage of the compiler to do some checks at compile-time, while others need to be done at runtime. For example, consider a function that generates the fibonacci sequence: int fibonacci(int); How should the code react if the input is not an integer, for example:

Read more →

tracing with gcc

Tracing in C and C++ Tracing function calls is a general technique for debugging applications (and collecting information). When something does not work as expected, the first useful information is to know where the error happened, what’s the status of the program, and so on. Unfortunately, the most technique I’ve seen boil down to editing the called (or supposedly called) functions and add a printf call, hidden behind a macro that would add other information like function name and line number.

Read more →

fmove

What is move semantic C++11 introduced move semantic. In short, move semantics permits to make further optimization for avoiding copying data. Not only the compiler can do such optimization, but the developer itself can also hint the compiler where variables are not used anymore, and so a copy of it could be avoided. The canonical example is std::vector<std::string> create() { std::vector<std::string> collection; // since empty, suppose no allocations collection.

Read more →