Open Source Technical Information: March 2012

Thursday 8 March 2012

Download pdf of Book of JAVA written by James Gosling

,

 About James Gosling

James Gosling

Born May 19, 1955 (age 56)
near Calgary, Alberta, Canada
Residence San Francisco Bay Area, California, United States
Nationality Canada
Alma mater Carnegie Mellon University, University of Calgary
Occupation Computer Scientist
Employer Liquid Robotics [1]
Known for Java programming language
Awards Officer of the Order of Canada
Website
James Gosling's weblog
James A. Gosling, OC (born May 19, 1955 near Calgary, Alberta, Canada) is a computer scientist, best known as the father of the Java programming language.


Books

  • Ken Arnold, James Gosling, David Holmes, The Java Programming Language, Fourth Edition, Addison-Wesley Professional, 2005, ISBN 0-321-34980-6
  • James Gosling, Bill Joy, Guy L. Steele Jr., Gilad Bracha, The Java Language Specification, Third Edition, Addison-Wesley Professional, 2005, ISBN 0-321-24678-0
  • Ken Arnold, James Gosling, David Holmes, The Java Programming Language, Third Edition, Addison-Wesley Professional, 2000, ISBN 0-201-70433-1
  • James Gosling, Bill Joy, Guy L. Steele Jr., Gilad Bracha, The Java Language Specification, Second Edition, Addison-Wesley, 2000, ISBN 0-201-31008-2
  • Gregory Bollella (Editor), Benjamin Brosgol, James Gosling, Peter Dibble, Steve Furr, David Hardin, Mark Turnbull, The Real-Time Specification for Java, Addison Wesley Longman, 2000, ISBN 0-201-70323-8
  • Ken Arnold, James Gosling, The Java programming language Second Edition, Addison-Wesley, 1997, ISBN 0-201-31006-6
  • Ken Arnold, James Gosling, The Java programming language, Addison-Wesley, 1996, ISBN 0-201-63455-4
  • James Gosling, Bill Joy, Guy L. Steele Jr., The Java Language Specification, Addison Wesley Publishing Company, 1996, ISBN 0-201-63451-1
  • James Gosling, Frank Yellin, The Java Team, The Java Application Programming Interface, Volume 2: Window Toolkit and Applets, Addison-Wesley, 1996, ISBN 0-201-63459-7
  • James Gosling, Frank Yellin, The Java Team, The Java Application Programming Interface, Volume 1: Core Packages, Addison-Wesley, 1996, ISBN 0-201-63453-8
  • James Gosling, Henry McGilton, The Java language Environment: A white paper, Sun Microsystems, 1996
  • James Gosling, David S. H. Rosenthal, Michelle J. Arden, The NeWS Book : An Introduction to the Network/Extensible Window System (Sun Technical Reference Library), Springer, 1989, ISBN 0-387-96915-2

 Download Books From Here : Click here to download

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Download PDF of c++ By Bjarne Stroustrup | c++ bjarne stroustrup.pdf | Pdf of C++ book written by Bjarne Stroustrup | Bjarne Stroustrup C++ Third Edition

,
Download PDF of C++ By Bjarne Stroustrup | c++ bjarne stroustrup.pdf | Pdf of C++ book written by Bjarne Stroustrup | Bjarne  Stroustrup C++ Third Edition





The C++ Programming Language
(Third Edition and Special Edition)

Addison-Wesley, ISBN 0-201-88954-4 and 0-201-70073-5.


Modified September 8, 2004
The "special edition" is the hardcover version of the 3rd edition. It differs from the early printings of the 3rd edition by about 1,000 corrections and clarifications, by two new appendices (just over 100 pages; also available online, see below), and by an improved index. The only difference between the current printings of the special edition and the 3rd edition is the cover (and the price difference implied by that stronger cover). See also my FAQ.

Advice of the day
(from TC++PL)

B.4[12] If older code tests the result of new against 0, it must be modified to catch bad_alloc or to use new(nothrow); secB.3.4.


Quote

Chapter 17: "Now is a good time to put your work on a firm theoretical foundation" -- Sam Morgan
Here is
See also a note about the structure, contents, and aims of this book. For solutions to selected exercises see David Vandevoorde: C++ Solutions Addison-Wesley Longman ISBN 0-201-30965-3. Reviews and code can be found at David's site.
Some of my interviews answer questions about my books.
For translations, see my publication list and my cover gallery.



Back Cover text:

More than a quarter of million programmers have benefited from this book in all of its editions. Written by Bjarne Stroustrup, the creator of C++, this is the world's most trusted and widely read book on C++.
For this special hardcover edition, two new appendices on locales and standard library exception safety have been added. The result is complete, authoritative coverage of the C++ language, its standard library, and key design techniques. Basd on the ANSI/ISO C++ standard, The C++ Programming Language provides current and comprehensive coverage of all C++ language features and standard library components.
For example:
  • abstract classes as interfaces
  • class hierarchies for object-oriented programming
  • templates as the basis for type safe generic software
  • exceptions for regular error handling
  • namespaces for modularity in large-scale software
  • run-time type identification for loosely-coupled systems
  • the C subset of C++ for C compatibility and systems-level work
  • standard containers and algorithms
  • standard strings, I/O streams, and numerics
Bjarne Stroustrup makes C++ even more accessible to those new to the language, while adding advanced information and techniques that even expert C++ programmers will find invaluable. A web page to support the book can be found at http://www.aw.com/csen
Bjarne Stroustrup is the designer and original implementor of C++ and the author of The C++ Programming Language ( first edition 1985, second edition 1991 ), The Annotated C++ Reference Manual, and The Design and Evolution of C++. A graduate of the University of Aarhus, Denmark, and Cambridge University, England, Dr. Stroustrup is currently the head of AT&T Labs' Large-scale Programming Research Department, an AT&T Fellow, an AT&T Bell Laboratories Fellow, and an ACM Fellow. His research interests include distributed systems, operating systems, simulation, and programming. He is editor of Addison-Wesley's C++ In-Depth Series.



Reviews:



Peter Salus in ;login: October 1997: Unlike those annoying volumes whose pages are filled with screendumps, this is full of real information. Bjarne has done a splendid job in this total rewrite of his important work.

