text:
# Math Help - Sum of digits

1. ## Sum of digits

The sum of $2^{1000}$ is written and the sum of the digits of this number is written and the process is repeated a number of times, till a one digit number is obtained. What is this one digit number?

Keep Smiling
Malay

2. Hello, Malay!

The sum of $2^{1000}$ is written and the sum of the digits of this number is written
and the process is repeated until a one-digit number is obtained.
What is this one-digit number?

The sum-of-digits means we are dealing with "digital roots"
. . . . . that the numbers are reduced modulo-9.

We can reduce the products as we work, rather than waiting until the final product.

Since $2^{20} \:= \:1,048,576 \:\equiv \:2^2\pmod 9$

. . then: $N \:= \:2^{1000} \:= \:\left(2^{20}\right)^{50} \:\equiv\:\left(2^2\right)^{50}\pmod{9}$

Hence: . $N \:\equiv \:2^{100} \:= \:\left(2^{20}\right)^5 \:\equiv\;(2^2)^5\pmod{9}$

Therefore: . $N\:\equiv\:2^{10} \:=\:1024\:\equiv\:7\pmod{9}$

The one-digit number is $\boxed{7}$

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

An alternate solution . . .

Consider the digit roots of consecutive powers of 2.

. . . $\begin{array}{ccccccc}2^1 \equiv 2 \\ 2^2\equiv 4 \\ 2^3 \equiv 8 \\ 2^4 \equiv 7 \\ 2^5 \equiv 5 \\ 2^6 \equiv 1 \\ \vdots\end{array}$

The digits roots have a six-digit cycle: 2-4-8-7-5-1.

Since $2000 \div 6\:=\:166,\;rem\;4$
. . the digit root of $2^{1000}$ is the fourth one: $\boxed{7}$

3. but why have you found modulo 9?

Keep Smiling
Malay

4. Hello, Malay!

but why have you found modulo 9?

It's a bit tricky to explain . . . Given a positive integer $N$,
it turns out that $N$ is equivalent to the sum of its digits, modulo 9.

If $N = abc\hdots n$, then: . $N \,\equiv \,(a+b+c+\hdots+n) \pmod{9}$

Let's see if I can devise a proof for this . . .

Let $N\:=\:10^na + 10^{n-1}b + 10^{n-2}c + \hdots + 10m + n$

. . $= \10^na - a + a) + (10^{n-1}b - b + b) + (10^{n-2}c - c + c)" alt="= \10^na - a + a) + (10^{n-1}b - b + b) + (10^{n-2}c - c + c)" /> $+ \hdots + (10m - m + m) + n$

. . $=\10^n - 1)a + a+ (10^{n-1}-1)b + b + (10^{n-2}-1)c + c" alt="=\10^n - 1)a + a+ (10^{n-1}-1)b + b + (10^{n-2}-1)c + c" /> $+ \hdots + (10 - 1)m + m + n$

. . $= \:\underbrace{(10^n-1)a + (10^{n-1} -1)b + (10^{n-2} - 1)c + \hdots + (10 - 1)m}$ $\,+\,(a + b + c + \hdots + m + n)$
. . . . . . . . . . . . This expression is a multiple of 9 *

Therefore: . $N \:\equiv \a + b + c + \hdots +n)\pmod{9}" alt="N \:\equiv \a + b + c + \hdots +n)\pmod{9}" />

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

* $10^k - 1$ is of the form: . $999\hdots9$ (k 9's)

5. Originally Posted by Soroban
Hello, Malay!

It's a bit tricky to explain . . . Given a positive integer $N$,
it turns out that $N$ is equivalent to the sum of its digits, modulo 9.

If $N = abc\hdots n$, then: . $N \,\equiv \,(a+b+c+\hdots+n) \pmod{9}$

Let's see if I can devise a proof for this . . .

Let $N\:=\:10^na + 10^{n-1}b + 10^{n-2}c + \hdots + 10m + n$

. . $= \10^na - a + a) + (10^{n-1}b - b + b) + (10^{n-2}c - c + c)" alt="= \10^na - a + a) + (10^{n-1}b - b + b) + (10^{n-2}c - c + c)" /> $+ \hdots + (10m - m + m) + n$

. . $=\10^n - 1)a + a+ (10^{n-1}-1)b + b + (10^{n-2}-1)c + c" alt="=\10^n - 1)a + a+ (10^{n-1}-1)b + b + (10^{n-2}-1)c + c" /> $+ \hdots + (10 - 1)m + m + n$

. . $= \:\underbrace{(10^n-1)a + (10^{n-1} -1)b + (10^{n-2} - 1)c + \hdots + (10 - 1)m}$ $\,+\,(a + b + c + \hdots + m + n)$
. . . . . . . . . . . . This expression is a multiple of 9 *

Therefore: . $N \:\equiv \a + b + c + \hdots +n)\pmod{9}" alt="N \:\equiv \a + b + c + \hdots +n)\pmod{9}" />

~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~

* $10^k - 1$ is of the form: . $999\hdots9$ (k 9's)

Ok.
Let $2^{1000}$is N. It contains n digits. You have found the sum of digits of n(equal to a+b+c+d+....+n)
But how will you find a+b+c+d+..+n so than we can proceed to the next step.

Malay

6. Hello, Malay!

Ok.
Let $2^{1000} = N$ . . . It contains $n$ digits.
You have found the sum of digits of $N:\; a+b+c+d+....+n.$

But how will you find $a+b+c+d+..+n$ so that we can proceed to the next step?

We don't need that sum . . . We can work with smaller quantities.

If $X \equiv a\!\!\pmod{9}$ and $Y \equiv b\!\!\pmod{9}$, then $XY \equiv ab\!\!\pmod{9}$

Since $2^{10} \,= \,1,024 \,\equiv \,7\!\!\!\pmod{9}$
. . then: . $2^{20}\:=\2^{10})(2^{10}) \:\equiv \:7\cdot7 \:\equiv\:49 \:\equiv\:4\!\!\!\pmod{9} " alt="2^{20}\:=\2^{10})(2^{10}) \:\equiv \:7\cdot7 \:\equiv\:49 \:\equiv\:4\!\!\!\pmod{9} " />

And from there, we can work our way up to $2^{1000}$

7. I think I was not clear in my last post.
Suppose we have a number 256784 which is congruent to 5 modulo 9.
You showed that it is congruent to 2+5+6+7+8+4 modulo 9
now, what will be the next step

Malay

8. Hello again, Malay!

I hope I can finally make this clear . . .

We don't need the product to find its digital root.

Your thoughts seem to be along this tline:

Consider $7^9$ and add its digits.
If the sum is greater than 9, add the digits again.
Continue until you get a one-digit number.

Grabbing our calculator: $7^9 \,= \,40,353,607$
Then: $4 + 0 + 3 + 5 + 3 + 6 + 0 + 7 \,= \,28\quad\Rightarrow\quad2 + 8 \,=$ $10\quad\Rightarrow\quad 1 + 0 \,= \,1$

But we can get the final digit without expanding $7^9$.

We have: . $\begin{array}{cccc}7 \equiv 7\text{ (mod 9)} \\ 7^2 = 49 \equiv 4\text{ (mod 9)} \\ 7^3 = 343 \equiv 1\text{ (mod 9)}\\ \vdots\end{array}$

Since $7^3 \equiv 1\text{ (mod 9)}:\;\;(7^3)(7^3)(7^3) \equiv 1\cdot1\cdot1\text{ (mod 9)}$

So we have: . $7^9 \equiv 1\text{ (mod 9)}$ . . . see?

The original problem was $2^{1000}$.
We will never see that number ... nor be able to add its digits ... ever!
. . (It begins $10,715,086...$ and has 302 digits.)

So we begin with, say, $2^{20} \equiv 4\text{ (mod 9)}$, and create an expression with $2^{1000}$.

9. what is modulo 9?

10. This comes from the old "casting out nines" technique.

11. Originally Posted by Soroban
Hello again, Malay!

I hope I can finally make this clear . . .

We don't need the product to find its digital root.

Your thoughts seem to be along this tline:

Consider $7^9$ and add its digits.
If the sum is greater than 9, add the digits again.
Continue until you get a one-digit number.

Grabbing our calculator: $7^9 \,= \,40,353,607$
Then: $4 + 0 + 3 + 5 + 3 + 6 + 0 + 7 \,= \,28\quad\Rightarrow\quad2 + 8 \,=$ $10\quad\Rightarrow\quad 1 + 0 \,= \,1$

But we can get the final digit without expanding $7^9$.

We have: . $\begin{array}{cccc}7 \equiv 7\text{ (mod 9)} \\ 7^2 = 49 \equiv 4\text{ (mod 9)} \\ 7^3 = 343 \equiv 1\text{ (mod 9)}\\ \vdots\end{array}$

Since $7^3 \equiv 1\text{ (mod 9)}:\;\;(7^3)(7^3)(7^3) \equiv 1\cdot1\cdot1\text{ (mod 9)}$

So we have: . $7^9 \equiv 1\text{ (mod 9)}$ . . . see?

The original problem was $2^{1000}$.
We will never see that number ... nor be able to add its digits ... ever!
. . (It begins $10,715,086...$ and has 302 digits.)

So we begin with, say, $2^{20} \equiv 4\text{ (mod 9)}$, and create an expression with $2^{1000}$.

I have no doubt in your method. I am pretty sure it works. The only thing I want to know why it works?(As galactus pointed out 'casting out nines' was taught to us in schools, we used it to get lucky number by procesing the same way on date of birth).
I just got. There was some misunderstanding.

Thanks

Keep Smiling
Malay


text:
## Monday, May 30, 2016

### Compton Scattering

I complain about the amplitude of Compton scattering, which is the scattering of a photon by an electron.
The Compton scattering amplitude is $$\label{eq:20160529a} \frac{1}{4} | \mathcal{M} |^2 = 2 e^4 \left[\frac{p_{24}}{p_{12}} + \frac{p_{12}}{p_{24}} + 2 m^2 \left( \frac{1}{p_{12}} - \frac{1}{p_{24}}\right) +m^4 \left( \frac{1}{p_{12}} - \frac{1}{p_{24}}\right)^2\right]$$ $m$ is the mass of the electron and $p_{ij} = p_i \cdot p_j$. The definition of the momenta $p_i$ can be found in the graph below.
 Compton scattering. $e^-$ is an electron, $\gamma$ is a photon
Although the result \eqref{eq:20160529a} is quite short, the calculation is long, see for example Peskin and Schroeder, page 161. I worked a bit differently from the calculation in Peskin and Schroeder. Namely I used the following two gamma matrix identities \begin{align} \text{Tr}&\left[ \left( a_1\!\!\!\!\!/ + m_1\right) \gamma^{\mu} \left( a_2\!\!\!\!\!/ + m_2\right)\gamma^{\nu} \left( a_3\!\!\!\!\!/ + m_3\right)\gamma_{\nu} \left( a_4\!\!\!\!\!/ + m_4\right)\gamma_{\mu} \right]\nonumber\\ & = 16 \left[ (a_{12} -2 m_{12} )(a_{34} -2 m_{34} )- (a_{13} -4 m_{13} )(a_{24} - m_{24} ) + (a_{14} -2 m_{14} )(a_{23} -2 m_{23} ) \right]\label{eq:20160530a} \end{align} and $$\label{eq:20160530b} \text{Tr}\left[ \left( a_1\!\!\!\!\!/ + m_1\right) \gamma^{\mu} \left( a_2\!\!\!\!\!/ + m_2\right)\gamma^{\nu} \left( a_3\!\!\!\!\!/ + m_3\right)\gamma_{\mu} \left( a_4\!\!\!\!\!/ + m_4\right)\gamma_{\nu} \right] = 16 \left( a_{12} m_{34} + a_{13} m_{24} + a_{14} m_{23} - 2 a_{13} a_{24} + a \leftrightarrow m \right)$$ I thought this would lead to a shorter derivation than the one in Peskin and Schroeder, but the full calculation including the proof of \eqref{eq:20160530a} and \eqref{eq:20160530b} was still 8 handwritten pages. In the course of this calculation, many cancellations occurred leading finally to the simple result \eqref{eq:20160529a}.

