Basically, what I am asking is, how does a java based program with free chat gaurd against, "); String onlinejava = "exploits by closing the string."
Pretty simple: they don't need to. Java is a compiler-language, thus the code can't be modified by this kind of exploits. This can only be done in some interpreter-languages, or before the code is compiled, like in SQL.
Related
I have recently been trying to learn DL4J but have run into some issues. They have an example of a neural network generating Shakespeare-like text based off and input character but I can't seem to find anything that wold indicate a possible way of creating a response to an input statement.
I would like to use an input string such as "Hello" and have it be able to generate a response of varying length depended on the input. I would like to know if this is possible using LSTM and have a point in the right direction as I have no idea where to even start.
We have plenty of documentation this actually. This gives you a layout of what an RNN looks like:
http://deeplearning4j.org/usingrnns
The model you would be looking at is character level, in general what you want is question answering though. You may want to look at an architecture like this: https://cs.umd.edu/~miyyer/pubs/2014_qb_rnn.pdf
If you are completely new to NLP, I would look at this class:
https://www.youtube.com/playlist?list=PLhVhwi0Pz282aSA2uZX4jR3SkF3BKyMOK
It covers question answering as well.
i have problem calling lucene method in php.
im beginner in java.
n im searching in google 4 solving, but no found.
im trying write this java code to php using php java bridge.
http://www.lucenetutorial.com/lucene-in-5-minutes.html
i found this line that i dont get it how to make it to php:
IndexReader reader = DirectoryReader.open(index);
DirectoryReader has no 'new' for initial a object, that's what i dont get it to write in php.
but, if the java code like below,
Query q = new QueryParser(Version.LUCENE_43, "content", analyzer).parse(querystr);
i write like this:
$query = new Query\QueryParser($version->LUCENE_43,'content',$analyzer);
$query->parse($strquery);
n no error.
so, how to create this java code
IndexReader reader = DirectoryReader.open(index);
to php ??
really need help,
thanks a lot in advance.
You should be able to use Zend's Zend_Search_Lucene module rather than using the PHP-Java bridge directly. Check it out it may be much more easier.
Can you reference to where you read that it'd be slower? What measurements were taken and how was this done? I am not really sure that, whatever these performance implications, they'd have a noticeable impact on our application.
Also since you're using Symfony there are ready libraries that provide integration for Symfony and Symfony2. I really suggest using Zend Search Lucene especially if you don't have JAVA experience since basing your application on more than one technology is already complex enough.
Another useful thing that may come in handy is a Lucene/Sorl query builder. I know that I am not answering your exact technical question however being a PHP programmer and having experience with Sorl/Lucene I just wanted to point out the issues above so that you can take the appropriate decision.
I apologize if this question is too "general";
But my question is very specific to what I am programming and I was not able to find a descent answer anywhere else.
I am creating a "Proof of Concept" program for extra credit in my calc class.
Now that the program is finished, I want to make a way to view the coding of the program to show the teacher and explain what I did.
My first thought was to use a JTextPane, but how would that work?
I want to find some way to display all the lines of coding, keeping the structure of coding that Java/Eclipse uses.
What is the best way to do this?
Thanks,
-Steven
use system.out.println and get a free account at https://github.com/ and upload your code and the output of your programs . Send the link to your professor ..I think he will be impressed not only by your work but also by how you are presenting your code to him/her to review it.
good luck, I am already impressed that you are searching online to best present your work for that you deserve an A+ too. keep up the good work.
If I was your teacher, I'd prefer to be shown your code within an IDE (such as Eclipse). Then I could browse around as I pleased and see it execute in front of me.
IDEs are built for looking at code :-)
I am preferring you to use your IDE , but anyway :
Maybe i am wrong but I think the only way is to get the codes from the (.java) file
and copy it to TextArea but it's not perfect like your IDE.
I will not post the whole program just the function hope it will be useful for you
Scanner sc = null;
try{
sc=new Scanner(new File("yourProgram.java"));
}catch(Exception ex){System.out.println(ex.getMessage());}
String line = "";
while (sc.hasNextLine()){
jTextArea1.append(line=sc.nextLine()+"\n");
}
Say I allow the user to edit something, like the phone number in an Address Book (actually, that's exactly what I'm doing). Is there something that I can add to println that will allow me to insert a variable to display as fully editable text? The assignment that I'm doing this for doesn't actually call for this, but I think it would be cool to have. I'm looking on Google but can't find anything, then again I don't really know what I'm looking for and whether or not I have the correct terms in mind ...
No, not using only what Java provides in the framework. Editing some text would require to
act on key press, which is not possible as in Java the input is buffered (i.e., wait for Enter to be pressed)
to move around in the text you output, which is also not possible
This could be done using some native code (ncurse on linux, ...), using JNI or JNA, but not that easily.
Note that there are some projects that aim to add those functionalities, so if you can use something outside of the core libraries, you could give them a tries... for instance http://code.google.com/p/java-console-api/
There are various options for this, in order of simplicity and portability to features and complexity:
Simply prompt for the information, reading a complete (return-terminated) line of response, and allow the normal terminal input facilities to be used for basic editing.
Use something like the gnu readline library to allow more advanced editing. You still won't have widgets (text input boxes at specific places on screen) as such though. There's a java implementation here: http://java-readline.sourceforge.net/
Use something like ncurses to specifically position the cursor, print text labels, handle keypresses, and implement your own text input box. Not fun.
Use a textual user interface library (TUI), like this one: http://www.bmsi.com/tuipeer/
If you opened a window that looks like the console window, and could react to keypress events, then you could do what you are asking, but, otherwise, if you are just running a program, the program will have ceased executing and returned control to your console, so it can't do anything else.
But, if you use a scriptable version of java you could write your own shell, and then you could do what you are asking, as the shell would not cease executing.
But, that will probably be beyond your course.
Say I allow the user to edit something, like the phone number in an Address Book (actually, that's exactly what I'm doing). Is there something that I can add to println that will allow me to insert a variable to display as fully editable text? The assignment that I'm doing this for doesn't actually call for this, but I think it would be cool to have. I'm looking on Google but can't find anything, then again I don't really know what I'm looking for and whether or not I have the correct terms in mind ...
No, not using only what Java provides in the framework. Editing some text would require to
act on key press, which is not possible as in Java the input is buffered (i.e., wait for Enter to be pressed)
to move around in the text you output, which is also not possible
This could be done using some native code (ncurse on linux, ...), using JNI or JNA, but not that easily.
Note that there are some projects that aim to add those functionalities, so if you can use something outside of the core libraries, you could give them a tries... for instance http://code.google.com/p/java-console-api/
There are various options for this, in order of simplicity and portability to features and complexity:
Simply prompt for the information, reading a complete (return-terminated) line of response, and allow the normal terminal input facilities to be used for basic editing.
Use something like the gnu readline library to allow more advanced editing. You still won't have widgets (text input boxes at specific places on screen) as such though. There's a java implementation here: http://java-readline.sourceforge.net/
Use something like ncurses to specifically position the cursor, print text labels, handle keypresses, and implement your own text input box. Not fun.
Use a textual user interface library (TUI), like this one: http://www.bmsi.com/tuipeer/
If you opened a window that looks like the console window, and could react to keypress events, then you could do what you are asking, but, otherwise, if you are just running a program, the program will have ceased executing and returned control to your console, so it can't do anything else.
But, if you use a scriptable version of java you could write your own shell, and then you could do what you are asking, as the shell would not cease executing.
But, that will probably be beyond your course.