Vedic Math - Squaring of numbers near '50'

Note: Vedic Math Blog has been moved to http://vedicmath.vedantatree.com/. Please bookmark the new address for new and existing blogs.

In this article, we pick another special case of squaring i.e. squaring numbers which are near 50. It can have two cases, which are:
  • Case 1: Numbers greater than 50.
  • Case 2: Numbers lesser than 50
In both the cases, we need to take 50 as the base value. First let us take 'Case 1' i.e. 'Numbers greater than 50'.

Case 1 -
Take an example: Say, 542=2916 
Consider this answer in two parts: 29 (first part) and 16(second part). Now let us study, how Vedic Math can help us to achieve this answers or both of these parts.

As we are taking '50' as base, so the number presentation will be like 50 + 4. So the first part is 50, and second part is 4.

For the first part of the answer:
  1. Pick the first part i.e. 50.
  2. Pick the first digit i.e. 5
  3. Square this digit i.e. 52 > 25
  4. Add 4(second part) to it
  5. And we get our first part of the answer i.e. 29 (25 + 4).
For the second part of answer, following are the steps:
  1. Pick second part i.e. 4
  2. Square this digit i.e. 42 > 16
  3. And we get our second part of the answer i.e. 16
So the answer is 2916

Let us understand it with another example to make it more clear. Say, 612=3721
As we are taking '50' as base, so the number presentation will be like 50 + 11. So the first part is 50, and second part is 11.

For the first part of the answer:
  1. Pick the first part i.e. 50.
  2. Pick the first digit i.e. 5
  3. Square this digit i.e. 52 > 25
  4. Add 11(second part) to it
  5. And we get our first part i.e. 36 (25 + 11).
For the second part of answer, following are the steps:
  1. Pick second part i.e. 11
  2. Square this digit i.e. 112 > 121
  3. Now the result is of three digit. So the first digit (1) will be added to the first part i.e. 1 + 36 = 37
  4. So first part becomes 37 now
  5. And second part of answer will be 21 
So the answer is 3721. Refer to image below for visual representation.


Vedic Math - Squaring Of Numbers Ending with '5'

Note: Vedic Math Blog has been moved to http://vedicmath.vedantatree.com/. Please bookmark the new address for new and existing blogs.

In this article, we shall discuss a very common and interesting trick to square those numbers quickly which are having '5' as last digit. For example, what is the result of 652, 852, 1252 ?

Let us start with an example:- 35 x 35. How will you multiply?

The conventional approach is-

     35
   x 35
   -------
    175
   105
 --------
   1225
 --------

 In above problem, we followed the following steps:
  1. In first step, we multiply 5 by 35, get 175 and wrote it below the line.
  2. In second step, we multiply 3 by 35, get 105, wrote it below the first step and leave one space from right.
  3. In last, we add results from both the steps and get 1225 as answer.
Now here is the magical trick or quicker way to do this calculation using Vedic Math (to square any number with a 5 on the end). Let us have a look on the same example once again, following 'Vedic Math' steps to solve it.
  1. In 35, the last digit is 5 and other number is 3.
  2. Add 1 to the top left digit 3 to make it 4 (i.e. 3+1=4) (See the image below).
  3. Then multiply original number '3' with increased number i.e. '4'. Like 3 x 4, and we get 12.
  4. Now you can see that this is the left hand side of the answer.
  5. Next, we multiply the last digits, i.e 5 x 5 and write down 25 to the right of 12.
  6. And here we come up with a desired answer, 1225
  7. Visual representation is given below.


Which is the Best Free Load Testing Tool?

We have been assigned the work to find the best Load Testing tool from Free Tools domain. We also need to evaluate it against some best paid tools. Requirements were:
  • Tool should be free and preferably open source
  • It should be very stable and mature
  • It should be able to generate any amount of load without any software limit. Hardware can be increased as per requirements. 
  • It should be able to generate the concurrent load in concurrent running threads
  • It should support running JUnit test cases out of the box
  • It should support recording of Test Cases for UI, which can be played back later with load
  • Generated reports should be extensive in information and preferably in format also
  • Tool should be in active development
  • Out of the box support for various other interfaces will be a plus