Mini review by Francis Glassborow (Editor of C Vu (Journal of the Association of C and C++ users), September 1997: Do not be deceived, this is a new book reusing an old title. It took three years to write and was critiqued by 12 technical reviewers and the author took every one of their comments seriously. That is what it takes to write a good programming book (and even so some errors got missed). ... I will go out on a limb and declare that if you have not read this book at least once during the next twelve months you are not a C++ programmer whatever you may think. As always, you will only get full benefit from your reading by thinking about what you read.



 Download book PDF From Here
Mirror 3
Purchase Online Price: $59.99 & this item ships for FREE with Super Saver Shipping


If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Tuesday 6 March 2012

Build your own Linux based graphics workstation

,
Workstation. It’s a term in the IT industry that either gets you very excited because of the sheer performance of such systems due to the hardware associated with a workstation. Or on the other hand, the term may scare the hell out of you because workstations usually cost many thousands of dollars.
More so than an everyday desktop system designed for checking your email. Workstations are specially designed and built systems set for a specific task. The graphics and animation industry is a prime example of what workstations are used for. And that’s what we’re going to do today in this article. I’m going to show you that you can put together a Linux based workstation designed for graphics based tasks that can easily rival that of commercial workstation systems.

 Recommended hardware extras

 Dual LCD displays

Software requirements

  1.  Ubuntu 10.04.4 LTS
  2. GIMP
  3. Inkscape
  4. Dia
  5. Blender
  6. Abiword
  7. Gnumeric
Operating system: Ubuntu 10.04.4 LTS
 I’ve chosen to recommend Ubuntu 10.04.4 for our graphics workstation primarily for the fact that it has great support right through to 2015 as it is a long term support release. And also, because it still uses to Gnome 2.x base for the graphical interface. Which is a very capable graphical interface. And especially suited to the tasks required by running graphical software on a workstation. Probably more-so than Unity or Gnome 3.
 All the software below should be in the default Ubuntu repositories. So no extra tweaks or modifications are necessary other than the installation of the mentioned packages. Which can all be installed with one easy command:
 sudo apt-get install gimp inkscape dia blender abiword gnumeric
 Or if you wish, you can install each package individually.

 - GIMP

 GIMP is an absolute essential piece of software for anyone interested in image editing or design. With a large variety of functions to suit amateurs and enthusiasts right through to professionals. it features awesome file support too. GIMP is the first piece of software that you need to be installing.

 - Inkscape

The complement GIMP, you need Inkscape. Inkscape is a vector image designer and editor. And regarding its functions, it is the closet software on Linux that you’ll find to CorelDraw and Adobe Illustrator. Inkscape is similar to GIMP in a sense that it does take some getting used to. Especially for users migrating over from standard commercial Windows applications. But once you get used to Inkscape, you’ll soon realize that it does everything required, plus more if you really get involved, to very professional standards.

- Dia

 Diais a neat little package that differentiates itself from both GIMP and Inkscape. Dia is designed for diagram and layout creation. Dia is very
 simple to use yet so powerful, at the same time. Once you’ve used Dia for the design and layout of your projects, you’ll never use another
package again. Definitely one of my favorites!

 - Blender

 Blender is an awesome package to say the least. And out of all the packages on the workstation, Blender is easily the most powerful, yet demanding of them all. It is powerful in a sense that it can easily compete with any commercial grade 3D creation software, which usually costs many thousands of dollars alone, on top of the cost of the workstation hardware and system itself.

 The extras: Abiword and Gnumeric

 The last two packages really are not necessary for your workstation but may come in handy. And almost an essential for any modern system, regardless of its primary purpose. Abiword for word processing and Gnumeric to handle your spreadsheet requirements.
 Once you add Abiword and Gnumeric, your workstation is ready. So go and get creative and enjoy the awesome benefits and raw processing power of what can be done on a Linux based workstation and potentially saving you thousands of dollars in the process.


If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Coverflow ALT-TAB- A nice extension for Cinnamon

,

Coverflow ALT-TAB is a great  extension for cinnamon that  let’s you Alt-Tab through your windows in a cover-flow manner.

Installation of Coverflow extension:

1- Download coverflow extension from this link
2- Extract the extension to your desktop and copy it to  ~.local/share/cinnamon/extensions , ~.local is a hidden folder in your home directory, unhide folders before to copy.


You can do that also by command line, first extract the file and copy it to ~.local folder:
cp -r CoverflowAltTab@dmo60.de ~.local/share/cinnamon/extensions
3- When installed, go to cinnamon settings ( Menu–>Preferences–> Cinnamon settings)and activate the extension


Then activate the extension:
 

4- Now restart cinnamon, ALT + F2 and type r.
Now use the extension by pressing ALT+TAB
That`s all.

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

XBMC 11 Eden RC1 has been released! PPA UBUNTU

,

XBMC 11 Eden RC1 has been released! PPA UBUNTU



XBMC 11 Eden RC1 has been released, this beta release comes 3 weeks after Beta3 release. According to the announcement, this release comes with a number of updated XBMC translations for final release, resolved a number of outstanding Airplay issues,  allowed specified movie sets to be sorted by title, rather than year, without changing the default sort order on other sets and added a  useful feature of IP weather look up.
For the complete change, check this link 

Installation in Ubuntu and LinuxMint:

For Installation of XBMC 11 Eden RC1 in Ubuntu and LinuxMint, you need to use this unstable PPA:
sudo add-apt-repository ppa:team-xbmc/unstable
sudo apt-get update
sudo apt-get install xbmc
For other LinuxDistro, download the package from this link


If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

How to Backup and Restore MySQL Database on Fedora16, Centos and Redhat

,

The mysqldump client is a backup program originally written by Igor Romanenko. It can be used to dump a database or a collection of databases for backup or transfer to another SQL server (not necessarily a MySQL server). The dump typically contains SQL statements to create the table, populate it, or both. However, mysqldump can also be used to generate files in CSV, other delimited text, or XML format.

 Mysql-server info
Source RPM  : mysql-5.5.20-1.fc16.src.rpm
 Build Date  : Fri 27 Jan 2012 09:17:21 AM CET
 Build Host  : x86-04.phx2.fedoraproject.org
 Relocations : (not relocatable)
 Packager    : Fedora Project
 Vendor      : Fedora Project
 URL         : http://www.mysql.com
 Summary     : The MySQL server and related files

1- Start  mysql  server

[pirat9@Fedora16 ~]$ sudo service mysqld   start
Connect  to the  Server   with
[pirat9@Fedora16 ~]$ mysql -u root -p
Output
 Enter password:
 Welcome to the MySQL monitor.  Commands end with ; or \g.
 Your MySQL connection id is 2
 Server version: 5.5.20 MySQL Community Server (GPL)
Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
 affiliates. Other names may be trademarks of their respective
 owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql>

2- Create new database

In my case i created a new database called unixmen
mysql> create database unixmen;
Query OK, 1 row affected (0.00 sec)
-Show databases with
mysql> show databases;
 +--------------------+
 | Database           |
 +--------------------+
 | information_schema |
 | mysql              |
 | performance_schema |
 | test               |
 | test1              |
 | unixmen            |
 +--------------------+
 6 rows in set (0.00 sec)
mysql>

3- Backup  mysql database

Backup MySQL database to <databasebackupfiles>.sql
<databasename> = Target existing database name
<databasebackupfiles> = Preferred backed up file name
# mysqldump -u root -p <databasename> > <databasebackupfiles>.sql
 Enter password: <Type your mysql password and press enter
i will back up the database named <unixmen> to mylbackup file. This will taking backed up all the tables including the data :
# mysqldump -u root -p unixmen > backup.sql
 Enter password:
 View the content on mysqlbackup.sql
more mysqlbackup.sql

4- Restore MySQL database

To restore the backed up database named “mbackup.sql” to new database named “new” as below :
# mysql -u root -p <mysqlpassword> <databasename> < <databasebackupfiles>.sql
<mysqlpassword> = MySQL password
<databasename> = Database name that will be restore
<databasebackupfiles> = Backed up database file, normally .sql file
Create the new database mysqlnew :
mysql> CREATE DATABASE mysqlnew;
 Query OK, 1 row affected (0.01 sec)
As example, i will restore the mysqlbackup.sql backed up file to database named “new” :
# mysql -u root -p password new < mysqlbackup.sql
or
mysql -u root -p new < mysqlbackup.sql

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Ubuntu 12.04 LTS Precise Pangolin Beta1 has been released! News & Screenshots Tour

,
Ubuntu 12.04 LTS Precise Pangolin Beta1 has been released! News & Screenshots Tour
It’s time to take another look at what is happening with the development of Ubuntu 12.04. As it stands, the first Beta of Ubuntu 12.04 LTS Precise Pangolin has been released (Official Announcement), there is still no official announcement yet (Beta1 iso  has been uploaded). I just updated my own system.

Download Ubuntu 12.04 LTS Precise Pangolin Beta1  

What changed since Alpha?  Not much, really. In fact, there’s really nothing groundbreaking or any new features added. Unity has been updated to version 5.4.0 which also sees the introduction of the new HUD feature. HUD still apparently has many outstanding bugs, but developers maintain that all bugs will be ironed out before Ubuntu 12.04 goes gold. also added recommendations to Ubuntu software center,  new tool called “privacy”and other small new features.
There’s also the usual software package updates. For example, Chromium Browser has been updated to 17.0, Firefox has been updated to 11.0 and VLC has been updated to the new 2.0.0 version, containing the much touted interface changes. And a nice update for VLC it is.
The user-interface has also been frozen. So you’re going to see no changes from now on through to final release. Not that any are required. I think the default Unity interface is just fine. And once HUD is introduced with the new Unity update, it should theoretically make it even better than what we currently have.
As a side note; I’ve noticed very fast download speeds from the Ubuntu 12.04 repositories in comparison to previous Ubuntu releases. And especially in comparison to the 10.04 repositories, which I also use as my primary operating system. I have no idea whether this improvement has been intentional from Canonical, because I can’t seem to find any relevant information related to the topic. But a lot also depends on where your source mirror is pointing to. Perhaps there’s been an improvement somewhere in between.
And in the mean time, upgrade your own system for the latest changes and let us know what you think. Or if you haven’t already got Ubuntu 12.04 installed, now is a good chance to test it out. But as always, please use it with caution and only for non-critical tasks as it is still under development.
Some visual changes with Screenshots by M. Zinoune
- The Ubuntu button now has quicklists with nice look
- HUD is now default in Ubuntu 12.04 Precise Pangolin
- Added new tool called privacy
- The volume bar got a new look , and  Rhythmbox has replaced banshee as a default player in Ubuntu 12.04
- Added recommendation to Ubuntu software center: When turned on, USC will put applications related to our preferences  at the bottom.
More screenshots :
- Default applications

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Why GIMP wins over Photoshop

,
GIMP (GNU Image Manipulation Program) is an iconic example of successful free software for image management in the age of Digital Photography. Thanks largely to some advanced software such as GIMP and some proprietary photo imaging software such as Photoshop – creating and editing photos, artwork – is now not just for professionals and Film Studios but for personal use as well.
Though there is a sizeable market for Photoshop, at the heart of digital photos industry are experts who swear by the scope and wide-ranging flexibility GIMP offers them. Be it filters that allow them to start artwork from scratch, GIMP to many users, is more than an ‘image manipulation’ tool. Because, if the need arises all it takes are personalized scripts that can render the desired effect professionals are aiming for- Versatility remains GIMP’s core feature.

Add to it high-performance features such as better gradient tool, an expert lasso tool and definitely a better ink tool; Drag handles for both rectangle /ellipse select tools, and you have all the right function-features that are not so comfortable to use on Photoshop. GIMP definitely makes for quicker and more intuitive use.
While Photoshop does offer a ‘well-packaged’ software for professional photographers as against the ‘upgrades and support’ by GIMP developer community, GIMP becomes a more comfortable software to use as it overcomes, Photoshop’s sluggishness on even slightly older software. GIMP remains- fast and easy to install (is much smaller than Photoshop).

You can forget about using curves tools in Photoshop, over an open window. For one, it will not allow you, and besides, it is embedded in not in the Colors menu as in GIMP, but in the image-adjustments menu!
However, this is not to say Photoshop is not good as a technical tool. It is, but at the price tag and bundled features it offers, GIMP wins hands down because of the free-to-use licensing it adopts.
A great deterrent in using Photoshop is the very strict licensing stipulations; it becomes expensive and limits the number of users.  Free-to-use GIMP does not squabble about the number of people using its software and instead encourages greater user adoption, propagating FOSS philosophy.

Probably, where GIMP, really makes the difference is in the ‘right click’ on an image to get to a menu, which incidentally are not more than a layer deep. In Photoshop the multi-layered drop down menu, which are not accessible on open windows, do not just limit the user experience, but are actually frustrating in the long run.
Photoshop is definitely, it has to accepted, smoother but GIMP does make up for the jerks in paintbrush cloning with the undistracted work flow it makes possible- cloning, scaling more quicker, easier and intuitive.
Where GIMP truly wins over Photoshop would be its portability. It can go on CD’s, memory sticks and sometimes the Xbox 360 (Microsoft) as well. GIMP UI small real-estate, CMYK and 3D-features does give it the scope of a Photoshop package but with the expensive price-tag.


If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Download ICON THEME : Nice collection of icon sets for your Linux Desktop with installation instructions| Ubuntu PPA

,

Nice collection of icon sets for your Linux Desktop with installation instructions| Ubuntu PPA


This is a nice collection of iconsets  for your Linux Desktop, so if you are a fun of changing default themes of your Linux Distribution, then this post is for you. I tried to collect the nicest and most updated icons themes existing in this moment, i included also a detailed howto install the themes for Ubuntu/ LinuxMint and Fedora based distributions.
I tested the icon themes in Ubuntu 12.04 Precise Pangolin Beta1, icons did work just fine.

1- Faience:


2- Meliae Iconset theme

3- Gnome Colors

Ubuntu users, use the following PPA:
sudo apt-get install ppa:gnome-colors-packagers/ppa
sudo apt-get update 
sudo apt-get install gnome-colors

4- Hydroxygen_iconset


5- Humanity Icons Colors Version



For Ubuntu & LinuxMint use the following PPA:
sudo add-apt-repository ppa:ravefinity-project/ppa
sudo apt-get update
sudo apt-get install humanity-colors

 

6-  Vibrant Icons

7- Awoken 2.4 (PPA Ubuntu)

8- AdriX icon theme

9- Faenza Icons:

PPA for Faenza icons for Ubuntu:
sudo add-apt-repository ppa:tiheum/equinox
sudo apt-get update
sudo apt-get install faenza-icon-theme

How to install and activate the new icons? (detailed for newbies :)

1- Download and extract the icons :

  • cd the directory where you downloaded the icons
  • Now extract directly to /usr/share/icons, example Adrix icons theme us
sudo tar xvjf AdriX-gnome.tar.bz2 -C /usr/share/icons/ 
If the archive is tar.bz use this command (Change icons-theme-name withe the name of the downloaded file):
sudo tar -xvzf icons-theme-name.tar.bz -C /usr/share/icons/
 For icons with PPA use the PPA above to install them.

2- Activate the icons:

You need to install Gnome Tweak Tool, use the following command:
sudo apt-get install gnome-tweak-tool
- For Fedora and other rpm based distro, as root type the following command:
yum install gnome-tweak-tool
3- Now open Gnome tweak tool and under theme choose the icon you want

I installed humanity icons theme and chosed the blue ones, this how does it looks.

For Ubuntu users, if you want more icons themes, use the following ppa, it contains a large number of icon themes. For a complete list check launchpad
 sudo add-apt-repository ppa:webupd8team/themes
List of themes in this PPA can be found in this link : https://launchpad.net/~webupd8team/+archive/themes


If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

How to- Disable SELinux on Fedora/Centos/RHEL/SL

,

 Security-Enhanced Linux (SELinux) is a Linux feature that provides a mechanism for supporting access control security policies, through the use of Linux Security Modules (LSM) in the Linux kernel. It is a set of Kernel modifications and user-space tools that can be added to various Linux distributions. Its architecture strives to separate enforcement of security decisions from the security policy itself and streamlines the volume of software charged with security policy enforcement .
In this post will show you  : How  to  disable  Selinux without  having to reboot ?
  • First   check  the  Selinux  status  with
#getenforce
Output Enforcing 
  • Disbale the  enforcing  with
#setenforce 0
This  the  the  temporally   disabling of the  selinux, but how  to disable  is  permanently ?
  • What you need to do is to  change “SELINUX=enforcing” to “SELINUX=disabled” in /etc/sysconfig/selinux
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.
SELINUX=enforcing # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
TO
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded.
SELINUX=disabled # SELINUXTYPE= can take one of these two values: # targeted - Targeted processes are protected, # mls - Multi Level Security protection. SELINUXTYPE=targeted
  • Check the  status  again
#getenforce
 Output 
Disabled

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

The growth of LibreOffice over Microsoft Office

,
LibreOffice after one and half-years as an open source office productivity suite has grown from being just a fork of OpenOffice.org (OOo) and emerged as an independent tool for those who prefer the openness and scope of work copyleft offers over claustrophobic copyright licenses and proprietary software. Following the game-changing split and backing by The Document Foundation (TDF) LibreOffice has over 25,000 code commits and 330 contributors. Secondly, it has over 15million Linux OS users, a further 10 million users are split between Microsoft (90-percent) and Mac OS X (5- percent). 

Even as these numbers speak of the domination of LibreOffice over the Office tools segment, there is room for thought, that it will soon break critical mass and move and become the most used office suite as Microsoft Office looks traction because of two major aspects – the phenomenal prices at which each version of the suite is sold and the claustrophobic licensing factor. In contrast LibreOffice, encourages and engages in the opposite, offering any number of downloads and use for almost the same set of tools – for spreadsheets, database creation, Math or desktop publishing. Despite paying due credit to Microsoft’s more mature platform and dedicated development input, the increase in contribution and excellent open governance model is fast moving LibreOffice to streamline its suite and offer a great package.

Additionally, there are umpteen limitations Microsoft Office struggles with – Document Sharing, technical support which is handled by trained office desk personnel as against developers who offer hands-on solutions for LibreOffice suite users. Another very vital and potentially dangerous issue is that of security. Every time Microsoft Office has a security-hole, and there have been many, users are typically unaware of the lurking dearth as they are not informed of such issues. Microsoft usually tries to patch them with standard security updates that they offer.
Interface on LibreOffice is its mainstay; frugal, minimalistic but highly functional and easily accessible. Microsoft’s ribbon interface, though now spread over all its products remains an acquired method.
Microsoft Office is limited to running on Windows or Mac. LibreOffice’s advantage is that not only will it run on other platforms, Windows, Linux or Mac, it actually runs on legacy hardware as well, which is simply not possible with Microsoft Office.

Perhaps, where LibreOffice truly delivers is its agility. With great implementation- in terms of algorithm, architecture and language, minimal layers and a integrated minimal program that LibreOffice has truly delivers on the speed over Microsoft’s Office.

LibreOffice 3.5 includes template creator for Writer, tweaked better performing Calc and elliptical arcs; Additionally, LibreOffice is to be available for tablets and a browser launched online LibreOffice suite. And for commercial users, LibreOffice is to offer integrative features for Microsoft SharePoint.
A recent development in this direction is Intel’s open move to encourage LibreOffice code improvement and offers download via Intel website. SUSE, in fact developed the Windows version of LibreOffice. Intel in fact, is considering adding LibreOffice to its AppUp Center providing users a great alternative to use vendor neutral productivity suite.

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

How to Configure conky-Lua in Ubuntu (11.10 & 12.04), Fedora, debian and LinuxMint | Howto Conky

,

Configure conky-Lua in Ubuntu (11.10 & 12.04), Fedora, debian and LinuxMint | Howto Conky


Conky is a free, light-weight system monitor for X, that displays any information on your desktop. There are many nice themes available for conky that can display clock, CPU usage, ram usage, swap, disk, net and more, one of these nice themes is Conky-Lua,  this theme (See screensot bellow) allow you to display nice rings for Clock, cpu …, the theme is available for Ubuntu, Linuxmint, fedora, and Debian.

In this post i will show you step by step on how to install and configure this awesome conky script called Conky-Lua. The installation has been done in Ubuntu 12.04 LTS Precise Pangolin Beta1. As usual, i tried to make the post newbies freindly
1- First of all we need to install conky, use the folowing command:
- For Ubuntu, LinuxMint and Debian use:
sudo apt-get install conky-all
-For Fedora use :
yum install conky-all
 
3- Now go to your Download folder and extract manually the file (double click on the archive or right click and select extract)

4- Now extract the 6 archives by selecting  and extracting them
5- Now select the folder you need, for example if you want to install it on LinuxMint select Conky Mint-lua, for Ubuntu use Conky ubuntu-lua (In my case i`m installing this on Ubuntu 12.04 Precise Pangolin).

