Wednesday, May 20, 2009

Java FX For All! - Experiences:

I also added JavaFX and J2ME Controller as part of
the Project.
To say truely,Learning and Programming Java FX IS SIMPLER,EASIER.
I request every one to do this!!!

Proposal Document

Proposal for the Code Java FX Contest

Title: Java™ FX for All

What is unique about this application?

The Java™ Media Framework does not support playing of videos with FLV Format. The Java FX Technology enables easy playing of FLV Videos. Also the application we have developed will enable vision challenged people to use it in an easy manner with out others help.

Which aspects of Java FX Technology are you going to use in your application?
We have used Java FX Media Player Component. The aspect we have used in our application is Graphics, Animations and Media.

Description:


After launching the application you will see you see a splash screen with some animated effects. Then you will see many applications embedded on a tab. We enable easy use of the system by the vision challenged people. This application we have chosen is suitable for all sorts of people. We may also make this application to speak aloud the contents in the web pages.

The Application first we have added in the tab is text to speech converter. This application conveys the messages from the system to Vision challenged people through Voice.

The Application will open the CD Tray with out touching the eject button on the CD Tray. We have used this under Windows Platform. If the application is required to be run under the Operating System other than windows we have to make a little change in this part.

The Application will have access to system resources (EX) Notepad in case of Windows Operating System. This application will create process automatically without human interface.

The application enables to display images either in local file system or in the web server.

Actually with notepad (Windows) we may create only text documents. In our application we have created a multi - pad that will create Text Documents, PDF – Portable Document Format Files, Audio Files (.wav, .mp3), Video Files (.mov), Image Files( JPEG,GIF,BMP).

Another application will simulate what the Print Screen button in our key board does. It will capture the entire desktop as image. Then with Key board we can control the mouse.

The application will get and set the Monitor Screen Attributes such as width, height, refresh rate etc.

The application we have designed will control the entire System (both hardware and software) with Voice. Based on the commands you speak in the microphone, appropriate applications will be launched.

At last we have designed an application that will collect the entire information about the Operating System under which the Java FX is currently running.

Java FX For All!!

Well, I was a Participant of the Code JavaFX Contest.
I would like to share some details about my Project.


The following was my Project Proposal:
Proposal for the Code Java FX Contest
Title: Java™ FX for All
What is unique about this application?

The Java™ Media Framework does not support playing of videos
with FLV Format.
The Java FX Technology enables easy playing of FLV Videos. Also the
application we have developed will enable vision challenged people to
use it in an easy manner with out others help.

Which aspects of Java FX Technology are you going to use in your application?

We have used Java FX Media Player Component. The aspect we
have used in our application is Graphics, Animations and Media.

Description:

After launching the application you will see you see a
splash screen with some animated effects. Then you will see many
applications embedded on a tab. We enable easy use of the system by
the vision challenged people. This application we have chosen is
suitable for all sorts of people. We may also make this application to
speak aloud the contents in the web pages.

The Application first we have added in the tab is text to
speech converter. This application conveys the messages from the
system to Vision challenged people through Voice.

The Application will open the CD Tray with out touching the
eject button on the CD Tray. We have used this under Windows Platform.
If the application is required to be run under the Operating System
other than windows we have to make a little change in this part.

The Application will have access to system resources (EX)
Notepad in case of Windows Operating System. This application will
create process automatically without human interface.

The application enables to display images either in local
file system or in the web server. Actually with notepad (Windows) we
may create only text documents. In our application we have created a
multi - pad that will create Text Documents, PDF – Portable Document
Format Files, Audio Files (.wav, .mp3), Video Files (.mov), Image
Files( JPEG,GIF,BMP).

Another application will simulate what the Print Screen
button in our key board does. It will capture the entire desktop as
image. Then with Key board we can control the mouse.The application
will get and set the Monitor Screen Attributes such as width, height,
refresh rate etc.

The application we have designed will control the entire
System (both hardware and software) with Voice. Based on the commands
you speak in the microphone, appropriate applications will be
launched.

At last we have designed an application that will
collect the entire information about the Operating System under which
the Java FX is currently running.

Wednesday, April 15, 2009

Sunday, March 8, 2009

Java Update Released!!

Want to use the power full open source Java ™ Technology?
Java update 12 for JDK Released.
Get it here http://www.java.sun.com/downloads
Java is Found every where..
In your Mobile Phones,PDA - Personal Digital Assistant, Blue Ray Disk, Computer...
Java™ Rocks!!
Can u imagine a world with out Java!!!
Never..
Thanks for James Gosling..
For giving this powerful Language....
A Special Dedication for James Gosling..

FireFox 2.0.4 Code

Are you a great admirer of Open Source.?
Want to see the Source Code of rocking Firefox?
Its Open Source!!!!
You Get it here
ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/2.0.0.4/source/firefox-2.0.0.4-source.tar.bz2

