Yesterday, I open-sourced “Lock With A Clock”—a small BlackBerry™ application I originally had developed three years ago.
As the process of setting up a build environment on Mac OS X (without using a Windows VM, or using Rosetta to run old PowerPC binaries) is somewhat dreaded, I took the liberty to fully document all necessary steps in the accompanying README file.
Be sure to check out the app—it’s really the best way to lock a BB against accidental key presses, et al.
Durch eine Diskussion mit Max wurde ich dazu gebracht, nochmal über das PHP-lässt-mich-wilde-Sachen-machen-Problem nachzudenken, und tatsächlich gibt es eine simple – wenn auch nicht besonders hübsche – Lösung, die ich hier mal in Java darlege:
for (MyClass d = dict.get(key); d != null; d = null) {
d.callMe();
}
Ich gehe dabei natürlich davon aus, dass der Compiler das sinnlose Setzen und Prüfen von d wegoptimiert.
Die ganze Vorgehensweise ist dabei allerdings abhängig von den Möglichkeiten des Frameworks, da es eben keinen @-Operator gibt: In diesem gibt mir das get() des Map-Interfaces glücklicherweise ein null zurück, bei C#-Dictionaries könnte man beispielsweise mit Extensions arbeiten.