In "half of the slices were eaten", how does the plurality of "slices" get projected past the preposition "of"?

Question: in "half of the slices were eaten" the phrase "half of the slices" is clearly headed by "slices" as the verb the subject took are plural. however, "of" is a preposition which takes "the slices" as its complement, therefore I dont see how the plurality of the word "slices" is projected to the subject.
Comment: you're analysing "of the slices" as a prepositional phrase, rather than "half of" as a determiner phrase
Comment: so is the structure you are suggesting is dp[ dp[ d'[ d[ half ] ] pp[ of ] ] d'[ d[ the ] np[ slices ] ] ] ?  or should i make "half of" one lexicon unit?
Comment: also, if "half of" is a determiner phrase then not sure where "the slices" will get its case from. for example, in "half of them", "them" gets its case from "of" the head of prepositional phrase.
Answer: In my opinion, "Slices" is not the head. "Half" is the head and is plural here because it semantically refers to multiple things. Compare "Half were eaten" and "One of the slices was eaten."
I found a paper that discusses the construction:

when they are used in a construction with of (as in All of the people were happy), Quirk et al (1985:258) refer to [all, both and half] as pronouns functioning as NP heads (see Section 22.214.171.124). Huddleston & Pullum (2002:434) consider half to be a noun since it can take a preceding indefinite article or a cardinal number.

("Syntactic variation in English quantified noun phrases with all, whole, both and half", Maria Estling Vannestål, Acta Wexionensia
Nr 38/2004 Humaniora. Page 55)
I don't know how to analyze this structure formally. My feeling is that the grammatical number of the verb or of "half" in these kinds of contexts is not determined by syntax; it is based instead on some kind of extra-syntactic factors such as pragmatics or semantics. For comparison, I think that in many contexts, the selection of an anaphoric or cataphoric pronoun is not determined by syntax, even though the choice of pronoun can be related in various ways to the meaning or even the grammatical properties of another word in the same or a different sentence.
Comment: Why not? "[half [of the pie]] was eaten"--half is singular because it refers to a mass
Comment: wow the reference is very thorough how did i not find it! thank you brass. quick comment, if "half" is the head, then "half of the pie was eaten" cant be explained.
Comment: hmm.. but for "half" to know whether it is plural or not it has to look at the complement of prepositional phrase "of the pie" which is "the pie" which is singular. is that okay? wont the preposition "of" which heads "the slices" blocks that? sorry i may be confusing myself.
Comment: @TrinTAAthigapanich: I think that whether "half" is plural or not is not based on syntax; or at least, not always. It is (or can be) based on what it means. The word "half" can even occur in a separate sentence from the word that semantically explains what it is half of: "I baked a pie yesterday. Today, half was eaten by my siblings!" "I baked cookies yesterday. Today, half were eaten by my siblings!" There might also be some similarity to how anaphoric pronouns are selected


Diamagnetic, Paramagnetic, Ferromagnetic

Question: Is there a way to understand why a substance would be diamagnetic, paramagnetic, or ferromagnetic without knowledge of quantum mechanics?  That is, can these phenomena be explained without quantum mechanics?
Comment: http://www.feynmanlectures.caltech.edu/II_34.html
Comment: Nice!  This is what I was hoping to find.  Thank you very much.
Answer: Diamagnetism occurs in all elements for a similar reason to Lenz's law, the magnetic field applied to the substance, induces electric currents which produce a magnetic field that opposes the applied field. The reason that diamagnetism is only observed in atoms where electrons are paired, is because then any paramagnetic effects are zero and you can observe the underlying diamagnetism, which would be swamped by any paramagnetic effects if there were unpaired electrons.
Answer: The existence and stability of atoms cannot even be explained classically, so in that sense the answer is no.
If you allow a semiclassical model where you forget about radiative losses and imagine the electron in orbit around the nucleus, then you can kind of account for diamagnetism. If you add that the spin angular momentum of the electron can only take two values as measured along any axis, then you can more or less account for paramagnetism.
Ferromagnetism, however, requires the quantum mechanical concept of exchange interaction to explain, and this has no classical analogue.
All in all, magnetism is a pretty deeply quantum mechanical phenomenon. Explaining it "classically" (to the extent that's even possible) requires us to add in a bunch of quantum mechanical results as ad hoc rules, so the real answer to your question is no.
Comment: Would you alter your explanation to detail how a semi-classical model could explain diamagnetism and paramagnetism?
Answer: At a basic level , diamagnetism occurs in those compounds / element which have all electrons paired.
Eg in $H_2 $all electrons in Bonding Orbital are paired
On the other hand paramagnetism occurs in those compounds / element which don't  have all electrons paired.
Eg in $O_2$ , 2 electrons are unpaired in the anti-bonding molecular orbital
It can similarly be applied on others too.
Comment: Thank you for this.  Is there a way to understand why this is the case?  Furthermore, water (a diamagnetic substance) aligns with an external magnetic field when it is large.  Why?
Comment: @NicNic8 I'm sorry but I don't exactly know the reason


What is use of reactJS in magento 2.3

Question: Friends recently I heard that Magento 2.3 will include react JS with it but I don't know what is the use of it and on what positions it will be used please share some Good resource SO I can understand the same.
Answer: You can create a Progressive Web App Using React.
Progressive Web App (PWA)
Magento has been forging ahead with the development of PWA Studio -- a suite of tools that allow you to develop, deploy and maintain a PWA storefront on top of Magento 2.
PWA is a new frontend technology that combines the advantages of native apps and websites. PWAs are usually built on a JavaScript framework like React, Vue.js or AngularJS for handling data and displaying it, and communicate with a backend via (Magento 2) REST API.
This approach is also known as Headless Magento.
Comment: can we use view or angular in place of react?
Comment: @AdarshShukla we can use it.
Comment: I have react.js build and how to integrate it with magento 2
Answer: Magento is a highly focused platform which allows users to build a compelling online store. It provides with engaging features that helps in developing the website with absolute satisfaction. For progressive web apps, Magento is going to be a part of Magento 2.3 and will reveal new stacks like React, Jsx, Redux. New front end stacks interduce possible tools and shed light on underlying technologies. The main purpose of React is to build the user interface fast, scalable and simple. It runs in the front-end browser. It helps developers to manage an extensive database.
Answer: You can use React JS with existing Magento 2 project and theme. You don't need to use PWA Studio or custom build MAgento 2 theme. This module integrates React and webPack with magento js, themes, css, templating  and layout - https://github.com/Genaker/reactmagento2
Answer: You can take a look at the PWA studio documentation to get an overview of the packages and libraries used. It's not Magento, but Magento PWA studio that is built with React: https://developer.adobe.com/commerce/pwa-studio/guides/project/tools-libraries/.
If you decide to take the route of building a Progressive Web App (PWA), you can consider better alternatives:

Vue Storefront. Commercial PWA, built with Vue.js - Demo
GraphCommerce. Open Source Magento 2 PWA, built with React - Demo
Deity falcon. Commercial PWA, built with React - Demo

What is use of reactJS in magento 2.3


Alternative for Swenson condensed milk. I'm diabetic

Question: I'm diabetic. I've been given a receipt for ice box pie that uses this milk.  What can I use to replace it with less sugar than receipts shown? It's made with Kool-Aid and cool whip.
Comment: Welcome! Can you post the full recipe and method?
Answer: There are actually many recipes for making your own sugar-free or low-sugar sweetened condensed milk. They generally involve combining non-fat milk or powdered milk and water with a sugar substitute like Splenda. Alternately, if it's sufficiently low in sugar, you can add Splenda or another no-calorie sweetener to evaporated milk.
We don't share recipes here but I encourage you to find one that works for you with your preference of milk product and sugar substitute.


is there any way I can open multiple terminals on the xfce4 window automatically every time I start xfce4?

Question: I'm doing some experiments and while I do it I have to turn a board off and on frequently (a program doesn't get killed properly probably with unclosed socket .. I installed signal handler and it worked and now it doesn't..) . Every time I turn on the board, I start vnc window (it starts xfce4 ) and have to open terminals in specific location. Is there any setup method through which the terminals are open automatically in specific locations? Or further with specific number of tabs? (I know how to give xwindow location and size : xwininfo -all. and use -geometry 1000x1000+300+300 for example).
Answer: From what I understand, you could add commands to the application autostart menu in Settings > Session and startup and give the command the working directory as an option as follows:
xfce4-terminal --default-working-directory="/home/$USER/Desktop"

The different options available are:
OPTIONS
   Option Summary
       Here is a summary of all the options, grouped by type. Explanations are in the following sections.

   General Options
       -h, --help; -V, --version; --disable-server; --color-table; --default-display=display;
       --default-working-directory=directory

   Window or Tab Separators
       --tab; --window

   Tab Options
       -x, --execute; -e, --command=command; -T, --title=title; --dynamic-title-mode=mode;
       --initial-title=title; --working-directory=directory; -H, --hold; --active-tab;
       --color-text=color; --color-bg=color

   Window Options
       --display=display; --drop-down; --geometry=geometry; --role=role; --startup-id=string; -I,
       --icon=icon; --fullscreen; --maximize; --minimize; --show-menubar, --hide-menubar;
       --show-borders, --hide-borders; --show-toolbar, --hide-toolbar; --show-scrollbar,
       --hide-scrollbar; --font=font; --zoom=zoom

Refer to the man page for more settings related to tabs and windows.
man xfce4-terminal

Comment: thanks, I'll try that when I get back to work. (wow I went to work this morning but immediately was sent home because there is someone in our building who has a covid-19 symptom.)
Comment: I tried that and could make two windows in my wanted positions, both with 4 tabs. But I can't figure out how to set the default-working-directory (for one tab it worked, but with 4 tabs, it didn't. maybe I have to give the value for all tabs..)


Database design - boolean attribute or new table

Question: Let's say I have a database table that I want to filter based on a boolean attribute (for example, "flagged" attribute). Is it better to just add a "flagged" attribute to the table, or make a new table which has foreign key to the base table? What are the pros and cons?
Answer: If that is all you need1, then just add the simple field.
But, you'll have to be careful about how you index it. Unless the values are seriously skewed2, you'll end-up with an index with a horrible selectivity and clustering factor3, and you'll actually be better off doing full table scans4.
If you filter by the flag in conjunction with other fields, make a composite index, which will then have a much better chance of being decently selective.

1 I.e. you don't need additional data that somehow "describes" or "augments" each of the two possible Boolean values.
2 One value is in deep minority (the number of rows containing false is much smaller than the number of rows containing true, or vice verse), and you happen to filter on just that value.
3 The link is for Oracle, but the general principle applies to all DBMSes.
4 Which a decent DBMS will do for you automatically, even in the presence of the index. A hypothetical "stupid" DBMS would just blindly use the index and perform even worse than the full table scan.
Comment: so making new table actually has no performance benefit from indexing? The attribute value is most likely skewed to 1 value
Comment: @vangoz Performance benefit? No. It will not let you index any more efficiently, will add the price of JOIN on top of that, and make the whole thing much bulkier (and therefore less cache-efficient).
Answer: If this flag has attributes by itself or if it is reusable, better create it as another table. But if its just something to mark a row as true/false, just make a bool column(and save time and work effort)
Answer: Just add column to the table, it is better and simpler.. then create a bitmap index what will speed up your queries if you use this column in WHERE
Answer: It depends. I myself prefer adding a new table when the value is not really related to the table/relation.
A good example of this is when you have table representing orders and you want to keep track of which ones has been printed. I would add new table called printed_orders with a foreign key to the order.
create table printed_orders (
  order_id int primary key references order(order_id)
);

If its been printed or not is not really part of the order but part of the system/business rules.


What is this O function?

Question: I came across such a function written by $O$. Can you please tell me what is this? Actually I see this function during proofs or error finding. I am familiar with big-O notation in algorithmic complexity, but I am talking about when it is used in math.
Example:
Answer: It's used in the exact same way as in complexity theory

$f=O(g)$ if and only if there exists a $k$ and an $N$ such that for all $x>N$, $f(x)<kg(x)$

It's not a new symbol. It's generally used in a manner similar to in complexity theory: to lump together the terms into a single term that dominates them in the analysis.
The main difference in the usage is that in error analysis, it's the slowly growing functions that matter rather than the fast growing ones. When $x$ is small, $x>x^2>x^3>\ldots$. It's usually used in the context of taylor series, which allows you to secure small values of $x-c$ (by centering the series near $x$). Therefore the dominating term is the smallest exponent, in contrast to evaluation at large values (such as in CS run-time) where the dominating term is the large exponent.
There is a discussion of this here
Comment: My thoughts now are like that: "so what?" :) Can you explain why people use it?
Always reading some proof or something, I am like "hmm, okay, then okay" and suddenly here is this $O$ function! Usually adding this at the end of the formula, so that: $f_1(x) + ... bla-bla + ... O(x^3)$ for example. What is this? Why do people need this?
Comment: @TurkhanBadalov I'm not sure what you're looking for besides "it's a concise way to express the idea that the remaining terms are dominated by a term of degree three." It's useful for doing algebra with inequalities because it lets you ignore higher degree terms.
Answer: It is the same big-O as in algorithmic complexity. The purpose in the specific context being to simplify the formal handling of terms that vanish in the asymptotic limit.
http://www.cs.cornell.edu/courses/cs312/2004fa/lectures/lecture16.htm
https://en.wikipedia.org/wiki/Asymptotic_analysis
Comment: Why do people use it? To not calculate all terms with coefficients? And instead they replace all them with the complexity function?
Comment: @TurkhanBadalov Yup, more or less. It's also a way to ignore all of the terms that don't matter (as error analysis usually hinges upon the coefficient of the lowest degree term)
Comment: @StellaBiderman, of the lowest degree or the highest? Where can I read about this?
Comment: @TurkhanBadalov I've edited my earlier answer to include more info and answer that question

