Archive for November, 2009

Δρομολόγια ΟΑΣΑ – Το επόμενο λεωφορείο

November 29, 2009

Ενημέρωση 2011/02/03: Το πρόγραμμα ανανεώθηκε ώστε να υποστήριζει τη νέα δομή του δικτυακού τόπου του ΟΑΣΑ.

Ενημέρωση 2010/06/11: Το πρόγραμμα έχει πλέον τη δυνατότητα να ορίζει ο χρήστης την ώρα της ημέρας για την οποία θέλει να δει τα δρομολόγια.

Υπάρχουν φορές που βιάζεσαι να βγεις στη στάση να πάρεις το λεωφορείο και θέλεις γρήγορα να δεις πότε περνάει το επόμενο. Τα πράγματα περιπλέκονται ακόμη περισσότερο αν κοντά στο σπίτι βρίσκονται 2 ή περισσότερες στάσεις από τις οποίες διέρχονται διαφορετικές γραμμές. Γι’ αυτό το λόγο έφτιαξα ένα πρόγραμμα σε C# ώστε να μπορεί κανείς να δει γρήγορα και εύκολα πότε έρχεται το επόμενο λεωφορείο.

(more…)

Υπηρεσία ΟΤΕ e-bill – αποθήκευση κλήσεων

November 29, 2009

Ενημέρωση 2010/10/07: Αναβάθμιση της εφαρμογής λόγω αλλαγής στο σύστημα πρόσβασης της υπηρεσίας ΟΤΕ e-bill.

Η υπηρεσία ΟΤΕ e-bill δίνει τη δυνατότητα στους συνδρομητές του ΟΤΕ να προβάλουν τους τελευταίους λογαρισμούς μέσω του διαδικτύου. Έφτιαξα ένα πρόγραμμα σε Python που συνδέεται στη συγκεκριμένη υπηρεσία και αποθηκεύει σε μία τοπική βάση SQLite τις κλήσεις από τους λογαριασμούς που είναι διαθέσιμοι στο σύστημα.

(more…)

Make database diagrams in DIA automatically

November 22, 2009

Continuing from yesterday’s post, I’ve written a utility in Python that reads an SQL schema and outputs a DIA file for it. As of now it is not designed to handle relations between tables. I have used it to create diagrams from SQL schemas written for MySQL. It should not be too hard to make it work with other database systems by changing the parsing code. The parsing is accomplished with regular expressions, which may be a little confusing but it seems to work OK on most cases tested.

(more…)

Make class diagrams in DIA automatically

November 21, 2009

There is usually the case that you need to draw a class diagram after having written the code. If you have only a few classes then it might be easier just to draw it by hand in DIA or a similar application. When you have a lot of classes, there are other options like using an IDE with reverse-engineering capabilities like NetBeans or using an excellent standalone utility that serves this purpose: UMLGraph. Using an IDE is an excellent choice if you can make it export your class diagram into a vector format, like PostScript. Using UMLGraph is an excellent option if you can afford the layout provided by Graphviz and its inability to do custom layout of its output.

(more…)

Frequency of words and phrases of a document

November 17, 2009

Sometimes out of curiosity you need to find the frequency of the words you use in one of your documents. Or you would like to make it a little bit more generic and find the frequency of N-sized groups of consecutive words in your document. For that matter I’ve written the following Python script:

(more…)

Count words in a Microsoft Office Word document

November 14, 2009

Update 2009/11/21: The utility displays the number of pages instead of the number of lines.

Counting words in a Microsoft Office Word document through the Microsoft Office Word application is trivial. Just click on the Word Count option from the Tools menu. Sometimes, though, it would be nice to be able to count and display the number of words in a document through a command line utility like the way Unix’s wc utility does for normal text files.

(more…)

Virtual methods from constructor / destructor in C++

November 3, 2009

I was reading the following discussion on the Chromium developers group: Virtual dispatch doesn’t work (as you might expect) in destructors! which documents a problem that arised during the development of a specific piece of code in Chromium. What it says is that virtual methods called from inside constructors or destructors are not dispatched to their intended final destination. Instead of that, they are dispatched to the declaration inside the object being constructed or destructed at the moment. A much more detailed explanation is given by Scott Meyers in the following article: Never Call Virtual Functions during Construction or Destruction

(more…)

Generating diagrams from relational databases

November 2, 2009

As a first step to understand a database schema people usually study a database schema diagram which depicts the relationships between different kinds of objects that are modeled in the database. Sometimes, though, looking at a database schema diagram is not enough due to the complexity of the relations between data. Then, it is useful to insert some test data and observe how the relationships are actualized on these test data. Unfortunately, I could not find a utility to transform a database filled with data into a diagram that displays the actual relations between the database’s data.

(more…)

Monitoring logon attempts on Windows Vista

November 1, 2009

A few simple steps to enable monitoring of logon attempts on Windows Vista.

(more…)

Standalone PHP code coverage without PHPUnit

November 1, 2009

When developing a PHP application you can use PHPUnit in order to execute unit tests and gather code coverage statistics. Sometimes, though, it would be useful to gather code coverage statistics from the real world usage of the application. Although that induces a time penalty, it could be used in a debug deployment of the application for the sake of gathering the required statistics.

(more…)