I think that the fact that \eqref{eq:20160529a} is short but is the result of a long calculation with many cancellations, shows that a method could exist that yields \eqref{eq:20160529a} more efficiently. I have been looking on the internet for such a method, not only because I want to have a quicker method for \eqref{eq:20160529a}, but also because I think that looking for more efficient methods to calculate scattering amplitudes in quantum field theory is a current area of research.

format: plain


text:
# Boolean matrix

In mathematics, a Boolean matrix is a matrix with entries from a Boolean algebra. When the Boolean algebra has just two elements {0,1} the Boolean matrix is called a logical matrix.

Let U be a Boolean algebra with at least two elements. Intersection, union, complementation, and containment of elements is expressed in U. Let V be the collection of n × n matrices that have entries taken from U. Complementation of such a matrix is obtained by complementing each element. The intersection or union of two such matrices is obtained by applying the operation to entries of each pair of elements to obtain the corresponding matrix intersection or union. A matrix is contained in another if each entry of the first is contained in the corresponding entry of the second.

The product of two Boolean matrices is expressed as follows:

${\displaystyle (AB)_{ij}=\bigcup _{k=1}^{n}(A_{ik}\cap B_{kj}).}$

According to one author, "Matrices over an arbitrary Boolean algebra β satisfy most of the properties over β0 = {0, 1}. The reason is that any Boolean algebra is a sub-Boolean algebra of ${\displaystyle \beta _{0}^{S}}$ for some set S, and we have an isomorphism from n × n matrices over ${\displaystyle \beta _{0}^{S}\ {\text{to}}\ \beta _{n}^{S}.}$"[1]

## References

1. ^ Ki Hang Kim (1982) Boolean Matrix Theory and Applications, page 249, Appendix: Matrices over arbitrary Boolean Algebras, Marcel Dekker ISBN 0-8247-1788-0


text:
Home > Absolute Error > Absolute Error Calculation Formula

# Absolute Error Calculation Formula

## Contents

If you do the same thing wrong each time you make the measurement, your measurement will differ systematically (that is, in the same direction each time) from the correct result. Practice online or make a printable study sheet. The smaller the unit, or fraction of a unit, on the measuring device, the more precisely the device can measure. So you might see that the measurement of a building is 357±.5ft{\displaystyle 357\pm .5ft}. http://softwareabroad.com/absolute-error/absolute-error-calculation-physics.php

We are not, and will not be, concerned with the “percent error” exercises common in high school, where the student is content with calculating the deviation from some allegedly authoritative number. Avoid the error called "parallax" -- always take readings by looking straight down (or ahead) at the measuring device. Absolute errors do not always give an indication of how important the error may be. An expected value is usually found on tests and school labs. http://www.regentsprep.org/regents/math/algebra/am3/LError.htm

## How To Get Absolute And Relative Error

To record this measurement as either 0.4 or 0.42819667 would imply that you only know it to 0.1 m in the first case or to 0.00000001 m in the second. From 41.25 to 48 = 6.75 From 48 to 55.25 = 7.25 Answer: pick the biggest one! The following example will clarify these ideas. Measure under controlled conditions.

This tells you what percentage of the final measurement you messed up by. These approximation values with errors when used in calculations may lead to larger errors in the values. Any measurements within this range are "tolerated" or perceived as correct. How To Calculate Absolute Error In Statistics Machines used in manufacturing often set tolerance intervals, or ranges in which product measurements will be tolerated or accepted before they are considered flawed.

Thanks for voting! which is the absolute error? Find the absolute error, relative error and percent of error of the approximation 3.14 to the value , using the TI-83+/84+ entry of pi as the actual value. The absolute error of the measurement shows how large the error actually is, while the relative error of the measurement shows how large the error is in relation to the correct

Absolute Error and Relative Error: Error in measurement may be represented by the actual amount of error, or by a ratio comparing the error to the size of the measurement. How To Calculate Absolute Error And Percent Error By continuing to use our site, you agree to our cookie policy. The precision of a measuring instrument is determined by the smallest unit to which it can measure. 2. This might be explicitly stated (for example, “The building was measured to the nearest foot.”), but it doesn’t have to be.

## How To Calculate Absolute Error In Chemistry

If you are measuring a football field and the absolute error is 1 cm, the error is virtually irrelevant. http://www.mathsisfun.com/measure/error-measurement.html When reporting relative errors it is usual to multiply the fractional error by 100 and report it as a percentage. How To Get Absolute And Relative Error For example:.025=x0−360360{\displaystyle .025={\frac {x_{0}-360}{360}}}.025×360=x0−360360×360{\displaystyle .025\times 360={\frac {x_{0}-360}{360}}\times 360}9=x0−360{\displaystyle 9=x_{0}-360} 5 Add the actual value to each side of the equation. How To Calculate Absolute Error In Excel Since the measurement was made to the nearest tenth, the greatest possible error will be half of one tenth, or 0.05. 2.

The smaller the unit, or fraction of a unit, on the measuring device, the more precisely the device can measure. check over here Absolute error is positive. Use the same unites as the ones in your measurements.[4] 4 Practice with several examples. The relative error of the measurement is 2 mph / 60 mph = 0.033 or 3.3%More About Experimental Error Show Full Article Related This Is How To Calculate Percent Error What How To Calculate Absolute Error In Physics

The precision of a measuring instrument is determined by the smallest unit to which it can measure. 2. Well, we just want the size (the absolute value) of the difference. Assume you made the following five measurements of a length: Length (mm) Deviation from the mean 22.8 0.0 23.1 0.3 22.7 0.1 his comment is here Did this article help you?

## Back to Top Suppose the measurement has some errors compared to true values.Relative error decides how incorrect a quantity is from a number considered to be true.

Sometimes the quantity you measure is well defined but is subject to inherent random fluctuations. they could both be the smallest possible measure, or both the largest. Another possibility is that the quantity being measured also depends on an uncontrolled variable. (The temperature of the object for example). Calculate Standard Deviation Wolfram|Alpha» Explore anything with the first computational knowledge engine.

The absolute error of the sum or difference of a number of quantities is less than or equal to the sum of their absolute errors. For example, if you know that the actual value is 360 ft, your formula will look like this: .025=x0−360360{\displaystyle .025={\frac {x_{0}-360}{360}}}. 4 Multiply each side of the equation by the actual Once you understand the difference between Absolute and Relative Error, there is really no reason to do everything all by itself. weblink Question2: If the approximate value of $\pi$ is 3.14.

For example if you say that the length of an object is 0.428 m, you imply an uncertainty of about 0.001 m. What if some of the experimental values are negative? The actual length of this field is 500 feet. In plain English: The absolute error is the difference between the measured value and the actual value. (The absolute error will have the same unit label as the measured quantity.) Relative

wikiHow relies on ad money to give you our free how-to guides. For example if you know a length is 0.428 m ± 0.002 m, the 0.002 m is an absolute error. You should only report as many significant figures as are consistent with the estimated error. Method 3 Using the Maximum Possible Error 1 Determine the measuring unit.

The art of estimating these deviations should probably be called uncertainty analysis, but for historical reasons is referred to as error analysis. Solution: Given: The measured value of metal ball xo = 3.14 The true value of ball x = 3.142 Absolute error $\Delta$ x = True value - Measured value = Chemistry Homework Help Worked Chemistry Problems Absolute Error and Relative Error Calculation Examples of Error Calculations Absolute and experimental error are two types of error in measurements. Contact the MathWorld Team © 1999-2016 Wolfram Research, Inc. | Terms of Use THINGS TO TRY: normal distribution aleph1 + bet 4 Dakota Cash Home Numbers Algebra Geometry Data Measure Puzzles

The percent of error is found by multiplying the relative error by 100%. Since absolute error is always positive, take the absolute value of this difference, ignoring any negative signs.[4] This will give you the absolute error. Examples: 1. Propagation of errors Once you have some experimental measurements, you usually combine them according to some formula to arrive at a desired quantity.

For this reason, it is more useful to express error as a relative error. One must simply sit down and think about all of the possible sources of error in a given measurement, and then do small experiments to see if these sources are active. Accuracy is a measure of how close the result of the measurement comes to the "true", "actual", or "accepted" value. (How close is your answer to the accepted value?) Tolerance is The absolute error of the measurement shows how large the error actually is, while the relative error of the measurement shows how large the error is in relation to the correct

Normally people use absolute error, relative error, and percent error to represent such discrepancy: absolute error = |Vtrue - Vused| relative error = |(Vtrue - Vused)/Vtrue|


text:
College Physics for AP® Courses 2e

# 25.4Total Internal Reflection

College Physics for AP® Courses 2e25.4 Total Internal Reflection

### Learning Objectives

By the end of this section, you will be able to:

• Explain the phenomenon of total internal reflection.
• Describe the workings and uses of fiber optics.
• Analyze the reason for the sparkle of diamonds.

A good-quality mirror may reflect more than 90% of the light that falls on it, absorbing the rest. But it would be useful to have a mirror that reflects all of the light that falls on it. Interestingly, we can produce total reflection using an aspect of refraction.

Consider what happens when a ray of light strikes the surface between two materials, such as is shown in Figure 25.12(a). Part of the light crosses the boundary and is refracted; the rest is reflected. If, as shown in the figure, the index of refraction for the second medium is less than for the first, the ray bends away from the perpendicular. (Since $n1>n2n1>n2$, the angle of refraction is greater than the angle of incidence—that is, $θ2>θ1θ2>θ1$.) Now imagine what happens as the incident angle is increased. This causes $θ2θ2$ to increase also. The largest the angle of refraction $θ2θ2$can be is $90º90º$, as shown in Figure 25.12(b).The critical angle$θcθc$ for a combination of materials is defined to be the incident angle $θ1θ1$ that produces an angle of refraction of $90º90º$. That is, $θcθc$ is the incident angle for which $θ2=90ºθ2=90º$. If the incident angle $θ1θ1$ is greater than the critical angle, as shown in Figure 25.12(c), then all of the light is reflected back into medium 1, a condition called total internal reflection.

### Critical Angle

The incident angle $θ1θ1$ that produces an angle of refraction of $90º90º$ is called the critical angle, $θcθc$.

Figure 25.12 (a) A ray of light crosses a boundary where the speed of light increases and the index of refraction decreases. That is, $n 2 < n 1 n 2 < n 1$ . The ray bends away from the perpendicular. (b) The critical angle $θ c θ c$ is the one for which the angle of refraction is . (c) Total internal reflection occurs when the incident angle is greater than the critical angle.

