tag:blogger.com,1999:blog-46806943845395183582024-02-20T10:18:30.745-08:00Technologyadoexhttp://www.blogger.com/profile/04333100509367374830noreply@blogger.comBlogger456125tag:blogger.com,1999:blog-4680694384539518358.post-76984392419542594602011-11-30T11:28:00.000-08:002011-12-02T18:14:22.459-08:00Array extras and ObjectsWhen Array extras landed in JavaScript 1.6 I had, probably together with other developers, one of those HOORRAYYY moment ...What many libraries and frameworks out there still implement, is this sort of universal each method that supposes to be compatible with both Arrays and Objects.A Bit Messed UpWhat I have never liked that much about these each methods is that we have to know in advance in anyUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-48486608340248511532011-11-27T06:26:00.000-08:002011-12-02T18:14:22.479-08:00About Felix's Style GuideStyle guides are good as long as these are meaningful and a bit "open minded" because if one style is recognized as anti pattern then it must be possible to update/change it.The Felix's Node.js Style Guide is surely a meaningful one, but I hope it's open minded too.Why This PostBecause I write node.js code as well sometimes and I would like to write code accepted by the community. Since Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-73147172606879850062011-11-26T03:52:00.000-08:002011-12-02T18:14:22.499-08:00JSONH New schema ArgumentThe freaking fast and bandwidth saver JSONH Project has finally a new schema argument added at the end of every method in order to make nested Homogeneous Collections automatically "packable", here an example: var // nested objects b property // have same homogeneous collections // in properties c and d schema = ["b.c", "b.d"]Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-85325113896082530242011-11-25T12:41:00.000-08:002011-12-02T18:14:22.518-08:00On Complex Getters And SettersA common use case for getters and setters is via scalar values rather than complex data.Well, this is just a programmer mind limit since data we could set, or get, can be of course much more complex: here an examplefunction Person() {}Person.prototype.toString = function () { return this._name + " is " + this._age;};// the magic identity configuration objectObject.defineProperty(Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-62327894601756565302011-11-20T18:19:00.000-08:002011-12-02T18:14:22.610-08:00Differential Background ScrollingA quick one about this technique quite common in Flash sites but rarely seen on Web.Have a look at the example first so you can understand what I am talking about ... got it ?What Is This AboutLet's say we have a background, a big massive graphic background surely not suitable for mobile phones, due data roaming, but maybe cool for desktop and fast ADSL.The background-size CSS property is able toUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-11341691860699378512011-11-12T04:02:00.000-08:002011-12-02T18:14:22.704-08:00Few JavaScript PatternsJust to be clear and once again, JavaScript can emulate:classespublic and public static methods or propertiesprivate and private static methods or propertiespublic and private constantsprotected methods... you name it ...// duck typing ( maybe all you need )var me = {name: "WebReflection"};// basic classfunction Person() {}Person.prototype.getName = function () { return this.name;};Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-14989895520769697102011-11-08T14:33:00.000-08:002011-12-02T18:14:22.819-08:00Function.prototype.notifierThere are way too many ways to stub functions or methods, but at the end of the day all we want to know is always the same:has that function been invoked ?has that function received the expected context ?which argument has been passed to that function ?what was the output of the function ?Update thanks to @bga_ hint about the output property in after notification, it made perfect senseThe Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-91168823091477757282011-10-31T12:52:00.000-07:002011-12-02T18:14:22.912-08:00On User Agent SniffingOh well, who was following me on twitter today is already bored about this topic (I guess) but probably other developers would like to read this too so ...What Is UA SniffingUserAgent sniffing means that a generic software is relying into a generic string representation of the underlying system. The User Agent is basically considered a unique identifier of "the current software or hardware that Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-5382735909488864682011-10-25T12:51:00.000-07:002011-12-02T18:14:23.030-08:00JS getCSSPropertyName FunctionI was re-checking @LeaVerou talk at jsconf.eu looking forward to see mine there too to understand how to improve and specially what the hell I have said for 45 minutes :DLea made many valid points in her presentation but as is for supports.property case, you never want to go too deep into a single point of your talk so ... here I come.getCSSPropertyName FunctionThis function aim is to understand Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-49978595660868344362011-10-20T12:25:00.000-07:002011-12-02T18:14:23.131-08:00My BerlinJS SlidesIt was a great event today at @co_up in @berlinjs meet-up and here are my sides about wru which accordingly with today meeting means where are you, directly out of SMS syntax.Enjoy ;)Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-43787483983675243612011-10-19T22:32:00.000-07:002011-12-02T18:14:23.144-08:00Playing With DOM And ES5A quick fun post about "how would you solve this real world problem".The ProblemGiven a generic array of strings, create an unordered list of items where each item contains the text of the relative array index without creating a singe leak or reference during the whole procedure.As plus, make each item in the list clickable so that an alert with current text content occur once clicked.The Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-6160030603350868352011-10-18T16:05:00.000-07:002011-12-02T18:14:23.239-08:00Do You Really Know Object.defineProperty ?I am talking about enumerable, configurable, and writable properties of a generic property descriptor.enumerablemost likely the only one we all expect: if false, a classic for/in loop will not expose the property, otherwise it will. enumerable is false by default.writablejust a bit more tricky than we think. Nowadays, if a property is defined as non writable, no error will occur the moment we'll Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-14345761633717545632011-10-16T04:49:00.000-07:002011-12-02T18:14:23.258-08:00The Missing Tool In Scripting WorldFew days ago I was having beers with @aadsm and @sleistner and we were talking about languages and, of course, JavaScript too.That night I have realized there is a missing process, or better tool, that could open new doors for JavaScript world.The Runtime NightmareThe main difference between scripting languages and statically typed one is the inability to pre optimize or pre compile the code Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-36488816959075286922011-10-15T05:27:00.000-07:002011-12-02T18:14:23.351-08:00Object.prototype.define ProposalSomebody may think that defineProperties is boring and I kinda agree on that.The good news is that JavaScript is flexible enough to let you decide how to do that ... and here I am with a simple proposal that does not hurt, but can make life easier and more intuitive in modern JS environments.Unobtrusive Object.prototype.defineHow ToWell, the handy way you expect.The method returns the object Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-82232697917530497292011-10-13T01:11:00.000-07:002011-10-13T01:11:16.184-07:00Depiction About Automation Systems
Automation system is the use of control system and information technologies to reduce the need for human work in the production of goods and services. Pad printing, laser printing, home automation etc. are automation systems.
Pad printing process is mainly using for move a 2D image on to a 3D object. It is an indirect offset printing process, where an image is transferred via a soft silicone Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-2927382858427337352011-10-13T01:07:00.000-07:002011-10-13T01:07:46.655-07:00The Stark Differences Between Apple iCloud and MobileMeAre you curious about the differences between the iCloud and MobileMe? After all, aren't they both cloud services?
MobileMe is Apple's current cloud software and it's a paid service that isn't very popular at the moment. Apple iCloud completely revamps the service and offers many more features. For one 5 GB of free cloud storage is available for every IOS account with IOS 5. MobileMe customers Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-91559058642763707332011-10-12T22:23:00.000-07:002011-12-02T18:14:23.445-08:00about JS VS VBScript VS DartYou can take it as a joke since this is not a proper comparison of these web programming languages. JS Dart VBScripttypes √ √ sort ofgetters and setters √ √ √immutable objects √ √ √prototypal inheritance √simulated classes √"real" classesUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-30027847148026368002011-10-12T21:18:00.000-07:002011-12-02T18:14:23.540-08:00about that postI have been blamed and insulted enough so I removed the possibility to comment and I also invite you again to do not stop reading the title of a generic post here or anywhere around the net.I would like to summarize few parts of that post:on real world we should use the proper flag in order to generate files where only necessary parts of the library is included...I agree that at this stage can beUnknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-5870768064856352932011-10-11T22:34:00.000-07:002011-12-02T18:14:23.636-08:00What Is Wrong About 17259 Lines Of CodeIs the most popular, somehow pointless, and often funny gist of these days.It's about Dart, the JavaScript alternative proposed by Google.Why So Many Lines Of CodeThe reason a simple "Hello World" contains such amount of code is because:the whole library core is included and not minified/optimized but on real world we should use the proper flag in order to generate files where only necessary Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-81370720799532532692011-10-09T03:45:00.000-07:002011-12-02T18:14:23.659-08:00Taking The Bat-Formula To The Next LevelWhen you wake up on Sunday morning with upside-down stomach and batcode in mind, you may realize it's time to rest a bit.with (/*Bat*/Math) Array(16).join( pow(/*JOK*/E/*R*/, cos, E/*vil*/)) + "batman";The output is the same produced by the original bat-formula:'NaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNNaNbatman'Have a nice Sunday.Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-34637747180683981202011-10-09T02:48:00.000-07:002011-12-02T18:14:23.754-08:00A Better is_a Function for JSIn 2007 I have posted about get_class and is_a functions in JavaScript in order to simulate original PHP functions.Well ... that was crap, since a much simpler and meaningful version of the is_a function can be easily summarized like this:var is_a = function () { function verify(what) { // implicit objet representation // the way to test primitives too return this instanceof what; } Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-37325872417128913192011-10-06T02:36:00.000-07:002011-12-02T18:14:23.854-08:00implicit require in node.jsplaying with Harmony Proxy I came out with a simple snippet:The aim of above snippet is to forget the usage of require ... here some example:module.sys.puts("Hello implicit require");var fs = module.fs;fs.stat( ... );It's compatible with nested namespaces too and if there are non JS chars in the middle ... well:var Proxy = module["node-proxy"];Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-6491463038485284532011-10-05T03:27:00.000-07:002011-12-02T18:14:23.952-08:00bind, apply, and call trapquick one out of ECMAScript mlvar // used to trap function calls via bind invoke = Function.call, // normal use cases bind = invoke.bind(invoke.bind), apply = bind(invoke, invoke.apply), call = bind(invoke, invoke);What Is ItThis is a way to trap native functions method in a handy way. Used in a private scope, it can address these methods once so that we can rely nobody can Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-89549103516948229672011-10-03T00:17:00.000-07:002011-12-02T18:14:24.052-08:00Dear Brendan, Here Was My QuestionI had the honor to personally shake the hand of the man that created my favorite programming language: Brendan Eich!I also dared to ask him a question about ES6 and I would like to better explain the reason of that question.I have 99 problems in JS, syntax ain't oneI don't know who said that but I completely agree with him.Here the thing: one of the main ES6 aim is to bring new, non breaking, Unknownnoreply@blogger.com0tag:blogger.com,1999:blog-4680694384539518358.post-17377050688847627992011-10-02T02:53:00.000-07:002011-12-02T18:14:24.156-08:00Me At JSConf.EU 2011About my JSConf.EU Talk.Here my JSConf EU 2011 Slides, and here again the speaker rate (only if you have seen the talk, pls).update I forgot to mention lazy features detection oject proposal!Thanks everybody, it has been a great week end :)Unknownnoreply@blogger.com0