If you are new to the Mac, everything can feel a bit off. This post tries to help. And might even teach you something new if you are already familiar with the Mac. I am also mentioning some advanced things which should be interesting for programmers and people coming from Linux.
The JavaScript server environment node.js has an intriguing approach to coding: Do other things while waiting for results from, say, a database. But don’t use threads to juggle those things, use continuations. This is similar to what client-side JavaScript code (such as Ajax calls) already looks like. Not having to create threads saves a lot of overhead when loads are high. Multi-core and multi-processor systems can still be supported, by scheduling one “instance” of node.js per core/processor.
The only problem with node.js code: You get one nested function expression for each outside request you make.
If a storage device is connected to a Mac via USB or Firewire, you can eject it so that it disappears from your Mac. This post explains how to remount it, without unplugging it and then plugging it back in. This is mainly of interest if you use an external (non-SSD) hard drive with Time Machine: After a backup, if you don’t want it to make any noise, you can eject it and it spins down. Then the problem is how to remount it for the next backup.
Update 2012-08-14: Rewrote most of the post, added Sect. 4 explaining typeof and instanceof.
This blog post explains that JavaScript has two main kinds of values: primitive values and objects. There are several things one needs to be aware of when working with them.
Creating objects via constructor functions is fairly straightforward in JavaScript. But as soon as you want to do inheritance, things become complicated. This post examines how inheritance works in traditional JavaScript. It then presents four APIs that make things easier, without adding too much bulk to the language: ECMAScript 5, YUI, Prototype.js, and John Resig’s Simple Inheritance.
Ich war vorgestern auf einem Vortrag über die zweite münchner Stammstrecke, gehalten von Martin Runge, dem Fraktionsvorsitzenden der Grünen im Landtag. Da bei diesem Thema Parteiinteressen eine relativ geringe Rolle spielen (OB Ude ist für die zweite Stammstrecke, ebenso die Staatsregierung), war ich mir relativ sicher, objektiv informiert zu werden. Dieser Blogeintrag ist meine Mitschrift des Vortrags. Als Münchner ist es wichtig, die folgenden Tatsachen zu kennen, denn momentan besteht noch die Möglichkeit, die zweite Stammstrecke zu verhindern und die in vielerlei Hinsicht bessere Alternative des Südrings zu ermöglichen. Zusammenfassung: Die zweite Stammstrecke ist weit teurer, als wir uns momentan leisten können, bringt erstaunlich wenig, und würde erst sehr spät fertig werden.