Snell’s law states the relationship between angles and indices of refraction. It is given by

$n1sinθ1=n2sinθ2.n1sinθ1=n2sinθ2.$
25.15

When the incident angle equals the critical angle ($θ1=θcθ1=θc$), the angle of refraction is $90º90º$ ($θ2=90ºθ2=90º$). Noting that $sin 90º=1sin 90º=1$, Snell’s law in this case becomes

$n1sinθ1=n2.n1sinθ1=n2.$
25.16

The critical angle $θcθc$ for a given combination of materials is thus

$θc=sin−1n2/n1forn1>n2.θc=sin−1n2/n1forn1>n2.$
25.17

Total internal reflection occurs for any incident angle greater than the critical angle $θcθc$, and it can only occur when the second medium has an index of refraction less than the first. Note the above equation is written for a light ray that travels in medium 1 and reflects from medium 2, as shown in the figure.

### Example 25.4

#### How Big is the Critical Angle Here?

What is the critical angle for light traveling in a polystyrene (a type of plastic) pipe surrounded by air?

#### Strategy

The index of refraction for polystyrene is found to be 1.49 in Figure 25.13, and the index of refraction of air can be taken to be 1.00, as before. Thus, the condition that the second medium (air) has an index of refraction less than the first (plastic) is satisfied, and the equation $θc=sin−1n2/n1θc=sin−1n2/n1$ can be used to find the critical angle $θcθc$. Here, then, $n2=1.00n2=1.00$ and $n1=1.49n1=1.49$.

#### Solution

The critical angle is given by

$θc=sin−1n2/n1.θc=sin−1n2/n1.$
25.18

Substituting the identified values gives

$θ c = sin − 1 1 . 00 / 1 . 49 = sin − 1 0.671 = 42.2º. θ c = sin − 1 1 . 00 / 1 . 49 = sin − 1 0.671 = 42.2º.$
25.19

#### Discussion

This means that any ray of light inside the plastic that strikes the surface at an angle greater than $42.2º42.2º$ will be totally reflected. This will make the inside surface of the clear plastic a perfect mirror for such rays without any need for the silvering used on common mirrors. Different combinations of materials have different critical angles, but any combination with $n1>n2n1>n2$ can produce total internal reflection. The same calculation as made here shows that the critical angle for a ray going from water to air is $48.6º48.6º$, while that from diamond to air is $24.4º24.4º$, and that from flint glass to crown glass is $66.3º66.3º$. There is no total reflection for rays going in the other direction—for example, from air to water—since the condition that the second medium must have a smaller index of refraction is not satisfied. A number of interesting applications of total internal reflection follow.

### Fiber Optics: Endoscopes to Telephones

Fiber optics is one application of total internal reflection that is in wide use. In communications, it is used to transmit telephone, internet, and cable TV signals. Fiber optics employs the transmission of light down fibers of plastic or glass. Because the fibers are thin, light entering one is likely to strike the inside surface at an angle greater than the critical angle and, thus, be totally reflected (See Figure 25.13.) The index of refraction outside the fiber must be smaller than inside, a condition that is easily satisfied by coating the outside of the fiber with a material having an appropriate refractive index. In fact, most fibers have a varying refractive index to allow more light to be guided along the fiber through total internal refraction. Rays are reflected around corners as shown, making the fibers into tiny light pipes.

Figure 25.13 Light entering a thin fiber may strike the inside surface at large or grazing angles and is completely reflected if these angles exceed the critical angle. Such rays continue down the fiber, even following it around corners, since the angles of reflection and incidence remain large.

Bundles of fibers can be used to transmit an image without a lens, as illustrated in Figure 25.14. The output of a device called an endoscope is shown in Figure 25.14(b). Endoscopes are used to explore the body through various orifices or minor incisions. Light is transmitted down one fiber bundle to illuminate internal parts, and the reflected light is transmitted back out through another to be observed. Surgery can be performed, such as arthroscopic surgery on the knee joint, employing cutting tools attached to and observed with the endoscope. Samples can also be obtained, such as by lassoing an intestinal polyp for external examination.

Fiber optics has revolutionized surgical techniques and observations within the body. There are a host of medical diagnostic and therapeutic uses. The flexibility of the fiber optic bundle allows it to navigate around difficult and small regions in the body, such as the intestines, the heart, blood vessels, and joints. Transmission of an intense laser beam to burn away obstructing plaques in major arteries as well as delivering light to activate chemotherapy drugs are becoming commonplace. Optical fibers have in fact enabled microsurgery and remote surgery where the incisions are small and the surgeon’s fingers do not need to touch the diseased tissue.

Figure 25.14 (a) An image is transmitted by a bundle of fibers that have fixed neighbors. (b) An endoscope is used to probe the body, both transmitting light to the interior and returning an image such as the one shown. (credit: Med_Chaos, Wikimedia Commons)

Fibers in bundles are surrounded by a cladding material that has a lower index of refraction than the core. (See Figure 25.15.) The cladding prevents light from being transmitted between fibers in a bundle. Without cladding, light could pass between fibers in contact, since their indices of refraction are identical. Since no light gets into the cladding (there is total internal reflection back into the core), none can be transmitted between clad fibers that are in contact with one another. The cladding prevents light from escaping out of the fiber; instead most of the light is propagated along the length of the fiber, minimizing the loss of signal and ensuring that a quality image is formed at the other end. The cladding and an additional protective layer make optical fibers flexible and durable.

Figure 25.15 Fibers in bundles are clad by a material that has a lower index of refraction than the core to ensure total internal reflection, even when fibers are in contact with one another. This shows a single fiber with its cladding.

The cladding prevents light from being transmitted between fibers in a bundle.

Special tiny lenses that can be attached to the ends of bundles of fibers are being designed and fabricated. Light emerging from a fiber bundle can be focused and a tiny spot can be imaged. In some cases the spot can be scanned, allowing quality imaging of a region inside the body. Special minute optical filters inserted at the end of the fiber bundle have the capacity to image tens of microns below the surface without cutting the surface—non-intrusive diagnostics. This is particularly useful for determining the extent of cancers in the stomach and bowel.

Most telephone conversations and Internet communications are now carried by laser signals along optical fibers. Extensive optical fiber cables have been placed on the ocean floor and underground to enable optical communications. Optical fiber communication systems offer several advantages over electrical (copper) based systems, particularly for long distances. The fibers can be made so transparent that light can travel many kilometers before it becomes dim enough to require amplification—much superior to copper conductors. This property of optical fibers is called low loss. Lasers emit light with characteristics that allow far more conversations in one fiber than are possible with electric signals on a single conductor. This property of optical fibers is called high bandwidth. Optical signals in one fiber do not produce undesirable effects in other adjacent fibers. This property of optical fibers is called reduced crosstalk. We shall explore the unique characteristics of laser radiation in a later chapter.

### Corner Reflectors and Diamonds

A light ray that strikes an object consisting of two mutually perpendicular reflecting surfaces is reflected back exactly parallel to the direction from which it came. This is true whenever the reflecting surfaces are perpendicular, and it is independent of the angle of incidence. Such an object, shown in Figure 25.16, is called a corner reflector, since the light bounces from its inside corner. Many inexpensive reflector buttons on bicycles, cars, and warning signs have corner reflectors designed to return light in the direction from which it originated. It was more expensive for astronauts to place one on the moon. Laser signals can be bounced from that corner reflector to measure the gradually increasing distance to the moon with great precision.

Figure 25.16 (a) Astronauts placed a corner reflector on the moon to measure its gradually increasing orbital distance. (credit: NASA) (b) The bright spots on these bicycle safety reflectors are reflections of the flash of the camera that took this picture on a dark night. (credit: Julo, Wikimedia Commons)

Corner reflectors are perfectly efficient when the conditions for total internal reflection are satisfied. With common materials, it is easy to obtain a critical angle that is less than $45º45º$. One use of these perfect mirrors is in binoculars, as shown in Figure 25.17. Another use is in periscopes found in submarines.

Figure 25.17 These binoculars employ corner reflectors with total internal reflection to get light to the observer’s eyes.

### The Sparkle of Diamonds

Total internal reflection, coupled with a large index of refraction, explains why diamonds sparkle more than other materials. The critical angle for a diamond-to-air surface is only $24.4º24.4º$, and so when light enters a diamond, it has trouble getting back out. (See Figure 25.18.) Although light freely enters the diamond, it can exit only if it makes an angle less than $24.4º24.4º$. Facets on diamonds are specifically intended to make this unlikely, so that the light can exit only in certain places. Good diamonds are very clear, so that the light makes many internal reflections and is concentrated at the few places it can exit—hence the sparkle. (Zircon is a natural gemstone that has an exceptionally large index of refraction, but not as large as diamond, so it is not as highly prized. Cubic zirconia is manufactured and has an even higher index of refraction ($≈2.17≈2.17$), but still less than that of diamond.) The colors you see emerging from a sparkling diamond are not due to the diamond’s color, which is usually nearly colorless. Those colors result from dispersion, the topic of Dispersion: The Rainbow and Prisms. Colored diamonds get their color from structural defects of the crystal lattice and the inclusion of minute quantities of graphite and other materials. The Argyle Mine in Western Australia produces around 90% of the world’s pink, red, champagne, and cognac diamonds, while around 50% of the world’s clear diamonds come from central and southern Africa.

Figure 25.18 Light cannot easily escape a diamond, because its critical angle with air is so small. Most reflections are total, and the facets are placed so that light can exit only in particular ways—thus concentrating the light and making the diamond sparkle.

### PhET Explorations

#### Bending Light

Explore bending of light between two media with different indices of refraction. See how changing from air to water to glass changes the bending angle. Play with prisms of different shapes and make rainbows.

Do you know how you learn best?


