dimitris kalamaras

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

Category: Qt Page 3 of 4

SocNetV 0.51: changes, new logo, and RPM packages

Last Friday, I released version 0.50 of Social Networks Visualiser (SocNetV) and version 0.51 followed already (yesterday), fixing an important (and yet embarrassing) bug in Graph::createDistanceMatrix() method.

IMHO, this new version is the first really usable version of this little application. With it you can draw mathematical graphs (social networks, to be precise, since the focus is more on Social Network Analysis than on Graph Theory), by pointing and clicking, load existing networks of most popular formats (Pajek, GraphML, GraphViz, UCINET, etc), create random networks (Small Worlds, Erdos-Renyi, Ring Lattices, etc), compute actor centralities (Betweeness, Closeness, Graph, etc) and clustering coefficients, select a different network layout based on these centralities (or Spring-Embedder models), and finally export your work to PDF, BMP or PNG file formats, without crashes (unlike earlier releases). A complete workflow, that is!

I am really proud of this progress (if not amazed) since I didn’t expect it to come this far 5 winters ago when I was playing with Qt toolkit while I was on army service in Evros 🙂 Yet, this application has really evolved in my spare time, and seems to be useful to some people (mostly academia).

To celebrate this new release, I prepared RPMs for both Fedora 10 and openSUSE 11.1 distros. Serafeim Zanikolas maintains already an older .deb package in Debian ‘experimental’ (and soon in Sid), while Markos Chandras just added SocNetV to qting-edge overlay, which also houses all new Qt4 and KDE4 software. Ubuntu users may add my Launchpad PPA (older version) to their repos or opt to compile from source (it’s really easy!). Meanwhile, 0.51 is the first version for which we provide a Windows zipped archive with executables (although I cant say I really tested it :P)…Oh, and we now have a much more polished and ad hoc logo (handmade with Gimp/Inkscape of course):

Nice, isn’t it? 😛

Qt (Μέρος IV): Φτιάξτε παιχνίδια

Στα τρία προηγούμενα μέρη αυτού του tutorial, μάθαμε τα βασικά κόλπα της Qt, και την αξιοποιήσαμε στη δημιουργία διαχειριστικών εργαλείων για βάσεις δεδομένων. Καλά όλα αυτά, αλλά πως χειριζόμαστε γραφικά με την Qt; Λοιπόν, δεν υπάρχει τίποτε πιο εύκολο από αυτό! Για να σας το αποδείξουμε, θα φτιάξουμε ένα μικρό παιχνίδι σκοποβολής, το MouseShooter.

Το παιχνίδι θα αποτελείται από ένα μοναδικό παράθυρο, πάνω στο οποίο θα τοποθετήσουμε δύο κουμπιά (για Εναρξη και Τερματισμό του παιχνιδιού) και από κάτω ένα καμβά, όπου θα εμφανίζονται τα γραφικά. Είναι πρωτόγονο, αλλά ο στόχος είναι να δούμε τις βασικές έννοιες, όχι να ξαναφτιάξουμε το …DOOM! Αυτή τη φορά, δεν θα χρησιμοποιήσουμε το QtDesigner για να σχεδιάσουμε κάποια φόρμα για το MouseShooter. Το παιχνίδι μας θα έχει ένα πολύ απλοικό interface, οπότε θα είναι εύκολο να του στήσουμε το περιβάλλον κατευθείαν από τον κώδικα – για να δείτε πως γίνεται κι αυτό…

Η ιδέα για το γραφικό θέμα του MouseShooter είναι απλή μέχρι αηδίας: τα ποντίκια έχουν πέσει πάνω στο τυρί, και εμείς τα πιάνουμε στα πράσα και τα …πυροβολούμε. Αυτά πανικοβάλλονται και αρχίζουν να τρέχουν αριστερά και δεξιά. Τα γραφικά, δηλαδή το spite του ποντικιού και το φόντο του τυριού, τα “δανειστήκαμε” από ένα απλοικό παράδειγμα της Qt. Εμείς όμως θα φτιάξουμε κάτι πολύ πιο σύνθετο…Ας ξεκινήσουμε λοιπόν!


