Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Posts by aura-lsprog-86
I asked this in SE years ago. I'm aware of two methods in order to access all the pixels in a QImage called img. Method 1 for (int y = 0; y < img.height(); y++) { QRgb *line = (QRgb *)...
(Brought over from SE.) The following code implements a simple interface to operate on mutable* Strings in C. It is composed of two files: one for the structure definition and the available oper...
(Brought over from SE.) This is a Bash script that copies files stored inside disk images to a directory, using a defined structure provided via a JSON file. I've included the external programs ...
This question was originally asked in SE. I have a program that draws lines using line drawing algorithms. I use gcc 5.2.1 on Xubuntu 15.10 to compile it. Executing it throws a "Segment violati...
I answered myself as it can be found here. Silly me! The root of the entire problem was the type used in both point.x and point.y: typedef unsigned int uint; typedef struct { uint x; ...
(Brought over from SE.) The problem I have followed this procedure in order to run Java applications as root when needed from Eclipse (as I use Xubuntu, for instance, when using jnetpcap to cap...
I've finally managed to get it working without using a wrapper for java. It has to do with filesystem capabilities in Linux. To let java list and select network interfaces, as well as analyse and ...
(User JS1 answered as follows; source.) Unsafe loop This loop in string_find() is unsafe since it could read past the end of your buffer: while (str->data[pos] != c) ++pos; You shoul...
(Brought over from SE) The problem I'm coding a Java Swing application dealing with XML files, so I'm using JAXB in order to marshal classes into documents and unmarshal the other way around. ...
I asked this question a while ago over SE. When I use a for loop with a uint64_t as a counter, it gets stuck forever, even though the condition seems to be well defined. Offending MCVE #includ...
The following answer was given by SE user Edward. The original source can be found here. The other answer gave some really good advice; this is intended as a complementary answer with still more...
I received this answer in SE. Sadly, the user who wrote the answer is no longer in the site. Don't use threads and synchronization primitives (semaphores, shared memory, etc) for this. In fact, ...
I asked this question in SE a while back. TL;DR I need to emulate a timer in C that allows concurrent writes and reads, whilst preserving constant decrements at 60 Hz (not exactly, but approxima...
SE user DU Jiaen provided the following answer, edited by Martin Zabel and found here. The expression i >= 0 is always true if i is of an unsigned integer type. The alternative and simple way...
SE user M Oehm provided with the following answer, as it can be found here. The condition i >= 0 is always true if i is an unsigned type. Decrementing an unsigned zero will not produce a nega...
The following answer was given by SE user Oh My Goodness. The original source can be found here. Instead of cat "$x" | command or echo "$x" | command, use command <$x (vs cat) or command ...
I've found a way to set the private field without exposing it or giving it a setter: Reflection. Using external event listeners, I can get ahold of the File object. Then, inside the beforeUnmarsha...