Methods and garbage collection
I encountered this question in an interview: Is an object created inside of a method eligible for garbage collection after the method is finished? Is yes the correct answer? ...
I encountered this question in an interview: Is an object created inside of a method eligible for garbage collection after the method is finished? Is yes the correct answer? ...
Hi, I'm on planning/modeling phase to develop a remote desktop sharing solution, which must be web browser based. In other words: an user will be able to see and interact with someone's remote desktop using his web-browser. Everything the user who wants to share his desktop will need, besides his browser, is installing an add-in, which...
Hi, I would like to ask for some ideas regarding a scenario like this: 1) we need to build up a real time application that runs on a client. Some sort of stock trading functionality, updates pushed to few clients in different geo locations every 25 secs. 2) the data is collected and pre-processed on the server side (Glassfish/Java) We...
I'm looking for a simple example to illustrate the benefits of using a rich domain model. Ideally, I'd like a before and after code listing (which should be as short as possible). The before code listing should show the problem being solved using an anemic domain model, and a lot of fairly procedural service-layer code, and the after co...
For some reason, if I run Firefox 3.5.x under Fedora 11 with SELinux enabled, my browser crashes when I attempt to embed the applet dynamically. Under Windows, Ubuntu, and Mac, the user is prompted to trust the signer and then trust the executing java applet, but under Fedora, I never see this prompt. If I disable SELinux, I get NO promp...
I have the following code: private final ImageIcon placeHolder = new ImageIcon(this.getClass().getClassLoader().getResource("Cards\\trans.png")); But this does not work once my application exported into a .jar file. ...
I'm playing with bencoding and i would like to keep bencoded strings as java strings but they contain binary data blindly converting them to string will corrupt the data. What i am trying to accomplish is have a conversion function that will keep the ascii bytes as ascii end encode non ascii chars in a reversible way. I have found some ...
I've already created the Binary Tree and Linked list classes, I'm just in need of an algorithm that prints ONLY the nodes of the largest path. The height and size of the Binary Tree are already stored in the root node, but my problem is traversing only the largest path while adding each node to my linked list. ...
Hi, I'm currently working on a (rather large) pet project of mine , a Swing application that by it's very nature needs to be multi-threaded. Almost all user interactions might fetch data from some remote servers over the internet , since I neither control these servers nor the internet itself, long response times are thus inevitable. A ...
Hello. I have a little page I've been working on. It's at: http://nait.jtlnet.com/~fpkj5v0r/programmer.php - and as you can see, a jquery chart shows up, like it's supposed to. Now here's the problem.. which has ended up taking up 6+ hours of my time... when I click a link (which uses ajax to load up a new page in the same div), and the...
Hi there I am looking for a class or method that takes a long string of many 100s of words and tokenizes, removes the stop words and stems for use in an IR system. For example: "The big fat cat, said 'your funniest guy i know' to the kangaroo..." the tokenizer would remove the punctuation and return an arrayList of words the stop wo...
UPDATE 1/31/10: Since this thread continues to get a lot of views...I am curious if it has been of help to anyone recently? Feel free to leave comments/feedback, thanks. I have a Spring form where I would like to reuse the search page to include the results under the search form. Currently when I do this I get the following error o...
Hello all, This is a question from a JAVA noob. I have eclipse open (JRE 1.6), I have copied this code into an eclipse class: http://bit.ly/WLntN The line in question is this: import netscape.javascript.JSObject; Eclipse is complaining that the import can not be resolved. I read that in the docs that the Java Plug-In comes as stand...
@Entity @Table(name = "BOOKTEST") @NamedQueries({@NamedQuery(name = "Booktest.findAll", query = "SELECT b FROM Booktest b"), @NamedQuery(name = "Booktest.findById", query = "SELECT b FROM Booktest b WHERE b.id = :id"), @NamedQuery(name = "Booktest.findByBookName", query = "SELECT b FROM Booktest b WHERE b.bookName = :bookName")}) public ...
I have an echo web service running on lets say http://localhost:8080/axis2/services/Service1. This service just echos back a string that is sent to it through the function echo(). Using the wsdl of the above mentioned service (Service.wsdl), I have generated (in eclipse) the ServiceStub.java and the ServiceCallbackHandler.java. With thes...
I heard C, C++, Java uses two complements for binary representation. Why not use 1 complement? Is there any advantage to use 2 complement over 1 complement? ...
So I am working on a java application, and the customer has requested the ability to have features that which can be unlocked to make the application customizable based upon what their customer wants to pay for. So I am trying to come with ideas for doing this in a manner that will provide some level of security, but also general maintai...
I want to measure API evolution for a given Java project, in particular new/renamed classes, new methods, newly deprecated methods, etc. Is there a tool that detect such changes? Back in 2007, a Google GSoc project was initiated, however, I cannot find the final work. ...
So, I was trying out a test case on a website and Selenium registers the events perfectly. Now, if I have to search for a particular class and get the innerHTML of that class, how would I do it assuming that I am using Java as the driving language? Just to be more clear. I have a class like this: <h1 class="classname">.....</h1> I...
Hi, I am trying to change JList rows dynamically. I need change nth row colour, highlight it(n is unknown during compilation). I saw a lot of examples with custom ListCellRenderer, but all were "static". In other words I have JList with x rows. During runtime my "business logic" detects nth row is important. So I want make its backgroun...