## 6 random character prefix automatically added to entire DB tables, how / why?

I’m working on a site, live on server. I’m using Navicat for working with the DB. I have the WP DB opened and am 100% sure the tables were just standard tables, using standard wp_ prefix.

While I’m working on another screen in admin area, I needed some user-meta info, I refresh the already opened DB.. and suddenly ALL tables have 6 random character prefix automatically added to entire DB tables!

So now instead of having one table.. wp_usermeta
I now have.. aojsfj_wp_usermeta

Now, opening for example aojsfj_wp_usermeta is not a list of users, it’s just ONE user’s meta. So now the DB has created all separate tables per the few (7) test user accounts, prefixing them with 6 random characters.

Can someone enlighten me on why / how this has happened? So far everything still seems to be working, but the DB + all these new tables can’t be good!

## Ndsolve of random (periodic) initial conditions via BSplineFunction

Suppose we want to solve the heat equation for a random initial temperature field T(t,x,y). Therefore I define the initial conditions with the BSplineFunction which nicely incorporates periodic boundary conditions and try to solve it with NDSolve:

Clear["Global*"] Lx = 1; Ly = 1; eq = D[T[t, x, y], t] == Laplacian[T[t, x, y], {x, y}]; pbc1 = T[t, x, 0] == T[t, x, Ly]; pbc2 = T[t, 0, y] == T[t, Lx, y]; T0[x_, y_] =   BSplineFunction[RandomReal[1, {30, 30, 1}], SplineClosed -> True][x,    y] Plot3D[T0[x, y], {x, 0, Lx}, {y, 0, Ly}, PlotRange -> All,   AxesLabel -> {"x", "y", "T"}, ColorFunction -> "DarkRainbow",   Mesh -> All, MeshStyle -> Opacity[.2]] T0[0, 0] ic = T[0, x, y] == T0[x, y] ic2 = T[0, x, y] == 0.5*Exp[-4 ((x - Lx/2)^2 + (y - Ly/2)^2)]; Monitor[AbsoluteTiming[   sol = NDSolve[{eq, pbc1, pbc2, ic},      T, {t, 0, 1}, {x, 0, Lx}, {y, 0, Ly},      Method -> {"MethodOfLines",        "SpatialDiscretization" -> {"TensorProductGrid",          "MaxPoints" -> 25}},      EvaluationMonitor :> (currentTime =         Row[{"t = ", CForm[t]}])]], currentTime] 

The code unfortunately throws an error "Data … is not a rectangular tensor with dimensions …". I assume this results from the fact that T0 evaluated e.g. at grid point [0,0] returns a list {} and NDSolve probably needs just the float value.

I tried T0[0,0][[1]] which yields the expected value. But this does not work for the definition of the initial condition: ic = T[0, x, y] == T0[x, y][[1]], where x,y are not set yet. This returns just x, in reality it should first put in the values of x,y and only after that take list element 1 (if I am not mistaken).

Apart from that the code works fine which can be verified if you simply use ic2 instead of ic as initial condition in NDSolve.

Can someone help to get this running?

## The Objective

Graph the difference between the probability distributions of sets of random variables that come from a number of different sources using a stacked bar chart (or another type of graph suited for such visualization).

## The Problem

I’m not sure of the right combination of SQL SELECT statement(s)/condition(s) to present the data to the graphing tool in the right way to achieve the objective above.

## The Method

### Summary

Feed the source data stored in Google Cloud Platform (GCP)’s BigQuery into Google Data Studio and use a stacked bar graph to visualize the numerous probability distributions.

### The Source Data

I’m dealing with simple binary outcomes, either a heads or tails. One trial (== one second) per source yields between 0 to 200 how many heads (1s) were counted.

The schema of the data we have stored in BigQuery is as follows:

time      | source1 | source 2 | ... sourceN --------------------------------------------- 09:00:00  | 99      | 110      | 95         | 09:00:01  | 101     | 115      | 107        | 09:00:02  | 99      | 91       | 97         | 

### For a Single Source

The following works fine if I’m trying to graph the results from just a single source. And as the law of probability would say, the graphed distribution is moreorless in fit with the expected bell curve.

SELECT   source1 AS src1,   COUNT(source1) AS count FROM   rnddata WHERE   recorded_at >= "2021-03-11 08:45:00" AND   recorded_at < "2021-03-11 09:45:00" GROUP BY src1 ORDER BY src1 
src1 | count 75   | 1 77   | 2 80   | 2 81   | 5 82   | 6 83   | 20 84   | 10 85   | 14 86   | 31 87   | 33 88   | 48 89   | 74 90   | 74 91   | 89 92   | 107 93   | 133 94   | 135 95   | 168 96   | 160 97   | 192 98   | 190 99   | 195 100  | 189 101  | 197 102  | 191 103  | 188 104  | 180 105  | 201 106  | 130 107  | 128 108  | 107 109  | 96 110  | 64 111  | 65 112  | 45 113  | 40 114  | 19 115  | 22 116  | 18 117  | 9 118  | 8 119  | 6 120  | 3 121  | 4 125  | 1 

### For Multiple Sources

I’m thinking that if I can have multiple dimensions (src1, src2… srcN) with a single count column for the metric, then I will be able to graph the dimensions as stacked bars on the X axis and have the count metric set to the X axis.

I imagine the output could be something like this:

src1 | src2 | count 75   | null | 1 77   | 77   | 2 80   | 00   | 2 null | 80   | 5 82   | 82   | 6 83   | null | 20 83   | 11   | null 84   | 84   | 10 

