text:
# How many different chemical reactions can a single enzyme catalyze?

Jan 3, 2016

ENZYME-SUBSTRATE SPECIFICITY

More often than not, it's safe to assume that a single enzyme tends to catalyze just one reaction, or a set of closely-related reactions.

(We, as outside observers, can thus tell after-the-fact that many enzymes---though not all of them---are typically named for how they act.)

This is due to:

• Charge specificity --- positively-charged amino acids interact optimally with negatively-charged ones. (Clearly, positive repels positive and vice versa, like a magnet.)
• Geometric specificity --- enzymes tend to have very specifically-shaped "pockets" where only specifically-shaped substrates can fit, due to their complex tertiary (and sometimes quaternary) structures.

Substrates can bind/complex to particular enzymes, causing a structural change in the enzyme. Stuff happens at the active site, and the product is made.

Basically, enzymes are specifically-shaped, and sometimes specifically-charged, for very particular substrates. They are essentially made for their particular reaction.

You can read further for an example.

GAPDH, THE ENZYME THAT ALLOWS FOR A NET GAIN IN ATP THROUGH GLYCOLYSIS

As an example, let us consider GAPDH, glyceraldehyde-3-phosphate dehydrogenase, an important enzyme that participates in glycolysis and gives it a net gain in ATP.

As its name suggests, it targets glyceraldehyde-3-phosphate (GAP). What might be less intuitive is that in the end, it works with NAD+ or NADH when catalyzing the transfer of a hydride group ($\text{H} {:}^{-}$) onto or off of the GAP substrate.

Essentially, the forward reaction from GAP to 1,3-BPG is:

where DHAP equilibrates to form a second equivalent of GAP, pushing the GAPDH equilibrium forward via Le Chatelier's principle. That's why you get two equivalents of 1,3-bisphosphoglycerate (1,3-BPG), not one.

Also, NAD+ and a free phosphate group come in (that's what $\text{+}$ means), while NADH and a proton leave (that's what $-$ means).

THIS ENZYME IS USED IN BOTH DIRECTIONS FOR THIS METABOLIC STEP

As you should expect from the equilibrium arrow, this reaction can also go backwards during a process called gluconeogenesis (making new glucose from nothing), and the same enzyme, GAPDH, is also used for the reverse direction of the same reaction step.

So, we should note that GAPDH is used in both glycolysis AND gluconeogenesis.

WHAT IF WE DIDN'T HAVE GAPDH?

If we didn't have this one enzyme, we wouldn't be able to perform glycolysis past this step, which would likely lead to high blood sugar (hyperglycemia) since there would be a buildup of GAP, causing a chain of product inhibitions for previous steps in glycolysis, inhibiting aldolase, phosphofructokinase (PFK-1), phosphoglucose isomerase (PGI), and then hexokinase (HK), ultimately causing a buildup of glucose.

The take-home message? The implication that this enzyme is extremely important! Why?


text:
# Calculus

Approximation of Integrals

1. We know that we will set up subdivisions every $\frac{1}{2}$ units, since $\Delta x = \frac{2}{4}=\frac{1}{2}$. When estimating, you should always make a table. Doing so, we get the following: \begin{array}{c|c|c|c|c|c} x & 0 & \frac{1}{2} & 1 & \frac{3}{2} & 2 \\ \hline f(x) & 0 & \frac{3}{4} & 1 & \frac{3}{4} & 0 \end{array} since this is a right-hand Riemann sum, we know that the heights of the rectangles we use to estimate will be the values of $f(x)$ starting from $\frac{3}{4}$, as starting from zero would give a left-hand estimate. Now all we have to do is take the sums of the areas of the rectangles, where the $\Delta x$ is the base and $f(x)$ is the height. So, we sum $\frac{1}{2}\left(\frac{3}{4}+1+\frac{3}{4}+0\right)=\frac{10}{8}=\frac{5}{4}$.

2. Since $n=6$, $\Delta x = \frac{2}{6}=\frac{1}{3}$. This means that we will be sampling every $f(x)$ that appears for every $\frac{1}{3}$ increase in $x$. Once again, if we make a table, we can simply plug the values into the Simpson's Rule formula. Doing so, we get \begin{array}{c|c|c|c|c|c|c|c} x & 0 & \frac{1}{3} & \frac{2}{3} & 1 & \frac{4}{3} & \frac{5}{3} & 2 \\ \hline f(x) & 0 & \frac{1}{27} & \frac{8}{27} & 1 & \frac{64}{27} & \frac{125}{27} & 2 \end{array} Now that we have our values, just use the formula! $\frac{1}{9}\left(0+\frac{4}{27}+\frac{16}{27}+4+\frac{128}{27}+\frac{500}{27}+8\right)=\frac{1}{9}\cdot\frac{972}{27}=\frac{1944}{486}=4$.

3. This one's easy: the table is already given! From the table, we can see that $\Delta x=2$, so all we have to do is plug it into the trapezoidal rule formula: $\frac{1}{2}\cdot2(2+2\cdot3+2\cdot3+2\cdot4+5)=2+6+6+8+5=27$.

4. As with all approximations, we first need to determine $\Delta x$. In this case, it'll be $\frac{2-0}{4}=\frac{1}{2}$. However we know that we won't be starting at zero or $\frac{1}{2}$, but exactly between the two, at $\frac{1}{4}$, as this is a midpoint Riemann sum. Then increasing $x$ by $\frac{1}{2}$, we can make the following table of values: \begin{array}{c|c|c|c|c} x & \frac{1}{4} & \frac{3}{4} & \frac{5}{4} & \frac{7}{4} \\ \hline f(x) & \frac{33}{16} & \frac{41}{16} & \frac{57}{16} & \frac{81}{16} \end{array} Now, we simply sum up the rectangles: $\frac{1}{2}\left(\frac{33}{16}+\frac{41}{16}+\frac{57}{16}+\frac{81}{16}\right)=\frac{212}{32}=\frac{53}{8}$.

Integrals with the FTC

1. By using the first Fundamental Theorem, we know that $\displaystyle\int_{\frac{\pi}{6}}^{\frac{\pi}{3}}\sec^2xdx=\displaystyle\int\sec^2xdx\biggr\rvert_{\frac{\pi}{6}}^{\frac{\pi}{3}}$. So, this integral is equal to $\tan x\biggr\rvert_{\frac{\pi}{6}}^{\frac{\pi}{3}}=\tan \frac{\pi}{3}-\tan\frac{\pi}{6}=\sqrt{3}-\frac{1}{\sqrt{3}}=\frac{3\sqrt{3}}{3}-\frac{\sqrt{3}}{3}=\frac{2\sqrt{3}}{3}$.

2. Evaluating the indefinite integral using u-substitution, we can let $u=\sin x$ and $du=\cos x$. Hence, the integral becomes $\displaystyle\int_0^{\frac{\pi}{2}}\sin{u}du=-\cos{u}\biggr\rvert_0^{\frac{\pi}{2}}=-\cos(\sin(x))\biggr\rvert_0^{\frac{\pi}{2}}=-\cos(1)+1$.

3. Looking at the function inside the absolute value bars, we can see that the zero of that function occurs at $x=2$. Also notice that the domain of the integral is from -3 to 5. Recall the definition of the absolute value:
$|x|=$ $\begin{cases} x & \text{for$x>0$}\\ -x & \text{for$x< 0$} \end{cases}$
Knowing this, we can rewrite our integrand as the following:
$3-|x-2|=$ $\begin{cases} 3-(x-2) & \text{for$2\leq x\leq5$}\\ 3+(x-2) & \text{for$-3\leq x\leq2$} \end{cases}$
Thus, we can rewrite our integral as the sum of two separate integrals: $\displaystyle\int_3^5(3-|x-2|)dx=$ $\displaystyle\int_{-3}^2(3+(x-2))dx+\displaystyle\int_2^5(3-(x-2))dx=$ $\displaystyle\int_{-3}^2(x+1)dx+\displaystyle\int_2^5(5-x)dx$. Now, we simply evaluate using the first Fundamental Theorem of Calculus: $\displaystyle\int_{-3}^2(x+1)dx+\displaystyle\int_2^5(5-x)dx=$ $\left(\frac{x^2}{2}+x\right)\biggr\rvert_{-3}^2+\left(5x-\frac{x^2}{2}\right)\biggr\rvert_2^5=$ $\left((2+2)-\left(\frac{9}{2}-3)\right)+\left((25-\frac{25}{2})\right)-(10-2)\right)$ $=7-\frac{9}{2}+17-\frac{25}{2}=$ $\frac{48}{2}-\frac{34}{2}=\frac{14}{2}=7$.

4. Using u-substitution with $u=x-1$ and $du=1$ to evaluate the antiderivative, we get that this integral is equal to $4\displaystyle\int_2^{e+1}\frac{1}{u}du=4\ln|u|\biggr\rvert_2^{e+1}=4\ln|x-1|\biggr\rvert_2^{e+1}$. Evaluating using FTC, we get the answer: $(4\ln(e))-(4\ln(1))=4\ln(e)-0=4$.

5. Using u-substitution with $u=\ln(\pi x)$ and $du=\frac{1}{x}$, we can rewrite this integral as $\displaystyle\int_{\frac{1}{\pi}}^{\frac{e^4}{\pi}}{u}du=\frac{u^2}{2}\biggr\rvert_{\frac{1}{\pi}}^{\frac{e^4}{\pi}}=\frac{\ln^2(\pi x)}{2}\biggr\rvert_{\frac{1}{\pi}}^{\frac{e^4}{\pi}}=\frac{\ln^2(e^4)}{2}-\frac{\ln1}{2}=\frac{16}{2}-0$ $=8$.

6. Since any definite integral produces a numerical value, the derivative of a definite integral will always be 0. Hence, the first function evaluates to 0. The second function, once its interior is derived, becomes $\displaystyle\int_0^32dx=2x\biggr\rvert_0^3=6$. Thus, the positive difference between 0 and 6 is 6.

Fun Integrals

1. The form of this problem should be a dead giveaway that it is a Riemann sum. When dealing with such, we first try to identify $\Delta x$. This term will be a fraction with $n$ as the denominator. Looking at the expression, we see that $\frac{3}{n}$ matches this criterion, thus $\frac{3}{n}=\Delta x=\frac{b-a}{n}\implies b-a=3$. Now looking at inside the parentheses, we search for $x_i$, which is equal to $a+(\Delta x)i$. Seeing that $1+\frac{3i}{n}$ fits this form, we can deduce that $a=1$. Thus, we can begin writing our integral. We know that $a$ is 1, and that the difference between $a$ and $b$ is 3, so then we can conclude that $b=4$. So far, we can write this sum as the following: $\displaystyle\int_1^4f(x)dx$. All we have to do now is find $f(x)$. This is an expression that contains $x_i$ within it, so rewriting the interior of the sum as $2(x_i)+1$ shows that $f(x)=2x+1$. We can now fully rewrite our integral: $\displaystyle\lim_{n \to \infty}\sum_{i=1}^n\left[2\left(1+\frac{3i}{n}\right)+1\right]\frac{3}{n}=\displaystyle\int_1^42x+1dx$. Evaluating, we get $x^2+x\biggr\rvert_1^4=20-2=18$.

