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

How to select an element with its name attribute in jQuery

To select an element with its name attribute in jQuery you can use the snippet below.

Samples

Javascript Sample

if you remove the div in div[name=”de.Fesslersoft.Testname”] you will get all elements with the specific name.

You can also have a look at this JSFiddle.

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

What is the difference between typeof(), GetType() and IS in C# and VB.NET

What is the difference between typeof(), GetType() and is?

  • typeof() takes a type name specified at compile Time.
  • GetType() gets the Type of an Object at runtime
  • is returns true if an instance is in the inheritance tree. Since the is Keyword is casting the object, you should use it with care.
  • here is an example.

    class Employee { } 
    class Developer : Employee { }
    
    void PrintTypes(Employee e) { 
        print(e.GetType() == typeof(Employee)) // false 
        print(e is Employee)                   // true 
        print(e.GetType() == typeof(Developer))    // true
    }
    

    Please rate this snippet

    How to check if an array contains a value in Javascript

    To check if an array contains a value in Javascript you can use the snippet below.

    Sample Javascript

    Array.prototype.inArray = function (inputValue) {
    	var counter;
    	for (counter=0; counter < this.length; counter++) {
    		if (this[counter] === inputValue) {
    			return true;
    		}
    	}
    	return false;
    };
    

    Please rate this snippet

    How to disable comments on posts older than date X in WordPress

    To disable comments on posts older than date X in WordPress you can use the snippet below.

    Sample mySQL

    UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2013-01-01' AND post_status = 'publish'
    

    Please rate this snippet

    How to remove any post that is older than X days in WordPress

    To remove any post that is older than X days in WordPress you can use the query below.

    Sample mySQL

    DELETE FROM wp_posts WHERE post_type = 'post' AND DATEDIFF(NOW(), post_date) > X
    

    Please rate this snippet

    How to check if a Form is Open in C# and VB.NET

    To Check if a Form is open in C# and VB.NET you can use the snippet below.

    Sample C#

    public static bool FormIsOpen(FormCollection application, Type formType)
    {
    	//usage sample: FormIsOpen(Application.OpenForms,typeof(Form2)
    	return Application.OpenForms.Cast<Form>().Any(openForm => openForm.GetType() == formType);
    }
    

    Sample VB.NET

    Public Shared Function FormIsOpen(application__1 As FormCollection, formType As Type) As Boolean
    	'usage sample: FormIsOpen(Application.OpenForms,GetType(Form2)
    	Return Application.OpenForms.Cast(Of Form)().Any(Function(openForm) openForm.[GetType]() = formType)
    End Function
    

    Please rate this snippet