What tense is "If I were a bird, I could fly"

Question: The sentence is not referring to any time past, present of future. It's just referring to an imaginary condition which has never existed and seemingly will never exist. Still, the sentence and other sentences of this type are said and spoken. So what can we say about their nature? Which tense are they, what type are they? Their clauses, etc.
Comment: It isn't obsolete at all. It is present-day English, but some native speakers will say _If I was a bird, I'd be able to  fly_.
Comment: You correctly tagged this with subjunctive mood. Your question may be related to http://english.stackexchange.com/questions/660/if-i-was-or-if-i-were-which-is-more-common-and-which-is-correct.
Comment: Thanks for all of yours responses. One thing has been clear that this sentence is in a state which is almost obsolete.
Now again I would like to know that how will we pronounce the same sentence in modern day English? I mean how will we convey the same meaning in present day English?
Comment: I agree with @BarrieEngland; while subjunctive mood is falling out of favor, I can hear it saying in a Monty Python voice, "I'm not dead yet." In versions earlier than MS Word 2007, the software would give you a squiggly green line on the verb (i.e., grammar correction) for "If I were" and suggest "If I was." Perversely, in MS Word 2010, it lets the subjunctive pass without a peep.
Comment: Thanks Barrie and Rajah.. but then if it is not obsolete. their must be a definite tense :( representing it. its main clause is, "If I were a bird" does not that suggest that it belongs to past indefinite?
Comment: The "were" construction does not necessarily indicate an impossible or ficticious condition. "If you were to phone me I would drop everything to talk with you."
Answer: Were is the plural past tense form of be, used here in a counterfactual conditional idiom construction that is given various names, including "subjunctive", which often apply to other European languages, though not to English.
In fact, however, tense is not what you need to know here. Tense only has to do with time -- past (was/were) and present (am/is/are) are the only tenses in English -- and the important thing about this construction is not when it occurs, but whether it occurs at all. And it doesn't; nothing happens. That's what counterfactual means.
So, in essence, there is no real time reference involved. Especially since the second clause uses the modal auxiliary could. Modals are defective verbs and are not inflected; therefore they can be said either to be always in the present tense, or to have no tense at all, depending on whether you require the first verb in an auxiliary chain to have a (perhaps inaudible) tense marker; take your pick.
It's true that there are certain uses of modals that retain some of their original preterite morphology, e.g, present can and preterite could in

When I was 25, I could do 100 pullups; now I can only do 99.

But there's no "past" at all in

I could do that right now.
Would you like to dance?
You must come visit me soon.

which are formed from historically preterite modals (could, might, would, should, must) instead of historically present ones (can, may, will, shall).
They're all idiomatic now. It's a mistake to expect any consistent semantic or grammatical regularity from modals, especially if there are negatives lurking about.
Comment: very helpful answer. What 'historically present modal', if there is one, is 'must' the preterite of? Pity you did not say anything about it...
Comment: English lost it a long time ago. It would be _muss_, or something like that, if it still existed. In German, which still has inflectable modal verbs, the present tense of "I must" is _Ich muss_ and the past tense (which means "I had to") is _Ich musste_. The final suffix is the normal -t/-d past that occurs in _could, should, would,_ and _might_.
Answer: If I were is in the past subjunctive.  It is used for hypotheses.
Then I could, like then I would be able to, is construed to be in the conditional.  However, morphologically, could is the past tense of the modal can.
Comment: @BarrieEngland I've never understood this desire to reanalyse and rebrand such things all the way back to OE (and probably beyond) using different terms than have traditionally been applied to them. There is probably an argument to be made there, but if so, I doubt whether it would fit within these comments.
Comment: Or, if you, prefer, as I and Messrs Huddleston and Pullum do, it is irrealis _were_.
Answer: The verbs in this sentence are vestiges of a subjunctive used in English to indicate conditions contrary to fact. We indicate this usage by using the plural form, where it exists, of the past tense.
Were is the plural past tense of to be.
Could is the past tense of can (no singular/plural distinction exists).
Example:
I have gone to the store to buy milk.
If I had gone to the store to buy milk...
Comment: _Plural past tense_ is an unsatisfactory description of _were_. _You were_ can be singular.
Comment: Understood. Looking for an easy guide for someone trying to figure out how to make the construction. Really, it's any non-first person formation, but to say, "Use the past plural" yields the correct result.
Answer: We have to distinguish between the name of a tense, eg conditional, and its use.
Present tense can be used to refer to the future time.
"Conditional" as name means this tense/mood mostly occurs in if-clauses. But that does not cover all uses. - I tried but the window would not open, it was jammed. - Here we have a would-form that does not describe an unreal condition.
"Were" in "If I were a bird" is grammatically past subjunctive, but it does not refer to a past event. It expresses an unreal/hypothetical condition referring to present or future time.
So the name of a tense and its use can be very different.
Answer: Yes, there are tenses on subjunctive moods.
The tense of "If I were a bird, I would fly to you" is present.
If I write this again in indicative mood:
I AM NOT a bird and I CANNOT fly to you.
You also can use past subjunctive mood.
"If I had been a bird, I would have flown to you." = (indicative mood) I WAS not a bird and I COULD NOT fly to you.
Answer: I would say it is past. In "If I were a bird", the 'were' is the past subjunctive of 'to be'. If it were the present, the sentence would be, "If I be a bird", which is probably even more obsolete than the past form.
The Oxford English Dictionary lists 'were' as the past subjunctive in the 1st, 2nd and 3rd singular and plural. It lists 'be' as the present subjunctive in the 1st, 2nd and 3rd singular and plural. Despite the meaning, it isn't because of the 'were' itself that makes it somewhat irrealis; it is the use of the subjunctive itself, which has two forms


Pca9685 & WS2818B, 1 Nano

Question: Arduino n00b here. I currently have an Arduino Nano set up to run 6 servos from a PCA9685 board. I'm looking to add 6 switches and 6 LED indicators to switch servo positions. What I'm curious about is how to connect the WS2818B. I know they can be run through I2C, but the Pca9685 is using those wires. Can I run both the pca9685 and the LEDs through I2C or just run each LED through a separate pin?
Answer: I was looking at WS2818B datasheet, they do not use i2c. It just needs a single ( dedicated) pin to receive the color/brightness commands.

Pca9685 & WS2818B, 1 Nano


Ancillary function of a random vector, which is independent of change of origin and scale

Question: Let
$(X_1,\ldots,X_n)$ be a random vector, whose distribution involves unknown: location parameter $\mu$ and a scale parameter $\sigma>0$. It follows, that any measurable function $f(X_1,\ldots,X_n)$, satisfying condition:
$$
f(\frac{X_1-a}{b},\ldots,\frac{X_n-a}{b})=f(X_1,\ldots,X_n) \quad \forall a\in \mathbb{R}\quad\land b>0,
$$
is ancillary statistic for the unknown parameter $(\mu,\sigma)$. How to prove the above implication? This statement appears in: "On statistics independent of a complete sufficient statistics", D. Basu.
Answer: You say that $X$ has some parametric distribution, which is a location-scale family. Then aspect of the distribution which is not influenced by the location or scale is said to measure some aspect of the distributions shape. By transforming
$$
   X_i \mapsto \frac{X_i-a}{b}
$$
you changes $X$ to have some distribution from the same family, only with location and scale changed. Your requirement is that this should not change the value of $f$. Then compare to the definition of ancillary statistic.
Comment: i think i've got it: if $X$ has distribution $\mathbb{P_{\mu,\sigma}}$, and $Y=b^{-1}X-a \mathbb{1}$ has distribution $\mathbb{P_{\mu',\sigma'}}$, then $\mathbb{P_{\mu',\sigma'}}(\{f(Y)\in B\})=\mathbb{P_{\mu,\sigma}}(\{f(b^{-1}X-a)\}\in B)=\mathbb{P_{\mu,\sigma}}(\{f(X)\in B\})$ for every measurable $B$ from range of $f$.
Comment: Ok, so starting from $X$, which has some distribution $\mathbb{P_{\mu,\sigma}}$, or starting with $Y=\frac{X-a}{b}$, which has some distribution $\mathbb{P_{\mu',\sigma'}}$, does not change value of function $f$. But i further can't see, that the distribution of this function will be the same. Could you give me some hint about how i can show it analytically?
Comment: @Mentossinho: If its value does not change by this transformation, and that is true *for all $x$*, how can its distribution change?


Current in a conductor

Question: In electrostatic shielding, we have read that the charged particles in a conductor experience no force.
       In the current carrying conductor, electric field is applied across its ends and the electrons experience force due to this field and constitute electric current.
However the two ideas oppose each other. If there is no electric field inside conductor, then how there will be flow of charge?
Answer: The electric field is zero in a conductor only in electrostatic situations. And this happens after a (usually extremely short) time comparable to the so-called dielectric relaxation time $\tau=\epsilon/\sigma$ for the redistribution of charges. If you apply a steady voltage difference to a conductor, there will be an electric field inside the conductor which produces a stationary current.
Comment: I have a doubt, we know that when conductors are placed in electric field they adjust their charges in such a way that the net field inside it becomes zero. In case we are applying a constant potential, isn't it analogous to the constant Electric field situation? Then why do we still observe flow of charges.
Comment: Yes. Me asking the same thing.
Comment: @a.b - You apply a potential difference (electromotoric force) with electrical contacts which maintains a steady electrical current. Charge carriers which are moved to one contact from the inside or removed from the other by the electric field  are transported into the contact or replenished there from the outside by the voltage source which supplies the current. In the electrostatic situation the charges carriers don't enter or leave the conductor. There is no current after the initial movement of the charges to the conductor surface which  produces the shielding of the field penetration.
Answer: The electric field inside an ideal conductor will be zero when under static conditions. In this case, a current can flow without an electric field present inside the conductor. But this is only true for an ideal conductor, like a superconductor. Most people, when talking about electromagnetics, will make the assumption that there is no electric field inside a conductor, however people talking about circuits will say that there is a (small) electric field inside the conductor.
In a non-ideal conductor, such as a real world wire or metal plate, a small electric field is required to maintain a constant flow of current under constant potential. This is only true because the electric field, which is directly related to the electric force on the charges in the wire, must overcome the non-zero resistance of the wire.
The mechanism at play in a typical circuit that allows for a constant potential is the existence of a power source which can maintain a difference in charge between two points, thus providing a constant voltage. In order for this to work, charges traveling into one end must be transferred to the other end continuously, or else the wire would "succeed" in rearranging all of its charges. This is done in any number of ways, e.g. electrochemically with a battery.
Side note: Power sources can also supply constant current, generating whatever potential difference is required to maintain a constant current. These are called current sources, but they are only common when you work with circuit design; they aren't as familiar so they are often left out.
It's worth noting that applying a potential difference to a wire will be effectively "shorting" the power supply, allowing very high currents. In the case of an ideal conductor, it would require infinite current to maintain a constant potential. This is why we need current-limiting elements such as resistors. Charges inside an ideal conductor will immediately rearrange, and the only way to maintain a potential is by allowing infinite charges through the power source, which is, of course, impossible.

Current in a conductor


Change in appearance of liquid drop due to gravity

Question: A liquid drop is spherical in shape due to surface tension. But why does it appear as a vertical line under the free-fall due to gravity? (E.g. During a rain - falling raindrop) Is there a specified length for the line or does it vary with the size of drops?
Comment: Your original question was better--- they appear long because they are moving fast, and so streak in your eye.
Comment: I'm not sure I exactly understand your question but maybe that can be interesting http://www.ems.psu.edu/~fraser/Bad/BadRain.html
Answer: A drop that is free falling in vacuum is spherical. This is because free falling in a gravitational field is the same thing as being at rest with no gravitational field present: the gravitational field and the acceleration cancel each other out.
Rain drops falling to the earth can have various shapes depending on their size, although I am not aware that they can become elongated (can you provide a source?). These shapes are due to the air flowing past them, in a rather intuitive way: roughly, air flow causes the bottom to become flatter.
Edit: Regarding the appearance of raindrops (as opposed to their physical shape), consider taking a photograph of falling rain. The camera integrates the incoming light over the exposure time $t$, during which the drop travels a distance of $v t$, where $v$ is the velocity. If we are close to the ground this will be the terminal velocity, which is about $2_{m/s}$. If we use an exposure time of $t=1/60_s$ (say we are using a flash), the drop will trace a line of length $\sim 3_{cm}$. The apparent line on the photograph then has to account for distance from the drop, etc.
Comment: Their shape depends on their size. Small drops are spherical, larger ones look sort of like pancakes (this is what I mean by 'flat', perhaps this was not clear), yet larger ones look like parachutes. I don't know at which size (if any) they become elongated, but the shape is due to the flow of air and not gravity. I will try to clarify...
Comment: I mistook a drawing for a photo! You are right--- raindrops are flat on the bottom. I assumed this would be unstable because the raindrop weight would be greater at the center. I found this paper: http://weather.about.com/od/cloudsandprecipitation/a/rainburgers.htm (although the wikipedia link you provide is fine).
Comment: They don't become flat, they become elongated, OP is asking why.
Comment: @CrazyBuddy then that's the question about optical illusions
Comment: @CrazyBuddy What confuses me at least is that you call them 'horizontal' lines -- I never saw a raindrop that looks like that. That is why I thought you meant this flattening. Do you mean vertical lines?
Answer: It is not an answer but an unfinished draft of how to get the shape :
Let $y(x)$ be the profile function of this axisymmetric shape. Supposing a laminar regime friction implies the total counterforce to weight is : $$F=2\pi av\int_0^L\frac{y'y}{\sqrt{1+y'^2}}dx$$ because the friction force is along the normal, while the projection along the axis is needed.
This is a variational problem, the minimum of F is seeked under the constraint of constant volume, given by : $$V=\pi\int_0^L y^2dx$$ and $y(0)=y(L)=0$.
Using Lagrange multipliers we get the functional : $$I[y]=\int_0^L \frac{\pi a v y y'}{\sqrt{1+y'^2}}-\lambda( \frac{V}{L}-\pi y^2)dx$$. The Euler-Lagrange equation permits to express y as a function of the multiplier and the derivatives, but I stopped there because it becomes a bit tedious and it is late here.
Then should follow to derivate towards $\lambda$ getting a final ODE for y, nevertheless it is nonlinear and of high order.
The latter should imply in particular that there are families of shapes, thus maybe there is no agreement on it.


