Monday, August 29, 2022
Many forks on github projects
When a project is not updated very often or goes by for years with no official updates, forks can proliferate. Then people who arrive at the site may want to know which forks are active. Luckily, there is a github project for solving this problem! It is called ActiveForks. If you go to https://techgaun.github.io/active-forks/index.html you can enter the name of the github project and you will get a table of results, with the ability to sort on any of the presented columns.
Monday, August 01, 2022
Windows and directories that cannot be (easily) deleted
If a directory contains nodes whose full pathname is greater than around 255 characters then Windows has tremendous difficulty deleting such a directory. But luckily, there is an easy way out. The 7-Zip command comes with an additional executable, 7zFM.exe which is the 7-ZIP File Manager. I recommend you put an icon for this on your desktop. It works a bit like a file explorer with one significant difference. If you click on a directory and enter shift-delete then it will delete that directory even if other commands fail due to the 255 problem.
Sunday, March 27, 2022
Function parameters that are fundamental types passed by value and const
The rule is to not do this in the header file.
Some people say don't do it in the cpp file either (I am in that camp)
but this does seem to be a matter of opinion.
See the abseil article https://abseil.io/tips/109 for a discussion.
[[Addition: April 2025]]
I went to ACCU 2025 where there were talks on contract assertions, a feature that has a bearing on this area. As of April 2025 contract assertions do not distinguish between function parameter values on entry and any modified value on exit. So there is no way make clear if a post condition variable refers to its value before or after. In other languages such as Eiffel, which have DbC built into the language, there are ways. Apparantly, this will be dealt with in C++, maybe by C++26. But in the meantime when one passes a fundamental type by value and does not use const in the cpp file, the value can be altered during function execution, since C++ is a pass by copy language. With such modifications it is possible for a post condition to inadvertently test a modified value. The standards committee are aware of this issue and suggest a remedy that I don't like at all. They say one should decorate such parameters with const. Since preconditions and postconditions are expressed on the function signature this means putting the const there. For symmetry I suppose they would also say that they must also be in the cpp file. I really don't like this, so my position of function parameters that are fundamental types passed by value stands. I will just have to wait for c++26.Windows, X11, cygwin, fonts and Xming
For years I used the X11 server that is part of cygwin. It seemed to be a bit flakey but there didn't seem to be anything better.
Every now and then I would run into a problem where it would seem to work but xterm would complain about missing fonts.
So, I downloaded and installed xming-fonts (from https://sourceforge.net/projects/xming/files/Xming-fonts/7.7.0.10/Xming-fonts-7-7-0-10-setup.exe/download) on my local node (not the node that was running xterm) and that fixed the error. These days I no longer use the cygwin X11. I use XMing: see http://www.straightrunning.com/XmingNotes.
Subscribe to:
Posts (Atom)