I'm trying to automatically compress both CSS and JS using maven and this plugin. I want to compress when the goal war is executed but I'm not figuring how:
<build>
<finalName>${artifactId}-${version}-production</finalName>
<plugins>
<plugin>
<groupId>net.sf.alchim</groupId>
<artifactId>yuicompressor-maven-plugin</ar...
Hi,
i want to use prepared statement with ejb3 to insert data in oracle. is it possible to use.
i try to find some example on net but i could not find any good example.
Please help me to use it. or is there any other way to use parameter query (as we use ? in prepared statement) in ejb3
Thanks and regards
...
Hello,
I've discovered the Robot class today and wanted to use it to do some funny scripts...
I want to convert a String into KeyEvent to do something like this :
writeKeyboard(myBot,"abcd");
public void writeKeyboard(Robot bot, String st){
char[] arr = arr.toCharArray();
int i = arr.length();
int j = 0;
int keyco...
Hi all, I have a complex question I cant find an answer anywhere.
here is a example :
public static void main(final String[] args) {
final JFrame frame = new JFrame("test");
final JPanel bigPane = new JPanel(new GridLayout(0, 1));
frame.setContentPane(new JScrollPane(bigPane, ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDE...
Hi! My question is: what is wrong with this conversion?
public int getTheNumber(int[] factors) {
ArrayList<Integer> f = new ArrayList(Arrays.asList(factors));
Collections.sort(f);
return f.get(0)*f.get(f.size()-1);
}
I made this after reading solution found in http://stackoverflow.com/questions/157944/how-to-create-array...
I have a class in Java which is written bellow.I want to know does that has normal size or it is big and huge and should be broken into some pieces:
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.TreeMap;
import java.util.logging.Level;
import java.util.logging.Logger...
I'm exploring the hardware/software requirements (ultimate goal is mobile Java app) for a potential free/paid application.
The application will start with this simple goal: Given a list of relevant words in a database, to be able to do word completion on a single string input.
In other words I already know the contents of the database ...
I use Resin webserevr.
There is great FileServlet class for serving static content.
I'd like to remap URIs like
/user1/file.txt -> /users/dir1/1/file.txt
/user2/file.txt -> /users/dir2/22/file.txt
...
in runtime.
But username->path mapping is not static and based on some database data.
...
Our Tomcat web application feels slow when it is used by a couple hundred users. The servers are in a hosting company and their reports doesn't show any problem with bandwith or cpu workload, so I suspect that the reason of the slowdowns can be because of contention on some legacy code that we encapsulated under synchronized calls becaus...
Hi, I've got to write a very short bit of code on a deque, however I'm not sure how to write the code for the methods, if someone could help me with one of the methods, (eg. a method to add an object to the from of the deque) then that would get me started. I'm sure I could manage the rest of the methods, just at the moment I'm pretty st...
Hello!
I'm using Netbeans. Often I need to specify own libraries, used by my
projects. It is very unhandy to maintain them across multiple workspaces.
As far as I understand correctly, Apache Felix, an implementation of OSGI's
module system, could manage such libraries (provide versioning,
automatic dependency resolvability, ...)
If t...
I recently purchased the book Filthy Rich Clients and i found it really useful and fun. Building on one example from the book i tried implementing a custom ScrollPane that displays a "shadow" on the bottom of its view over the component to be displayed. I ended up with the code below. It works but not perfectly. Specifically when i scrol...
Is it possible? How do I do it?
...
Is there a way to limit the maximum buffer size to be read from an ObjectInputStream in java?
I want to stop the deserialization if it becomes clear that the Object in question is crafted maliciously huge.
Of course, there is ObjectInputStream.read(byte[] buf, int off, int len), but I do not want to suffer the performance penalty of al...
I find decorator pattern to be most confusing. Please consider the example provided in "Head first design patterns book".
So to get a DarkRoast with double mocha and a whip, you have to write
Beverage beverage2 = new DarkRoast();
beverage2 = new Mocha(beverage2);
beverage2 = new Mocha(beverage2)...
I am working on a project where I have lots of classes referring to my GUI (mainly the panels but sometimes the frame itself). So I was thinking that instead of passing the frame as an argument to every constructor and create getters in each class, I would make a singleton instance of the JFrame so all the classes get access to it instea...
This should be fairly easy, but for some reason nearly everything I try just seems to hand out a 'not found' error when I hook it up to a web browser.
I've got a single static context, and for the ResourceBase I've got 'file:jar:/path/to/myjar!/.'... any ideas what I'm missing?
...
I have a J2ME app running on my mobile phone(client),
I would like to open an HTTP connection with the server and keep polling for updated information on the server.
Every poll performed will use up GPRS bytes and would turn out expensive in the long run, as GPRS billing is based on packets sent and received.
Is there a byte efficien...
As a java web applications developer I have used this last year JSF (SUN) for a framework to my web applications. I have to say I quite liked using it, it makes the developing easier.
Recently, I have read a lot of good things about JBoss Seam, but I still haven't encountered a person that has used it. From what I have read it seems tha...
I am trying to figure out how to decrypt a file that is encrypted with BlowfishJ.BlowfishEasy. Anyone who has Java and PHP experience and would be willing to help would be great!
BlowfishEasy Class: https://opensource.at.northwestern.edu/trac/filebridge/browser/tags/1.0.2/source/encryption-src/BlowfishJ/BlowfishEasy.java
Decrypt Call C...