What is this O function?


In FreeBSD, how can I disable hardware prefetching?

Question: I just finished reading
How to Choose between Hardware and Software Prefetch on 32-Bit Intel® Architecture
 and made the decision that I need to disable hardware prefetching for my use case.
In particular the following applies exactly to me:

Generally, prefer software-controlled prefetch in situations where all the following are true: irregular access patterns are present, short arrays must be prefetched, and making changes to existing application code is acceptable.

I found a number of answers that reference Linux specifically (see this SO answer).  However, for performance reasons I am using FreeBSD.
Even if this ends up being a bad idea, I want to benchmark by application without h/w prefetching.
Answer: Can you try to do the same using cpucontrol command?


Does yield point of steel depend on thickness?

Question: I have two different plates of different thickness and I need to calculate yield point. Does yield point of steel plate changes with changing of plate thickness?
Comment: Yield strength actually can depend on thickness. Rolled steel plates have lower yield strength when thicker, because it is somewhat more difficult to control internal flaws at higher thicknesses. Anyway, the question could be more clear.
Comment: are you asking if a 10 mm thick steel plate is as strong as a 10 cm thick one?
Comment: Do we use thicker plates to increase the mass or to increase the strength?
Comment: What do you mean by "yield point"?  Stress at yield?  Applied load at yield?  Strain at yield?  Physical location on the plate that yields first?
Answer: Basically, "no", but here I qualify the answer:
If by yield point you mean 'at what loading will this steel plate yield', then it is  basically a tensile strength test result. This can be calculated by knowing the specified yield stress strength of the material (fy = ?) and the cross section area subjected to the yield strength (A).
T (at yield) = A * fy
If by yield point you are asking 'what is the yield stress of the steel plates of varying thickness, then it is the same equation, with fy as the unknown:
fy (at yield) = T / A
Manufacturing and fabrication of steel plate can cause localized stresses and material differences, but manufacturers and fabricators take measures to minimize those variations and provide a uniform product. I'm assuming that is beyond the basic question that you were asking.


Table join inheritance

Question: I create db with Person, Client, Employee, Manager, Developer. I'm interested what is the best way to put the data in tables. In which cases should programmer unite Client in table hierarchy with EmployeeCategory for next using concept of Table join inheritance (because they have common attributes like firstName, lastName, email..) and in which cases programmer should hold Client table separate from Employee hierarchy (despite that Client has common attributes with Person)?
Answer: If you have common attributes across non-exclusive tables, you should consider normalizing your tables.
It appears that Client, Employee, Manager, and Developer are all sub-types of the Person entity.  As such any attributes common to all types should be in the person entity, and attributes for the other entities should depend only on that sub-type.
I would expect Managers and Developers are often or always Employees.
Programmers while need to join the tables need to access the data required for their use case.  It may be appropriate to select from only from the subtype tables, or only from the Person table.

Table join inheritance


Litmus test for replacing 95 Integra rotors?

Question: The rear wheels are making a scraping sound, which, I believe is an indicator to replace the pads.  How does one determine if it is time to replace the rotors?
Comment: It's not a litmus test, it's a thicknus test.
Answer: While the scaping sound is a good indicator, the way to determine for certain is to remove the wheel and measure the rotor thickness with a micrometer.  If it measure at or below the minimum service limit (from the SERVICE MANUAL and often embossed in the rotor itself) you should replace them.
Even if they do measure above the service limit, you should inspect for any damage or unusual wear including runout and replace if necessary.
Answer: If the pads have gone to metal to metal contact on the rotors, then replace them.
While it may be possible to machine them if they are still thick enough they could also be warped and that needs to be measured with a dial gauge. Even if they can be machined then they can warp after due to the heating / damage from the pads metal to metal contact.


Dealing with an infinitely repeated game

Question: I have been playing around with problems related to game theory, and I ran
into this issue related to an infinitely repeated game. Consider this game
repeated an infinite number of times:
$$\begin{array}{|c|c|c|}
    \hline
    &A&B \\
    \hline
    C&(1,1)&(-2,2) \\
    \hline
    D&(2,-2)&(0,0) \\
    \hline
