ENGLISH etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster
ENGLISH etiketine sahip kayıtlar gösteriliyor. Tüm kayıtları göster

8 Nisan 2020 Çarşamba

Biri Hariç Tüm Sayıların İkişer Adet Bulunduğu Dizideki Yanlız Sayıyı Bulma


Given a non-empty array of integers, every element appears twice except for one. Find that single one.

>> Solution 1: Using list - O(n^2) time, O(n) space


    /**
     * Given a non-empty array of integers, every element appears twice except for one. Find that single one.
     *
     * Performance: O(n^2) time, O(n) space
     *
     */
    public int singleNumber(int[] nums) {
       
        // O(n) space
        List<Integer> allElements = new ArrayList<>();
       
        // O(n^2) time
        for(int n : nums){
           
            Integer nWrapped = Integer.valueOf(n);
            if(allElements.contains(nWrapped)){
                allElements.remove(nWrapped);
            } else {
                allElements.add(nWrapped);
            }
           
        }
       
        return allElements.get(0);
    }


 Solution 2: Using hash map, O(n) time, O(n) space


    /**
     * Given a non-empty array of integers, every element appears twice except for one. Find that single one.
     *
     * Performance: O(n) time, O(n) space
     *
     */
    public int singleNumber(int[] nums) {
       
        Map<Integer, Integer> elementCounts = new HashMap<>();
       
        // O(n) time, O(n) space
        for(int n : nums){
            Integer wrappedVal = Integer.valueOf(n);
            int currentCount = elementCounts.getOrDefault(wrappedVal,0)+1;
            elementCounts.put( wrappedVal , currentCount );
        }
       
        // O(n) time, O(1) space
        for(int n : nums) {
            Integer wrappedVal = Integer.valueOf(n);
            if(elementCounts.get(wrappedVal) == 1) {
                return n;
            }
        }
       
        throw new UnsupportedOperationException("Not a correct input set");
    }




 Solution 3a: Using math, O(n) time, O(n) space


    /**
     * Given a non-empty array of integers, every element appears twice except for one. Find that single one.
     *
     * Performance: O(n) time, O(n) space
     *
     *  sumOfSet = a+b+c
     *  sumOfNums = c + 2*(a+b+c)
     *  sumOfNums = c + 2*sumOfSet - c
     *  c = 2*sumOfSet - c
    */
    public int singleNumber(int[] nums) {

        // O(n) time, O(1) space
        int sumOfNums = IntStream
            .of(nums)
            .sum();
       
        // O(n) time, O(n) space
        int sumOfSet = IntStream.of(nums)
            .boxed()
            .collect(Collectors.toSet())
            .stream()
            .mapToInt(Integer::intValue)
            .sum();
       
        return 2*sumOfSet - sumOfNums;
    }




  Solution 3b: Using math, O(n) time, O(n) space - but better runtime


    /**
     * Given a non-empty array of integers, every element appears twice except for one. Find that single one.
     *
     * Performance: O(n) time, O(n) space
     *
     *  sumOfSet = a+b+c
     *  sumOfNums = c + 2*(a+b+c)
     *  sumOfNums = c + 2*sumOfSet - c
     *  c = 2*sumOfSet - c
    */
    public int singleNumber(int[] nums) {

        int sumOfNums = 0;
        int sumOfSet = 0;
        Set<Integer> elements = new HashSet<>(); // O(1) space
      
        // O(n) time
        for(int n : nums) {
            Integer intWrapped = Integer.valueOf(n);
            if(!elements.contains(intWrapped)) {
                elements.add(intWrapped);
                sumOfSet += n;
            }
            sumOfNums += n;
        }
      
        return 2*sumOfSet - sumOfNums;
    }


 

 Solution 4 : Bit operations, O(n) time, O(1) space

   /**
    * Given a non-empty array of integers, every element appears twice except for one. Find that single one.
    *
    * Performance: O(n) time, O(1) space
    *
    *  a XOR 0 = n
    *  a XOR a = 0
    *  a XOR b XOR a = a
    */
    public int singleNumber(int[] nums) {

        // O(1) space
        int result = 0;
      
        // O(n) time
        for(int n : nums) {
            result = result ^ n;
        }
      
        return result;
    }






2 Nisan 2011 Cumartesi

