Create your own Hybrid Project Life Cycle

There are various project life cycle approaches in use for projects. All of these have their own pros and cons. So process should be picked after analyzing these pros and cons from project perspective. But it might be possible that none of the existing approaches are actually catering to all of your project or Organization requirements. Hence, it is also very much possible to mix more than one approaches, may be in different phases of project or in different activities. Many of the projects are executed with hybrid approaches. To understand this, let us first understand about most popular approaches in brief.

Waterfall Approach
It is one of the most used approaches for projects till now. It is in use since long. The approach suggests to plan for the whole project requirements in one go i.e.

  • Collect all requirements
  • Analyze and freeze the requirements
  • Do analysis and design for complete functions
  • Plan and Schedule the tasks for whole project
  • Complete the construction
  • Execute the testing of all functions
  • Fix the issues
  • Make the project live
  • Perform Maintenance activities
So you would see, it is a sequential approach to perform and complete all activities for a project going through conception, Initiation, Analysis, Design, Construction, Testing, Deployment to production and then Maintenance. Waterfall model comes from manufacturing and construction industries initially. Then it later adopted for software development also. And it actually worked well initially. It performs well for projects with comparatively stable requirements. 

Points in favor of this approach are that it give emphasis to complete the work for each phase with utmost perfection. It asks to design the system perfectly in design phase itself to avoid any restructuring later which can cost lot of money due to changes at large scale. It advocates to close the requirements in first phase itself, to avoid the changes later in project life. Due to these reasons, it results into a very stable project life cycle, easy to predict - plan - and budget. So it is good for budgeting also. It emphasize of documentation for each phase of project, and hence helps in creating the rich knowledge base. This remove the risk of loss of knowledge if any key member or members leave the project.

What is Pagination?

In many use cases, there is a generic requirement to show the list of data to user. User should be able to see the list of data, to perform search and sorting operations on this data. User should also be able to navigate to any data record anytime. This requirement demands to fetch the large amount of data from database and list it on UI for the user. Then this data can be filtered using various search criteria and can be sorted also depending upon user input. Approach to fetch the data can be different depending upon architecture and implementation of application, like data can be fetched directly from database in case of embedded applications, or 2 tier architecture or through some services in 3 tier architecture. The process flow used to be like:
  • Take inputs from user what kind of data she wants to see
  • Interact with database directly or through service (depending upon architecture) to get this data 
  • Display this data to user
  • Filter or sort the data depending upon user action on UI
For example, open google.com. Search for any word. You will get search results in list form, and various page number given at the bottom of the page to navigate to different pages. 

Now if there are thousands of data records in database for given inputs, all of this data can not be shown to user in one go. Showing this on same screen will be having problems like: 
  • It will not be a good experience for user, as she will need to scroll up and down a lot and information will be unreadable practically.
  • It will not be good for performance of application, as application may get out of memory or may face slow response due to large amount of data in memory, or data transfer from database.
To solve first problem mentioned above, we need to divide the data in small parts to show the user one part at a time. For example, we can divide data in parts having 50 records each. Then each of the parts can be shown to user one by one. Once user see first part, she can request for next or previous part and hence corresponding 50 records can again be shown on screen to user. These parts are called pages, and this process is called pagination - which divides the large data in pages (having limited records) and show these to user.

Vedic Math - Multiplication of any Numbers

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

In the previous article, we have discussed few cases of Multiplication with "vertically and crosswise" sutra. In this article, we shall learn the remaining cases.

E. Multiplying three digit by three digit numbers
For example: abc x pqr



Multiply:
1) vertically                                              (a x p)
2) crosswise in both directions and add    (a x q) + (b x p)
3) crosswise in both directions and add    (a x r) + (b x q) + (c x p)
4) crosswise in both directions and add    (b x r) + (c x q)
5) vertically                                              (c x r)

Step2 and Step4 are same as we did in the previous sections i.e. multiplying crosswise with two columns at a time. But in Step3, we multiply crosswise using the outer columns, then multiply vertically in the middle column and add these numbers.

Vedic Math - Multiplication of any numbers

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 the Vedic Math sutra "vertically and crosswise". This is the General Formula which is applicable to all the cases of multiplication. You will found this method very useful in division also that we shall discuss later. In the previous sutras, you subtracted crosswise; now you will multiply crosswise.

A. Multiplication of two digit numbers
For ab x uv


The numbers are written from left to right.
Now multiply:
1) vertically                                              (a x u)
2) crosswise in both directions and add    (a x v) + (b x u)
3) vertically                                              (b x v)