Java FX Released

Read latest Java™ FX updates here
http://www.javafx.com

FireFox 3.0.7

Firefox 3.0.7 Released!!!!!
Want to Download Firefox 3.0.7?
Get it here
http://www.mozilla.com/products/download.html?product=firefox-3.0.7&os=win&lang=en-US

Tuesday, January 13, 2009

Get AVG Here


http://software-files.download.com/sd/_0PHINY0qH88ez5vKKo-4S7vkon843Af2CWfRYKPz4Yi8oZAe2BvfIQtjD7HB5Odu5PEBHBxDV8IaIED14PKJZAC_IzYjtM4/software/10997344/10710160/3/avg_ipw_stf_en_8_229a1410.exe?lop=link&ptype=1901&ontid=2239&siteId=4&edId=3&spi=228c0fbe4600cef70879e15350ff1857&pid=10997344&psid=10710160

Get Java BioInformatics E Book Here

http://rapidshare.com/files/23711747/Java.for.Bioinformatics.and.Biomedical.Applications-0387372350.pdf

Get ASP.Net E Book Here.

http://free-file-hosting.info/showfile-113/ebook_asp_net_3_5_beginners_guide.zip

Get Professional ASP.NET 2.0 AJAX.chm here

http://download272.mediafire.com/dtvb0saxsl2g/etp4mxjmvdg/www.free-ebooks-download.org----Professional+ASP.NET+2.0+AJAX.chm

Know some basics about CDC..

Java Platform, Micro Edition and Standards

1. What is the Java Platform, Micro Edition (Java ME)?

The Java Platform, Micro Edition (Java ME) is the Java platform targeted at consumer electronics and embedded devices like wireless phones, pagers, personal digital assistants, camcorders, game devices, small retail payment terminals and smart cards.

2. What are the principal components of Java ME platform technology?

Java ME platform technology has three components which, taken together, form a compliant Java application environment:

* A Configuration is a combination of a Java virtual machine and a set of application support APIs that are shared across a class of devices.

* A Profile is a set of APIs (designed for a specific configuration) that address the needs of a narrower device category.

* An Optional Package is a set of technology-specific APIs that extends the capabilities of a Java application environment.

A Java ME-compliant Java application environment requires both a configuration and a profile. Optional Packages provide device designers and other JCP participants with a standards-based extension framework.

3. How are Java ME standards defined?

Java technology standards are developed through the Java Community Process (JCP) by expert groups drawn from several industries. In this way, industry participants help shape Java ME standards targeted for their markets. For more information on the Java Community Process, see http://java.sun.com/aboutJava/communityprocess/. Java ME technology is built around JSRs, reference implementations and technology compatibility kits.

4. What is a JSR?

Java technology standards are delivered as Java Specification Requests (JSRs). Expert groups propose, develop and ratify JSRs through the Java Community Process.

5. What is a reference implementation?

A reference implementation (RI) is a working demonstration of a JSR. RIs are developed and licensed by the JSR specification lead.

6. What is a technology compatibility kit?

A technology compatibility kit (TCK) is a test suite that verifies whether an implementation is compliant with a given JSR. TCKs are developed and licensed by the JSR specification lead.

Sales and Licensing

1. What is the licensing model for Java ME technology?

The CDC reference implementation source code is available free of charge for education and research purposes under the Sun Community Source License Agreement (SCSL). If you plan to ship a commercial product that leverages Sun's source code, or if you want to use one of the CDC technology compatibility kits developed by Sun, you must sign a commercial license agreement with Sun.

2. Does Sun license only reference implementations and TCKs?

Sun also licenses optimized implementations of various JSRs, as well as different optimized versions of CDC HotSpot Implementation.

3. How can I contact a Sun OEM software sales representative?

Sales and licensing information is available from Sun sales representatives. For more information, contact Sun Microsystems Software and Technology.

CDC Products

1. What is CDC?

The Connected Device Configuration is a standards-based framework for building and delivering mobile applications that can be shared across a range of network-connected personal mobile devices. Typically, these devices include a 32-bit microprocessor/controller and require about 2 MB of RAM and 2.5 MB of ROM for the Java application environment.

2. What is CDC HotSpot Implementation?

The Connected Device Configuration HotSpot Implementation (formerly CVM) is a Java virtual machine that is highly optimized for resource-constrained devices like consumer products and embedded devices. CDC HotSpot Implementation combines full Java 2 compatibility with excellent performance, reliability and a low memory footprint.

3. How many Java virtual machine implementations does Sun have?

As the leader in Java virtual machine technology, Sun has developed several Java virtual machine implementations for different product scenarios and continues to perform research and development in this area. The following Java virtual machine technology products share the HotSpot brand:

* Java HotSpot Server is designed for multi-processor enterprise server environments that require maximum program execution speed, 64-bit support and very large memory heaps.

