I am crunching through many gigabytes of text data and I was wondering if there is a way to improve performance. For example when going through 10 gigabytes of data and not processing it at all, just iterating line by line, it takes about 3 minutes.
Basically I have a dataIterator wrapper that contains a BufferedReader. I continuously...
I have a Map in java that has strings for both .
Data is like following <"question1", "1">, <"question9", "1">, <"question2", "4">, <"question5", "2">
I want to sort the map based on its Key's. So In the end I will have question1, question2, question3....an so on.
Eventually I am trying to get two strings out of this Map. First Str...
Possible Duplicate:
Is it worth learning Java when you already know C# fairly well?
I have been working on the .net framework for the past 5 years. Does it make sense to learn Java. Aren't both the Java and C# language / runtime / libraries meant for general purpose programming? How do they differentiate themselves?
I guess w...
We have some applications that sometimes get into a bad state, but only in production (of course!). While taking a heap dump can help to gather state information, it's often easier to use a remote debugger. Setting this up is easy -- one need only add this to his command line:
-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,a...
I'm reading a text file with the following format:
Room1*Exposition*Work 1 | Work 2 | Work 3 | Work n
Room2*Exposition*Obra 1 | Work 2 | Work 3 | Work n
Using the following:
try {
String path="contenidoDelMuseo.txt";
File myFile = new File (path);
FileReader fileReader = new FileReader(myFile);
...
I have run into a problem with a network server that receives signals from devices my company produces. The device will occasionally reuse the source port that it had just used. This causes the SYN to be dropped by the server. The device then retries until the old socket falls out of TIME_WAIT on the server. The server then SYN-ACKs....
I'm working on a web application that uses a standalone ehcache server to cache certain data. The ehcache server is accessed via REST (as opposed to SOAP).
For functional testing purposes, I need to run an embedded instance of the ehcache server. The echcache-server project itself does this for its own functional tests, using the Cargo ...
I have a 5yr old G4 PowerBook that I use while travelling, and I had intended to get some work done whilst I am away for the next few weeks.
Eclipse just seems to be horrendously slow on it. I've tried tweaking the memory allocated to the VM, but it doesn't seem to do very much :)
Any thoughts as to why it's so slow? I don't get this p...
I'm firing off tasks using an ExecutorService, dispatching tasks that need to be grouped by task-specific criteria:
Task[type=a]
Task[type=b]
Task[type=a]
...
Periodically I want to output the average length of time that each task took (grouped by type) along with statistical information such as mean/median and standard deviation.
Th...
I am using Microsoft JDBC Driver 2.0 with SQL Server 2005. To explain my question better, let me start with a sample code to call a stored procedure.
public static void executeSproc(Connection con)
{
CallableStatement cstmt = con.prepareCall("{call dbo.getEmployeeManagers(?)}");
cstmt.setInt(1, 50);
ResultSet rs = cstmt.executeQ...
I'm curious...I've read much of Python being on the approved list of languages used by Google employees, and I know they employ Guido. That said, is their use of Python focused mainly on managing servers and applications, and not for developing the applications themselves? If so, why? It seems most I read indicates they use Java for the ...
Ideally, I am looking for something like JAX-RS (using annotations to describe the services I want to call), but allowing to call REST services implemented using other technologies (not JAX-RS). Any suggestion?
...
As I understand them, generics are a compile time feature of Java, and parametrized type information does not exist in the compiled byte code. I have now discovered the Field#getGenericType and Method#getGenericReturnType methods, thusly shattering my world view. Please help me to piece it together.
...
Is there really a big difference between Eclipse 3.2 and 3.4? I am currently using 3.2.
...
I am new to using javax.mail API, version jdk 1.6.0.11. I am using javax.mail API to parse a MIMEMessage text and extract the attachments. If the MIME message contains attchments that have very long file names javax.mail API is not able to parse it and reports no attachments.
I would appreciate any help on this. Thanks!
...
I have been all around with this question and I can't find the correct answer! So, behold, the description of my question:
I'm working in J2ME, I have my gameloop that do the following:
public void run() {
Graphics g = this.getGraphics();
while (running) {
long diff = System.currentTimeMillis() - lastLoop;
...
I am trying to convert a string like "testing123" into hexadecimal form in java. I am currently using BlueJ.
And to convert it back, is it the same thing except backward?
...
I'm trying to get the Calendar from here running.
I've no experience working with GlassFish or the JavaServer Faces components, and so I'm lost when I read the tutorial saying that the Calendar should appear on my Palette? Is it my Netbeans Palette or is elsewhere? I downloaded GlassFish and ran the .jar but I don't see any changes on m...
I want to get all values of a set interface in one go as a comma separated string.
For Example(Java Language):
Set<String> fruits= new HashSet<String>();
fruits.add("Apple");
fruits.add("Banana");
fruits.add("Orange");
If I print the set as fruits.toString then the output would be:
[Apple, Banana, Orange]
But my requirement is A...
how do i convert this value from nano seconds to seconds?
I have the following code segment:
import java.io.*;
import java.util.concurrent.*;
..
class stamper {
public static void main (String[] args ){
long start = System.nanoTime();
//some try with nested loops
long end = System.nanoTime();
long elapsedTime = end - start;
...