text:
# Q. 1.     Answer the following:             (a) Take Sarita’s present age to be $y$ years             (i)  What will be her age $5$ years from now?             (ii)  What was her age $3$ years back?             (iii)  Sarita’s grandfather is $6$ times her age. What is the age of her grandfather?             (iv)  Grandmother is $2$ years younger than grandfather. What is grandmother's age?             (v)  Sarita’s father’s age is $5$ years more than $3$ times Sarita’s age. What is her father's age?

S seema garhwal

According to the given condition,

(a) (i) $y+5$

(ii) $y-3$

(iii) 6y

(iv) $6y-2$

(v) $3y+5$

Exams
Articles
Questions

format: plain


text:
# Mechanisms of epileptic fast ripples

Fast ripples are high-frequency oscillations (HFOs) >250 Hz recorded in epileptogenic hippocampal regions. In 2007, we proposed a mechanism by which fast ripples emerge from the pathological desynchronization of neuronal firing (Foffani et al. Neuron 2007). Later in 2010, we developed the out-of-phase firing hypothesis which is now accepted as a major mechanism of pathological HFOs (Ibarz et al. JNeurosc 2010). More recently, using unsupervised learning we disclosed synaptic mechanisms underlying firing selectivity collapse during fast ripples (Valero et al. Neuron 2017).


text:
# nLab orthogonal ring spectrum

Contents

### Context

#### Higher algebra

higher algebra

universal algebra

## Theorems

#### Stable Homotopy theory

stable homotopy theory

Introduction

# Contents

## Idea

An orthogonal ring spectrum is a ring spectrum modeled as an orthogonal spectrum. Equivalently this is a monoid object with respect to the symmetric monoidal smash product of spectra, for orthogonal spectra. Morever, if we regard orthogonal spectra as $\mathbb{S}_{orth}$-modules, as discussed at model structure on orthogonal spectra, then this, in turn, is equivalent to a $\mathbb{S}_{orth}$-algebra, where $\mathbb{S}_{orth}$ is the standard model of the sphere spectrum as an orthogonal spectrum.

There is a model structure for orthogonal ring spectra (MMSS 00) under which orthogonal ring spectra represent genuine A-infinity rings, and commutative orthogonal ring spectra represent genuine E-infinity rings. This fact is one of the key motivation for passing from sequential spectra to the richer model of orthogonal spectra.

Despite all this, the component expression of the structure in an orthgonal ring spectrum, in the fashion of functors with smash product, is rather straightforward, and directly analogous to the structure in a dg-algebra: essentially there is for all pairs of indices $n_1, n_2$ a pairing between the component spaces of the spectrum in these degrees

$E_{n_1}\wedge E_{n_2}\longrightarrow E_{n_1 + n_2}$

such that this respects the given action of the orthogonal groups and of suspensions, and such that it is is associative and unital in the evident way.

## Definition

The definition is directly analogous to that of symmetric ring spectrum, just with the symmetric groups replaced by orthogonal groups throughout.

## References

Created on June 30, 2016 at 04:15:59. See the history of this page for a list of all contributions to it.


text:
# Prove $\sum_{n=1}^\infty\frac{\cot(\pi n\sqrt{61})}{n^3}=-\frac{16793\pi^3}{45660\sqrt{61}}$

$$\sum_{n=1}^\infty\frac{\cot(\pi n\sqrt{61})}{n^3}=-\frac{16793\pi^3}{45660\sqrt{61}}.$$

• Prove it converges and,

• evaluate the series.

For the first part of the question, I prove it converges by considering the irrationality measure,

$$|\sin (n\pi\sqrt{61})|=|\sin (n\pi\sqrt{61}-m\pi)|\ge \frac{2}{\pi}|n\pi\sqrt{61}-m\pi|\ge 2n\left|\sqrt{61}-\frac{m}{n}\right|>\frac{C}{n},$$

so $$\left|\frac{\cot(\pi n\sqrt{61})}{n^3}\right|\le\left|\frac{1}{n^3\sin(\pi n\sqrt{61})}\right|<\frac{C}{n^2}.$$

How to evaluate the series?

I have found a related question.

I apologize for incorrect information in the previous post.

• Maybe residue theorem? – Szeto Nov 30 '18 at 7:31
• It is hard to use residue theorem directly since cotangent is a meromorphic function. – Kemono Chen Nov 30 '18 at 7:41
• If it is $\sqrt{63}$ instead of $\sqrt{61}$, the problem would be much easier. – Szeto Nov 30 '18 at 9:13
• You might want to polish your proof of convergence, which contains some minor gaps. – pisco Nov 30 '18 at 9:59

In general $$F(\alpha) = \sum_{n=1}^\infty \frac{\cot(n\pi \alpha)}{n^3}$$ converges and can be explicitly calculated when $$\alpha$$ is a quadratic irrational. The convergence in this case is easily seen as $$\alpha$$ has irrationality measure $$2$$. More precisely, $$F(\alpha)/\pi^3 \in \mathbb{Q}(\alpha)$$ when $$\alpha$$ is quadratic irrational.

The procedure below also works when $$n^3$$ is replaced by any $$n^{2k+1}$$.

Let $$g(z) = \frac{\cot(z\pi \alpha)\cot(z\pi)}{z^3}$$ then $$g$$ has simple poles at non-zero integer multiples of $$1$$ and $$1/\alpha$$, and $$5$$-th order pole at $$0$$. Let $$R_N$$ denote a large rectangle with corners at $$N(\pm 1 \pm i)$$. Then contour integration gives $$\tag{1}\sum_{\substack{n\in R_N \\ n\neq 0}} \frac{\cot(n\pi\alpha)}{\pi n^3} + \sum_{\substack{n/\alpha\in R_N \\ n\neq 0}} \frac{\alpha^2\cot(n\pi/\alpha)}{\pi n^3}-\frac{\pi ^2 \left(\alpha^4-5 \alpha^2+1\right)}{45 \alpha} = \frac{1}{2\pi i} \int_{R_N} g(z)dz$$ I claim there exists a sequence of integers $$N_1, N_2, \cdots$$ such that RHS tends to $$0$$. Note that $$\cot(z\pi)$$ is uniformly bounded on the annulus $$R_{N+3/4} - R_{N+1/4}$$ when $$N$$ is an integer. Hence by equidistribution of $$n\alpha$$ modulo $$1$$, we can find integers $$N_i$$ such that both $$\cot(z\pi\alpha)$$ and $$\cot(z\pi)$$ are uniformly bounded on $$R_{N_i+3/4} - R_{N_i+1/4}$$.

Since we already know the series converges, from $$(1)$$: $$\tag{2}F(\alpha) + \alpha^2F(\frac{1}{\alpha}) = \underbrace{\frac{\pi ^3 \left(\alpha^4-5 \alpha^2+1\right)}{90 \alpha}}_{\rho(\alpha)}$$ Note that obviously $$F(\alpha+1)=F(\alpha)$$.

Let the continued fraction expansion of $$\alpha$$ be given by $$\alpha = [a_0;a_1,a_2,\cdots]$$ Successive complete quotients are denoted by: $$\zeta_0 = [a_0;a_1,a_2,\cdots]\qquad \zeta_1 = [a_1;a_2,a_3,\cdots]\qquad \zeta_2 = [a_2;a_3,a_4,\cdots]$$ Then $$(2)$$ and periodicity implies for $$k\geq 0$$: $$\tag{3} F(\zeta_{k+1}) + \zeta_{k+1}^2 F(\zeta_k) = \rho(\zeta_{k+1})$$ If continued fraction of $$\alpha$$ is of form $$\alpha = [a_0;a_1,\cdots,a_m,\overline{b_1,\cdots,b_r}]$$ Then $$\zeta_{m+r+1} = \zeta_{m+1}$$, so we eventually entered a cycle. $$(3)$$ gives a system of $$m+r+1$$ linear equations (by setting $$k=0,\cdots,m+r$$), with $$m+r+1$$ variables: $$F(\zeta_0), F(\zeta_1),\cdots,F(\zeta_{m+r})$$. $$\begin{cases} F(\zeta_1) + \zeta_1^2 F(\zeta_0) &= \rho(\zeta_1) \\ F(\zeta_2) + \zeta_2^2 F(\zeta_1) &= \rho(\zeta_2) \\ \cdots \\ F(\zeta_{m+1}) + \zeta_{m+1}^2 F(\zeta_{m+r}) &= \rho(\zeta_{m+1}) \end{cases}$$ Solving it gives the value of $$F(\zeta_0)=F(\alpha)$$.

For $$\alpha = \sqrt{61} = [7;\overline{1,4,3,1,2,2,1,3,4,1,14}]$$, we have \begin{aligned} \zeta_0 = \sqrt{61} \qquad \zeta_1 &= \frac{1}{12}(7+\sqrt{61}) \\ \zeta_2 = \frac{1}{3}(5+\sqrt{61}) \qquad \zeta_3 &= \frac{1}{4}(7+\sqrt{61})\\ \zeta_4 = \frac{1}{9}(5+\sqrt{61}) \qquad \zeta_5 &= \frac{1}{5}(4+\sqrt{61})\\ \zeta_6 = \frac{1}{5}(6+\sqrt{61}) \qquad \zeta_7 &= \frac{1}{9}(4+\sqrt{61})\\ \zeta_8 = \frac{1}{4}(5+\sqrt{61}) \qquad \zeta_9 &= \frac{1}{3}(7+\sqrt{61}) \\ \zeta_{10} = \frac{1}{12}(5+\sqrt{61}) \qquad \zeta_{11} &= \frac{1}{12}(7+\sqrt{61}) \end{aligned} solving the above system gives the result.

A few examples: for $$\alpha = (1+\sqrt{5})/2$$, the continued fraction has period $$1$$, direct substitution into $$(2)$$ gives $$\sum_{n=1}^\infty \frac{\cot(n\pi \frac{1+\sqrt{5}}{2})}{n^3} = -\frac{\pi ^3}{45 \sqrt{5}}$$ Complexity of result increases as period of $$\alpha$$ increases. For $$\alpha = \sqrt{211}$$, which has period $$26$$: $$\sum_{n=1}^\infty \frac{\cot(n\pi \sqrt{211})}{n^3} = \frac{128833758679 \pi ^3}{383254107060 \sqrt{211}}$$ For $$\alpha = \sqrt{1051}$$, with period $$50$$: $$\sum_{n=1}^\infty \frac{\cot(n\pi \sqrt{1051})}{n^3} = \frac{47332791433774124737806821 \pi ^3}{589394448213331173141730140 \sqrt{1051}}$$ For $$\alpha = \sqrt{3361}$$, with period $$95$$: $$\sum_{n=1}^\infty \frac{\cot(n\pi \sqrt{3361})}{n^3} = -\frac{21398204683553311136959481444654882139602077 \pi ^3}{862144802276358317644836682685386007371980 \sqrt{3361}}$$ When $$\alpha$$ is not a "pure" quadratic irrational, for example, $$\alpha = 1/4 + \sqrt{7}/{3}$$, the result involves "constant term" (because of non-trivial automorphism of $$\mathbb{Q}(\alpha)$$): $$\sum_{n=1}^\infty \frac{\cot(n\pi(\frac{1}{4}+\frac{\sqrt{7}}{3}))}{n^3} = \frac{13 \pi ^3}{288}+\frac{104771 \pi ^3}{1244160 \sqrt{7}}$$ The closed-form here follows immediately by noting $$\csc x = \cot (x/2) - \cot x$$.

