Hot answers tagged

6

Is it common to include a specific build of a library/ tool for production level project? I would say it is at least not totally uncommon, and it depends on how you define "production level". But if you try to achieve 100% reproducible builds which don't break when third-party dependencies change in unpredictable ways, you have to version all artifacts and ...


4

how did they debug this stuff Same as today. You divide the code into trusted and untrusted and pick apart the untrusted until you trust it. How did others in the past do this when the tooling wasn't available? Tooling has always been available. It's just different tooling. Here's a blast from the past. Note the highlighted "single step" control. ...


4

This is pretty simple (at least conceptually), all that you need is mmap() a file and then just write your own malloc() or override the new operator so that they allocate memory from the mmap-ed region. But do note that this will still use RAM, all that this really does is move your memory usage from process virtual memory to filesystem cache memory. There ...


4

It sounds like you are looking for a data-serialization format that is human-readable and version-control-friendly but not as strict about quotes as JSON. Such formats include: Relaxed JSON (RJSON) (simple keys and simple values generally do not require quotes) Hjson (simple keys and simple values generally do not require quotes) YAML (keys and values ...


3

In general, if you're not programming on the bare hardware, your application is talking to the operating system and has to believe what it is told, even if the OS claims "this is actually what the hardware said". Depending on the place where a cheat inserts its artificial key presses, your application may or may not have any way of finding out whether they ...


3

Invoking command anywhere from the terminal means that the command is available in the PATH. PATH is an environment variable containing an order list of directories. Whenever a command is called the list is parsed to see if an executable file of the same name is available. If it is, it is executed. If nothing was found you get "command not found error" ...


3

Of course this depends on the file system, but in traditional UNIX filesystems a device node contains a type indicator (block or character device) and a major and minor number. In the kernel, the major number is used to select the driver (actually a table of function pointers for the various operations) and the minor number is passed as an argument to each ...


3

Search for "git bare repositories". They are made exactly for this purpose. You need a directory that's write-accessible by all users, then you can push into this directory and pull/clone from it just as you would do with github or gitlab. Of course, it doesn't provide a nice web interface... If you have a small web server that your group can use ...


2

I recommend you to store the child process PID in an array, to eventually, send the signal in this way. for(i=0; i<number_of_child; i++){ if(kill(PID_child[i], SIGTERM) == -1 && errno != ESRCH){ /*Free resources*/ exit(EXIT_FAILURE); } } /*Do not let zombies alive(wait for all the child to finish) ...


2

One thing you should understand is that the on-disk inode structure is rarely identical to the in-memory inode structure. What data is stored in an on-disk inode depends on the filesystem. But yes, it will almost invariably have direct and/or indirect pointers to the disk blocks storing the file contents. (With some filesystems, tiny files might have their ...


2

Never debug. First: understanding your code is better than playing with a machine. Second: knowing that you can’t debugger your code will make you write perspicuous code in the first place. Evidence / experience: In the batch days - send the cards, get the printout. If it differs: think. In CP/M days - starting with a Basic-only machine, write an ...


2

Where to store Helper classes and what naming conventions to use is largely a matter of taste. There is no consensus; some developers consider Helper classes an anti-pattern and don't use them at all. The general principles I follow: Put the Helper class in a namespace or folder that is consistent with its scope (i.e. that Helper class is used throughout ...


1

The test folder in a repository typically contains the code to test the system from an engineering perspective: does the system still work as it should. This code is typically not delivered to end-users or recipients of a binary-only distribution. For an app or apps folder, there is no convention on what to put in there. It seems OpenCV uses that folder to ...


1

Generally, no. Even if you're going to write a USB HID mouse/keyboard driver and your program somehow have the privilege to replace the default mouse/keyboard driver in the kernel, or even if your program actually installs itself into the bootloader as an operating system, you still won't be able to distinguish that the connected keyboard might actually be ...


1

I have seen such messes too, and especially C++ and many tools can make a legacy project cumbersome. In a copy tear the project apart in separate modules, small makefiles (without much complexity in them), and documentation of modules: sources & products and the hierarchy. A must: explaining text and a component diagram. Modularity will help/speed up ...


1

This approach has two major drawbacks: Raspberry Pi is not really done with virtual machines or containers in mind. The goal of a Raspberry Pi, specifically, is to differentiate itself from servers. While servers are (1) expensive, (2) with lots of resources to allocate to virtual machines (or containers) and (3) with hardware optimized for virtualization, ...


1

I can't reliably talk about all filesystems and all platforms. But I have some experience in dealing with file allocation reflecting disk/volume/partition/region structure. The most obvious way is present in WinNT NTFS disks. (I'm not entirely sure about other win FSes). It can be easily done using userspace defragmentation API. From my point you can not ...


Only top voted, non community-wiki answers of a minimum length are eligible