What is the difference between statically typed and dynamically typed programming languages?

Statically typed programming languages do type checking (the process of verifying and enforcing the constraints of types) at compile-time as opposed to run-time.

Dynamically typed programming languages do type checking at run-time as opposed to Compile-time.

Advertisements

Differences between military time and 24 hour time

Military time is very similar to 24 hour time.

There are 2 differences between the military time setting and the 24 hour time setting. Military time uses a leading zero and doesn’t have a colon, while 24 hour time uses a colon but not a leading zero. So 8 o’clock am is shown as 0800 in military and 8:00 in 24 hour time. 8 pm would be 2000(military) and 20:00(24 hour).

Knowing these differences will help with deciding which time format will be of most use for specific purposes.

Quick and easy Left and Right shift operator

Left Shift

x = x * 2^value (normal operation)

x << value (bit-wise operation)

Example:

x = x * 16 (which is the same as 2^4)

The left shift equivalent would be x = x << 4

Right Shift

x = x / 2^value (normal arithmetic operation)

x >> value (bit-wise operation)

Example:

x = x / 8 (which is the same as 2^3)

The right shift equivalent would be x = x >> 3