Posts

Showing posts from April, 2010

Object.defineProperty - A Missed Opportunity

Just a quick post about some clever hack we should probably forget ... make old scripts less obtrusive using new ES5 features. I am talking bout those guys out there that use scripts with a classic: onload = function () { ... }; // or this.onload = ... // or window.onload ... // or self.onload ... // etc etc Apparently WebKit Nightly fires an error when we try to define getters and setters via Object.defineProperty and this is already enough to remove that "hoooraayyyy" for my silly test .... here the code: Object.defineProperty(this, "onload", (function (self, callback) { function onload(e) { while (callback.length) { callback.shift().call(self, e); } } self.addEventListener ? self.addEventListener("load", onload, false) : self.attachEvent("onload", onload) ; return { get: function () { return onload; }, set: function (onload) { callba...

JSON __sleep, __wakeup, serialize and unserialize

The JSON protocol is a de facto standard used in many different environments to transport objects, included arrays and Dates plus primitives such: strings, numbers, and booleans ... so far, so good! Since this protocol is widely adopted but it has not the power that a well known function as is the PHP serialize one has, we are often forced to remember how data has been stored, what does this data represent, and eventually convert data back if we are dealing with instances rather than native hashes. If we consider the ExtJS library architecture, we can basically have a snapshot of whatever component simply storing its configuration object. The type will eventually tell us how to retrieve a copy of the original component back and without effort at all. Since JSON is the preferred protocol to store data in WebStorages, databases, files, etc etc, and since we can save basically only hashes, loosing every other property, I have decided to try this experiment able to bring some magic in the...

FRIDAY

Image

THE MEN / NOMOS WEEKEND TOUR STARTS TONIGHT!

Image
We will have tour copies of the NOMOS / THE MEN Split CS, and we will probably have firecrackers...

Sold out blues

So it looks like the split we did with Nomos sold out in only a day or so from Vinyl Rites. If you are going to come see us this weekend we will have a special "tour" version of the split on a green shell tape (as opposed to the red "mailorder" version). If you can't make it out this weekend and need to have this, Adam over at icoulddietomorrow.blogspot.com put the release up for download... http://icoulddietomorrow.blogspot.com/2010/04/nomosthe-men-split-cs.html also, if we have extras after this weekend we will be selling them at upcoming shows and maybe even mailorder a few if there are enough.