\end{array}$$
Where Player 1 is the rows, Player 2 is the columns. I am wondering, is there
potentially a grim trigger nash equilibrium to this game, and if so, what
rate of defection would need to exist in order for the specific Nash Equilibrium
to be sustained?
Comment: Are you familiar with [the Prisoner's Dilemma](https://en.wikipedia.org/wiki/Nash_equilibrium#Prisoner.27s_dilemma) as an application for a Nash equilibrium?
Answer: Grim trigger is a strategy lacking forgiveness. If an agent initially defects, and the other agent is grim, the grim agent will subsequently defect forever.

My understanding is that there is no rational basis for a grim strategy in this game, because once the grim trigger is enacted, there will be no benefit for either agent for the remainder of the infinite iterations.

The biggest problem with iterated Dilemmas is that, if the number of iterations is finite, an agent that wants to "win" from a score perspective will want to defect on the last turn to gain some advantage:

If the game is played exactly N times and both players know this, then it is optimal to defect in all rounds. The only possible Nash equilibrium is to always defect. The proof is inductive: one might as well defect on the last turn, since the opponent will not have a chance to later retaliate. Therefore, both will defect on the last turn. Thus, the player might as well defect on the second-to-last turn, since the opponent will defect on the last no matter what is done, and so on. The same applies if the game length is unknown but has a known upper limit.Iterated Dilemma (wiki)

If there is no upper bound on iterations, there is no reason to preemptively defect.
I find real world grim strategies to be unlikely, since forever is an awfully long time, (and the 30 years war only lasted 30 years;)
It's unclear that mutual defection in infinite Dilemma is truly a Nash equilibrium because a case may be made that a rational player might gain by changing their strategy and cooperating for an iteration or two, based on the chance of the opponent also changing their strategy.


What is "swimming delta" as a risk attribute in pnl explain?

Question: What is swimming delta as in risk attribution?
Comment: "Swimming delta" is another name for "floating delta" (as opposed to sticky delta).  https://books.google.com/books?id=LnLgAgAAQBAJ&pg=PA170 Glen Swindle's excellent book "Valuation and Risk Management in Energy Markets" happens to be in Google books and explains it well on page 170.
Answer: Delta is the partial derivative of Call price C with respect to Stock price S, i.e $\frac{\partial C}{\partial S}$.
In the BSM model implied vol $\sigma$ is constant, in particular it does not depend on $S$ so there is nothing further to discuss.
When we allow for skew (but still compute IV according to the BSM model) the effect of a change in S is more complicated. When S increases, C increases by the direct effect mentioned earlier. But the increase in S also causes a drop in implied vol, which makes the call slightly less valuable.
Swimming Delta is the total derivative $\frac{dC}{dS}$ including both effects.
According to equation 5.8 in Euan Sinclair's book
$\frac{dC}{dS}=\frac{\partial C}{\partial S}+\frac{\partial C}{\partial \sigma}\frac{\partial \sigma}{\partial S}$
$=\Delta_{BSM}+\text{Vega}_{BSM}\cdot \frac{\partial \sigma}{\partial S}$
The last term is the (empirically estimated) slope of the Skew.
Therefore I think of Swimming delta as an ad-hoc correction to the Black Scholes delta.
Comment: You shoukd probably add that that is not the total derivative, just a more complete version than the partial without the shadow delta.
Comment: Yes, I am not happy with this answer and I will make change(s) soon.
Answer: "Swimming delta" is another name for "floating delta" (as opposed to sticky delta). books.google.com/books?id=LnLgAgAAQBAJ&pg=PA170 Glen Swindle's excellent book "Valuation and Risk Management in Energy Markets" happens to be in Google books and explains it well on page 170.
I'm just going to quote from his book here (see the book for formulas).

This leads to the following question: How does the volatility surface
  behave as a function of the forward price? This question has
  implications for the effective delta of any options portfolio, even
  those comprised solely of vanilla options.
This basic question can be
  refined as follows: Given a prescribed change in the underlying
  forward price, what inference can be made about the change in the
  implied volatility surface? ...
The volatility look-up
  protocol implicitly assumes that the ATM volatility does not change
  because of forward price movements. This is commonly referred to as
  the floating-skew convention because the default estimate for the new
  volatility surface given the new forward price is that the volatility
  surface shifted in tandem with the forward price with shape unchanged.
  As prices move, the volatility surface appears fixed when viewed in
  reference to the forward price but changes for any fixed strike
  option...
The other hypothesis most frequently
  discussed is sticky skew, in which the volatility surface is
  parameterized by absolute strike... Here the volatility surface is
  fixed with respect to option strike and moves when viewed from the
  reference of the prevailing forward price... As a consequence, delta under the
  floating-skew hypothesis is not the standard delta obtained from Black
  but is rather the total derivative...
So which of these paradigms is more consistent with empirical
  behavior? The results are not particularly compelling in part because
  any difference between the two approaches appears to be small relative
  to daily changes in implied volatility levels.


Perfect secrecy of affine cipher

Question: Given any probability distribution P r on the set
$\{k ∈ \mathbb{Z}_{26} : \gcd(k, 26) = 1\}$.
Show that the Affine Cipher achieves perfect secrecy if the key (k, a)
is used with probability $Pr(k) ·(1/26)$.
Answer: An encryption scheme is said to achieve perfect secrecy if for every probability distribution over M (the messsage space), every message m$\in$*M* and every ciphertext c$\in$C for which Pr[C = c]>0:
Pr[M = m | C = c] = Pr[M = m] or, equivalently, Pr[E(K,m)=c]=Pr[E(K,m')=c]   where E is the encryption algorithm that encrypt the message M according to the key K.So I think you should define/identify also the probability distribution over the message space(M) before starting to talking about perfect secrecy. However, I think the AffineCipher cannot achieve perfect secrecy except in particular cases in which the probaiblity distributions are too much flat and the message to be enciphered very short.

Perfect secrecy of affine cipher


Is this correct... "Every time I will listen to this song, I will remember you."

Question: Is this correct... "Every time I will listen to this song, I will remember you."
It's just that using will twice sounds awkward to me.
Comment: Drop the first will.
Answer: "Every time I will listen to this song, I will remember you."
This is grammatical, and possible, though not as common as
"Every time I listen to this song, I'll remember you."
An easier example to use to explain the difference would be,
<code>"If you go, I'll go, too."
vs.
"If you'll go, I'll go, too."
</code>
Note that I've contracted will, since we usually only pronounce 'will' when emphasizing our intent (often in an argumentative tone).
The first case, "If you go, I'll go, too." is more commonly what we would say, since it means simply that if the first condition is met (you go), then the second condition will also be met (I will go).
In the second case, "If you'll go, I'll go, too." it sounds like for some reason neither of us really want to go, but if you are willing to go, then I will be willing to go, too.
Answer: I agree with other answers given that the first will should be dropped (indeed, it must be dropped to be grammatical, although I can't explain exactly why).
The second will may be required or prohibited depending on the circumstance, though...
if this is the initiation of a habit, then it is necessary.  That is, you are establishing that "from this time forward, whenever I hear this song, I will remember you".  This is basically a promise of a future event, and therefore the future tense will remember is needed.
If, however, this is a description of an existing habit, then the latter will should be dropped.  That is, you are stating that "I have listened to this song in the past and it always caused me to remember you, and it will continue to do so in the future as well."  Because it is an already-established habit that has happened in the past and present, you do not need to move it into the future tense.
Comment: I don't 100% agree with the assertion that "will" in such constructions *only* applies to future actions. For example, I'm quite happy to understand [Whenever I receive a call for help, I will honor the request](https://www.google.com/search?q=%22Whenever+I+receive+a+call+for+help+I+will+honor+the+request%22&btnG=Search+Books&tbm=bks&tbo=1) as meaning *that's what I've done in the past, and what I will continue to do in the future*. I've certainly got no problem with *Fumblefingers will always disagree* being used to mean *Fumblefingers **habitually** disagrees*.
Comment: @FumbleFingers I like to think of the *will* in these fundamentally conditional constructions as being as much *consequential* as they are *subsequential*. I'd say that context determines whether the *will* expresses currently habitual behavior or a promise of future behavior.
Comment: I agree that it doesn't "sound right" with the first "will" ... but I'm hard pressed to cite a rule to say why. The listening is in the future. Maybe the "every time" makes it more of a present continuous? I'd be interested if anyone can chime in to explain why what Hellion says and what my gut feel says is right, is indeed right.
Comment: @StoneyB: Indeed. We had an [interesting question over on ELU](http://english.stackexchange.com/q/132225/2637) about one of the more obscure uses of "would", but unless I'm much mistaken you haven't supplied us with a definitive answer here on ELL covering the basics of common *would/[zero]/will* usage as it relates to the needs of learners. As ever, though, *context is all*.
Answer: This sentence, although this it does not have a clause headed by if, is really a 'realis' conditional: every time acts like if, and the clause it heads expresses a condition which you regard as possible. When and whenever can act like if, too—and in this sentence every time is equivalent to whenever.
And you probably know already that in a conditional construction with future reference, the verb in the condition (if) clause is cast in the present-tense form, and only the consequence (then) clause may employ an explicit future reference.
<code>        If I listen to this song I will remember you.
  Whenever I listen to this song I will remember you.
Every time I listen to this song I will remember you.
</code>
Answer: Although the superfluous "will" sounds unnecessary, this doesn't seem like a case of bad grammar, but a matter of euphony.
A clause can give a quantifier like "every time" or "whenever", and use future tense.

Oh don't pay attention to his weird response. He will do that every time.
I promise I will write everyday.

Also, if the tense is past, note both clauses must be in the past tense:

Every time I listened to the song, I remembered you.

Here, if either verb is changed to present tense, without the other, it is ungrammatical.
So it is a rather a "special case" that we can have:

Every time I listen to the song, I will remember you.

whereby the first clause is expressed in the grammatical present tense, but inherits the future tense semantics from the "will* in the second. This "propagation of tense" is not a general rule; it seems to apply to clauses dependent on a main future tense clause.
If you stare at these two sentences long enough, you may find yourself changing your mind! The first one will start to look awkward, while the second starts to look normal:

Every time I listen to the song, I will remember you.
Every time I will listen to the song, I will remember you.

The more I re-read the first one, the more I want to insert "From now on, " at the beginning to soften the change in tense, which seems more and more abrupt. (The rearrangement "I will remember you every time I listen to the song" continues to look fine, though: the inheritance of tense goes left to right, following the direction of speech. In the original order, I feel that I have to hold a present tense clause in my mind and then "back edit" its tense to the future upon receiving the future tense clause.)
At the same time, I'm able to "train" myself to accept the second without a whole lot of difficulty. If the usage were a common dialect somewhere, I'd probably pick it up over a weekend trip to the place.
Answer: A sentence can be constructed like that in light sarcasm because of the obvious opposite expectations of both parties. The speaker expects the listener is completely aware of their intentional use of that kind of 'weird' but random emphasis. For example:
Every time I should listen to this song, I should remember you.
That is totally grammatical too.
It can also be used to demonstrate the emotional relationship between the writer and the reader.


Visual Studio WPF Assembly and DLL solving

Question: I'm improving an existent WPF project with a TCP/IP protocol that sends and receive small objects. I'm using Visual Studio 10 but I'm stuck.
I'm using BinaryFormatter to serialize the objects and until I used to send and receive with two classes in the same project I had no problem, but when I separated listener and sender (TCPListener and TCPCLient) on runtime i had this error:
"Can't find Assembly 'ProjectName, Version=220.127.116.11, Culture=neutral, PublicKeyToken=null'".
Googling I found out that the problem could be solved creating an external dll called from main program, but I don't know how to pass the MainWindow to the dll because the library not even can find WPF types (such as MainWindow, Combobox or Textbox)
Can you help me with this dll problem or do you have any ideas to solve the assembly reference problem?
Answer: First of all, you shouldn't pass the MainWindow to a class you intend to serialize. This data class should actually not have any dependencies on the GUI. In fact, if you want to serialize a class, its public interface should in my opinion only contain primitive types or classes defined in the same assembly.
However, for a quick fix, and if you don't want to rewrite your project completely, I found that the easiest way to get the dependencies for a WPF library right was to start a new WPF application project and then change its project type to WPF Class library in the application tab of the project properties.
Comment: Thanks for answering.

I've followed your advice but I understood the problem was in other place.

I've read that Deserialization wants the same dll signature for the formatter, so I created an external dll who offers to construct the BinaryFormatter and exported it in each program path.
In this way every application instance will find the same signature on both BinaryFormatters and do the serialization/deserialization in "safe" mode.

I find this a little tricky (why not permit a forced Deserialization) but solved.

Thanks for availability!


How much the previous university's prestige matters for a phd enrollment?

Question: I'd like to apply for a PhD in Ancient History at Oxford in the future.
Currently I'm planning to apply for a ResMa in Ancient History at Leiden university, in the Netherlands, which is thaught in English.
Is it a recognised uni for classics in UK or the US or should I do a British university instead, such as Durham, Mancester, UCL, St Andrews and so on to have better possibilities to be taken at Oxford?
Thank you all!
Comment: Spelling, punctuation, and proper grammar matters tremendously -- especially in the humanities. In that regard, you might find yourself at a disadvantage.
Comment: Crazy question. It's far better to attend the #1 university in your country.
Comment: I think you should factor in that at Leiden you would be doing a research masters. I am unaware of these existing in the UK. Consequently, going to Leiden may get you a publication and that would be a significant factor into where and whether you are accepted for a PhD. It's not the only factor of course, I'm not qualified to say whether Leiden would be a good place (that's something you should research).
Comment: @ThomasKing MRes certainly do exist in the UK, much more so in the humanities than the sciences afaik.
Answer: All of the universities you have mentioned are top-league universities with high prestige. As for whether you have a better chance of getting into Durham, UCL etc versus Oxford is debatable. They are internationally renowned and the competition very high. Of course, Oxford is Oxford, but there's little point in going to Oxford just because it's Oxford, which it sounds like you want to do, because you don't seem to know what it's like for your specialist subject area.
The most important thing about any university is the staff in the departments, not necessarily the university itself. These are the supervisors who you will be learning from and have constant contact with. Their tuition can be either inspiring or a hindrance to positive learning.
All of the universities you mention are good. Take some time to visit their websites, look at the department members, their publications and what feel you get from the institution and the department. Do you get the impression that you really like the place? Does it look inspiring? Does it make you want to find out more, do you think you that when the course gets difficult [not if] you would be able to overcome the obstacles with the staff's support?
At the end of the day, finding out the answers to these questions is far more important that going to Institution A or B based on some arbitrary popular notion of league places. A slightly lower-league university may get a lot more out of you than one a few more places up depending on how well you gel with the department. If, after your research, you still want to go to Oxford and it looks right to you, by all means go for it, but don't get hung up on it. The amount that an institution inspires you will govern how much 'better' the 'possibilities' are for your entry.
Answer: I think your university's prestige matters very little. What is more important is the quality of work you do, your grades, possible publications, awards etc, and the strong reference letters which naturally follow on from those things.


Windows 8 in a VDI environment and the use of Secure Boot

Question: I have a question, How would secure boot be implemented in a virtulized environment, say XEN hypervisor with multiple guest OS's including Windows 8 guest VM? does the guest VM need access to the hardware validation as well?
Comment: You would simply disable the secure boot option in a virtualized environment.  At least until the virtualized environment supported secure boot.  Why is everyone so worried about Secure Boot?
Answer: A virtualised environment could would be easier to handle in this case.
Firstly, in order to load any operating system, you need to emulate boot. So a VM implementation such as Intel VT only implements CPU emulation; the rest is up to the vm software. Everything must either be emulated or passed through with hardware support.
Boot is no exception - and as most VM solutions currently emulate MBR-based BIOSes there is no reason for them not to be able to emulate EFI boot either. The EFI spec is publicly available and GPT-partitioned disks such as are required to EFI boot with Windows have been creatable for a while now.
Now the question is - how does secure boot work? Well, without diving too deep into the specification, the concept is that the binaries you wish to boot are signed with a private key and the corresponding public key is shipped with the hardware. I'm not yet sure to what extent a full x509/PKCS trust chain is in place, but I believe that's the aim.
Given an executable the hardware is asked to boot, secure boot means very simply that it will check the signature(s) on that executable and if they match its internally trusted certificates and the signatures remain valid, great, they can boot. If not, the EFI shell simply tells the user "sorry mate, can't boot that, don't like it" and bam, out you go.
So from the point of view of guest operating systems, life is easy getting things to boot - just allow it and don't check the signatures.
Things get more complicated when it comes to the OSes ability to establish a channel* to the hardware, however - I believe (I've not read that bit of the spec thoroughly, but I have read the GPT layout part. I can quote GPT layouts to you in my sleep!) operating systems will communicate with the EFI shell should they wish to notify it of changes to their environment, replace keys etc. This would need to be emulated correctly; a failure to do so would undoubtedly break the host OS assuming it requires and expects the protocol to exist.
If Windows 8 is going to insist upon secure boot and the ability to interact with the hardware, that'll all require correct emulation. However, OSes that merely require getting started it'll make no difference to.
Comment: I agree.  Secure boot in a virtualised environment shouldn't be too big a problem.

Virtualisation just extends the chain of trust.  If your hypervisor bootloader was trusted to launch, you then trust the hypervisor to only allow trustworthy guest VMs (and their boot loaders) to be run.  Emulating EFI is one way of doing this.  The big thing about Secure Boot is getting the initial step sorted.


Sencha touch 2 + Apple push notifications + Ext.device.Push

Question: I recently started developing with Sencha Touch 2, at the moment i'm creating an app that needs support for Apple Push Notifications.
So I've created the neccesary certificates at the Apple developer center and used them to package the application with the Sencha Touch SDK tools. All went well and I'm able to run this app on my device.
In the app I added a button to receive the device token. When I tap the button it executes the following code:
<code>    Ext.device.Push.register({
        type: Ext.device.Push.ALERT | Ext.device.Push.BADGE | Ext.device.Push.SOUND,
        success: function (token) {
            console.log('# Push notification registration successful:');
            Ext.Msg.alert('    token: ' + token);
        },
        failure: function (error) {
            console.log('# Push notification registration unsuccessful:');
            Ext.Msg.alert('     error: ' + error);
        },
        received: function (notifications) {
            console.log('# Push notification received:');
            Ext.Msg.alert('    ' + JSON.stringify(notifications));
        }

    //    Ext.device.Notification.show({
    //        title: 'My Title',
    //        message: 'A message',
    //        style: "login",
    //        buttons: ["Cancel", "Login"],
    //        callback: function (button, values, options) {
    //              //When the user taps a button, show another notification
    //              Ext.device.Notification.show({
    //                   message: 'You typed: "' + values + '"'
    //              });
    //                    }
    //        });
},
</code>
When the Ext.device.Notificaion.show is uncommented, I get a message so I'm sure this piece of code gets executed. Now my problem is I don't get any message from the Ext.device.Push.register. No success, failure or received event gets fired. Has anyone over here managed to get this working, or what am I doing wrong?
Answer: Make sure you included <code>"notificationConfiguration":"debug"</code> into your JSON config.
Answer: I've post on my blog how to configure and build a Sencha Touch application for IOS Push Notifications - http://isolasoftware.it/2013/09/17/ios-push-notifications-using-sencha-touch-2/.
The most important steps are:

Configure applicationName, applicationId and bundleSeedId in package.json
Perform a manual entitlement on your app
Build the .pem certificate (or .p12) for push server correctly


Origin of alternate meanings

Question: How do some words get alternate meanings that have nothing to do with their original definition? For example, the word cool means both moderately cold and permitting such a sensation. How are these alternate definitions coined?
Comment: Because people start using them that way. That is the *whole* of the answer. You can *sometimes* identify a particular event or set of circumstances by which a particular word acquires a new meaning, but the general question has no more specific answer.
Answer: One of the ways that new meaning comes up is through usage.  Alternate meanings come from change in meanings due to the way its used. Let's take the word you gave, cool. Originally meant to mean moderately cold, if someone wasn't excited, or someone was calm and had good control over himself, he was said to be "cool as a cucumber", that is, not easily excited. Thus, an alternate meaning of cool came from describing a person who did not get "hot" in an exciting occurrence, or debate, etc.
Then, as time wore on, someone who could hold his nerves was looked up to, and someone who was "cool" soon began to mean something more of the, "admirable"(e.g. "That car is cool".
Thus, we can kind of slowly trace the alternate meanings in a word. But they're different for every word.
The main thing that influences them however, is what they're used for, and the environment around usage.
Comment: Cool=popular/fashionable is probably a deliberate inversion of the earlier hot. Like bad means good
Comment: A much more specific occurrence of word change is something called Grammaticalization (http://en.wikipedia.org/wiki/Grammaticalization).  This is the process that turns words such as 'go' into a functional word, as in "I'm going to scream."

Origin of alternate meanings


How to make a sword that when you hold it the mobs near it will die in 1 secs?

Question: I saw a video on YouTube where someone made a sword that using repeating command blocks, causes the mobs nearby to die. The sword in the video was created in Minecraft Bedrock Edition but I want it in Java Edition and in 1.16.
Answer: It in fact is possible using scoreboards and /execute commands, I'll try to explain everything as thoroughly as possible.
First off all, I'm assuming the sword has been renamed to "Spaghetti" and is a netherite sword, as this will be what the command block will be checking for (these are just examples and can of course be any item and name you want). You can rename a netherite sword in an anvil or obtain a renamed sword directly with the following give command:
/give @p netherite_sword{display:{Name:'{"text":"Spaghetti"}'}} 1

If you don't want a lot of text and just want the commands here they are:
/scoreboard objectives add os_timer dummy is first needed to create the scoreboard we need
Then the following 3 commands all need to be in 3 separate always active repeating command blocks
execute at @a[nbt={SelectedItem:{id:"minecraft:netherite_sword",tag:{display:{Name:'{"text":"Spaghetti"}'}}}}] run scoreboard players add @e[nbt=!{SelectedItem:{id:"minecraft:netherite_sword",tag:{display:{Name:'{"text":"Spaghetti"}'}}}},distance=..3] os_timer 1

kill @e[scores={os_timer=20}]

execute at @a run scoreboard players reset @e[distance=3..] os_timer

Explanations below:
/scoreboard objectives add os_timer dummy
The scoreboard "os_timer" is needed as this is the countdown until a mob is killed, the name can be whatever you want, as long as you edit them in every other command as well.
The first command in a command block:
The first part of the command /execute at @a[nbt={SelectedItem:{id:"minecraft:netherite_sword",tag:{display:{Name:'{"text":"Spaghetti"}'}}}}]
in short looks for a player that wields a netherite sword that is called "Spaghetti" and takes that player's location as its location where it runs.
The second part of the command run scoreboard players add @e[nbt=!{SelectedItem:{id:"minecraft:netherite_sword",tag:{display:{Name:'{"text":"Spaghetti"}'}}}},distance=..3] os_timer 1 in short adds 1 score to the "os_timer" scoreboard for every entity in a 3 block radius that is NOT wielding the sword (as to not kill yourself in the process).
Second command block:
kill @e[scores={os_timer=20}] simply kills all entities whose "os_timer" score is 20, 20 being chosen as a repeating command block runs 20 ticks per second.
Third command block:
execute at @a run scoreboard players reset @e[distance=3..] os_timer this one is not needed, however what it does is, it resets every entity's score when they go outside the 3 block range (of every player)
Answer: I'd like to say that this is probably not possible. But you can try making a sword that is ONE SHOT Kill sword by adding 32k sharpness enchantment
This is what you have to type in to get a **One Shot ** kill sword
The video you saw the person might be using some mods which might be helping him.
/give @p netherite_sword{Enchantments:[{id:sharpness,lvl:32767},{id:knockback,lvl:10},{id:fire_aspect,lvl:32767},{id:looting,lvl:10},{id:sweeping,lvl:3},{id:unbreaking,lvl:32767},{id:mending,lvl:1}]}

Comment: Why would this be not possible?
Comment: Welp, thanks VikyTricKy but i already have a sword like that and also ExpertCoder14 if you say this is not possible than how do you do it?
Comment: @yypl he never said it wasnt possible


Is there a generic way to replace referential constraints with triggers?

Question: Porting application from MSSQL+Oracle to Sybase, and there's an issue with 'on delete cascade' - Sybase doesn't have the option.
Sybase has a link with a trigger to implement cascading delete: http://infocenter.sybase.com/help/index.jsp?topic=/com.sybase.help.ase_15.0.sqlug/html/sqlug/sqlug815.htm
but there is a problem with that solution when put into context of using it as 'on delete cascade'.
The problem, is triggers get executed after any referential constraints are checked.
The issue is illustrated here:
<code>--drop table A
--drop table B
create table A (c int primary key)
create table B (c int primary key)

alter table A
add constraint Ac FOREIGN KEY (c) REFERENCES B(c)

create trigger delBA on B for delete
as delete A from A, deleted where A.c = deleted.c

insert into B values (1)
insert into A values (1)

delete B where c = 1
</code>
The 'delete' statement will fail, because of 'Ac' constraint.  Had the trigger fired before the check for referential constraints (instead of after), it would have removed the value '1' from table 'A' and there would not be a problem.
For this reason, I'm thinking to implement the referential constraint by using a trigger.  So I have to create an Insert and Update trigger, I believe.  Is there some template that I can use?
I want to make sure I'm not overlooking anything, at first look at the issue, I missed that update trigger should be written so that it can validate that after update the constraint is still valid.  - That is the reason I'm looking for a template, so I won't miss anything similar.
Answer: Triggers are often sources of trouble. A common approach would be to set up your data access layer that will create a transaction, delete the 'children' (cascade part) then delete the parent.


Cron job in Magento Module

Question: I am trying to use Cron job in magento on my Linux (HostGator) server.
I have created a module in magento admin panel and I want to run it with mymodule but it is not working.
When I run it from cpanel, it is working properly and it takes time schedule from 'cpanel', but I want to run it according to time, which I have set in mymodule crontab.
Can any body advise me that it is necessary to set cronjob from cpanel? or it can be run from a module crontab at different time schedules?
Answer: Please read this wiki article about the work of cron in Magento
http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/how_to_setup_a_cron_job
Answer: First you need to configure Cron via Cpanel. Here is more info (with screenshots)    https://support.sweettoothrewards.com/entries/21196536-setting-up-cron-jobs-in-magento
Here is also my article that can give you more info how to setup cron in your custom magento extension and how cron works http://blog.belvg.com/magento-certified-developer-exam-setting-up-a-cron-job.html
Here is also very nice and free extension by Fabrizio Branca that will help you to test your cron jobs
http://www.fabrizio-branca.de/magento-cron-scheduler.html

Cron job in Magento Module


color glitches and weird texture in render

Question: When I look in my preview render everything looks fine (for not having finished lighting) but when i actually render it the color of my doughnut icing glitches and the texture of the table doesn't appear.
Answer: It looks to me like you have some extra lights and meshes in your scene that are hidden in the viewport. Objects that are hidden in the viewport won't show up in the preview renders, but will show up in the final renders. You can reveal any hidden objects by using AltH. Then once these hidden objects are revealed you will be able to see their effects in realtime and remove or adjust them accordingly.
Comment: in the outliner look for objects that are disabled for the viewport (eye icon) and enabled for render (camera icon)
Comment: Your table material may be suffering from too much specular.


Why is there a chemical potential term in the Bose-Hubbard Hamiltonian?

Question: When looking at the Bose-Hubbard Hamiltonian
$$H_{BH}=-t\sum_{\langle i,j\rangle}a^\dagger_ia_j+\frac{U}{2}\sum_ia^\dagger_ia_i(a_i^\dagger a_i-1)-\mu\sum_ia_i^\dagger a_i,$$ I'm wondering why there is the chemical potential term. In my understanding, the Hamiltonian is supposed to "measure" the energy of the system or more precisely, the eigenvalues are the energies of its eigenstates. While to me, the first two terms seem rather obvious (Energy attached to the "hopping" within the system and on-site interaction due to pseudo contact potential) I don't understand why there is the chemical potential term. Shouldn't this $\mu=\frac{\partial E}{\partial N}|_{S,V}$ already be accounted for with the first two terms? And more confusingly,if not, why is the sign negative? Last but not least, it appears that all the particles "carry" the same chemical potential but if we imagine a particle-by-particle filling of the lattice, then obviously this is not the case. So could someone clarify why this term is there and why it looks how it looks?
Answer: The model assumes your system of $N$ particles is connected to a reservoir of infinite particles. The chemical potential $\mu$ is the "tilt" between these two bowls of particles, allowing for particles to flow until equilibrium (same number of particles, fixed desired $N$) is reached. In the same way a potential difference between the two sides of a charged capacitor exists until both sides have the same total charge. This formalism is known as the grand-canonical ensemble.
$\mu$ controls the filling. How many particles there are in your system.  This affects the physics, because even if $U\rightarrow \infty$ but you only have $1$ particle, nothing interesting will happen. You always need to know what $J$ or $U$ are compared to $\mu$. As an example, if you plot the average number of particles per site in the Mott phase $\bar n$, it is a step ladder for integer values of $\mu / U$.

Shouldn't this $\mu=\frac{\partial E}{\partial N}|_{S,V}$ already be
accounted for with the first two terms?

No. The first two terms do not depends on the number of particles. This extra term is telling how much the energy of the system changes by adding a new particle, while the other ones are telling you how much the energy of the system changes as you vary interactions and tunnelling (at fixed particle number).

And more confusingly,if not, why is the sign negative?

The chemical potential of bosons is negative, so really here it should be $-|\mu|$. Intuitively, you can justify it with "bosonic enhancement", i.e. bosons like to be in the same state so they lower their energy for that to be more favourable.
Edit:
While part of my statement above is true, it is not why there is a $-\mu$ term. That also shows up in classical statistical mechanics and is just the result of derivatives and stuff when integrating out the reservoir. See e.g. here.

Last but not least, it appears that all the particles "carry" the same
chemical potential but if we imagine a particle-by-particle filling of
the lattice, then obviously this is not the case. So could someone
clarify why this term is there and why it looks how it looks?

The chemical potential is set by this particle reservoir in the grand-canonical ensemble. It controls how many particles are in the system, it does not care about the system's specifics.
Comment: Thank you very much for the nice explanation!
Especially for pointing out that it is not $-\mu$ but $-|\mu|$! I am quite surprised that writing $-\mu$ seems to be a common notation when in fact it needs to be $+\mu$ (At least if we stick to $\mu:=+\frac{\partial E}{\partial N}|_{S,V}$
Comment: @Simon, Actually I am sorry, I am wrong. The chemical potential is indeed negative for bosons near Tc but the $-\mu$ occurs also in classical statistical physics. I've edited my answer.
Answer: The reference energy (energy upto Fermi energy) given by muN is subtracted from H.
Which is needed for solution in grand canonical ensemble.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).


Physical explanation of the characteristics of the order parameter of the transverse Ising Model

Question: The Hamiltonian for transverse Ising model is $$\hat{H}=-\sum_{j=0}^{N-1}(\lambda \hat{\sigma}_j^x\hat{\sigma}_{j+1}^x+\hat{\sigma}_j^z)$$ where $\hat{\sigma}$s are Pauli matrices. This model shows quantum phase transition at $\lambda=1$. The order parameter is transverse magnetization ($\langle \hat{\sigma}^x\rangle$). The value of $\langle \hat{\sigma}^x\rangle$ for $\lambda \geq 1$ is $$(1-\frac{1}{\lambda^2})^{\frac{1}{8}}$$ This expression comes from a lengthy calculation as done by P. Pfeuty [Annals of Physics: 57, 79-90 (1970)]. Is there any simpler way to understand the $\lambda$ dependence and the overall power $\frac{1}{8}$ based on some physical argument?
Answer: $\lambda$ describes the strength of the spin-spin interaction ($J$) relative to (or against) the thermal fluctuation ($kT$); the former prefers an ordered phase whereas the latter a disorder phase. So, $\lambda$ is a function of $J$ and $kT$.
The power $\frac{1}{8}$ is called the critical exponent of the order parameter. It's a kind of signature to identify which universality class the phenomenon in question belongs to. Since the power is $\frac{1}{8}$, I believe the model describes a phase transition in $d=2$, i.e. 2D Ising model. In short we could say, a critical exponent is a manifestation of several factors (dimension, range of interaction, and spin dimension) that determines the universality class of a phase transition phenomenon.
More details about critical exponents: https://en.wikipedia.org/wiki/Critical_exponent
And universality class: https://en.wikipedia.org/wiki/Universality_class
Comment: I don't think that this answers the question by the OP. As far as I understand, he would like to have a heuristic explanation for the exponent $1/8$. The fact that one finds the same exponent as for the 2d Ising model is intuitively clear (given the well-known representation of the transverse chain as a $1+1$-dimensional semi-discrete Ising model).  So the question can be restated, I believe, as "what is an intuitive reason for the value of the magnetization exponent in the 2d Ising model". I don't know of any intuitive argument and would also be interested in seeing one.


windows server core 2012 BPA does not complete error

Question: When attempting to run a BPA scan on a remote server core 2012 installation, I'm getting the error "There has been a Best Practice Analyzer error for Model Id 'Microsoft/Windows/WebServer'. The Result file has not yet been generated, Please perform the scan first and try again.
Answer: https://support.microsoft.com/en-us/kb/2028818 suggests to set script execution policies to certain settings.

Edit Group Policy/ Computer Configuration\Administrative Templates\Windows Components\Windows PowerShell
Turn on Script Execution

It tried to enable this and it removed the error, only to replace it with KeyNotFoundException


uniform rod revolving around a vertical axis with given angular velocity and given length of rod

Question: A uniform rod of given length and given angular velocity is revolving around a vertical axis.
Clearly it can do so in a horizontal plane with respect to vertical axis.
At what other angle can it do so?
That is, what is the angel of inclination with vertical axis?
Given that inclination angle is constant.
Answer in the book is :cosine inverse 3g/(2 times square of angular velocity times length of rod).
Where g is acceleration due to gravity.
Answer: The torque due to gravity and centripetal force must be equal. Let's call the coordinate along the rod $x$, varying from 0 to $L$. A small piece, of length $dx$ has a mass of $\frac{m}{L} dx$. The torque due to gravity of this small piece is $$d\tau_g=\frac{m}{L} dx g x \sin \theta$$ The total torque due to gravity is given by $$\tau_g=\int_0^L\frac{m}{L} dx g x \sin \theta=\frac{1}{2}mgL\sin\theta$$
The centripetal force on the same small piece is given by $$dF=\frac{m}{L} dx \omega^2 x\sin\theta$$ $\omega$ is the angular velocity. If the rod is at an angle $\theta$ with respect to the vertical, the rotation radius of that small piece at distance $x$ along the rod is $x\sin\theta$. the torque due to this force is $$d\tau_F=dF x \cos\theta=\frac{m}{L} dx \omega^2 x^2\sin\theta\cos\theta$$ Integrating it we get
$$\tau_F=\frac{1}{3}m\omega^2L^2\sin\theta\cos\theta$$
Now from $\tau_g=\tau_F$ we get:
$$ \frac{1}{2}mgL\sin\theta=\frac{1}{3}m\omega^2L^2\sin\theta\cos\theta$$
We have two solutions. $\theta$=0 means that the rod is vertical, rotating around the vertical axis. The other solution is the one you were looking for: $$\cos\theta=\frac{3g}{2\omega^2L}$$
Note that the rod cannot be horizontal, since the gravity will pull it downwards.
Comment: It's perhaps worth emphasizing that 1) While it cannot be truly horizontal, it can be made arbitrarily close to such by sufficiently increasing either the angular velocity or the length, 2) If $\omega^2<3g/2L$, then no solution to the last equation exists and therefore only the vertical equilibrium is possible.
Comment: @semiclassical in the book theta equals 0 was given. I foolishly thought it to be horizontal plane instead of vertical.
Comment: @Andrei in the book theta equals 0 was given. I foolishly thought it to be horizontal plane instead of vertical.


How does Java know the methods of an external jar?

Question: What I don't get is how does Java know the methods of a jar that is referenced? If it is compiled just for running and you can't read it I don't see how you can see the methods still. An example of my question is like if you made a jar that makes a box show up on the screen using a method called
"ShowABox". And you add it to another Java project. Then how does the IDE know that a method called
"ShowABox" exists since the jar was already compiled? You can't read class files in an IDE so why can it read methods?
Answer: All the information you are referring to is actually stored in the class files precisely for this reason.
As to seeing the code in class files, you can certainly do so, and it will also prove that the information was kept. Have a look at Java Decompiler. Note you can even build this into eclipse if you want to see it directly there.
Answer: Compiled classes contain bytecode. Methods still has their real names, but their code compiled to JVM instructions.
You can read java class file format specification on wiki, read "The constant pool" paragraph, methods names (as other class information) contains in constant pool.
Just try to open some .class file in text editor, you will find methods names there. (.class files are often in project/bin folder, or open .jar as archive and get .class file from there)
Answer: A JAR is nothing more than all the class files zipped in a single file with a manifest attached. Each class file completely describes its public interface.
Answer: JAR-files have a very specific format — see http://en.wikipedia.org/wiki/JAR_(file_format) — and they contain class-files, which also have a very specific format — see http://en.wikipedia.org/wiki/Java_class_file. This format, in addition to providing the Java Virtual Machine with the information it needs to execute code, also provides IDEs and compilers with the information they need to find classes, interfaces, fields, methods, and so on.
Answer: A jar is nothing but an archive containing Java compiled .class binaries compressed for compactness into a single file.  Its contents are compiled binaries organized in a directory structure.  So you can think of it as a directory with files but compressed into a single archive (just like a zip file).  A jar itself is not a binary ("exists since the jar was already compiled") -- it doesn't get compiled itself but it rather contains compiled elements.


About asking a question in two different SE communities?

Question: I just asked this question in the Computer Graphics SE but I also kind of want to ask it in the Video Production SE which may have a different view on the topic. What are the SE rules and how to best do this if allowed at all?
Answer: The policy is that cross-posting is not allowed.
That is not to question your motives for asking a question across multiple sites, but unfortunately the most common scenario for cross-posting is that folks will shotgun questions across every site that even remotely match what they're asking for. Unfortunately, that typically means they're disregarding norms of each community while their content is spread too far and wide to be attentive to any followup questions or edits each community may have.
Essentially, we don't really like to question the motives of why someone is asking a question, so sometimes it is best to have these broad policies in place so we can keep the system simple and help the most people possible.
The best practice here is to ask your question on one site… and then bring what you have learned to ask again elsewhere if necessary. You might even be able add some of those experiences into subsequent questions to share what you have learned. That would stay within the spirit of the policy while avoiding the problems asking a lot of questions all at once.
Answer: Generally it is frowned upon to post the exact same question on multiple sites, however if you have distinct things you are looking for about the same situation, it may be possible to ask different but similar questions to different communities.
The idea behind this is that we want questions to be at the best place for them to be found so that we don't split up good answers to the question, but for example, if you were trying to setup an online billing site, you might ask about legal aspects of it on law and programming aspects on stack overflow.
Comment: @O.M.Y. honestly, looking at the specific question.  I don't see how the difference in background would matter significantly to the question.  The state of the art of what is possible is the same no matter if you are asking a video editor, a computer graphics person or a signal processing person.  It's still the same thing doing the same problem.  There is no meaningful difference in perspective.  I say that as a video editor and computer graphics person with a pretty solid understanding of signals.
Comment: Since in this case there are three highly similar yet not identical fields, each might have different approaches to the subject matter. That does not however automatically mean the problem needs to be described using three different phrasings to explain the same problem. I really am trying to see how this question could be asked *differently* for these 3 fields, each of which has its own specializations.
Answer: Your question involves upscaling a video so looks on-topic - the Signal Processing SE is another candidate.
Comment: So should I copy (aka "repeat") the same question into these other SE's or is there a rule about/against cross-posting ?
Comment: Just copy it here.


Why fewer feature classification models can perform better?

Question: I have seen articles on the "curse of dimensionality" and why reducing the number of features can help with overfitting, but imagine we are interested in cases with significantly less features. Why is it that a classification model with fewer features can perform better than one with more features when the feature set is already small (for the sake of example, let's say 10 features)?
Answer: Overfitting can occur when we include ten features in a model on dataset $A$ just as easily as it can occur when we include a thousand features on dataset $B$. (This is not the "curse of dimensionality" as such.)
Let's simulate some data with a single "true" predictor and ten unrelated predictors, then check what happens on a holdout set if we include the unrelated predictors in a model. We will use a sample size of $n=30$ in both the training and the test sample and use the Mean Squared Error to assess the predictions.

We see that the MSE goes down as we include the single relevant predictor; then, as we add completely unrelated predictors, it goes up again. This is overfitting.
This is a numerical example; the same holds for classification, I'd just rather not go into discussions of what KPI to use in classification.
<code>nn <- 30
n_preds <- 10
n_sims <- 2e3

mses <- matrix(NA,nrow=n_sims,ncol=n_preds+1,dimnames=list(NULL,0:n_preds))
pb <- winProgressBar(max=n_sims)
for ( ii in 1:n_sims ) {
    setWinProgressBar(pb,ii,paste(ii,"of",n_sims))
    set.seed(ii)
    dataset <- data.frame(matrix(runif(2*nn*n_preds),nrow=2*nn,
      dimnames=list(NULL,paste0("X",1:n_preds))))
    dataset$yy <- dataset$X1+rnorm(2*nn)

    model <- lm(yy~1,dataset[1:nn,])
    mses[ii,1] <- mean((yy[-(1:nn)]-predict(model,dataset[-(1:nn),]))^2)

    for ( jj in 1:n_preds ) {
        model <- lm(paste0("yy~",paste0("X",1:jj,collapse="+")),dataset[1:nn,])
        mses[ii,jj+1] <- mean((dataset$yy[-(1:nn)]-predict(model,dataset[-(1:nn),]))^2)
    }
}
close(pb)

plot(colMeans(mses),type="o",pch=19,
  xlab="Number of predictors",ylab="Mean squared prediction error")
</code>
Comment: Yes, exactly. Overfitting can occur with a single predictor. I edited my answer to illustrate.
Comment: Hi Stephan, thanks for your response! I have typically seen overfitting in the context of high dimensionality. Does overfitting occur with lower dimensional data because it is essentially picking up on "noise" from unrelated predictors?
Comment: Awesome, thanks for the example and explanation. That was super helpful in illustrating the overall concept.


Hand dipped in water and surface tension

Question: If we dip our fore finger in water and we try to pull it out we notice that our forefinger sort of 'drags' the water along with it(see pic).My textbook says its because of surface tension and leaves it there.I am however unable to understand why so.The surface tension in my opinion will try to pull back (downward force) and hence try to detach from our finger.Is the reason for this 'drag' is because of the adhesive force btw our finger and water greater than force by surface tension and hence the finger drags the water along with it?. I am having a bit difficulty to comprehend whats happening......
Answer: The surface tension effect can be understood from the picture below (figure source).

There are three components of the surface tension. Mostly people think about the surface tension between water and air, but there is also surface tension between your finger and air, and your finger and water. Together with gravity this defines the contact angle at the interface. If the droplet is small, the surface tension is stronger than gravity. This is why you can tilt the water up, or why droplets attach to surfaces.
I am not sure what the adhesive force would be that you are hypothesizing about. You can experiment with bigger surfaces, since an adhesive force would scale with area, whereas the surface tension force scales with the circumference mostly.


How to prove this language is not context free?

Question: $$L=\{a^{nm} \mid \text{$n$ and $m$ are prime numbers}\}$$
How can i prove $L$ is not context free? I tried pumping lemma but couldn't find an i that $uv^ixy^iz \notin L$.
Any idea or hint on how to prove this?
Answer: A simple proof consists to use Parikh's theorem, which states that the commutative image of a context-free language is semilinear. In your case, this theorem implies that if your language is context-free, then the set
$$
\{nm \mid \text{$n$ and $m$ are prime numbers} \}
$$
is a finite union of arithmetic progressions, or equivalently, that your language is regular. Now, if your language were regular, its intersection with the regular language $(a^2)^*$ would also be regular, that is, the language
$$
  \{ (a^2)^p \mid \text{$p$ is a prime number} \}
$$
would be regular. You should now be able to show that this is not the case.
Answer: We want to prove that, for arbitrarily large integers $n$ such that $n$ is the product of two primes, and for all non-negative integers $a,b,c,d, h$ such that $$\begin{cases}a+b+c+d+h=n\\ b+d\ge1\end{cases}$$
there is a positive integer $k$ such that $a+b+c+k(b+d)$ is not the product of two primes.
Since all the info is condensed in $a+b+c=u$ and $b+d=v$, we may just be looking for a $k$ for each $v$ and $u$ such that $u+v=n$ and $v\ge 1$.
Consider three distinct primes $p_1,p_2,p_3$ which do not divide $v$. You want to find $k$ such that $$kv+u\equiv 0\pmod {p_1p_2p_3}$$
Since $v\in \Bbb Z_{p_1p_2p_3}^*$, this is always possible. Explicitly, any positive integer in the form $$k\equiv -u\cdot v^{(p_1-1)(p_2-1)(p_3-1)-1}\pmod {p_1p_2p_3}$$ works. For instance, $k=(p_1^np_2p_3-u)\cdot v^{(p_1-1)(p_2-1)(p_3-1)}$.


Which framework works best for Enterprise application testing in distributed environment?

Question: I am working in an enterprise with some legacy applications, which are quite coupled.
Integration test is thus very important. I am looking for a distributed testing framework, or a combination of them that QA team and development team can both leverage on. For "distributed" I refer to the many environments for testing, while a single application itself is not a distributed system.
The following criteria might not be the ideal model, but kind of requirement and expectation of the tool to be developed.
Such framework should be :
open sourced
community support to learn, maintain and extend :)
distributed
allow tests to be execute in multiple environments.
since test cases may change quite often, it should be managable to distributed those test into target machines with target codebase to run.
<code>I am checking out  [STAF][1] on this.
</code>
allow integration tests
I am looking into Camel testing. we have some existing  "simulator", "mock" to stimulate some applications behavior.
framework with easy-to-use dependency injection / mock will be very helpful..
with WEB UI, wich is a single place that can
<code>- all testing results are shown
- able to trigger test
- able to see testing definition
</code>
Human readable and configurable acceptance testing definition
Testing language should be in a readable DSL
      I wonder is framework like FitNesse a good choice as I did not figure out a way to test it distributed.
     For Citrus  I am concerning XML is hard to read
Some current frameworks
My team has been suggesting JSystem, while it is possible to distribute tests, there is no web GUI and
my major concern is its development has been stopped since 2009
I looked into many frameworks as mentioned,
Grinder - seems better suite web load testing?
JMeter- this seems to be closer, but also focused on load test?
more on background: most developers are familiar with JAVA and currently we use Hudson to run JUnit tests.
And finally I am also thinking a more conceptual issue, should xUnit test, integration test, acceptance test all being separated? xUnit test should be stick with code base? perhaps this worth another question, but with that in mind I am not sure I am looking for the right thing.
I will greatly appreciate if you can give me some comments on the thought / suggest some frameworks. Thanks a lot in advance.
Answer: I will suggest you to use Jenkins Framework.

Open source
Can be used for different environments
I myself working over Integration Testing using Jenkins so suggest you for this.
Web UI is very interactive.

Large variety of plugins is available and development is still on.
Write some ANT, MAVEN scripts you can get your job done through this.


How important is it to keep content above the fold?

Question: The leadership at my company is constantly pushing to make heroes/headers thinner and thinner so that we can push more and more content above the fold. Consequently the website has a very busy, un-modern feel and all the heroes/headers look like ad banners. But they really only care about click metrics. Any advice on convincing them not to be afraid of larger heroes, and valuing an appealing look and feel over just click metrics?
Answer: I believe this question falls into the category of something that is context sensitive (like everything else in the UX world), but for a while it was definitely something that people believed to be true, and then there were evidence to suggest otherwise.
You can read about examples on UX Myth #3 - People Don't Scroll (i.e. only stuff above the fold counts) and see examples of why people do scroll if there is reason to do so.
However, since this Myth was established (and busted) a while ago, you may want to test this against your particular product or service just to make sure that the reasons for doing this makes sense for your audience.
Answer: You could create mockups with color designs that show ways to highlight the areas they want to have increased clicks on while maintaining a more user friendly website that is modern. Having a busy website also distracts the user rather than drawing their attention to the desired areas, which is another good point to bring up with management.
In the end, if it's their decision, all you can do is try to show them why you want what you want and convince them why it would be better.
Another good point is for responsive development, small headers can be difficult to see on smaller screens that are unable to use the zoom feature on their device, especially for less competent users, so that could push users away, depending on the target audience.


Software to visually represent telecommunications networks

Question: I am working on some software tools used for the design and optimization of telecoms networks: routing, capacity allocation and topology.
To represent the network nodes and interconnecting links I currently use standard MFC calls to draw things like lines and ellipses using mouse clicks, menu commands and so on.
For the time being this has been an adequate means of graphically representating what the
network looks like, as I have been more concerned with getting the underlying algorithms right, improving efficiencies and so on.
At some stage I will want to improve the look and feel of the software.  Is anyone aware of any GUI software that is particularly suited to this purpose, open source or otherwise, that would be suitable for the network building stage?  The intention is to use something that is more slick than what I am currently doing, especially when it comes to (say) dragging nodes into the drawing area and setting their properties. Also of interest would be graphics to display bar charts representing link utilization levels.
Thanks in anticipation.
Answer: For looks, I think you must go for WPF. But the migration from MFC wont be that easy if you have a huge code base. Although GDI is said to be good, performance wise.


Can you add a specific link to IOS homescreen?

Question: I have a vbulletin forum I frequent in which I'd like to place a link to the "new posts" search on my homescreen.  Anyone familiar with vbulletin knows this is a url with search.php?do=getnew , once you access that URL it redirects you to a search ID which is cached for easy access later.  Thing is, you can't add that to your home screen as it wil just pull up the old search results rather than returning the newest posts.  I'd like to add a link to the new posts link on my homescreen but it seems there is no way to edit the homescreen links.
Comment: So what would the URL be? Maybe you should host your own .html file, and redirect to that URL when it gets hit?
Answer: Short answer: yes!
I faced the same issue and basically tricked my iPad, you simply turn on airplane mode, you don't hit the redirect, you store the "server not found" page on the home screen and you are done :-)
Hope you can now resolve your 4 year old question.
Comment: this is a terrific idea, thanks! this fixed a similar problem of mine on latest iOS (iPhone)
Comment: Is there a way to do this and still get the favicon used as the app icon? I used your tip and it worked, but a side effect is I no longer get the nice icon from the site (nodered.org).
Answer: Yes - this works just fine for many web sites.
For example, these two links work very well when saved to the home screen on iOS.

http://apple.stackexchange.com/questions?sort=active
http://apple.stackexchange.com/questions?sort=newest

Each will reuse an existing window and refresh the content to be sorted as specified (active versus newest) and they also work if you don't already have a "tab" open to this site on Mobile Safari.
Not all websites will allow you to embed these codes, so you might have to shoot off an email to the webmaster asking if they have an URL that will set the proper cookies or yield the desired results. This is the sort of technical thing most web sites will provide for users with the smarts to take advantage of - even if they decide to hide that URL from most of the users that are browsing the site normally.
Answer: Short answer: No!
There's only one possibility to add a website to homescreen: Tell the user to add it. It's also not possible to change the link for this.
So the user needs to navigate to your search.php and add this page to the homescreen.
Maybe you could write a webapp with dashcode which creates a page for new posts..?
Comment: The OP *is* navigating to the page he wants and is attempting to add it to the home screen, but the URL he's getting is not the one he navigated to (as is my case). The added home screen shortcut (at least in my case) ends with .org. Everything after that is chopped off for some reason. Turning off WiFi does seem to get around this issue. The only downside is you don't get the favicon icon in the shortcut when you do that - but you do get the whole url.
Answer: I was also wondering how I could create a Safari icon on the home screen of my iPhone with the http://vbulletin-forum/thread-name-new-posts.html URL, which will take me to the latest page in a forum thread.  The problem is when you go to that URL in Safari, it will redirect you to a URL for a specific page in the thread (e.g. http://vbulletin-forum/thread-name-page-number.html).  If you try to add that to your home screen, you are adding the URL for that specific page, not the "new posts" URL.  There is no way to edit the URL for an icon already on the home screen.
But I found a free app called App Icons that lets you create a Safari icon with a URL and put it on your home screen.  After installing the app, do the following:

Touch "Create Icon"
Under "Common Tasks", touch "Go to Link"
In the "TYPE URL" field, paste or type in your desired URL
In the "Go to Link" field, type in a name for the icon
Touch "Install" and touch "Install" again
Touch the square icon with the up arrow
Touch "Add to Home Screen"
Touch "Add" and a Safari icon with your desired URL will be on your home screen


sending a group message on my galaxy s3

Question: When I send a group message on my galaxy s3 software 4.3 other people in the group message receive the message as an individual message. How do I fix this so that all the people in message receive it as a group message.
Answer: You may be better off using Whatsapp messenger, it deals with group messages much better than using SMS.
Using Whatsapp everyone can reply to a message that you've sent and all participants can see each other's replies.
You can download it from here:
https://play.google.com/store/apps/details?id=com.whatsapp
Answer: Also remember all the recipients of a group message can also see every person you add to the conversation as well as their phone numbers. Like (1990clb) says try a messaging app meant for group mssg. , even google voice/hangouts has a great app that can include a couple (or) your entire contact list. I guess to remind them all about your upcoming surprise birthday party... Also allows u to video chat or make a call with the same group of ppl if texting becomes too confusing for your grandmother.

sending a group message on my galaxy s3


Where can I find a repair diagram for Sony SELP1650 lens?

Question: I dropped my Sony a6000 and the lens took the impact (SELP1650) rendering it useless. Is there a site where I can get an exploded diagram? I intend to fix this myself. Also, if anyone knows where I can source the broken parts I would be very grateful.
Comment: googling for "16pz50 lens" only returns links to your question - maybe that's not the correct lens model
Comment: Obviously it's the Sony Sel16pz50 model.google is useless hence my question to a better informed forum. I hoped.
Comment: http://www.dpreview.com/forums/post/51664794
Comment: I searched for Sel16pz50 and, again, found nothing.  Not sure why I bothered to keep going but, having established that the model number is SELP1650 I found [this](https://www.youtube.com/watch?v=VACGVOSG7a4) and [this](https://www.youtube.com/watch?v=XxPLQbQBcA0) which may be of help. I'll see if I can find a definition of "obvious" for you - as I don't think it means what you think it means. And if "google is useless" I have nothing but sympathy for the people who request 3.5 billion searches on it each day.
Comment: Stop searching you've only found what I have seen already like I said Google is useless in supplying an answer to this. I was hoping someone who had experienced this issue might be able to help. With a link to a drawing.Cheers
Answer: Indeed, claiming that google is useless is apparently an exaggeration. Assuming the lens is a model SELP1650, I found a service manual here: http://elektrotanya.com/sony_sal1650_ver.1.4.pdf/download.html . Even if it is not a perfect match, it may be able to help you. I have serviced perhaps 10 lenses over the years, and I have never had the benefit of a service manual. Although, the lenses I was servicing were old manual lenses, which are probably a lot easier than a newer electronic one. Good luck.
Comment: Maybe an exaggeration admit but I am proved correct again. The drawing you provided was for the alpha mount lens SAL1650. I will probably attempt to fix this without the manual. I needed the drawing to just identify which part was broken.Thanks.
Comment: Well then, perhaps Sony support is a better place for you to ask. It is probable that they only provide this information to authorized service centers, but it would not hurt to try.
Answer: For all those looking for the same information I found the parts drawing here
http://www.searspartsdirect.com/model-part/selp1650/0996/0500140/50041709/00001.html
Comment: Wow! You can actually buy camera lens _parts_ from the Sears Catalogue? Will wonders never cease! (_only somewhat tongue-in-cheek_)


Optimizations in quantum circuits

Question: In a paper called On quantum circuits employing roots of the Pauli matrices, I found this figure, where I couldn't understand the equality in the circled circuits. I need an explanation of how the circuits in the circle are equal with any rules used in reduction. Especially the CNOT underlined in red - How it is reduced?
Answer: For circuit equalities I find using quirk with the state-channel duality super useful where you setup the inverse of a circuit, see the identity in the amplitude display and then play around with the gates then on the left side.
In the given equality this is my thinking:

I'm going to ignore the equivalent prefix of the two circuits

this circuit is CNOT gates, that permute the subspaces and phaser gates (T / S are all just phasing the |1> subspace of the given qubit) - you can think about "commuting" the phase gates over the CNOT gates in two ways: 1) the CNOT control commutes 2) if you have the same CNOT even times then the CNOT permutations even out, so you'll have an equivalent circuit => this explains why the S gate can be commuted over to the end

Now, if we ignore the phaser gates for a second, we get this circuit (see in quirk state-channel duality to play around with)

And the question becomes why is this equivalent to

We can remove the identities, after which the question becomes:
Why is

equivalent to

this last one can be understood by the CNOT mirroring rule (rule VI in this paper):
adding two CNOTs is an identity

mirroring over the first CNOT results in adding the new CNOT

after which we can just commute the CNOTs to their places

I'm sure there's simpler explanations :)
Answer: The two CNOTs that have gone missing have been moved rightward until they reach the CNOT between the two top qubits. They are then moved through that CNOT, which cancels one of them out. The remaining one was then moved to the right side of the circuit using the fact that its control can travel unmodified through phasing operations (S, T) and paired CNOTs.

That being said, the decomposition you've relayed is not optimal. Because the two Toffoli operations share a target and a control, they can be merged into one Toffoli operation. Here's what that looks like:

And this can be decomposed into a circuit using four T gates (instead of eight) by using an ancilla:
Comment: You mean that the CNOT underlined in red is cancelled by the CNOT between the two top qubits. but sorry I haven't studied a rule that says that. Can you share any reference with that rule? I only know that if 2 CNOTs share the same target and same control, the 2 CNOTs give Identity gate. Thanks for help.
Comment: @monicamagdy just work out the truth table for the three involved bits to convince yourself it's the same.

Optimizations in quantum circuits


Watching Kerr Ring Singularity

Question: Can you see light from ring singularity from inside the Cauchy Horizon? In between 2 horizons space and time coordinate swaps places, so the inside region lies at the future. But after crossing Cauchy time starts behaving normally, so light from the ringulaty should be visible to an observer in this region.
Comment: You shouldn't really get hung up with the ring singularity, anything after the cauchy horizon is an unphysical mathematical artificat. In fact, there are infinitely many things that may happen beyond the Cauchy horizon, and the ring singularity is merely one of them, that we get when we assume the metric is analytic. This assumption is unphysical, because information about a given point can give you the full spacetime configuration, and that is not go well with notions like causality.
Comment: spelling: "ringularity" - quite good ;)
Answer: The answer is yes in the technical sense that in the Kerr geometry, there are lightlike geodesics that originate at the singularity and pass through any point inside the inner horizon (Cauchy horizon).
But it's a vacuum solution, so there's no light to see, and also no you to see it. There's evidence that perturbing it by adding any matter (even just the matter that initially collapsed to make the hole) leads to a spacelike singularity just outside the inner horizon, and no interior with a ring singularity. So realistic spinning black holes probably have the same causal structure as Schwarzschild black holes: you can't see the singularity because it's in the future.
(arXiv:1907.05292 is an interesting review article about this and other aspects of black hole interiors.)
Answer: If you want a representation of what an observer can actually  see "inside" a black hole (hint: it is probably more complicated than you think!), your options are very limited!
A good place to start with is Andrew Hamilton's Home Page.  Unfortunately he has not been able to provide the software for you to reproduce his work.
If you want to be more "hands on" and make your own views, then I think your only option is David Madore's page.  He provides a single-file c program that creates PPM images, but you will need to compile it yourself!  His black holes tutorial is very good IMO, and I would strongly recommend reading it.

Watching Kerr Ring Singularity


How to implement SSAO in Shader Model 3/ DX9?

Question: Ive read a few articles about SSAO, and i would like to implement it in to 3d engine at work, which runs on top of DX9. Can you give me an tips on getting the simplest implementation possible up and running using shader model 3, and how would you upgrade this implementation over time to tackle artefacts like haloing?
Answer: A talented programmer (Iq from from rgba) has written good articles:

ssao: http://www.iquilezles.org/www/articles/ssao/ssao.htm
global illumination: http://www.iquilezles.org/www/articles/simplegi/simplegi.htm
ambient illumination: http://www.iquilezles.org/www/articles/ao/ao.htm
Comment: This answer would be better if it summarized the key points you hope a reader will glean from these links, so that the answer still stands on its own even if the links rot away, as happened with the other answer to this question.
Answer: Check out this simple fragment shader implementation with explanation on why's and how's http://www.coniserver.net/wiki/index.php/Screen_Space_Ambient_Occlusion_Shader Although it is fragment/GL and not D3d9, it's simple as it gets, so you should be able to understand what you need to do.
Comment: This link now leads to something completely unrelated to the question. This is why we recommend against link-only answers.