Apache SOLR

Popular, blazing fast open source enterprise search platform from the Apache Lucene project is a very powerful tool,especially for full text searching.



Recently Lucene and SOLR development is merged . Following this announcement, SOLR 3.1 is released and SOLR version number is synced with Lucene. Here is a small tutorial video about SOLR:


You can also check the latest reference guide from here.

You might want to watch the  interview with Grant Ingersoll, a Apache Lucene and Solr committer and co-founder of Lucid Imagination about the merging of Lucene and SOLR.

LINKS
Lucene and SOLR Merge
SOLR 3.1 is released
SolrCloud is on the way
Solr Reference Guide

30 Mart 2010 Salı

Why You Can’t Work at Work


Big Think Interview with Jason fried - Why you can't work at work?



"
The modern workplace is structured completely wrong. It’s really optimized for interruptions.

Everyone’s calling meetings all the time, everyone’s screaming people’s names across the thing, there’s phones ringing all the time. People are walking around. It’s all about interruptions.

I’m working 50-60 hours this week. It’s not that there’s 50 or 60 hours worth of work to do, it’s because you don’t work at work anymore. You go to work to get interrupted.

Like before you know it, it’s 4:00 and you’ve got nothing done today.

If someone’s calling my name, or tapping on my shoulder, or knocking on my door, I can’t ignore those things.

Managers are the biggest problem because their whole world is built around interruption. That’s what they do. Management means interrupting. Hey, what’s going on? How’s this going? Let me call a meeting because that’s what I do all day, I call meetings. And so, managers are the real problems here and that’s got to change too.  


Some more useful advices from Uncle Jason:

Real World ?
Whatever you’re doing, cut it in half





12 Ocak 2010 Salı

En iyi 20 Programcı Mazareti



The Top 20 replies by programmers when their programs do not work:
  1. That’s weird…
  2. It’s never done that before.
  3. It worked yesterday.
  4. How is that possible?
  5. It must be a hardware problem.
  6. What did you type in wrong to get it to crash?
  7. There is something funky in your data.
  8. I haven’t touched that module in weeks!
  9. You must have the wrong version.
  10. It’s just some unlucky coincidence.
  11. I can’t test everything!
  12. THIS can’t be the source of THAT.
  13. It works, but it hasn’t been tested.
  14. Somebody must have changed my code.
  15. Did you check for a virus on your system?
  16. Even though it doesn’t work, how does it feel?
  17. You can’t use that version on your system.
  18. Why do you want to do it that way?
  19. Where were you when the program blew up?
  20. It works on my machine.”


Kaynak: http://www.thatwasfunny.com/top-20-programmers-excuses

24 Temmuz 2009 Cuma

Call Stored Procedure In Oracle And Pass In Out Parameters

import java.sql.CallableStatement;
import java.sql.Connection;
import java.sql.DriverManager;

public class Main {
public static void main(String[] args) throws Exception {
Connection conn = getOracleConnection();
// Step-2: identify the stored procedure
String proc3StoredProcedure = "{ call proc3(?, ?, ?) }";
// Step-3: prepare the callable statement
CallableStatement cs = conn.prepareCall(proc3StoredProcedure);
// Step-4: set input parameters ...
// first input argument
cs.setString(1, "abcd");
// third input argument
cs.setInt(3, 10);
// Step-5: register output parameters ...
cs.registerOutParameter(2, java.sql.Types.VARCHAR);
cs.registerOutParameter(3, java.sql.Types.INTEGER);
// Step-6: execute the stored procedures: proc3
cs.execute();
// Step-7: extract the output parameters
// get parameter 2 as output
String param2 = cs.getString(2);
// get parameter 3 as output
int param3 = cs.getInt(3);
System.out.println("param2=" + param2);
System.out.println("param3=" + param3);
conn.close();
}

private static Connection getHSQLConnection() throws Exception {
Class.forName("org.hsqldb.jdbcDriver");
System.out.println("Driver Loaded.");
String url = "jdbc:hsqldb:data/tutorial";
return DriverManager.getConnection(url, "sa", "");
}

public static Connection getMySqlConnection() throws Exception {
String driver = "org.gjt.mm.mysql.Driver";
String url = "jdbc:mysql://localhost/demo2s";
String username = "oost";
String password = "oost";

Class.forName(driver);
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}

public static Connection getOracleConnection() throws Exception {
String driver = "oracle.jdbc.driver.OracleDriver";
String url = "jdbc:oracle:thin:@localhost:1521:caspian";
String username = "mp";
String password = "mp2";

Class.forName(driver); // load Oracle driver
Connection conn = DriverManager.getConnection(url, username, password);
return conn;
}
}

