Peter Benda

Ranch Hand
+ Follow
since Jul 23, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Peter Benda

yes i sent to the WS.
until know i found that next chars are getting converted by the escapeHtml4 :


&  ndash   ;
&  nbsp   ;


(i did the space so it can be see in te post
this 2 make the problem, but i assume there are more which i want to find in advance.
4 years ago
i missed a change in code i did, i actually do the conversin with

and send it as in the code below  that is :try (CloseableHttpClient httpClient = ......"
4 years ago
i removed it as you suggested
and still get the same error with the




4 years ago
i am sending xml, which contains text in Unicode language like Arabic.
i am using the next code the encode text before sending it to the WS which is written in C#:


when i have a text that contains "-" it's converted to  – and then the send fails and i get 400 Error, how can i avoid this conversion to  – (it happens also with  )

thanks
4 years ago
this is the code




4 years 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?
4 years ago
Map.of not exist (maybe because i am on Java 8?(
4 years ago
i have the next code :


thanks
4 years ago
Hi, i am not using executer, just doing Start to 100 threads
4 years 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 years 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 years 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
4 years 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.
4 years 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)
4 years ago