Vector Passing

I have 2 files called Payroll and the other called GUIDisplay.
Payroll:
public class Payroll
      private Vector<Object> test;
    public void getdatabaseConnection()throws SQLException, ClassNotFoundException
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
            link = DriverManager.getConnection(
                    "jdbc:odbc:payrollAccounts","","");
public void getAll()throws SQLException, ClassNotFoundException
          Connection link = null;
          Statement statement = null;
          ResultSet results = null;
          statement = link.createStatement();
          results = statement.executeQuery("SELECT * FROM tableOne");
          test = new Vector<Object>();
          while (results.next())
               test.add(results.getInt(1));
               test.add(results.getString(2));
               test.add(results.getString(3));
               test.add(results.getFloat(4));
     public Vector<Object> getAcctDetails()
          return test;
     }GUIDisplay:
public class GUIDisplay extends JFrame implements ActionListener
private Vector<String> heads;
private Vector<Object> row;
private Vector<Vector> rows;
public static void main(String[] args)
             Payroll payroll = new Payroll();
             payroll.getdatabaseConnection()
             GUIDisplay frame = new GUIDisplay();
              (plus other code)
public GUIDisplay()
              (code)
public void displayAll()
                final int NUM_FIELDS = 4;
                Payroll payroll = new Payroll();
                Vector<Object> accounts = payroll.getAcctDetails();
                 heads = new Vector<String>();
                for (int i=0; i<heading.length; i++)
                    heads.addElement(heading);
rows = new Vector><Vector>();
for (int i=0;i<accounts.size() /NUM_FIELDS;i++)
row = new Vector><Object>();
row.addElement((Integer)accounts.elementAt(i*NUM_FIELDS));
row.addElement((String)accounts.elementAt(i*NUM_FIELDS+1));
row.addElement((String)accounts.elementAt(i*NUM_FIELDS+2));
row.addElement((Float)accounts.elementAt(i*NUM_FIELDS+3));
rows.addElement(row);
jTable = new JTable(row,heads);
plus other jtable code
I'm trying to have my sql code in one file and get it into a JTable in the other file. This code doesn't seem to work, any ideas?
Brings NullPointerException.