The answer has the form:   au | av + bu | bv

Following is the example of two-digit multiplication will make this clear:
12 x 23
 1         2
 2         3
--------------
2 | 3 + 4 | 6
= 2 | 7 | 6
= 276

The previous examples involved no carry figures, so let us consider this case in the next example.
64 x 93
 6          4
 9          3
-----------------
54 | 18 + 36 | 12
=54 | 54 | 12
=54 | (54 + 1) | 2         (Carry over the 1)
=54 | 55 | 2
=(54 + 5) | 5 | 2          (Carry over the 5)
=59 | 5 | 2
64 x 93 =5952

The Algebraic Explaination is:
Let the two 2 digit numbers be (ax+b) and (ux+v). Note that x = 10. Now consider the product
(ax + b) (ux + v)
= au. x2 + avx + bux + b.v
= au. x2 + (av + bu)x + b.v
The first term i. e. the coefficient of  x2 is got by vertical multiplication of a and u
The middle term i. e. the coefficient of x is obtained by the cross-wise multiplication of a and v and of b and u and the addition of the two products
The independent term is arrived at by vertical multiplication of 'b' and 'v'

More about Singleton Design Pattern

In our previous article about Singleton Design Pattern, we have discussed about basics of its working and design. Today we are adding more points to it.

While implementing singleton, we need to take care that it should work well in multiple thread environment. So one option is to initialize the instance eagerly at the time of declaring the variable. But if we want to initialize the variable lazily, i.e. only when it is required, then we can make the method 'getSharedInstance' synchronized. But that will slow down the operations in every request. But we need synchronization only if instance is null and we need to create it.

So one approach could be to use double 'null' check as given below:

getSharedInstance()
{
// first check to make sure that synchronization comes in effect only if instance is null
 if (instance == null )
 {
  // synchronizing to avoid access my multiple threads
  synchronized (this)
  {
   // check again if instance is not null, as first check of not null may be passed by more than one thread
   if (instance == null)
   {
    instance = new Instance();
   }
  }
 }
 return instance;
}

But in above approach, we are still synchronizing a code block, and checking the instance for 'null' twice. There can be another better approach as given below: 

public class SingletonObject 
{
  public static SingletonObject getSharedInstance ()
 {
   return SingletonHolder.sharedInstance;
 }

 private static class SingletonHolder 
{
 static SingletonObject sharedInstance = new SingletonObject();
}
}

Here no synchronization is required in code. The instance will be initialized lazily only when request will hit getSharedInstance method for the first time, as inner static class will be initialized then.

With these approaches, you need to take care of few points like
  • Cloning should not be supported
  • Constructor of class should be private
  • Serialization should be controlled, i.e. we should override readResolve method to return the shared instance.

But later 'Joshua Bloch' has proposed another approach, termed as best approach for implementing Singleton Patter. This is to use 'enum' for implementation. Example is given below:

// Enum Singleton
public enum SingletonObject
{
  SHAREDINSTANCE;

  public void someMethod()
  {
    .....
  }
}

And it is done. Now you can use it like

SingletonObject.SHAREDINSTANCE.someMethod()

It is perfectly thread safe without any double check for null or synchronization. Check in serialization methods are also not required, because Enum are serialization specially in Java by just writing their names in stream.

With this approach, there is no chance to have more than one instance of object with any of the hook. From Joshua book - 
This approach is functionally equivalent to the public field approach, except that it is more concise, provides the serialization machinery for free, and provides an ironclad guarantee against multiple instantiation, even in the face of sophisticated serialization or reflection attacks. While this approach has yet to be widely adopted, a single-element enum type is the best way to implement a singleton.

Solution for 'NullPointerException' on Eclipse Startup

We faced a scenario where we abruptly had to kill the java while eclipse was running on system. However, when we tried to run the Eclipse again, it just get hanged and console/logs exposed us following error:

[weblogic@localhost oepe-indigo-12.1.1.0.1]$ /home/weblogic/Programs/Oracle/oepe-indigo-12.1.1.0.1/eclipse -vm /usr/java/jdk1.6.0_33/bin
LogFilter.isLoggable threw a non-fatal unchecked exception as follows:
java.lang.NullPointerException
at org.eclipse.core.internal.runtime.Log.isLoggable(Log.java:101)
org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.safeIsLoggable(ExtendedLogReaderServiceFactory.java:59)
org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.logPrivileged(ExtendedLogReaderServiceFactory.java:164)
org.eclipse.equinox.log.internal.ExtendedLogReaderServiceFactory.log(ExtendedLogReaderServiceFactory.java:150)
org.eclipse.equinox.log.internal.ExtendedLogServiceFactory.log(ExtendedLogServiceFactory.java:65)
org.eclipse.equinox.log.internal.ExtendedLogServiceImpl.log(ExtendedLogServiceImpl.java:87)
org.eclipse.equinox.log.internal.LoggerImpl.log(LoggerImpl.java:54)
org.eclipse.core.internal.runtime.Log.log(Log.java:60)
org.tigris.subversion.clientadapter.javahl.Activator.isAvailable(Activator.java:92)
org.tigris.subversion.clientadapter.Activator.getClientAdapter(Activator.java:67)
org.tigris.subversion.subclipse.core.SVNClientManager.getAdapter(SVNClientManager.java:127)
org.tigris.subversion.subclipse.core.SVNClientManager.getSVNClient(SVNClientManager.java:94)
org.tigris.subversion.subclipse.core.SVNProviderPlugin.getSVNClient(SVNProviderPlugin.java:462)
org.tigris.subversion.subclipse.core.status.RecursiveStatusUpdateStrategy.statusesToUpdate(RecursiveStatusUpdateStrategy.java:62)
org.tigris.subversion.subclipse.core.status.StatusCacheManager.refreshStatus(StatusCacheManager.java:270)
org.tigris.subversion.subclipse.core.resourcesListeners.FileModificationManager.refreshStatus(FileModificationManager.java:220)
org.tigris.subversion.subclipse.core.resourcesListeners.FileModificationManager.resourceChanged(FileModificationManager.java:161)
org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45)
org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

And the solution we found was, it happens because some of the metadata file got corrupted during abrupt exit. So we follows the steps mentioned below to get eclipse started again:
  1. cd .metadata/.plugins
  2. mv org.eclipse.core.resources org.eclipse.core.resources.bak
  3. Start eclipse
  4. It will start but will show errors with opened tabs. This is because we have changed the resources folder, which eclipse use for managing the resources
  5. Close all opened tabs
  6. Exit from Eclipse
  7. Delete any newly create org.eclipse.core.resources folder
  8. Rename back the 'org.eclipse.core.resources.bak' to 'org.eclipse.core.resources'
  9. Start Eclipse
  10. It should start fine with all projects
 Hopefully you won't face any problem further, but will depend on scenario. Please share your experience if that was different.

Vedic Math - Squaring numbers near base

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

In the previous article, we have discussed about the method of multiplication by using the base value. In this article, we shall learn the squaring of numbers by using base value. Squaring numbers near base is much easier as there is no possibility of different cases that we discussed earlier for multiplication, like
1. One number is above the base and the other number is below it
2. Numbers near different bases like multiplier is near to different base and multiplicand is near to different base.

So it is comparatively simpler. Here, we can use the sub sutra “whatever the extent of its deficiency, lessen it still further to that extent; and also set up the square of that deficiency”.

In this, first corollary is “All from 9 and the last from 10”. This method will work for any type of squaring. There is another method by taking the sutra "Vertically and Crosswise" but that we will discuss later.

Suppose we have to find the square of 8. The following will be the steps for it:
1. We shall take the nearest power of 10 (10 itself in this case) as our base.
2. 8 is '2' lesser than 10, so we shall decrease 2 from 8 (i.e. 8 - 2 = 6). This will become the left side of answer.
3. And, for right part of answer, we write down the square of that deficiency i.e. 2 x 2 = 4
4. Thus 8 x 8 = 64

In exactly the same manner, we say
72 = (7-3)  |  32
     =  4  |  9
     =  49

92 = (9-1)  |  12
     =  8  |  1
     =  81

62 = (6-4)  |  42
     =  2     |     6                (Here, since right side is 2 digit number, so '1' will be carried to its left)
                   1
     =  3     |   6        
     =  36

How to Manage Inter-Project Dependencies using Jenkins


We have explained about Use of Jenkins and its Configuration in one of the previous blog. Here we shall discuss, how Jenkins can be used to work with inter-dependent projects. Managing the CI environment with multiple inter-dependent projects is quite important, as it is general scenario with projects.

If there are multiple projects having dependencies, then requirements would be:
  1. If Project A is dependent on Project B, then a successful build of Project B should trigger the build for Project A also. In generic words, the build of current project should trigger the build for other dependent projects also. It is required to ensure the integrity of whole project dependency chain after any change.
  2. The dependent projects should be able to pick the latest jars from Projects on which these are dependent. Different mechanism can be used for this. One of these could be to modify the build system of every dependent project to pick the required jars from downstream project
  3. This way, finally whole project chain will be built again on change in any of the project (from down to up)

