Anda di halaman 1dari 63




: : : :

Pentium IV at 1.5GHz or higher 256MB or above 256KB or above 40GB or above


SDK IDE Database Web Server

: : : :

JDK 1.6 Eclipse Helios 3.6 MySQL Server Tomcat 7.0 Windows XP / Windows 7 / Ubuntu 8.04 or

Operating System : higher Web Browser :

Google Chrome/Mozilla Firefox 3.0

JAVA Java is a programming language originally developed by James Gosling at Sun Microsystems (which has since merged into Oracle Corporation) and released in 1995 as a core component of Sun Microsystems' Java platform. The language derives much of its syntax from C and C++ but has a simpler object model and fewer low-level facilities than either C or C++. Java applications are typically compiled to bytecode (class file) that can run on any Java Virtual Machine (JVM) regardless of computer architecture. Java is a general-purpose, concurrent, class-based, object-oriented language that is specifically designed to have as few implementation dependencies as possible. It is intended to let application developers "write once, run anywhere" (WORA), meaning that code that runs on one platform does not need to be recompiled to run on another. Java is as of 2012 one of the most popular programming languages in use, particularly for client-server web applications, with a reported 10 million users.[9][10] The original and reference implementation Java compilers, virtual machines, and class libraries were developed by Sun from 1995. As of May 2007, in compliance with the specifications of the Java Community Process, Sun relicensed most of its Java technologies under the GNU General Public License. Others have also developed alternative implementations of these Sun technologies, such as the GNU Compiler for Java and GNU Classpath.

History Sun Microsystems released the first public implementation as Java 1.0 in 1995. It promised "Write Once, Run Anywhere" (WORA), providing no-cost run-times on popular platforms. Fairly secure and featuring configurable security, it allowed network- and file-access restrictions. Major web browsers soon incorporated the ability to run Java applets within web pages, and Java quickly became popular. With the advent of Java 2 (released initially as J2SE 1.2 in December 1998 1999), new versions had multiple configurations built for different types of platforms. For example, J2EE targeted enterprise applications and the greatly stripped-down version J2ME for mobile applications (Mobile Java). J2SE designated the Standard Edition.

In 2006, for marketing purposes, Sun renamed new J2 versions as Java EE, Java ME, and Java SE, respectively. In 1997, Sun Microsystems approached the ISO/IEC JTC1 standards body and later the Ecma International to formalize Java, but it soon withdrew from the process.[15] Java remains a de facto standard, controlled through the Java Community Process.[16] At one time, Sun made most of its Java implementations available without charge, despite their proprietary software status. Sun generated revenue from Java through the selling of licenses for specialized products such as the Java Enterprise System. Sun distinguishes between its Software Development Kit (SDK) and Runtime Environment (JRE) (a subset of the SDK); the primary distinction involves the JRE's lack of the compiler, utility programs, and header files Principles There were five primary goals in the creation of the Java language: It should be "simple, object-oriented and familiar" It should be "robust and secure" It should be "architecture-neutral and portable" It should execute with "high performance" It should be "interpreted, threaded, and dynamic" Versions Major release versions of Java, along with their release dates: JDK 1.0 (October 1, 1992) JDK 1.1 (February 19, 1997) J2SE 1.2 (December 8, 1998) J2SE 1.3 (May 8, 2000) J2SE 1.4 (February 6, 2002) J2SE 5.0 (September 30, 2004)

Java SE 6 (December 11, 2006) Java SE 7 (July 28, 2011) Java Platform One characteristic of Java is portability, which means that computer programs written in the Java language must run similarly on any hardware/operating-system platform. This is achieved by compiling the Java language code to an intermediate representation called Java bytecode, instead of directly to platform-specific machine code. Java bytecode instructions are analogous to machine code, but are intended to be interpreted by a virtual machine (VM) written specifically for the host hardware. End-users commonly use a Java Runtime Environment (JRE) installed on their own machine for standalone Java applications, or in a Web browser for Java applets. Standardized libraries provide a generic way to access host-specific features such as graphics, threading, and networking. A major benefit of using bytecode is porting. However, the overhead of interpretation means that interpreted programs almost always run more slowly than programs compiled to native executables would. Just-in-Time (JIT) compilers were introduced from an early stage that compile bytecodes to machine code during runtime. Automatic Memory Management Java uses an automatic garbage collector to manage memory in the object lifecycle. The programmer determines when objects are created, and the Java runtime is responsible for recovering the memory once objects are no longer in use. Once no references to an object remain, the unreachable memory becomes eligible to be freed automatically by the garbage collector. Something similar to a memory leak may still occur if a programmer's code holds a reference to an object that is no longer needed, typically when objects that are no longer needed are stored in containers that are still in use. If methods for a nonexistent object are called, a "null pointer exception" is thrown. Java does not support C/C++ style pointer arithmetic, where object addresses and unsigned integers (usually long integers) can be used interchangeably. This allows the garbage collector to relocate referenced objects and ensures type safety and security

JavaServer Pages JavaServer Pages (JSP) is a technology that helps software

developers create dynamically generated web pages based on HTML, XML, or other document types. Released in 1999 by Sun Microsystems[1], JSP is similar to PHP, but it uses the Java programming language. To deploy and run JavaServer Pages, a compatible web server with a servlet container, such as Apache Tomcat or Jetty, is required. Overview Architecturally, JSP may be viewed as a high-level abstraction of Java servlets. JSPs are translated into servlets at runtime; each JSP's servlet is cached and re-used until the original JSP is modified.[2] JSP can be used independently or as the view component of a server-side model viewcontroller design, normally with JavaBeans as the model and Java servlets (or a framework such as Apache Struts) as the controller. This is a type of Model 2 architecture.[3] JSP allows Java code and certain pre-defined actions to be interleaved with static web markup content, with the resulting page being compiled and executed on the server to deliver a document. The compiled pages, as well as any dependent Java libraries, use Java bytecode rather than a native software format. Like any other Java program, they must be executed within a Java virtual machine (JVM) that integrates with the server's host operating system to provide an abstract platform-neutral environment. JSP pages are usually used to deliver HTML and XML documents, but through the use of OutputStream, they can deliver other types of data as well. Syntax JSP pages use several delimiters for scripting functions. The most basic is <% ... %>, which encloses a JSP scriptlet. A scriptlet is a fragment of Java code that is run when the user requests the page. Other common delimiters include <%=

... %> for expressions, where the value of the expression is placed into the page delivered to the user, and directives, denoted with <%@ ... %>

Comparison with similar technologies JSP pages are similar to PHP pages and ASP.NET Web Forms, in that all three add server-side code to an HTML page. However, all three terms refer to a different component of the system. JSP refers to the JSP pages, which can be used alone, with Java servlets, or with a framework such as Apache Struts. PHP is itself a programming language, designed for dynamic Web pages.[11] is a framework comparable to Struts or JavaServer Faces that uses pages called Web Forms.[12] While JSP pages use the Java language, ASP.NET pages can use any .NETcompatible language, usually C#. ASP.NET is designed for a Microsoft Windows web server, while PHP and Java server technologies (including JSP) are fairly operating system agnostic. Ajax Ajax (an acronym for Asynchronous JavaScript and XML) is a group of interrelated web development techniques used on the client-side to create asynchronous web applications. With Ajax, web applications can send data to, and retrieve data from, a server asynchronously (in the background) without interfering with the display and behavior of the existing page. Data can be retrieved using the XMLHttpRequest object. Despite the name, the use of XML is not required (JSON is often used instead), and the requests do not need to be asynchronous. Ajax is not a single technology, but a group of technologies. HTML and CSS can be used in combination to mark up and style information. The DOM is accessed with JavaScript to dynamically display, and to allow the user to interact with the information presented. JavaScript and the XMLHttpRequest object provide a method for exchanging data asynchronously between browser and server to avoid full page reloads.