Εικόνα 1: Το εκπληκτικό shooter μας σε όλο του το μεγαλείο! Τα ποντίκια δεν μένουν ακίνητα βέβαια…

Read More

SocNetV 0.49 & Ubuntu packaging

Found some time today to finish another SocNetV release — after three months of development, SocNetV 0.49 sports a redesigned dock with tabs (statistics, edit, layout), new supported social network formats, weight numbers on edges and, as usual A LOT of bug fixes :P… But, the funkier feature of this release is that I finally managed to build decent SocNetV packages for Ubuntu Intrepid Ibex. Thanks to Canonical’s Launchpad, my very own PPA (Personal Package Archive) can be used as a third-party repository in your Ubuntu installation. All you have to do is to add these two lines in your /etc/apt/sources.list file:

deb http://ppa.launchpad.net/dimitris-kalamaras/ubuntu intrepid main
deb-src http://ppa.launchpad.net/dimitris-kalamaras/ubuntu intrepid main

Then, update your package list and install SocNetV with this single-line:

sudo apt-get update && sudo apt-get install socnetv

To run it, just go to Applications > Education > SocNetV,  et voila!

SocNetV 0.49 in Ubuntu 8.10

SocNetV 0.49 in Ubuntu 8.10

Unfortunately, it seems I can’t figure out what is going on with my older RPM .spec file, although I did try some mods, which is why the openSUSE Build Service refuses to build even plain openSUSE 11.1 packages. The funny thing is that the same .spec file builds the RPM ok in my local openSUSE install… And, unfortunately I have no more time to spend on it. 🙁

Qt (Μέρος IIΙ): Αρχειοθέτης άρθρων

Στο προηγούμενο tutorial φτιάξαμε μια γραφική εφαρμογή, το BookAdmin, για να διαχειρίζεστε τη συλλογή των βιβλίων σας χρησιμοποιώντας μια βάση δεδομένων MySQL. Δεν ήταν κάτι ιδιαίτερο, βέβαια, και η αλήθεια είναι ότι θα έπρεπε ίσως να συνεχίζαμε την ανάπτυξή της (βάζοντας π.χ. φίλτρα για τις εγγραφές). Ωστόσο, πολλοί αναγνώστες του “LF” μας ζήτησαν με ευγενικό τρόπο (μας δωροδόκησαν καλά!) να τους δώσουμε έναν τρόπο αρχειοθέτησης των άρθρων του περιοδικού για όλα τα μέχρι σήμερα τεύχη. Οπότε σκεφτήκαμε: “τι καλύτερο από το να γράψουμε ένα μικρό tutorial γι’ αυτό βασιζόμενοι σε ότι κάναμε στο BookAdmin;” Έτσι, αυτή τη φορά, θα φτιάξουμε μια τέτοια εφαρμογούλα για να τηρείτε το “αρχείο” σας, αλλά και για να δείτε πως φτιάχνεται κάτι τέτοιο στην πράξη. Τέτοιο …making of ούτε στο Holywood δεν θα βρείτε! 😛 Σημείωση: μπορείτε να κατεβάσετε όλον τον κώδικα του άρθρου από εδώ.

Το σχέδιο έχει ως εξής. Η εφαρμογή, ας την βαφτίσουμε ArtAdmin, θα πρέπει να έχει ένα γραφικό περιβάλλον αντίστοιχο του BookAdmin, δηλαδή με πεδία για προβολή και αναζήτηση κάποιων εγγραφών (δηλαδή άρθρων) και ένα TableView σε ξεχωριστή καρτέλα για να βλέπετε όλα τα άρθρα μαζί. Συνεχίζοντας με αυταπάρνηση την παράδοση που θέλει κάθε προγραμματιστή …τεμπέλη, θα βασιστούμε στη φόρμα του BookAdmin αλλάζοντας ελαφρώς την πρώτη καρτέλα της για να φτιάξουμε το ολοκαίνουριο ArticlesAdmin – φασόν δηλαδή 🙂 Αυτή τη φορά, όμως θα προσθέσουμε και μερικά νέα κόλπα…

Read More

Qt (Μέρος IΙ): Βάσεις δεδομένων

