Skip to main content
Filter by
Sorted by
Tagged with
Advice
0 votes
4 replies
112 views

In Haskell, how should one test the equality of two infinite lists? With finite lists, one might try: listEqual :: Eq a => [a] -> [a] -> Bool listEqual l0 l1 = and $ zipWith (==) l0 l1 But ...
Geoffrey Warne's user avatar
0 votes
1 answer
101 views

I'm in a .NET 6 web application with EFCore, and I have these boilerplate abstract classes and interfaces for defining entities. I know it's quite a number of complexity layers, but it really helps me ...
Davide Vitali's user avatar
0 votes
3 answers
97 views

take the code below: contentsDiv.innerHTML = container.outerHTML; if(contentsDiv.firstChild === container) console.log('true'); in this code, contentsDiv is a div created in my html file ...
Miachi Solomon's user avatar
-1 votes
3 answers
298 views

The Equals and GetHashCode methods on anonymous types are overridden to make them work in such a way that two instances of the same anonymous type are considered equal only if all their properties are ...
Sisus's user avatar
  • 750
0 votes
1 answer
77 views

I am wondering if, and if so which guarantees there are about the pickle module when using pickle.dump[s]. Specifically for my problem I am pickling list[T] where T can be bool, int, decimal, time, ...
JoniKauf's user avatar
  • 346
1 vote
4 answers
134 views

I have a custom class for holding a collection of quotes in swiftData in my app. It looks like this: @Model final class CollectionData: Equatable { var name: String var data: [Quote] var ...
Kitten Apps-Films's user avatar
0 votes
2 answers
105 views

I have two classes, non-generic BindingFilter and generic BindingFilter<T>: public class BindingFilter { public object Value { get; set; } public string Member { get; set; } ...
dgo's user avatar
  • 3,987
0 votes
0 answers
39 views

I have a custom dataclass, which is rather lage (many attributes, methods). Some attributes are pandas dataframes. The default __eq__ comparison does not work for the attribtues which are pandas ...
user13132640's user avatar
0 votes
1 answer
107 views

I would like to test if the coefficients across different regressions are the same in R and I am not sure how I should do it. Let me illustrate. I have an independent variable of interest called treat ...
Alex's user avatar
  • 1,304
0 votes
2 answers
206 views

This might be a beginners question, but I have a problem for which I could not find an existing solution and was hoping you could help me here. I would like to compare instances of a reference type ...
notSoSharpAskingAboutcSharp's user avatar
0 votes
1 answer
91 views

I am working on a kotlin function that needs to verify that all objects in a collection have the same value for a particular property. Normally I would simply use distinctBy() and check that the size ...
pbuchheit's user avatar
  • 1,839
3 votes
1 answer
502 views

Consider this Minimal Reproducible Example. Point point1 = new Point(1, 2, 3); Point point2 = new Point(1, 2, 31); Console.WriteLine(point1 == point2); // True Console.WriteLine(point1.Equals(point2)...
FluidMechanics Potential Flows's user avatar
1 vote
2 answers
414 views

I'm interested in the most efficient way to check for equality of memory blocks. Currently, I use memcmp(...) == 0 to determine if two memory blocks are equal. While this works, memcmp is designed not ...
AvidCoder's user avatar
  • 531
-3 votes
3 answers
2k views

What's the best way to compare two lists of string in terraform? ["arm64"] == ["arm64"] evaluates to false My use case is constructing lambda extension ARNs based on ...
Croad Langshan's user avatar
3 votes
3 answers
248 views

When trying to construct an example where a == b is not the same as b == a, it seems that I have accidentally constructed an example where a == b is not the same as a.__eq__(b): class A: def ...
Sebastian Thomas's user avatar
3 votes
1 answer
375 views

What's the correct way to compare hashtables in Pester tests? i.e. the following gives the error: InvalidResult: Expected System.Collections.Hashtable, but got System.Collections.Hashtable. $expected =...
JohnLBevan's user avatar
  • 24.8k
8 votes
1 answer
343 views

In (an idealized version of) Haskell, is there a concrete type a such that we can implement Eq a lawfully, but it is impossible to implement Ord a? The order doesn't need to be meaningful, and any ...
Trebor's user avatar
  • 431
0 votes
1 answer
76 views

I have the past 19 days of stock price stored in the pd.dataframe and I am trying to find out the price P that is smaller than (mean - 2.5*standard deviation), where mean and standard deviation are ...
Roy Chang's user avatar
1 vote
1 answer
159 views

i have a question why it works like this var a = new Tuple<object, object, object>(1, 1, 1); var b = new Tuple<object, object, object>(1, 1, 1); Console.WriteLine(a.Item1==b.Item1);//...
Кирилл Гелашвили's user avatar
0 votes
1 answer
117 views

Code: #include<stdio.h> #include<stdlib.h> unsigned char s(const unsigned char x) { static const unsigned char aes_s_box[16][16] = { {0x63, 0x7C, 0x77, 0x7B, 0xF2, 0x6B, 0x6F,...
kesarling's user avatar
  • 2,322
0 votes
2 answers
232 views

If we have a class that contains properties/fields of other reference types, how would a proper and elegant equality check be performed? For example, MainClass contains properties of SubClassA and ...
Tsaras's user avatar
  • 493
1 vote
0 answers
29 views

I am filtering using AngularJS. Everything works fine, but I want a filter to work differently. If "1" is searched, the result should only be "1". I would like your help regarding ...
CodeInSpace's user avatar
-2 votes
1 answer
59 views

I wrote this code to ask the user for options A, B, or C and show a message afterward, but even if I type the correct options, it still sends me the 'try again' message. what can I do so the program ...
Carlos De Avila's user avatar
1 vote
0 answers
54 views

In MATLAB R2016a, suppose that I define the array arr = -0.2:0.1:0.2. I may then find the location of the value el = 0.1 with the command idx = find(arr==el). This correctly yields idx = 4. But now ...
SapereAude's user avatar
2 votes
0 answers
59 views

In the following example (my attempt to mimic section feature of LEAN4 prover), I have declared 2 special axioms that allows 2 objects of type Gen[T] to be perceived equal and can be cast to each ...
tribbloid's user avatar
  • 3,792

1
2 3 4 5
45