Archive for September, 2009
Post Chrome Frame, fear seen in Mozilla!
It is interesting to see how people behave in a period of change. Some people embrace it, some go hysterical blabbering nonsense. Post release of Chrome Frame, one of the Mozilla’s top brass, Mitchell Baker, has taken the second route. Excerpting from her blog entry:
For many people Chrome Frame will make the web even more unknowable and confusing. Image you download Chrome Frame. You go to a website. What rendering engine do you end up using? That depends on the website now, not on you.
I don’t care! What I want is my page to render properly.
She continues:
And if you end up at a website that makes use of the Chrome Frame, the treatment of your passwords, security settings, personalization all the other things one sets in a browser is suddenly unknown.
The aim of Chrome Frame is just to change the rendering engine. Not replace IE’s personalization tools.
And the blabber continues to new hysterical levels:
Google is not the only website developer that would find this idea useful. Google is providing the set of features it believes are helpful for making powerful websites. Other websites will have browser features they would find useful for their applications. Imagine having the Google browser-within-a-browser for some sites, the Facebook browser-within-a-browser for Facebook Connect sites, the Apple variant for iTunes, the mobile-carrier variant for your mobile sites — all injected into a single piece of software the user thinks of as his or her “browser”. Each browser-within-a-browser variant will have its own feature set, its own quirks, and its own security problems.
Wow! I don’t understand what she is saying!!
And the classic case of fear: blabber about the architectural flaws:
For those not familiar with the ins-and-outs of browser architecture, you can think of a browser as having two essential parts. One part we humans don’t see — it’s the part that “speaks” computer languages and talks with web servers. This is often called the “platform” or the “rendering engine”. The other part is the set of things that human beings see and interact with, which is often called the “front-end” or the “application layer.”
She continues:
Chrome Frame breaks this connection by inserting a separate rendering engine into your browser, and allowing websites to determine which rendering engine you end up using. If you download Chrome Frame you see the basic front end of your previous browser, but websites cause your browser to toggle back and forth between the rendering engine of Chrome and the rendering engine of the browser you selected. The application layer of your browser and the platform part of your browser are no longer connected.
What if they are not connected? Why talk theory in a place where usability matters?
So guys, what does this mean? Fear! Of course!! Fear of (quoting Mitchell again):
Mozilla Firefox has reached some 300 million people, but hundreds of millions more continue to use the browser that came on the machine they bought, sometimes years ago. Google began offering its own browser — “Chrome” — a year or so ago, but this has yet to gain significant traction.
Fear of Google Chrome (and Chrome Frame) surpassing Firefox in usage. And fear of Google severing the financial lifeline of Mozilla Foundation (Google is the only big donor to the foundation).
On my part, I have removed Mitchell Baker from my feed. I thought her to be a inspirational person. But she turned out to be just another emotionally fluctuating person.
Long live Mozilla!
Google Chrome Frame
Google has pulled the rug out of Microsoft’s feet! In a totally fascinating move, Google released Google Chrome Frame, a IE plugin which brings in WebKit rendering inside IE. When using this IE plugin, the page rendering is done by WebKit and Google’s fast JavaScript parser V8. But the Cookies, Browser History and Stored Passwords are still managed by IE. This allows for seamless shifting between sites.
The best part is, from a Web Developer perspective, we have to just add the following inside the <head> section:
<meta http-equiv="X-UA-Compatible" content="chrome=1">
If Chrome Frame is installed in the browser rendering this page, then it is used by default. Cool!
Check out the Wikipedia IE8 page to understand more about X-UA-Compatible.
Amazing work Google
OpenSource Font Manager
Fontmatrix is an excellent Font organizing Software available for Linux, Windows and MacOS.
To install it in all Debian based systems (including Ubuntu):
$ sudo apt-get install fontmatrix
Screenshot of Fontmatrix running in my system:
Mounting WebDav in Ubuntu
$ sudo apt-get install davfs2 $ sudo mount -t davfs http://localhost:8080/alfresco/webdav <filesystem_folder>
XSL Transform using Java
import javax.xml.transform.Templates; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerFactory; import javax.xml.transform.stream.StreamResult; import javax.xml.transform.stream.StreamSource; import javax.xml.transform.TransformerConfigurationException; import javax.xml.transform.TransformerException; ... // The XSL source: StreamSource xsl = new StreamSource(...); // Create the transformer: TransformerFactory factory = TransformerFactory.newInstance(); Templates template = factory.newTemplates(xsl); // can throw TransformerConfigurationException (parent exception is: TransformerException) Transformer transformer = template.newTransformer(); // can throw TransformerConfigurationException // The data XML source StreamSource data = new StreamSource(...); // The transformed output: StreamResult out = new StreamResult(...); // Transform using the Transformer instance: transformer.transform(data, out); // can throw TransformerException
Have a look at the StreamSource API and StreamResult API to understand the various ways by which it can be instantiated.
IE 8 features that impressed me
I am posting this as a photo-stream in Flickr.
Tornado (the Python WebServer/Framework behind FriendFeed) goes OpenSource
Post acquisition by Facebook, the software behind FriendFeed has been OpenSourced. Tornado is a Python WebServer/Framework. The distinguishing feature of this WebServer is that it is non-blocking and designed for high-scalability.
Facebook in the past has OpenSourced many of their frameworks and tools.
Beginner’s article on Liferay Portal Server
My article Portlet Development with Liferay published in the August 09 edition of Linux for You is available online.
Text Transform in CSS
For one of my blog post, I copied a particular blog author’s name from his blog. The author name was displayed in his blog as TOM BAEYENS. When I copied and pasted it in a text editor, it pasted as: Tom Baeyens. I wondered how did copy-paste change the case of the text.
After little debugging using the Firefox WebDeveloper plugin, I found that the text in the blog had the CSS property text-transform with value uppercase.
After little more study, I learned that text-transform is a CSS2 property which supports the following values:
| capitalize | Make first character in each word uppercase |
| uppercase | Make all characters uppercase |
| lowercase | Make all characters lowercase |
| none | No transformation |
To demonstrate, I write the text with different text-transform values:
| none | I love JAVA |
| capitalize | I love JAVA |
| uppercase | I love JAVA |
| lowercase | I love JAVA |
jBPM 4.1 released
Tom Baeyens (founder and lead of JBoss jBPM project) has announced the availability of jBPM version 4.1.
Maven Profiles
Thanks to Arun Jeganath for making me understand Maven Profiles.
Often we are forced to specify different build parameters in different environments. In the ages of Make, these parameters used to be specified as environment variables. In the world of Maven, we have profiles.
Profiles: Introduction
A sample profile information:
<profiles>
<!-- DEV Profile (Default) -->
<profile>
<id>dev-profile</id>
<activation>
<property>
<name>env</name>
<value>dev</value>
</property>
<activeByDefault>true</activeByDefault> <!-- Note this -->
</activation>
<!-- Liferay Home in DEV -->
<properties>
<liferay-home>${user.home}/apps/liferay-portal-tomcat-6.0-5.1.2</liferay-home>
</properties>
</profile>
<!-- TEST Profile -->
<profile>
<id>test-profile</id>
<activation>
<property>
<name>env</name>
<value>test</value>
</property>
</activation>
<!-- Liferay Home in TEST -->
<properties>
<liferay-home>/opt/apps/liferay-portal-tomcat-6.0-5.1.2</liferay-home>
</properties>
</profile>
</profiles>
Quick learning from the above example:
- There can be number of profiles defined.
- A profile can be marked as <activeByDefault>. This will enforce the configuration defined in the activated profile to take effect during build.
- To enable a specific profile during build, the value defined in XPath /profiles/profile/activation/property needs to be passed the Maven as System Property (in our case: -Denv=test).
- The property defined in the profile (liferay-home) can be referenced elsewhere in the pom.xml as ${liferay-home}.
Placing profile information
Profile information is generally placed in:
- In the project POM itself.
- Inside {user.home}/.m2/settings.xml.
In the first case (in this particular example), the deployment information is placed in the project’s POM. This, some might feel improper because the module/project build has hardcoded environment dependencies which might not work in other systems. The second option externalizes the platform specific build information. But a new developer checking out the project will not be aware of this external dependency causing his build to fail. Both these problems might be addressed using documentation: some projects have README and BUILD files explaining environment setup for build.
As we saw, both methods have advantages and disadvantages. Choose the method appropriate to your situation.
Parameters that can be overridden in profiles
Note: This list is shamelessly copied from the official Maven profiles guide. Refer to this guide for detailed information.
- <repositories>
- <pluginRepositories>
- <dependencies>
- <plugins>
- <properties> (not actually available in the main POM, but used behind the scenes)
- <modules>
- <reporting>
- <dependencyManagement>
- <distributionManagement>
- a subset of the <build> element, which consists of:
- <defaultGoal>
- <resources>
- <testResources>
- <finalName>
