Saturday, October 16, 2010

UNSUNG HERO of SRI LANKAN SPORTS – R KARUNANANDA, 1964 OLYMPICS

We know Susanthika, Damayanthi Dharsha, Marion Jones, Michael Jordan but have we heard about R Karunanada. He represented Sri lanka (then Ceylon) in the 1964 Olympics, in the mens 10,000m event.

Karunananda did his best to win a medal to his country, one could see the effort he took to his boot from the beginning and right throughout the race despite the spectators shouts. Finally, he won his battle making the spectators to a standing ovation that exceeded the salutation that the spectators gave to any athlete, and completed the race.


The Sri Lankan media has forgotten about this great athlete who fought his best to win a medal for his country, a true heroes like Karunananda should be honoured for his efforts made at this race. most of your’l might had not seen the race i am talking about, watch it at the end of this post.

Here is an article i pulled out, that would give one more information about Karunananda; (i don’t know the source of this article :( maybe daily mirror)

Those who unwittingly inhabit others’ versions of their realities might find Karunananda in a different way, I realized. If they scanned world cinema, the greatest or the most entertaining flicks, they might come across Ron Ichikawa’s ‘Tokyo Olympiad’ (Tokyo Orimpikku). They would no doubt be amazed to learn that a man who came last in the 10,000m race was also featured among the winners, including the incredible Ethiopian, Abebe Bikila who was the first Black African to win an Olympic gold medal and the first to win the marathon twice in a row. Karunananda didn’t compete in the marathon. He was placed 47th out of 52 in the 5000m race and started the 10,000 with a bad cold and a considerably weakened body. This was in 1964, when athletes didn’t chicken out if they were less than 100 percent fit, a time when athletes were not pampered with sponsorships, employment, vehicles, houses and other gifts.

Karunananda competed because he wanted his little daughter to be happy that he competed, from start to finish. He came last. He could have stopped at any point, it would not have changed anything. He didn’t. He was with the leaders when Billy Mills of the USA breasted the tape. That’s because he had been lapped four times by that time. When he continued, it surprised the spectators. When he came around they jeered. When he came around a second time, there was silence. And then there was cheering. Wild applause. He finished the race to a standing ovation that exceeded the salutation that the spectators gave Mills. Mills is reported to have said that the gold should have gone to Karunananda. Days after the race he still received gifts from sympathetic Japanese. One housewife wrote, ‘I saw you on TV, running all alone and I could not keep back my tears’. He was the original ‘Marathon Karu’ (the subsequent Marathon Karu, better known, died with Jeyaraj Fernandopulle in a suicide attack). The Japanese remember. His story is related to schoolchildren to teach the virtue of determination and the triumph of the human spirit.

Karu was offered a job in Japan. A few days before he was to leave Sri Lanka, he died. Some say he died in an accident. Some say he was murdered. Some say he just disappeared. Years later a Japanese television crew arrived in Sri Lanka to do a documentary on this incredible man. No one knew him. They had been taken to the then ‘Marathon Karu’ by mistake and he had helped the Japanese find the man’s family. Karu’s wife had lost her mind when her husband ‘died’. The family was literally on the street until a kind relative had offered to take care of the children. This is how his own country has recognised him………….! ‘We don’t have to look beyond our shores, ‘We are a nation blessed with our own heroes.’ There’s one in every body in fact. if we want to remember men and women who stood taller than the multitude, then let’s spare a thought for Ranatunga Karunananda.

Bloggers comments >> No wonder we live in Sri Lanka, we usually forget the people who were part and parcel of our lives and our country. So, the great Ranatunga Karunananda, i salute you on behalf of all the Sri Lankans as Sri Lankans will remain as Sri Lankans for many years to come.

Lesson learnt — People will drag you down, once your no longer an assert to them. Selfish indeed

Sunday, May 16, 2010

Saturday, April 3, 2010

XML

Why use XML
XML is the Extensible Markup Language.It improves the functionality of the Web by letting identify information in a more accurate, flexible, and adaptable way.It is extensible because it is not a fixed format like HTML (which is a single, predefined markup language).Instead, XML is actually a metalanguage—a language for describing other languages—which lets design own markup languages for limitless different types of documents. XML can do this because it's written in SGML, the international standard metalanguage for text document markup (ISO 8879). Here are a few reasons for using XML

1.XML can be used to describe and identify information accurately and unambiguously, in a way that computers can be programmed to ‘understand’ information (well, at least manipulate as if they could understand it).

2.XML allows documents which are all the same type to be created and handled consistently and without structural errors, because it provides a standardised way of describing, controlling, or allowing/disallowing particular types of document structure. Note that this has absolutely nothing whatever to do with formatting, appearance, or the actual text or data content of the documents, only the structure of them?.

3.XML provides a robust and durable format for information storage and transmission. Robust because it is based on a proven standard, and can thus be tested and verified; durable (persistent) because it uses plain-text file formats which will outlast proprietary binary ones.

4.XML provides a common syntax for messaging systems for the exchange of information between applications. Previously, each messaging system had its own format and all were different, which made inter-system messaging unnecessarily messy, complex, and expensive. If everyone uses the same syntax it makes writing these systems much faster and more reliable.

5.XML is free. Not just free of charge (free as in beer) but free of legal encumbrances (free as in speech). It doesn't belong to anyone, so it can't be hijacked or pirated. And you don't have to pay a fee to use it (you can of course choose to use commercial software to deal with it, for lots of good reasons, but you don't pay for XML itself).