I wrote a Mathematica code to evaluate this sum. The command cotsum[Sqrt[61]] evaluates the sum in the question. You can try other quadratic irrationals as well. The case when denominator is $$n^5$$ or $$n^{2k+1}$$ can be similarly handled by modifying $$f$$.

This algorithm is not very efficient, it works by creating plenty of variables (one for each term of continued fraction until repetition occurs), then solve the resulting equation. For $$\alpha$$ with period around $$100$$, it typically takes around 3-6 minutes. It would be much more efficient to back-substitute, but I don't have much motivation now in optimizing it.

cotsum[x_] /; QuadraticIrrationalQ[x] :=
Module[{a1 = x, list, l, r, i, nlist, f, solution, output, equation,
string}, list = ContinuedFraction[a1];
l = Length[list] - 1;
r = Length[list[[l + 1]]];
i = 1; string = "{";
While[i < l + r + 1, string = string <> "x" <> ToString[i] <> ",";
i++]; string = StringTake[string, StringLength[string] - 1] <> "}";
Do[Evaluate[ToExpression["a" <> ToString[i + 1]]] =
FromContinuedFraction[Drop[list, i]], {i, 1, l - 1}];
nlist = list[[l + 1]];
Do[Evaluate[ToExpression["a" <> ToString[i + l + 1]]] =
FromContinuedFraction[{Flatten[
Append[Drop[nlist, i], Take[nlist, i]]]}], {i, 0, r - 1}];
f[a_] := (1 - 5 a^2 + a^4)/90/a;
equation =
Table[ToExpression[
"x" <> ToString[i + 1] <> "+a" <> ToString[i + 1] <> "^2*x" <>
ToString[i] <> "==f[a" <> ToString[i + 1] <> "]"], {i, 1,
r + l - 1}];
equation =
Append[equation,
ToExpression[
"x" <> ToString[l + 1] <> "+a" <> ToString[l + 1] <> "^2*x" <>
ToString[r + l] <> "==f[a" <> ToString[l + 1] <> "]"]];
solution = Solve[equation, ToExpression[string]]; Clear["a*"];
output = (ToExpression[string][[1]] /. Flatten[solution])*Pi^3;
FullSimplify[output]]

• This is amazing. – Szeto Nov 30 '18 at 10:44
• (+1) Very good explanation. – user90369 Nov 30 '18 at 10:49
• Truly perfect and awesome.. Thank you very much! – Tianlalu Nov 30 '18 at 11:28
• It seems your notation with the $\zeta_j$ gives exactly the middle column in Prof. Lubin's classroom method for solving Pell's equation. I posted that as an answer, I have it written as a program that produces the Latex code in full, ready for pasting in an answer box on this site. I suspect Prof. Lubin's method is very similar to what Fermat, Wallis, and Brouncker would have used, being entirely made up of integer operations. – Will Jagy Nov 30 '18 at 18:40
• +1 and it appears Ramanujan also said the same thing. See math.stackexchange.com/q/907480/72031 – Paramanand Singh Dec 1 '18 at 18:10

Sigh. I believe that Pisco's sequence from $$\zeta_1$$ to $$\zeta_{11}$$ matches the middle column (all plus signs) in Prof. Lubin's no-calculator method for solving Pell, and is likely what Fermat, Wallis, Brouncker used all those years ago. Yes! If I continued one more step, I would get $$\zeta_{11},$$ which equals $$\zeta_1$$

Method described by Prof. Lubin at Continued fraction of $$\sqrt{67} - 4$$

$$\sqrt { 61} = 7 + \frac{ \sqrt {61} - 7 }{ 1 }$$ $$\frac{ 1 }{ \sqrt {61} - 7 } = \frac{ \sqrt {61} + 7 }{12 } = 1 + \frac{ \sqrt {61} - 5 }{12 }$$ $$\frac{ 12 }{ \sqrt {61} - 5 } = \frac{ \sqrt {61} + 5 }{3 } = 4 + \frac{ \sqrt {61} - 7 }{3 }$$ $$\frac{ 3 }{ \sqrt {61} - 7 } = \frac{ \sqrt {61} + 7 }{4 } = 3 + \frac{ \sqrt {61} - 5 }{4 }$$ $$\frac{ 4 }{ \sqrt {61} - 5 } = \frac{ \sqrt {61} + 5 }{9 } = 1 + \frac{ \sqrt {61} - 4 }{9 }$$ $$\frac{ 9 }{ \sqrt {61} - 4 } = \frac{ \sqrt {61} + 4 }{5 } = 2 + \frac{ \sqrt {61} - 6 }{5 }$$ $$\frac{ 5 }{ \sqrt {61} - 6 } = \frac{ \sqrt {61} + 6 }{5 } = 2 + \frac{ \sqrt {61} - 4 }{5 }$$ $$\frac{ 5 }{ \sqrt {61} - 4 } = \frac{ \sqrt {61} + 4 }{9 } = 1 + \frac{ \sqrt {61} - 5 }{9 }$$ $$\frac{ 9 }{ \sqrt {61} - 5 } = \frac{ \sqrt {61} + 5 }{4 } = 3 + \frac{ \sqrt {61} - 7 }{4 }$$ $$\frac{ 4 }{ \sqrt {61} - 7 } = \frac{ \sqrt {61} + 7 }{3 } = 4 + \frac{ \sqrt {61} - 5 }{3 }$$ $$\frac{ 3 }{ \sqrt {61} - 5 } = \frac{ \sqrt {61} + 5 }{12 } = 1 + \frac{ \sqrt {61} - 7 }{12 }$$ $$\frac{ 12 }{ \sqrt {61} - 7 } = \frac{ \sqrt {61} + 7 }{1 } = 14 + \frac{ \sqrt {61} - 7 }{1 }$$

Simple continued fraction tableau:
$$\begin{array}{cccccccccccccccccccccccccccccccccccccccccccccccc} & & 7 & & 1 & & 4 & & 3 & & 1 & & 2 & & 2 & & 1 & & 3 & & 4 & & 1 & & 14 & & 1 & & 4 & & 3 & & 1 & & 2 & & 2 & & 1 & & 3 & & 4 & & 1 & & 14 & \\ \\ \frac{ 0 }{ 1 } & \frac{ 1 }{ 0 } & & \frac{ 7 }{ 1 } & & \frac{ 8 }{ 1 } & & \frac{ 39 }{ 5 } & & \frac{ 125 }{ 16 } & & \frac{ 164 }{ 21 } & & \frac{ 453 }{ 58 } & & \frac{ 1070 }{ 137 } & & \frac{ 1523 }{ 195 } & & \frac{ 5639 }{ 722 } & & \frac{ 24079 }{ 3083 } & & \frac{ 29718 }{ 3805 } & & \frac{ 440131 }{ 56353 } & & \frac{ 469849 }{ 60158 } & & \frac{ 2319527 }{ 296985 } & & \frac{ 7428430 }{ 951113 } & & \frac{ 9747957 }{ 1248098 } & & \frac{ 26924344 }{ 3447309 } & & \frac{ 63596645 }{ 8142716 } & & \frac{ 90520989 }{ 11590025 } & & \frac{ 335159612 }{ 42912791 } & & \frac{ 1431159437 }{ 183241189 } & & \frac{ 1766319049 }{ 226153980 } \\ \\ & 1 & & -12 & & 3 & & -4 & & 9 & & -5 & & 5 & & -9 & & 4 & & -3 & & 12 & & -1 & & 12 & & -3 & & 4 & & -9 & & 5 & & -5 & & 9 & & -4 & & 3 & & -12 & & 1 \end{array}$$

$$\begin{array}{cccc} \frac{ 1 }{ 0 } & 1^2 - 61 \cdot 0^2 = 1 & \mbox{digit} & 7 \\ \frac{ 7 }{ 1 } & 7^2 - 61 \cdot 1^2 = -12 & \mbox{digit} & 1 \\ \frac{ 8 }{ 1 } & 8^2 - 61 \cdot 1^2 = 3 & \mbox{digit} & 4 \\ \frac{ 39 }{ 5 } & 39^2 - 61 \cdot 5^2 = -4 & \mbox{digit} & 3 \\ \frac{ 125 }{ 16 } & 125^2 - 61 \cdot 16^2 = 9 & \mbox{digit} & 1 \\ \frac{ 164 }{ 21 } & 164^2 - 61 \cdot 21^2 = -5 & \mbox{digit} & 2 \\ \frac{ 453 }{ 58 } & 453^2 - 61 \cdot 58^2 = 5 & \mbox{digit} & 2 \\ \frac{ 1070 }{ 137 } & 1070^2 - 61 \cdot 137^2 = -9 & \mbox{digit} & 1 \\ \frac{ 1523 }{ 195 } & 1523^2 - 61 \cdot 195^2 = 4 & \mbox{digit} & 3 \\ \frac{ 5639 }{ 722 } & 5639^2 - 61 \cdot 722^2 = -3 & \mbox{digit} & 4 \\ \frac{ 24079 }{ 3083 } & 24079^2 - 61 \cdot 3083^2 = 12 & \mbox{digit} & 1 \\ \frac{ 29718 }{ 3805 } & 29718^2 - 61 \cdot 3805^2 = -1 & \mbox{digit} & 14 \\ \frac{ 440131 }{ 56353 } & 440131^2 - 61 \cdot 56353^2 = 12 & \mbox{digit} & 1 \\ \frac{ 469849 }{ 60158 } & 469849^2 - 61 \cdot 60158^2 = -3 & \mbox{digit} & 4 \\ \frac{ 2319527 }{ 296985 } & 2319527^2 - 61 \cdot 296985^2 = 4 & \mbox{digit} & 3 \\ \frac{ 7428430 }{ 951113 } & 7428430^2 - 61 \cdot 951113^2 = -9 & \mbox{digit} & 1 \\ \frac{ 9747957 }{ 1248098 } & 9747957^2 - 61 \cdot 1248098^2 = 5 & \mbox{digit} & 2 \\ \frac{ 26924344 }{ 3447309 } & 26924344^2 - 61 \cdot 3447309^2 = -5 & \mbox{digit} & 2 \\ \frac{ 63596645 }{ 8142716 } & 63596645^2 - 61 \cdot 8142716^2 = 9 & \mbox{digit} & 1 \\ \frac{ 90520989 }{ 11590025 } & 90520989^2 - 61 \cdot 11590025^2 = -4 & \mbox{digit} & 3 \\ \frac{ 335159612 }{ 42912791 } & 335159612^2 - 61 \cdot 42912791^2 = 3 & \mbox{digit} & 4 \\ \frac{ 1431159437 }{ 183241189 } & 1431159437^2 - 61 \cdot 183241189^2 = -12 & \mbox{digit} & 1 \\ \frac{ 1766319049 }{ 226153980 } & 1766319049^2 - 61 \cdot 226153980^2 = 1 & \mbox{digit} & 14 \\ \end{array}$$

• Why was this down voted?? – Mark Viola Nov 30 '18 at 18:50
• I did not downvote, but maybe the long table broke someone's browser :) – Tob Ernack Nov 30 '18 at 19:40
• (+1) to annihilate the down vote – Mark Viola Nov 30 '18 at 19:42


text:
oschina地址
github地址

# 尝试过程

That is because websockets never report their requestHeadersText.
Fixed for the new implementation.

# 解决

I believe it happens when the actual request is not sent. Usually happens when you are loading a cached resource.

