|
Ok fellas,
I have edited and updated my main Question in this thread. Pls refer to it. can kindly assist? thanks.
DA: http://www.pohcbsonic.deviantart.com/
Blog: http://www.pohcbsonicx.blogspot.com/
Homepage: http://www.pohcbsonic.tripod.com/
modified on Sunday, October 4, 2009 11:51 PM
|
|
|
|
|
int indx = 9;
EndianUtils.writeSwappedDouble(BytetxtMsg, 2, reverse(number));
ByteBuffer bbuf = ByteBuffer.allocate(8);
Byte buffer is 8 and is constant i.e does not change lets call it b, so we have two variables the indx and the 2 in the endian lets call it x. The relationship would be indx = b + x; as the minimum acceptable value.
|
|
|
|
|
the problem is that:
EndianUtils.writeSwappedDouble(BytetxtMsg, 2, reverse(number));
you just fix it:
EndianUtils.writeSwappedDouble(BytetxtMsg, 1, reverse(number));
Double has 8 bytes.bbuf has 9 bytes capacity and begins with index zero.But your offset is 2,so its capaticy will not be enough. it will throw out of bound exception.
|
|
|
|
|
Ok, I've already solved the EndianUtils problem. But the following error still exists.
<small><br />
<br />
ERROR: SerialComm.Comms<br />
ERROR: null<br />
ERROR: SerialComm.Comms<br />
ERROR: null<br />
<br />
</small>
Although I did use the try and catch method to catch the above errors in my code, I still couldn't figure out why the problems exist.
<small><br />
<br />
try{<br />
<br />
<br />
connect("COM2");<br />
}catch (Exception e) {<br />
System.err.println("ERROR: " + e.getMessage());
<br />
}<br />
<br />
}<br />
<br />
<br />
try{ <br />
C1.sendBytes(BytetxtMsg); <br />
} catch (Exception e) {<br />
System.err.println("ERROR: " + e.getMessage());
<br />
}<br />
<br />
</small>
DA: http://www.pohcbsonic.deviantart.com/
Blog: http://www.pohcbsonicx.blogspot.com/
Homepage: http://www.pohcbsonic.tripod.com/
|
|
|
|
|
hi guys,
i have learnt java beginners fundamentals and concepts,i want to learn j2ee can i learn it using books or it should be learnt only in training centers.please help me out.
|
|
|
|
|
Sun has a lot of information; here[^].
Install netbeans and start creating.
Buy a book. Even if you decide to take a training course, buy a book it will always be useful.
Start learning the big concepts first.
97.35% of EE work is the same as SE; so don't sweat it.
Enjoy!
Panic, Chaos, Destruction.
My work here is done.
|
|
|
|
|
thanks for the information provided
|
|
|
|
|
i have a web application in struts. i want to use the tiles for that application.is there any possibility?
|
|
|
|
|
Yes it is and a nice guide for it Link[^]
Good luck
|
|
|
|
|
Hi,
I tried the code given to send mails using lotus notes. I want to try the code for multiple reciepients. I tried the solution given i.e using ";" to separate the email ids. But its not working. Its not working even for cc and bcc.
|
|
|
|
|
Ask the guy who implemented it Link[^]
Good luck
|
|
|
|
|
I want to create a PDF file having the inputs specified at console through Java. I do not want to use ready made libraries like iText etc.
I dont have to create sophisticated PDF's, i just want to write strings in the PDF.
I started off :
import java.io.*;
public class FileHandling
{
public static void main(String args[]) throws IOException
{
FileOutputStream fos=new FileOutputStream("file.pdf");
DataOutputStream dos=new DataOutputStream(fos);
DataInputStream dis=new DataInputStream(System.in);
String str;
System.out.println("enter string value");
str=dis.readLine();
dos.writeChars(str);
dos.close();
fos.close();
}}
But this is not working, i guess i am missing the specifications of the PDF. Please provide me solution for it, and a code would be highly obliged
|
|
|
|
|
I don't know why you don't like Itext[^]? Anyway there is no simple way to do it unless you want to implement it your self. A nice article to read here in codeproject utilizes PDF Generation using XSLFO and FOP[^] but if I where you I would stick to Itext a simple example:
import java.awt.*;
import com.lowagie.text.*;
import com.lowagie.text.pdf.*;
import java.io.*;
import java.util.zip.*;
public class TextToPDF{
public static void main(String arg[]){
try{
InputStreamReader in= new InputStreamReader(System.in);
BufferedReader bin= new BufferedReader(in);
System.out.println("Enter text:");
String text=bin.readLine();
Document document = new Document(PageSize.A4, 36, 72, 108, 180);
PdfWriter.getInstance(document,new FileOutputStream("pdfFile.pdf"));
document.open();
document.add(new Paragraph(text));
System.out.println("Text is inserted into pdf file");
document.close();
}catch(Exception e){}
}
}
18 lines of code what do you think? Better than 16+ don't you think?
Regards
|
|
|
|
|
akashj87 wrote: FileOutputStream fos=new FileOutputStream("file.pdf");
You need to understand that this does not create a PDF file. The extension of "pdf" means nothing to Java or to Windows/UNIX, it is merely a convention for humans to recognise the type of file, but the application still has to do the work to create the file.
The definition of DataOutputStream.writeChars() states that it Writes a string to the underlying output stream as a sequence of characters . The structure of a PDF file is much more complex than this (see the specifications on the Adobe web site). The easiest way to achieve your objective is use the tools that are available.
|
|
|
|
|
you can use Apache FOP without having to learn XSL-FO or complex API. Just put the data you want convert in a XML file and use this XSL FO generator to create the PDF file.
|
|
|
|
|
Hi Everybody !
I 've got some question about TTS:
1.Currently are there any Java Opensource can read German,French,...
2.Are there any free database Dictionary that we can download
(I prefered with English-Vietnamese,German-Vietnamese).
Thanks and regards !
|
|
|
|
|
eSpeak[^]
To use it in a Java application just call the Runtime.getRuntime.exec("command"); where command is what you want to hear. Example command might be cmd.exe /C %path of espeak%\\espeak "This is a test"
Good luck
|
|
|
|
|
Hi Member!
I've got the c++ source from the link you gave.
But when i compile(Using BorlandC), the compiler couldn't find two file:
getopt.h
speak_lib.h
i try to found these file in source, there no file name identical those.
How can i compile this code and which tool diffrent from BorlandC,...
I don't want to use the setup_espeak.exe because i just want to embed the exe file into my java app and the relative resource. So user needn't to setup this file.
Thanks regards!
modified on Wednesday, September 30, 2009 10:48 PM
|
|
|
|
|
Hi Everybody !
I found Jespeak.
I set the build path to the jespeak-0.2-alpha.jar
but when run the program, i got this Error:
JeSpeak Copyright (C) 2007 pjer at users dot sourceforge dot net
This program comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it
under certain conditions.
Exception in thread "main" java.lang.UnsatisfiedLinkError: no JeSpeak in java.library.path
at java.lang.ClassLoader.loadLibrary(Unknown Source)
at java.lang.Runtime.loadLibrary0(Unknown Source)
at java.lang.System.loadLibrary(Unknown Source)
at com.jespeak.JeSpeakNative.<clinit>(JeSpeakNative.java:25)
at com.jespeak.JeSpeakImpl.<init>(JeSpeakImpl.java:26)
at com.jespeak.JeSpeak.getInstance(JeSpeak.java:53)
at com.jespeak.JeSpeak.main(JeSpeak.java:125)
How can i fix this.
Thanks and regards !
modified on Wednesday, September 30, 2009 11:56 PM
|
|
|
|
|
Jespeak is not fully implemented yet thats why I referd you to espeak. Correct me if I am wrong but cant you include the espeak file in your application and call it from there by Runtime.getRuntime().exec("C:\\eSpeak\\command_line\\espeak.exe \"This is a test\""); ?
|
|
|
|
|
Hi member !
I knew the command to execute the espeak with the agruments.
(By the way, i want to ask you about the command you gave,
1.which language espeak will speak?
2.If i want espeak speack read german or french, with command argument for the language?
)
But i download the setup_espeak.exe, so if i want to use the espeak.exe i must install it.
So, i want the espeak.exe stard alone to embed into my app that the users who will use my app needn't install setup_espeak.exe.
You can read this link for more info:
http://espeak.sourceforge.net/commands.html[^]
# speak is a stand-alone version which includes its own copy of the speech engine.
Where can i download it.
Thanks and regards
modified on Thursday, October 1, 2009 5:01 AM
|
|
|
|
|
1. English
2. You need to follow the steps mentioned in the mbrola.html which is available under docs.
3. Yes only you need to install it then copy the espeak file to your Java project folder after you done step 2. There you can call the exe from Java and when you want to deploy include the file with Jar thats it.
Good luck
|
|
|
|
|
|
I need to create a method that reads in bytes until it reaches a nullterminator using FileInputStream. Can someone point me in the right direction?
|
|
|
|
|
jonig19 wrote: I need to create a method that reads in bytes until it reaches a nullterminator using FileInputStream. Can someone point me in the right direction?
You could try this[^]!
|
|
|
|