Archive for October, 2010


Dear Readers and Friends of Free Software,

First of all, as a return gift of gratitude, I owe a big thanks to both the FS / OSS Association, who gave me the opportunity to freely share my knowledge and my experiences about the world of ARDUINO with you through the cycle of seminars started on Sunday 24/10/10 as well as to all of you who attended the first seminar filling the hall of the laboratory with your presence and your interest.

Continue reading

The Association of Greek Users and Friends of Free Software / Open Source Software invites you to the new presentation in the new round of free courses and presentations organized with a view to deepening the knowledge and alternative use and exploitation of FS / OSS:

Open Source Electronics Platform ARDUINO

The presentation will be made by the Informatics Scientist and Communications Engineer as well as Arduino hacker, Efstathios Chatzikyriakidis.

The event will take place at 13:00 on Sunday, October 24, 2010 in the Computer Laboratory of the Department of Economics, University of Macedonia.

It was a very interesting experience for me to participate in the mission of the Department of Informatics and Communications of the T.E.I. of Central Macedonia in Thessaloniki, where the Department took part in the Infosystem 2010 exhibition.

Continue reading

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.

Continue reading

The following program generates N random integers between 0 and 999, creates a linked list inserting a number in each node and then rearranges the nodes of the list so that the numbers appear sorted when we go through the list. For the sorting, it maintains two lists: one input list (not sorted) and one output list (sorted). In each iteration of the loop, it removes a node from the input list and enters it in the appropriate position in the output list. The code is simplified by using head nodes for each list, which contains links to the first node lists. Also, both lists (input and output) are printed.

Continue reading

This program demonstrates the use of an array and is representative of the usual situation in which we store data in one array to process them later. It counts the number of pairs of N randomly generated points of the unit square, which can be connected to a line segment of length less than ‘d’, using the point data type. Because the execution time of this program is O(n2), it can’t be used for large N.

Continue reading

The function ‘reverse’ in the following example reverses the links in a list, returning a pointer to the end node, which then shows the next of the last node, and so forth, while the link to the first node of the initial list is assigned the value 0 corresponding to null pointer (in C++). To accomplish this task, we must maintain links to three consecutive nodes in the list.

Continue reading

For the representation of individuals arranged in a circle, we create a circular linked list with a combination of each person to the person on his left in the circle. The integer i represents the i-th person in the circle. After you create a circular list of one node for 1, we insert its unique node to nodes 2 to N. We end up with a cycle from 1 to N, with x indicating the node N. Then, starting from 1 we omit M-1 nodes, we define the pointer of the (M-1)-th node to omit the M-th, and continue that way until only one node remains in the list.

Continue reading

The aim of this program is to assign to a[i] the value 1 if i is a prime number and the value 0 if not. Initially, all elements of the array take the value 1 to indicate that there are no numbers which are known not to be prime. Then all elements of the array corresponding to indexes that are known not to be primes (multiples of known primes) take the value 0. If a[i] has the value 1 even after all multiples of smaller primes have taken the value 0, we know that i is a prime number.

Continue reading

The program generally simulates a Bernoulli trials sequence, a familiar and abstract notion of probability theory. So, if you flip a coin N times, we expect “head” to occur N/2 times – but it could occur anything between 0 and N times. The program performs the experiment M times, reading the N and M from the command line. It uses an array ‘f’ to count the frequency with which the result “i heads” appears for 0 <= i <= N, and then displays a histogram of the results of experiments with an asterisk for every 10 appearances. Also, the operation behind the program – of indexing an array with a calculated value – is critical to the effectiveness of many computational procedures.

Continue reading