NTV Football Tycoon Forum ve Uygulamasını Ziyaret Etmek İçin Tıklayınız
Your Ad Here
Google Reader -Eser (laroux)'s starred items

via Ajaxian » Front Page by Dion Almaer on 7/24/08

David Recordon has just started his OSCON talk, embedded above, on supporting the Open Web.

He is announcing the Open Web Foundation, a new attempt to have a place for us to incubate, license, and build community around specifications, protocols, and more.

I posted about this on my blog as I am an initial member:

I am excited to see the recent talk of Open Web Foundation is now out there. I think that it is poised to become a great new corner of the Web giving us a place for the other stuff.

Let’s take an example. Imagine that you came up with a great idea, something like OAuth. That great idea gains some traction and more people want to get involved. What do you do? People ask about IP policy, and governance, and suddenly you see yourself on the path of creating a new MyApiFoundation.

Wait a minute! There are plenty of standards groups and other organizations out there, surely you don’t have to create MyApiFoundation?

Well, there is the W3C and OASIS, which are pay to play orgs. They have their place, but MyApi may not fit in there. The WHATWG has come up with fantastic work, but the punting on IP was an issue too (solved by working with the W3C).

MyApi has some code in there, so how about putting this in Apache? Apache is great for code, but it doesn’t deal with the other stuff, which is fine. That isn’t its mandate. Apache does things very well though, especially when it comes to governance and the incubator process. What if we had a foundation that had some of the same values around people participating (so anyone can, versus companies) and a varied community (not just a few blokes from the same company).

This is why I am hopeful for the Open Web Foundation. It is a new place to look at if you come up with something helpful for the Open Web, a place that may match your values.

But wait a minute, what about this “Open Web” thing again. As I just said on a post about defining the term, people can’t agree on what the darn thing is! There is a lot of gut feel “Flash and Silverlight are not the Open Web, but GWT is!”

I believe that the Open Web Foundation needs to be a leader in working this out. With metrics in place, the foundation can bless projects that meet the requirements. When a project starts it may not be Open Web yet (e.g. multiple browser implementations). We need a place to move forward and push the Web. Can’t wait to see what happens there.

Announcing a new foundation isn't what matters. What really matters is what comes of it. I am excited to see how this all evolves.

In somewhat related news, Google Code now supports content licensing to go along with your open source project.

via Ajaxian » Front Page by Dion Almaer on 7/25/08

Steve Souders gave a talk at OSCON yesterday where he demonstrated the new Firebug Lite 1.2.

Today Firebug Lite 1.2 was released. This new version was built by Azer Koçulu, creator of pi.debugger. Azer joined the Firebug Working Group, morphed the GUI to look Firebug, and added it to the Firebug code base.

Firebug Lite is a subset of Firebug that can be used in IE, Opera, and Safari. The previous version provided console.log functionality. In Firebug Lite 1.2, Azer added the ability to inspect DOM elements, track XHRs, and navigate HTML, CSS, and JavaScript. You can embed it in your pages and enable debugging. I prefer creating a Firebug Lite bookmarklet that I can launch on any web page. Instructions and more information are available on the main Firebug Lite page.

If you like a little Firebug love when you debug non-Firefox browsers, check out the very much improved version!

via Ajaxian » Front Page by Chris Heilmann on 7/29/08

