Entropy in chaos dynamics

Question: I'm curious about how entropy is defined within chaos theory. Are there analogous laws similar to the second law of thermodynamics? How do we define steady-state or equilibrium within the state space of a system governed by chaos theory? Is the dynamics considered reversible in principle? These questions highlight my lack of understanding, and I would greatly appreciate it if someone could kindly explain these concepts or provide any related information that would clarify them.
Comment: This answer provides good references https://physics.stackexchange.com/a/461281/226902. In general, if you know everything about a classical dynamical system (chaotic or not) then there is no entropy (you can think of entropy as  "ignorance"). Moreover, isolated chaotic systems are reversible (three masses orbiting each other is an example).
Answer: I think those questions you are asking are pretty much exactly what "foundation of statistical mechanics" deals with. This is because either quantum or classical, you can view the time evolution of a physical system as a continuous time dynamical system (obeying Newton's equation of motion or the Schrodinger equation). I can't give a full lecture here, but I can try to point out to some key words or concepts.

Are there analogous laws similar to the second law of thermodynamics?

The second law of thermodynamics should rather be something that is derived from chaos theory setups. For example, a box of air molecules is a dynamical system with approximately $6\times 10^{23}$ degrees of freedom, that happens to be chaotic. Can we derive the fact that (for the vast majority of initial configurations) after sufficient time evolution, the system's macroscopic observables converge to a static value (that is uniquely determined by some few observables of the initial state)? is the question of deriving thermodynamics and statistical mechanics from dynamical systems (Newtonian or quantum mechanics, to be precise).
But if you don't want to go that deep, I can also point out that there's a concept called Kormogorov-Sinai entropy that characterizes how much chaotic a trajectory is in a dynamical system, and assigns "entropy" to it. How this KS entropy actually connects to thermodynamic entropy though, could be fairly subtle.
One of the most common ways to introduce statistical mechanics is to consider Liouville's theorem. This considers the setup where you start from a probability distribution of initial configurations, and then have a deterministic time evolution. In this case, if the dynamical system is chaotic, the Shannon entropy of your state increases as a function of time.

How do we define steady-state or equilibrium within the state space of a system governed by chaos theory?

That's the very core of the "foundations of statistical physics", and the eigenstate thermalization (ETH) is one of the approaches people have been looking into in the past decade or so. The basic idea of ETH (and some other approaches such as small effective dimension or typicality) is that the vast majority of states actually look macroscopically identical.
This is in some sense the biggest addition to the simple "dynamics system" framework. We are always dealing with extremely large number of degree of freedom. So, words like macroscopic (observables) pop up.

Is the dynamics considered reversible in principle?

In many setups (unitary time evolution or Newtonian dynamics without dissipation), yes, you are right, and the truly interesting thing is that we still observe macroscopically irreversible processes associated with the increase of entropy, for large systems.
I think many of the references provided in Quillo's link would also be very helpful.
Comment: Thanks! I found your explanation really enjoyable. Are you suggesting that chaotic dynamics underpins thermalization (in the first part of your answer)? It seems to me that reaching equilibrium might require dynamics governed by chaos theory as a necessary condition.
Comment: Yup! Maybe I wasn't clear enough.. >chaotic dynamics underpins thermalization
This is exactly what I meant. As a matter of fact, it is fairly well known that integrable (thus explicitly non-chaotic) systems do *not* converge to the Gibbs state! They are known/believed to converge to a state called _generalized_ Gibbs state (a quick google search with those key words gave me https://arxiv.org/pdf/1304.5374.pdf but I'm pretty sure the ref by pseudo-goldstone also explains that in depth). So yes, from these facts, it's pretty clear that chaos is very deeply related to thermalization.
Answer: In the context of quantum chaos and eigenstate thermalization, I believe this review has many of the answers you are looking for: https://arxiv.org/abs/1509.06411

Entropy in chaos dynamics


How to set an action to unpublish a comment with rules?

Question: The rules modules has default actions setup to unpublish nodes but not comments.
Do I need to use PHP to unpublish a comment?
Answer: If you choose the action "Set a data value" and a comment is visible to the action (e.g. because the triggering event is "After saving a new comment") then the data selector will let you choose
<code>comment:status
</code>
which you can then choose to set to "Published" or "Unpublished", or (via a data selection) to another available value.
Answer: I had this same issue using Flag module and this solution worked out great for
the data source was flagged-comment:status in case anyone comes across this
Answer: Make sure you have nodecomment module downloaded and enabled. If node comment module is there, then you will get comments as the first option in rules trigger.
Comment: If you are referring to http://drupal.org/project/nodecomment, it doesn't have a D7 version, and @MotoTribe still doesn't tag his questions with D7 yet :) :) :)
Comment: oops, forgot again. Anybody still on 6? ;-)


Interacting with the Raydium API

Question: I don't know much about programming. I want to interact with the Raydium API in order to swap tokens <30 secs after launch. How do I do it? A detailed guide would be great, thanks.
Answer: There are different programming languages you can do it in such as Typescript, Python and Rust. Solana library is available in all of these languages but Raydium library is not available in Python due to which you will have to manually write all the required raydium functions.
On the other hand, a similar question was answered earlier, which you can find here. The answer may not be your detailed guide, but it may serve as your starting point.

Interacting with the Raydium API


Can we distribute a package before sending it for the security code Review?

Question: Basically, we are an ISV partner and want to deploy our App to the AppExchange for our customers. But due to the shortage of time for the security review, we're unable to upload it to the AppExchange. So, we want to deploy our package to the customer's Org before the Security review without breaking any Salesforce rules.
Comment: Technically you can (though you won't be able to create patch releases, only major/minor release upgrades). However, you would be violating your master agreement with Salesforce so this is probably not a great idea.
Comment: Your comment is actually an answer, @PhilW
Answer: Technically you can install an "uncertified" app on a customer's org (something allowed because customers can create their own apps as packages if they so choose). Note that you cannot create patch releases for a package that hasn't yet passed security review, meaning any bug fixes etc. can only be made using major/minor release upgrades.
However, you would be violating your master agreement with Salesforce since you would be charging your customers for this package, so this is probably not a great idea. The agreement (this is the May 2020 version) specifically says:

Partner shall not distribute a Partner Application
unless such Partner Application has successfully passed the Partner Application Security Review.


rpm: define my own variable in spec file

Question: Is there a way to declare my own variable inside of a spec file and refer to it as %{my_var} ?
Answer: Define your variable at the beginning: %define my_var my_value and use it with %{my_var}.
According to rpm packaging guide - defining your own macros, %global can be used too.
See also: https://rpm-software-management.github.io/rpm/manual/macros.html
Answer: Sure. You use %global or %define for that. See for example the fedora firefox.spec.


Filesystem TreeView

Question: Is there a control that will allow me to click through folders on the FS? Like the left tab after you right click a file and hit explore in explorer?
Answer: I don't think there is a control to do this for you, but it's relatively easy with the TreeView control.  Check out this example.
Answer: If you're asking is there a WinForms/WPF control that will allow you to do this then the answer is no.  There is no such built-in control that can be used for this purpose.
You can however open up a modal dialog which does this by using the OpenFileDialog.
<code>using (var diag = new OpenFileDialog()) {
  var result = diag.ShowDialog();
  var fileName = diag.FileName;
}
</code>
Answer: I have written a library that might be able to help you. You can find it at: http://gong-shell.sourceforge.net/
The control you're looking for is the ShellTreeView.

Filesystem TreeView


Is $AA^*$ and $A^*A$ self-adjoint?

Question: if I have a densely defined closed linear operator $A$ and $A^* = -A$(same domain also closed). Is this sufficient that $AA^*$ and $A^*A$ are proper self-adjoint operators, assuming that we can also define both of them on a dense domain of our underlying Hilbert space. If this is true( I guess so), could anybody state the actual theorem that shows this or better: explain why the fact that the operators are closed and densely defined are important here?
Comment: well, I thought that an operator $T$ is self-adjoint if the operator is closed, symmetric, densely-defined and $T-i$,$T+i$ are onto. I think your argument only shows symmetry.
Comment: Doesn't $\langle ABx,y\rangle=\langle Bx,A^*y\rangle=\langle x,B^*A^*y\rangle \implies (AB)^*=B^*A^*$?
Comment: Since $A^*=-A$, $H=iA$ is self-adjoint and so is $H^2$. Now $AA^*$ and ${A^*}A$ are defined and coincide on the domain of $H^2$.
Comment: @Urgje okay, you did this by using what $A^*$ actually is, in this example, thank you. Is the general case also true, if yes, could I encourage you to post this as an answer? I think this will be also more valuable to other people seeing this thread who may be more interested in the general case :-)
Answer:
Lemma: Let $B : \mathcal{D}(B)\subseteq X\rightarrow X$ be a symmetric linear operator on a Hilbert space $X$ for which $(Bx,x) \ge 0$. If $I+B$ is surjective, then $B$ is closed, densely-defined and selfadjoint.

Proof: Let $B$ as stated. Suppose that $B+I$ is surjective. To show that $B$ must be densely-defined, suppose that $y \perp \mathcal{D}(B)$ and write $y=(I+B)x$ for some $x\in \mathcal{D})$. Then $y \perp x$ gives
$$
          0 = (y,x)=((I+B)x,x) \ge \|x\|^{2} \implies x = 0 \implies y = (I+B)x=0.
$$
So the domain of $B$ must be dense. $B$ is closed because $(I+B)^{-1}$ is bounded and defined on all of $X$, owing to the fact that
$$ \|x\|^{2} \le ((I+B)x,x) \le \|(I+B)x\|\|x\|,\;\;\; x \in \mathcal{D}(B). $$
Therefore $B^{\star}$ is also closed and densely-defined. Because $B$ is symmetric, then $B\preceq B^{\star}$ (meaning that $B^{\star}$ extends $B$.) To see that $B=B^{\star}$, suppose that $y \in \mathcal{D}(B^{\star})$. The proof is finished by showing that $y \in \mathcal{D}(B)$: to this end, note that there exists $z \in \mathcal{D}(B)$ such that $(I+B^{\star})y=(I+B)z$. So,
$$
    ((I+B)x,y)=(x,(I+B^{\star})y)=(x,(I+B)z)=((I+B)x,z),\;\;\; x \in \mathcal{D}(B).
$$
Because $(I+B)$ is surjective, then $z=y \in \mathcal{D}(B)$. So $B=B^{\star}$. $\Box$

