Friday, August 29, 2014

Data Structure that empowers

Once again I started to feel as if I missed something interesting back in my education. I found myself embedded in the jargon of the professional IT and forgotten the deep academic concepts. I realized the importance of the non-cheating labs and the strong motives to do and not to score. And back to data structure I started going through MIT book on structure and interpretation of computer programs. This text revealed some in depth data structure concept I started to forget.
The essence of any software lies in the power of abstraction that has been utilized. The more precisely you abstract your business model, the more you are ready to accept the changing business need. Also, the more re-usable you make the software. For example, if you build a few-line module for doing a simple functionality then what it worths depends upon how often the functionality is needed. But, how re-usable it is depends upon how you model your software. To elaborate the re-usability of abstraction I want to take help from a real life example.
Suppose we are building a text processing engine. What you do at the very first is parse and validate individual records in the text. Then you map the records to some useful data structure. Now, how often you use this data structure and what you can build from that data structure relies upon how you model the data structure and of course the entire engine. Properly designed structure will find its use in every addition in the business usecases and every extension in the ultimate business. Well thought off model can extend to any business need by just assembling the business components in different ways or re-writing some of the components using the sub-components and reassembling them in different ways and so on.
Power of a programmer lies in utilizing the standard concept of abstraction without affecting the readability of the code underlying. Academics provides us with the key idea in the theories behind these standards and the concepts that apply to many domains.

Wednesday, February 4, 2009

Modern vs classical physics

In the Newtonian age physics dealt with the individual object. Basic foundation of Newtonian physics was that every object has some fundamental building block and there must be foundation for everything. In modern physics however every object exists because of its complex relationship with the other objects in the surroundings.
Physics from the beginning of human race has a great impact in social behavior and physics itself is developed with the social changes. So, society is directly affected with every inventions in physics and social beliefs are someway or other affected by the basic understanding of physics.
In the Newtonian age the focus was in individualism and the aim of physics was to know all the realities of the world by breaking it in parts and to win the nature. That very concept had ruled over the society and so society marched for the physical development and inventions without caring for the impacts. Every one focused for himself.
Modern physics two main inventions: relativity theory and the uncertainty principle marked the drastic change in the old concept. The other important invention of the age is Matrix theory. With these inventions the modern age defined a very complex relationship among the so called individuals and complex theory that is very hard to observe with our understanding in 3 dimensional world for the reality always bases on four dimensions, the fourth being time. Modern theory differs from the old theory mainly in two cases: there is no any definite foundation for any thing even the knowledge and, there is no individualism in reality.
The firm belief of the Newtonian physics with the expectation of a firm foundation for any theory and beings made very hard to believe the new theory even for Einstein. Even very good researchers of modern physics can not believe on this new theory and can not understand easily.So it is far from beyond the ken of normal mind.
Whatever may be the complexity physics ultimately establishes its root in society. The reality of this invention is different from other inventions since this is beyond the conception of normal mind and will certainly take very long time to be established in the society. With the establishment of this theory, it will have a great impact.
With the Newtonian concept every one thinks as an individual as the theory suggested existence of fundamental building block. With the modern concept, the basis of existence of one is dependent on the existence of the others and the formation of the whole. This makes individual to not to think as me and mine and nature will no longer become separated from the individual. An individual can never progress as an individual rather the whole environment is affected and similarly an individual can hurt just others rather affecting the existence of himself...

Friday, April 11, 2008

Custom error handling in jsf applications

Steps required in custom error handling:
1.Define custom Faces Servlet that delegates the service to default faces servlet, javax.faces.webapp.FacesServlet, refer Mert's approach http://www.jroller.com/page/mert?entry=handling_errors_with_an_errror
2.Edit web.xml so that the default faces servlet javax.faces.webapp.FacesServlet is defined as old faces servlet(or some other name). Also define your own custom faces servlet as Faces Servlet. Now your web.xml faces servlet part looks like this:



Servlet mapping is not changed, follow instructions in Mert's article. The redundant servlet without mapping, javax.faces.webapp.FacesServlet is required evenif you do not use it to process any request and do not map any urls.
3. Add factory element in the faces-config.xml as follows:





4. Define a custom ServletContextListener class that implements ServletContextListener and add a listener element to web .xml.

5. Update the facelets.DEVELOPMENT parameter to make it false, if you are using facelets, this ensures redirection to error page.