 |
 |
When posting your question please:- Choose the correct forum for your message. Posting a VB.NET question in the C++ forum will end in tears.
- Be specific! Don't ask "can someone send me the code to create an application that does 'X'. Pinpoint exactly what it is you need help with.
- Keep the subject line brief, but descriptive. eg "File Serialization problem"
- Keep the question as brief as possible. If you have to include code, include the smallest snippet of code you can.
- Be careful when including code that you haven't made a typo. Typing mistakes can become the focal point instead of the actual question you asked.
- Do not remove or empty a message if others have replied. Keep the thread intact and available for others to search and read. If your problem was answered then edit your message and add "[Solved]" to the subject line of the original post, and cast an approval vote to the one or several answers that really helped you.
- If you are posting source code with your question, place it inside <pre></pre> tags. We advise you also check the "Encode HTML tags when pasting" checkbox before pasting anything inside the PRE block, and make sure "Ignore HTML tags in this message" check box is unchecked.
- Be courteous and DON'T SHOUT. Everyone here helps because they enjoy helping others, not because it's their job.
- Please do not post links to your question in one forum from another, unrelated forum (such as the lounge). It will be deleted.
- Do not be abusive, offensive, inappropriate or harass anyone on the boards. Doing so will get you kicked off and banned. Play nice.
- If you have a school or university assignment, assume that your teacher or lecturer is also reading these forums.
- No advertising or soliciting.
- We reserve the right to move your posts to a more appropriate forum or to delete anything deemed inappropriate or illegal.
When answering a question please:
- Read the question carefully
- Understand that English isn't everyone's first language so be lenient of bad spelling and grammar
- If a question is poorly phrased then either ask for clarification, ignore it, or mark it down. Insults are not welcome
- If the question is inappropriate then click the 'vote to remove message' button
Insults, slap-downs and sarcasm aren't welcome. Let's work to help developers, not make them feel stupid.
cheers,
Chris Maunder
The Code Project Co-fou
|
|
|
|
 |
I want one enter data in two table from one html form .
Ex. 1 student have multiple mobile no.
please provide me solution.
Praveen Kumar
Software Developer (Java)
|
|
|
|
|
 |
anyone can help me here please :
Handling Biometric Fingerprint Attendance Device by using Socket (JAVA) Is that possible?! I try with Socket, BUT it does not executed with me!
Me Code is:
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.net.Socket;
import java.net.UnknownHostException;
public class Requester {
Socket requestSocket;
ObjectOutputStream out;
ObjectInputStream in;
String message;
Requester() {
}
void run() throws IOException {
try {
requestSocket = new Socket("192.168.0.19", 4370);
System.out.println("Connected to given host in port 4370");
in = new ObjectInputStream(requestSocket.getInputStream());
String line;
while (true) {
line = in.readLine();
if (line != null) {
System.out.println(line);
}
}
} catch (UnknownHostException unknownHost) {
System.err.println("You are trying to connect to an unknown host!");
} catch (IOException ioException) {
ioException.printStackTrace();
} catch (Exception Exception) {
Exception.printStackTrace();
} finally {
in.close();
requestSocket.close();
}
}
void sendMessage(String msg) {
try {
out.writeObject(msg);
out.flush();
System.out.println("client: " + msg);
} catch (IOException ioException) {
ioException.printStackTrace();
}
}
public static void main(String args[]) throws IOException {
Requester client = new Requester();
client.run();
}
}
f anyone could help me to communicate with the finger print device I will be grateful.
modified yesterday.
|
|
|
|
 |
Please refer to point 9 of the forum guidelines above.
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
 |
What does "it does not executed with me" mean; we cannot guess from this what is going wrong? Have you checked the documentation for the device to make sure your protocol is correct?
|
|
|
|
|
 |
Maheera Jazi wrote: I do not know where is the error in my code Well you need to use your debugger to check what is happening internally. But, more importantly, you need to be sure that the device is functioning correctly, and communicating with your PC. And for that you need to contact the device manufacturer for help.
|
|
|
|
 |
yes, thanks for your response please.But, question please, you mean that it is possible to use Socket Object to retrieve the data from Fingerprint attendance machine?! as in my code!?
|
|
|
|
 |
Maheera Jazi wrote: you mean that it is possible to use Socket Object to retrieve the data from Fingerprint attendance machine?! No idea. As I keep saying, you must read the documentation for the device; we have no idea how it works.
|
|
|
|
 |