* Java HotSpot Client is designed for single-processor desktop environments that require faster start-up time and a smaller memory footprint.

* CDC HotSpot Implementation (formerly CVM) is designed for resource-constrained devices like consumer products and embedded devices. Typically, these devices include a 32-bit microprocessor/controller and require about 2 MB of RAM and 2.5 MB of ROM for the Java application environment. CDC HotSpot Implementation has excellent performance and reliability for low-memory conditions. Its portability interfaces make it rapidly adaptable for the many different kinds of platforms in the consumer and embedded market.

* CLDC HotSpot Implementation (formerly Monty) is designed for very small memory scenarios, typically 128 KB to 512 KB for the Java application environment. CLDC HotSpot Implementation also includes a portability interface for supporting alternate CPUs and operating systems.

4. For what platforms are implementations available?

Sun has developed optimized versions of CDC and CDC HotSpot Implementation for the ARM, PowerPC, MIPS and SPARC CPU architectures and the Linux and Solaris operating systems. The Personal Basis Profile reference implementation includes a device-driver based portability interface that includes a sample port based on X11. The Personal Profile reference implementation includes a sample port based on the GTK+ 1.2 toolkit. Other ports of Personal Profile include the QT application framework.

5. What profiles are currently available for CDC?

CDC currently supports three profiles. Foundation Profile provides basic application support APIs without any additional support for GUIs. Personal Basis Profile includes all of the APIs contained in Foundation Profile and adds support for lightweight AWT GUI components and the xlet application model. Personal Profile includes all of the APIs contained in Personal Basis Profile and adds support for full AWT compatibility and the applet application model.

6. What optional packages are currently available for CDC?

CDC currently supports several optional packages, with more on the way. RMI Optional Package supports remote method invocation based on the Java ME java.rmi package. JDBC Optional Package provides a subset of the JDBC 3.0 API for accessing tabular data sources including spreadsheets, flat files and cross-DBMS connectivity to a wide range of SQL databases. Mobile Media Optional Package supports access to audio, video and other time-based multimedia services on resource-constrained devices and allows Java applications to access device-level multimedia services.

7. What is the difference between CDC and CLDC?

These two Java ME configurations are designed around different target device footprints. CLDC is designed for very small memory scenarios, typically 128 KB to 512 KB while CDC is designed for more moderate memory scenarios, typically 2 MB of RAM and 2.5 MB of ROM. As a result, the CLDC APIs are very compact and do not require Java SE compatibility. CDC is based on Java SE compatibility for both APIs and tools.

8. What is the migration path for the PersonalJava, EmbeddedJava and JavaOS technologies?

These technologies precede both Java SE and the JCP standards organization. Rather than retrofit them into the JCP process they are being replaced by new JCP standards. The migration path for these legacy technologies is with CDC and its profiles.

Developers

1. What are the differences between the CDC APIs and Java SE APIs?

Most of the core APIs are identical between CDC and J2SE 1.3.1. The main differences are in java.awt and the omission of javax.swing and other large packages like org.omg.*. See CDC API Comparison for a description of the relationship between the J2SE 1.3.1 APIs and the CDC APIs.

2. Can I migrate my code from Java SE to CDC?

Because CDC includes the core application support APIs from J2SE 1.3.1, migrating code from a Java SE application environment to a CDC application environment is straightforward.

3. What are the differences between the CDC APIs and CLDC APIs?

The CDC and CLDC APIs are very different. The CLDC APIs were designed around very small resource configurations and therefore do not require Java SE compatibility. The CDC APIs were designed around more moderate memory constraints and the need for Java SE compatibility for both APIs and tools.

4. Can I migrate my code from CLDC to CDC?

Yes. CDC is a superset of CLDC functionality.

5. Can I migrate my code from MIDP to CDC?

No. The MIDP GUI APIs are different. We are investigating a solution for this.

6. What are the graphical user-interface options for CDC?

The basic CDC profiles each offer different GUI options. Foundation Profile has no GUI support and can be used for "headless" device scenarios or for supporting a device with a proprietary GUI. Personal Basis Profile provides just enough AWT functionality to support lightweight components. Personal Profile supports full AWT and applet compatibility.

7. What is an xlet?

The xlet application programming model is very similar to the applet application programming model. Xlets are loaded into an xlet manager and controlled through a life cycle interface. This is similar to how an applet is loaded and run inside a browser. The main difference is that the xlet application programming model does not have implicit API requirements like java.applet which allows it to be used in a greater variety of product scenarios.

8. What is the security model for CDC?

CDC uses the same policy-based security model that Java SE provides. This gives an application fine-grained control over the access and use of its external interfaces.

9. Is CDC compatible with Java SE tools?

Yes. CDC supports Java SE-based compilers, debuggers and profilers.

Reference:http://java.sun.com/javame/technology/cdc/faqs.jsp

