Whether can mysql router connects to several MySQL InnoDB CLuster?

As suggested by MySQL, we can install MySQL Router service on application server.But how to configure the MySQL Router service when it needs to connect to several MySQL InnoDB Cluster?

For example, we have 2 InnoDB Clusters ClusterA and ClusterB.The applications connecting to the 2 clusters are under same host HostA.How can we configure in the mysql router on HostA, then we can use mysql router to connect 2 clusters.

What does the entry 3/day mean if several spell-like/psi-like abilities are listed?

I am preparing an encounter involving a psionic Yuan-Ti Abomination. The entry in the XPH lists under the section psi-like abilities:

3/day—body purification (6 points*), psionic charm (all targets, 1 day/level, DC 19*), concealing amorpha, deeper darkness, mind thrust (ML 7th, 7d10, DC 18*), psionic suggestion (four targets, DC 16*); (XPH, p. 218)

Does that mean the Yuan-Ti can manifest

a) each psi-like ability listed here 3/day,

b) a total of three manifestations of abilities in this list, including using the possibility to use one ability three times

c) three abilites out of this list once each

A similar issue arises with the spell-like abilities in the gnome entry in PHB, where it says:

1/day—dancing lights, ghost sound, prestidigitation.

Does this mean gnomes can use each of these abilities once, or only one of these?

Help needed with several engines use case

We are developing an app, aprox 50k RPM read, 1k RPM write, it ask via key and get a JSON. The search is always made by key. I’m inclined to use one MySQL 8 table with a Id field and JSON field with innodb. Seems simple, cheap and fast accessing by index. Each index can have n rows (30 max), total size of table less than 100gb. Response time is important, I think 2-10ms are achievable on MySQL. The other, more expensive options that I have are DynamoDB and ElasticSearh (can’t use another tool). Can’t find a comparison for this use case to help me know if I’m in the correct path. Do you see any cons of using MySql or I’m missing something? Thanks!!

How to make a game object from several game objects in Unity?

Dear Stackoveflow fourm I have programmed a great music game. Unfortunately there is a problem. In my game there are so many objects that my smartphone can’t load the game properly. I have nowhere to find out how to make an object out of many objects. If someone knows how to do it I would be very happy!

My Script:

   using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement;  public class line : MonoBehaviour {          //Please attach me to the line, then set  dline,tail,mcamera,road,decorates,dieeff.     //You can add more to make this better!     public GameObject dline, tail, mcamera, road, decorates, dieeff;      private GameObject tempgo, tempdia, tempcr;      public bool direction, alive, start, load, roadmaker;      public float cameraspeed, temprm;      public Vector3 offset, tempcrgo;      private GameObject[] dia, cr;      List<GameObject> go = new List<GameObject>();      void Start()     {         start = false;         load = true;         alive = true;         //find diamonds and crowns         dia = GameObject.FindGameObjectsWithTag("dia");         cr = GameObject.FindGameObjectsWithTag("crown");         //     }      void Update()     {         if (load == true)         {             //save the initial distance between camera and line             offset = mcamera.transform.position - dline.transform.position;             cameraspeed = 0.03f;             load = false;             //         }         //restart         if (Input.GetKeyDown(KeyCode.R) == true)         {             SceneManager.LoadScene("main");         }         //         if (start == false && alive == true)         {//start game             if (Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)             {                 start = true;                 dline.GetComponent<AudioSource>().enabled = true;             }          }//          if (start == true)         {//turn             if (Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)             {                 if (direction == true)                 {                     direction = false;                 }                 else                 {                     direction = true;                 }             }         }//          //build road/wall more efficiently         if (roadmaker)         {             temprm += 1;             //why there is temprm?to reduce the ammount of roads             //why build one when click?to ensure there is road/wall when line turns(or it will look weird)             if (temprm % 6 == 1 || Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)             {                 GameObject.Instantiate(road, dline.transform.position + new Vector3(3, 0, -3), dline.transform.rotation);                 GameObject.Instantiate(road, dline.transform.position + new Vector3(-3, 0, 3), dline.transform.rotation);             }// // //         }         else         {//when you play ...I dont put the part in Update but if(roadmaker) because these actions will create new gameobject and interfere the copying of road             GameObject.Instantiate(tail, dline.transform.position, dline.transform.rotation);             if (Input.GetMouseButtonDown(0) == true || Input.GetKeyDown(KeyCode.Space) == true)             {                 if (direction == true)                 {                     go.Add(GameObject.Instantiate(decorates, dline.transform.position + new Vector3(8, -9, -5), dline.transform.rotation));                 }                 else                 {                     go.Add(GameObject.Instantiate(decorates, dline.transform.position + new Vector3(-5, -9, 8), dline.transform.rotation));                 }             }         }//     }      void FixedUpdate()     {//smooth camera         mcamera.transform.position = Vector3.Lerp(mcamera.transform.position, offset + dline.transform.position, cameraspeed);         //         //some 'animations' .I didnt use animation component because I dont know how it works in Unity :(         foreach (GameObject tempgo in go)         {             tempgo.transform.position += new Vector3(0, 0.2f, 0);         }          foreach (GameObject tempdia in dia)         {             tempdia.transform.localEulerAngles += new Vector3(0, 2, 0);             if (Mathf.Abs(dline.transform.position.x - tempdia.transform.position.x) < 1 && Mathf.Abs(dline.transform.position.z - tempdia.transform.position.z) < 1 && tempdia.transform.localScale.z > 0)             {                 tempdia.transform.localScale -= new Vector3(0.3f, 0.3f, 0.3f);             }         }         foreach (GameObject tempcr in cr)         {             tempcr.transform.localEulerAngles += new Vector3(0, 2, 0);             if (Mathf.Abs(dline.transform.position.x - tempcr.transform.position.x) < 2 && Mathf.Abs(dline.transform.position.z - tempcr.transform.position.z) < 2 && tempcr.transform.localScale.z > 0)             {                 tempcr.transform.localScale -= new Vector3(0.26f, 0.26f, 0.26f);                 tempcrgo = tempcr.transform.position;             }             if (tempcr.transform.localScale.z <= 0)             {                 tempcrgo += new Vector3(Random.Range(-2f, 2f), Random.Range(-1f, 2f), Random.Range(-2f, 2f));                 tempcr.GetComponent<Light>().enabled = true;                 tempcr.transform.position = Vector3.Lerp(tempcr.transform.position, tempcrgo, 0.02f);              }         }         //         if (start == true && alive == true)         {//how the line move             if (direction == true)             {                 dline.transform.position += new Vector3(0.3f, 0, 0);             }             else             {                 dline.transform.position += new Vector3(0, 0, 0.3f);             }         }//     }      void OnCollisionEnter(Collision x)     {//when die...         if (x.collider.tag == "wall")         {             alive = false;             mcamera.GetComponent<AudioSource>().enabled = true;             dieeff.SetActive(true);         }//           //when complete the level...         if (x.collider.tag == "Finish")         {             offset = offset + offset + offset + offset;             cameraspeed = 0.01f;         }//     } } 

`

Game Scene

Video Link:

https://drive.google.com/file/d/1dqIqu6tx5thNbCJ1jNndXEJY_a9JJGGe/view?usp=sharing

Matching several indexes

I have a large set of data in which I need to compare several samples in different tests and under varying conditions. I am looking for a way to pair and analyze these easily. As an example, lets say I have Samples (S) a, b, and c, which undergo tests (T) 1 and 2, under conditions (C) x, y and z, which output results (R) R1 and R2.

S   T   C   R1  R2 a   1   x   2.9 a   1   y   2.6 a   1   z   8.7 a   2   x   9.4 0.372 a   2   y   8.1 0.208 a   2   z   7.6 0.154 b   1   x   7.5 b   1   y   7.3 b   1   z   1.7 b   2   x   3.9 0.213 b   2   y   7.9 0.435 b   2   z   2.5 0.294 c   1   x   6.2 c   1   y   1.8 c   1   z   6.3 c   2   x   1.5 0.246 c   2   y   6.0 0.496 c   2   z   1.7 0.167 

The tests have different outputs, and I need to apply specific functions depending on the test. Such as:

Test1[a,b] = R1a/R1b Test2[a,b] = R1a/R2a - R1b/R2b 

The tests should only be applied to samples with matching conditions, but each sample should be paired. So a result would be:

S1  S2  T   C   R a   b   1   x   2.9/7.5 a   c   1   x   2.9/6.2 a   b   2   x   9.4/0.372-3.9/0.213 a   c   2   x   9.4/0.372-1.5/0.246 a   b   1   y   2.6/7.3 ... 

I’ve been trying to get this right for a while and just end up confusing myself. Anyone have a solution or suggestions? If you want an easily copyable format of the example:

{{S,T,C,R1,R2},{a,1,x,2.9},{a,1,y,2.6},{a,1,z,8.7},{a,2,x,9.4,0.372},{a,2,y,8.1,0.208},{a,2,z,7.6,0.154},{b,1,x,7.5},{b,1,y,7.3},{b,1,z,1.7},{b,2,x,3.9,0.213},{b,2,y,7.9,0.435},{b,2,z,2.5,0.294},{c,1,x,6.2},{c,1,y,1.8},{c,1,z,6.3},{c,2,x,1.5,0.246},{c,2,y,6.,0.496},{c,2,z,1.7,0.167}}

Using several render textures at the same time during runtime

I want to achieve a system where I can use render textures as portraits/icons. So when I select something I want to show it in my UI, currently I do:

  1. Spawn my prefab with the model (I have one of these prefabs for each model), in my case this prefab has a camera (for render texture), a model, and a spotlight.
  2. Show this render texture in my UI

This is fairly straight forward when I only need one render texture at a time. But say I select a house and want to see all residents, now I need 6-10 render textures all showing different models.

Should I create/destroy render texture assets at runtime for this type of feature, since each camera would need its own render texture? Im worried its an expensive feature that costs more than its worth perhaps.

Or do I need to create one render texture asset for each model in my game, and simply point to it in the prefab mentioned above?

Is there a smarter way?

The whirpool application of the Control Water spell leads to several questions regarding creatures caught in it

As written, the whirlpool usage of the Control Water spell says:

Whirlpool. This effect requires a body of water at least 50 feet square and 25 feet deep. You cause a whirlpool to form in the center of the area. The whirlpool forms a vortex that is 5 feet wide at the base, up to 50 feet wide at the top, and 25 feet tall. Any creature or object in the water and within 25 feet of the vortex is pulled 10 feet toward it. A creature can swim away from the vortex by making a Strength (Athletics) check against your spell save DC.

When a creature enters the vortex for the first time on a turn or starts its turn there, it must make a Strength saving throw. On a failed save, the creature takes 2d8 bludgeoning damage and is caught in the vortex until the spell ends. On a successful save, the creature takes half damage, and isn’t caught in the vortex. A creature caught in the vortex can use its action to try to swim away from the vortex as described above, but has disadvantage on the Strength (Athletics) check to do so.

The first time each turn that an object enters the vortex, the object takes 2d8 bludgeoning damage; this damage occurs each round it remains in the vortex.

Are creatures or objects in the water and within 25′ of the vortex automatically pulled 10′ toward it? Do they continue to be pulled 10′ further toward the center of the vortex every round they are in it? Is a creature or object caught in the vortex also pulled down toward the bottom? On a failed save, are they caught for the entire duration of the spell, with no more chance at saves, or until they can swim free of it? On a failed save, does a creature continue to take 2d8 bludgeoning damage every round they are in the vortex? Can the whirlpool be cast so that it is completely underwater? Also, can the whirlpool be cast ‘upside down’ so the widest part is at the bottom?

Can magic missile be considered both 1 damage roll and several? [duplicate]

While 99% of the time this doesn’t matter if you roll several dice or just the 1 dice for all the darts, a player did something which seems contradictory and knowing the true answer to this would clear up a lot of uncertainty.

They cast magic missile after using Hexblade’s curse, to add their prof to each damage roll. Then after used the Empowered Metamagic to reroll the 1 for all the darts, into a 4, and topped it all of with the wizards Empowered Evocation to add their INT to the dart.

The way I see this the Hexblades curse would only work several times if you were treating each of the darts individually, by rolling them out separately. This would have the benefit that the Lore Bards cutting words can’t cut the damage down to zero as effortlessly, by cutting the 1 dart that is multiplied down to 0.

But if treated as an AOE the Empower Metamagic and wizards Empowered Evocation would work. This also matters immensely when considering how magic missile works on damage thresholds (others have answered, and it seems to contradict again).

So my question which way does it work?

Binary string satisfying several constraints

I’m trying to solve this problem, but without success.

Problem: You’re given a binary string where some of the bits are replaced by ?. You’re also given several intervals [$ l_i$ , $ r_i$ ] ($ l_i < r_i$ ). Find a binary string S with ? replaced by 0 or 1, such that in each interval [$ l$ , $ r$ ], s[$ l..r$ ] includes both 0 and 1.

Example:

Given the string 00?11 and the interval [2, 3], the string 00111 satisfies the requirements, as S[2..3]=01 include both 0 and 1.

However, the string 00?11 and the intervals [2, 3] and [3, 4] cannot be solved, as the ? would have to be both 0 and 1.

The bounds are |S|,Q<=1e5

I tried using greedy, but it’s giving wrong answer for this case: 0??0, [1, 3], [2, 3] and [3, 4], as the greedy algorithm would try 0??0 -> 01?0 -> 0100 -> fail, yet there exists a solution (0010).

I tried removing completely overlapping intervals (such as [1, 3] and [2, 3]), but there’re other cases I found that fails. What would be a correct solution?

Thanks.

MariaDB subqueries to same table and column resulting in several columns

I have a table and want to pick monthly minute data to compare column wize in 10.3.13-MariaDB

Tested and tested for hours and hours different approaches without success, one example is below. Some tests does not complain syntactically but takes forever, and some tests complains about column names not recognized. All subqueries if tested separately return the same number of records, each in one column.

`SELECT RD, OT1, OT2, OT3 FROM

(SELECT rdate from OO where month(rdate) = 7 and year(rdate) = 2006) AS RD,

(SELECT ot from OO where month(rdate)=7 and year(rdate) =2006) AS OT1,

(SELECT ot from OO where month(rdate)=7 and year(rdate) =2007) AS OT2,

(SELECT ot from OO where month(rdate)=7 and year(rdate) =2008) AS OT3;`

The result should be something like:

`RD OT1 OT2 OT3

2006-07-01 00:00:00 1.2345 2.1234 1.543

… … … …

2006-07-31 23:59:00 3.456 3.234 2.234`

And, no I dont want to use UNION because then they will still follow one after the other…

Any thoughts?!