java

Is there an equivalent to the Scanner class in C# for strings?

In Java I can pass a Scanner a string and then I can do handy things like, scanner.hasNext(), or scanner.nextInt(), scanner.nextDouble(), etc. This allows some pretty clean code for parsing a string that contains rows of numbers. How is this done in C# land? If you had a string that say had: "0 0 1 22 39 0 0 1 2 33 33" In Java I wou...

What is best way to learn Spring AOP or AOP in general?

Hi, I have got experience working in Spring framework, but i find it very difficult to understand the basics of Spring AOP or AOP in general. Could you guys suggest me some good online tutorials/books you have come across to learn it. -Snehal ...

Using nsis to retrieve choices from checkboxes

Hi there, I'm using nsis for an installer of a webapplication. In one page of the wizard i want the user choice one of three checkboxes: each of them has to set two variables in different ways. Here is the code i'm trying to run: !define DATA_ONE data_one.zip !define DATA_TWO data_two.zip !define DATA_THREE data_three.zip Functio...

Reflector for Java?

Is there a Java equivalent to .NET Reflector? Edit: more specifically, decompiling is what I'm after. ...

What are all the portlet classes in Spring mvc?

In Spring MVC there seem to be two parallel class hierarchies, one with portlet, one without. What is that? Why is it so and what should I use. ...

In the Java Plug-In applet options, what does jar "pre-loading" do?

I'm investigating options for speeding up the initial load time of our applets. Looking at the Java Plugin Developer Guide, i see an applet parameter option called cache_archive_ex which references pre-loading. What's that? I can't find any documentation on what that means exactly anywhere. And a deeper question, which noone need answ...

How to avoid copying 40M of java lib's within a WAR when the WAR's size is 41M?

At the moment my build process consists of repackaging the war file with all required java libraries under WEB-INF/lib and then copying the war file to development/demo/production server to be redeployed by tomcat. The packaged war file's size is about 41M and it has at the moment something like 40M of external java libraries. There ha...

What do I need to learn to build a web app in Java?

Hi, I've been doing PHP/MySQL web development for a while and I'm fairly competent in it. Lately however, I've learnt Java and fallen in love with it, and I'd really like to do more Java work now. I've gotten my first opportunity with a client who needs a web 2.0ish web app built, and he has agreed to let me use anything I want to, inc...

How to fix a Resource not Found error in OC4J?

I am trying to deploy a web app on OC4J, and although I've followed the instructions to the letter and the deployment process goes without a hitch, I keep getting a 500 error (below). I am a newbie in OC4J, so I would appreciate some hints on what to look at and tinker with (XML/settings/etc) to fix this. Here's the actual error, just ...

Getting Ant <javac> to recognise a classpath

I have an Apache Ant build file with a <javac> command that requires four specific JARs to be on the build classpath. I've tried to do this: <project basedir=".." default="build_to_jar" name="Transnet Spectrum Analyzer"> <property environment="env"/> <property name="src" value="src"/> <property name="libsrc" value="library_s...

How can I create a Java Swing app that covers the Windows Title bar?

I'm working on a java swing application that will be used in a psychology experiment and the researchers have requested that I make the program "black out the screen" in order that there should be no outside stimuli for the user. They want the swing app to be truly full-screen and without any type of title bar or minimize/maximize/close ...

SSL socket php code needs to be converted to Java

I have a Pem file that I use with this php code to connect to a c++ SSL server, but now I need this php code written in Java $ctx = stream_context_create(); stream_context_set_option($ctx, 'ssl', 'local_cert', 'cert.pem'); stream_context_set_option($ctx, 'ssl', 'passphrase', $pass); $fp = stream_socket_client('ssl://serverURL', $err,...

how to access a mySQL enum field with Java ResultSet and PreparedStatement

Quick question what's the correct way to use ResultSet and PreparedStatement to access an ENUM field in MySQL? ...

Using AesCryptoServiceProvider in VB.NET

My problem is actually a bit more complicated than just how to use AES in VB.NET, since what I'm really trying to do is use AES in VB.NET from within a Java application across JACOB. But for now, what I need to focus on is the AES implementation itself. Here's my encryption code Public Function EncryptAES(ByVal toEncrypt As String, By...

Quick way to create a list of values in C#?

I'm looking for a quick way to create a list of values in C#. In Java I frequently use the snippet below: List<String> l = Arrays.asList("test1","test2","test3"); Is there any equivalent in C# apart from the obvious one below? IList<string> l = new List<string>(new string[] {"test1","test2","test3"}); ...

jdbc connection using thin driver

i am connecting orace 10g xe with java but getting the exception java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver even i have included the classpath of driver i.e ojdbc14.jar if i have set wrong classpath plz tell me the correct way to set the classpath ...

How long is the request queue on a Vista-system?

Hi all! I'm currently hacking on a new project, a web-app. But something's wrong, and I think it's Vistas fault, when I'm stress-testing the app, not all of the requests are answered. The only thing I can think of is that the queue of incomming requests is getting too long, I've googled around, but can't find out how long the queue is,...

How to use PEM file to create a SSL socket in Java?

See related question. I have a PEM file provided to me and was told that it will be needed in establishing a SSL socket that connects to a c++ server for some API calls. Does anyone know how I can read in the PEM file and connect? I was also given the parapharse password. ...

Why is this simple applet using up >50% of my CPU?

I wrote a simple applet to have as a base fr making games, and it's already using up >50% of my CPU. I'm on a 3ghz P4 with 1.5gb ram, so I know it shouldn't take up THAT much. import java.awt.*; import java.applet.*; public class applettest extends Applet implements Runnable { long lastFrame; public void init() { (new T...

Handling different API versions in same Java source

I'm sure this is a dumb question, but.. We have the same Java source files and we want to use a different version of a Java API (jar file) depending on the client we are building our app for. The newer version of the API has the methods setAAA() and setBBB() which we reference in our Java source: if (...) { api.setAAA(a); api.se...