Wednesday, December 19, 2007

Concerts in Vienna

Two weeks ago I went to Vienna for a weekend break. Since I have been living in Scandinavia for the last 3 years, I am used to planning my trips in advance. This doesn't imply that I am following my plans, but that's another story.. The story here is about booking online tickets for a concert in Vienna's Opera.

AVOID http://www.viennaconcerts.com
This website looks nice and serious and comes first at google's results if you search for "concerts in vienna".. However, there are some small details that noone ever reads in the terms and conditions.

I booked a ticket for "The Magic Flute" and I paid 43€. I was going to get the ticket from the box office, just before the start of the performance..
It was only when I got the ticket in my hands that I realized that I paid 13.30€ more than the price of the ticket!

The price of the ticket was 29.70€!!!
Believe it or not, I had to pay 45% more than the original price!

Then I read the terms and conditions and I could see that
"Opera / Musical Prices
...
The net difference between prices listed at www.viennaconcerts.com and the face value of the opera tickets is generally 25%. For some ticket categories, due to high demand, the difference might be higher than 25% but not higher than 34 EUR / ticket. Very few performances and/or ticket categories where this difference is higher than 34 EUR / ticket are clearly marked as "incl. special purchase fee"."

Yeah.. Thanks.. I am happy I didn't pay double price..

Just avoid ViennaConcerts website..

Monday, July 09, 2007

How to create a SQL script that executes other SQL scripts

Yesterday I was facing the following problem..
I have several sql scripts that I want to call from a single sql script.
I am using SQL Server 2005.
I have found two ways of doing it. The first one is by directly calling the scripts one by one, and the second is by calling all the scripts in a folder.

First of all, you need to set your server to accept 'xp_cmdshell' commands.
This is done by the following code
USE MainDB

GO
EXEC sp_configure 'show advanced options', 1
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure 'xp_cmdshell', 1
GO
RECONFIGURE WITH OVERRIDE
GO
EXEC sp_configure 'show advanced options', 0
GO
Now, let's assume that you have a folder at D:\Test, which has 3 files,
Test1.sql
Test2.sql
Test3.sql

The first way, which is the easiest way to execute this files by a sql script is by the following
USE MainDB

EXEC master..XP_CMDShell 'osql -E -i D:\Test\test1.sql'
EXEC master..XP_CMDShell 'osql -E -i D:\Test\test2.sql'
EXEC master..XP_CMDShell 'osql -E -i D:\Test\test3.sql'
If you want to run all the scripts in a folder, then you can use the following script
USE MainDB

CREATE TABLE ##SQLFiles ( SQLFileName VARCHAR(2000))
GO

INSERT INTO ##SQLFiles
EXECUTE master.dbo.xp_cmdshell 'dir /b "D:\Test\*.sql"'
GO

DECLARE cFiles CURSOR LOCAL FOR
SELECT DISTINCT [SQLFileName]
FROM ##SQLFiles
WHERE [SQLFileName] IS NOT NULL AND
[SQLFileName] != 'NULL'
ORDER BY [SQLFileName]

DECLARE @vFileName VARCHAR(200)
DECLARE @vSQLStmt VARCHAR(4000)

OPEN cFiles

FETCH NEXT FROM cFiles INTO @vFileName
WHILE @@FETCH_STATUS = 0
BEGIN
SET @vSQLStmt = 'master.dbo.xp_cmdshell ''osql -E -i "D:\Test\' + @vFileName + '"'''
EXECUTE (@vSQLStmt)

FETCH NEXT FROM cFiles INTO @vFileName
END

CLOSE cFiles
DEALLOCATE cFiles
GO

DROP TABLE ##SQLFiles
GO

This code will work if you don't need a username and password to connect to your database.. If your configuration is more complicated, you will have to add some more parameters to the osql. Read more here

Monday, July 02, 2007

Graduated!

Finally, I graduated..
I am not sure if I am happy for that.
Lately I have been planning to travel with Erasmus program to Australia! Since, I have graduated, I don't have this option anymore :(

But, anyway, it's good when things that are supposed to be done, are finally done!

Now, let's study something else..
Psychology and Law seem to be the main competitors..

Tuesday, June 26, 2007

News

It's been a long time, so I will just post the headlines of my news.
  • No news about the flash project.. Still not sure if I passed/graduated or not.
  • I have applied for a position as Teaching Assistant again from September.. It was fun :)
  • I am considering some new projects for the summer.. Mainly websites..
  • Still working at the bar of my kollegium on Thursdays and Saturdays.
  • Still working at EasyTime International
  • I start to like running medium distances (5km).. Competition is the best motivation!
  • I, finally, applied for a visa to US and A. I have booked an appointment and on the 13th of July, I will go to the US embassy to try my luck..
I will come back with something more interesting soon.. I hope :)

Tuesday, May 22, 2007

Flash project news..

"The Multi Media Lab is being used for other purposes the next few days blah blah blah blah ...your deadline for handing in is prolonged.
The deadline for handing in your written reports in Multimedia Production for the Internet is Thursday 24 May 15.00"

This means that I have one more day!!
I might finish it after all!!

