August 01, 2008

Experience with Cuil

Cuil, the new search engine seems to be a big buzz on internet this week. This is mainly for two reasons: One, they claim to have indexed more web sites than Google and second that it was developed by ex-Google employees. Even with these claims, I feel the search engine poor to Google or other competing search engine. The only stand out being the way they display search results. Here is my experience using cuil.

Starting with the name “cuil”, which is pronounced cool, does not sound good! This might be very personal comment and might sound irrelevant compared to other experience I had. Google has become an english word we commonly say “I am going to google it”. But “I am going to cuil (cool) it” sounds little wired.

Leave apart the silly issue, I found cuil delivering me irrelevant data and redundant once. My first test on the search engine was to search for my-self! Interesting thing is showed me pictures of someone else. It also to me to an explicit site when safe search was turned on! Regarding the redundant results entries, the engine displayed the same entries on far pages.

Other issue with the engine is that they do not have much of a preference. You can only can only turn on/off the safe search and typing suggestions. There is no search by file type, date, etc.

Major advantage is how the results are displayed. On searching “java programming”, the engine provided me an accordion on exploring by categories. But it’s sad that cuil do not suggest word if you miss spell!

So, what do you think? Can a product developed by ex-Google employees be so badly written? Or is it just the beginning of a new search engine? Because Google was not built in a day!

July 22, 2008

I am frustrated with Geronimo!

For those who don’t know, Geronimo is a project from Apache aimed in creating a Java EE 5 application server using open source. It is also certified by Sun for its compatibility with java EE specification. Apache claims the server to be very developer friendly, easy to use and easily integrate with IDEs like Eclipse. All my hopes failed when in installed it on my Vista!

Yes, I am a frustrated developer now! My laptop comes with Vista Home and I am simply not able to start the Geronimo server on it. At the same time, I am able to run the server and play with it on other Microsoft OS like Windows XP, Windows Server 2003.
So what did I do? I contacted the Geronimo user group at Nabble forums. After one week I still have no solution! Its not that I got a reply.. Its simply that none of the options work out. Here is what I have tried so far:
  • Try running the server from C:\geronimo
  • Try running the server from C:\user\\geronimo
  • Try running the server from another Drive
  • Try running the server from C:\Program Files\geronimo
  • Try running the server after disabling firewall in the above mentioned locations.

Does anybody have a solution???

July 09, 2008

What is Cross Site Scripting (XSS)?

Web sites have become quite complex and dynamic in nature these days. They have incorporated features that increase user experience and make browsing enjoyable. With new features come new troubles too. One major and popular threat is "Cross Site Scripting" but security professionals call it XSS. In this article, I will explain what it is and how as a netizen, avoid an attack.

So, what is XSS? Cross Site Scripting (XSS) is said to occur when a web site collect malicious data from a user. The attacker adds the malicious code in a form or link. Usually the code is encoded in HEX or other encoding methods. For a normal user the link or form appears normal and part of the web site. On accessing these links, the data about the user collected. Along with this, the code creates an output that looks genuine. For example, Orkut user would have received java script that can be executed through the Orkut scrap box. The script gives interesting output that look harmless but, it is easy for the attacker to hijack my session and use it.

XSS can be in the form of JavaScript, VBScript, ActiveX, HTML, or Flash. And using XSS you can hijack accounts, manipulate with user settings, steal cookies or poison them, and also do false advertising. This attack can even occur on a secured site too. The lock on your browser does not mean that you are secure for XSS!

So what do we do? As a common user here are few things that you can do to prevent XSS attack:
  • Always follow links from the main website. For example, if you see link to news article of site X on site Y. It is better to open site X, use its menu or search feature to get the news or article.
  • Think twice before you click on ads placed on less know web sites. If an ad interests you, google it and view the site!
  • Be careful in opening your emails, its attachments etc.
  • Keep internet security at high level in your browser.
These actions might help you from XSS attack. At the same time, browser vendors like Mozilla and Microsoft have started their war against this attack. IE8 team recently demonstrated their XSS filter on IEblog. From Firefox, you already have add-ons that help you detect and prevent XSS.

June 25, 2008

Nokia to open source Symbian and start a new revolution

