Code Review (pt-br)

A revisão de código é uma prática fundamental no desenvolvimento de software que contribui para a detecção precoce de erros, melhoria da qualidade do código, aprendizado e desenvolvimento dos membros da equipe, colaboração e trabalho em equipe. Além disso, a revisão de código pode ajudar a identificar problemas de desempenho e segurança. Estabelecer um processo formal de revisão pode ajudar a garantir que a revisão de código seja realizada de maneira consistente e eficaz.

April 25, 2023

double para string

Em C++, você pode converter um double em uma string usando a função sprintf. Ela formata uma série de valores o resultado em um array de caracteres. #include <cstdio>#include <iostream> int main() { double value = 3.14159265; char buffer[100]; int decimalPlaces = 2; sprintf(buffer, "%.*f", decimalPlaces, value); std::string result(buffer); std::cout << result << std::endl; return 0; } Neste exemplo, decimalPlaces é o número de casas decimais que você deseja exibir. O .

February 13, 2023

Why using a wrapper container might be a dangerous idea

The ZMap case I worked in a company that has the policy of not using any library container directly. So we need to create wrappers for any containers, even for STD containers. And after working there for some years, I believe that this was a big mistake. Forget to implement it. Some months ago, I found a bug in the class equality comparative.

January 7, 2023

Crashfix Maintenance Cleanup

For my work with Crashfix, I have a little VM, but after running for some time, the disk is full. And I need to fix that without flushing the database. For that, I use the commands below. Check the disk size $ df -h … /dev/nvme0n1p1 500G 404G 76G 85% / … Clean monitor log cd /var/log/crashfix$ sudo du -hc –max-depth=0 .

January 7, 2023

Convert Qt Project to CMake

Convert an old Qt projet do CMake Install base packages pip install virtualenv python -m virtualenv -p python3 convert virtualenv -p python3 convert .\convert\Scripts\activate.bat qmake2cmake Using the Qt tool qmake2cmake to convert the project to CMake python -m pip install qmake2cmake qmake2cmake_all . –min-qt-version 6.4 Build the project mkdir build cd build cmake -G "Visual Studio 17 2022" -A x64 .

November 5, 2022