George Kosmidis

Microsoft MVP | Cloud Solutions Architect | .NET Software Engineer | Organizer of Munich .NET Meetup | Speaker

C#: Calculating all Greek Public Holidays for any given year

After calculating the Greek Orthodox Easter, it was time for the public holidays calculation. With the Easter calculation ready, it proved to be much easier than expected!

Modified 2 years ago

My next events!

Nürnberg Convention Center NCC Ost
Bernhard-Nocht-Straße 97, D-20359, Hamburg
Microsoft MVP - George Kosmidis

C#: Calculating Orthodox and Catholic Easter

Some time ago I was called about an online calendar for a company’s portal. The need was to inform employees about public holidays for the requested year. In Greece, some of those holidays are static meaning they occur the exact same date each year, but some are based on the Orthodox Easter so they move from date to date. There are a lot of online services that can return these information, but I thought I should give it a go and try writing the Orthodox Easter calculation in C#. Saying that, I found the algorithm online and since I was there I also found the Catholic Easter algorithm.

Modified 5 months ago

SQL Server: Using RANK to display PERCENT (percentage of relevance)

So you end up with a query l that returns what you searched for and with SQL Server Full Text Search engine, and with it the RANK column! How do you end up with a percentage of relevance for your users to enjoy?

Modified 5 months ago

C#: Getting a user IP behind a proxy (HTTP_X_FORWARDED_FOR)

Did you know that HTTP_X_FORWARDED_FOR can return multiple IPs? According to the format is:

X-Forwarded-For: client, proxy1, proxy2

Modified 2 years ago

SQL Server: How to simulate DROP TRIGGER IF EXISTS

I usually store triggers, store procedures, functions, queries etc in sql files in an SVN repository. I then use a simple app I wrote, that just opens each file and executes it. The problem of course is CREATE and ALTER. I can’t use CREATE because the same trigger might already be there. On the other hand I couldn’t use ALTER because some triggers might be new.

Modified 5 months ago
SQL Server: Using .NET assemblies (SQLCLR)

SQL Server: Using .NET assemblies (SQLCLR)

SQLCLR is a technology for hosting of the .NET CLR engine inside SQL Server. Adding an assembly can be a lifesaver sometimes, since the limitations of coding in TSQL stored procedures, triggers or functions are a lot and profound.

Modified 2 years ago

SQL Server: Weird behavior with CONTAINSTABLE, ISABOUT and weighted terms

I came across the following weird behavior in an ISABOUT query in SQL SERVER, that involves the weight keyword and the final rank of the results. I want to describe this behavior here, just in case someone has a good explanation for it!

Modified 5 months ago