6.XML information can be manipulated programmatically (under machine control), so XML documents can be pieced together from disparate sources, or taken apart and re-used in different ways. They can be converted into any other format with no loss of information.

7.XML lets you separate form (appearance) from content. Your XML file contains your document information (text, data) and identifies its structure: your formatting and other processing needs are identified separately in a style sheet or processing system. The two are combined at output time to apply the required formatting to the text or data identified by its structure (location, position, rank, order, or whatever).

XSL

Why use XSL?
The process of transforming and formatting information into a rendered result is called styling. Advantages to separating content from style
• Contrary to when style information is hard-coded into the content, separation of style from content allows for the same data to be presented in different ways. This enables:
• reuse of fragments of data: the same content should look different in different contexts
• multiple output formats: different media (paper, online), different sizes (manuals, reports), different classes of output devices (workstations, hand-held devices)
• styles tailored to the reader's preference (e.g., accessibility): print size, color, simplified layout for audio readers
• standardized styles: corporate stylesheets can be applied to the content at any time
• freedom from style issues for content authors: technical writers needn't be concerned with layout issues because the correct style can be applied later The full XSL language logically consists of three component languages which are described in three W3C (World Wide Web Consortium) Recommendations:
• XPath: XML Path Language--a language for referencing specific parts of an XML document
• XSLT: XSL Transformations--a language for describing how to transform one XML document (represented as a tree) into another.
• XSL: Extensible Stylesheet Language--XSLT plus a description of a set of Formatting Objects and Formatting Properties. An XSL processor takes a stylesheet consisting of a set of XSL commands and transforms it, using an input XML document.

Wednesday, February 17, 2010

SVG format

SVG is a language for describing two-dimensional graphics in XML [XML10]. SVG allows for three types of graphic objects: vector graphic shapes (e.g., paths consisting of straight lines and curves), images and text. Graphical objects can be grouped, styled, transformed and composited into previously rendered objects. The feature set includes nested transformations, clipping paths, alpha masks, filter effects and template objects.[1]
File extension SVG is mostly used in describing two-dimensional vector graphics in XML format. SVG stands for Scalable Vector Graphics. Data can be stored on its own file or can be embedded in a web page. However, not all web browsers are capable of interpreting it. File of this extension can be static or animated images. Since this is in XML format, SVG files can be opened by using text editors. These are images written as text. Vector images use geometrical figures represented by mathematical equations as oppose to raster images that uses pixels represented with different colors to create an image.[2]
With SVG, it can be fill (i.e., paint the interior) or stroke (i.e., paint the outline) of shapes and text using one of the following[3]
• color (using or the 'solidColor' element)
• gradients (linear or radial)
• patterns (vector or image, possibly tiled)


