About Kyriakos Anastasakis

I was born on the beautiful island of Chios, Greece, where I received my primary school and high school education. At the age of 18 (in 1997), I moved to Athens to attend the Department of Informatics at the T.E.I. of Athens. In 2001 as part of a six month industrial placement, I joined Ulysses Systems, Piraeus as a junior Software Developer. In 2002 I received the degree of Informatics Engineer (Mihanikos Pliroforikis) from the T.E.I. of Athens. I continued to work for Ulysses Systems until the end of July of 2003. In 2003 I moved to Birmingham to study for the MSc in Advanced Computer Science at the School of Computer Science, at the University of Birmingham. In 2004, after I finished the MSc studies, I decided to stay in Birmingham and pursue a PhD degree in Computer Science. Since then I have been working towards the PhD in Birmingham under the supervision of Dr. Behzad Bordbar. Since 2005 I have been a part time self-employed software consultant. An interesting project I was involved in, was the development of a small scale CRM software for the Birmingham branch of MLP Private Finance. Since 2004 I have also been responsible for development and maintainance of the website of the Hellenic Society of the University of Birmingham.

Today I finished a beta version of a simple java program that collects the statistics from a subversion repository. I have created a website for the program: http://www.freewebs.com/subvstats/

It currently works by checking the whole history of the repository, finding how many lines have been added/removed in each file by using the “svn diff” command and creating an HTML report.
A sample of the report can be found here: http://www.freewebs.com/subvstats/samplereport.html

The program should work for relatively small repositories. As soon as I have time I will document it more and generate more statistics. And yes, I am thinking of making it opensource, but not in its current state. I first need to find some time to document the code properly and have a stable version.

Keywords: Subversion, statistics, package, tool, program, software, java, subvstats.

For the past two days I have been working with MS Access to create an application. One of the features I wanted to create, was a parametric query that would take the value from a combobox on a form and create a report.

To be more precise I had a form with a combobox populate with IDs and names and when the user selected a specific item from the combo and clicked on a button I wanted to have a report that showed some information of related to the selected ID.

One way to do it is to create some vb code and create a select query with a “where” clause. But, that is not too flexible, caz if I want to change the query, I have to change the code.

Today I came across a more flexible solution. Parametric queries. I knew how to use parametric queries, but not in conjunction with forms. So if you want to create a parametric query related to a form, all you have to do in the query is define the parameter at the beginning like:

PARAMETERS [Forms]![formName]![ControlName] ParameterType;

In the where clause you also have to use the same notation. So for example:

where Id = [Forms]![formName]![ControlName]

and that’s it!

I was trying to convert an MS Access database I had developed to MDE. It was crashing every time I was trying to create the MDE file.

After some search on the internet I run across a Microsoft article that solved the problem for me.

The link is: http://support.microsoft.com/Default.aspx?scid=kb;en-us;814858&spid=2509&sid=98

What it says is:

WORKAROUND
To work around this problem, you can reload the VBA project of the Access database from text and then create the MDE file or the ADE file. To do this, follow these steps:

Note Make a backup copy of the database before you start these steps.
1. On the taskbar, click start and then click Run.
2. Type msaccess.exe /decompile and then click OK.

3. Open the original .mdb file or the original .adp file that you want to save as the new MDE file or the new ADE file.
a. Press ALT+F11 to open the Visual Basic Editor.
b. On the Debug menu, click Compile <databasename>.

c. On the File menu click Save <databasename>, and then close the Visual Basic Editor.
4. On the Tools menu, click Database Utilities and then click Make MDE File or click Make ADE File.
5. In the Save MDE As dialog box or the Save ADE As dialog box, locate the folder where you want to save the MDE file or the ADE file, type the file name in the File name box, and then click Save.<databasename>

I tried it and it and it works like a charm! Apparently I had deleted some forms and there was some VBA code related to those forms that was still there. With the decompile option not only did I manage to create an MDE file, but I also reduced the size of the db by almost 1MB(!!) after I compacted it.

From now on I am going to use the /decompile option every time before I deploy a new version of access.