19 Kasım 2007 Pazartesi

Page Expire Problem When Browser's Back Button is Clicked

PROBLEM:

As a result of a search form submission, results are displayed as links. The user clicks any links and goes to that page. When back button is pressed, browser gives an error.


In detail,

1. User submits an HTML form that does a search.
2. User sees a list of search results, each hyperlinked to a details screen.
3. User clicks one of the "details" hyperlinks.
4. User sees the details screen.
5. User clicks browser's "Back" button to return to the screen in Step 2.
6. Browser gives confusing message about having to resubmit POST data. In Firefox this is a dialog box with OK/Cancel, and IE this is a white screen with the message:

"Warning: Page has Expired The page you requested was created using information you submitted in a form. This page is no longer available. As a security precaution, Internet Explorer does not automatically resubmit your information for you. To resubmit your information and view this Web page, click the Refresh button."

SOLUTION:

Handle the form inside javascript, and submit search using request parameters.

Not a Form, a text input field and a link:

SEARCH LINK
Javascript Code:function ProcessSearchSubmit() {
linkToRedirect="/search.ovt?results=allResults&searchInput=";
if ( document.getElementById('searchInputId') ) {
linkToRedirect += document.getElementById('searchInputId').value;
}
setTimeout( "window.location.href = linkToRedirect", 0 );
}

Window.location.href not working in IE for every page

There is a problem about javascript redirect in Internet Explorer. I couldn't redirect to another page in IE using

window.location.href = url;

This command gets executed (proofed with alert messages) but nothing happens. Firefox acts like expected but i couldn't get it work in IE.

I have finally found the solution after some google search.

RedirectUrl = url;
setTimeout( "window.location.href = RedirectUrl", 0 );

Another solution says that if you set this from the window.location.href in a Javascript function, is enough to return false. Check this out: IE bug.

27 Mayıs 2007 Pazar

Execute Queries on a Database

A class that makes connection to database and run queries.
----------------------------------------------

/*
* FlightDB.java
*
* Created on 24 Dec 2006 Sunday, 06:00
*
*/

package com.myairline.db;

import java.sql.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.Date;
import java.sql.PreparedStatement;

import com.myairline.type.Flight;
import com.myairline.type.Route;
import com.myairline.type.Plane;
import com.myairline.type.Airport;
import com.myairline.common.MyConstants;

/**
*
* @author ozkansari
*/
public class FlightDB {

Connection connection;

/** Creates a new instance of UserDB */
public FlightDB() {
DatabaseConn dbConn = new DatabaseConn();
connection = dbConn.getConnection();
}

public ArrayList searchFlight() {
return null;
}

public boolean insertNewFlight() {
return false;
}

public boolean deleteFlight() {
return false;
}

public void scheduleFlight() {
}

/**
*
*
* @param fromAirportId
* @param toAirportId
* @param flightDate
* @param returnDate
* @param passengerCount
*/
public ArrayList getFlightList( int fromAirportId, int toAirportId, Date flightDate, int passengerCount ) {

ArrayList flightList = new ArrayList();

try {
Statement statement = connection.createStatement();
String q = "SELECT * FROM `flight` f , `route` r, `plane` p WHERE " +
"f.idRoute = r.idRoute AND " +
"f.idPlane = p.idPlane AND " +
"f.passenger_count + " + passengerCount + "<= p.capacity " + " AND " +
"r.start_airport =" + fromAirportId + " AND " +
"r.end_airport =" + toAirportId + " AND " +
"flightDate LIKE \"" + flightDate +"%\"" ;

ResultSet rs = statement.executeQuery(q);

AirportDB airportcheck = new AirportDB();
Airport fromAirport = airportcheck.getAirport(fromAirportId );
Airport toAirport = airportcheck.getAirport(toAirportId );

while (rs.next()) {

Flight flight = new Flight();
Route route = new Route();
Plane plane = new Plane();

flight.setFlightNo(rs.getInt("f.flight_no"));
flight.setIdPlane(rs.getInt("f.idPlane")) ;
flight.setIdRoute(rs.getInt("f.idRoute")) ;
flight.setFlightDate(rs.getDate("f.flightDate"));
flight.setPassengerCount(rs.getInt("f.passenger_count")) ;
flight.setTicketFare(rs.getInt("f.ticket_fare")) ;
flight.setFlightStatus(rs.getString("f.status")) ;

route.setIdRoute(rs.getInt("r.IdRoute"));
route.setStartAirportId(rs.getInt("r.start_airport"));
route.setEndAirportId(rs.getInt("r.end_airport"));
route.setMiles(rs.getInt("r.miles"));
route.setStartAirport( fromAirport );
route.setEndAirport( toAirport );

plane.setIdPlane(rs.getInt("p.IdPlane"));
plane.setPlaneType(rs.getString("p.planeType"));
plane.setCapacity(rs.getShort("p.capacity"));

flight.setFlightPlane( plane ) ;
flight.setFlightRoute( route ) ;

flightList.add(flight);
}

} catch (SQLException e) {
e.printStackTrace();
}

return flightList;
}

}


