Questions tagged [mod]

For questions related with the *mod operation*, that can arise in Cryptography, Number Theory, Hashing, etc..

In computing, the modulo operation finds the remainder after division of one number by another (sometimes called modulus). Given two positive numbers, a (the dividend) and n (the divisor), a modulo n (abbreviated as a mod n) is the remainder of the Euclidean division of a by n.

437 questions
2
votes
1 answer

Module operation with decimals?

In System Dynamics there are transformations (like Arnold's cat map) in which, in addition to the iteration on the index n, (mod 1) is applied. Example is: Xn + 1 = 2 Xn (mod 1) That for an initial value 0.65 we would obtain the sequence (2x0.65)…
2
votes
3 answers

APACHE 2.4 Remote Proxy mod_substitute and ProxyHTMLExtended don't work

I built a reverse proxy with Apache 2.4 on a cento's 7 server. It works with standard html pages but i need to substitute some url stored in .js files too. The directive: ProxyHTMLExtended On should enable the parsing inside external .css and .js…
S.Succi
  • 21
  • 1
  • 3
2
votes
2 answers

What is the time complexity of the whole algorithm?

I am new to asymptotic notation and here is the algorithm. What is the worst case tight bond for time complexity and why? F(A,B) { //A and B are positive while A>0 print(A mod B) A=A div B }
WILLIAM
  • 457
  • 5
  • 28
2
votes
1 answer

Sort even numbers, then odd numbers

I need to sort street addresses for people to walk on either side of the street. Therefore I need to order the even address numbers first, then the odd numbers. I've already managed to sort by street name, but now how do I sort the data by evens and…
chuck_iv
  • 25
  • 1
  • 7
2
votes
2 answers

Creating a random int generator with an even probability

In the code below, I want to ensure that there is an even chance of theImageRand being equal to theImage or theImage2, but I realized that between 1 and 100 more numbers are equal to 2 mod 1 than 2 mod 0. So theImage is being chosen a…
collegesista
  • 87
  • 3
  • 12
2
votes
0 answers

Mod operator to scan through table entries

Is there any built-in Matlab function, let's call it modd, that works like the mod function but returns x for modd(x,x) (unlike mod(x,x) which returns 0).
pluton
  • 244
  • 1
  • 9
2
votes
1 answer

How to find probe sequence of keys?

How would I solve this question? I'm sort of confused on how to start The keys 34, 25, 79, 56, 6 are to be inserted into a hash table of length 11, where collisions will be resolved by open addressing. The hash function is h(k,i) = (k mod11 + i(1+k…
HPotter
  • 141
  • 2
  • 11
2
votes
2 answers

Could someone explain to me why mod (-4) 3 =2 and not 1?

I'm trying to put my head around the mod function. All seemed well until I tried mod (-4) 3 in GHCi. Could someone explain to me why mod (-4) 3 is equal to 2 and not 1? It's really bothering me!
letter
  • 91
  • 1
  • 7
1
vote
0 answers

C# Harmony Transpiler null field exception for one of two nearly identical calls

Here's my code. Question is at the bottom: namespace DifficultyModNS { [HarmonyPatch(typeof(Boosterpack),nameof(Boosterpack.Clicked))] public class OneVillagerChecks { public static Int32 frequency = 5; public static…
jmucchiello
  • 18,754
  • 7
  • 41
  • 61
1
vote
0 answers

How to get node-esl data outside of the connection object?

I have tried and implemented the esl part for freeswitch using this https://github.com/englercj/node-esl/tree/master It works fine just that I want the data outside of the connection object and I cannot get it. This is the…
Ritam
  • 11
  • 2
1
vote
1 answer

AMPL duplicate member "x" for set "y", how to fix it

I'm working with AMPL. In the ".mod" I have declared a set like this: set path_intersections; It consists of rows of two numbers, the first one is the number of the path, and the second one the number of the intersection, in the .dat it looks like…
Ares
  • 11
  • 4
1
vote
0 answers

Inconsistent vendoring error about fsnotify package even though go build -mod vendor is run during the docker build stage

Here is the console output of Jenkins build and related error with Docker and fsnotify. 09:39:52 Step 1/21 : FROM golang:1.16.15-stretch as builder 09:39:52 ---> c6f80a9088b5 09:39:52 Step 2/21 : ENV CGO_ENABLED=1 09:39:52 ---> Using…
baris
  • 157
  • 1
  • 9
1
vote
1 answer

How can I get a correct decimal results for a Python modulo operation (without extra libs)?

I am trying to get a correct decimal (not scientific) expression for the following equation. It seems, by default, Python prints the scientific notation. I am using Python on an embedded system, so I cannot easily install libs. I am looking for a…
wishi
  • 7,188
  • 17
  • 64
  • 103
1
vote
2 answers

CS50 Week 2 Caesar Practice

My code seems to be working properly except at the point when it should print the final output. The problem is to input a string and output an encrypted version. The encryption works by adding an int defined as the key and then adding that value to…
Alec
  • 17
  • 5
1
vote
3 answers

Got an error trying to install mod_v8 for FreeSwitch 10 in Debian 11: You need to either install libv8-6.1-dev, ibv8fs-dev

On a "clean" Debian 11, I deployed all the necessary packages and began to build FreeSWITCH 10 with the mod_v8 module enabled. When executing the ./configure command, I get the message: checking for v8-6.1_static >= 6.1.298... checking for…
Sly Fox
  • 21
  • 4