 |
 |
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
|
|
|
|
 |
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
}
}
|
|
|
|
 |
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 2 days ago.
|
|
|
|
|
 |
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?
|
|
|
|
 |
I want to know, to what extend a XML file can store data???
Means the string limitations, data types and so on.....
-Toywarrior
|
|
|
|
 |
Limitations are based on users of the xml not the xml itself.
1. Java can't have a string greater than Integer.MAX (or whatever it is called.)
2. A file can't be bigger than the file system.
3. Java can't occupy more than the allowed user addressable space.
For the second of the above if you are close to those limits than it is unlikely that an XML file is an optimal choice for data storage.
|
|
|
|
 |
So, can I actually store images(any medai) in XML file, I want to actually know this...
-Toywarrior
|
|
|
|
 |
Shrikshel wrote: can I actually store images(any medai) in XML file You could, but that is not what XML was designed for. Images are better stored as files, or BLOBs in a database.
|
|
|
|
|
 |
Shrikshel wrote: So, can I actually store images(any medai) in XML file
Can you - yes.
Should you - I seriously doubt it.
Without knowing any thing about what you are doing and presuming you don't want to use a database then if it was me I would use files for each image and perhaps keep meta data in the xml file (such as a pointer to the file path on the file system.) Keeping in mind however that doing that is basically the same as creating a database.
|
|
|
|
 |
OK. I got it.
Thanks...
-Toywarrior
|
|
|
|
 |
Hi,
i've a web application which has mysql quesry browser as backened,in database i've stored image data using longblob as datatype with the help of inputsteam.
the application is for peproposal kind of stuff where user get list of question, on selection of question will get answer consist of images that diplayed on one msword .
Now every thing is getting fine but list of answer from database not able to be printed on msword one after another instead last answer get only displayed below is code snipet so please provide any solution .
Thanks in advance,
public Object mapRow(ResultSet rs, int arg1)
throws SQLException {
for(int k=0;k<answers.length;k++){
DomainForm d = new DomainForm();
d.setAnswer(rs.getBinaryStream("Answer"));
InputStream s = (InputStream)d.getAnswer();
System.out.println("This is S values:"+s);
answers[k]= s;
}
return null;
}
});
}
try {
Vector v=new Vector();
for(InputStream is : answers){
v.add(is);
System.out.println("ele"+is);
}
System.out.println("elements"+v.elements());
Enumeration e=v.elements();
SequenceInputStream sis = new SequenceInputStream(e);
byte[] buffer1 = new byte[1024];
int size1 = 0;
response.setContentType("application/msword");
while ((size1 = sis.read(buffer1)) > 0) {
response.getOutputStream().write(buffer1, 0, size1);
}
response.getOutputStream().flush();
sis.close();
} catch (IOException e) {
e.printStackTrace();
}
return ans;
}
|
|
|
|
 |
How can i develop an application on a phone without an internet. The banks used it here in South Africa (FNB). Please guide me.
Jimoh H.A
|
|
|
|
 |
You don't seriously expect anyone to be able to answer such a wide ranging question in a technical forum? For a start we have no idea what type of phone you are planning to develop for, or what system you hope to connect to, all of which will affect what you need to do. Start by doing some research into the phone system that you want to use, and the possible interfaces available to the bank(s) you wish to work with.
|
|
|
|
|
|
 |
I doubt that anyone here is going to provide such a tutorial. Go back to the Jasa site and use the links under Contacts and Support.
|
|
|
|
 |
Hello,
Please have a look at readme.md[^] file available with JASA source code.
Regards,
Prasad P. Khandekar
Knowledge exists, man only discovers it.
|
|
|
|
 |
Message Automatically Removed
|
|
|
|
 |