## statistics – How to calculate the chances of reaching a certain success level prior to failed channeling?

In Warhammer 4e casters can use channeling in order to gain success level prior to casting a spell. Success levels are essentially for every 10 you exceed the skill number you gain a success level and they keep piling up till you make a failed roll.

As a wizard I am trying to figure out how to calculate the probability of piling up enough SL’s before failing channeling and suffering a miscast.

What I wish to ask if how can I calculate my odds of reaching a certain SL prior to suffering a miscast (Making a failed roll) and losing all of my SL? (Note that the system uses a d100 and you try to roll below your skill.)

Posted on

## nt.number theory – Reaching real numbers from other real numbers by changing a small number of digits in the base b expansion

Given a real number $$r$$, and an integer $$b$$>0, we can define $$B_b(r)$$ as the set of numbers which are obtained from $$r$$ by writing $$r$$ in base $$b$$ and then altering a density zero subset of its digits. For example, if $$r=0.0000…$$ then $$B_2(r)$$ would include $$0.10100100001000001 cdots$$ . There is a slight ambiguity here in the definition if r has a finite expansion in base $$b$$; for example whether for 1 we use $$r$$ written as 1.0000… or we use r written as 0.9999… For our purposes, it is probably ok to include both, and won’t alter the answers to any of the things we care about. Given S a subset of the real numbers we can then define $$B_b(S)$$ as the union of $$B_b(s)$$ for every s in S. We’ll define $$T(S)$$ as the union of $$B_b(S)$$ for every base $$b$$.

Set $$U(r)$$ to be $$bigcup_{i=0}^{infty} T^i(r)$$.

Question 1) Is it true that $$U(0)= mathbb{R}$$?. My guess is that the answer is probably “No” but it isn’t obvious. One might try a measure theoretic argument, but since the union of an uncountable number of measure zero sets is not necessarily of measure zero, it doesn’t seem to get a result. Note that for any $$r$$, $$T(r)$$ contains every number of the form $$r+q$$ for $$q$$ a non-negative rational, since adding $$frac{a}{b}$$ changes only a finite number of digits in base $$b$$.

We can also define versions of $$B_b$$ for complex numbers, where we do the same thing changing a zero density set of the real part and the complex part, and then define $$T_{mathrm{com}}(s)$$ accordingly. Given a set of complex numbers Let $$overline{S}$$ be the algebraic closure of the smallest field containing a given set S of complex numbers. We can then define $$U_{mathrm{com}}(r)$$ as the union of $$T(r)$$, $$overline{(T(r))}$$, $$T(overline{(T(r))})$$, $$overline{T(overline{(T(r))})} cdots$$

Question 2: Is $$U_{mathrm{com}}(0)$$ all complex numbers? This question seems to be possibly substantially much harder, and I’m less certain what the answer is.

Posted on

## graphics card – GPU makes a beeping sound when reaching high clock frequency or moving cursor around

I have searched everywhere and it all points to coil whine, but I’m not quite sure yet.

The beeping noise happens when I move my cursor around in desktop, but not if I move it on any other windows/programs. Same with clock frequency, it increases to 1900+MHz when I move the cursor in my desktop background, but not when I’m moving it inside a window (like a browser, notepad etc)

What could the problem be? And how do I solve it?
The GPU is still under warranty, however due to GPU stock shortages, I want to avoid RMAing it without necessity.
The GPU in question is an MSI RTX 3090 Gaming Trio

Here is the video (headphones recommended so you can hear the beeping sound):
https://streamable.com/ewm8fz

Posted on

## unity – How can I make transform to rotate facing the next waypoint each time reaching a waypoint?

``````using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;

