What did Confucius mean by reflection and imitation?

Question: Confucius said that there are 3 methods to learn wisdom: by imitation, experience and reflection.
Experience is clear, what about imitation and the most unclear - reflection?
Answer:
"By three methods we may learn wisdom: First, by reflection, which is
noblest; Second, by imitation, which is easiest; and third by
experience, which is the bitterest." -- Confucius

People try to imitate the actions of people of knowledge, in hope to understand what the wise know. Reflection is for the most intelligent men. They hear the thoughts of wisdom and gain direct insight into the nature of things (which is a 1st class experience) from reflection. The other two men learn from repeated imitation or hard experience.
Reflection is defined as "thought occurring in consideration or meditation". Reflection is one of the qualities of consciousness. Consciousness is like a mirror that reflects reality as it is. To regain such ability, one must meditate and cleanse his awareness from all garbage of nescience. Then his consciousness is unspoiled and can reflect reality.
Noble people don't blindly imitate others or bash their heads against reality. They educate themselves and learn reality from reflection. Of course, they go through all kinds of experiences but never like a fool; they reflect and learn from their experience. They may even repeat the process of some wise men and reflect upon it.
It is important to understand the difference between reflection and reflexion. Reflection is of conceptual nature. When you reflect on your thoughts or memories, that act is called reflection. You can sit in your chair and reflect on the object of the sea or forest road - something that's separate from you.
Reflexion is a reflection of immediate experience - something that you're dealing with right here and now. It doesn't rely on thoughts or memories but arises from direct experience of something that you have in your space. In reflection, you don't think about the objects of consciousness but experience them directly.
References
R. G. de S. Wettimuny, The Buddha's Teaching and the Ambiguity of Existence
Comment: "Tell me and I forget,
Show me and I remember,
Involve me and I understand" - Xunzi
Answer: Confucius discusses reflection a lot in the Analects especially as a means of self audit. More than anything its a tool to make sure you stay on the right path, keep improving in the right way, etc.
I cant find the exact location of this quote because the translations vary but the most powerful one i remember is this one:
"When we see men of worth, we should think of equaling them; when we see men of a contrary character, we should turn inwards and examine ourselves."- https://sourcesofinsight.com/confucius-quotes/
So the first guy, you want to imitante which makes sense. For the second guy, whatever this guy is doing that you don't like, you need to do an honest self assessment and make sure you're not secretly also like him. That's reflection and the way to help make sure you're going down the good path. Maybe thats why its nobelest because it takes a constant and very honest effort.


Is quantum field theory defined by its lattice regularization?

Question: One statement I've heard many times is that QFT is "defined" by the lattice, or that the "only" definition of QFT is on the lattice (when such definition exists, e.g in pure Yang-Mills theory). I've heard that from many people I respect, but I have my doubts. Specifically - the lattice is an algorithmic definition of those quantities that can be calculated in Euclidean spacetime. As I said in my answer to this question, this is a proper subset of all physical quantities you may be interested in calculating in general, and many physical situations do not have Euclidean formulation. Is there some response to this objection I am missing, or am I being naive somehow?
Comment: I think you are correct.  However, note that in the existing mathematical literature you almost always have to impose a condition called reflection positivity (roughly that the analytic continuation exists and is nicely behaved).  So while the lattice definition might miss certain physically reasonable situations, the other more esoteric constructive field theories most certainly miss a lot more.  Perhaps there are some workarounds though, i'm sure some lattice field theorists have worked on that.
Comment: I agree that it is probably the best approach to do calculations in non-perturbative QFT, but for example it is not clear to me it is the right way to clear up the mathematical foundations of the subject. Constructive field theories have their own issues, I agree.
Comment: Moshe was one of the top prolific people on this site a few years ago. But now this site only acknowledges him with the sad hypergeneric pseudonym of "user566". This is what you get for using link/name autoconversion instead of explicitly writing the username in clear text. Thanks SE!
Comment: In fact just by the fact of warning of this fact, after many years of being on this site, I just got my daily vote quotas limited
Comment: related: https://physics.stackexchange.com/q/705106/226902
Answer: I can only guess that "QFT is defined on the/a lattice" means that certain infinities in Lagrangian QFT come from defining QFT on a smooth (Lorentzian or Euclidiean) manifold, while many physicists suspect that the "smoothness" is an approximation that breaks down on a certain length scale (like the Planck length), and incorporating the true - quantum - nature of spacetime will cure the QFT-infinities.
In this sense, defining QFT on a lattice is a better approximation than defining QFT on a smooth manifold.
I would object, however, that there is no single, unifying framework for doing QFT, Lagrangian QFT is only one approach. There is of course algebraic/local/axiomatic QFT that does not have any problems to define QFTs on globally hyperbolic Lorentzian manifolds at all - it does have a problem with the construction of interesting models, but in the last two decades there has been some progress.
There has been one specific approach that elevates operator product expansions to a defining property, an axiom, of QFT, it started somewhen around this paper:

S. Hollands, R. M. Wald: Quantum field theory in curved spacetime, the operator product expansion, and dark energy

An introduction and a toy example can be found in this thesis:

Jan Holland: Construction of operator product expansion coefficients via consistency conditions

