Archive

Archive for the ‘ANSI & GNU C’ Category

Ignoring multiline comments in compilers with Flex.

May 5, 2013 Leave a comment

In your lexer when lexical analysis is performed you may want also to ignore any multiline c-like comments.

Read more…

The project ‘gfs’ (GNU Find String).

October 25, 2012 Leave a comment

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.

Read more…

The project ‘gtrm’ (GNU Terminal Random Message).

September 19, 2012 Leave a comment

It is true that Software Programming is a branch of Computer Science about which I’m pretty enthusiastic. But I’m very excited at the times when I learn something new and innovative on programming. Such a period of learning of new issues on programming was when I began to wonder about the way the Internet works. My questions were related to the client – server architecture model (on whose base the Internet and its services has been designed), how web applications is in practice implemented and how I could implement an Internet service on my own.

Read more…

The project ‘clg’ (Cell Life Game).

September 10, 2012 1 comment

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.

Read more…

The project ‘YAFL’ (Yet Another Free Language).

May 7, 2012 Leave a comment

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.

Read more…

Protection of critical regions of a process in GNU/Linux.

March 7, 2011 Leave a comment

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.

Read more…

Implementation of basic string processing functions in C.

October 4, 2010 Leave a comment

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.

Read more…

Input function as a possible scenario for reproducing non-deterministic errors with defensive programming.

July 16, 2010 Leave a comment

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).

Read more…

Implementation of a C function to convert a typical process into background service (Daemon).

July 15, 2010 2 comments

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.

Read more…

Implementation of functions in C for software signal management in POSIX operating systems.

July 15, 2010 Leave a comment

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.

Read more…

Function implementation to generate true random numbers from the Linux kernel.

July 15, 2010 Leave a comment

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.’.

Read more…

Embedded systems RAM integrity check with C.

July 12, 2010 2 comments

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.

Read more…

The project ‘hcf’ (Histogram of Characters Frequencies).

June 29, 2010 Leave a comment

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.

Read more…

The project ‘mam’ (Müller’s Arithmetic Method).

June 29, 2010 Leave a comment

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.

Read more…

The project ‘dec2bin’ (decimal to binary converter).

June 29, 2010 Leave a comment

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.

Read more…

Follow

Get every new post delivered to your Inbox.

Join 145 other followers