Σε αυτό το tutorial, στόχος μας είναι να φτιάξουμε μια εφαρμογή που να αλληλεπιδρά με τη MySQL. Η Qt υποστηρίζει αρκετές βάσεις δεδομένων (MySQL, PostgreSQL, SQLite), αλλά εδώ θα περιοριστούμε στην MySQL.

Στο παράδειγμα που θα δούμε παρακάτω, θα φτιάξουμε2008/08/02/qt-μέρος-ι-convertor/#content μια εφαρμογή διαχείρισης βιβλίων, το bookAdmin. Η υλοποίηση του όμως θα είναι αρκετά γενική ώστε να μπορείτε να το προσαρμόσετε εύκολα στις δικές σας ανάγκες. Με μερικές αλλαγές στο περιβάλλον της εφαρμογής θα μπορείτε, αντί για βιβλία, να διαχειρίζεστε CDs, ταινίες, γραμματόσημα, οτιδήποτε. Θυμίζω ότι βασιζόμαστε στην Qt 4.2+ οπότε, ανάλογα με τη διανομή σας, θα πρέπει να έχετε ήδη εγκαταστήσει τα πακέτα ανάπτυξης της Qt4 (δείτε το πρώτο tutorial). Επιπλέον, επειδή θα δουλέψουμε με βάσεις δεδομένων, θα πρέπει να εγκαταστήσετε και το πακέτο libqt4-sql στο Debian/Ubuntu (ή το qt4-database-plugin-mysql-lib στο PCLinuxOS). Κατά τ’ άλλα, θα αρκεστούμε και πάλι στo Qt Designer και σε ένα κειμενογράφο.

Δημιουργία GUI

Αρχικά θα φτιάξουμε το GUI του bookAdmin. Τρέξτε λοιπόν το QtDesigner. Στην ερώτηση για το είδος της φόρμας, επιλέξτε “Main Window” μια και αυτή τη φορά θέλουμε να φτιάξουμε μια κανονική εφαρμογή. Στο προηγούμενο τεύχος είχαμε προτιμήσει το Widget, μια και τότε θέλαμε μόνο ένα λιτό διάλογο με μερικά μόνο πεδία για την εισαγωγή και προβολή των μονάδων. Το bookAdmin όμως θα είναι πολύ πιο περίπλοκη εφαρμογή, γι’ αυτό προτιμάμε το MainWindow.

Read More

SocNetV gets a review (not bad one :))

I started this SocNetV thing as a learning exercise: to deepen my knowledge of Qt/C++, to familiarize myself with tools like svn, mercurial, etc, and, above all, to build something that I needed back then in my Linux box (was it Mandriva 2005?): a simple application to help me draw social graphs and compute some statistics (centralities) about them. After three years of development, Social Networks Visualiser is nowhere near complete, but it is quite usable and it’s getting better (I think).

Today, a friend called me to comment on the “review”… I was, “what review?”…Well, it seems that somehow, Mihai Mircea, the Softpedia Linux Editor was convinced that SocNetV deserves a review on Softpedia. So, there it is: we got 3 stars out of 5. Not bad — actually it was more positive than I would expect. Anyway, thanks for the review and the thoughtful comments, Mihai.

RPM .specs, for a Qt4 application

Been busy the last few days; mostly reading math but occasionally I would steal some time (preferably late at night or in the afternoons) to hack on SocNetV — btw, I released a bugfix 0.47 a couple of days ago.

Today, I decided to check on SUSE Build Service. This is a complete distribution development platform that provides the means to build packages for openSUSE distributions as well as most other Linux distributions. The whole idea seemed to be “upload your source tarball and a spec, and we’ll make binary packages for you for every distro you name”. This is just awesome, if you think about it, cause it takes all the trouble from the developer. Well, I was reading their manual, trying to understand which-is-which and what-to-do-to-build-my-great-package, when I realized that I could easily make an RPM for SocNetV with no hassles, and no Build Service at all. You see, we had a very nice tutorial on building RPM packages in the Greek edition of Linux Format magazine. At the time, I hadn’t test the instructions in real world examples, but hey ..it couldn’t be that hard! And it wasn’t. Actually, it was far easier than I thought in the first place…

Read More

Page 3 of 4

Powered by WordPress & Theme by Anders Norén