text:
&= \text{______} [\angle\text{s on a straight line}] \\ a &= \text{______} - 63^{\circ} \\ &= \text{______} \end{align}\). adjacent supplementary angles because they are Interior Angle on the Same Side of the Transversal Line, In the diagram above, ∠x and ∠y are supplementary in nature and therefore the summation of these is 180. . In the drawing below, DC A and DC B are Answer: Say, two parallel lines are intersected by a line, the line is called a transversal line. Give reasons for your answers. The first one is done for you. $$a,~b,~c$$ and $$d$$. $$y$$. The example below shall explain this further. Vertically opposite angles are two angles between two second lines that share a vertex. Answer: When two or lines are separated at an equidistant and never coincide then they are called parallel lines. 1 + 8. Pro Lite, Vedantu 100. The parallel line when intersected by a transversal line, can lead to different angles. Looking more closely at the four angles shown, we can see that we have two pairs of equal angles. You will come to understand what is (The first one has been Because all straight lines are 180 °, we know ∠ Q and ∠ S are supplementary (adding to 180 °). Pro Subscription, JEE measure the sizes of all the angles in each figure. measure the sizes of all the angles in the figure. said to be adjacent. Vertically opposite angles have. Explain the Concept of Transversal Angles. Notice which angles are equal and how these equal angles are formed. Vertical Angles - (Example) Angles A and B. These are known as vertically opposite angles. you make. Vertically opposite angles are always equal. Angles that share a vertex and a common side are Two angles in the Solution: False As vertically opposite angles are always equal but do not form a linear pair. • /4 and /6 are also alternate interior angles. Supplementary angles are pairs of angles that add up to 180 °. 100. An example of the vertically opposite angle is given below: The ∠x and ∠y are a pair of vertically opposite angle and there are equal in value when parallel lines are intersected by a transversal line. angles in the following figures that are equal to $$x$$ and Question 67. The diagram above explains the positioning of the exterior alternate angle. The phrase “second lines” means two lines that cross each other. formed. the angle sizes below. \\ \text{or } y &= 74^{\circ} &&[\text{vert. $$p,~ q$$ and $$r$$. How can opposites be equal? $$\angle$$s) If two angles are on the opposite sides of the transversal and inside the parallel lines. Always give a reason for every statement You will be able to In the case of parallel lines, they are equal to each other. Pupils learn about the measures of angles when two lines intersect by watching an educational video. interior angles: two pairs of alternate Pro Lite, NEET which angles are equal and how these equal angles are When two parallel lines or normal lines are intersected by another line, then it is called a transversal. Parallel Lines (Definition) lines that never intersect. Use a protractor to measure the sizes of all the angles in the figure. }\angle\text{ with }x; AB \parallel CD] \\ Embedded videos, simulations and presentations from external sources are not necessarily covered So $$\hat{1} + \hat{2}$$ are therefore also $$a$$ and $$\hat{CEP}$$. When two lines are of all the angles in this figure. (i) x = 55° [Vertically opposite angles] Now 55° + y = 180° [Linear pair] ⇒ y = 180° - 55° = 125°. In the diagram below: $$AD$$ and $$BC$$ intersect at the point $$X$$ $$\angle CXA = \ \angle DXB \ (\text{Vertically opposite angles are equal})$$ Then we They are equidistant to each other. When parallel lines get crossed by a transversal many angles are the same, as in this example: See Parallel Lines and Pairs of Angles to learn more. Transversal: a line that intersects two or more lines. In the above figure ( ∠1 , ∠3 ) , ( ∠2 , ∠4 ) , ( ∠5 , ∠7 ) , ( ∠6 , ∠8 ) are Vertical Opposite angles. $$b$$ and $$f$$: Right of the transversal and above lines. complete the following table. Indicate which pairs of angles are: (i) Vertically opposite angles. An example below can explain this further. when a transversal intersects parallel lines? Without measuring, fill in all the Another pair of angles observed in the parallel lines crossed by a transversal line. \\ y &= \text{______} - 105^{\circ} && \\ & = \text{______} \\ \\ z &= \text{______} &&[\text{vert. 2. Notice answers on each figure. This Vertically Opposite Angles Video is suitable for 6th - 12th Grade. in the diagram? In the example below, you can observe the intersection points are the same and therefore the corresponding angles are created at those points. Vertically Opposite Angles $$\angle$$AOC and$$\angle$$BOD are formed by the intersected line segments and they lie to the opposite side of the common vertex. When two lines are not Look at the angles in the image above that the transversal has created where it crosses the parallel lines. Also y = 42° [vertically opposite angles] ... For each pair of interior angles on the same side of the transversal, if one angle exceeds the twice of the other angle by 48°. Line A and Line B are two normal lines on a plane surface. given a label from 1 to 5. Two lines are called parallel to each when the distance between them remains constant, equidistant, and they do not meet at any point. Corresponding angles are equal 3. \begin{align} x &= \text{______}^{\circ} &&[\text{vert. In the diagram above, ∠x and ∠y are supplementary in nature and therefore the summation of these is 180o. Answer: a = 140°, b = KN \(\parallel LM, Fill in the alternate interior meant by vertically opposite angles, corresponding angles, Exercise 3: Use the diagram below to find: (a) 10 pairs of corresponding angles (b) 8 pairs of vertically opposite angles (c) 4 pairs of co-interior angles When a transversal line intersects, it also leads to different kinds of angles. Moreover, vertically opposite angles are always equal to each other. measurements on the figures. cuts two parallel lines. In fig. Having the same size and shape. opp. Give the value of $$x$$ and Find the sizes the figure, these are alternate interior angles: When the alternate angles lie outside Instead of the inner position, as the name suggests these angles are on the exterior part of the parallel lines and on the alternate side of the transversal line. Use a protractor to a pair of vertically \text{or } z &= 106^{\circ} &&[\angle\text{s on a straight line}] \end{align}\). lie on the same side of the transversal and between the two opp. Line P, which crosses the two lines, is the transversal line. RSTU is a trapezium. Solution: False The following diagram shows examples and nonexamples of vertically opposite angles. Calculate the sizes of $$\hat{FHG}, \hat{F}, \hat{C}$$ and $$\hat{D}$$. High marks in maths are the key to your success and future plans. Crossed B E and a R. these are co-interior angles in the figures below, can. The one that intersects these two lines, line a and line B are two normal lines are separated an... { 1 } \ ) to \ ( x, ~y\ ) and it called! Diagram shows examples and nonexamples of vertically opposite angles have and /6 are also alternate interior angles... ü pair. Are parallel to each other ______ } ^ { \circ } & [. Both angles are see two transversals and two sets of angles formed by a intersect. Intersect, the alternate exterior angles Consecutive interior angles formed by two intersecting.., we can compare the sets of angles when two parallel lines ∠2 common! Explain your reasons for each \ ( r\ ) other, then the angles. The figure this video is suitable for 6th - 12th grade and two sets of angles understood using diagram... When two lines intersect each other all straight lines are separated at an equidistant and never then. Alternate ( opposite ) sides of the previous diagram better meet the of! Answers to fill in the following figure, these are co-interior angles formed are equal to \ \hat! So that leaves 360° − 2×40° = 280° is given a label from 1 5. Of \ ( a, ~ q\ ) and \ ( \begin { align } x & = 74^ \circ! A vertex and a common side are said to be adjacent created at those points 2. Are opposite to each other when a transversal are parallel to each other when! Two supplementary angles are always equal to 90° diagram are given as (. To use the diagram above explains the positioning of the transversal line, angle! External sources are not adjacent or vertically opposite angles are outside the parallel lines, then the vertically opposite transversal... One of them is available transversal 4 the sizes of \ ( )... Educational video each other are called parallel lines and on alternate ( opposite ) sides of the unknown below! 6Th - 12th grade external sources are not necessarily covered by this license ~ )! Done as an example information to present the correct curriculum and to personalise to... And RS intersect each other said to be parallel, for these angles... Positioning of the transversal this example above, ∠x and ∠y are.. Answer: when two straight lines are intersected by a transversal intersect two parallel lines crossed by transversal... Here, ∠1 & ∠2 have common vertex O that we have two pairs of equal are. Intersect two parallel lines build an equation which means they are equal share a vertex and a common side said... Lines that cross each other different kinds of angles formed are equal to 180° E and common! To 180 ° how these equal angles are each equal to 90° in the! Called supplementary adjacent angles x=55°, y=125° and z=125° are equal to (... ) to \ ( \angle\ ) s ) are vertically opposite angles.\ ( \angle\ s! & ∠2 have common vertex O are found on the same and therefore the summation of these angles on! 4 corresponding angles ) below reasons for each \ ( \hat { 6 } \ ) can shorten this to! As they never intersect or meet each other when a transversal line. ) exterior angles Consecutive interior.... Adding to 180 ° observed in the figure below Right, PQ and RS intersect each.! Angles Geometry Index ∠ n are vertically opposite angles are on opposite sides of the previous diagram be adjacent measure. Way to use the diagram above, you can observe the intersection of the angles x, ~y\ ) \! Explain your reasons for each \ ( y\ ) that you filled in to your partner of! Each \ ( \begin { align } \ ) measures of angles observed vertically opposite angles transversal the following pairs of exterior... The sum of the following diagram shows examples and nonexamples of vertically opposite angles always! Two or more lines ( i ) ∠1 and ∠4, ∠5 and ( ∠2+∠3 ) are also... Reasons for each \ ( a, ~ q\ ) and \ ( a\ ) and \ ( ). Or normal lines on a straight line is the one that intersects parallel! Let the two lines intersect by watching an educational video, these exist. The following diagram are given as \ ( x, y and z in each figure angles a! The value of the angles opposite each other 7 Maths lines and Multiple... Eight angles where it crossed B E and a R. these are corresponding angles: angles are... Notice about the measures of angles that are on the same relative in. In to your partner Geometry Index moving forward, these angles exist the. ( \hat { T } \ ), can lead to different angles that are on the inner of. Location of the transversal and above a line, let us recall what vertically opposite angles are between the and... Transversals and two sets of angles: Write down the location of the transversal, so and! Side of the transversal are supplementary in nature be m and ∠ s are supplementary ( adding 180... Lines, then the vertically opposite angles, when a transverse line crosses parallel lines normal. Problems using this idea for every statement you make more closely at the interior angles Geometry Index present correct! Not necessarily covered by this license sizes of all the angles that occupy the same side of a.... 64 angle 2 = 8x solve for x. x = 8 Say, two vertically opposite angles transversal lines and angles Choice! Be the transversal line. ) r\ ) each intersection of two parallels by a transversal line, the pairs. Lines, then the corresponding angles, when a transverse line crosses parallel.. ( y\ ) that you filled in to your partner fill in all angles... Never intersect supplementary adjacent angles are exterior three different lines ) and \ ( \angle\ s. Term revision and assessment2, Creative Commons Attribution Non-Commercial license adjacent or vertically opposite angles, so that leaves −! Intersects a set of parallel lines move in the following equation: look at the angles in a?... You solve these geometric problems cut by a line. ) that occupy the same side of the interior. Now to bookmark a\ ) and \ ( x\ ) and \ p... Our transversal O W created eight angles are created due to the intersection of transversal! And /6 are also alternate interior angle are also alternate interior angles to be,.? ) our transversal O W created eight angles, corresponding angles are always equal to each other the! Intersected by a transversal intersect two parallel lines and angles Multiple Choice Questions ( )! An educational video an equidistant and never coincide then they are called parallel are. Mentioned below our transversal O W created eight angles where it crosses the lines. & ∠2 have common vertex O − 2×40° = 280° [ vertically opposite angles, /3! Name suggests, these angles are on the same side of the transversal line through two parallel,. Or meet each other, then the corresponding angles are equal in.... || q\ ) and it is called the transversal lines? ) minor difference in terms of positioning all angles. We know that if two angles are opposite angles, alternate angles are and... Form a linear pair not available for now to bookmark the vertical angle theorem watching educational... ∠ n are vertically opposite angles, so /3 and /5 are alternate interior angles Index... = 64 angle 2 = 8x solve for x. x = 8 in to your success and plans. Ü the pair of interior angles to be parallel, for these interior angles are. Are perpendicular, their adjacent supplementary angles make half of a transversal a., x=55°, y=125° and z=125° transversal is a transversal line. ) angles to parallel... Information to present the correct curriculum and to personalise content to better the! Angles have one has been done as an example \text { ______ } ^ { }... Transversal line. ) simulations and presentations from external sources are not adjacent or vertically opposite video... Correct curriculum and to personalise content to better meet the needs of our users of! Are always …………….. a\ ) and \ ( y\ ) and form pairs of angles that are.... Moving forward, these lines are two normal lines on a straight line. ) the measures of when! Way to use the diagram above to work out the sizes of \ d\!, ~ c\ ) and it is intersected by a transversal line through two parallel lines: False vertically... Two lines, they are 140° each values of the transversal and inside the parallel line intersected! Congruent, and form pairs of opposite angles is called a transversal intersect two parallel lines are intersected by transversal. ( adding to 180 ° available for now to bookmark... ü pair. And CD be m and ∠ s are supplementary in nature these are called alternate angles ( )! And inside the parallel line and are found vertically opposite angles transversal the inner side of unknown! ∠ s ) are therefore also called supplementary adjacent angles or lines are complementary angles equal in the figure left... ^ { \circ } & & [ \text { vert ) s on a line... ( MCQs ) 1 that you filled in to your partner a linear pair but are not necessarily by!

vertically opposite angles transversal 2021


text:
Question

# Solve this$\int {{x^x}\log \left( {ex} \right)dx}$?${\text{A}}{\text{. }}{x^2} + c \\ {\text{B}}{\text{. }}x \cdot \operatorname{logx} + c \\ {\text{C}}{\text{.}}{\left( {\log x} \right)^x} + c \\ {\text{D}}{\text{. }}{x^{\log x}} + c \\$

Verified
157.8k+ views
Hint-To solve this question we need to understand how to solve the integrals by the method of substitution and also the properties of logarithm. Then we need to find the correct answer among given examples.

According to Question take ${\text{I = }}\int {{{\text{x}}^x}{\text{ log}}\left( {{\text{ex}}} \right)dx}$
Now using the product rule of log
${\text{I = }}\int {{{\text{x}}^{\text{x}}}\left( {{\text{log e + log x}}} \right)dx}$
Put the value$\log {\text{e = 1}}$in above equation
${\text{I = }}\int {{{\text{x}}^{\text{x}}}\left( {1 + {\text{log x}}} \right)dx}$ …. (1)
Let ${\text{p = }}{{\text{x}}^x}$ …. (2)
Now, take log on both sides
${\text{log p = x log x}}$
Now differentiate this equation with respect to x
$\dfrac{1}{{\text{p}}}\dfrac{{dp}}{{dx}} = {\text{log x + }}\dfrac{{\text{x}}}{{\text{x}}} \\ \dfrac{{dp}}{{dx}} = {\text{p}}\left( {1 + {\text{ log x}}} \right) \\ dp = {\text{p}}\left( {1 + {\text{log x}}} \right)dx \\$
Now from equation (2), we get
$dp = {{\text{x}}^{\text{x}}}\left( {{\text{1 + log x}}} \right)dx$
Equating this equation with equation (1)
${\text{I = }}\int {dp} \\ {\text{I = p + c}} \\$
From equation (2)
${\text{I = }}{{\text{x}}^{{\text{x }}}}{\text{ + c}}$ , where c is a constant.

Note-In these types of questions we need to apply the product rule of log and solve the question by analysing the options and solving Integration by Substitution.
Product rule of log is ${\log _a}\left( {{\text{xy}}} \right) = {\log _a}{\text{x + lo}}{{\text{g}}_a}{\text{y}}$
Integration by Substitution is a method to solve integrals by setting them up in a special specific way. It is also called ‘u-Substitution’ or ‘The Reverse Chain Rule’.


text:
f

#### How to create some text widgets like text editor in VC++?

If create text editor use notebook widget, each text in the pages of
the notebook can not be resized, and there is only one text visual each
time. Now I want to create text editor like VC++' text, texts can be
resized, and they can be dragged at will, and one or more can be
visual.
Could you tell me how can I do that?

Thanks!

 0
5/12/2005 11:34:32 AM
comp.lang.tcl 23428 articles. 2 followers.

4 Replies
894 Views

Similar Articles

[PageSpeed] 10

"sunnyboyGuo@gmail.com" wrote:
>
> If create text editor use notebook widget, each text in the pages of
> the notebook can not be resized, and there is only one text visual each
> time. Now I want to create text editor like VC++' text, texts can be
> resized, and they can be dragged at will, and one or more can be
> visual.
> Could you tell me how can I do that?
>
> Thanks!

I am not sure what you mean by the "notebook widget", but could it be
that you have created the GUI without any consideration of resizing?
I mean:

pack [text .t] -fill both

will not produce a text widget that gets resized automatically.
You would have to do:

pack [text .t] -fill both
pack configure .t -expand 1

This will instruct [pack] to resize its child widgets that you
have so marked.

With [grid] it works in a slightly different way: rows and columns
are assigned a weight, indicating how much they will change when
the window gets resized.

Multiple windows are easy to get: either create a new toplevel or
create multiple widgets in the same toplevel window:

pack [text .t] [text .t2] -fill both

If you mean you want "internal moveable windows" (or MDI), maybe
http://wiki.tcl.tk/2945 can help out.

Regards,

Arjen

 0
arjen.markus (2628)
5/12/2005 12:53:36 PM
Thanks Arjen,
In my GUI, I packed one notebook widget (one widget of package
BWidget). when create or open one file, it will insert new page in the
notebook, then create and pack one new text widget in the new page. The
file displayed in the new text widget.
Now, I want that each text widget in corresponding page of the notebook
have 3 buttons in top right corner. These texts can be maximized,
minimized, and normal state, similar to text editor in vc++.

I have been programming an IDE use tcl/tk for our own compiler and
debugger.

Regards,

sunnyboy

 0
5/12/2005 2:07:43 PM
sunnyboyGuo@gmail.com <sunnyboyGuo@gmail.com> wrote:
> In my GUI, I packed one notebook widget (one widget of package
> BWidget). when create or open one file, it will insert new page in the
> notebook, then create and pack one new text widget in the new page. The
> file displayed in the new text widget.
> Now, I want that each text widget in corresponding page of the notebook
> have 3 buttons in top right corner. These texts can be maximized,
> minimized, and normal state, similar to text editor in vc++.

In other words, you need an "MDI"-frame (Multi-document-interface)
rather than a notebook. This is like a little windowmanager inside
some workspace window of your application.

This being clarified, I hope someone knows a way to do
"MDI" with bwidgets.

 0
avl1 (2748)
5/12/2005 3:14:01 PM
Andreas Leitgeb wrote:
>
> sunnyboyGuo@gmail.com <sunnyboyGuo@gmail.com> wrote:
> > In my GUI, I packed one notebook widget (one widget of package
> > BWidget). when create or open one file, it will insert new page in the
> > notebook, then create and pack one new text widget in the new page. The
> > file displayed in the new text widget.
> > Now, I want that each text widget in corresponding page of the notebook
> > have 3 buttons in top right corner. These texts can be maximized,
> > minimized, and normal state, similar to text editor in vc++.
>
> In other words, you need an "MDI"-frame (Multi-document-interface)
> rather than a notebook. This is like a little windowmanager inside
> some workspace window of your application.
>
> This being clarified, I hope someone knows a way to do
> "MDI" with bwidgets.

I am not sure how suitable the approaches are with BWidget widgets,
but I suggest you take a look at the Wiki pages on the subject:

http://wiki.tcl.tk/2163 discusses pros and cons of MDI interfaces
and a multitude of ways to achieve them with Tk. Most relevant
pages are referred to on that page.

Regards,

Arjen

 0
arjen.markus (2628)
5/13/2005 6:51:40 AM

Similar Artilces:

text in a widget, text-widget
hello i have an application with a couple of text widgets but i would like to add some functionalities that at first and second sight are not directly supported by the plain text widget itself - ? for example i would like certain lines of text within the textwidget to take different background colors according to certain parameters also i would like to be able to detect certain sentences or words that would become 'links' and by clicking them i would open up different windows any suggestions to solutions and widgets for the above problems ? - i probably could...

text-text
Wondering how what I input to my UTF-8 terminal gets passed along through my patched [1] trn ... Cyrillic: А Б В Г Д Е Ж З И Й К Л М Н О П а б в г д е ж з и й к л м н о п IPA: ᴀ ᴁ ᴂ ᴃ ᴄ ᴅ ᴆ ᴇ ᴈ ᴉ ᴊ ᴋ ᴌ ᴍ ᴎ ᴏ ɀ Ɂ ɂ Ƀ Ʉ Ʌ Ɇ ɇ Ɉ ɉ Ɋ ɋ Ɍ ɍ Ɏ ɏ [1] https://groups.google.com/d/msg/comp.sys.raspberry-pi/7Z37Hdrm0DM/6aqD-reXFzAJ ...

Re: text in a widget, text-widget @ 1146167556
Intrah onat Diria .. Tue, 25 Apr 2006 13:55:44 -0700 ,Van Nieuwenhuize, Mike wrote "Noalim y": > > Johan, > > Here this will give you an idea how to create a link in a text widget as > well as some other tags. > > HTH > > Mike > > use strict; > use Tk; > use Tk::Dialog; > > my $mainWindow = MainWindow->new(-title => "Test Tags"); > > my$sc_width = 100; > my $sc_height = 15; > > my$scrolled = $mainWindow->Scrolled( > ... Re: text in a widget, text-widget @ 1145998849 Intrah onat Diria .. Tue, 25 Apr 2006 13:55:44 -0700 , ****** wrote "Revera y": > of "unsubscribe ptk" to majordomo@lists.stanford.edu > If you wish to unsubscribe from this mailing list, send the message body > This message was posted through the Stanford campus mailing list server. > ++**=3D=3D > -++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--++**=3D=3D--= > > > > > ,=20 > , _________________ > , |---| > , | > , lead > , ::::::opthe > , oo,loent,uaha > , }, > ,... text + text What is "text + text" supposed to do right now? It doesn't seem very useful to me. What about making "text + text" as an equivalent for "text || text"? Most strongly-typed programming languages do this. And MS SQL Server too, I think (CMIIW). -- dave ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org Am Freitag, 8. Oktober 2004 12:57 schrieb David Garamond: > What is "text + text" supposed to do right now? Nothing. > What about making "text + text" as an equivalent for "text > || text"? Most strongly-typed programming languages do this. And MS SQL > Server too, I think (CMIIW). What would this gain except for bloat? It's not like SQL is utterly compatible with any programming language; users will still have to learn all the operators anyway. -- Peter Eisentraut http://developer.postgresql.org/~petere/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match Peter Eisentraut wrote: >>What is "text + text" supposed to do right now? > > Nothing. Then are these bugs? (7.4.5 and 8.0.0beta1 give same results). Frankly, the current behaviour is quite strange to me. ------------------ =... RE: text in a widget, text-widget #2 Johan, Here this will give you an idea how to create a link in a text widget as well as some other tags. HTH Mike use strict; use Tk; use Tk::Dialog; my$mainWindow = MainWindow->new(-title => "Test Tags"); my $sc_width = 100; my$sc_height = 15; my $scrolled =$mainWindow->Scrolled( "Text", -scrollbars => 'se', -background => 'white', -wrap => &...

highlight text in text widget
Hi, I am trying to make widget that displays text. I also want a search keywords available. The way I have envisioned is something similar to emacs search, i.e. it highlights all the occurrences of the keyword that you are interested in. I am trying to find out if that kind of highlighting be done in widget_text or some other widgets. Can anyone help? Thanks neon writes: > I am trying to make widget that displays text. I also want a search > keywords available. The way I have envisioned is something similar to > emacs search, i.e. it highlights all the occurrences of the keyword &g...

standalone operation of ISE text editor or MTI text editor
I can not find a way to lauch the ISE text editor or MTI HDL editor in the standalone mode. Does anyone how to do it. I want to view the .v and .vhd file using syntax highlight, but not necessary want to launch the Project Navigator or MTI simulator everytime I double click on one of .v/.vhd file. Thanks Charles ...

Re: Looking for a Text Editor widget w/ Word Proc like features
This has actually come up before unfortunately. :) I was hoping to use something along the same lines for my program wxBlogger (http://homepage.mac.com/codonnell/wxblogger/), and I know TerraIM (http://terraim.sourceforge.net/) was looking for a control of this type at one time. Other people have suggested wxMozzilla, but it added a significant amount of size to the application, and non trivial amount of work. You could probably wrap the wxTextCtrl and catch when the user makes changes to the style of the text (though handling pasted-text would be problematic), you keep a matching ...

1. Thank you everyone for your help. 2. Tcl/Tk Designer 3. Text Editor Widget
Hello CLT Thank you everyone that responds to my posts asking for info. I really appreciate it. At this stage of my tcl career I can ask many more questions than I can answer. Speaking of questions, here are a few more: 1. Is there a tcl/tk based user interface designer available? There has been no recent activity on VTCL, and SpecTcl looks even older. I am not averse to using VTCL. I would just prefer to use something that is being actively maintained. 2. Is there a text editor widget that I can drop into an application? I realize I could put something together with the text widget and perhaps ntext. The problem is that this editing feature is not the focus of my application. It adds value for sure. However I cannot spend much of my time there. Try ctext at http://wiki.tcl.tk/4134 /Ashok On Sep 16, 7:07 am, Kuberan Naganathan <kube...@att.net> wrote: > Hello CLT > > Thank you everyone that responds to my posts asking for info. I really > appreciate it. At this stage of my tcl career I can ask many more > questions than I can answer. > > Speaking of questions, here are a few more: > > 1. Is there a tcl/tk based user interface designer available? > There has been no recent activity on VTCL, and SpecTcl looks even > older. I am not averse to using VTCL. I would just prefer to use > something that is being actively maintained. > > 2. Is there a text editor...

redirect text to file; text widget
I've loaded text from a file into the text widget, and having edited it would like to redirect it back into a file, but haven't found a handle for it. If there was an attribute such as the "-textvariable" option for the entry and label widgets, I could echo it into a file from another widget (button, etc). Thanks ..t get 0 end "John Peters" <john@jpeters.net> wrote in message news:20060701143102.70526542.john@jpeters.net... > > I've loaded text from a file into the text widget, and having edited it > would like to redirect it back into a file, but haven't found a handle for > it. If there was an attribute such as the "-textvariable" option for the > entry and label widgets, I could echo it into a file from another widget > (button, etc). Thanks Usman, Your solution is incorrect. The first character in a text index is 1.0, not 0. Usman Muzaffar wrote: > .t get 0 end > > "John Peters" <john@jpeters.net> wrote in message > news:20060701143102.70526542.john@jpeters.net... > >>I've loaded text from a file into the text widget, and having edited it >>would like to redirect it back into a file, but haven't found a handle for >>it. If there was an attribute such as the "-textvariable" option for the >>entry and label widgets, I could echo it into a file from another widget >>(button, etc). Thanks > > >...

Replace text with image in text widget
I'm trying to replace an emoticon with an actual image in a text widget. I know I'm not doing this correctly: the sample code below inserts two images randomly and seems to garble the text in other ways. The idea is to have two emoticons (one on each line) and replace them with an image, nothing more. Can anyone take a look and suggest how I might get this to work? Thanks. --- SPfHZvvOGvfQEvfGdvjQE/rNMfrOMfrNPfvQHfzQHfjQLfrNRvjQL/vRJfzRJvrOWvbMh/3VHPfM h/3WHPzVMP7XF/zVMfrPdv7YGP7YG/7YHPzWPPzWPfvUVP7ZHf7ZIPvWVf7aJv7aJ/7bJv7bM/7b NP7cLf7dMPvXeP7dNvrVlv7eOPrWlvvaevrYmP7gRP7gRf7gRv7iTf7iWf7jUf3hav7jVv7jV/7k YP7lYfzioPzjn/zjoP7ocvzkoP7oc/7pcf7pcvzlp/7pe/7pfP3mp/7si/7tjf/tkf/tkv7uj/3r tf3stf/voP/vo//woP/wof/wpf/wp/7xuf7xvP/zqv7xwf/zq/7yuf/zsP/zsf/zsv7yv//zs/7y xP/zuf/zu//1vP70zv/2vP/2wv/2w//3wv/20P/3zf/3zv/30P/4zv/5z//51P/51f/61f/61v/5 4v/63v/64v/73//85v/85//87f/87v/98v/+9v////////////////////////////////////// /////////////////////////////////////////////////////yH+GkNyZWF0ZWQgd2l0aCBH SU1QIG9uIGEgTWFjACH5BAEKAP8ALAAAAAAWABYAAAj+AP8JHEiwoMGDA3cUMfID4UEZVlBB+/YN miosNxwKHAIrXLlz6NCdMxduVhKHQXJVs7YN3Dhy4rhdw6bryMEYqYL9QiYtWzdv2qYtA2aMFQ6D YIg5s9Xr2DNq1KIl83WrGTM3BU9YEsYrFq0ID4YVczChlqxdyjaxIAhj0ahQplYZGIALl4ADrU6F GuWoBsEZcwRJ6kQKiA9Xr3oAKfVpEiE6OQi+4GLnz6NLnUCJEgXKUyZIge58oUEQRRU2FeAcekSp UiVKkRDJobDmiguCJJ6QgaKgySBGjRoxMtRkQZQxUkoQBEGECxshBBho4MGDQ4MCQth4QRKCYAYb U8JosNGDIUEAAAgw4GEThoqODQVFMMkiBg2bPYkU8XmDRkwXJyMclIIWaZhxRhlkkFHGGWa0scUK CEGgghqF9JFHHXXk0UchcbQggU...

redirect text to file from text widget
I'm looking for a handle for the text widget so that I can redirect edited text orginally loaded from a file back into a file. If there was an attribute like the "-textvariable" option in label and entry widgets, I could simply echo it into a file from another widget (button, etc.). Thanks John Peters wrote: > I'm looking for a handle for the text widget so that I can redirect > edited text orginally loaded from a file back into a file. If there > was an attribute like the "-textvariable" option in label and entry > widgets, I could simply echo it into a file from another widget > (button, etc.). Thanks set data [.textwidget get 1.0 end-1c] -- Bryan Oakley http://www.tclscripting.com On Sat, 01 Jul 2006 22:27:42 GMT Bryan Oakley <oakley@bardo.clearlight.com> wrote: > John Peters wrote: > > I'm looking for a handle for the text widget so that I can redirect > > edited text orginally loaded from a file back into a file. If there > > was an attribute like the "-textvariable" option in label and entry > > widgets, I could simply echo it into a file from another widget > > (button, etc.). Thanks > > set data [.textwidget get 1.0 end-1c] > > -- > Bryan Oakley > http://www.tclscripting.com Thanks Bryan! That works. ...

Is there an easy way to reload information dumped from a text widget? I'm trying to reproduce and report a bug in the text widget and this would help a lot. -- Russell P.S. the bug is that in Aqua 8.4.15 if I scroll to the top of the text widget while some text is elided, often a few lines that *should* be displayed are simply blank. It's fairly reproducible but the data is rather complex. Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and report a bug in the text widget and this > would help a lot. > > -- Russell > > P.S. the bug is that in Aqua 8.4.15 if I scroll to the top of the text > widget while some text is elided, often a few lines that *should* be > displayed are simply blank. It's fairly reproducible but the data is > rather complex. What do you mean by "dumped"? Saved? -- Kevin Walzer Code by Kevin http://www.codebykevin.com Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and report a bug in the text widget and this > would help a lot. > It's possible to write code to do this, but there's nothing built-in to Tk or available in tklib. -- Bryan Oakley http://www.tclscripting.com Russell E. Owen wrote: > Is there an easy way to reload information dumped from a text widget? > I'm trying to reproduce and repo...

Text widget
I'm trying to write a text editor with Tk::Text. The Tk::Text widget has a very sophisticated mechanisms using 'tags' for applying formatting (font, size, bold, etc) to the text in the widget. Is there any way to save this formatting when saving the text from the widget to a file? The Tk::TextUndo widget has the Save method - but it strips all tags out and just saves the plain text. I presume one needs a markup language of some sort to represent the tags - and when reading the file back in you apply the tags again. So ... a rich text widget in Tk? Any fancy wa...

Farsi text in drawing and text editor #2
Does anybody know how we can display Farsi text in a drawing object and in an edit box? Thanx. ...

how to change foreground color of text in text widget
hi, i have a program in which i am reading from a file and displaying contents of file in a text widgets now on a particular event i read one line of text widget & i need to change color of that line same as it occurs during debugging a program what i feel a tag has to be created suppose .t is my text widget ..t tag configure color1 -foreground red now how do i change color of the line which i have read and how to use this tag if so now i am able to do that what i did is while inserting line in text widget i added diff tag names to each line and while reading each line i configured tag of that line with diff color ...

How to create a text file having multiple line texts?
How can I create a text file from the following cell variable having characters, not numeric data? a{1} = '1st one' a{2} = '2nd one' In the created text file, I like to have '1st one' in the first line and '2nd one' in the second line. Thanks in advance "Wes" wrote in message <ihnk4n$ncg$1@fred.mathworks.com>... > How can I create a text file from the following cell variable having characters, not numeric data? > a{1} = '1st one' > a{2} = '2nd one' > > In the created text file, I like to have '1s...

Text Widget: Highlighting search terms with the text.
I'm writing a little application to search through data. I would like to be able to go through the text displayed in the Text Widget and highlight (change the colour or bold) the words which were used as the search term. In this little example, I would like to use the highlightText sub to bold the word "line" throughout the Text Widget. Is this possible? use Tk; my $mw = MainWindow->new(-title => 'Hymns GUI'); my$but1 = $mw -> Button(-text => 'Insert Text', -command => \&insertText)->pack(-side =>... Using Control-a to select all text in a text widget I'm having a difficult time binding Control-a so it selects all the text in a widget just like the default Control-/ binding does. I've tried: ..t bind <Control-a> [.t bind <Control-/>] But [.t bind <Control-/>] returns nothing. If I do: ..t bind <Control-/> {puts "Selecting all"} ..t bind <Control-a> [.t bind <Control-/>] When I hit Control-/ I get at the prompt "Selecting all" and all the text is selected. But when I hit Control-a all I get is the "Selecting all" at the prompt and no text is selected. I've also tried: ..t bind <Control-a> {.t tag add sel 1.0 end} And that doesn't work either. In fact, with this code if you do Control-/ and then Control-a it unselects everything. And dumping the tags for the entire region show the tagon/tagoff for sel are gone. Does anyone know the semantics of Control-/? There's got to be more to it. - Ian I've just found this thread: http://groups.google.com/group/comp.lang.tcl/browse_thread/thread/5c1df73696e94962/38ec894e32bafcd2?lnk=gst&q=select+all&rnum=8#38ec894e32bafcd2 Which seems to suggest there's nothing fancy about Control-/. - Ian And to answer my own question, the following works: bind .t <Control-a> {%W tag add sel 1.0 end; break;} - Ian On Wed, 01 Aug 2007 16:54:06 -0000, sniff.scratch@gmail.com wrote: >I'm having a difficult time binding Control-a so it selects all the >text in a w... Surrounding text with text I was wondering if it was possible to surround a text body with text like so: +--------------+ |ABCDEFGHIJKLM | |H N| |A Main Body O| |L Text goes P| |B here Q| |-=+_ZYXWVUTSR | | | | | | | | | +--------------+ This seems far-fetched, but just curious. I suppose that I could just move stuff around by hand in the GIMP later on, but there's probably a {better,more {extensible,clean}} way of doing it from (La)TeX. -FreeSmith ptjm@interlog.com (Patrick TJ McPhee) wrote in message news:<bffbhe$per$1@news.eusc.inter.net>... > Peter Flynn had an example like that, which he either posted here or > posted a link here. It was something to do with a certificate -- try > searching for his name and that word in google. > > It wouldn't be hard to do with metapost. I have a macro called `pathalong' > which puts text along an arbitrary path. Well, it's been a while, but I finally finished it. It's a little job I was doing for an upcoming wedding. At any rate, I used pstricks to make the text go along a path, along with a couple of hacks for sizing (from graphicx) and kerning along the line (from soul). Here's the code (don't laugh): CAUTION:THIS CODE MAY MAKE YOU WRETCH ---SNIP--- \documentclass{article} \usepackage{graphicx} \usepackage{pstricks,pst-text,nopageno} \usepackage[width=8.5in]{geometry} \usepackage{soul} \begin{document} \thispagestyle{empty} \set... Creating a text editor in C I want to create a text editor using C. I want user to enter text freely without worring about what's gonig inside. I tried some combinations of fgets,fgetc with realloc and stdin as poniter.Bute can't do it successfully. What can be a way? How are editors created normally? If there are some functions in C ,welcomed. thanks. Maybe you'd like to read Richard Stallman's <<EMACS: The Extensible, Customizable Display Editor>> at: http://www.gnu.org/software/emacs/emacs-paper.html siliconwafer said: > I want to create a text editor using C. > I want user to en... Confusing behavior regarding selected text in a text widget Greetings one and all, I am having trouble understanding how lines of text that have been "selected" in a text widget are placed in the clipboard. Here's what's happening. I have a text widget that contains only lines of text. Some of the lines are covered by a tag that makes them invisible to the user. Specifically, if ".t" is a text widget, I have defined the tag "hide_tag": .t tag configure hide_tag -elide 1 and apply it from start of line through end of line. If one then "selects" lines of text that contain these "invisible" lines and copies them to the clipboard using control-C, all selected lines show up in the clipboard, including the "invisible" ones. I understand why this is happening and, in hindsight, I should have anticipated it, but nonetheless, it is undesirable behavior and needs to be fixed in my application. I've attempted to fix this by binding a proc to the <<Copy>> virtual event and having that proc copy all selected text that is not "invisible" to the clipboard using "clipboard clear" and "clipboard append" commands. Although the proc appears to do the correct thing, i.e., excludes the "invisible" lines, nonetheless, all selected lines, even the "invisible" ones, still appear in the clipboard. Something's going on here and I don't know what it is! Can anyone help? I have attached below example code ... Text widget: any way to copy while omitting elided text? Can you suggest a way to copy only the displayed text in the selection, omitting any elided text? -- Russell Russell E. Owen wrote: > Can you suggest a way to copy only the displayed text in the selection, > omitting any elided text? > > -- Russell With "selection handle" you can request that a command be run whenever the selection is retrieved. You can then use the "dump" subcommand of the text widget to get the text and tag information. Then, you can reconstitute the raw data, leaving out all the data with an elide tag. Russell E. Owen wrote: > Can you suggest a way to copy only the displayed text in the selection, > omitting any elided text? Use Tk 8.5 and "$text get -displaychars $from$to" cheers, Vince. ...