Randomly initialised global counter used to encrypt the kth message with $\operatorname{IV} = \operatorname{IV} + k \hspace{5mm} mod \hspace{5mm} 2^n$

Question: The use of an increasing IV is not secure for a block cipher. That is, using a random IV for the first message then $\operatorname{IV} + 1$ for the second , $\operatorname{IV}+ 2$ for the 3rd etc. How can I construct an attack to show that this mode is not secure?
Comment: Just for terminology, the main problem here is having a predictable IV. https://crypto.stackexchange.com/questions/3883/why-is-cbc-with-predictable-iv-considered-insecure-against-chosen-plaintext-atta
Comment: *The use of an increasing IV is not secure for a block cipher.* No that depends on the mode of operation, mainly CBC is not secure, but other modes like GCM mode it is secure (i.e. the IV is a nonce). Block ciphers themselves do not have an IV as input.
Answer: A block cipher, per se, does not have a notion of initialization vector.  But a randomized or stateful message cipher may.  If you're building an application, you should forget the concept of 'block cipher' altogether: the fact that some cryptographic magic is built out of a pseudorandom permutation family whose name is spelled A-E-S is not important to you; the security contract of the result, including your obligations and the security you get in exchange, is what's important.

For a randomized cipher like AES-CBC, your obligation in the security contract is to choose an IV unpredictably.
If, given the first message's IV, the adversary can guess the second message's IV, the security contract is voided.  This mistake was exploited to recover plaintext in ssh sessions in 2009[1] (paywall-free).
For a stateful cipher like AES-CTR, your obligation in the security contract is typically to choose a nonce uniquely, which you can do by counting.  (The 'nonce', for number used once, is sometimes called an 'IV', but some authors—like this one—prefer to reserve the term 'IV' for unpredictable ones.)
It does not matter if the adversary can predict the nonce in advance, as long as the sender never repeats a nonce.  As a bonus, you can immediately detect buggy implementations by having the receiver require the nonces to be sequential.

One can always safely use state to choose the IV for a randomized cipher, by deriving it by a pseudorandom function of the number of messages so far; and one can choose a nonce randomly for a stateful cipher, but at risk of nonce collision, so it's not so safe.
All this said, you should really use an authenticated message cipher.  Even if an adversary can't read secrets in an encrypted message by eavesdropping, without authentication you might act on adversary-controlled input which causes secrets to leak.  Examples of authenticated ciphers include:

AES-GCM, with a message sequence number for the 96-bit nonce;
NaCl crypto_secretbox_xsalsa20poly1305, with a message sequence number or uniform random nonce, since the 192-bit nonce is large enough to be safely chosen uniformly at random; or,
if you must use AES-CBC, at least use it in encrypt-then-MAC composition with HMAC-SHA256 or similar, and the sender must choose the IV unpredictably for each message.
Comment: I think the part about CTR does not distinguish the nonce, the IV and the counter used *within CTR*, to be honest. The nonce is usually just part of the counter value, and the IV is generally the full block size in API's. Generally those use an unsigned big endian counter, so the nonce will be the leftmost bytes within the IV, which is simply the initial counter. The danger is that you can have a unique IVs of 16 bytes, that still manage to repeat counter values if they are too close.
Comment: I'm not addressing any internals of AES-CTR.  You feed it a message up to (say) 4 GB and a 96-bit nonce (as in AES-GCM), and it returns a ciphertext which is secret as long as you don't repeat the nonce.  The fact that there is a per-block counter inside it is just as much an irrelevant implementation detail as the fact that there's a pseudorandom permutation family inside it.  As a matter of _usage_, a message sequence number, _i.e._ a count of the messages so far, is a very good way to choose a nonce.
Comment: Also, while the name 'AES-CTR' doesn't imply any _particular_ formatting of the AES input, if you're doing $m \oplus \bigl(\operatorname{AES}_k(n) \mathbin\| \operatorname{AES}_k(n + 1) \mathbin\| \operatorname{AES}_k(n + 2) \mathbin\| \cdots\bigr)$ where $n$ is the nonce and $+$ is addition rather than concatenation, you're doing it wrong and violating the security contract that essentially everyone understands the name 'AES-CTR' to have, because this is _not_ a nonce-based cipher: it is _not_ enough that $n$ be unique. If you know of APIs that do this, please send them my stern vituperation.
Answer:
How can I construct an attack to show that this mode is not secure?

