Taswar Bhatti
The synonyms of software simplicity
Archive: December 2013
iis8

If you are running Windows Server 2012 with IIS8 and you got this error HTTP Error 500.19 – Internal Server Error. If you web.config file contains “handler” or “modules” tag. In order to fix this, launch cmd or powershell and execute these 2 commands inside of C:\Windows\System32\InetSrv

This will unlock the handlers and modules […]

dotnet C#

In C# there is a params keyword which allows a method parameter to take variable number of arguments. MSDN Some notes on param It must always be the last parameter in the function/method definition There can only be one params keyword in a function/method parameter signature Example:

But by changing it to params we […]

phantomjs

Thanks to everyone who came out last night at OttawaJS for the phantomjs talk, the slides are located at slid.es. You can find the code in my github account. https://github.com/taswar/ottawajs-dec2013 A recap of things we covered: Simple screencapture CoffeeScript with phantomjs Scraping hackernews and dzone site for links using webdriver to integrate with phantomjs (python […]

dotnet C#

In C# there is the out parameter keyword which causes arguments to be passed by reference. It is like the ref keyword, except that ref requires that the variable be initialized before it is passed. Example:

The out parameter keyword provides a way for a method to output multiple values from a method without […]

dotnet C#

In C# when using the ref keyword it causes an argument to be passed by reference, not by value. In order to use a ref as a parameter, both the method definition and the calling method must explicitly use the ref keyword, and also the variable must be initialized before passing in. In the example […]

dotnet C#

.NET provides in its System.IO namespace the Path class which performs operations on String instances that contain file or directory path information. These operations are performed in a cross-platform manner. Most of the time we see develeopers writing code like

But by using Path.Combine we can provide a cross platform path

By using […]

GhostDoc

Recently have been going through some old code to review the comments in them from other developers and what I find out is developers tend to have really bad comments & documentation in their code Example:

From the above code it is obvious that it is the constructor but does the comment tell me […]

UA-4524639-2