Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!

paul seldon

Greenhorn
+ Follow
since Oct 26, 2006
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by paul seldon

Exception in thread "main" java.lang.NullPointerException
at suncertify.gui.controller.GuiController.getAllContractors(GuiController.java:96)



First thing first.
Starting with this null pointer exception to be gone.
And then would you post again?
I would like to help you.
If there is not "Must Not," then you can use it.
But you must specify choice.txt why you choose that over others.
what I have done is:
when user of this sw clicks the book button, dialog pop up,
that has a textfield and the user insert the number whichever it is.
(in this case, whatever... 8 digits)

and press one of the button called ok --> which close the dialog.

But, what I was concerned with is description in the paper.

< Sun's description >
The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale.



THE SYSTEM YOU ARE WRITING DOES NOT INTERACT WITH THESE NUMBER,
rather it simply records them.

What is the meaning here INTERACT WITH THIS NUMBER, and then record THEM?
Can one record the number without interact with this number?
Can that user (CSR) type this number be interact with this number?


It was very equivocal statement.
[ September 30, 2007: Message edited by: paul seldon ]
Perfect!

But, with webstart(jnlp), it can be web-application without any single thought...
That is exactly what I have understood at first.
But,

3. A null value in criteria[n] matches any field value.
example: a null value in criteria 3 matches all fields in column 3: r3,s3,t3,..



We define the field as each column. and matches all fields then logic flows to all columns...

I just need to make sure not leakage of this logic.

How about the first question?
John Stone, is it OK created with random number generator regarding customer number? or is it OK let user type the any arbitraty 8 -digit number?

< Sun's description >
The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale.



Why they can say clearer? Doesn it mean when the book button is pressed,
the random 8 digit number created and inserted into the column of customer holding? or Let Customer service Representative fill the arbitrary 8 digit number?


public int[] find(String[] criteria);
/1./ returns an array of record numbers that match the specified critieria.
/2./ Field n in the database file is described by criteria[n].
/3./ A null value in criteria[n] matches any field value.
/4./ A non-null value in critieria[n] matches any field value that begins with criteria[n]. (For example, "Fred", matches "Fred", "Freddy.")



I understand up to 1 and 2. what they said 3 and 4 confused with 2.
let's say table has 6 column :
No_0 | No_1 | No_2 | No_3 | No_4 | No_5 |
___________________________________________________

criteria[0] = null; // No_0 field
criteria[1] = null; // No_1 field
criteria[2] = null; // No_2 field
criteria[3] = null; // No_3 field
criteria[4] = null; // No_4 field
criteria[5] = "Fred"; // No_5 field


find method spec has input parameter as array of string.
it seems array size is the number of database field.
1 and 2 describes as if seperate search for each field.
And then 3 and 4 saying matches any field... Then why it has to be
in this seperated array criteria?


It will be really appreciated your opinion.
[ September 30, 2007: Message edited by: paul seldon ]
Andrew Monkhouse's book (SCJD with Java 5) but it doesn't seem
stating that. Of course, we can change the application into web using
webstart(jnlp) but the above personn is asking more specific clear answer not buy-the-book. I am still looking for the author's answer regarding web, but about 300 pages to go. MVC is nothing to do with better scalability toward the web direction. MVC is the design pattern for Client side.

Thanks -
It seems to me not all methods are about to use this assignment.
All the methods regardless of using it or not for this assignment,
have to be full-fledgedly coded? or only the one is about to use.
And the rest which is not going to implement for this assignment,
just put return 0 or return something appropriate for that particular methods spec and leave it.

Let me know.
< Customer holding this record owner 8 The id value (an 8 digit number) of the customer who has booked this. Note that for this application, you should assume that customers and CSRs know their customer ids. The system you are writing does not interact with these numbers, rather it simply records them. If this field is all blanks, the record is available for sale. >

should I have in GUI : customer id : (JTextField)
or without that, only book button and a record is selected, automatically generated id to be assigned owner field.
which way I must do?
"Header Information"
Is it from the start of the file to right before schema section,
right? When I print *.db file it comes out like below :
------------------------------------------------------------------------
< Instruction.html >
-> Start of file
4 byte numeric, magic cookie value. Identifies this as a data file
4 byte numeric, total overall length in bytes of each record
2 byte numeric, number of fields in each record

Schema description section.

------------------------------------------------------------------
< Result after reading dataInputStream>

Cookie value(4Byte) : 513
OveralLength(4Byte) : 183
NumberOfField(2Byte): 6

Each Record has :
name : 32
location : 64
specialties : 64
size : 6
rate : 8
owner : 8
Head Size : 70
----------------------------------------------------------------

70 means what? 70 byte for all header information?
How should I think of this?

Let me know. Thanks -
Since this instruction doesn't ask to implement delete and create, although the interface has those, can I left those empty as in interface.
< User Interface >
* It must allow the user to book a selected record, updating the database
file accordingly.

Does "updating" mean that I change the delete flag to 1?
ok - then,
----------------------------------------------------------------
package suncertify.db;
public interface DB {
...
public void delete(int recNo, long lockCookie)
throws RecordNotFoundException, SecurityException;
}
----------------------------------------------------------------

Since we have to think about scalability, there is a delete (),
in this delete case, let's assume we set the delete flag to 1.

Now, how we perceive this 1 in a data file from booking or deletion?

this flag is used for find(), which means the flag is set to 1, don't show
it into table, then yet another problem occurs, from ambiguous distiction,
from booking or deletion?

I think about set the value 2 for booking but then the definition of
flag fades out, doesn't it? flag 0 or 1.

Let me know the good insights.
Thanks -
"It must allow the user to search the data for all records, or for
records where the name and/or location fields exactly match values
specified by the user."


search the data for all fields, then what you are concerning is correct.
you can enter size for search, etc... all the field name would be there.
But, not field but records.

I can search all the records with name and/or location because those are the primary key of the database.