|
SoMad wrote: left the name of your professor in the post
I'm sure Professor Bexhet Kamo would like to be told one of his students is cheating
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
If I was Professor Bexhet Kamo, I would already be a member on CodeProject, scanning through messages to see if my students were trying to cheat
Soren Madsen
|
|
|
|
|
I teach college courses from time to time and, yes, I check here and fortunately I have not seen anyone in the past 6+ years of my teaching, try to do their homework on here.
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
You mean the one at Polytechnic University of Tirana, whose email address is found in the first Google link?
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Yes sir, I'm thinking that is the one
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
But it's OK really, because he's not a Code Project member (under that name).
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Sure I'll help you. I formatted the text a bit - it's easier to read that way.
Feel free to come back and ask specific questions. We will help you in defined problems, but we can not do homework. Unless we get paid. well paid.
Java RMI JDBC Programming Practice
Title: Java RMI JDBC Program for Automating and Controlling Access to Buildings
Delivery Date: June 25th, 2012
The objective of this practice is to gain skills in Java distributed programming and assimilate the main concepts and techniques of RMI JDBC programming and SQL
database programming.
An enterprise has a number of buildings in a Campus. Each building has a name that
identifies it and a number of gates to access it. Buildings have floors. Each floor can be
accessed from different gates and has a number of rooms (offices, labs, etc.). The employees of an enterprise are given access to some buildings, and within a building they are given access to some floors and within a floor they are given access to some rooms.
The enterprise is interested to develop software that would automate the controlled
access to buildings and would permit the enterprise to monitor the access of
employees, the time the employees stay in the enterprise’s facilities, etc.
You are requested to design and implement a program in Java RMI JDBC that enables
automatic access of employees to the buildings of the enterprise. The objective of this
practice is to develop a client/server program in Java RMI JDBC that offers to the employees (remote clients) the following options through a contextual menu 1:
1. Connect a remote client to the server application: A client (employee) requests to
enter the application by providing its username and its password.
1.1. if the username and password (verified at the database) are correct, the client
enters the program and the options are shown to him.
1.2. the username or password (verified at the database) are incorrect, the server
should notify "You don’t have access to the application".
2. If identified correctly, a client (employee) can access any facility he/she has access to
2 in the enterprise’s facilities. For that, the client is requested to go through the
following steps:
2.1. Access to a building:
2.1.1. the employee is requested to provide: his ID, the name of the building
and the access gate number of the building.
2.1.2. based on the data, the server checks if the employee has granted access
to the building. If yes, he receives the message "Access permitted to
1 A Graphical User Interface (GUI) is not required, but would be positively evaluated. The GUI can be done following
a similar example program in the course materials.
2 In real life scenario the Access would be done with a ID card which stores the data; here we are simulating the process.
building " If not, he receives the message "You don’t have access to this building "
2.1.3. The employee can follow next step to enter a floor.
2.2. Access to a floor:
2.2.1. the employee is requested to provide the floor number and the access
gate of the floor.
2.2.2. based on the data, the server checks if the employee has granted access
to the floor. If yes, he receives the message "Access permitted to floor " If
not, he receives the message "You don’t have access to this floor "
2.2.3. The employee can follow next step to enter a room.
2.3. Access to a room:
2.3.1. the employee is requested the room number.
2.3.2. based on the data, the server checks if the employee has granted access
to the room. If yes, he receives the message "Access permitted to room Enjoy working"
3 If not, the employee receives the message "You don’t have access to this room "
3. Disconnect the user from application server: the employee leaves the building. The
server computes the time the employee has been in, and the employee receives
the message "You have stayed …. time in the building. Good bye "
For the application, you should design and implement a database. The database should
have tables to store the following information (and other information that you may
need for implementing the application):
• Employees: information on all employees (clients): Id, name, surname,
username, and password.
• Buildings: information on buildings and their access gates.
• Floors: information on floors of a building and their access gates.
• Rooms: information on rooms of a floor of a building.
• Accesses: access rights of employees to buildings, floors and rooms
To implement the program follow the steps below:
1. Design and implement the database in postgresql
2. Define the remote interface (only one remote interface in this case)
3. Implement the remote interface
4. Implement a Java server application
5. Implement a Java client application that uses the remote interface.
6. Compile all java sources (with javac) and further generate stubs and skeletons (with rmic)
7. Deploy and run the application (registry, server and one or more clients). For
running and testing the application you can use the localhost.
3 At this point, the server saves the entry time.
Notes:
o The practice should be necessarily done in groups of two students. No
changes are allowed once groups are established.
o You can use the java classes and source code of the examples used during
the course.
WHAT TO DELIVER:
You should deliver a zip file named surname1_surname2.zip with the following:
1. All java source files,
2. All objects .class files
3. Two sql scripts: one for creating the database, another one for inserting
registers (rows) in the tables of the database. The name of the database should be AccessControl
4. The config.properties file
5. A document (doc or pdf) including:
a. Title of the practice, authors and delivery date
b. Problem formulation and main aspects of the proposed solution
c. UML design
d. Database design (tables and relations, EntitydRelationship)
e. A selfdevaluation, indicating which objectives of the practice were achieved.
f. A manual with instructions on how to execute the program
TO WHOM TO DELIVER:
Deliver the zip file to Prof Bexhet Kamo
WHEN TO DELIVER:
On or before 25th of June 2012
CHEATING:
Attempts at cheating at practice will imply failure to enter the exam.
|
|
|
|
|
I know C# a little and I have an programming exam which is in Java, tomorrow. Therefore I'll be glad if you tell me what some of the equivalent statements of C# in Java mentioned below are. Thanks for your help.
Some of C# statements:
*** Console.WriteLine(string str)
*** Console.Write(string str)
*** Console.ReadLine(string str)
*** // Inheritance
*** // Polymorphism
*** // LinkedList
*** // Interface
*** // Overloading Operators/Functions
*** // Properties
And any other simple differences which you think I have to know. The exam itself is not a full-coding-type exam but it's not completely free of codes!
Thanks again
|
|
|
|
|
atoi_powered wrote: I know C# a little and I have an programming exam which is in Java, tomorrow
Too late. Far, far too late.
System.out.println(Object);
System.out.print(Object);
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
String input = null;
try {
input = br.readLine();
} catch (IOException ioe) {
System.out.println(ioe);
}
class Child extends Parent {
}
My advice is stay up all night and start reading. Fast!
Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett
|
|
|
|
|
You're right but the exam is algorithmic and it doesn't depend on bunches of codes! I don't know why but the professor asked us to write the coding problems in Java. I think it will be fun, wish me luck
|
|
|
|
|
I don't know whether you are a fast learner, but you could take a look at the Java Tutorials[^].
|
|
|
|
|
|
I need your help in java.
1)how to convert audio file into binary format in java.
2)Then that Binary converted audio file is to be matched in SQLServer 2005 Database .Which i have stored it in varBinary(MAX) format.
3)I want to match both files during authentication.
thank You!
|
|
|
|
|
Nileshbhoi wrote: how to convert audio file into binary format in java.
It's already in binary format. Maybe that is not really what you are asking for, please clarify.
|
|
|
|
|
And you really expect that when one man speaks a short sentence two times, all thousands of bytes will be exactly the same? Also the background noise will be same...
No, that will work not at all. Learn some basics about audio information, analysing audio, searching for similarities between audio data, etc.
|
|
|
|
|
|
how to save the text file to any directory...and suggest any new algorithm for encoding and decoding or explain discret markvo chain model
|
|
|
|
|
Basavaraj Neelagund wrote: explain discret markvo chain model
I chose the more difficult question first which can be explained here[^].
For the simple question you could try here[^].
|
|
|
|
|
Have you tried anything so far? If so show us here, we can comment on it if you have stuck on something.
If you've never failed... You've never lived...
|
|
|
|
|
hello
in my java program I excecute a command through the code => it works
but as I stepped into the prog : I found myself with a command that requires an answer after his execution
then by java program: I do not know how to answer but in the command line I responds with yes and it works
do you have any idea how to respond through the java code
I hope you understand the question:
Here's the code I use for execute command DOS :
public static String importer_certificat(String alias,String nom_certi,String nom_keystore,String pass_keystore)
{
try{
String b = "keytool -import -alias "+alias+" -file "+nom_certi+" -keystore "+nom_keystore +" -storepass "+pass_keystore;
System.out.println(b);
Process p = Runtime.getRuntime().exec(b);
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String inputLine, tous = "";
while ((inputLine = in.readLine()) != null)
{
tous += "\n"+inputLine;
System.out.println(inputLine);
}
return tous;
}catch(Exception e)
{
e.printStackTrace();
return e.getMessage();
}
}
thank you in advance
|
|
|
|
|
|
The OP is asking how to make the java code respond to a query from the process.
waitFor() isn't going to help with that.
|
|
|
|
|
ahmadiss wrote: (p.getInputStream()))
That gets what the normal application 'output'.
Now you need to send it 'input'.
So you use getOutputStream()
Also keep in mind that your solution will only work if the application outputs a very, very little amount of text. If it outputs large amounts then you will need to use threads for the IO and perhaps use waitFor().
|
|
|
|
|
how to convert a java file into a stand alone file
|
|
|
|
|
Your question is not clear, a Java file is already stand alone. Please try and explain what problem you are trying to solve.
|
|
|
|