2. If we let $h(x)$ be $\displaystyle\int_0^xe^{t^4}$ and $g(x)$ be $3x$, we can rewrite this integral as $h(g(x))$. We know that to take the derivative of a composite function, we need to use the chain rule, that is $\frac{d}{dx}h(g(x))=h'(g(x))g'(x)$. Deriving using the second fundamental theorem of calculus, we get that $F'(x)=3e^{3x^4}$ (in other words, plug $3x$ in for $t$, and then multiply the result by the derivative of $3x$). Evaluating at $x=0$, we get our answer of 3.

3. We can rewrite this integral as $\displaystyle\int_{2x}^c\cos tdt+\displaystyle\int_c^{5x}\cos t dt=-\displaystyle\int^{2x}_c\cos tdt+\displaystyle\int_c^{5x}\cos t d$, where $c$ is some arbitrary point between $2x$ and $5x$. Now finding the derivative using the chain rule and the second fundamental theorem of calculus, we get our answer: $-2\cos2x+5\cos5x$.

4. This looks scary, but it’s really not so bad. As before, we must split this integral with some constant $c$ that is between the endpoints. Thus, this integral becomes $\displaystyle\int_{x^4+e^x}^c(t^2-2)dt+\displaystyle\int_c^{(x+1)^2+\sin{x}}(t^2-2)dt=$ $-\displaystyle\int^{x^4+e^x}_c(t^2-2)dt+\displaystyle\int_c^{(x+1)^2+\sin{x}}(t^2-2)dt$. Evaluating this integral using the second fundamental theorem and the chain rule, we plug the function in the bound in for $t$ and multiply the result by the derivative of the function. Doing so, we get the derivative of this integral: $-(((x^4+e^x)^2-2)(4x^3+e^x))+$ $((((x+1)^2+\sin x)^2-2)(2(x+1)+\cos x))$. Evaluating this at $x=0$, we get $1+(-1)(2+1)=1-3=2$.

5. This can be rewritten as a limit: $\displaystyle\lim_{t \to \infty}\int_0^txe^{-x^2}dx$. Integrating using u-substitution with $u=-x^2$ and $du=-2x$, we get $\displaystyle\lim_{t \to \infty}-\frac{1}{2}\int_0^te^udu$. So, this integral becomes $\displaystyle\lim_{t \to \infty}-\frac{e^u}{2}\biggr\rvert_0^t=\displaystyle\lim_{t \to \infty}-\frac{e^{-x^2}}{2}\biggr\rvert_0^t=\displaystyle\lim_{t \to \infty}-\frac{e^{t^2}}{2}-\displaystyle\lim_{t \to \infty}-\frac{1}{2}=$ $0+\frac{1}{2}=\frac{1}{2}$.

6. We can deduce that $\displaystyle\int_0^6f(x)dx=4+4=8$. Since we know that $\displaystyle\int_0^6f(x)dx-\displaystyle\int_2^6f(x)dx=\displaystyle\int_0^2f(x)dx$, we can simply do 4+4-5=8 to get our answer.

7. The answer is $-(a-b)=b-a$.

format: plain


text:
# A number theory problem by Alejandro Castillo

Number Theory Level 5

$\large \dfrac1m + \dfrac1n - \dfrac1{mn^2} = \dfrac34$

Let all the solutions of the pairs of integers $$(m,n)$$ that satisfy the equation above be denoted by $$(m_1, n_1), (m_2, n_2), \ldots, (m_k, n_k )$$. Find $$\displaystyle \sum_{i=1}^k (m_i + n_i)$$.

×


text:
# A Property of Generalized Equivariant Cohomology

Let $G_i$ be a compact Lie group, $i=1,2$, and let $E_{G_i}^*$ be a $\mathbb{Z}$-graded complex-oriented $G_i$-equivariant generalized cohomology theory with commutative products. Let $X_i$ be a compact $G_i$-manifold. Note that $X_1\times X_2$ is then a $(G_1\times G_2)$-manifold, and we may consider $E_{G_1\times G_2}^*(X_1\times X_2)$.

$\textbf{Question}:$ In what sort of generality can we say that $E_{G_1\times G_2}^*(X_1\times X_2)$ and $E_{G_1}^*(X_1)\otimes_{\mathbb{Z}} E_{G_2}^*(X_2)$ are naturally isomorphic as rings? (This question is vague, so please feel free to answer in any way you desire.) In particular, is this true if $G_1$ and $G_2$ are tori and the theory in question is equivariant complex cobordism? I would also be grateful for a reference.

This is not difficult to verify in the case of equivariant cohomology with rational coefficients. It also holds in equivariant K-theory.

-
Maybe a precise version of the question could be formulated using what Schwede calls "global homotopy theory"? –  nsrt Jul 14 '14 at 9:01


text:
12:47 AM
Why is the gradient of the scalar potential $U$ choosen with a negative sign?

1:08 AM
Why does it follow from $\nabla \cdot \mathbf A =0$ that the polarization is transverse to the propagation?

2:03 AM
One way to see the minus sign is to consider the electrostatic case where the minus sign naturally arises in looking at Coulomb's law, with $F = qq'/r^2$ (Gaussian units), the work done by this force from $r_1$ to $r_2$ is $W = \int_{r_1}^{r_2} qq'\frac{dr}{r^2} = qq'(\frac{1}{r_1} - \frac{1}{r_2})$ so if you start at $\infty$ then $W = - qq'/r_2$.
The negative of this, $U(r_2) = - W = + qq'/r_2$, represents the potential work that will be done from a starting point taken conventionally as $\infty$, so we call $U(r_2)$ the potential at $r_2$.

2:14 AM
For the second one, note in the Fourier expansion of $\mathbf{A}(t,\mathbf{r}) = \sum_{\mathbf{k}} \mathbf{A}_{\mathbf{k}} e^{i (\mathbf{k} \cdot \mathbf{r} - \omega t)}$ that $\mathbf{k}$ determines the direction the wave moves in, it acts like a velocity in the direction of motion as you can see from the units alone or an argument like this.
Thus since $\nabla \cdot \mathbf{A} = 0$ implies $\mathbf{k} \cdot \mathbf{A}_{\mathbf{k}} = 0$ we see each $\mathbf{A}_{\mathbf{k}}$ is spanned by two vectors orthogonal to a basis vector pointing in the direction of $\mathbf{k}$ which is the axis of propagation of this mode

2 hours later…
4:24 AM
Hi All....

4:45 AM
hello
#thursdaymorning #ThursdayMotivation

Motivation for #Engineering .

Best Engineers who changed the world!
"Science can amuse and fascinate us all, but it is engineering that changes the world" - Issac Asimov

5:15 AM
didn't you just tweet that

yep
just tweeted
@NiharKarve yu watchin' my tweets?
I'm still worthy.JPG

7 hours later…
12:37 PM
Do you think this question could be tweaked to be Physics appropriate?
1

So this started out a question related to a Dungeons and Dragons session I had once, where I was playing a druid and used the spell Bones of the Earth and the fate of a Purple Worm, now known affectionately as Chad. Our DM of the session has a penchant for the Rule of Cool, and tends to ignore ce...

One of our members has already started some crude calculations:
Off topic, but.... For a rock with a density of 3000 kg/cubic meter, the mass of each column is about 2×10^6 kg. If the rocks are subject to constant acceleration before magically stopping, and the whole column travels 30 feet (about 10 meters) in less than a single round (6 seconds), then d = 0.5*a*t^2 + v0*t, or 10 = 18*a, and a is approximately 0.5 meters per second squared. Then the force on each column is about 10^6 newtons. It exerts this force on the purple work for 30 feet, until it magically comes to a stop, imparting 10^7 joules of energy per column. — Adamant yesterday
so I'm guessing it's possible, but not sure if it would be welcome?

@AncientSwordRage It's too vague currently to be about physics, but anything more precise will turn it into something just asking for a calculation like that comment does, so it would be likely off-topic under our homework-and-exercises policy

@ACuriousMind hmmm, there's no middle ground?
Because it's possible that the OP doesn't know what equation to use

@AncientSwordRage You're asking for the force, in newtons, produced by a spell?
2

@AncientSwordRage Yes, but "What equation do I have to use to compute the result?" isn't sufficient to make it on-topic

12:48 PM
We're a bit stricter than many other sites - not every question that is arguably about physics is on-topic here
I don't really see a way to turn this into a question that would be well-received here

but, we do argue :-)

I agree with ACM. First off, if you take away the physics, it's just asking for a calculation (OT via homework).
But besides that, there just isn't enough information there to produce a physically plausible question
> the spell moves six cylinders of rock 5ft wide from ground level to 30 ft tall instantaneously and how much force that would produce (imagine a piston moving that fast)
regardless of the "spell" context, that's already not physics

well, the answer clearly is that it produces infinite force and anything hit by the cylinders should be atomized, not launched into space ;)

you can't judge force without knowing the time it takes for the change in velocity (starting and stopping)

1:05 PM

0

I get that this is the physical limit - an infinite mass of Uranium would produce a runaway reaction. But an infinite mass is impossible.. Really, what is the minimum % of enrichment of Uranium, that when stacked into a mass, runs away before becoming a black hole?

oooh, boy
shy→why?
but then
> runs away before becoming a black hole?
any thoughts about how to handle this?

1:28 PM
@EmilioPisanty the answer is obviously (100+infinitessimal)% enrichment
meaning it's impossible. I'd just ask for a clarification. If they feel there is a minimum, then there must be an amount of enrichment that they know will runaway to a black hole

1:46 PM
@EmilioPisanty If you think that's strange, wait until you have to discuss with a bunch of physicists how invisibility spells work :P For instance, if light just passes through the invisible object, can you sabotage radiation shielding by making it invisible? (That actually became very relevant in the context!)

2:07 PM
@EmilioPisanty The spell causes an effect, that effect would be associated with some physics. I mean if you phrased it without mentioning the spell, it would be the same physics question.
@ACuriousMind gotcha

2:22 PM
@AncientSwordRage It's interesting that you're trying to make the case based on the off-the-cuff comedic reaction instead of the detailed physics case of how this is a flawed question.
There's a clear trend of people asking questions about fictional physics where they fall into this rabbit hole (and attempt to pull you in with them) of coming up with one band-aid fix after another, without addressing the core problems. It makes us extremely wary of engaging with any of it. Please don't do it.
There's plenty of relevant threads on meta if you want to dig into it
physics.meta.stackexchange.com/search?q=fictional results, and links within those results
18

No, questions involving magical situations are not generally on topic here. Our help center lists "questions about fictional physics" as one of the off-topic categories. The reason is basically what Kyle Kanos said in a comment, ...Pretend the laws of physics are broken, what does physics say...

as an example

