Posts

Showing posts from September, 2009

Chrome Frame Always On IE Toolbar Button

Image
As promised in the CF ML, here I am with the first Chrome Frame Button application. It's beta not because of its functionality, it works 100% at least in my old laptop, but because when you click the button the Chrome Frame is always on or of as expected, but to see the new icon or the new label we need to restart IE. Anyway, this button is not created to switch every second, this button is "just for fun", as fun was the first always on application . How it works? Grab the zip file from my chromefix project. Unpack it, and read the file README.TXT ... it's really simple, basically a double click and nothing else

Software Quality - We Are Loosing It

This may sounds silly, surely not technical, but today I've lived the last drop before crackpots! IE6 Inside The Cash Point I am not joking, I have no idea how many cash points use windows and IE to run a 7 screens software. Have you never noticed a " click clack " while you are performing your operations? OK, maybe banks do not even buy Microsoft licenses, or maybe those are dedicated cache machine version of Windows, but I could never imagine to find a windows popup with an error in a cache machine, it is ridiculous! Those one with just text? Well, they look old and ugly, but I've rarely seen one disabled. We have dozen of valid Operating System able to perform the same software for years without requiring a single reboot. How difficult will be to create an OS specific for a cash point where operations are always the same, adding just 1 image format supported? What I mean is that you can find active screens with lottery ads inside running 24/7 without problems over

Chrome Frame On By Default ?

Image
A quick one for those interested into Frame switch on. Two options use regedit to add or modify the key HKCU\Software\Google\ChromeFrame\OptInUrls with char * download my Chrome Frame Switch executable application. Latter one, is a zip with two versions of the same application, one for 32bit, one for 64bit. The application allows us to automatically set or remove that register key.

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

One Function To Trap Them All

This is a quick one. This technique could have some side-effect I am not aware about but I've never seen it so far in any library. Talking about LiveMonitor I have successfully tested same concept to create faster implementation of some of my DOM common code, not yet updated in vice-versa . document.getElementsByClassName Example (function(childNodes){ /* Another (C) WebReflection Silly Idea */ // how to re-use them all, just an example if(!document.getElementsByClassName) document.getElementsByClassName = function getElementsByClassName(className){ for(var re = new RegExp("(?:\\s|^)" + className + "(?:\\s|$)"), ret = [], i = 0, l = 0, length = childNodes.length, node; i < length; ++i ){ if((node = childNodes[i]).nodeType === 1 && re.test(node.className)) ret[l++] = node ; }; return ret; } ; // let the magic happen })(document.getElemen

CSS Position Fixed Solution

Image
Who does not know CSS 2.1? ... silence (maybe) ... Good, so who does not know the CSS 2.1 position property ? ... silence (still maybe though) ... Excellent! Finally, who would like to use in a lightweight, cross-browser, unobtrusive way, without JavaScript dependencies, the property fixed ? ... silence again, but this time I can spot a different expression in your face ... Common Browsers With position:fixed Support Chrome Firefox Internet Explorer 7 and 8 but NOT in quirks mode Opera Safari Common Browsers WithOut position:fixed Support Internet Explorer 6 Internet Explorer 7 and 8 in quirks mode WebKit for Android WebKit for iPhone To Quirks Or Not To Quirks For backward compatibility reasons IE let developers choose between two box models ... Our loved bloody 64 years * old browser Internet Explorer 6 has never supported such property while both Internet Explorer 7 and 8 do nt support it if we are in quirks mode, a modality tendentiously dead thanks to new simple HTML 5 doctype de

JavaScript Liquid Image FX

Image
Yesterday I have been in Brixton Academy for Massive Attack concert: amazing! I have been totally impressed by their choreography: it looked apparently rudimentary stuff but once they started playing I could not avoid to think all the time how beautiful special effects are and how simple, sometimes, they could be for a stunning result. Liquid FX I cannot forget my ActionScript Developer past and of my favorite coded special effects has always been the liquid one. What is a liquid effect? Here a preview: Test Liquid FX Directly In Your Browser Well, if the preview image is not explicative enough, I am sure this demo page is :) Update , this Sony VAIO Flash Style Splash Page could be interesting as well, isn't it? And all in 14Kb images, JS, and layout included ;) How Does Liquid Work There is a Liquid function, and its configuration object: Liquid({ // image src, whatever format src:"myimage.png", // element to use as Liquid FX container target: document

I Would Simply Like To Support iPhone But I Cannot