Advantages of using SVG over other image formats (like JPEG and GIF) [4]
• SVG is an open standard
• SVG files are pure XML
• SVG files can be read and modified by a large range of tools (e.g. notepad)
• SVG files are smaller and more compressible than JPEG and GIF images
• SVG images are scalable
• SVG images can be printed with high quality at any resolution
• SVG images are zoomable (and the image can be zoomed without degradation)
• SVG works with Java technology

The biggest advantage SVG has over Flash is the compliance with other standards (e.g. XSL and the DOM). Flash relies on proprietary technology that is not open source.




Security considerations
SVG documents may be transmitted in compressed form using gzip compression. For systems which employ MIME-like mechanisms, such as HTTP, this is indicated by the Content-Transfer-Encoding header; for systems which do not, such as direct file system access, this is indicated by the filename extension and by the Macintosh File Type Codes. In addition, gzip compressed content is readily recognized by the initial byte sequence [5].
Compressed SVG files are typically 50 to 80 percent smaller than SVG files and are automatically decompressed by the Adobe SVG Viewer with no noticeable delay to the user [6].
SVG documents may reference external media such as images, audio, video, style sheets, and scripting languages. Scripting languages are executable content. In this case, the security considerations in the Media Type registrations for those formats shall apply. if the processor follows only the normative semantics of this specification, this content will be outside the SVG namespace and shall be ignored. Only in the case where the processor recognizes and processes the additional content, or where further processing of that content is dispatched to other processors, would security issues potentially arise. And in that case, they would fall outside the domain of this registration document [5].
Simple svg example for Text[7]




It was the best of times


It was the worst of times.



The text element is used to write text at a location. The location is given in absolute terms with the x and y attributes or a relative location with dx and dy attributes.


Simple svg example for Circle(shape)[8]






The SVG element is used to create a circle. The cx and cy attributes define the x and y coordinates of the center of the circle. If cx and cy are omitted, the circle's center is set to (0, 0). The r attribute defines the radius of the circle.
Manipulate SVG Document From XML[9]
To manipulate SVG documents from XML it is needed to Encoding the Parts Catalog into XML.The parts catalog document is an XML document having as its root a element. This element inherits the xlink:extended characteristics by including the xlink:type attribute set to "extended." The root element also contains another attribute, the xml:base, which defines the base document location for all the contained locators. The xml:base attribute value points to the SVG document that encodes the small motor illustration(as an example).
xlink:type="extended"
xml:base="figure.svg"
xlink:title="motor">
... Locators ...

Each part contained in the motor assembly is modeled as an xlink:locator element that refers to a numbered circle pointing to a part in the exploded view illustration. A contained part element (a locator) contains a part description, a link to a more detailed view and quantity. The element points to a more detailed external parts document if a part is composed of other parts (i.e., if it is an assembly itself). That external view is another XML document encoded the same way .


1
Cylinder head



[1]Scalable Vector Graphics (SVG) 1.1 Specification W3C Recommendation 14 January 2003
[2] http://svg.extensionfile.net/
[3] http://www.w3.org/TR/SVG11/pservers.html
[4] http://www.w3schools.com/svg/svg_intro.asp
[5] http://www.w3.org/TR/SVGMobile12/mimereg.html
[6] http://www.adobe.com/svg/illustrator/compressedsvg.html
[7] http://www.svgbasics.com/simple_text.html
[8] http://www.w3schools.com/svg/svg_example.asp
[9] http://www.xml.com/lpt/a/67

Monday, February 8, 2010

Spring MVC framework



