In this article I will present to you a dynamic string data structure helper implementation. In C, a string is just an array of characters terminated with the null character (NUL in ASCII). Also, some times we handle a string by using a pointer to a buffer containing sequential characters terminated also with the null character. The C standard liibrary provides various functions for string manipulation but it seems that whenever we want to extend a string by using pointers we have to perform all the time memory reallocation which leads to a bad evolution of replicated code. In a recent project, I needed to create a string and append to it any number of new strings in order to extend it without using strcat, strcpy, strlen and realloc functions all the time. So, I created a simple dynamic string data structure which solved my specific problem and I would like to share it with you people.
Tag Archive: GNU/Linux
In this article I will present to you a useful function for getting the host name and service of a socket.
In this article I will present to you a POSIX function I wrote that can be used to create a server socket to support both IPv4 and IPv6 addresses (IP-Agnostic). Recently, I needed to support this feature in a server application. The implementation uses POSIX system calls and data structures that can be used as generics to support both IPv4 and IPv6.
Whenever we create a new source code file for a free software with Emacs we need first to add the short brief of the blessed GNU GPL v3. You can add a LISP function to your “~/.emacs” configuration file and call it whenever you want to add it.
If the file is missing you can create it.
After inserting the function and restarting Emacs you can call the function:
M-x insert-short-gpl (press Alt-x, type insert-short-gpl, press return).
Many text editors create backup files with names ending with “~”.
Most of the times these files are annoying and unnecessary…
So, you can use the following piped commands to remove them :
find / | grep "^.*~$" | sed -e 's/\(^.*$\)/"\1"/g' | xargs rm -f > /dev/null 2>&1
Please take account that this version handles correctly also filepaths containing space characters.
The project ‘shell-library’ (Shell Function Library) is a developers’ effort to develop a free shell library with POSIX general purpose functions. The functions that the library offers can be used within shell scripts developed to automate the work of your operating system.
The project ‘OSHACKERS’ (Operating System Hackers) and the website ‘oshackers.org’ refer to a safe, free, friendly and useful to the end-user online web system for visualising information related to the various users of the various free and open operating systems around the world.
The GNU Project by Richard Stallman
The original version was published in the book “Open Sources”
The first software-sharing community
When I started working at the MIT Artificial Intelligence Lab in 1971, I became part of a software-sharing community that had existed for many years. Sharing of software was not limited to our particular community; it is as old as computers, just as sharing of recipes is as old as cooking. But we did it more than most.
The Free Software / Open Source Software Association (FS / OSSA) recently organized a conference entitled “Open Source: Opportunity Development” in various cities. Also, last Sunday (22/05/11), I had the opportunity to attend the one-day workshop held at the University of Macedonia in Thessaloniki.
Probably sometime you will need to write a program in assembly language. For this reason, in this article we will develop a simple and typical executable “Hello World” program in assembly language to familiarize yourself with the process.