NetBeans – debugging error

I found the below funny scenario when I was debugging my Java application using NetBeans 5.5, where the debugging line will go into comment, even empty line.

yoo-hoo! it get to debug as normal when I try to put a simple print line statement and set the breakpoint there, then start debug again 😉

 

Compile Apache WebServer In Redhat Linux

  1. Download Unix Source from http://httpd.apache.org/download.cgi.
  2. Extract the file by issue the following command :
    #gunzip http-xxx.tar.gz (Skip this if file extension is .tar)
    #tar -xf http-xxx.tar
  3. Execute following command :
    # ./configure –prefix=/opt/apache –enable-mods-shared=most
    Note: (Set the prefix directory where you want to install Apache, Eg in this case is /opt/apache)
  4. Issue the following command : # make
  5. Issue the following command : # make install
  6. Apache should successfully install in /opt/ folder now.
  7. To start Apache, go /opt/apache/ then issue this command : # ./apachectl start
  8. Verify examples at http://localhost, to make sure Apache start successfully 🙂

Note: Please make sure Gnu C Compiler (gcc) is install before compile Apache.

 

Tomcat Multiple Context Path

Problem to create multiple context path in server.xml as below:

<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">

<Context path="/JAVA" docBase="C:jakarta-tomcat-4.1.31webappsJAVAweb" debug="0"
reloadable="true" crossContext="true">
bla…bla…bla
bla…bla…bla
</Context>
</Context>

FINALLY, I found that context path should write in this way 🙂

<Context path="/examples" docBase="examples" debug="0"
reloadable="true" crossContext="true">
</Context>

<Context path="/JAVA" docBase="C:jakarta-tomcat-4.1.31webappsJAVAweb" debug="0"
reloadable="true" crossContext="true">
</Context>

 

 

 

Tomcat Connector – Apache

Here with the steps :

  1. Get general version mod_jk here or Linux version mod_jk here then rename it as mod_jk.dll(Windows) or mod_jk.so(Linux) and put it into {Apache_Home}modules. (eg: C:ApacheGroupApache2modulesmod_jk.dll) ** NOTE: (Download proper version to meet your need, in this case, I use Apache 1.3* & Tomcat 4.1*)
  2. Get workers.properties here , and change the path for tomcat_home and java_home in the beggining of file. Then put it into {tomcat_home}confjk (eg:C:jakarta-tomcat-4.1.31confjkworkers.properties)
  3. Edit httpd.conf which located in Apache conf directory. Get example here and refer the setting part at line Setting mod_jk Connector“. (The simplest way is copy and paste the whole setting and paste into you httpd.conf, Don’t forget to change the path to point to the correct directory in your machine)
  4. Verify examples at http://localhost:8080/examples/, to make sure Tomcat is running.
  5. Verify examples at http://localhost/examples/, on success, the connection is done successfully.

Click here for another quick start.

Click here for full workers.properties configuration doc

 

Java History

1990

  • A small group of people were given opportunities to think of what “the next big big thing in technology”.

1991

  • A gang of four “brillian and bored” – James Gosling, Ed Frank, Patrick Naughthon, and Mike Sheridan, talk about leaving Sun for something more challenging after Sun president Scott McNealy said, “Maybe you guys are on to something… Why don’t you go hide somewhere and think about what it is”.
  • James Gosling, Ed Frank, Patrick Naughthon, and Mike Sheridan set themselves up in a secret off-campus office in Menlo Park above a Bank of America, and away from Sun and corporate “antibodies.” And named themselves as Green Project.
  • They began constructing a devices call star seven (*7), for the purpose of control of variety of everywhere devices.
  • James Gosling had written an “interpreter” in the form of a virtual machine made of software. He had also created a compact, simple software language, and necessary code compiler to drive the virtual machine. And he named for the new programming language–OAK.

