Menu

If you ever write a varags method…

November 08, 2010

In some specific cases, methods with a variable argument list might greatly improve the usability of an API. However, it is very easy to overuse or misuse this language feature, leading to cumbersome APIs. Varags methods shine when the programmer knows how many arguments must be passed to a specific invocation of the method when… Read more

Practical Scala/Java interoperability by small examples

September 14, 2010

If you try to combine Java code with Scala in your application, everything seems to go fine until you bump into big differences between Java collections and Scala collections. A Scala Traversable is not Java Iterable and vice versa; maps are different, etc. So, in practice, you have to do conversion. Fortunately, there are pretty… Read more

Autonomy, Mastery and Purpose

May 31, 2010

Behavioral science and specifically motivational science is fascinating. When you wake up, what drives you? Dan Pink, in his recent book Drive: The Surprising Truth About What Motivates Us, identifies three principal factors: autonomy, mastery and purpose. Check out the video below to get an excerpt.

jQuery.data(): underappreciated

May 28, 2010

One of the most underappreciated jQuery methods has to be .data(). It allows you to associate arbitrary named values with DOM elements. Usage is simple:   $(“body”).data(“x”, 1); $(“body”).data(“y”, someObject);   You can store any data types and expect the same back.   As a web developer, I’m sure some of you have assigned arbitrary… Read more

Hosting Stanford’s Palo Alto Bike Tour

May 22, 2010

Yesterday, we had the pleasure to host the first “Stanford Bike Tour” organized by Ibrahim Elbouchikhi. It is a chance for Stanford students to hop on a bike, and cross over to the neighboring valley!

Opera takes the cake

May 17, 2010

In Firefox, Chrome, and Safari, timeouts passed to setTimeout are subject to signed 32-bit integer arithmetic overflow. For instance, the following code shows an alert immediately, as if zero or a negative value had been supplied. setTimeout(function() { alert(‘hi’) }, 2147483648); Internet Explorer has the same problem, except they use unsigned 32-bit integers. Try this… Read more