6-Now open the folder you chosed (For Ubuntu use : conky ubuntu-lua folder) and rename the file called conkyrc to .conkyrc, then move it to your home directory.

7- Now move the renamed file .conkyrc  to your home directory

 
8- Now Open your home directory and unhide the folders, create a new folder called .conky and copy the other 2 files to this new folder(PNG image and clock_rings.lua).

 
9- Now open the file .conkycr (Right click on the file and use open with text editor) to edit or by command :
 gedit .conky


10- Now change the patch to the new one in the home folder (See screenshot bellow):
/~.lua/scripts/clock_rings.lua
 to
 ~/.conky/clock_rings.lua

11- Now open terminal and run conky
conky
 

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Thursday 1 March 2012

How to Install JDK 7 in windows

,


How to Install JDK 7

Java Development Kit (JDK) 1.7 (officially named Java SE 7), which is freely available from Sun Microsystems (now part of Oracle), is needed for writing Java programs. JDK can be downloaded from the Java mother site @ http://java.sun.com (or http://www.oracle.com/technetwork/java/index.html).

1.  How To Install JDK

JDK or JRE?
JRE (Java Runtime) is needed for running Java programs. JDK (Java Development Kit), which includes JRE plus the development tools (such as compiler and debugger), is need for writing Java programs. Since you are supposed to write Java Programs, install JDK (which includes JRE).
STEP 0: Un-install Older Version of JDK/JRE
If you have previously installed older version of JDK/JRE, un-install them. Run "Control Panel" ⇒ "Program and Features" ⇒ Un-install programs such as "Java SE Development Kit" and "Java SE Runtime". (If you are not sure whether you have older versions of JDK, check!)
STEP 1: Download JDK
  1. Goto Java SE download site @ http://www.oracle.com/technetwork/java/javase/downloads/index.html.
  2. Click the "Download" button under "JDK" of "Java SE 7".
  3. Choose your operating platform, e.g., Windows x86 (for 32-bit Windows OS - "jdk-7u2-windows-i586.exe" 84MB); or Windows x64 (for 64-bit Windows OS).
