Posts

Showing posts with the label Google

JavaScript Builder from Falsy Values

Update: uglify-js as third option Thanks to @kitgoncharov JSBuilder now includes the option to run uglify-js through Rhino ... still cross platform, a builder for any taste. as promised during my workshop, I have created a Google Code Project with the builder used to demonstrate most advanced and common techniques to make a library, application, snippet, small and fast. What Is JSBuilder It's a truly simple Python module based over a certain hierarchy able to combine multiple files and produce a minified version of the application. A similar approach has been used since ages with jQuery, and I am pretty sure there are tons of builders out there able to do similar task. I personally created ages ago a similar project compatible with all windows platform . However, that project was missing the possibility to put everything together, preserve some piece of code if necessary, replace some string runtime, and produce if necessary different outputs through the simplified module approac...

Google Closure ? I'm Not Impressed

We all know that Google is synonym of performances, simplicity, and again performances. A search engine that uses a truncated body for a not valid W3 markup should be the most bytes and performances maniac in the current web era, isn't it? Well, Google Closure Tools has been a negative surprise, at least this is what I can tell about it after a first quick review. Closure Compiler It's since ages I am wondering what kind of tool Big G is using to produce their scripts and finally we got the answer: Closure Compiler ... ooooh yeah! Packer , YUIC , it does not matter, when Google needs something, it creates something. This is almost intrinsic, as developers, in our DNA: we spot some interesting concept? We rewrite it from the scratch pretending we are doing it better! This is not the case, or better, something could go terribly wrong ! // ==ClosureCompiler== // @compilation_level ADVANCED_OPTIMIZATIONS // @output_file_name default.js // ==/ClosureCompiler== (function(){ ...

Google Chrome Frame - A First Look

In one single day the news about Google Chrome Frame has reached, I suppose, every web related company or developer. As posted before , I hope this plug-in will be adopted soon throwing away every other plug-in " record ", thanks to its target: the most used, discussed, slow, and not standard, casa Microsoft default browser, Internet Explorer. I have spent part of my precedent night sleeping testing this little revolution from Big G. and here there are first suggestions, impressions, results. The Correct Way To Set Chrome Frame The Google Getting Started guide is a good lecture, but it is not enough . The Making Your Pages Work with Google Chrome Frame is incomplete, and I will tell you why. First of all, we need to understand that Chrome is a Runtime Embedded Browser plug-in, not a tag related one then, as Adobe Flash Player is. Writing something like: Just add this tag to the top of the page: That's it! is confusing and not that detailed info. A meta tag is normal...

Web Terminator Salvation - Google Chrome Frame

Google Chrome Frame Bookmark , if you are surfing for whatever reason in IE, right click in precedent link, add to favorite and save as: FINALLY THE WEB , or simply copy this code and past in the website url you are surfing with IE // corrected via kangax javascript:void(location.href='cf:'+location.href)); It's the beginning of a Web Revolution , it's the dream of every Web developer, it's the annihilation of the most slow, problematic, non-standard, engine ever: the whatever version inside Internet Explorer! It's the " Say Fucking What? Buggy Flash Player Yes For Ages And Chrome Frame No? " era, it's something I've been trying for ages without that direct switch, provided by this plug-in, able to forget Internet Explorer except its frame (weird choice about the name though, Google) ... it's the new stats where IE could increase again it's market share who fuckin' care as long as we can finally develop real web applications , is ...

google caja, what's wrong with "new" ?

In JavaScript we mainly have two type of variables: primitives (string, number, boolean, null or undefined) object related (Array, Object, Function, unknown for IE) Due to this difference, a primitive string and a new String are two different worlds: var s1 = "abc"; var s2 = new String("abc"); s1 instanceof String; // false s2 instanceof String; // true The nature of primitive constructor is to return a typeof constructor, but if we use new in front of the same constructor, it will obviously return an instance of that constructor. This is the nature of javascript, summarized in this snippet: function I1(){ return 1; }; function I2(){}; var i1 = new I1(); var i2 = new I2(); In both cases, o1 and i2 will be respectively an instanceof I1, and I2. In few words, if a function is caled via new , the assigned value will be an instance o the constructor itself or, if it returns an instanceof Something , the instanceof something value. function I3(){ return n...