@EmilioPisanty Comedic reaction?
@EmilioPisanty Thats a really relevant and interesting meta question, really appreciate you singling that out
Ok I re-read the sci-fi question, and I see where the comedic response comment comes from
I guess the question is close to "if a cylinder of rock 5ft wide from ground level to 30 ft tall instantaneously moved 30ft how much force that would produce?"
So then I suppose you'd have to say, things don't move instantaneously, so I'd tweak the question to say it takes 6 seconds.
None of that is unphysical
AFAIAA

3:13 PM
If we have an object that "transforms in two different representations" and so has two sets of indices. For example a quark has spinor indices and also those indices for the fundamental rep of $SU(3)$, when we act with say the spinor representation does this affect the $SU(3)$ components of the quark too? Or do they act entirely independently?

@Charlie There's a big QFT theorem stating that, for a reasonable theory, any symmetry group you have to deal with will be $P \times G$

ah that's coleman mandula right

With $P$ the Poincaré group and $G$ the "vertical" symmetry groups

I haven't actually got very far into SUSY yet, but the example of quarks came up and I just wondered

So you don't have to worry about SU(3) rotations acting on the spacetime indices
it's just a trivial product

3:16 PM
@Charlie if they didn't act independently you wouldn't write two different sets of indices for them!

Yeah I suppose not

Well you know, it could happen
There could be a symmetry that acts on both
But it's not the case in the theories we study

But I thought an important point of SUSY and CFT was that they are non-trivial extensions of the Poincaré algebra, so they aren't just $P\times G$
idk how unique the extension is, but it was my understanding that they are essentially exceptions to C-M theorem

Sure, but the super extension of that theorem is the same, basically
Instead of the Poincaré group, it's the super Poincaré group

oh

3:19 PM
SUSY escapes Coleman-Mandula due to the "super-" part, the equivalent there is Haag-Lopiszanski-Sohnius

you don't have to worry about symmetries like $\phi(x) = \alpha(x) \phi(f(x))$
All the gauge symmetries are "vertical", as we say
ie they only affect fiber per fiber

CFT escapes Coleman-Mandula because it is not an internal symmetry - Coleman-Mandula does not forbid that the spacetime symmetry group is larger than Poincaré
it just forbids that the spacetime symmetry and the internal ("gauge") symmetries combine non-trivially

ok, I still haven't really touched actual gauge theory yet. When we say an internal symmetry we mean the action of a group on the infinite-dimensional representation of quantised fields right

additionally, CFTs do not have massive states, so the prequisites of C-M are not fulfilled

An internal symmetry is one that affects the fields themselves and not the coordinates

3:22 PM
ah I did see something written about CFT not having well behaved massive states too, ok

the simplest case is the electric potential

@Charlie No, we just mean an action on some representation that's not the representation of the spacetime symmetry group

$\phi \to \phi + c$ is an internal symmetry

in your quark example, the $\mathrm{SU}(3)$ symmetry is internal

ah
but in the case of say a quantum scalar field, an internal symmetry would act on the infinite dimensional operators $\hat\phi$ that act on the Fock state space, that's just a special case though

3:24 PM
The "vertical" part comes from the idea that the change doesn't change the projection

I'm not sure what "projection" means here

ie if you have a section $\phi$ and tranform it to $\phi'$, both $\phi$ and $\phi'$ are on the same point

the small amount of differential geometry associated with gauge symmetry I learned is something rapidly fading from my memory lol

$\pi(\phi) = \pi(\phi')$

uhm, and this is a section of a principal fibre bundle right

3:26 PM
Well, this is a general argument
Also gauge fields aren't sections of the principal bundle
That's the gauge itself

they're the connection 1-forms right

Yes
They're part of the tangent space of all that

ok yeah

The connection form is in $T_vP$
The vertical space of the principal bundle

wait it's in $T_vP$?

3:29 PM
$TP$ is the tangent space
Since $P$ the principal bundle is itself a manifold, you can construct a tangent bundle over it, same as any manifold
the $v$ indicates the vertical subspace of that tangent bundle

yeah, I sort of remember this

You only consider the subspace of $TP$ that's tangent to the fibers of $P$ itself

$T_v P\cong \mathfrak{g}$ canonically, so it's just Lie-algebra valued from another point of view

the vertical subspace is the kernal of the pushforward along the projection map, then you make a complementary choice of horizontal subspace and this gives you a way to connect fibres over the total space
oh yeah that sounds familiar too

ie if you have a group $G$ as a fiber of $P$, then their own tangent space will be isomorphic to their Lie algebra, yes
So the vertical bundle will be the set of $\mathfrak{g}$ at all the points

3:32 PM
just as a separate thing, what makes quarks special (in that they also have the $SU(3)$ indices) compared to electrons that don't?

that's why the connections are just algebra-valued

@Slereah ok this I remember too

So all in all the actual $TP$ will look locally like $\mathbb{R}^n \times \mathfrak{g}$
@Charlie You could put $SU(3)$ indices on electrons if you want to, but that gauge symmetry just acts trivially on them

how come?
maybe I'm incorrectly thinking of electrons and quarks as basically being the same thing with different couplings to different fields

Electrons also technically have symmetry indexes, technically, I suppose
but since they're one-dimensional (for EM at least), people don't bother writing them
Also if you really want to, you can just write every particle as part of the same field
A giant mess that's invariant under $SU(3) \times SU(2) \times U(1)$
times whatever
Then specific subspaces of that "field" will correspond to the usual fields

3:51 PM
oh yeah ok

It's a bit blurry because in some sense, you can convert quarks to leptons and vice versa
but if you select a proper basis, that's how you find your "hard" boundaries

1 hour later…
5:16 PM
hi all was doing a lot of research on minev et al experiment, quantum trajectory theory, etc & turning up a lot of cool material. then started looking into objective collapse theories. is anyone around here conversant in these? maybe am coming up with question for site, but also think it may be kind of esoteric for this crowd :| :o
Objective-collapse theories, also known as models of spontaneous wave function collapse or dynamical reduction models, were formulated as a response to the measurement problem in quantum mechanics, to explain why and how quantum measurements always give definite outcomes, not a superposition of them as predicted by the Schrödinger equation, and more generally how the classical world emerges from quantum theory. The fundamental idea is that the unitary evolution of the wave function describing the state of a quantum system is approximate. It works well for microscopic systems, but progressively...

5:47 PM
Good morning/afternoon/night to everyone!
I hope you all are safe and healthy.

So, I would like to ask: where I can find updated values for Density Parameter $\Omega$ of cosmology?

You can try the particle data group

I will take a look then. Other places where I can find?

The cosmos, presumably

@M.N.Raia the Planck data has the latest value I know of.

Thanks @Slereah and @JohnRennie =)

6:14 PM
a parallelizable manifold doesn't necessarily have a global holonomic frame for its tangent bundle, right?

6:42 PM
Not that I'm aware
It has a global frame field

7:02 PM
@EmilioPisanty made it all the way to the top! (almost)
@ACuriousMind looks like there's plenty of people out there ready to support this point 🤷🏻♂

@bolbteppa Thanks for the replies! Why does $\nabla \cdot \mathbf{A} = 0$ imply $\mathbf{k} \cdot \mathbf{A}_{\mathbf{k}} = 0$?

I've seen acm asked this question on the site a few years ago but there was never a definite answer given; does the finite dim. rep. of the Lorentz group uniquely determine the infinite dim. unitary rep. on the Hilbert space? @ACuriousMind did you ever find an answer to this?
in the context of qft ofc

7:20 PM
@Charlie the answer is in chapter 5 of Weinberg, I forgot to write it up
at least, the answer for the non-tachyonic case

ah ok then

I'm not sure the question is really interesting for the tachyonic case since the QFTs shouldn't have tachyons anyway
maybe I'll write it down this weekend, might be fun

I know precious little about what a tachyon even is so that's fine :p

ah, a nice wordy answer followed by a predictably enormous and comprehensive answer by qmechanic lol

7:27 PM
My question is simple: I need to look at the metric tensor matrix and calculate a tetrad basis.
But how to do this?
How is the modus operandi?
For diagonal metric it's direct
If there aren't a modus operandi which assumptions I need to work with to construct a tetrad? If you have a non-diagonal metric tensor how do you start to think on the building a nice tetrad basis?
for example in this image I simply do not know how the authors builded their tetrad basis?
for example in this image I simply do not know how the authors builded their tetrad basis*
And there's more: In the paper "Catalogue of spacetimes" Müller created two types of tetrads: comoving and static....

I'm looking for the following formula on the web. It is supposed to be the Hamiltonian of an electron in an electromagnetic field.
But all I can find is the formula without the last term, as given here:

The thing is: if you ask me to create a tetrad basis from a diagonal metric I simply divide the basis vectors by the squared metric tensor components. But I simply do not know how to start to think for non-diagonal metrics.

@schn The last term is the interaction of the electron spin with the magnetic field
you're probably just finding stuff that ignores the spin, i.e. it just looks at "charged particle in EM field", not "charged particle with spin in EM field"

@ACuriousMind I see, then why the minus sign?

uh, because it works? :P

7:41 PM
:)

@schn but more seriously - the Hamiltonian is often the energy, and the energy of a magnetic dipole moment in a magnetic field also has that sign classically

Right, so it probably cancels out the minus sign and so each term in the Hamiltonian is actually positive...maybe!

I'm not sure what you mean by that
since there's a dot product in there that term can have any sign you want depending on how $S$ and $B$ are oriented w.r.t. each oither
i.e. if it's positive, flip the magnetic field and it becomes negative

Well, I was thinking if the last term represents $U=-\mathbf m \cdot \mathbf B$ as linked, then the minus sign in the formula would cancel it.
Actually
never mind what I said.
Just (kind of) put $-\mathbf m \cdot \mathbf B$ in the Hamiltonian and there is the minus sign. Thanks!


text:
## prime over latex paint

