Peter Benda

Ranch Hand
+ Follow
since Jul 23, 2017
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
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 Peter Benda

this is the code




1 month ago
i tried the AnyMatch
but i get all values back (from your example) even if not all arays are size 3 or above - where can be the mistake?
1 month ago
Map.of not exist (maybe because i am on Java 8?(
1 month ago
i have the next code :


thanks
1 month ago
Hi, i am not using executer, just doing Start to 100 threads
4 months ago
Hi,
its a standalone application running from windows console.
there are other things running on the server as well which be posible that not all threads running on all 8 vCores.
4 months ago
i have a server (1 CPU with 48 vCors, 256GB Memory)
i have Java application that open 100 Threads, so the app can send http request in parallel to another system (URL never changes).
in the client i am using the org.apache.http.impl.client class.
when i lok at the cpu it seems (maybe i am wrong) that all the threads are not spread over cores but rather use only the first ones :

CPU

how can i check more deeply ? is this situation is ok?
4 months ago

It's true that HashMap will slow down if it gets fuller, because there are more and more collisions and performance will degrade from constant lookup times to logarithmic lookup times (because it now has to look for items in a tree, rather than a hash table). This is why the map doesn't wait for itself to get full before it resizes. Instead, it resizes when its size has reached a certain percentage of its capacity. This percentage is known as the load factor. By default, the load factor is 75%. This means that by default, 25% of all buckets in a HashMap will be unused. This may seem wasteful, but it ensures that there are almost no collisions and that lookups will remain super fast.


totally agree
5 months ago
Each bucket is implemented behind as a linked list or bTree.
what was the point of implementing it of the data that is added will be the size of tha HashMap, this loses the power of the buckets.
5 months ago
i want to see if i can predicate what size of hash i need to init.
lets say i have 100,000 strings.
i want to see if some of them fall into the same bucket, and what the hashmap size i should init so there wan't be any resize later on (assuming no need data is added)
5 months ago
i am looking for a way, to make next scenarion :
1. to make 2 or more value to be in the same bucket
2. to see if there is a way to see how many item(2 or more) are in the bucket.

is thee a way to do 1+2? until now i tried to put different values in and all the times it seems like only 1 element is in a bucket.
5 months ago
Hi thanks for the kink
i understand about performance issues
but that are things tat i want the Java to interact with window componenets.
do you know maybe a project sample that interacts with something on windows
10 months ago
Hi,
i am looking for article how to build a simple JNI application between Java and C++ (can be gradle but not a must)
something that gives example of step by step.

Thanks
10 months ago
i have the same issue as described in
Java Console Application Lockedwebpage

i created app with Java8 on Win Server 2016 (but i reproduce it on other version of windows too, clicking with mouse in console window and the app get stuck.
i am lookin for a way to avoid this situation, is there any way to do it?
1 year ago