Simon Willison is lately having a lot of fun with App Engine and developing small RESTful helper apps for the masses out there. Following JSON Time, a small timezone lookup API over HTTP (showcased at BBC's Mashed earlier this year) he now released JSON head which is what it says on the tin: a HTTP HEAD lookup app that returns a JSON object.

If you for example use the APP with a url parameter like this:

http://json-head.appspot.com/?url=http://www.yahoo.com/&callback=foo

You are going to get a JSON response with a wrapper function called foo:

JAVASCRIPT:
  1.  
  2. foo({
  3.     "status_code": 200,
  4.     "ok": true,
  5.     "headers": {
  6.         "Via": "HTTP\/1.1 GWA",
  7.         "Content-Encoding": "gzip",
  8.         "Accept-Ranges": "bytes",
  9.         "X-Google-Cache-Control": "remote-fetch",
  10.         "Vary": "User-Agent",
  11.         "Last-Modified": "Tue, 29 Jul 2008 16:03:20 GMT",
  12.         "Connection": "close",
  13.         "Cache-Control": "private",
  14.         "Date": "Tue, 29 Jul 2008 16:23:14 GMT",
  15.         "P3P": "policyref=\"http:\/\/p3p.yahoo.com\/w3c\/p3p.xml\", CP=\"CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV\"",
  16.         "Content-Type": "text\/html; charset=utf-8",
  17.         "X-XRDS-Location": "http:\/\/open.login.yahooapis.com\/openid20\/www.yahoo.com\/xrds"
  18.     }
  19. })
  20.  

If you try a non-existing URL like:

http://json-head.appspot.com/?url=http://www.yahoo.com/nada

You'll get the 404 error message in JSON:

JAVASCRIPT:
  1.  
  2. {
  3.     "status_code": 404,
  4.     "ok": true,
  5.     "headers": {
  6.         "Via": "HTTP\/1.1 GWA",
  7.         "X-Google-Cache-Control": "remote-fetch",
  8.         "Vary": "User-Agent",
  9.         "Connection": "close",
  10.         "Cache-Control": "private",
  11.         "Date": "Tue, 29 Jul 2008 16:25:31 GMT",
  12.         "P3P": "policyref=\"http:\/\/p3p.yahoo.com\/w3c\/p3p.xml\", CP=\"CAO DSP COR CUR ADM DEV TAI PSA PSD IVAi IVDi CONi TELo OTPi OUR DELi SAMi OTRi UNRi PUBi IND PHY ONL UNI PUR FIN COM NAV INT DEM CNT STA POL HEA PRE GOV\"",
  13.         "Content-Type": "text\/html; charset=utf-8"
  14.     }
  15. }
  16.  

You could for example use this to write a script that removes links from the document when they are broken.

via Ajaxian » Front Page by Ben Galbraith on 7/30/08

In my other life as a desktop application developer (which due to a mix of Fluid, AIR, Prism, canvas, SVG, and Flash is threatening to converge on my Ajax life) I've long been a fan of data-binding frameworks that make it easy to have a form automatically synchronize with backing data structures, saving you from the tedium of a dozen little "widget.getValue() - dataModel.setValue()" calls (or in the case of grids, etc. much more verbose and tedious plumbing).

Dojo and others frameworks have some interesting binding features, but if your favorite JavaScript framework lacks form data binding, check out Steven Bazyl's small stand-alone JSON binding project: js-binding.

The project is just getting started, but it already has a few basic features that make it useful. For example, to convert this form:

HTML:
  1.  
  2.   <input type="text" name="username"/>
  3.   <input type="text" name="email"/>
  4.   <input type="text" name="address.street"/>
  5.   <input type="text" name="address.city"/>
  6.   <input type="text" name="address.state"/>
  7.   ...
  8. </form>
  9.  

into this object:

JAVASCRIPT:
  1.  
  2. {
  3.   username: "...",
  4.   email: "...",
  5.   address: {
  6.     street: "...",
  7.     city: "...",
  8.     state: "..."
  9.   }
  10. }
  11.  

You just need to write this code:

JAVASCRIPT:
  1.  
  2. var myObject = ...;
  3. var myForm = ...;
  4. var binder = Binder.FormBinder.bind( myForm );
  5. binder.deserialize( myObject );
  6.  

js-binder also has a built-in type conversion mechanism that, for example, allows you to easily integrate with a JavaScript date parsing library:

JAVASCRIPT:
  1.  
  2. var binder = Binder.FormBinder.bind( myForm, {
  3.   date: {
  4.     // Date handler using datejs much improved parsing...
  5.     parse: function( value ) { return Date.parse( value ); },
  6.     format: function( value ) { return Date.toString( 'M/d/yyyy' ); }
  7.   }
  8. } );
  9. binder.deserialize( myObject );
  10.  

The docs are concise but useful.

via Ajaxian » Front Page by Dion Almaer on 7/31/08

Vladimir Vuki?evi? normally hacks on Mozilla products, but spent a little time on an experiment with IE. An experiment that looks very exciting indeed.

I love canvas, and wish that it was ubiquitous. We have great wrappers out there such as dojo.gfx, but wouldn't it be nice if canvas worked everywhere? (and the full API to boot).

Well, Vladimir has an experiment to get it to IE. The approach is very interesting indeed. It isn't like excanvas which uses VML... and there is a Silverlight bridge being worked on that looks promising. Instead, we have this:

I've been working on a native Canvas implementation for IE based on the same rendering core that's in Firefox.

The same implementation, shoe horned into IE:

With an object tag, a bit of CSS, and (to work around another IE bug) a single line of script, <canvas> elements in HTML just work. I'm excited that this experiment is working out, because lack of Canvas support in IE is one of the reasons people skip Canvas and instead turn to Flash and other plugin technologies.
</canvas>

Congrats on a great hack, and here's to you making it much much more.

via Ajaxian » Front Page by Dion Almaer on 7/31/08

The first main play for IE 8 was to get developers on board, and start a conversation with us on what they are fixing, and where they are going.

There were a couple of user features such as Activities and Web Slices, but you could tell they hadn't finished there.

In their latest blog post they talk about reliability and the fact that they now have isolation between web pages and the chrome itself via processes. This means that a page could die, but the browser is fine:

One of our most significant investments is in a feature called Loosely-Coupled IE (“LCIE”), which is an architectural attribute that helps isolate different parts of the browser from each other, most notably, the frames from the tabs. LCIE is the foundation that we have built a few of our features on including Automatic Crash Recovery of which I expand on below.

For Beta 2, we added the following changes:

Frame Process Merging

To help improve startup performance, we have reduced the number of processes that we start. Instead of firing up two processes every time you launch the browser (one for the frame and one for your tabs), we now only fire up one frame process the first time you launch IE. Subsequent launches will only start a new tab process or make a new tab in an existing tab process.

For users that are accustomed to browsing websites in multiple “sessions”, for example if you want to log in to multiple email sites simultaneously, you can specify the “-nomerge” command line option to disable this feature.

More tab processes

It turns out that the vast majority of all IE sessions contain three or fewer tabs. Accordingly, in Beta 2 we try to give users three efficient tab processes. This is contingent on the user’s computer capabilities, but the more capable a computer is, the more processes we will use, up to a point. Adding more processes gives users much better isolation in the event of a failure. If each tab is in its own process, websites are completely isolated from each other.

Virtual tabs

We have also added the internal capability to “hot swap” the process from underneath a tab. Previously, Protected Mode worked on a per-process basis. For example, say you add a website to your trusted sites in IE7. If that site links to another site that is not in your trusted sites, it will cause you to switch browser windows when you click the link.

We improved this in IE8 Beta 1 with LCIE when we split the frame from the tabs. With the split we can create a new tab in the same window and switch you to that tab as opposed to being “punted” to a new window.

Virtual tabs lets you navigate across Protected Mode in the same tab since we just switch the process under the tab to the correct integrity level. This is really just “UI-sugar” – virtual tabs do not impact security or protected mode in any way, other than to make it more convenient to transition between protected mode on/off.

LCIE's capability of isolating different parts of the browser coupled with more tab processes and virtual tabs will improve the performance and overall reliability of Internet Explorer.

I saw an early IE 8 beta 2, and there are other very interesting features in there too. Some were subtle but interesting. We should get our hands on it soon!

via Ajaxian » Front Page by Dion Almaer on 8/1/08

Brad Neuberg got a huge amount of feedback on his call for a definition of the Open Web. He distilled that information and tried hard to come up with something that fits into one sentence, and ended up with this:

The Open Web is an interoperable, ubiquitous, and searchable network where everyone can share information, integrate, and innovate without having to ask for permission, accessible through a powerful and universal client.

His litmus test for this asks if the technology in question has:

  • Composability The ability to innovate, link, contribute, search, and integrate without red tape, fear of a lawsuit, or having to ask "please?"
  • Interoperability The ability for developers to interoperate without having to know of each others existence
  • Ubiquity The ubiquity of a set of open technologies and services agreed upon by the widest possible community
  • Universal Client Empowering and evolving the browser and web technologies as a universal client

via Ajaxian » Front Page by Dion Almaer on 8/4/08

Are you an ExtJS and Django user? If so, you will want to check out this article by Matt of Tangible Worldwide on Using ExtJS's Grid Filtering with Django.

He goes into detail on how to tweak the grid filtering system that is aimed at PHP, and getting it to work in a way that allows you to write this Django code:

PYTHON:
  1.  
  2. # take a ContentType model name (say, from the URL)
  3. # and create a QuerySet
  4. ctype = ContentType.objects.get(model=ctype_model)
  5. model_class = ctype.model_class()
  6. obj_qs = model_class.objects.filter()
  7.  
  8. # 'q' is the set of POSTed filtering parameters
  9. filter_params = request.POST.get('q', '[]')
  10.  
  11. # decode the filtering parameters w/ simplejson
  12. filter_params = simplejson.loads(filter_params)
  13.  
  14. # apply the filtering params
  15. filtered_qs = get_queryset_from_ext_filters(obj_qs, filter_params)
  16.  

ExtJS 2.1 saw inclusion of the popular (at least in my world) user extension for AJAX filtering of data by grid columns. As useful as this is (provided you can abide by the GPL or paid licensing options), the filter parameters serialized as a PHP array, which is not particularly useful for other languages. With a quick modification to the grid filtering serialization method and a helper function for Django, we can rewire the system to send a JSON string that Django can use to directly apply filtering to a QuerySet. I've found that most clients love having this sort of command and flexibility over their data -- especially the kind that don't necessarily realize that this visualization and control exists. I like that. Additionally, the amount of work and code required is minimal, and the code both reusable and straight-forward. I like that, too.

There are 4 steps to this process:

  1. Modify the serialization method in GridFilters.js
  2. Set up the helper function that will process the QuerySet with the grid filter parameters
  3. Slightly customize your models (see below)
  4. Add (simple) helper code to your Ajax view

via Ajaxian » Front Page by Dion Almaer on 8/5/08

Bruce Johnson of the GWT team has continued the deep dive into GWT with a posting on a new GWT 1.5 feature: JavaScript overlay types. This feature goes beyond the JNSI technique to "make it easy to integrate entire families of JavaScript objects into your GWT project. There are many benefits of this technique, including the ability to use your Java IDE's code completion and refactoring capabilities even as you're working with untyped JavaScript objects."

The first example that Bruce gives is to mix JSON objects with Java:

JAVASCRIPT:
  1.  
  2. var jsonData = [
  3.   { "FirstName" : "Jimmy", "LastName" : "Webber" },
  4.   { "FirstName" : "Alan""LastName" : "Dayal" },
  5.   { "FirstName" : "Keanu", "LastName" : "Spoon" },
  6.   { "FirstName" : "Emily", "LastName" : "Rudnick" }
  7. ];
  8.  
JAVA:
  1.  
  2. // An overlay type
  3. class Customer extends JavaScriptObject {
  4.  
  5.   // Overlay types always have protected, zero-arg ctors
  6.   protected Customer() { }
  7.    
  8.   // Typically, methods on overlay types are JSNI
  9.   public final native String getFirstName() /*-{ return this.FirstName; }-*/;
  10.   public final native String getLastName()  /*-{ return this.LastName;  }-*/;
  11.    
  12.   // Note, though, that methods aren't required to be JSNI
  13.   public final String getFullName() {
  14.     return getFirstName() + " " + getLastName();
  15.   }
  16. }
  17.  
JAVA:
  1.  
  2. // the glue
  3.  
  4. class MyModuleEntryPoint implements EntryPoint {
  5.   public void onModuleLoad() {
  6.     Customer c = getFirstCustomer();
  7.     // Yay! Now I have a JS object that appears to be a Customer
  8.     Window.alert("Hello, " + c.getFirstName());
  9.   }
  10.  
  11.   // Use JSNI to grab the JSON object we care about
  12.   // The JSON object gets its Java type implicitly based on the method's return type
  13.   private native Customer getFirstCustomer() {
  14.     // Get a reference to the first customer in the JSON array from earlier
  15.     return $wnd.jsonData[0];
  16.   }
  17. }
  18.  

Bruce then shows us some performance wins that you get, as GWT gets to do a lot of inlining:

A quick digression for compiler geeks. Another neat thing about overlay types is that you can augment the Java type without disturbing the underlying JavaScript object. In the example above, notice that we added the getFullName() method. It's purely Java code — it doesn't exist on the underlying JavaScript object — and yet the method is written in terms of the underlying JavaScript object. In other words, the Java view of the JavaScript object can be richer in functionality than the JavaScript view of the same object but without having to modify the underlying JS object, neither the instance nor its prototype.

(This is still part of the digression.) This cool wackiness of adding new methods to overlay types is possible because the rules for overlay types by design disallow polymorphic calls; all methods must be final and/or private. Consequently, every method on an overlay type is statically resolvable by the compiler, so there is never a need for dynamic dispatch at runtime. That's why we don't have to muck about with an object's function pointers; the compiler can generate a direct call to the method as if it were a global function, external to the object itself. It's easy to see that a direct function call is faster than an indirect one. Better still, since calls to methods on overlay types can be statically resolved, they are all candidates for automatic inlining, which is a Very Good Thing when you're fighting for performance in a scripting language.

From this Java code:

JAVA:
  1.  
  2. class MyModuleEntryPoint implements EntryPoint {
  3.   public void onModuleLoad() {
  4.     JsArray<customer> cs = getCustomers();
  5.     for (int i = 0, n = cs.length(); i <n; ++i) {
  6.       Window.alert("Hello, " + cs.get(i).getFullName());
  7.     }
  8.   }
  9.  
  10.   // Return the whole JSON array, as is
  11.   private final native JsArray<Customer> getCustomers() /*-{
  12.     return $wnd.jsonData;
  13.   }-*/;
  14. }
  15.  

The compiler inlines away to get to the followinig (not obfuscated to see):

JAVASCRIPT:
  1.  
  2. function $onModuleLoad(){
  3.   var cs, i, n;
  4.   cs = $wnd.jsonData;
  5.   for (i = 0, n = cs.length; i <n; ++i) {
  6.     $wnd.alert('Hello, ' + (cs[i].FirstName + ' ' + cs[i].LastName));
  7.   }
  8. }
  9.