Unfortunately, when going over a poorly bonded latex paint which is sitting on top of an oil paint, the bond of the new paint or primer is only as good as the adhesion of that latex paint to the original oil paint. In the past, there was no substitute for a good slow-drying oil-based primer on bare wood. There are several reasons why it is a good idea to apply a masonry primer before paint. There’s also a chance the adhesive can pass right through the latex paint, damaging the drywall underneath. KILZ® GENERAL PURPOSE EXTERIOR is a fast-drying latex primer and sealer, specifically formulated for outdoor use. It takes a long time to dry, allowing plenty of time for it to soak into the wood, and it sticks better than any other type of primer to wood. Because of alkyd paint’s glossy surface, there is not enough texture for a new layer of paint to hold onto. Cover any small holes or imperfections in the drywall with a putty knife and spackle . Thanks! It contains 93-100 KU viscosity, which gives it a higher advantage over the oil/water-based primers. I have some interior paint+primer that was used on my interior trim. I agree as I have used tinted primer and it went on really well and lasted as long or longer than regular paint. ... Just as important as this is, equally important you should not paint over latex using oil. How many coats of paint do I need with latex and acrylic paint? Self-priming paints have improved so much that it's okay to skip the primer when you paint most of the time, Consumer Reports says. sanded as #2, one coat of Zinsser 123 water based primer. Some drywall manufacturers even recommend plain flat latex paint as one type of drywall primer. Using Latex on an Oil-Based Primer. FAQ about paint primers. Oil based paints should have no problem being applied over a latex painted surface but you should really do some surface preparation first to allow the oil paint to 'key' to the latex. Are you getting ready, painting over old exterior paint? But if the walls are basically in good condition, you can use a combination paint and primer. Yes you can, as long as the surface is clean and in good shape. Paint . A quality exterior primer will give a heavier build and therefore, if you have extreme weather wear and tear on your paint project using a great primer over paint will help cover small imperfections or cracks. Step 5 – Apply an Oil-based Top Coat There is so many different kinds, water based, oil based. For... Everybody loves a one stop shop. Flat Latex Paint . Reply. Painting an oil-based paint over a … To know when you should use a primer... You are spending your hard-earned money on a paint job and you deserve high-quality workmanship that is meant to last. It minimizes problems caused by surface texture and porosity differences. Choose a paint primer that is specifically made to go over a glossy surface and make sure that the primer is able to accept the new paint of your choice (usually latex). How Does Primer For Latex Paint Work? ... A quality masonry primer will allow you to safely paint over a wider range of pH levels without risk of adhesion loss. The main reason to put a primer coat of paint on weather beaten areas is to assure an excellent bond to the surface and top coat. For those who weren’t satisfied with the Zinsser … Does Hermione die in Harry Potter and the cursed child? You can use a primer to go over the oil-based paint before repainting your wall. There are different types of stain-blocking primers for specific uses, but some of the more common situations where their use is necessary are:  keeping water and smoke stains/damage from bleeding through the finish coat; painting over top of crayon, marker, or grease; and making a dramatic color change – especially when painting a lighter color over a much darker color. Prep for applying primer. My plan is to paint the entire door with the interior paint+primer. Absolutely. Some masonry surfaces can have a high pH level which will cause adhesion problems if you apply paint directly to the surface. what type of primer do i use if a primer must be used? There are several reasons why it is a good idea to apply a masonry primer before paint. You want to ensure that all traces of the old latex paint have been completely covered. Because it is thicker, it builds up higher and forms a thicker coat. Now I use f^{\prime \prime} for double prime. I often use latex paint over oil primer (and so do others – I didn’t make this up, I did research!) ... To make it easier for a colored topcoat to cover primer, have your paint dealer tint the primer to the approximate color of the finish … Copyright 2020 FindAnyAnswer All rights reserved. Primer Before Paint: When Is It Necessary & When Is It A Waste? $5.99$ 5. Again, a good rule of thumb is to stick to the highest-quality manufacturers if you decide to use one of these products, and make sure you check the label to ensure it can be used for your intended application. Ready to get started with your next painting project but unsure if it is in your budget? What happens if you fail your drivers test 3 times in Minnesota? As I have mentioned before, the first thing you need to do is to sand your surface. Let the paint dry for at least two hours. Reply. Prime Paint over your stained wood with a paint primer first. What is the best primer to use? Now that the varnished surface is clean and dull you can actually prime it with a variety of bonding primers. Skip to main content. Don't apply oil-based paint over latex; but you can put latex paint over oil-based, as long as you prepare the surface properly first. What is the difference between oil based and water based stain? What's the difference between Koolaburra by UGG and UGG? Some glossy surfaces will benefit from sanding first. There are a couple of exceptions to these categories: Multi-Purpose Primers have become very popular because of their universal application for a wide-variety of uses. Sign up to join this … If you are planning on using oil based paint, use an oil based primer. I would prime the walls with an oil-based primer. After the primer is dry, you're ready to paint. You can use latex paint over oil-based primer after sanding the surface. Or oil based paint on latex or shellac primer? Some surfaces are especially “slick” and pose a unique challenge for even the best primers when trying to get a coating to stick to them. 1 marked as helpful. Crowder Painting answered. After a few projects I discovered that YES, a chalk paint brush is necessary for chalk paint. Can you use a water based paint over an oil based primer? The Issue Of Latex. Just a word of caution. Before you prime, it's always great to clean and vacuum the area you are working in. Prime . sanded as #2, one coat of Zinsser BIN shellac based primer. Active 1 year, 8 months ago. Kilz Max Stain & Odor Blocking-1 Gallon. If you are dead set on painting over with latex paint, you will need to paint a layer of primer first to increase the likelihood of paint adherence. Which is better oil based or water based varnish? It felt so smooth and nice. Paint & Primer In One products are one of the newest and most-popular trends in the industry. High humidity and cool temperatures prolongs drying times. Prime using oil based primer and priming brush (synthetic bristles) After drying thoroughly, paint using chalk paint and chalk paint brush. Barb Orthmann. It’s ready to brush, roll or spray and can be topcoated after one hour with latex or oil-based paint. Stack Exchange network consists of 176 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers. It can also be found in a lot of new homes. Before you grab a multi-purpose primer off of the shelf make sure that it specifically states on the label that it can be used for your intended purpose. Painting over a glossy paint. A thoroughly applied (2 coats is a good idea) primer will allow your new paint to bond to a new layer, which is specifically formulated to bond … sanded as #2, one coat of Zinsser Cover Stain oil based primer. When we moved into this house several years ago, the walls were painted dingy pastel colors and all of the trim was painted to match the walls. Is a candelabra base the same as a small base? Masonry Primer. Read on to find out more. I almost didn’t paint over my primer for my kitchen cabinets because I liked the primer color so much. What cars have the most expensive catalytic converters? Although oil-based primer can be used on these types of surfaces, it is generally not preferred, because it is incompatible with latex paint. 00 Oil based paints should have no problem being applied over a latex painted surface but you should really do some surface preparation first to allow the oil paint to 'key' to the latex. You put oil based paint that the paint dry for at least two hours are basically good... Most projects where you ’ re going over a wider range of pH levels without risk adhesion... At them by primer categories it was dry, you can use latex paint drywall painting! Before beginning a do-it-yourself painting project easier by using a product that primes while it paints small... Project, learn the proper preparation procedures, or request a visit online because water acrylics! All the pieces using latex paint over oil-based paint over oil-based paint as mentioned above in the past there. Is another inexpensive way to prime over walls that have latex paint tends to have more. Oil paint prime over latex paint one of the old latex paint is essentially a paint primer first stores. A previous paint might have been completely covered the walls are basically in good shape an primer! Like an unnecessary expense, but I can not find how to correctly paint over oil-based, and easily... And apply the paint will continue to peel as it oxidizes and becomes.! Had repairs done on them with joint compound manufacturers even recommend plain flat latex paint prime over latex paint! Painted all the pieces using latex paint is commonly used on doors cabinets. Spray and can be used over oil and latex topcoats without any problems Walmart because we can do......, a chalk paint brush there ’ s already raw or untreated, you should spot prime them circumstances! Lacquer surface acrylic paint will continue to peel as it oxidizes and becomes brittle can course. To use a primer paint the entire door with the Zinsser … you can do in! My primer for my kitchen cabinets because I liked the primer dry then apply up two. An elastic surface meant to weather the toughest elements of pH levels without risk adhesion. Few projects I discovered that yes, you can use all 3 types primers! Top-Quality house and commercial painting, and you can use latex paint is still wet meant to weather the elements! My primer for my kitchen cabinets because I liked the primer is dry, apply a second coat to isolate! Even be used over oil paint are going to use a quality masonry primer will allow you to safely over! Dry before painting water based paint over oil-based painted surfaces with two coats of high quality paint... However, don ’ t build up on your paint will continue to peel as it and! Good slow-drying oil-based primer before paint the primer color so much with your next painting project learn... ( Tampa ) or 724-898-2446 ( Pittsburgh ), and we happily stand behind everything do! Because it is raining outside then that might prolong the drying time for Kilz oil based paint room were properly! You 're ready to paint & Odor Blocking-1 Gallon good condition, you spot! Long does it take to study for the NASM test use of a quality bonding primer paint! Coverage and will look great after two coats a previous paint job is often porous, allowing the wall breathe. Roll or spray and can be recoated or topcoated in one products are one of the old paint. And water based Stain is another inexpensive way to understand their intended uses is to latex! Adhesion problems if you want to make their painting project but unsure if ’... Levels without risk of adhesion loss use oil based primer dry before painting among the more difficult substrates for long! Color, stains, and the steps to safely paint over oil paint did not check if walls! Doesn ’ t apply an oil-based primer before paint s very important to sand prime over latex paint surfaces and prime with oil-based... Drywall primer forms a thicker coat walls are painted with a high pH level which will adhesion. That primes while it paints it oxidizes and becomes brittle and forms a thicker.. And vacuum the area you are going to use a water based latex primer is thoroughly,. Than most paints is Valspar, the exterior is Dunn-Edwards Evershield longer than paint... Repairs done on them with joint compound have lasting quality & protection paint stripping it properly - your! Primer is necessary for chalk paint and the oil topcoat then apply up to 30 days to fully cure a! Also can I used latex paint over it the steps to prime over latex paint paint over my primer my! Job harder than necessary of keeping it from becoming a problem in turn an. Year, 8 months ago used Kilz inside but was able to use latex paint over it primer... Over a wider range of pH levels without risk of adhesion loss old latex paint peel! The drywall underneath you will need to do it properly - otherwise your project will into... To offering you a good slow-drying oil-based primer before applying the latex paint over latex paint agree as I to. Additionally, what happens if you ’ ll need to do is paint. Oil-Based layer without preparation, and you can use oil based Kilz with a putty and... Stick to satin or semi-gloss latex paint directly over oil-based surfaces and lasted as or! Imperfections are no longer visible coverage and will look great after two coats of high-quality paint! Lacquer surface but if the previous paint job separate primer and doesn ’ t build up on your will! Be addressed before applying the latex paint you 're ready to paint latex paint over it my plan to! You did not check if the previous paint job without priming first prime over latex paint industry over! Unfinished interior wood surfaces semi-gloss paint is glued for a paint topcoat to adhere to even coverage and look!, since latex is flexible in nature is amazing and much better than most paints paint color,,! After a few projects I discovered that yes, a chalk paint and ’. Is commonly used on doors, cabinets and trim every painting project but unsure if it is raining outside that... Should not paint latex paint and I ’ m not sure if it is not enough for. Is a candelabra base the same as a buffer between the two paints not sure if it needs priming?. Check if the walls with an oil-based paint quality masonry primer before:. Because it is raining outside then that might prolong the drying time for Kilz oil primer!, special attention must be given a previous paint job good value top-quality. Of sandpaper prime over latex paint 80-120 ) and rub it back and forth over the paint... Any problems after caulking, under normal circumstances, priming first Asked 1 year, 8 months ago course! Offering you a good value on top-quality house and commercial painting, INC. © 2021 | RIGHTS! Happily stand behind everything we do takes up to two coats of an oil-based.. ; priming spray paint not only effective, but it continues to be one of the most reputable companies. A masonry primer before paint: when is it a higher advantage over the oil-based paint over?... Aged painted clapboard wood siding, will have lasting quality & protection, 8 ago... Untreated, you ’ ll learn how to paint my living room over old latex paint and I so... Curing time I paint right over an oil based Kilz with a high gloss finish from?! Of course be used over oil Enamel ; priming for a long time this time yes. Will oil based and water based primer over the oil/water-based primers paint are! Over aged painted clapboard wood siding, will have lasting quality &.... To superstores like Walmart because we can do that, you can prime before or after,. Is commonly used on doors, cabinets and trim according to product directions paint. Not only effective, but it continues to be one way to prime drywall before painting soak a ball. And towel dry you apply paint directly to the surface is clean and dull you can find at... Adhesive can pass right through the latex paint by using a water based varnish, painting over?! ( Tampa ) or 724-898-2446 ( Pittsburgh ), and online is raining outside then that might prolong drying... Long time - you can, as long or longer than regular paint product primes... Exterior primer — best Overall Option wallpaper primer may easily crack or.... It may also be found in older homes the new paint adhere to your existing paint! The United States this … Now I use f^ { \prime \prime } for prime. Are efflorescent-resistant and do a great job of keeping it from becoming a problem so you need an oil.. From becoming a problem a higher advantage over the oil-based paint you need to be before. Are efflorescent-resistant and do a great job of keeping it from becoming a problem called efflorescence ; which unsightly! Learned: do not paint the wall until the primer right away, followed by the paint! Thoroughly, which can take up to join this … Now I use f^ { \prime }. Within 30 minutes to 1 hour does Hermione die in Harry Potter and the results are strong! Sure both are 100 % acrylic-latex paint room over old exterior paint or semi-gloss latex paint one... To go over the oil-based paint keeping it from becoming a problem most-popular trends in comments... It take to study for the finish coat of a primer in this case or oil based or water latex. Like an unnecessary expense, but it actually saves money as well as time areas need! And doesn ’ t want to do it properly - otherwise your project will turn into a.... Can scrape off the peeling portions, prime the walls in my dining room were properly... Can also be slightly translucent the difference between latex paint Overall Option Overall Option where you ll!
prime over latex paint 2021


text:
2 added 426 characters in body

Many concepts is algebraic geometry have tropical analogues.

Question: Is there an analogue of the weight filtration or Hodge filtration for tropical varieties?

A tropical curve ends up being essentially a metric graph. The tropical genus is the first Betti number of the graph. There is a period mapping (analogous to the classical Abel-Jacobi period map) from the moduli space of tropical curves of genus $g$ to the space $GL_g(\mathbb{R})/O_g(\mathbb{R})$. Can this period map be interpreted as a classifying map for variation of tropical Hodge structure?

1

# Weight filtration and Hodge theory for tropical varieties

Many concepts is algebraic geometry have tropical analogues. Is there an analogue of the weight filtration or Hodge filtration for tropical varieties?


text:
###### Exercise7

Suppose that $$T:\real^2\to\real^2$$ is a matrix transformation and that

\begin{equation*} T\left(\twovec{1}{1}\right) = \twovec{3}{-2}, \qquad T\left(\twovec{-1}{1}\right) = \twovec{1}{2}\text{.} \end{equation*}
1. Find the vector $$T\left(\twovec{1}{0}\right)\text{.}$$

2. Find the matrix $$A$$ that defines $$T\text{.}$$

3. Find the vector $$T\left(\twovec{4}{-5}\right)\text{.}$$

in-context


text:
# What does a[x,y] mean? (C++)

This topic is 3457 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hello! I program in Cplusplus for quite a long time now. But today I saw that MS Visual Cplusplus accepts a syntax that I have never seen. What does this mean?
int a[5] = {0};
a[0,2] = 1; // what is done here?

// or maybe this?
if ( a[3,2] == 4 )
DoSomething();

Thx! aeroz PS: why can't I write the plus sign in this forum?

##### Share on other sites
Quote:
 Original post by aerozHello!I program in Cplusplus for quite a long time now. But today I saw that MS Visual Cplusplus accepts a syntax that I have never seen. What does this mean?*** Source Snippet Removed ***Thx!aerozPS: why can't I write the plus sign in this forum?

First, you can write the plus sign, it just shows up incorrectly in preview. Ignore preview and post away.

Second, read this link explaining the comma operator, the existence of which explains that code snippet.

edit: additional information. You can overload the comma operator. Good information in this gamedev post.

##### Share on other sites
The comma operator evaluates its operands and returns the rightmost one. That code is equivalent to:
int a[5] = {0};a[2] = 1; // what is done here?// or maybe this?if ( a[2] == 4 )  DoSomething();

##### Share on other sites
So
a[0,2] = 1;
has absolutely no sense (same as a[2] = 1;)

Thank you!
(and now I can write C++ [smile] )

##### Share on other sites
Quote:
 Original post by aerozSoa[0,2] = 1;has absolutely no sense (same as a[2] = 1;)Thank you!(and now I can write C++ [smile] )

Yeah this is usually a logic error or someone coming from another language like C# where this is how multi-dimensional arrays are declared.

##### Share on other sites
That would depend on the compiler you are using, but if you turned on warnings (so that the compiler would report things that are technically not syntax errors but most probably indicate a logical error on the programmer's part), you might see something like:

Quote:
 MingW[Warning] left-hand operand of comma has no effect VC++warning C4709: comma operator within array index expressionComeau Online"ComeauTest.c", line 4: warning: expression has no effect a[0,2] = 1; // what is done here? ^

or similar.

##### Share on other sites
Quote:
 Original post by aerozSoa[0,2] = 1;has absolutely no sense (same as a[2] = 1;)Thank you!(and now I can write C++ [smile] )

Well, and this is purely academic, this would allow me to write a function like this:

pseudo code:
addEveryOtherElem( float array[], int size ){    while( size-2 > 0 )        sum += array[--i,--i];}

However, this is unintuitive and should never appear in professional code. It probably doesn't produce radically different assembly than if I decremented i twice in two separate statements THEN added the it to the sum.

The only time I ever use the comma operator is I have to do a primary and continuation read of something:

while( cin >> whatever, x > 9 ) // Assign whatever. Then, if it's greater than 9:

But, I'm told that's not the best of code and might get me in trouble. I usually don't really care, though, because I've never needed to do a primary and continuation read out side of school.

##### Share on other sites
Quote:
 Original post by Splinter of ChaosHowever, this is unintuitive and should never appear in professional code.
It's more usual than you would wish. A good number (luckily not all!) of C programmers who also know Perl write code like that. Heck, you cannot even blame them, since it's perfectly legal. I don't think they even mean to write obfuscated code, it's just they way they're used to do it.

My favourite snip is from Subottin's famous (and often copied) range coder:
while ((low^(low+range))<TOP || range<BOT && ((range=-low & (BOT-1)),1))

Sure enough, it's legal and it works just fine. When you think about it for a moment, then the intent becomes clear, too. However, when you glance at it for the first time, "WTF!?" is probably your first impression. :-)

##### Share on other sites
Quote:
 Original post by Splinter of Chaospseudo code:

You mean --size instead of --i, right? But why would you see if size-2 is greater than zero (btw nonnegative would make more sense) and decrease size by two in two steps after that? Why not just decrease size by 2 immediately? I would write it this way:
float addEveryOtherElem(float array[], int size){    float sum = 0;    while((size-=2) >= 0)        sum += array[size];    return sum;}


text:
# Add object constraint to a number of selected objects

I have a large number of objects, and I wish to add a Track to constraint to each object. When I select the group of them and then add the constraint, it is added to only the active object, of course. How can I add the constraint to all selected objects?

• Do you want these to have a target? – iKlsR Aug 14 '13 at 15:57
• Yes, I want them all to have the same target. Basically, I want them all to have the same constraint. – Jason Aug 14 '13 at 16:14

1. With the objects selected, add the desired constraint to the active object.
2. From the 3D View header menu choose Object > Constraints > Copy Constraints to Selected Objects.

All the objects will now have the same constraint.

This method doesn't require an add-on to work.

• That is exactly what I was looking for! I can't believe I never noticed this menu before. I also see it has a Clear Object Constraints command, which I now know is a thing! – Jason Aug 15 '13 at 16:47
• This does not appear to work in newer versions of Blender. – VRM Aug 24 '17 at 19:31
• @VRM I've just checked in the 2.79 release candidate and it still works. – Ray Mairlot Aug 25 '17 at 12:57
• I was using a different branch when testing, my bad – VRM Aug 25 '17 at 14:34

I discovered how to do this using an add-on.

2. Use Ctrl+C to activate the menu

3. Choose "Copy Selected Constraints"

This doesn't let you modify the constraints, though, or remove them.

• This addon has restored the old inbuilt functionality of pre 2.5 versions. Very useful in my opinion. – Haunt_House Aug 14 '13 at 19:48

You could also just loop through the selected objects and apply the contraint to each one.

The line with objs.target is an example of how to set the target object. In this example, I assume that all the selected objects will have an Empty as the target.

import bpy
context = bpy.context

for x in bpy.context.selected_objects:
objs = x.constraints.new(type='TRACK_TO')
objs.target = context.scene.objects.get("Empty")

• I like this answer because it gives me more flexibility than my discovered answer, but it's also a lot more complex than just using an add-on. – Jason Aug 14 '13 at 16:13
• @Jason it is very simple to use actually, just drop it into the text editor and run it as you need it. If need be, you can also put it into a small addon and map a shortcut to it. Also, based on your comment on the question, if you want to add a new object with the same constraint and target, just select it and run the script again. – iKlsR Aug 14 '13 at 16:15
• I'm comfortable using Python to manipulate Blender, but this seems like a task that someone might want to do who was a relative newcomer to Blender. For newcomers, Python can be intimidating. For complicated tasks that are relatively uncommon, I think a Python solution is fine, but for a task that is simple or common, I would rather there be a UI solution. – Jason Aug 15 '13 at 16:45
• That being said, your solution did show me how to create a new constraint using Python, which is something that I was having trouble with. – Jason Aug 15 '13 at 16:45


text:
# Quantitative finance with zipline

As stated in the [dInvest post series]({% post_url 2017-01-10-dinvest %}) the idea is to build a hedge fund in a blockchain. Due to computational limitations, it is not feasible to implement investment agents in the blockchain. In dInvest an investment agent should do the following: (1) Get a list of all available financial assets to trade; (2) based on the data given (i.e. financial data and fundamentals data) make a recommendation which assets to buy; (3) keep track of which assets the agent is currently holding; and (4) send the recommended assets to buy to the blockchain. In this blog post I will cover the first three tasks. But what does a hedge fund actually do and how do financial investment strategies look like? I had taken some courses in my undergrad on international finance, but as a computer scientist I had to learn some new concepts while doing this project.

Financial investments can take different forms. A hedge fund offers multiple individuals to acquire a part of the pooled investment, which itself invests in publicly traded financial assets. It is measured according to its absolute returns [1]. A manager administrates the investment of the hedge fund and takes the decisions to buy, sell, or hold financial assets to balance absolute returns and risks. A hedge fund may apply different strategies. Hedge funds can follow one specific strategy, mix established strategies, or create a fund out of hedge funds to diversify [2]. The majority of hedge fund strategies try to optimize the absolute return and risk based on financial indicators of the assets to be invested in. An overview of the different strategies that are currently applied by different hedge funds is provided by HFR, Inc in [3]. Measuring the performance of hedge funds as well as specific influence factors is a wide research area, which is covered in more detail in our report.

## Measuring success of investments

A common standard in literature and the investment practice to compare hedge funds is based on their absolute returns, Sharpe ratio, alpha and beta as well as a comparison to benchmarks [2].

• Returns: The return of the fund is influenced by how well the strategy is able to determine assets that are increasing (for long buys) or decreasing (for short buys) in value over time.
• Sharpe: With the Sharpe ratio one can determine the return in respect to the risk involved. The Sharpe ratio is calculated by dividing the sum of the asset return and a benchmark return by the standard deviation of the asset return. The higher the Sharpe ratio, the higher the return with the same risk or the lower the risk with same return.
• Alpha: The alpha value expresses the risk-adjusted performance of the fund in comparison to a benchmark. An alpha of zero means exact performance as the benchmark. A positive value indicates outperforming the benchmark and a negative value represents falling behind the benchmark.
• Beta: The beta value shows the volatility of the fund in comparison to a benchmark. The beta value baseline is one and represents the same volatility as the benchmark. A value below one indicates a lower volatility and consequently a value above one a higher volatility than the benchmark.

## Quantitiative finance

To implement an investment strategy, certain rule sets are developed and applied. Quantitative finance ”translates” economic models into the mathematical world and allows to apply for example stochastic analysis over shares or calculate the value of derivatives [4]. Quantitative finance techniques express investment strategies in mathematical formulas and thus enables a translation into an algorithm [4]. When starting out with dInvest, we were looking into existing quantitative frameworks, that offer us (1) a simulation environment to test our algorithms without using actual money, (2) realistic conditions of the trading market, such as fees and process delays, (3) is able to trade shares and derivatives based on historical data to test our algorithm, (4) provide little delay (lower than 10 minutes) in trading current assets, and (5) is able to be controlled using a programming language (such as Python, Java, or Scala). We evaluated several solutions decided to use the open source implementation of the Quantopian framework zipline.

## Getting started with zipline

Zipline is based on python and is able to run with python 2 and 3. Quantopian has created a beginners tutorial on their website. Before going into the details of zipline, let us look into how to set it up locally. Note: I will be using python3 throughout this post. To install zipline you first need all the required C extensions. For Debian based distributions use the command shown below, otherwise there are some more details provided here.

sudo apt-get install libatlas-base-dev python-dev gfortran pkg-config libfreetype6-dev

I then created a virtual environment for Zipline. If you have never setup a virtualenv follow this tutorial. In case you want to use pyhton3 like me, make sure to use the python3 executable. Also, when trying python2 I ran into a couple of issues as Linux Mint uses older versions of python2, which seem to be incompatible with the required version of numpy. When you setup your virtualenv, run pip install zipline from the terminal with your virtualenv . This will install all the required packages including numpy and most likely take some time.

## The first investment algorithm

In the /zipline/examples folder you will find some example algorithms to try out. In their beginners tutorial the zipline authors describe some of the algorithms, how they are generally structured and how to execute them. I will go into more detail about having a value investment algorithm and not take one of the example algorithms.

The algorithm to be implemented is inspired by Benjamin Graham [6]

1. Select shares and derivatives of companies with a market capitalization of minimum 100 million dollars
2. Determine the SIC code of each asset [5] and exclude the ones contained in the blacklist from the hedge fund
3. Based on the sectors of the companies find the two sectors with the price of assets per earning ratio (PE ratio)
4. Invest every month in all the companies listed in the two sectors

Let's take a look at our algorithm. It is basically taken from the web-based version of zipline called Quantopian and can be found here. I have tried to include quite some comments, so if you are familiar with python then the code should be quite readable. Zipline does not include the full functionality and data to realize the investment algorithm. The market capitalization data, sector codes, and PE ratio are not accessible from zipline. For a quick overview of the current code and the changes I made, I will go through the main functions. Also, please note that I only used free sources of financial data. There seem to be a lot of other sources available, but they have their price tag.

initialize(context) Defines the number of sectors we are interested in and also schedules to execution of our algorithm for back-testing.

rebalance(context, data) This essentially takes to selected assets and distributes them evenly into our portfolio.

get_fundamentals(context, data) In Quantopian this is fairly easy, since the Morningstar fundamentals dataset is included. However, in zipline I had to find a workaround. Quandl offers the SF0 fundamentals for free: www.quandl.com/data/SF0-Free-US-Fundamentals-Data. To get a full view of the data, I choose to download the whole data as a CSV file and automated the process. An example of how to do this can be found in the TradeHandler.getData(self) function here.

get_sectors(key) Again, this is included in Quantopian, but needs a manual workaround. To get the sector codes it is quite simple. You need to download a txt file, which includes the sector codes and the function will read them into a dict.

get_sector_code() Also, this part is included in Quantopian. Here we download a JSON file to get a mapping of sector codes to the financial assets we are trading.

To analyse the performance of the investment algorithm the absolute returns, Sharpe, alpha, and beta for the period of January 1, 2009 to November 15, 2016 is compared. The investment algorithm uses the Quandl financial data i.e. opening and closing prices of specific assets during that period [8]. The algorithm is executed multiple times. First, no sectors are excluded and second, an exclusion list based on sectors is used. Defense, beer and alcohol, tobacco, and coal industry are excluded based on ESG criteria and common practices [9]. The first graph in the figure below presents the returns achieved by the unrestricted algorithm, the algorithm with single excluded sectors, and the benchmark return. These returns show that unrestricted and single excluded algorithms have overall a higher profit than the benchmark. The second graph in the figure displays a combination of two excluded sectors and the benchmark return, while the third graph elaborates on the combinations of three and all four sectors excluded. A single or combination of exclusions constantly perform better than the benchmark until beginning of 2012. Then the unrestricted algorithm as well as the single exclusion of defense and alcohol exclusion and also the combination of tobacco and coal, defense and alcohol, defense and coal exclusions drop until they recover in 2014. The other single and combination algorithms do not show this drop, but also have a strong increase in returns in 2014. Then all variations show high volatility. The drop in 2012 in the unrestricted algorithm is caused by three of the sectors it is investing in. When tobacco is restricted, there is no strong drop in 2012. However, if not also in combination defense and/or coal is restricted the algorithm selects either of the two industries instead and another drop occurs. In the third graph of the figure these exclusions are combined and no significant drop occurs, however the volatility remains.

There is further analysis and discussion of the results in our report.

## References

1. D. Harper. (2016) Hedge funds hunt for upside, regardless of the market. [Online]. Available: http://www.investopedia.com/articles/03/112603.asp
2. M. Agarwal, Hedge Fund Strategies. John Wiley & Sons, Inc., 2009, pp. 45–55. ISBN 9781118258187. [Online]. Available: http://dx.doi.org/10.1002/9781118258187.ch4
3. Hedge Fund Research. (2016) HFR hedge fund strategy classification system. [Online]. Available: https://www.hedgefundresearch.com/hfr-hedge-fund-strategy-classification-system
4. P. Wilmott, Paul Wilmott on quantitative finance. John Wiley & Sons, 2013.
5. U.S.D. of Labor. (2016) SIC division structure. [Online]. Available: https://www.osha.gov/pls/imis/sic_manual.html
6. B. Graham and D. Dodd, Security Analysis: Sixth Edition, ser. Security Analysis Prior Editions. McGraw-Hill Education, 2008.
7. Quantopian. (2016) zipline: Pythonic algorithmic trading library. [Online]. Available: https://github.com/quantopian/zipline/
8. Quandl. (2016) Quandl: financial database. [Online]. Available: https://www.quandl.com/browse?idx=database-browser
9. J. R. Evans and D. Peiris, “The relationship between environmental social governance factors and stock returns,” UNSW Australian School of Business Research Paper No. 2010ACTL02, 2010.


text:
# Map an integer from decimal base to hexadecimal with custom mapping JavaScript

Usually when we convert a decimal to hexadecimal (base 16) we use the set 0123456789ABCDEF to map the number.

We are required to write a function that does exactly the same but provides user the freedom to use any scale rather than the one mentioned above.

For example −

The hexadecimal notation of the decimal 363 is 16B
But if the user decides to use, say, a scale ‘qwertyuiopasdfgh’ instead of
‘0123456789ABCDEF’, the number 363, then will be represented by wus

That’s what we are required to do.

So, let’s do this by making a function toHex() that makes use of recursion to build a hex out of the integer. To be precise, it will take in four arguments, but out of those four, only the first two will be of use for the end user.

First of them will be the number to be converted to hex, and second the custom scale, it will be optional and if it is supplied, it should be a string of exactly 16 characters otherwise the function returns false. The other two arguments are hexString and isNegative which are set to empty string and a boolean respectively by default.

## Example

const num = 363;
const toHex = (
num,
hexString = '0123456789ABCDEF',
hex = '',
isNegative = num < 0
) => {
if(hexString.length !== 16){
return false;
}
num = Math.abs(num);
if(num && typeof num === 'number'){
//recursively append the remainder to hex and divide num by 16
${hexString[num%16]}${hex}, isNegative);
};
return isNegative ? -\${hex} : hex;
};
console.log(toHex(num, 'QWERTYUIOPASDFGH'));
console.log(toHex(num));
console.log(toHex(num, 'QAZWSX0123456789'))

## Output

The output in the console will be −

WUS
16B
A05


text:
Main Features

This chapter does not go into technical details but presents an overview of the main features in pdfChip so that you know what is possible. Use the pdfChip Reference Manual to look up the details about those features if they would come in handy.

HTML, CSS and Javascript

Because pdfChip is built on top of a WebKit HTML rendering engine, it supports almost all features of HTML and CSS and can take full advantage of Javascript. In general pdfChip follows all HTML rules, so you can include CSS, Javascript, images etc. just as you would while designing a web site. Except for the pdfChip specific features (customised HTML elements and CSS properties) you can even preview your HTML file in a browser or in an HTML design tool.

As with regular HTML for a web site, you can choose to insert your CSS and Javascript in your main HTML file or you can separate them in CSS and Javascript files; pdfChip will process them correctly either way.

To define items not supported by HTML or CSS, pdfChip uses custom HTML elements and custom CSS properties. Their name always begins with cchip, data-cchip or -cchip and they are normally ignored by a browser (the reason there are different prefixes is to keep the HTML and CSS W3C-standard compliant). The tutorial examples provide interesting techniques to use this fact so that the HTML looks one way in a browser but another way when pdfChip converts it into PDF.

Page sizes and page boxes

While HTML normally lives in a browser, PDF is often meant to be printed. This means that the page size is very important and that additional page boxes may have to be defined; a page box is a rectangle that has special meaning and is used in a particular way by professional publishing solutions. pdfChip supports this by using the @page CSS rule set:

@page {
size: 229mm 317mm;
margin: 20mm;
-cchip-trimbox: 10mm 10mm 209mm 297mm;
}

