Questions tagged [xor]
For questions involving exclusive-or operations (typically bitwise).
1,644
questions
1
vote
2
answers
163
views
Smallest element after xor
Starting with array of N positive integers, support Q queries. Each query contains a positive integer i. To answer the query, replace each element of the array with the result of xoring it with i, ...
-1
votes
1
answer
66
views
XOR bytes in c#
I saw a neat way to swap 2 variables using XOR lately and decided to try that in c# with strings, and though I managed to do that I'm a little worried that I have to cast int into byte after the XOR ...
3
votes
2
answers
66
views
How to XOR shapes with CSS only?
In the example below, the two XORed bars do not completely cancel out when perfectly aligned. You can see their outline.
How to make the outline disappear, which is what a correct XOR should do?
....
1
vote
1
answer
40
views
Get XOR between 2 dataframes
How to get difference between 2 pandas dataframes (symmetric difference)?
import pandas as pd
a = pd.DataFrame({'a': [1, 2], 'b': ['x', 'y']})
b = pd.DataFrame({'a': [1, 2, 3], 'b': ['x', 'z', '']})
...
0
votes
1
answer
46
views
Having trouble understanding binary scan results of XOR data frame over web socket?
I'm likely doing something very stupid and I'm having quite a bit of trouble understanding how these results could possibly be generated.
Over a web socket from a browser to a local Tcl script, the ...
1
vote
2
answers
133
views
Check if there are 3 numbers in array whose XOR is equal to zero
Given array of N real numbers x_1, x_2, ..., x_n, check if there exists 1 <= i,j,k <= n such that x_i ⊕ x_j ⊕ x_k = 0, where ⊕ is XOR operation.
This is college homework and it has to be done in ...
0
votes
0
answers
44
views
English character frequency calculation
I've written code to perform character frequency analysis on strings by taking the standard ETAOIN SRHD... frequencies of english character occurrence and I have two questions.
Is this the most ...
1
vote
5
answers
234
views
Negate every bit value of a binary in C
So I got a coding problem, the the program asks me to negate every bit of a binary, for example, the regular bitwise negation will be like this:
ten = 00001010 the negation is 11110101 = 245, well to ...
0
votes
0
answers
24
views
XOR Hex and ASCII [duplicate]
I have a 16 bit key (e.g., abcd) that represents hex values, and a 16 bit input (e.g., 0123) that I read in and stored in a character array. How would I XOR these together in C? I'm pretty stuck on ...
0
votes
1
answer
151
views
XOR Encryption in C with key
I am trying a simple XOR encryption in C/C++ for Windows. To achieve this I am using a key "SECRETKEY" and a character array "payload". If at some point the value of current key ...
0
votes
0
answers
26
views
Operating XOR over a defined set of iterating matrices in python
I have a set of defined rules numbered [1, 2, 4, 8, 16, 32, 64, 128, 256]. Whenever I enter a positive integer, my code converts it into a binary representation of 9-bit. It then calls the rule ...
0
votes
1
answer
51
views
How to model an exclusive or in OWL?
I OWL I want to model the case where for a certain class only one or the other subclass is allowed. I want to model a restriction that allows for a property to be only linked like (A XOR B) OR (some ...
0
votes
0
answers
37
views
XOR with NEAT Algorithm
I'm currently trying to implement the NEAT algorithm according to this paper https://nn.cs.utexas.edu/downloads/papers/stanley.ec02.pdf and I'm trying to solve the XOR problem with my current ...
0
votes
1
answer
42
views
XORing all values of a (2d) numpy array together
If I have a 2d numpy array like (the data is not necessarily sequential but for example)
[[0. 1. 2. 3.]
[4. 5. 6. 7.]
[8. 9. 10. 11.]]
how can I compute 0^1^2^3^4^5^6^7^8^9^10?
I think I could ...
-3
votes
2
answers
119
views
XOR operator problems in C [closed]
Which of the following options can achieve a swapping effect for pair (*, *)? Note that ^ represents XOR operation. For binary numbers, 0 XOR 0 = 0, 0 XOR 1 = 1, 1 XOR 0 = 1, 1 XOR 1 = 0.
A. (x, y): x ...