Another possible scenario I’ve seen - the exact same request is being sent again just after few milliseconds (most likely due to a bug in the client side).
In that case you’ll also see that the status of the first request is “canceled” and that the latency is only several milliseconds.

# 结论

Provisional headers are shown


text:
# Dominant stochastic markets

% operators that are separated from the operand by a space

% operators that require brackets

% operators that require parentheses

% Paper specific

We generalize the formalism of dominant markets to account for stochastic “deductive processes,” and prove a theorem regarding the asymptotic behavior of such markets. In a following post, we will show how to use these tools to formalize the ideas outlined here.

Appendix A contains the key proofs. Appendix B contains the proofs of technical propositions used in Appendix A, which are mostly straightforward. Appendix C contains the statement of a version of the optional stopping theorem from Durret.

##Notation

Given a topological space:

• is the space of Borel probability measures on equipped with the weak* topology.

• is the Banach space of continuous functions with uniform norm.

• is the Borel -algebra on .

• is the -algebra of universally measurable sets on .

• Given , denotes the support of .

Given and measurable spaces, is a Markov kernel from to . For any , we have . Given , is the semidirect product of and and is the pushforward of by .

Given , Polish spaces, Borel measurable and , we denote the set of Markov kernels s.t. is supported on the graph of and . By the disintegration theorem, is always non-empty and any two kernels in coincide -almost everywhere.

##Results

The way we previously laid out the dominant market formalism, the sequence of observations (represented by the sets ) was fixed. To study forecasting, we instead need to assume this sequence is sampled from some probability measure (the true environment).

For each , let be a compact Polish space. represents the space of possible observations at time . Denote

Given , denotes the projection mapping and . Denote

is a compact Polish space. For each we denote the projection mapping. Given , we denote , a closed subspace of . Given and , we denote .

#Definition 1

A market is a sequence of mappings s.t.

• Each is measurable w.r.t. and .

• For any , .

As before, we define the space of trading strategies , but this time we regard it as a Banach space.

#Definition 2

A trader is a sequence of mappings which are measurable w.r.t. and .

Given a trader and a market , we define the mappings (measurable w.r.t. and ) and (measurable w.r.t. and ) as follows:

The “market maker” lemma now requires some additional work due to the measurability requirement:

#Lemma

Consider any trader . Then, there is a market s.t. for all and

As before, we have the operator defined by

We also introduce the notation and which are measurable mappings defined by

#Definition 3

A market is said to dominate a trader when for any , if

then

#Theorem 1

Given any countable set of traders , there is a market s.t. dominates all .

Theorem 1 is proved exactly as before (modulo Lemma), and we omit the details.

We now describe a class of traders associated with a fixed environment s.t. if a market dominates a trader from this class, a certain function of the pricing converges to 0 with -probability 1. In a future post, we will apply this result to a trader associated with an incomplete models by observing that the trader is in the class for any .

#Definition 4

A trading metastrategy is a uniformly bounded family of measurable mappings . Given , is said said to be profitable for , when there are and s.t. for any , -almost any and any :

Even if a metastrategy is profitable, it doesn’t mean that a smart trader should use this metastrategy all the time: in order to avoid running out of budget, a trader shouldn’t place too many bets simultaneously. The following construction defines a trader that employs a metastrategy only when all previous bets are closed to being resolved.

#Definition 5

Fix a metastrategy . We define the trader and the measurable mappings recursively as follows:

#Theorem 2

Consider , , a metastrategy profitable for and a market. Assume dominates . Then, for -almost any :

That is, the market price of the “stock portfolio” traded by converges to its true -expected value.

##Appendix A

#Proposition A.1

Fix a compact Polish space and . Then, there exists s.t.

#Proof of Proposition A.1

Follows immediately from “Proposition 1” from before and Proposition B.6.

#Proposition A.2

Fix compact Polish spaces. Denote . Then, there exists measurable w.r.t. and s.t. for any and :

#Proof of Proposition A.2

Define by

We can view as the graph of a multivalued mapping from to . We will now show this multivalued mapping has a selection, i.e. a single-valued measurable mapping whose graph is a subset. Obviously, the selection is the desired .

is closed by Proposition B.7. is closed by Proposition B.5. by Proposition B.6 and hence closed. In particular, the fiber of over any is also closed.

For any , , define by and by . Applying Proposition A.1 to we get s.t.

It follows that and hence is non-empty.

Consider any open. Then, is locally closed and in particular . Therefore, the image of under the projection to is also and in particular Borel.

Applying the Kuratowski-Ryll-Nardzewski measurable selection theorem, we get the desired result.

#Proof of Lemma

For any , let be as in Proposition A.2. We define recursively by:

#Proposition A.3

Consider a probability space, a filtration of , , and stochastic processes adapted to . Assume that:

Then, with probability 1.

The proof will use the following definition:

#Definition A

Consider a sequence . The accumulation times of are defined recursively by

Consider a probability space and a stochastic process. The accumulation times of are defined pointwise as above. Clearly, they are stochastic processes and whenever is adapted to a filtration , they are stopping times w.r.t. .

#Proof of Proposition A.3

Without loss of generality, we can assume (otherwise we can renormalize , and by a factor of ). Define by

By Proposition B.8, is a submartingale. Let be the accumulation times of . By proposition N23, are submartingales for all . By Proposition\ N24, each of them is uniformly integrable. Using the fact that to apply Theorem C, we get

Clearly, is adapted to . Doob’s second martingale convergence theorem implies that ( is the limit of the uniformly integrable submartingale ). We conclude that is a submartingale.

By Proposition B.12, . Applying the Azuma-Hoeffding inequality, we conclude that for any positive integer :

Since , it follows that

By Proposition B.13

It remains to show that if is s.t. then the condition above fails. Consider any such . , therefore . On the other hand, by Proposition B.14, .

#Proposition A.4

Consider a probability space, a filtration of , , and stochastic processes adapted to and an arbitrary stochastic process. Assume that:

Then, (equivalently ) with probability 1.

#Proof of Proposition A.4

Define . We have

By Proposition A.3, with probability 1. Since , we get the desired result.

#Proposition A.5

Consider , and as before. Consider , , a metastrategy profitable for and a market. Then, for -almost any :

#Proof of Proposition A.5

We regard as a probability space using the -algebra and the probability measure . For any , we define and by

Clearly, is a filtration of , are stochastic processes and are adapted to . is uniformly bounded, therefore is uniformly bounded and so is . Obviously, is also non-negative.

By Proposition B.15, are uniformly bounded. is bounded and in particular . We have

Let and be as in Definition 4.

By definition of , is equal to either or 0. In either case, we get (almost everywhere)

Applying Proposition A.4, we get the desired result.

#Proposition A.6

Consider the setting of Proposition A.3. Then, for almost all :

#Proof of Proposition A.6

Define by

Let be the accumulation times of . Consider any s.t. but . Proposition B.13 implies that

As in the proof of Proposition A.3, we can apply the Azuma-Hoeffding inequality to and get that for any positive integer

It follows that

Comparing with the inequality from before, we reach the desired conclusion.

#Proposition A.7

Consider the setting of Proposition A.4. Then, for almost all :

#Proof of Proposition A.7

Define . As in the proof of Proposition A.4, meets the conditions of Proposition A.3 and thus of Proposition A.6 also. By Proposition A.6, for almost all :

As in the proof of Proposition A.4, is uniformly bounded, giving the desired result.

#Proof of Theorem 2

Let , , and be as in the proof of Proposition A.5. Using Proposition A.5 and the assumption that dominates , we conclude that for -almost any , . As in the proof of Proposition A.5, the conditions of Proposition A.4 are satisfied, and therefore the conditions of Proposition A.7 are also satisfied. Applying Proposition A.7, we conclude that . By Proposition B.17, it follows that for any , . We get

##Appendix B

#Proposition B.1

If are compact Polish spaces and is continuous, then defined by is continuous.

We omit the proof of Proposition B.1, since it appeared as “Proposition A.2” before.

#Proposition B.2

Fix compact Polish spaces. Define by . Then, is continuous. In particular, we can apply this to in which case .

#Proof of Proposition B.2

Consider and . We have

By Proposition B.1

Combining, we get

#Proposition B.3

Fix compact Polish spaces and denote . Define by

Then, is continuous.

#Proof of Proposition B.3

Consider , . By Proposition B.1, implies that

Since , we get

#Proposition B.4

Fix compact Polish spaces. Denote . Define by

Then, is closed.

#Proof of Proposition B.4

Consider , , , . By Proposition B.3, we get

Hence, .

#Proposition B.5

Fix compact Polish spaces. Denote . Define by

Then, is closed.

#Proof of Proposition B.5

By Proposition B.2, is the continuous inverse image of a subset of which is closed by Proposition B.4.

#Proposition B.6

Fix a compact Polish space. Consider and and denote . Then, iff .

#Proof of Proposition B.6

If then and therefore .

Now, assume . For any , Markov’s inequality yields

Taking , we get and hence .

#Proposition B.7

Consider compact Polish spaces. Denote . Define by

Then, is closed.

#Proof of Proposition B.7

We fix metrizations for and and metrize by

For each , denote .

Consider , , . We have . By Proposition B.1, , therefore . By Proposition B.6, and hence .

#Proposition B.8

Consider a probability space, a filtration of , and stochastic processes adapted to . Assume that there are s.t.:

Define by

Then, is a submartingale.

#Proof of Proposition B.8

Obviously, is adapted to . We have

#Proposition B.9

Let be a probability space, a filtration on


text:
# How to prove “if every subset of a set is a CFL, then the set must be regular.”

"If every subset of a set is a CFL, then the set must be regular."

I want to prove it, could anyone please give me some hints?

• Hint: show that every infinite set has a non-CFL subset. Another hint: use the pumping lemma. – Shaull Jan 7 '16 at 18:32
• There is no need to use the pumping lemma. You can use the fact that there are only countably many context-free languages. – Yuval Filmus Jan 7 '16 at 18:51
• Cardinality really helps here. – chi Jan 7 '16 at 18:52
• Once you figure out the answer, feel free to answer your own question. – Yuval Filmus Jan 7 '16 at 22:56
• N.B. If we want to enforce using the pumping lemma, we can ask what happens if (say) all computable subsets of a set are context-free. – Yuval Filmus Jan 7 '16 at 22:57

Suppose that $$L$$ is a language such that each subset of $$L$$ is context-free. I claim that $$L$$ must be finite, and so regular. Indeed, otherwise $$L$$ would have uncountably many subsets, and so not all of them could be context-free (since there are only countably many context-free languages).

Lemma 1: any language over a finite alphabet has either a finite or countably infinite number of elements. Option one, your language is finite. Option two, your language is infinite, but you can still sort all the strings in "lexicographic order" (i.e. alphabetical order). This means they can be enumerated, so there are only countably many.

Lemma 2: a countably infinite set has uncountably many subsets. This is called Cantor's Theorem, and for the sake of time I'm not going to prove it here, but the proof is very elegant and can be found online.

Lemma 3: the set of context-free languages is countable. You can write down the grammar of any context-free language as a string of finite length (a CFG), and these strings can be sorted lexicographically.

Lemma 4: if a language is infinite, it must have a non-context-free subset. If a language is infinite, it has countably many elements, which means uncountably many subsets. This means there are more distinct subsets than context-free languages. So some of these subsets must be non-context-free.