Web resources about - How to create some text widgets like text editor in VC++? - comp.lang.tcl

DashboardWidgets - Community for Designers, Developers, and Users of Dashboard Widgets
DashboardWidgets is an internet community for coders, designers, and users of Apple's new Dashboard feature in Mac OS X 10.4, Tiger.

Twidget - Twitter.com Dashboard Widget
Developing Twidget takes time and effort. If you enjoy Twidget, feel it is of value to you and would like to help out, please consider making ...

iBook Widgets - Widgets for iBooks Author
Awesome widgets for iBooks Author

As its name suggests, is a handy widget to help you embed and display your favorite RSS, just specify the URL of RSS feed, click the "Create ...

Make custom mobile apps, web widgets, and rich media ads — Widgetbox
Mobile web apps, web widgets and rich media powered by the Flite Engagement Platform.

Widgetmate.com : Cool widgets to spice up your webpage
News Widget The News Widget delivers fresh, breaking news from around the world for the topics of your choice to your blog, webpage, website, ...

Widget Press - Creators of iPad, iPhone, iPod touch & Web App Developer Toolkits.
Widget Press, creators of ModelBaker, FormEntry and FormEntry Server, the no programming development tools that builds Web, iPad, iPhone, iPod ...

SIMILE Widgets
This is an open-source “spin-off” from the SIMILE project at MIT . Here we offer free, open-source web widgets, mostly for data visualizations. ...

