## real analysis – The set of all rational points in the plane is a countable set

From Kolmogorov’s Introductory Real Analysis. I am doing some self-study and would like some feedback on whether my proof is correct.

I am using that the set of rational numbers is countable as given, and I am invoking the following Theorem which is proved in the book.

Theorem 2. The union of a finite or countable number of countable sets $$A_1, A_2, ldots$$ is itself countable.

Claim. The set of all rational points in the plane (points with rational coordinates) is countable.

Proof.
Since $$mathbb{Q}$$ is a countable set, we can write $$mathbb{Q} = {q_1, q_2, q_3, ldots}$$. If we fix $$q_1$$ we can define the following set:
$$Q_1 = {(q_1, q);|; qinmathbb{Q}},$$
which are all the rational points in the plane with $$q_1$$ in the $$x$$ position. We can create a one-to-one correspondence with $$mathbb{Q}$$ by simply setting $$pleftrightarrow (q_1, p)$$ for each $$pinmathbb{Q}$$, which shows
that $$Q_1$$ is countable. We can now define the following union which includes all rational points in the plane:
$$mathcal{Q} = bigcup_{n=1}^infty Q_n,$$
which is a countable union of countable sets. By Theorem 2, $$mathcal{Q}$$ is a countable set.

Posted on

## algorithms – Need help understanding Knuth’s proof that: The set of all pure words is well-ordered by the relation >

In the paper linked below by Knuth and Bendix, theorem 1:

The set of all pure words is well-ordered by the relation ‘$$>$$

has a proof that I can’t seem to follow despite staring at it all day. I can’t even decipher what the notation is trying to represent.

So, we have four fixed sequences:

• An infinite sequence of variables $$v_1, v_2, v_3, …$$ etc. (not relevant for Theorem 1)
• A finite sequence of operators $$f_1, f_2, f_3, …, f_n$$
• A finite sequence of degrees $$d_1, d_2, d_3, .., d_n$$
• (i.e. degree of $$f_4 = d_4$$)
• and a finite sequence of weights $$w_1, w_2, w_3, …, w_n$$
• (i.e. weight of $$f_4 = w_4$$)

A word is then defined inductively as either a variable alone or an operator followed by an appropriate number of other words depending on the degree of said operator.

A ‘pure word’ is a word with no variables and the weight of a pure word, $$alpha$$ is defined as follows:

• $$w(alpha) = sum_j w_jn(f_j , alpha)$$ where $$n(f_j, alpha)$$ is the number of occurrences of $$f_j$$ in the word $$alpha$$

Finally the relation $$>$$ that orders all pure words that is proved to be well-ordered is defined as:

$$alpha > beta$$ if and only if:

1. $$w(alpha) > w(beta)$$
• (I’m assuming the ‘$$>$$‘ here is strict integer inequality and not the same ‘$$>$$‘ that is being defined.)
1. $$w(alpha) = w(beta)$$ and $$alpha = f_jalpha_1 … alpha_{dj}$$, $$beta = f_kbeta_1 … beta_{dk}$$, and either:
• 2a) $$j > k$$; or
• 2b) $$j = k$$ and $$alpha_1 = beta_1,…, alpha_{t-1} = beta_{t-1}, alpha_t > beta_t$$, for some $$t, 1 leq t leq d_j$$

Finally on page 266, for the proof that $$>$$ is well-ordered the exposition states:

Now let $$alpha$$ be a pure word with $$n_j$$ symbols of degree $$d_j$$. It is easy to prove inductively that:

$$n_0 + n_1 + n_2 + … = 1 + 0.n_0 + 1.n_1 + 2.n_2 + …,$$

i.e. $$n_0 = 1 + n_2 + 2n_3 + …$$

I don’t know whether it really is ‘easy’ to prove the above because I don’t really know what the above is.

I’m fairly sure symbols are just operators in this context of pure words but if $$n_0, n_1,$$ etc. are symbols then how are they being summed? Does $$n_0$$ in the above actually represent $$w(n_0)$$. That doesn’t seem to provide any clarity as to what is going on with the proof.

I’ve reread the first four pages of the paper multiple times and nothing seems to be getting any clearer:

https://www.cs.tufts.edu/~nr/cs257/archive/don-knuth/knuth-bendix.pdf

Any insight would be appreciated.

Posted on

## How to set variable in power automate (escalation, timeout scenario)

