Chrome leaks saved passwords like GTalk chat incedent
2 pointsby blameless0 comments
// for a graph
var balances = [];
// constants
var winnings = 1,
losses = -1,
epsilon = 0.05;
function play(probOfWinning) {
return Math.random() < probOfWinning ? winnings : losses;
}
for (var experiment = 0; experiment < 100; experiment++) {
var balance = 0;
for (var flip = 0; flip < 1000000; flip++) {
if (flip % 3 == 0) { // game A
balance += play(0.5 - epsilon);
} else { // game B
balance += Math.round(balance) % 3 == 0 ? play(1/10 - epsilon)
: play(3/4 - epsilon)
}
}
balances.push(balance);
}
My most commonly used one is "prop" which generates an automatic property in C#: "public string Name { get; set; }". I type "prop", then hit tab, string is selected and I can change it to any type I want, hit tab again, I can now change the name of the property, hit enter and I'm done Takes 1.5 seconds.