Skip to main content
Stack Overflow
  1. About
  2. For Teams
Filter by
Sorted by
Tagged with
0 votes
1 answer
48 views

I'm fairly new to Agda and I'm trying to construct the Interval's lattice. So far I've defined the Lattice datatype as follows: data I : Set where ⊤ : I ⊥ : I -∞ : Z → I _+∞ : Z → I I : ...
1 vote
1 answer
81 views

I’m trying to understand whether all pure functions are commutative with respect to execution order. That is, does the order in which pure functions are executed ever matter, assuming no external ...
0 votes
2 answers
124 views

In the context of op-based CRDTs, it has been shown that a sufficient condition to ensure convergence (Strong Eventual Consistency) is that all operations commute. (assuming an underlying reliable ...
0 votes
2 answers
103 views

Is there a way to essentially write "and vice versa" in an if statement without writing the same code again but with "||"? if (currentDirection == 1 && nextDirection == 2) ...
4 votes
1 answer
145 views

I have implemented a class vec3: struct vec3 { double x = 0, y = 0, z = 0; auto& operator*= (double d) {x *= d; y *= d; z *= d; return *this;} }; auto operator* (const vec3 &a, double ...
0 votes
2 answers
110 views

I have the following problem with my code. I start off with a polynomial (f = 3x+2y+xy), and want to store the coefficients and variables in separate lists (I want to be able to change this polynomial ...
2 votes
2 answers
185 views

I wanted to ask whether there is a method to expand brackets in Python non-commutatively. For example, INPUT (x+y)**2, OUTPUT x**2 + x*y + y*x + y**2, instead of the usual output x**2 + 2*x*y + y**2. ...
1 vote
1 answer
275 views

Does a non commutative homomorphic hash function exist (or been researched/published)? LtHash developed by Facebook and implemented on Github here is the sort of function I am looking for, but LtHash ...
0 votes
2 answers
84 views

Hello I have a function foo (Int -> Int -> Int) in haskell and I want to map each element of a list [1..y] to a value x which I would usually do like this: map (foo x) [1..y] the problem is my ...
0 votes
1 answer
73 views

I have following code and want to check commutative property with impure functions. Can anyone explain why the first two console log print 3, 3 and why the direct function call print 3 and -3? var ...
11 votes
2 answers
751 views

I am investigating corner cases of numeric operations in R. I came across the following particular case involving zero divided by zero: (0/0)+NA #> [1] NaN NA+(0/0) #> [1] NA Created on 2021-07-...
3 votes
1 answer
324 views

Suppose I have a group of related non-scalar structs with a commutative arithmetic operation defined on them. For example, struct Foo { a: f64, b: f64 } impl Add<f64> for Foo { type ...
MSR's user avatar
  • 2,921
1 vote
4 answers
111 views

I have used the bcrypt library in my Ruby program. I noticed that the order of the equality operator seems to be important. Depending on which variable is left or right of the '==' I get a different ...
1 vote
2 answers
278 views

I am calculating the Hamming distance between 2 strings where Hamming(A,B) == Hamming(B,A) The function signature is @lru_cache def Hamming(A:str,B:str)->int: ... How can I modify @lru_cache ...
1 vote
2 answers
751 views

I want to run the following code: df = df.coalesce(1).orderBy(["my_col"]) but its execution will obviously bottleneck on a single task doing all the sort work. I know it's possible to run ...

15 30 50 per page
1
2 3 4 5

AltStyle によって変換されたページ (->オリジナル) /