With explorations, we found following tools famous and highly recommended in their categories:
  • Apache JMeter - Free and Open Source
  • Grinder - Free and Open Source
  • HP Load Runner - Paid, just to have a good comparison
Our exploration for above three tools is:

What is Vedic Math?

Note: Vedic Math Blog has been moved to http://vedicmath.vedantatree.com/. Please bookmark the new address for new and existing blogs.

We are going to start a new and very interesting section and that is 'VEDIC MATH'. Many of us are interested in increasing our productivity with calculations. This is where ‘Vedic Math’ helps us. It teaches us many ways to do the calculations quickly and if practiced correctly then all the calculations can be done in mind. Hence it helps us not only in our work, but routine works also. Vedic Math is also very useful for students to get rid of math phobia and improve grades. With these techniques one could be able to solve the mathematical problems 15 times faster. It improves mental calculations, concentration and confidence. Isn’t this great!

Once you are aware of the basics of Vedic Math, you can practice and make yourself a human calculator. Vedic Mathematics is magical. Let us take a simple example of multiplication to feel what Vedic Math is and what it can do.

So, let’s try 14 times 11.
  •     Split the 14 apart, like:
    •     1    4
  •     Add these two digits together
    •     1 + 4 = 5
  •     Place the result, 5 in between the 14 to have 154
  •     And the result is
    •     14 X 11 = 154

This is a very basic example to show the magical power of Vedic Math. Once you learned all the techniques, you will be able to do various complex calculations very fast as mentioned above. Before we proceed towards the different techniques of Vedic mathematics in detail, we first give you brief background of Vedic Mathematics history.

'Vedic Mathematics' is the name given to the ancient system of mathematics derived from ancient treasure of knowledge called ‘Veda’. ‘Veda’ means knowledge. Vedic Mathematics believes to be a part of ‘Atharva Veda’. It a unique technique of calculations based on simple rules and principles, using which any mathematical problem related to arithmetic, algebra, geometry or trigonometry can be solved quickly and possibly orally (once you master it).

Vedic Mathematics was devised probably thousands of years back; however it was rediscovered again from the Vedas between 1911 and 1918 by Sri Bharati Krsna Tirthaji (1884-1960). According to his research all of mathematics is based on sixteen Sutras or word-formulae. For example, 'Vertically and Crosswise` is one of these Sutras. These formulae describe the way the mind naturally works and are therefore a great help in solving the problems.

Basics of Java Message Service - II

In previous Article, we have read about basics of JMS with some simple programs. Here we shall continue with the introduction of basic programming elements, and objects of JMS Design. These basic objects are required for every JMS program. So it is important to understand these from conceptual and working aspect.

These JMS objects are called Administered JMS objects. JMS API has come in existence to provide a standard for messaging service and to standardize the interfaces and working of various messaging service providers. But, as many of the service providers were already in market, so it was not possible to define a strict protocol. Hence, JMS defines a compratively flexible protocol which take care of client protability by providing the standard interface, however, at the same time given ample flexbility to service providers to continue with their existence implementation by just changing the interfaces. JMS Administered objects are the standard objects specified by JMS API which every service provider should implement. These are important to ensure client portability. Beyond these administered objects, service providers are free to provide their custom implementation.

Following is the list of important Administered Objects:

Object Type - Implementing Objects
-----------------------------------------------
  1. ConnectionFactory - TopicFactory, QueueFactory
  2. Connection - TopicConnection, QueueConnection
  3. Session - TopicSession, QueueSession
  4. MessageProducer - TopicProducer, QueueProducer
  5. MessageConsumer - TopicSubscriber, QueueConsumer
