AS3 for each … in vs for … in

Friday, December 16th, 2011

If you’re like me, remembering which version of the AS3 for … in loop does what is practically impossible.

So here is a reminder:

for each … in

Very simply, the for each … in loop iterates through the values of all properties associated with an object.

Example:

var obj:Object = {
  name:"Will Smith"
  occupation:"Actor"
};

for each (var prop in myObject){
trace(prop);
}

The above snippet will print the following:

Will Smith
Actor

for … in

Conversely, the for … in loop iterates through the name of each property associated with an object.

Example:

var obj:Object = {
  name:"Will Smith"
  occupation:"Actor"
};

for (var prop in myObject){
trace(prop);
}

The above snippet will print the following:

name
occupation

Hope this helps clear up some confusion!

weak password woes

Sunday, January 31st, 2010

Passwords are still too weak for the most part.Well, here we are in the 21st century – the second decade of the 21st century, even, and Internet security, specifically the problem of weak passwords, still plagues our society.  A new study, based on analysis of 32 million passwords, shows that the most popular password is – can you guess? – “123456″.  One in five users leaves a key under the virtual doormat with obvious passwords like “qwerty”, “password”, “iloveyou”, or “princess”!  (original story here).

Why is it that we can’t pick secure passwords?  It seems it’s just human nature.  A password that is secure is, by definition, hard to remember for a human.  Here are five tips that will help your passwords remain secure. (more…)