Wired's Hide and Seek

7th February 2010; Discussion

So I read this article about an attempt of one air force analyst to sell secrets to Iraq and China and there author claims that two puzzles created by Regan (the spy in question) were sent to the National Security Agency, where cryptanalysts spent hundreds of hours without any result. Then, they found some other guy that cracked the first code and apparently it was enciphered with Caesar’s shift.

Now, are they telling me that NSA cryptanalysts failed to break Caesar’s code? Because I can hardly believe in that.

KHUH LV D ZHE SDJH ZKHUH BRX FDQ SODB ZLWK WKLV FLSKHU: FDHVDU VKLIW FLSKHU.

4.4. Dress Code

Since attendees must wear their name tags, they must also wear shirts or blouses. Pants or skirts are also highly recommended. Seriously though, many newcomers are often embarrassed when they show up Monday morning in suits, to discover that everybody else is wearing T-shirts, jeans (shorts, if weather permits) and sandals. There are those in the IETF who refuse to wear anything other than suits. Fortunately, they are well known (for other reasons) so they are forgiven this particular idiosyncrasy. The general rule is “dress for the weather” (unless you plan to work so hard that you won’t go outside, in which case, “dress for comfort” is the rule!).

The Tao of IETF: A Novice’s Guide to the Internet Engineering Task Force

Brewer's CAP Theorem

5th February 2010; Discussion

Brewer’s Theorem is pretty neat. It essentially states that you cannot have a clustered system that supports consistency, availability and partition-tolerance at the same time. So, if you want to build a nice clustered system you have to stop partitions from happening, or accept the fact that from time to time affected services will either be unavailable or inconsistent.

Eric Brewer presented this theorem in 2000 and two years later it was proved to be correct by Seth Gilbert and Nancy Lynch of MIT.

I was introduced to this theorem through a pretty good article by Julian Browne: Brewer’s CAP Theorem. Also, there is another interesting article—A CAP Solution (Proving Brewer Wrong)—in which author claims that consistency, availability and partition-tolerance is possible if we loosen the at the same time condition.

ACM ICPC 2010 World Finals

Gold medals go to teams from Shanghai Jiaotong, Moscow State, National Taiwan and Taras Shevchenko Kiev National universities.

In the 1790s, when the Bill of Rights was ratified, any two people could have a private conversation—with a certainty no one in the world enjoys today—by walking a few meters down the road and looking to see no one was hiding in the bushes. There were no recording devices, parabolic microphones, or laser interferometers bouncing off their eyeglasses. You will note that civilization survived. Many of us regard that period as a golden age in American political culture. — Whitfield Diffie
Buxton, whose warm waters have made thy name famous, perchance I shall visit thee no more—Farewell. — Mary, Queen of Scots on her last visit to Buxton

Quick JavaScript profiling

17th January 2010; Discussion

The text below was posted on my old blog in August, 2008. Since I still use this technique, I think it is worth moving it here.

Sometimes, you need to know how many times a function was executed and how much time did it take. It is not a problem if you have good profiling tools, but sometimes they are not available. A few months ago I was optimizing my code in some very early Fx3 build and the tools I use were not ready yet (Firebug was too buggy to use and Venkman didn’t work at all). So I was on my own. Fortunately, in javascript, you can monkey patch already created functions and insert your profiling code there:

function p_register(func_name) {
  var func = window[func_name];
  var h_name = "__" + func_name + "__";
  window[h_name] = func;
  window[func_name] = function() {
    // start profiling
    var result = window[h_name].apply(window, arguments);
    // store profiling results
    return result;
  };
}

In the code above, I’ve copied the function and replaced the original with a new one which contains my profiling code and a call to the hidden copy. So, every call to a function I wanted to profile was counted. As for the bottleneck, it was about prototype.js, its `Element.hasClassName` method and elements extension: it was too expensive to use them with a lot of elements, so I wrote a tiny func which acted just as `.hasClassName` but without element extension.

Seattle Space Needle and downtown, a few days go.

Seattle Space Needle and downtown, a few days go.

The Seattle Central Library

10th January 2010; Discussion

The Seattle Central Library, Level 3

The Seattle Central Library is one of the best things I saw here, in the United States. Not only it has a pretty large collection of books, its building is very beautiful. The 11-story glass and steel building in downtown Seattle, it has wonderful interior, gets tons of natural light and contains a lot of reading spots with power sockets and free wireless internet. And it is free to use for everybody (well, at least I paid nothing and nobody stopped me).

Read More

Possible memory leak in Chrome

8th January 2010; Discussion

If you are writing an extension for Chrome, it is probably not a good idea to log everything since the browser does not have any limit on how many console messages to store.