Big mobile players Nokia, Sony Ericsson, Motorola and NTT DOCOMO anounced they are all set to open source the Symbian mobile OS. Nokia will buy 52% of Symbian. This acquisition will be the first step in the establishment of the 'Symbian Foundation'. And Nokia will join two other major platforms; Google's Android operating system and Apple's OS X iPhone.

The new foundation will provide unified platform with common UI framework. Initially, they will release selected components as open source and gradually make the complete software open source. The platform is intended to be released under Eclipse Public License (EPL) 1.0. Nokia had recently acquired Trolltech which also provide a mobile software platform. But now, they will have the most widely used mobile OS unified and taking on Android and iPhone!

June 05, 2008

Using XSL-FO to create PDF files

Libraries like iText,PDFBox are some of the best libraries available for PDF creation and manipulation. But these libraries have its disadvantages. One such disadvantage is templating the PDFs you create. In a enterprise where reports (PDF files) are generated automatically and routed to work-flows or stored in content management repositories. These reports follow an enterprise level style and pattern which can be reused, can change and will require proper management. Hardcoding styles and formats of reports into your application can cause lots of issues in future. That's when XSL-FO and Java (or other language) come into picture. In this article I will introduce XSL-FO and Apache FOP.

Let me intoduce XSL-FO first. XSL-FO stand for Extensible Stylesheet Language Formatting Objects and is a language for formatting XML data. It was initially part of the XSL W3C recommendation. So W3C has come up with XSLT for transforming XML documents and XSL-FO for formatting. XSL-FO documents are XML files that contain information about the output layout and output contents. But they do not specify the content type of the output. This output can be any document type; all you need is a transformation library that transform the XSL-FO to the appropriate content. In this article I will make use of Apache FOP, which is part of Apache XML Graphics Project.

First look at XSL-FO:
Here is a sample XSL-FO file. Like any other XML file, its starts with XML declaration:
<?xml version="1.0" encoding="utf-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">

<fo:layout-master-set>
<fo:simple-page-master master-name="A4">
<fo:region-body margin="2cm" />
<fo:region-before/>
</fo:simple-page-master>
</fo:layout-master-set>

<fo:page-sequence master-reference="A4">
<fo:flow flow-name="xsl-region-body">
<fo:block>Hello World!</fo:block>
</fo:flow>
</fo:page-sequence>
</fo:root>
The element is the root element of XSL-FO document. contains one or more template pages and master-name attribute specify the name for the template. elements describe the page contents. contents are not directly placed, they are placed inside a flow which in turn hold block. Each block can hold the data that is displayed. For further details please go through the tutorial.

Apache FOP:
Apache FOP (Formatting Objects Processor) claims to be the first processor that reads a formatting object (FO) tree and renders the resulting pages to a specified output. The primary output format is PDF but the following formats are supported:
  • PDF (Portable Document Format)
  • PS (Adobe Postscript)
  • PCL (Printer Control Language)
  • AFP (MO:DCA)
  • SVG (Scalable Vector Graphics)
  • XML (area tree representation)
  • Print
  • AWT/Java2D
  • MIF
  • RTF (Rich Text Format)
  • TXT (text)
Using the FOP library, you will be able to process any XSL-FO and render it to PDF. The library is very simple and straight forward. Since all the details of formatting is in the XSL file, all we need is to make use of the transformation API to transform and generate the output. This content is stored as file on your file system. FOP makes use of JAXP. Have a look at the Java application to transform a simple XSL-FO document into PDF.
OutputStream outputPDF = new BufferedOutputStream(new FileOutputStream("hello.pdf"));

FopFactory ff = FopFactory.newInstance();
Fop fop = ff.newFop(MimeConstants.MIME_PDF, outputPDF);
TransformerFactory factory = TransformerFactory.newInstance();

Transformer transformer = factory.newTransformer();
Source src = new StreamSource(new File("hello.fo"));
Result res = new SAXResult(fop.getDefaultHandler());
transformer.transform(src, res);
For your reference, you may download the sample application. Like I mentioned, the main advantage will be to use XSL for formatting and designing the templates of different and simple use the API to generate the complete report. This way, all reports will have consistency and it will be easy to modify the reports style if necessary.