Hi all...
I`m trying to remove some package from my report and having trouble.
Could some one give me some help?
I'm using EMMA in my ant process.
<!-- Generate the emma report both in xml and html -->
<emma>
<report
sourcepath="${build.report.src}"
metrics="class:${coverage.classes.min},method:${coverage.methods.min}">
...
Could someone of you show me how to effectively use "Scripting Engine" inside Java?
What are all the right use-case to use scripting engine?
Is there any open source project using "Scripting Engine"?
One thing comes to mind is "Closure, Functional programming" support is possible, but it is more of technical use than "Application Requ...
Does JSP or any related lightweight technology like JSTL perform HTTP POST "data grouping", or support form element "indexing" in the way PHP does?
For example, you can create an HTML form with the following inputs:
<input type="text" name="person[1][name]" />
<input type="text" name="person[1][age]" />
<input type="text" name="person[...
I want to rewrite the contents of a file.
What I have thought of so far is this:
Save the file name
Delete the existing file
Create a new empty file with the same name
Write the desired content to the empty file
Is this the best way? Or is there a more direct way, that is, not having to delete and create files, but simply change the...
I've created a GWT project using Eclipse which was working perfectly (I was able to run it in both Hosted Mode and on Google App Engine) until I tried to import the Gears API for Google Web Toolkit. After adding the following line to my java source file:
import com.google.gwt.gears.client.geolocation.Geolocation;
I get the following ...
PrintServiceLookup.lookupDefaultPrintService() returns null as i have printer installed and set to default printer.
if i am using this in simple program it works fine.
but when i try to use it in my applet based program it returns null to me.
Please send me some good solution for this problem.
Regards:
Babar
...
Is there a nice way to extract tokens that start with a pre-defined string and end with a pre-defined string?
For example, let's say the starting string is "[" and the ending string is "]". If I have the following string:
"hello[world]this[[is]me"
The output should be:
token[0] = "world"
token[1] = "[is"
(Note: the second token ha...
Hi folks, I'm new to Android dev.
There's a very pretty state diagram of the MediaPlayer, but I can't for the life of me figure out how to actually use this class to play a video.
There's a view samples around the 'net, but they seem to be for previous versions of the SDK.
I've also checked the official samples, but with no luck.
...
I was just wondering what the easiest way to iterate over a set indefinitely, i.e. when it reaches the end it next(); calls the first object. I'm assuming that this is not an already predefined function in Java, so just looking for the easiest way to implement this in Java.
...
I want to open a new browser and load a page from the file system (which will be created on clicking that button). My app is a java servlet. Basically I am allowing users to change some HTML on their website. On clicking the button the user get's to see a preview page, that shows what the page looks like with the changes made.
What woul...
hello,
i need to know that how can we change java.policy file for applet printing.
as printing is not supported in java applets by default.
i want to print from applet.
and i am using PrintServiceLookup.lookupDefaultPrintService() method and it returns null to me.
please send me the solution with reference and sample code.
Thanks.
Baba...
How can I truncate a VARCHAR to the table field length AUTOMATICALLY in Derby using SQL?
To be specific:
CREATE TABLE A ( B VARCHAR(2) );
INSERT INTO A B VALUES ('1234');
would throw a SQLException:
A truncation error was encountered trying to shrink VARCHAR '123' to length 2.
Is there a easy way to suppress this exception?
...
In PHP I would use this:
$text = "Je prends une thé chaud, s'il vous plaît";
$search = array('é','î','è'); // etc.
$replace = array('e','i','e'); // etc.
$text = str_replace($search, $replace, $text);
But the Java String method "replace" doesn't seem to accept arrays as input. Is there a way to do this (without having to resort to a f...
I have a colleague who wants to attempt the following query:
INSERT INTO table (ColumnA, ColumnB, ColumnC)
VALUES (?, (SELECT Id FROM ColumnD WHERE x=y), ?)
Sybase complains about this as it does not seem to allow subqueries in the VALUES portion of the query. Does anyone know of a way around this problem?
...
I get a NullPointerException and I don't like it. It is a larger build with several submodules (which differ in their maven config only slightly), for most of the modules it does work, but for some not. Any ideas what the problem might be?
[INFO] [assembly:assembly]
[INFO] Reading assembly descriptor: src/assemble/all.xml
[INFO] -------...
I'm writing a Java game engine (http://victoryengine.org) and I've been experimenting with generating "3d" images with depth that you can see with those red/blue glasses. I'm using Java2D for graphics.
I've created something that works, but is very slow (by manually copying pixel values and stuff like that).
What I need to is take two ...
I am looking for some efficient way for building a immutable class, just like Java's String class.
...
In a java application,when the user hits download,establishing the remote connection and downloading the content from remote is done in a separate thread and a dialog is popped up in the screen to show the download progress. Now a cancel command has been added to the dialog inorder to provide the user with an option of cancelling the dow...
i have tried a lot ...as u all gave me the code segments as a solution...but still the same error is accured...so can anyone give me the solution...
It seems a big oversight that the Robot cannot be used to enter basic non-alphanumeric characters.
Is there a cross-platform API that converts characters to key strokes?
...
My main purpose is to execute processes one by one in a round-robin fashion until one calls receive() and is blocked, so that the execution switches to the next process in the queue. There is a controller application which is coded in Java and it executes these processes(which are also Java applications) using Runtime.getRuntime().exec()...