Now, how we can achieve these requirements in Jenkins. Here we are describing this with an example.
  • Suppose there are three projects, Project 1, Project 2 and Project 3. 
  • Project 1 is dependent on Project 2. Project 2 is dependent on Project 3.
  • Assumption is that build of every project produce the distribute-able jar etc in a specific folder
  • Now update the 'build' for Project 3 in a way, so that before compiling its own code base, it picks the output of Project 2 build from its output folder and synchronize it in its own library folders. Of course, assumptions are to have a fixed project structure (preferably relative directory structure).
  • Similarly update the 'build' for Project 2 in a way, that before compiling its own code base, it picks the output of Project 1 'build' from its output folder and synchronize it in own library folders.
  • Create a Job in Jenkins for Project1, as described with previous article
  • Add post build actions to this job to trigger the build of Project2
  • Create a Job for Project2
  • Add post build actions to this job to trigger the build of Project 3
  • Create job for Project3
  • Using this setup, whenever Project1 will be build, it will trigger the job for Project2
  • Project 2 will pick the depdencies from Project1 output folder and will build its own code base. Build will place the output files in some specific folder.
  • Similarly Project3 build will be triggered and it will pick the dependencies from Project2 output folders

Using this approach, we shall be able to have a perfectly integrated build system and will be able to track if any of the project in whole dependency chain breaks due to any commit. On change in any project, it will trigger the build of all dependent projects. Inter-project dependencies will be synchronized automatically.

How to Set Java Home and Path in Linux

This small article will describe how to set the Java Path in Linux.

  1. Open '/etc/profile' file
  2. Add following line at the end of this file
    1. export JAVA_HOME=/usr/java/jdk1.6.0_33                                              export PATH=$PATH:/usr/java/jdk1.6.0_33/bin
    2. Change the path of JDK as per your installation
  3. This should set the path
  4. If it is not solving your problem, 
  5. Open '/etc/bashrc' file
  6. Add following line at the end of this file
    1. export JAVA_HOME=/usr/java/jdk1.6.0_33
      export PATH=$PATH:/usr/java/jdk1.6.0_33/bin
    2. Change the path of JDK as per your installation
  7. If it still does not resolve the motive,
  8. Open directory '/etc/profile.d'
  9. Create a file 'java.sh' here (if it is not there)
  10. Add following lines to this file
    1. JAVA_HOME=/usr/java/jdk1.6.0_33
      PATH=$JAVA_HOME/bin:$PATH
      export JAVA_HOME
      export PATH
Scripts located in 'profile.d' directory runs in the end and hence override any other settings done. So it should finally help to have the Java Home set in system.

How to Set Hostname for Linux Machine

Here is a small trick for defining a fix 'hostname' for linux machine. Sometimes we face a problem that 'hostname' keeps on changing for Linux machine. At first level, you can check with /etc/hosts, if settings are proper there. The contents should be like:

127.0.0.1               localhost.localdomain localhost
::1                          localhost6.localdomain6 localhost6

But sometimes, even after having these settings fine, we still face above problem.

Next level of quick fix for this problem is given below:

  • Open /etc/rc.local
  • Add following lines  in this file
  • hostname localhost.localdomain (or any other hostname if you want)
  • Save the file
  • Restart the system
This file runs in the last during network configuration (at the time of login) hence any setting which is written here will take effect finally. So whatever in your system would be affecting the hostname, will be overridden here. And you will get the right 'hostname'.

Vedic Math - Base Multiplication Part-2

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

In the previous article, we learnt multiplication by taking base. We discussed following three cases:
A. Numbers are below the base number
B. Numbers are above the base number
C. One number is above the base and the other number is below it

And now, we shall discuss rest of the two cases here:
D. Numbers are not near the base number, but are near a multiple of the base number, like 20, 30, 50 , 250 , 600 etc.
E. Numbers near different bases like multiplier is near to different base and multiplicand is near to different base.

Before going further, let us take few examples of larger numbers with the same method, which we have discussed in previous article.

Example: 6848 x 9997

 6848    -3152
 9997    -0003
----------------
 6845  |  9456     (Refer to previous article for details of approach)
----------------

Example: 87654 x 99995


