Programming Leftovers
-
C/C++ Debugging Tools - KDAB
The first thing you need to do is make sure your code is properly tested. This, in itself, is not debugging, but it enables you to make sure that you don’t introduce three new bugs when you fix one. One of the ideas that you can use for this is called Test-Driven-Development, which means writing the tests before you write the code that it will test. This way, you can make sure the test is testing the right thing. If the test fails, you fix it, and then it passes. It’s a very good idea to add full unit test coverage for classes you’re going to rewrite or refactor, so that you don’t introduce regressions compared to the old code. To do this, you can use one of the existing unit test frameworks. As a Qt developer, I know especially QTestLib. But you can also use Google Test or Catch and there are actually many others. The goals of those is to save you time because you don’t have to set up everything so you can write a test, make sure that all the test methods are called, how to handle failures, and all of that.
One step further is to integrate these tests with your continuous integration so that, after every commit or every night, you get a full build from scratch and a full run of all of the unit tests. All of this improves the quality of your application and is very necessary for the actual debugging that we are going to talk about because you’ll make sure you don’t introduce regressions when actually fixing a bug.
-
Qt Creator 8.0.2 released
We are happy to announce the release of Qt Creator 8.0.2!
Qt Creator 8.0.2 fixes various smaller issues. Please take a look at the change log for details.
We now build the Qt Creator packages using Qt 6.3.2, which fixes a crash related to closing drop down menus on macOS.
-
Programming as play
But I'm not the only person that has pushed for programming just for fun: [...]
-
Cut the Technobabble
The marketing for Functional Programming is made of technobabble. Technobabble was used in Star Trek. Those long discussions are what Star Trek was loved for, but technobabble isn't good for sharing knowledge or advancing our field.
-
Logic to remove duplicate user-installed package
The current release of EasyOS does not have the 'samba' package, so the user may have installed the samba PET from the package manager.
The next release of EasyOS will have samba builtin, in 'easy.sfs', so the user-installed package has become redundant.
Ditto with 'html-notepad', that will be builtin in the next release.
-
How to Debug a Bash Shell Script in Linux
In most of the programming languages, debugger tool is available for debugging. A debugger is a tool that can run a program or script that enables you to examine the internals of the script or program as it runs.
In this post, we will learn how to debug a bash shell script line by line in linux. In the shell scripting we do not have any debugger tool but with the help of bash command line options like -n, -v and -x we can do the debugging.
-
Check if a Variable Contains a Number in Bash - TecAdmin
A number is a combination of 0-9 digits—the Bash variables stores all value in the form of strings. Even if the stored value is in string format, we can perform all the arithmetical operations if the stored value is a valid number. As a best practice, we should verify the values of variables before performing the arithmetic operations.
A number can be an integer number, a floating point number, or a positive/negative number that prefixes with a “+ and -” symbol. In this tutorial, we have discussed a few methods to verify that the variable contains only digits, integers, and double or float values, not alphabets.