Skip to main content

Posts

Showing posts from September, 2014

C# Brainteasers

Please try to find the output of following code without running it. using System; using System.Collections.Generic; class Program {     static void Main(string[] args)     {         DoSomething("a", "b");         Console.ReadLine();     }     public static void DoSomething<T>(IList<T> set)     {         Console.WriteLine(set.Count);     }     public static void DoSomething<T>(params T[] items)     {         List<T> set = new List<T>();         foreach (T t in items)         {             if (t == null)                 continue;             set.Add(t);         }         DoSomething(set);     } } Answer - it will go in infinite loop and you will get out of stack error. Reason behind this is that CLR thinks converting a List to T[] is easier then converting it to IList. 

Free Web Hosting... :)

Yes, its true, earlier i was using a paid hosting service to host my personal resume web page. I paid 5K+, hosting was on windows server. I though I will use the server for deploying my test project on host servers I did it couple of times but most of the time only my web resume was there. I analyse my needs and come to a conclusion that to host only we small web page, I should not pay 5K. That was the time I started searching for a web hosting services which is free and add free. I came across few free and add free services   and the best of www.hostinger.in   here I am describing the features we get in free account. 2000 MB Disk Space 100 GB Bandwidth 2 MySQL Databases 2 E-mails Accounts Website Builder Script Autoinstaller