I assume you're asking about CBC mode (you didn't specify), and while this smells like a homework question, it's been long enough for the assignment to have been due, and so I'll just give you the answer.
What you do is ask to encrypt three consecutive messages, and the first block of the first message has the value $X$, the first block of the second message has value $X \oplus 1$ and the first block of the third message has the value $X$.  It doesn't matter that $X$ is, and it doesn't matter what the rest of the messages are.
Because of how CBC works, the first block of the three encrypted messages are the values:
$$AES_k( IV \oplus X )$$
$$AES_k( (IV+1) \oplus (X \oplus 1))$$
$$AES_k( (IV+2) \oplus X) $$
If the lsbit of $IV$ happens to be 0, the $IV+1 = IV \oplus 1$ (as the internal carry in the addition doesn't propagate beyond the lsbit), and so $(IV+1) \oplus (X \oplus 1) = IV \oplus X$, that is, the initial blocks of the first and second ciphertext messages are the same, which can be tested.
And if the lsbit of $IV$ happens to be 1, then the lsbit of $IV+1$ will be 0, and so we have $(IV+2) \oplus X = ((IV+1) \oplus 1) \oplus X = (IV+1) \oplus (X \oplus 1)$ and so the initial blocks of the second and third ciphertext messages are the same, which can also be tested.
So, this shows that the construction does not meet IND_CPA security.


Why does the marriage bond cease with death?

Question: I know Jesus says marriage ends with death, but I don't understand WHY marriage ceases to exist with death. I prefer Catholic answers to this question.
Comment: The main reason is that otherwise remarriage would be adultery!
Answer: Catholic teaching that marriage ceases with death
Good question (although Jesus didn't exactly say marriage ends with death), especially with the secular culture promoting the idea that "marriage is forever" (e.g. wedding ring seller: "diamond is forever").  Also, with the Catholic church assiduously protecting the indissolubility of sacramental marriage before death (if valid and consummated) and how one has to go through a possibly complicated canonical process for remarrying, why does the Catholic church teach that the marriage bond ceases with death? (see below)
Canon Law 1141, quoted by CCC 2382 says:

Can. 1141 A marriage that is ratum et consummatum can be dissolved by no human power and by no cause, except death.

Scripture also provides the legal basis of marriage dissolution at death consistent with "Until Death Do Us Part" in the marriage vow (see the history of it in a magazine article Why We Say "Until Death Do Us Part" In Wedding Vows).  Romans 7:3:

Accordingly, she will be called an adulteress if she lives with another man while her husband is alive. But if her husband dies, she is free from that law, and if she marries another man she is not an adulteress.

What will survive and will be transformed: love between spouses
To answer this question, we need to understand which aspect of earthly marriage survives to heaven according to the Catholic church.  A reddit question has a good answer (emphasis mine):

Marriage is a sacrament. Sacraments are "visible signs of invisible grace" that help us encounter God and His Love in tangible ways. When we are in heaven, we will have no need of sacraments any more because we will be dwelling within God's love eternally. We won't need to receive the Eucharist, for example, since we will eternally be in God's presence.
Marriage, in particular, is a sacrament that makes God's love known on earth (to each spouse in the marriage and to the community who witnesses their love). We won't need marriage to witness to God's love in heaven, however, because we will be IN God's love already. It would be superfluous.
Of course, that's not to say that a lifetime of loving one another won't mean anything at all in heaven. The love I have for my husband, for example, will still be present.

A similar explanation is offered by Fr. Raniero Cantalamessa in his commentary on the readings for the 32nd Sunday in Ordinary Time (cycle B) which also addresses other scenarios (unhappy marriage, remarriage after first spouse's death, etc.).
A third support can be had from the conclusion of St. John Chrysostom's Letter to a Young Widow (whose husband died after only 5 years of happy marriage) that marital love will be transformed into a "far nobler kind":

Wherefore desisting from mourning and lamentation do thou hold on to the same way of life as his, yea even let it be more exact, that having speedily attained an equal standard of virtue with him, you may inhabit the same abode and be united to him again through the everlasting ages, not in this union of marriage but another far better. For this is only a bodily kind of intercourse, but then there will be a union of soul with soul more perfect, and of a far more delightful and far nobler kind.

(Source: NC Register article Is There Marriage in Heaven?)
What ceases: procreation and vow
The Catholic church teaches that the marriage covenant

is ordered by its nature to the good of the spouses and the procreation and education of offspring ... (Canon 1055)

Although in Mark 12:25 and Matthew 22:30 Jesus didn't exactly say that marriage ceases with death, Jesus explicitly said that there will be no new marriages and that couples will live like angels in heaven, implying that there will also be no procreation (like angels).  Since what is "good of the spouses" has been transformed into something better (see previous section), then it makes sense that there is no more reason for the marriage covenant after death.
Also, in Romans 7:1-3 Paul implied that once a spouse has died he/she will no longer be bound by law to the other.
Non Catholic Views
It's interesting that for LDS marriage survives death: see LDS answer to the question "Do Mormons believe that marriage is eternal?"
Also, among non-Catholics there are several views of the marriage covenant that become important when considering whether Remarriage after divorce should be allowed; see a book in the Counterpoints series: Remarriage After Divorce in Today's Church: 3 Views.
Comment: @zippy2006 Thanks.  Added the procreation angle into the answer.
Comment: This is a good answer.  In addition I would point to two things: 1) Mark 12:25 and Matthew 22:30, and 2) The Catholic Church's constant teaching that there will be no pregnancy/birth in Heaven, and therefore no need for copulation or marriage.
Answer: The purpose of marriage is the procreation of children. 1917 canon 1013:

The primary end of marriage is the procreation and the education of children

Cornelius à Lapide, S.J., commentates on St. Matthew 22:30 ("For in the resurrection they shall neither marry nor be married, but shall be as the angels of God in heaven."):

there will be no need then of marriage and generation; for these things have been instituted for the perpetuation of the race and the individual, by means of children. Because the father is mortal, therefore he begets a son, that after death he may live and continue in his son. But in Heaven there shall be no death, and they shall live for ever. Marriage, therefore, and procreation of children would be without an object there. Wherefore S. Luke adds (20:36), Neither can they die any more. Appositely says S. Augustine (Quæst. Evang. in Luc. xx. 35):

Marriage is for the sake of children, children for the sake of succession, succession on account of death. Where, therefore, death is not, marriage is not.

Though marriage ceases, the bonds of charity between friends endure (St. Thomas Aquinas, Summa Theologica II-II q. 26 a. 3 "Whether the order of charity endures in heaven?"); "there seems to be the greatest friendship between husband and wife" (Summa contra Gentiles lib. 3 cap. 123 [6]).
Answer: Because in Heaven your bond with everyone is greater than even your marriage bond is down here. As to the ends of marriage, the view of Dietrich von Hildebrand is everywhere the standard.
Sticking strictly to the question this is said to allow other marriages. There is no dogmatic de fide statement about what the relationship of former spouses is in heaven. I do personally like St Thomas More's

Here lies Joanna, dear little wife of Thomas More, who intends this tomb for Alice and me. The first united to me in my youthful days, gave me a boy and three girls to call me father. The second, a rare distinction in a stepmother, was as affectionate as if the children were her own. It is hard to say if the first lived with me more beloved than the second does now. Oh how blessed if fate and religion had permitted all three of us to live together. I pray the tomb and heaven may unite us, thus death could give what life could not give.

Epitaph written by Sir Thomas More for his wives seen to this day in Chelsea Old Church
Comment: "in Heaven your bond with everyone is greater than even your marriage bond is down here" what is your source for this statement?
Answer: Jesus did not exactly say marriage ends with death. He said:

For when they rise from the dead, they neither marry nor are given in
marriage, but are like angels in heaven.  -- Mark 12:25

Literally this means that a person cannot marry in the afterlife. It does not mean that a marriage is dissolved when a person dies.
Writing in the Catholic Standard, Msgr. Charles Pope writes:

... We ought not to conclude that a long marriage in this world will
have no meaning at all in the age to come. In heaven our body and our
soul will be perfected. So, too, our fundamental relationships, both
spousal and familial. They will not be discarded or simply forgotten.
Surely those who are spouses here will experience a far more perfect
union in Heaven... While the juridical aspects of marriage may end at death, the union of hearts and lives will not.

The Catechism states in CCC ¶1026:  "Heaven is the blessed community of all who are perfectly incorporated into Christ." It is hard to think of a truly blessed community that does not include families. Thus Msgr. Pope's point is well taken.
We also have testimonies from saints who, shortly before death, reported seeing their families in the next world. For example, St. Thérèse of Lisieux promised her her sisters that she would "be even more with you than I was before. I'll will not leave you.  I will watch over Uncle and Aunt, over my little Lèonie, over all of you.  When they are ready to enter heaven, I'll go very quickly to meet them." Is there a reason why married saints (there are about 500 of them) would not watch over their spouses as well, and welcome them eventually into heaven if/when they arrive there?
However, for Catholics, the focus in heaven is not humans, but on God. People who reside in heaven are "Absorbed in the beatific vision," but not so much that they do not recognize their relatives and still have special feelings for them.
As Sr. Marie Morgan points out, we also have countless testimonies from Catholic laypeople who report visitations from family members, including spouses, who have passed away.

(There are) innumerable stories told by people even today who lie on
their death beds, sharing with us their experience of dying. How many
hospice workers can attest to the fact that many people claim to have
seen or even spoken with their loved ones as they lay dying! For some,
it is easy to "write off" these experiences as drug-induced fantasies
or as hallucinations caused by the brain "shutting down."  However,
when these experiences bring great peace and joy to agitated souls, I
believe they point to the presence of some sort of heavenly
intervention.  As my own mother lay dying nearly two years ago, she
smiled and exclaimed that she could see her brother "up there!"  I
have no doubt that she did.

And if a nun will know her mother in heaven, it must surely be that that a happily married wife will know her husband, and the husband will know his wife. Jesus did not not tell us that marriages end in heaven, he said only that we will not get married there. Those already married remain so, at least in heart if not in law.
Comment: "_he said only that we will not get married there. Those already married remain so._" Marriage ceases, but [the bond of charity between a husband and wife endures in heaven](https://christianity.stackexchange.com/questions/45684/communion-of-saints-and-our-relationships-in-heaven/45686#comment228689_45684).
Comment: I didn't do the -1.  I think this answer is right within the spirit of Catholicism but doesn't quite answer the OP question on WHY the Catholic teaching says the marriage is dissolved (in the eyes of the Church), consistent with the vow: ["until death do us part"](https://www.redbookmag.com/love-sex/relationships/a49934/until-death-do-us-part-wedding-vows-origin/)).   In other words, while your answer is very good in the exegesis of Jesus's saying and in explaining the *continuing* aspect of the marital union, it fails to reconcile with the "dissolved" aspect that Romans 7:3.
Comment: The "neither married nor given in marriage" quote is in context of a story of a woman who had 7 husbands, one would die and she married another, and Jesus was asked who she was married to in heaven. If the answer is "you stay married when you die," then she's married to 7 dudes in heaven, and her not getting married to an 8th after death doesn't at all address the point: she's still got 7 husbands, which Jewish law didn't permit and neither does ours. OTOH, if people don't stay married when they die but are "like the angels," the question is answered.
Comment: St. Paul also addresses this in Romans 7:2: For instance, a married woman is bound by law to her husband as long as he lives. But if her husband dies, she is released from the law of marriage.
Comment: @Maverick, like Geremia, I would make a distinction between the law of marriage and the emotional bonds of marriage. The former are dissolved so that a widow may remarry. The latter may be retained so that families are not separated in the afterlife.


Can I replace post mount disc brakes calipers with flat mount calipers?

Question: I have post mount TRP Spyre calipers, how can I upgrade to flat mount Ultegra calipers? are there adapters available? I've only seen adapters for flat to post.
Comment: I've closed this as a dupe of the other linked question because it had an accepted answer and was 6 months older.  Did you ever complete this job?  If so, feel free to add your own answer sharing how it went and what challenges you faced.
Answer: I think there are no adapters on the market to use flat-mount calipers on a post mount fork, so your options are:

Get a flat mount fork and Ultegra caliper you want. I actually did that, the additional price will depend on new/secondhand and no-name/open mold/brand name factors.
Get any post mount Shimano hydraulic caliper, those are all compatible. There's no actual Ultegra post mount calipers, but prior to R8000, Shimano made a non-group, Ultegra-level ST-RS685/BR-RS785 shifters/calipers, so you might use a BR-RS785 or slightly older BR-R785 (actually an XT).
Comment: BR-RS785 has a straight hose connection while BR-R785 has the banjo.  So go with BR-RS785, or Deore BR-M6000.  Both are directly compatible with OP's other parts.
Comment: Yeah, but the banjo connector doesn't matter much unless there's a tight clearance. Just a matter of what hose to get.


Image clustering by its similarity in python

Question: I have a collection of photos and I'd like to distinguish clusters of the similar photos. Which features of an image and which algorithm should I use to solve my task?
Answer: I had the same problem and I came up with this solution:

Import a pretrained model using Keras (here VGG16)
Extract features per image
Do kmeans
Export by copying with cluster label

Here is my code, partly motivated by this post.
from keras.preprocessing import image
from keras.applications.vgg16 import VGG16
from keras.applications.vgg16 import preprocess_input
import numpy as np
from sklearn.cluster import KMeans
import os, shutil, glob, os.path
from PIL import Image as pil_image
image.LOAD_TRUNCATED_IMAGES = True
model = VGG16(weights='imagenet', include_top=False)

# Variables
imdir = 'C:/indir/'
targetdir = "C:/outdir/"
number_clusters = 3

# Loop over files and get features
filelist = glob.glob(os.path.join(imdir, '*.jpg'))
filelist.sort()
featurelist = []
for i, imagepath in enumerate(filelist):
    print("    Status: %s / %s" %(i, len(filelist)), end="\r")
    img = image.load_img(imagepath, target_size=(224, 224))
    img_data = image.img_to_array(img)
    img_data = np.expand_dims(img_data, axis=0)
    img_data = preprocess_input(img_data)
    features = np.array(model.predict(img_data))
    featurelist.append(features.flatten())

# Clustering
kmeans = KMeans(n_clusters=number_clusters, random_state=0).fit(np.array(featurelist))

# Copy images renamed by cluster
# Check if target dir exists
try:
    os.makedirs(targetdir)
except OSError:
    pass
# Copy with cluster name
print("\n")
for i, m in enumerate(kmeans.labels_):
    print("    Copy: %s / %s" %(i, len(kmeans.labels_)), end="\r")
    shutil.copy(filelist[i], targetdir + str(m) + "_" + str(i) + ".jpg")

Update 02/2022:
In some cases (e.g. unknown number of clusters) using Affinity Propagation may be a much better choice than kmeans. In this case, replace kmeans by:
from sklearn.cluster import AffinityPropagation
affprop = AffinityPropagation(affinity="euclidean", damping=0.5).fit(np.array(featurelist))

and loop over affprop.labels_ to access the results.
Answer: It is a too broad question.
Generally speaking you can use any clustering mechanism, e.g. a popular k-means. To prepare your data for clustering you need to convert your collection into an array X, where every row is one example (image) and every column is a feature.
The main question - what your features should be. It is difficult to answer without knowing what you are trying to accomplish. If your images are small and of the same size you can simply have every pixel as a feature. If you have any metadata and would like to sort using it - you can have every tag in metadata as a feature.
Now if you really need to find some patterns between images you will have to apply an additional layer of processing, like convolutional neural network, which essentially allows you to extract features from different pieces of your image. You can think about it as a filter, which will convert every image into, say 8x8 matrix, which then correspondingly could be used as a row with 64 different features in your array X for clustering.
Comment: I want to make each cluster consist of the photos of the same object/scene, i.e. I took three photos of my room, but from a little bit different position or there were less light on some photo. So the photos are not completely equal, but very similar.
Comment: In fact I'd suggest taking a look at mahotas  library, which can be well applicable in your case. Link - http://mahotas.readthedocs.io/en/latest/features.html
Comment: In this case I'd suggest to try a simple approach first before delving into the depths of deep learning (convnet). I'd just extract the map of pixels from every image, especially since they all are of the same size. Converting your pictures to black/white will help you to reduce the complexity. Then try to apply the k-means from scikit-learn. Vary number of clusters as well to see the impact. But most likely you will have to apply some kind of convnet to get a meaningful result. I am just  suggesting to move in phases.
Comment: I've tried to obtain haralick features, but I don't understand, why do I get 13x13 matrix for each image? Shouldn't it be a 13x1 vector, which describes some number for each of 13 haralick features?


Plugin missing while using ajax prototype in Grails 2?

Question: Hello..I'm using Grails 2 and tried to implement the ajax call from gsp page to my controller..At first library prototype was missing in grails 2 i solve this using command grails install-plugin prototype..Now that error is not coming but not working and different error is coming..
Here by i attached the code..I'm trying simple update second select box if i change the first
As well i added grails.views.javascript.library = "prototype" this line in Config.groovy

     //Controller

        def ajaxgetStrudents() {

            def college=College.get(params.id)
            render college?.students as JSON

        }
        //GSP

        javascript library="prototype" plugin="prototype"

        <g:select id="name" name="name" from="${collegeNames.name }"
        onChange="${ remoteFunction(controller:'College', action:'ajaxgetStrudents',

        , onComplete: 'updateStudent(e)',params   :'\'id=\'+this.value '

            )}
`

And i wrote javascript code to fill student select box..This code is not working..In console error coming like this

` Error 2012-10-08 01:16:57,933 [http-bio-8083-exec-6] ERROR [/SampleGrails].[default]  - Servlet.service() for servlet [default] in context with path [/SampleGrails] threw exception
Message: It looks like you are missing some calls to the r:layoutResources tag. After rendering your page the following have not been rendered: [defer]
    Line | Method
->> 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor

|    603 | run       in java.util.concurrent.ThreadPoolExecutor$Worker
^    722 | run . . . in java.lang.Thread
`
First i want to make run of this code..??
Next even though i installed the prototype plugin that was not added in my project plugin folder..but it was showing in grails list-plugin -installed command..why it is..??
Thanks..,
Answer:
Prototype has been dropped from Grails 2.1.0 onwards (Not sure about 2.0.3)

Replace
<g:javascript library="prototype" plugin="prototype" />

With
<g:javascript library="prototype" plugin="prototype" />
<r:layoutResources/>

Hope that helps. Always refer to the documentation available. This one is a link to upgrading grails, have a lot of info though Grails 2.1.x
Comment: Thanks for your answer i'm using the javascript like that only as well i added the `r:layoutResources` it's not working at all.As well thanks for your document link i'm not trying to any up gradation here..problem is even after i installed the prototype plugin i can't able to access it in Grails 2..i want to know how to do that..
Thanks..,
Answer: The correct way to install plugin in grails 2.x is to put an entry in BuildConfig.groovy instead of "install plugin" command.
Also to troubleshoot, you could try "Firebug" in Firefox and see if prototype scripts are getting loaded.
Answer: Heading ## - List item
Iam having same issue with prototype,unable to include prototype.js in my grails application.Basically iam using both jquery and prototype and including library using following snippets.
`

The issue comes as gsp unable to load the prototype plugin due to this my prototype ajax is not working and getting following exception.

After rendering your page the following have not been rendered: [defer] Line | Method ->> 1110 | runWorker in java.util.concurrent.ThreadPoolExecutor
Answer: I think you simply missed "update" property in the remoteFunction call.


Time Manager runs with different speed in QGIS 3.10

Question: I created a map to show my data with time manager. The feature type is polygon.
Changes in "Show frame for x milliseconds" affect the time the frames are shown. But the first frame is shown for x milliseconds and the next frames are shown for much less milliseconds. It almost seems it needs to much time to render and then it runs through the frames.
When I export and generate a GIF. That works fine.
Are there any settings I can change to improve this?
Answer: Sometimes TimeManager animations run faster than specified. In this case, it usually helps to stop and restart the animation a few times. The cause of this behavior is unknown.
If the animation runs slower than specified, this may be caused by longer rendering times. Renderings times of successive frames may speed up since parts of the map may be cached.


Looking for a Sefer on Chagim/ Yom Tov

Question: I enjoy learning Rav Soloveitchik's Hararei Kedem and Rav Zevin's Ha'moadim Be'halachah to prepare for Yom Tov. Does anyone have any other recommendations for sefarim similar to these? Specifically, in Hebrew and discuss sources and analysis (lomdus) on Yomim Tovim. Could be a rec on one Chag specifically doesn't need to be like the above which are on all of them. Thanks!
Comment: Moadim uZemanim - R Moshe Shternbuch
Comment: @JoelK fyi he signs "Sternbuch"
Comment: The sefarim already mentioned are my main go-to Yom Tov sefarim of the type you describe. I understand that Hegyonei Halacha by R' Yitzchak Mirsky is well regarded, though I haven't gone through much of it myself. Chag HaAsif by R' Eliyahu Weisfish is a good one for Sukkos. The excellent Mikraei Kodesh series of sefarim by R' Moshe Harari is a thorough and highly annotated halachic compendium on the chagim, organized in the vein of Shmiras Shabbos K'hilchasah or Tefilla K'hilchasah. Though it contains lomdus, you might not consider it to be in the genre you are looking for.
Comment: I know your wrote you only want hebrew books. This sefer just came out and is a brillant analysis of the rabmam hil chometz umatzah. great for understanding the lomdoous (not al pi derech brisk but lomdous) behind the Rambam https://www.amazon.com/Seder-Night-Rambam-Chananya-Berzon/dp/B0BVT3QXJ2/ref=sr_1_27?crid=G21HFBYGGJFF&keywords=berzon&qid=1677243560&sprefix=berzon+%2Caps%2C245&sr=8-27
Comment: B'moedeah series of Rav Nevantzal
Answer: As Joel K said, Moadim Uzmanim is the most classic.
For many years, the chiddushim of Rav Kulefsky were published in small pamphlets that were distributed and studied across America. Here is an example of the one on Purim for sale.
Another sefer gaining a lot of popularity is Yerach L'moadim by Rav Yerucham Olshin.
In addition, some halacha sefarim have a lot of well-presented lomdus in the footnotes. A few good examples are Chazon Ovadia by Rav Ovadya Yosef, Halichos Shlomo based on the rulings of Rav Shlomo Zalman Auerbach, and Kovetz Halachos based on the rulings and opinions of Rav Shmuel Kamenetzky.

Looking for a Sefer on Chagim/ Yom Tov


How does an extended slat generate drag?

Question: I am wondering how does an extended slat generate drag because I often read that slots agument lift by increasing critical angle of attack, but they do generate some extra drag. I am curious what is the cause of this drag.
Comment: Do you mean *slat*?
Answer: Friction drag is proportional to the speed gradient right at the wall. This gradient is highest when the boundary layer is thin, and every boundary layer starts at zero thickness, with thickness increasing downstream.
Slots on purpose allow a fresh boundary layer to form on the wing or flap downstream of them because this fresh boundary layer can overcome steeper pressure rises downstream.
The downside of this fresh boundary layer is a lot more friction drag compared to the retracted state where the boundary layer of the slat becomes the (now much thicker) boundary layer of the wing. The same is happening again with the flaps: Slotted flaps allow the highest lift increases, but at the cost of much increased drag. However, would there be no new boundary layer on the flap, the flow would separate much earlier, at much lower flap angles and angles of attack.
Another effect are higher speeds of the flow around the wing at high lift coefficients. Low pressure means high speed, so the flow speed outside of the boundary layer is higher when local pressure is lower. This increases the speed gradient in the boundary layer, thus adding another drag increment,
Answer: The slat projects downward increasing frontal area, and   forms a convergent duct leading from below to above the LE, that forces air to go around sharp corners to move up through the slot.  Plenty of turbulence, extra frontal area, and air forced to make sharp changes in direction.  Of course it's going to be draggier than a clean leading edge.
The effect is so strong that on the CRJs, the landing technique is completely different from the 200, with no slats, to the slightly larger 700, with slats.  The 200 just coasts when you pull off the thrust, and you go to idle at 50 ft.
The 700, you have to keep the power on into the flare and ease it off at 10-20 ft, or else you will come down like a brick as the speed rapidly bleeds off. Using 200 technique on a 700 will guarantee a hard landing.
Answer: All passive High Lift devices (e.g. nothing that uses active flow control) increase the Lift Coefficient by increasing the overall camber of the wing system (the wing + slats + flaps).
If the wing stays at the same angle of attack, and the slats + flaps are extended, the increased camber is going to increase the lift coefficient. The benefit of this is that the aircraft can now fly slower and produce the same amount of lift to maintain level flight. The detriment of this configuration is the increase in induced drag.
As we know from the induced drag relationship, the induced drag coefficient scales with the square of the lift coefficient, and so the extra lift generated by slats + flaps comes at a significant expense of drag.
Vorticity is shed at any point that we have a spanwise change in circulation, including at the edge of slats & flaps. Therefore even modern wingtip winglets do not minimize the induced drag penalty that comes from these high lift devices.


SSRS 2008 & ReportViewer web control > on postback, dropdown value does not get bound & no results

Question: I'm a long time reader and first time poster. I have scoured the web for 2 days straight to no avail and decided to ask for help. Let's see what y'all got! :)
(Sorry, since I'm a new user I can't post screen shots. Spent all that time for nothing. :()
Here's the situation:
1) I created simple SSRS 2008 report that includes a single-select drop down. For simplicity I have set the "Available Values" to a fixed set of values. (This issue also happens if you bind the drop down to a a result set, so the source of data doesn't seem relevant here.)
2) The report runs fine when running it in Report Builder and on the report server itself.
3) However when displaying the report from the ASP.NET server "ReportViewer" control, the single select drop down doesn't get bound on postback. In other words, when I select a value in the drop down and click the "View Report" button, the report does not return results and the drop down goes back to the selected option "<Select a Value>".
4) This issue only happens with single-select drop downs. Multi-select dropdowns, text boxes, checkboxes etc do not have this issue.
5) For reference, here's how the control is set up. Aside from setting the ReportPath in the code behind (and only once, the first time the page is loaded), I don't manipulate the control at all.
<rsweb:ReportViewer ID="ReportViewer1" runat="server"
    ProcessingMode="Remote"
    Width="100%"
    Height="800px"
    AsyncRendering="False">