Theorem [von Neumann]: Let $X$ be a Hilbert space, and let $A : \mathcal{D}(A)\subseteq X\rightarrow X$ be a closed densely-defined linear operator. Define $A^{\star}A$ on the domain
  $$\mathcal{D}(A^{\star}A)=\{ x \in \mathcal{D}(A) : Ax \in \mathcal{D}(A^{\star})\}.$$
  Then $A^{\star}A$ is a closed densely-defined selfadjoint linear operator. Because $A^{\star}$ is also closed and densely-defined, then $AA^{\star}$ is also a closed densely-defined selfadjoint linear operator.

Proof: Let $J : X\times X\rightarrow X\times X$ be defined as $J\langle x,y\rangle=\langle-y,x\rangle$. Let $\mathcal{G}(A)=\{ \langle x,Ax\rangle : x\in\mathcal{D}(A)\}\subset X\times X$ be the graph of $A$. Then it is well-known that $\mathcal{G}(A^{\star})=J(\mathcal{G}(A)^{\perp})=(J\mathcal{G}(A))^{\perp}$, where the orthogonal complement is taken in $X\times X$. Because $X\times X$ is a Hilbert space, then $X\times X = \mathcal{M}\oplus\mathcal{M}^{\perp}$ for any closed linear subspace $\mathcal{M}$ of $X\times X$. Therefore,
$$
            X\times X = \mathcal{G}(A)\oplus J\mathcal{G}(A^{\star}).
$$
Hence, for every $a \in X$, there are unique $x \in \mathcal{D}(A)$, $y\in\mathcal{D}(A^{\star})$ such that
$$
    \langle a,0\rangle = \langle x,Ax\rangle + \langle -A^{\star}y,y\rangle, \\
            a = x - A^{\star}y,\;\; y=-Ax.
$$
So $x \in \mathcal{D}(A^{\star}A)$ and $(I+A^{\star}A)x=a$. That is, $I+A^{\star}A$ is surjective on its natural domain. Now the previous lemma applies to $B=A^{\star}A$. $\;\;\Box$
Comment: When and where did Von Neumann publish this theorem? How does one cite it?
Comment: "Mathematical Foundations of Quantum Mechanics", John von Neumann, 1932. von Neumann was a student of Hilbert. von Neumann was the first to define an abstract inner product space, to prove the Spectral Theorem for self-adjoint operators on a Hilbert space. And he invented the CPU.

Is $AA^*$ and $A^*A$ self-adjoint?


Interpreting the VIF in checking the multicollinearity in logistic regression

Question: Would someone interpret the results of VIF in logistic regression the same way s/he would interpret them in linear regression?
Answer: Yes, you can use VIF in the same way for logistic regression as you would in linear regression.
Variance inflation factor measures how much the behaviour (variance) of an independent variable is influenced, or inflated, by its interaction/correlation with the other independent variables. Variance inflation factors allow a quick measure of how much a variable is contributing to the standard error in the regression - therefore it doesn't really matter if it's a logistic regression model or another type of regression.
Answer: One caveat.
While in linear regression, it is traditional to use a threshold of 10 for VIFs, in logistic regression you use a much lower value. But afaik, I haven't seen any work detailing what such value might be.


Symbol for a discrete domain?

Question: Suppose I have a variable $x\in\mathbb{D}_{X}$, with $\mathbb{D}_{X}$ being its domain. What is the mathematical correct way of expressing "$\mathbb{D}_{X}$ is discrete" (i.e. not continuous)?
Comment: Discrete variable does not have to be non-negative. Moreover, discreteness is about countable number of categories, not about being represented by integers.
Comment: thanks for the comment, I removed my obviously wrong guess
Answer: The exact definition of a discrete random variable is quite subtle, and is discussed in detail in this question.  To cut a long story short, a countable set of possible outcomes is a sufficient but not necessary condition for a random variable to be discrete.  More strictly, a random variable is discrete if it has probability one of falling into a countable set of possible values (either finite or denumerable).  Also, random variables are not just numbers in a set - they are functions from a sample space to an outcome set.  Hence, it is a slight abuse of notation to refer to random variables as being values in an outcome set.
Suppose we set aside this complication, and consider the simple case of using a countable set of possible outcomes to define a discrete random variable (which is sufficient).  Without any further specification of the possible outcomes, those possible outcomes could be anything; they could be integers, or rationals, or just some arbitrary numbers.  There is no inherent problem with choosing a new symbol to represent your countable set, though it is usual to use a script-font with the same letter as the random variable.  Since all countable sets exist in a one-to-one relationship with simple sets of integers, it is also usual to denote countable sets by reference to the integers.  (In some cases it might be simpler to denote the set by reference to the rationals, or some other countable set, but it will depend on the structure of your set.)  For simple set structures, here are some common notational conventions.

Standard notation conventions for finite sets: For a finite set with $n \in \mathbb{N}$ elements, it is usual to denote the set as $\mathscr{X} = \{ x_1, ..., x_n \}$ and then refer to outcomes as $X=x_i$ for some $i \in \mathbb{N}_n$.
Standard notation conventions for bounded denumerable sets: For a denumerable set with a lower bound one the outcomes (i.e., a smallest value), it is usual to denote the set in a way that lists the values in increasing order,  as $\mathscr{X} = \{ x_1, x_2, x_3, ... \}$ where $x_1 < x_2 < x_3 < ... $ and then refer to outcomes as $X=x_i$ for some $i \in \mathbb{N}$.  If the set has an upper bound instead then this notation can be reversed to list elements in decreasing order.
Standard notation conventions for unbounded denumerable sets: For an unbounded denumerable set, it is usual to denote the set in a way that lists the values in increasing order,  as $\mathscr{X} = \{ ... , x_0, x_1, x_2, ... \}$ where $... < x_0 < x_1 < x_2 < ... $ and then refer to outcomes as $X=x_i$ for some $i \in \mathbb{Z}$.

The above notational conventions are common when analysts deal with discrete random variables. Discrete sets are usually denoted by direct analogy to the natural numbers, or integers, or a subset of these.  In cases where the discrete set of interest has a structural analogy to some other set (e.g., the rational numbers) then this analogy might be preferred.  If the outcomes are just a string of consecutive integers, you can simplify accordingly.
Comment: @whuber: Thanks for that - I initially interpreted this question as a purely notational one, but you're right that he is also asking about the meaning of "discrete" random variables.  I have added an opening paragraph to be more accurate on this point, with a link to a previous answer on the substantial question.  I have kept the later notational discussion, since that also bears on the question.
Comment: Some recent questions about discrete random variables have uncovered the importance of emphasizing (a) the distinction between this meaning of "discrete" and that of a discrete topological space and (b) the important role played by the underlying probability. This is brought to the fore when one considers discrete random variables with uncountable sets of values, but where most of the values have no probability of occurring. It might also be worth remarking that the notation in the question, "$x\in\mathbb{D}_X,$" although mathematically meaningful, does not mean what the OP intends.

Symbol for a discrete domain?


Regarding Tax deductions

Question: I have moved to UK on 10th Feb 2018. And Tax amount around £1300 has been deducted for months Feb and March because I didn't have NI number for first 2 months and also it was end of financial year. my monthly salary is 3500. can anyone please help me how much money I can claim back?
Answer: You are probably going to get most of this tax back.
When you move to the UK you are considered resident for tax purposes only for the part of the year when you are actually in the UK.. This means that for UK purposes your total income for the tax year is going to be your income between 10 Feb and the end of the tax year - so not much. you will not be assessed tax on any income you earned abroad before you moved to the UK. Unless you are a high earner, this will most be offset by your personal tax allowances, and you will end up paying minimal tax.
Of course you will only find out exactly how much when the tax office finishes collecting your data and sorting out your situation. It's possible to predict it roughly, but certainly not without knowing your exact salary and other income. When they do finish they will return some of your tax paid, either through your employer or by sending you a refund cheque. You could help the process along by filing a tax return, but it probably isn't necessary.
Some points to be aware of:

If for some reason you had other UK income from before you arrived in the UK (investments for example) that will increase the amount of tax paid.
Your previous country may require you to pay tax on your UK income.
Only tax will be refunded, not National Insurance contributions.

EDIT:
HMRC (the British tax office) keeps track of your income and tax contributions automatically, and most people don't need to do anything to ensure they pay the correct tax. However this does rely on you having an NI number, and your employer knowing and reporting it. When that has happened you should find that your excess tax is returned to you without having to do anything, probably through your paycheque.
You may possibly need to fill in a self-assessment tax return if you have British income other than your pay, or other unusual circumstances. Check the link above to see if it is necessary. British tax returns are pretty simple and you should not need any help doing it, certainly not a 'third party vendor'.
Comment: Just as a general principle in the UK, it's not necessary to fill in a tax return to get a refund. Essentially HMRC have tax returns as the "full" process for people with complicated or potentially complicated affairs; but for many people with simpler situations they can and do use simpler processes.
Comment: As an aside, this sort of "follow-on" question shouldn't be posted as an answer: either add an additional comment to DJClayworth's answer, or [edit] the question. In answer: I think "_You lived or worked abroad_" (in answer to Question 7) will apply to the tax-year in question (2017-18 – when the "extra tax" was collected) in which case the response is "_You need to [**contact HMRC**](https://www.gov.uk/government/organisations/hm-revenue-customs/contact/self-assessment) if you lived or worked abroad._".
Comment: thanks for your response. is there anyway I can claim my tax without the help of third-party vendors ?
Comment: Edited into the answer.
Comment: I have checked on self assessment and have answered their questions. and the result says I don't need to self assessment. did I answer anything wrong ?[enter image description here](https://i.stack.imgur.com/OVd7X.png)
Comment: thank you so much for your response.. I will contact HMRC

Regarding Tax deductions


Based on the SMS response will I be able to send an email through journey builder

Question: I am trying to send an sms to a list of subscribers in a data extension through journey builder.I have added the DE as the entry source in the journey builder. Then I have created a SMS activity . Subscribers are receiving the SMS. Now subscribers will respond back to the SMS. Based on the SMS response will I be able to send an email through the same journey builder ?
Answer: You can use next keywords https://help.salesforce.com/articleView?id=mc_moc_use_next_keyword.htm&type=5. And in the the response add AMPScript to populate/update a data extension.
Then, depending on what you want to achieve, you can either use AMPScript in an email to adopt the communication. Or add the Data Extension to an Attribute Group if you want to use the response in a decision split.


Textures always show up in pink