Lemma 5: if a language is finite, it is regular. You can make a regular expression for it by just union-ing together a whole lot of singleton strings.

Theorem: if a language has no context-free subset, it must be regular. The contrapositive of Lemma 4 means this language must be finite, and so Lemma 5 means it's regular.


text:
• Create Account

## Structure of classes in good Game Engine?

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

46 replies to this topic

Posted 18 June 2012 - 01:46 PM

Hello everyone

Well I'm making a game with a friend, and we're having small problem with organizing our classes.
What we're doing is having main engine class, which creates all classes we use in it, then we pass the
classes into constructor that we want to use.. eg:
[source lang="cpp"]gameWorld = new ChunkManager(LogSys, gfxSystem);gameCamera = new Camera(ScreenWidth, ScreenHeight, 0.0f, 0.0f, 0.0f, SDL_Key, events,joystick1, LogSys);Time = new GlobalTime(LogSys);Menu = new SDL_Menu(this,gameCamera,events,Time,LogSys);[/source]
The thing is, we pretty much pass in LogSys class to EVERYTHING!
Is there any easier way to distribute it to pretty much everything?
I was thinking of inheriting it to everything, but i heard inheritance is bad in some cases to game engines..?

Well thanks for help in advance, cant wait to see the answers!

### #2MajorTom  Members

Posted 18 June 2012 - 02:17 PM

POPULAR

If it's used everywhere, make it global. Some people fight to the death to ensure there are no globals in the code... but sometimes, globals are necessary, and it keeps the code interface nice and tidy. (Don't use globals everywhere though, since they can be a pain to track when debugging)

Using inheritance isn't "bad" all of the time, only when it's abused, like any other tool.
At the moment, try focusing on implementing the game, and think less about the engine. You'll learn a lot about what you really need the engine to do from making a game.

Hope this helps

Saving the world, one semi-colon at a time.

Posted 18 June 2012 - 02:27 PM

I'm one of those people who fight to death not to have any globals in code is there any other way?

### #4Juliano Schroeder  Members

Posted 18 June 2012 - 02:35 PM

Inheritance is not bad. It can be bad if you do it wrong or too much. Inheritance is very good when you want substitutable behavior. Take a look at the C++ Faq on inheritance:

http://www.parashift.com/c++-faq-lite/proper-inheritance.html

On your LogSys case, I would go for a global as MajorTom suggested. Take a look at your sentence "

Is there any easier way to distribute it to pretty much everything?" well, globals are for eveything everywhere.

http://www.creationguts.com - The Guts of Creation
drawing, programming and game design.

### #5ApochPiQ  Moderators

Posted 18 June 2012 - 02:51 PM

POPULAR

Keep in mind that your logging system probably doesn't need to be a class at all. Consider using a simple free function instead, possibly in a namespace.
Wielder of the Sacred Wands

### #6DvDmanDT  GDNet+

Posted 18 June 2012 - 03:14 PM

Debug utilities (ie logging) is one of the very few things which I consider suitable for global access (ie global variable, global function, singleton, ..). If you have other stuff you need everywhere, that might indicate a code design/architecture problem.

### #7frob  Moderators

Posted 18 June 2012 - 03:22 PM

Personally I wouldn't bother with either.

There are already a bajillion existing logger systems out there, most are far more comprehensive than an individual would ever use. The better systems integrate with your debugger, allow multiple simultaneous output methods including logging across networks, provide graphical visualizations when comparing bulk logs, and do much more than simply output individual text blobs.

Why re-invent the wheel?

Check out my book, Game Development with Unity, aimed at beginners who want to build fun games fast.

Also check out my personal website at bryanwagstaff.com, where I occasionally write about assorted stuff.

### #8alnite  Members

Posted 18 June 2012 - 03:28 PM

Keep in mind that your logging system probably doesn't need to be a class at all. Consider using a simple free function instead, possibly in a namespace.

This.

If you still decide it needs to be a class, ask yourself: does it need to be instantiated? What benefit do I get for having two or more instances of logger class? If there's none, then you don't need a class.

### #9bglanzer  Members

Posted 18 June 2012 - 03:43 PM

You can do something like this

class Log {
public:
static Log* Get() {
if( !m_pInstance )
m_pInstance = this;
return m_pInstance;
}
protected:
Log* m_pInstance;
};

Then use the log like this within your classes
Log* pLog = Log::Get();
pLog->Write( "Me and the Cap't make it happen!" );

Brendon Glanzer

### #10ApochPiQ  Moderators

Posted 18 June 2012 - 04:36 PM

You can do something like this

class Log {
public:
static Log* Get() {
if( !m_pInstance )
m_pInstance = this;
return m_pInstance;
}
protected:
Log* m_pInstance;
};

Then use the log like this within your classes
Log* pLog = Log::Get();
pLog->Write( "Me and the Cap't make it happen!" );

This is the "singleton pattern" or as I like to refer to it "the greatest sin perpetuated by programmers with good intentions."

The singleton thing has been debated to death, so if you're interested, I invite you to go search around for any of the dozens of threads on the subject. For now, though, I will leave it at this: please, don't use that code. Ever.
Wielder of the Sacred Wands

### #11bglanzer  Members

Posted 18 June 2012 - 05:22 PM

I often times see Sington's used within references. For loggers particularly. I think its used that way in the Hieroglyph Engine from the book Practical Rendering & Computation. They have thier place but like ApochPiQ said they really shouldn't be used. They have the same issues as global variables so you have to take the same precautions.

The other way I've seen loggers done is passing a pointer to your logger on creation just like you are currently doing. I think that Method is used in 3d Game Engine Architecture. This is probably the method I would recommend.

Brendon Glanzer

### #12ApochPiQ  Moderators

Posted 18 June 2012 - 06:32 PM

That still raises the obvious question: why is your logger an object/class to begin with?
Wielder of the Sacred Wands

### #13metsfan  Members

Posted 18 June 2012 - 07:02 PM

On that note, your logger (if you choose to keep it as a class) could be a class member of your global Application class, so that you don't feel all dirty making it a global, and it still can remain at your disposal anywhere in the code.

I will say this though as parting words: if you find yourself passing an instance of a class to every single constructor or function call, the class is already tightly coupled with your code. There's no point in trying to fight it. It is meant to be a global.

As a note to future posters, like I said, I'm not pro on the subject of game dev, I'm just learning it myself, so I welcome criticism of my response from that perspective.

### #14bglanzer  Members

Posted 18 June 2012 - 07:04 PM

Wouldn't a free function require opening and closing of the log file? Would that cause any type of slowdown compared to a class which opens the file on creation and closes before destruction?

It would make it alot easier to not have to pass the Log to each class that requires it.

Brendon Glanzer

### #15metsfan  Members

Posted 18 June 2012 - 07:09 PM

You can do something like this

class Log {
public:
static Log* Get() {
if( !m_pInstance )
m_pInstance = this;
return m_pInstance;
}
protected:
Log* m_pInstance;
};

Then use the log like this within your classes
Log* pLog = Log::Get();
pLog->Write( "Me and the Cap't make it happen!" );

This is the "singleton pattern" or as I like to refer to it "the greatest sin perpetuated by programmers with good intentions."

The singleton thing has been debated to death, so if you're interested, I invite you to go search around for any of the dozens of threads on the subject. For now, though, I will leave it at this: please, don't use that code. Ever.

Singletons used incorrectly are a bad idea, but Singletons do have their place. There are times when having two instances of a class is an error and may/will cause your program to malfunction. I am well aware of the downsides (increased strong coupling, problems with unit testing, debugging headaches), but there are times when having just one instance of a class is needed. I will say though, that a logger class is not one of those cases, having two logger classes shouldn't break your application. There are situations though where a singleton pattern makes sense, and not only can be used, but should.

However, it goes without saying that code is crap =) I don't think the poster was intending to provide copy/paste code (at least I hope not!)

Edited by metsfan, 18 June 2012 - 07:10 PM.

### #16Hodgman  Moderators

Posted 18 June 2012 - 08:25 PM

That still raises the obvious question: why is your logger an object/class to begin with?

Because it has state. An overly generic logger will likely have at least a file-pointer as state, perhaps also a "warning level" to ignore, a verbose flag, etc... You might even have one part of your app plugged into a network logger and another part plugged into a local file logger.

Though I know this isn't what you're getting at You're getting at the point that a game's logger doesn't need to have state.

In my new engine core (here and here), I follow ApochPiQ's advice and only provide logging via a global/free function. Despite that, I can still filter out different engine sub-systems, and later I can still add features like network/disk logging, browser-display/formatting, etc...
eiInfoGroup( FooBar, true );//declare and enable log filter "FooBar"
eiInfo(FooBar, "couldn't frobnicate %d", foo );//Print to log, or don't depending on filters.

Singletons used incorrectly are a bad idea, but Singletons do have their place. There are times when having two instances of a class is an error and may/will cause your program to malfunction.

Can you name one? I've been trying for a while to find a justification, but my current engine still has zero. I know that in theory, singletons or monostates are the solution to the problem of "2 instances are always an error", but I'm not sure that this problem actually exists in the real world...

Wouldn't a free function require opening and closing of the log file? Would that cause any type of slowdown compared to a class which opens the file on creation and closes before destruction?

Not saying you should, but free-functions can still have hidden state. e.g. in the CPP that implements the function, you can have a file-static variable that holds the file pointer. From the outside, it acts like a free function, but internally, it's basically a singleton with it's instantiation policy hidden.
N.B. I've seen some loggers continuously open/close the file on purpose, because it ensures that if your program crashes, the log is always written out correctly (normally, the latest log data would be in a buffer, and maybe not yet on disk).

However, for the last few years, no game engine that I've worked on has logged straight to disk like this. The last ~3 engines I've used, all have a "companion" developer application that you run alongside the game -- this usually just sits down in your system tray, and communicates with the game over a socket. When the game needs to perform any dev duties, like logging, the game sends the data over the socket to this companion app. The game doesn't need to know how to rebuild assets or write logs, it just needs to know how to ask the companion/dev app how to do these things.

The thing is, we pretty much pass in LogSys class to EVERYTHING!

As above, I think logging should be implemented a a simple global function -- but if this was anything other that logging, then you're doing it correctly.
For emphasis, 99.9% of the time, I don't allow people to use new/malloc in my engine -- they've got to be passed an allocator object if they want to allocate memory. Imagine all the classes which I've got to pass around allocators between! Yet, I still believe this approach is more correct, as it makes your code slightly more functional and have no hidden dependencies/side-effects.

Edited by Hodgman, 18 June 2012 - 08:45 PM.

### #17krippy2k8  Members

Posted 18 June 2012 - 09:12 PM

However, for the last few years, no game engine that I've worked on has logged straight to disk like this. The last ~3 engines I've used, all have a "companion" developer application that you run alongside the game -- this usually just sits down in your system tray, and communicates with the game over a socket. When the game needs to perform any dev duties, like logging, the game sends the data over the socket to this companion app. The game doesn't need to know how to rebuild assets or write logs, it just needs to know how to ask the companion/dev app how to do these things.

So those game engines are incapable of enabling any logging in production code? They likely still need state in any case, unless they're opening and closing a socket or pipe with every log request.

I would really just stick to using a global for the logger. Overuse of globals is a bad thing, but bending over backwards for ideological purity and compromising the complexity of your code for the sake of not using any globals is much worse in my opinion. The goal of development is to produce a product, not a human rights treaty.