A Simple Servlet Example 2

A simple java servlet which gets requests from a web page as parameter, process the request, set response attributes and forwards to destination page
----------------------------------------------




/*
* SearchServlet.java
*
* Created on 23 Dec 2006 Saturday, 17:45
*/

package com.myairline.servlets;

import java.io.*;
import java.net.*;
import java.sql.*;
import java.util.ArrayList;
import java.util.Iterator;

import javax.servlet.*;
import javax.servlet.http.*;

import com.myairline.db.DatabaseConn;
import com.myairline.db.AirportDB;
import com.myairline.db.FlightDB;
import com.myairline.db.PassengerDB;
import com.myairline.db.TicketDB;

import com.myairline.type.Airport;
import com.myairline.type.Flight;
import com.myairline.type.Ticket;
import com.myairline.type.Passenger;
import com.myairline.type.CreditCard;

import com.myairline.common.MyConstants;


/**
*
* @author ozkansari
* @version
*/
public class SearchServlet extends HttpServlet {

AirportDB airportCheck;
ArrayList airportList;

FlightDB flightCheck;
ArrayList flightList1, flightList2;
PassengerDB passengerCheck;
TicketDB ticketCheck;

Flight currentFlight, currentFlight2 ;


/** Processes requests for both HTTP <code>GET</code> and <code>POST</code> methods.
* @param request servlet request
* @param response servlet response
*/
protected void processRequest(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {

// Page will be forwarded to :::
String destinationPage = "";

// Make database connection :::
DatabaseConn dbConn = new DatabaseConn();
Connection connection = dbConn.getConnection();

// get command parameter that will decide which operation is performed :::
String cmd = (String) request.getParameter("cmd");

// get session variable :::
HttpSession sessionVar = request.getSession();

// Check command and perform the proper operation :::
if( cmd.equalsIgnoreCase("flight_search") ) {
String source = (String) request.getParameter("source");

// Get Airport List to send them to next page as bean :::
airportCheck = new AirportDB();
ArrayList airportList = airportCheck.getAirportList();

// Set Attribute and destination Page :::
if( source.equalsIgnoreCase("customer") )
destinationPage = "/customer/flightSearch.jsp";
else if( source.equalsIgnoreCase("agency") )
destinationPage = "/agency/flightSearch.jsp";
request.setAttribute( "airportList", airportList );
}

else if( cmd.equalsIgnoreCase("get_flights") ) {
String returnFlight = (String) request.getParameter("return");

// Get parameters :::
int fromAirportId = Integer.parseInt( request.getParameter("fromAirportsList") );
int toAirportId = Integer.parseInt( request.getParameter("toAirportsList") ) ;
int day1 = Integer.parseInt( request.getParameter("daydropdown1") );
int month1 = Integer.parseInt( request.getParameter("monthdropdown1") );
int year1 = Integer.parseInt( request.getParameter("yeardropdown1") );
Date departDate = new Date( year1-1900, month1, day1 );
int passengerCount = Integer.parseInt( request.getParameter("passengerCount") );

// Get Airport List to send them to next page as bean :::
flightCheck = new FlightDB();
flightList1 = flightCheck.getFlightList( fromAirportId,toAirportId,departDate,passengerCount);


Date returnDate = null;
if( returnFlight.equalsIgnoreCase( "yes" ) ) {
int day2 = Integer.parseInt( request.getParameter("daydropdown2") );
int month2 = Integer.parseInt( request.getParameter("monthdropdown2") );
int year2 = Integer.parseInt( request.getParameter("yeardropdown2") );
returnDate = new Date( year2-1900, month2, day2 );

flightList2 = flightCheck.getFlightList( toAirportId,fromAirportId,returnDate,passengerCount);
request.setAttribute( "flightList2", flightList2 );
}

// Set Attribute and destination Page :::
String source = (String) request.getParameter("source");
if( source.equalsIgnoreCase("customer") )
destinationPage = "/customer/flightResults.jsp";
else if( source.equalsIgnoreCase("agency") )
destinationPage = "/agency/flightResults.jsp";

request.setAttribute( "passengerCount", ""+passengerCount );
request.setAttribute( "flightList1", flightList1 );

}

else if( cmd.equalsIgnoreCase("selected_flight") ) {

// Define variables :::
Iterator flightIterator ,flightIterator2;

// Get source: Agency or Customer?
String source = (String) request.getParameter("source");

// Get flight selection :::
int flightSelection = Integer.parseInt( request.getParameter("flightSelection") );

// Get number of passengers :::
int passengerCount = Integer.parseInt( request.getParameter("passengerCount") );
request.setAttribute( "passengerCount", ""+passengerCount );

// Get depart flight Info :::
flightIterator = flightList1.iterator();
while( flightIterator.hasNext() ) {
currentFlight = (Flight) flightIterator.next();

if( currentFlight.getFlightNo() == flightSelection ) {
request.setAttribute( "selectedFlight", currentFlight );
}
}

if( request.getParameter("flightSelection2") != null ) {

int flightSelection2 = Integer.parseInt( request.getParameter("flightSelection2") );

// Get return flight Info :::
flightIterator2 = flightList2.iterator();
while( flightIterator2.hasNext() ) {
currentFlight2 = (Flight) flightIterator2.next();

if( currentFlight2.getFlightNo() == flightSelection2 ) {
request.setAttribute( "selectedFlight2", currentFlight2 );
}
}
}
// Set Attribute and destination Page :::
if( source.equalsIgnoreCase("customer") )
destinationPage = "/customer/payment.jsp";
else if( source.equalsIgnoreCase("agency") ) {

// Get sale selection: Single or Group?
String saleSelection = (String) request.getParameter("saleSelection");
if( saleSelection.equalsIgnoreCase( "single" ) )
destinationPage = "/agency/singleSale.jsp";
else if( saleSelection.equalsIgnoreCase( "group" ) )
destinationPage = "/agency/groupSale.jsp";
}


} else if( cmd.equalsIgnoreCase("payFlight") ) {

// Define ::
ArrayList departTicketList = new ArrayList();
ArrayList returnTicketList = new ArrayList();
ArrayList passengerList = new ArrayList();
int selectedFlightNo, selectedFlightNo2;

// Get selected depart flight No :::
selectedFlightNo = Integer.parseInt( (String) request.getParameter("flightNo") ) ;

// Get and set credit card info parameters :::
CreditCard cardInfo = new CreditCard();
cardInfo.setCardOwner( (String) request.getParameter("cardOwner") );
cardInfo.setCardNo( (String) request.getParameter("cardNo") );
int day = Integer.parseInt( request.getParameter("daydropdown1") );
int month = Integer.parseInt( request.getParameter("monthdropdown1") );
int year = Integer.parseInt( request.getParameter("yeardropdown1") );
cardInfo.setExpireDate( new Date( year-1900, month, day ) );
cardInfo.setSecurityCode( (String) request.getParameter("securityCode") ) ;

// Ticket sale for the specified number of passengers
int passengerCount = Integer.parseInt( request.getParameter("passengerCount") );
for( int i=1; i<=passengerCount ; i++ ) {

// Get and set Passenger info parameters :::
Passenger passenger = new Passenger();
passenger.setName( (String) request.getParameter("name"+i) );
passenger.setSurname( (String) request.getParameter("surname"+i) ) ;
passenger.setAge( Integer.parseInt( (String) request.getParameter("age"+i) ) );
passenger.setSex( request.getParameter("gender"+i).charAt(0) );
passenger.setPassportId( (String) request.getParameter("passportId"+i) ) ;
passenger.setAddress( (String) request.getParameter("address"+i) );
passenger.setPhoneNo( (String) request.getParameter("phoneNo"+i) ) ;

// Set ticket info :::
Ticket departTicket = new Ticket();
departTicket.setFlightNo( selectedFlightNo );
departTicket.setFarePaid( currentFlight.getTicketFare() );
departTicket.setTicketStatus( "active" );
departTicket.setMyFlight( currentFlight );

// Create a new depart ticket :::
ticketCheck = new TicketDB();
int idTicket = ticketCheck.insertTicket( departTicket );
passenger.setIdTicket( idTicket );
departTicket.setIdTicket( idTicket );

// Create a new passenger :::
passengerCheck = new PassengerDB();
boolean check = passengerCheck.insertNewPassenger( passenger );

if( request.getParameter("flightNo2") != null ) {

// Create a new passenger
Passenger passenger2 = new Passenger( passenger );

// get selected return flight no
selectedFlightNo2 = Integer.parseInt( (String) request.getParameter("flightNo2") ) ;

// Set ticket info :::
Ticket returnTicket = new Ticket();
returnTicket.setFlightNo( selectedFlightNo2 );
returnTicket.setFarePaid( currentFlight2.getTicketFare() );
returnTicket.setTicketStatus( "active" );
returnTicket.setMyFlight( currentFlight2 );

// Create a new depart ticket :::
ticketCheck = new TicketDB();
int idTicket2 = ticketCheck.insertTicket( returnTicket );
passenger2.setIdTicket( idTicket2 );
returnTicket.setIdTicket( idTicket2 );

// Create a new passenger entry for return flight
boolean check2 = passengerCheck.insertNewPassenger( passenger2 );

//
returnTicketList.add( returnTicket );

}

// Set Attributes ::
departTicketList.add( departTicket );
passengerList.add( passenger );

} // end-for-loop

if( request.getParameter("flightNo2") != null ) {
request.setAttribute( "ticketList2", returnTicketList );
request.setAttribute( "flight2", currentFlight2 );
}
request.setAttribute( "flight", currentFlight );
request.setAttribute( "passengerCount", ""+passengerCount );
request.setAttribute( "ticketList", departTicketList );
request.setAttribute( "passengerList", passengerList );

// Set destination Page :::
String source = (String) request.getParameter("source");
if( source.equalsIgnoreCase("customer") )
destinationPage = "/customer/showTicket.jsp";
else if( source.equalsIgnoreCase("agency") )
destinationPage = "/agency/showTicket.jsp";


}
else if( cmd.equalsIgnoreCase("payGroupFlight") ) {

int agencyId = Integer.parseInt( (String) request.getParameter("agencyId") );
int passengerCount = Integer.parseInt( request.getParameter("passengerCount") );

// Get selected depart flight No :::
int departFlightNo = Integer.parseInt( (String) request.getParameter("flightNo") ) ;

// get selected return flight no
if( request.getParameter("flightNo2") != null ) {
int returnFlightNo = Integer.parseInt( (String) request.getParameter("flightNo2") ) ;
}

if( request.getParameter("flightNo2") != null ) {
request.setAttribute( "flight2", currentFlight2 );
}
request.setAttribute( "flight", currentFlight );
request.setAttribute( "passengerCount", ""+passengerCount );

destinationPage = "/agency/showGroupTicket.jsp";

}

// Clean your garbage :::
dbConn.closeConnection();

// Go to destination page :::
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(destinationPage);
dispatcher.forward(request, response);
}

// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
/** Handles the HTTP <code>GET</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/** Handles the HTTP <code>POST</code> method.
* @param request servlet request
* @param response servlet response
*/
protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
processRequest(request, response);
}

/** Returns a short description of the servlet.
*/
public String getServletInfo() {
return "Short description";
}
// </editor-fold>
}