Tom Storm

Ranch Hand
+ Follow
since Nov 12, 2014
Tom likes ...
Firefox Browser Fedora Java
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
2
Received in last 30 days
0
Total given
4
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Tom Storm

Hi there,

From a quick glance it's because you have created an array for books but then you haven't added any. The line below should fix your issue.



TS
7 years ago
Hi,

Thanks very much for your informative post. Very helpful.

Thanks,
TS
7 years ago
Hi,

I have tried to replace the stream with little success. I found a library called lambdja and tried to use it but it resulted in null pointer exception. What would be the best way to replace the stream? The code below shows my attempt.



Thanks,
TS
7 years ago
Hi there,

Lines 18/19 and 39/40 throw the number format exception. I will attempt to write the code without streams. I apologise for the long lines. I wasn't aware how it would scale.

Thanks,

TS
7 years ago
Hi,

I receive a

java.lang.NumberFormatException: For input string: ""DepDelayMinutes""

error when trying to filter a list and then assign the results to a new list. I have edited the code so it is an int that throws the exception so it isn't the presence of a string that is causing the error -

java.lang.NumberFormatException: For input string: ""0914""

. I believe the issue is because of the two sets of double quotes but I do not understand how they came about. The original dataset does not have any quotes whatsoever.



Thank you very much to all who reply.

TS
7 years ago
Thank you all for you replies.

I would like to reply to some of your answers. Firstly the reason I would like the program to slow down is because if the CPU is at 100% the CPU is either operating at the very optimum level or else the actual load is closer to 120%. It is only by slowing down the program that one would see that. Secondly to rein in my parameters - I have created the problem and would like to find the optimum solution to solve it. I have no specific application. I have simply created a very heavy application and am attempting to find the best way to "slow it down".

I understand the scheduler and will see how it affects usage.

Thanks,
TS
7 years ago
Hi there,

Do you know of any method of removing the quotes or why they are there? The dataset doesn't have these quotes.
Thanks,
TS
7 years ago
Thanks for the replies. I was able to use a hashmap to find the most frequent String. However I'm running into an exception when I try to filter a list and then assign it to a new list. The code is below. Is it the code causing the error or the actual data?



The error I'm receiving is java.lang.NumberFormatException For input String""0918"". I think it is the double quotes but I don't know why they're there. The error traces back to the Predicate departureDelayOver10Filter and the filtering of the existing list.

Thanks again,
TS

7 years ago
Hi,

I have a number of Java Beans stored in a list. I would like to use a predicate to filter the list. I have a getter method in the beans that returns a string for each bean. I would like the predicate to find the most frequent String that is returned and then filter the objects to those that contain that String. I found a number of posts mentioning hashmaps but it seems very memory inefficient. Is it possible to do this?



Thanks,
TS
7 years ago
Do you mean to create a thread scheduler and then assign different priorities to threads? If so my only objection is that the usage wouldn't change unless another thread of a higher priority needs cpu time. What I thought could be implemented was a method that would effectively slow down a Java program which would result in far less usage.
Possibly a method which analyses a certain number of objects, then sleeps for a certain period of time and then analyse the same number of objects in a continuous loop. I am not sure if that would result in smooth lower usages or extremely varied usages.
Thoughts?

Thanks for the replies.
TS
7 years ago
Hi,

I would like to try and limit the usage of both RAM and CPU in Java. I have created a very CPU intensive program and would like to limit its usage of the computers CPU time. The program is designed to be extremely inefficient as I would like to find a way to limit Java cou usage. Is it possible to do this in Java or even through a JNI? I understand that memory is already limited with Xmx.

Thank you to all who reply.
TS
7 years ago
I managed to fix the exception by looping through files in a directory rather than combining them into a single cvs.

Thank you for your replies.

TS
7 years ago
I had a look at SQL but received a number of errors when using the code I have to extract the information from the HDF file. However I have found CSV files and have another little issue. I receive an arrayoutofbounds exception with the current code. What am I doing incorrectly?



Thanks for the earlier response.

TS
7 years ago
Hi there,

I have a number of HDF5 files and would like to extract information from them and then dump it into a format that I can then query. I was wondering if a CSV file would be suitable. Would I be able to select rows 1 to 10000 and analyse variable number x from each row in this format?

Questions
1) What is the best way in Java to extract information from a HDF5 file and dump it into another format.
2) Which format would allow me to easily select variables from a number of rows.

I found the HDF5 website very unhelpful for Java and the code I am currently using to work with the HDF5 files is extremely inefficient.

Thanks to all who reply,

TS
7 years ago