Creating SVN Repository In UBUNTU (Linux) System

1) Up-to-Date Installed Packages
sudo apt-get update
2) Downloading the Subversion, Subversion Tools and Libapache2 packages
you need to run svn subversion and it's tools by using commands
sudo apt-get install subversion subversion-tools libapache2-svn
3) Creating Subversion (SVN) Directory
creating svn directory, where you want to configure svn.
sudo mkdir /home/svn

Maths Server Using Socket Programming

It is time to implement a more comprehensive network application by using the socket programming APIs you have learned so far. A sample math client-server interaction demonstrating online math server that can perform basic math operations,

package com.techa2zsolution.intf.math;

public interface MathService {
    public double add(double firstValue, double secondValue);
    public double sub(double firstValue, double secondValue);
    public double div(double firstValue, double secondValue);
    public double mul(double firstValue, double secondValue);
}

Get the database size, Free space and last update

To get the current database size just by querying into your query browser or CLI from the INFORMATION_SCHEMA database in table TABLES.


SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB"
FROM information_schema.TABLES
GROUP BY table_schema ;

Get the database free space

SELECT table_schema "Data Base Name",
sum( data_length + index_length ) / 1024 / 1024 "Data Base Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES
GROUP BY table_schema;

Get the database last update ordered by update time then by create time.

SELECT MAX(UPDATE_TIME), MAX(CREATE_TIME), TABLE_SCHEMA
FROM `TABLES`
GROUP BY TABLE_SCHEMA
ORDER BY 1, 2;

JFree Chart Via Java Programming

PIE Chart Using JFree Chart :
 
First required database connection, as per connection provide sql query to retrieve data from database. 
JDBCPieDataset dataset = new JDBCPieDataset(connection);
        try {
            dataset.executeQuery("SQL QUERY");
                    JFreeChart chart = ChartFactory.createPieChart
                    ("Performance - Report", dataset, true, true, false);
                    chart.setBorderPaint(Color.white);
                    chart.setBorderStroke(new BasicStroke(10.0f));
                    chart.setBorderVisible(true);
                    if (chart != null) {
                        int width = 500;
                        int height = 350;
                        final ChartRenderingInfo info = new ChartRenderingInfo (new StandardEntityCollection());
                        response.setContentType("image/png");
                        OutputStream out=response.getOutputStream();
                        ChartUtilities.writeChartAsJPEG(out, chart, width, height,info);
                    }
        }catch (SQLException e) {
            e.printStackTrace();
        }

Line Chart Using Jquery

<!DOCTYPE HTML>
<html>

<head>
<link href="/assets/css/jquery-ui.1.11.2.min.css" rel="stylesheet" />
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/jquery.canvasjs.min.js"></script>
<script type="text/javascript">

Excel File Data Reading Using Spring MVC

 Uploading EXCEL - 2003, 2007 file's using file uploading UI, and insert all file data into database.

                            <form:form modelAttribute="bulkfileupload" role="form" enctype="multipart/form-data" >
                                            <div class="form-group">
                                                <label>Upload Excel File !</label>
                                                <form:input type="file" path="uploadFile" id="uploadFile"  />
                                                <div class="has-error">
                                                    <form:errors path="uploadFile" class="help-inline" />
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <input type="submit" value="upload">
                                            </div>
                                        </form:form>

For handling request of multipart/form-data, required MultipartResolver interface to handle file request. for that configure bean tage in xml file or

Path Variables In Spring Framework

Spring Framework offers to handle URI method parameters by using @PathVariable annotation

@Controller
@RequestMapping("admin")
public class PathVarController {

@RequestMapping("/welcome/{springPathVariable}/{page}")
public ModelAndView pathVariableTest(@PathVariable("page") String name, @PathVariable("springPathVariable") String pathVariable ) {

ModelAndView mav = new ModelAndView("pathVariable");
mav.addObject("message", " "+ name+" Your PathVariable is : "+pathVariable);
return mav;
}
}

Shell Script Tips

Shell Script, delete last 30 day's records from system.

#!/bin/bash
# Delete log files older than 30 days in this script.

find /var/log/tomcat7/localServer/logs/ -mtime +30 -type f -delete
echo "-----------------------------------------------------"
echo "$(date)"
echo "Deleted files older than 30 days in this location :: /var/log/tomcat7/ "


Custom Tag In Java

Custom Tag Library use to make own tag in jsp by extending TagSupport class, build xml with (.tld) extension file, which specify the result would you want to use.
Java Server Page (JSP) contain standard tag library @taglib for including (.tld) file.

public class CustomTagTest extends TagSupport {

public CustomTagTest() { }

@Override
public int doStartTag() throws JspException {
JspWriter out = pageContext.getOut();//returns the instance of JspWriter
   try{

Design Pattern Tutorial


Design Pattern are best practices how to solve common know problems. This article will give an overview of best practices in object-oriented programming and has pointers to some design-pattern tutorials.
Design patterns are proven solutions approaches to specific problems. A design pattern is not a framework and is not directly deployed via code.

Design Pattern have two main usages:

Api Integration

This tutorial will focus on the basic principles and mechanics of testing a REST API with live Integration Tests with a JSON Results.
For an internal application, this kind of testing will usually run as a late step in a continuous Integration process, consuming the REST API after it has already been deployed.
When testing a REST resources, there are usually a few orthogonal responsibilities the tests should focus on:


SDLC Process

Software Development Life Cycle, or Software Development Process, defines the steps/ stages/ phases in the building of software.


software development life cycle
Software Development Life Cycle 

SDLC IN SUMMARY

  • Project Planning
  • Requirements Development
  • Estimation
  • Scheduling
  • Design
  • Coding
  • Test Build/Deployment
  • Unit Testing
  • Integration Testing
  • User Documentation
  • System Testing
  • Acceptance Testing
  • Production Build/Deployment
  • Release
  • Maintenance

SDLC stands for software development life cycle. A software development life cycle is essentially a series of steps, or phases, that provide a model for the development and life cycle management of an application or piece of software. 

Socket Programming interview Question.

Q:) Name the seven layers of the OSI Model and describe them briefly?
Answer:-
Physical Layer - covers the physical interface between devices and the rules by which bits are passed from one to another.
Data Link Layer - attempts o make the physical link reliable and provides the means to activate, maintain, and deactivate the link.
Network Layer - provides for the transfer of information between end systems across
some sort communications network.

Socket Programming Using Multi-Threading in Java.

public class Server {
    public static void main(String arg[]) throws IOException {
        final int port = 4440;
        System.out.println("Server waiting for connection on port "+port);
        ServerSocket ss = new ServerSocket(port);
        Socket clientSocket = ss.accept();
        System.out.println("Recieved connection from "+clientSocket.getInetAddress()+" on port "+clientSocket.getPort());
        //create two threads to send and recieve from client
        RecieveFromClientThread recieve = new RecieveFromClientThread(clientSocket);
        Thread thread = new Thread(recieve);
        thread.start();