Rahim Nathwani

Greenhorn
+ Follow
since Sep 19, 2005
Merit badge: grant badges
For More
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 Rahim Nathwani

Head First java is good. There are also a lot of free content online, YouTube Udemy has free courses as well
RN
3 years ago
Hi Jamiel,

Congratulations on your book, looking forward to reading it.

Besides reading your book, what other resources or recommendations would you have for us to look into? I am fairly new to Blockchain and find myself going down some rabbit holes

Thanks
RN
3 years ago
Thanks guys,

Just so I am clear - There is 2 requirements

1. Business where I show the user the exact match via the GUI
2. Data class req, where I return "beginning with" matches

Thanks
Rahim
I was confused about the find/search requirment but after searching a few posts, I'm even more confused . Hope you guys can help me clarify it

The requirement in the interface is as follows:

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

The requirment in the document:
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.

The way I was going to implment this was too as per Roel's post long time ago:
GUI contains 2 fields: one for location and for name. So the user has 4 possibilities:
- retrieve all hotel rooms (leave both input fields empty)
- search on a name (enter a value in the input field name and leave the input field location empty)
- search on a location (enter a value in the input field location and leave the input field name empty)
- search on both name and location (enter a value in both input fields)

The thing that is confusing me the most is that in the interface states that "value that begins with criteria[n]. (For example, "Fred" matches "Fred" or "Freddy".)" but in the document search "records where the name and/or location fields exactly match values specified by the user" - These seem to say the opposite - Any thoughts to clarify this for me

Or how did others implement the search?

Thanks

Take a look at the FAQ - There is an app that you can run on your DB file. This will help break down the requirements
Hi jeremy,

You got it with the WTF --- Too many

I'm working on UrlyBird - Room rental. I have decided exactly what you did as far as the search. I am searching anything which started with the specified search term. So if the search is "Fr" --> returns "French", "Fred" ---> NOT "fred" ie. Case sensitive

Marcelo,

I have understood the search as you have. I don't think that we need a search on every column. Love for someone who has passed the certification doing it this way to conform.
I just realized something in my assignment

The instructions.html states:
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.

The DB intergace states:
// Returns an array of record numbers that match the specified
// criteria. Field n in the database file is described by
// criteria[n]. A null value in criteria[n] matches any field
// value. A non-null value in criteria[n] matches any field
// value that begins with criteria[n]. (For example, "Fred"
// matches "Fred" or "Freddy".)


public int[] find(String[] criteria) {
return null;
}

Which search do I do? Match exactly or "Fred" results in a return of "Freddy"?
Sorry number 4 has a typo:

4. criteria{"Fr","Ed",null,null......} - Display all records that name starts with "Fr" AND location starts with "Ed"

thanks
For the requirment:
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.

My interpretation for the method find(String[] criteria):
1. criteria{null,null,null,null......} - Display all records
2. criteria{"Fr",null,null,null......} - Display all records that name starts with "Fr"
3. criteria{null,"Ed",null,null......} - Display all records that location starts with "Ed"
4. criteria{"Fred","Ed",null,null......} - Display all records that name starts with "Fr" AND location starts with "Ed"

I'm not sure if point number 4 is correct - Anyone have thought about this requirement?

Thanks
Nevermind Kai - I figured it out

Thanks for the help
Hi Kai,

Can you suggest a way I can do it?

Thanks
Hi all,

I am working on UrlyBird 1.1.1

The assignment says Data must implement interface DB.

So in my data class i have a method:
public int create(String[] data) throws DuplicateKeyException{}

I really like Kai's idea of throwing a UnsupportedOperationException instead of accessing the file and creating a record etc....

Do I break any rules is I change the mothod signature in Data.java to:
public int create(String[] data) throws DuplicateKeyException,UnsupportedOperationException {}

I was under the impression that I can't mess with the method signature if it comes from interface DB. I think I might be misunderstanding this

Thanks
Thanks everyone,

I will not hardcode it!

Roy - Can you explain the following further:

"so I also needed to have some sort of seperate schema which matches the data file"

Thanks
Hello All

The assignment desciption tells us the format of the file and the database schema.

So it is fair to hard code these values into my assignment.

For example:

Hotel Name is 8 bytes
City is 8 bytes

I have a class HotelRoom with varables

static final int HotelNameSize = 8;
static final int CityNameSize = 8;

Thanks
Looking for contract work in Edmonton AB Canada PT/FT

I have four years experience in the information technology field with a focus on application development and maintenance using Java and J2EE.

Thanks
17 years ago