This has been asked a couple of times, but none provide coded test cases. Here I give an example of the problem:
programmatic generation of a Keystore (works)
creation of certificate within that store (works)
saving keystore to disk (works)
listing keystore with keytool (works)
loading the keystore programmatically (fails with IOExcep...
I am trying to move my code from Java to C, and I have encountered a problem while trying to find a function in C that can take an array of ints and create a bitmap from it for OpenGL. In Java, I used
bitmap = Bitmap.createBitmap( {int array name} , w, h, Config.RGB_565);
Is there a similar function that I can use in C, or a workar...
The following code creates a new audio clip, plays it, sleeps for 3 seconds and then closes it when it is finished playing. Despite the call to close(), I am watching the memory usage of the jvm go up by the size of the sound clip every time the while loop is run.
I'm participating in a game coded in java, and am handling the sound. I c...
Every time I see a conflict on something like imports or method signature changes (e.g. renames of variables) in my SCM I wonder if there is something like a language aware diff/merge method that can handle the more annoying small changes that can happen on a shared project.
Is there anything out there that handles conflicts more smoothl...
I'm working on an application in Java, that needs to do some complex logic rule deductions as part of its functionality. I'd like to code my logic deductions in Prolog or some other logic/constraint programming language, instead of Java, as I believe the resulting code will be significantly simpler and more maintainable.
I Googled for e...
I have created a 2D array and want to print the output. I want to label the columns and rows. I have labeled the rows. but I can not figure out how to label the columns. Something link this:
A B C D E F
Row 1 * * * * * *
Row 2 * * * * * *
Row 3 * * * * * *
Row 4 * * * * * *
Row 5 * * * * * *
Row 6 * * * * * *
Row 7 * * * * ...
I have a few questions for this program, one the first thing I am trying to do is make it so it could compare and see if the textfield is equal to the colorValues[x] position. The second issue is the if statement says if inText == to colorValues.length - 1 to open a box that says congradulations that does not work either. 3rd issue even ...
I'm using a filter in web.xml to check if a user is logged in or not:
<filter>
<filter-name>LoginFilter</filter-name>
<filter-class>com.mycompany.LoginFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
And this works like a charm until...
We need to sign a SOAP message with a certificate in Websphere 7. Currently we are looking at using WSS4J from Apache and are approaching this in the java code itself.
Does anyone have any experience signing SOAP messages in Websphere or otherwise?
...
I have a JList which is populated after importing a file.
Is it possible to have the first item/element of the JList highlighted/selected.
I have browsed many places hoping to find a line along the lines of
list.setFocus(0);
//or
listSelectionEvent.setSelection(0);
//0 referring to index point of the list
Maybe this isn't even possibl...
I'm deploying my project to a web-server to be deployed with java Web Start. However, Web Start uses modification date to figure out whether to download the resources again (by default).
What I want is a way to only deploy those (jar) files that do not already exist. This is made possible by having build-version numbers on all my jars, ...
I am using JACOB to access system information through WMI. I have not found much documentation for WMI and Jacob on the web and was wondering if I could get some help in making the code a little more efficient.
Here is the code:
String query = "SELECT * FROM Win32_PerfFormattedData_PerfOS_Processor WHERE Name='_Total'";
Variant vColle...
hi,
I imported a java project into eclipse which had .svn folders in it. The project did on build properly and it gave errors. But, once I deleted the .svn folders from the project, eclipse did not show any errors. What is the reason ?
...
Ok, I've been google'ing the web and I just can't seem to find any solution to my problem. I found lots of solutions, just not any that fit.
I need to create an array of generics. But the generic type itself extends Comparable. When I try the following :
public class Hash<T extends Comparable<String>> {
private T[] hashTable;
priv...
Why am I getting this error when the SystemController class is in the same directory?
sgs$ javac Main.java
Main.java:27: cannot find symbol
symbol : class SystemController
location: class sgs.Main
SystemController sc = new SystemController();
^
Main.java:27: cannot find symbol
symbol : class SystemController
location...
my primary key entity look like below
@GeneratedValue(strategy= GenerationType.TABLE)
private Long id;
when i run, i get error
could not get or update next value;nested exception is org.hibernate.exception.SQLGrammerException:could not get or update next value
but when i just change to
@GeneratedValue
private Long id;
no error...
I have,
int[10] oneDim = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, index = 0;
as shown here, we create the the two dimensional one from the origin. But how do I iterate my oneDim inside for (index = 0; index < 10; index++) so that I could get my column index and row index there without creating a new one?
I want it looks like this while print...
In my JSP/HTML files i use the following servlet to get blob-images from the MySQL-database.
<img src="/image?id=1" />
Image servlet
This is mapped to a imageservlet, who:
- gets a stateless session-bean injected
- uses the session-bean to lookup a product, based on the id passed in to the servlet
- streams this image out as the resp...
I'm trying to write a client and time server for an assignment and I'm having trouble getting the server to receive the second request from the client. The first request goes through fine without a hitch. then it just stalls. I'm actually pretty lost in this whole thing and rather uncomfortable with java still, so I have no idea what I'm...
Within this program, we need to create an 8x8 grid of "LifeCell" widgets. The instructor did not mention that the widgets had to be an object of Shape so I went ahead and used the GridLayout class. The GridLayout class works fine (as well as I know, since there is no visual aid to confirm.) The object of the program is to play the Game o...