Monday, January 5, 2009

Magazine

Want to download the Computer magazine?
Get it here..
http://www522.megaupload.com/files/db86be88ac477ffd3888dbdfdefd37e7/MAGPcWdOc08.rar

Java ME

Want to download Java ME Emulator?
Get it here...

JavaMEEmulator

Java Tutorials

New To Java?
Want to be a Java Expert?
Go through the following website to master Java.
Work out the code samples given here..
www.java2s.com

RealPlayer

Want RealPlayer Gold?
Get it here...
http://download.softpedia.com/dl/24d7b3cf4af268c3b95abf73cef06bc5/495bfc04/100008186/software/multimedia/video/RealPlayer11GOLD.exe

CCleaner

Want to clear cache and fix
Registry Problems.
Get the CCleaner from the following link
ccleaner

Want To Download Internet Download Manager 5.15?

Internet Download Manager (IDM) is an easy to use tool to increase download speeds by up to 500 percent, resume and schedule downloads. According to the opinions of IDM users Internet Download Manager is a perfect accelerator program to download your favorite software, games, cd, dvd and mp3 music, movies, shareware and freeware programs much faster!

Internet Download Manager has wide customization capabilities, downloadable skins, visual XP styles, multilingual interface, and supports proxy servers, FTP, HTTP and HTTPS protocols, firewalls, file redirects, cookies, directories with authorization, ZIP preview, categories, MP3 audio and MPEG video content processing and a large number of server platforms. IDM integrates seamlessly into Microsoft Internet Explorer, Netscape, AOL, MSN Explorer, Opera, and Mozilla browsers to automatically handle your downloads. You can also drag and drop files or use Internet Download Manager from command line. Internet Download Manager can dial your modem at the set time, download the files you want, then hang up or even shut down your computer when it's done.

Get this from the following Link
IDM 5.15

Want to Download Latest Firefox 3 .0.5?

Click this link to download
Mozilla FireFox 3.0.5
Mozilla Firefox 3.0.5

Want To Download NetBeans 6.5 with JavaFX?

Click this link to download for
Windows XP

NetBeans 6.5 With JavaFX

Saturday, January 3, 2009

wireless Programming with JavA


http://ifile.it/vdgah9e/0672321351.rar

http://www.filefactory.com/file/449420/n/0672321351_rar

Security Issues with the Applet

Java applet is run inside a web browser. But an applet is restricted in some areas, until it has been deemed trustworthy by the end user. The security restriction is provided for protecting the user by malicious code, like copy important information from the hard disk or deleting the files. Generally, applets are loaded from the Internet and they are prevented from: the writing and reading the files on client side. Some security issues to applet are following :

* Applets are loaded over the internet and they are prevented to make open network connection to any computer, except for the host, which provided the .class file. Because the html page come from the host or the host specified codebase parameter in the applet tag, with codebase taking precedence.

* They are also prevented from starting other programs on the client. That means any applet, which you visited, cannot start any rogue process on you computer. In UNIX, applets cannot start any exec or fork processes. Applets are not allowed to invoke any program to list the contents of your file system that means it cant invoke System.exit() function to terminate you web browser. And they are not allowed to manipulate the threads outside the applets own thread group.

* Applets are loaded over the net. A web browser uses only one class loader that’s established at start up. Then the system class loader can not be overloaded, overridden, extended, replaced. Applet is not allowed to create the reference of their own class loader.

* They cant load the libraries or define the native method calls. But if it can define native method calls then that would give the applet direct access to underlying computer.

JSF Interview Questions - 1

1)What is JavaServer Faces?
JavaServer Faces (JSF) is a user interface (UI) framework for Java web applications. It is designed to significantly ease the burden of writing and maintaining applications that run on a Java application server and render their UIs back to a target client. JSF provides ease-of-use in the following ways:
Makes it easy to construct a UI from a set of reusable UI components
Simplifies migration of application data to and from the UI
Helps manage UI state across server requests
Provides a simple model for wiring client-generated events to server-side application code
Allows custom UI components to be easily built and re-used

Most importantly, JSF establishes standards which are designed to be leveraged by tools to provide a developer experience which is accessible to a wide variety of developer types, ranging from corporate developers to systems programmers. A "corporate developer" is characterized as an individual who is proficient in writing procedural code and business logic, but is not necessarily skilled in object-oriented programming. A "systems programmer" understands object-oriented fundamentals, including abstraction and designing for re-use. A corporate developer typically relies on tools for development, while a system programmer may define his or her tool as a text editor for writing code. Therefore, JSF is designed to be tooled, but also exposes the framework and programming model as APIs so that it can be used outside of tools, as is sometimes required by systems programmers.
2)How to pass a parameter to the JSF application using the URL string?
if you have the following URL: http://your_server/your_app/product.jsf?id=777, you access the passing parameter id with the following lines of java code:
FacesContext fc = FacesContext.getCurrentInstance();
String id = (String) fc.getExternalContext().getRequestParameterMap().get("id");
From the page, you can access the same parameter using the predefined variable with name param. For example,