ok, thanks! although this is not mentioned on the device documentation! I will try all roads!
|
|
|
|
 |
Forget what is not mentioned and focus on what is. You cannot create an application to use this device by guesswork, you need to study the documentation and follow what is says. If the documentation is not clear then go back to the manufacturers and ask for help.
|
|
|
|
 |
Hi everyone,
I have 1 question here?
Is there any way to call public method of a child thread from its parent class
from where it is created
eg.
public class ChildThread implements Runnable{
public ChildThread(){
}
public void run(){
}
public void doMethod(){
}
}
Now I'm creating multiple ChildThread in AnotherClass
public class Parent {
Thread t;
//variables
public Parent(){
//initialization
}
//statements
private someParentMethod{
//for some event1
t=new Thread(new ChildThread(),"name1");
t.start();
}
private doSomething(){
//some event1 for name1
//want to call doMethod() of ClildThread name1
}
}
|
|
|
|
 |
Short answer: YES.
long answer:
I would recommend to use childThread direct and a null-check before using the member variable t:
public class ChildThread extends Thread{
public ChildThread(String name){
super(name);
}
public void run(){
}
public void doMethod(){
}
}
public class Parent {
ChildThread t;
public Parent(){
}
private someParentMethod{
t=new ChildThread("name1");
t.start();
}
private doSomething(){
if(t != null){
t.doMethod();
}
}
}
regards Torsten
I never finish anyth...
|
|
|
|
 |
krishna_m wrote: Is there any way to call public method of a child thread from its parent class
Yes but I am guessing that you really do not want to do that.
Typically different threads do not communicate except very explicitly. Note that I said "thread" not class. If you want a thread to communicate with another thread then you first figure out what the best way to do that is and THEN you figure out which classes will do it (and how.)
|
|
|
|
 |
hi everyone,
I need java program for converting pdf file into excel file. please help me.
|
|
|
|
|
 |
1. find a library that reads pdfs.
2. Find a library that writes excel files.
3. Spend a LOT of time figuring out what to do with all the differences between pdfs and excel file.
4. Write code that implement 3 and uses 1 and 2.
|
|
|
|
 |
Hi colleague developers,
I've got a problem in communicating with serial port. In my applcation I have to receive some data from the serial port and to manage them for some operation. For now I'm just trying to write out the data received.
I've create a test class with main() that manage the connection (open the port, set the parameters) and starts a thread. The thread is started in this manner:
try {
(new Thread(new Lettore(port), "Lettore")).start();
} catch (Exception e) {
System.err.println("Errore " + e);
}
where the "port"parameter is the SerialPort object.
The "Lettore" class contains the follow:
SerialPort port;
public Lettore(SerialPort port) throws IOException {
this.port = port;
}
@Override
public void run() {
byte[] buffer = new byte[1024];
int len = -1;
try {
while (true) {
len = port.getInputStream().read(buffer);
System.out.print(new String(buffer, 0, len));
if (len != 0) {
port.getOutputStream().write(buffer, 0, len);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
In this case, the code in the thread seems to be never executed: no characters are show on the terminal and on the other station of the communication. On the other hand, if I write the same code of the run() function in the main, it works fine.
Someone has ever got this problem? Can anyone help me?
modified 27-May-14 3:57am.
|
|
|
|
|
 |
Dear Richard,
thanks for the reply. I made the thread runnable by "implements Runnable" on the "Lettore" class definition, now it works. Thank you very much!
The final code is this:
public class Lettore implements Runnable {
SerialPort port;
public Lettore(SerialPort port) throws IOException {
this.port = port;
}
@Override
public void run() {
byte[] buffer = new byte[1024];
int len = -1;
try {
while (true) {
len = port.getInputStream().read(buffer);
System.out.print(new String(buffer, 0, len));
if (len != 0) {
port.getOutputStream().write(buffer, 0, len);
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
|
|
|
|
 |
Hi guys, i wrote a desktop programm, that can send sms using a modem via seriaport...on netbeans i run my programm all is ok...i receive my sms on my phone!!...but once a creat an .exe, then i get error reported, i don't understand why...i don't know what to do, i've created my .exe using excelsior jet, and comm.jar for reading serial port....on netbeans i can easely clean and build my project , but once the .exe done i ain't get nothing ...please help!!..
|
|
|
|
 |
mtouxx wrote: please help With what? We know nothing about your program except that it does not work. Why not try running it as a proper Java class so you can use the debugger to find out what the problem is?
|
|
|
|
|
 |