This is a very new approach, which I cite mainly to illustrate that there is a lot of room left for the development of an unifying, axiomatic approach to QFT which, when found, may change our thinking about QFT significantly.
(I'm also aware of the fact that many people in quantum gravity think that everything about QFT is said and done: well, shoot me.)
Comment: You may be surprised how many people working on string theory would sympathize with your sentiments (roughly: QFT is hard and mysterious), especially now that we have discovered that we are working on QFT after all. As for the question of definition of QFT, I think the idea is that there is an algorithmic way to calculate any quantity to an arbitrary precision using the lattice. It is the "any quantity" part I don't understand.
Answer: Moshe, I hope others will give their answer and I would also like to read it.
But I agree with you that the Euclidean calculations are "only" good for some rather important quantities that are easy to be calculated in the Euclidean setup - and they should be continued to the Minkowski spacetime. Some time-dependent questions surely make it more natural to try to solve things directly in the Minkowski spacetime. However, the full set of on-shell scattering amplitudes or off-shell Green's functions is a very important set of observables and, in some sense, contains "all the dynamical knowledge" about the theory. And this dynamical knowledge is much more naturally calculated in the Euclidean setup which is why people like me wouldn't be afraid to say that the Euclidean calculations are more fundamental.
Somewhat independently of that, there's the question of lattice QFT. Lattice QCD is usually meant to denote the Monte Carlo calculations etc. and they're calculated in the Euclidean spacetime. However, you may also discretize the spatial coordinates only, do the Hamiltonian lattice QCD, and keep the Minkowski space. I would separate the Euclidean spacetime from the latticization as two different and largely independent procedures.
Discretizing spacetime is a straightforward procedure to approximate a real theory if we want to calculate it on a digital computer. Many people think "discretely" and they have a problem to distinguish the reality from the computer models. That's why they think that the discrete models are the "real thing", and lattice QCD is their definition of choice. Of course, there is nothing scientific about this attitude.
Nature has no trouble to work with continuous quantities - and fields that depend on continuous variables (and even infinitely many variables, if necessary) - and even the physicists, who are much more limited than Nature, have learned many mathematical ways that allow them to directly calculate the results in the continuous spacetime.
Needless to say, some properties of the system change when the spacetime is Wick-rotated to the Euclidean one (or back); and when the spacetime is discretized. The first transformation changes the reality conditions for the spinors and produces various problems with the fermions. The second transformation - the discretization - also produces its related problems with the fermions, the fermion doubling problem etc. Moreover, it breaks the continuous translational symmetry, and because the supersymmetry anticommutes to translations, lattices inevitably break (most of) the supercharges, too.
Of course, if one views supersymmetry as a key property of a theory, its loss is a huge problem and mostly invalidates the idea that the lattice definition is "more real" or "more fundamental".
To summarize, the latticization is just one particular way - one of the conceptually simplest or most straightforward ways - to define a theory that flows to the desired quantum field theory at long distances. And some people want to confine their reasoning into the lattice because they believe that their duty as scientists is to behave as similarly to a mindless digital computer as possible. (Even computers may deal with non-lattice approaches, but that requires them and the programmers to learn some serious maths and not just mechanical operations on a lattice.) As far as I know, there is no scientific justification of the idea that the "right" definition of a field theory should ultimately boil down to a lattice.
Answer: Lattice QCD is define on a grid with spacing $a$, and where on the edgelinks there are gauge potentials.  The reciprocal lattice spacings are momentum cut-offs, and must be set so that the heaviest quark mass is $m_q~>>~1/a$.  So the lattice spacing is not entirely arbitrary.  A discrete difference in gauge potentials defines the fields
$$
F_{ij}~=~(A_j(x')~-~A_i(x"))~-~(A_i(x"')~-~A_j(x"'))~-~g(A_j(x')A_i(x")~-~A_i(x"')A_j(x"'))
$$
where the coordinates are illustrated in the figure.  The internal gauge indices are implied.

This evaluates the gauge potential around a square or plaquette, which is in a large grid.  The field is then evaluated as one evaluates a magnetic field as $B~=~-\nabla\times A$ as evaluated in the area of the plaquette.  This means the Lagrangian for the quantum system is periodic, and is similar in some ways to a Bloch potential.  The limit that one takes the lattice spacing small enough the funny periodic nature of the Lagrangian due to the lattice plays an insignificant role.  This is one reason the inverse lattice spacings have to be smaller than the quark masses.
So the lattice is a finite element approach to QFT, which is set to the cut off scale of the theory.  Lattice QCD is worked because the nonlinear nature of the theory makes explicit calaculations exceedingly difficult, particularly due to inverse screening.  This make the computation of the hadron spectrum tough where one does not has asymptotic freedom to work with.
Comment: I think that any sort of inquiry into who votes on answers and why is antithetical to the way I understand Stackexchange sites to work, which is to let the community vote and appeal to its collective judgment to find good answers. (Whether this voting is actually efficient at finding the good answers will depend a lot on whether the community contains enough competent people, but in principle I think it's a nice idea.)
Comment: @Moshe, it just ticks me off when I see an individual being targeted in this manner. Now you may or may not see this answer as being entirely in line with your question, but the very first para gives a very nice response for why a lattice formulation is natural. After that he goes on to explain how observables are calculated in the lattice approach. Yes, he does not directly answer your query about the Euclidean formulation you mention in the *details* of your question. But his answer is by no means "not useful". What is amazing is that despite this targeted down-voting, @Lawrence has (contd.)
Comment: @space: I disagree, just stating a bunch of facts in the general vicinity of the topic mentioned does not make a useful response (there are also some mistakes). I haven't voted this down, but I don't see such action necessarily as ridiculous or mean spirited.
Comment: As for the reputation, I really dislike this system. It is clear that just by being persistent you can increase that silly number, it is far from being an indication of quality of anything.
Comment: OK, I will fess up: I downvoted this. Mostly because it tries to answer the question "what is lattice gauge theory," which is not Moshe's question, and which Moshe already knows perfectly well. Also, because it says things that are false, like that quark masses must be larger than the inverse lattice spacing. I downvote a lot of things; no one should take it personally, I'm just trying to chip in to sorting out the good answers from bad. No judgment of the person writing the answers is implied.
Comment: @Moshe. It is not ridiculous or mean-spirited when it happens only on occasion and perhaps with (or even without) some justification. When it happens with every single answer an individual gives there is obviously a pattern. And no, the reputation is not as useless a system as you feel. But that is a discussion for meta.
Comment: This is clearly a discussion for meta, but in my mind downvoting is part of what I can do to clear things up for other users, and I am glad I can do it without it being too painful or time consuming. Also, trying to sort out every little disagreement is not a good way to live in peace, or have fun. This applies to this answer, and to the meta discussion as well.
Comment: WTF is the down-vote for? Jeebus man! Anonymous coward show your face!
Comment: (contd.) already accumulated an impressive reputation - which I know, means "nothing" to some. But this has been happening for every one of @Lawrence's answers. Downvotes with no explanation. Some on exceptionally good answers. It seems like a determined push to discourage someone, who clearly has a deep understanding of many complex issues, from being a useful participant. The only way to out those behind such behavior is to call out them out with old-fashioned methods. And it clearly seems to be working. Cheers!
Comment: As for the incorrect aspects of his answer, why don't you point them out so they can be subject of discussion? Or is that too trivial a task for you?
Comment: @space: It wasn't me but: A. This is a random collection of mostly (but not entirely) true facts, not adding up to a response addressing the question. B. Relax, man.
Comment: @Matt thanks for the clarification. The only reason I asked for one is the many consecutive down-votes @Lawrence's answers have been getting, despite in some cases, being of higher quality than other answers to the same question. Also it would be great if you could clarify for me why the statement about quark masses and inverse lattice spacing is incorrect. That is not something obvious to me. Or perhaps this just shows my ignorance of the subject.
Answer: Unless someone can show how to come up with chiral fermions and avoid the fermion doubling problem over a lattice, it's clear lattice regularizations can't cover everything. That person would have to bypass the Nielsen-Ninomiya theorem.
Comment: Maybe, what I'm asking is independent though - is the lattice an algorithmic definition of pure YM theory?
Comment: -1: Wrong interpretation of a theorem.
Comment: @RonMaimon how would you interpret it? the Nielsen-Ninomiya theorem implies that for simulating Standard Model phenomena on the lattice at least one of its assumptions needs to be relaxed, or there would be fermion doubling on the lattice.
Answer: As far as I understand, a lattice formulation makes it possible to employ "naturally" the famous Wilson's reasoning about scales and "effective" theories. Factually there is nothing physical in this QFT "definition" since the lattice step is arbitrary unlike in the Wilson approach to the critical phenomena. I would call it a "fog" to hide real physical problems in.


Why do my dwarves climb trees?

Question: My base started on a mountain. I dismantled the wagon and made a large meeting area on two cliffs below. However it seems like that my units like to climb trees. In fact, one of my miners was found stuck in a tree rather than digging but eventually went down. I've searched dwarffortresswiki but only came across Adventure Mode. Is this a feature?
Comment: What version is this in? There've already been some additional changes to the climbing logic between 40.01 and 40.08.
Comment: @Raven I'm using the LNP for linux, 0.40.06r4
Comment: Maybe they really don't want to swim in water anymore...
Comment: Climbing is a new feature valid for adventure and fortress mode.
Comment: Not sure but I have this problem as well. And it's a very big problem for me. At some point, I noticed a lot of work stopped being done. And a week later, I noticed a lot of dwarves dying from dehydration. This was very confusing to me, cause they were all found to be stuck in trees. And when I say a lot of dwarves, I'm talking 30 at a time. All stuck in trees all over the place for no reason. I don't know why they climbed the tree, nor do I know why they can't get back out. But they're doomed to die up there. They won't leave no matter what.
Answer: Climbing trees is meant to be a feature if your dwarfs can't get to their objective any other way. However, their aggressiveness in climbing up a tree and refusing to come down is a known bug. Often changing their labors around temporarily, or temporarily giving another dwarf the job they refuse to do, is enough to snap them back to reality. Sometimes they're stuck up there forever. This is DWARF FORTRESS!
Comment: @remyabel The bug tracker comments also indicates that creating a _burrow_ and assigning the stuck dwarf to that might make him come down...
Answer: Its a feature. On the wiki it says:
Trees can be climbed in both fortress and adventurer mode. In densely wooded areas, the overlapping tree crowns can form a continuous canopy that can be traversed by walking, climbing and/or jumping. Both types of branches provide floor-like support for walking, but twigs are too frail to support the weight of a dwarf. All kinds of trunk tiles are treated as solid barriers, except trunk tips - they can be walked and jumped over.
I couldn't find any source where this is concerned as an issue so its not really a problem.
In adventurer mode you can climb them yourself by pressing H to first hold on it and then moving by pressing the movement keys, but I guess you already figured out.
"tree" on dwarf fortress wiki
Comment: You have now found a source, mentioned right here, so it's now really a problem.
Answer: I think this is a feature and DF treats leaves and branches as normal pathable area. Nothing extraordinary or harmful about it, or at least I haven't encountered a case that would hurt (me).
It makes for funny situations in combat - I once had a squad of dorfs chasing a wereelephant through several trees, until it got too tired and slowed down.
Answer: This just happened to me, for some reason no one was chopping the tree and the staircase wasn't working so I just spawned in some water on the tree and it pushed the dwarf off it and onto the ground.
Comment: But do you know what caused it ?

Why do my dwarves climb trees?


In what ways does the transfer of heat affect bond stability?

Question: It is to my understanding that certain amount of joules may change an element's/compound's physical state given a certain temperature. How does a certain added number of joules affect the orbital of a bonded electron ( I realize my question's ambiguity by not stating a specific type of bond).
Answer:
How does a certain added number of joules affect the orbital of a
  bonded electron

If you pump enough energy into an element\molecule you can promote an electron from one orbital to the next highest.  For example, the hydrogen atom has a single 1s electron, put enough energy in and you can promote that electron to the 2s orbital.  That means that, on average, the electron would spend more time further away from the nucleus.  In molecules, there are numerous "sub-levels" between each (molecular) orbital.  These "sub-levels" relate to rotational and vibrational energy.  So as you pump energy into the system the molecule will rotate and vibrate more violently.  If you put enough energy in, the bond will break and the atoms connected by that bond will fly apart.


Changing grub purple interface to CLI

Question: I want to see all everything in booting like what is being loaded and all instead of grub purple Interface.. So is there any way to enable text kind of mode and disable that purple screen ??
Comment: If you press any arrow key(at the time of booting or shutting down) then your purple screen will change and will show you all the processes which are starting..
Comment: yeah thanks , its so simple but am new with it..
Answer: Permanent
Type sudo gedit /etc/default/grub. Look for the line that reads:
GRUB_CMDLINE_LINUX_DEFAULT="vesafb.invalid=1 splash quiet"

remove the splash quiet part (yours might be different, so don't change anything but that). Save the file.
Now type sudo update-grub. Reboot, no more purple screen.
Temporal (one time)
In the boot menu, press E. Look at the end of the line starting with linux for splash quiet. Remove splash quiet (do not touch anything else) press Ctrl + X. No purple screen.
Comment: we cant change background in grub as we can do in berg??
Comment: @Sushantp606 ask that in another question....

Changing grub purple interface to CLI


Print job stops when given serial command

Question: I want to access the bed temperature of the 3D printer. I am able to get the temperatures using serial connection (Thanks to Demetris's help (Access Temperature sensor data of 3D printer via Serial connection)). The problem that I am facing now is that as soon as I give the command, I get the temperature values, however the print job stops. Is there a way around it? I want to get the temperature values as the print job goes on. TIA!
Comment: I think it would be best if you reverted your edit, since questions about programming are not on-topic on this site. "Why does my printer stop printing when I connect over serial" makes a reasonable question, but "Here's my code and please make it do what I want" is not (this would not even be accepted on the programming SEs).
Comment: Thanks Tom. I am not looking for a code solution from you, I just meant that this is what I am doing and just needed a point in the right direction from here since its a little difficult for beginners to interpret everything correctly right from the start. I was not asking you to make it do what I want to do, I can do that myself. I think you misunderstood. Anyhow, thanks for your help.
Answer: Opening a serial connection to your printer will usually reset the microcontroller, stopping the print.
The serial interface has a line known as request to send (RTS) that indicates to the microcontroller that the computer is ready to receive data. When the port is closed, this line is HIGH (indicating the computer is not ready), and when you open the serial connection the line goes LOW (indicating the computer is ready now) and the transition from HIGH to LOW triggers a reset.
There are a number of ways to prevent this:

In software: disable hang up on close (HUPCL). This prevents the RTS line from going HIGH after you close it, allowing it to be subsequently opened without causing a reset. However, this does not work for the first attempt (the first, initial connection still causes a reset). How this is configured depends on your software/driver set up, but it is widely supported.
In software: disable the RTS line from going LOW in the first place. I'm not sure if this is readily possible with common serial drivers.
In software: modify your workflow to always keep the connection open, preventing the associated reset from happening.
In hardware: your printer's board will have some circuitry on there that translates the RTS line transitioning from HIGH to LOW to trigger a reset, usually this is implemented in the form of a single capacitor between RTS and RST. RST is normally pulled high with a pull-up resistor (on the order of 10k or so), and when RTS transitions to low the capacitor briefly allows some current to flow, pulling RST low. One way to prevent this is to include a stronger pull-up resistor that overcomes the current drain associated with the RTS line going LOW. DisablingAutoResetOnSerialConnection suggests using a 330 Ohm resistor between VCC and GND.
In hardware: desolder the capacitor mentioned earlier.
Comment: Thank you Tom for your very detailed and informative reponse. I am very new to this field. I am trying to access the  bed temperature of 3D printer using a simple python code and sending M105 command. Could you please help me with this?
Comment: @TomvanderZanden I thought that serial communication was limited to a single connection between the bus and software. If you are using a serial connection to run the printer and attempt to push a command, you risk overriding the previous connection. So, potentially, your best bet would be to use slicing software with a wrapper API. Something like the Cura Engine might work like this.
Comment: I made the assumption that he was printing from SD, otherwise attempting to access the serial interface during a print would be insane as it is indeed limited to one concurrent connection in any reasonable implementation.


Can RGB screen color exist in real physical world?

Question: For example the bright royal blue color; R0 G10 B220, HEX: #000ae1. I know this color cannot be printed nor painted. But can this blue color exist in the real world other than on a digital screen? For example the aurora in the sky, or a rainbow in the sky, or a blue glass bottle?
Comment: The question may be a nonsequitur.  Humans only see 3 colors, based on the cone cells in their retinas.  Whether a color can be printed or painted does not change this fact.  In addition, the 3 colors that we can see do not constrain in any way the colors that can exist in nature.
Comment: Remember that our vision (and that of RGB screens) are limited to the visual spectrum, which is just a very small part of the electromagnetic spectrum. Since photons with any frequency in the spectrum can be produced, you could have colors that you can't even see with your eyes, and not because of that they stop being real frequencies of light.
Answer: The colours we experience come from photons hitting our eyes and triggering the right amount of activity in different kinds of cone cells. So any source of photons that triggered the same pattern as #000ae1 on your screen triggers would be the same colour. There are presumably many physical processes beside computer screens that could do that, but finding "ready made" examples might be tricky.
We typically only have three kinds of cones mediating our color perception (roughly, we integrate spectral radiance with three different sensitivity functions to get the response $r_{red}=\int L(\lambda) x(\lambda) d\lambda$, $r_{green}=\int L(\lambda) y(\lambda) d\lambda$, $r_{blue}=\int L(\lambda) z(\lambda) d\lambda$ somewhat like in the CIE system). Since this compresses a high-dimensional spectral space into a few responses, there are many spectral radiances that give the same visual response.
However, most objects we see in everyday life reflect or scatter light rather than emit light. This tends to make very pure colours rare, and contribute to pigments working differently from computer screens (pigments work by reducing the re-emission of photons of certain wavelengths giving us subtractive colouring, while screens and stage lights work by adding photons of certain wavelengths giving us additive colour). Since reflected light also picks up colour from the surroundings and our brains do a lot of nontrivial guesswork about the "real" colour this can really make it hard to imitate a particular colour stimuli.
The easiest way of getting #000ae1 is likely some emission or filtering process. An aurora produces a spectrum dependent on particular emission lines of nitrogen and oxygen, so unless we are lucky and they have some combination that exactly fits, auroras are unlikely to do it. Rainbows give a spectrum of sunlight overlaid on the background light: they tend to not be that strongly saturated, likely not getting close to royal blue unless there was a really black background. A blue glass bottle with the right colour might well filter sunlight into royal blue.


Laravel 5 : how to acces in a field on the hasMany table?

Question: i have two models linked with hasMany to many relationship and there are my tables structure
clients = id|title...etc
roles = id|title...etc
client_role = id|client_id|role_id|desc

everythings works great
now i want to access to the desc field on the client_role table how can i do that?
i tried
$client =  Client::first()->roles()->desc
//nothing returned!
$client =  Client::first()->desc

but nothing ! please help
Comment: Post your model code
Answer: You have to load the columns of your pivot in the model relationship (Clients, for example):
return $this->belongsToMany('App\Role')->withPivot('desc');

Then you can call the column in the pivot like this:
foreach ($clients as $client) {
    echo $client->pivot->desc;
}

Answer: In your Clients model have:
public function roles() {
    return $this->belongsToMany('App\Clients');
}

In your Roles model have:
public function clients() {
    return $this->belongsToMany('App\Roles');
}

Then from your controller:
$client =  Client::with('roles')->first();
dd($client->roles); // Laravel Collection


Balanced ±1-sequences with no zero partial cumulative sum

Question: Let $S_n$ be the set of all sequences consisting of $n$ each of $\pm1$:
$$S_n=\{[s_1,s_2,\dots,s_{2n}]|s_i=\pm1,\sum s_i=0\}$$
Let $T_n$ be the set of sequences in $S_n$ with no partial cumulative sum zero:
$$T_n=\{[s_1,s_2,\dots,s_{2n}]|s_i=\pm1,\sum s_i=0,\sum_{i=1}^j s_i\ne0\ \forall j<2n-1\}$$
What is $|T_n|$? And more importantly what's an elegant way to explain the solution?
Comment: Hint: for $n>1$ we know that the last two entries must be the same (else deleting them would give a subsequence that summed to $0$).  Let's say they are both $1$.  Then the previous sequence has exactly two more $-1's$ than $1's$ so we can apply the [Ballot Theorem](https://en.wikipedia.org/wiki/Bertrand%27s_ballot_theorem).
Comment: Your formulas never say anything corresponding to the "equal number of $1$ and $-1$" of the title.
Comment: @MarcvanLeeuwen I fixed that already!
Answer: Here is another approach. $s_1\ne s_{2n}$, otherwise the cumulative sum would be zero somewhere. Thus there are two choices for $s_1$; without loss of generality say it is $+1$. Then the remaining $s_i$, $n-1$ each of $\pm1$, must be arranged so that the subsequence $s_2,\dots,s_{2n-1}$ has no negative cumulative sum. By definition, the number of admissible arrangements is the Catalan number $C_{n-1}$, so $|T_n|=2C_{n-1}$.
Answer: There is an elegant way to identify this with the Ballot Theorem. Let $a_i$ be the partial sums of the $s_i$. That is, $a_{i+1} = a_i + s_i, a_0=0.$ Consider the sequence of points in the plane $(i,a_i)$. They form a path from the origin to $(2n,0)$ that never crosses the $x$-axis. Now rotate and scale the path so the origin is fixed but now ends at $(n,n)$. Each step is now $(0,1)$ or $(1,0)$ and the path never crosses the line $y=x$. This is the ballot problem.


Is there a keyboard shortcut to start a comment on a Trello card?

Question: There's a shortcut for nearly everything else, and since some of the shortcuts have changed (a is now m, even though both work, for example) I wonder if there is a shortcut to start a comment on a currently open card.
Comment: They so need this.
Comment: Inspect the page source on a Trello card page and search for "accesskey=". Do you see any HTML elements relating to starting a comment that include an accesskey attribute? If not, it is pretty easy to add keyboard shortcuts to a web app using client-side javascript.
Answer: Unfortunately not, though the shortcuts help page will be kept up-to-date as new shortcuts are added.
Answer: Although there is no shortcut for this available - on Chrome 55/Windows 10, with a card already open, use CTRL+L (or ALT+D) to go to location bar and then hit Tab. Cursor will land on Comment text box.
Answer: This post is currently the top search result on Google so here is an alternative (albeit still indirect) method:
With the card open, press E (shortcut to edit the description), then TAB four times. This should put you directly into the new comment text box.
Comment: Sometimes you need to press `TAB` more than four times, when there are images or documents.


devel module use anonymous user as author in generate content?

Question: i have been created 'job' content type, i used 'Devel module' to generate content of 'job' type, but in some 'jobs' its taking anonymous user as a author, but i don't want anonymous user as author, so what should i do to avoid anonymous user as a author?
Answer: Answer for you question is Yes it do,and you can resolve your problem  with following solutions:
The First solution is

Install the views, views_bulk_operations, and admin_views modules.
Go to the content listing (admin/content).
Filter the results to get the nodes you are interested in.
Check the checkboxes next to the node (there is also an option to select all).
Select "Change author" from the operations dropdown and click the "Execute" button.
Select the user you want to change the author to and click the "Next" button.

Admin views uses views bulk operations to override the default drupal administration views with something a lot more useful.
And also another solution is using bulk author update module
Comment: Can you be more specific about your " Yes it do"? I.e. what you mean by the "it" in it?
Answer: If you first set your permissions so that only authenticated users are allowed to create content of type 'job', then the Devel module should not be able to create this kind of content. At least that is what I would expect.
However, as per Devel generate not respecting node create persmission (which dates from 2009 and is still active), after tuning your permissions, Devel doesn't seem to work like that. Maybe not the answer you would want to get, but I'm pretty sure that this is the explanation of what happens.
Possible workaround:
I would use the Rules module and create a custom rule that looks like so (in Rules Export format):
{ "rules_change_node_author" : {
    "LABEL" : "Change node author",
    "PLUGIN" : "reaction rule",
    "OWNER" : "rules",
    "REQUIRES" : [ "rules" ],
    "ON" : { "node_insert" : [] },
    "IF" : [
      { "node_is_of_type" : { "node" : [ "node" ], "type" : { "value" : { "job" : "job" } } } },
      { "data_is" : { "data" : [ "node:author:uid" ], "value" : "0" } }
    ],
    "DO" : [
      { "data_set" : { "data" : [ "node:author" ], "value" : [ "site:current-user" ] } }
    ]
  }
}

Some more details about what the above Rule actually does:

Rules Event: After saving a node.
Rules Conditions:

Check if the author's uid = 0.
Check if the content type is Job.

Rules Action: Update the node's author (i.e. to the user using the Devel module).

If you have the Rules UI enabled, you can simply import the above rule in your own site. If you want to use it for another content type, first adapt the machine name job prior to trying to import this rule (to avoid the import would fail if you don't have a Job content type).
PS: if you've configured your permissions that you do not allow anonymous users to create nodes of type 'Job', I think it is reasonable to assume that it must be that these kinds of nodes were created using Devel.
Comment: I had done whatever u said but still devel is generating content having anonymous user as author.
Comment: @user66287 : can you first let me know if what I had included in what is now [revision 2](http://drupal.stackexchange.com/revisions/213170/2) of your question is yes or no a correct understanding of your question? If so, consider performing a rollback to that version (using the rollback link within the revisions history next to revision 2). Additionally, can you be more specific (= add more details) about the "I had done whatever you said", especially to which permissions you have used (disallowed) for anonymous users.
Comment: i have set permission to create job to authenticated user only but still its using anonymous user as author.
Comment: by default anonymous user have permission to view comments,view published content , i had not changed any permission not added any type of permission other than this.


Rail stat generator with Rails 3

Question: It is possible to use Rail_stat_generator(https://github.com/lmanolov/railstat) with Ruby on Rails 3? What should I do to install it and make it work? If it is not possible, what any open source analytics apps would you suggest?
Answer: I think that you may run into problems using that in Rails 3, seems kinda outdated.
I would highly recommend using an external tool, like awstats for that job.
http://awstats.sourceforge.net/

Rail stat generator with Rails 3


IP in League of Legends

Question: How is Ifluence Points awarded in league of legends. I understand when one wins he gets more IP and if the stats are better during the game they get more. But how does one become able to "farm" or get the most IP possible and why?
Comment: [These](http://gaming.stackexchange.com/questions/29606/how-much-ip-do-you-get-for-winning-losing-games-in-the-various-modes-maps) seem [related.](http://gaming.stackexchange.com/questions/23852/is-ip-gained-based-at-all-on-performance)
Answer: There is a first win of the day Bonus every 22 hours which you should get as fast as possible (so you can reset the timer sooner). You can play a coop vs AI match to ensure you will get it as fast as possible. This bonus gives you an additional 150ip.
This is the first and most important thing you need to consider.
You can see every IP reward here: http://leagueoflegends.wikia.com/wiki/Influence_Points
If you are interested in farming IP then play dominion a lot!
The games are shorter and you get bonus IP for finishing the fast. (You have to try and win a lot though). If you win in under 20 minutes you actually get more IP (unlike any other mode in League of Legends). Also as you can see dominion has the highest base ip reward in the game. Summoner's Rift is only better as the game lasts longer..
Note: Something that COULD possibly work for Ip farming if you don't care about defeats in dominion would be to have 4 friends with you and lose dominion on purpose. After 5 minutes the game would end and you would get the minimum amount of IP. But I suspect if you can lose 4 times in 20 minutes you would get more IP than winning 1 time in the same time.
But please note that you should never do this when you use matchmaking as you are ruining your teammates game. It's bad enough that you ruin your opponents game (although I think everyone can appreciate a 5 minute free win in dominion.)
Comment: free wins are never fun
Comment: @Paralytic I didn't say they are fun and I didn't say it is worth doing this. Personally I think the best (and most honorable) way to get lots of IP is to try to Win dominion games. That's all. Losing them on purpose could result in you getting more ip in the longrun but its definitely not fun for anyone. Like I said you actually ruin your opponents game (but noone complains about free ip if you think about it.)

IP in League of Legends


Mingw-w64 debugging & profiling : incomplete call stack

Question: I am using mingw-w64 4.6.3 for compiling under windows.
When debugging code in QtCreator, I have no proper display of the call stack (?? is displayed instead of the caller list). The current function name is properly displayed, and the local variables are also working.
Also, when profiling with Very Sleepy, I cannot get information about the callers in the function statistics.
On the other hand, when compiling with MinGW 32 bit (4.4), everything works well (debugging and profiling).
In both cases, I compile with -g and link with -Wl,-s
Do you have any idea why the call stack is not available when debugging with MinGW-w64?
Thanks,
Etienne
Answer:
-s: Remove all symbol table and relocation information from the executable.

Remove -Wl,-s.
https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html


Phase and group velocity calculation

Question: I have a wave described by $A \sin(k_x x) \exp(i(k_y y− ωt))$. This wave is propagating in $+y$ direction. However its angular frequency is given by $k_x^2 + k_y^2 = (w/c)^2$. If I want to calculate phase and group velocity does it mean that I only use $k_y$, because the wave is travelling in that direction? For example $v_{\rm p} = \omega/k_y$
and $v_{\rm g} = d\omega/dk_y$?
Answer: The phase velocity is the easiest place to start. Ask yourself what is the definition of a wavefront, and then how fast the wavefronts are moving.
Your wave has the form
$$
f(x) e^{i(k_y y - \omega t)}
$$
where $f(x)$ is some function of $x$; in this case $A \sin(k_x x)$. So you have a wave travelling in $+y$ direction as you say, and all that $f(x)$ is doing is saying that the amplitude of the wave is a function of $x$. I hope this is enough to make it clear to you that the phase velocity is indeed $v_{\rm p} = \omega/k_y$ since this is the speed at which the wavefronts are moving. (A wavefront being a locus of points at constant phase of the wave).
Once we have the phase velocity at each $\omega$ and $k_y$, the group velocity follows. To see this, consider a pair of waves of the type under discussion, one at $k_x, k_y$ and one at $k_x + dk_x, \; k_y + dk_y$. Add the two waves together, and you should find you have a fast oscillation and a beat pattern envelope. That envelope moves at speed $d \omega / d k_y$. Using the dispersion relation you then get
$$
\frac{d \omega}{d k_y} = c \frac{d}{d k_y} \left(k_x^2 + k_y^2 \right)^{1/2}
$$
and to carry out the differentiation you would need to know how $k_x$ and $k_y$ are related for the waves you are considering.
Comment: Thanks, really helpful!

Phase and group velocity calculation


How do I clone Galdos?

Question: I noticed there was an achievement for cloning Galdos... at first I'd assumed it was a typo since the name of the achievement is Cake2 but I just hired a Hero with this name. Do I have to be a specific race? If you can help me figure out if it's even achievable w/out spoilers that would be awesome, but considering the specificity of this question, I wouldn't be surprised if spoilers are unavoidable.
Answer:
Be Horatio
Hire Galdos AI hero
(use seed 1772120598 to start with her as one of your first three choices)
Clone her
(from the academy screen)
Comment: This seed [doesn't seem](http://gaming.stackexchange.com/q/129474/23) to be working anymore.
Comment: 4. ???
5. Profit!
Comment: user39580, can you tell us what settings you had the galaxy on? It probably still does work, but some of the settings (galaxy size/shape, etc) would need to be the same for it to work.
Answer: Cloning is, of the standard races, a Horatio ability.
If you're playing as the Horatio, you can clone an existing hero rather than recruit a new one from the academy.
Answer: The problem with the seed method is that

You must set every single aspect of the galaxy to be the same.
It changes whenever new content is released (quite often)

The trick is to edit your Hero.xml file (it can't be a mod since those disable achievements)
The file is located in
Base game:
"\Steam\steamapps\common\Endless Space\Public\Simulation"
Disharmony:
"\Steam\steamapps\common\Endless Space\Public_xp1\Simulation"
Once there

Backup the file
Open it in an editor, such as notepad++
Delete all heroes except those whose ID you want to keep.

The problem is, of course, in figuring out exactly what the hero ID is.
It took some digging, reasoning, and trial and error, but I managed to find out that it is in fact "Hero48". Simply delete all other heroes
And make sure to not delete the first two lines, or anything below and including the line that says "Hero classes" (there is some code around it, but including that makes it not appear in this page

How do I clone Galdos?


Can I calculate area of an irregular driveway using perimeter length?

Question: can I measure the perimeter of an irregular driveway then simply convert this into area using the formula for area of a circle?
Comment: Well ... Ummm ... no ....
Comment: Trevor, imagine a circular pizza, or pancake, or whatever. Imagine trying to bring the edges of the circle inward to create an irregular shape. Can you do it without the circle wrinkling and lifting off the table? No. This illustrates how 1) area changes with shape, and 2) a circle has the lowest circumference to area ratio of any shape.
Comment: Also, if you were to post an aerial/satellite image of your driveway, plenty of folks would offer suggestions for calculation. You'd probably get a very precise answer if you included a reference dimension.
Comment: Thanks guys. Just had a coffee and a slice of cake. I've reduced cake circumference by about one sixth but now need to add on 2xradius to obtain 'perimeter'. Conclusion: Stack Exchange is a useful tool and coffee is a good stimulant. Trevor
Comment: Recommend closing as off-topic: this is a math question.
Answer: You'll need to measure smaller sections such as rectangles, squares, triangles and compute the area of those.  Then add those smaller areas up.
Also if it's more convenient you can measure a large area that includes non-driveway and compute that area, then also measure that smaller non-driveway portion separately and subtract it.
Comment: Tyson. thanks for that. I am able to break it down into smaller regular shapes as per your suggestion. See my comment to the other guys. Trevor
Comment: Thanks, If that is the solution for you please feel free to accept it as the answer.  In a normal browser, that means clicking the outlined green check mark on the left to make it a solid check mark (the different phone apps seem to vary a bit how marking as solution is presented).


How to use ORI file sysstem on Ubuntu

Question: How to use the new ORI file system on Ubuntu? Are there any documentations?
Answer: There is a manual here (This is the paper from the original ori-page).
Quote from page 154:
"The following commands create and mount an autosynchronized file system.
Listing 1: Configuration of a user's initial repository.
ori newfs MyRepo
orifs MyRepo

In the example above, a repository named
MyRepo is created, and mounted onto a directory with the same
name. By default orisync is enabled, but can be disabled
with the --nosync flag. Next, in Listing 2, we replicate
and mount the file system on a different computer from
the first host over SSH.
Listing 2: Remote mounting a file system
ori replicate --shallow user@host:MyRepo
orifs MyRepo

In this example we use the --shallow flag to enable the background fetch optimization. Data is fetched from the source in the background and on-demand, and once
enough data is replicated the machine will be ready for
offline operation. We mount the MyRepo
replica onto a directory with the same name."
I have no idea what they are talking about, but maybe it helps the pros here...
Answer: Actually there is a ppa provided by the developers:
add-apt-repository ppa:ezyang/ppa
apt-get update
apt-get install ori

How to use ORI file sysstem on Ubuntu


What is the damage to the database if it uses high memory storage? Are there consequences for this use? Does it affect performance?

Question: What is the damage to the database if it uses high memory storage? Are there consequences for this use? Does it affect performance?
I need to understand a lot about this problem to be able to create solutions to it
Comment: which nosql? Generally high memory usage is good for database as a in memory cache as its quicker than retrieving data of storage. If the there is swapping to disk of excessive virtual memory then that's generally bad. You need to describe problem significantly between to attempt a solution.
Comment: Presumably you've paid for your machine's memory, so using it is a good idea as @danblack says - my own **personal** rule of thumb is that if your database server is using ~ 85% of memory without (too much) swapping, you're doing OK. Having server resources sitting idle is a waste of money (IMHO). p.s. welcome to the forum!
Comment: @Verace I think that's the general consensus for all of one's database server's hardware resources too, that sitting idle is a waste of money for something generally expensive. I'm definitely with you on that point.
Answer: To add on to danblack's point, it's generally good for your server's memory to be mostly consumed by the database system because accessing data from memory is faster than disk, but if you don't have enough memory to support your database system's workload then you can run into performance issues when it needs to pull from disk or compensate in other ways.
If you updated your question with the specific issue you're trying to solve then we can provide more specific information, but if you're just generally asking then you don't have to worry too much about this until you run into performance issues. There's a lot of other things that can equally or more likely affect performance before memory provision does.
Comment: @danblack's Thank you for the answer, but I want to write a suggestion on one of the MONGODB issues! I chose a problem that it uses high memory for data storage., is that correct?
Comment: @GheEid if your question is "does MongoDB have performance issues because it uses a lot of memory?" then I'd say no. This is by design (as most database systems are designed to heavily rely on memory) and is normal. See here for more information on how it uses that memory: https://dba.stackexchange.com/questions/148395/mongodb-using-too-much-memory


Problem with Team Collaboration in Publishing site

Question: My problem with collaboration with my team members is that, when I Edit the page my team collaborator cann't get the and edit it( it Tell that i Checkout the page) and me i doesn't checkit out, so my question is that i want to work together in the same page and edit it together and in the final step merge our modification
is there any solutions ?
Note : I work in a publishing site
Answer: AFAIK, you cannot work simultaneously on a Page.. Once you are editing a Page, its exclusively checked-out to you.. And once you complete the updates, you check-in the page, so its available to other Authors..
Now your team mate can Check-out the page and do his work and check-in again.. You can set Alerts on the Page Item to automatically get notifications on checking-in/checking-out etc.
Comment: but I already try the same experience with a project site , and it give me a simultaneously edit, and at the end it give me a window prompt to merge our edit results
Comment: hmm, maybe I'm not aware of it.. Let's wait for someone else to jump in


Rational function must have polynomials?

Question: In Oscar Fernandez' Everyday Calculus, he refers to this equation as a rational function:
$$r(V) = k{\sqrt{P_0l} \over V}.$$
Don't both the numerator and denominator have to be polynomials to be called a rational function? Is he, maybe, calling it this simply because it contains a ratio of $ \sqrt{P_0l} $ over $ V $?
Comment: If any of the answeres below were useful to you, then you should [upvote](http://math.stackexchange.com/help/why-vote) all answers you find useful and [accept](http://math.stackexchange.com/help/accepted-answer) the one that was most useful to you. It is a way to show that you have found the answer to your question and it shows your appreciation. Now it seems like you still need help. If answers are not useful to you, then it helps if you say why not. This helps others to help you. For more information [read this](http://math.stackexchange.com/help/someone-answers).
Answer: Fernandez is calling this a rational function, because the numerator and denominator are both polynomials in $V$.
Remember that a polynomail of degree $n$ in $V$ is just an expression of the form:$$\alpha_0+\alpha_1V+\alpha_2V^2+\alpha_3V^3+\ldots+\alpha_nV^n.$$
So if we choose $\alpha_0=k\sqrt{P_0 l}$ and $\alpha_i=0$, for $i=1,2,\ldots,n$, then we see that $k\sqrt{P_0 l}$ is a polynomial in $V$ of degree $0$.
Likwise we can choose $\alpha_0=0$, $\alpha_1=1$ and $\alpha_i=0$, for $i=2,3,\ldots,n$, and we  see that $V$ is a polynomial in $V$ of degree $1$.
So the expresion $k\frac{\sqrt{P_0l}}{V}$ is a rational function indeed.


Do I need to renew my US tourist visa in my home country or in the country where I reside now temporarily?

Question: I have a Philippine ls passport and I want to renew my US tourist visa before it expires. Where can I get most likely approval: in my home country or where I currently reside with my spouse, South Africa (temporary resident visa only). Hoping for answers. Thanks!
Comment: The answer depends in part on how temporary your residence in South Africa is.  How long have you been there?  How long do you plan to stay there?  Do you want to visit the US before you leave South Africa?  (There's no benefit to applying for your next US visa before the current one expires; you may as well wait until the next time you actually plan to visit the US.)
Comment: @phoog : Thanks for the advice. I've been here for almost a year already and planning to stay until I get my PR visa. My plan to visit US would be next year. So it's not true what I heard that it's easier to apply for renewal before the visa actually expires? Thank you so much!
Comment: @user79057 I don't know for a fact that it's not true, but I cannot imagine any reason why it would be.  People often use the term "renewal" to describe a new visa, but in either case it is treated as a fresh application, and in both cases your travel history, presumably one of compliance, with your earlier visa will be taken into account.  There's no reason why a gap after the prior visa's expiration would have any ill effect.
Answer: In a comment, you write:

I've been here for almost a year already and planning to stay until I get my PR visa.

Since your residence is temporary only in terms of the name of your legal status, you should apply for your new visa in South Africa.  Here's what the US State Department has to say about it:

You should schedule an appointment for your visa interview at the U.S. Embassy or Consulate in the country where you live. You may schedule your interview at another U.S. Embassy or Consulate, but be aware that it may be more difficult to qualify for a visa outside of the country where you live.

You live in South Africa, so you should apply in South Africa.
Comment: Your comments directly go against your quote that says you CAN apply anywhere.  "Permanent" is a specific term when it comes to immigration that isn't necessarily relevant in cases like this.  eg, I've been a "temporary" resident of the country I live in for over 10 years. I very certainly "reside" there, despite not having permanent residence.
Comment: @Doc Which comment?  I echo the State department's language that uses "should," which is not the same as "must": user79057 *can* apply anywhere, as you say, but *should* apply in South Africa because the application will be most likely to succeed there.  The mention of the word "temporary" was intended to counter the possible line of reasoning that because residence is nominally "temporary" the application should be submitted in a different place.
Comment: @phoog Thanks again for your feedback. You made my decision making easier. I'll apply for my renewal of US visa here in SA as this is where I live now with my husband. Actually, I got Relatives Visa which is under Temporary Resident Visa. This has expiration date so I would definitely renew my visa here before it expires.


SQL Server incremental Log backups

Question: We are taking COPY_ONLY (non-truncating) transaction log backups every 2 hours. Our requirement is to take the incremental log backup every 2 hours and not cumulative. I did not find an option in BACKUP LOG TSQL command. Is there a way to do this?
Comment: Don't use COPY_ONLY - you need to back up the log in a way that releases the VLF's for reuse.  Alternately, explain the business purposes behind your 'requirement' and precisely what you mean by incremental and cumulative, as well as your requirements for Point In Time Restore and for VLF reuse in the transaction log.  From the sounds of the question so far, you're trying to do something highly unusual and likely not recommended.
Answer:
We are taking COPY_ONLY (non-truncating) transaction log backups every
  2 hours.

Reference: Copy-Only Backups (SQL Server)
You need to understand the difference between COPY_ONLY and without COPY_ONLY?
A copy-only backup is a SQL Server backup that is independent of the sequence of conventional SQL Server backups. Usually, taking a backup changes the database and affects how later backups are restored. However, occasionally, it is useful to take a backup for a special purpose without affecting the overall backup and restore procedures for the database. Copy-only backups serve this purpose. +
A copy-only log backup preserves the existing log archive point and, therefore, does not affect the sequencing of regular log backups. Copy-only log backups are typically unnecessary. Instead, you can create a new routine log backup (using WITH NORECOVERY) and use that backup together with any previous log backups that are required for the restore sequence. However, a copy-only log backup can sometimes be useful for performing an online restore. For an example of this, see Example: Online Restore of a Read-Write File (Full Recovery Model).

Our requirement is to take the incremental log backup every 2 hours
  and not cumulative.

Schedule transaction log backup every 2 hours.  Make sure your business stack holders understand the consequence of taking transaction log backup every 2 hours.
Read this answer (What's a good SQL Server backup schedule?) for more a better understanding.  Here is (Transaction Log Backups (SQL Server) ) Microsoft's official standing on this.

I did not find an option in BACKUP LOG TSQL command. Is there a way to
  do this?

There is enough example at the bottom of this page.
BACKUP (Transact-SQL)
As a side note ( I am advocating this) many Database professionals use Ola Hallengren's solution.
https://ola.hallengren.com/sql-server-backup.html

SQL Server incremental Log backups


Can you save an image sequence from blender's compositor without re-rendering the timeline?

Question: I have an image sequence of 193 frames in the compositor. I want to save these edited images without either re-rendering the images (which took hours) or saving from the viewer node one at a time. Is there a way to do this in the compositor? Or, is there a way to view the composited image sequence in blender's VSE and save it there?
Set up below
Answer: To get the Compositor output into the Sequencer, you must have the Sequencer in another scene than the Compositor and add a Scene strip in it pointing to the Scene with the compositor output.
Then ensure you have these settings(in Blender 3.0+):
Properties > Post Processing > Compositor to ON
View > Scene Strip Display > Rendered
Scene Strip > Input Camera
Compositor > Use Nodes > Checked
Nb. it's very slow.
Reference: https://devtalk.blender.org/t/the-poorly-exposed-scene-strip-properties-which-results-in-bad-ux/15415
Answer: The compositor renders what you put in your node tree.
The render layer node is responsible for rendering any 3d scene from the compositor.
Delete any Render Layer node, and the only render that will happen is the compositing of your image sequence.


If a paper disc is cut into a spiral, does its moment of inertia change?

Question: It is obvious that there is no change in the mass of it and its radius. But the shape of the object does change. Does it mean its moment of inertia will also change?
Answer: I think the answer to your question depends on how one chooses to model a cut.
The moment of inertia of a two-dimensional object is
$$I= \int_\text{disk} r^2 \rho(r,\theta) r\,dr\,d\theta,$$
where $\rho$ is the areal (two-dimensional) mass density.
If your model for what "cutting" means leaves all of the relevant quantities (which I suppose are the area of integration and $\rho$) unchanged, then the moment of inertia would not change. If, however, cutting does affect some quantity, then the moment would likely change.
Answer: No change of moment of inertia would happen, if the axis of rotation is down the centre of the disk, and the spiral does not expand outwards as it is rotated.
if $I = \xi^2 M$ where $\xi$ is the moment-operator $\xi X = \int r \; dX$.  Because the spiral would keep $r$ unchanged over elements of $M$, the size of the inertia would also be constant.
Were the spiral to expand outwards, then the moment of inertia would change, probably involving some $v^2$ term.


Will putting new subs and amp in car drain my battery

Question: I have a 99 Acura 3.2 TL with a Napa legend 75 battery would putting a 1000 watt amp and 2 15 subs hurt my car?
Answer: Your question title doesn't quite match the body... but I'll answer both:
Simply put, this shouldn't harm your car - but that said, there are some things you may need to do:

Check that you have good connections to ground - a 1000W amp can draw a lot of current
You'll want a high current cable with inline fuse from your battery +ve to your amp. A sub being driven hard will draw more than your average car's wiring loom can cope with
Check the alternator is well maintained and gives a charging current of greater than the current draw of the amp :-)
If you plan on playing your music loud when parked with the engine off, seriously consider getting an uprated battery or maybe even a second battery. It's embarrassing how fast you can drain a battery at a beach party...
Comment: Thank you do you recommend any specific battery to get if I get secondary?
Comment: Many places do "winter" or "heavy duty" batteries. I have various devices and a 650w amp in my car, and I run off a winter battery that is double the capacity of a normal battery - can't remember exact amp/hours, but that was the selling point for me


OpendID security tips for Asp.net

Question: I am just starting with OpenID in an Asp.net MVC application and was wondering what some of the pitfalls are when using OpenID. The reason why I am asking is because I read a lot of warnings when using some OpenID implementations. Mostly it's something like "Don't use that library! You just need to change one word in the url and your site is open to anybody!!!!"
I will most likely end up using DotNetOpenAuth but as a beginner some of the therms that are used seem a little foreign. That's also one of the reason why I made this question because ignorance isn't going to make my application very secure.
Since there isn't one correct answer I hope making this question 'community wiki' is the right thing to do. If this sort of question isn't allowed I'll delete it right away.
Thanks in advance,
Pickels
Answer: DotNetOpenAuth isn't one of those "change one word and it's broken" libraries.  It's a good one to use.
As far as terminology:

ClaimedIdentifier is the new username.  Treat it as case sensitive and make sure your database does case sensitive matching when you look up user records based on it.  Do not consider http and https URLs that are otherwise identical as the same user -- they must be considered entirely different.
User supplied identifier is the literal string the user typed into the OpenID box (if there is one).  Never, ever treat anything here as authoritative and don't make security decisions based on it.  Wait until you get a ClaimedIdentifier from the response and make decisions based on that, and the ProviderEndpoint.
OP Endpoint (aka Provider endpoint) is the URL of the OpenID Provider's OpenID endpoint, and you can make decisions on that if you want to trust only certain Providers.
Claims, such as email address and full name of the user may come from the Provider if you request those attributes.  But never trust that as correct unless the claims comes from an OP Endpoint you trust.
Answer: I can't speak about existing .NET projects, but I can provide explanation of the basics for a beginner. Although there are some edge-cases and optional functionality, the basic flow is not difficult to understand. OpenID-enabled service providers ("Relying Parties" or RP) effectively off-load the password-checking functionality of authentication to a 3rd party web site ("Identity Provider", or IdP). A (end-user specific) URL to such an IdP is specified by the end-user and (from the point of view of the RP) this URL is the end-user's "Identifier".  The RP makes a server-side call to the Identifier URL to get a activity token, and then bounces the browser to the Identifier URL. Now the end-user is interacting with the IdP, and when the IdP is satisfied, it bounces the browser back to the RP with some info tacked onto the query string to indicate success. Voila.
Because the user gets to decide who verifies their identity, they can even choose a service that uses some entirely different authentication mechanism, like calling them up on the phone, or even requiring a thumbprint through a connected device. Alternatively, if they don't trust anyone else in the world, they can program their own IdP and have total control over their identity.
Many times (not here on SO) an RP will actually make the Identifier public throughout the service, e.g. as the end-user's username. Therefore, it's fashionable to use a vanity URL or a blog URL, or something more meaningful than http://superopenidprovider.com/adjad9va8ivasdlkjnq8t7 . So there exists the concept of IdP delegation, through which an end-user that includes on their homepage/blog appropriate LINK tags to http://superopenidprovider.com/adjad9va8ivasdlkjnq8t7, can use their homepage/blog URL as their Identifier. RPs must be aware of this functionality and take appropriate action.
High-level concepts
Roughly from Wikipedia. These are more conceptual than Andrew's answer.

End-user The person who wants to assert his or her identity to a service provider.
Identity The service provider-specific information related to a single end-user. I.e. all the stuff an end-user identifies with and wants to protect.
Identifier The end-user specific URL supplied by the end-user, with which OpenID authentication can be initiated.
Relying party (RP) A service provider that uses OpenID to determine the veracity of an end-user's identity claim.
Identity provider (IdP) website that can respond to OpenID authentication requests from Relying Parties, usually involving password-based challenge/response with the end-user via web forms and cookies. IdPs typically support multiple users, and thus allow end-users to register and manage Identifiers through the site. However, an individual can host their own IdP which only authenticates themselves.

OpendID security tips for Asp.net


Find if Foursquare venue mayor is currently at the venue

Question: I am looking for a way to know whether the Foursquare venue mayor is currently checked in. Several 4sq apps show whether the mayor is at the venue when you check i but I am not able to find how to do this using the 4sq API. Any help would be appreciated.
Answer: The venue aspect returns a hereNow block which lists all people who have publicly shared their location.
It also returns a mayor block, listing the ID of the current mayor.
This means that you can simply iterate through the hearNow list and see if the mayor shows up. Easy!


Lyx Single Column

Question: In Lyx, one has the option of making 'Two-column' document by selecting the corresponding option in the 'Text Layout' section of the document settings. Is there any way of disabling this for a few pages? So if I have a document that's two column, is there a way to make the third page and only the third page single column only?
Answer: You can use the commands \onecolumn and \twocolumn to switch between modes. Both commands will cause a new page to start before the change in mode.
\documentclass[twocolumn]{article}
\usepackage{lipsum}
\begin{document}
\lipsum[1-5]
\onecolumn
\lipsum[1-6]
\twocolumn
\lipsum[1-5]
\end{document}

Depending on the reasons you have for wanting the single column, there may be better means of achieving what you want. For example, there are ways to make tables, figures and equations span two columns within a two column document.
To make a floating figure or table span two columns, you can use the {figure*} and {table*} environments.  If you do so, it is best to load the dblfloatfix package to improve placement options.
Alternatively, the multicol package allows you to put selected parts of text in a one column document into multiple columns.
Answer: Use Ctrl-L for invoking the TeX mode and then insert \onecolumn. Going back to the two column layout is the same with inserting \twocolumn
Answer: I believe the LaTeX package singlepage may have the answer. That allows you to change formatting for just one page.
Comment: CTAN does not list a `singlepage` page.
Comment: @lockstep My apologies. It's been a while since I used `LaTeX`. I was thinking of the `fancyhdr` package -- it has the option to do different layouts for different pages. If you still can't find the answer in the `fancyhdr` docs let me know and I'll look harder.

Lyx Single Column


Flat AD curve - policy effects

Question: Suppose the AD curve is relatively flat because the Fed wants a stable price level.
Which policy (monetary or fiscal) is ineffective?
Answer: A flat AD-curve is not the result of the desire of a central bank to stabilize the price level, it is determined by the behaviour of the aggreggate economy (such as  elasticities and taxes). Stabilizing the price level by using monetary or fiscal policy can be done by shifting the AD-curve (or influencing the slope of the curve, but that is a less standard option). In this context the effectiveness of monetary and fiscal policy depends on how easily policymakers can shift the AD-curve. If you have an equation for AD, this can be easily calculated as $\frac{\partial Y}{\partial X }$, $X$ being the variable in the AD-equation used to implement the policy.
The effectiveness of monetary or fiscal policy also depends on the slope of the AS-curve, possible shifts in the (short run) AS-curve in response to the policy (such as inflation expectations), and the objective of the policy: price stabilization or outputstabilization.

Flat AD curve - policy effects


Besov spaces: Regularization by convolution

Question: Consider either a Besov space $B_{p,q}^s$ or a Triebel-Lizorkin space $F_{p,q}^s$ with parameters $p,q \in [1,\infty)$ and $s \in \mathbb{R}$. It is known that the Schwartz space $\mathcal{S}(\mathbb{R})$ is dense in $A_{p,q}^s$ for $A \in \{B,F\}$. I was looking for a "concrete" approximation. From my perspective, the most natural idea is to use convolutions: Fix $f \in A_{p,q}^s$ with $A \in \{B,F\}$. For $\chi \in C_c^{\infty}(\mathbb{R}^n)$ with $\chi \geq 0$ and $\int \chi(x) \, dx =1$, define $\chi_k(x) := k^d \chi(kx)$. Then
$$f_k := f* \chi_k$$
should converge to $f$ in $A_{p,q}^s$, right? Moreover, $f_k$ is a Schwartz function, and we are done. Does anybody know a reference for this result? I checked the books by Triebel and also the book by Sawano, but I couldn't find it (probably because it is "obvious").
Answer: That is the idea. For Besov spaces, this is the content of Proposition 17.12 of Giovanni Leoni's A First Course in Sobolev Spaces (or Proposition 14.5, if you're looking at the 1st edition).


How to crop an image in Illustrator?

Question: I've read a few tutorials but I'm still new to Illustrator. Currently, I am trying to work with a sketch that I am trying to position on the artboard. If I were to resize the entire shape the sketch is drawn on to within the bounds of the artboard, however, the sketch would be too small. How can I crop or otherwise keep the sketch the same size as it is in the image below, while keeping the shape it is on within the artboard?
Answer: for <= Illustrator CS6
You can not crop raster images in Illustrator. At least not with the standard Adobe installation.
You can utilize clipping masks if that helps.

Draw a rectangle above the raster image.
Select both the rectangle and the image
choose Object > Clipping Mask > Make.

This will hide a portion of the raster image but will not remove it.
If you need the raster image cropped, standard procedure is to crop the raster image in a raster editing application, such as Photoshop, before placing or importing the image into Illustrator.
There is a third party plug in titled Rasterino from www.astutegraphics.com which will crop raster images from within Illustrator.
For >= Illustrator CC
Select the image, and click the Crop Image button on the Control bar across the top of the screen.
Answer: You CAN crop raster images in Illustrator.

Draw a rectangle above the raster image.
Select both the rectangle and the image
choose Object > Clipping Mask > Make.
change blending mode to "darken" from transparency tab
choose Object > Flatten Transparency..> OK
Choose Object > Expand...

Now you have trimmed raster object.
Comment: This is the best answer for anyone wanting to avoid using Photoshop or Rasterino/other plugins.  Process is still a little tedious.  Adobe should simplify this and just add a 'crop' function to Illustrator but this does work and making a macro helps.
Comment: This is the best answer. I used this method for Adobe Illustrator CS6
Comment: This is truly an amazing answer!
Answer: here's a script that crops raster images, all it needs is a rectangle that serves as the "cutter path", place this path on top of the image, select both objects, run the script. The script will rasterize the image, discarding what's outside the bounds of the "cutter path"
http://aiscripts.com/image-crop-script/
Answer: The easiest way to "crop" the canvas to a selection in Adobe Illustrator that I could find (without a very long, overly-complicated, and tedious process), is to:

Select all the parts of your object and make a group (right-click > Group);
File > Document Setup... > Edit Artboards;
Drag each corner of the Artboard so that it snaps to the corresponding edge/corner of the image, then press Esc (Escape key);
Save/Export the image when ready.

N.B. These instructions work for Adobe Illustrator CC 2017.1.0 (21.1.0). I'm not sure if there are any differences in previous versions.

How to crop an image in Illustrator?


Term for conversational actions meant to influence emotional state

Question: Is there a term for the set of conversational actions/tools that instead of exchanging direct information, seek to instead affect a certain emotional state?
Examples of such actions would include compliments, taunts, threats, (to express) doubt, etc.
Is there any branch of linguists that studies this aspect of verbal communication?
Comment: Speech act theory, to a certain extent.
Comment: I'm not sure whether [Rhetoric](https://en.wikipedia.org/wiki/Rhetoric) can be subsumed under linguistics, but there you can find a wealth of well-known and named techniques to affect the emotional state of the recipients of verbal communication.
Comment: Yes, pragmatics, and theatre, darling, which studies the gestures that often accompany emotional states.
Comment: Rhetoric overlaps with pragmatics in many ways. In N. America it's found in Speech and Drama departments while pragmatics is found in Linguistics departments. Sometimes they talk to one another. Similar remarks on phonetics, dialectology, and sociolinguistics in one department, while voice coaching and accent mimicry is in a different one.
Comment: Pragmatics is the branch of linguistics that studies this. There are some cover terms, like _impositive_, which covers all types of speech that try to impose the speaker's will on the addressee, like ordering, questioning, directing, insisting, etc.
Answer: In J. L. Austin's speech act theory, complimenting, persuading, frightening, and so on are termed perlocutionary acts: the effect of the speech on other people. Note that unintentional effects also fall into this category: if I say something innocuous that causes you to feel afraid, I've frightened you (a perlocutionary act), whether or not that was my intent.
This is contrasted with locutionary acts (the actual words you say and their literal meanings) and illocutionary acts (the implications of those words).
Austin's theory, and various alternatives to it, generally fall under the heading of pragmatics.


Using FME to Parse An Attribute Field

Question: I have a table that contains a field with street names. Each street name ends with the street type.  Fore example, Washington St, Happy Valley Rd, Redstone Dr.  I need to extract the last part of the street name and have it populate a field called Street Type.  I been trying to use the AttributeSplitter transformer but it only splits strings according to a delimiter (in this case it's a space), but this does not work.  Any suggestion on using a different transformer or combination of transformers? Solutions need to be in FME as this task is part of a greater workflow.
Answer: Try the Regular Expressions.
It has been some time since I've used FME, but I know a while back they had a Regular Expressions Transformer (or the AttributeSplitter had a Regular Expressions option).
You should be able to use a regular expression to match some form of pattern.
For example, the address:
<code>123 abc st, Sesame Street
</code>
could be matched by the regular expression:
<code>"$[0-9]+\w[a-zA-Z]+([st|dr|av])[\wa-zA-Z]+"
</code>
Which indicates the pattern as,

from the start of the string ($)
there will be a sequence of digits : [0-9]+
followed by a white space character (space, tab, etc) : \w
followed by a string consisting of Upper and Lower case alpha characters: [a-zA-Z]+
followed by the string of interest in the pattern: ([st|dr|av]) *NOTE
followed by any number of white space and alpha characters: [\wa-zA-Z]+

NOTE
The parenthesis () tag that part of the pattern to an attribute that you can use later on in your FME script.
I hope this gives you some pointers.  I'll follow this question to help further if required.
Comment: I had a felling it was going to involve some funky expression. I also just [found this](http://groups.google.com/group/fmetalk/browse_thread/thread/33e8ced1f47a8efd).  I'll give both a try.  Thanks for chiming in.
Answer: SubstringExtractor should work too
Category: Strings
Extracts a substring from the source attribute. The substring is taken from the range of characters specified.  Character indexes start at 0 for the first character.  A negative index is used to indicate the position relative to the end of the string (-1 is the last character, -2 the second last, and so on).  The index can also be taken from the value of another attribute.
If the last index is greater than or equal to the length of the string then it is treated as if it were the end of the string. If the first index is greater than the last index then an empty string is placed into the result attribute.
Each of the index parameters may either be entered as a number, or can be taken from the value of a feature attribute by selecting the attribute name from the pull-down list.
Examples:
To trim off the first character only, use a start of 1 and an end of -1
To trim off the last character only, use a start of 0 and an end of -2
To extract the second and third characters in the string, use a start of 1 and an end of 2
http://docs.safe.com/fme/html/FME_Transformers/transformers/substringextractor.htm

Using FME to Parse An Attribute Field


Giant fighting robots vs. US military: who would win?

Question: In a ground war with conventional weapons, excluding the use of tactical nukes and orbital bombardment. Say a squad of giant fighting robots touches down on the East Coast and is advancing towards New York or DC...
Comment: How big are these robots? Size of a truck, skyscraper, mountain?

How many in the squad? 5, 10, 10 000?

What shape are they? Humanoid or something else?

What is their main power source? Diesel, gas turbine, nuclear reactor?

It's impossible to speculate without these details.
Comment: Describe your robots, just using any robot gives too many answers to this question.
Comment: the military wins, because the robots all fall over and prove useless, thanks to the square cube law making giant robots unable to support their own weight.
Comment: What is the tech level and capabilities of the giant fighting robots?
Comment: In my mind they are Mechwarrior types with fusion reactors, beam weapons, PPCs, Gauss railguns, etc. But I'm interested in other conceptions of giant fighting robots as well.
Comment: Giant robots are a terrible idea on a physics level, so you'd probably have to explain why they use them, too. If this is an invasion force then it makes no sense to use giant robots as advanced tanks would be much more effective.
Comment: Does EMP affects these robots?
Answer: Are they robots or are they Exo-suits? We got little descriptions about the robots so we have to look at some "existing" - Lets go through a few different kinds.
Robots - Autonomous
The most famous autonomous robots would be transformers. In the later movies the transformers encounter several different kind of tanks or armored vehicles, but the ability to react move and shoot faster than the tank make them superior. Versus infantry the robots are also superior towards humans. It has been proven that they can be damaged by large amounts of force but it is difficult.
The terminator would be another example, but one would only have to look at the movies to know that it would be vastly superior to normal infantry and tanks. But again not indestructible. A group or individual would be possible but an army would be fatal.
Robots - Dependent An example of a dependent robot would be the robots from the movie Real Steel. This kind of robot would be difficult to go in to direct combat with since it requires wires. Given the possibility to make it wireless. The fearlessness of the robot would make it dangerous. Given the driver uses fear of damage and but not fear of death.
Androids Robocop has the passion and the mind of a human able to make decisions that AI's would have problems with packed in bulletproof armor targeting systems and machine pistol. This make him a dangerous target, but towards tanks and other larger vehicles, we already know that he is vulnerable towards high powered guns.
Exosuits - Giant We got the robots from Pacific rift, able to fight off super monsters, the ability to fight that kind of machine as ground based city fighter would be hard. Though it's vulnerable head makes it possible, but don't count on getting home for dinner.
Exosuits - Large Exo-suits are used a lot in the warhammer 40k universe where both "human" sized suits (Tactical Dreadnought Armor), and larger machines using dead humans to harness it's power exists. Dropping a few Terminators in to a city environment with today's tech would not end well because it combines over-human abilities with mechanical assistance and close to immortality, added with a dash of soldier skills and rocked propelled explosive bullets. It would be pretty ugly.
A more friendly example of exo-suits look at the movie Edge of tomorrow. Here the suit does not provide protection but it provides super human strength and the ability to carry larger guns.
Comment: Keep in mind that in Transformers the physics on the way they move is completely wrong.
Answer: This is really very simple.
If the military can blow up the robots, they win. Think large cannon but especially mines.
If the robots are fast or smart, they win. Assuming reaching NY/DC constitutes a win.
Two caveats:

Robot resupply gives the military an extra round for free as they are fighting on home ground.
No effect on the "game" if NY/DC are abandoned in a scorched-earth policy and so stop being a target.


SD Card not readable after upgrading to El Capitan

Question: I'm not able to use my SD card on my MacBook Pro after I upgraded the OS to El Capitan. I tried to reset PRAM without success. Consider that if I put the SD card on another Mac it works perfectly. Any suggestions?
Comment: Does a different SD card work with your MacBook Pro?
Comment: I have only this one available :(
Comment: Does `diskutil list` show the SD card when attached? What format is the SD card?
Comment: Nope. Format is microsd inserted in a SD Adaptor
Comment: Interesting, so it's not being read at all, rather than just not being shown in Finder. By my second question, I meant disk format (HFS+, FAT32, etc).
Answer: I would install the older OS to another USB drive so that you can verify that the new OS is really causing the issue and it's not a hardware failure.
When you boot to the old OS (hold option key when booting to choose which OS of the ones connected) run diskutil list to check the filesystem on the SD card.
It's unlikely that it's a format that's no longer included in the new OS. It's more likely that you'll find the card itself faulty or the hardware has changed and needs to be cleaned (lint can obscure one pin connector) or repaired. You can also get a USB to SD card reader to avoid needing to reinstall the old OS just to eliminate the SD card reader as a potential source of the problems on the Mac with the new OS.
Answer: I've just encountered the same issue, and after some research found that the problem is that OS X does not load the SD kext (Kernel Extension - a driver) for whatever reason. Loading it manually resolves the issue.

Eject the SD card
Open Terminal
cd /System/Library/Extensions
sudo kextload AppleSDXC.kext (enter your password for sudo access)
Insert SD card

After this, my SD card appeared in diskutil list and in the GUI Disk Utility and was mounted in Finder. Annoyingly this has to be repeated after rebooting, or you can automate it.
Answer: Remove the SD card, reboot the machine and don't put in the SD card until it is completely rebooted. Worked for me.
Comment: OMG, I thought a simple reboot would NOT work since the SD card worked in my MacBook Pro. But that did the trick for me too! I was pretty p'd off because it's brand new and I didn't think to try it out before I off the continent to Egypt! Phew!
Answer: I was able to fix this by doing the following:
starting my mac in recovery mode by holding cmd + opt + r
selecting disk utility
clicking mount for my SSD
clicking first aid
restart my mac
Comment: Please don't post the same answer for random questions
Comment: my solution fixes all of these problems. a bad HD is the root cause of all of the issues i commented on.
Comment: Can you elaborate on how manually mounting the internal SSD fixes issues with an external SD card?
Comment: its a hardware issue with the internal drive. first aid doesnt erase ur internal drive. it repairs it. the drive isnt mounted when you run ur mac in internet recovery mode so u need to mount it in order to click first aid.


Squealing sound when I start car

Question: I drive a 97 acura tl and when I turn the car on it has a high pitch squeal. It only does it when I start the vehicle. What could be wrong? Thank u in advance.
Answer: Your serpentine belt is squealing on the alternator. One of two possible causes for this. Either your serpentine belt is worn out or your tensioner pulley is not doing it's job (tensioning the serpentine belt). The pulley can wear out over time allowing the belt to slip a little. At startup there is a heavy load placed on your alternator, which causes it to squeal on the belt. Once the belt is warmed up, it can grab a little better, plus the demand on the alternator will have subsided some, which will allow it to stop squealing. Replace the belt first, as I would put a much higher probability on this being the problem (plus it's a lot easier and cheaper to replace).
Comment: If the tensioner pulley is not spring loaded, it just may need the adjustment bolt tightened or loosened to add a little more tension to the belt.
Answer: I drive a 2017 Nissan Rogue and was having the "squealing problem" in the AM when I start my car. Also, I live in Austin, TX where the temps are pretty chill in winter months.
I took my vehicle to Nissan dealership express service lane and here was the result:
1) Opened hood of car and identified Serpentine belt
2) Did a visual inspection and determined that belt was not not frayed or loose
Conclusion:
No real issue if this happens only we the car is started first thing in the AM.  Since the Serpentine Belt works with alternator to supply electricity to the car, indicator light will activate on panel if there is ever a serious issue.
Answer: Could be a problem where starter drive and flywheel teeth are not properly engaging. This would require a starter replacement. Sounds like your car is still under warranty and the dealership is trying to avoid the real problem.

Squealing sound when I start car


GFCI and 3 way switch

Question: I am trying to wire in a GFCI outlet from a 3 way switch. There is a good ground nearby but no neutral. Can it be done and how?
Comment: Can you post photos of the insides of the boxes please?
Answer: No. You can never wire a receptacle with no neutral, and you can't substitute ground. (This is another disadvantage of running switch loops without them, which by the way is no longer allowed.)
Comment: @Ack If they have big enough conduit, they could stuff a neutral wire through it. And they could of course run a whole new cable, but you can always do that.
Comment: @Ack -- you can't run a single wire by itself -- their options depend on what *wiring method* was used to wire their house, though. (One reason why photos are *very* important)
Comment: This is the answer for the way it is now and I also think how the CO meant the question. Just in case: they -could- run a neutral wire (or new wiring) yes?
Comment: That's what I figured. I'm not sure the OP knew it. They may not want to do it but now have the knowledge to make an informed decision. BTW  your name is a long one to type out :) Do they need to run a full cable or just one wire? I assume that has to do with the electrical code. Say, run a single wire straight down to a crawlspace and fish it in, to avoid opening up the wall. I'm asking as much for me as them.
Answer: It is usually impossible to hang any other load off a 3-way switch circuit.  Those wires do not perform the functions that you need. There is no way to --
-- Oh, wait.  Smart switches.
Smart switches typically call for changing the functions of wiring in a 3-way circuit.  They make it so always-hot and neutral are available at all switch locations (since the wired smart switches need power to function).  A useful side-effect of that is that always-hot and neutral are now present for other loads.
We cannot advise further what your options would be, because you have given us very little information about the wiring in your circuit. Every 3-way switch circuit is different.

GFCI and 3 way switch


Half wave rectifier

Question:
While explaining the working of a half wave rectifier, why is 'A' always positive and 'B' always negative during positive half cycle? Similarly why is 'A' negative and 'B' positive during negative half cycle? Please explain as soon as possible.
Comment: It's called the 'positive half cycle' because it is the half of the cycle when A is more positive than B. If A were not more positive, then it wouldn't be the positive half cycle - it would be something else. I think you're looking at this from the wrong end ...
Comment: Because of how transformer works. During positive half cycle of input (i.e. primary) then A will be positive with respect to B at the secondary and vice versa.
Comment: Could u elaborate
Comment: Just think about the sine wave. During positive half cycle at input (ie primary) then A will be positive with respect to B (assuming secondary is in phase with primary) and vice versa.
Answer: A and B are reference voltages.
The assumption is that A is expected to be positive and B is expected to be negative or common (As if your were measuring DC with a multi-meter with A as the positive terminal and B as the common).
During the positive half cycle of the input voltage, you will read a positive voltage since A is greater than B. During the negative half cycle of the input voltage, you will read a negative voltage because B is now greater than A, or to put in terms you are using, B is positive and A is negative.
If you were to draw a Sine wave (starting at 0 and moving in the positive direction) and call it A minus B, it will show you when A is positive and negative with respect to node B, which are your positive and negative half cycles.
Now flip the Sine wave and call it B minus A. This shows you when B is positive and negative with respect to node A. You will see that the voltages are opposite and that B is positive on the negative half cycle.
As for the half wave rectifier operation. The diode only allows current to flow when voltage of node A is greater than the voltage of node B (Ideally, true diodes have their own voltage drop usually described in textbooks as 0.7V that must be overcome). Due to this, you will only see the positive half wave of the input voltage signal across the load, therefore it can be considered DC as the current does not flow in the opposite direction.
To visualize this, cover the bottom half of a Sine wave.
Answer: Let's get one thing clear - the phase of the incoming mains AC is unimportant here and, because of that, when we talk about the positive half cycle we refer to the secondary voltage i.e. the voltage between A and B in the OP's diagram. If the incoming mains AC is in-phase or out-of-phase with the secondary, nobody will care in this example and most others.
So, it's purely semantics; when we talk about the positive half cycle and show a picture of a half wave rectifier we absolutely mean that the voltage feeding the anode of the half wave rectifier is positive.
It would be stupid to say that the forward conduction occurs in the negative half cycle because it doesn't make any logical sense.
Answer: You've got the cart before the horse.
We call the half-cycle on which the diode conducts the 'positive half cycle'. This distinguishes it from the other half cycle, which we call 'negative'.
There is no reference symbol shown on that schematic, so we cannot talk about any given terminal being positive or negative. However, the 'uninteresting' terminal of the secondary, the one not connected to the diode, sort of assumes the role of a reference terminal. That it's at the bottom of the diagram helps reinforce that choice. With that terminal playing the part of the reference terminal, the 'interesting' one with the diode attached is positive when the diode conducts, and negative when it doesn't.
Answer: It doesn't make any difference if you take A positive first or B positive first, but the point is that the current will flow in the load if and only if A is at a higher voltage than that of B.
You may revise the concept here: half wave rectifier introduction.
Comment: Why are you writing comments on your own answer? Use the edit link below your post instead.
Comment: It could be the other way. I would suggest to google transformer dot convection.

Half wave rectifier