Skip to main content
18 votes
1 answer
1k views

In C#, using the structure HashCode and the List<T>.ForEach method shows a behaviour that I cannot explain: The two snippets below do not return the same result: Working as expected: var ...
Julian's user avatar
  • 285
0 votes
2 answers
130 views

I have a class that includes sets and optionals: class SomeRequest{ Set<Long> longs; Optional<String> name; Optional<Set<Long>> opLongs; Optional<Long> ...
S.Dan's user avatar
  • 1,940
0 votes
1 answer
104 views

I am building an empty image using the following Dockerfile: FROM scratch I tried in multiple environnements. I get either an imageID 71de1148337f or 471a1b8817ee. Why is that ? Why two different ...
sr-01-01's user avatar
  • 115
-2 votes
1 answer
93 views

I have a Class B defined as below --> Class B { private List<String> obj1; private List<A> obj2; // Need to implement hashcode() and equals() methods } In my code, I am using ...
rishi007bansod's user avatar
0 votes
1 answer
46 views

In Java we know some examples of strings which have identical hash codes despite being distinct strings, such as Ea and FB both having a hash code of 2236. Is there a way, algorithmically, to come up ...
Aamir's user avatar
  • 493
0 votes
1 answer
154 views

Could someone explain the following behavior for .hashcode(). When working with the two classes below I get different values for .hashcode() calls. Now I am just trying to understand the reason behind ...
Gustavo Palomino's user avatar
1 vote
2 answers
108 views

I have a basic class called Dice that represents groups of dice. The format I use for them is D&D's format of NdX. Where N is the number of dice and X is the number of sides each dice has. EG. 5d6 ...
Detinoy's user avatar
  • 45
2 votes
3 answers
173 views

I had a bit of a curious behaviour with negative and positive double value hashcodes I was not expecting. Essentially, if the same Double value appears twice in the hashcode function, if the sign of ...
Claudio's user avatar
  • 83
1 vote
0 answers
26 views

I have a custom key. However the test to make them equal is failing. The hash and equals have been overriden Can you please give me some clue? @Getter @Setter public class CustomKey { private int ...
matel's user avatar
  • 485
1 vote
1 answer
75 views

I have a bunch of objects with xyz pairs (bytes) that I need to add to a dictionary. It's in the tens of thousands and I'm not sure what the most efficient way would be to go about it. Would ...
user2980746's user avatar
-2 votes
1 answer
107 views

I have a question about HashMap<Key,Values>. Let's imagine this scenario: I have a Person class: Person a=new Person(int id, String fullName, int age) I didn't define the equals and hashCode ...
el moutawakil's user avatar
2 votes
3 answers
352 views

I'm looking for an implementation of hash code to use alongside IReadOnlySet<T>.SetEquals. .NET's HashCode type appears to be order sensitive, so it is not a good fit. var random = new Random(); ...
Kyle McClellan's user avatar
0 votes
0 answers
82 views

Suppose I have a list of 64-bit integers $X = (x_1,x_2,\ldots,x_N)$. I want to make a hash signature for $X$ with a very low collision rate, preferably one as low as the SHA functions. The catch is ...
Brendan McKay's user avatar
2 votes
1 answer
140 views

I'm workig (as a part of a team) on an Enterprise Java application that has been in active development for 15+ years now. We are looking to build a REST API that would call some of the EJBs of the '...
Gozke's user avatar
  • 41
-1 votes
1 answer
67 views

I want to compare StudentDTO class object. StudentDTO s1 = new StudentDTO(); StudentDTO s2 = new StudentDTO(); s1.equals(s2) I have Class StudentDTO contains AddressDTO class object as ...
user2042166's user avatar

15 30 50 per page
1
2 3 4 5
137