In brief, every JMS user needs to create a connection factory first. Connection Factory can be specific to Topic or Queue messaging module depending upon requirements. JMS API defines a separate concrete object for Topic/Queue messaging model correspodning to each interface. So once we have connection factor, it can be used to ask Connection. Connection is like a factory for session objects. Session is a kind of separate working area for each client of JMS. One connection may provide multiple sessions, and each session will have its separate working space. After getting session, next step will be to create message producer and message consumer. Session acts as factory for message producers and consumers, so it is used to create message producers and consumers. Once message producer and consumers are created, now, these can be used to produce and consume the messages. Certainly, if you want to use Topic Publish/Subscribe model, you need to use Topic type of objects or otherwise you will use Queue type of objects.

Basics of Java Message Service - I


In perivous article, we have read about basics of messaging system and come to know that how messaging can help in quite flexible and abstract integration of various software applications. Now let us move further towards basics of Java Message Service (JMS), which can help us to implement the messaging concepts read till now.

JMS is a Messaging Oriented Middleware. Middleware is the software used to connect more than one software applications (distributed also) in quite flexible manner. Middleware can be of two typs, RPC based and messaging based. RPC based Middleware is one which provided synchronous integration between two software applications. Whereas, Messaging based Middleware (MOM) is one which inetgrate two software applications asynchronously using messaging concept. Certainly nowadays, MOM are quite popular where client can not wait for response from service and hence want a asynchronous request processing. JMS comes in this category. JMS can also be used for synchronous communication with some efforts, however, that is not something for which JMS comes in existence. It is devised specially to strengthen and standardize the messaging oriented middleware software.

Before JMS, there were many messaging solutions in market from various Industry players, like from IBM, Progress Software and Fiorano etc. Problem was, these products were not following any standard specification. So suppose, today you find that Software A is meeting your requirement and use it for implementation. After one year, you met with some new requirements, and then found that A can not meet these requirements but B has these new features. But, now it was not easy to replace the messaging software due to lack of any standard API implementation. JMS has solved this problem by defining a standard to implement the messaging systems with an abstract API. Now, clients can easily switch from one to other vendor anytime as per requirement without disturbing the implementation of application.

Hence JMS is a specification which defines an API allowing java based applications to utilize the features of any JMS compliant MOM software, without sticking to any one implementation. It provides a right level of abstraction from proprietary implementation of MOM systems. JMS is not an actual product. Actual products are still coming from indepdent software product companies like IBM, Progress Software etc. However, now, these products are adhering to the protocol defined by JMS specification, and hence following a standard approach with many of their specific advance features like load balancing, persistence, fault tolerance and administration etc. JMS is also implemented in J2EE in form of Message Driven Beans. Hence it becomes a intrinsic part of J2EE specification now.

Basic Concepts of Messaging System

JMS (Java Messaging System) was developed to cater the need of flexible integration design among various application or within application components.

In simple Java application, if we need to integrate one component/application with other, we have to have the reference of target with source. It means that one object must be aware about other object. It results into a tight coupling. It can be made flexible further by using different patterns like Factory, Service Locators and Directories but still objects used to be aware about each other type with a defined integration protocol like method signature. Now when architects want more flexibility, where one object is completely unaware about existence of other object and can simply say that I need this type of message. This is an ultimate flexibility in integration.

This type of flexible integration can be achieved using a messaging based simple design in java.  If we want to achieve this in Simple Java implementation, we can make a Message broker kind of component. This component can provide following facilities: 
  1. Any object can register with it as message producer by specifying a specific type of message, which can be a plain string. Message broker will maintain an internal data structure to keep track of such message producers corresponding to their message types.  
  2. Any object can register with message broker as message consumer. It will also specify a type of message for which it is interested to consume the message. Message broker will maintain an internal data structure to keep track of all message consumers corresponding to message types for which these wants the messages. 
  3. Now whenever any message producer produce a message, it calls message broker API and hand over the new message to it. Message broker knows the type of message, so it searches all the message consumers registered for this message type, iterate over this list and hand over the message to each consumer. 

Basics of Java Class Loader