(For Mac Users Only) Download JDK from http://developer.apple.com/java/download/ and follow the instructions to install (or google "how to install JDK on Mac").
STEP 2: Install JDK/JRE
Run the downloaded installer, which installs both the JDK (Java Development Kit) and JRE (Java Runtime). By default, the JDK and JRE will be installed into directories "C:\Program Files\java\jdk1.7.0" and "C:\Program Files\java\jre7", respectively. For novices, accept the defaults.
I shall refer to the JDK installed directory as <JAVA_HOME>, hereafter, in this article.
(For Advanced Users Only)
  • The default JDK/JRE directories work but I recommend avoiding "Program Files" directory because of that blank character in the directory name. You may change the installed directories for JDK and JRE during installation. I personally installed JDK and all my programming tools in "d:\bin" (instead of "C:\Program Files") for ease of maintenance.
  • It is always cleaner to un-install all the out-dated JDK/JRE before installing a new version.
STEP 3: Include JDK's "bin" directory in the PATH
Windows Operating System searches the current directory and the directories listed in the PATH environment variable for executable programs invoked from the CMD shell. JDK's programs (such as compiler javac.exe and runtime java.exe) reside in directory "<JAVA_HOME>\bin" (where <JAVA_HOME> denotes the JDK installed directory you have chosen in the previous step). You need to include the "<JAVA_HOME>\bin" directory in the PATH environment variable.
To edit the PATH environment variable in Windows 2000/XP/Vista/7:
  1. Click the "Start" button ⇒ "Control Panel" ⇒ "System" ⇒ (Vista/7 only) "Advanced system settings".
  2. Switch to "Advanced" tab ⇒ "Environment Variables..."
  3. In "System Variables" box, scroll down to select "PATH" ⇒ "Edit..."
  4. In "Variable value" field, INSERT "c:\Program Files\java\jdk1.7.0\bin" (assume that this is your JDK's binary directory) IN FRONT of all the existing directories, followed by a semi-colon (;) which separates the JDK's binary directory from the rest of the existing directories. DO NOT DELETE any existing entries; otherwise, some existing applications may not run.
    Variable name  : PATH
    Variable value : c:\Program Files\java\jdk1.7.0\bin;....exiting entries....
    
(For Advanced Users Only) I suggested that you place the JDK binary directory in front of "c:\windows\system32" and "c:\windows". This is because some Windows systems may have an out-dated copy of JDK/JRE in these directories. Do a search for "java.exe", and you will be amazed of the findings.
You could read "Java Applications and Environment Variable" for more discussions about PATH environment variable.
(For Mac and Linux Users Only) You can set the environment variables JAVA_HOME and PATH in your .profile or .bashrc or .bash_profile (under your home directory $HOME) by including the following commands:
export JAVA_HOME=path_to_JDK_directory
export PATH=$JAVA_HOME/bin:$PATH
For Mac OS X, the path_to_JDK_directory is probably /Library/Java/Home. For Linux (Ubuntu), it is probably /usr/lib/jvm/java-7-xxx.
STEP 4: Verify the JDK Installation
Launch a CMD shell (click the "Start" button ⇒ run... ⇒ enter "cmd"), and
  1. Issue a "path" command to list the content of the PATH environment variable. Check the output and make sure that <JAVA_HOME>\bin is listed in the PATH.
    prompt> path
    PATH=c:\Program Files\java\jdk1.7.0\bin;......other entries......
  2. Issue the following commands to verify that JDK is properly installed and display its version:
    prompt> java -version
    java version "1.7.0"
    Java(TM) SE Runtime Environment (build 1.7.0-b147)
    Java HotSpot(TM) Client VM (build 21.0-b17, mixed mode, sharing)
    prompt> javac
    Usage: javac <options> <source files>
    .........
    .........
STEP 5: Compile & Run a Java Hello-world Program
Read "Writing your First Java Program with JDK and a Programming Text Editor".
"Everything that can possibly go wrong will go wrong": Read "JDK Installation Common Errors".
STEP 6: Download JDK API Documentation
The JDK download does not include the documentation, which needs to be downloaded separately. In the past, I always insist that my students should have a local copy of JDK API Documentation. But, today, you can easily access the online copy by googling "JDK 7 Documentation".
To install JDK API documentation:
  1. From the Java SE download page (@ http://www.oracle.com/technetwork/java/javase/downloads/index.html), look for "Java SE 7 Documentation" (under "Additional Resources") ⇒ Download the zip-file (e.g., "jdk-7....zip" - about 57MB).
  2. Unzip into the <JAVA_HOME> (JDK installed directory). The documentation will be unzipped into "<$JAVA_HOME>\docs". Browse the JDK documentation by opening "<JAVA_HOME>\docs\index.html".
STEP 7: (For Advanced Users Only) JDK's Source Code
Source code for JDK is provided and kept in "<JAVA_HOME>\src.zip". I strongly recommend that you to go through some of the source files such as "String.java", "Math.java", and "Integer.java", under "java\lang".

2.  Using External JAR files and Native Libraries In JDK (For Advanced Users Only)

External Java packages (such as JOGL, JUnit) are often distributed in JAR-files together with possibly native libraries (lib, dll). To use an external package in JDK, you need to:
  1. Include ALL the JAR-files in the CLASSPATH environment variable (e.g., classpath=.;path1\a.jar;path2\b.jar).
  2. Include the native libraries's directory in the PATH environment variable. (To be precise: The native libraries are to be kept in a directory accessible via JRE's property "java.library.path", which normally but not necessarily includes all the paths from the PATH environment variable).
If you cannot compile your program, make sure that the all the JAR files are included in the CLASSPATH. (Native libraries are not involved in the compilation.)
If you get a runtime error "java.lang.UnsatisfiedLinkError: no xxx in java.library.path". This means that JRE cannot find your native library at runtime. You could print the contents of "java.library.path" via System.out.println(System.getProperty("java.library.path")) and check whether it includes your native library's path.
You could set the native library path via the command-line option -Djava.library.path=xxx.
Alternatively, you could copy the JAR-files into JDK's extension directory at "<JDK_HOME>\jre\lib\ext", instead of using CLASSPATH; and copy all the dll's and lib's into a directory included in java.library.path.



If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

How To Install and Get Started: NetBeans 7.0 For Java Programming

,

NetBeans 7.0 For Java Programming

How To Install and Get Started

NetBeans (@ http://netbeans.org) is an open-source Integrated Development Environment (IDE), supported by Sun Microsystems (now part of Oracle). Compared with its rival Eclipse (http://www.elicpse.org) (both are open-source, so I don't know what are they competing for?), NetBeans provides seamless support for Java AWT/Swing, Java ME mobility pack, Java EE, and bundled with an excellent profiler for performance tuning.

How to Install NetBeans


Step 0: Install JDK
To use NetBeans for Java programming, you need to first install Java Development Kit (JDK). See "JDK - How to Install".
Step 1: Download
Download "NetBeans IDE" installer from http://netbeans.org/downloads/index.html. There are many "bundles" available. For beginners, choose the "Java SE" (NetBeans-7.0.1-ml-javase-windows.exe).
Step 2: Run the Installer
Run the downloaded installer. Choose your installation directory (e.g., "d:\myproject").

Writing a Hello-world Java Program in NetBeans


Step 0: Launch NetBeans
Launch NetBeans. If the "Start Page" appears, close it by clicking the "close" button.

Step 1: Create a New Project
For each Java application, you need to create a "project" to keep all the source files, classes and relevant resources.

  1. From "File" menu ⇒ Choose "New Project...".
  2. In "Choose Project" diglog ⇒ Under "Categories", choose "Java" ⇒ Under "Projects", choose "Java Application" ⇒ "Next".
  3. "Name and Location" ⇒ In "Project Name", enter "FirstProject" ⇒ In "Project Location", select a suitable directory to save your works ⇒ Uncheck "Create Main class" ⇒ Check "Set as Main Project" ⇒ Finish.
Step 2: Write a Hello-world Java Program
  1. Right-click on "FirstProject" ⇒ "New" ⇒ "Java Class..." (OR from the "File" menu ⇒ "New File..." ⇒ Categories: "Java", File Types: "Java Class" ⇒ "Next").
  2. "Name and Location" ⇒ In "Class Name", enter "Hello" ⇒ "Finish".
  3. The source file "Hello.java" appears in the editor panel. Enter the following codes:
    public class Hello {
        public static void main(String[] args) {
            System.out.println("Hello, world");
        }
    }
Step 3: Compile & Execute
There is no need to "compile" the source code explicitly, as NetBeans performs the so-called incremental compilation (i.e., the source statement is compiled while it is entered).
To run the program, right-click anywhere in the source (or from the "Run" menu), select "Run File" (or "Run Hello.java"). Observe the output on the output console.
Notes:
  • You should create a new Java project for each of your Java application.
  • Nonetheless, NetBeans allows you to keep more than one programs in a project, which is handy for writing toy programs (such as your tutorial exercises). If you have more than one files with main() method in one project, you need to right-click the source and choose "Run File".
Step 4: Read the NetBeans Documentation

  • At a minimum, you SHOULD READ the "IDE Basics, Getting Started, Java Application", which is accessible via NetBeans's "HELP" menu ⇒ "Help Contents".
  • The "Help" ⇒ "Online Doc and Support" (@ http://netbeans.org/kb/index.html) contains many articles and tutorial on using NetBeans.
  • The NetBeans "Start Page" also provides many useful links to get you started.

Debugging Program in NetBeans

Step 0: Write a Java Program
The following program computes and prints the factorial of n (=1*2*3*...*n). The program, however, has a logical error and produce a wrong answer for n=20 ("The Factorial of 20 is -2102132736" - a negative number?!).
1
2
3
4
5
6
7
8
9
10
11
12
13
public class Factorial {
   // Print factorial of n
   public static void main(String[] args) {
      int n = 20;
      int factorial = 1;
   
      // n! = 1*2*3...*n
      for (int i = 1; i <= n; i++) {
         factorial *= i;
      }
      System.out.println("The Factorial of " + n + " is " + factorial);
   }
}
Let us use the graphic debugger to debug the program.
Step 1: Set an initial Breakpoint
A breakpoint suspends program execution for you to examine the internal states of the program. Before starting the debugger, you need to set at least one breakpoint to suspend the execution inside the program. Set a breakpoint at main() method by clicking on the left-margin of the line containing main(). A red circle or an inverted Triangle appears in the left-margin indicating a breakpoint is set at that line.

Step 2: Start Debugging
Right click anywhere on the source code ⇒ "Debug File". The program begins execution but suspends its operation at the breakpoint, i.e., the main() method.
As illustrated in the following diagram, the highlighted line (also pointed to by a green arrow) indicates the statement to be executed in the next step.

Step 3: Step-Over and Watch the Variables and Outputs
Click the "Step Over" button (or select "Step Over" in "Debug" menu) to single-step thru your program. At each of the step, examine the value of the variables (in the "Variable" panel) and the outputs produced by your program (in the "Output" Panel), if any. You can also place your cursor at any variable to inspect the content of the variable.
Single-stepping thru the program and watching the values of internal variables and the outputs produced is the ultimate mean in debugging programs - because it is exactly how the computer runs your program!
Step 4: Breakpoint, Run-To-Cursor, Continue and Finish
As mentioned, a breakpoint suspends program execution and let you examine the internal states of the program. To set a breakpoint on a particular statement, click on the left-margin of that line (or select "Toggle Breakpoint" from "Run" menu).
"Continue" resumes the program execution, up to the next breakpoint, or till the end of the program.
"Single-step" thru a loop with a large count is time-consuming. You could set a breakpoint at the statement immediately outside the loop (e.g., Line 11 of the above program), and issue "Continue" to complete the loop.
Alternatively, you can place the cursor on a particular statement, and issue "Run-To-Cursor" to resume execution up to the line.
"Finish" ends the debugging session. Always terminate your current debugging session using "Finish" or "Continue" till the end of the program.

Other Debugger's Features:

Modify the Value of a Variable
You can modify the value of a variable by entering a new value in the "Variable" panel. This is handy for temporarily modifying the behaviour of a program, without changing the source code.
Step-Into and Step-Out
To debug a method, you need to use "Step-Into" to step into the first statement of the method. You could use "Step-Out" to return back to the caller, anywhere within the method. Alternatively, you could set a breakpoint inside a method.

NetBeans - Tips & Tricks


General Usage

These are the features that I find to be most useful in NetBeans:

  1. Maximizing Window (double-click): You can double-click on the "header" of any panel to maximize that particular panel, and double-click again to restore it back. This is particularly useful for editing source code in full panel.
  2. Code Auto-Complete (or Intelli-Sense) (ctrl-space): Enter a partial statement (e.g., Sys) and press control-space to activate the auto-complete, which displays all the available choices.
  3. Javadoc (ctrl-space, alt-F1): Place the cursor on a method or class, and press ctrl-space to view the javadoc; or right-click ⇒ Show Javadoc (alt-F1) to open it on a browser.
  4. Code Shorthand (tab): For example, you can enter "sout" and press TAB for "System.out.println"; "psvm" for "public static void main(String[] args) { }" or "fori" + tab for a for-loop. To view and configure code template, choose "Tools" menu ⇒ "Options" ⇒ "Editor" ⇒ "Code Templates".
  5. Formatting Source Code (alt-shift-f): Right-click on the source (or from the "Source" menu) ⇒ Choose "Format". NetBeans will layout your source codes with the proper indents and format. To configure the formatting, choose "Tools" menu ⇒ "Options" ⇒ "Editor" ⇒ "Formatting".
    You can also select the section of codes to be formatted, instead of the entire file.
  6. Hints for Correcting Syntax Error: If there is a syntax error on a statement, a red mark will show up on the left-margin on that statement. You could click on the "light bulb" to display the error message, and also select from the available hints for correcting that syntax error.
  7. Rename (Refactor) (ctrl-r): To rename a variable, place the cursor on that variable, right-click ⇒ "Refactor" ⇒ "Rename" ⇒ Enter the new name. All the appearances of that variables in the project will be renamed.
  8. Small Programs: You can keep many small toy programs (with main()) in one Java project instead of create a new project for each small program. To run the desired program, on the "editor" panel ⇒ right-click ⇒ "Run File".
  9. Source Toggle Comment: To temporarily comment-off a block of codes, choose "Source" ⇒ "Toggle Comment".
  10. Error Message Hyperlink: Click on an error message will hyperlink to the corresponding source statement.
  11. Command-Line Arguments: To provide command-line arguments to your Java program in NetBeans, right-click on the "project" ⇒ "Set as Main Project" ⇒ "Set Configurations" ⇒ "Customize..." ⇒ "Run" ⇒ select the "Main" class ⇒ type your command-line arguments inside the "Arguments" field ⇒ choose "Run" menu ⇒ "Run Main Project".
  12. Line Numbers: To show the line numbers, right-click on the left-margin ⇒ "Show Line Numbers".
  13. Changing Font Face and Size: Tools ⇒ Options ⇒ Fonts & Colors ⇒ In "Category", select "Default" ⇒ In "Font", choose the font face and size.
  14. Resetting Window View: If you mess up the window view (e.g., you accidentally close a window and cannot find it anymore), you can reset the view via "Window" menu ⇒ "Reset Windows".
  15. Code Templates: For example, when you create a new Java class, NetBeans retrieves the initial contents from the "Java Class" code template. To configure code templates, select "Tools" menu ⇒ "Templates" ⇒ Choose the desired template ⇒ "Open in Editor". To set a value of a variable used in the all the code templates (e.g., $User), select "Tools" menu ⇒ "Templates" ⇒ "Settings".
  16. Displaying Chinese Character: Need to choose a font that support chinese character display, such as "Monospace", in Tools ⇒ Options ⇒ Fonts & Colors ⇒ Syntax ⇒ default.
  17. Let me know if you have more tips to be included here.

Java Application Development

  1. Choosing the JDK version for your program: Right-click on your project ⇒ "Properties" ⇒ "Source" node ⇒ You can select the JDK level of your project in pull-donw menu "Source/Binary Format".
  2. Enabling JDK 7 support: If JDK 7 is already installed in your system, right-click on your Project ⇒ "Properties" ⇒ "Source" node ⇒ "Source/Binary Format" ⇒ Select "JDK 7". Also check "Libraries" ⇒ Java Platform ⇒ JDK 7.
    If JDK 7 is not installed/configured, install JDK 7. Add JDK 7 support to NetBeans via "Tool" menu ⇒ "Java Platforms" ⇒ "Add Platform...".
  3. Choosing Default Charset: Right-click on your project ⇒ "Properties" ⇒ "Source" node ⇒ "Encoding" ⇒ choose your desired charset for the text-file I/O from the pull-down menu.
  4. Enabling Unicode Support for File Encoding: Right-click on your project ⇒ "Properties" ⇒ "Source" node ⇒ "Encoding" ⇒ choose your Unicode encoding (e.g., UTF-8, UTF-16, UTF-16LE, UTF-16GE) for the text-file I/O.
  5. To include Javadoc/Source: Use "Library Manager" (select the "Tools" menu ⇒ "Libraries"); or "Java Platform Manager" (select "Tools" menu ⇒ "Java Platforms")
  6. Adding External JAR files & Native Libraries (dll, lib): Many external Java packages (such as JOGL, Java3D, JAMA, etc) are available to extend the functions of JDK. These binaries are often provided in a "lib" directory with jar files and native libraries (dll and lib).
    To include an external JAR file into a project: Expand the project node ⇒ Right-click on "Libraries" ⇒ "Add JAR/Folder..." ⇒ Select the desired JAR file or the folder containing the classes.
    If the external package contains many JAR files, you could create a user library to contain all the JAR files, and add the library to all the projects that required these JAR files. From "Tools" menu ⇒ "Libraries" ⇒ "New Library..." ⇒ Enter a library name ⇒ Use "Add JAR/Folder..." to add JAR files into this library.
    Many JAR files come with native libraries in the form of dll or lib. The directory path of these libraries must be included in JRE's property "java.library.path". This can be done via right-click the project ⇒ Set Configuration ⇒ Customize... ⇒ Run ⇒ In "VM options", enter "-Djava.library.path=xxx", where xxx is path of the native libraries.
    Notes: The jar files must be included in the CLASSPATH. The native library directories must be included in JRE's property "java.library.path", which normally but not necessarily includes all the paths from the PATH environment variable.
    If you get a runtime error "java.lang.UnsatisfiedLinkError: no xxx in java.library.path", which means that JRE cannot find your native library at runtime. The easier way to debug is to print out the contents of "java.library.path" via System.out.println(System.getProperty("java.library.path")). You could set the native library path via the command-line VM option -Djava.library.path=xxx.

Writing Java GUI (AWT/Swing) Application in NetBeans


Step 0: Read
Java GUI Application Learning Trail @ http://www.netbeans.org/kb/trails/matisse.html.
Step 1: Create a New Project
  1. Launch NetBeans ⇒ File ⇒ New Project...
  2. Under "Categories", choose "Java" ⇒ Under "Projects", choose "Java Application" ⇒ Next
  3. In "Project Name", enter "FirstGUI" ⇒ Choose a suitable directory for your "Project Location" ⇒ Uncheck both the "Create Main class" and "Set as Main Project" boxes ⇒ Finish.
Step 2: Write a Java GUI Program
  1. Right-click on the project "FirstGUI" ⇒ "New" ⇒ "JFrame Form..." ⇒ In "Project Name", enter "Counter" ⇒ Finish.
  2. Create the GUI Components visually:
    1. From the "Platte" panel ⇒ "Swing Controls" ⇒ Drag and drop a "Label", "TextField", and "Button" into the design panel.
    2. Click on the "jLabel1" ⇒ In the "Properties" panel, enter "Count" in "text" (You can also double-click on the jLabel1 to change the text). Right-click on the jLable1⇒ Change Variable Name ⇒ In "New Name", enter "lblCount".
    3. Similarly, for "jTextField1" ⇒ Change the "text" to 0, and change the "Variable Name" to "tfCount" ⇒ Resize the text field if necessary.
    4. For "jButton1" ⇒ Change the "text" to "Count Up", and change the "Variable Name" to "btnCount".
  3. Write the event handler for the button by double-clicking the button and enter the following codes:
    private void btnCountActionPerformed(java.awt.event.ActionEvent evt) {
       tfCount.setText(Integer.toString(Integer.parseInt(tfCount.getText()) + 1));
    }
Step 3: Compile & Execute
Right-click the source and select "Run Counter.java".
Step 4: Study the Generated Source Code
Expand the private method initComponent() and study how the GUI builder declare, allocate and initialize the GUI Components. Note how the JButton registers an ActionEvent listener and how an inner class is used as the listener and provide the event handler actionPerformed(). Also notice that the main() method uses a Swing's worker to run the GUI on a separate thread, instead of the main thread.

Developing and Deploying Web Application in NetBeans


Read:

Web (HTTP) Servers

Configuring Web Server
You could configure the web server via "Tools" menu ⇒ "Servers".
Tomcat Server
To configure Tomcat Server, select "Tools" menu ⇒ "Servers" ⇒ click "Add Servers":
  1. Choose Server: Select the desired Tomcat version ⇒ Next.
  2. Installation and Login Details: In "Server Location", fill in the Tomcat installation directory ($CATALINA_HOME) ⇒ Enter the username/password of a tomcat user with "manager" role. You could either check the "create user if it does not exist" or define the tomcat user in "$CATALINA_HOME\conf\tomcat-users.xml" as follows:
    <tomcat-users>
       <role rolename="manager"/>
       <user username="tomcatmanager" password="xxxx" roles="manager,manager-script,admin" />
    </tomcat-users>
Running the Web Server
Choose "Services" ⇒ Expand "Servers" node ⇒ Right-click on the desired server ⇒ Start/Stop/Restart.

MySQL Database Server

You can also manage the MySQL database server directly from Tomcat. Read "NetBeans and MySQL" Section.

Writing a Hello-World Servlet/JSP Web Application

Create a New Servlet/JSP Project
  1. From "File" menu ⇒ choose "New Project...".
  2. "Choose Project" ⇒ Under "Categories", choose "Java Web" ⇒ Under "Projects", choose "Web Application" ⇒ "Next".
  3. "Name and Location" ⇒ In "Project Name", enter "HelloServletJSP" ⇒ In "Project Location", select a suitable directory to save your works ⇒ Check "Set as Main Project" ⇒ Next.
  4. "Server and settings" ⇒ Choose your server, or "add" a new server ⇒ Next.
  5. "Frameworks" ⇒ Select none for pure servlet/JSP application ⇒ Finish.
Writing a Hello-World JSP
A JSP page called "index.jsp" is automatically created, which says "Hello world!". To execute this JSP, right-click on the project ⇒ "Run". The URL is http://localhost:8080/HelloServletJSP/index.jsp.
Writing a Hello-World Servlet
  1. Right-click on the project "HelloServletJSP" ⇒ New ⇒ Servlet.
  2. "Name and Location" ⇒ In "Class Name", enter "HelloServlet" ⇒ In "Package", enter "hello" ⇒ Next.
  3. "Configure Servlet Deployment" ⇒ In "Servlet Name", enter "HelloServletExample" ⇒ In "URL Pattern", enter "sayhello" ⇒ Finish.
  4. Enter the following codes for "HelloServlet.java":
    package hello;
     
    import java.io.IOException;
    import java.io.PrintWriter;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest;
    import javax.servlet.http.HttpServletResponse;
     
    public class HelloServlet extends HttpServlet {
     
       @Override
       public void doGet(HttpServletRequest request, HttpServletResponse response)
               throws IOException, ServletException {
          // Set the response message's MIME type (in Content-Type response header)
          response.setContentType("text/html;charset=UTF-8");
          // Get an output Writer to write the response message over the network
          PrintWriter out = response.getWriter();
          // Write the response message (in an HTML page) to display "Hello, world!"
          try {
             out.println("<!DOCTYPE html>");
             out.println("<html>");
             out.println("<head><title>Hello Servlet</title></head>");
             out.println("<body><h1>Hello, World (from Java Servlet)!</h1></body>");
             out.println("</html>");
          } finally {
             out.close();  // Always close the output writer
          }
       }
    }
  5. To execute the servlet: Right-click on the project ⇒ run ⇒ Change the URL to http://localhost:8080/HelloServletJSP/sayhello.
Generating a WAR-file for a Web Application
A WAR (Web Archive) file is basically a zip file for distributing web application in single file. You can use WinZip or WinRAR to inspect or unzip the war file.
To distribute the project as a war-file, right-click project ⇒ "Clean and Build". The war file is created in the "dist" directory. You can deploy the web application by dropping the war-file into Tomcat's "webapps" directory. Tomcat will automatically unzip the war-file and deploy the application upon startup.
Debugging Web Application
The most important reason for using IDE is to use the graphic debugger for debugging the program. You can set a breakpoint in your server-side Java codes, and "Debug" a web application, similar to a standalone application.

Writing a Hello-world JSF 2.0 Web Application

Create a New JSF 2.0 Project
  1. From "File" menu ⇒ choose "New Project...".
  2. "Choose Project" ⇒ Under "Categories", choose "Java Web" ⇒ Under "Projects", choose "Web Application" ⇒ "Next".
  3. "Name and Location" ⇒ In "Project Name", enter "HelloJSF20" ⇒ In "Project Location", select a suitable directory to save your works ⇒ Check "Set as Main Project" ⇒ Next.
  4. "Server and settings" ⇒ Choose your server, or "add" a new server ⇒ Next.
  5. "Frameworks" ⇒ Check "JavaServer Faces" ⇒ In "Libraries", "Registered Libraries", select "JSF 2.0" ⇒ Finish.
  6. An "index.xhtml" JSF page is generated, as follows:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html">
        <h:head>
            <title>Facelet Title</title>
        </h:head>
        <h:body>
            Hello from Facelets
        </h:body>
    </html>
    To run this facelet, right-click on the project ⇒ Run.
Create a new JSF 2.0 Facelet
  1. Right-click on the project ⇒ New ⇒ "Other..."
  2. "Choose File Type" ⇒ Under "Category", select "JavaServer Faces" ⇒ Under "File Type", select "JSF Page" ⇒ Next.
  3. "Name and Location" ⇒ In "File Name", enter "HelloJSF20" ⇒ In "Options", check "Facelets" ⇒ Finish.
  4. In "HelloJSF20.xhtml", enter the following codes:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html>
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:h="http://java.sun.com/jsf/html">
        <h:head>
            <title>Hello JSF 2.0</title>
        </h:head>
        <h:body>
           <h1>Hello from Facelets</h1>
        </h:body>
    </html>
  5. To execute the JSF page, right-click on the project ⇒ Run ⇒ Change the URL to http://localhost:8080/HelloJSF20/HelloJSF20.xhtml.

Writing a Hello-world JSF 1.2 Web Application

Create a New JSF 1.2 Project
  1. From "File" menu ⇒ choose "New Project...".
  2. "Choose Project" ⇒ In "Categories", choose "Java Web" ⇒ In "Projects", choose "Web Application" ⇒ "Next".
  3. "Name and Location" ⇒ In "Project Name", enter "HelloJSF12" ⇒ In "Project Location", select a suitable directory to save your works ⇒ Check "Set as Main Project" ⇒ Next.
  4. "Server and settings" ⇒ choose your server, or "add" a new server ⇒ Next.
  5. "Frameworks" ⇒ Check "JavaServer Faces" ⇒ In "Libraries", "Registered Libraries", select "JSF 1.2" ⇒ Finish.
  6. A "WelcomeJSF.jsp" page is generated, as follows:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE html>
    <%--
        This file is an entry point for JavaServer Faces application.
    --%>
    <f:view>
      <html>
        <head>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
          <title>JSP Page</title>
        </head>
        <body>
          <h1><h:outputText value="JavaServer Faces"/></h1>
        </body>
      </html>
    </f:view>
    To run this page, right-click on the project ⇒ Run.
Create a new JSF 1.2 Page
  1. Right-click on the project ⇒ New ⇒ "Other..."
  2. "Choose File Type" ⇒ In "Category", select "JavaServer Faces" ⇒ In "File Type", select "JSF Page" ⇒ Next.
  3. "Name and Location" ⇒ In "File Name", enter "HelloJSF12" ⇒ In "Options", check "JSP File (Standard Syntax)" ⇒ Finish.
  4. In "HelloJSF12.jsp", enter the following codes:
    <%@page contentType="text/html" pageEncoding="UTF-8"%>
    <%@taglib prefix="f" uri="http://java.sun.com/jsf/core"%>
    <%@taglib prefix="h" uri="http://java.sun.com/jsf/html"%>
    <!DOCTYPE html>
     
    <f:view>
      <html>
        <head>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
          <title>Hello JSF 1.2</title>
        </head>
        <body>
          <h1><h:outputText value="Hello World!"/></h1>
        </body>
      </html>
    </f:view>
  5. To execute the JSF page, right-click on the project ⇒ Run ⇒ Change the URL to http://localhost:8080/HelloJSF12/faces/HelloJSF12.jsp.

Debugging Web Applications in NetBeans

You can debug a webapp just like standalone application. For example, you can set breakpoints, single-step through the programs, etc.

REFERENCES & RESOURCES

 

If you found any thing wrong then pleas Let me know ...Write Your tips and suggestion in comment ... Thank you...

Deal of the Day

Advertisement here

Advertisement here