This week's book giveaway is in the General Computing forum.
We're giving away four copies of Learning Regular Expressions and have Ben Forta on-line!
See this thread for details.
Win a copy of Learning Regular Expressions this week in the General Computing forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

non-networked and network mode  RSS feed

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
non-networked and network mode
It is said I must finish non-networked and network mode in the the assignment.
Does it means if the users select non-networked, he should browse fold in his computer and select the right data-file by a "open file Dialog"
and
if the users select network, in a textfield, he should input IP address which belong the remote computer??
Is it right??
 
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Does it means if the users select non-networked, he should browse fold in his computer and select the right data-file by a "open file Dialog"


Yes.


if the users select network, in a textfield, he should input IP address which belong the remote computer??


IP or host name and the port number that the server listens to.
Nick.
 
yi lu
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How the program know if the selected db-file's format is the right one?
Should a verify be needed? and how?
[ December 26, 2003: Message edited by: hgf hgf ]
[ December 26, 2003: Message edited by: hgf hgf ]
 
author and jackaroo
Marshal Commander
Posts: 12218
279
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hgf
Welcome to JavaRanch.
We don't have many rules here, but one we do have is the JavaRanch policy on displayed names. We require you to use a real name as your displayed name (both a first and last name), which should preferably be your real name. Could you please change your displayed name to meet this policy? You may change it here.
There are a number of simple tests you can do to verify that the data file is indeed a data file. For a start, you can check that the magic cookie at the start of the file is the same as the magic cookie you have right now.
You can also check the size of the file: you have
  • one or more fields at the start of the file
  • the meta data (names and sizes of fields)
  • the data


  • The size of the file, less the size of the meta data and the initial fields, must be an even multiple of the size of a record.
    Regards, Andrew
     
    yi lu
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Thank you for your notice
     
    yi lu
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    what is magic cookie??
     
    Nicholas Cheung
    Ranch Hand
    Posts: 4982
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    A magic cookie, in this assignment, means the identifier (here is the number) that used to recongize a file that is the correct/required database file.
    i.e. for example, if the magic cookie of your database file is 123, when I intentionally give you my database file (with magic cookie 456), your program should be able to identify that my database file is not the one that your application can understand, and prompts an error to the user (or me), asking him to provide the *correct* database file for your system to operate.
    Nick.
     
    yi lu
    Greenhorn
    Posts: 18
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    How to get the magic cookie of the db-file
     
    Ranch Hand
    Posts: 41
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    sounds like you need to review the spec.
    the magic cookie is not really a cookie (nor is it really magic, but let's not go there). It is an identifier for your database. It doesn't do anything at your end, but I suspect Sun use it to track the subtle variations in the assignments they give out.
    I think all you need to do is read the first n digits of your file, and that will be your magic cookie.
     
    With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    • Post Reply Bookmark Topic Watch Topic
    • New Topic
    Boost this thread!