Archive
Ignoring multiline comments in compilers with Flex.
In your lexer when lexical analysis is performed you may want also to ignore any multiline c-like comments.
The project ‘gfs’ (GNU Find String).
Within the framework of the course “Operating Systems I – Laboratory” (Department of Informatics and Communications, T.E.I of Serres) we were asked to choose one of 25 available projects aiming to implement and then present to the entire class. My choice was project 17, whose goal was the implementation of the external ‘find’ command of the operating system MS-DOS.
The project ‘clg’ (Cell Life Game).
Within the framework of the course “Operating Systems II – Laboratory” (Department of Informatics and Communications, T.E.I of Serres) we developed as a semester assignment an application whose aim was to simulate the evolution of a colony of single-celled organisms, namely the creation of the famous game of life.
The project ‘YAFL’ (Yet Another Free Language).
This project refers to the development of the procedural programming language YAFL (Yet Another Free Language) as well as its interpreter. The programming language YAFL is a tool for teaching the basic principles of procedural programming to secondary school students and beginners in general.
Protection of critical regions of a process in GNU/Linux.
Below, we quote a function for managing a transaction in a hypothetical transaction management system. It is very likely multiple instances of the function to be executed in parallel on a system of symmetric multiprocessing (SMP), on multi-processor platforms or even a multithreaded single processor systems.
Implementation of basic string processing functions in C.
Below there are some basic processing functions of strings in C. The implementations are approached with the pointers of C, thus creating faster and more compact code.
Input function as a possible scenario for reproducing non-deterministic errors with defensive programming.
The presence of errors in software development (and not only) is inevitable. However, over time the programs improve and tend to perfection through various techniques and methods we have developed.
The deterministic problems are easy to spot because they always lead to the same error. There are tools that run through the source code of an application to find possible deterministic errors (these tools are especially useful in applications written with scripting languages such as Python, Bash Scripting, etc).
Implementation of a C function to convert a typical process into background service (Daemon).
Below I quote a function in C to convert a standard Linux kernel process into background service (Daemon Service). If you wish to develop a server to provide services, it may be helpful. Although there are several manuals on the Internet on how to create background services, most of them don’t show a complete example, while others are barely functioning. The following function converts a standard process into a service taking everything you need into account. Also, this function is the result of a combination of several textbooks and numerous studies about this issue. Finally, it has been tested on personal applications servers and it is performing well.
Implementation of functions in C for software signal management in POSIX operating systems.
Below I quote a simple implementation in C that you can use in your applications for the management of software signals in POSIX operating systems (such as the GNU/Linux). Of course, this implementation comes from a personal project of the past, especially where I grappled with system programming. You can modify this implementation to work best with your needs.
Function implementation to generate true random numbers from the Linux kernel.
Before I mention the function that I have personally developed for the production of random numbers from the monolithic Linux kernel, I would first like to say something about the issue of random numbers.
The issue of producing truly random numbers is important and had even since the beginning puzzled computer scientists. In mathematics, it is very difficult to define the random and, generally, randomness is very difficult to prove with no assumptions. In the past, many scientists tried to develop mathematical models and algorithms to develop random number generators.
One of the greatest scientists of Computer Science, John von Neumann (the basic idea of the architecture of all computer systems today was his own design) jokingly said: ‘Anyone who considers arithmetical methods of producing random digits is, of course, in a state of sin.’.
Embedded systems RAM integrity check with C.
Below I quote a program in C which performs memory test in a computer system (for example the BIOS performs a memory test before loading the operating system loader in any IBM PC). However, what we quote is different in its implementation. If you are dealing with embedded systems or operating systems programming it may be useful.
The project ‘hcf’ (Histogram of Characters Frequencies).
Within the framework of the course “Programming II – Laboratory” (Department of Informatics and Communications, T.E.I of Serres) we were asked to implement as homework a program that reads characters from the standard input and then export to standard output a frequency histogram of the characters that appear.
The project ‘mam’ (Müller’s Arithmetic Method).
Within the framework of the course “Numerical Methods in Programming Environments – Theory” (Department of Informatics and Communications, T.E.I of Serres) we were asked to develop an optional program that implements Müller’s numerical method for finding the root of equations of the form f(x) = 0.
The project ‘dec2bin’ (decimal to binary converter).
The project ‘dec2bin’ (decimal to binary converter) is the implementation of an idea I had for some time. I have to admit that sometime in the past when studying possible ways of programming embedded systems with the programming language C and C++, I felt the need to be able to produce, through a program, supposed memory addresses in the form of binary numbers.