Home

Installation failed while installing SQL Server 2008

Installing the Default instance of SQL Server 2008 R2 Express with Tools on a Windows 7 64bit failed with error: Error Says: Rule “Same architecture installation” failed. The CPU architecture of installing feature(s) is different than the instance specified. To…

UnsupportedClassVersionError-Unsupported major.minor version

UnSupported major.minor error

java.lang.UnsupportedClassVersionError happens when you’re trying to load a Java “class” file that was compiled with a newer version of Java and you are trying to load(run) it with an older version. In other words, it could mean that Your system…

How to Merge two or more Lists in C#

Suppose we have 2 Lists of Products, and we want to make it one List. List<Product> products1 = GetProducts(cid1); List<Product> products2 = GetProducts(cid2); One way is to iterate the 2nd List, and add all elements to the 1st List, or iterate both…

Make a reserved keyword a Variable name in C#

Reserved keyword as variable name

In C# the ‘@‘ character is used to denote literals that explicitly do not adhere to the relevant rules in the language specification. If we use a keyword as the name for an identifier, we get a compile-time error “identifier expected,…

Why interface cannot have static method – C#

Interface cannot have static method

We cannot have a static method inside an interface, like below: public interface Foo { public static int bar(); // compile time error } This will be a compile time Error saying: The modifier ‘static’ is not valid for this…

Remove item from List while iterating – C#

Remove items from list while iterating

Removing elements from List<> while iterating over the List, someone may simply try: foreach(char c in list)  {      list.Remove(c);  } But, When we execute this code, we will get System.InvalidOperationException with the message “Collection was modified; enumeration  operation may not execute.” The reason is: The…

Merge Lists and Removing duplicates C#

Merge Lists by Removing Duplicates

We have 2 Lists and we want to make it one and also remove the repeating values, i.e., we want a Union of the two Lists but no repeating value.We can always do it by iterating the 2nd List, and…

Get System IP Address using VBScript

vbscript for getting IP

Following is the code to get the IP Address of the system using VBScript (.vbs) dim Nics, StrIP Set Nics= GetObject(“winmgmts:”) .InstancesOf(“Win32_NetworkAdapterConfiguration”) For Each Nic in Nics if Nic.IPEnabled then StrIP = Nic.IPAddress(i) Wscript.Echo “IP Address: “&StrIP wscript.quit end if…

Parse and get xml node using php

XML Parsing using PHP

XML parsing essentially means traversing through the XML and returning the data. Nowadays, A number of web services return data in JSON format, but a large number still use XML. There are two methods for loading XML, the simplexml_load_file() will load the…

When will Gregorian and Islamic calendars intersect?

islamic calendar fact

One can be curious to observe that the Islamic calendar year is about 11 days shorter than the Gregorian calendar year, so there will come a point when these calendars will intersect each other. So, Islamic and Gregorian are not…