Java class loader is an interesting concept of Java Runtime. We know that in Java,  every executable code is stored  in .java files which are compiled to .class files. These class files are stored in file system  in plain directory structure or in jar files or probably using some other medium. When any java program runs, it needs the definition of referred class files to execute this code at runtime. Here comes the role of Java Class Loader. Whenever Java runtime needs any class file, it calls a component of Java runtime called class loader to load the desired class. Default class loaders of Java i.e. Bootstrap and System Class Loader has the logic to search for the class file in JVM and in  directories and jars included in classpath respectively. It assumes that if Java program is referring to java.lang.Object, then the definition of this class must  be somewhere on  classpath in  java/lang/Object.class hierarchy. So by default, it has the logic to search in directories and jars. Once it finds the class file, it loads it in memory, store it with in memory cache for future reference and return to the runtime. So class loader search for the class files only once, and stores it in memory data structure to be utilized on future calls. Java classes loaded from default class loader are considered as trusted classes and hence these have the access to all core classes of java library itself.

Now Java provide enough flexibility to users applications to define their own custom class loaders, which can extend the default class loaders, and can add custom logic; like to load the classes from a  network location or from database and so on. Working of class loaders generally used to be like; a custom class loader first ask the parent default class loader of Java runtime to load the requested class. If default class loader is unable to find the class, then extended class loader proceed to load that class using its specific loading algorithm.

High Level Design Considerations for Reporting Solution

Reporting is an important part of most business enterprise solutions. Even for end business users, value of software is directly  proportional to quality of reporting system it provides. In this article, we shall discuss about very high level design considerations for reporting system. We shall not go in depth of technology, but will  talk about the thought process and various considerations which helps in design and in choosing the right tool.

When we talk about reporting, it means we are providing the information stored by Enterprise Application in a form which can provide valuable business and operational information to various stakeholders. Data stored by Application might be in different format, like most of the operations are related to CRUD activities and processing of various business document. However, reporting requirements can be very different. These can be very simple like to show all order processed with summary of their values, and also can be bit complex where one want to see the summary of all operations held, trend of specific business operations, future forecasting of business depending upon current sale trend and market data and so on. That means that we need to maintain data considering reporting requirements of solution, otherwise, it will be a good level of processing at the time of generating the reports if database structure is not compatible.

Next to discuss is, how database structure required for reporting can be different than application general data structure. Here are some of the possible differences:-

  • Operation database used to be highly normalized to ensure the data integrity and consistency. However, to generate the reports which may need bulky data processing, we may need to maintain data in de-normalized form so that related data can be found in same table/s without applying multiple joins.  
  • Reporting database may need many indexes to speed up the searching operations while generating the reports. However same level of indexes can slow down the create/update/delete operations in Operational Database.
  • We may need to do various calculations on Operational Data to generate the reports. If reporting data is different and is ported from Operational Data, these calculations can be done during porting and can be stored in database for fast access while generating the reports.     


What is Software Release Process


As software systems, development processes, and resources become more distributed, they invariably become more complex. Further, software products used to be in an ongoing cycle of development, testing, and releases. Moreover different platforms add more complexity to this. Hence it is quite understandable that there are many different dynamic pieces that must fit together seamlessly to ensure the success and long-term value of a product or project.

Release Process means a set of well defined steps which MUST be followed before giving any new project version to end users for use. These steps involves various components like:

  • Planning of features/enhancements/support/bugs we are covering in this release 
  • Versioning of releases
  • Time line for release - release date for testing and for users
  • Repository structure like branching in repository maintain the changes
  • Trace-ability matrix to track the quality
  • A good build system to ensure the quality deployments
  • Test cases and procedures
  • UAT management
  • Release to production environment
  • Procedures to revert the deployment in case of any failure
  • Information to client and training wherever required

Release process is the core of a stable system. If engineering team is heart of the project, release process is like heart beat of the project. Stability of every release is directly proportional to the strength and quality of release process and how good are we adhering to it. Ideally Release process is so important that it is being kept at first step even before building the software. Because it is the prorces which will ensure a smooth and quality delivery to the end users. Software team responsibility is not only to build a great software, but also to deliver it to users on time as expected and with desired level of quality.