Hey I'm making a simple caesar cipher in Java using the formula [x-> (x+shift-1) mod 127 + 1] I want to have my encrypted text to have the ASCII characters except the control characters(i.e from 32-127). How can I avoid the control characters from 0-31 applying in the encrypted text. Thank you.
...
My application is trying to use Hibernate annotations. I've gotten the 3.5.0 version of Hibernate installed, but when I try to load my app I get the following exception:
junit.framework.AssertionFailedError: Exception in constructor: testSubscriber (java.lang.NoClassDefFoundError: javax/persistence/spi/ProviderUtil
at java.lang.Clas...
Hello all,
I recently switched to J2EE from .NET, and am confused about where to put JAR files. I know that the CLASSPATH, WEB-INF, and Eclipse's Java Web Path are all places where JARs can be stored, but I'm confused about which folder to use, when, and why.
First off, we have the CLASSPATH. I usually set this by going into "Environ...
I would like to control the attribute order in .java files generated by the JAXB compiler.
I'm aware that attribute order is not important for xml validation. The order is important for textual comparison of marshalled xml in a regression test environment. The order of attributes in a file directly affects the order of the attribute...
I have been working on a simple Java app. I had it compiling and running. I made the changes to turn it into an Applet. However, when I finished, the applet portion of the HTML came up blank... No errors.
I decided I'd revert the changes so that I could compile it and run it in my IDE. Once I did that, the program would compile successf...
I'm having trouble getting tomcat to start
I followed these instructions to get tomcat / apache2 running:
http://www.mogilowski.net/?p=121
...but tomcat fails to start on reboot. Here's the message from the log:
Nov 30, 2009 6:59:53 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 13009 ms
Nov 30, 2009 6:59:53 P...
I'm using Ant to build some Java projects.
In some, I've got a lib/ directory, which contains external dependencies, in the form on JAR files.
During the build, I create a bundled jar, that contains the project's code, alongside the dependencies, by adding to the bundle jar file a zipfileset for each of the jars in the lib/ directory.
...
We're seeing ConnectException with message "Connection refused" sporadically appearing at times when connecting to our Tomcat server. Could these be caused by long GC cycles?
(We're activating up the relevant JVM flags to get more log messages on GC cycles, but I thought to ask this here anyways)
...
I need a class Person to describe persons. Each person has a name and an array consisting of Person-objects, which represent the person's children. The person class has a method getNumberOfDescendants, which returns an integer equal to the total number of descendants of the person, i.e. his children plus grandchildren plus their children...
I have a simple ListActivity that uses a custom ListAdapter to generate the views in the list. Normally the ListAdapter would just fill the views with TextViews, but now I want to put a button there as well.
It is my understanding and experience however that putting a focusable view in the list item prevents the firing of onListItemCli...
My question is very similar to this question. I want to be able to instantiate an object of the type parameter type, but also without needing to pass in a "factory". I really need to be contained all in the one class.
public class myClass<E> {
E someObject;
public myClass(){
someObject = new E();
}
}
Previous soluti...
here i am trying to add elements to the array.
the elements i am trying to add are text fields, so im basically trying to store persons contact details within the array list?
any help would be greatful
public void addContact()
{
ArrayList<String> details = new ArrayList<String>();
{
details.get(txtname(0));
deta...
Hello. I'm working on a project that involves the creation of numerous web services. Top-down/contract-first and model-driven design strategies are utilized (WSDL -> codegen). NetBeans (6.7) + JAX-WS + GlassFish comprise the chosen tooling stack. The web services will be EJBs deployed as Composite Applications in the Glassfish JBI cont...
I'm trying to figure out which property of BoxComponentEvent will tell me if the generated OnMouseWheel event was a scroll-up or scroll-down event. I have output the values of all the properties BoxComponentEvent exposes; and all of them (with the exception of the coordinates at which the event took place) stay the same regardless. Googl...
Whenever I use equals() method with two different StringBuffer objects, I get the result as false, but when I use equals() method with two different String objects, I get the result as true. Why?
String s=new String("434");
String s1=new String("434");
System.out.println(s.equals(s1));//true
StringBuffer s=new StringBuf...
I am hunting for a job and one of the companies that I interviewed with asked me to write a little test program so that they could test my programming abilities. I am a biologist by training, and most of my programming knowledge I gain by autodidactic means. I am also more comfortable writing Python then Java.
This is the brief I was g...
What do you use for writing data-driven tests in jUnit?
(My definition of) a data-driven test is a test that reads data from some external source (file, database, ...), executes one test per line/file/whatever, and displays the results in a test runner as if you had separate tests - the result of each run is displayed separately, not in...
I am working on a project in netbeans that requires the running project to have root privileges.
I would like it so that each time I push "Run Project" (F6) my project is run as root, so with the equivalent of "gksudo javac Main", as it is has a GUI.
One option is to start netbeans with root privileges, easily done by editing the short...
I'm having trouble setting up multicast transport using ActiveMQ. I noticed with version 5.2 there is a bug that prevents it from even building the correct factory (fixed in 5.3). The fact this bug exists makes me wonder if anyone is using multicast at all. How can this be tested when it only recently has been enabled?
Just knowing that...
Hi guys,
I want to create native Mac OS X application using Cocoa + Objective C but I need to connect to proprietary data source, and for this, owner of the data source only provides Java library. So I need to somehow import this Java library into my project and call functions on its Java classes.(Or create java wrapper around this libra...