Firefox 2 vs Firefox 3 beta 5
May 13th, 2008

| Test #1 | Test #2 | Test #3 | Test #4 | |
|---|---|---|---|---|
| Firefox 3 beta 5 | 15.3 | 51.3 | 135.9 | 48.3 |
| Firefox 2 | 184.5 | 782.8 | 909.6 | 828.2 |
I decided to give a try to Firefox 3 beta 5 and did some JavaScript performance comparison to see how faster it is. I used my own test script that performs object instantiations.
For a more thorough benchmark I recommend using SunsSpider JavaScript benchmark.
XML séma probléma
May 4th, 2008
XML sémák készítésekor beleütköztem az XML Séma nyelv egy kellemetlen korlátozásába.
Mindeddig azt hittem, hogy az XML Séma kellően rugalmas ahhoz, hogy bármilyen XML struktúra képes leírni.
Egy elemet deklaráltam, egy "type" nevű attribútummal.
Azt akartam elérni, hogy a type attribútum értékétől függően az elem rendelkezzen egy további "default" nevű attribútummal.
Valójában itt két egymástól minimálisan eltérő összetett típusról van szó.
Eddig minden rendben is volna.
A következőkben egy "question" nevű elemet deklaráltam, amelynek típusa vagy question1Type, vagy question2Type.
Ez az elem csak egyszer fordulhatna elő, és típusa változna.
Ezt azonban az XML séma nem engedi meg.
A séma érvényesítése a következő hibaüzenetet adja:
This schema doesn’t appear to be valid by itself (as a part of another schema,
it might still be OK): Schema error cos-element-consistent - all types of local
element ‘question’ must be consistent.
A choice elem a következő deklarációt engedné:
Egyszerű típusoknál az XML séma azonban lehetőséget nyújt a fenti probléma megoldására.
Ebből azt a tanulságot vonhatjuk le, hogy XML struktúrák tervezésekor figyelembe kell venni az XML Séma korlátait.
Ellenkező esetben gondok léphetnek fel az XML séma írásakor.
REST API to Google Search
April 23rd, 2008
Google’s SOAP Search API was very popular. As of December 5, 2006 Google no longer givs out Keys for SOAP search. This made a lot of people upset. A few books became useless as the examples relying on Google’s SOAP search no longer worked. Many SEO tools had been using the service, too.
Last year Google came out with AJAX Search API that lets you put Google Search in your web pages with JavaScript. Compared to the SOAP webservice it is rather useless as you cannot call Google Search directly from a server side code. However, this is no more true. The Google Ajax API team has a new release that enables you to access AJAX Search APIs from any web application, Flash or the server side.
Using the APIs from your Flash or Server Side framework couldn’t be simpler. If you know how to make an http request, and how to process a JSON response, you are in business [1].
I created a simple demo code in PHP to see how it works (Demo page,
See the source code
Download PHP source code ).