Let us discuss the fourth case:
D. Numbers are not near the base number, but are near a multiple of the base number, like 20, 30, 50 , 250 , 600 etc.

As you know that this method is applicable in all the cases, but works best when numbers are close to the base. Here, we shall apply the same sutras  “All from 9 and the last from 10” and "Vertically and Crosswise"  discussed earlier and also the sub sutra i.e. "Proportionately".

Take example as 207 x 213 . Here the numbers are not near to any of the bases that we used before: 10, 100, 1000 etc. But these are close to '200'. So, when neither the multiplicand nor the multiplier is near to the convenient power of 10 then we can take a convenient multiple or sub-multiple of a suitable base (as our 'Working Base'). And then perform the necessary operation by multiply or divide the result proportionately. Like in this example, we take 100 as a 'theoretical base' and take multiple of 100 i.e. 200 (100 x 2) as our 'working base'.

207 x 213
  207    +007
  213    +013
  ------------
= 220  |  091
  ------------
= (220 x 200) | 91
= 44000 + 91
44091

As they are close to 200, therefore deviations are 7 and 13 as shown above. From the usual procedure (refer to previous article), we get, 220 | 91. Now since our base is 200, we multiply the left-hand part of the answer by 200 and add it to the right-hand part. That is, (220 x200) + 91 {(Left side x base) + right side}. The final answer is '44091'.

How to Configure and Use Jenkins - A Continuous Integration System