Update Before other silly flame/blame will start, I have already twitted that my next laptop will be a netbook. Here the related tweet . let me summarize the story: at that time I had a girlfriend with an iPhone so I though why on earth shouldn't I buy an Android instead? If I need some test online I'll have both to test it , and I've rarely been that wrong. Wanna Develop for iPhone? Buy a Mac As marketing strategy sounds " cool " except I do not want to develop iPhone application, the present and the future is online, why on earth should I learn another programming language from the scratch, Objective-C, to develop something that will be relatively soon replaceable via WebKit and a good host? Wanna Develop Web for iPhone? Buy a Mac Again!!! Unbelievable, there is not such a thing: online iPhone tester , everything I found Googling was about a silly image with an iframe just to test the iPhone size ... are you kidding me ? It's like put IE inside an iframe ins

LiveMonitor - Asynchronous Property Monitor

Today I would like to introduce you a quite uncommon JavaScript trick , a trapped Live Object or, generally speaking, a lightweight monitor able to understand when a generic property has been changed. About Live Objects A live object could be described as a particular object able to change without our interaction. The most common live object example is this: // this is the most common live object // the HTMLCollection var divs = document.getElementsByTagName("div"); divs.length; // let's say 4 // let's add another div inside a generic node document.body.appendChild( document.createElement("div") ); divs.length; // 5! In few words DOM searches are dynamic, which is the reason almost every selector library needs to transform the current result into a static Array . About LiveMonitor Specially suited for live objects, LiveMonitor is a function which aim is to notify us when the specified property change: // LiveMonitor example var lm = new LiveMonitor(

Formaldehyde JS - The Circle Is Close

As announced in Ajaxian , I have created Formaldehyde JS with exactly the same Zero Config logic. We put this file before everything else and that's it, Formaldehyde will automatically decide how to show errors in a wide range of browsers: Chrome Firefox Internet Explorer 5, 5.5, 6, 7, 8 with or whout console Opera Safari Logs will naturally degrade until the most primitive alert but hey, Formaldehyde is for debug and development environments, not for production. Enjoy ;)
Image

double tweet - up to 280 chars tweets!

Update At least one other person did the same and before this post, here there's the prove . The algo seems to be almost the same, except the length is probably padded to be module of 2 (\x00 at the end) so you can use double-tweet gadget to decode gareth message as well :) Via encode template and same bookmark link, I would like to introduce my last simple experiment: WebReflection::double-tweet (just a click to give it a try, another one to remove) The Concept Twitter lets us type messages with a maximum of 140 characters. Fortunately, twitter accepts Unicode characters and still fortunately, it is extremely easy to pack two ASCII characters into a single Unicode one. Accordingly, 140 ASCII characters could be packed into 280. A Fast ASCII pack / unpack function ASCIIPack(s){ // WebReflection Mit Style License for(var r = [], i = 0, length = s.length, c; i < length; ++i){ c = s.charCodeAt(i); r.push(++i < length ? (c << 8) + s.charCodeAt(i)

for the phillies...

THE MEN from brooklyn, crazy post-rock punk mayhem. like what that band panthers should have evolved into meets more rocking Can stuff http://wearethemen.blogspot.com [wearethemen.blogspot.com] » [wearethemen.blogspot.com] » DISTRESS SIGNAL also crazy, intense hardcore heralding the return of great american steak religion/rorschach, but after they've listened to a couple spacemen 3 albums http://myspace.com/distresssignal666 [myspace.com] » [myspace.com] » WOMEN philly slut-punk, like the Buzzcocks on Gern Blandsten in '94, i think. definitely also crazy. Do they have a myspace page? i don't know, but their 7" certainly does rock. PYRAMIDS totally Portraits of Past meets End of the Line ebullitiony hardcore jams! Their myspace page encourages us to "drop knowledge not bombs", so do it! http://myspace.com/pyramidspa [myspace.com] » [myspace.com] » EXTRA TONGUE currently the best band in philly, like if Elvis, the Beatles and Nico played in a pigfuck band. Sike

PHP Serialization And Recursion Demystified

Introduction PHP has different in-core callbacks able to help us with daily deployment, debug, improvements. At the same time, PHP is loads of intrinsic " gotcha ", too often hard to understand, hard to explain, or simply hard to manage. One common problem is about debug, caching, or freezing, and the way we would like to debug, cache, or freeze, variables. For freezing, I mean those procedures able to regenerate a stored variable and its status, in order to reuse that variable, to understand what happened in that moment with that variable, or just to speed up expensive tasks already completed. The Problem One of the most common procedures to freeze variables is their serialization, performed in core via a well known serialize function. Please consider this example: $person = new Employee('Mr. Lucky Me'); // ... do some useful task myCompanyFreezer($person); // the myCompanyFreezer function function myCompanyFreezer(Employee $p){ $company = Company::getInstance()