Technologies The term Ajax has come to represent a broad group of web technologies that can be used to implement a web application that communicates with a server in the background, without interfering with the current state of the page. In the article that coined the term Ajax, Jesse James Garrett explained that the following technologies are incorporated: HTML (or XHTML) and CSS for presentation The Document Object Model (DOM) for dynamic display of and interaction with data XML for the interchange of data, and XSLT for its manipulation The XMLHttpRequest object for asynchronous communication JavaScript to bring these technologies together Since then, however, there have been a number of developments in the technologies used in an Ajax application, and the definition of the term Ajax. XML is not required for data interchange and therefore XSLT is not required for the manipulation of data. JavaScript Object Notation (JSON) is often used as an alternative format for data interchange,although other formats such as preformatted HTML or plain text can also be used. Cascading Style Sheets Cascading Style Sheets (CSS) is a style sheet language used for describing the presentation semantics (the look and formatting) of a document written in a markup language. Its most common application is to style web pages written in HTML and XHTML, but the language can also be applied to any kind of XML document, including plain XML, SVG and XUL. CSS is designed primarily to enable the separation of document content (written in HTML or a similar markup language) from document presentation, including elements such as the layout, colors, and fonts.This separation can improve content accessibility, provide more flexibility and control in the specification of presentation characteristics, enable multiple pages to share formatting, and reduce complexity and repetition in the structural content (such as by allowing for tableless web design). CSS can also allow the same markup page to be presented in different styles for different

rendering methods, such as on-screen, in print, by voice (when read out by a speechbased browser or screen reader) and on Braille-based, tactile devices. It can also be used to allow the web page to display differently depending on the screen size or device on which it is being viewed. While the author of a document typically links that document to a CSS style sheet, readers can use a different style sheet, perhaps one on their own computer, to override the one the author has specified. CSS specifies a priority scheme to determine which style rules apply if more than one rule matches against a particular element. In this so-called cascade, priorities or weights are calculated and assigned to rules, so that the results are predictable. The CSS specifications are maintained by the World Wide Web Consortium (W3C). Internet media type (MIME type) text/css is registered for use with CSS by RFC 2318 (March 1998), and they also operate a free CSS validation service

Syntax CSS has a simple syntax and uses a number of English keywords to specify the names of various style properties. A style sheet consists of a list of rules. Each rule or rule-set consists of one or more selectors, and a declaration block. A declaration-block consists of a list of declarations in braces. Each declaration itself consists of a property, a colon (:), and a value. If there are multiple declarations in a block, a semi-colon (;) must be inserted to separate each declaration. In CSS, selectors are used to declare which part of the markup a style applies to, a kind of match expression. Selectors may apply to all elements of a specific type, to elements specified by attribute, or to elements depending on how they are placed relative to, or nested within, others in the document tree. Pseudo-classes are used in CSS selectors to permit formatting based on information that is outside the document tree. An often-used example of a pseudo-class is :hover, which identifies content only when the user 'points to' the visible element, usually by holding the mouse cursor over it. It is appended to a selector as in a:hover or #elementid:hover. A pseudo-class classifies document elements, such as :link or

:visited, whereas a pseudo-element makes a selection that may consist of partial elements, such as :first-line or :first-letter. Selectors may be combined in many ways, especially in CSS 2.1, to achieve great specificity and flexibility.

Browser support Further information: Comparison of layout engines (Cascading Style Sheets) Because not all browsers correctly parse CSS code, developed coding techniques known as CSS hacks can either filter specific browsers or target specific browsers (generally both are known as CSS filters). The former can be defined as CSS filtering hacks and the latter can be defined as CSS targeting hacks. Both can be used to hide or show parts of the CSS to different browsers. This is achieved either by exploiting CSS-handling quirks or bugs in the browser, or by taking advantage of lack of support for parts of the CSS specifications. Using CSS filters, some designers have gone as far as delivering different CSS to certain browsers to ensure designs render as expected. Because very early web browsers were either completely incapable of handling CSS, or rendered CSS very poorly, designers today often routinely use CSS filters that completely prevent these browsers from accessing any of the CSS. Internet Explorer support for CSS began with IE 3.0 and increased progressively with each version. By 2008, the first Beta of Internet Explorer 8 offered support for CSS 2.1 in its best web standards mode. An example of a well-known CSS browser bug is the Internet Explorer box model bug, where box widths are interpreted incorrectly in several versions of the browser, resulting in blocks that are too narrow when viewed in Internet Explorer, but correct in standards-compliant browsers. The bug can be avoided in Internet Explorer 6 by using the correct doctype in (X)HTML documents. CSS hacks and CSS filters are used to compensate for bugs such as this, just one of hundreds of CSS bugs that have been documented in various versions of Netscape, Mozilla Firefox, Opera, and Internet Explorer (including Internet Explorer 7). Even when the availability of CSS-capable browsers made CSS a viable technology, the adoption of CSS was still held back by designers' struggles with browsers' incorrect CSS implementation and patchy CSS support. Even today, these problems

continue to make the business of CSS design more complex and costly than it was intended to be, and cross-browser testing remains a necessity. Other reasons for the continuing non-adoption of CSS are: its perceived complexity, authors' lack of familiarity with CSS syntax and required techniques, poor support from authoring tools, the risks posed by inconsistency between browsers and the increased costs of testing. Currently there is strong competition between Mozilla's Gecko layout engine used in Firefox, the WebKit layout engine used in Apple Safari and Google Chrome, the similar KHTML engine used in KDE's Konqueror browser, and Opera's Presto layout engineeach of them is leading in different aspects of CSS. As of August 2009, Internet Explorer 8, Firefox 2 and 3 have reasonably complete levels of implementation of CSS 2.1. Bing Translator Bing Translator (previously Live Search Translator and Windows Live Translator) is a user facing translation portal provided by Microsoft as part of its Bing services to translate texts or entire web pages into different languages. All translation pairs are powered by Microsoft Translator statistical machine translation platform and web service, developed by Microsoft Research, as its backend translation software. Two transliteration pairs (between Chinese Traditional and Chinese Simplified) are provided by Microsoft's Windows International team.

Features In addition to standard text and web page translation, Bing Translator includes several additional features: When translating an entire web page, or when the user selects "Translate this page" in Bing search results, the Bilingual Viewer will be shown, which allows users to browse the original web page text and translation in parallel, supported by synchronized highlights, scrolling, and navigation Four Bilingual Viewer layouts are available: Side by side

Top and bottom Original with hover translation Translation with hover original Website owners can add a translation widget to their website for translating it into other languages supported by Bing Translator; this is done by inserting an HTML code snippet on the web page Any-to-Any language translation pairs Automatically detect the language of the text or website being translated Ability to easily reverse the translation direction The user can play back a spoken version of the translation through text-to-speech (not supported in every language)

SPHINX CMU Sphinx, also called Sphinx in short, is the general term to describe a group of speech recognition systems developed at Carnegie Mellon University. These include a series of speech recognizers (Sphinx 2 - 4) and an acoustic model trainer (SphinxTrain). In 2000, the Sphinx group at Carnegie Mellon committed to open source several speech recognizer components, including Sphinx 2 and later Sphinx 3 (in 2001). The speech decoders come with acoustic models and sample applications. The available resources include in addition software for acoustic model training, Language model compilation and a public-domain pronunciation dictionary, cmudict.


Sphinx Sphinx is a continuous-speech, speaker-independent recognition system making use of hidden Markov acoustic models (HMMs) and an n-gram statistical language model. It was developed by Kai-Fu Lee. Sphinx featured feasibility of continuous-speech, speaker-independent large-vocabulary recognition, the possibility of which was in dispute at the time (1986). Sphinx is of historical interest only; it has been superseded in performance by subsequent versions. An archival article describes the system in detail.

Sphinx 2 A fast performance-oriented recognizer, originally developed by Xuedong Huang at Carnegie Mellon and released as Open source with a BSD-style license on SourceForge by Kevin Lenzo at LinuxWorld in 2000. Sphinx 2 focuses on real-time recognition suitable for spoken language applications. As such it incorporates functionality such as end-pointing, partial hypothesis generation, dynamic language model switching and so on. It is used in dialog systems and language learning systems. It can be used in computer based PBX systems such as Asterisk. Sphinx 2 code has also been incorporated into a number of commercial products. It is no longer under active development (other than for routine maintenance). Current real-time decoder development is taking place in the Pocket Sphinx project. An archival article describes the system.

Sphinx 3 Sphinx 2 used a semi-continuous representation for acoustic modeling (i.e., a single set of Gaussians is used for all models, with individual models represented as a weight vector over these Gaussians). Sphinx 3 adopted the prevalent continuous HMM representation and has been used primarily for high-accuracy, non-real-time recognition. Recent developments (in algorithms and in hardware) have made Sphinx 3 "near" real-time, although not yet suitable for critical interactive applications. Sphinx 3 is under active development and in conjunction with SphinxTrain provides

access to a number of modern modeling techniques, such as LDA/MLLT, MLLR and VTLN, that improve recognition accuracy (see the article on Speech Recognition for descriptions of these techniques).

Sphinx 4 Sphinx 4 is a complete re-write of the Sphinx engine with the goal of providing a more flexible framework for research in speech recognition, written entirely in the Java programming language. Sun Microsystems supported the development of Sphinx 4 and contributed software engineering expertise to the project. Participants included individuals at MERL, MIT and CMU. Current development goals include: developing a new (acoustic model) trainer implementing speaker adaptation (e.g. MLLR) improving configuration management creating a graph-based UI for graphical system design

Basic concepts of speech Speech is a complex phenomenon. People rarely understand how is it produced and perceived. The naive perception is often that speech is built with words, and each word consists of phones. The reality is unfortunately very different. Speech is a dynamic process without clearly distinguished parts. It's always useful to get a sound editor and look into the recording of the speech and listen to it All modern descriptions of speech are to some degree probabilistic. That means that there are no certain boundaries between units, or between words. Speech to text translation and other applications of speech are never 100% correct. That idea is rather unusual for software developers, who usually work with deterministic systems. And it creates a lot of issues specific only to speech technology.


Structure of speech In current practice, speech structure is understood as follows: Speech is a continuous audio stream where rather stable states mix with dynamically changed states. In this sequence of states, one can define more or less similar classes of sounds, or phones. Words are understood to be built of phones, but this is certainly not true. The acoustic properties of a waveform corresponding to a phone can vary greatly depending on many factors - phone context, speaker, style of speech and so on. The so called coarticulation makes phones sound very different from their canonical representation. Next, since transitions between words are more informative than stable regions, developers often talk about diphones - parts of phones between two consecutive phones. Sometimes developers talk about subphonetic units - different substates of a phone. Often three or more regions of a different nature can easily be found. The number three is easily explained. The first part of the phone depends on its preceding phone, the middle part is stable, and the next part depends on the subsequent phone. That's why there are often three states in a phone selected for HMM recognition. Sometimes phones are considered in context. There are triphones or even quinphones. But note that unlike phones and diphones, they are matched with the same range in waveform as just phones. They just differ by name. That's why we prefer to call this object senone. A senone's dependence on context could be more complex than just left and right context. It can be a rather complex function defined by a decision tree, or in some other way. Next, phones build subword units, like syllables. Sometimes, syllables are defined as reduction-stable entities. To illustrate, when speech becomes fast, phones often change, but syllables remain the same. Also, syllables are related to intonational contour. There are other ways to build subwords - morphologically-based in morphology-rich languages or phonetically-based. Subwords are often used in open vocabulary speech recognition.


Subwords form words. Words are important in speech recognition because they restrict combinations of phones significantly. If there are 40 phones and an average word has 7 phones, there must be 40^7 words. Luckily, even a very educated person rarely uses more then 20k words in his practice, which makes recognition way more feasible. Words and other non-linguistic sounds, which we call fillers (breath, um, uh, cough), form utterances. They are separate chunks of audio between pauses. They don't necessary match sentences, which are more semantic concepts. On the top of this, there are dialog acts like turns, but they go beyond the purpose of the document.

Recognition process The common way to recognize speech is the following: we take waveform, split it on utterances by silences then try to recognize what's being said in each utterance. To do that we want to take all possible combinations of words and try to match them with the audio. We choose the best matching combination. There are few important things in this match. First of all it's a concept of features. Since number of parameters is large, we are trying to optimize it. Numbers that are calculated from speech usually by dividing speech on frames. Then for each frame of length typically 10 milliseconds we extract 39 numbers that represent the speech. That's called feature vector. They way to generates numbers is a subject of active investigation, but in simple case it's a derivative from spectrum. Second it's a concept of the model. Model describes some mathematical object that gathers common attributes of the spoken word. In practice, for audio model of senone is gaussian mixture of it's three states - to put it simple, it's a most probable feature vector. From concept of the model the following issues raised - how good does model fits practice, can model be made better of it's internal model problems, how adaptive model is to the changed conditions.

Third, it's a matching process itself. Since it would take a huge time more than universe existed to compare all feature vectors with all models, the search is often optimized by many tricks. At any points we maintain best matching variants and extend them as time goes producing best matching variants for the next frame.

Models According to the speech structure, three models are used in speech recognition to do the match: An acoustic model contains acoustic properties for each senone. There are contextindependent models that contain properties (most probable feature vectors for each phone) and context-dependent ones (built from senones with context). A phonetic dictionary contains a mapping from words to phones. This mapping is not very effective. For example, only two to three pronunciation variants are noted in it, but it's practical enough most of the time. The dictionary is not the only variant of mapper from words to phones. It could be done with some complex function learned with a machine learning algorithm. A language model is used to restrict word search. It defines which word could follow previously recognized words (remember that matching is a sequential process) and helps to significantly restrict the matching process by stripping words that are not probable. Most common language models used are n-gram language models-these contain statistics of word sequences-and finite state language models-these define speech sequences by finite state automation, sometimes with weights. To reach a good accuracy rate, your language model must be very successful in search space restriction. This means it should be very good at predicting the next word. A language model usually restricts the vocabulary considered to the words it contains. That's an issue for name recognition. To deal with this, a language model can contain smaller chunks like subwords or even phones. Please note that search space restriction in this case is usually worse and corresponding recognition accuracies are lower than with a word-based language model.

Those three entities are combined together in an engine to recognize speech. CMUSphinx Toolkit CMUSphinx toolkit is a leading speech recognition toolkit with various tools used to build speech applications. CMU Sphinx toolkit has a number of packages for different tasks and applications Sphinx4 adjustable, modifiable recognizer written in Java CMUclmtk language model tools Sphinxtrain acoustic model training tools

MySQL MySQL is the world's most used open source relational database management system (RDBMS) that runs as a server providing multi-user access to a number of databases. The SQL phrase stands for Structured Query Language. The MySQL development project has made its source code available under the terms of the GNU General Public License, as well as under a variety of

proprietary agreements. MySQL was owned and sponsored by a single for-profit firm, the Swedish company MySQL AB, now owned by Oracle Corporation. Free-software-open source projects that require a full-featured database management system often use MySQL. For commercial use, several paid editions are available, and offer additional functionality. Applications which use MySQL databases include: TYPO3, Joomla, WordPress, phpBB, MyBB, Drupal and other software built on the LAMP software stack. MySQL is also used in many high-profile, largescale World Wide Web products, including Wikipedia, Google (though not for searches), Facebook, and Twitter. MySQL is a popular choice of database for use in web applications, and is a central component of the widely used LAMP open source web application software stack LAMP is an acronym for "Linux, Apache, MySQL, Perl/PHP/Python".

Many programming

languages with

language-specific APIs include libraries for

accessing MySQL databases. These include MySQL Connector/Net for integration with Microsoft's Visual Studio(languages such as C# and VB are most commonly used) and the JDBC driver for Java. In addition, an ODBC interface

called MyODBC allows additional programming languages that support the ODBC interface to communicate with a MySQL database, such as ASP or ColdFusion. The HTSQL - URL-based query method also ships with a MySQL adapter, allowing direct interaction between a MySQL database and any web client via structured URLs. As of April 2009, MySQL offered MySQL 5.1 in two different variants: the open source MySQL Community Server and the commercial Enterprise Server. MySQL 5.5 is offered under the same licenses. They have a common code base and include the following features: A broad subset of ANSI SQL 99, as well as extensions Cross-platform support Stored procedures Triggers Cursors Updatable Views Information schema Strict mode (ensures MySQL does not truncate or otherwise modify data to conform to an underlying data type, when an incompatible value is inserted into that type) X/Open XA distributed transaction processing (DTP) support; two phase commit as part of this, using Oracle's InnoDB engine Independent storage engines (MyISAM for read speed, InnoDB for transactions and referential integrity, MySQL Archive for storing historical data in little space) Transactions with the InnoDB, and Cluster storage engines; savepoints with InnoDB SSL support Query caching

Sub-SELECTs (i.e. nested SELECTs) Replication support (i.e. Master-Master Replication & Master-Slave Replication) with one master per slave, many slaves per master, no automatic support for multiple masters per slave.

