« first day (3136 days earlier)      last day (1803 days later) » 

12:00 AM
The best laid plans of mice and men are held up in the legal department. (source)
 
 
4 hours later…
3:50 AM
Pineapples.
 
4:43 AM
hey guys, did anyone ever need to integrate spring boot with Azure AD?
 
 
6 hours later…
10:43 AM
dreams of electric sheep
 
 
1 hour later…
12:00 PM
While awake, a human brain can generate enough energy to power a light bulb (between 10-23 watts). (source)
 
 
2 hours later…
Pie
2:08 PM
Hi everyone
I need help in understanding monostate pattern
@c
@coldFire hi
 
2:35 PM
ok
 
Pie
can anyone help
 
can you ask a more specific question?
 
Pie
a simple example of monostate design pattern in java @Wietlol
 
2:50 PM
again, can you ask a more specific question?
what do you want to achieve? what do you want to understand? etc
 
Zoe
3:16 PM
@Wietlol Pie wants an example of the monostate pattern because they don't understand how it works.
 
but the example wont tell you how it works
its a weird pattern
 
Zoe
I didn't know it existed until about an hour ago XD
 
 
1 hour later…
4:36 PM
what we often do is a monostate singleton
but that contradicts the monostate pattern because it explicitly doesnt want a singleton
because... you shouldnt care if it is a singleton or not
but... we should care in all cases anyway
 
 
3 hours later…
7:27 PM
@Turac Welcome to the Java Chat, the room for Java enthusiasts! Please use a code snippet tool when posting code snippets. If you have an Android question, you're in the wrong place! And remember: this is not tech support! Thanks for visiting and have fun! :D
 
31
A: What is the significance of load factor in HashMap?

HelloWorldActually, from my calculations, the "perfect" load factor is closer to log 2 (~ 0.7). Although any load factor less than this will yield better performance. I think that .75 was probably pulled out of a hat. Proof: Chaining can be avoided and branch prediction exploited by predicting if a bucke...

can those who are interested in maths comment on the accuracy of this answer?
 
7:57 PM
i think the accuracy of that answer is irrelevant
the accepted answer makes a very strong and solid point
> As with all performance optimizations, it is a good idea to avoid optimizing things prematurely (i.e. without hard data on where the bottlenecks are).
changing the load factor is an optimization measurement
choosing a load factor is assuming that your choice somehow makes more sense than the default value
the load factor of a hashmap is really weird imho
the perfect value depends on the size of the map
smaller maps are fine with a higher load factor, while larger maps prefer lower load factors
coming back to the point of the accepted answer, you should only change it when you find out that mutating/scanning your hashmap is a bottleneck
at which point, you are dealing with a specific instance and use case
then, you can run tests on it and find out that your huge, 200 million element hashmap needs a higher load factor
or find out that your small, 200 element hashmap prefers a lower load factor
then you could choose to change the load factor
which is still a decision you should want to avoid
(from a design point of view, making the load factor configurable is good because of Dependency Inversion)
 

« first day (3136 days earlier)      last day (1803 days later) »