</rsweb:ReportViewer>

6) My development environment: VS.NET 2010, ASP.NET Web Forms, .NET 4 framework, Microsoft.ReportViewer.Common.dll (file version 10.0.30319.1)
I have scoured the web for a couple of days and I've found no references to others having this same problem and so either I'm doing something obviously wrong or my Googling skills suck. I found only one discussion thread that seemed related and had a proposed "solution": they created a class that manually parsed the ReportViewer control's posted-back values and put them into a List<ReportParameter> so that they could call ServerReport.SetParameters() manually (note: the solution on that page is for the VS.NET2005 control and needs to be tweaked to work with 2010). Sure, that'd work but why should I have to jump through that many hoops? Again, it leads me to believe I'm doing something fundamentally wrong.
Any ideas?
Answer: Are you setting things like ReportPath and ReportServerUrl in the code behind?
If so, make sure you have them inside if (!Page.IsPostBack) { }


What are the modern arguments for state-based Senate seat allocation?

Question: Is there a logical rationale for grouping people by state for federal government representation today (e.g. the US Senate)? I understand that precedent and reluctance to fundamentally alter the US constitution are perhaps reason enough for most, but barring these arguments, if the bicameral legislature were to be redefined today, what arguments would be used on the side of state-based seat allocation for the Senate? For argument purposes consider a proportional representation scheme such as open party-list proportional representation as an alternative.
Comment: Those are probably largely the same as they were when the Constitution was drafted. You could ask if any novel arguments were brought forth since then (but I rather doubt that's the case.) "modern benefits" is too vague, imho.
Comment: Downvoted because it seems an objective answer is pretty well impossible, because "benefits" are almost always inherently subjective.  For instance, I as a rural person think it is very beneficial to keep damned urbanites from controlling more of the country than they already do.  Those urbanites may well hold the opposite opinion :-)
Comment: Right, but the heterogeneity of each state's constituents in terms of desires, economic centers, etc. has changed radically since then, so I'm wondering what modern arguments in support of state-based allocation would look like with acknowledgement of this shift
Comment: Despite its complexity it is still a valid question, and the skeleton arguments can still be discussed. Furthermore, there is precedent for such movement for political ends (Bleeding Kansas, see link) so it's worth considering how this behavior and the Senate relate https://en.wikipedia.org/wiki/Bleeding_Kansas#Early_elections
Comment: I understand that there are countries where a legislative house is not selected based on geography (for instance party-list proportional representation); that's not exactly my question. I want to understand the arguments for the system in place in the United States
Comment: Is this just "what are the benefits of federalism?" If the senators don't represent the states, then what are the states for?
Comment: Not my DV, but this is going to be largely opinion-based... If you want to make a more objective q, you could ask if there are federal systems/countries where the upper chamber is not elected strictly this way.
Comment: @Fizz How could the question be changed to make it less opinion-based? There must be some arguments in support of state-based allocation despite disparate representation?
Comment: I.e. a thoughtful, not necessarily critical, reassessment of the theoretical basis of the Senate proposed 250 years ago in light of modern empirical trends.
Comment: This sounds like a thesis length question.
Comment: And if combined with things in the UK like affordable housing legislation would lead to discussion on how even House/Commons representation is still relevant when based on geographical location.
Comment: I'm not asking for an argument over whether the Senate is a good idea. I merely want the arguments FOR the Senate to be detailed.
Comment: @jamesqf It's worth distinguishing between "people posting answers will be posting their own subjective opinions" (which this question is not asking for) and "answers will be describing arguments made by others that will inherently include subjective valuations," which is the case with many (perhaps most) questions on Politics.SE.
Answer: It is worth observing that the U.S. Supreme Court has held since the 1964 that allocating representatives in a legislative body other than the U.S. Senate on anything other than an equal population one man-one vote basis, is an unconstitutional violation of the equal protection clause of the 14th Amendment.
Prior to this ruling many states modeled their bicameralism on the federal U.S. Senate model and this is now unconstitutional for state and local governments to do.
In Baker v. Carr, 369 U.S. 186 (1962), the United States Supreme Court held that redistricting qualifies as a justiciable question under the Fourteenth Amendment, thus enabling federal courts to hear Fourteenth Amendment-based redistricting cases.
In Wesberry v. Sanders, 376 U.S. 1 (1964), it held that districts in the United States House of Representatives must be approximately equal in population.
In Reynolds v. Sims, 377 U.S. 533 (1964), it held that the electoral districts of state legislative chambers must be roughly equal in population:

