Hi I've been working with django for some months and find it really helpful, is there alike frameworks for other programming languages such as java or c#?
The problem I suffer by using django is finding a server to host the proyect because supporting servers are more expensive and harder to find.
From django I find useful: the object-re...
I often hear of situations where a bug in a program is passed off as a feature. This seems like a useful skill to have.
Please describe a technique for doing this - preferably with specific examples.
...
Hello!
It is possible in plain Java to override a method of a class
programmatically at runtime (or even create a new method)?
I want to be able to do this even if I don't know the classes at compile time.
What I mean exactly by overriding at runtime:
abstract class MyClass{
public void myMethod();
}
class Overrider extends MyCla...
One can deploy several versions of the same application on GAE/J, but how does GAE/J deal with the fact that different versions can use different Datastore (and possibly incompatible) schemes?
Example:
Suppose that on version 1 of my application I have a POJO like (I've left out the several details for sake of simplicity):
public cla...
I've seen some interesting claims on SO re Java hashmaps and their O(1) lookup time. Can someone explain why this is so? Unless these hashmaps are vastly different from any of the hashing algorithms I was bought up on, there must always exist a dataset that contains collisions.
In which case, the lookup would be O(n), not O(1).
Can so...
I am having a web form(JSP) which submits the data to different application, hosted on different server. After submitting the form data, that application redirect back to same JSP page. Now, I want to save the entered the data. What are the different approaches to retain the submitted data in web form. I would not prefer to store the dat...
How can I receive a file as a command-line argument?
...
Using Java is there anyway to display a custom form/image that behaves similar to TrayIcon.displayMessage() function in that it displays just above the system tray for a while then disappears?
I am also looking for a way to display multiple notifications at the same time by having them display above each other.
If not, how do I find th...
Recently, I was discussing with another programmer the best way to refactor a huge(1000 lines) method full of "if" statements.
The code is written in Java, but I guess this issue could happen in other languages such as C# as well.
To solve this problem, he suggested using a chain-of-responsibility pattern.
He proposed having a base "Ha...
I'm trying to send a Java UUID to C++, where it will be used as a GUID, then send it back and see it as a UUID, and I'm hoping to send it across as just 16 bytes.
Any suggestions on an easy way to do this?
I've got a complicated way of doing it, sending from Java to C++, where I ask the UUID for its least and most significant bits, wri...
Hello,
I am designing a application where many clients connect to a central server. This server keeps these connections, sending keep-alives every half-hour. The server has a embedded HTTP server, which provides a interface to the client connections (ex. http://server/isClientConnected?id=id). I was wondering what is the best way to go a...
Hi,
Could anyone please clarify the defination of attribute?
for example, in the following code, what is an attribute:
request.setAttribute("ja",new foo.Employee());
Is the attribute in the above code an object of type foo.Employee(), or it is key/value pair, or it is actually "ja"?
...
Hi
I am using Netbeans IDE 6.5.1. I have made projects in netbeans. My pc configuration is :RAM : 1 GB, HD: 160 GB, Processor: AMD, OS: Window Xp Sp2. Netbeans IDE takes around 2 hrs time to load at my pc (too much time), i had read somewhere that for improving netbeans performance you can remove extra modules which are not required. SO ...
I've a Vector of objects, and have to search inside for a random attribute of those objects (For example, a Plane class, a Vector containing Plane; and I've to search sometimes for destination, and others to pilotName).
I know I can traverse the Vector using an Iterator, but I've got stuck at how do I change the comparison made between ...
Hi,
I'm trying to programm a k-means algorithm in Java. I have calculated a number of arrays, each of them containing a number of coeficients. I need to use a k-means algorithm in order to group all this data. Do you know any implementation of this algorithm?
Thanks
...
The following Java design allows an object to be extended without changing its interface to clients. The object can implement additional extension interfaces. Clients can ask the object for extension interfaces that it implements. I read about it in a blog post, but my Google skills failed to find the blog post again. I'm not advocat...
I know it's a simple concept but I'm struggling with the font metrics. Centering horizontally isn't too hard but vertically seems a bit difficult.
I've tried using the FontMetrics getAscent, getLeading, getXXXX methods in various combinations but no matter what I've tried the text is always off by a few pixels. Is there a way to measur...
I have created a concurrent, recursive directory traversal and file processing program, which sometimes hangs after all parallel computations have finished but the 'primary' thread never continues with other tasks.
The code is basically a fork-join style concurrent aggregator, and after the parallel aggregation completes, it should dis...
I need some help figuring out what I'm doing wrong here. I am trying
to master one to many relationships and running into a roadblock.
I tried to modify the Employee and ContactInfo example to do one to
many mappings:
Everything works if I create both the parent (employee) and child
(Contact) and then call makePersistent.
But if I try ...
I'm implementing a Java JTree panel. This panel holds a TreeModel build from a set ofdatastructures that are treelike (a list of lists of composites - different classes). I get these datastructure from external jar implementations based on a set of interfaces I defined.
The treenodes contain a checkbox that the user may check to indicat...