Archive for October, 2011

4430981558_1c3d42c908_b

Steve Sanderson continues his series on full-height layouts. Main focus is on phone and tablet UX.

4825343310_76230a6135_b

I started experimenting with Dart. Obviously, one of the first question is: Does it implements tail recursion?

int recursive(int n) {
  if (n <= 0) return 0;
  return recursive(n-1) + 1;
}

int tailRecursive (int n, int acc) {
  if (n <= 1) return 0;
  return tailRecursive (n-1, acc+1);
}

main() {
  int max = 1000000;
  double totalTime = 0.0;
  for (int i = 0; i < max; i++) {
    var start = Clock.now();
    recursive(100);
    var end = Clock.now();
    totalTime += (end - start);
  }
  totalTime /= max;
  print ('${(totalTime/Clock.frequency()) * 1000} ms');

  totalTime = 0.0;
  for (int i = 0; i < max; i++) {
    var start = Clock.now();
    tailRecursive (100,0);
    var end = Clock.now();
    totalTime += (end - start);
  }
  totalTime /= max;
  print ('${(totalTime/Clock.frequency()) * 1000} ms');
}

Well… It seems not.

0.004474 ms
0.004762 ms

My previous post didn’t compare comparable algorithms. Because time complexity was not the same. Sorry for the confusion. First algorithm ran in O(1.618^n) and the other in O(n). Therefore, not comparable in any way! 5 minutes experiments before leaving the office are always bad…

3908122634_0a1b9e2ce6_o

Easy, near from trivial, but really useful. This shall improve the speed and convenience for most users.

I like how source code is clean.

KnockoutJS Custom Binding for Invoking an Action with Enter Key.

2020482513_d6ea3dca47_b

I didn’t had the time (yet) to dive into dart. There is a (unreadable?) specification of the language here that should allow abstract interpretation to detect common errors or issue warnings.

A project to watch, for sure. Especially the VM that will be integrated in Chrome.

468436732_c3f6906f36_b (1)

An other presentation about gamification. Much more weighted than the previous one, comments in the slide are worth reading.