Along with Baker v. Carr (1962) and Wesberry v. Sanders (1964), it was
part of a series of Warren Court cases that applied the principle of
"one person, one vote" to U.S. legislative bodies.
Prior to the case, numerous state legislative chambers had districts
containing unequal populations; for example, in the Nevada Senate, the
smallest district had 568 people, while the largest had approximately
127,000 people. Some states refused to engage in regular
redistricting, while others enshrined unequal representation in state
constitutions. The case of Reynolds v. Sims arose after voters in
Birmingham, Alabama, challenged the apportionment of the Alabama
Legislature; the Constitution of Alabama provided for one state
senator per county regardless of population differences.
In a majority opinion joined by five other justices, Chief Justice
Earl Warren ruled that the Fourteenth Amendment's Equal Protection
Clause requires states to establish state legislative electoral
districts roughly equal in population. Warren held that "legislators
represent people, not trees or acres. Legislators are elected by
voters, not farms or cities or economic interests."

The U.S. Senate remains an anomaly because it is baked into the structure of the U.S. Constitution which is the basis of invalidating any legal arrangement on constitutional grounds, so it can't violate the constitution, and because the equal representation of the states in the U.S. Senate is the one thing that the U.S. Constitution states cannot be modified without the consent of the state whose representation in the U.S. Senate is reduced. Article V of the U.S. Constitution states that:

