Posts

Showing posts from December, 2007

[OT] Never forget old school!

Another year has gone, new technologies are coming but please never forget genuine old style. Happy new year to everyone from me and old "friend" :D

Is JSON forgetting something?

I played many times with JSON serialized data, creating odd alternatives too like JSTONE or JSOMON . Few years ago I created even a PHP compatible serializzation but nowadays, with PHP5, json_encode and json_decode are natively integrated in PHP language and, at the same time, even faster than old serialize and unserialize global functions. The big difference between JSON and PHP serializzation Both JSON and PHP Serialized data have the same goal: transport objects and data over http protocol or storage these informations inside a cookie, a database or why not, a file. However, PHP serialize and unserialize functions do more things than JSON serializzation, adding charset/indexes informations transporting even private or protected parameters. With JavaScript 3rd edition We have not latter kind of properties so we shouldn't care about this limit during serializzation. This is probably the most important difference between these two different serializzation but there is another on

JavaScript Iterator for IE and other browsers

This is just my proposal to add Iterator in Internet Explorer and other browsers too. (function(){ function Iterator(obj, name){ // Iterator(obj) and new Iterator(obj) behaviour if(this instanceof Iterator){ var i = 0, result = [], skip = false, key; for(key in obj){ result[i++] = name ? key : [key, obj[key]]; this[key] = undefined; if(!skip && (key == "constructor" || key == "toString" || key == "valueOf")) skip = true; }; // solve IE problems for(var l = 0, arr = ["constructor", "toString", "valueOf"]; !skip && obj.hasOwnProperty && l < arr.length; l++){ if(obj.hasOwnProperty(arr[l])){ result[i++] = name ? arr[l] : [arr[l], obj[arr[l]]]; this[arr[l]] = undefined; }; }; // add next method if any next in object this.next = function(){ if(i === result.length) throw new StopIteration; else return result[

packed.it ... again online

I am sorry for last days while packed.it wasn't working as expected because of new server. It seems to be faster than precedent one so thank you again Daniele , I'll write your link as soon as I can :-) Enjoy both JavaScript and CSS compressed files in a single one, enjoy packed.it!

FireFox, Safari, and Opera ... JavaScript Conditional Comment

I've still written a comment in John Resig blog about Re-Securing JSON and FireFox or Safari 3 const behaviour to create an immutable function, called Native, and to retrieve original Array, Object, String or other constructors. This is the function: const Native = (function(){ const NArray = Array, NBoolean = Boolean, NDate = Date, NError = Error, NMath = Math, NNumber = Number, NObject = Object, NRegExp = RegExp, NString = String; return function(Native){ switch(Native){ case Array:return NArray; case Boolean:return NBoolean; case Date:return NDate; case Error:return NError; case Math:return NMath; case Number:return NNumber; case Object:return NObject; case RegExp:return NRegExp; case String:return NString; }; }; })(); // Example Array = Native(Array); eval("[1,2,3]"); At the same time I've talked about IE behaviour and its missed support for const . While I was thinking about that I imagined a way to use a piece

Looking for a job in London ... or not?

It's about 2 weeks that I'm studying in London to improve my English knowledge, specially my spoken one (I know, written is not so perfect too). I put my cv on line in a famous recluting search engine but it seems that most interested people are Agency's employees that usually look for generic IT - Web masters. I would like to explain my " strange situation ": I am not absolutely a web designer, I do know quite nothing about graphic, I could just know how to start Gimp!!! :D It seems that if You know quite perfectly ActionScript 1.0/2.0, that's basically ECMAScript 3rd edition or, in case of 2.0, 4th one closed, you can be only a Web Designer and not a programmer, even if You know Flash Player bugs and you're able to find out workarounds. It seems that if You know deeply JavaScript (best practices, OOP, Ajax, cross-browser/platform development, bugs, common libraries suggestions) it's not important ... just a preferred plus ... but at the same time e