public class MoveOnCurvedLines : MonoBehaviour
{
public LineRenderer lineRenderer;
public float speed;
public bool go = false;
public bool moveToFirstPositionOnStart = false;

private Vector3() positions;
private Vector3() pos;
private int index = 0;
private bool goForward = true;
private List<GameObject> curvedLinePoints = new List<GameObject>();

// Start is called before the first frame update
void Start()
{
curvedLinePoints = GameObject.FindGameObjectsWithTag("Curved Line Point").ToList();
transform.rotation = curvedLinePoints(1).transform.rotation;

pos = GetLinePointsInWorldSpace();

if (moveToFirstPositionOnStart == true)
{
transform.position = pos(index);
}
}

Vector3() GetLinePointsInWorldSpace()
{
positions = new Vector3(lineRenderer.positionCount);
//Get the positions which are shown in the inspector
lineRenderer.GetPositions(positions);

//the points returned are in world space
return positions;
}

// Update is called once per frame
void Update()
{
if (go == true)
{
Move();
}
}

int counter = 1;
void Move()
{
Vector3 newPos = transform.position;
float distanceToTravel = speed * Time.deltaTime;

bool stillTraveling = true;
while (stillTraveling)
{
Vector3 oldPos = newPos;
newPos = Vector3.MoveTowards(oldPos, pos(index), distanceToTravel);
distanceToTravel -= Vector3.Distance(newPos, oldPos);
if (newPos == pos(index)) // Vector3 comparison is approximate so this is ok
{
// when you hit a waypoint:
if (goForward)
{
bool atLastOne = index >= pos.Length - 1;
if (!atLastOne) index++;
else { index--; goForward = false; }
}
else
{ // going backwards:
bool atFirstOne = index <= 0;
if (!atFirstOne) index--;
else { index++; goForward = true; }
}
}
else
{
stillTraveling = false;
}
}

transform.position = newPos;

counter++;
transform.rotation = curvedLinePoints(counter).transform.rotation;
}
}
``````

There are 12 waypoints I called the List variable as curvedLinePoints.
The positions array are positions between the curvedLinePoints but I want the transform to rotate facing each next curvedLinePoints point and there are 12 like this.

The way I did it with the counter is wrong and also give exception out of bound index. and I should not doing it in the Update at this place.

In the Start I tried to make the transform to point the next waypoint :

``````transform.rotation = curvedLinePoints(1).transform.rotation;
``````

Not sure if it’s the right way.

And I also want later to do that it will rotate smooth to the next waypoint and not just rotate at once but first how to make it rotating looking the next waypoint ?

Posted on

## Why should I care about my transactions ever reaching the blockchain if I can spend them while unconfirmed?

From what I understand, I can use unconfirmed transactions because they are essentially already confirmed, they just need to reach the blockchain. This can create a chain of unconfirmed transactions, but that’s fine because they will all eventually be confirmed and added to the blockchain.

If that is the case, why should I care about my transactions ever reaching the blockchain? I don’t see a reason why I should care, and with that, I don’t see a reason to include a fee with my transactions.

Posted on

## dnd 5e – Is a Spell-Refueling Ring useless for a Warlock once reaching level 7?

My Warlock just got a ring with the Artificer Infusion “Spell-Refueling Ring”, this infusion states:

While wearing this ring, the creature can recover one expended spell slot as an action. The recovered slot can be of 3rd level or lower. Once used, the ring can’t be used again until the next dawn.

However, I am a Warlock which means that at 7th level, I literally do not have any 3rd level or lower spell slots. Does the ring thus become useless at this point and I should just give it to another party member?

Posted on

## performance – Why is my mongodb setup not reaching EBS IOPS limit?

I have an application that is constantly pumping data to MongoDB. MongoDB instance is running with 2-replicas, each with 3TB gp2 EBS volume.

As you can see on the following graph of

``````irate(node_disk_reads_completed_total{}(1m))
irate(node_disk_writes_completed_total{}(1m))
`````` The reading performance is slow and steady, which is normal, but the writes seem to be under-performing.

Even in the peaks we never reach theoretical 3IOPS/GB * 3000 GB = 9k IOPS. The application itself is spending most of the clock time pumping more and more data to the DB, so from the perspective of the app the DB is the clear bottleneck.

So why can’t it go faster? And why is it such a wave? I would expect that writing to WAL will provide constant source of write activity and things like periodic fsync to disk would not really cause such extreme up and down patterns.