I did a bit of research and experimenting with UNIONS and JOINS and INTERSECTS but couldn’t quiet get the above output. Any advice on how to form such an SQL statement to do that, or offer a better presentation (schema) of the data for the graphing purposes, would be greatly appreciated.

## How does Nilbogism interact with features that have a random table of effects?

The Nilbog at page 182 in Volo’s Guide to Monsters has the following feature:

Nilbogism. Any creature that attempts to damage the nilbog must first succeed on a DC 12 Charisma saving throw or be charmed until the end of the creature’s next turn. A creature charmed in this way must use its action praising the nilbog. The nilbog can’t regain hit points, including through magical healing, except through its Reversal of Fortune reaction.

So if anyone would use the a Wand of Wonder, even the nilbog himself, would they have to make a Charisma Save before using it if there is a slim chance they could harm the nilbog?

If the nilbog would use it, there are a lot which could happen to him: stunned on a 11-15, potential 1d6 psychic damage on a 21-25, potentially standing in a fireball 70-79, blinded on a 91-95, petrified on a 98-00.

## In Teradata SQL how to get random number between a pair, coming from field/column?

I am recently got stuck upon a simple problem in Teradata: how to get random number between a pair of number coming from field/column?

The function RANDOM( lower_bound , upper_bound ) apparently is restricted to only accept fix number rather than field / column name.

--THIS ONE FAILS: WITH TRIAL(CATEGORY, VAL_MIN, VAL_MAX) AS ( SELECT 'A', 0, 3 FROM CTE UNION ALL SELECT 'B', 1, 9 FROM CTE UNION ALL SELECT 'C', 2, 5 FROM CTE UNION ALL SELECT 'D', 1, 12 FROM CTE ), CTE(DUMMY) AS (SELECT 'X') SELECT T.*, RANDOM(T.VAL_MIN, T.VAL_MIN) --HERE'S THE PROBLEM FROM TRIAL T;  --THIS ONE WORKS: WITH TRIAL(CATEGORY, VAL_MIN, VAL_MAX) AS ( SELECT 'A', 0, 3 FROM CTE UNION ALL SELECT 'B', 1, 9 FROM CTE UNION ALL SELECT 'C', 2, 5 FROM CTE UNION ALL SELECT 'D', 1, 12 FROM CTE ), CTE(DUMMY) AS (SELECT 'X') SELECT T.*, RANDOM(1, 7) --HERE'S THE PROBLEM FROM TRIAL T; 

I’m pretty sure there’s simple solution for this. Greatly appreciate any help.

## Is there an item that summons random encounters?

I am looking for an item that will simulate the Hands Of Fate feeling. For those unfamiliar with the game both the player and the dealer chooses several encounter cards and then the player starts exploring the cards in a random order.

## Specifying statistical models / Equations between Random Variables

I’m new to Mathematica and confused about how random variables work.

Say I have a standard normal random variable $$X\sim \mathcal N(0,1)$$ and set $$Y := 2X$$. Then $$\operatorname{Cov}(X,Y) = 2$$. Now if I generate $$N$$-iid. draws for $$X$$, the sample covariance of $$X_1,\dots, X_N$$ and $$Y_1,\dots, Y_N$$ with $$Y_n := 2X_n$$ should be close to $$2$$.

My question is: how can I compute statistics (e.g. sample covariance) in Mathematica? Naively, I tried

x:=RandomVariate[NormalDistribution[], 5000] y:=2*x Covariance[x,y] `

but the result is clearly incorrect (usually not close to $$2$$), because in actuality (I presume) under this model $$Y$$ is independent of $$X$$.

What is the most convenient way of achieving the correct result?

## Random date for all comments in the range of 2 days

Tell me, please, is it possible to somehow update the date of all comments? I need to update them every day, i.e. it is necessary for each comment to change the date to a random one in the range of the last 2 days. Unfortunately, I don’t even have a beginning, no code, or anything else. Please tell me.

## Do identical bonuses from random properties of different Artifacts stack?

Some Artifacts have Major/Minor Beneficial/Detrimental Properties, rolled from the appropriate table.

If I were to have two attuned Artifacts, both with, say, the Minor Beneficial Property of "While attuned to the artifact, you gain a +1 bonus to Armor Class.", would I have a +2 or +1 AC bonus?

From the DMG Errata on Combining Game Effects (p. 252):

Different game features can affect a target at the same time. But when two or more game features have the same name, only the effects of one of them—the most potent one—apply while the durations of the effects overlap. […] Game features include spells, class features, feats, racial traits, monster abilities, and magic items.

"Artifact property" isn’t listed, which is evidence for +2. But Artifacts are magic items, which may mean it should only be +1 instead. Which is correct?

## Which 3rd party D&D nested random encounter resource includes combat/social/treasure/mystery encounters for each type of environment?

I had once found a nested random encounter resource, as in there was a master table to determine the whether the party discovered interesting terrain, combat, mysteries, etc and one could then find associated tables for those encounter types for various environments: arctic, trade road, forest, grassland, underwater…

This book was very similar to Necromancer Games 2003 Mother of All Encounter Tables except as I had stated previously unlike MOAET the book I am looking for includes many different types of possible discoveries to come across whereas MOAET simply lists possible monsters one might find and fight in a particular biome.

I do not remember many of the encounters from this book but one that had stuck out in my mind is one from the arctic table where the party comes across a metallic device generating heat in the snow, as if to imply alien or future technology.

Does anyone know the name of this resource or where to find it?