1992

  • The green team had grown to 13, and dedicated to bringing their control demo to life.
  • The birth of Duke who explain everything you needed to know about the devices on screen.
  • Using just a standard remote control, you could view a list of program, change channel, and order and record shows over the network.
  • After 2 years of refinement and pitches, the team still couldn’t fine a market for their invention. No one ready to go for digital. Many cable companies feared they lost control of the viewer.

1994

  • A web browser created using Oak language.
  • What was unique about Oak browser was that it contains software (the “Oak runtime environment”) that allowed small application to run securely within a web browser. They named the browser-based application “applets”.
  • No longer Internet is flat.

1995

  • Lisa Poulson, who handle PR had arrange for the San Jose Mercury News to write a story on Java technology based.
  • The front page story positioned Java technology as “The Next Big Thing”.
  • Netscape Navigator 2.0 shipped with Sun’s Java technology.

1996

  • Sun created an official JavaSoft business unit and hired Alan Baratz (MIT doctoral and IBM researcher) as its president.
  • “Java Compatible” logo was created.

1997

  • By this year, Java programming was being taught in 78% of surveyed university and college.

1998

  • Sun launched the Java community Process (JCP TM) program which gives participants the right to create new pieces of Java technology through community collaboration.
  • By 1998, the team and industry partners were seeing vast horizons for Java technology. From very small application running on handheld devices to very large application running on network.

1999

  • At the JavaOne conference, Sun announced that the Java platform would now be available in three editions:
    1. The Standard Edition (Core technology for desktop and server)
    2. The Enterprise Edition (Medium to large business)
    3 .The Micro Edition (small and mobile devices eg: cellphones)
  • Java technology powered mobile phone starting gather the stream around the world.

1999 – 2006

  • Axzlto (Part of the French conglomerate Schlumberger) give their implementation of “Java card” technology to sun.
  • Java powered the onboard computer in toys, car, planes and rockets, even gave NASA’s Mars Rover “eyes” by creating image out of data send from onboard camera.
  • Java technology use to connect a national patient database, hospital outpatient facilities and pharmacies for healthcare system project in South America.
  • A project based on Java card technology being use for personal identity card in Belgium.
  • eBays relies on Java technology to handle merchandise sales and registered user worldwide. 
2010
  • Oracle Corporation acquire Sun Microsystems for $7.4 @ January 27.
  • Father of Java-James Gosling has resign from Oracle @ April 2010
* Information taken from — “Hello world(s)!”, From Code to Culture: A 10 Year Celebration of Java TM 

 

DirectCast vs CType

Dim Q As Object = 2.37
Dim I As Integer = CType(Q, Integer) Succeeds.
Dim J As Integer = DirectCast(Q, Integer) Fails.

The difference between the two keywords is that CType succeeds as long as there is a valid conversion defined between the expression and the type, whereas DirectCast requires the run-time type of an object variable to be the same as the specified type. If the specified type and the run-time type of the expression are the same, however, the run-time performance of DirectCast is better than that of CType.
In the preceding example, the run-time type of Q is Double. CType succeeds because Double can be converted to Integer, but DirectCast fails because the run-time type of Q is not already Integer.

 

ListView Item/Subitem Location

lv = ListViewItem
ListView.view = Detail (Set ListView.View Property to Detail)

(Example Listview with record)

Column1 Column1 Column1
lv.Items(0) lv.Items(0).SubItems.Item(1) lv.Items(0).SubItems.Item(2)
lv.Items(1) lv.Items(1).SubItems.Item(1) lv.Items(1).SubItems.Item(2)

(ListView location)

 

What is Static Variable

  • Variables that are common to all objects.
  • Fields that have the static modifier in their declaration are called static fields or class variables. They are associated with the class, rather than with any object.
  • Every instance of the class shares a class variable, which is in one fixed location in memory.
  • Any object can change the value of a class variable.
  • class variables can also be manipulated without creating an instance of the class.
  • e.g: If you are going to create a variable serial number for an Item, which is unique for each, you can consider to declare a variable as static because no matter how many instance of class you create, they are also sharing the static variable.