Internet Explorer with V8 Engine :: A Partial Reality

Update now it works with Internet Explorer 7 and 8 with O3D plug-in enabled. Today, via ajaxian , I discovered the new Google O3D project and as a nerd first, and a developer after, I instantly read the API. Few seconds and I spot this: Use the V8 engine OK, OK, whatever code you read there will not instantly work ... you have to understand the library and how to retrieve the dreamed eval function to make JavaScript execution possible inside the extremely fast V8 engine. Obviously V8 integration is great with FireFox and other browsers, but a bit different in Internet Explorer. This limitation is about the DOM manipulation, something that would make IE a good browser, but everything else, executed via V8 engine and without browser engine references , will perform 5 to 100 time faster. Function creations, optimized loops, numbers, string manupulation, etc etc ... if we could use a little plugin to fully integrate V8 inside Explorer, we could all forget nowadays benchmark because it w...

Another experiment inspired by Google Buttons

Image
I found this post from Ajaxian extremely interesting, and I decided to try to create a better version, if it is possible, of Google Buttons 3.1 The result is not perfect, still alpha, and just for fun, but compatibility seems to be great while multiple buttons visualizations (horizontal or vertical) is extremely simple: write links beside each other, or add a couple of rules for vertical version. States are hover, active, selected, represented via JavaScript events (onmouseover, onmousedown, onmouseup). As I said this is just an experiment, but I think as is it is not that bad ... maybeI am wrong :D

Google Chrome Fix

Update 2008/09/04 I have created a new version that should be able to recognise the correct Google directory in every supported windows, and not only English version. Please do not hesitate to tell me if the created link for No Sandbox Option is not creating it properly, thank you. Google Chrome Fix Multi Language OS ----------------------- I successfully tested the new browser in my laptop, while today I had some headache at work. This is the reason I created in few minutes a simple Windows Application that let you choose which option you want to solve crashes during Google Chrome startup: The application failed to initialize properly (0x00000005). Press Ok to terminate application. Please note that the registry fix option changes a key that should solve Symantec problems, but it is not clear if this key could change security level for those PC that use Symantec end point protection, or similar softwares. In every other case, the GUI create a link to launch Chrome without multiple san...

Google Code Jam: Mousetrap in 4 languages - GAME OVER

First of all, I would like to thank the Google team for Code Jam opportunity, and its organization: AMAZING! Yesterday I have lost my Round without a single commit. This time I have not excuses, it was simply my fault. I did not understand properly first two problems, or better, expected results, but I was sure the reason was my poor English knowledge, and I wouldn't be silly, asking silly questions (some question was silly enough, so, next time, I'll be less shy than this time). Accordingly, since Code Jam is a challenge, I chose to solve the most difficult problem, the Mousetrap. First of all, because the problem, and the expected result, was so simple to understand, secondly, because it was the best one for points :geek: Problem Analysis Ok, we had 2 hours to analyse the problem, to find the best solution, and to commit results, and this time I did not even download the test, because I would like to be sure that my solution was good enough to solve the problem. Count positio...

Google Code Jam, or better, how to feel a 100% idiot !

Update 2 Congratulations! The results of the Google Code Jam 2008 Qualification Round are now official, and we're happy to announce that you have advanced to Round 1 Cheers :D ----------------------------------------- Update Guys, I do not know what Google judges will think about him/her, but in my mind, the qualification winner, for Python language, is the user camrdale , currently in position 40 of global score grid. That code is extremely clear (come on, that is Python, how can be different!), essential, and the logic is probably not the perfect one, but is so linear that you can understand the problem even without reading them. Well done camrdale, and good luck for the contest :geek: ----------------------------------------- Guys, honestly, I did not think about that kind of selection only to participate, bloody hell! First of All, the selection started at 11pm, and since I am an employee, and an hard worker as well, I though: who care? I have 24 hours to partecipate . This is ...