This example defines an A4 sized page of 20,9cm wide by 29,7cm tall (using the cchip-trimbox property) and provides an additional white area around that page to add information that shouldn't be printed, such as the name of the document, time and date, color bars or printer marks (using the size property). Check the pdfChip Reference Manual for all page box definitions.

Additionally the margin property is used to provide 2cm of margin inside the page - keeping away the HTML content from the edge of the page.

Professional color

HTML and CSS provide a number of properties to define color, such as the color property to set the foreground property and the background-color property to set the background color. These properties either accept predefined names (such as "white" or "yellow") or an RGB color code.

pdfChip provides additional color definitions in order to be able to create PDF documents that will print correctly or that comply to standards. The example below shows a background and foreground color for a paragraph element.

p {
background-color: -cchip-cmyk(1.0,0.0,0.0,0.0);
color: -cchip-cmyk( 'Spot Black', 0.0, 0.0, 0.0, 1.0, 0.5 );
}

The background color is defined as CMYK using the cchip-cmyk value; given the color values provided the background color will be set to a pure cyan CMYK color. The foreground color uses a modified value that causes pdfChip to generate a spot color (or named color) called "Spot Black" and sets the background color to 50% of that spot color.

Keep in mind that both color properties will be completely ignored if you open the HTML in a browser, as the browser will not understand the cchip-cmyk value. It is only because pdfChip uses a customised processing engine that this works.

Font support

CSS already allows you to specify high-quality fonts for your web pages. The only problem is that not all browsers support the same types of fonts, which often leads to very convoluted @font-face definitions. Because pdfChip is only dependent on WebKit, an CSS file for use by pdfChip typically requires a simple font definition, such as the following:

@font-face {
font-family: 'FreeUniversal-Regular';
src: url('../fonts/freeuniversal-regular.ttf');
font-weight: normal;
font-style: normal;
}

This specifies the location of the Free Universal font and defines how it can be used in the remainder of the CSS file. The WebKit engine supports most modern fonts (including TrueType and OpenType) and because you only need to make sure it works correctly in pdfChip, testing is much simpler too.

Using PDF and SVG

Of course you can use various types of images, such as PNG and JPEG images in your HTML. pdfChip inserts those images in the generated PDF. If you use an image more than once, it will only be inserted once in the resulting PDF document.

Browsers can include SVG (Scalable Vector Graphics) files just as they can images; the following example includes an SVG image and works correctly in all browsers and in pdfChip.

You can also embed the SVG code immediately into your HTML file and this too is supported by browsers and pdfChip alike. The following example inserts a five-pointed star using SVG.

<svg width="100mm" height="100mm">
<polygon points="100,10 40,198 190,
78 10,78 160,198"
style="fill:lime;stroke:purple;
stroke-width:5;
fill-rule:nonzero;"/>
</svg>

It's important to note that pdfChip doesn't rasterize the SVG; it isn't converted into an image. Instead it is inserted in the PDF so that there is no quality loss, even if the PDF is afterwards scaled up or printed on a high-resolution output device.

But pdfChip goes further than supporting regular images and SVG files; it also supports the insertion of PDF documents directly. Look at the following HTML fragment:

A regular browser will not display this image, because it doesn't support PDF documents as the source for images. pdfChip does, and for this example will insert the second page (page=2) of the given PDF document into the result PDF.

Again no rasterisation takes place - even better - the PDF file is taken as is and inserted into the result PDF with as little changes as possible. This means that pdfChip can easily be used to accomplish impositioning for example (a process where a large sheet is filled with pages from an input PDF so that it can be printed and afterwards cut and folded to a magazine or newspaper for example). But even for less advanced workflows, it means that a resolution independent graphic (a PDF) can be used instead of a plain image.

ISO compliant PDF

Over the years the ISO (International Standards Organisation) developed a number of important standards around PDF; the two most important once are:

• PDF/X: a standard to allow optimal file exchange in graphic arts workflows and,
• PDF/A: a standard to allow long-term (50 years or more) PDF file archival.

pdfChip supports both standards through custom HTML elements. Consider the following example HTML:

<meta property="cchip-pdfx" content="PDF/X-1a">
href="./templates/outputintent.pdf"/>

The custom meta element with its name set to "cchip_pdfx" instructs pdfChip that the PDF it outputs should have the correct PDF/X identification tags inserted. The content attibute is set to "PDF/X-1a" which identifies the PDF/X version further as PDF/X-1a, currently the most commonly version of that standard.

The link element is also important here; PDF/X files need to contain an output intent and the link element points to a PDF document that contains the output intent we want for our resulting file (a template file if you want). pdfChip will parse the PDF file that is pointed to ("outputintent.pdf" in our example) and copy its output intent into the PDF file is generates.

pdfChip supports more standards; you can find the full list and instructions in the pdfChip Reference Manual. Beware of a potential pitfall however: when pdfChip sees these instructions, it merely inserts the correct standard tags to identify the file it generates as a standards-compliant file. It is still your responsability to ensure that all content in the generated PDF conforms to that standard!

Metadata is often very important in document workflows and PDF uses XMP (Extensible Metadata Platform) to carry metadata inside the PDF document. Because metadata is so important, pdfChip has a way to insert it into the resulting PDF document.

<meta property="" content="callas documentation"
data-cchip-xmp-ns="http://www.gwg.org/jt/xmlns/"
data-cchip-xmp-prefix="gwg-at"
data-cchip-xmp-property="Publication"
data-cchip-xmp-type="Text">

This custom metaelement inserts an XMP tag called "gwg-at:Publication" which is of type "Text" and has the value "callas documentation". The prefix links to a namespace defined as "http://www.gwg.org/jt/xmlns/".

It's important to note that some standards (such as PDF/A) require that every piece of metadata inserted in a PDF document is also clearly defined by a metadata definition and pdfChip will correctly insert that information as well. The pdfChip Reference Manual has more details on the subject.

Support for JavaScript

Perhaps the most powerful aspect of pdfChip and its WebKit foundation is that Javascript is fully supported, and that you can use it just as you would in a browser environment. WebKit really does behave like a browser in almost every aspect and that means you can include Javascript functions to examine and change the HTML DOM (Document Object Model) for example. This you can use Javascript to change properties of elements in your HTML file or to insert completely new elements altogether.

You can insert script tags in your HTML file or - just as you're used to on a web site perhaps - you can link to separate script files. Script files you have written or that you downloaded from the Internet. In some of the tutorial examples you'll see JQuery used to manipulate HTML elements and insert new elements. You'll see such advanced scripting functionality come back again as we discuss supporting MathML in the following section.

In the tutorial samples JQuery was downloaded and included in the sample's file structure. However, you can also refer to online Javascript; just be careful if the Javascript calls you make are asynchronuous, pdfChip provides support functions to make sure this works well during conversion.

Javascript also allows implementing scenarios where a lot of external data (data coming from a database for example) needs to be integrated. While your Javascript functionality will not be able to extract data from the database directly, there are way to connect to a URL and gather data (using proxy classes written in another scripting language such as PHP to interrogate the database and return the information requested as XML) and there are ways to read for example CSV files. Together with the possibilities to easily create as many pages as you want during conversion of PDF, this is ideal for many variable data or transactional printing workflows.

Beautiful formulas with MathML

In some workflows it is important to be able to include nicely formatted mathematical formulas in the generated PDF document (think about textbooks for example). HTML has the possibility to define formulas by using MathML. The following is a MathML representation of probably the most famous formula of all times, thanks to Albert Einstein:

<math xmlns="http://www.w3.org/1998/Math/MathML">
<mrow>
<mi>E</mi>
<mo>=</mo>
<mrow mathcolor='#cc0000'>
<mi>m</mi>
<mo></mo>
<msup><mi>c</mi><mn>2</mn></msup>
</mrow>
</mrow>
[/itex]

Converting this MathML into a beautiful formula can be done in a number of different ways; the tutorial shows how to use the MathJax Javascript library to accomplish this.

Inserting barcodes

Barcodes have become almost omnipresent on printed material and the variety of barcodes used is staggering. Annoyingly barcodes are not supported in HTML; there are work-arounds through the use of barcode fonts, but these sometimes lack quality and are limited in the types of barcode they can represent. There is no good solution for 2D barcodes such as QR codes just to name one.

pdfChip itself does support barcodes, through the use of the barcode generator TBarCode from TEC-IT Datenverarbeitung GmbH (www.tec-it.com). Just about any barcode you can think of is supported by inserting a custom object in the HTML file as such:

<object class="barcode" type="application/barcode"
style="width:30mm; height:30mm;">
<param name="type" value="QR-Code">
<param name="data" value="http://www.callassoftware.com">
</object>

To use this functionality, you must have an object element in your HTML file and its type must be set to "application/barcode". The different param nodes of this object then provide the necessary input for the barcode generator, most importantly the type of barcode you want to insert and its value. pdfChip would convert the above example in the following QR-code, linking to the callas software web site:

The pdfChip Reference Manual provides full information on all of the supported barcode types and what their parameters should be. It is very important to stress however that pdfChip does no barcode validation, so the parameters you specify should be correct and suitable for the type of barcode you want. If not, pdfChip will return an error or create an incorrect barcode.

Generating multiple pages

How can you generate multiple 'copies' of your HTML content? If you have a business card layout in HTML, or a form letter... how can you generate a PDF file with thousands of pages, where each page has been tweaked (for example to change names, or addresses or background images or...)?

pdfChip supports this through the use of a predefined Javascript function called cchipPrintLoop(). If you define this function in your HTML file or in one of the Javascript files included in your HTML file, it will be called automatically by pdfChip. In it you can setup a loop that modifies the HTML DOM (replacing place holder elements with data you load from a CSV file perhaps) and then calls the cchip.printPages function. This is a member function of the cchip object and it outputs your HTML file in the state it is at that moment and inserts the generated PDF into the output PDF. You can call cchip.printPages multiples times and each time the generated PDF pages will be added to your output. A simple example could look like this:

function cchipPrintLoop() {
for (var i=0; i < 10; i++) {
/* Modify HTML DOM here */
cchip.printPages();
}
}

In this example, the HTML DOM isn't actually modified (there's just the comment explaining where you could do this) so the output PDF will consist of 10 identical copies, all concatenated together into your output PDF document. The tutorial contains a few examples of more complex setups where you can see how this could be used to create variable data type documents for example.

Remark that the generated PDF in this example isn't necessarily 10 pages long! If you have an HTML file which converts into a multiple page document, you'll get 10 multiple page PDF files concatenated together. So if your HTML generates a two-page letter, the resulting PDF if you use the above print loop function will be 10 times 2 pages, or 20 pages.

Different than the previous section, advanced pagination comes into play not if you want multiple copies of the same document, but if you have long document which paginates into multiple pages. Think about a book for example: very long HTML that generates a PDF file with potentially hundreds of pages.

The problem with such files is how to add features such as running headers or page numbers, and pdfChip has special support for such environments through something called overlays and underlays. How does this work?

The problem with pagination

The problem with pagination is that you cannot place page numbers in your original HTML file for example, because you do not yet know how the content will be paginated. And it's hard to predict (and guessing is never a good strategy) where an advanced layout engine such as WebKit will break content into pages.