As long as you follow a good practice of explicitly initializing and cleaning up the state of your globals in discrete locations (i.e. in your main()) instead of relying on constructors and destructors that may be called before or after it is safe to do so, there is no problem with using globals, or singletons either, really.

You can use a free function that will access the global logger object to do the actual logging if you want, to avoid littering your code with calls to global variables. Personally I like to use macros to call my logging and debugging constructs. That way I can implicitly pass things like __FILE__ and __LINE__ to the logger, and I can easily replace whatever logging/debugging implementation I want to use later if necessary.

### #18krippy2k8  Members

Posted 18 June 2012 - 09:32 PM

Can you name one? I've been trying for a while to find a justification, but my current engine still has zero. I know that in theory, singletons or monostates are the solution to the problem of "2 instances are always an error", but I'm not sure that this problem actually exists in the real world...

In the case of PC game engines I doubt there are very many cases where a "2 instances are always an error" situation will exist, but there are many cases in the real world. Particularly when you have classes that instance third-party libraries and/or drivers that can't handle multiple interfaces in the same process. i.e. a while back I was working on an application that interfaces to control modules on vehicles, and I had to use a vendor-supplied DLL to communicate with the control modules through another piece of vendor-supplied hardware. Any attempt to instantiate more than one interface to the vendor-supplied hardware from the same process could cause problems, up to and including damaging the control module and rendering the vehicle useless until the control module was replaced or repaired. While 2 instances of a class that can interface to the vendor's DLL isn't necessarily an error, it is a huge financial risk, which is even better ;)

### #19metsfan  Members

Posted 18 June 2012 - 09:33 PM

Can you name one? I've been trying for a while to find a justification, but my current engine still has zero. I know that in theory, singletons or monostates are the solution to the problem of "2 instances are always an error", but I'm not sure that this problem actually exists in the real world...

The best example I can think of is the one I mentioned, which is having a singleton to represent the application itself. An example would be the UIApplication class in iOS. UIApplication is implemented as a singleton because the class represents the application itself. Since there is only one application, using a singleton class to represent our application makes sense. I'm not saying this is the only way to represent an application, but it is a very intuitive and well established way of doing so.

### #20Hodgman  Moderators

Posted 18 June 2012 - 10:47 PM

So those game engines are incapable of enabling any logging in production code? They likely still need state in any case, unless they're opening and closing a socket or pipe with every log request.

They have to use a different logger implementation for retail builds. It could just swallow/ignore log entries (and probably would ignore/disable a lot of logging channels), or pipe them to the game's console (maybe colouring channels), or a text file inside %appdata%, etc... You don't need to inherit an interface or anything to do this, a simple ifdef to select different implementations is often good enough.

The best example I can think of is the one I mentioned, which is having a singleton to represent the application itself. Since there is only one application, using a singleton class to represent our application makes sense

It makes it convenient, but doesn't necessarily make sense. What is the one application that's running? Isn't this just a grouping of global variables into another (global) structure called 'application'? You could just make a few more globals instead and get rid of the grouping, or not even make them global ;) What if I want to launch a new process in the background, or send a message to another app -- in those cases there is more than one application in the problem domain..?

An example would be the UIApplication class in iOS. UIApplication is implemented as a singleton because the class represents the application itself. I'm not saying this is the only way to represent an application, but it is a very intuitive and well established way of doing so.

I'm not familiar with iOS, but from scanning the UIApplication docs with, it seems to be written in the kind of OOP style where you dump a whole bunch of useful functions into a class and then inherit from it. This style also often uses singletons to make it easy to get at those functions. That's fine, each style to it's own, but this is still an arbitrary choice by the API designer to use a singleton as a restriction on the end-user developers usage. You could replace the UIApplication singleton by, inside main, making local variables for a window, an event queue, a URL fetcher, etc... and then having the choice weather to make them global variables (e.g. via a singleton) or not, ourselves (i.e. the end-user of the API).

Edited by Hodgman, 18 June 2012 - 10:52 PM.

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


text:
# Count solutions to $xy=(x+y)R!$

Question: Is there anyway to find how many integer solutions there are to the formula $$1=\frac{x\cdot y}{(x+y)\cdot (R!)}$$ for any given $R$. Is there anyway to compute it and if so, compute it quickly.

-
Do you mean $((x+y)\cdot R)!$ or $(x+y)\cdot (R!)$ ? –  Zev Chonoles Dec 24 '11 at 12:12
A good hint is at MO: mathoverflow.net/questions/84210/count-solutions-closed –  David Mitra Dec 24 '11 at 12:16

Yes, by @David Mitra's hint (mathoverflow.net/questions/84210/count-solutions-closed), the equation reduces to $(x-n)(y-n)=n^2$ for $n=R!$. Now if $n=\prod_1^r{p_k^{e_k}}$ is the unique factorization into the $r$ distinct primes $p_k \leq R$ (e.g. where $e_k=\sum_{i=0}^{\infty}[np_k^{-i}]$), then the number of (positive) divisors of $n^2=\prod{p_k^{2e_k}}$ is $\tau(n^2)=\prod{(1+2e_k)}$ since each positive divisor is of the form $u=\prod{p_k^{f_k}}$ where $0\leq f_k \leq 2e_k$ (so that the exponents $f_k$ are $r$-tuples of integer lattice points inside a $r$-dimensional rectangular solid), and for each such $u$ dividing $n^2$, we can take $v=n^2/u$ and write two unique integer solutions: $(x,y)=(n+u,n+v)$ and $(x,y)=(n-u,n-v)$. Thus, the total number of solutions is $$2\;\tau(R!^2) = 2\;\tau(n^2) = 2\;\prod_{k=1}^{r}(1+2e_k)$$

-


text:
# Math Help - True/False questions on a TEST

1. ## True/False questions on a TEST

How many ways can someone answer a test with 10 questions, where the first 2 are false, OR the last 3 questions are true.

2. Hello tyrone92
Originally Posted by tyrone92
How many ways can someone answer a test with 10 questions, where the first 2 are false, OR the last 3 questions are true.
I don't understand the question.

I take it there are $10$ questions that have either true or false answers. Since each question can be answered in either of $2$ ways, the number of different ways of answering all $10$ is $2^{10}=1024$.

What do you mean 'the first $2$ are false'? Do we know those answers to be false and have to find combinations of true/false answers to the other $8$? (In which case there are $2^8=256$ possibilities.)

Can you clarify the question please?


text:
# Kerodon

$\Newextarrow{\xRightarrow}{5,5}{0x21D2}$ $\newcommand\empty{}$

Remark 2.4.1.12. Let $\operatorname{\mathcal{C}}_{\bullet }$ be a (small) simplicial category. Then the construction $[n] \mapsto \operatorname{\mathcal{C}}_{n}$ determines a functor from the simplex category $\operatorname{{\bf \Delta }}^{\operatorname{op}}$ (Definition 1.1.1.2) to the category $\operatorname{Cat}$ of (small) categories. Allowing $\operatorname{\mathcal{C}}_{\bullet }$ to vary, we obtain a functor $\operatorname{Cat_{\Delta }}\rightarrow \operatorname{Fun}( \operatorname{{\bf \Delta }}^{\operatorname{op}}, \operatorname{Cat})$, which fits into a pullback diagram of categories

$\xymatrix@C =80pt@R=50pt{ \operatorname{Cat_{\Delta }}\ar [r]^-{ \operatorname{\mathcal{C}}_{\bullet } \mapsto ([n] \mapsto \operatorname{\mathcal{C}}_ n)} \ar [d]^{\operatorname{Ob}} & \operatorname{Fun}( \operatorname{{\bf \Delta }}^{\operatorname{op}}, \operatorname{Cat}) \ar [d]^{ \operatorname{Ob}} \\ \operatorname{Set}\ar [r] & \operatorname{Fun}( \operatorname{{\bf \Delta }}^{\operatorname{op}}, \operatorname{Set}), }$

where the lower horizontal map carries each set $S$ to the constant functor $\operatorname{{\bf \Delta }}^{\operatorname{op}} \rightarrow \operatorname{Set}$ taking the value $S$.

Phrased more informally: simplicial categories can be identified with simplicial objects $\operatorname{\mathcal{C}}_{\bullet }$ of $\operatorname{Cat}$ for which the underlying simplicial set of objects $[n] \mapsto \operatorname{Ob}( \operatorname{\mathcal{C}}_{n} )$ is constant. In particular, the functor $\operatorname{Cat_{\Delta }}\rightarrow \operatorname{Fun}( \operatorname{{\bf \Delta }}^{\operatorname{op}}, \operatorname{Cat})$ is a fully faithful embedding.


text:
# Two thermally insulated vessels 1 and 2 are filled with air at temperatures $(T_1, \; T_2)$, volume $(V_1, \; V_2)$ and pressure $(P_1, \; P_2)$ respectively. If the value joining two vessels is opened, the temperature inside the vessel at equilibrium will be
( A ) $(T_1 + T_2)/2$
( B ) $\frac{T_1T_2 (P_1V_1 + P_2V_2)}{P_1V_1T_1 + P_2V_2T_2}$
( C ) $\frac{T_1T_2 (P_1V_1 + P_2V_2)}{P_1V_1T_2 + P_2V_2T_1}$
( D ) $T_1 + T_2$


text:
Are there any sets of axioms that have an efficient algorithm for all provable statements?

I'm looking for a set of axioms that are reasonably expressive (non-trivial) such that any statement that can be proved as true from the set of axioms can be done so efficiently. By this I mean that an algorithm is known that takes polynomial time to find a proof for any true statement, polynomial in terms of the size of the statement (and thus there is also a guarantee that all proofs have a polynomial sized encoding in terms of the size of the statement).

For example, Presburger arithmetic is decidable in time $$2^{2^{cn}}$$ for some $$c>0$$. I'm looking for something that is decidable in time $$poly(n)$$. There are some trivial options that work (such as everything is true, or a contradiction proves everything), but I'm looking for something non-trivial.

• Someone asked about clarifying "trivial", but then deleted their comment. A rule that throws out most trivial cases is "there are an infinite number of true and false statements, and for all integers $c$ there is a true statement with a proof of size greater than $c$". There may be some edge cases that are still pretty boring that satisfy this condition, but it seems like a good start. – Phylliida Jul 15 '20 at 17:18
• (To clarify for other readers, that person was me. I removed my comment once I noticed the argument in my answer, which in my opinion provided a sufficiently strong negative result to constitute an answer.) – Noah Schweber Jul 15 '20 at 17:31
• BTW I did not downvote or vote to close. – Noah Schweber Jul 15 '20 at 18:15

While the term "nontrivial" is still a bit unclear, there's a good sense in which a positive answer to your question is extremely unlikely:

Suppose $$T$$ does not prove "There is exactly one element in the universe." Then we can in polynomial time reduce the set of unsatisfiable propositional sentences to the set of $$T$$-theorems. In particular, if $$\mathsf{P\not=NP}$$ this gives a strong negative answer to your question.

To do this, we argue as follows. Given a $$\mathsf{SAT}$$ instance $$\theta$$ with propositional atoms $$a_1,...,a_n$$, consider the first-order sentence $$\theta':\equiv\exists x_1,y_1,...,x_n,y_n[\varphi(x_1,y_1,...,x_n,y_n)]$$ where $$\varphi$$ is the first-order formula gotten from $$\theta$$ by replacing each $$a_i$$ with the formula $$x_i=y_i$$. Assuming $$T$$ is consistent with the existence of two distinct elements, we have that $$\theta$$ is satisfiable in the propositional sense iff $$T\cup\{\theta'\}$$ is consistent. And the construction $$\theta\mapsto\theta'$$ is sufficiently simple for this reduction to be efficient.

