George Kosmidis

Microsoft MVP | Speaks of Azure, AI & .NET | Founder of Munich .NET
Building tomorrow @
slalom
slalom

C#: Basic Combinatorics

Basic combinatorics in C# is a straight forward task for relatively small numbers like (100!). This is a helper class I wrote when I was asked to write an online lottery system.

Keep in mind though, that for bigger numbers (above 100!) you will need Arbitrary-precision arithmetic.

Here is the code and please, if someone knows a faster way or has some suggestions let me now!

Modified 4 years and 1 month ago

Visual Studio 2012.4, “Run As Administrator” -> “The application cannot start” error

After a good 2 hours of searching what the **** happened and Visual Studio stopped working, I finally found a working solution..!

Modified 3 years ago
Microsoft MVP - George Kosmidis

Export MS SQL Database schema with C#

A few days ago I was searching for a way to export MS SQL schema of all databases of a server for backup and migration purposes. Although I found some tools, what I needed was a way to get stored procedures, functions, views, triggers and everything even if it was encrypted.

Modified 3 years ago
Azure Architecture Icons - SVGs, PNGs and draw.io libraries

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 4 years and 1 month ago

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 3 years 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 3 years 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 http://en.wikipedia.org/wiki/X-Forwarded-For the format is:

X-Forwarded-For: client, proxy1, proxy2

Modified 4 years and 1 month ago