From the time that a request is received by Spring until the time that a response is returned to the client, many pieces of the Spring MVC framework are involved. The process starts when a client (typically a web browser) sends a request (1) .The first component to receive the request is Spring’s DispatcherServlet. Like most Java-based MVC frameworks, Spring MVC funnels requests through a single front controller servlet. A front controller is a common web-application pattern where a single servlet delegates responsibility for a request to other components of an application to perform the actual processing. In the case of Spring MVC, DispatcherServlet is the front controller.
The Spring MVC component that is responsible for handling the request is a Controller. To figure out which controller should handle the request, DispatcherServlet starts by querying one or more HandlerMappings (2). A HandlerMapping typically performs its job by mapping URL patterns to Controller objects.
Once the DispatcherServlet has a Controller object, it dispatches the request to the Controller to perform whatever business logic it was designed to do (3) (Actually, a well-designed Controller performs little or no business logic itself and instead delegates responsibility for the business logic to one or more service objects.) Upon completion of business logic, the Controller returns a ModelAndView object (4) to the DispatcherServlet.
The ModelAndView can either contain a View object or a logical name of a View object. If the ModelAndView object contains the logical name of a View, the Dispatcher- Servlet queries a ViewResolver (5) to look up the View object that will render the response. Finally, the DispatcherServlet dispatches the request to the View object (6) indicated by the ModelAndView object. The View object is responsible for rendering a response back to the client.

Spring

Spring is an open-source framework; created by Rod Johnson .It was created to address the complexity of enterprise application development. Spring makes it possible to use plain-vanilla JavaBeans to achieve things that were previously only possible with EJBs. However, spring’s usefulness is not limited to server-side development. Any Java application can benefit from spring in terms of simplicity, testability, and loose coupling. Put simply, spring is a lightweight inversion of control and aspect-oriented container framework.

Key features of Spring

Lightweight—spring is lightweight in terms of both size and overhead. The entire spring framework can be distributed in a single JAR file that weighs in at just over 1 MB. And the processing overhead required by spring is negligible. What’s more, spring is nonintrusive: objects in a Spring-enabled application typically have no dependencies on spring specific classes.

Inversion of control—Spring promotes loose coupling through a technique known as inversion of control (IoC). When IoC is applied, objects are passively given their dependencies instead of creating or looking for dependent objects for themselves. You can think of IoC as JNDI in reverse—instead of an object looking up dependencies from a container, the container gives the dependencies to the object at instantiation without waiting to be asked.

Aspect-oriented—Spring comes with rich support for aspect-oriented programming that enables cohesive development by separating application business logic from system services (such as auditing and transaction management). Application objects do what they’re supposed to do—perform business logic—and nothing more. They are not responsible for (or even aware of) other system concerns, such as logging or transactional support.

Container—spring is a container in the sense that it contains and manages the life cycle and configuration of application objects. It can be configured to how your beans should be created—either creates one single instance of your bean or produce a new instance every time one is needed based on a configurable prototype—and how they should be associated with each other. Spring should not, however, be confused with traditionally heavyweight EJB containers, which are often large and cumbersome to work with.

Framework—spring makes it possible to configure and compose complex applications from simpler components. In Spring, application objects are composed declaratively, typically in an XML file. Spring also provides much infrastructure functionality (transaction management, persistence framework integration, etc.), leaving the development of application logic to you.

All of these attributes of Spring enable to write code that is cleaner, more manageable, and easier to test. They also set the stage for a variety of sub frameworks within the greater spring framework.

Spring modules





The Spring framework is made up of seven well-defined modules (sub frameworks) .When taken as a whole; these modules give you everything you need to develop enterprise-ready applications. But you do not have to base your application fully on the Spring framework. You are free to pick and choose the modules that suit your application and ignore the rest. All of Spring’s modules are built on top of the core container. The container defines how beans are created, configured, and managed—more of the nuts-and-bolts of Spring. .These modules will provide the frameworks with which will build the application’s services, such as AOP and persistence pr MVC.


The core container: Spring’s core container provides the fundamental functionality of the Spring framework. In this module you’ll find Spring’s Bean Factory, the heart of any Spring-based application. A Bean Factory is an implementation of the factory pattern that applies IoC to separate the application’s configuration and dependency specifications from the actual application code.

The Spring MVC framework: Spring comes with a full-featured Model/View/Controller (MVC) framework for building web applications. Although Spring can easily be integrated with other MVC frameworks, such as Struts, Spring’s MVC framework uses IoC to provide for a clean separation of controller logic from business objects. It also allows to declaratively binding request parameters to the business objects.