How to check if a value is a double value in Android (Java)

To check if a value is a double value in Android you can use the snippet below.

Samples

Java (Android) Sample

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

IsSmallerThan generic extension method for C# and VB.NET

This is the IsSmallerThan generic extension method, this extension method which is part of the Fesslersoft.Extensions. It should only work with numeric values.

Samples

Sample C#

Sample VB.NET


If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

IsLargerThan generic extension method for C# and VB.NET

This is the IsLargerThan generic extension method, this extension method which is part of the Fesslersoft.Extensions. It should only work with numeric values.

Samples

Sample C#

Sample VB.NET

If you have any questions or suggestions feel free to rate this snippet, post a comment or Contact Us via Email.

Related links:

Please rate this snippet

How to check if a variable exists in Python

To check if a variable exists in Python, you can use the snippet below.

Sample Python

if 'myVariable' in locals(): # myVariable exists locally.
if 'myVariable' in globals(): # myVariable exists globally.

Please rate this snippet

How to get the Month name of a Datetime in C# and VB.NET

To get the Month name of a Datetime in C# and VB.NET you can use the following snippet.

Sample C#

Console.WriteLine(new DateTime(2010, 1, 1).ToString("MMM", CultureInfo.InvariantCulture)); //Jan
Console.WriteLine(new DateTime(2010, 1, 1).ToString("MMMM", CultureInfo.InvariantCulture)); //January

Sample VB.NET

Console.WriteLine(New DateTime(2010, 1, 1).ToString("MMM", CultureInfo.InvariantCulture))
'Jan
Console.WriteLine(New DateTime(2010, 1, 1).ToString("MMMM", CultureInfo.InvariantCulture))
'January

Please rate this snippet

IsNull extension method for C# and VB.NET

You can use the IsNull Extension method by using the snippet below.

Sample C#

public static bool IsNull(this object source)
{
     return source == null;
}

Sample VB.NET

<System.Runtime.CompilerServices.Extension> _
Public Shared Function IsNull(source As Object) As Boolean
	Return source Is Nothing
End Function

As always, this extension method has been added to the Github Fesslersoft.Extensions Repository

Please rate this snippet

How to check if a number is a power of 2 in C# and VB.NET

To check if a number is a power of 2 in C# and VB.NET you can use the following extension method.

Sample C#

public static bool IsPowerOfTwo(this ulong input)
{
    return (input != 0) && ((input & (input - 1)) == 0);
}

Sample VB.NET

<System.Runtime.CompilerServices.Extension> _
Public Shared Function IsPowerOfTwo(input As ULong) As Boolean
	Return (input <> 0) AndAlso ((input And (input - 1)) = 0)
End Function

As always, the extension method was added to out Fesslersoft.Extensions library @Github

Please rate this snippet

How to get the path of the active app.config file in C# and VB.NET

To get the path of the active app.config file in C# and VB.NET you can use the following snippet

Sample C#

AppDomain.CurrentDomain.SetupInformation.ConfigurationFile;

Sample VB.NET

AppDomain.CurrentDomain.SetupInformation.ConfigurationFile

Please rate this snippet

How to check if a character is Uppercase in C# and VB.NET

To check if a character is Uppercase in C# and VB.NET you can use the following Extension Method

Sample C#

/// <summary>
///     Checks whether the character is an uppercase Character or not
/// </summary>
/// <param name="inputChar"></param>
/// <returns>True or False depending on the character</returns>
public static bool IsUpperCase(this char inputChar)
{
	return inputChar >= 'A' && inputChar <= 'Z';
}

Sample VB.NET

''' <summary>
'''     Checks whether the character is an uppercase Character or not
''' </summary>
''' <param name="inputChar"></param>
''' <returns>True or False depending on the character</returns>
<System.Runtime.CompilerServices.Extension> _
Public Shared Function IsUpperCase(inputChar As Char) As Boolean
	Return inputChar >= "A"C AndAlso inputChar <= "Z"C
End Function




Please rate this snippet

How to check if String is Null or Empty in XSL

To check if String is Null or Empty in XSL you can use the following snippet.

Sample XSL

<xsl:choose>
    <xsl:when test="fieldToTest != ''">
        <xsl:value-of select="Field1Value" />
    </xsl:when>
    <xsl:otherwise>
        <xsl:value-of select="Field2Value" />
    </xsl:otherwise>
</xsl:choose>

Please rate this snippet