Tuesday 19 September 2017

JAVASCRIPT EQUALITY OPERATOR


You’re marvelling why that part of code inside an if block is being executed while you expected it to be glance right! Well, let’s easy and see what’s incident under the hood to understand why quite that is happening.
You’re awestruck why that piece of code inside an if block is being performed while you expected it to be fly right! Well, let’s try and see what’s happening bottom the hood to understand why strictly that is happening.
Javascript supports two types of equality operators:
  • The Equality Operator(==) and
  • The Strict Equality Operator (===)
The equality operator deal with the “types” of the operands being compared and applies some rules on the operands with honour to type conversion.

web zone
web zone

Two values are strictly equal only if they have the same type and the same value. We will focus on the equality operator in this post since, well, there’s not much to highlight with respect to the strict equality operator J.
I hope you are aware of the primitive data types in JavaScript:
  • Boolean
  • Strings
  • Numbers

CASE1HAVING THE SAME TYPE OF BOTH OPERANDS 

This is the easiest case. If both the operands are of the same type, then compare their values. No type conversion required.

CASE 2COMPARE A STRING AND A NUMBER

  1. The string is converted to a number.
    1. Does the string represent a valid number: Compare the values.
    2. The string does not have a valid number(NaN): Return false.

CASE 3COMPARE A BOOLEAN TO A NUMBER

  1. Convert the Boolean to a number. True evaluates to 1, false evaluates to 0.
  2. Compare the values.

CASE 4COMPARE A BOOLEAN TO A STRING

  1. Convert the Boolean to a number. True evaluates to 1, false evaluates to 0.
  2. Convert the String to a number.
  3. Compare the values.

CASE 5COMPARE UNDEFINED TO NULL

Evaluates to true. Strange but true. Since both null and undefined represent “no value” (i.e. an object with no value and a variable with no value respectively.)

SOME RULES OF TYPE CONVERSION:

  • The string” ” converts to 0
  • Anything compared to NaN evaluates to False.
  • Anything (except null) compared to Undefined evaluates to False.

Thursday 14 September 2017

Pentagon Still Running Windows 95 , 98 and Windows XP


It’s shocking Pentagon still uses Windows 95 and 98 on Critical systems even today. The United Staes Department of Defence is planning to migrate to Windows 10. And this migration is part of a broader effort announced in collaboration with Microsoft. And the transition to the new operating system is projected to be finalized in the fall of this year.

Pentagon Running Older Windows Version

It is always recommended to use the latest operating system with patches. However, Pentagon is still running older Windows versions like Windows 95, 98 and XP.
Speaking about Pentagon’s efforts to boost security of its systems, Daryl Haegley, program manager for the Office of the Assistant Secretary of Defense for Energy, Installations and Environment, has revealed that many of the critical computers are currently powered by unsupported Windows versions. And this includes not only Windows XP (which is no longer getting updates since April 2014) but also releases that are more than 20 years old.
Cyber Security
“About 75 percent of the devices that are control systems are on Windows XP or other nonsupported operating systems,”  he said. In addition, he stated these stats were collected after visits to different 15 military sites.

Is it safe to Run Older Operating System?

Haegley says there’s no reason to worry because these computers do not have an Internet connection. So, they are harder to hack. This isn’t impossible, especially if these systems are part of larger networks where other computers are connected to the web.
“A lot of these systems are still Windows 95 or 98, and that’s OK—if they’re not connected to the internet,” Haegley explained.
DefenseOne says that systems running Windows 95 or 98 feature sensors that connect to the Internet anyway. So, they’re more or less vulnerable to attacks. And running old operating systems certainly doesn’t help.
In the end, Haegley calls for security researchers to look for vulnerabilities. They are not only looking into websites but also in critical systems which could be exposed to cyberattackslaunched by other states.