The Congress, whenever two thirds of both Houses shall deem it
necessary, shall propose Amendments to this Constitution, or, on the
Application of the Legislatures of two thirds of the several States,
shall call a Convention for proposing Amendments, which, in either
Case, shall be valid to all Intents and Purposes, as Part of this
Constitution, when ratified by the Legislatures of three fourths of
the several States, or by Conventions in three fourths thereof, as the
one or the other Mode of Ratification may be proposed by the Congress;
Provided that no Amendment which may be made prior to the Year One
thousand eight hundred and eight shall in any Manner affect the first
and fourth Clauses in the Ninth Section of the first Article; and
that no State, without its Consent, shall be deprived of its equal
Suffrage in the Senate.

So getting to the question:

What are the modern arguments for state-based Senate seat allocation?

Primarily that it is unconstitutional to change the status quo without what amounts to unanimous consent, and that given the clear partisan benefits of the status quo to one of the two major political parties vis-a-vis the other one, this is a political impossibility.
Somewhat more theoretically, the U.S. Constitution originally contemplated that the federal government would have an extremely limited role and that government would primarily be conducted at the state level.
Towards that end, the Senate was a compromise between the Articles of Confederation that preceded the current U.S. Constitution and required unanimous consent, and a unitary federal government with plenary legislative power like the U.K. parliament. It involved a smaller number of states (originally 13), at a time when those states felt an unprecedented sense of common purpose in the wake of the Revolutionary War, and the early states did not yet have the extreme disparities of population present today.
And, for a long time, the U.S. federal government was skeletal. It was funded almost entirely by customs duties. It did little beyond providing for national defense, postal services, international trade, and customs duty collection. Interstate commerce was comparatively simple and slow. The federal courts were small and didn't have intermediate courts of appeal. Federal judges and federal legislators often left their posts midterm for more important jobs in state government or in the private sector. Election procedures were slipshod and frequently resolved on a partisan basis by Congress. The civil service system and federal bureaucracy was not a thing. Federal constitutional rights did not apply to state and local officials.
This changed with the U.S. Civil War and Reconstruction, briefly attempted to retreat towards the status quo, and then grew gradually between the 1870s and 1930 in response to industrialization and greater interstate commerce and World War I, and then really ramped up in scale and scope with the New Deal during the Great Depression and WWII. It became impossible to accomplish reasonable policy goals without acting as a unified nation guided by federal policies.
By the time that the 50th state was admitted in the 1950s, the scope and scale of federal government activity and the number of states involved has ballooned far beyond what the founders could have foreseen, and advances in technology and economic organization made national regulation necessary in a way that it hadn't been in the late 18th century when the constitution was adopted.
Most of this change has happened without constitutional amendments, although the 17th Amendment calling for the direct election of Senators rather than their appointment by state legislators, really underlined the extent to which the federal government had become the primary rather than the secondary player in American federalism.

Is there a logical rationale for grouping people by state for federal
government representation today (e.g. the US Senate)?

Not really. This arrangement reflected a conception of the United States as a political alliance of sovereign separate states much like the European Union is today, which hasn't been an accurate empirical description of how the United States actually operates for at least nine decades.

if the bicameral legislature were to be redefined today, what
arguments would be used on the side of state-based seat allocation for
the Senate?

The rub is that state based allocation of political power makes sense at some level when you are blending separate independent countries into a union when they have very distinct cultural identities.
But, the status quo in which 50 states span from coast to coast plus Alaska, Hawaii, Puerto Rico, and several other smaller territories couldn't have arisen in the first place without being united in a single country with a coherent national identity. States are far more similar to each other by practice and by the realities of living with the same federal laws and a unified commercial body than they are constitutionally required to be.
For most of U.S. history, the biggest cultural divide and divide in political values in the U.S. has been between the North and the South, which came to a head in the U.S. Civil War, but still remains a point of great tension and the first order political divide in the U.S. In 2022, it was still impossible to get white contractors in Richmond, Virginia (a state the backed Biden in the most recent Presidential election), to remove confederate statutes from the public square. The divides that led to the Civil War are still alive and well in the United States and are now playing out over issues like abortion and LGBT rights and the death penalty.
The U.S. Senate has been tolerable despite its disconnect with the modern reality of the U.S. government mostly because its political divisions have, as it does today, closely tracked the political divisions of the U.S. House, with discrepancies between the two as much due to the lagging effect of having Senators serve six year terms a third at a time, as due to a strongly different partisan mix between the U.S. broken up into 435 Congressional districts, and the U.S. broken up into 50 states.
This, in turn, is the product of many decades of careful political calculation in the process of growing the number of U.S. states from 13 to 50, with states being approved to join the U.S. only when this could secure bipartisan support (often linking more than one state admission at once to do so), because it didn't tip  the political balance in the Senate too much.
If the bargain had to be renegotiated, it almost surely would not have been done so in the manner it is now. Perhaps if it was unicameral at all it would have made the Senate like the House of Lords or Canadian Senate, a mere house of revision less powerful on most matters than the House rather than providing a source of absolute gridlock with veto power over all legislation. Alternatively, negotiating from scratch, states might divide power on regional lines rather than state lines, so that either the North or the South would have the political power to veto federal legislation not to their liking, or by providing major regionally organized political factions with a veto that was more transparent and direct.
No one designing a national constitution from scratch has replicated this feature of the U.S. Constitution for a very long time. Deeply ethnically and culturally divided countries like Lebanon, Iraq, and Bosnia have adopted constitutions that more explicitly give each major cultural faction a guaranteed amount of representation and the power, alone, or with other factions organized as such, to veto legislation.

For argument purposes consider a proportional representation scheme
such as open party-list proportional representation as an alternative.