How can I set variable where are two approvals in flow?
First approval has timeout parametr and after timeout second approval start. How to set variable with two approval comments like:

if(first approval result null then set variable comments aprroval second) or if(first approval result is not null set variable comments first approval)

I try use union(body response first approval, body response second approval) in foreach but without success.

Something like this:

union(null,body response second approval) or union(body response first approval,null)

Posted on

## c# – Erro “NullReferenceException: Object reference not set to an instance of an object” no Unity

Opa, estou tentando desenvolver o meu primeiro jogo com Unity, um Space Invaders, e até que consegui fazer bastante coisa, mas ao chegar na parte do código de criar o movimento do inimigo, estou recebendo esse erro:

NullReferenceException: Object reference not set to an instance of an object
EnemyController.Start () (at Assets/Scripts/EnemyController.cs:32)

Procurei bastante, mas não achei nenhuma resposta que pudesse ajudar no meu caso, então preciso de uma luz.

O problema fica na linha 32, essa aqui:
“InvokeRepeating(“MoveEnemy”, 0.1f, 0.3f);”

Código abaixo:

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

public class EnemyController : MonoBehaviour
{
private Transform enemyHolder;
public float speed;

public GameObject shot;
public Text winText;
public float fireRate = 0.997f;

void Start()
{
winText.enabled = false;
InvokeRepeating("MoveEnemy", 0.1f, 0.3f);
enemyHolder = GetComponent<Transform> ();
}

void MoveEnemy()
{
enemyHolder.position += Vector3.right * speed;

foreach(Transform enemy in enemyHolder)
{
if(enemy.position.x < -10.5 || enemy.position.x > 10.5)
{
speed = -speed;
enemyHolder.position += Vector3.down * 0.5f;
return;
}

if(Random.value > fireRate)
{
Instantiate(shot, enemy.position, enemy.rotation);
}

if(enemy.position.y <= -4)
{
GameOver.isPlayerDead = true;
Time.timeScale = 0;
}

}

if(enemyHolder.childCount == 1)
{
CancelInvoke();
InvokeRepeating("MoveEnemy", 0.1f, 0.25f);
}

if (enemyHolder.childCount == 0)
{
winText.enabled = true;
}
}
}
``````

Posted on

## Cannot create a Db Set for ‘Application Role’ because this type is not included in the model for the context. What is the problems, please helps me

When I sign-in to page. prompt error message "Cannot create a dB Set for ‘Application Role’ because this type is not included in the model for the context.". What is the problems, please helps.

Posted on

## How to use arrayformula to find and get data from only a certain, dynamic set of columns in another Sheet?

I saw a proposed solution here, but it didn’t work for me.
How to use arrayformula to find and get data from only a certain, dynamic set of columns?

Using formula:

``````=SUM(INDIRECT(ADDRESS(4, MATCH("BB", 3:3, 0), 4)&":"&
SUBSTITUTE(ADDRESS(4, MATCH("BB", 3:3, 0), 4), "4", "")))
``````

I am trying to do something similar but it’s not working (“Formula parse error”)

Differences from the original (above):

• I’m trying to do an average, not a sum.
• The data to compare and average are both on another Sheet.

I want to be able to average a column of data below a header from another Sheet,

if the header on that Sheet (‘Vends’!) matches the cell to the left on the current Sheet (‘AGG-Vends’!).

Eg. If the header on row 2 of Sheet Vends! matches A2 on Sheet ‘AGG-Vends’!,

I want to average all the values below that header (row 3 and so on,

with an indeterminate number of values to be added).

My headers on Vends! Sheet are on row 2, so I modified the row number from which to start searching, to row 3.

``````=AVERAGE(INDIRECT(
ADDRESS(3, MATCH(A2, Vends!A2:2, 0), 4, TRUE, Vends!)&":"&
SUBSTITUTE(
ADDRESS(3, MATCH(A2, Vends!A2:2, 0), 4, TRUE, Vends!),
"3", "")))
``````

My formula is in B2 on “AGG-Vends’! Sheet (highlighted Blue).
sample Sheet

(Vends may be added or moved around, etc., so I was attempting to circumvent any Sheet-wide catastrophes of having to remodd formulas to fix)

Posted on

## Composer require drupal/social_auth_google – Your requirements could not be resolved to an installable set of packages

Previously I got an error with the command