Note: You have to call the jsf page directly and using the servlet mapping.

3)How to add context path to URL for outputLink?
Current JSF implementation does not add the context path for outputLink if the defined path starts with '/'. To correct this problem use #{facesContext.externalContext.requestContextPath} prefix at the beginning of the outputLink value attribute. For example:

4)How to get current page URL from backing bean?
You can get a reference to the HTTP request object via FacesContext like this:
FacesContext fc = FacesContext.getCurrentInstance();
HttpServletRequest request = (HttpServletRequest) fc.getExternalContext().getRequest(); and then use the normal request methods to obtain path information. Alternatively,
context.getViewRoot().getViewId();
will return you the name of the current JSP (JSF view IDs are basically just JSP path names).

5)How to access web.xml init parameters from java code?
You can get it using externalContext getInitParameter method. For example, if you have: connectionString jdbc:oracle:thin:scott/tiger@cartman:1521:O901DB
You can access this connection string with:
FacesContext fc = FacesContext.getCurrentInstance();
String connection = fc.getExternalContext().getInitParameter("connectionString");

6)How to access web.xml init parameters from jsp page?
You can get it using initParam pre-defined JSF EL valiable.
For example, if you have: productId 2004Q4
You can access this parameter with #{initParam['productId']} . For example:
Product Id:



7)How to terminate the session?
In order to terminate the session you can use session invalidate method.
This is an example how to terminate the session from the action method of a backing bean:
Public String logout() {
FacesContext fc = FacesContext.getCurrentInstance();
HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
session.invalidate();
return "login_page";
}
The following code snippet allows to terminate the session from the jsp page:
<% session.invalidate(); %>

8)How to implement "Please, Wait..." page?
The client-side solution might be very simple. You can wrap the jsp page (or part of it you want to hide) into the DIV, then you can add one more DIV that appears when user clicks the submit button. This DIV can contain the animated gif you speak about or any other content.
Scenario: when user clicks the button, the JavaScript function is called. This function hides the page and shows the "Wait" DIV. You can customize the look-n-fill with CSS if you like.

10)How to download PDF file with JSF?
This is an code example how it can be done with action listener of the backing bean.
Add the following method to the backing bean:
public void viewPdf(ActionEvent event) {
String filename = "filename.pdf";
// use your own method that reads file to the byte array
byte[] pdf = getTheContentOfTheFile(filename);
FacesContext faces = FacesContext.getCurrentInstance();
HttpServletResponse response = (HttpServletResponse) faces.getExternalContext().getResponse();
response.setContentType("application/pdf");
response.setContentLength(pdf.length);
response.setHeader( "Content-disposition", "inline; filename=\""+fileName+"\"");
try {
ServletOutputStream out;
out = response.getOutputStream();
out.write(pdf);
} catch (IOException e) {
e.printStackTrace();
}
faces.responseComplete();
}
This is a jsp file snippet:


JNI Interview Questions & Answers

1)How to debug JNI code in CVM?
Porting Guide for the CDC and the Foundation Profile from SUN has a chapter on "C Debugging with GDB".

2)How can I check the status of a java Thread using JVMDI?
// ThreadTool.java class ThreadTool { public static final int THREAD_STATUS_UNKNOWN = -1; public static final int THREAD_STATUS_ZOMBIE = 0; ...

3)Is there a COM Bridge that lets Windows developers create native client applications that access Enterprise JavaBeansTM (EJBTM) components deployed on a J2EE App server?
Yes. Take a look at: JavaTM 2 Platform, Enterprise Edition Client Access Services (J2EETM CAS) COM Bridge 1.0 Early Access.

4)What is necessary to have an applet call a native method? DLL installation, code signing, specific security permissions needed.
After more tries I solved the problem. I used your posted response about such a thing for Netscape. But was difficult to use that answer because Netscape...

5)JDK 1.4 has introduced the concept of direct buffers. Where can I get more information and/or samples for manipulating direct buffers?
JNI has been enhanced in v 1.4 to reflect a new feature of the java.nio package: direct buffers. The contents of a direct buffer can, potentially, reside...

6)What are the basic techniques for debugging mixed java and C++ code?
Debugging integrated Java and C/C++ code illustrates the two basic approaches using JNI (call C/C++ code from java, embed jvm in C/C++ code) and ways to...
EJB-JNI-Legacy Integration (C++ API) we have existing System in C++.We want to use Existing in the intranet/internet. We are using JNI to use existing System. And then we are calling JNI Classes in...
EJBs are supposed to be portable between different app servers who comply with the Sun's specifications for compliant EJB containers. Because of this reason,

