How to detect Mobile Device Browsers?
We can easily detect the Mobile device browsers using the following C# code.
public bool IsMobileDevice(string UserAgent)
{
bool result = false;
Regex b = new Regex(@"(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge.
How to hide the first option of a select using jQuery
When using "jquery.selectbox.js" plugin the "select & option" tags will be converted into "ul li" at run time. In this case it's hard to hide the first option using the normal select option script. The following solution rectifies this situation..
Find the Distance between 2 Latitude Longitude Co-Ordinates using Haversine formula
The following function is used to find the distance between two Latitude & Longitude co-ordinates using Haversine formula.
The haversine formula is an equation important in navigation, giving great-circle distances between two points on a sphere.
Microsoft SQL Server Function to Get Ordinal Suffix of a Number
This AddOrdinal function will be useful when we needed to display the date format as 1st July -3rd October. There is nothing in there about ordinals, but it can't be done using String.Format. However it's not really that hard to write a function to.
PHP Code to Get Ordinal Suffix of a Number
It's a user-defined function which is a lot simpler than you think. Though there might be a .NET function already in existence for this, the following function (written in PHP) does the job. It shouldn't be too hard to port it over. This ordinal function.
C# Code to Get the Latitude and Longitude Co-Ordinates of a Place using Address or Zip-code
The following C# Code is used to get the Latitude and Longitude Co-Ordinates of a particular place anywhere in the World using the Address or Zip-code. To get the Latitude and Longitude Co-Ordinates using Address, call the function like this, getLatLong("Briarwood,.
C# Code to Get Ordinal Suffix of a Number
There is no inbuilt capability in the .NET Base Class Library to get the Ordinals. This AddOrdinal function will be useful when we needed to display the date format as 1st July -3rd October. There is nothing in there about ordinals, but it can't be.