Could it be that syncing between replicas are causing pauses in the throughput? But I am using the default write concern, which should be `w: 1, j: true` and not require waiting for replicas.

Anything else that I might be missing?

Posted on

## algorithms – The shortest path that visits every specified node before finally reaching the specified end node?

After asking another question(Is the last step in the Christofides’ algorithm necessary), I have decided Christofide’s algorithm probably doesn’t solve the problem I’m facing.

Is there any algorithms that would best suit this problem?

The input is a set of nodes on a graph (an implementation would be similar to the illustration in the question), and the required output is the shortest path that visits every specified node before finally reaching the specified end node.

Posted on

## collision detection – What is the best way to check if a moving 2D object will collide with another inmobile one before reaching it’s destiny?

If the other thing isn’t moving, you can use a raycast. (You didn’t say what engine you’re working with, but there should be a way to use one for any major engine.) Start at a point just outside of your moving object’s hitbox, and cast a ray in the direction of the object’s movement, with its length being the length the object will move in however much time you want to “predict.” If the ray hits the immobile object, then that’s your predicted collision. If not, your path is clear for the length of the ray.

Posted on

## unity – How can I move object to target then do something when reaching the target and then to move back to it’s original position?

Inside Update :

``````if (finalLookWeight > 0.95f) // here you can play with a value between 0.95f -> 1.0f
{
if (primaryTarget.interactableMode == InteractableItem.InteractableMode.Action
{
// call your funtion to shoot something here
StartCoroutine(ThrowObject(objToThrow.transform, primaryTarget.transform, throwSpeed));
}
}
``````

I’m using a helper flag IsAlreadyThrown so the Coroutine will not start over and over again nonstop.
But I also want to be able from outside this script using in other script to change the flag IsAlreadyThrown back to false at some places/times in the game. How can I make that I can change the flag to false from other scripts ?

And inside the ThrowObject method I did :

``````IEnumerator ThrowObject(Transform objectToMove, Transform toPosition, float duration)
{
float counter = 0;

while (counter < duration)
{
counter += Time.deltaTime;
Vector3 currentPos = objectToMove.position;

float time = Vector3.Distance(currentPos, toPosition.position) / (duration - counter) * Time.deltaTime;

objectToMove.position = Vector3.MoveTowards(currentPos, toPosition.position, time);

yield return null;
}

//StartCoroutine(ThrowBack(objectToMove, toPosition, duration));
}
``````

And :

``````IEnumerator ThrowBack(Transform objectToMove, Transform toPosition, float duration)
{
float counter = 0;

while (counter < duration)
{
counter += Time.deltaTime;
Vector3 currentPos = objectToMove.position;

float time = Vector3.Distance(currentPos, toPosition.position) / (duration - counter) * Time.deltaTime;

objectToMove.position = Vector3.MoveTowards(toPosition.position, currentPos, time);

yield return null;
}
}
``````

The first part is working fine the ThrowObject but then I tried to start the second Coroutine ThrowBack but it’s just not doing anything. The object is not moving and stay in the target position. It’s getting to the line :

``````objectToMove.position = Vector3.MoveTowards(toPosition.position, currentPos, time);
``````

but the objectToMove just stay in position.

This is what I want to do more or less :

``````IEnumerator ThrowObject(Transform objectToMove, Transform toPosition, float duration)
{
float counter = 0;

while (counter < duration)
{
counter += Time.deltaTime;
Vector3 currentPos = objectToMove.position;

float time = Vector3.Distance(currentPos, toPosition.position) / (duration - counter) * Time.deltaTime;

objectToMove.position = Vector3.MoveTowards(currentPos, toPosition.position, time);

yield return null;
}

DoStuff(objectToMove, toPosition, duration);
}

void DoStuff(Transform objectToMove, Transform toPosition, float duration)
{
// do things when finish start the ThrowBack

StartCoroutine(ThrowBack(objectToMove, toPosition, duration));
}
``````

At least this is the logic I want to do.

Posted on