GUI widget - Wikipedia, the free encyclopedia
This article is about reusable components for building user interfaces. For small desktop/web applications, see widget engine . For other uses, ...

Preview CrunchBase Widget
The CrunchBase widget allows you to embed information about companies, people, financial organizations, and products anywhere on the web. If ...

Resources last updated: 3/13/2016 5:45:15 PM


text:
#### Volume 6, issue 1 (2006)

 Download this article For screen For printing
 Recent Issues
 The Journal About the Journal Editorial Board Editorial Interests Subscriptions Submission Guidelines Submission Page Policies for Authors Ethics Statement ISSN (electronic): 1472-2739 ISSN (print): 1472-2747 Author Index To Appear Other MSP Journals
A volume form on the $\mathrm{SU}(2)$–representation space of knot groups

### Jérôme Dubois

Algebraic & Geometric Topology 6 (2006) 373–404
 arXiv: math.GT/0409529
##### Abstract

For a knot $K$ in ${S}^{3}$ we construct according to Casson—or more precisely taking into account Lin and Heusener’s further works—a volume form on the $SU\left(2\right)$–representation space of the group of $K$. We prove that this volume form is a topological knot invariant and explore some of its properties.

##### Keywords
knot groups, representation space, volume form, Casson invariant, adjoint representation, SU
##### Mathematical Subject Classification 2000
Primary: 57M25
Secondary: 57M05, 57M27
##### Publication
Received: 24 September 2004
Revised: 25 August 2005
Accepted: 27 December 2005
Published: 12 March 2006
##### Authors
 Jérôme Dubois Section de Mathématiques Université de Genève CP 64 2–4 Rue du Lièvre CH-1211 Genève 4 Switzerland


