java

Java 2D. Hovering over Circle

If I draw some circles using Java2D. Is there a way display some text when I hover over any of the circles? i.e. I want to display the ID of that circle and some other stuff. ...

GridBagLayout .NET WinForms

Is there anything similar to Java Swing's GridBagLayout on .NET and Winforms? ...

cannot do 2nd level cache

in my applicationcontext.xml <bean id="annotatedsessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean"> <property name="packagesToScan" value="testonly.package.model" /> <property name="hibernateProperties"> <props> <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect...

Questions about PHP and Java

I want to know how Java (JSP) on Tomcat compares to PHP on Apache in terms of performance. Two servers with the same hardware configurations, one running Tomcat/Java (JSP) the other Apache/PHP, both servers maxed out with how many connections they can handle at once. Would they be somewhat close or would one pull away from the other one...

Spring Webflow Best Practice

Hi. I have a java web application which uses spring webflow as framework. I have a problem with processing data on a plain flow xml. When the processing gets more complicated I find it hard to implement using the flow xml of the web flow. I was considering of using controllers to perform these operations. How do I do this. Have no Idea ...

Pulling HTML from a Webpage in Java

I want to pull the entire HTML source code file from a website in Java (or Python or PHP if it is easier in those languages to display). I wish only to view the HTML and scan through it with a few methods- not edit or manipulate it in any way, and I really wish that I do not write it to a new file unless there is no other way. Are there ...

Retrieve SD Card Serial Number and Manufacturer under Linux

I want to be able to retrieve an SD Card's Serial Number, Manufacturer, and any other information it may provide. Java or just a command to run would be great. Compact Framework does it, but that doesn't help me. ...

Who Uses Real Time Java?

I noticed that Real Time Java 2.2 was released back in September, seems to have come a long way from when I last looked at it. However, does anybody know of any real world uses, commercial or academic to date? http://java.sun.com/javase/technologies/realtime/index.jsp ...

hibernate cache strategy

how to decide whitch CacheConcurrencyStrategy to use? NonstrictReadWriteCache, ReadOnlyCache, ReadWriteCache, TransactionalCache . I read https://www.hibernate.org/hib%5Fdocs/v3/api/org/hibernate/cache/CacheConcurrencyStrategy.html but doesn't explain in detail enough ...

Recommend Linux + Java books, resources for .NET developer

Hi, I want to learn Java and Linux. Java itself (as a language) is not a big deal for me as I know pretty well .NET and C# (so the paradigm is similar). The biggest issue for me would probably be doing Java on Linux platform (I have never used Linux before). I think Ubuntu should be good for me (a friend of mine recommended it). ...

how to make java application display chinese under fedora core 5

we have a java application running under fedora core 5. the jdk version is 1.5. after installed the chinses/TrueType under the /usr/share/fonts the firefox can display chinese pages but the java application display nothing for those chinese unicode (\uXXXX). I modified the jre/lib/fontconfig.properties.src file to add a line of "appended...

javabat question

Return an array that contains the exact same numbers as the given array, but rearranged so that all the zeros are grouped at the start of the array. The order of the non-zero numbers does not matter. So {1, 0, 0, 1} becomes {0 ,0, 1, 1}. You may modify and return the given array or make a new array. zeroFront({1, 0, 0, 1}) → {0, 0, 1, ...

config ehcache.xml for jpa entity or use annotation?

when using ehcache rather than defining statement like <cache name="testonly.package.model.TestPOJOcategory" maxElementsInMemory="200" eternal="true" overflowToDisk="false" timeToIdleSeconds="300" timeToLiveSeconds="600" /> can directly define inside entity independent of whatever cache pro...

access running JVM raw memory

Forgive me if this is an ignorant question, I'm not exactly an expert programmer just curious. Is it possible to read the working memory, say for an instance of a class, from inside a running program? I know you can do something like println(theInstance.getClass()); and it will give you the memory address of the instance (I'm assuming ...

enums as mini data tables

I tend to use enums to create mini data tables all over my code. I use this pattern often. Often enough that I thought I'd ask for others opinion. I'm just curious if I'm taking enums too far, or if I should be doing something else instead. A common example is an enum I'll use to drive the TableFormat(from glazed lists) in a JXTable(fro...

How to set trigger on contacts database in Android

Hi, I have a requirement wherein I need a list of all the contacts that are edited/changed. As per the Android documentation, _SYNC_DIRTY will be set every time a contact is edited. But, there seems to be a bug in this, which makes this always set to 1 (no matter what), even is we explicitly set it to 0. So, I was wondering if I c...

Obscure your Ruby code?

I am in the middle of developing an enterprise application using RoR (first time for us to build an enterprise app on RoR instead of Java), and while we do not have that much problem of obscuring the source code, I was still wondering if this was possible. Whether we could somehow just have a simple EXE or something else, such that our c...

Android: How do I know if Activity.onStop() is being called because the user is going back to Home?

I need be able to tell if Activity.onStop() was called because my application is moving to a new activity, or if it was closed because the user pressed the "Home" key or hit the back button from the bottom of the activity stack. The reason is because I need to know when it is appropriate to shut off music that is playing in my applicati...

java.net.UnknownHostException

public static final String readURL(String url)throws Throwable { try { InputStream in = (InputStream) fetch(url); byte[] bArr = readBytes(in); return new String(bArr); } catch (Throwable e) { throw e; } } public static final Object fetch(String address) throws MalformedURLException,IOException { URL url = new URL(ad...

java issues with arraylist

Hey, I'm a bit new to java, so please bear with me. I have a class that contains 2 arraylists which i'm trying to store objects into, one for each object type. in my main class, i'm insert the objects like so: for (int i =0; i < 3; i++) { Cat cat = new Cat("meow",i); Dog dog = new Dog("woof",i); objList.addCat(cat); obj...