So basically, unless $$T$$ is extremely silly we can always embed $$\mathsf{coSAT}$$ into the $$T$$-$$\mathsf{THEOREM}$$.

EDIT: And in fact the situation is much worse - as Tom Baker observed, we can in fact get all of $$\mathsf{PSPACE}$$ (the point being that as soon as $$T$$ has a model with more than one element, we can efficiently reduce the theory of the two-element pure set to the set of $$T$$-theorems).

• Nice, this does seem to rule out most things, or at least, makes the boundary very clear. The main exception is if encoding SAT clauses in this way takes exponential space. An analogy would be encoding subset sum in unary (tally marks) to make it solvable in poly time in terms of the size of the input. – Phylliida Jul 15 '20 at 17:31
• @Phylliida True, but the encoding here is linear. The length of $\theta'$ is roughly four times that of $\theta$ at worst (basically, the matrix $\varphi$ has length about twice that of $\theta$, and the block of quantifiers at the front is at worst roughly twice as long as $\theta$). – Noah Schweber Jul 15 '20 at 17:33
• @Phylliida I've now asked a followup question. – Noah Schweber Aug 20 '20 at 17:34
• @Phylliida There's less to that than meets the eye. A "pure set" is just a structure with, well, no structure - pedantically, it's a structure in the empty language. Two pure sets are isomorphic iff they have the same cardinality (there's no additional structure to preserve), so in the same way that we can abuse terminology and say "the two-element cyclic group" we can say "the two-element pure set" - that phrase specifies the structure in question up to isomorphism. Meanwhile, the first-order theory of a structure is the set of all first-order sentences true in that structure. (continued) – Noah Schweber Aug 25 '20 at 15:08
• So, for example, allowing for the usual abbreviations the sentences "$\exists x,y(x\not=y)$" and "$\forall x\exists y\forall z(x=z\vee y=z)$" are in the first-order theory of the two-element pure set. Meanwhile, "$\exists x,y,z(x\not=y\wedge y\not=z\wedge x\not=z)$" and "$\forall x,y(x*y=y*x)$" are not: the former is false in the two-element pure set (it says "there are three distinct elements"), and the latter isn't even grammatically correct in this context since it uses the symbol "$*$" which isn't in the language of pure sets (which, again, has only the logical apparatus). – Noah Schweber Aug 25 '20 at 15:11


text:
library.tex 4.8 KB
 MARCHE Claude committed Oct 28, 2010 1 2 3 \chapter{Standard Library} \label{chap:library}  MARCHE Claude committed Dec 15, 2010 4 5 We provide here a short description of logic symbols defined in the standard library. Only the most general-purpose ones are  MARCHE Claude committed Dec 15, 2010 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 described. For more details, one should directly read the corresponding file, or alternatively, use the \verb|why3| with option \verb|-T| and a qualified theory name, \eg \begin{verbatim} > why3 -T bool.Ite theory Ite (* use BuiltIn *) (* use Bool *) logic ite (b:bool) (x:'a) (y:'a) : 'a = match b with | True -> x | False -> y end end \end{verbatim} In the following, for each library, we describe the (main) symbols of each theories defined  MARCHE Claude committed Dec 15, 2010 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49  \section{Library bool} \begin{description} \item[Bool] boolean data type \verb|bool| with constructors \verb|True| and \verb|False| ; operations \verb|andb|, \verb|orb|, \verb|xorb|, \verb|notb| \item[Ite] polymorphic if-then-else operator written as \verb|ite| \end{description} \section{Library int} \begin{description} \item[Int] basic operations \verb|+|, \verb|-| and \verb|*| ; comparison operators \verb|<|, \verb|>|, \verb|>=| and \verb|<=|. \item[Abs] absolute value written as \verb|abs| \item[EuclideanDivision] division and modulo, where division rounds down, written as \verb|div| and \verb|mod| \item[ComputerDivision] division and modulo, where division rounds to  MARCHE Claude committed Dec 15, 2010 50  zero, also written as \verb|div| and \verb|mod|  MARCHE Claude committed Dec 15, 2010 51 52 53 54 55 56 57  \item[MinMax] \verb|min| and \verb|max| operators \end{description} \section{Library real}  MARCHE Claude committed Dec 13, 2010 58 \begin{description}  MARCHE Claude committed Oct 28, 2010 59   MARCHE Claude committed Dec 15, 2010 60 61 \item[Real] basic operations \verb|+|, \verb|-|, \verb|*| and \verb|/| ; comparison operators  MARCHE Claude committed Oct 28, 2010 62   MARCHE Claude committed Dec 15, 2010 63 64 65 \item[RealInfix] basic operations with alternative syntax \verb|+.|, \verb|-.|, \verb|*.|, \verb|/.|, \verb|<.|, \verb|>.|, \verb|<=.| and \verb|>=.|, to allow a simultaneous use of integer and real operators.  MARCHE Claude committed Oct 28, 2010 66   MARCHE Claude committed Dec 15, 2010 67 \item[Abs] absolute value written as \verb|abs|  MARCHE Claude committed Oct 28, 2010 68   MARCHE Claude committed Dec 15, 2010 69 \item[MinMax] \verb|min| and \verb|max| operators  MARCHE Claude committed Oct 28, 2010 70   MARCHE Claude committed Dec 15, 2010 71 \item[FromInt] operator \verb|from_int| to convert an integer to a real.  MARCHE Claude committed Dec 13, 2010 72   MARCHE Claude committed Dec 15, 2010 73 74 75 \item[Truncate] conversion operators from real to integers: \verb|truncate| rounds to 0, \verb|floor| rounds down and \verb|ceil| rounds up  MARCHE Claude committed Dec 13, 2010 76   MARCHE Claude committed Dec 15, 2010 77 \item[Square] operators \verb|sqr| and \verb|sqrt| for square and square root  MARCHE Claude committed Dec 13, 2010 78   MARCHE Claude committed Dec 15, 2010 79 \item[ExpLog] functions \verb|exp|, \verb|log|, \verb|log2|, and \verb|log10|  MARCHE Claude committed Oct 28, 2010 80   MARCHE Claude committed Dec 15, 2010 81 \item[Power] function \verb|pow| with two real parameters.  MARCHE Claude committed Oct 28, 2010 82   MARCHE Claude committed Dec 15, 2010 83 84 \item[Trigonometry] functions \verb|cos|, \verb|sin|, \verb|tan|, and \verb|atan|. Constant \verb|pi|.  MARCHE Claude committed Dec 13, 2010 85   MARCHE Claude committed Dec 15, 2010 86 87 \item[Hyperbolic] functions \verb|cosh|, \verb|sinh|, \verb|tanh|, \verb|acosh|, \verb|asinh|, \verb|atanh|.  MARCHE Claude committed Dec 13, 2010 88   MARCHE Claude committed Dec 15, 2010 89 \item[Polar] functions \verb|hypot| and \verb|atan2|.  MARCHE Claude committed Dec 13, 2010 90   MARCHE Claude committed Dec 15, 2010 91 92 \end{description}  MARCHE Claude committed Dec 17, 2010 93 \section{Library \texttt{floating\_point}}  MARCHE Claude committed Dec 15, 2010 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110  This library provides a theory of IEEE-754 floating-point numbers. It is inspired from~\cite{ayad10ijcar}. \begin{description} \item[Rounding] type \verb|mode| with 5 constants \verb|NearestTiesToEven|, \verb|ToZero|, \verb|Up|, \verb|Down| and \verb|NearTiesToAway|. \item[SpecialValues] handling of infinities and NaN \item[GenFloat] generic floats parameterized by the maximal representable number. Functions \verb|round|, \verb|value|, \verb|exact|, \verb|model|, predicate \verb|no_overflow|. \item[Single] instance of GenFloat for 32-bits single precision numbers \item[Double] instance of GenFloat for 64-bits double precision numbers \end{description}  MARCHE Claude committed Dec 17, 2010 111 \section{Library \texttt{array}}  MARCHE Claude committed Dec 15, 2010 112 113  \begin{description}  MARCHE Claude committed Dec 13, 2010 114   MARCHE Claude committed Dec 15, 2010 115 116 117 118 119 \item[Array] polymorphic arrays, a.k.a maps. Type \verb|t| parameterized by both the type of indices and the type of data. Functions \verb|get| and \verb|set| to access and update arrays. Function \verb|create_const| to produce an array initialized by a given constant.  MARCHE Claude committed Dec 13, 2010 120   MARCHE Claude committed Dec 15, 2010 121 122 \item[ArrayLength] arrays indexed by integers and holding their length. Function \verb|length|.  MARCHE Claude committed Dec 13, 2010 123   MARCHE Claude committed Dec 15, 2010 124 125 126 \item[ArrayRich] additional functions on arrays indexed by integers. Functions \verb|sub| and \verb|app| to extract a sub-array and append arrays.  MARCHE Claude committed Dec 13, 2010 127 128 129  \end{description}  MARCHE Claude committed Dec 15, 2010 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 \section{Library option} \begin{description} \item[Option] data type \verb|option 'a| with constructors \verb|None| and \verb|Some|. \end{description} \section{Library list} \begin{description} \item[List] data type \verb|list 'a| with constructors \verb|Nil| and \verb|Cons|. \item[Length] function \verb|length| \item[Mem] function \verb|mem| for testing for list membership. \item[Nth] function \verb|nth| for extract the $n$-th element. \item[HdTl] functions \verb|hd| and \verb|tl|. \item[Append] function \verb|append|, concatenation of lists. \item[Reverse] function \verb|reverse| for list reversal. \item[Sorted] predicate \verb|sorted| for lists of integers. \item[NumOcc] number of occurrences in a list \item[Permut] list permutations \item[Induction] structural induction on lists \item[Map] list map operator \end{description}  MARCHE Claude committed Dec 13, 2010 157 158   MARCHE Claude committed Oct 28, 2010 159 160 161 162 163 164  %%% Local Variables: %%% mode: latex %%% TeX-PDF-mode: t %%% TeX-master: "manual" %%% End:


text:
Content-Type: text/shitpost

Subject: Narf
Path: you!your-host!ultron!gormenghast!hal9000!plovergw!shitpost!mjd
Date: 2018-11-12T18:22:51
Newsgroup: misc.narf
Message-ID: <61a5fe2ac2e50bf8@shitpost.plover.com>
Content-Type: text/shitpost
    data Narf a = Narf (Narf a) deriving (Eq, Show)

One kinda funny thing about this type is that it does actually contain a (countably) infinite family of values. But there's no way to tell any of them from any of the others.

    narfn 0 = undefined
narfn n = Narf \$ narfn (n - 1)

The deriving Eq is a strikingly empty promise.


text:
cancel
Showing results for
Did you mean:
See all
See all
##### Groups
Explore all groups

# Can I tell Bamboo to accept a different return code from a command as a pass?

I am trying to run a zip command to package up some artifacts as part of a stage and the tool run from CMD returns 1. Bamboo marks the job as failed because it says it was expecting 0 but valid return codes from the zip tool are 1 for success and negative for failures.

#### 1 accepted

0 vote

I'm not sure you can configure Bamboo that way, but what you COULD do is wrap the invocation of that tool in a script (shell, batch file, etc. depending on your OS) and have the script exit with 0 if the tool exits with 1 (and simply exit with the same exit code as the tool otherwise). Have your build execute that script rather than the tool directly. It's a little bit of work (and I DO think Bamboo should let you define what "Success" and "Failure" exit codes are - I have a couple of problem tools that I've had to do this for myself), but it will get around this problem.

That seems to work, calling 'dir' or 'echo' after the command I want feels a bit silly, but the build passes now.

'exit /b 0' should work too

something like (warning: untested from the top of my head)

REM Do ZIP command
IF %ERRORLEVEL% EQU 1 (EXIT /B 0)
ELSE (EXIT /B %ERRORLEVEL%)
http://ss64.com/nt/exit.html

Patrick's example above shows the link where you can see a more elaborate example of converting multiple return codes but above it looks like part of the code and so I missed it the first time through. http://ss64.com/nt/exit.html. Also see http://ss64.com/nt/robocopy-exit.html has the myriad of exit codes for Robocopy sorted out into success and failure return codes.

0 vote

I agree with Patrick Aikens' answer and just wanted to add another example that I've used extensively. See the robocopy return code problem here: http://ss64.com/nt/robocopy-exit.html There is an elaborate example of exit codes (codes 0-7 are good copies but different variations, Codes 8-16 include failures). And how to convert them to 0 for a valid (successful) return code 0.

0 vote

For some reason it wasn't good enough to just "exit /b/ 0". It would still flag the step failed. So I had to actually set the %errorlevel% = 0.

"C:\Program Files\PSTools\psexec.exe" \\servername -s -i -d -accepteula C:\path\to\app.exe
if %errorlevel% GTR 2000 (
ECHO Process started successfully on PID: %errorlevel%
SET %errorlevel% = 0
)
exit /b %errorlevel%
0 vote

Just started using Bamboo and this is already causing me headaches, so I've raise the following JIRA issue : -

https://jira.atlassian.com/browse/BAM-16356

### How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Community showcase
Published May 18, 2017 in Bamboo

### FAQ: How to Upgrade Bamboo Server

Bamboo 5.9 will no longer be supported after June 12, 2017. What does this mean? As part of our End of Life policy, Atlassian supports major versions for two years after the first major iteratio...

1,822 views 0 6

### Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Connect with like-minded Atlassian users at free events near you!

##### Find my local user group

Unfortunately there are no AUG chapters near you at the moment.


text:
0%

Vim without plugins/Widgets
Four modes of vim namely General mode,normal mode, Command line mode,Visual mode.

## Four modes of vim

1. General mode: normal mode. You can move the cursor, delete characters or entire lines, and copy and paste file data. Opening vim is to enter this mode, and the switching between the three modes is also transferred here.

2. Edit mode: In general mode, press any one of iIo O a A r R s S to enter this mode. You can edit the content of the file and press Esc to return to the normal mode.

-i I is insert (in front of the character under the cursor and at the beginning of the line)
-o O is open new line (start a new line below the line where the cursor is and start a new line above the line where the cursor is
-a A is append (after the character under the cursor and at the end of the line where the cursor is)
-s S is to delete (the character where the cursor is and start inserting and the line where the cursor is and start inserting), that is, substitute replacement.
-r R is to replace the character under the cursor and become the replacement mode

3. Command line mode: Press : / in normal mode? Any one enters this mode (the meaning of these symbols will be described below). You can find data operations, read, save, replace a lot of characters, leave vim, display line number and other operations, press Esc to return to the general mode.

4. Visual mode: In general mode, press v V ctr + v to enter the visual mode, which is equivalent to the normal mode after highlighting the selected text, that is, in this mode, you can arbitrarily select a specific area and be The selected area is highlighted, v selects the unit: one character; V is also called the visible line mode, select the unit: line; ctr + v is also called the visible block mode, select the unit: square ; All three are useful, see below for details.

## Mobile

In normal mode:

w → to the beginning of the next worde → to the end of the next word (words are separated by spaces by default)
W → to the beginning of the next stringE → to the end of the next string (a string refers to a string consisting of numbers, letters, and underscores)
B → Go to the first character of the previous string. The b → “command moves the cursor to the first character of the previous word.

By default, a word is composed of letters, numbers and underscores
If you think words are separated by blank characters, then you need to use uppercase E and W (Chen Hao: Note)

0 → number zero, to the beginning of the line
^ → Go to the first position of the line that is not a blank character (the so-called blank character is a space, tab, line feed, carriage return, etc.)
$ → Go to the end of the line g_ → to the last position of the line that is not a blank character % → Go to the other of the pair of brackets where the cursor is gg → first line G → last line h j k l (strongly recommended to use it to move the cursor, but it is not necessary) → you can also use the cursor keys (← ↓ ↑ →). Note: j extends downwards, k extends upward 1. ** High frequency usage scenario 1 **: Change a variable name in the line first and move the cursor: w and b, W and B (or if the line is too long, use the following Search function) to the target word 2. ** High frequency usage scenario 2 **: Modify the indent and jump to the beginning of the line^ 3. ** High frequency usage scenario 3 **: View the completeness of the function or class or the variable scope % 4. ** High frequency usage scenario 4 **: After splitting the screen, jump to different windows: ctrl + w + (h or j or k or l) 5. ** High-frequency use scene 5 **: Move left (left, top, right) (h, j, k, l) 6. ** High frequency usage scenario 6 **: Delete to the end: d$ Delete to the beginning: d ^

### Tag

Note: ** mark is to find better **, in normal mode:

mx meaning: mark x, x is the name of mark;
'x meaning: go to the position of x mark

1. ** High-frequency usage scenario 1: ** You can see how to define other functions in the function. You want to see how to define them. After you read it, you need to come back. Then mark it first and then jump back.

In normal mode:

1. gd meaning: go to definition
2. Press [ and then ctrl + d to jump to #define
3. Press [ and then ctrl + i to jump to functions, variables and #define

** Note **: The language support is not very good, you can try the language used

### Quick page turning

In normal mode:

Partner 1 Partner 2
ctr + d page down  ctr + d page up
ctr + f page forward  ctr + b page back

## Action operation instruction

In normal mode:

Partner 1 Partner 2
d ** d ** elete a character and copy to clipboard  D has been ** deleted ** from the cursor position to the end of the line
y ** c ** opy to clipboard  Y ** Copy ** one line (= yy)
s ** s ** ubstitue a character  S ** Replace ** the line where the cursor is located
r ** r ** eplace a character R* Not commonly used *, which means to enter replacement mode
c ** c ** hange a character  C * Not commonly used *, which means ** modify ** the cursor position until the end of the line, the same effect as S rendering
p ** p ** aste after the cursor  P ** Paste ** before the cursor position (if you paste a whole line, paste to the previous line)
u ** u ** ndo a operation  U one-time ** undo ** all operations on a whole line
x cut a character  X * not commonly used *, ** cut ** to the left, ie backspace: delete the character to the left of the cursor
** ** Search the word under the current cursor ** downward, and jump to the next word when found #** Search the word under the current cursor ** upward, jump to the previous word when found
/ word ** Search the word word ** down to the full text, jump to the first word that matches, if there are multiple, continue to search down and press the n key (in the direction of the original command), up to press the N key. ? word ** Search the word word ** up the full text, jump to the first word that matches, and if there are multiple, continue to search upwards and press the n key (in the direction of the original command), down to press the N key.
a ** a ** ppend after the cursor  A is ** append ** at the end of the line where the cursor is located)
i ** i ** nsert before the cursor  I ** insert ** at the beginning of the line where the cursor is located
o Start a new line below the line under the cursor, open the new world? O starts a new line above the line where the cursor is located
v enters ** v ** isual mode, used to select areas (can cross lines), used to cooperate with other subsequent operations (addition, deletion, and modification)  v enters visual line mode, used to select some lines To cooperate with other follow-up operations (addition, deletion and modification)
f ** f ** ind a character after the cursor  F ** find a character before the cursor position **
t ** t ** ill a character tx is the same as fx, the difference is to jump to the front of character x  T Tx is the same as Fx, the difference is to jump to the character x

### Formed separately

. Repeat the operation just now
~ Convert case

1. You can change the case of the first letter of the variable
2. You can select a string (variable) in combination with the commands provided below, and then change the case of the entire string (variable). For example: macro definition

= Auto format

1. Use == for the current line (double press = twice), or use n == for multiple lines (n is a natural number) to automatically indent the next n lines from the current line
2. Or enter the visual line mode, select some lines and then = for formatting, which is equivalent to the code format in the general IDE.
3. Use gg = G to typeset the entire code.

### Undo and Redo

1. u undo undoes the operation in the previous step. Commands can be combined. For example, Nu N is any integer, which means undoing the N-step operation. The following is the same.
2. U restore the current line (that is, undo all operations on the current line at once)
3. ctr + r control + redo restore the previous operation that was cancelled
4. CTRL-R back to the previous command

### Text replacement

Enter the replacement command in normal mode: : [range] s / pattern / string / [flags]

-pattern is the string to be replaced, which can be expressed by regexp.
-string replaces pattern with string.
-[range] has the following values:

[range] Meaning
None The default is the line where the cursor is located
. Current line of cursor
N Line N
$ Last line 'a Mark the line where a (marked with ma before) . + 1 The line below the current cursor line $ -1 The penultimate line, you can add or subtract a value to determine the relative line
22,33 Lines 22 to 33
1, $ Line 1 to last line 1, . line 1 to current line .,$ Current line to last line
'a,' b The line from the mark a to the line from the mark b (Ma and mb have been used to mark before)
% All rows (equivalent to 1, $) ? str? Search up from the current position to find the line of the first str (where str can be any string or regular expression) / str / Search down from the current position to find the line of the first str (where str can be any string or regular expression) ** Note that all the above methods for range can be used to set the relative offset by + and-operations. ** -[flags] has the following values: flags meaning g Replace all matches (global) within the specified range c Request user confirmation before replacement e Ignore errors during execution i ignore case-insensitive None Only the first match in the specified range is replaced ** Note: All the above flags can be used in combination. For example, gc means to replace all matching items in the specified range, and the user will be asked to confirm before each replacement. ** #### Examples Replace some lines 1. : 10,20s / from / to / g replaces lines 10 to 20. 2. : 1,$ s / from / to / g replaces the contents of the first line to the last line (that is, all text)
3. : 1, .s / from / to / g replaces the content from the first line to the current line.
4. :., $S / from / to / g replaces the content from the current line to the last line. 5. : 'a,' bs / from / to / g replaces the line between the marks a and b (including the line where a and b are located), where a and b are the marks previously made with the m command . Replace all lines: :% s / from / to / g ## Repeat the action In normal mode, any action can be repeated Note: N is a number -Numbers: Nyy copies N lines down from the current line, Ndd deletes N lines down from the current line, Ngg jumps to the Nth line, and dNw deletes from the current cursor to the first Before N words (does not contain blanks, ie delete N-1 words), yNe copies from the current cursor to the end of the Nth word (note: yy = 1yy dd = 1dd) d$ delete to the end of the line
-Repeat the previous command: N. (N indicates the number of repetitions)

## Block selection

Note: The brackets are optional

In normal mode: [ctr +] v + (h or j or k or l)

1. ** High-frequency use scenario 1 **: [ctr +] v Select some line headers and then press=Effect: ** Code format is automatically adjusted **
2. ** High frequency usage scenario 2 **: [ctr +] v After selecting the head of some lines, press I, then press the comment symbol (eg: //) and finally press ESC : All the selected lines are commented ** Multi-line quick comment **
3. ** High frequency usage scenario 3 **: [ctr +] v After selecting some line headers, then press A, then press the contents of the comment and finally press ESC (for example: // This is a test Code) Effect: All the lines at the end of the selected lines are commented on.//This is the test code ** Multi-line quick comment **
4. ** High-frequency use scenario 4 **: [ctr +] v select some line header comments (for example://), then press d and finally press ESC effect: selected All these lines are commented out. ** Multi-line quick delete comments **
5. ** High-frequency use scenario 5 **: After selecting certain blocks, press [ctr +] v and then press the above-mentioned action buttons to achieve regional operation

## Powerful combination

### Operate a word under the cursor

In normal mode:

Action + Move [+ Number of Repeats]
The combination has already been used a lot in the past, continue here:

Action Operation Command + Range Effect
cw or c1 or c1w change from current cursor to word end
caw change whole word including current cursor
dw or d1 or d1w delete from current cursor to word end
daw delete whole word including current cursor
yw or y1 or y1w copy from current cursor to word end
yaw copy whole word including current cursor
d / word delete forward until the former character of the next ‘word’
d? word delete backward until the former character of the last ‘word’
Action Operation Command + Range Effect
dtc delete until before the next ‘c’
dfc delete until after the next ‘c’
Scope + Action Operation Instructions Effects
——————— ———-
bve or BvE + c / d / y manipulate a variable or string

The above table are high-frequency use scenarios

## Autocomplete

Press directly in insert mode: the most commonly used completion

 ctrl + n ctrl + p

Smart completion

 ctrl + x // Enter completion mode

-Complete line completion CTRL-X CTRL-L
-** Complete based on keywords in the current file ** CTRL-X CTRL-N
-** Complete according to dictionary ** CTRL-X CTRL-K
-Completion of CTRL-X CTRL-T according to thesaurus
-** Complete according to keywords in header file ** CTRL-X CTRL-I
-Completion of CTRL-X CTRL-] according to tags
-** Complete file name ** CTRL-X CTRL-F
-Completion of macro definition CTRL-X CTRL-D
-Completion of vim command CTRL-X CTRL-V
-User-defined completion method CTRL-X CTRL-U
-** Spelling suggestions ** CTRL-X CTRL-S // For example: an English word

## Collapse

In normal mode:

 zo (fold + open) zi (fold + indent) zc (fold + close)

## Split screen

** Split command **, in normal mode, enter

1. vs (Description: Vertically split the screen vertically)
2. sp (Note: split horizontally splits the screen, which is the default splitting method)

** Screens jump to each other **

1. ctr + w and then press h or j or k or l
2. Explanation: h: left, j: down, k: up, l: right

** Resize the split window **

1. ctrl + w before pressing+or - or =, of course press a number before pressing + or - or=to change the window height,=is equal The meaning of points. .
2. In normal mode, enter : resize -N or: resize + N to explicitly specify that the window is reduced or increased by N lines
3. ctrl + w before pressing <or> or=, of course press a number before pressing <or> or=to change the window width,=is equal The meaning of points.
4. Sometimes preview large files and feel that the split screen is too small, ctrl + w + T moves the current window to a new tab.

## tab window

Vim has added the function of multi-tab switching since vim7, which is equivalent to multiple windows. Although the previous version also has a multi-file editing function, it is not as convenient as this. Usage in normal mode:

-: tabnew [++ opt option] [＋ cmd] The file creates a new tab for the specified file
-: tabc closes the current tab or: q
-: tabo close ** other ** tab
-: tabs view ** all open ** tabs
-: tabp previous tab window
-: tabn next tab window

gt, gT can switch directly between tabs. There are many other commands,: help table.

## table of Contents

In normal mode:

1. : Te displays the current directory in the form of a tab window, then you can switch directories and open a file
2. :! Ls This is how vim invokes shell commands:! Ls + shell_command, but it does not display the current directory in the form of a tab window.

## Content operation of paired symbols

The following commands can operate on the content within punctuation:

1. ci' ci " ci ( ci [ ci { ci < respectively change the text content of these paired punctuation marks
2. di'di" di (ordib di [ di {or diB di < delete the text content of these paired punctuation marks respectively
3. yi' yi " yi ( yi [ yi { yi < separately copy the text content of these paired punctuation marks
4. vi' vi " vi ( vi [ vi { vi < respectively select the text content of these paired punctuation marks
5. cit dit yit vit separately operate the content between a pair of tags, editing html is very useful

** In addition, if you change the above i to a, you can operate the paired punctuation and the content of the paired punctuation at the same time **, for example:

For example, the text to be operated: 111 “222” 333, move the cursor to any character of “222” and enter the command

-di “, the text will become: 111” “333
-If you enter the command da “, the text will become: 111333

## Clipboard

### 1. Simple copy and paste

vim provides 12 clipboards, their names are vim and there are 11 pasteboards, which are 0, 1, 2, …, 9, a, “. If you open the system clipboard, there will be two more + And *. Use the: reg command to view the contents of each pasteboard.

In vim, simply use y and just copy it to the clipboard of ", and the same thing as paste with p is also the content of this clipboard.

### 2. Copy and paste to the specified clipboard

To copy the content of vim to a pasteboard, enter the normal mode, select the content to be copied, then press " Ny to complete the copy, where N is the pasteboard number (note that you click the double quotes and then press the pasteboard number Finally, press y), for example, to copy the content to the pasteboard a, select the content and press “ay”.

To paste the contents of a vim pasteboard, you need to exit the editing mode, press " Np in the normal mode, where N is the pasteboard number. For example, you can press " 5p to paste the contents of pasteboard No. If you paste it in, you can also press " + p to paste the content in the system global pasteboard.

### 3. System Clipboard

To view the clipboard supported by vim, enter : reg in normal mode

How should it be used to interact with the system clipboard? When you encounter problems, the first thing you are looking for is the help document. The Clipboard is the Clipboard. View help via : h clipboard

The asterisk * and plus sign + pasteboard are system pasteboards. Under Windows, the * and + clipboards are the same. For X11 systems, * the clipboard stores the selected or highlighted content, + the clipboard stores the copied or cut content. Open the clipboard option, you can access + clipboard; open xterm_clipboard, you can access * clipboard. * One function of the clipboard is that the content selected in one window of vim can be taken out in another window of vim.

** Copy to system clipboard **

example:

" * y " + y " + Nyy copy N lines to the system clipboard

Explanation:

Command Meaning
{Visual} “+ y copy the selected text into the system clipboard
“+ y {motion} copy the text specified by {motion} into the system clipboard
: [range] yank + copy the text specified by [range] into the system clipboard

** Cut to system clipboard **

example:

“+ dd

** Paste from system clipboard to vim **

In normal mode:

1. " * p
2. " + p
3. : put + Meaning: Ex command puts contents of system clipboard on a new line

In insert mode:

<Cr> + Meaning: From insert mode (or commandline mode)

“+ p is better than the Ctrl-v command, it can handle the pasting of large blocks of text faster and more reliably, and can also avoid the accumulation of automatic indentation at the beginning of each line when pasting a large amount of text, because Ctrl-v The system caches stream processing, processing the pasted text line by line.

## vim encoding

Vim can edit all kinds of character encoding files very well, which of course includes popular Unicode encoding methods such as UCS-2 and UTF-8.

Four character encoding options, encoding, fileencoding, fileencodings, termencoding (for possible values of these options, please refer to Vim online help: help encoding-names, their meanings are as follows:

-** encoding **: The character encoding used internally by Vim

Including Vim’s buffer (buffer), menu text, message text, etc. The default is to choose according to your locale. The user manual recommends changing its value only in .vimrc. In fact, it seems that it only makes sense to change its value in .vimrc. You can use another encoding to edit and save the file. For example, the encoding of your vim is utf-8, and the edited file uses cp936 encoding. Vim will automatically convert the read file into utf-8 (vim can read) Understand the way), and when you write a file, it will automatically switch back to cp936 (the file save encoding).


text:
# zbMATH — the first resource for mathematics

New integral representations of Whittaker functions for classical Lie groups. (English. Russian original) Zbl 1267.17007
Russ. Math. Surv. 67, No. 1, 1-92 (2012); translation from Usp. Mat. Nauk 67, No. 1, 3-96 (2012).
A remarkable integral representation for the common eigenfunctions of $$\mathfrak{gl}_{l+1}$$ Toda chain Hamiltonian operators was proposed in [A. Givental, Transl., Ser. 2, Am. Math. Soc. 180(34), 103–115 (1997; Zbl 0895.32006)], see also [D. Joe and B. Kim, Int. Math. Res. Not. 2003, No. 15, 859–882 (2003; Zbl 1146.14302)]. This integral representation arises naturally in a construction of a mirror dual of Type A topological closed strings on $$\mathfrak{gl}_{l+1}$$. According to B. Kostant [Invent. Math. 48, 101–184 (1978; Zbl 0405.22013), Representation theory of Lie groups, Proc. SRC/LMS Res. Symp., Oxford 1977, Lond. Math. Soc. Lect. Note Ser. 34, 287–316 (1979; Zbl 0474.58010)], the common eigenfunctions of $$\mathfrak{g}$$-Toda chain Hamiltonian operators are given by generalizations of the classical Whittaker functions and can be expressed in terms of matrix elements of infinite-dimensional representations of the universal enveloping algebra $$\mathcal{U}(\mathfrak{g})$$.
In this paper the authors propose a universal construction of an integral representation of a $$\mathfrak{g}$$-Whittaker function for an arbitrary semisimple Lie algebra $$\mathfrak{g}$$ with the integrands expressed in terms of the matrix elements of the fundamental representations of $$\mathfrak{g}$$ (Proposition 1.1). For classical Lie algebras $$\mathfrak{so}_{2l+1}$$, $$\mathfrak{sp}_{2l}$$, and $$\mathfrak{so}_{2l}$$, the construction is modified to obtain a generalization of the Givental construction for classical Lie algebras (Theorems 1.3, 1.6, 1.10, and 1.14).
In [A. Gerasimov et al., Int. Math. Res. Not. No. 6, 23 p. (2006; Zbl 1142.17019)], it was noted that the Givental integral representation has a recursive structure connecting the $$\mathfrak{gl}_l$$- and $$\mathfrak{gl}_{l+1}$$-Whittaker functions by simple integral transformations. The corresponding integral operator coincides with a particular degeneration of the Baxter $${\mathcal Q}$$-operator for the $$\widehat{\mathfrak{gl}}_{l+1}$$-Toda chain. In the paper under review, the authors introduce the Baxter $${\mathcal Q}$$-operators associated with the classical affine Lie algebras $$\widehat{\mathfrak{so}}_{2l}$$, $$\widehat{\mathfrak{so}}_{2l+1}$$ and a twisted form of $$\widehat{\mathfrak{gl}}_{2l}$$ and prove that the relation between recursion integral operators of the generalized Givental representation and degenerate $${\mathcal Q}$$-operators remains valid for all classical Lie algebras.

##### MSC:
 17B20 Simple, semisimple, reductive (super)algebras 22E45 Representations of Lie and linear algebraic groups over real fields: analytic methods 33D80 Connections of basic hypergeometric functions with quantum groups, Chevalley groups, $$p$$-adic groups, Hecke algebras, and related topics
##### Keywords:
Whittaker function; Toda chain; Baxter operator
Full Text: