Recent site activity

Announcements

Class discussion on HTTP Stuff

posted Mar 6, 2012 8:27 PM by Sukhjit Singh


Learn about Object Oriented Programming from Intro to Java

posted Jan 18, 2012 10:49 AM by Sukhjit Singh

Video Lectures from Intro to Java

Interfaces and Abstract Classes for Lab2 - examples

posted Oct 12, 2011 7:10 PM by Sukhjit Singh


Exception Handling Example - that recovers error - sort of!

posted Oct 10, 2011 7:23 PM by Sukhjit Singh

Here is an example of Example Handler with a recovery method.

Sample final exam from previous quarter

posted Jun 14, 2011 9:27 PM by Sukhjit Singh

FINAL CIS 35b



Answer all eight questions. Each question is worth 10 points.


Q1    Ques 1 – 10 points

Consider the following code:


public class mySet {

   ArrayList myElements = new ArrayList( );


   public boolean add( Object o ) {

        myElements.add( o );

   }


   public Object remove( ) {

        if (myElements.isEmpty( ) == false)

           return myElements.remove( 0 );   // removes & returns object at position 0

        return null;

   }

}

    1. What may happen if an object of the class mySet is used by multiple threads calling add( ) and remove( ) at the same time?  
    2. Change the add( ) and remove( ) methods so that the class mySet can be safely used by multiple threads at once.
    3. Change the add( ) and remove( ) methods so that the method remove( ) will always return an object when used by multiple threads (by waiting until an object has been added).



Q2    How do you transfer input from a form to a JavaBean Variable? Explain your answer and write a short code snippet to demonstrate the concept.


Q3    Write a code snippet that shows the following: Create a socket and attach an input and output stream to it. Write a function that can check to see if the socket connection is broken.


Q4.     Explain how the hidden text fields can be used with Java?


Q5.    What is the role of response variable in JSP? Why is thread safety important in JSP and how it is achieved?


Q6    How do interfaces exhibit Polymorphism? Explain your answer with an example.


Q7.  Explain in depth how an http request is processed, clearly identifying the role of webserver and JVM Engine (Tomcat for example)


Q8.  Can a serialized object be transferred over a network? Write a code snippet to show how this might be achieved

Relative paths setup in tomcat (Physical and Virtual Directory)

posted Mar 14, 2011 9:14 PM by Sukhjit Singh

H:\bsingh\tomcat332\webapps\examples\jsp\test\index.jsp
http://localhost:8080/examples/jsp/test/index.jsp


Accessing packages:
H:\bsingh\tomcat332\webapps\examples\WEB-INF\classes\coreservlets
http://localhost:8080/examples/servlet/coreservlets.hello

FAQ's about labs grading

posted Feb 3, 2011 9:14 AM by Sukhjit Singh

Q1 - What should I do if my score is low or not perfect?

Kindly read the feedback and see why you lost points. My goal in the course is to help you learn and not penalize. Since you are working on existing codebase you can fix the issues progressively. Some issues that are significant design issues should be addressed quickly. Others that are minor can be handled over time. When you submit your last lab create a report that justifies why you should get the points back you lost in a given lab. This will be a one time option with Lab 6. I will review this report and allocate lost points to the respective labs  - only if I see you have fixed the issues.

Q2 - What should the justification report look like?

Kindly use the following format

Lab#, Points losts, Reason for point loss, Points you should score back, Justification for points you should earn back.

Q3 - What should I do if I do not know how to proceed in a lab or if I am falling behind?

Again, my goal is teach you to succeed as a software engineer and not programmer. I would like you to talk to me and ask for specific pointers on where you are stuck on design or coding issues. This should be done during labtime. Usually you have more lab time in latter part of quarter.

flashy yet lame?

posted Jan 24, 2011 9:46 PM by Sukhjit Singh

Please read this article

http://news.cnet.com/8301-17852_3-20029268-71.html

and come up with use cases for these devices that would not be so lame in the near future.

ArgoUML Tutorial

posted Jan 19, 2011 9:49 PM by Sukhjit Singh

http://argouml-stats.tigris.org/documentation/manual-0.30/pt01.html

How to install tomcat?

posted Nov 10, 2010 7:13 PM by Sukhjit Singh

Follow these cryptic instructions:

working with Tomcat 3.3.2 - jakarta.apache.org

Download for windows
http://archive.apache.org/dist/tomcat/tomcat-3/v3.3.2/bin/jakarta-tomcat-3.3.2.zip

Download for unix
http://archive.apache.org/dist/tomcat/tomcat-3/v3.3.2/bin/jakarta-tomcat-3.3.2.tar.gz

Create a batch file with this - update path as needed.
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_07
set PATH=%JAVA_HOME%\bin;%PATH%
set TOMCAT_HOME=z:\tomcat332
set CLASSPATH=.;z:\tomcat332\lib\common\servlet.jar;z:\tomcat332\webapps\examples\WEB-INF\classes;
Z:\tomcat332\bin\startup

1-10 of 11