Posts Tagged With: type

Find files of a specific mime-type

Tagged with: , , , , , , ,

Use this command to find files of a given mime-type. In this example, we are looking for video files…


find -type f -print0 | xargs -0 file -i | grep -i video

And, by the way, this command, and the last two commands were sponsored by Mahesh. Happy now?

No Comments »

File Command

Tagged with: , , ,

Find the contents of a file using this commande


file filename.txt
No Comments »

Dynamic/Static/Strong/Weak Types

Tagged with: , , , , , ,

A dynamically typed language is a language where the type of a variable can be altered at any time. (It is a string, now it is a Fixnum, now it is a Time object, etc.)

A statically typed language is the opposite. (Decide what x is once for all and don’t change your mind!)

A strongly typed language is a language that is being strict about what you can do with your typed variables. (Don’t mix them… or I will throw you an error in the face!)

A weakly typed language is the opposite. (Do what you want with your different types. Mix them all! We’ll see what happens!)

Original Article

[tags]type,types,duck,static,weak,strong,dynamic[/tags]

No Comments »

Object or Array

Tagged with: , , ,

Find whether the given variable is an object,or is an Array?

function isArray(testObject) {
    return testObject && !(testObject.propertyIsEnumerable('length')) && typeof testObject === 'object' && typeof testObject.length === 'number';
}

Original Page
[tags]javascript,object,array,type[/tags]

No Comments »