## Is there performance loss in out of sequence inserted rows (MySQL InnoDB)

I am trying to migrate from a bigger sized MySQL AWS RDS instance to a small one and data migration is the only method. There are four tables in the range of 330GB-450GB and executing mysqldump, in a single thread, while piped directly to the target RDS instance is estimated to take about 24 hours by pv (copying at 5 mbps).

I wrote a bash script that calls multiple mysqldump using ‘ & ‘ at the end and a calculated --where parameter, to simulate multithreading. This works and currently takes less than an hour with 28 threads.

However, I am concerned about any potential loss of performance while querying in the future, since I’ll not be inserting in the sequence of the auto_increment id columns.

Can someone confirm whether this would be the case or whether I am being paranoid for no reasons.

What solution did you use for a single table that is in the 100s of GBs? Due to a particular reason, I want to avoid using AWS DMS and definitely don’t want to use tools that haven’t been maintained in a while.

## Ringed Wall of Fire: How does the damage sequence go?

When casting WoF, you can cast it as a ring, and designate the inside of the ring to be the damage side (thus, everyone inside must save or take 5d8 at the time of casting). The spell then says

“A creature takes the same damage when it enters the wall for the first time on a turn or ends its turn there.”

So, by making a ring-shaped wall, are the creatures inside forced to save again on their turn (because they either ended within 2 squares of the damaging side, or they entered the wall’s space)?

## Minimizing cost of a given sequence by partitoning [closed]

Given a sequence of positive integers of size N(let) divide it into at most K(K > N/C) disjoint parts/subsequences in order to minimize the "cost" of the entire sequence.

Partitions cannot overlap, for example [1,2,3,4,5] can be divided into [1,2], [3,4] and [5] but not [1,3] and [2,4,5].

The cost of a subsequence is computed as the number of repeated integers in it. The cost of the entire sequence is computed as the sum of costs of all the subsequences and a fixed positive integer cost C times the number of partitions/divisions of the original sequence.

How should I go about determining the position and number of partitions to minimize the total cost?

Some more examples:

The given list = [1,2,3,1] Without any partitions, its cost will be 2 + C, as 1 occurs two times and the original sequence is counted as one partition.

[1,1,2,1,2] Without any partitions, its cost will be 5, as 1 occurs three times and 2 occurs two times. If we divided the subsequence like so [1,1,2],[1,2] then the cost becomes 2 + 2*C, where C is the cost of partitioning.

I have actually solved the problem for the case of C = 1, but am having problems generalizing it to higher values of C.

For C = 1 it makes sense to partition the sequence while traversing it from one direction as soon as a repetition occurs as the cost of a single repetition is 2 whereas the cost of partitioning is 1.

I’m trying to solve it in nlog(n) complexity ideally or at most a fast n^2.

## Help understanding a theorem Kleinberg proves related to sequence alignment

This is from Kleinberg’s Algorithm Design text (Theorem 6.14)

Let $$M$$ be an alignment of $$X$$ and $$Y$$. If $$(m, n) \notin M$$, then either the $$m^{\text{th}}$$ position of $$X$$ or the $$n^{\text{th}}$$ position of $$Y$$ is not matched in $$Y$$.

The theorem does not state that $$m, n$$ must be the last elements of $$X$$ and $$Y$$ respectively, but earlier, when introducing the topic, he uses $$m, n$$ to denote the last entries of the two strings. Which of these is correct?

## Find number of ways to create sequence $A$ of length $n$ satisfying $m$ conditions

Find number of ways to create sequence $$A$$ of length $$n$$ satisfying $$m$$ conditions. This sequence $$A$$ should consist of only non negative numbers. Each condition is described by three integers $$i,j,k$$ signifying $$max$$($$A_{i}$$,$$A_{j}$$)=$$k$$.
It is guaranteed that each index of the sequence will be there in at least one condition i.e. there will be finite number of such sequences.
The maximum value of $$n$$ will not exceed $$18$$ and maximum value of $$k$$ will not exceed $$2*10^4$$.
I tried it using dynamic programming but the time complexity came out to be exponential. Can you suggest me any better approach which will reduce the time complexity?

## Find number of ways to create sequence $A$ of length $n$ satisfying $m$ conditions

Find number of ways to create sequence $$A$$ of length $$n$$ satisfying $$m$$ conditions. This sequence $$A$$ should consist of only non negative numbers. Each condition is described by three integers $$i,j,k$$ signifying $$max$$($$A_{i}$$,$$A_{j}$$)=$$k$$.
It is guaranteed that each index of the sequence will be there in at least one condition i.e. there will be finite number of such sequences.
The maximum value of $$n$$ will not exceed $$18$$ and maximum value of $$k$$ will not exceed $$10^6$$.
I tried it using dynamic programming but the time complexity came out to be exponential. Can you suggest me any better approach which will reduce the time complexity?

## Car Chase sequence in modern 5E?

I’ve done a few vehicle sequences in our campaign so far, where I drop my party into a situation that requires one of them to pilot a vehicle and react to environmental challenges thrown at him as a result of his piloting abilities. I’ve used Dex checks to accomodate overcoming this, but I’m curious if anyones aware of an established or widely used methodology that I can adopt to make this more challenging/interesting? The meat of the next session is going to involve a high-speed pursuit through the avenues of a city in lockdown, and I want the party to feel like they’re doing more than just on rails.

To summarise;

• Is there an established approach to handling vehicle handling/chases?
• Should I give my passengers any specific advantages or disadvantages if they attempt to attack pursuing vehicles?
• How should I measure the length of the chase? (I was thinking I’ll throw 10 to 20 ‘milestone’ challenges at the pilot, and if he succeeds, they reach intact, if not, the pursuit comes to an end)

Cheers

## Is there a way to store an arbitrarily big BigInt in a bit sequence, only later to convert it into a standard BigInt structure?

I am trying to imagine a way of encoding a BigInt into a bit stream, so that it is literally just a sequence of bits. Then upon decoding this bit stream, you would generate the standard BigInt sort of data structure (array of small integers with a sign). How could you encode the BigInt as a sequence of bits, and how would you decode it? I don’t see how to properly perform the bitwise manipulations or how to encode an arbitrary number in bits larger than 32 or 64. If a language is required then I would be doing this in JavaScript.

For instance, this takes bytes and converts it into a single bit stream:

function arrayOfBytesTo32Int(map) {   return map[0] << 24     | map[1] << 16     | map[2] << 8     | map[3] } 

How would you do that same sort of thing for arbitrarily long bit sequences?

## Can TLS defeat the manipulation of TCP sequence numbers?

Assuming there is a powerful adversary who can arbitrarily manipulate the sequence number of each tcp packet, then the following packet-reorder attack should be possible, right?

Assuming the packet the attacker wants to disorder has the tcp sequence number n, he first allows the n+1, n+2, …, n+m packets to be sent out but modifies the sequence-number fields to use numbers n, n+1, …, n + m -1. Finally, the attacker uses the sequence number n+m to send the detained packet.

Is the attack still possible when TLS/SSL is used?

## Supremum of a sequence

Given is the set $$D := \{x \in \mathbb{R}\ |\ x^2-4x < 5\}$$.

Is $$sup\ D = \{5,-1\}$$ or $$sup\ D = 5$$?