7)Anyone know of a way of marking a Java thread as being a demon if it was "created" through the JNI AttachCurrentThread call?
Through a new method called AttachCurrentThreadAsDaemon.

8)What is Signal Chaining mechanism that has been implemented in JDK 1.4?
Signal-chaining enables the Java Platform to better interoperate with native code that installs its own signal handlers. The facility works on both Solaris and Linux platforms.

The signal-chaining facility was introduced to remedy a problem with signal handling in previous versions of the Java Hotspot VM. Prior to version 1.4, the Java Hotspot VM would not allow application-installed signal handlers for certain signals including, for example, SIGBUS, SIGSEGV, SIGILL, etc, since those signal handlers could conflict with the signal handlers used internally by the Java Hotspot VM.
The signal-chaining facility offers:
A. Support for pre-installed signal handlers when the Hotspot VM is created.
B. Support for signal handler installation after the Hotspot VM is created, inside JNI code or from another native thread.

Pre-installed signal handlers (A) are supported by means of saving existing signal handlers, for signals that are used by the VM, when the VM is first created. Later, when any of these signals are raised and found not to be targeted at the Java Hotspot VM, the pre-installed handlers are invoked. In other words, pre-installed handlers are "chained" behind the VM handlers for these signals.

9)Is there a TCL-Java Bridge?
Yes, The Tcl/Java project currently has two packages, Jacl and Tcl Blend. Jacl, which stands for Java Command Language, is a Java implementation of Tcl..

PHP – Variables

If you have never had any programming, Algebra, or scripting experience, then the concept of variables might be a new concept to you. A detailed explanation of variables is beyond the scope of this tutorial, but we've included a refresher crash course to guide you.


A variable is a means of storing a value, such as text string "Hello World!" or the integer value 4. A variable can then be reused throughout your code, instead of having to type out the actual value over and over again. In PHP you define a variable with the following form:



$variable_name = Value;

If you forget that dollar sign at the beginning, it will not work. This is a common mistake for new PHP programmers!



Note: Also, variable names are case-sensitive, so use the exact same capitalization when using a variable. The variables $a_number and $A_number are different variables in PHP's eyes.




A Quick Variable Example




Say that we wanted to store the values that we talked about in the above paragraph. How would we go about doing this? We would first want to make a variable name and then set that equal to the value we want. See our example below for the correct way to do this.



PHP Code:









Note for programmers: PHP does not require variables to be declared before being initialized.


PHP Variable Naming Conventions



There are a few rules that you need to follow when choosing a name for your PHP variables.



PHP variables must start with a letter or underscore "_".

PHP variables may only be comprised of alpha-numeric characters and underscores. a-z, A-Z, 0-9, or _ .

Variables with more than one word should be separated with underscores. $my_variable

Variables with more than one word can also be distinguished with capitalization. $myVariable


PHP – Echo



As you saw in the previous lesson, the PHP command echo is a means of outputting text to the web browser. Throughout your PHP career you will be using the echo command more than any other. So let's give it a solid perusal!


Outputting a String



To output a string, like we have done in previous lessons, use PHP echo. You can place either a string variable or you can use quotes, like we do below, to create a string that the echo function will output.



PHP Code:

I love using PHP!";

?>



Display:



Hello!

I love using PHP!

In the above example we output "Hello!" without a hitch. The text we are outputting is being sent to the user in the form of a web page, so it is important that we use proper HTML syntax!



In our second echo statement we use echo to write a valid Header 5 HTML statement. To do this we simply put the
at the beginning of the string and closed it at the end of the string. Just because you're using PHP to make web pages does not mean you can forget about HTML syntax!


Careful When Echoing Quotes!



It is pretty cool that you can output HTML with PHP. However, you must be careful when using HTML code or any other string that includes quotes! Echo uses quotes to define the beginning and end of the string, so you must use one of the following tactics if your string contains quotations:


Don't use quotes inside your string

Escape your quotes that are within the string with a backslash. To escape a quote just place a backslash directly before the quotation mark, i.e. \"

Use single quotes (apostrophes) for quotes inside your string.

See our example below for the right and wrong use of echo:



PHP Code:

I love using PHP!
";



// OK because we escaped the quotes!

echo "
I love using PHP!
";



// OK because we used an apostrophe '

echo "
I love using PHP!
";

?>