Full-text indexing and searching using MyISAM engine Embedded database library Partial Unicode support (UTF-8 and UCS-2 encoded strings are limited to the BMP) ACID compliance when using transaction capable storage engines (InnoDB and Cluster)[ Partitioned tables with pruning of partitions in optimiser Shared-nothing clustering through MySQL Cluster Hot backup (via mysqlhotcopy) under certain conditions

MySQL implements the following features, which some other RDBMS systems may not: Multiple storage engines, allowing one to choose the one that is most effective for each table in the application (in MySQL 5.0, storage engines must be compiled in; in MySQL 5.1, storage engines can be dynamically loaded at run time): Native storage engines (MyISAM, Falcon, Blackhole, Cluster, Merge, Memory

(heap), Federated, Archive, CSV,


and InnoDB, which was made the default as of 5.5) Partner-developed storage engines (solidDB, NitroEDB, ScaleDB, TokuDB, Infobright (formerly Brighthouse), Kickfire, XtraDB, IBM DB2).[ InnoDB used to be a partner-developed storage engine, but with recent acquisitions, Oracle now owns both MySQL core and InnoDB. Community-developed storage engines (memcache engine, httpd, PBXT, Revision Engine) Custom storage engines Commit grouping, gathering multiple transactions from multiple connections together to increase the number of commits per second.


APACHE STRUTS FRAMEWORK Apache Struts is an open-source web application framework for developing Java EE web applications. It uses and extends the Java Servlet API to encourage developers to adopt a modelviewcontroller (MVC) architecture. It was originally created by Craig McClanahan and donated to the Apache Foundation in May, 2000. Formerly located under the Apache Jakarta Project and known as Jakarta Struts, it became a top-level Apache project in 2005. Design goals and overview

In a standard Java EE web application, the client will typically call to the server via a web form. The information is then either handed over to a Java Servlet which interacts with a database and produces an HTML-formatted response, or it is given to a JavaServer Pages (JSP) document that intermingles HTML and Java code to achieve the same result. Both approaches are often considered inadequate for large projects because they mix application logic with presentation and make maintenance difficult. The goal of Struts is to separate the model (application logic that interacts with a database) from the view (HTML pages presented to the client) and the controller (instance that passes information between view and model). Struts provides the controller (a servlet known as ActionServlet) and facilitates the writing of templates for the view or presentation layer (typically in JSP, but XML/XSLT and Velocity are also supported). The web application programmer is responsible for writing the model code, and for creating a central configuration file struts-config.xml that binds together model, view and controller. Requests from the client are sent to the controller in the form of "Actions" defined in the configuration file; if the controller receives such a request it calls the corresponding Action class that interacts with the application-specific model code. The model code returns an "ActionForward", a string telling the controller what output page to send to the client. Information is passed between model and view in the form of special JavaBeans. A powerful custom tag library allows it to read and write


the content of these beans from the presentation layer without the need for any embedded Java code. Struts is categorized as a request-based web application framework. Struts also supports internationalization by web forms, and includes a template mechanism called "Tiles" that (for instance) allows the presentation layer to be composed from independent header, footer, and content components. Struts2 features

Simple POJO based Actions Simplified testability Thread Safe AJAX Support jQuery Plugin Dojo Plugin (deprecated) AJAX Client Side Validation Template Support Support for different result types Easy to extend with Plugins REST Plugin (REST based Actions, Extension-less URLs) Convention Plugin (Action Configuration via Conventions and Annotations) Spring Plugin (Dependency Injection) Hibernate Plugin support in Design JFreechart Plugin (Charts) jQuery Plugin (AJAX Support, UI Widgets, Dynamic Table, Charts) Rome Plugin (RSS Feeds) Competing MVC frameworks


Although Struts is a well-documented, mature, and popular framework for building front ends to Java applications, there are other frameworks categorized as "lightweight" MVC frameworks such as Spring MVC, Stripes, Wicket, Play!, and Tapestry. The new XForms standards and frameworks may also be another option to building complex web Form validations with Struts in the future. The WebWork framework spun off from Apache Struts aiming to offer enhancements and refinements while retaining the same general architecture of the original Struts framework. However, it was announced in December 2005 that Struts would re-merge with WebWork. WebWork 2.2 has been adopted as Apache Struts2, which reached its first full release in February 2007. In 2004, Sun launched an addition to the Java platform, called JavaServer Faces (JSF). Aside from the original Struts framework, the Apache project previously offered a JSF-based framework called Shale, which was retired in May 2009. Other MVC frameworks that are Java based include WebObjects and Grails.

ECLIPSE IDE Eclipse is a multi-language software development environment comprising an integrated development environment (IDE) and an extensible plug-in system. It is written mostly in Java. It can be used to develop applications in Java and, by means of various plug-ins, other programming languages including Ada, C, C++, COBOL, Haskell, Perl, PHP, Python, R, Ruby (including Ruby on Rails framework), Scala, Clojure, Groovy, Android and Scheme. It can also be used to develop packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others. The initial codebase originated from IBM VisualAge.The Eclipse SDK (which includes the Java development tools) is meant for Java developers. Users can extend its abilities by installing plug-ins written for the Eclipse Platform, such as development toolkits for other programming languages, and can write and contribute their own plug-in modules.

Released under the terms of the Eclipse Public License, Eclipse SDK is free and open source software. It was one of the first IDEs to run under GNU Classpath and it runs without issues under IcedTea.

Architecture The Eclipse Platform uses plug-ins to provide all functionality within and on top of the runtime system, in contrast to some other applications, in which functionality is hard coded. The Eclipse Platform's runtime system is based on Equinox, an implementation of the OSGi core framework specification. This plug-in mechanism is a lightweight software componentry framework. In addition to allowing the Eclipse Platform to be extended using other programming languages such as C and Python, the plug-in framework allows the Eclipse Platform to work with typesetting languages like LaTeX, networking applications such as telnet and database management systems. The plug-in architecture supports writing any desired extension to the environment, such as for configuration management. Java and CVS support is provided in the Eclipse SDK, with support for other version control systems provided by third-party plug-ins. With the exception of a small run-time kernel, everything in Eclipse is a plug-in. This means that every plug-in developed integrates with Eclipse in exactly the same way as other plug-ins; in this respect, all features are "created equal". Eclipse provides plugins for a wide variety of features, some of which are through third parties using both free and commercial models. Examples of plug-ins include a UML plug-in for Sequence and other UML diagrams, a plug-in for DB Explorer, and many others. The Eclipse SDK includes the Eclipse Java development tools (JDT), offering an IDE with a built-in incremental Java compiler and a full model of the Java source files. This allows for advanced refactoring techniques and code analysis. The IDE also makes use of a workspace, in this case a set of metadata over a flat filespace allowing external file modifications as long as the corresponding workspace "resource" is refreshed afterwards.


Eclipse implements widgets through a widget toolkit for Java called SWT, unlike most Java applications, which use the Java standard Abstract Window Toolkit (AWT) or Swing. Eclipse's user interface also uses an intermediate graphical user interface layer called JFace, which simplifies the construction of applications based on SWT. Starting with the Eclipse 4.x series, Eclipse XWT (XML Window Toolkit) replaces SWT as the preferred way to create user interfaces for Eclipse. SWT support is deprecated in Eclipse Juno, and is planned to be removed entirely in Kepler. Language packs developing by the "Babel project" provide translations into over a dozen natural languages.

Rich Client Platform Eclipse provides the Rich Client Platform (RCP) for developing general purpose applications. The following components constitute the rich client platform: Equinox OSGi a standard bundling framework Core platform boot Eclipse, run plug-ins[citation needed] Standard Widget Toolkit (SWT) a portable widget toolkit JFace viewer classes to bring model view controller programming to SWT, file buffers, text handling, text editors Eclipse Workbench views, editors, perspectives, wizards Examples of rich client applications based on Eclipse are: Lotus Notes 8 Novell/NetIQ Designer for Identity Manager Apache Directory Studio Server platform


Eclipse supports development for Tomcat, GlassFish and many other servers and is often capable of installing the required server (for development) directly from the IDE. It supports remote debugging, allowing the user to watch variables and step through the code of an application that is running on the attached server. Web Tools Platform

The Eclipse Web Tools Platform (WTP) project is an extension of the Eclipse platform with tools for developing Web and Java EE applications. It includes source and graphical editors for a variety of languages, wizards and built-in applications to simplify development, and tools and APIs to support deploying, running, and testing apps.

APACHE TOMCAT SERVER Apache Tomcat (or simply Tomcat, formerly also Jakarta Tomcat) is an open source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat implements the Java Servlet and the JavaServer Pages (JSP) specifications from Oracle Corporation, and provides a "pure Java" HTTP web server environment for Java code to run. Tomcat is not the same as the Apache web server, which is a C implementation of a HTTP web server; these two web servers are not bundled together, although they are frequently used together as part of a server application stack. Apache Tomcat includes tools for configuration and management, but can also be configured by editing XML configuration files.



DESCRIPTION It is a dynamic web application developed for synchronous conferencing over a network. The application is written in Java programming language. The application is run through Eclipse Helios IDE on Windows OS / Unix-based OS having Internet connection.

SCOPE This web application has been developed to use field communication. The objective of this project is to establish communication between clients who speak different languages (specifically Hindi and English). The clients can use two interfaces: i.Text Oriented Interface The client can communicate by typing words in the provided text area using standard keyboard or a native keyboard ii. Voice Oriented Interface (For future implementation) The client can communicate by speaking into the microphone, which is then converted into text by the integrated speech recognizer.

INVOCATION The Dynamic Web Application Project has to be imported into the workspace of Eclipse Helios IDE. The project requires an API key, which provides access to the Bing Translator, available at Microsoft Azure Marketplace. Clients wishing communicate need to Sign Up first.


SOURCE CODE When the project is run on Apache Tomcat Sever, the XML file web.xml opens the welcome page signup.jsp mentioned in XML code. The client signs up through this JSP page. The code for above mentioned files is shown below along with the screenshot of the signup page:

web.xml <?xml version="1.0" encoding="UTF-8"?>

<web-app xmlns:xsi="" xmlns="" xmlns:web="" xsi:schemaLocation="" id="WebApp_ID" version="3.0">

<display-name>Struts 2</display-name> <welcome-file-list> <welcome-file>/signup.jsp</welcome-file> </welcome-file-list>

<filter> <filter-name>struts2</filter-name> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filterclass> </filter>

<filter-mapping> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern>


</filter-mapping> </web-app>


<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> <html> <head> <style type="text/css">

#signup-box { background: url(images/login-box-backg1.png) no-repeat; padding-top: 100px; padding-left: 200px; font: 12px Arial, Helvetica, sans-serif; color: #ebebeb; margin-left: 100px; }

#signup-box h2 { padding: 0; margin: 0; color: #ebebeb; font: bold 50px "Calibri", Arial; }

.form-Name { float: left; margin-left: 20px; margin-top: 18px; border: 1px solid #0d2c52; background-color: #1e4f8a; width: 205px; font-size: 16px; color: #ebebeb; }

.form-submit { float: left; font-weight: 900; font-size: 14px; background: #4F8CDF; padding-left: 10px; padding-right: 10px;

height: 42px; width: 103px; border: 2px; border-radius: 8px; color: #ebebeb; margin-top: 20px; margin-left: 200px; box-shadow: 0px 2px 3px #000000; } </style> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Signup</title> </head> <body>

<div style="padding: 0px 0px 0px 180px;"> <div id="signup-box"> <H2>Sign Up</H2> <s:form action="signup"> <s:textfield label="FIRST NAME" name="firstname" cssClass="form-Name" labelposition="left" value="" size="30" maxlength="2048"></s:textfield> <s:textfield label="LAST NAME" name="lastname" cssClass="form-Name" labelposition="left" value="" size="30" maxlength="2048"></s:textfield> <s:textfield label="DISPLAY NAME" name="dname" cssClass="form-Name" labelposition="left" value="" size="30" maxlength="2048"></s:textfield> <s:textfield label="EMAIL" name="email" cssClass="form-Name"

labelposition="left" value="" size="30" maxlength="2048"></s:textfield> <s:password label="PASSWORD" name="password" cssClass="form-Name" labelposition="left" value="" size="30" maxlength="2048"></s:password> <br> <s:password label="CONFIRM PASSWORD" name="password1" cssClass="form-Name" labelposition="left" value="" size="30" maxlength="2048"></s:password> <br> <s:textfield label="LANGUAGE" name="lang" cssClass="form-Name" labelposition="left" value="" size="30" maxlength="2048"></s:textfield> <br> <s:submit value="SignUp" cssClass="formsubmit"></s:submit> </s:form>

<br> <br> <br> <br> <br> <br> <br> <br>

</div> </div>

</body> </html>

After filling the form and clicking on submit button the form is validated. The control then moves to Java class

The code for Signup-validation.xml and is shown below.


<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE validators PUBLIC "-//OpenSymphony Group//XWork Validator 1.0.2//EN" ""> <validators> <field name="dname"> <field-validator type="requiredstring" short-circuit="true"> <message>Display Name is required.</message> </field-validator> </field> <field name="password"> <field-validator type="requiredstring"> <param name="max">15</param> <param name="min">6</param> <message>Password is required.</message> </field-validator> </field> <field name="password1"> <field-validator type="requiredstring"> <param name="max">15</param> <param name="min">6</param> <message>Password is required.</message> </field-validator> </field> <field name="firstname"> <field-validator type="requiredstring"> <message>FirstName is required.</message> </field-validator>

</field> <field name="lastname"> <field-validator type="requiredstring" short-circuit="true"> <message>Last Name is required.</message> </field-validator> </field> <field name="lang"> <field-validator type="requiredstring" short-circuit="true"> <message>Language is required.</message> </field-validator> </field> <field name="email"> <field-validator type="email" short-circuit="true"> <message>Email is required.</message> </field-validator> </field>

</validators> package translator;

import java.sql.Connection; import java.sql.DriverManager; import java.sql.ResultSet; import java.sql.Statement; import java.util.*;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;


public class Signup extends ActionSupport {

String firstname, lastname, dname, password, password1, email, lang;

public String getLang() { return lang; }

public void setLang(String lang) { this.lang = lang; }

public Signup() { }

public String getFirstname() { return firstname; }

public void setFirstname(String firstname) { this.firstname = firstname; }

public String getLastname() { return lastname; }

public void setLastname(String lastname) { this.lastname = lastname; }

public String getDname() { return dname; }


public void setDname(String dname) { this.dname = dname; }

public String getPassword() { return password; }

public void setPassword(String password) { this.password = password; }

public String getPassword1() { return password1; }

public void setPassword1(String password1) { this.password1 = password1; }

public String getEmail() { return email; }

public void setEmail(String email) { = email; }

Connection con; ResultSet rs; Statement st; int flag = 0, f = 0;


public String execute() {

ServletActionContext.getContext().getSession().put("l", lang);

try { Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con = DriverManager.getConnection("jdbc:odbc:mydsn"); st = con.createStatement(); rs = st.executeQuery("select * from Table1"); while ( { String x = rs.getString("email"); if (x.equals(email)) { flag = 1; } } if (password.equals(password1) && (flag == 0)) { st.executeUpdate("insert into Table1 values('" + firstname + "','" + lastname + "','" + dname + "','" + email + "','" + password + "')"); ServletActionContext.getContext().getSession() .put("fsign", dname); f = 1; } else { f = 0; } } catch (Exception e) { System.out.print(e); } if (f == 1) { return SUCCESS; } else return NONE;

If the method execute(), defined in, returns SUCCESS the details filled by the client are stored in the database through Java Database Connectivity (JDBC) and the next JSP page chat.jsp as mentioned in the XML file struts.xml is displayed. The code and screen shots are shown below.

struts.xml <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN" "">

<struts> <constant name="struts.devMode" value="true" /> <constant name="struts.action.extension" value="html" /> <package name="helloworld" extends="struts-default">

<action name="signup" class="translator.Signup" method="execute"> <result name="input">/signup.jsp</result> <result name="success">/chat.jsp</result> <result name="none">/signup.jsp</result>


<action name="login" class="translator.Login" method="execute"> <result name="input">/login.jsp</result> <result name="success">/chat.jsp</result>


<result name="none">/login.jsp</result>


<action name="chat" class="translator.Chat" method="execute"> <result name="input">/chat.jsp</result> <result name="success">/chat.jsp</result>


</package> </struts>


chat.jsp <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <%@taglib prefix="sx" uri="/struts-dojo-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> <html> <head> <style type="text/css"> #signup-box { background: url(images/login-box-backg1.png) no-repeat; padding-top: 20px; padding-left: 100px; font: 12px Arial, Helvetica, sans-serif; color: #ebebeb; margin-left: 100px; }

#signup-box h2 { padding: 0px; margin-left: 230px; margin-top: 40px; color: #ebebeb; font: bold 50px "Calibri", Arial; }

.form-Name { float: left; margin-left: 0px; margin-top: 0px;


border: 1px solid #0d2c52; background-color: #1e4f8a; width: 205px; font-size: 16px; color: #ebebeb; }

.form-submit { float: left; font-weight: 900; font-size: 14px; background: #4F8CDF; padding-left: 10px; padding-right: 10px; height: 42px; width: 103px; border: 2px; border-radius: 8px; color: #ebebeb; margin-top: 20px; margin-left: 490px; box-shadow: 0px 2px 3px #000000; } </style> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>Chat</title> <sx:head /> </head>


<div style="padding: 0px 0px 0px 180px;"> <div id="signup-box">


<h2 id="signup-box h2">CHAT</h2> <sx:div cssStyle="border:1px solid black; width:585px; height:300px;margin-left:7px;margin-top:0px;" href="result.jsp" updateFreq="1000" autoStart="true"></sx:div> <s:form action="chat"> <s:textfield name="t" cssClass="form-Name" labelposition="left" value="" cssStyle="width:585px;height:50px;"></s:textfield> <s:submit value="Send" cssClass="formsubmit"></s:submit> </s:form> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> <br> </div> </div> </body>


package translator;

import org.apache.struts2.ServletActionContext;

import com.memetix.mst.language.Language; import com.memetix.mst.translate.Translate;


import com.opensymphony.xwork2.ActionSupport; import edu.cmu.sphinx.frontend.util.Microphone; import edu.cmu.sphinx.recognizer.Recognizer; import edu.cmu.sphinx.result.Result; import edu.cmu.sphinx.util.props.ConfigurationManager;

public class Chat extends ActionSupport { String t, translatedText, translatedChat, lng, usr,rec; static String chat = "";

public String getT() { return t; }

public void setT(String t) { this.t = t; }

public String execute() throws Exception {

Translate.setClientId(/* Enter your Windows Azure Client Id here */); //username for ms azure marketplace

Translate.setClientSecret(/* Enter your Windows Azure Client Secret here */); //API key

lng = (String) ServletActionContext.getContext().getSession().get("l"); usr = (String) ServletActionContext.getContext().getSession() .get("ulog"); rec = (String) ServletActionContext.getContext().getSession().get("y");

if (t != null || rec != null) { if (lng.equals("ENGLISH")) { System.out.println("english");


translatedText = Translate.execute(chat, Language.ENGLISH); translatedChat = Translate.execute(t+rec, Language.ENGLISH);

chat = translatedText + " " + usr + ":" + " " + translatedChat + "." +"<br>"; System.out.println(chat); ServletActionContext.getContext().getSession().put("z", chat); }

if (lng.equals("HINDI")) { translatedText = Translate.execute(chat, Language.HINDI); translatedChat = Translate.execute(t+rec, Language.HINDI);

chat = translatedText + " " + usr + ":" + " " + translatedChat + "" + "<br>"; System.out.println(chat); ServletActionContext.getContext().getSession().put("z", chat); } }

else { if (lng.equals("ENGLISH")) { translatedText = Translate.execute(chat, Language.ENGLISH); System.out.println(chat); ServletActionContext.getContext().getSession()


.put("z", translatedText);

if (lng.equals("HINDI")) {

translatedText = Translate.execute(chat, Language.HINDI); System.out.println(chat); ServletActionContext.getContext().getSession() .put("z", translatedText);

} }

return SUCCESS; }

} Now as the user is on the JSP page chat.jsp, provided that another client is online, the synchronous conferencing can start. A separate session for each client is started when the client logs in.

Another session to carry out the translation process is created based on the selected languages.

The message is given as input which is stored in an object of String class. This string variable is then translated from the source language to the destination language as selected by the clients. The previous content if any is stored in the String variable translatedChat. The content of translatedChat is concatenated with new message and is stored in chat. Finally this chat is stored the session variable z. This session variable is then


printed on the JSP page result.jsp.The JSP page Chat.jsp uses AJAX to refresh and display this result.jsp page at regular intervals as specified. A registered client may login from the JSP page login.jsp.The code for login.jsp, and the screenshot is shown below.


<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> <%@ taglib prefix="s" uri="/struts-tags"%> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Login</title>

<style type="text/css"> #login-box { width: 333px; height: 352px; padding: 58px 76px 0 76px; color: #ebebeb; font: 12px Arial, Helvetica, sans-serif; background: url(images/login-box-backg.png) no-repeat left top; }

#login-box img { border: none; }

#login-box h2 {

padding: 0; margin: 0; color: #ebebeb; font: bold 44px "Calibri", Arial; }

#login-box-name { float: left; display: inline; width: 80px; text-align: right; padding: 14px 10px 0 0; margin: 0px 0 7px 0; }

#login-box-field { float: left; display: inline; width: 230px; margin: 0; margin: 0 0 7px 0; }

.form-submit { float: left; margin-left: 110px; }

.form-login { width: 205px; padding: 10px 4px 6px 3px; border: 1px solid #0d2c52; background-color: #1e4f8a; font-size: 16px;

color: #ebebeb; }

.login-box-options { clear: both; padding-left: 87px; font-size: 11px; }

.login-box-options a { color: #ebebeb; font-size: 11px; }

.nits { margin-top: 0px; } </style> </head>


<div style="padding: 100px 0 0 250px;">

<div id="login-box">


<br /> <br /> <div class="nits"> <s:form action="login"> <s:textfield label="Email" name="email" cssClass="form-login"

labelposition="left" title="Username" value="" size="30" maxlength="2048" /> <s:password label="Password" labelposition="left" name="password" cssClass="form-login" title="Password" value="" size="30" maxlength="2048" /> <s:textfield label="Language" name="lang" cssClass="form-login" labelposition="left" title="Username" value="" size="30" maxlength="2048" /> <s:submit type="image" src="images/loginbtn.png" value="LOGIN" cssClass="form-submit" width="103" height="42"></s:submit> </s:form> </div> <br /> <span class="login-box-options"><s:checkbox name="1" value="1"> </s:checkbox>Remember Me <a href="#" style="margin-left: 30px; font-weight: 900; textshadow: 1px 3px 10px #ffffff; text-decoration: none; letter-spacing: .8em;">SIGNUP</a> </span> <br /> <br /> <a href=""><img src="images/loginbtn.png" width="103" height="42" style="margin-left: 90px;" /> </a>



</body> </html>

package translator;

import java.sql.*;

import org.apache.struts2.ServletActionContext;

import com.opensymphony.xwork2.ActionSupport;

public class Login extends ActionSupport{ public Login(){} String email,password,lang;

public String getLang() { return lang; } public void setLang(String lang) { this.lang = lang; } public String getEmail() { return email; } public void setEmail(String email) { = email; } public String getPassword() { return password; }

public void setPassword(String password) { this.password = password; } String e,p,fn; Connection con; ResultSet rs; Statement st; int fl=0; public String execute() { try {

Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:mydsn"); st=con.createStatement(); rs=st.executeQuery("select * from Table1");

while( {

e=rs.getString("email"); p=rs.getString("password");

if((e.equals(email))&&(p.equals(password))) { fl=1; }

} catch (Exception e) { System.out.print(e);


if(fl==1) {

ServletActionContext.getContext().getSession().put("ulog",email); ServletActionContext.getContext().getSession().put("l", lang); return SUCCESS; }

else { return NONE; } }

The Voice Interface : CMUSphinx

package edu.cmu.sphinx.speaking;

import edu.cmu.sphinx.frontend.util.Microphone; import edu.cmu.sphinx.recognizer.Recognizer; import edu.cmu.sphinx.result.Result; import edu.cmu.sphinx.util.props.ConfigurationManager;

public class Speaking {

public static void main(String[] args) {


ConfigurationManager cm; String resultText=""; if (args.length > 0) { cm = new ConfigurationManager(args[0]); } else { cm = new ConfigurationManager(Speaking.class.getResource("speaking.config.xml")); }

Recognizer recognizer = (Recognizer) cm.lookup("recognizer"); recognizer.allocate();

Microphone microphone = (Microphone) cm.lookup("microphone"); if (!microphone.startRecording()) { System.out.println("Cannot start microphone."); recognizer.deallocate(); System.exit(1); }

while (true) {

Result result = recognizer.recognize();

if (result != null) { resultText = result.getBestFinalResultNoFiller(); System.out.println(resultText); ServletActionContext.getContext().getSession().put("y", resultText); } else { System.out.println("I can't hear what you said.\n"); } } } }

The lines below define the frequently tuned properties. They are located at the top of the configuration file so that they can be edited quickly.

<property name="logLevel" value="WARNING"/>

<property name="absoluteBeamWidth" value="-1"/> <property name="relativeBeamWidth" value="1E-80"/> <property name="wordInsertionProbability" value="1E-36"/> <property name="languageWeight" value="8"/>

<property name="frontend" value="epFrontEnd"/> <property name="recognizer" value="recognizer"/> <property name="showCreations" value="false"/> Recognizer

The lines below define the recognizer component that performs speech recognition. It defines the name and class of the recognizer, Recognizer. This is the class that any application should interact with. The javadoc of the Recognizer class has two properties, 'decoder' and 'monitors'. This configuration file is where the value of these properties are defined.

<component name="recognizer" type="edu.cmu.sphinx.recognizer.Recognizer"> <property name="decoder" value="decoder"/> <propertylist name="monitors"> <item>accuracyTracker </item> <item>speedTracker </item> <item>memoryTracker </item> </propertylist> </component>


The 'decoder' property of the recognizer is set to the component called 'decoder', which is defined as:

<component name="decoder" type="edu.cmu.sphinx.decoder.Decoder"> <property name="searchManager" value="searchManager"/> </component> The decoder component is of class edu.cmu.sphinx.decoder.Decoder. Its property 'searchManager' is set to the component 'searchManager', defined as:

<component name="searchManager" type=""> <property name="logMath" value="logMath"/> <property name="linguist" value="flatLinguist"/> <property name="pruner" value="trivialPruner"/> <property name="scorer" value="threadedScorer"/> <property name="activeListFactory" value="activeList"/> </component> The searchManager is of class This class performs a simple breadth-first search through the search graph during the decoding process to find the best path. This search manager is suitable for small to medium sized vocabulary decoding.

The logMath property is the log math that is used for calculation of scores during the search process. It is defined as having the log base of 1.0001. Note that typically the same log base should be used throughout all components, and therefore there should only be one logMath definition in a configuration file:

<component name="logMath" type="edu.cmu.sphinx.util.LogMath"> <property name="logBase" value="1.0001"/> <property name="useAddTable" value="true"/> </component>

The linguist of the searchManager is set to the component 'flatLinguist', which again is suitable for small to medium sized vocabulary decoding. The pruner is set to the 'trivialPruner':

<component name="trivialPruner" type="edu.cmu.sphinx.decoder.pruner.SimplePruner"/> which is of class edu.cmu.sphinx.decoder.pruner.SimplePruner. This pruner performs simple absolute beam and relative beam pruning based on the scores of the tokens.

The scorer of the searchManager is set to the component 'threadedScorer', which is of class edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer. It can use multiple threads (usually one per CPU) to score the tokens in the active list. Scoring is one of the most time-consuming step of the decoding process. Tokens can be scored independently of each other, so using multiple CPUs will definitely speed things up. The threadedScorer is defined as follows:

<component name="threadedScorer" type="edu.cmu.sphinx.decoder.scorer.ThreadedAcousticScorer"> <property name="frontend" value="${frontend}"/> <property name="isCpuRelative" value="true"/> <property name="numThreads" value="0"/> <property name="minScoreablesPerThread" value="10"/> <property name="scoreablesKeepFeature" value="true"/> </component> The 'frontend' property is the front end from which features are obtained.

Finally, the activeListFactory property of the searchManager is set to the component 'activeList', which is defined as follows:

<component name="activeList" type=""<


<property name="logMath" value="logMath"/< <property name="absoluteBeamWidth" value="${absoluteBeamWidth}"/< <property name="relativeBeamWidth" value="${relativeBeamWidth}"/< </component< It is of class It uses a partitioning algorithm to select the top N highest scoring tokens when performing absolute beam pruning.

The 'logMath' property specifies the logMath used for score calculation, which is the same LogMath used in the searchManager. The property 'absoluteBeamWidth' is set to the value given at the very top of the configuration file using ${absoluteBeamWidth}. The same is for ${relativeBeamWidth}.


The linguist is the component that generates the search graph using the guidance from the grammar, and knowledge from the dictionary, acoustic model, and language model.

<component name="flatLinguist" type="edu.cmu.sphinx.linguist.flat.FlatLinguist"> <property name="logMath" value="logMath"/> <property name="grammar" value="jsgfGrammar"/> <property name="acousticModel" value="wsj"/> <property name="wordInsertionProbability" value="${wordInsertionProbability}"/> <property name="languageWeight" value="${languageWeight}"/> </component>

It also uses the logMath that we've seen already. The grammar used is the component called 'jsgfGrammar', which is a BNF-style grammar:


<component name="jsgfGrammar" type="edu.cmu.sphinx.jsapi.JSGFGrammar"> <property name="grammarLocation" value="resource:/demo/sphinx/speaking/"/> <property name="dictionary" value="dictionary"/> <property name="grammarName" value="hello"/> <property name="logMath" value="logMath"/> </component> JSGF grammars are defined in JSAPI. The class that translates JSGF into a form that Sphinx-4 understands is edu.cmu.sphinx.jsapi.JSGFGrammar. Note that this link to the javadoc also describes the limitations of the current implementation).

The property 'grammarLocation' can take two kinds of values. If it is a URL, it specifies the URL of the directory where JSGF grammar files are to be found. Otherwise, it is interpreted as resource locator. The 'grammarName' property specifies the grammar to use when creating the search graph.

'logMath' is the same log math as the other components.

The 'dictionary' is the component that maps words to their phonemes. It is almost always the dictionary of the acoustic model, which lists all the words that were used to train the acoustic model:

<component name="dictionary" type="edu.cmu.sphinx.linguist.dictionary.FastDictionary"> <property name="dictionaryPath" value=

value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/cmudict.0.6d" /> <property name="fillerPath"

value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict"/> <property name="addSilEndingPronunciation" value="false"/> <property name="wordReplacement" value="<sil>"/>


</component> The locations of these dictionary files are specified using the Sphinx-4 resource mechanism. The dictionary for filler words like BREATH and LIP_SMACK is the file fillerdict.

For details about the other possible properties, please refer to the javadoc for FastDictionary.

Acoustic Model

The next important property of the flatLinguist is the acoustic model which describes sounds of the language. It is defined as:

<component name="dictionary" type="edu.cmu.sphinx.linguist.dictionary.FastDictionary"> <property name="dictionaryPath" value=

value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/cmudict.0.6d" /> <property name="fillerPath"

value="resource:/WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz/dict/fillerdict"/> <property name="addSilEndingPronunciation" value="false"/> <property name="wordReplacement" value="<sil>"/> </component> 'wsj' stands for the Wall Street Journal acoustic models.

Sphinx-4 can load acoustic models trained by Sphinxtrain. Common models are packed into JAR files during build and located in lib folder. Sphinx3Loader class is used to load them. The JAR needs to be included into classpath.


The JAR file for the WSJ models is called WSJ_8gau_13dCep_16k_40mel_130Hz_6800Hz.jar, and is in the sphinx4/lib directory.




BIBLIOGRAPHY BOOKS 1. Charles Hampfed(2000)Instant Java Server Pages University of Toranto 2. Herbert Schildt(2000) Java Complete Reference Tata McGrow Hill 3. Budi Kurniawan(2008)Struts 2:Design And Programming BPB Publications 4. Jamie Jaworsky J2EE Bible Techmedia 5. Oxford Brooks University HTML Primer


2. 3. 4. 5. 6. 7. 8.



Reserved Words Reserved words are words that can't be used as identifiers. Many of them are keywords that have a special purpose in Java. abstract catch double future instanceof operator return throw while boolean char else generic int outer short throws break class extends goto interface package static transient byte const final if long private super try byvalue continue finally case default float cast do for inner null rest

implements import native protected switch var new public

synchronized this void volatile

One of the goals of Java is code reusability. The library keeping function for code reuse is enabled through the use of packages of precompiled classes that can be imported into other projects. This allows developers to distribute their work as toolkits without distributing the source code and programmers to use these classes as easily as using those distributed in the developers kit. The package location's root is determined by an operating system environment variable called classpath. It can have multiple entries which are used in sequence as search paths. The first matching entry is used. As an example of a classpath that checks the current directory and if the file isn't there checks the bin folder of the installed distribution package: classpath=.;C:\Program Files\Java\jdk1.6.0_24\bin;


Java Beans
Java Beans are precompiled software components (ie building blocks) that have been designed to be reusable in a variety of different environments. All properties, events, and methods of a Bean that are exposed, can be controlled. Beans can be localized for global usage. Beans can exchange events with other Beans. Bean designers write classes conforming to a specific convention. Builder tools provide ways to create Beans, palettes of available Beans, worksheets for laying Beans in a GUI, editors to configure Beans, and commands to interconnect Beans to form an application, and checks for state and behaviour.