Would you like us to guess where the error occurs and what causes it?
Also, you're the second person in as many weeks who I've seen
using Vectors to hold data that should be in objects.
Instead of holding an array of objects in the sequence
int, String, String, float, make a container object representing
your data and hold an array of those. This will make your life
much easier in the long run.
public class MyDataObject() {
    private final int myInt;
    private final String myFirstString;
    private final String mySecondString;
    private final float myFloat;
    public MyDataObject(final int myInt, final String myFirstString,
            final String mySecondString, final float myFloat) {
        this.myInt = myInt;
        this.myFirstString = myFirstString;
        this.mySecondString = mySecondString;
        this.myFloat = myFloat;
    public int getMyInt() {
        return this.myInt;
    // other accessors
}

Similar Messages

  • HELP with Throwing a Vector into a JSP

    Hi,
    I have created a vector of Strings (for now) and i need to display it in a JSP page. I can't find references that don't use Beans...even then it makes no sense.
    Help please?

    yes so this is my JSP file
    <%@ taglib uri="/WEB-INF/tld/struts-form.tld" prefix="form" %>
    <html>
    <head>
    <title>Search Results</title>
    </head>
    Here is what you searched for:
    <%java.util.Vector vector=(Vector)request.getAttribute("SearchInfo");%>
    </html>
    and the snippet of my struts-config.xml file - which is completely wrong
    <action path="/Search"
    type="org.apache.struts.actions.ForwardAction"
    parameter="SearchAction" />
    I know the the looking at the database, lookup fuction, loading to vector is right....the problem is
    a) how do I get that vector passed into the jsp to begin with (or is that what you just gave me?)
    b) how do I setup my struts config file?

  • Problem with beans in session scope

    Hello,
    I developped a website using JSP/Tomcat and I can't figure out how to fix this problem.
    I am using beans in session scope to know when a user is actualy logged in or not and to make some basic informations about him avaible to the pages. I then add those beans to an application scope bean that manages the users, letting me know how many are logged in, etc... I store the user beans in a Vector list.
    The problem is that the session beans never seem to be destroyed. I made a logout page which use <jsp:remove/> but all it does is to remove the bean from the scope and not actualy destroying it. I have to notify the application bean that the session is terminated so I manualy remove it from its vector list.
    But when a user just leave the site without using the logout option, it becomes a problem. Is there a way to actualy tell when a session bean is being destroyed ? I tried to check with my application bean if there are null beans in the list but it never happens, the user bean always stays in memory.
    Is there actualy a way for me to notify the application bean when the user quits the website without using the logout link ? Or is the whole design flawed ?
    Thanks in advance.
    Nicolas Jaccard

    I understand I could create a listener even with my current setup Correct, you configure listeners in web.xml and they are applicable to a whole web application irrespective of whether you use jsp or servlets or both. SessionListeners would fire when a session was created or when a session is about to be dropped.
    but I do not know how I could get a reference of the application bean in >question. Any hint ?From your earlier post, I understand that you add a UserBean to a session and then the UserBean to a vector stoed in application scope.
    Something like below,
    UserBean user = new UserBean();
    //set  bean in session scope.
    session.setAttribute("user", user);
    //add bean to a Vector stored in application scope.
    Vector v = (Vector)(getServletContext().getAttribute("userList"));
    v.add(user);If you have done it in the above fashion, you realize, dont you, that its the same object that's added to both the session and to the vector stored in application scope.
    So in your sessionDestroyed() method of your HttpSessionListener implementation,
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now remove the object from the Vector passing in the reference to the object retrieved from the Session.
            v.removeElement(user);
    }That's it.
    Another approach would be to remove the User based on a unique identifier. Let's assume each User has a unique id (If your User has no such feature, you could still add one and set the user id to the session id that the user is associated with)
    void sessionDestroyed(HttpSessionEvent event){
         //get a handle to the session
         HttpSession session = event.getSession();
          //get a handle to the user object
          UserBean user = (UserBean)session.getAttribute("user");
           //get the unique id of the user object
           String id = user.getId();
           //get a handle to the application object
          ServletContext ctx = session.getServletContext();
           //get a handle to the Vector storing the user objs in application scope
            Vector v = (Vector)ctx.getAttribute("userList");
           //now iterate all user objects in the Vector
           for(Iterator itr = v.iterator(); itr.hasNext()) {
                   User user = (User)itr.next();               
                    if(user.getId().equals(id)) {
                           //if user's id is same as id of user retrieved from session
                           //remove the object
                           itr.remove();
    }Hope that helps,
    ram.

  • Finding the min value in a hashtable

    Hi,
    I'm trying to work out the lowest value contained in a hashTable. So far I've got.
    import java.util.Enumeration;
    import java.util.Hashtable;
    import java.util.Vector;
    public class StoreValuesDouble extends Statistic {
          * Each object of the class (StoreValuesDouble) will have these attributes.
          * When you call the StoreValuesDouble class you can use
          * myDoubleValues (a Vector holding Double types),
          * Hashtable (a Hashtable using Double types as values and keys) and
          * nullValues (an Double currently set to 0.0).
         Vector<Double> myDoubleValues; //declare a variable myDoubleValues that is of data type Vector
         Hashtable<Double, Double> myValues; //declare a variable myvalues that is a data type Hashtable
         Double nullValues = 0.0; //Double attribute to count the number of null values contained in the vector
          * pass myDoubleValues to inValues
          * @param Vector /<Double/> a vector holding Double values
          * @param inValues the values in the vector
          * @return
         public void DoubleStat(Vector<Double> inValues) {
              myDoubleValues = inValues;
          * calculate the mean of myDoubleValues
          * @return mean of myDoubleValues as a double
         public double meanDouble() {
              double mean = 0;
              Double currentDouble;
              double nonNull = 0;
              for (double j = 0; j < myDoubleValues.size(); j++)
                   currentDouble = myDoubleValues.elementAt((int) j);
                   if (currentDouble != null) {
                        mean += currentDouble.doubleValue();
                        nonNull++;
              return mean / nonNull;
          * calculate the standard devitation of myDoubleValues
          * @return standard devitation of myDoubleValues as a double
         public double standardDeviationDouble() {
              double m = meanDouble();
              double t = 0.0;
              Double currentDouble;
              double n = 0;
              for (double j = 0; j < getDoubleValues(); j++) {
                   currentDouble = myDoubleValues.elementAt((int)j);
                   if (currentDouble != null) {
                        n = currentDouble.doubleValue();
                        t += (n - m) * (n - m);
              return Math.sqrt(t / (myDoubleValues.size() - 1.0));// n - 1 as sample varience
          * return the number of values of myDoubleValues to help calculate the mean & standard deviation
          * @return the size of myDoubleValues as a Double
         public double getDoubleValues() {
              return myDoubleValues.size();
          * compute the number of null values
          * @return a double value representing the number of null values
         public Double getDoubleNull() {
              Double nbNull = 0.0;
              // test if myIntValues is null
              if (myDoubleValues == null) {
                   System.out.println("Please enter values that are not null!");
                   return 0.0;
              // if not null, parse all values
                   // for each value, test if it is null or not
                   Double currentDouble;
                   for (double i = 0; i < myDoubleValues.size(); i++) {
                        currentDouble = myDoubleValues.elementAt((int)i);
                        if (currentDouble != null) {
                             /// nothing to do
                        else {
                             nbNull++;
              return nbNull;
    //find the MIN values in the Hashtable to give us the range (with the MAX value)
         public Double MinDouble()
              Double MinDouble = null;
              Double currentValue;
              for (double j = 0; j < myDoubleValues.size(); j++)
                   currentValue = myDoubleValues.elementAt((int) j);
                   if (currentValue != null){
                   if (currentValue <= MinDouble) {
                        MinDouble = currentValue;
              return MinDouble;
         /*find the MAX value in the Hashtable to give us the range (with the MIN value)
         public double MAX()
          * Create an instance of StoreValuesDouble to hold vector values and number of times the values
          * appear. StoreValuesDouble automatically contains the variables defined above
          * (myDoubleValues, myValues and nullValues) we have to initialise myDoubleValues and myValues
          * as they have been defined but not initialised. nullValues has been defined (int) and initialised (0).
          * @param Vector /<Double/> a vector holding Double values
          * @param inValues the values in the vector
          * @return
         public StoreValuesDouble(Vector<Double> inValues) {
              myDoubleValues = inValues; //the attribute myDoubleValues defined in the StoreValuesDouble class
              //is the inValues parameter, this allows us to store the Vector in inValues
              myValues = new Hashtable<Double, Double>(); // create an instance of/initialise Hashtable
          * Now define the methods to make the instance StoreValuesDouble do what we want it to do
          * (ie parse all the double values of the myDoubleValues Vector attribute.
         public void computeDoubleValues() {
              Double currentDouble;//local variable to store the current read Double object
               * Use a for loop to read through all the values contained in the vector
              for (double i = 0; i < myDoubleValues.size(); i++) {
                   currentDouble = myDoubleValues.elementAt((int)i);
                   //currentDouble is now the Double object stored at i
                   //to check that i is not null we use the if statment
                   if (currentDouble != null) {
                        //i is not null so we want to add it to the hashtable. Rather than writing a lot of code
                        //here to do checking and adding we just call a method that can be written seperately
                        updateDoubleTable(currentDouble);
                   else {
                        //i is null so we just count it by adding it to our nullValues attribute
                        nullValues++;
          * Update the current distribution of Doubles
          * @param Double for the value of the key
          * @param inDouble for the value entered into the Hashtable (the object)
         public void updateDoubleTable(Double inDouble) {
              //First test that variable inDouble is not null
              if (inDouble != null) {
                   //update the table myValues this involves two tasks
                   //1)see if the double object has already been seen
                   //so we create a local variable to test the Hashtable
                   boolean alreadyPresent;
                   alreadyPresent = myValues.containsKey(inDouble);
                   //here we check whether inDouble is already in myValues
                   if (alreadyPresent) {
                        //if it is present we need to increase the counter
                        Double counter = myValues.get(inDouble);
                        //local variable counter to get the value associated to the key inDouble
                        Double newCounter = new Double(counter.intValue() + 1.0);
                        //update counter values and then ...
                        myValues.put(inDouble, newCounter);
                        //put into myValues
                        //as Hashtable can store only Objects, we cannot use primitive types
                        // so we use Objects related to primitive types as Integer, Float, Double
                        // or Boolean (here, we use Double)
                   } else {
                        //store the double and set it's counter to 1
                        myValues.put(inDouble, new Double(1));
              } else {
                   //do nothing
         //now we want to display the values
         public void displayDoubleTable() {
              // to display the distribution, we need to parse all the keys of the
              // hashtable and access to the value associated to each key
              Enumeration<Double> keys = myValues.keys();
              Double currentKey;
              Double currentValue;
              System.out.println("");
              System.out.println("Hashtable Information:");
              System.out.println("");
              System.out.println(myDoubleValues.size() + " Double objects in initial vector");
              System.out.println("");
              while (keys.hasMoreElements()) {
                   currentKey = keys.nextElement();
                   currentValue = myValues.get(currentKey);
                   System.out.println("The value " + currentKey.doubleValue()
                             + " has been seen " + currentValue.doubleValue()
                             + " time(s) in the initial Vector");
              System.out.println("");
              System.out.println("There were " + nullValues
                        + " null Double object(s) in the inital Vector");
         }As part of the StoreValuesDouble class. And to display it.
    package statistics;
    import java.util.Vector;
    public class TestStatDouble {
         static Vector<Double> doubleVector;
          * Create and initialise a vector of values and compute the mean,
          * standard deviation, distribution and MIN/MAX values.
         public static void main(String[] args) {
               // initialise the values in initValues
              initValues();
              // create an instance of StoreValuesDouble taking double as the parameter
              StoreValuesDouble is = new StoreValuesDouble(doubleVector);
              //Display the results
              displayVectorContent(doubleVector);
              System.out.println("");
              System.out.println("Number of null values: " + is.getDoubleNull());
              System.out.println("Number of non-null values is: " +(is.getDoubleValues() - is.getDoubleNull()));
              System.out.println("Number of all values: " + is.getDoubleValues());
              System.out.println("The mean is: " + is.meanDouble());
              System.out.println("Standard deviation is: " + is.standardDeviationDouble());
              System.out.println("The lowest value is " + is.MinDouble());
              System.out.println("");
               * now I want to display the results from the displayTable method in the StoreValuesDouble
               * class so I create an instance of StoreValuesDouble and use the computeDoubleValues and
               * displayDoubleTable methods.
              StoreValuesDouble storeValues = new StoreValuesDouble(doubleVector);
              storeValues.computeDoubleValues();
              storeValues.displayDoubleTable();
          * create the class method initValues() to add values to the Vector doubleVector
         public static void initValues()
              doubleVector = new Vector<Double>();
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(10.9));
              doubleVector.addElement(new Double(15.95));
              doubleVector.addElement(new Double(17));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(1));
              doubleVector.addElement(new Double(4));
              doubleVector.addElement(new Double(10.499));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(10.4999));
              doubleVector.addElement(new Double(17));
              doubleVector.addElement(new Double(-15));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(14));
              doubleVector.addElement(new Double(20));
              doubleVector.addElement(new Double(-3));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(9));
              doubleVector.addElement(new Double(1.5));
              doubleVector.addElement(null);
              doubleVector.addElement(new Double(10.22));
              doubleVector.addElement(new Double(15.23));
              doubleVector.addElement(new Double(17.91));
              doubleVector.addElement(null);
          * class method to print values contained in the vector doubleVector to the console.
          * @param doubleVector the Vector to be displayed
         public static void displayVectorContent(Vector doubleVector)
              Double currentDouble;
              System.out.println("Double values within the Vector:");
              for (int i=0; i<doubleVector.size();i++)
                   try
                        currentDouble = (Double) doubleVector.elementAt(i);
                        if (currentDouble != null)
                             System.out.print(currentDouble.toString() + " ");
                   catch(ClassCastException cce)
                        System.out.print(cce.getMessage() + " ");
                        cce.printStackTrace();
              System.out.println("");
         It compiles fine but when I try and run it I get a
    Exception in thread "main" java.lang.NullPointerException
         at statistics.StoreValuesDouble.MinDouble(StoreValuesDouble.java:139)
         at statistics.TestStatDouble.main(TestStatDouble.java:37)
    TestStatDouble 37 is
    System.out.println("The lowest value is " + is.MinDouble());139 is
    if (currentValue <= MinDouble) {I guess the problem's in my if loop but I'm not sure why. Any help would be appreciated.
    Message was edited by:
    Ali_D

    Couple of points about your code:
    1. Don't declare your instance variables as solid types, declare them using their interfaces (where applicable), so in your case don't specifiy that you are using Vector or Hashtable, use List and Map. This will allow you to easily change your code to use a different collection, if and when appropriate. Also the unnecessary overhead of Vectors synchronisation means that you should use ArrayList instead of vector (that means that you will have to use get(int) instead of elementAt() but that's a very small price to pay.
    2. Declare local variables as close to their point of usage as possible. (Unless you need to do this for your course work, in which case you don't have a choice).
    3. Use the appropriate data type. For your count of null values you should be using an int or a long (you can't have a fractional count value!) Also, this should have been obvious to you, when you had to cast the value to an int for use with your lists. (Using double as an index is a very bad idea... And before you go posting the question, do a search on why floating point precision may not give you the results you expect)
    4. Code defencively... e.g. in your meanDouble() method, you set nonNull to 0, and then you do a division using that value. What do you think is going to happen if your loop doesn't execute once? Division by zero... You should handle these cases, rather than letting them fail ignominiously.
    5. If you are doing code like this...    if (currentDouble != null) {
            // / nothing to do
        } else {
            nbNull++;
        } Why have the empty block? You should just do the inverse.
        if (currentDouble == null) {
            nbNull++;
        } Far simpler, and expresses exactly what you are trying to do, not what you are not trying to do.
    6. Enumeration --- What version of java is that course being run in? I can see that you are using autoboxing, so it has to be 1.5 so, WHY is your lecturer encouraging the use of Vectors, Hashtables, and Enumerations!?!?!
    Anyway, that should be enough to be going on with.

  • Utilising calendar class

    Hi all,
    I am trying to retrieve a file with lowest timestamp from a set of files. The timestamp is contained in the filename.The following code gives the method Im using:
    public String sortFilesByTimeStamp(Vector vec)
            String currFileName, selectedFile=null;
            int year,month,date,hours,mins;
            Calendar givendate=Calendar.getInstance();
            Calendar currdate=Calendar.getInstance();
            System.out.println("Currdate:"+ currdate.getTime().toString());
            if(vec==null)
                return selectedFile;
            for(int i=0;i<vec.size();i++)
               currFileName=(String)vec.get(i);
               if(currFileName!=null)
               year= Integer.parseInt(currFileName.substring(4,6));
               month=Integer.parseInt(currFileName.substring(6,8))-1;
               date=Integer.parseInt(currFileName.substring(8,10));
               hours=Integer.parseInt(currFileName.substring(10,12));
               mins=Integer.parseInt(currFileName.substring(12,14));
               givendate.set(year,month,date,hours,mins);
               System.out.println("GivenDate:"+givendate.getTime().toString());
               if((givendate).before(currdate))
                   currdate=givendate;
                   selectedFile=currFileName;
            return selectedFile;
        }  The vector passed to the method contains an array of strings.
    However, when I run this, with the following values:
    ABCD0709100600
    ABCD0709100800
    ABCD0709090700
    the file returned is ABCD0709100600 when it has to be ABCD0709090700
    am I doing something wrong here?
    or is there any better approach to do this?
    thanks in advance!

    Aren't the strings already sorted in the correct order? Then why bother converting them to Calendar objects to do the conversion? And also, why write your own code to find the first? I would do this:Collections.sort(vec);
    return (String) vec.get(0);

  • Session attributes

    I have a JSP page that calls itself multiple times and passes information back to itself using a vector passed as a session attribute. I am attempting to clear the attribute by using the removeAttribute() method and also calling the setAttribute() method and assigning an empty vector when the page is first called.
    If after populating the session attribute I move to another page ("page X") and then come back, the page appears to have cleared the attribute/vector, but when I submit the page unto itself again the attribute/vector appears with the new information that I just passed to it ALONG WITH the old information assigned from my initial call before going to "page X". I would like to clear the information if the page is called from a page other than itelf, but somehow the old information is still being saved in the session.
    Anyone know what I'm doing wrong?
    Thanks for your time.
    Matt

    Thanks for the help. I have pieced out the part of the page where I attempt to reset the vector. Hopefully it is not too out of context to make any sense.
    Assumptions:
    - daySelected is a form object in this page (used to determine if page is called by itself
    - workWeek is a vector of "workday" objects populated by this page
    Code below:
    if(request.getParameter("daySelected") != null){//page called by itself
    //retrieve the workweek object from the previous version of this page
    workWeek = (Vector) session.getAttribute("passedWorkWeek");
    //dayIndex = 0-6 (Sat-Fri)
    dayIndex = Integer.parseInt(request.getParameter("daySelected"));
    if(request.getParameter("hourType").equals("In")){  //Time In
    input = request.getParameter("hourin").trim() +":"+
    request.getParameter("minuteIn").trim()+
    request.getParameter("AMPMin").trim();
    ((WorkDay) workWeek.elementAt(dayIndex)).setTimeInEntries
    (input);
    }else{//hourType="Out" = Time Away
    input = request.getParameter("outHours")+"."+
         request.getParameter("outFracHours") + " "+
         request.getParameter("outType").trim();
    ((WorkDay) workWeek.elementAt(dayIndex)).setTimeAwayEntries (input);                                              
    session.setAttribute("passedWorkWeek",workWeek);
    }else{//if page not called by itself or Clear Hours selected
    //clear any existing vector and session attribute
    workWeek.clear();
    session.removeAttribute("passedWorkWeek");
    //the above lines seem redundant as I am setting the attribute again, but nothing seems to work consistently
    //Create empty vector for workWeek
    for(int i=0; i<7; i++){
    workWeek.addElement(new WorkDay(weeksDates,"", "", ""));
    session.setAttribute("passedWorkWeek",workWeek);

  • Flash file is too big! Have tried everything!

    I am making a simple file with three images looping. I drew the images in Illustrator and have saved them as bitmap, jpeg, eps, png, gif...in varying sizes, I have put the resolution down to 70, I cannot get teh file any smaller than 670kb and max size for submission is 250kb.
    Ive read to use vectors instead of raster, but how do I save a file in illustrator so that it is considered still a vector?
    Is this what I need to do? Nothing fancy in my video, just less than 200 frames at 24fps
    Please help! The deadline for my project is in a couple days!
    [email protected]

    The biggest factor in file size is often the physical dimensions of the image. A 320 x 240 image uses 1/4 the pixels that a 640 x 480 image does, so file size is MUCH smaller.
    So the first thing is to design the image in the exact physical dimensions needed. NEVER scale the image after you add it to Flash.
    All the file formats that you mentioned are pixel based... bitmaps... so they will not work like a vector passed image... as one created (drawn) directly in Flash.
    Can you directly import into the Library the Illustrator (vector) image file? Then you can bypass the pixel based bitmap.
    Best of luck!
    Adninjastrator

  • EXR and RPF rules for alpha and color management?

    How can I change the interpretation rules so that EXRs always import with straight alphas? They always import with Premulti now.
    Also, I want to always turn off color management (Preserve RGB) for RPFs. (I use RPFs for my motion vector passes and color management always throws off the blur with ReelSmart)

    How can I change the interpretation rules so that EXRs always import with straight alphas? They always import with Premulti now.
    AE is just obeying the original EXR spec, which suggests all colors are premultiplied. If the Alpha channel is not specifically tagged as unpremultiplied, that's what AE will use.
    Also, I want to always turn off color management (Preserve RGB) for RPFs. (I use RPFs for my motion vector passes and color management always throws off the blur with ReelSmart)
    Similar to the previous, I'd say. The fault is probably with the program not creating a linear motion vector pass in the first place and thus the pass having a Gamma bias or else you wouldn't see those shifts. And I wouldn't use RPF... If you render your RGB to EXR, you can do so for the motion pass as well. EXRs per spec store colors linearly, which might also help to avoid your issues.
    Anyway, I'm not aware of globally changing any of that from the AE end. As I was trying to explain, the program is more or less behaving correctly based on assuming the files you feed it comply with certain standards....
    Mylenium

  • Illegal Operation

    I'm getting a constant illegal operation after loading 6 textfields from an access97 database. The data loads fine but after about 10 seconds the error appears. The error appears immediately if I initiate the following code. I'm using Visual Cafe' ver 4.1a standard edition as my editor with Win98 600mb memory PIII 667mh Millennia
    public Vector getAllEmployees(){
    //Declare Method Variables/Objects
    Vector allEmployeesVector = new Vector();
    //Pass DSN to constructor of DatabaseConnect
         DatabaseConnect DB = new DatabaseConnect("Emp");
         System.out.println("In Get All Employees....");
         try{
         String theSQL = "SELECT * FROM tblEmployee";
         ResultSet theResult = DB.queryDatabase(theSQL);
         while(theResult.next()){
         Employee E1 = new Employee();
         E1.setEmployeeID(theResult.getInt("EmployeeID"));
         E1.setEmployeeName(theResult.getString("EmployeeName"));
         E1.setEmployeeAddress(theResult.getString("EmployeeAddress"));
         E1.setEmployeePhone(theResult.getString("EmployeePhone"));
         E1.setPayMethod(theResult.getString("PayMethod"));
         E1.setnDeptID(theResult.getInt("nDeptID"));
         //Debug Trace
         System.out.println(E1.getEmployeeID());
         System.out.println(E1.getEmployeeName());
         System.out.println(E1.getPayMethod());
         System.out.println(E1.getEmployeePhone());
         System.out.println(E1.getPayMethod());
         //Add to Vector
         allEmployeesVector.addElement(E1);
         }catch(SQLException se){
    System.out.println("getAllEmployeesMethod error : "+ se);
    return allEmployeesVector;
    void JbtnClear_actionPerformed(java.awt.event.ActionEvent event)
              JbtnAdd.setVisible(true);
              JtxtEmpId.setText("");
              JtxtEmpId.setVisible(false);
              JtxtName.setText("");
              JtxtAdd.setText("");
              JtxtPhone.setText("");
              JtxtPay.setText("");
              JtxtDept.setText("");
              JlblFormHeading.setText("");
    JAVAW caused an invalid page fault in
    module <unknown> at 0084:1f909400.
    Registers:
    EAX=05ac0654 CS=0167 EIP=1f909400 EFLGS=00010297
    EBX=05ac1330 SS=016f ESP=04ddf650 EBP=04ddf670
    ECX=05ac0e60 DS=016f ESI=05ac0e60 FS=67f7
    EDX=05ac0e60 ES=016f EDI=00000000 GS=0000
    Bytes at CS:EIP:
    Stack dump:
    1f7d792e 052a2810 00000000 83540000 007d2f10 0068a060 00000000 00000000 04ddf6c8 1f7d7866 05ac0e60 00000000 00000010 0180a180 007d2f10 502d29b8

    Windows 98. Used to drive me crazy with those "invalid operation" messages. It's not a Java problem, it's just something that happens to Win 98 after you've loaded enough complex pieces of software onto it. Senility or something like that. If you have the stomach for it, reinstall Windows and the software you need; better still, install Windows 2000 (looks like you have enough hardware to run it).

  • Animating effects

    Hi.
    I have found a decent tutorial on creating heat haze and the results are exactly what I want.  I have created animations in 3DS Max and then imported file sequences into AE to add the heat haze.  This is great when the camera is not moving and when the hot components in my scene are "static" (location wise).
    Q.  If I have a moving camera panning around the scene and I also have hot objects that are moving around the scene, what is the best way to animate my heat haze effect to follow the hot objects and change size with them.
    This is the method for the heat haze that I am using:  Creating heat distortion and shimmer with After Effects
    Many thanks,
    T

    You will need to create custom passes in your 3D program using particles and placeholder geometry. Typically UV passes, motion vector passes, normal passes and custom point position passes are used for this in combination with object buffers to determine positions of pixels or apply reverse mapping techniques and generates masks and mattes. Sometimes VFX companies even go so far as to simulate the actual heat flow using fluid simulations and output the direction vectors or point clouds... And then of course depending on the camera move a bit of manual keyframing, masking and tracking will do many times. It's not that most people will notice the difference as long as there is no obvious drift...
    Mylenium

  • Problem occures after editing the JTable....

    Before understanding problem, let understand my logic first --
    I m writing code for 'find' functionality, which works exactly same as find (ctrl+f) in any document or table...
    - In my case I m applying it on JTable it follows the steps bellow .
    - Enter word to search in a GUI & click on find or find all
    Internal working as :---
    - take JTable instance..
    -pass it to function which detects the occurrence of 'search word' in a JTable cell.
    - save rows & columns no. of all occurrences in a vector
    - pass the vector to cell renderer, which ll high light the occurrences with blue color.
    - update table UI using "table.updateUI()".
    Now my problem is :--
    The code works fine & doesn't gives any problem until I do not edit the cell of JTable displayed on screen...
    If I edit the cell & then try to search a particular word in the table then it ll not work properly & shows message "Word not found".(Which actually displayed if the word count is zero in the table).
    Code is too large so I am not pasting here....
    Any suggestion or clue will be appreciated....
    Thank you very much in advance
    Suyog

    Code is too large so I am not pasting here....If you need further help then you need to create a [Short, Self Contained, Compilable and Executable, Example Program (SSCCE)|http://homepage1.nifty.com/algafield/sscce.html]
    that demonstrates the incorrect behavior, because I can't guess exactly what you are doing based on the information provided.
    Don't forget to use the [Code Formatting Tags|http://forum.java.sun.com/help.jspa?sec=formatting] so the posted code retains its original formatting.

  • The mystery of the vanishing variables...

    Hello,
    I've got a bit of a problem re data that vanishes from some of my Vectors.
    One class - Transfers - in its update() method, sends data in 2 Vectors to classes Tracking, and Reserve, in that order.
    public class Transfers
      update()
       new Tracking(vec1, vec2);
       new Reserve( vec1, vec2);
    }Class Tracking's constructor receives the 2 Vectors sent to it so:
      public Tracking(Vector vec1, Vector vec2)
       this.vec1 = vec1;
       this.vec2 = vec2;
      }Once all processing has been done in Tracking, I remove all data elements from the vectors passed to it.
    Program flow then passes to the Reserve class, which receives the same 2 Vectors that were passed to the Tracking class.
    But, at this stage, there is no data in vec1 or vec2 to pass to the Reserve class.
    It seems to me that when the data in Tracking.vec1 and Tracking.vec2 was deleted, the same happened to the data in Transfers.vec1, and Transfers.vec2. But why? Surely, it's only a copy of the data in the Transfers Vectors that is being passed to Tracking and Reserve?
    What can I do to prevent the data in the Vectors from vanishing?
    Thanks,
    Hasman.

    The next can be an example. ArrayList is used instead of Vecter.
    // import java.util.*;
    public class H {
    public static void main(String[] args) throws java.lang.Exception{
    ArrayList list = new ArrayList();
    list.add(new A(0));
    list.add(new A(1));
    list.add(new A(2));
    /*ArrayList scopy = new ArrayList(list);// data is changed in this case if those in the original "list" are changed
    ((A)list.get(1)).change(100);
    for(int j=0;j<scopy.size();j++){
       System.out.println(((A)scopy.get(j)).n);
    ArrayList dcopy = new ArrayList(); // in this case data is not changed
    for(int j=0;j<list.size();j++){
       Object a = ((A)(list.get(j))).clone();
       dcopy.add(a);
    ((A)list.get(2)).change(1000);
    for(int j=0;j<dcopy.size();j++){
       System.out.println(((A)dcopy.get(j)).n);
    }// end of class H
    class A implements Cloneable{  // instances of this class will be stored in ArrayList
    public int n;
      A(int i){
         this.n = i;
      public void change(int m){
         this.n = m;
      public Object clone(){
         return new A(this.n);
    }

  • Problem in passing vector from an applet to servlet

    Hi,
    I m facing problem in reading an object in the servlet (that i send from an applet). I have used BufferedInputStream ... The servlet reads the object but it takes about 30 seconds to do this ... If i don't use BufferedInputStream, it gives an "error reading inputstream header" ... if i use it, it take 30 seconds ... i m using netscape ent. server 4.0 ...
    Servlet code is as follows :
    try {
    InputStream in = req.getInputStream();
    inputFromApplet = new ObjectInputStream(new BufferedInputStream(in));
    saveVector = (Vector)inputFromApplet.readObject();
    I don't understand why it takes so long ... is there any other way ? Please help on this ... you may email me on [email protected]
    Thanks in advance..

    When you send a Vector through a stream, it must not only pass the Vector itself, but all the objects that the Vector refers to, all the objects that those objects refer to, and so on. Combine all this data with a slow internet connection, and passing what may seem like a small Vector could take minutes or hours.
    Are you sure you're passing a very small amount of data over a fast connection?

  • How do I convert a Vector to be passed into the session

    Hi I have a vector in a JSP that I need to pass on to a second JSP. I use the following command to do that just as I pass normal other strings:
    session.setAttribute("MyVector",vecData);
    But the follwoing error is been thrown by Tomcat.
    Incompatible type for method. Can't convert void to java.lang.Object.
    out.print(session.setAttribute("ResultsSet",set));
    ^
    I guess I have to convert it explicitly into an object and then how do I do that? could someone please help me fast on this?
    if this doesn't work is there some other way to send this vector to my other page? I am currently sending enough strings using the above method, but for Vectors it doesn't seem to work though I am told that a session object can carry any object unlike the request object that carries only strings. Please help!!!!

    Hi Calin thank you so much for taking ur time to help me with my problem.
    well let me explain my requirement fully in detail. JSP1 has a form on it for the user to fill in. its in the form of a table with multiple rows. say as in entering product details one after the other in an invoice.
    I want each of these rows taken in and passed into JSP2.
    What I do is pack each row of the table into a hashtable using a 'for' loop.
    Then I add each record (within the 'for' loop) to a Vector. After the 'for' loop, outside of it, I set this Vector to the session as :
    session.setAttribute("RecordSet",vecRecordSet);
    Well let me copy paste and extract of the coding from my source which shows what I have done.
    Vector set=new Vector();
    for (int i=0;i<Integer.parseInt(request.getParameter("NoOfRecords"));i++)
    Hashtable Record=new Hashtable();
                   Record.put("ReminderStatus",ReminderStatus);
                   Record.put("CustomerNo",CustomerNo);
                   Record.put("CustomerName",CustomerName);
                   Record.put("Address",address);
                   Record.put("ContractNo",ContractNo);
                   Record.put("MachineID",MachineID);
                   Record.put("ModelNo",ModelNo);
                   Record.put("Description",description);
                   Record.put("SerialNo",SerialNo);
                   Record.put("ContractValue",ContractValue);
                   Record.put("NoOfServices",NoOfServices);
                   Record.put("ContractStartDate",ContractStartDate);
                   Record.put("ContractEndDate",ContractEndDate);               set.add(Record);
         session.setAttribute("ResultsSet",set);//SHERVEEN
    well don't worry about the for loop condition up there cos it works for the main functionality that exists within the for loop. but what seems to go wrong is when I add records to the hashtable and when I pack it to the Vector "set"
    I hope I have not done something wrong as a principle over here.
    And btw the error that I showed u before, is pointed at a row which exists in the file that is generated when compiled. the out.println part is generated in that file during compilation and I don't know why.
    I hope I have given u information for u to make some sense of my requirement and thank u a million once again for ur effort to help me out. I am grateful to all of u.

  • Storing resultset data to vector and then passing this data to JList

    hi every body I am facing this problem since two days I tried but could't get correctly,I am new to java and I need to pass the result set data from the database to a JList having JCheckBox
    I think I need to store the resulsetdata to a vector or array
    I tried but could't solve the problem
    I tried but could't get it
    please do help me out
    need some sample code for passing resultset data to JList having JCheckBox anybody please help me out
    thanking you,
    with regards

    hi guys any body please help me out
    need a sample code for the first thread which i had the problems
    trying but could't get that correctly,please please do help me out,
    do help me out as I am new to java need some code snippet java gurus
    thanking you,
    with regards

Maybe you are looking for

  • ISE 1.2 - cannot delete AD group

    Hi all, I have a standalone node, ISE 1.2, in our lab which is joined to the AD. By accident I added an invalid AD group, and when I try to delete the group and "Save Configuration", the ISE responds: "Error: One or more of the groups being deleted

  • Can anybody help me with that crash report?

    Process:         Logic Pro X [522] Path:            /Applications/Logic Pro X.app/Contents/MacOS/Logic Pro X Identifier:      com.apple.logic10 Version:         10.0.0 (2911.1) Build Info:      MALogic-2911035000000000~1 Code Type:       X86-64 (Nati

  • Star schema versus snowflake schema

    I have a question regarding dimensional data modeling. My question here is, when star schema model would be useful and when snowflake schema model would be useful. In star schema, we have only fact and it is connected with dimensions. But in snowflak

  • OID error while starting the dcm-daemon service on Oracle Infra

    Not able to login to OID eventhough the service is up in OracleInfra but the dcm-daemon is down and giving the problem and tried to bring dcm-daemon but throwing error $ ./opmnctl startproc ias-component=dcm-daemon opmnctl: starting opmn managed proc

  • Aperture 1.5.2 white balance broken and render it totally useless!!!

    I really like Aperture a lot. However, Aperture is totally screwed up in white balance. I have been using Aperture for a few months now, but I don't seem to have found any work-around for its erratic white balance. I shoot using a Nikon D200. To veri