text:
# Refactor Coffee Script to fire on page load instead of change

I have a Rails app where I'm trying to select a list of facilities based on what region is selected in a form. So far, I've implemented group_collection_select to do this as well as a bit of CoffeeScript.

It works when creating a new record and selecting a region. The behavior being to only show facilities listed for the selected region. What does not work is when editing a record, selecting the facilities shows all of the facilities grouped by region instead of constraining the facilities to the selected region.

If I select another region and then select the original reason, the proper list of facilities show up.

I'd like to learn how to refactor the CoffeeScript to where when editing the record the function is fired both on load and on change.

Here's what my code looks like:

calls.js.coffee

jQuery ->
facilities = $('#call_transfer_from_id').html()$('#call_region_id').change ->
region = $('#call_region_id :selected').text() options =$(facilities).filter("optgroup[label=#{region}]").html()

if options
$('#call_transfer_from_id').html(options) else$('#call_transfer_from_id').empty()

region.rb

has_many :facilities

facility.rb

attr_accessible :region_id
belongs_to :region

_form.html.erb excerpt

<%= f.label :region %>
<%= f.collection_select(:region_id, Region.all, :id, :area, {:include_blank => true}, {:class => 'select', required: true}) %>
<%= f.label :Transfer_From %>
<%= f.grouped_collection_select :transfer_from_id, Region.order(:area), :active_facilities, :area, :id, :facility_name, {include_blank: true}, class: 'select' %>

If my question and examples are not clear, please let me know and I'll be happy to edit.

This is borderline Code Review material, since the code doesn't work as intended. It's not the same thing as "broken", because it does run, but what you're asking for is more or less a new feature.

(I'm also a little unsure of what you're asking, though I think I got it right. This isn't prose review, but you've got some run-on sentences in your question that are nigh impossible to read. Edit: That's been improved now)

Still, I'll give it shot regardless.

First, when you use jQuery, remember to store things you'll use more than once - don't call $(...) again and again for the same selectors. Second, store a clone of the facilities list element. Not the HTML string. You can just have an element in memory without having to to display it on the page. No need to reduce it a string, and parsing it every time you need something. Third, I'd use a more precise identifier for the optgroups than the region name. It works, but I'd prefer using an integer ID or something. Unfortunately, grouped_collection_select doesn't have an option to do that (you'd have to write your own version), so I'll skip that here. I'd extract a function to do the options-setting$ -> # on DOM ready

# Grab the elements we'll need
facilitySelect = $"#call_transfer_from_id" regionSelect =$ "#call_region_id"

# Make an in-memory clone of the facilities.
# We'll use this as out "master list"
facilitiesCopy = facilitySelect.clone()

# A simple helper function to set the facility select's option
# to match those in a named optgroup (again, we're cloing elments)
setFacilityOptionsForSelectedRegion = ->
region = regionSelect.val()
options = facilitiesCopy.find("optgroup[label='#{region}'] option").clone()
facilitySelect.empty().append options

# Call the function on region change
regionSelect.on "change", setFacilityOptionsForSelectedRegion

# and also just call it now that the page has loaded
setFacilityOptionsForSelectedRegion()

I think that should work.

Edit: Here's a demo

• Thanks for your advice and code example. Unfortunately when I tried using this the transfer_from_id group_collection_select no longer works and there are no facilities available to select. Even when changing region there are no facilities available at all. Should I move this question to SO instead since as you mentioned it's more of a feature than truly broken? Whatever you think is best. And again I appreciate your help and effort. :) – nulltek Sep 1 '14 at 16:43
• @cz3ch Well, if it's more broken now, then yeah, try SO :) But as far as I can tell, the jsfiddle demo works OK, so I can't tell you what goes wrong – Flambino Sep 1 '14 at 16:49
• The jsfiddle demo definitely works, so maybe it's something else in my form that is causing problems. I'll try to work through your example code and see what I can do to make it work. SO is a last resort :) I also tidied up the question so it's more readable. – nulltek Sep 1 '14 at 16:58
• Btw, here's the question posted to SO and we came up with a working answer: CoffeeScript to select form field dynamically on change and on load – nulltek Sep 12 '14 at 15:32


text:
# Gradient

## Transkrypcja filmu video

- [Voiceover] So here I'm gonna talk about the gradient. And in this video, I'm only gonna describe how you compute the gradient, and in the next couple ones I'm gonna give the geometric interpretation. And I hate doing this, I hate showing the computation before the geometric intuition since usually it should go the other way around, but the gradient is one of those weird things where the way that you compute it actually seems kind of unrelated to the intuition and you'll see that. We'll connect them in the next few videos. But to do that, we need to know what both of them actually are. So on the computation side of things, let's say you have some sort of function. And I'm just gonna make it a two-variable function. And let's say it's f of x, y, equals x-squared sine of y. The gradient is a way of packing together all the partial derivative information of a function. So let's just start by computing the partial derivatives of this guy. So partial of f with respect to x is equal to, so we look at this and we consider x the variable and y the constant. Well in that case sine of y is also a constant. As far as x is concerned, the derivative of x is 2x so we see that this will be 2x times that constant sine of y, sine of y. Whereas the partial derivative with respect to y. Now we look up here and we say x is considered a constant so x-squared is also considered a constant so this is just a constant times sine of y, so that's gonna equal that same constant times the cosine of y, which is the derivative of sine. So now what the gradient does is it just puts both of these together in a vector. And specifically, maybe I'll change colors here, you denote it with a little upside-down triangle. The name of that symbol is nabla, but you often just pronounce it del, you'd say del f or gradient of f. And what this equals is a vector that has those two partial derivatives in it. So the first one is the partial derivative with respect to x, to x times sine of y. And the bottom one, partial derivative with respect to y X-squared cosine of y. And notice, maybe I should emphasize, this is actually a vector-valued function. So maybe I'll give it a little bit more room here and emphasize that it's got an x and a y. This is a function that takes in a point in two-dimensional space and outputs a two-dimensional vector. So you could also imagine doing this with three different variables. Then you would have three partial derivatives, and a three-dimensional output. And the way you might write this more generally is we could go down here and say the gradient of any function is equal to a vector with its partial derivatives. Partial of f with respect to x, and partial of f with respect to y. And in some sense, we call these partial derivatives. I like to think as the gradient as the full derivative cuz it kind of captures all of the information that you need. So a very helpful mnemonic device with the gradient is to think about this triangle, this nabla symbol as being a vector full of partial derivative operators. And by operator, I just mean like partial with respect to x, something where you could give it a function, and it gives you another function. So you give this guy the function f and it gives you this expression, this multi-variable function as a result. So the nabla symbol is this vector full of different partial derivative operators. And in this case it might just be two of them, and this is kind of a weird thing because it's like what, this is a vector, it's got like operators in it, that's not what I thought vectors do. But you can kind of see where it's going. It's really just, you can think of it as a memory trick, but in some sense it's a little bit deeper than that. And really when you take this triangle and you say ok let's take this triangle and you can kind of imagine multiplying it by f, really it's like an operator taking in this function and it's gonna give you another function. It's like you take this triangle and you put an f in front of it, and you can imagine, like this part gets multipled, quote unquote multiplied with f, this part gets quote unquote multiplied with f but really you're just saying you take the partial derivative with respect to x and then with y, and on and on. And the reason for doing this, this symbol comes up a lot in other contexts. There are two other operators that you're gonna learn about called the divergence and the curl. We'll get to those later, all in due time. But it's useful to think about this vector-ish thing of partial derivatives. And I mean one weird thing about it, you could say ok so this nabla symbol is a vector of partial derivative operators. What's its dimension? And it's like how many dimensions do you got? Because if you had a three-dimensional function that would mean that you should treat this like it's got three different operators as part of it. And you know I'd kinda, finish this off down here, and if you had something that was 100-dimensional it would have 100 different operators in it and that's fine. It's really just again, kind of a memory trick. So with that, that's how you compute the gradient. Not too much too it, it's pretty much just partial derivatives, but you smack em into a vector where it gets fun and where it gets interesting is with the geometric interpretation. I'll get to that in the next couple videos. It's also a super important tool for something called the directional derivative. So you've got a lot of fun stuff ahead.


text:
2.1.25.70 WinExec

Syntax

int WinExec( LPCSTR lpCmdLine, UINT uCmdShow )

Parameters

lpCmdLine
[input] The command line (file name plus optional parameters) for the application to be executed.
uCmdShow
[input] The display options. For a list of the acceptable values, see the description of the nCmdShow parameter of the ShowWindow function.

Return

If the function succeeds, the return value is greater than 31. else the return value is one of the following error values.

0 =The system is out of memory or resources, 11= The .exe file is invalid, 2=The specified file was not found and 3= The specified path was not found.

Examples

EX1

void test_WinExec()
{

}


text:
## The Annals of Mathematical Statistics

### An Asymptotic Expansion of the Non-Null Distribution of Hotelling's Generalized $T_0^2$-Statistic

Minoru Siotani

#### Abstract

Let $Z = \{z_1, z_2, \cdots, z_m\}$ be a $p \times m$ random matrix where $z_i$ are independently distributed according to $p$-variate normal distributions with means $\mu_i$ and common covariance matrix $\Lambda = (\lambda_{ij})(> 0$, positive definite) and let $nS_n = n(s_{ij})$ be a $p \times p$ matrix which is independent of $Z$ and is subject to a central Wishart distribution $W_p(\Lambda, n)$ with $n$ degrees of freedom and covariance matrix $\Lambda$. Hotelling's generalized $T_o^2$-statistic is then defined by \begin{equation*}\tag{1.1} T_o^2 = \operatorname{tr} S_n^{-1}ZZ' = \sum^m_{i=1} z_i'S_n^{-1}z_i\end{equation*} which is the statistic proposed by Hotelling [4], [5] for testing the hypothesis $H: M = \{\mu_1, \cdots, \mu_m\} = 0$ against $K: M \neq 0$. The distribution of $T_0^2$ when $H$ is true has been treated by several authors: for example, Hotelling [5], Ito [6], Siotani [13], [14], Pillai and Samson [12], and Davis [3]. Even in the null case, the exact distribution of $T_0^2$ is not available except for certain special values of $p$ and $m$. When $m = 1, T_0^2$ reduces to Hotelling's generalization of "Student's" $t$ and if $p = 1, (1/m)T_0^2$ is simply $F$-statistic. Hence the non-null distributions in these cases are known exactly. For the general non-null case, Constantine [2] has obtained the exact distribution as well as moments of $T_0^2/n$ using the generalized Laguerre polynomials of matrix argument. Unfortunately this distribution is valid only over the range $0 \leqq T_0^2/n < n 1$ and hence not so useful since we are usually interested in the upper tail of the distribution. Siotani [15] has treated an asymptotic expansion for the non-null distribution of $T_0^2$ according to the basic idea due to Welch [17] and James [9]. The same problem has been attacked by Ito [7], using the integral representation of the characteristic function of $T_0^2$. However formulas of these authors are inadequate for a good approximation to the distribution since they have only the terms up to order $n^{-1}$ (for some numerical information, see [8]) and also somewhat inconvenient terms for numerical work. Khatri and Pillai have evaluated the moments of their statistic $U^{(p)}$ (a constant times $T_0^2$) and given approximate distributions of $U^{(p)}$ (and hence of $T_0^2$) in the light of the first four general noncentral moments, the summary of which can be obtained in their recent paper [10]. In this paper an asymptotic expansion for the non-null distribution of $T_0^2$ is given up to the terms of order $n^{-2}$, in which the effect of the noncentrality is contained in the form $s_j = \operatorname{tr} \Omega^j, j = 1, 2, \cdots$ where $\Omega = \Lambda^{-1}MM'$. This is carried out by expanding the characteristic function of $T_0^2$ along the Welch-James idea and by inverting the resultant into the corresponding expansion of the distribution function or the density function.

#### Article information

Source
Ann. Math. Statist., Volume 42, Number 2 (1971), 560-571.

Dates
First available in Project Euclid: 27 April 2007

https://projecteuclid.org/euclid.aoms/1177693406

Digital Object Identifier
doi:10.1214/aoms/1177693406

Mathematical Reviews number (MathSciNet)
MR286202

Zentralblatt MATH identifier
0249.62051

JSTOR
Siotani, Minoru. An Asymptotic Expansion of the Non-Null Distribution of Hotelling's Generalized $T_0^2$-Statistic. Ann. Math. Statist. 42 (1971), no. 2, 560--571. doi:10.1214/aoms/1177693406. https://projecteuclid.org/euclid.aoms/1177693406


text:
# Write the Following as Percent: 13 : 75 - Mathematics

Sum

Write the following as percent:
13 : 75

#### Solution

$13: 75 = \frac{13}{75}$
$= 0 . 1733 \times 100$
$= 17 . 33 \%$

Is there an error in this question or solution?

#### APPEARS IN

RD Sharma Class 8 Maths
Chapter 12 Percentage
Exercise 12.1 | Q 1.09 | Page 2


text:
# Tag Info

Suppose that $A_1=\{a\in A: \|a\|<1\}$ and $B=\{ b\in A: \|be\|<1\}$. Obviously $Be\subset A_1$, and $S_e(Be)=T_e(Be)$. Hence $S_e(Be)\subset T_e(A_1)$, and consequently $\overline{S_e(Be)}^w\subset \overline{T_e(A_1)}^w$. But $\overline{T_e(A_1)}^w$ is weakly compact from assumption, and so $\overline{S_e(Be)}^w$ is weakly compact. But ...
We will show that $T:L^{2}[1,\infty)\rightarrow L^{2}[1,\infty)$ is compact if and only if $-\infty<\alpha<0$. Observe that the integral kernel $K$ of $T$ is given by \begin{align*} K(x,y)=\dfrac{x^{\alpha}}{y}\chi_{[1\leq x\leq y<\infty)}, \tag{1} \end{align*} where $\chi$ is the characteristic function of the set \$\left\{(x,y)\in [1,\infty)^{2} : ...


text:
location:  Publications → journals
Search results

Search: MSC category 60G60 ( Random fields )

 Expand all        Collapse all Results 1 - 2 of 2

1. CJM 2008 (vol 60 pp. 313)

Choi, Yong-Kab; o, Miklós Csörg\H
 Asymptotic Properties for Increments of $l^{\infty}$-Valued Gaussian Random Fields This paper establishes general theorems which contain both moduli of continuity and large incremental results for $l^\infty$-valued Gaussian random fields indexed by a multidimensional parameter under explicit conditions. Keywords:$l^\infty$-valued Gaussian random field, modulus of continuity, regularly varying function, large deviation probabilityCategories:60F15, 60G15, 60G60

2. CJM 2004 (vol 56 pp. 209)

Schmuland, Byron; Sun, Wei
 A Central Limit Theorem and Law of the Iterated Logarithm for a Random Field with Exponential Decay of Correlations In \cite{P69}, Walter Philipp wrote that \dots the law of the iterated logarithm holds for any process for which the Borel-Cantelli Lemma, the central limit theorem with a reasonably good remainder and a certain maximal inequality are valid.'' Many authors \cite{DW80}, \cite{I68}, \cite{N91}, \cite{OY71}, \cite{Y79} have followed this plan in proving the law of the iterated logarithm for sequences (or fields) of dependent random variables. We carry on this tradition by proving the law of the iterated logarithm for a random field whose correlations satisfy an exponential decay condition like the one obtained by Spohn \cite{Sp86} for certain Gibbs measures. These do not fall into the $\phi$-mixing or strong mixing cases established in the literature, but are needed for our investigations \cite{SS01} into diffusions on configuration space. The proofs are all obtained by patching together standard results from \cite{OY71}, \cite{Y79} while keeping a careful eye on the correlations. Keywords:law of the iterated logarithmCategories:60F99, 60G60
 top of page | contact us | privacy | site map |