Mysql Router not sending Write request to R/W instance

I am doing InnoDB Cluster Group Replication for the first time. I stuck at the last step Mysql Router. Mysql Router is configured with bootstrapping, But the main issue is MySQL router does not send the write request to the Primary R/W instance after failover. After failover primary become node instance and the Error says The MySQL server is running with the –super-read-only option so it cannot execute this statement

I am following this tutorial

Thanks in advance

How can I write a formula for this houseruled roll in AnyDice?

So here it goes:

  1. The roll is a pool of dice of d6s, d8s, and d10s. The minimum dice pool is 1d6 and the maximum dice pool is 10 dice. It could be 2d6 + 2d8 + 1d10, for example.
  2. Rolling 5+ is a success.
  3. A number of successes is necessary equal or higher than the Difficulty (that ranges from 1 to 10) to have a successful check.
  4. The maximum value of a die explodes: 6 in a d6, 8 in a d8, 10 in a d10. But there’s a limit by the character’s Protagonism (ranges 1 to 10). It’s like the level of the character, so one with Protagonism 3 could not explode any dice more than 3 times. The eventual 4th time counts only as a normal success, even if it has the maximum value again.

I see it can be very difficult to do this, so I thank anyone who may come up with something. Thanks so much!

Using double write buffer is 8x slower in SSD (compared with 2x~3x in HDD)

I understand the double-write-buffer enhances the reliability of data, so it makes transactions slower. But it is amazing that the slow down is such severe in the newest Samsung 980 pro (M.2 PCIe 4.0, which is about 400$ for 1TB).

Configurations: other parameters are defaults.
CPU: AMD Ryzen 3900XT
MEM: 64GB, 3200MHz
OS: Ubuntu 20.10, all disks are ext4
MySQL: 8.0.22

Why does this happen? Did I hit a performance bug?


en ter image description here

Need a script that saves what I write

I´m someone, who is really interested in statistics and music, so when Spotify released their 2020 User Statistics, I wanted to make something similar for my own.

Because I don´t think Spotify will allow me to see user statistics. I instead wanted to try making a mobile app, where i can type in something like: Song – Artist and then it saves what I´ve typed in a list I´ll always have access to. But then, I had another idea: When I type for example Savage Love – Jason Derulo and one day later i type it in again, in the list, there should be shown something like:

  1. Savage Love – Jason Derulo (listened: 2 time/s)

and if I then don´t like this song anymore and instead i hear Lucid Dreams – Juice Wrld for three times, the list shall show me something like:

  1. Lucid Dreams – Juice Wrld (listened: 3 time/s)
  2. Savage Love – Jason Derulo (listened: 2 time/s)

Tell me if you haven´t understood something, and please also tell me, if you know, how to do this (or if you have suggestions)

Should I write custom allocators for STL containers to interface with my memory pool, or just overwrite the standard new and delete

I want to write a custom memory allocator for learning. I’m tempted to have a master allocator that requests n bytes of ram from the heap (via new). This would be followed by several allocator… Adaptors? Each would interface with the master, requesting a block of memory to manage, these would be stack, linear, pool, slab allocators etc.

The problem I have is whether I should write custom allocator_traits to interface with these for the various STL containers; or if I should just ignore the adaptor idea and simply overload new and delete to use a custom pool allocator.

What I’m interested in understanding is what tangible benefit I would gain from having separate allocators for STL containers? It seems like the default std::allocator calls new and delete as needed so if I overload those to instead request from my big custom memory pool, I’d get all the benefit without the kruft of custom std::allocator code.

Or is this a matter where certain types of allocator models, like using a stack allocator for a std::dqueue would work better than the default allocator? And if so, wouldn’t the normal stl implementation already specialise?

i want to write this query for php