If one did this, why bother with bicameralism? Why not, for example, simply abolish the U.S. Senate and have state delegations to the House elected on a proportional representation basis?
Bottom Line
Political institutions evolve in path dependent ways and are inseparable from their history. There is no one right solution to how to design them.
After a long era of centralization and development of common ground in the U.S., we have come into an era where the U.S. is more deeply divided.
One possibility is that the Senate's current structure, by setting such a high bar for finding bipartisan support to change status quo policies and gridlocking the federal government is facilitating a new era of decentralization of government in which differing state policies on core issues become the norm again and the U.S. becomes less "one Nation indivisible" and more a confederation of countries with a common history and some shared arrangements.
Effectively, the current structure of the U.S. government allows for common action only when there is a high level of consensus, nearly approaching that of the Articles of Confederation unanimity requirement but allowing action to be taken without a "heckler's veto" of just a handful of states.
This is almost surely not optimal for U.S. economic growth or cultural unity, but it could be that autonomy is more valuable to Americans collectively than goals that can only be achieved through national legislation.
Whether this is desirable or not depends to some extent to the amount of stress from uncontrollable international and economic factors arising from technology and global circumstances.  While there is no right political answer to political questions, there are often many clearly wrong answers to political questions (including doing nothing at all) that can have disastrous consequences for the nation because they have real world consequences.
If the United States encounters an existential challenge that requires prompt actions by the nation as a whole before a wide national consensus is reached on an issue, the nation will die or its political institutions will be broken in some way.
On the other hand, if the United States can avoid having to face existential stress tests, its inability to take decisive national action without a widespread consensus in a deeply divided nation could be survivable.
Answer: The argument for the allocation is that the House of Representatives was intended to represent the popular opinion, and thus are allocated to states based on population (each state gets one rep guaranteed, plus additional based on population size).  Each State gets Two seats in the Senate, regardless population or physical size.   This means that states with larger populations have more power in the House, but have less in the Senate.  The idea is to prevent a situation where California (Largest state by population) doesn't have a dominance over Wyoming (smallest state by population) and Wyoming can have some measure of comparable say in policy, which rarely aligns with California.  Additionally, repartitioning the Senate is damn near impossible, as provisions in the Constitution state that no state may be denied equal suffrage in the senate without consent of the state, effectively baring any possible amendment that would change the senate make up from being more more closely focused on distribution that favor a proportional representation.  It's the only part of the constitution that is expressly barred from being amended, which means the only way to change the way Senate seats are allocated is to completely toss the constitution, something for which no serious discussion has been had (most want to see changes, but not abandonment altogether).
It should be noted that the U.S. is not alone in their Upper House not being determined by proportional representation and many governments have their upper houses either indirectly elected OR not proportional to population of constituency (where as almost universally, the lower house is proportional to population.  Additionally, most Federal Nations do allocate their upper house seats by even distribution to sub-national divisions.  That said, the number of seats may not be "two" but is certainly more than "1" in most cases.  America was just the first to do it.).
Historically speaking, the Upper House has always been more of the benefit of a government interest instead of a popular interest.  For example, the U.K. parliament's House of Lords traditionally were representative of noble interests while it's lower house, The House of Commons was representative of the commoner interests.
Comment: One thing to note is the house used to have no cap on the number of members and it used to be "The U.S. Constitution called for at least one Representative per state and that no more than one for every 30,000 persons.". The cap of 435 that got placed on membership had a big impact on representation. If you go off that we would have close to ten thousand members now.
Comment: @JoeW: Even [the cube root rule](https://en.wikipedia.org/wiki/Cube_root_law) would give us 692 members as of the 2020 census.  There's nothing special about the number 435; it's just that Congress failed to agree on the answer to "How many Representatives should we have?" after the 1920 census, so decided to just permanently leave it where it was.
Comment: @dan04 the issue is that it causes different members to represent a different number of people instead of being more balanced like the founders intended.
Answer: I think this question devolves into the question of "What are the modern benefits of states?".
The Senate was originally designed to represent state governments the way that the House was designed to represent the people in each state.  This was later changed by the Seventeenth Amendment to allow the direct election of Senators, but they still represent the entirety of their state, the way they did when the government picked them.  As long as each state has its own government which needs to address all the disparate concerns of its citizens (both urban and rural), then it makes sense to have representation at the national level of that same unit of population.
Additionally, the current Rural/Urban divide in politics is a relatively new situation.  Compare the county-by-county maps from 1920 (100 years ago), 1968 (52 years ago), 2000 (20 years ago) and 2020 (now) - you can see that what used to be regional groupings by party has been gradually diffusing across the country.  But that doesn't mean that this division is permanent.  20 years from now, it's very possible that the varying effects of climate change are the most important dividing issue, and the eastern states are opposed to the western states in how to best handle it.
Comment: You mention that The senate used to be appointed by the states themselves and was later changed to direct election like the house. It might be good to mention that part of the reason for this is that some Senate seats used to go unfilled for years because replacements would not get picked and the direct election was the way it was decided to fix that problem.
Comment: I don't think you're being historically accurate by saying that the Urban/Rural divide is a "new" thing because it was central to the U.S. political scene since the nation's founding (the Framers of the Constitution specifically mention the Urban/Rural divide as the reason for the the Virginia Compromise which established the the bicameral in first hand sources).  The reason these graphs don't show this is that 1920s America was largely different.  It also neglects socio-economic status as well and the shift of parties appeal over the years.  These maps are poor indicators of that.
Comment: The reason I mention it is because people tend to think that Senators represent the people as they are elected by the people but that is only because some states failed to do their job and select Senators in a timely manner.
Comment: @hszmv - For the maps, the lack of consistency between them kindof annoys me, but I think they show what I'm trying for.  In 1920, _region_ was the best indicator as to how people voted.  By 2000, it's much more interwoven, with pockets of blue scattered around in red areas, and some red spots in bluish areas.  That's all they're here to show - how the **mix** of political leanings changed over time from being almost entirely state/region based to being based on a different grouping.
Comment: @JoeW - You might be right.  I really only addressed why tying it to the existence of states makes sense, and didn't touch on the _method_ for the election.  I've linked the relevant amendment for now, and will consider elaborating on that part of it.
Comment: @hszmv - I would say that the urban/rural divide has gotten more specific.  I admit I haven't dug into it myself, but I doubt that the inhabitants of Charleston, SC (4th most populous city in the US in 1790) would have supported proportional representation just because they lived in a city. The Compromise was more about more urban states vs more rural states.  Nowadays, cities in "red" states tend to be much "bluer" than the rest of their state, and vice versa for the more rural areas of "blue" states.
Comment: @Bobson The Virginia Compromise was to prevent states with higher populations from making decisions that were not wanted by most of the states, but got pushed because states with a higher population.  Even states that are neighbors can have wildly different interests.  (My home state tends to be reliably blue despite the almost all but one state being swing states or moderately red.)  There's also a socio-economic counterpart that the maps tell a little better.
Comment: @Bobson:  The thing your not seeing is that consistency is American politics is best observed in shorter gaps than over multiple gaps.  California, for example, tends to shift over long periods of time.  Your map selections skip the entirety of it's depression/WWII era Democrat dominance.  From 52-88, California only broke for the Democrat presidential candidate exactly once (64) and during this time almost every Republican candidate for president was either a Californian (Nixon and Regan) or Republican adjacent candidate on the ticket.


How does Flow Field pathfinding work?

Question: Supreme Commander 2 has something called flow field path finding. How does it work? Is there some article available I can read up on how it works?
Answer: I wrote flow fields for sup com 2, and I wrote an article explaining the details. It can be found in the upcoming book "Game AI Pro: Collected Wisdom of Game AI Professionals".
Also, I recently did a video stream talking about flow fields for Planetary Annihilation. I show some debug views and explain how it works at a high level.
http://youtu.be/5Qyl7h7D1Q8?t=24m24s
Hope this helps
Answer: I've been looking for this term as well, and this paper is the only major one I could find that references flow fields directly:
http://www.aaai.org/Papers/AIIDE/2008/AIIDE08-031.pdf
This approach involves each pathfinding agent being influenced by a global vector field, and in turn influencing that field with their resulting path.  You still need some basic object avoidance code to kick things off, so is only really applicable for swarms crossing paths, rather than individual agents.
However, the SupComm2 guys mention research from the University of Washington directly, and this is the most applicable paper that I could find from that institution:
http://grail.cs.washington.edu/projects/crowd-flows/
This approach seems more promising but I need to read more about it.
Answer: The official specs of the pathfinding algorithm in Supreme Commander 2 refer to the Crowd Continuum Study at University of Washington.
There are several papers and demonstrations at that link.
Answer: I'll include the description of how to solve an eioknal equation here, because it's the messy bit to implementing flow field path finding. See Continuum Crowds for an example of how to use this solution for path finding. Basically, the idea is that you are computing the time a wavefront spreading out from initial points reaches every other point in a grid, e.g.:

(Image from Implementation Details of the Fast Marching Methods, which I highly recommend reading)
It's sorta like pathfinding starting from a set of goal points, and computing the amount of time T(x, y) it would take to reach the nearest goal point from any point on a grid if you were following the optimal path and moving at speed F(x, y) (the F(x,y) values you can chose and are part of the map, and something like terrain roughness could make them lower). This is nice because you are solving for every point on a map, so every agent with the same goal can use this same result, and you only have to do one run of the algorithm (per timestep) for all of them. To get these T(x, y) values, there are three options I know of: The Fast Marching Method, Fast Sweeping Method, and Fast Iterative Method.
The Fast Marching Method works fairly well for small grids, takes time O(nlog(n)), where n is the number of points in the grid, and is best described in the "Implementation Details of the Fast Marching Methods" link at the bottom of the wiki page. However, for larger grids (say in 3D), this log(n) factor becomes prohibitive, so that's where the Fast Sweeping Method and Fast Iterative Method come in. More importantly, the Fast Marching Method uses a binary heap, which means it's not straightforward to parallelize, and has poor cache coherency. The Fast Sweeping Method has the potential to perform better, yet is slowed down by any direction changes that could happen, say, in the case of a winding maze. The Fast Iterative Method is a pretty good compromise between these two, working pretty well in winding mazes, being somewhat amenable to parallelization, and having good cache coherency. It also is slower in smaller maps, however, so I'd probably recommend implementing the Fast Marching Method first, then if it's too slow working towards implementing the Fast Iterative Method in something like OpenCL using Scans.
I'll describe the Fast Marching Method in more detail here, as the part about how to solve the quadratic is equally applicable to the Fast Iterative Method. In short, the Fast Marching Method starts by setting all beginning nodes as frozen, with T(x, y)=0. Then every node adjacent (4 neighbor neighborhood in 2D and 6 neighbor neighborhood in 3D) to these nodes is marked as being in the "narrow band," and their T(x, y) is computed using a quadratic:
$$(T(x, y) - a)^2 + (T(x, y) - b)^2 = (1/F(x, y))^2$$
Where
$$a = Min(T(x + 1, y), T(x - 1, y))$$
$$b = Min(T(x, y + 1), T(x, y - 1))$$
only considering values for T(...) of neighboring frozen nodes. Thus, for example, if the node above and the node below aren't frozen, the (T(x, y) - b)^2 term drops out of the equation. This can be solved by hand, or with wolfram, and you use the greater of the two solutions. In 3D it's very similar. The reason for this quadratic is because it makes the solution look smoother than simply spreading out linearly from the goal, also for math consistency reasons I don't fully understand.
When implementing this there were times where this quadratic had no solution, however, so I asked about this on the scicomp stack exchange, and got a very good answer that's best explained there: basically in that case you just need to solve the quadratic differently by falling back to a "lower dimensional wavefront." You also need to do this if the solution you get is lower than any frozen node's T(x, y) values nearby - because then the quadratic solution is invalid because if you use it the wave is somehow travelling back in time.
You add each of these narrow band nodes to a binary heap, sorted by their newly computed T(x, y) values. Then the node at the top is removed, made a frozen node, and any new narrow band nodes are added to the heap. It's important to note that this means narrow band nodes can be added to the heap more than once, which can be addressed by simply ignoring any frozen nodes that are at the top of the heap - since we've already processed them with a more accurate T(x, y) value before.
This process is repeated until all nodes are set to frozen (or inaccessable), at which case you're done solving the eikonal equation. This is also cool because you can easliy make boundaries by either never allowing boundary nodes to be added to the "narrow band" so they never become frozen, or by giving them very low F(x, y) values so agents prefer to go around them. Just be warned that the falling back to a "lower dimensional wavefront" (as described in the scicomp stack exchange link above) is needed if your F(x, y) values change too quickly, as they would with arbitrary boundaries.
Finally, you need to be able to compute
$$\nabla{T}$$
which is a vector with an x and y component (I'll call them dx and dy) that describes the rate of change in their respective directions. These are defined as:
$$dx(x, y) = Average(T(x + 1, y) - T(x, y), T(x, y) - T(x - 1, y) )$$
$$dy(x, y) = Average(T(x, y + 1) - T(x, y), T(x, y) - T(x, y - 1))$$
which continuum crowds also has you normalize (divide each dx(x, y) and dy(x, y) by $$\sqrt{dx(x, y)^2 + dy(x, y)^2}$$ unless they're both zero). If a neighboring node doesn't exist (say if it's outside the boundary or within an obstacle), you can just use the other neighboring node's value and not compute any average, and if neither neighbor node exists it probably makes sense to use some default value like 0. This gives us vectors which point in the direction of the optimal path to the goal, and you can move units along these optimal paths by moving them in this direction at a velocity equal to F(x, y).
Since we're working with a discrete grid, however, all units will be between four points. To find the value of a function at any point we need to interpolate between the four surrounding values:
<code>float interpolateBetweenValues(float x, float y, float[,] array)
{
    int topLeftX = (int)Math.Floor(x);
    int topLeftY = (int)Math.Floor(y);

    if (topLeftX < 0 || topLeftX + 1 >= array.GetLength(0) ||
        topLeftY < 0 || topLeftY + 1 >= array.GetLength(1))
        throw new Exception("Out of bounds");

    float xAmountRight = x - topLeftX;
    float xAmountLeft = 1.0f - xAmountRight;
    float yAmountBottom = y - topLeftY;
    float yAmountTop = 1.0f - yAmountBottom;

    float averagedXTop = array[topLeftX, topLeftY] * xAmountLeft + array[topLeftX + 1, topLeftY] * xAmountRight;
    float averagedXBottom = array[topLeftX, topLeftY+1] * xAmountLeft + array[topLeftX + 1, topLeftY+1] * xAmountRight;

    float averagedYTotal = averagedXTop * yAmountTop + averagedXBottom * yAmountBottom;

    return averagedYTotal;
}
</code>

How does Flow Field pathfinding work?


ffmpeg player in discord.py (python) automatically leave

Question: I have created a discord bot that on certain messages either sends back a message or plays a sound (like a soundboard)
The crucial line of code is:
         soundboard_player = voice_client.create_ffmpeg_player("doh.mp3")
         soundboard_player.start()
         await client.send_message(message.channel, "Playing DOH...")

This works absolutely fine but i kept trying to add the line
             after=voice_client.disconnect()
I put this inside the ("doh.mp3", * I PUT IT HERE *) brackets.
I wanted the bot to leave after it was done.
When I run the code with the 'after' statement included, the bot joins and I get the error message:
TypeError: disconnect() takes 1 positional argument but 2 were given

I know you can use soundboard_player.is_done() to check the status of the bot but I couldn't figure out a way to check the status without trapping the code in a loop
By trapping the code in the loop I cant execute a STOP command to stop it playing the song (soundbite) half way through.
Any help with the after=voice_client.disconnect() command for the ffmpeg player
or a creative way to periodically check the status without getting trapped in the loop?
Answer: run it threadsafe.
I recommend:
loop = voice_client.loop
after=lambda:
    asyncio.run_coroutine_threadsafe(voice_client.disconnect(), loop)

you should write it inside a sync function.
good luck.


Can someone call himself Jewish if he is in the process of converting?

Question: Shalom! If one is in the final stages of conversion to Orthodox Judaism, is not a Noahide,  does not belong to any religion, is it appropriate for him to say he is Jewish? He does not want to tell strangers about his conversion.
Comment: You should check with the rabbi overseeing your conversion process. We can't know the particulars of your situation or your community
Comment: How is this different from your other question? The title is different, but the question explanation is basically asking the same thing: https://judaism.stackexchange.com/questions/135669/is-a-pre-convert-considered-a-noahide. Did you not get your answer there? Maybe think about this: once you are engaged, should you go around telling everyone you are this woman's husband/ man's wife, or would it be more prudent to wait until after the chupa? As for your desire for privacy in the matter of conversion, please discuss this with your Dayanim, I'm sure they can offer better advice than we can
Comment: I'm not clear on the situation you are describing. Who are these "strangers" who are asking you your religion? No one ever asks me mine. Even if I needed to lie about it, I wouldn't need to, because the issue never comes up. - If you're talking about being counted in a minyan, then it's obvious that you mustn't deceive people who will think they have a minyan when they don't.
Answer: Self-evidently, someone in the final stages of conversion to Orthodox Judaism is not yet a Jew. The Gemoro Shabbos 55a states that

חותמו של הקדוש ברוך הוא אמת
the seal of the Holy One Blessed be He is truth.

This potential convert wants to come under the tabernacle of HKB"H and in the process wishes to utter untruths.
No he must not utter untruths.


Sync sent items from a POP3 account on Microsoft Exchange

Question: I'm using Thunderbird for my work email account, which is powered on Microsoft Exchange I think. I'm OK with sending and receiving messages. However all the sent messages are in Thunderbird only. Is there a way to sync them into my real sent box, so that I'll be able to view them on the web mail on the browser?
Comment: Is using IMAP an option?
Answer: In short, no.  POP3 and SMTP were designed back when storage was much more expensive, and nothing was typically left server-side.  If your email is indeed coming from Exchange, you should be able to use IMAP, as long as your employer is allowing access to it.  If your employer is running Exchange 2007 or 2010, there is also an EWS (Exchange Web Services) plugin called ExQuilla that will allow for a somewhat more native connection (I believe this is similar to how Android and iOS devices connect).  If I'm understanding it correctly, ExQuilla would allow Thunderbird to function more like Outlook, including Global Address Book support.
If you do set up an EWS or IMAP connection, it should then be possible to copy/move everything from your local sent box to the server.
Comment: Thank you very much ND for the detailed explanation. I think the Exchange service I'm using is called OWA. Do you think if I can set up the account again but using IMAP in Thunderbird, which means same email account 2 methods IMAP and POP3. Then Can I possibly drag all the sent items from the POP3 one into the IMAP one? Is that doable and will it sync all the items to the web account please?
Comment: OWA stands for Outlook Web Interface.  You may be referring to the server name, which may be something like owa.companysite.com.  If that's the case, yes, you can probably just create a new IMAP account.  Once it's created, you should be able to drag the sent items from the POP3 folder locally to the IMAP sent folder.  Be aware that if you have a large number of messages, this could take a long time depending on your upload speed.  This is best done on the office network, if possible.
Comment: I'll double check with my work mates, I think some of them are using IMAP. It's good to know that could work. I assume there won't be any problem of having POP3 and IMAP on the same account at the same time? And thanks for your advice.
Comment: If you're not deleting from the server when you download via POP3 (which, based on your original question is what it sounds like), no. You will be doing duplicate downloading, though, which may be a concern depending on your internet connection (speed, limits, etc.).  It also means you'd be storing every message twice (once in the local storage for the POP3 account and once in the local storage for the IMAP account). I'd recommend disabling the POP3 connection once you have the IMAP connection configured.
Comment: I'm sure all the inbox items are remaining in the web account. I don't mind duplicate downloading all the messages, the connection at work is very very fast. Yes, I'm thinking the same, once I get the sent items and IMAP sorted out I'm willing to disable/remove the POP3 account. Thanks!


What is the Lagrange remainder in a Taylor series expansion

Question: I know what a Taylor series expansion is and I know how to find the Lagrange remainder but what does it mean intuitively? I need an explanation of what the Lagrange remainder represents in terms of the Taylor series expansion without proofs, strictly intuition.
Comment: Any difference between remainder and Lagrange remainder? I think it's the difference between the function f and the Taylor polynomial that approximates it. So it's like an error term. It approaches zero as we add more and more terms to the Taylor polynomial to approximate f
Comment: I guess any remainder because the Lagrange remainder is just one way of calculating the same remainder correct?
Answer: Taking your comment about "any remainder" in mind, BCLC's comment is effectively the answer you seem to be looking for, i.e. the remainder $R_n(x)$ is simply the difference between the $n^{th}$ order Taylor polynomial $T_n(x)$ and the function it is approximating. That is, given $T_n(x) = \sum_{i=0}^{n} \frac{f^{(i)}( c)}{i!}(x-c)^i$, the remainder is:
$$
R_n(x) = f(x) - T_n(x)
$$
There are various forms for this remainder, one of which is the Lagrange remainder you mentioned. Wikipedia groups the various forms under "Taylor's theorem," and provides a more detailed discussion about the technical details.
Broadly speaking, for applications, having an expression for the remainder allows one to, e.g.:

Determine the error on a given approximation (i.e. for a given number of terms used in the approximation, determine the error);
Determine the number of terms required to get an approximation that will be within some desired error (i.e. to obtain a value of the function accurate to a given number of decimal places, determine the number of terms $n$);
Determine the largest interval over which the error in a given approximation will be below a desired level (i.e. fix the number of terms and the error, determine the interval).

One can also use the remainder to prove that the limit (i.e. as $n \to \infty$) of the sequence of partial sums of $T_n(x)$ converges to $f(x)$, by showing that $R_n(x) \to 0$, in the same limit, i.e.:
$$
\begin{aligned}
f(x) & = T_n(x) + R_n(x) \\[5pt]
%
\Leftrightarrow \qquad \lim_{n \to \infty} f(x) & = \lim_{n \to \infty} T_n(x) + \lim_{n \to \infty} R_n(x) \\[5pt]
%
= \qquad f(x) & = \lim_{n \to \infty} T_n(x) + 0
\end{aligned}
$$
Although, in practice, it is usually impractical to work with $R_n(x)$ directly (even using Taylor's inequality) and other methods may be simpler (e.g. showing that the series satisfies the D.E. and initial condition which define the function; for example $\frac{df}{dx} = f$ and $f(0) = 1$ for $f(x) = e^x$, or $(1+x)f = rf$ and $f(0) = 1$ for $f(x) = (1+x)^r$, etc.).
Hope this gives you a non-technical sense for the remainder.


Shimano Hydraulic Disc Brake Leaking Oil

Question: I have a Shimano 105 BR-R7070 hydraulic disc brake and just discovered that the front caliper is leaking oil from one side of the pistons. I'm wondering if this is fixable? If not, what replacement shall I get? I can't seem to find 105 disc brake calipers anywhere. Is it compatible with other calipers and what would you recommend?
Answer: Usually, with leaking Shimano brakes, the piston has cracked. Have you changed the brake pads or otherwise messed with the pistons lately?
Aftermarket pistons and seals are available, but that would be a non-authorized hack job that Shimano does not authorize. Don't expect to keep your warranty if you do so, and your safety is no longer guaranteed. Up to you if you think it's worth it.
Every Shimano caliper is interchangeable in terms of functionality.
Comment: Concur - given its the front brake, the most important one, I'd buy a new caliper and have confidence in my ability to brake when required.
Comment: Thanks for the answer. I was bleeding the brake and did hear some squeaking sound while trying to push the piston back after an accidental press. So I guess you are right that the piston is done.

Only issue is that getting a brake caliper seems very hard at this time. Can't find an available R7070 anywhere and I'm trying to broaden my choice.
Comment: @NingWang Yeah, it's unfortunate that the Shimano ceramic pistons are that fragile. If you're okay with the risk, you could buy those aftermarket pistons OR harvest one from a cheap MTB caliper. Or you can buy any caliper that works with your brake mount setup (flat mount?) Anything from Tiagra to Dura-Ace will work, and even the latest MTB flat mount calipers too.