Jenkins (http://jenkins-ci.org/) is a Continuous Integration system, facilitates continuous build and test setup for projects. It is an open source tool is similar to 'CruiseControl'. Jenkins is quite stable tool and is used by many Organizations. In this article, we shall discuss about Jenkins, its usage, and configuration.

When we call it 'Continuous Integration System', what is this?

When we work in a team environment using some Source Control / versioning tool, we checkout the work code from repository and starts working on it. After this, every developer used to commit her code to repository whenever she is finished with her work. When application is highly integrated, every commit may change the application integration scenarios, break the integration and probably can induce bugs also, or can break the code compilation etc. Now we need some tool to ensure that we check this inter-dependencies of integration and the stability of latest committed code, as soon as any body commits the code. So we need some tool, which can perform following kind of tasks:
  1. As soon as, any code is committed to source code repository (or at any given schedule), tool takes the update from repository for the project and run its build
  2. Frequency to check any new commit in source code repository should be configurable
  3. Build system is designed by team and can be based on any building mechanism like ant or maven. Tool should recognize and support the famous build tools like ant or maven etc
  4. Tool builds the project and hence all tasks configured with build system will be performed
  5. If build fails, tool should capture the 'build logs'/'console output' and should be able to send email with all logs to more than one configured email id
  6. It should have some User Interface where user can be able to see the status of various projects, their last build time, failure, logs etc
  7. If build passes, it means everything is good with new commit
  8. Then tool should be able to check if any other project or module is dependent on current project. If yes, it should trigger the build for that project also
  9. Again controls goes to step 5 for new dependent project
  10. .....
For more information about 'Continuous Integration', please refer to
  • http://en.wikipedia.org/wiki/Continuous_integration
  • http://martinfowler.com/articles/continuousIntegration.html

Jenkins support all of above features and even more with different extensions.

Earlier 'Jenkins' was known as 'Hudson'. It was started by its founder (as Hudson) developer while working with Sun Microsystem. Later, it was separated out under a separate name as 'Jenkins' due to some IP (or similar) rights conflicts. Hudson is moved to Eclipse Foundation now. You can find it at http://hudson-ci.org/

After knowing this, one question come to mind is, which tool we should use? Well, this is something everyone need to find herself. However, we have decided to go for 'Jenkins' because it is where most of the original developers and community is working. It is having quite active development releases and is going well as of now. You can find more discussions at http://stackoverflow.com/questions/4973981/how-to-choose-between-hudson-and-jenkins

How to Install Redmine 2 - A Project Management Tool

This article will describes the steps to install Redmine Version 2. Please read it in conjunction with our article about installation of previous version of Redmine at http://www.vedantatree.com/2010/12/how-to-install-redmine-project.html

Please follow these steps: 
  1. Install MySQL
  2. Download RubyInstaller and Install Ruby ( http://rubyinstaller.org/downloads/ )
  3. Download RubyGem and extract the package ( http://rubyonrails.org/download )
  4. Run 'ruby setup.rb' in RubyGem root folder
  5. Run 'gem install rails'
  6. Download MySQL dll from - http://instantrails.rubyforge.org/svn/trunk/InstantRails-win/InstantRails/mysql/bin/
  7. Save this file in <ruby-installation-folder>/bin
  8. Run 'gem install mysql'
    1. It may give you an message telling from where you can get the compatible libmysql.dll. If you get this, download it from there and put in  <ruby-installation-folder>/bin
  9. Download DevKit-tdm-32-4.5.2-20111229-1559-sfx.exe (http://rubyinstaller.org/downloads/ )
  10. Extra it in <ruby-installation-folder>/DevKit
  11. Run following commands in DevKit folder
    1. ruby dk.rb init
    2. ruby dk.rb review
    3. ruby dk.rb install
  12. Run 'bundle install --without development test rmagick postgresql sqlite'
  13. Go to MySQL prompt and run following queries
    1. create database redmine character set utf8;
    2. create user 'redmine'@'localhost' identified by 'my_password';
    3. grant all privileges on redmine.* to 'redmine'@'localhost';
  14. Go to config folder of Redmine and update database.yml file for MySQL password
  15. Run following commands to configure the database
    1. set RAILS_ENV=production
    2. rake db:migrate
    3. rake redmine:load_default_data
  16. Now Redmine is installed. You can run the server as
    1. ruby script/rails server webrick -e production
  17. Once server is started, you can access redmine at http://localhost:3000. Default admin user name and password is: 
    1. User Name - admin
    2. Password - admin
Redmine should be working fine by now. Sometime there might be problems with various gem installations. We have covered many of these cases, like:
  • 'json' native gems requires installed build tools
  • Problem in installing rmagick
  • Problem in installing mysql gem or problem while loading data
    • activerecord-mysql-adapter not found
  • If you don't have right libmysql.dll, it may result in many errors while migrating database like
    • mysql not connected
    • Incorrect buffer type used
    • Or process gets hanged
    • and so on

For more information, please refer to http://www.redmine.org/projects/redmine/wiki/RedmineInstall .

If you like the article, you may contribute by:
  • Posting your comments which will add value to the article contents
  • Posting the article link on Social Media using the Social Media Bookmark bar
  • Connecting with 'VedantaTree' on Facebook (https://www.facebook.com/VedantaTree)

Vedic Math - Base Multiplication

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

Today, we are going to learn the GENERAL formula of multiplication. This is simple and easy technique and good part is that it is applied to almost all the cases. This method works better when numbers are near their base value. After going through the below discussed method, you will see that multiplication tables are not required for calculation above 5 x 5. You will be able to do all types of multiplication involving bigger multiplicands and multipliers quickly and easily; like for '789789 × 999997'. All the sutras (formulae) of Vedic Math are short and simple; and with the practice of the techniques, most of the calculations become a playful experience for you.

Following is the sutra that we will follow today:

The formulae (sutras) are : “All from 9 and the last from 10” and "Vertically and Crosswise"
The algebraical expression is :(x+a) (x+b) = x (x+a+b) + ab.

From the title of the article, you can understand that today we shall do the multiplication by taking the base of numbers. So, first we need to be familiar what is 'base'. The term ‘base’ in Vedic Math has a broader meaning than you may be used to. We work in a base 10 number system, but within Vedic Math the ‘base’ is the number you will use as a basis for calculation. The numbers taken can be either less or more than the base considered. The difference between the number and the base is termed as deviation. Deviation may be positive or negative.

Now observe the following table.

Number      Base         Number – Base       Deviation
   13             10                  13 - 10                      3

    7              10                     7 - 10                    -3

   89             100                  89 - 100                -11

 1110           1000             1110 - 1000              110

99998          100000       99998 - 100000            -2

So, the deviation obtained are from "All from 9 and the last from 10" sutra (formula).

Following are the cases which we shall discuss here:
A. Numbers are below the base number
B. Numbers are above the base number
C. One number is above the base and the other number is below it
D. Numbers are not near the base number, but are near a multiple of the base number, like 20, 30, 50 , 250 , 600 etc
E. Numbers near different bases like multiplier is near to different base and multiplicand is near to different base

Let us discuss these cases one by one.

A. Numbers are below the base number

Working with Base 10
Let us take an easy and simple example to start this technique. Suppose we have to multiply 6 by 8.
Now the base is 10. Since it is near to both the numbers.
Place the two numbers 6 and 8 above and below on the lefthand side (as shown below). Subtract the base value (i.e. 10 in this case) from both of the numbers and write down the remainders (i.e. 4 and 2) on the right-hand side with their deviation sign (-).

6 x 8   

Redmine Java Connector 1.0.0 Released

We are happy to announce the second release of Redmine Java Connector (RedmineJConnector) at http://code.google.com/p/redmine-jconnector/. It is a Java based client side API for Redmine.

The product was born out of necessity. We were desperate for a Java based Redmine Client library which can help us to interact with Redmine from our projects. However we were not able to find any library matching to such requirements at that time. So this product is the result of this requirement, and now we are using it with our projects also.

RedmineJConnector is capable to interact with Redmine Server (http://redmine.org/) using its Rest API. Redmine provides API for various CRUD operations on its main data objects like Projects, Issues, Users etc. RedmineJConnector helps to perform these CRUD operations using exposed Rest API without going into intricacies of Rest Service interaction.

Features released with 1.0.0 version are: 
  1. Get all Projects and Issues
    1. It is supported with Data Paginator feature. It is an 'iterator' based implementation. 
    2. This feature will facilitate the user to fetch all data objects from Redmine in specific size pages. 
    3. It should help in memory and performance management, which may get critical in case if we fetch all objects in one go. 
  2. Improved Exception Handling
  3. Improved Java Doc
  4. Improved build with inclusion of Java Doc generation and JUnit Test cases
  5. JUnit test cases for all new implementation

Improve Productivity with these Desktop and Mobile Tools


Productivity, improvement in efficiency is quite a hot mantra nowadays to be successful and to achieve the growing number of goals. With the fast moving life, demanding expectations, people are in continuous pressure to improve what they are doing now, to manage multiple tasks simultaneously, and to remember many things which they need to complete in a day or probably in few days. Won't you feel, sometime our mind gets exhausted with this sea of information and tasks. However, to meet the expectations, we have to manage it. Managing information, planning ahead, scheduling, remembering the schedule and then execute it, is the key to success. But one point is certainly clear that we need some help to manage this bulk information and tasks etc. So how should we do that? Are we talking about having a personal secretary.. sort of :). But everyone can not afford to hire a personnel for this management. So.....

Alternative good solution, in this high tech world, is to use available productivity and hobbies related tools on mobile phone and desktop computers. There are many good tools available on phones and in browsers which can actually help us to manage our day, to manage our task list, schedules, alarms, goals and can keep us updated for all information which we want. Now the need is to identify these and utilize these properly. We have explored and used few tools as need arises, which we are sharing here if these can help. These are very simple tools and many people must be using these. These can give a good start to the beginners.

Let us start from desktop. On desktop if you are using or can use Chrome Browser, following tools can definitely help you. These are:

Google Calendar: It helps you to schedule your events. Events can be one time, or recurring. It has good facility to schedule as per requirements. Moreover, there are various ways to remind you for these events like

  1. It can send you email before any pre-defined interval. It can actually send multiple mails at multiple time gaps.
  2. It can send you the daily agenda as per your calendar event schedule
  3. It can send you SMS on your register phone number
  4. It can show you alert on your computer screen, if Google calendar is opened in browser

Isn't that great to have reminders for all of your events beforehand, and moreover, you can define the reminder's frequency and style. That is actually like having a personal assistant, who reminds you for every event you want to be reminded for. You can access it anywhere anytime, even on your mobile wherever you are.

Vedic Math - Mathematical magic trick

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

Let us take a break from calculations and enjoy a small magical mathematics trick.

1. Think a number (any number). To keep it easy, think any number having 1 or 2 digit.
2. Now double this number i.e. multiple by 2.
3. Add 12 to the result
4. Divide the total by 2.
5. Subtract the original number from above result.
6. And you will always get '6' as final result.

Try this one with different numbers, and you will see that the sequence always produces the '6' as result ,no matter which number was originally selected.

For example, if the original number is 15.
1. 2 x 15 = 30
2. 30 + 12 = 42
3. 42 / 2 = 21
4. 21 - 15 = 6

You must be curious that how this magic trick is working. Following is the concept for this magic trick:

Let us take a number be x and the steps performed by us are:
1. 2x
2. 2x + 12
3.(2x + 12) / 2 = x + 6
4. x + 6 - x = 6

So, in last step, we see that whatever number we choose (as x) will finally result in '6' with above calculation. After knowing the formula, now you can change the answer by changing the formula. For example, if you want to change the answer to '4', then you add twice of that '4' i.e. '8' in the second step.

Enjoy this trick!!

Vedic Math - Multiplication of numbers whose last digits add to 10 and first digits are same and vice-versa.

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

We had discussed this method in our previous articles for 2-digit numbers and today we shall explain the same method for 3-digit numbers.

A. Numbers whose last digits add to 10 and the remaining first digits are the same
Case 1: When sum of last two digits number is 100 
Example: 392 x 308
Here we can see that right digits sum is 100 i.e.(92 + 8) and left side digits are same. Here we can now apply the same method, which we discussed earlier for 2-digit number. But this time we must expect to have four figures on the right-hand side.

  • First, multiply the right side numbers(92 x 08) and the result is 0736.
  • Second, multiply 3 by the number that follows it, i.e.4, so the result of (3 x 4) is 12.
  • And now the final output is 120736.

Example: 795 x 705
Here 95 + 05 = 100 and left side digits are same i.e. '7'. Hence it qualifies for this case.
In calculation, we shall multiple the last two digits and the left digit i.e. '7; with its next number '8'. So the calculation is:
795 x 705 = 7 x 8 | 95 x 05
                 = 56 | 0475
                 = 560475

Example: 866 X 834
Here 66 + 34 = 100 and left side digit is 8 and its next number is 9. So the calculation is:
848 x 852 = 8 x 9 | 66 x 34            (Note: For 66 x 34, we shall discuss in our upcoming articles)
                 = 72 | 2244
                 = 722244
         
         
Case 2: When sum of whose last digits is 10  and the remaining first digits are the same   
Example: 241 x 249
Here we can see that right digits sum is 10 i.e.(9 + 1) and left side digits are same i.e. 24. So we can now apply the same method as described above.
241 x 249 = 24 x 25 | 1 x 9
                 = 0600 | 09
                 = 60009

Vedic Math - Multiplication of numbers with a series of 1's

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

In the previous article, we learnt the technique of "how to multiply numbers with a series of 9’s". In this article, we shall learn the technique of "how to multiply numbers with a series of 1’s". So, we shall multiply the numbers with 1, 11, 111,..... etc.

I. Let us start with the vedic multiplication by 11

In this technique, we use "vertically and crosswise" vedic sutra. Take example of ab x uv, and apply the sutra as follows:

       a         b
       u         v
   ---------------------
   a x u | av + ub | b x v
   ---------------------

(Here '|'  is used just as separator)

Here we are splitting the answer in three parts as following:
  • vertically                         =(b x v)
  • crosswise multiplication and add   =(a x v) + (b x u)
  • vertically                         =(a x u)
During multplication with 11, u=1 and v=1, means:

           a               b
           1               1
         --------------------
           a  |  a + b  |  b
         --------------------


Example:  Multiply 53 by 11

Vedic Math - Multiplication of numbers with a series of 9’s

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

Another special case of multiplication is, multiplication with numbers like 9, or 99, or 999, or 9999.....so on. It feels like if multiplier is a big number, the calculation will be tough. But, with the help of vedic math formulae, the multiplication is much easier for all '9' digits multiplier. By using the method given below, we can multiply any number with 99,999,9999, etc. very quickly.

Please note that the methods or the vedic formulae, that we use in this calculation, are "By one less than the one before"  and "All from 9 and the last from 10".

There are three cases for the multiplication of numbers with a series of 9's.
  • Case 1: Multiplying a number with a multiplier having equal number of 9’s digits                                              (like 587 x 999)
  • Case 2: Multiplying a number with a multiplier having more number of 9’s digits                                             (like 4678 x 999999)
  • Case 3: Multiplying a number with a multiplier having lesser number of 9’s digits                                             (like 1628 x 99)

The method to solve 'Case 1' and 'Case 2' is the same, but for 'Case 3', the method is different. Let us start with 'Case 1'.

Case 1: Multiplying a number with a multiplier having equal number of 9’s digits

Multiply 587 by 999

           587
       x  999
       ------------
        586 413
       
Solution is,
  •  Let us first do the calculation by conventional method to understand the solution. Result will be 586413.
  • Split the answer in two parts i.e. '586' and '413'.
  • Let's see the first part of the result, i.e. 586. It is reduced by 1 from the number being multiplied i.e. 587 - 1 = 586. {Vedic sutra "By one less than the one before"}
  • Now see the last part, i.e. 413. Subtract the multiplicand i.e. 587 from 1000 (multiplier + 1). Vedic Sutra applied here is "All from 9 and the last from 10", and hence we substract 587 from 1000. So the outcome will be (9 -5 = 4, 9 - 8 = 1, 10 - 7 = 3) , and result is 413. Refer to image below for more clarity:

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.