dimitris kalamaras

math, social network analysis, web dev, free software…

Category: C++

LIFO (2001)

The goal of this project was to create a class (named lifo) of Last-In-First-Out Lists (Stacks) of integers with variable length. The class actually defines a new Data Type, named lifo. Each variable of this type will be a LIFO List. Of course, the class must have defined some operations (member-functions) for handling the lists, ie PUSH an integer to a stack, POP an integer from the stack, PRINT a list, COPY one list to another, COMPARE two lists, CONCATENATE two lists, SEARCH a list for an element etc.
The program is quite simple. It creates an “array” a of 100 elements of type lifo. Thus, it creates 100 LIFO lists and displayes a simple menu as user interface with the above actions.

It was written in Borland C++ v.5 but I think you can compile and run it in any compiler due of its simplicity. It only requires the iostream.h for cout and cin.

Read More

Qt (Μέρος Ι): Convertor

Το Q Toolkit (Qt) είναι μία εργαλειοθήκη για δημιουργία εφαρμογών με γραφικό περιβάλλον (GUI), αντίστοιχη της GTK του Gnome. Ξεκίνησε να αναπτύσσεται το 1991 από τους Haavard Nord and Eirik Chambe-Eng και έγινε η βάση πάνω στην οποία στηρίχτηκε ολόκληρο το γραφικό περιβάλλον KDE. Ουσιαστικά, οι εκδόσεις του KDE ακολουθούν πάντα τις αναβαθμίσεις της Qt. H Qt αναπτύσσεται πλέον από τη Νορβηγική Trolltech, και υπάρχουν ανοικτού κώδικα εκδόσεις της για Unix, Mac OS, Windows και embedded συστήματα.

Λίγη ιστορία

Μέχρι την έκδοση 1.45, η άδεια χρήσης της Qt (FreeQt) δεν ήταν συμβατή με τις άδειες χρήσης ανοικτού κώδικα του OSI (www.opensource.org) αλλά και τον ορισμό του ελεύθερου λογισμικού (www.fsf.org), πράγμα που έκανε πολλούς developers να ανησυχούν για την εξέλιξη του KDE. Η άδεια άλλαξε με την Qt2 που είχε άδεια Q Public License, την οποία όμως το FSF θεώρησε και πάλι ασύμβατη με την GPL. Το αποτέλεσμα ήταν η ανάπτυξη ανταγωνιστικών προσπαθειών, όπως της εργαλειοθήκης Harmony και του Gnome. Το Harmony ήταν μια άδοξη προσπάθεια αναδημιουργίας της Qt με άδεια GPL ενώ, πιο φιλόδοξα, το Gnome έθεσε ως στόχο την αντικατάσταση του KDE στα desktops μας (από εκεί πηγάζει η αντιπαράθεση KDE εναντίον Gnome, που όμως έχει πλέον ατονήσει).

Read More

Integral in C (1997)

This program uses the basis of the Archimedes (287-212 BC) method, known as exhaustion, to approximate the integral of a given real function in a given space [a,b]. First it segments the given space into N subspaces. It calculates: a) the sum of the areas of orthogonal parallelograms of height equal to the minimum of the function in each segment and b) the sum of the areas of orthog. parallelograms of height equal to the max value of f(x) in each segment. Theoretically, when N right infty, the progressions are both converging to the same limit which is the integral of the function.

The program is simple. It requires the segmentation number N and the integration limits a,b. You can easily change the function to your desired one in the function at the end of the code. As you may see, after the calculations, it tries to graph the function. Well don’t expect much, although it has very good output in some functions like the f(x)=xsinx.

The program was written in Borland C++ 5.0. You will need the compiler bcc in order to compile and run it, but it’s very easy to make some alterations for other compilers or other OS’s.

Read More

Page 4 of 4

Powered by WordPress & Theme by Anders Norén