Question: I am really new to Blender, and by the title I mean that when importing/creating a new texture, blender always says that there are missing textures, I have succeeded in painting/importing textures on this same file before, but now it's not working anymore. I have tried the report and find missing files feature, but that does nothing. Any help would be appreciated.
Comment: Are the textures in the same place as your model? Have you tried going into 'Material Properties' manually creating a new texture, opening your texture and then applying it to the model? If that doesn't work then maybe go into 'Edit Mode' select all the faces and choose 'assign' in the Material Properties?
Answer: Select your object and go to the shader editor, add an image texture by pressing shift>A and then connect the image texture node into the base color. In the image texture node press open and select your file or just open the dropdown menu and select the file from there. Now go to the texture paint workspace and check. It will not be pink.
Comment: thanks! it works like a charm

Textures always show up in pink


How do I set the GRASS_ADDON_BASE environment variable?

Question: I am using QGIS and now GRASS GIS but I am not overly computer savvy. I am trying to add a GRASS modules (r.lfp) to my GRASS setup. I am on a Windows computer and can use the GRASS shell (I used to use .DOS in the old days). I've tried installing the extension using g.extension: it installs successfully (to c:/users/Bill/.grass7/addons) but also says that it won't function until the GRASS_ADDON_BASE variable is set. Can someone explain how I do that in simple language? I also tried to install r.lfp by saying "r.lfp -s" but perhaps I don't have permission to do so since that didn't work either. I've also tried to add r.lfp through the wxpython gui but the computer just hangs up and doesn't fetch the extensions repository (does it need something called numpy?)
Answer: g.gisenv set="GRASS_ADDON_BASE=pathtoyouraddondirectory"
should do what you are after!
Note that the default setting is: "The default (...) on MS Windows $APPDATA\GRASS7\addons!"
See:
https://grass.osgeo.org/grass70/manuals/g.gisenv.html
https://grass.osgeo.org/grass72/manuals/variables.html
Comment: I believe that what you suggested worked!!!  Thank you!  I'd been stumped for a couple of days on this.


When are the phrases "in motion" and "in movement" used?