As I was searching for something on google, I saw an ad at the bottom of the page. The ad was about the Davinci code new movie that is coming out. I clicked and found a sudoku like puzzle, related to the movie. The puzzle is explained in the following two pictures (description can also be found on: http://student-rant.blogspot.com/2006/04/googles-da-vinci-code-quest-1.html)

Well… it is clearly a very simple problem for a constraint solver, like Alloy Analyzer! I created the following model (took me half an hour, so no comments or too much thought about it).

module testopen util/ordering[Natural] as ord

abstract sig Natural{}

one sig One extends Natural{}
one sig Two extends Natural{}
one sig Three extends Natural{}
one sig Four extends Natural{}

abstract sig Symbol{}

one sig Cross extends Symbol{}{}
one sig Fi extends Symbol{}{}
one sig Blade extends Symbol{}{}
one sig Star extends Symbol{}{}

sig Cell{
symbol: one Symbol,
rowIndex: Natural,
columnIndex: Natural,
inRange: Natural
}

fact Numbers{
ord/first() = One
ord/next(One) = Two
ord/next(Two) = Three
ord/last() = Four

}

pred defineRange(row:Natural,column:Natural,r:Natural){
all c:Cell |
c.rowIndex = row && c.columnIndex = column => c.inRange = r
}

fact DefineRange{
defineRange(One,One,Two)
defineRange(One,Two,One)
defineRange(One,Three,One)
defineRange(One,Four,One)
defineRange(Two,One,Two)
defineRange(Two,Two,Two)
defineRange(Two,Three,Three)
defineRange(Two,Four,One)
defineRange(Three,One,Four)
defineRange(Three,Two,Two)
defineRange(Three,Three,Three)
defineRange(Three,Four,Three)
defineRange(Four,One,Four)
defineRange(Four,Two,Four)
defineRange(Four,Three,Four)
defineRange(Four,Four,Three)
}

pred staticSymbols(row:Natural, column:Natural, s:Symbol){
all c:Cell |
c.rowIndex = row && c.columnIndex = column =>
c.symbol = s
}

fact{
staticSymbols(One,Four,Fi) &&
staticSymbols(Two,Two,Cross) &&
staticSymbols(Four,Two,Blade) &&
staticSymbols(Four,Three,Star)
}

// No two same symbols in the same Range
fact{
all disj c,c’:Cell |
c.inRange = c’.inRange =>
c.symbol != c’.symbol
}

// All cells have different rowIndex and columnIndex
fact{
no disj c,c’:Cell | (c.rowIndex = c’.rowIndex && c.columnIndex = c’.columnIndex)
}

//No two same symbols in the same row Column
fact{
all disj c,c’:Cell |
c.rowIndex = c’.rowIndex =>
c.symbol != c’.symbol

all disj c,c’:Cell |
c.columnIndex = c’.columnIndex =>
c.symbol != c’.symbol
}

pred solution(){
#Cell = 16
}

run solution for 16 Cell

Alloy Analyzer came up with a solution in 3 seconds, on the dual core 2GB RAM opteron server running linux!

The solution is the following one:

symbol= { (Cell_0 Blade_0) (Cell_1 Blade_0) (Cell_2 Blade_0) (Cell_3 Blade_0) (Cell_4 Fi_0) (Cell_5 Fi_0) (Cell_6 Fi_0) (Cell_7 Fi_0) (Cell_8 Cross_0) (Cell_9 Cross_0) (Cell_10 Cross_0) (Cell_11 Cross_0) (Cell_12 Star_0) (Cell_13 Star_0) (Cell_14 Star_0) (Cell_15 Star_0) }

rowIndex = { (Cell_0 One_0) (Cell_1 Two_0) (Cell_2 Three_0) (Cell_3 Four_0) (Cell_4 One_0) (Cell_5 Two_0) (Cell_6 Three_0) (Cell_7 Four_0) (Cell_8 One_0) (Cell_9 Two_0) (Cell_10 Three_0) (Cell_11 Four_0) (Cell_12 One_0) (Cell_13 Two_0) (Cell_14 Three_0) (Cell_15 Four_0) }

columnIndex = { (Cell_0 One_0) (Cell_1 Four_0) (Cell_2 Three_0) (Cell_3 Two_0) (Cell_4 Four_0) (Cell_5 Three_0) (Cell_6 Two_0) (Cell_7 One_0) (Cell_8 Three_0) (Cell_9 Two_0) (Cell_10 One_0) (Cell_11 Four_0) (Cell_12 Two_0) (Cell_13 One_0) (Cell_14 Four_0) (Cell_15 Three_0) }

It is quite straightforward! The symbol of Cell_0 is Blade, its row is One and column One. The symbol of Cell_1 is Blade again, he row is Two and Column Four etc.

The symbol names are not related to the movie or book symbol names. In my model Blade is the pyramid like shape, Fi is the Greek letter fi, Cross is the symbol that looks like a cross and Star is the symbol that looks like a star. I know that I spent half an hour to solve a problem that would have taken me around 10 minutes to solve manually, but as a proper nerd I prefer to use my (few) grey cells to think how to use a computer to solve a problem for me, instead of solving the problem myself.

Well.. that’s it! I don’t want to spend more than 1 hour on this!

There are a couple of blogs with solutions to the puzzles.
Links to solutions:
http://student-rant.blogspot.com/2006/04/warning-solution-to-google-da-vinci.html
http://googlefact.blogspot.com/

UPDATE: I used the model on my P4 running @ 2.8G with 712 MB ram and took AA 23 seconds to solve the problem. Not bad at all! But for bigger problems the state space will be increased by too much. Looks like an AI technique should be used to find a solution.