Firefox 3.5 now supports HTML5, which includes some new features such as video element. Also, Firefox 3.5 supports new CSS Properties (Mozilla extensions - some of this are available with webkit with slight differences)

Among other things was the -moz-transform and -moz-transform-originproperties which lets the developer apply a linear transformations to HTML elements.

I was playing around with the new video element and javascript. and with the -moz-transform, and thought of sharing

Here’s the code of the following rotated box

<div id='test' style='-moz-transform:rotate(-45deg) skew(10deg, 10deg); background-color:#0000aa; height:100px; width:100px;'>
test test test test test test test test test test test test test test test test test test test test test test test test test test test test test
</div>

test test test test test test test test test test test test test test test test test test test test test

Here’s the code that will rotate the whole blog :)

<input type='button' value='Click Me!' onclick="document.getElementById('wrapper').style.MozTransform='rotate(-45deg) skew(10deg, 10deg)'" />

Tags: , ,

This is a short tutorial on how to use the PHP: Abstract Extension API and Dependency Interface.

You can find details about he status of the project here. The source code is available at the git repository : git://github.com/vpj/PHP-Extension-API.git, and some sample code which uses the interface : git://github.com/vpj/PHP_EXT_API_Tests.git

How to register APIs

You should create a structure with the API functions.

struct _SAMPLE_EXT_API {
	int (*add)(int, int);
	int (*multiply)(int, int);
};
 
typedef struct _SAMPLE_EXT_API SAMPLE_EXT_API;

Then you should register the API during module initialization

zend_ext_api_register("calculator", "1.0.0.0", (void *)&ext, sizeof(ext));

calculator is the name of the extension and 1.0.0.0 is the version in the major.minor[.build[.revision]] format. It is possible to register multiple APIs if there are multiple versions, to support backward compatibility. For example:

    zend_ext_api_register("calculator", "1.0", (void *)&ext_old, sizeof(ext_old));
    zend_ext_api_register("calculator", "1.1", (void *)&ext_new, sizeof(ext_new));

Getting the required APIs

APIs could be retrieved using a callback function or using zend_ext_api_get. Callbacks are called after module initialization but before RINIT. Callbacks should be used when the dependent extension requires some extension during module initialization. APIs cannot be retrieved during MINIT, since it will depend on the order in which APIs are registered. Therefore, the dependent extension could set up the callback function during MINIT and it will be called once all extensions are initialized.

Here’s an example of a callback function

typedef struct _SAMPLE_EXT_API {
	int (*add)(int, int);
	int (*multiply)(int, int);
} SAMPLE_EXT_API;
 
void my_callback(void *p_api, char *ext_name, uint version)
{
	char *version_text;
	SAMPLE_EXT_API *api = (SAMPLE_EXT_API *)p_api;
 
	zend_ext_api_version_toa(version, &version_text);
	php_printf("API Callback: %s - %d\n", ext_name, version_text);
	php_printf("\tsum(243, 34) = %d\n", api->sum(243, 34));
}

Callback should be registered in MINIT

zend_ext_api_set_callback("calculator", "1.0.0.0", my_callback);

I just noticed that I haven’t blogged since 3 months – last post was on February 7th. I was loaded with work in the past few months and didn’t find anything important to blog about :P .

I got selected for the Google Summer of Code project at PHP - Abstract Extension API and Dependency Interface; here is the link. So far, I have set up the build environment with lots of help from my mentor, Brian Shire, and played around with zend to get familiar with it. I will probably have to do considerable amount of work on this before our exams start on 1st of June :( . Anyway, there’s a long 2 month vacation after exams ;) .

I’ll be blogging about the status of the GSoC project, and you can also find updates here in the wiki.

Tags: ,

Puzzles

Recently I was just looking at some interview questions, and came across this page with some good puzzles (non-technical ones). I have seen some of these before, but most of these are new and challenging.

http://www.techinterview.org/

Tags:

I came across this you tube video of a record from a radio broadcast, and thought you might also enjoy it. It has a little more of the song than the official trailer :) . Visit Remember Ghajini for the trailers. Cool domain name ;)

Songs will be released on 15th November.

Hope you’ll enjoy! As always A R Rahman has done an awesome job.

EDIT

You can download the Guzarish full song mp3 (low quality) from rapidshare.

Tags:

Check your TC stats

jmzero’s website gives a comprehensive analysis of your past performance in topcoder competitions. It shows your weak areas and your strengths.

It also gives a comparison of your performance with contestants with similar ratings and with Petr. It shows you when you have outperformed Petr :-o .

Tags: ,

You can check the quality and speed of your internet connection with speed.io. Here’s what I got; overall quality: less good :( .

Tags:

I found this awesome video in digg. Enjoy!

Tags: ,



Tags:

Chrome

Google has release their open source browser and I gave it a try yesterday. It’s based on the Mozilla framework.

It took only a couple of minutes to download and install the browser. I came across a couple of awesome features while clicking around the browser.

  • There’s a real-time search integrated to the navigation bar, which also searches for domain names while typing urls; e.g. it matches etickets.lk when I typed etickets – this is different from Firefox as this was the first time it visited this site.
  • There is a control panel to stop tabs and plug-ins
  • There is a detailed list of memory used by each tab and plug-in
  • It has a cool start page which shows the frequently visited sites
  • Then, there are incognito windows. No trace of what you browsed in these windows will be saved. This is very handy if you are using a public computer.

Tags: ,

« Older entries