Category: C Sharp Tricks

Why do Java developers wear glasses?
Because they do not C#.

C# – Heap Sort Algorithm

The last week I was fighting with algorithms again. 🙂 Thus, I had to implement the mighty heap sort in C# and here is what I came up with. The idea of the code below is the following: In line 68

Tagged with: , ,

Python – Times the dice is same as previous or next

  Today, after playing some interesting board games, I was wondering about some probabilities with dice. As far as I did not want to calculate them with statistics methods (and it is always funnier to make a simulation), I have

Tagged with: , , , ,

C# Algorithms – Phone Book Implementation – List of int and string with a tuple

Today I had to write a solution of the following problem – imagine you have two lists like this:

  What I needed to write was a program, printing the names of the users in liNumbers. Something like this. As

Tagged with: , ,

C# Algorithms – Calculation of Squared Root with Binary Search

Binary sorting is something trivial in algorithms – it is trivial, because a lot of people know how to do it, but because even those who claim to be the professors in algorithms and be the wise guys in the area

Tagged with: , ,

C# Algorithms – Usage of Nested Lists and TryGetValue of Dictionary

Since the beginning of the month, I am visiting a course called Algorithms. As far as I have to work with one of the following languages – C#, C++, Java or Python and somehow Python is rather slow for such

Tagged with: , , , ,

C# Algorithms – Bubble Sort

After working out Selection Sort, Count Sort and Insertion Sort, I have decided to continue with the last easy sorting method – Bubble Sort in C#. The other advanced sorting, using recursion can also be found here, but I am

Tagged with: ,

C# Algorithms – Selection Sort and Count Sort

After writing yesterday about the insertion sort algorithm with Python here, today I have decided to continue with the algorithms. Thus, I have decided to take a look at two other simple sorting algorithms – Count Sort and Selection Sort.

Tagged with: , , , ,

C# – Make your own query language

Well, most probably the answer depends on the query language 🙂 Here is the task: Problem 3 – A query language over a CSV file A CSV files (comma separated values) can be represented as a table. For example this

Tagged with: , , , ,

C# – A simple interface with 3 classes in C#

In the current article, I will show how to resolve with VBA an entry exam for programming in HackBulgaria. The problems could be resolved in any language and I will use VBA for this last task. The program is actually the

Tagged with: , , ,

C# – Masking words in a text

Imagine you are the owner of a web site with a lot of comments (not like this one, where noone comments due to the fact that he should do it with his Facebook account 🙂 ). In this site there

Tagged with: ,

C# – Animate a ASCII picture in Console

I was searching for a way to animate a picture in the C# console and I managed to find something quite good here. Then it was quite easy, to do the animation – the key was in the adding of the line

Tagged with: , , ,

C# – Building classes in C# – Video

In this article I present the second solution from the homework from SoftUni – – concerning classes in C#. This is the task: Define a class Laptop that holds the following information about a laptop device: model, manufacturer, processor, RAM,

Tagged with: ,

C# – Defining Classes Homework from SoftUni – Video

In the current article, I will show you the code of a solution of one homework from the SoftUni ( The solution is built in YouTube and you may take a look at it, if you want to hear me speaking

C# – Enumeration – Classes builders

This week I have started again to look into Object Oriented Programming with C#. Thus, I have built a small example of OOP, using Enumeration. In the example I have two classes – the class “RunningCar”, containing the Main method

Tagged with: , ,

C# – Defining Classes – SoftUni Homework

Some time ago I wrote a homework, concerning building classes. The easiest part of it looked like this as a task: Define a class Person that has name, age and email. The name and age are mandatory. The email is optional.

Tagged with: , ,

C# – Basic Exam – Wine Glass

As mentioned in the previous two articles, here (Biggest Triple) and here (Fruit Market) I have participated in one competition for C# basic programmers. So, in this article I will present the 3rd exam problem, which I have managed to

Tagged with: , , ,

C# – Basic Exam – Biggest Triple

As I have mentioned here, I have participated in a competition for C# programmers. The second problem was concerning something quite standard – finding the biggest triple from a line of numbers.  With other words, one get as an input the

Tagged with: , , ,

C# – Basic Exam – Fruit Market

On the 14.04.2014 I have applied for the SoftUni – a Software University in Sofia, Bulgaria. There were 5 C# problems and I managed to resolve completely 3 of them, thus gaining 300 points and being ranked in 278 place

Tagged with: , ,

C# – Eggcellent – Painting on the console

Sometimes, you may see something that seems rather easy to be achieved, you have a vision in your mind regarding it and it still takes 5 times more time and patience to get it. Today, after taking a look at

Tagged with: , , ,

C# – Binary Operations – Count of Binary Digits Count

The binary operations problems are probably the ones, that can easily make a student to quit with programming tasks. They are somehow too abstract and the fun they bring is really doubtful. Anyway, in contests for programming so far, I

Tagged with: , , ,

C# – Taking only numbers from array and working with them – (The Horror)

Looking into some programming task is sometimes challenging. You may think that the answer is quite simple, but actually someone has decided to make you sweat. In this task  you should read one line from the console and print the sum

Tagged with: , , , ,

C# – Conversion of text array to integer array

In the current article I present an interesting problem, concerning conversion of text array to integer array. The casting of values in arrays has always been a problem for people without much experience and with the current text I will

Tagged with: , , ,

C# – Simple Counter of Values in Array – Miss Cat 2011

On the mood to find some solutions for old C# programming contests, I have decided to take a look at a quite simple problem and to give it a try again. I wanted to come up with a solution using List<int>

Tagged with: , , ,

C# – “Painting” with the console – Kaspichania Boats

Today I have decided to take a look at some new C# contest problems, for C# level 1 of the Telerik Academy. I thought that this would be rather easy for me, as far as I have successfully passed the

Tagged with: , , , ,

C# – Dictionaries and simple actions with them

The dictionaries in C# are quite interesting feature. For a person, coming from the VBA world ( 🙂 ), this feature is quite interesting and new. A lot has been said in the internet about dictionaries, so I will not try

Tagged with: , , , ,

C# – A little bit about Lists < T >

In this article I will present some good and worthy examples about the usage of Lists in C#.Net. There are quite a lot good articles for lists and their usage, this one will try to summarize their examples and and

Tagged with: , , ,

WPF – Triggers and Styles – Pro WPF 4.5 in C# book

Some time ago I started reading this book – Pro WPF 4.5 in C#. As far as it was given to me in order to write some reviews on it, today I have decided to write something about chapter 11.

Tagged with: , , ,

C# – WPF – 23 Well Written WPF Control Examples

In this article I present a code from the book “Pro WPF 4.5. in C#“, which I consider useful and interesting. This example has impressed me with its structure – it simply gives good practises for creation of 23 different

Tagged with: , , , , , , , , , , , , , , , , , , , , , , , , , , ,

C# – WPF – Generate an Excel file with WPF

In the current article I proudly present a simple application, which creates a simple Excel file from XAML. In the example I present I am using Excel 2010 as this is my current version. In order to be able to

Tagged with: , , , , , , ,

C# – WPF – EightBall Application – simple code

In this article I present a code from the book “Pro WPF 4.5. in C#“, which I consider useful and interesting. The application concerns building a simple program where you may ask a yes-no question and get a random answer.

Tagged with: , , , , , , , ,