If you want to output a string that includes quotations, either use an apostrophe ( ' ) or escape the quotations by placing a backslash in front of it ( \" ). The backslash will tell PHP that you want the quotation to be used within the string and NOT to be used to end echo's string.


Echoing Variables


Echoing variables is very easy. The PHP developers put in some extra work to make the common task of echoing all variables nearly foolproof! No quotations are required, even if the variable does not hold a string. Below is the correct format for echoing a variable.



PHP Code:





Display:

Hello Bob. My name is: 4a

Echoing Variables and Text Strings

You can also place variables inside of double-quoted strings (e.g. "string here and a $variable"). By putting a variable inside the quotes (" ") you are telling PHP that you want it to grab the string value of that variable and use it in the string. The example below shows an example of this cool feature.



PHP Code:

";

echo "Hi, I'm Bob. Who are you? $my_string
";

echo "Hi, I'm Bob. Who are you? $my_string Bobetta";

?>



Display:



Hello Bob. My name is: Bobetta

Hi, I'm Bob. Who are you? Hello Bob. My name is:

Hi, I'm Bob. Who are you? Hello Bob. My name is: Bobetta



By placing variables inside a string you can save yourself some time and make your code easier to read, though it does take some getting used to. Remember to use double-quotes, single-quotes will not grab the value of the string. Single-quotes will just output the variable name to the string, like )$my_string), rather than (Hello Bob. My name is: ).


PHP Echo - Not a Function




Echo is not a function, rather it is a language construct. When you use functions in PHP, they have a very particular form, which we will be going over later. For now, just know that echo is a special tool that you'll come to know and love!

Java Reporting Made Easy

Overview

ReportMill is the best Java application reporting tool available for dynamically generating reports and web pages from Java applications in formats such as PDF, HTML, Flash, Excel and more. ReportMill combines an easy-to-use page layout application and a powerful Java API in a single compact jar file, which is remarkably easy to integrate into your custom Java application.

Embedded Reporting

Running as Java code inside your application, ReportMill seamlessly harvests data directly from any Java dataset, whether EJBs, POJOs (Plain Old Java Objects), Java Collection classes, JDBC ResultSets or any combination of these. This is much more efficient than traditional reporting tools, which often require developers to repackage existing Java datasets as the original SQL query, then force a redundant refetch and some potentially risky inter-process communication.

This architecture also provides unique access to custom business logic found in the developer's object model, providing a significant savings by reusing this code instead of forcing a rewrite in proprietary template macro languages.

Powerful Design Application
ReportMill is the only reporting tool built on top of a comprehensive page layout application . This ensures that almost any page or report design can be accommodated and also makes template design more intuitive for anyone who has made a newsletter or "For Sale" sign in any of the popular page layout applications.

Downlaod The ReportMill

http://reportmill.com/product/


Simple API


Most developers need to call only three lines of ReportMill API. Since ReportMill harvests data from any Java dataset using reflection and common collections interfaces, there is no need to write any binding/feeder code, implement any interfaces or create any datasource objects.

Online Aptitude Tests

1) Which of the following countries has launched the solar observation satellite solar-B ?



1) Japan

2) China

3) Russia

4) USA



2) A Great way to fly is the media campaign of which of the following airlines?



1) Lufthansa

2) Fly Emirates

3) Jet Airways

4) Singapore Airlines



3) Who among the following is the author as the book mein kampf?



1) Rudyard Kipling

2) Adolf Hitler

3) Arnold Toynbee

4) Charles Dickens



4) Who among the following were the founders of the Vijayanagar empire?



1) Krishna Deva Raja

2) Saluva Narsimha

3) Deva Raja II

4) Harihara and Bukka



5) What is the correct expansion of the abbreviation NASA?




1) National Aeronautical Science Association

2) New Aeronautical and Science Agency

3) National Aeronautics and space Administration

4) None of these



6) At which of the following places on the globe has the highest temperature been recorded?




1) Al Azizyah

2) Jacobabad

3) Cairo

4) None of these



7) The Indio constitution is divided into how many parts?




1) Twenty-Two

2) Twenty

3) Eighteen

4) Sixteen



8) The first five year plan of India started in




1) 1952-53

2) 1951-52

3) 1956-57

4) 1948-49



9) The first Indian woman president of the Indian National Congress was



1) Sarojini Naidu

2) Nellie Sengupta

3) Annie Besant

4) Aruna Asaf Ali



10) The first bowler to take all the 10 wickets in a test innings was



1) Anil Kumble

2) Richard Hadlee

3) Jim Laker

4) Shane Warne



11) The first Indian tennis player to win a Grand Slam event



1) Ramanathan Krishanan

2) Mahesh Bhupati

3) Ramesh Krishanan

4) Leander paes



12) The first train in India from Bombay to Thane ran in




1) 1857

2) 1855

3) 1860

4) 1853



13) How many PIN code zone are there in India?




1) 7

2) 9

3) 8

4) 6



14) The film DON is a remake of an old film of the same name. Who is the director of the present DON?



1) Shahrukh Khan

2) Rakesh Mehra

3) Ram Gopal Verma

4) Farhan Akhtar



15) The new Chief Minister of the Jharkhand is



1) Arjun Munda

2) Madhu Koda

3) Shibu Soren

4) None of these