Question: When are the phrases in motion and in movement used?
In motion is the most popular form based on a Google search, but in movement still has 3 080 000 results.
Comment: welcome, google is quite useless to measure things; [ngrams](http://books.google.com/ngrams/graph?content=in+motion%2C+in+movement&year_start=1800&year_end=2000&corpus=0&smoothing=3) are much better, *plus* you can click-through to books to see the actual usage in context.
Comment: Why not look at a few of those "in movement" results in Google, and see how they are used?  For example, some are about the "sit-in movement".
Comment: @Unreason: You should probably flesh that NGram out into an answer. The long and short of it being that unless you know *exactly* why you want to write **in movement**, you probably shouldn't. And if you read it, unless you know better you should just assume the writer isn't a native speaker.
Answer: It might be totally wrong, but I'd like to share my understanding of the two:
Movement: moving from one place to another
Motion: not standing still
In that sense, in motion might be regarded as opposite of stationary while in movement could indicate something or somebody is in the process of moving from place A to place B.
Intuitively, in motion brings me back to high school physics class; in movement just reminds me that some political or social movement is taking place.
Answer: According to etymonline both movement and motion trace their origin to L. movere "move, set in motion".
The difference is that motion came from O.Fr. motion (13c.), from L. motionem (nom. motio) "a moving, an emotion," from motus, pp. of movere "to move", where movement came from English word move.
Different senses acquired later were, for:

motion: The verb sense in parliamentary procedure first recorded 1747; with meaning "to guide or direct by a sign, gesture, movement" it is attested from 1787.
movement: In the musical sense of "major division of a piece" it is attested from 1776; in the political/social sense, from 1828.

The phrase "in motion" has been much more common since it is used in idiom "set in motion", which is used to say "to give an impulse (impetus) to".
The phrase is much more common:

To say that something is "in motion", generally speaking, means that it is moving (lit. or fig.), and to say that something is "in movement" would mean that it is a part of a movement. So, if you want to say that something is moving, do not say that is "in movement"; that will most likely be confusing.
On the other hand, as nouns, the two words are almost interchangeable and even in physics it is hard to find distinguishing definitions, however certain terms will consistently use motion vs movement, where they can not be interchanged e.g. brownian motion vs particle movement. Also, in physics the term motion is used more frequently.
Overall a movement implies some sense of complexity and a motion is, usually, simpler and regular in some way. Also, I would prefer motion for a single instance of some action and movement if I want to talk about generalized idea.
Answer: "In motion" is a phrase used as an adjective to describe a thing that is moving. Here you would never separate "in" and "motion", they go together as a singular phrase.

He caught the ball while it was still in motion.
A toddler is perpetually in motion; he doesn't sit still for an instant.

Here you could easily substitute the word moving.
There's nothing special about the phrase "in movement".  Sometimes the two words appear next to each other, but they are not really used together as a singular phrase.  You could have:

A lesson in movement.
Functional imaging in movement disorders.

But this is really just:

A lesson in (some subject).  e.g. A lesson in geography.
Functional imaging in (some kind of) disorders.  e.g. Functional imaging in mood disorders.

The Google NGrams results for 'in movement' show a whole bunch of occurrences like this.


KDE Plasma 5 switch between windows with arrow keys

Question: I recently upgraded to KDE5. Something that is really annoying is that Alt+Tab does not have proper behavior. Specifically, in KDE4, when I pressed Alt+Tab, then let Tab go while still pressing Alt, I was able to switch between windows using the arrow key and go in forward and reverse order. Now this does not seem possible anymore. I went to K > System Settings > Window Management > Task Switcher and played around with the options, but no configuration seems to be able to bring this behavior back. Furthermore, since I have virtual workspaces and use Alt+Arrows to switch between them, whenever I try to add Alt+Arrow as shortkey in the Task Switcher, it tells me that it will overwrite the global command. There must be a way to avoid this conflict during Alt+Tab invocation since it worked perfectly in KDE4. Any suggestions?
Answer: I also needed this feature very much, my concern was mostly using arrow keys when KDE task switcher is active. so I built a little tool for it called karrowswitch which emulates (shift+) tab/gravy-accent key when the task switcher is active and arrow keys are pressed. Feel free to try it.

KArrowSwitch adds support for arrow keys in KDE default
  alt+tab/grave-accent task switcher. it is very simply implemented, it
  detects alt+tab/grave-accent (hence an active task-switcher state)
  then it emulates "tab/grave-accent" key when right/down arrows are
  pressed, and "shift+tab/grave-accent" for left/up arrows.
Comment: Please read [how to recommend software in answers](https://meta.superuser.com/questions/5329/how-do-i-recommend-software-in-my-answers), particularly the bits in **bold**; then edit your answer to follow the guidelines there. Thanks!
Answer: Actually to use Alt + Tab and than arrow keys you have to select a proper visualization effect to Task Switcher on System Settings.
The default effect, Breeze, currently is not supporting the arrow keys anymore, but you can try the effect "Cover Switch" or some other that will work good with arrow keys too.
That would be nice if you could register a bug report on https://bugs.kde.org/ reporting that Breeze effect will not work with arrow keys while other effects are working ok with arrow keys.
I'm working on my first code to kwin and I'm planning to work on some new features and bug correction in future. I would like to work on this one.


Mysql 1 way replication master lost data replication still has

Question: Had a master mysql on (windows) improper shutdown. Many records could not be recovered and investigation found slave had records master did not have. Did not restore over master - left as was. As if by magic, about 6 weeks later the missing data from master re-appeared on the master, and now master>slave agree, with some lingering discrepancies. We're talking thousands of rows across many schemas and many tables within each schema. Looking for theories and data mining is not revealing much of anything. 1st question is knowing MySQL tries to automatically recover data, could something have happened where mysql cached it, then released it 6 weeks later. Anybody encountered this or any known issues like this?
Comment: MySQL recovers data from iblogfiles, so it may have recovered from those files. You may need to study the architecture of MySQL for better understanding. hope following link helps you http://dev.mysql.com/doc/refman/5.6/en/innodb-recovery.html
Answer: There is no mechanism in MySQL for a master to recapture "lost" (missing, corrupt) data from a slave.  Unless replication is circular (or master/master, where each machine is both master of, and slave to, the other... don't try this at home) then the interaction between master and slave is strictly one-way.  Even in a circular configuration, there's no "recovery" or resynchronization mechanism.
There is also no mechanism for data to be hidden away and reappear.  The comment referencing InnoDB recovering data from log files seems to overlook the fact that this sort of recovery occurs at start-up, and until it is complete, the server doesn't start accepting connections.
The answer should be discoverable in the master's binary logs (you archive those, right?) and the daily backups from master and slave (you archive those, too, right?).
Absent frequent periodic backups and historical binlogs, it seems difficult to speculate further.


Derivation for the e/m of an electron when moving in a circular path due to a constant magnetic field

Question: I'm attempting to derive a formula for the $e/m$ of an electron moving in a circular path due to a constant magnetic field. Using the relationships $F_B = qvB\sin(θ)$, $F_{net} = ma$, and $a_c = v^2/r$, I was able to get the relationship of $qvB = mv^2/r$. This appears to be in agreement with most of the places I've checked online. However, using this equation, I tried to get the relationship of $q/m$ by rearranging the equation. This gives me $q/m = v/Br$. However, most places online say that this is incorrect, and that the actual relationship is $q/m = 2v/B^2r^2$. Can someone please enlighten me on how this is the case? Where did my derivation go wrong? Thanks for any help!
Comment: That $V$ is the potential difference, not the velocity $v$.
Comment: Could you provide a reference for the supposedly correct equation? I don't think it is correct.
Comment: [Here is a reference I found online.](http://www.smc.edu/AcademicPrograms/PhysicalSciences/Pages/Calculating-the-em-ratio-of-the-electron.aspx) I would give my uni's page which shows the same thing, but anonymity and all that.
Comment: Thanks for point that out. That would explain it. I think I may well be an idiot.
Answer: Your formula $$q/m = v/Br$$ is correct! The right hand side also has the correct dimension $$[charge/mass]$$The expression $$q/m = 2v/B^2r^2$$ cannot be correct because the right hand side doesn't have the required dimension $[charge /mass]$ but the wrong dimension $$[charge^2/(mass^2 length)]$$ I wonder which sources give you this wrong formula.


How do you decide the ratio between font-size & line-height?

Question: I don't know if there's a canonical answer, but maybe some theories that you can point me to that I can read about.  Do most designers just play it by ear? Or go from the gut?
Answer: Many designers will leave applications at their default setting - which is typically 120% of type size (at least for Adobe software).
How or when to alter this is highly dependent upon many things:

Actual typeface

Some typefaces inherently demand more or less line spacing. 120% for some typefaces can cause ascenders/descenders to overlap. While for other typefaces 120% may create large spacing almost equal to an addition line. IT's all in how the font was encoded.

Target demographic

Younger audiences have far less trouble tracking lines of text. So the older the demographic the more additional line spacing is beneficial.

Desired aesthetics

If their is a desire to make text unpleasant to read, as in disclaimers or legal-ease, tightening line spacing can make text seem less important. Conversely, increasing line spacing can add an air of openness and ease.

Ultimately line spacing is a choice a designer should consciously make, the same as choosing colors or choosing type sizes. You are correct in assuming there's no canonical answer. Each piece is unique and requires an individual assessment as to what is appropriate.
The goal in most instances is to ensure glyphs do not overlap or would not overlap - i.e. even though a g and a b aren't right above one another and other glyphs allow these to display without overlap, if they were on top of one another they shouldn't overlap. Of course, one may consciously choose to overlap glyphs for a specific aesthetic.
In terms of increased line-spacing, the goal for most text is to ensure readers can track one line to the next without losing their place. Rhythm is important and any increase in line-spacing should help to assist rhythm, not hinder it.
Personally, I tend to prefer less than 120% for headlines/sub-headlines - often 100-110%. For basic paragraph text, I generally prefer more than 120% for line-spacing - often 140-150%. But these are merely my personal preferences.
For the web... this all translates to roughly a 1.0 to 1.1 line-height property for headlines and a 1.3 to 1.5 line-height property for body copy.
Comment: Nicely done. I'd add another consideration:  line width. If you're setting very wide lines of type, a bit of extra leading can aid legibility.
Answer: You can't simply apply the same rule everywhere. It varies with your context for example :-
(1) Type of text components : Making the line height in the range of 110-125% makes large lines of text more readable inside main article or body. But same is not applicable for "disclaimer text in the footer" and "terms and conditions" as it shouldn't take much of your document or page space.
(2) Typeface or font used :- Fonts with glyphs cause the line height to increase. So you may observe different spacing with same line height value when using different fonts.
(3) Type of document :- Web documents are read on screen and slightly more line height increases readability, but same is not true for news paper or books.
Above are just few examples of many other factors which affects the document readability.
Answer: For block text readability I personally use this simple rule:

Vertical space between the lines (put in lowercase)  should be ca. 180%
of the height of the lowercase letters.

Other criteria (than readability) may exist, like e.g. economy of paper/space, so those can come in play for certain applications.
To illustrate the rule, I copy paste the letter "o" and fit it between the lines:

So the optimal spacing is when I can fit slightly less than two whole letters between the lines.
However, the only universal approach here is to simply adjust the value that is provided by your software, and look at the text to achieve this spacing. Otherwise it may be not possible to just tell the number because different software use different units and approaches to define this spacing. Usually those approaches are not even related to the optical line height (lowercase height), so it is better just to look at the result.


When half laping two 6x6s, what is the optimal length and ratio?

Question: Joining two 10 ft 6x6s of dry pressure treated with half lap joint (not tapered) and 3/8" lag bolts with washers (not machine bolts).
For strength, what is the optimal length of half lap and what is the optimal ratio of thicknesses?
Would it be different for 4x4s?
Answer: In a "half" lap joint, the thickness should always be half of the material for the most strength.  You're reducing the strength of the board because you're removing thickness, and the joint will only be as strong as the weakest piece.  If you made the thickness ratio 25%/75%, then the 25% side would be the weakest.
Lap joints are used often for 90 degree joints, and in this case, the length of the joint is equal to the width of the board so all the edges match up.  In a end-to-end joint, the same ratio can be used to provide adequate gluing, nailing, or bolting area.  Less length might not provide enough area for bolts, and more area isn't going to add more strength because the weak point still comes from the fact that you just cut out half the thickness of the board.

Picture: http://timberframehq.com/simple-half-lap-joint/
Comment: If I do the 50/50 then the lag bolts will have only 2" to grab in the 6x6 (5" lag, lap thickness 2.75), and 1" in the 4x4 (3" lag, 1.75" lap thickness) (1/4" of the tip has neglible holding power).  If the length was 12" rather than 5.5", there would be much less torque (for in-plane  bending), or pull-out (for perpendicular bending).
Comment: @user25678, why not use carriage bolts that would go all the way through?
Comment: can't. as specified in OP, lag bolts not machine bolts.
Comment: @user25678 , you are OP, and I thought more detail was in order because bolts would increase the strength quite a bit.


Why NaCL does not provide anonymous public key cryptography?

Question: At the same time Sodium provides API for anonymous encryption without using ephemeral keys.
Is it a bad practice to just use other user public key to encrypt a message?
Comment: Crypto_box with an ephemeral key is authenticated. But sodium provides `int crypto_box_seal(unsigned char *c, const unsigned char *m,
                    unsigned long long mlen, const unsigned char *pk)` which does not require secret key for encryption.
Comment: You can't actually authenticate an ephemeral key sort of by definition, so I guess we aren't in agreement on some basic terminology.  Notice `crypto_box_seal` is exactly an ephemeral key and `crypto_box` with a little extra trick to compute the nonce in a space-saving way.
Comment: I'm not really clear on the question.
Comment: @ThomasM.DuBuisson, from NaCL docs: "NaCl's goal is to provide all of the core operations needed to build higher-level cryptographic tools". Isn't non-authenticated asymmetric encryption, the core operation to build cryptographic tools?
AFAIK, sodium server the same purpose and provides this.
Comment: How is `crypto_box` with an ephemeral key not unauthenticated?  Or do you mean not count hybrid operations, so you can't count most DH-only ECC schemes?
Answer: As I now understand the question: why doesn't NaCL provide a primitive for unauthenticated encryption, making ciphertext blobs that are only decrypt-able by a receiver identified by their public key?  Note libsodium provides crypto_box_seal which does exactly this and NaCL claims to (try to) provide all necessary crypto primitives.
In answer, notice crypto_box_seal can be built using other primitives.  Sodium says of crypto_box_seal:
ephemeral_pk ‖ box( m, recipient_pk, ephemeral_sk
                  , nonce=blake2b(ephemeral_pk ‖ recipient_pk))

So what we have in terms of NaCL prims are (pseudo-code):
sk = random();
ephemeral_pk = crypto_box_keypair(sk);
nonce = sha512(ephemeral_pk || recipient_pk); // NaCL uses SHA512 not Blake2b.
ct = ephemeral_pk || crypto_box(m, recipient_pk, sk, nonce);

This can be considered anonymous because the ephemeral key pairs used are not associated with any identity - the secret key should be destroyed immediately after computing the ciphertext message, ct.


IBM AS400/iSeries find which job is blocking a job queue

Question: I'm working on an iSeries with system version 6.1. Some job is keeping other jobs in its queue to process. I know the queue name (PUR1) and see it has an abnormally amount of jobs in it. My understanding is that when a job runs, it moves from it original job queue. So how can I find which job is keeping the others from being processed?
Answer: A job is removed from the job queue as part of starting it.  If you have multiple job queues attached to the subsystem, and multiple jobs running in the subsystem, then you have a bit of a challenge.  Take a look at the job queue for each job currently running in the subsystem. One of the first few messages should mention the name of the job queue.


IV curve on this solar panel datasheet

Question: The IV curve of this solar panel looks okay, but the axes values don't seem to match up with the tabulated values. Datasheet states that 6.70 V, 36.6 mA at mpp. Can anyone tell me the relation between these and the graph?

http://ixapps.ixys.com/DataSheet/SM940K12L.pdf
Answer: The unit is mA/cm2. You need to calculate the area of each cell. 2cm * 0.471cm = 0.942cm2. The panel you are looking at has 12 cells connected in series.
The voltage at max power on the graph is roughly 0.56V. 12*0.56V = 6.72V ~ 6.7V
The current at max power is roughly 39mA/cm2.   39m/cm2 * 0.942cm2 = 36.73mA ~36.6mA
Answer: that IV curve is correct. Your  solar panel is composed of 12 cells that are connected in series.thats why there is 6.7 V in datasheet.

IV curve on this solar panel datasheet


Reading mV from the MAX31856

Question: I am trying to use a Type-C thermocouple with a MAX31856 thermocouple IC.  This means that I must read the thermocouple voltage directly (in mV) and convert the voltage to temperature in software using a lookup table.  I cannot understand the formula given on page 20 of the MAX31856 datasheet on how to convert the "code" received from the 31856 to mV.  I am writing my program in python.  Can anyone explain to me the steps involved in implementing this equation?  Maxim tech support simply refers me to the datasheet.  Thanks in advance for any advice.
Answer: Welcome. Presumably you are referring to this datasheet (please provide a link to the datasheet in the future) and the below:

So you are going to decide which full scale mV to use (+/-19.531 or +/-78.125). The latter will cover the full range of the Type C thermocouple, but will give less resolution and probably more noise. The former will cover you up to only around 1050 to 1100°C depending on the ambient temperature (less if the chip happens to be relatively cold).
So if you treat the number you read from the chip as a 19-bit signed number (presumably 2's complement), you will have a number between 0x1FFFF and 0x60000, representing mV from +78.125mV to -78.125mV using the Gain = 8. So if you convert to floating point and divide that 19-bit signed integer by (8.0 * 1.6 * 2^17) = 1677721.6 you will have the input voltage in volts. You would normally want to sign-extend the 19-bit integer.
After that you'll have to read the cold junction voltage in degrees, convert and possibly delinearize that to mV-equivalent for type C (or do a slapdash linear approximation), sum that with the mV sensor reading and then linearize the resulting voltage to read in degrees. The details of that are complex and well outside of the scope of this answer.

Python's 64-bit floats are more than good enough for the calculation. To do the sign extension, that's really a Python question, for which this answer is probably helpful.
<code>def sign_extending(x, b):
if x&(1<<(b-1)): # is the highest bit (sign) set? (x>>(b-1)) would be faster
    return x-(1<<b) # 2s complement
return x
</code>
Where you would use b = 19, so
volts = sign_extending(y,19)/1677721.6
(where y is the code read from the chip)
Comment: It's taken me a long time to get back to this issue... but I wanted to get back to you and THANK YOU again for helping me through the math here.  The result is 100% perfect and has finally put this problem to rest!  Very much of a help to me, and I appreciate it, and thank you.
Comment: Wow!  Thank you for taking the time to explain that in that detail.  I needed the help and haven't understood how to solve that equation with the bit manipulation.  We run the furnaces to 2200C so will need the full range.  I hope to use this module... https://pypi.org/project/thermocouples_reference/  to do the linearization.  We'll see how it all comes together.  Thanks again very much.

Reading mV from the MAX31856


What is the difference between a fund manager and a portfolio manager?

Question: What is the difference between: a fund manager, a portfolio manager and a trader?
Comment: Related: [What is the difference between a 'trader' and a 'stockbroker'?](http://money.stackexchange.com/questions/8255/what-is-the-difference-between-a-trader-and-a-stockbroker)
Answer: In most companies, a fund and a portfolio mean the same thing; therefore a fund manager and portfolio manager are the same role.
The difference between a portfolio manager and a trader (where exists) is as follows:

Portfolio manager's job is to decide on the best contents (holdings) in the portfolio that would accomplish the portfolio's stated objective within stated constraints (e.g. make the best possible return while keeping the risk under a specified level).
Trader's job at a buy-side institution is to basically execute the trades necessary to change the portfolio holdings from their current state to whatever state portfolio managers decided to achieve.
As a matter of fact, at some smaller buy-side firms (especially fixed income), there ARE no separate trader positions, and portfolio managers do both jobs.
A trader's job is to execute the required trades so that the transaction costs are minimized and the PnL is maximized by buying as low as possible and selling as high as possible (e.g. for a simple example dumping a large chunk of a certain stock all at once would depress the stock price so you would make less money as your average sell price goes down).
Trader's job at a sell-side institution is more involved, as the trader is also responsible for making money for the firm via his trades, e.g. he may trade securities specifically for the purpose of making the money off the trade as opposed to the purpose of achieving desired portfolio composition.
Answer: I have always been trader, prop trader and/or market maker in various options and derivatives markets. I have managed my own portfolio with a P&L target under Var & stop loss constraint. But I never called my self PM.
The only difference I will see between PM and Trader like I am is that a PM seems not to be executing his own orders on the markets.
The role of the broker is to execute orders and advise their clients. I'd like to know more in detail the difference between a trader and a PM myself.
Comment: Hi option trader, welcome to the Money.Stackexchange.com.  We generally discourage unsubstantiated opinion answers here, so I've removed those parts of your answers.  Please take a look at the [FAQ] when you have a moment.


How to list all images running in a cluster in CSV format?

Question: I'd like to get a CSV for our security team with all the container images running in our kubernetes cluster right now including the image digests and namespace. How can I do that?
Answer: This depends on anchore kai (which you just download and drop in your path. https://github.com/anchore/kai/releases) and jq which you probably already have installed. This also assumes your kubectl is configured and pointed to the cluster with needed credentials to read everything you need to acquire.
kai -i \
  |jq --raw-output '.results[] \
    | {"namespace": .namespace, "image": .images[].tag, "digest": .images[].repoDigest} \
    | [.namespace, .image, .digest] \
    | @csv' \
  `

The first line is getting the images using kai. The -i outputs the inventory to the commandline. This is in a json format. Then I use jq to get the results in line 2. In line 3 I re-arrange the results so the namespace is associated with each image in the same array. Then I dump these into a bunch of individual rows in line 4 and finally in line 5 output that to stdout in a CSV format instead of json.
You'll get a count of the images per namespace to stderr and the csv to stdout so you can simply add  > inventory.csv to the end of the command to save it off to a file. You'll still see the stderr output to the screen so you can follow along.


How to make products-per-page setting reset to default on pageload

Question: I have tried modifying getLimit() in the file Mage_Catalog_Block_Product_List_Toolbar, but that didn't seem to change anything.  Is this even possible?
Answer: This may not achieve what you want but it's worth mentioning: you can disable the 'memorization' of product list toolbar parameters by calling the following method:
Mage_Catalog_Block_Product_List_Toolbar::disableParamsMemorizing()

Or, via layout XML you can update the toolbar block of your category handle as follows:
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
    <action method="disableParamsMemorizing"></action>
    <block type="page/html_pager" name="product_list_toolbar_pager"/>

</block>

Notice I've added the <action> node with a call to the disableParamsMemorizing method.
This will prevent the user's toolbar params from being stored in their session and will reset it each time they load the page, provided it doesn't have the param in a query string. Keep in mind this will 'forget' ALL toolbar params:

sort_order
sort_direction
display_mode
limit_page

You could also apply this on a per-category basis via layout updates in the Magento Admin.
Answer: It seems as if you rewrote the method as follows it would do what you want it to do:
public function getLimit()
{
    $limit = $this->_getData('_current_limit');
    if ($limit) {
        return $limit;
    }
    $limit = $this->getRequest()->getParam($this->getLimitVarName(), $this->getDefaultPerPageValue());

    $this->setData('_current_limit', $limit);
    return $limit;
}

What I've done here is remove the conditions that set/get the limit values from the catalog session. This means that if the limit is set in the querystring it will obey it but it will not store it in the session, so it's only applying the limit for those who change the products-per-page dropdown value - not for their return visits where they likely hit a category page by browsing the site or by organic search.
If the limit value was not set in the querystring it then defaults to the value set in the configuration.
Best of luck!
Comment: I modified the code, but it didn't change anything.  I even hard coded a return number, but even that didn't do anything.  I made sure to clear my cache first.


Data Binding in .NET with CSLA BOs

Question: OK, I am having quite an issue with data bindings in .NET.
Some background information, my business object tier is using CSLA v1.0.
And _clientObj is passed in as a parameter as a business object that inherits CSLA.BusinessBase
Here is the code segment:
Dim nextClient As New ComboBox With { _
            .Name = "txtClientAtt" & (ClientBoxes.Count + 1).ToString(), _
            .DisplayMember = "FullNameAndID", .ValueMember = "ClientID", _
            .Tag = _clientObj}
nextClient.DataSource = ClientList.GetClientList(SelectedSite)

nextClient.DataBindings.Add("SelectedValue", _clientObj, "ClientID")
If Not _clientObj.ClientID = Nothing AndAlso nextClient.SelectedValue Is Nothing Then
     Debug.Print("How could I ever be inside this conditional????")
End If

That debug statement does indeed get reached if _clientObj is a pre-existing object with an assigned ID value.  How is that possible?  I was assuming that adding the data binding should immediately set the .SelectedValue property of the ComboBox if the DataSource object has an initial value.
Answer: If Not _clientObj.ClientID = Nothing

is not the correct way to test for a null value.  You should be using:
If Not _clientObj.ClientID Is Nothing

However, I'm not sure if that is actually the issue you are having or not.

Data Binding in .NET with CSLA BOs


View how much ram my videocard has in Win7

Question: How can I see how much RAM my videocard has in Windows 7 ?
Answer: If it's like Vista then you need to navigate to "Control Panel", "Performance Information and Tools" then click "View and Print details"
Update: yes it's the same on my Win 7 netbook. You might need to change Control Panel's view to "small icons" to easily find "performance Information and Tools".
Comment: I'm with you on this one, DxDiag shows "Approx. Total Memory: 3797MB" for my 1GB Graphics card while Performance Information show me 1GB dedicated and 2.7GB shared memory.  The 1GB is what is on the card, 3.7GB is what is available *to the system* for the graphics card.
Answer: the easiest way is to use the DirectX Diagnostic tool.
simply type

dxdiag

into the search field in the start menu.
dxdiag should come up as an option. run the program and view the "Display" tab.
the display tab provids information on your video card.
there is a line named "Approx. Total Memory:" this line holds the ram on your video card.
Comment: On my netbook that gives Approx Total memory. Performance Indicator & Tools also breaks it down into Dedicated Graphics Memory, Dedicated System Memory and Shared System Memory.
Comment: in my OP Performance Indicator & Tools can be misleading and confusing as it is concerned with the memory of the entire system. thats why I suggested dxdiag, as it is only concerned with the video card. but yes, if you want to know the details of how memory is allocated on the system use Performance Indicator & Tools
Answer: Use GPU-z


Changing my tires

Question: I have a Dodge Charger SE 2006. I'm currently using a 235/55/17 tires. I would like to know if I can change it to 255/75/17. Thanks in advace.
Answer: First be aware that actual tire size can vary by brand and use. An off road tire will be a different dimension from road performance or rain tire. Identical tires dimensions, can be different if mounted on a wider or narrower wheel. On line research shows some basic guidelines. A 235/55/17 is listed as having a 27.2 inch diameter by 9.3inch wide footprint. A 255/75/17 is listed as having a 32.1inch by 10 inch wide footprint. As a starting point if you don't have an additional 3 inches between the tire tread and the wheel well opening front, rear and top it won't fit. Another contact point can be the strut, you will need an additional 1/2 inch between the tire and strut 3 inches higher than the current tire.
Answer: It depends what you are trying to accomplish.
Swapping to a wider and taller tire will have your speedometer lie to you: in your case, you will actually be travelling 18% faster than what your speedometer will be indicating (better get ready for a basket full of speeding tickets!), simply because the car doesn't know how fast you are really going, it only knows how much the axle is spinning and it does some simple math from that by using the tire size it had when it left the factory.
If you are looking at fitting wider tires to have more traction, you need a tire with a narrower sidewall (the middle number) so that the tire diameter and circumference remain the same of your current tires.

If you want to use the same rim size, 255/50/17 would work, your
speedometer would only be off by 0.7%.
If you want to fit larger rims (18 inches), you can fit 255/45/18 or 265/45/18 or even 285/40/18 (all off by 0.7%), or 295/40/18 (off by 0.4%)

Feel free to play around this site to figure out other tire sizes you may use. First, look at the sticker inside your door to find what tire size your car came with from the factory, because according to this other site, it wasn't 235/55/17.

Changing my tires


Can not get mysql-connector-python to install in virtualenv

Question: I'm using Amazon Linux AMI release 2013.09. I've install virtualenv and after activation then I run pip install mysql-connector-python, but when I run my app I get an error: ImportError: No module named mysql.connector. Has anyone else had trouble doing this? I can install it outside of virtualenv and my script runs without issues. Thanks in advance for any help!
Comment: I was able to run my app inside of my venv by installing the python connector outside of virtualenv and then manually copying what was installed in the site-packages folder into my virtual environments site-packages folder. This is no solution however as it defeats the purpose of virtualenv. It's interesting that pip didn't already do this.
Comment: Yeah, this is a hassle since `yum` relies on Python 2.6.x. I would recommend setting up a `virtualenv` with 2.7, that way you get the best of both worlds. [Here](http://tumblr.kurttheviking.com/post/30920138314/painless-python-2-7-on-aws-ec2) is a blog describing the process.
Comment: What version of Python are you running?
Comment: 2.6.9 (unknown, Oct 29 2013, 19:58:13) [GCC 4.6.3 20120306 (Red Hat 4.6.3-2)]
Comment: See also https://stackoverflow.com/questions/43029672/unable-to-find-protobuf-include-directory
Answer: Several things.  There is an inconsistency in package naming so you may want to do:
pip search mysql-connector

to find out what it is called on your platform. I got two results mysql-connector-python and mysql-connector-repackaged.
so try this first:
pip install mysql-connector-python

this may additionally give an error like this:
Some externally hosted files were ignored (use
    --allow-external mysql-connector-python to allow).

so finally this should do the job:
pip install mysql-connector-python --allow-external mysql-connector-python

Comment: I had to move on in my project, but I will make an effort to test this out and get back to you. Thank you for your answer.
Comment: `mysql-connector-python` comes before `--allow-external` **and after**!!
Comment: It looks like --allow-external is not supported in some versions of pip? I'm using pip 1.3.1 in a python 2.7.10 venv and get "no such option: --allow-external"
Comment: Follow-up: I also updated pip to 8.0.2 and get the same result, no such option! But I know this worked before, under python 2.7.8.
Comment: Could not find a version that satisfies the requirement mysql-connector-python (from versions: )
No matching distribution found for mysql-connector-python
Comment: This no longer works. Apparently, allow-external is deprecated
Comment: Answer by @slim worked for me.  sudo easy_install mysql-connector
Answer: Solution I found:
sudo pip install mysql-connector-python-rf

If you see this error: option --single-version-externally-managed not recognized, try this:
sudo pip install --egg mysql-connector-python-rf

Answer: pip install mysql-connector

This worked for me!
Comment: Can you tell us what environment you're running?
Comment: @slim I tried to install mql.connector in my linux machine, and this worked for me.
Comment: What distro and version?
Comment: This worked for me also (it installed successfully, haven't tried to use it yet), using Windows 10, Python 3.6.4, and pip 9.0.1
Answer: I was facing the similar issue. My env details -
Python 2.7.11
pip 9.0.1
CentOS release 5.11 (Final)
Error on python interpreter  -
>>> import mysql.connector
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named mysql.connector
>>>

Use pip to search the available module  -
$ pip search mysql-connector | grep --color mysql-connector-python

mysql-connector-python-rf (2.2.2)        - MySQL driver written in Python
mysql-connector-python (2.0.4)           - MySQL driver written in Python

Install the mysql-connector-python-rf -
$ pip install mysql-connector-python-rf

Verify
$ python
Python 2.7.11 (default, Apr 26 2016, 13:18:56)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-54)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mysql.connector
>>>

Comment: mysql-connector-python-random-fix ;)
Comment: @slim see ["What are the differences..."](https://stackoverflow.com/q/34168651/673991). Summarizing, (1) it's Required For Django 1.8, (2) it's Retrieved the most Frequently, (3) it's the veRsion that actually Functions.
Comment: Do you know the difference between the two packages? What's does the "-rf" stand for?
Comment: @slim TBH even I am having the same question! could not find the answer yet.. For sure its not something random fancy stuff =)
Answer: I'd like to add that
sudo easy_install mysql-connector

worked for me after pip kept crashing no matter what I did.
Comment: That was the only one that worked for me on quite outdated EC2 instance
Comment: Work with Python3.6 on a Ubuntu 64bit 18.04 as well. Interesting
Comment: Chiming in to add this worked for me using a Python3.7 conda environment, none of the other solutions worked on my end...
Answer: I've battled with this and tried upgrading pip and setuptools but actually it seems all you need to do is:
sudo pip install virtualenv --upgrade

Once you've upgraded virtualenv, create a new virtual environment, activate it and try installing with:
pip install https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.1.3.tar.gz

(you might need to update the url, but that's the current one)
Answer: Command
pip install mysql-connector-python-rf

worked for me in my pyenv python version 2.7.12 and pip version 9.0.1.
Answer: I have managed to overcome this problem by entering mysql-connector-python package URL, taken from MySQL page, directly to the requirements file, instead of dependency name.
My requirements file looks like this:
bson==0.4.2
https://cdn.mysql.com/Downloads/Connector-Python/mysql-connector-python-2.0.4.tar.gz
pymongo==3.2.1

After creating virtualenv and switching into it I am executing
$ pip install -r ./requirements

And pip is doing the rest of the work, i.e., downloading, extracting and installing.
Answer: It works for me!
pip install mysql-connector-python-rf

If you get the error, install the latest version of setuptools and wheel:
pip install -U setuptools
pip install -U wheel

Answer: Also something that can go wrong: Don't name your own module mysql
import mysql.connector will fail because the import gives the module in the project precedence over site packages and yours likely doesnt have a connector.py file.
Answer: try my answer here. Though i meant it for Python3, u can just modify the command python3->python to make it work for python2
Answer: I just had the same problem and none of the solutions below worked. Some was already installed and the last one returned me an error:
    pip install mysql-connector
    pip install mysql-connector-python
    pip install mysql-connector-python-rf

It looks like all I had to do was run the code in a different IDLE version, moving from 3.6 to 3.7.
Before doing that, I also used the windows repair installation tool in two different python versions I have installed.
Sometimes the simplest solutions work. Good luck
Answer: Make sure that you've installed the mysql connector from within the venv.
In VSCode, what worked for me is I selected the venv interpreter as the python interpreter.
https://code.visualstudio.com/docs/python/environments
Comment: An answer is a direct response that sincerely attempts to provide the information/analysis requested by the question. Hence remember link is not an answer.
Comment: A link to a solution is welcome, but please ensure your answer is useful without it: add some more text and examples or code that someone can use to solve the problem asked in the OP post.
Answer: You can download official connector from here -
Choose Platform independent version.
Unzip and cd to the folder.
run sudo -H python3 setup.py install from your environment.
Done


What's the use of having both a proper subset and subset definition when we have the of notion equality?

Question: By definition a set $A$ is a proper subset of another set $B$ if we have $A$ is a subset of $B$ and $A\neq B$, I understand the need for such a definition however what I don't understand what's the use of the subset definition when we can say the A is a proper subset of $B$ in case they are not equal and $A=B$ in case they care, what does the subset definition really add to the table here?
Comment: what does $a\le b$ add to the table when we already have $a < b$ and $a=b$?
Comment: Not sure what your point is.  There are situations in which we know that $A$ is a subset of $B$ but we aren't sure whether $A=B$ or not.  Accordingly we may want to distinguish between cases in which we know $A$ is a proper subset and cases in which we don't. Does that answer your question?
Answer: "$A$ is a subset of $B$" is equivalent to "$A$ is a proper subset of $B$ or $A=B$" and the first is clearly more succint. We often don't care if a subset is proper.
Answer:
It is useful to have the $\leq$ relation defined on numbers; it conveys the idea that one number is at most as big as another one.

But , arguably, numbers are sets . For example $0=_{df} \emptyset$ and $1=_{df}\{\emptyset\}= \{0\}$ , and $2=_{df}\{0,1\}$

So how can we define the $\leq$ relation on sets? For example suppose that sets N and M are natural numbers. How are we going to express the fact that $N\leq M$ ?

We will say that $N\leq M \iff N\subseteq M$.


Regularity of "middles" of words from regular language

Question: I need some help with the following problem. Let $L \subseteq \Sigma^*$ be a regular language. I have to prove that the language $P = \{\alpha \mid \beta\alpha\gamma \in L, \beta,\gamma \in \Sigma^*\}$ is regular, where $\Sigma$ is the alphabet. In other words $P$ is the language of all substrings of words from $L$.  How do I prove that $P$ is regular?
Comment: This doesn't really warrant a full answer, but as for the name, this is known as the "factor closure" of the given language ("factor" being formal language-ese for substrings).
Answer: Let $R$ be a regular language. Then there is a finite automaton $M$ for which the language, $L(M)$, of $M$ is $R$. Without loss of generality, we may assume that $M$ has no unreachable states. Construct a new FA, $M'$, as follows:

For each state $q$ of $M$ which has a sequence of transitions to a final state of $M$, make $q$ a final state. Call the set of such states $S$.
Add a new start state $q_0$ having $\epsilon$-transitions to each element of $S$.

It's not hard to see that $M'$ will accept any string which is a substring of some string in $R$.
Answer: Proving the language is regular
We can prove the language $P$ is regular by using other closure properties. Middles are actually substrings. They are obtained by taking suffixes of prefixes of the original language. Both operations of taking prefixes and taking suffixes applied to regular languages will result in regular languages.
Finding an explicit regular expression for it
In one of the comments the question was narrowed down to: Given a regular expression, can we find a regular expression for the substrings of a language directly, i.e., without intermediate finite state automata?
Interesting. Yes, it can be done. First observe that substrings are suffixes of prefixes. I will explain how to find an expression for prefixes. Then a similar solution works for suffixes, and we can apply both operations in turn.
The solution works recursively, as regular expressions are defined that way. Let $\alpha, \beta$ be regex's. Your own notation may vary.
$\operatorname{pref}(\alpha + \beta ) = \operatorname{pref}(\alpha)+\operatorname{pref}(\beta )$
$\operatorname{pref}(\alpha \cdot \beta ) = \operatorname{pref}(\alpha)+\alpha\cdot\operatorname{pref}(\beta )$
$\operatorname{pref}(\alpha^* ) = \alpha^*\cdot\operatorname{pref}(\alpha )$
Then we should add a base-case.
$\operatorname{pref}(a) = \varepsilon+a$
Answer: $L$ is a regular language, so you have a DFA $M$ for it. First remove every "dead" state in $M$, i.e. every state that cannot lead to an accepting state. Make every state in $M$ an accepting state, and make a new start state that $\epsilon$-branches to every state in $M$. The resulting NFA $M'$ recognizes $P$, because:
a) If the string $bac$ was accepted by $M$, then there was a sequence from $Start$ through $S1$ that recognizes $b$, a sequence from $S1$ to $S2$ that recognizes $a$, and a sequence from $S2$ to an accepting state $S3$ that recognizes $c$. But $S1$ is now connected to $Start'$ through $\epsilon$-transitions and $S2$ is an accepting state, hence $M'$ accepts $a$.
b) Conversely, because we have removed transitions that cannot lead to an accepting state, every sequence recognized by $M'$ was part of an accepting sequence for $M$. Because we have not added any edges except those that can be used only to skip $b$, this sequence was consecutive in $M$.
Answer: Given a finite alphabet $\Sigma := \{a, b, \dots\}$, consider the so-called "tagged" alphabet $\Sigma' := \{a', b', \dots\}$. Consider the monoid morphisms $untag, killTag : \Sigma \cup \Sigma' \to \Sigma$ given by

$untag(a) := a$ for $a \in \Sigma$, $untag(a') := a$ for $a' \in \Sigma'$.
$killTag(a) := a$ for $a \in \Sigma$, $killTag(a') := \varepsilon$ for $a' \in \Sigma'$.

We can verify that these are indeed monoid morphisms. We know that the class of regular languages is closed under homomorphisms, inverse homomorphisms, and intersection with regular languages. With this in mind we see that
$P = killTag[untag^{-1}[L] \cap \Sigma'^*\Sigma^*\Sigma'^*]$
which is also regular due to the closure properties of regular languages mentioned above.

Regularity of “middles” of words from regular language


If I remove my apple ID account on my Iphone 4s, does it delete the data on iCloud on that device only?

Question: If I remove my apple ID account on my Iphone 4s, does it delete the data on iCloud on that device only? I already have an Iphone 5s which is using the same apple ID. And planning to sell my Iphone 4s. Please help me. Thanks!
Comment: If you're selling the phone, turn off findmyiphone and then reset (clear the memory). https://support.apple.com/en-us/HT201351
Answer: Removing your Apple ID account from your iPhone should have no affect on the data stored in iCloud. You can safely sign out of iCloud and related services from your iPhone. In doing that, read the prompts to confirm that you are not as they look rather ominous at times, but should only be telling you that data will be removed from the phone.
Comment: I won't -1 this, as it ***is*** strictly the answer to the question; but Tyson's comment is actually better advice - remove from find my iPhone, then totally reset.


How do I see my mobile contacts in Empathy?

Question: In Pidgin and most other clients for instant messaging I've used, when my contact is logged in from a mobile phone, the client shows an icon by their name so I can differentiate between these buddies that are online from a phone and buddies that are online from a computer. Does Empathy have this feature?
Answer: This is a known bug in Empathy and is currently being worked on.
So Empathy currently lacks this feature but it will likely show up in the next version of Ubuntu (10.10).
Comment: The bug has been fixed. In 12.04 you can see the icon by the contact's names when he is logged from a mobile phone.
Answer: You can't just yet. This feature is coming, likely in 10.10, and there was a blog post asking users about how this should be presented, so if you feel like it, you can give your opinion here.


Why strangulation for adultery?

Question: The Torah tells us which relationships are forbidden and what the punishments are. Some of them are cut off from the people, some are strangled, some are burnt, killed by sword others are stoned. The Gemora says that strangulation is the easiest way to die among these punishments. But why does a man who sleeps with a married woman only get strangled? This is a terrible sin that breaks a family, hurts everyone involved and might bring illegitimate children into the world. Shouldn't he get a harsher punishment?
I am asking about the severity of the sin and the punishment, not about the types of death that the court gives.
Comment: אלו הן הנהרגין רוצח ואנשי עיר הנדחת.  Not forbidden relationships
Comment: I think you mean some get stoned, not killed by the sword
Comment: Are the others not also terrible sins? I don't understand the question. The easiest form of capital punishment is still pretty terrible.
Comment: It's still human.
Comment: @Heshy can you explain please
Comment: There are no forbidden relationships that cause someone to get killed by the sword.  Only murder and ir hanidachas get punished that way.
Answer: The reason is technical, as the Talmud makes clear:

Rabbi Yonatan says: It is not because strangulation is the most lenient type of capital punishment; rather, there is a principle that every death penalty stated in the Torah without specification is nothing other than strangulation, whereas the other types of capital punishment must be stated explicitly in the verse. [Sanhedrin 52b]
Comment: yup that is one answer, yet also the gemora says because strangulation looks the most like a natural death.
The question is about the crime rather then the technical (I agree with your answer looking for something more droush)... R SR Hirsh also has a nice peshat....

Why strangulation for adultery?


Recommended grammar textbook for self-study

Question: There are French grammar textbooks written in my native language. However, most of them are either too simple (containing not enough information) or too hard (contain many information but less systematic). I knew a little bit French and I can use English quite fluently.
Could you please recommend me some good grammar textbooks so that I can study on my own?
Comment: You could try: *Le point du FLE*: http://www.lepointdufle.net/grammaire_conjugaison.htm and in English  *Tex's French Grammar*: http://www.laits.utexas.edu/tex/gr/overview.html or *LanguageGuide*: http://www.languageguide.org/french/grammar/introduction/
Answer: I love collecting language grammar books in general, and by far one of my favorites is French Grammar and Usage by Hawkins and Towell.  It is exceptionally well-organized and a pleasure to read, with lots of examples.  It has perhaps the clearest explanation of the subjunctive that I have ever come across.
The one disadvantage for you is that it is has extra focus on difficult points of grammar for native English language speakers.  Still, they're not explicit and I suppose you could simply skip those sections if you find it irrelevant.
Check it out with your favorite bookshop.
Answer: For pronunciation, try this book (better not finish it !! or you may end up pedant) and master some vocabulary in this book and for grammar you can always do some books like this one. But the most of it,..try to engage conversations with a french speaker... There are some idioms not well mastered when reading books.
Answer: I recently lit upon Mosegaard Hansen, Maj-Britt's The structure of modern standard French : a student grammar, OUP, 2016.

I posted the following books in Nov 25 2015 based on a now removed website of the University of Cambridge's Department of French.

Grammars

Probably the best recent grammar of French written in English is:

*G. Price, L. S. R. Byrne & E. L. Churchill's A Comprehensive French Grammar , 4th edition, completely revised by Glanville Price, Oxford: Blackwell, 1999 (F3.E.60)

The following may also be of use:

H. Ferrar, A French Reference Grammar, 2nd edition, Oxford University Press, 1967 (F3.E.37 & F3.E.38, older ed. at F3.E.50)
R. Hawkins & R. Towell, French Grammar and Usage, London: Arnold, 1996 (F3.E.54)
J.E. Mansion, A Grammar of Present-Day French, London: Harrap (old, but still very serviceable). (F3.E.41)
C. Abbadie, B. Chovelon, M-H. Morsel, L'expression française écrite et orale, Presse Universitaire de Grenoble, PFLUG.

If you are uncertain about basic grammatical points, the following may be useful:

T. Marriott and M. Ribière, Help Yourself to French Grammar, London: Longman, 1990 (F3.E.48)

Although the Department does not adopt a single course book, you may find the grammar sections in the following helpful:

Le Français en faculté: Cours de base, 2nd edition, London: Hodder & Stoughton, 1986 (F3.E.44)

You will gradually need to get used to consulting French grammars written in French:

G. Mauger, Grammaire pratique du français d'aujourd'hui, langue parlée, langue écrite, Paris: Hachette, 1968 (published under the auspices of the Alliance Française) (F3.E.43)
H. Bonnard, Code du français courant, Paris: Magnard, 1984. (F3.E.52)
J. Ollivier, Grammaire française, 2nd edition, Holt, Rinehart and Winston, 1993 (F3.E.45)

The French themselves consult Grevisse; you may initially find this difficult to approach, but should find it increasingly helpful during your course:

Maurice Grevisse, Le Bon Usage, 12th edition, revised by André Goosse, Paris & Gembloux: Duculot, 1986 (F3.E.21;22; 30)
Answer: I can recommend a book that I used for self-study myself; the book was very good and I felt that it was vital for my progress in the French language.
The book is not in English, it is in French. I had really little French knowledge, yet I was able to learn with this book in self-study mode. So if you have some knowledge of the French language, I guess maybe this could be a good try.
The title was La grammaire des premiers temps from the authors Abry and Chalaron.
This book has since been updated and the title today is La nouvelle grammaire des premiers temps.
I have to admit that I do not know other self study books. This one was a great  recommendation I had at that time and I was happy and lucky that the book was perfect for me. The pace, the style the form, everything just suited my learning style.
Having that said, and knowing that each person learns differently, I recommend to first see if one can get hold of an example or copy of the first pages so that one can check if the book is suitable for oneself.
I got the second book (advanced level) once I had finished the first.


Timing in double slits experiment

Question: In this setup the source, the slits and the screen are a lightsecond away from each other. I would like to know if there is any difference if I tempered with the slits before and after the photon is created from the source? Imagine a photon is being created and before it crosses the double slits and interfere with itself, I quickly close one of the slits.
Answer: Photons can be said to choose the best path considering all paths, this is another more modern interpretation as opposed to saying that "a photon interferes with itself".
If the slit closes before the photon reaches it then only a single slit pattern will be observed (from the other open slit), if the slit closes at the exact time the photon arrives then it will be based on probability whether single or double slit diffraction is observed. If the slit closes late then the normal double slit pattern will be observed.
All of the above assumes you will repeat the experiment a number of times to allow the pattern to build up as performed and shown in many single photon double slit diffraction experiments.
Answer: So you are saying that the slits and the screen are 1 lightsecond apart from each other. Let's assume there is an apparatus that will be able to temper with the slits this fast (faster then 1sec).
Now there are two cases that you mention:

you temper with the slits before the photon reaches the slits. In this case the photon's partial waves that cross the slits will not be able to interfere with themselves, and there will be no interference pattern. Though, the photon itself will still reach the screen, but when you repeat the experiment, you will not see any pattern as one slit will be closed every time before the photon would reach the slits
you temper with the slits after the photon reaches the slits. In this case, the photons' partial waves already passed the slits and interfered with themselves, so you will see a pattern.

Timing in double slits experiment


Keyboard "WillShow" and "WillHide" vs. Rotation

Question: I've got a view controller listening for both UIKeyboardWillShowNotification and UIKeyboardWillHideNotification. The handlers for these notifications adjust various parts of the view, which is standard procedure.
The following code is used to convert the keyboard rect from screen coordinates:
CGRect keyboardBounds = [self.view convertRect:[keyboardBoundsValue CGRectValue] fromView:nil];

Again, standard procedure. Unfortunately, there is a critical situation where this conversion fails. Look at what happens when an iPhone is rotated from portrait to landscape while the keyboard is deployed:
1) iOS automatically fires UIKeyboardWillHideNotification; self.interfaceOrientation is reported as portrait; keyboardBounds.height is 216.0. This makes sense. Why? Because the notification handler is given the chance to "clean up" before the view switches to landscape mode.
2) iOS automatically fires UIKeyboardWillShowNotification; self.interfaceOrientation is reported as portrait; keyboardBounds.height is 480.0. This does NOT make sense. Why not? Because the notification handler is going to do its work thinking that the height of the keyboard is 480.0!
Did Apple drop the ball on this one, or am I doing something wrong?
Please note that listening instead for UIKeyboardDidShowNotification is not a valid solution, because it significantly degrades the user experience. Why? Because animating my changes to the view after the keyboard deployment animation occurs is... well, pretty terrible-looking.
Has anyone managed to get autorotation working perfectly while the keyboard is deployed? It seems like an explosion of chaos that Apple has completely overlooked. >:|
Comment: Which iOS version are you trying this with?
Answer: Maybe a bit late, but I've just run into the same issue and have a nice solution for it that avoids any kind of work arounds (unless of course apple change things)
Basically, when the notification center calls your method for UIKeyboardWillShowNotification (or any of the other notifications), the frame that it gives you for UIKeyboardFrameBeginUserInfoKey is in context of the window, NOT your view. The problem with this, is that the windows coordinate system is always in portrait, regardless of the devices orientation, hence you're finding the width and height the wrong way round.
If you want to avoid your work around, simply convert the rectangle into the coordinate system of your view (which does change according to the orientation). To do this, do something like the following :
- (void) keyboardWillShow:(NSNotification *)aNotification
{
     CGRect keyboardFrame = [[[aNotification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue];
    CGRect convertedFrame = [self.view convertRect:keyboardFrame fromView:self.view.window];

    ......
    /* Do whatever you want now with the new frame.
     * The width and height will actually be correct now
     */
    ......
}

Hopefully this should be what you're after :)
Comment: Thanks a lot man! It seems that UIKeyboardFrameBeginUserInfoKey in upside down rotation returns {0,0} origins.
Comment: Take care to send `convertRect` to the correct view.
Answer: Recently I've wrote a blog post about this exact problem you've described and how to solve it with a short and elegant way. Here is the link to the post: Synchronizing rotation animation between the keyboard and the attached view
If you don't want to dive into the long explanation described in the blog post here is a short description with a code example:
The basic principle is to use the same method that everyone uses - observing keyboard notifications to animate the attached view up and down. But in addition to that, you have to cancel these animations when the keyboard notifications are fired as a consequence of interface orientation change.
Rotation example without animation cancellation custom on interface orientation change:

Rotation example with animation cancellation on interface orientation change:

- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];

    [[NSNotificationCenter defaultCenter]
            addObserver:self selector:@selector(adjustViewForKeyboardNotification:)
            name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter]
            addObserver:self selector:@selector(adjustViewForKeyboardNotification:)
            name:UIKeyboardWillHideNotification object:nil];
}

- (void)viewDidDisappear:(BOOL)animated {
    [super viewDidDisappear:animated];

    [[NSNotificationCenter defaultCenter]
            removeObserver:self name:UIKeyboardWillShowNotification object:nil];
    [[NSNotificationCenter defaultCenter]
            removeObserver:self name:UIKeyboardWillHideNotification object:nil];
}

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
    [super willRotateToInterfaceOrientation:toInterfaceOrientation duration:duration];
    self.animatingRotation = YES;
}

- (void)didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation {
    [super didRotateFromInterfaceOrientation:fromInterfaceOrientation];
    self.animatingRotation = NO;
}

- (void)adjustViewForKeyboardNotification:(NSNotification *)notification {
    NSDictionary *notificationInfo = [notification userInfo];

    // Get the end frame of the keyboard in screen coordinates.
    CGRect finalKeyboardFrame = [[notificationInfo objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue];

    // Convert the finalKeyboardFrame to view coordinates to take into account any rotation
    // factors applied to the window's contents as a result of interface orientation changes.
    finalKeyboardFrame = [self.view convertRect:finalKeyboardFrame fromView:self.view.window];

    // Calculate new position of the commentBar
    CGRect commentBarFrame = self.commentBar.frame;
    commentBarFrame.origin.y = finalKeyboardFrame.origin.y - commentBarFrame.size.height;

    // Update tableView height.
    CGRect tableViewFrame = self.tableView.frame;
    tableViewFrame.size.height = commentBarFrame.origin.y;

    if (!self.animatingRotation) {
        // Get the animation curve and duration
        UIViewAnimationCurve animationCurve = (UIViewAnimationCurve) [[notificationInfo objectForKey:UIKeyboardAnimationCurveUserInfoKey] integerValue];
        NSTimeInterval animationDuration = [[notificationInfo objectForKey:UIKeyboardAnimationDurationUserInfoKey] doubleValue];

        // Animate view size synchronously with the appearance of the keyboard.
        [UIView beginAnimations:nil context:nil];
        [UIView setAnimationDuration:animationDuration];
        [UIView setAnimationCurve:animationCurve];
        [UIView setAnimationBeginsFromCurrentState:YES];

        self.commentBar.frame = commentBarFrame;
        self.tableView.frame = tableViewFrame;

        [UIView commitAnimations];
    } else {
        self.commentBar.frame = commentBarFrame;
        self.tableView.frame = tableViewFrame;
    }
}

This answer was also posted in similar question: UIView atop the Keyboard similar to iMessage App
Answer: I met the same problem. iOS gaves me incorrect width/height of the keyboard. I used the following snipped in a keyboardDidShow handler:
CGSize keyboardSize = [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
CGSize keyboardSize2 = [[info objectForKey:UIKeyboardFrameEndUserInfoKey] CGRectValue].size;
LogDbg(@"keyboard size: frameBegin=%@; frameEnd=%@", NSStringFromCGSize(keyboardSize), NSStringFromCGSize(keyboardSize2));

and for portrait and landscape modes of iPad I got respectively:
2012-06-14 04:09:49.734 -[LoginViewController keyboardDidShow:] 132 [DBG]:keyboard size: frameBegin={768, 264}; frameEnd={768, 264}
2012-06-14 04:10:07.971 -[LoginViewController keyboardDidShow:] 132 [DBG]:keyboard size: frameBegin={352, 1024}; frameEnd={352, 1024}

Guessing that the width of the keyboard should be greater then the height (yep, i'm so naive) I made a workaround like following:
if (keyboardSize.width < keyboardSize.height)
{
    // NOTE: fixing iOS bug: http://stackoverflow.com/questions/9746417/keyboard-willshow-and-willhide-vs-rotation
    CGFloat height = keyboardSize.height;
    keyboardSize.height = keyboardSize.width;
    keyboardSize.width = height;
}

Answer: Well, try looking at keyboard width.  If it is the value that you are expecting, then I assume that the values are simply switched ;).  480 makes sense as a keyboard width for going into landscape, which is what gives me this hunch.
If that fails, just store the portrait and landscape rectangles separately.  They are well documented ;)
Comment: Thanks, but I'd like to avoid hardcoding such values. There's a reason the OS reports the keyboard's dimensions to the running process.
Comment: I take it they weren't simply reversed then?
Answer: I know this a very very late reply. Now only I came on this situation and find the unanswered question. So I thought I'll share my solution. There will be some other better way, but the following way also we can solve this.
The KBKeyboardHandler that I used is from: UITextField: move view when keyboard appears
I just changed my delegate as following:
- (void)keyboardSizeChanged:(CGSize)delta
{
    CGRect frame = self.view.frame;
    UIInterfaceOrientation interfaceOrientation = [[UIApplication sharedApplication] statusBarOrientation];
    switch (interfaceOrientation) {
        case UIInterfaceOrientationPortrait:
            frame.origin.y-=delta.height;
            break;
        case UIInterfaceOrientationPortraitUpsideDown:
            frame.origin.y+=delta.height;
            break;
        case UIInterfaceOrientationLandscapeLeft:
            frame.origin.x-=delta.height;
            break;
        case UIInterfaceOrientationLandscapeRight:
            frame.origin.x+=delta.height;
            break;
        default:
            break;
    }
    self.view.frame = frame;
}

And it was working fine.
Answer: Here is my workaround:
CGSize keyboardSize = [[[notification userInfo] objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size;
float keyboardHeight = self.interfaceOrientation == UIInterfaceOrientationPortrait ? keyboardSize.height : keyboardSize.width;

Hope this helps :)
Answer: I use the following code to get the size of the keyboard which works fine for all rotations
NSDictionary *info = [aNotification userInfo];
if (UIInterfaceOrientationIsLandscape(self.interfaceOrientation))
  kbHeight = [[NSNumber numberWithFloat:[[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size.width] floatValue];
else
  kbHeight = [[NSNumber numberWithFloat:[[info objectForKey:UIKeyboardFrameBeginUserInfoKey] CGRectValue].size.height] floatValue];
NSLog(@"keyboard height = %F",kbHeight);

I then test for the orientation using the status bar orientation (which works in the first launch case for the iPad) and shift the view in the relative direction needed to make space for the keyboard. This works perfectly, if the keyboard is visible then it relocates to the correct position on rotations.
UIDeviceOrientation orientation =  [UIApplication sharedApplication].statusBarOrientation;

if (orientation == UIDeviceOrientationPortrait)
  {
  NSLog(@"Orientation: portrait");
  self.originalCenter = self.view.center;
  self.view.center = CGPointMake(self.originalCenter.x, self.originalCenter.y-kbHeight);
  }

if (orientation == UIDeviceOrientationPortraitUpsideDown)
  {
  NSLog(@"Orientation: portrait upside down");
  self.originalCenter = self.view.center;
  self.view.center = CGPointMake(self.originalCenter.x, self.originalCenter.y+kbHeight);
  }

if (orientation == UIDeviceOrientationLandscapeLeft)
  {
  NSLog(@"Orientation: landscape left");
  self.originalCenter = self.view.center;
  self.view.center = CGPointMake(self.originalCenter.x+kbHeight,self.originalCenter.y);
  }

if (orientation == UIDeviceOrientationLandscapeRight)
  {
  NSLog(@"Orientation: landscape right");
  self.originalCenter = self.view.center;
  self.view.center = CGPointMake(self.originalCenter.x-kbHeight,self.originalCenter.y);
  }

You can return the view to its original position when the keyboard disappears or via a textFileDidEndEditing function.