Hi all,
I want to create an AnalogClock that can display a preset time, given as a parameter.
And I want to draw between the background and the hands. I want to paint the area between the minute-hand and location of the hour-hand at a preset future time. This is to let the user see how much time remains for the current activity.
I tho...
I need a Java API that i can use to receive and send SMS messages. I already know of SMSLIB, but am wondering if there is a better one out there.
...
I'm trying to put some anti sql injection in place in java and am finding it very difficult to work with the the "replaceAll" string function. Ultimately I need a function that will convert any existing \ to \\, any " to \", any ' to \', and any \n to \\n so that when the string is evaluated by MySQL SQL injections will be blocked.
I'v...
I am having problems trying to write the correct code to test whether a string from the keyboard contains a valid date with the correct amount of months, days for each particular month and format mm/dd/yyyy with adjustments for leap years here is what Ive done so far I dont think I am even close but any help would be greatly appreciated...
So here is one of the simplest things one might do:
Random rng = new Random();
int a = rng.nextInt(10);
int b = rng.nextInt(10);
So far so good. But we want to avoid having equal a and b, so naturally we do:
Random rng = new Random();
int a = rng.nextInt(10);
int b = rng.nextInt(10);
while (a == b){
b = rng.nextInt(10);
}
However...
I am trying to build a string using "if" statements, and then using the built string to show in a JOptionPane.
//If the value is zero, don't show the line item
if (intLays > 0)
strBuiltOrder = "intSnickers + \"Snickers\" + \"\\n\"";
In the end there would be one line item for each variable that had a value greater than zero. However...
I have a Java question: I am writing a program to read a string and display the number of characters in that string. I found some example code but I don't quite understand the last part - can anyone help?
int[] count = countLetters(line.toLowerCase());
for (int i=0; i<count.length; i++)
{
if ((i + 1) % 10 == 0)
System.out.pri...
Here you can see ive used the BufferedReader method to impotr contacts from an external file, but i keep getting the repeated errors -
not a statement, illegal start of expression and ';' expected.
can anybody help?
public void importContacts(){
try{
BufferedReader import = new BufferedReader(new FileReader("example.bua...
would it be possible for an answer is psudocode please guys?
how could i write a method that, in O(n log n), takes a string array and removes null entries
i appreciate you cant alter array sizes which means i need to copy the contents over to a new one but i can only seem to do it with nested for loops which comprimises my algorithm ti...
Is it permissible to have multiple entries as the context root of a servlet?
E.g. all Sun examples use a single "/catalog" or similar as the context root, but can it be
"/catalog/furniture" as well?
The servlet spec http://cds-esd.sun.com/ESD6/JSCDL/servlet/2.4-fr/servlet-2%5F4-fr-spec.pdf?AuthParam=1259432348%5F056658a1be4c791239f676c...
I've been using the following web development stack for a few years:
java/spring/hibernate/mysql/jetty/wicket/jquery
For certain requirements, I'm considering switching to a NoSQL datastore with an AJAX frontend. I would probably build the frontend with jQuery and communicate with the web application middleware using JSON. I'm leanin...
Since this not really answers my question, I'm gonna clarify.
3 .jsp pages, index.jsp, calculator.jsp and error.jsp.
index.jsp contains (withoug html and body tags):
<p><b>Enter the Number you want to know the square root of:</b></p>
<form action="calculator.jsp" method="post">
<div><input type="text" name="number_textfield" size="40"...
hello guys, i need help in converting sms in PDU mode to text mode in Java.
...
Hi,
Im trying to understand how hibernate works under the hood, how it manages lazy load, transactions, data mappers, unit of work, identity maps, etc.
I wrote a small object model, and im downloading hibernate's source code for debbuging it.
Im kind of lost, is this the best approach? Does documentation on these issues exist out ther...
Hi, I want to add some features to webdriver, but since I don't know Java at all, I want to understand the way it works first. So as I get it, there is a firefox plugin (javascript) and there is java code that starts firefox with that extension installed, then this java code listens to a local port and when it gets some command, java sig...
Hi I'm trying to figure out how to upload to imgur using java, does anyone have any experience with this kind of thing?
...
Hi all,
I doubt if there is a way to make compile-time conditions in Java like #ifdef #ifndef in C++.
My problem is that have an algorithm written in Java, and I have different running time improves to that algorithm. So I want to measure how much time I save when each improve is used.
Right now I have a set of boolean variables that a...
I have a java model where the classes have associations (1 to 1, 1 to n, n to n) that should work in both directions.
Example:
class A has a collection of class B
All instances of B must know, who their parent (A) is. If I change the parent property of B, the association needs to be updated on the other side as well.
I think, writing ...
Hey,
This is primarily just curiosity but are there any pure java OCR implementations? I'm curious how this would perform purely in java and OCR in general interests me so I'd love to see how it's implemented in a language I thoroughly understand (java). Naturally this would would require that the implementation is open source ... but I...
Our server web app will handle jobs that are requested by REST API requests.
Ideally if the server dies during a job (ie: plug pulled), the job should resume or restart at startup.
A very convenient way to process these jobs is in a separate thread using some of the concurrent utility classes in Java 5. The only issue is, given a fa...