``````composer require "drupal/social_auth_google:^2.0"
``````

So I tried;

``````composer require "drupal/social_api:2.x-dev" "drupal/social_auth:2.x-dev" "drupal/social_auth_google:2.x-dev"
``````

But now composer throws up faults no matter what I do. I tried removing all the “social” entries from `composer.json` but here are the errors I get instead;

`````` Your requirements could not be resolved to an installable set of packages.

Problem 1
- Root composer.json requires drupal/title_field_for_manage_display ^1.0, found drupal/title_field_for_manage_display(1.0.0, ..., 1.12.0) but the package is fixed to 2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
Problem 2
- Root composer.json requires drupal/social_auth_google ^2.1 -> satisfiable by drupal/social_auth_google(2.1.0).
- drupal/social_auth_google 2.1.0 requires drupal/social_auth ^2.0 -> drupal/social_auth is fixed to 2.x-dev (lock file version) by a partial update but that version is rejected by your minimum-stability. Make sure you list it as an argument for the update command.

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.
``````

So now composer doesn’t work at all. How can I fix composer?

Posted on

## How to set "My Music" and "My Video" location in VLC 3

When I open VLC, in Playlist View and click "My Music" or "My Video" it shows me my \$HOME directory. I want it to display \$HOME/Music and \$HOME/Video respectively. How can I do that ?

Posted on

## Set MySql read-only from K8s cluster

I have a Kubernetes cluster running with MySql app (5.7.32 MySql version). I’m trying to make MySql app be in a consistency mode, using this command:

“FLUSH TABLES WITH READ LOCK; SET_GLOBAL read_only = ON;”

When I run this command from inside the app – it works (getting error when trying to write when the DB is locked):

kubectl exec -ti mysql-0 -c mysql — mysql

mysql> FLUSH TABLES WITH READ LOCK; SET_GLOBAL read_only = ON; INSERT INTO mydb.mytable VALUES(‘hello’);

But When I run this command using kubectl exec command – it doesn’t work (this command doesn’t fail, and it is able to write to the DB):

kubectl exec -ti mysql-0 -c mysql — mysql -h mysql -e “FLUSH TABLES WITH READ LOCK; SET_GLOBAL read_only = ON; INSERT INTO mydb.mytable VALUES(‘hello’); “

I also try using a grant privileged user, it didn’t help:

kubectl exec -ti mysql-0 -c mysql — mysql -h mysql -e “CREATE USER \$USER@’\$HOST’ IDENTIFIED BY ‘\$PASS’; GRANT ALL PRIVILEGES ON * . * TO \$USER@’\$HOST’;”

kubectl exec -ti mysql-0 -c mysql — mysql -h mysql -u \$USER -p\$PASS -e “FLUSH TABLES WITH READ LOCK; SET_GLOBAL read_only = ON; INSERT INTO mydb.mytable VALUES(‘hello’); “

How Can I bring my MySql app to be in a read-only state without running the command from inside the application?

Thanks!

## unity – How can I set perspective camera in portrait to fit screen sizes

I want to fit a perspective camera in different mobile portrait resolutions to see always the same objects in screen.

Doing a research about my problem I have found this post Scale camera to fit screen size unity that have a similar problem than mine, but he ask for an ortographic camera also horizontal.

My problem is the same but in perspective and vertical, I have tryed to adapt the solution code to my project but I don’t know why isn’t working, can someone explain to me the code or helpme to understand the maths behind them so I can figure how to do it?

My code for vertical

``````public float VerticalFoV = 60.0f;

// ...

void Update() {
float halfHeight = Mathf.Tan(0.5f * VerticalFoV * Mathf.Deg2Rad);

float halfWidth = halfHeight * Screen.width/ Screen.height;

float horizontalFoV = 2.0f * Mathf.Atan(halfWidth) * Mathf.Rad2Deg;

Camera.main.fieldOfView = horizontalFoV;
}
``````

Sample code for horizontal

``````public float horizontalFoV = 90.0f;

// ...

void Update() {
float halfWidth = Mathf.Tan(0.5f * horizontalFoV * Mathf.Deg2Rad);

float halfHeight = halfWidth * Screen.height / Screen.width;

float verticalFoV = 2.0f * Mathf.Atan(halfHeight) * Mathf.Rad2Deg;

camera.fieldOfView = verticalFoV;
}
``````

Posted on