|
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.
|
|
|
|
|
I suspect OP means a standalone exe.
Cheers,
Peter
Software rusts. Simon Stephenson, ca 1994. So does this signature. me, 2012
|
|
|
|
|
Me too; I'm just trying to get him/her to think about what they are asking.
|
|
|
|
|
As Richard said, please reword your question. Are you trying to make a java .class file be a standalone executable?
Creating an Executable jar File[^] might be of interest to you
""Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
hello
I want to create a program that signs and verifing file with jarsigner
I succed to create .jar but the keystore not
here is my code :
public static void main(String[] args)
{
try
{
String[] dd = { "cmd.exe", "/C", "dir C:\\ >keytool-genkey-alias-keystore signLegal examplestanstore.jks" };
Process p = Runtime.getRuntime().exec(dd);
BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
String inputLine;
while ((inputLine = in.readLine()) != null) System.out.println(inputLine);
}catch(Exception e)
{
e.printStackTrace();
}
}
in netbeens it write me BUILD SUCCESSFUL (total time: 1 second) but don't create the fiel of keystores
my goal is to create that with program
do you have any idea
thank you in advance
|
|
|
|
|
ahmadiss wrote: in netbeens it write me BUILD SUCCESSFUL
So you have built your program, but you still need to run it in the JVM.
|
|
|
|
|
first thank you for your reply
how to execute it in the jvm ?
I can't run it only with program !!
|
|
|
|
|
|
Well, my French is not very good but it looks like the message says "keytool-genkey-alias-keystore is not recognised as a command or program file name". I suggest you check where this program resides and use the full pathname to run it.
|
|
|
|
|
thank you , I resolved the problem : problem in path
|
|
|
|