I guess that tonight I will upload my Arkanoid on the web just for fun..
Tomorrow I will have to start optimizing and writting the report..

My Arkanoid will for sure be better than this and worse than this. At least my initial version. Maybe in the future I will enhance it, but now I don't have time..

Monday, May 21, 2007

Flash Project

I will not write much, because I am too busy..

I am planning to implement an Arkanoid (BreakOut for the nerds out there).
I started yesterday by creating an engine (partly from the web and partly mine). I am very close to have something nice, but it still needs a lot of things :(

I might finish ITU this semester after all..
Life is full of surprises :)

Wednesday, May 16, 2007

Flash and ITU in general

For many reasons, I was thinking that it might be good (or, not bad) to finish ITU the next semester, and not now(as it was planned).

Since I have a full time job, I am not in a hurry. I like this country and I am planning to stay more anyway.. So, I can continue being a student and meeting more new people while having fun with my last course :)

So, the deadline for the Flash project is not a deadline anymore :D

And I am thinking to spend some more time on social activities and hobbies.
  • I am looking for a dSLR (any suggestions are welcome)
  • I will start playing at Amager Volleyball Klub Mixed Team(already playing at mens team)
  • I will start learning danish.
  • I will travel more.
and more to come..

Thursday, April 19, 2007

Flash

Another thing that keeps me busy these days, is my last course at ITU. The course name is Multimedia Production for the Internet, and mainly it covers animation and programming with Flash.

I have to find something nice to make in flash for my final project(or exam).
I was thinking to implement a small adventure game, but it will require too much time(which I don't have (or I want to spend it elsewhere))..

I am also considering to create a website for Ellas, which is a Greek restaurant situated at Copenhagen..

The back-up solution is to make a useless website with no subject and nothing to say, where I will implement all the techniques that we learned, just to illustrate that I know what I have been taught :)

The deadline/exam is the 22nd of May.

Friday, April 06, 2007

8 Queens and BBDs (Updated)

As I wrote before, I have finished with my Master Thesis.
I have also defended it.
So, it seems that I have plenty of time to write new posts, to have fun, to go out for beers, etc..

The reality is far from this.. :(

One of the things that keep me occupied these days, is that I am working as a Teacher Assistant at the Efficient Artificial Intelligence Programming course. So, instead of enjoying Easter holidays, I will have to implement this in java.

The problem is well known to the community, and it's about placing 8 queens on a chess board. The queens have to be placed in valid positions (not attacking each other) and the algorithm have to check and show to the user only the positions that will lead to a solution. One way to solve the problem is to use Binary Decision Diagrams. That's how we are going to solve it.

So, I have to create the UI and the Logic of the problem, then hide some code from the Logic and let the students figure out how to implement the missing code..

--Update
Maybe I was not very clear..
The problem is NOT ONLY to restrict the row, column and diagonal of the last inserted queen, but to restrict all the board positions that don't lead to a solution. What I mean by that, could easily be seen at this image. If you place a queen at A5, then E6 should be restricted, because irrespective of where the user will put the other queens, the problem doesn't have a solution.
Brute force cannot help much here, because of the complexity of the problem. We have to calculate the permutations of 8 queens on the 64 positions of the board. That means 64!/(8!*56!) permutations.

Actually, it can be done with brute force, but since the algorithm has to be able to solve the n-queens problem efficiently, there are more efficient algorithms and data structures :)

Friday, March 02, 2007

Master Thesis.. The end..

That was it..
However, God can still do something to help me if he wants..
I hope that God still hears me..

Now I have spare time and I don't know what to do.. :)

Wednesday, February 28, 2007

Master Thesis

For those out there wondering why I am not posting anything, I want to say that have been very busy these days writing my thesis..
I will hand it in, on Friday..

God, bless my thesis! God, You are my last hope.. :)

Sunday, January 14, 2007

Fun

Ίσως επειδή έχω πιει λίγο παραπάνω, ίσως επειδή δεν έχω τίποτε τρελό σε σχέση με τα κομπιούτερς και τους αριθμούς να γράψω, αποφάσισα να το ρίξω λίγο στο Α.Μ.Α.Ν.

Ακολουθούν επιλογές..

Μακράν το καλύτερο, ΟΤΕ...


Louka!


A8hnaikes pinakides


gunaikes sto timoni


logikh..


Xasame ton Pappou

Thursday, January 04, 2007

Response.Redirect and ThreadAbortException

Response.Redirect..
That's the method that made me anxious and nervous and pissed off..

When you have a web page(main.aspx) and you want to go to another(second.aspx), you most often use
Response.Redirect("second.aspx");
at the code of main.aspx.

Until one day your project doesn't work and you get a ThreadAbortException.
You cannot imagine the reason, unless you spend some time on the net(or read it here in advance;) ).

The problem is that Response.Redirect(url), calls the Response.End internally, which terminates the thread of the main page from the call stack. That results in this exception.

The best practice, is to use the Response.Redirect(url, false) instead of Response.Redirect(url). False, is a boolean that defines that the thread of the main page should continue to be executed and not terminated.

That's all.. Just one more parameter :)
more info here and here.