jQuery API browser
Wow! I just discovered that my favorite Javascript framework is now available in version 1.3 (actually it has been around since January 14th, but I didn't notice until now ...).
Even more interesting: There is a new jQuery API browser. I found it to be very fast and fun to use. For example, there is a live filter function which works very well and is maybe the fastest way to get to a method you need (if you know at least the beginning of the name). The methods you use most often can be saved as favorites. And, last but not least, the API even includes jQuery UI (I haven't done much with that but would surely consider it if I'd start a new project).
Just watched this in the lectures ... so simple and yet so stirring.
Color Shift in Photoshop
Yesterday, I was doing some work with Photoshop and was once again very frustrated with the colors after saving for the web. Mysteriously, the colors look very vibrant in Photoshop, but the resulting JPG is very dull.
There are quite some articles about this issue on the internet, so I found out this is due to the color management Photoshop does. To solve the problem, I followed the steps at Viget. It basically removes the color management and works great for webdesign (but isn't suited if you're working mainly with photos or print).
German only, but just too good:
Fudder
For my courses in ActionScript and Flash, I built a retro version of the Pong Game. The online version (two player) is without sound, but originally there was a midi sound in the background which completes the retro experience …
Before starting, you have to click in the game area because browsers don’t focus a flash movie after loading. From then on, it’s keyboard only. Enjoy ;)
Trashing Treasure
So ... it’s been quite quiet around here lately. The reason is very obvious: So much to do ;)
This forces me to stop working on Treasure … and on my content management system, meaning that it won’t get any new big features. If there is the need for any, a system like TYPO3 might be the better choice.
But I don’t want to end this post with sad news, so here is a recommendation: Currently I am reading "The Humane Interface" by Jef Raskin and it’s definitly the best book I’ve ever read about interface design …
VirtualBox and MacBook Pro Keyboard
I installed Windows XP on VirtualBox right after I got my MBP. I never used it since then for anything else then testing websites on different IE versions. So until now I didn’t really care about the weird keyboard layout. Now we’re working with DB Designer in my studies and recently we played a bit with Debian (and will continue doing so until february). That’s when I noticed that I didn’t know how to type chars like |{}[]~ and so on. What to do? The normal combinations didn’t work.
Unfortunately, it seems there is no satisfying solution. VirtualBox offers no way to map the keyboard exactly as it is on my mac. But still, it’s possible to type the chars, so here are my solutions so far:
| alt + ^ @ alt + q { alt + 7 } alt + 0 [ alt + 8 ] alt + 9 ~ alt + +
PHP - Iterator Interface
There’s lots of stuff going on recently, so I haven’t been able to work on Treasure. But I promised to write a bit about the process so that’s what I’m going to do now ;)
Basicly, it all started with PHPs lack of late static binding (well yeah, there is actually some support in 5.3, but I don’t want to support only the newest PHP version). This means I’m unable to know which subclass a called method belongs to. Because of this, something like Foo::bar() is unable to return an object of type Foo. Unfortunately, this is the very heart of Active Record. I started to think about different solutions and came up with a very simple one: tables map to classes, objects map to rows (notice the plural here). This means one object can store none, one or multiple rows of a specific table. Active Record is different here in mapping an object to only one row. My solution includes a pointer that points to the current position in the associative array (where the column-value pairs are) inside the object.
All of this seemed like a good idea to me, but the next problem was to iterate over the records in the object. I thought this would be difficult to solve, but then I discovered the iterator interface. Basicly, it defines the methods needed for a for-loop. These are: rewind(), next(), valid(), current(), key(). I implemented these in my parent model class and now I am able to iterate over my model object with foreach. Very cool. Maybe the most interesting method is current(). I decided to return a reference to the object (instead of just returning the current array) because then I am able to refer to the values of the current data set (via magic methods) like this: $object->name (if the column I want to access is called name). This is awesome …
New Project
Two days ago I was thinking about versioning. My CMS is lacking versioning, because I didn’t consider it important three years ago. Now I changed my mind, but versioning should be something that is done automatically, without much effort. Furthermore, versioning should be available not only for the CMS, but for every extension etc.
After some thinking, sketching and internet research I decided to start a new project. I want to write a model for interacting with a database. Included features are pagination, versioning and validation. The concept is based on something similar to Active Record. Most of the code will be taken from my own CMS framework, and a lot of ideas are borrowed from Ruby on Rails and CakePHP.
I think I’m going to release it under the MIT license once it’s ready (which will take quite some time). In the meantime, I might blog about some parts of it, for example I’m using PHP’s Iterator interface which is quite interesting.
But for now, i’m only going to spill the name … Treasure!
Keyboard Shortcuts
Yeah, I know, it’s really embarrassing that I own a computer for more than seven years and never came across them, but hey ;)
Cmd+Right jumps to the end of a line, Cmd+Left to the beginning. But what’s really cool is that Cmd+Shift+Left marks the line from the cursor until the left end, Cmd+Shift+Rigt to the right end. Awesome. How in the world was I able to live without it?
Also very nice: Cmd+Alt+Up doubles the current line and inserts the new line above (of course Cmd+Alt+Down does the opposite).