Posts

Showing posts from July, 2010

Tesla Experiment, aka JavaScript Lightnings

Hardware Accelerated Browsers are a great step forward for Web potentials, but not all of them are able to accelerate properly the canvas element. When it comes to performances, we should be aware about those practices able to slow down consistently not that powerful devices such Netbooks and smart pad or phones. The Tesla Experiment This demo has a mere entertainment purpose and it is specially suitable for iPad since it becomes more funny via multi touch screens. It is possible to customize almost everything via the Tesla class , and for the example page we can simply use the query string . All properties has been explained in the source code of the index page, when the Tesla instance is initialized. Here another configuration example ( more " Dragon Ball " style :D ) It has been interesting to test how the blur can destroy performances, as interesting was to realize that with current canvas API, a nicer FX as this one could be is quite impossible if performances matters

August 7th!

Image

Constructorification

... he he, I know the title could not be worst, but after my last post about Arrayfication I have thought: " ... hey, the Thing.ify(object) could be more than handy in many occasions such mixins and duck typing ... ". So, let me introduce the Function.prototype method that nobody will ever use: Function.prototype.ify = function (o) { for (var self = this, p = self.prototype, // find a fucking way to implement this in ES3 // ... uh wait, there's no way to implement // this in ES3 ... // https://bugzilla.mozilla.org/show_bug.cgi?id=518663 m = Object.getOwnPropertyNames(p), i = m.length, n; i--; ) { // methods only m[i] = typeof p[n = m[i]] == "function" ? "o." + n + "=p." + n + ";" : "" ; } m.push("return o"); return (self.ify = Function("p", "return function " +

In case you missed it...

You might have heard that we have contributed a couple of tracks for an upcoming cassette compilation coming soon on BURN BOOKS RECORS . We posted said tracks a month or so ago but in case you missed the link, here it is again... http://www.mediafire.com/?utktnodmyon There are two tracks, one being a new original song entitled "Think", and a cover of Devo's "Gates Of Steel". In other news the Pregnant LP Release Party is less than 2 weeks away and it will be fucking awesome. Come early to check out Cool Intentions, a great new band out of Brooklyn. Our 3rd LP is almost done. We are going back to Python Patrol Studios in August to put the finishing touches on it and hopefully we will have it out by the end of the year.

Array.prototype.slice VS Arrayfication

One of the most common operations performed on daily basis directly or indirectly via frameworks and libraries is Array.prototype.slice calls over non Array elements such HTMLCollection , NodeList , and Arguments . Why We Perform Such Operation The Function.prototype.apply works only with object created through the [[Class]] Array or Arguments. In latter case we may like to avoid ES3 arguments and named arguments mess when dealing with indexes. Finally, in most of the case we would like to perform Array operations over ArrayLike objects to filer, map, splice, change, modify, etc etc ... The Slice Cost Let's perform over an ArrayLike object of length 2000, 2000 slice calls (change the length if you have such powerful machine): // create the ArrayLike object for(var arguments = {length:2000}, i = 0; i < 2000; ++i) arguments[i] = i; ; // define the bench function function testSlice(arguments) { var t = new Date; for (var slice = Array.prototype.slice, i = 0, length =

REPRESS OF THE IMMACULADA LP IS NOW UP FOR SALE

There are only about 70 left from tour so if you have not gotten one yet, order soon before they are gone. These ones are a bit cheaper, only 10 bucks + shipping. www.themen.bigcartel.com Also, we have a cool show coming up, PREGNANT's long awaited LP release party, info to the right. In other news, we had a cassette with us on tour that KARMIC SWAMP TAPES put out which was two instrumental songs that did not go onto the "Immaculada" LP. We sold out of our copies but if you keep checking his blog his copies should be up for sale soon. More later.

TOUR STARTS TODAY!!

Image
SEE YA!!

JavaScript FatalError

just in case at some point you decide to break everything, regardless possible try catches around ... function FatalError(message, file, line){ function toString() { throw e; } var e = this; e["@message"] = message; e["@file"] = file || e.file || e.fileName; e["@line"] = line || e.line || e.lineNumber; if ("__defineGetter__" in e) { e.__defineGetter__("message", toString); e.__defineGetter__("description", toString); } else { e.message = e.description = {toString: toString}; } // just in case, but not necessary e.toString = e.valueOf = toString; }; (FatalError.prototype = new Error).name = "FatalError"; how to use it? throw new FatalError("this must be a joke!"); P.S. it won't work if Errors are not logged ( silent failures, definitively a problem for certain applications ;) )