Are dice re-rolled together or sequentially for Chaos Bolt with Empowered Metamagic?

The Sorcerer’s Empowered Spell metamagic option reads

Empowered Spell When you roll damage for a spell, you can spend 1 sorcery point to reroll a number of the damage dice up to your Charisma modifier (minimum of one). You must use the new rolls.

While the spell Chaos Bolt reads:

You hurl an undulating, warbling mass of chaotic energy at one creature in range. Make a ranged spell attack against the target. On a hit, the target takes 2d8 + 1d6 damage… If you roll the same number on both d8s, the chaotic energy leaps from the target to a different creature of your choice within 30 feet of it. Make a new attack roll against the new target, and make a new damage roll, which could cause the chaotic energy to leap again.

If Sorcerer chooses to Empower Chaos Bolt and has a Charisma modifier of at least +2 do they need to re-roll all of the dice that they wish to re-roll at once or can they re-roll one d8 then, if it does not match, re-roll the other?

As an example:

The sorcerer casts Chaos Bolt and rolls a 7 and an 8. They use Empowered spell and re-roll the 7 getting a 3. Can the sorcerer re-roll the 8?

Relevance of data races in sequentially consistent languages?

In (e.g.) Java we have the promise that if there are no data races in our program, then the program will execute as if sequential consistency was offered by the language. This means that data races are important in Java.

But are data races important also in languages that offer sequential consistency for all programs? If so, why? And what definition of data races makes sense for such languages? As far as I can tell, Java’s definition of data races does not make sense in a language that offers sequential consistency for all programs, as there would be no non-synchronized reads or writes in the Java sense in such language?

Merging individual files from two folders sequentially (never asked question)

I need to merge the contents of two folders sequentially into individual destinations. Here is what i have. A,B,C,D,E,F are individual files.

Folder 1: A B C ...  Folder 2: D E F ... 

At the output i need merged files sequentially. So they should be merged like this:

Output: AD BE CF ... 

In other words, first file from the Folder 1 with the first file from the Folder 2. Second file from the Folder 1 with the second file from the Folder 2. In our case AD is consisting of the content of files A and D, BE consisting of files B and E, etc.

Both folders have the same number of files. Output can go anywhere. For the sake of simplicity let’s call it Output folder and locate it in the same root as Folder 1 and 2.

Been looking for the solution for two days now. Yikes!

What is the name of the tool that makes it less likely to roll the same number sequentially?

I’m searching for an online tool a friend used in an RPG once, that adjusted the probabilities of an otherwise fair dice roll to make it less likely to roll the same number multiple times. So, if you rolled 1d6 and got a 4, your next roll off 1d6 would be less likely to be a 4 than it would be to roll 1, 2, 3, 5, and 6.

This made for pretty interesting play, since it enforced a broader distribution of values on dice that we wouldn’t otherwise have seen. We still rolled on average the same number, but the distribution was wider.

Does anyone know where I could find this tool?

Merge pdfs sequentially

I would like to merge 4 pdfs, pdf1.pdf, pdf2.pdf, pdf3.pdf pdf4.pdf together so that the pdfs are spliced, i.e. the first page will be the first page of pdf1, the second the first of pdf2, the third the first of pdf3, etc.

How would I accomplish this? It would be nice to do it from the terminal as well.

Pattern for sequencing steps in a job to run sequentially against external system

I am trying to understand how I can make the code for this easy to understand and debug too. The reason I’m asking is that it feels like the kind of scenario which has probably been tackled before plenty of times. And if that is the case I would like to use that as a solid starting point which will allow this to be extended and scale in the future of its lifetime.

Ihave a web application, which needs to performs lots of different actions against an existing external system. The trigger is an action performed in the portal. The order of the steps at design time, and they need to run in order. The actions needed are generally formed of a few steps.

Eg.

Portal action (Job)A -->  (Task A -> Task B -> Task C) Portal action (Job)B -->  (Task A -> Task D -> Task E) Portal action (Job)C -->  (Task B -> Task D -> Task E) Portal action (Job)D -->  (Task C -> Task E) etc, etc. 

The steps need to run in order.

While there are technology choices (possibly queuing) within this, the main thing I’m trying to decide on is a code structure.

I have considered a couple of patterns.

  • Chain of Responsibility – From what I understand, it seemed like more of a filter for permissions/validation, rather than a method to chain together steps.
  • Event Sourcing – To get the benefit, it looked better suited to none sequential execution or possibly multiple subscribers to the same event.

I’m still struggling to accept that I am searching for a pattern that doesn’t exist. I’m looking advice on that front, what is the suitable pattern to give me a good solid starting point?