java

android listviews: header and footer views

In my ListActivity, I need header and footer views (on the top and bottom of the list) to be used as previous page and next page buttons on my list, respectively, because I want to display only 20 items at a time. I set my header and foot views by doing: getListView().addHeaderView(myHeaderView); getListView().addFooterView(myFooterVie...

getObjectsById on App Engine

According to JDO, you can use PersistenceManager.getObjectsById to load multiple entity instances by their object id. What kind of Collection does one need to use here? A Google Data Store Key does not work as object id. ...

Need help in latent semantic indexing

Hi, I am sorry, if my question sounds stupid :) Can you please recommend me any pseudo code or good algo for LSI implementation in java? I am not math expert. I tried to read some articles on wikipedia and other websites about LSI ( latent semantic indexing ) they were full of math. I know LSI is full of math. But if i see some source co...

JSTL: iterate list but treat first element differently

Hi Everyone I'm trying to process a list using jstl. I want to treat the first element of the list differently than the rest. Namely, I want only the first element to have display set to block, the rest should be hidden. What I have seems bloated, and does not work. Thanks for any help. <c:forEach items="${learningEntry.samples}...

Sample EJB 3.0 MDB on Weblogic with Ant script

I'm struggling to find a simple example that builds and deploys a message driven bean onto Oracle Middleware 11g (i.e., Weblogic). I'm using dependency injection. It seems there should be a simple Ant task provided by Oracle to simply compile and deploy the MDB. import javax.jms.MessageListener; @MessageDriven(messageListenerInterfac...

How should I set CLASSPATH?

I did this before: CLASSPATH=".:/home/phoenies/jdk1.6.0_17/lib/tools.jar:/home/phoenies/jdk1.6.0_17/lib/dt.jar" But today an article says I should do this: CLASSPATH=".:/home/phoenies/jdk1.6.0_17/lib" If I do so, will it search all the jar files in lib? So it's probably a shorter way? ...

java : writing large files ?

Greetings , I get huge number of records from database and write into a file.I was wondering what the best way to write huge files. (1Gb - 10Gb). Currently I am using BufferedWriter BufferedWriter mbrWriter=new BufferedWriter(new FileWriter(memberCSV)); while(done){ //do writings } mbrWriter.close(); ...

bindings not resolving with AST processing in eclipse

Hi everyone, I'm using the eclipse JDT AST parser to process some Java code and am trying to extract the type bindings for fields and method declarations. The logic for doing that is inside my Visitor class (see below). Unfortunately, I'm not having any luck and none of the bindings are resolving (they are consistently null). The intere...

when to use global transaction Or use spring aop for transaction

Q1. i do understand when we need to deal with multiple databases, we need to use global transaction. but from this post http://fogbugz.atomikos.com/default.asp . the person suggested just use spring aop to advise on the different transactionmanager ( more > datasource/sessionfactory). can anyone explain in what kind of situation we ca...

generate executable jar at runtime

I'd like to write a Java app which can create executable jars at runtime. The "hello world" of what I want to do is write a Java app X that when run, generates an executable jar Y that when run, prints hello world (or perhaps another string not known until after Y is run). How can I accomplish this? ...

what are the major differences and similarity in java and ruby?

Hi I am java professional now I like to go for ruby.Are there any similarity in both the languages? and what are the major differences? As both are object oriented. ...

Java Font Rendering

I have been attempting to enhance my GUI system written in Java to use subpixel antialiasing and have been successful, except for two remaining anomalies. This is a follow on to my other question from a few weeks ago. The first problem is that setting rendering hints KEY_ANTIALIASING to VALUE_ANTIALIAS_ON causes KEY_TEXT_ANTIALIASING t...

How to get the subnet ip adress from http request

Hi, I'm writing a web application, I need to do a audit log for all the actions in the application. For this purpose I need to get the IP Address of the client systems. I'm using request.getRemoteAddr() to get the remote IP Address. But this has a problem, if the client is behind a proxy this method will give the IP of the proxy syste...

hibernate property

can anyone explain on this 2 properties Q1. hibernate.cglib.use_reflection_optimizer ? what is the effect of setting to true and false Q2. hibernate.c3p0.max_statements . i read hibernate doc https://www.hibernate.org/214.html. it only mentioned default value is 0. I am using oracle10g, and i set to 100. but i want to know how to ...

can freemarker be used to output custom collections?

Can freemarker be used to loop through collections and output the properties of each item in the collection? This collections properties will be dynamic i.e. can't be hard coded, will be generated from the database. what I am looking for: be able to point to different databases, and loop through each table and output the tables column...

convert video file into flv formate using jsp

in my webpage i want to convert uploaded video file into flv formate using jsp or servlets ...

Java "events" - nothing more than Interfaces. Why pretend it is Events when it is just a normal Interface and classes that implements that interface?

I am mainly developing in .NET C# and I love the Events in C#. Im now doing som Android stuff and thus must deal with Java. When porting some code from C# to Java I ran into the problem of Events; Java does not have anything that corresponds to C# Events. So, when reading up on how Java handles "events", the only thing I can conclude i...

Getting Error On Xml resultSet in java

when i try run to execute java code it displays error. which i used to get xml type resultset from oracle using flowing method in java poxml = XMLType(rs.getOPAQUE(1)); it shows cannot find symbol --- symbol : method getOPAQUE(int) any one can suggest any other method for retrieving the xml resulset values from oracle ...

How to combine library with my jar?

Ok so i wrote a program that makes use of a 3rd party open source library and i want to package it with my program in a single jar. I'm using netbeans 6.8 and everything I've tried java always spit back the error: java.lang.NoClassDefFoundError: libraryname; off topic:also i would like to know how to make an executable-jar(exe) throu...

Could the value of an html anchor tag be fetched using xpath?

If I have HTML that looks like: <td class="blah">&nbs;<a href="http://....."&gt;????&lt;/a&gt;&amp;nbsp;&lt;/td&gt; Could I get the ???? value using xpath? What would it look like? ...