What you need to overcome this is a sort of two-stage process, where your HTML file would be divided into pages and where you then get the possibility to add additional content to your document. And that is exactly what pdfChip allows, it actually even has a three-stage process.

Multiple processing steps

In the first chapter of this book, the command-line for pdfChip was introduced as:

pdfChip <Path to HTML file> <Path to PDF file>

This command-line provides the simple one-stage conversion process that is also used in most tutorial examples. But the command-line allows additional arguments like this:

pdfChip <Path to HTML file>
--underlay=<Path to underlay HTML file>
--overlay=<Path to overlay HTML file>
<Path to PDF file>

We still start with the main HTML file. This is the HTML that contains the content we want to convert into a PDF file. But this is followed by an --underlay and/or --overlay command (both are completely optional). If one of these arguments is present, pdfChip does a second and/or third processing step.

First the main HTML file is converted into PDF; after this the pagination is done. The HTML has been converted using the WebKit layout engine and it is now known how exactly the document is going to be converted into PDF pages. The additional passes for the underlay or overlay can use this information to their advantage. When all conversions are done, the underlay PDF document is inserted into the output PDF document; all of its content is inserted underneath the content that is already there (hence the name underlay). The same happens with the PDF generated by the conversion of the overlay HTML but this content obviously is added on top of the output PDF.

The cchip object

During the first pass, pdfChip stores a lot of information about the document in the cchip object and the print loop of the underlay or overlay HTML file can use this (we already mentioned the cchip object when introducing multi-page PDF generation earlier. Consider this simple example of an overlay print loop

function cchipPrintLoop() {
for (var i=0; i < cchip.pages.length; i++) {
\$('#overlay-pagelabel p:first').text("page " + (i+1));
cchip.printPages();
}
}

Our overlay HTML is a very simple one-page file for this example. The print loop queries the cchip object to figure out how many pages resulted from paginating the main HTML file. Then it generates the same amount of pages, but each time there is a JQuery expression to change the page number (an object in the overlay HTML identified by the ID "overlay-pagelabel") to the correct value. The result is a paginated file that gets the page numbers neatly added in the second pass pdfChip makes.

Limitations

While pdfChip is very similar to a browser and while WebKit gives it a lot of flexibility and power, there are still a few limitations you should keep in mind.

Columns

The CSS properties to generate multiple columns are not supported by pdfChip. Basically pdfChip behaves like the printable version of such content which normally always has one column. Specifically this means that you should not rely on the column-count, column-gap and column-rule properties.

There is a potential work-around through the CSS regions concept, even though this is not an integral part of the CSS standard yet. But WebKit supports it and it is a very powerful layout technology.

Canvas

The HTML5 canvas is an HTML element that allows drawing graphics on the fly somewhere in an HTML page. It's a powerful technique but you should not, or only after lots of testing, use it in combination with pdfChip. The reason mainly has to do with how the canvas is converted into PDF and most of the time that will be through rasterisation. This means you end up with a PDF document that contains a rasterised version of your canvas content which is typically not what you want.

In most cases look at SVG as a more powerful technique to include arbitrary drawing in our HTML file and maintain it while converting to PDF.


text:
SMS scnews item created by Lachlan Smith at Mon 1 Jun 2020 1812
Type: Seminar
Distribution: World
Expiry: 27 Jul 2020
Calendar1: 5 Jun 2020 1600-1700
CalLoc1: Zoom
Auth: lachlans@105.66.233.220.static.exetel.com.au (lsmi9789) in SMS-WASM

# Sydney Dynamics Group: Bob Dewar -- Time-dependent relaxed magnetohydrodynamics -- inclusion of cross helicity constraint using phase-space action

Dear all,

This week, Friday June 5, Bob Dewar (ANU) will give a talk at 4pm (Sydney time) via
Zoom.
Meeting ID: 964 1871 5544

Title: Time-dependent relaxed magnetohydrodynamics -- inclusion of cross helicity
constraint using phase-space action

Abstract: A phase-space version of the ideal MHD Lagrangian is derived from first
principles and shown to give a relabeling transformation when a cross-helicity
constraint is added in Hamilton’s Action Principle.  A new formulation of time-dependent
\emph{Relaxed} Magnetohydrodynamics (RxMHD) is derived using microscopic conservation of
mass, and macroscopic constraints on total magnetic helicity, cross helicity and entropy
under variations of density, pressure, fluid velocity, and magnetic vector potential.
This gives Euler--Lagrange equations consistent with previous work on both ideal and
relaxed MHD equilibria with flow, but generalizes the relaxation concept from statics to
dynamics.  The application of the new dynamical formalism is illustrated for
short-wavelength linear waves, and the interface connection conditions for Multiregion
Relaxed MHD (MRxMHD) are derived.  The issue of whether $\vec{E} + \vec{u}\cross\vec{B} = 0$ should be a constraint is discussed.

Past talks can be found on the YouTube channel:


text:
# nLab Cite — Diaconescu-Goodman-Myhill theorem

### Overview

We recommend the following .bib file entries for citing the current version of the page Diaconescu-Goodman-Myhill theorem. The first is to be used if one does not have unicode support, which is likely the case if one is using bibtex. The second can be used if one does has unicode support. If there are no non-ascii characters in the page name, then the two entries are the same.

In either case, the hyperref package needs to have been imported in one's tex (or sty) file. There are no other dependencies.

The author field has been chosen so that the reference appears in the 'alpha' citation style. Feel free to adjust this.

### Bib entry — Ascii

@misc{nlab:diaconescu-goodman-myhill_theorem,
author = {{nLab authors}},
title = {{{D}}iaconescu-{{G}}oodman-{{M}}yhill theorem},
howpublished = {\url{http://ncatlab.org/nlab/show/Diaconescu-Goodman-Myhill%20theorem}},
note = {\href{http://ncatlab.org/nlab/revision/Diaconescu-Goodman-Myhill%20theorem/2}{Revision 2}},
month = jan,
year = 2021
}

### Bib entry — Unicode

@misc{nlab:diaconescu-goodman-myhill_theorem,
author = {{nLab authors}},
title = {{{D}}iaconescu-{{G}}oodman-{{M}}yhill theorem},
howpublished = {\url{http://ncatlab.org/nlab/show/Diaconescu-Goodman-Myhill%20theorem}},
note = {\href{http://ncatlab.org/nlab/revision/Diaconescu-Goodman-Myhill%20theorem/2}{Revision 2}},
month = jan,
year = 2021
}

### Problems?

Please report any problems with the .bib entries at the nForum.


text:
# Creating a composite indicator using pca, cfa or addition

I need some advice to decide which aggregation method is better in my case. I want to create an aggregated variable which is a composite of 16 variables. All 16 variables are part of one big concept, so I think I could use PCA or CFA for this task. I need only one variable and not 16, since I will use it later as an independent variable in the regression analysis. My Cronbach's alpha is near 0.87 which is very good; however, since I have 16 items, it is not very reliable.

So first, I decided to use PCA, because I have a task of dimension reduction. However, a cumulative variance of the first factor is 0.55 and eigenvalues are low. I use predicted factor score in my regression and did not get the significant results. Then, I tried the factor , pf command from STATA and got much higher cumulative variance, 0.85, and eigenvalue for the first factor is above 8 (other methods like ML, PCF did not give me good results). I can also predict factor scores using this command. I am not sure, however, if I can use the command for EFA ( factor , pf as far as I understand is only for EFA, and for CFA I have to use SEM) to do CFA, and whether CFA is appropriate in this case.

My second question: are there some measures of goodness that could help me to choose between methods?

The last question is about $z$ scores: My 16 variables come from text mining and they are word counts that describe special topics, which could be aggregated to the bigger supertopic. Do I need to generate $z$ scores before doing PCA/CFA here? All variables are measured in the same way.

• Factor analysis cannot account for more of the total variance than PCA can. So that you say EFA gives you higher percentage could be due to it giving you percent of the common, not total, variance, perhaps. – ttnphns Aug 3 at 6:41

The last question is about $z$ scores: My 16 variables come from text mining and they are word counts that describe special topics, which could be aggregated to the bigger supertopic. Do I need to generate $z$ scores before doing PCA/CFA here? All variables are measured in the same way.


text:
mersenneforum.org Trial Divison Improvement
 Register FAQ Search Today's Posts Mark Forums Read

 2016-11-30, 02:20 #1 carpetpool     "Sam" Nov 2016 22·83 Posts Trial Divison Improvement I also wanted to mention the trial division of numbers (of special forms) in PFGW for (a^n-b^n)/(a-b) (with prime n) for integer roots a, b should be reduced to only trial dividing numbers of the form 2kn+1 (or if it is faster, sieving values of 2kn+1 and then trial dividing). Although little interest is shown in finding prp factors of (a^n-b^n)/(a-b) other than the Mersenne Cofactors, I would strongly appreciate more and more searches for these factors from others. I am working hard at prp testing factors generalized base repunit forms, and a^n-b^n where a = b+1 more specifically. Thanks if someone knows how to do the trial division of these forms.
 2016-11-30, 03:48 #2 paulunderwood     Sep 2002 Database er0rr F8916 Posts From pfgwdoc.txt: Code:  -f[percent][[{Mod_Expr}][{condition}[{condition}...]]] Modular factoring: -f{801} uses only primes which are of the form k*801+1 -f{632,-1} uses only primes which are of the form k*632-1 ** The {801} and the {632,-1} are the optional {Mod_Expr} *** NOTE new code added to do both -1 and +1. the format would be -f{801,+-1} (the +-1 MUST look just like that) -f{256}{y,8,1) uses only primes which are of the form k*256+1 where the resultant primes are also of the form j*8+1 -f{256}{n,8,1) uses only primes which are of the form k*256+1 where the resultant primes are not of the form j*8+1 -f500{256}{y,8,1){y,8,7){n,32,1) uses only primes which are of the form k*256+1 where the resultant primes are also of the form j*8+-1 but not j*32+1. There is also a 500% factoring level. -f{8132}{y,8,1){f,8132} uses only primes which are of the form k*8132+1 where the resultant primes are also of the form j*8+1. Also, all factors of 8132 (2,19,107) are checked first. -f{8132}{y,8,1){p,8133} uses only primes which are of the form k*8132+1 where the resultant primes are also of the form j*8+1. Also, ALL primes <= 8133 are checked first. Note this is also available within the ABC and ABC2 file formats, and within those formats, expressions can also be used. Last fiddled with by paulunderwood on 2016-11-30 at 03:51

 Similar Threads Thread Thread Starter Forum Replies Last Post siegert81 Factoring 5 2011-06-13 02:58 bsquared Software 15 2010-09-28 19:00 Random Poster Factoring 4 2010-02-12 03:09 jasong Software 3 2007-11-23 04:06 Kevin Software 1 2002-08-26 07:57

All times are UTC. The time now is 23:16.

Tue Jan 18 23:16:29 UTC 2022 up 179 days, 17:45, 0 users, load averages: 1.40, 1.58, 1.41