SET @sql = NULL; SELECT   GROUP_CONCAT(DISTINCT     CONCAT(       'max(CASE WHEN = ''',       date_format(date, '%Y-%m-%d'),       ''' THEN coalesce(ca.remarks, ''N'') END) AS `',       date_format(date, '%Y-%m-%d'), '`'     )   ) INTO @sql FROM time_dimension where date>='2020-09-01'   and date <= '2020-09-30'; select @sql; SET @sql    = CONCAT('SELECT ca.employee_id,                ', @sql, '              from             (               select, a.employee_id,a.remarks               from time_dimension c               left join attendance a on             ) ca             where>=''2020-09-01''               and <= ''2020-09-30''                and employee_id is not null             group by ca.employee_id'); select @sql; PREPARE stmt FROM @sql; EXECUTE stmt; DEALLOCATE PREPARE stmt; 

I’m trying to write a randomly patrolling AI for my 2D Platformer

I’m trying to write a randomly patrolling AI for my 2D Platformer. The AI already has a ground checker function which checks if there are tiles nearby or not. What I want to do is randomize its actions and create an illusion of a somewhat "sentient" enemy. What I tried to create below is using the built in RNG to make the enemy either jump, change direction, or keep moving.

The problem is, it doesn’t seem to work properly. The enemy just jumps every second I want it to change behaviour. The change direction functions, however, don’t occur as frequently. I need to know what I’ve done wrong here. Thanks.

void Update() {          //RNG       behaviour = Random.Range(0,3);       jumpSpeed = Random.Range(1,5);         //clock       timer += Time.deltaTime; }    //time     private float waitTime = 2.0f;     private float timer = 0.0f;   void MoveRandomizer() {     if((Mathf.Round(timer%waitTime)) == 0)     {         if(behaviour == 0)         {         movingRight = false;                  }         if(behaviour == 1)         {            movingRight = true;                  }         if(behaviour == 2)         {         rb.velocity = new Vector2(rb.velocity.x, jumpSpeed);         }     }         } 

How to write “∀x.F(x)” for “F(x)=λx.Φ(x)” in one expression (sequel from question about “∀(λφ. (φ x m→ φ y))”?

This question is sequel from How to understand quantifier without predication " ∀(λφ. (φ x m→ φ y))"? which further explains the notation and context.

So – I have anonymous Boolean-valued function F(y)=λx.Φ(x) (of course, y and x point to the same variable, I just used different syntactic names, to point out, that x is bound variable) and I would like to write the statement, that F(x) is true for all the values of the argument and it can be written ∀x.F(x). But F(x) is named function, but I would like to write the same expression for the anonymous function that uses lambda, so I am with my suggestion: ∀x.λx.Φ(x) or ∀x.λy.Φ(y)? And apparently they both are wrong.

What I am trying to achieve? I just want to build parser for language that is declared in This language contains expressions like [∀(λΦ. P (λx. m¬ (Φ x)) m→ m¬ (P Φ))].

I am using ANTLR grammar for lambda calculus and I understand that the 1) quantifiers; 2) logical connectives; 3) arithmetic functions are just another lambda functions (it is just syntactic sugar that they are written in the specific non-lambda syntax/prefix form etc.) and as such I express them in the existing lambda.g4 grammar So – my first step is to write the cited expressions with the named functions and then I will just replace them with anonymous functions because lambda.g4 has no options to introduce named functions. But it is so confusing to write anonymous function and the quantifier function for the same argument.

Just side question – maybe there is better ANTLR grammar for lambda calculus with syntactic sugar for quantifiers and connectives?

Why did Hopcroft and Karp write $M_0, M_1, M_2, \cdots, M_i, \cdots$? (Hopcroft – Karp Algorithm)

I am reading “An $ n^{\frac{5}{2}}$ Algorithm for Maximum Matchings in Bipartite Graphs” by Hopcroft and Karp.

Please see the image below.

Let $ s$ be the cardinality of a maximum matching.
I think any of $ M_0, M_1, M_2, \cdots, M_s$ is a matching and $ M_s$ is a maximum matching.
So, I think $ P_s$ doesn’t exist.
But the authors wrote $ M_0, M_1, M_2, \cdots, M_i, \cdots$ and $ |P_0|, |P_1|, \cdots, |P_i|, \cdots$ .


Maybe I am confused. enter image description here