PHP How to var_export a debug_backtrace

Just a quick post, and I am not sure if this is documented, or if this works with every PHP version, but apparently a truly common problem with var_export is the logical inability to manage recursions. Well, one of the most important function in PHP is the debug_backtrace , which contain recursion, and one thing you would probably like to know is that this trick allowed me to avoid recursion problems: $backtrace = unserialize( serialize(debug_backtrace()) ); After this, it is possible to use json_encode, var_export, or whatever other serializer. The reason is that serialization discover and remove some implicit recursion, so that unserialize will return a cleaner object. This technique has been used in Formaldehyde , but manual recursions are not supported yet (for example via formaldehyde_log). recursions, for a debug purpose, are in any case redundant. All we need to know is what is there, rather than where. Regards

Formaldehyde - Ajax PHP Error Debugger

Image
I am proud to announce my last Web 2.Next creation, Formaldehyde , the most simple, lightweight, scalable, and complete (for its simplicity) Ajax and PHP Error Debugger. I described everything in its dedicated Google Code Project Page , but just to summarize without many other words, this is the common deployment situation : while this is what's up with a single formaldehyde.php file inclusion: I hope you will like it, can't wait for some comment :geek:
Market Hotel Presents: HARDCORE GIG VOLUME # 114 FAILURES - Rippin' fast hardcore, Brooklyn/Boston DRUNKDRIVER - Damage Punk from Brooklyn, Loud! SALVATION - Hardcore from Philadelphia THE MEN - Brooklyn fuzzed out punk Thursday October 1st - 8pm - ALL AGES @ Market Hotel 1142 Myrtle Ave & Broadway Brooklyn, NY http://www.myspace.com/markethotelnyc

@font-face we are already doing wrong

Image
Update - Now We Do Right Thanks everybody for your tests and contributions. For those interested about why we were doing wrong please read both post and comments but for those just interested about the best way so far to serve correctly one or more font-face, this is the hack: @font-face { // define the font name to use later as font-family font-family: "uni05_53"; // define the font for IE which totally ignores local() directive src: url(../font/uni05/uni05_53.eot); // use local to let IE jump this line and // redefine the src for this font in order to let // other clever browser download *only* this font rather than 2 src: local("uni05_53"), url(../font/uni05/uni05_53.ttf) format("truetype"); } You can test directly this technique in my HTML5 Prime Directives Test Page Credits Paul Irish for its Bulletproof @font-face syntax Mikuso, comments, for his suggestions about server configurations, instantly followed by Weston

JScript Console - A Simple One

After I've read Ajaxian post about JavaScript as a command line scripting language I thought it could be interesting to know how to create the first Windows console. The console.js File function print(text){ WScript.StdOut.WriteLine(text); }; function quit(){ WScript.quit(1); }; while(!WScript.StdIn.AtEndOfStream){ try{ eval(WScript.StdIn.ReadLine()); }catch(e){ print(e.message); }; }; WScript.StdOut.WriteLine("bye!" + "\r\n"); The console.bat Launcher @echo off cscript console.js A double click in latter file, and that's it, the most basic native JScript console ever has landed in your PCs - enjoy :)

PHP 5.3 Singleton - Fast And Abstract

In this same blog I talked different times about Singleton Pattern , in latter link " poorly " implemented in PHP 5. I say poorly, because being Singleton a pattern, there are many ways to implement it and via PHP 5.3 things are more interesting. There are several ways to define a Singleton class and to extend it, being able to automatically create another one that will follow that pattern. Here is my implementation, which is extremely fast, logic, and simple as well. <?php // Singleton :: The WebReflection Way namespace pattern; // this is just a pattern ... // so no new Singleton is allowed // thanks ot abstract definition abstract class Singleton { // note, no static $INSTANCE declaration // this makes next declaration a must have // for any extended class // protected static $INSTANCE; // @constructor final private function __construct() { // if called twice .... if(isset(static::$INSTANCE)) // throws an Exception

94 bytes to quickly get a var type

I surpassed myself for the third time but I tweeted too much about, so here a quick one ;) // was getClassName but people prefer type // while kangax prefers var var type=(function(s,u){return function(o){return o==u?""+o:s.call(o).slice(8,-1)}})({}.toString);