Ans:
1) 1 2) 4 3) 2 4) 4 5) 3
6) 1 7) 1 8) 2 9) 1 10) 3

11) 1 12) 4 13) 3 14) 4 15) 2

Hibernate Interview Questions

1.What is Hibernate?
Hibernate is a powerful, high performance object/relational persistence and query service. This lets the users to develop persistent classes following object-oriented principles such as association, inheritance, polymorphism, composition, and collections.

2.What is ORM?
ORM stands for Object/Relational mapping. It is the programmed and translucent perseverance of objects in a Java application in to the tables of a relational database using the metadata that describes the mapping between the objects and the database. It works by transforming the data from one representation to another.

3.What does an ORM solution comprises of?
It should have an API for performing basic CRUD (Create, Read, Update, Delete) operations on objects of persistent classes
Should have a language or an API for specifying queries that refer to the classes and the properties of classes
An ability for specifying mapping metadata
It should have a technique for ORM implementation to interact with transactional objects to perform dirty checking, lazy association fetching, and other optimization functions

4.What are the different levels of ORM quality?


There are four levels defined for ORM quality.

Pure relational

Light object mapping

Medium object mapping

Full object mapping

5.What is a pure relational ORM?

The entire application, including the user interface, is designed around the relational model and SQL-based relational operations.

6.What is a meant by light object mapping?

The entities are represented as classes that are mapped manually to the relational tables. The code is hidden from the business logic using specific design patterns. This approach is successful for applications with a less number of entities, or applications with common, metadata-driven data models. This approach is most known to all.

7.What is a meant by medium object mapping?

The application is designed around an object model. The SQL code is generated at build time. And the associations between objects are supported by the persistence mechanism, and queries are specified using an object-oriented expression language. This is best suited for medium-sized applications with some complex transactions. Used when the mapping exceeds 25 different database products at a time.

8.What is meant by full object mapping?
Full object mapping supports sophisticated object modeling: composition, inheritance, polymorphism and persistence. The persistence layer implements transparent persistence; persistent classes do not inherit any special base class or have to implement a special interface. Efficient fetching strategies and caching strategies are implemented transparently to the application.

9.What are the benefits of ORM and Hibernate?

There are many benefits from these. Out of which the following are the most important one.
Productivity – Hibernate reduces the burden of developer by providing much of the functionality and let the developer to concentrate on business logic.

Maintainability – As hibernate provides most of the functionality, the LOC for the application will be reduced and it is easy to maintain. By automated object/relational persistence it even reduces the LOC.

Performance – Hand-coded persistence provided greater performance than automated one. But this is not true all the times. But in hibernate, it provides more optimization that works all the time there by increasing the performance. If it is automated persistence then it still increases the performance.

Vendor independence – Irrespective of the different types of databases that are there, hibernate provides a much easier way to develop a cross platform application.

10.How does hibernate code looks like?

Session session = getSessionFactory().openSession();
Transaction tx = session.beginTransaction();
MyPersistanceClass mpc = new MyPersistanceClass ("Sample App");
session.save(mpc);
tx.commit();
session.close();

The Session and Transaction are the interfaces provided by hibernate. There are many other interfaces besides this.

JMS Questions & Answers

1.What are the advantages of JMS?

JMS is asynchronous in nature. Thus not all the pieces need to be up all the time for the application to function as a whole. Even if the receiver is down the MOM will store the messages on it's behalf and will send them once it comes back up.



2.What is the difference between topic and queue?

A topic is typically used for one to many messaging i.e. it supports publish subscribe model of messaging. While queue is used for one-to-one messaging i.e. it supports Point-to-Point Messaging.



3.What is the use of Message object?

Message is a lightweight message having only header and properties and no payload.



4.What are the two different types of messaging models that are supported by JMS?

1. Point-to-Point
2. Publish and Subscribe.


5.What information is stored in the Header of a ‘Message’?

Message identification and routing information.



6.What are the types of acknowledgments?

1) Acknowledgment by commits. – Acknowledgement happens automatically when a transaction is committed.

2) Session.AUTO_ACKNOWLEDGE

3) Session.CLIENT_ACKNOWLEDGE – client must call the acknowledge( ) method

4) Session.DUPS_OK_ACKNOWLEDGE –Session acknowledges the message after it has been delivered. This may result in the delivery of some duplicate messages if the JMS provider fails.



7.What happens to messages if a transaction is rolled back?


All consumed messages are re-delivered.



8.What is text message?

Text messages contain String messages. It is useful for exchanging textual data and complex character data like XML.



9.What is the Role of the JMS Provider?


The JMS provider handles security of the messages, data conversion and the client triggering. The JMS provider specifies the level of encryption and the security level of the message, the best data type for the non-JMS client.



10.What are the advantages of JMS?


One of the principal advantages of JMS messaging is that it's asynchronous. Thus not all the pieces need to be up all the time for the application to function as a whole.