How can I dynamically change the display format?

Question: I have an entityreference field. I want to change the 'Format' under 'Manage Display' from 'Rendered Entity' to 'Label' based on custom logic. Basically, what I'm doing is, if there isn't an image in a node (field_image), it will load a default image from the taxonomy term. If there is an image in the node, it will just display the label. Sorry if this has been answered, but I can't find anything on it. I've tried hook_entity_view_alter, but I don't think that's the right one.
Comment: Have you tried using the node_view_alter, which allows you to modify the node just before final output. More info is here: https://api.drupal.org/api/drupal/modules!node!node.api.php/function/hook_node_view_alter/7
Comment: I did try node_view_alter, however it still doesn't work. Maybe I'm using it wrong. I'm changing $build['field_entityref']['#formatter'] from 'entityreference_entity_view' to 'entityreference_label' but when I dpm($content) in the node.tpl, it still has the rendered entity under the field_entityref instead of the label by itself. I ended up just keeping it at 'Rendered Entity'. If I need the Term name, I just grab it from $content['field_entityref'][$id]['taxonomy_term'][$term_id]['#term']->name
Answer: You can do that printing directly the entityreference field in the node.tpl.php. First you need to check if the image field exists and then display the entity reference, so you can do something like this:
<code>if(!$content['field_image']){
   //Load default image
}else{
   print 'Your custom label.';
}
</code>
You have to remember to set the format to hidden in the display section.


Will a crimson chest spawn in a corruption world?

Question: I have a few of the legendry items from the dungeon chests now. I was wondering, if I managed to get a hold of a crimson key, would I be able to find a chest in my corruption world, or would I have to create a new crimson world and find it; is it already there?
Answer: Crimson chests are spawned during world generation, and only in worlds which have the Crimson. You will need to make a new world to find one.
Answer: No, they will spawn in the Dungeon after you defeat Skeletron.


Is the strange reproductive process in The Twelve Kingdoms based on a myth or legend?

Question: In The Twelve Kingdoms, babies are born from Ranka, or giant eggs that grow on trees.  Is this based on an myth or legend?  Or is it just a way the author invented to explore what happens to a society where the women do not have to give birth?  The idea of babies growing in eggs on trees seems like something I've heard of before somewhere else, but I can't recall where.
Comment: I would assume that sex is just for pleasure and not for tangible results in this universe.  I wonder if STDs grow on trees too...
Comment: Not that I know of, but it does raise some interesting questions about why people in that universe still have sex (Youko, the main character, nearly gets sold to a brothel).
Comment: :p - What I meant was, why was that even an option...
Answer: I touch on this in my answer to your other question. Eastern and Buddhist myths often use the cosmic egg to explain creation. In Chinese mythology, it is Pangu who hatches from the egg. In Hindu mythology, it is Brahma. In Buddhism, Buddha himself is depicted as hatching from the egg as seen below.

The myth of the World Tree is another that pervades religion.
Answer: As with coleopterist's already accepted answer, I don't know the author's inspiration for certain, which would be impossible, unless a writing or interview exists in which Ono explicitly describes any inspiration for the idea. But the following are suggestive, and I think worth mentioning in addition to coleopterist's information regarding Buddhism. Some of these may perhaps be what you were reminded of in term of babies growing in eggs (albeit not from trees; on the other hand, Princess Kaguya of Japanese legend was said to have been born from a bamboo stalk, but not an egg):

...consider the following extremely suggestive legend of T'arhae, the fourth king of Silla. The legend as it is recounted in the Samguk sagi (Historical Records of the Three Kingdoms), the oldest historical chronicle of the Korean kingdoms, is as follows:

T'arhae was born in the country of Tap'ana. That country is one thousand ri northeast of Yamato. Of old, the king of that country married the queen of a country of women. She became pregnant for seven years, and gave birth to a large egg, at which time the King said:
"A human being born from an egg is an inauspicious omen. Throw it away." But the queen could not bear to simply throw it away, and so she wrapped the egg in a silk cloth and placed it along with some treasures in a box and set it floating upon the sea, where she lost sight of it. ... It thereupon floated to the coast of Ajinp'o ... where an old woman picked it up. When she opened the box, there was a small boy inside.61

Mishina Shōei and others have demonstrated that this legend illustrates a common motif of the nation-founding legends of the Korean kingdoms wherein a child of the sun who is "hatched" from an egg is sent floating on the sea until he reaches a kingdom that has been promised to him. In the Ame no Hiboko/Akaru Hime legend cycle we find at least part of this motif repeated as Akaru Hime, apparently the daughter of the sun god, crosses over to Yamato from Silla after "hatching" from a stone that Ame no Hiboko has metaphorically incubated for an evening.62

--Como, Michael I. (2008) Shotoku: Ethnicity, Ritual, and Violence in the Japanese Buddhist Tradition,  Oxford University Press.
Similarly, in the 16th century Chinese novel Fengshen Bang/Fengshen Yanyi/The Investiture of the Gods/The Creation of the Gods,

Nezha's mother, Lady Yin, gave birth to a ball of flesh after being pregnant with him for three years and six months. Li Jing thought that his wife had given birth to a demon and attacked the ball with his sword.

-- https://en.wikipedia.org/wiki/Nezha
The above descriptions of king or lord  thinking a child born from an egg is inauspicious or demonic is an interesting contrast to the King of Kou's repeated claim that as a kaikyaku born of a woman and not of ranka, Yōko would bring ruin and even demons to the land. The Kou king's reversal of this trope of suspicion of the egg-born, however... (the following is a spoiler for Shadow of the Moon, the Sea of Shadow: Ch. 12)

 turns out not to be what he truly believes -- quite the opposite in fact: It eventually emerges that he feared Kei becoming, like En, more prosperous than Kou, due to some imagined connection between taika rulers and prosperity.

Lastly, in Chinese Daoist legends of creation,  "Pan Gu, the first man, is said to have come forth from chaos (an egg) with two horns, two tusks, and a hairy body."
(As a clarification, he -- not the egg from which he was born -- had the horns, tusks, and body hair.)
Comment: As a side note, I wonder if Pan Gu's reputed appearance or [Pang Gu masks](https://www.google.com/search?q=%22Pang-Gu+mask%22&tbm=isch) served at all as artistic inspiration for the supposedly atavistic transformation of Marvel Comics character Ravage 2099. Probably just coincidence, though.


Banshee stopped working properly

Question: So... I was having some trouble with Banshee and I decided to uninstall it. I tried to install it again but now when I click to open, Banshee doesn't open. I thought that the problem could be broken packages, or missing plugins, but it seems the problem isn't this.
Does anybody know what to do? = /
Answer: Please try adding the Banshee's stable PPA:
<code> sudo add-apt-repository ppa:banshee-team/ppa
</code>
Or from the unstable PPA:
<code> sudo add-apt-repository ppa:banshee-team/banshee-daily
</code>
Update the repositories:
<code> sudo apt-get update
</code>
NOTE: Please add only one PPA.
Next, please remove all banshee packages and configuration files:
<code>sudo apt-get remove banshee* --purge
</code>
Install banshee:
<code> sudo apt-get update && sudo apt-get install banshee && sudo apt-get upgrade
</code>
Comment: Good, please in "feedback" in this answer, in a question "Was this post useful to you?" select "Yes".

Banshee stopped working properly


Can a ultracentrifuge be used to test general relativity?

Question: With today's ultracentrifuge technology, they can spin so fast that the sample can be subjected to  accelerations of up to 2 millions Gs. That is equivalent to two solar masses. Has someone tried to measure the time dilation in a radioactive sample? How calculate that time dilation respect to the time outside the ultracentrifuge, for example one week. I think that that time dilation will be significant enough to be measured.
Answer: This is really the same as a couple of the other answers, but I note that in the comments to those answers you are insistent that your experiment is a test of general relativity. However this is not the case. As long as spacetime is flat the experiment can be analysed using special relativity, and in this answer I shall explain why.
It's commonly believed that special relativity cannot be used for accelerating frames, but this is wholly false. Special relativity only fails when spacetime is not flat, i.e. when the metric that describes the spacetime is not the Minkowski metric.
The analysis I'll give here originally formed part of my answer to Is gravitational time dilation different from other forms of time dilation?, but I'll repeat it here since it is the core issure in your question.
In the centrifuge the observer is rotating about the pivot with some velocity $v$ at some radius $r$. We are watching the observer from the laboratory frame, and we measure position of the observer using polar coordinates $(t, r, \theta,\phi)$. Since spacetime is flat the line interval is given by the Minkowski metric, and in polar coordinates the Minkowski metric is:
$$ ds^2 = -c^2dt^2 + dr^2 + r^2(d\theta^2 + sin^2\theta d\phi^2) $$
We can choose our axes so the rotating observer is rotating in the plane $\theta = \pi/2$, and since it is moving at constant radius both $dr$ and $d\theta$ are zero. The metric simplifies to:
$$ ds^2 = -c^2dt^2 + r^2d\phi^2 $$
We can simplify this further because in the laboratory frame the rotating observer is moving at velocity $v$ so $d\phi$ is given by:
$$ d\phi = \frac{v}{r} dt $$
and therefore our equation for the line element becomes:
$$ ds^2 = -c^2dt^2 + v^2dt^2 = (v^2 - c^2)dt^2 \tag{1} $$
Now we switch to the frame of the rotating observer. In their frame they are at rest, so the value of the line element they measure is simply:
$$ ds^2 = -c^2dt'^2 \tag{2} $$
where I'm using the primed coordinate $t'$ to distinguish the time measured by the rotating observer from the time we measure $t$.
The fundamental symmetry of special relativity is that all observers agree on the value of the line element $ds$, so our value given by equation (1) and the rotating observer's value given by equation (2) must be the same. If we equate equations (1) and (2) we get:
$$ -c^2dt'^2 = (v^2 - c^2)dt^2 $$
and rearranging this gives:
$$ dt'^2 = (1 - \frac{v^2}{c^2})dt^2 $$
then:
$$ dt' = dt \sqrt{1 - \tfrac{v^2}{c^2}} = \frac{dt}{\gamma} $$
which you should immediately recognise as the usual expression for time dilation in SR.
So the time dilation for the rotating observer is given by the same function as for an observer moving in a straight line at constant speed. This is why it's perfectly valid for the other answers to calculate time dilation using the normal special relativity formula.
The centripetal force/acceleration does not appear in this expression and general relativity is not required.
Comment: @doetoe: No. The computation is the same in GR. In fact SR is just a specific case of GR where the metric is the Minkowski metric. In a curved spacetime the method for the calculation would be the same but the metric would be more complicated. Actually this is an important point since if you understand the calculation I describe you basically understand how to use metrics in GR, so GR isn't as hard as you think!
Comment: Please read my comment to @Physicist137 and http://physics.stackexchange.com/questions/87673/did-people-realize-that-gravity-accelerated-things-before-einsteins-elevator-th
Comment: @CarlosFreites: which comment? If you mean your second comment asking about the three scenarios then I think that's a different question to the one you asked.
Comment: @JohnRennie Yes John, the imaginary elevator experiment one.
Comment: Ah, **ds is the thing to agree on**, not necessarily dt. So we can have observer in frame 1 at proper time T see the clock in frame 2 as being behind his, which implies that the odometers differ too.
Comment: Would it be possible to show the time dilation using gravitational time dilation formula?
Comment: Maybe I'm mistaken, but aren't you just showing that the time dilation in this situation can be computed using special relativity, but not that it gives the same answer as when using general relativity?
Comment: @JohnRennie Thanks John! I'll think about it a bit more.
Comment: Could we turn this around and invoke the equivalence principle to conclude that the time dilation due to gravity can be computed by making the calculation for an appropriate centrifuge (i.e. what you did)?
Comment: Let's say you made this into a twin paradox example and stopped the centrifuge. You'd have to rewind the same number of orbits to re-unite the clocks to compare the proper times to establish permanent age diff. If you stopped the fuge and flew the clocks back together along the radius, that is a much shorter distance than the accumulated orbits so there must be some rule broken here to establish twin paradox perm age diff.
Answer: Short answer: I'm afraid this is not a test of general relativity. I'll tell you why. I'll try to keep simple.
You may use special relativity when your frame of reference is inertial. Let's say you see a Ultra-centrifuge spinning. You are experiencing no gravity at all (Earth's gravity is negligible for time dilation effects). You are experiencing no non-inertial forces (Earth spin and Coriolis force are in a very small scale for time dilation). Therefore, you are (approximately) a valid inertial frame of reference, and therefore, you can use special relativity for the spinning radioactive sample.
But, let's move to the reference frame of the sample. On there, the sample is experiencing 2 million Gs of non-inertial forces. It is cleary a non-inertial frame of reference. Thus, you cannot use special relativity here. You must use general relativity.
However, both observers, you and the sample, must agree and came up with the same results. Since it is far easier to treat the problem using special relativity, we can do so, using your inertial frame of reference. Let's calculate the $\gamma$-factor:
$$
\gamma = \frac{1}{\sqrt{1 - \frac{v^2}{c^2}}} = \frac{1}{\sqrt{1 - \frac{gr}{c^2}}}, \quad\quad
g = \frac{v^2}{r}
$$
I'm keeping the calculations very simple so you can understand. This is not right, but likely holds as good approximation. The non-inertial acceleration as you said has the value: $g = 10^6m/s^2$. I'll exagerate the radius: $r=1m$. Therefore, the gamma factor:
$$
\gamma\approx\frac{1}{\sqrt{1-10^{-10}}}\approx 1
$$
Therefore, the time dilation: $\Delta t' = \gamma\Delta t$, is negligible, in your small experiment.
It was a nice ideia. It would work with atomic clocks. For instance, take a look in the Hafele–Keating experiment.
Comment: @CarlosFreites: re your last comment: the equivalence principle tells us it is impossible to distinguish acceleration from gravity in a **local** measurement. However over any non-zero distance you can tell your options 1, 2 and 3 apart because the tidal variation of the force will be different in the three cases.
Comment: This is exactly what I was trying to get across in my answer. I'm glad someone agrees.
Comment: First you are agree with me that special relativity effect are negligible and because that, general relativity must be used. But then you use special relativity formulas to conclude that general relativity effects are negligible. Feel free to use the differential geometry tools that is necessary to handle general relativity in order to get the formula to calculate the time dilation that is applicable. On the other hand, my experiment is a direct test for General Relativity.
Comment: OK. Let's do the **imaginary** elevator experiment. You are inside a close elevator with no windows. Suppose that in Earth your weight is 1 Kg and that your weight inside that elevator is 2000000 Kg.  Can you differentiate whether:

1) Your elevator is immobile over the surface of a planet with the mass of 2 suns with the same radius of the Earth.
2) Your elevator is being accelerated with a propulsion of 20000000 Gs in the empty space.
3) Your elevator is inside an ultracentrifuge that spin so fast that makes you weight 20000000 Kg.
Comment: Please notice that by **imaginary** means things like:

a) You can forget you can be crushed by your own weight.
b) You can no get that acceleration because you would soon be at c speed.
b) The ultracentrifuge radius is enough big that the whole elevator feel the same acceleration.
d) You are unable to detect anything outside the elevator.

Apart from that, you have all kind of equipment to measure the field that makes you weight 20000000 Kg.
Comment: **If General Relativity is right, the answer is: You can NOT ever know if whether 1, 2 or 3 is the origin of the force you feel that makes you weight 2000000 Kg.**

If anyone thinks can detect a difference, then must study General Relativity carefully.
Comment: @CarlosFreites Relativity, as the name suggests, everything is relative when analysed from different frames of reference. Then you must fix a reference frame prior to any analysis. If you fix yourself as a reference frame observing the sample rotating, **your frame** is inertial. And hence we can use special relativity to see the sample. Because the frame you are using to do so, is inertial.
Answer: You recently commented

I think the special relativity influence is absolutely negligible.

It's exactly the opposite. It's the influence from general relativity that's absolutely negligible.
Time dilation is a prediction of both general and special relativity. In general relativity, it's caused by an object being near a massive body. In special relativity, it's caused by an object moving very quickly. This is the time dilation that you're talking about. In an ultracentrifuge, the object is being spun around a center point very quickly. Any time dilation would be a result of its enormous speed. There is no giant bit of matter causing time dilation.
The acceleration mentioned is most likely the centripetal acceleration the object experiences. Centripetal acceleration is always towards the axis of revolution, so the object moves at a constant speed.
Comment: In general relativity, it's caused by an object being near a massive body. Exactly, like a body with two sun masses. What "feels" that object that makes its time dilated? It is a strong gravitational field that is locally identical (according to general relativity) to an acceleration of 2000000 Gs (the mass of the sun is 1000000 times the mass of the earth). The tangential speed in the ultracentrifuge is negligible respect to c.
Comment: @CarlosFreites Acceleration does not necessarily come from gravity. It comes from a force; gravity is just one example of a force.
Comment: That is right but one fundamental aspect of general relativity is that locally you can not differentiate if you are in an accelerated system or in presence of a gravitational field.
Comment: @CarlosFreites That doesn't mean that all accelerations are due to gravity.
Comment: All accelerations behave locally as gravity.
Comment: @CarlosFreites Yes, because the effect of gravity is the same as the effect of every other scenario where the net force on an object is non-zero - there is an acceleration.
Comment: For a very small interval, the centrafuge is the same as the elevator: constant acceleration pushing the floor against me. For longer time, you see that the room is also rotating and the vector of acceleration changing too.  So, you have to consider the various acceleration periods in different directions, which is not the same as the elevator.
Answer: A good start here would be to compute the time dilation effect expected from a centrifuge operating with a million Gs.  With $\frac{v^2}{r} = 10^6 g$  I would assume something like a radius of 10 cm, in which case $v\approx 1000$ m/s.  We know gamma is $\gamma=\frac{1}{\sqrt{1-\frac{v^2}{c^2}}}$, which means that $gamma-1$ is about $6\cdot 10^{-12}$.  Using radioactive decay directly then is probably not such a great measure of this then since you'd need greater than ${10^{12}}^2$ counts to have a precision necessary to measure the dilation.  That would be a pretty hot radioactive emitter...
On the other hand, if you're willing to use something other than counting the half-life of a radioactive substance, then you might consider using mossbauer absorption, where the resonance of a photon absorption in a nuclear transition is so sharp that very slight deviations can be measured.  Indeed, in mossbauer systems, velocities of $10^{-2}$ cm/s can be sufficient to measure the deviation from a resonant system.  There is too much detail in that computation to reproduce here, so better to read a simple explanation of it in Experiments in Modern Physics by Melissinos and Napolitano, Chapter 9.3.
Granted, this doesn't really test General Relativity directly, so the short answer is, no.  Wonderful idea though!
Comment: Yes, 1000 m/s = 1 Km/s is totally negligible respect to c (300000 Km/s) this mean that at this speed the time dilation is negligible for special relativity effects. On the other hand, **this is a direct test for General Relativity**.
Comment: @CarlosFreites Just use an atomic clock and hold on a different elevated position.
Comment: That is not the point. The point is to check acceleration has identical effect that gravitational mass.
Answer: The previous answers are correct and even an acceleration $2 x 10^6g$ centrifuge at $1m$ radius will generate a relative compared to the speed of light, tiny constant tangential speed of $υ=1.41 Km/s$ thus just only $0.00047$% of the speed of light $c$ in the vacuum.
Therefore, the SR time dilation effect value calculation which depends not on  acceleration but exclusively on the scalar value of velocity thus speed and not any vector direction, is calculated as tiny and negligible in the OP's given example.
$$
\gamma=\frac{1}{\sqrt{1-\frac{v^2}{c^2}}}\approx 1
$$
However, with that said in particle physics high energy experiments circular rotation time dilation effect is significant. For example in the 2021 muon g-2 Fermilab anomalous magnetic moment experiment published results here the SR time dilation correction in the cyclotron was $γ=29.3$ (see eq.1 page 3). Time inside the cyclotron passed $x29.3$ slower than outside in the lab.
Of course the muons were accelerated inside the cyclotron in this experiment at a constant speed $υ$ very close to the speed of light $c$.
Answer: It is a nice very idea for an experiment, but I don't think that radioactive decay would be an accurate enough 'clock' to use because generally with these types of measurements very small differences in time are detected - generally atomic clocks are used to measure the time in these experiments. With the radioactive decay process it is random decay and there will always be some uncetainty in the activity of the sample after the experiment.
I also wonder whether the centrifuge is equivalent to a gravitational field; according to this reference it is equivalent. The time dilation would be most noticeable if the sample was rotated at 'relativistic speeds'. If the speed is not so fast we would need more accurate time measurement.
Comment: I think the special relativity influence is absolutely negligible. Yes inertial mass is equal to gravitational mass that is a fundamental aspect of general relativity.
Comment: @CarlosFreites this question is about general relativity where there is time dilation in frames that are being accelerated. I agree with you that the effect will be very small, but it is an interesting question and if an atomic clock could be used to measure time it would probably show an effect - see the link for experiments where general relativity has been observed with atomic clocks. I don't think it is realistic here to centrifuge an atomic clock, but the idea of radioactive decay is interesting as a way of measuring time.
Answer: I am not a physicist (my background is biotech) but from a non-technical perspective I believe that since the centrifuge has no gravitational field (it operates in the same part of earths gravitational field as the observer) then the only time dilation that might be measured would be due to the velocity of the test subject rather than the g-forces created by bending the subjects trajectory into a tight curve. In other words since both the subject and the observer are both in the exact same point of the exact same gravity well, there is no gravitational time dilation, but since the centrifuge also creates speed, that might create some time dilation.
Comment: Hello Coral. One of the more amazing postulates of General relativity is that you can not, locally differentiate, a gravitational field from an accelerated referential system. That is if you are inside a elevator without any contact with the outside world, no matter what experiment you do, you can not say if you are in the earth with no acceleration at all or if you are in the space accelerating at 9.81 m/(seg^2).
Answer: I put a cesium clock in a centrifuge for 24 hours, got 45.9 microseconds first relative to gps satellite. 20,200km up
Centrifuge spun at 2 G's it was 91.8 microseconds.  You can suck on numbers all you want, but experiments don't lie.
Comment: And how do those experimental values correlate to general relativity expectations? By the way, the tone of your last sentence is not helping get your point across.
Comment: You put a cesium *clock* in a centrifuge? How did you manage that? Are you publishing this anywhere?


Test-set error in cross-validation with regularization

Question: I am performing regularization (Ridge regression) using cross validation. I understand that for a certain value of the regularization parameter $\lambda$, we first fit on the training-set and then we use the resulting parameters to calculate the error on the test-set and the optimal $\lambda$ is the one that minimizes the test-set error.
My question is: for the calculation of the test-set error do we include the penalty term (for the value of $\lambda$ that we used in the training set), or not (i.e. use $\lambda =0$)?
On one hand, I see the need to treat the training and test sets "on an equal footing" and use the same $\lambda$ for the test-set error calculation.
On the other hand, the parameter values that we get from fitting the training-set have already been penalized, and we want to see how these values perform on the test-set, so why use a penalty term again?
Answer: You should use the same value of λ on both training and test data sets.
The value of λ influences the values of the parameters. The values of the parameters should be consistent across training and test data sets, thus the value of λ should be the same.
Comment: Thanks Brian. I would agree that consistency is a good enough reason.


How to Save .svg in Illustrator so it shows right on Adroid?

Question: I am trying to create a .svg image for Android devices, but it is not visible clearly in the device. How should I save the file from Adobe Illustrator and how can I optimise the file?
Comment: svg's appear fine on my android device/s
Comment: When I save a file as SVG in Illustrator with standard settings it shows fine on android for me.
Comment: The last few versions of Illustrator export improperly formatted svg when using the "Export for screen option". Use "save as" The reason for this is that the useless, greedy individuals at Adobe are incapable of doing anything properly.
Answer: Sometimes converted SVG don't work fine and it may show some distortions, that's because the SVG file is not perfectly designed to demonstrate curve drawn with bezier curve method or what we call it paths. of course Illustrator is perfect in that. You may see an orthographicaly drawing presented well but when it comes to curves it will distort.
My solution is to divide your curves in sub curves and don't simplify the path.
Go to Objects>path>Add Anchor Points and do it whatever it takes. two or three times.
Answer: I usually save SVG right on the border of the graphics. In Web Desktop Browsers you definatelly need some css usually to scale things. But i would go with the screen size i want the svg to initially appear.
Screenshots might help.


Video Playback Stutters

Question: I am on a 2017 MacBook Air, Intel i3, 8GB RAM, I am on Big Sur 11.5.1 and every video, including the video previews for trackpad gestures are stuttering. I have done virus scans with Malwarebytes and it found nothing. YouTube and downloaded content is slow, please help.
Comment: If Internet access is slow in general: Does a reboot of both your MBA and your router change things?
Answer: Try using Activity Monitor to check if there's something using an excessive amount of your CPU:

Open Activity Monitor.app. You can find it via Spotlight or in /System/Applications/Utilities.
At the top of the window, click the CPU tab.
In the menu bar, click View > All Processes.
Click on the % CPU column header to order the list by current CPU usage.

If a specific app is using a lot of CPU (around 100% or more), try quitting it. If it doesn't respond, try force quitting by selecting it in the list and clicking the Stop button in the toolbar.
Comment: Thanks, an Adobe program was hogging all my CPU.

Video Playback Stutters


How to make a circle spin from the edges

Question: I have an issue where I need to make a large wire through a bearing spin in 3" diameter circles, and have a weight hanging from the bottom of the wire. Essentially, I need a hole that moves in a trajectory such that the center of that hole makes a 3" circle path. To make the 3" diameter circles, I was just thinking of having a spinning disk driven by a motor and an arm, and have a circle offset 1.5" from the center. The problem with this is that the motor shaft would be secured in the center of the rotating disk, and there would not be enough room for the weight at the bottom of the wire to spin without interfering with this shaft. One of my ideas was to design some fixture similar to the one shown in this video: https://www.youtube.com/watch?v=VTkULChFXkk. I would have four motors driving holes in the corners of a plate driving the rotation, and put my bushing through the center. Another idea I had was to do something like the following image, where I have 3 or more servos on the edges of a center gear that has the 1.5" offset hole. Would this be secure enough? How would assembly work with this, as I am not too familiar with gears. Would I be able to put the three servos down and then put the center gear down in the middle?
enter image description here
Comment: the motion can be circular without passing the cable through a circular plate ... web search `pantograph` ... drive it at the end with a 6 inch wheel ... the cable is attached at middle
Comment: The other post wasn't deleted? I am just trying to work out some other ideas for how to make this work. Unless you are referring to someone else posting something and deleting it.
Comment: Sorry. I was rash there. Your two accounts weren't linked and the other question got buried super fast.
Answer: Can you even find a gear big enough with the appropriate flat center surface? Most gears have center holes in them after all unless you plan to EDM one yourself out of a plate.
With your new method you only need one driven gear if you wish. No need to drive all three gears, gear tooth strength permitting. If you choose to drive multiple planets with multiple motors, they will inherently synchronize and load share and not disturb the path (whereas the  the corner discs on square plate method would need electronically synced motors because it had more degrees of freedom so the path could be disturbed. In other words the square plate can wobble.)
You will want your planet gears to have a flat above and below the toothed part with wider diameter for supporting the sun gear and to keep it captive and stop it from lifting away. Sort of like what you see in pinions for timing belts so the belt doesn't run off. Could also be done with discsc unattached to the planet gears but mounted on the same shaft above and below the planets with thrust bearings. You may need other stronger, independent bearing surfaces to support the weight at the edges if the motors or planet gear shafts aren't enough.
Comment: Good question, I would need to look around to find a gear that could make this work, just wondering if it is possible. Also, I thought about only having one gear at first, the reason for additional gears was to keep the larger gear centered. Usually both gears will have shafts fixed to something, so they cant move away from each other, but if I had nothing attached to the center of the large gear, what stops it from just moving away as the servo starts spinning?
Comment: You need three, but only one *driven* gear. The 3 planets keep it centered. See last paragraph edits.
Comment: Thanks for all the help on this over the last few days! I am in a new engineering role and there aren't other design engineers to talk ideas through with.


Tomato 911 - they have brown bottoms

Question: Help - my tomatoes are turning brown on the bottom. This one plant out of 15.  It's not every tomato on this plant. Maybe 1/3 have this problem. t's an heirloom, brandywine.   I am in zone 9b. This just happened in the last couple of days. I have a drip system and all my other tomatoes are doing well. But we have had a sudden heat wave of 100 plus days for the last 3 days. Is it disease or a heat/water issue?  Should I quarantine?  It is in a fabric pot so I can move it.
Comment: Usual cause of blossom end rot is insufficient water, which disables calcium uptake, so yea, the heatwave meant  this one needed more water
Answer: Blossom end rot. It's caused by a calcium imbalance. It can be because of calcium deficiency, but also other reasons such as soil PH and watering. In your case it is likely to be due to the heat wave.
Answer: I thought I'd send a recipe for management. Be nice to see your entire plant, to know whether it is in sterile potting soil if it is in a pot, if not what type of soil you do have, raised beds? Watering practices and most certainly what you are using for fertilizer.  This link should help or even engender more questions.tomato end rot  Just adding calcium might not help at all.  You need to test your soil's pH and give us the formulation of your fertilizer.  Any additions such as manure?

Tomato 911 - they have brown bottoms


Touch interface in android phones

Question: What are the dots used for horizontal scrolling called? These light up to show what screen the user is on.
Comment: @Gusdor The downvote item itself (on the tooltip) states that the reason for downvoting would be "*..does not show any research effort*" which this question does not, so it is likely that is the reason for the downvote. Also, there is no examples of where this is used, what purpose they OP has for asking it. It's just a one-liner where somewhere like Google should be the first port of call.
Comment: @JonW I can accept that.
Comment: Not sure why this got voted down. It is a straight forward question with a range of demonstrable concrete answers. Is that the problem? Is it not subjective enough for UX? +1 for equilibrium.
Comment: This isn't really specific to android. Most web sites have page indicators similar to this (with numbers instead of circles) and this specific picture is from iOS (first result I found for page indicator in image search).
Comment: @DannyVarod you're right. _actually_ these dots are not "android-ish" at all! Check the design guide - you won't find them.
Answer: I'm not sure if they have a formal name but I would refer to these as page indicators.
You can compare this to a tabbed view quite nicely (the difference is that you navigate by swiping). If you are using this idiom, the dots are now the tab headers.
Comment: "page indicator" seems to be a commonly used term for this: https://www.google.com/search?q=page+indicator&newwindow=1&safe=off&espv=210&es_sm=93&source=lnms&tbm=isch&sa=X&ei=qHVmUvmLHYWR7AbC6IHQCw&ved=0CAkQ_AUoAQ&biw=1236&bih=761
Answer: I would refer to these as "pagination buttons". The content is paginated, and these are buttons which can be used to move between each page. These usually (but not always) have an active state when the page they link to is the currently visible page.
Answer: Most of the developers in my company referred it as "android pagination indicator" or "Page Indicator"
you can see some example over here:
https://stackoverflow.com/questions/11486218/android-added-circle-indicator-to-viewpager
http://viewpagerindicator.com/
you can also check some android patterns over here: http://www.androidpatterns.com/uap_pattern/horizontal-scrolling-page-indicators
Comment: Thanks for all the help.Actually, I new to the world of user interface.

Touch interface in android phones


Does segment routing protocol steer packets based on best (longest) prefix matching?

Question: In segment routing protocol, we know that the routing process is source steered. I'm struck to know if any best (longest) prefix matching happens to route the data packets? If so any clue about the prefix be attached to the header of IP packet when forwarding to downstream router?
Answer: Subnet routing is usually by destination address (as opposed to policy-based routing where other parameters can be used).
The routing algorithm selects the most specific, longest subnet prefix from the routing table. Effectively, the routing table is sorted by prefix lengths and entries are tested from longest to shortest prefix until a match is found. If present, the null-length default entry 0.0.0.0/0 matches all destinations.
The packet itself doesn't carry any prefix length information, just the source and destination addresses. The length of the prefix is taken from the routing table of each forwarding hop.
This way, the routing entries can become more specific along the way, from hop to hop. For instance, a branch office using 10.11.22.0/24 locally can use a 10.0.0.0/8 "private default" route to headquarters. At HQ, 10.22.0.0/16 can point to another branch office and there, 10.22.33.0/24 can point to an actual subnet.
Comment: ... not quite sure if question or answer actually *do* refer to _segment routing_, which seems to be an entirely different animal than classic destination based IP routing.
Comment: @Marc'netztier'Luethi Good point - given the OP rep I was guessing he referred to normal IP routing. AFAIK, segment routing doesn't use prefixes but uses a kind of source-routing.
Comment: @Zac67 thanks for the help. I wanted to know if, in segment routing, router A by any chance computes the best matching prefix to transmit a packet to router B (downstream). I learnt that in source-routing of SR, it allows an ingress (1st) node to compute the path without a need for prefix-based routing. I was confused about the theory and needed some validating opinion. Your answer helped me that way. Thanks again!
Comment: Router A doesn't compute a prefix, it just checks its routing table for the first fit from longest prefix to shortest. IPv4 source-routing works somewhat differently but it's obsolete (can of worms actually).


Physical interpretation of Green's theorem with Dirichlet boundary condition

Question: The potential is given by
$$\Phi(\mathbf{x})=\int_V d^3x' G_D(\mathbf{x},\mathbf{x'})\rho(\mathbf{x'})-\frac{1}{4\pi}\oint_S d^2x'\frac{\partial G_D(\mathbf{x},\mathbf{x'})}{\partial n'}\Phi(\mathbf{x'})$$
Is there a physical interpretation of the surface term?
The only one I can think of is that it is the surface integral of $\Phi(\mathbf{x'})$ times $\sigma(\mathbf{x'})$, where $\sigma(\mathbf{x'})$ is the surface charge induced by the presence of a unit point charge at $x$, with the surface being grounded. But why it should be of this form?
Comment: Look at comment in Jackson 3rd Edition page no 37. It clearly explains why this term is electric potential due to a surface charge density.
Answer: Your intuition regarding the surface term is right. Beyond that it is just plain details and I give a derivation below.
Consider the identity (called Green's second identity)
$$
\int_V \left(\phi \nabla^2 \psi - \psi \nabla^2 \phi\right)\text{d}V' = \oint_S \left(\phi \frac{\partial\psi}{\partial n}  - \psi \frac{\partial \phi}{\partial n} \right) \text{d}S'
$$
In this equation, set $\phi(\mathbf{x}')=\Phi(\mathbf{x'})$ and $\psi(\mathbf{x}')=G(\mathbf{x},\mathbf{x}')$ and use $\nabla^2 \Phi(\mathbf{x}) =-4\pi \rho(\mathbf{x})$ and $\nabla'^2 G(\mathbf{x},\mathbf{x}') =-4\pi \delta(\mathbf{x}-\mathbf{x}')$ along with the boundary conditions i..e, $\Phi=\Phi_0$ and $G(\mathbf{x},\mathbf{x}')=0$ for $\mathbf{x}'\in S$. If I not made some trivial errors, you will then reproduce the required relation.


What are simple ways to have a remote client endorse an agreement?

Question: I have quite simple contract terms so far. I don't expect that any legal actions are possible (the money is not that big and we're always around the globe). It's more for the client to be aware what to expect in case of problems. Should I ask them to make a photo of their signature in that case? Or just prompt to read and confirm?
Comment: I don't think they'll give you a photo of their signature. A scan of the contract would be nice though. But if you assume that you will never take legal action anyway, why bother? Just send an email and ask for confirmation / reply.
Answer: You can use services like RPost or Docusign if you want a pure electronic approach.  But what's wrong with having the client sign a sheet of paper, scan, and e-mail?  Keep things simple.
Answer: You can use an e-signature tool like Docusign, Hellosign, or Authentisign to have the client sign the contract electronically.
Or you can have them print out a copy of the contract, sign it, scan it, and email it back to you for records.
You can also request for them to get the printed document notarized in their country or at an US consulate if available, and then have them mail the hard copy back to you.  Depending on the country, some contracts will need to be notarized in order to be valid.  I would recommend consulting with an attorney specializing in these matters.
Best of luck.
Answer: Some businesses that I use send me an email with the agreement, and ask that I reply, by email, with my name and "I agree to the terms" in the body.
This is a good solution for relatively small amounts, a few hundred perhaps, you'll have to decide where your comfort level is.
For larger amounts, and a more secure/binding contract, there are many online services which allow you to send PDF agreements by email and have them signed and returned to you, generally without any special software by your client. These will typically have monthly subscription costs.
You have to decide what is appropriate for your business. For smaller amounts, and international, it may not be cost effective to pursue non-paying clients legally. Therefore, does it it make sense to have a fancy contract system. As long as the agreement and correspondence is professional, that is probably the most important thing.


What data does AddThis share with social media platforms?

Question: If I have AddThis Share and Follow buttons integrated on my site, is there a way to tell whether the AddThis script passes any data (such as HTTP referrer) to the social networking sites upon page load?  I know AddThis gets the http referrer and can drop/view their own cookies, but I'm trying to determine exactly what the AddThis script may share with the social networking sites upon my page load (and not upon any click events).
Answer: All that is passed to the social media platforms is the URL of the page being shared as a URL parameter. The social media platforms then perform a crawl of the page in question to get the details of the page to attach to the share post. Your sites cookies and referrers are not passed along as a popup window is opened which then is redirected from the addthis server to the social media providers content sharing URL's. The referrer data they see every time is just the addthis server.


How do I display the commentor's first name and last name in the comments?

Question: How do I display the commentor's first name and last name in the comments?... rather than their username as currently shows.
Answer: This will get you a first name + last name combination if available, or just the first name or last name if that's all your user submitted.
This assumes you're interested in registered user's names. If you're going to add first and last names to your commenting form... or treat first + last name as "display name" from the back end forward (so possibly not just in commenting forms), either would be something different!
For theme functions.php or plug-in:
add_filter( 'get_comment_author', 'wpse_use_user_real_name', 10, 3 ) ;

//use registered commenter first and/or last names if available
function wpse_use_user_real_name( $author, $comment_id, $comment ) {

    $firstname = '' ;
    $lastname = '' ;

    //returns 0 for unregistered commenters
    $user_id = $comment->user_id ;

    if ( $user_id ) {

        $user_object = get_userdata( $user_id ) ;

        $firstname = $user_object->user_firstname ;

        $lastname = $user_object->user_lastname ;

    }

    if ( $firstname || $lastname ) {

        $author = $firstname . ' ' . $lastname ;

        //remove blank space if one of two names is missing
        $author = trim( $author ) ;

    }

    return $author ;

}

Your results may of course vary depending on your installation and whatever particular requirements you may have added 1) for commenting (i.e., "anyone" vs "registered only") and 2) for signing up (are First and Last Name required to register?).
Additionally, in a full installation, you might want to adjust the user profile page, where the user selects a "display name." If you're going to display firstname/lastname instead then it'd be best to deal with that one way or another - by restricting choices, for example, or by adjusting labels and instructions.
Answer: With the $comment object you can get the name and by means of conditionals you can show the author as you want.
Here I leave an example to show name and first letter of the surname (if any).
add_filter( 'get_comment_author', 'mmr_use_user_real_name', 10, 3 );
function mmr_use_user_real_name( $author, $comment_id, $comment ) {

    $firstname   = '';
    $lastname    = '';
    $author_name = $comment->comment_author;

    if ( $author_name ) {
        $nombre_partes = explode( ' ', $author_name );
        $firstname     = $nombre_partes[0];
        $lastname      = $nombre_partes[1];
        if ( $lastname ) {
            $custom_lastname = substr( $lastname, 0, 1 );
            $author          = $firstname . ' ' . $custom_lastname . '.';
        } else {
            $author = $firstname;
        }
    }

    return $author;
}

Answer: Take a look at the 'callback' argument of the function wp_list_comments. You can set a own function to render the comment list: https://codex.wordpress.org/Function_Reference/wp_list_comments.
After some googling, i found a great and complete article that may help you:
https://blog.josemcastaneda.com/2013/05/29/custom-comment/


Creating a customizable high pressure extensions line for cga 580

Question: So I'm trying to set up a keg on nitro. The way my room is laid out, id like to have the n2 cylinder far away from the regulator and keg. One side of this setup requires cga580 male, the other side requires cga 580 female.
Because of the specifics of this setup I need the line to be a high pressure line that can connect directly to the cylinder.
So my goal is to essentially make an extension cable that I can place different cga 580 ends on. I've seen this referred to as a pigtail.
I can't figure out which parts will fit which other parts though. I bought this expensive cga580 male to male pigtail thinking I could remove one of the male heads but I can't remove the head.
Does anyone know if getting a stainless pigtail with 1/4 npt female ends would allow me to add adapters that are 1/4 npt to cga 580?
If so could someone point me towards the adapters that will allow this setup?
Or if not, does anyone know og anywhere that sells a cga 580 male to female pigtail?
Or any other ideas?
Answer: I'm not sure I would try to make something that would be handling full tank pressure.
I personally use a high pressure hose from my CO2 tank to my regulator bank, but I didn't make the hose myself.
Here's a high pressure nitrogen hose that can be used to offset your regulator from your nitrogen tank.
Good luck and stay safe!


IP addresses and how to find them?

Question: i'm trying to find the IP address of a PC but when i use the CMD it shows odd stuff instead of the IP like fe80:2de0 and it go's on but i don't want to reveal any info of this PC's IP address someone plz help
Comment: This question appears to be off-topic because it is not about Apple products as defined in the FAQ
Comment: Does this actually have anything to do with an Apple product? Are you asking how to find an IP address on a Mac? Because you stated you're looking for the address of a PC, and you mentioned CMD (which is the Windows Command Prompt, not the Mac Terminal)
Comment: Perhaps he or she is using Bootcamp (or a virtual machine)?
Comment: @aglasser, the procedure to check an IP address is the same on a Windows virtual machine as it is on a normal Windows PC
Comment: I understand that, Chris. I answered because they may be running Windows on Apple hardware.
Answer: IP addresses come in two major flavors, IPv4 and IPv6.
There can be multiple ipv6 addresses per interface.  The fe80:... is a link-local address for ipv6.
Your ipv4 addresses are listed separately.  For example 192.168.10.10 ....
Answer: If Windows is set to use both IPv6 and IPv4, ipconfig will output both addresses.
IPv6 has the format that you mentioned.
IPv4, however, is probably what you are looking for. This is an x.x.x.x formatted address.
When running ipconfig, notice the lines containing "IPv6 Address" and "IPv4 Address". Both will be listed.
Comment: Downvoted. Instead of answering a question that clearly has absolutely nothing to do with an Apple product, you should have flagged the question as "**Blatantly off-topic** (this question has nothing to do with Apple hardware or software)"
Comment: The user may be accustomed to Mac OS X and not understand how to find his or her IPv4 address from inside of Windows (Bootcamp or a virtual machine). I understand that the question has nothing to do specifically with an Apple product, but I figured I would help them out and answer their question regardless.
Comment: The question is also an extremely simple one that could have been solved after spending a grand total of 5 minutes on Google (less time, I think, than it took the OP to even write this question). It clearly shows a lack of research.

IP addresses and how to find them?


Open Graph Beta Authenticated Referrals

Question: From reading the open graph beta auth doc it seems like the intent of authenticated referrals is to provide tighter site integration with facebook for open graph beta Actions we define. However getting those permissions still seems to be tied to a user session/token which expires after 90min or so.
Is there a way to make calls to our open graph beta Actions without have to re-authenticate every 90min without request full offline permissions.  It seems ridiculous to expect to re-authenticate that frequently for a defined Action.
Answer: No, you'll have to request full offline access. (Everyone else is doing it.)

Open Graph Beta Authenticated Referrals


What is the length of tunnels puffins dig in the Farne Islands?

Question: I was watching this video and the host said that the puffins dig over 80km of tunnels in the Farne Islands. Is that true? I couldn't find a source to confirm that number.
Answer: If that's the current number of tunnels at any one time, it can be right, it depends if they dig a new nest every year.
Farne islands has mostly horned puffins with rainbow beaks as opposed to tufted puffins which have an different beak, the former makes nest around 1 meter and the latter up to 2.75 meters,
Puffins lay one egg per year, there are 30-50,000 pairs of them on Farne islands, that's about 40km of new tunnels every year.
Every five years the trust carries out a larger audit, the last being in 2013, when puffin numbers on the islands were strong, at just under 40,000 pairs.
That was an increase on the 2008 figure when a stormy summer hit numbers hard from a high of more than 50,000 down to 36,000 breeding pairs.


What does "occasion genius" mean?

Question: A friend of mine gifted a sticker on which, "occasion genius" is written. I wonder what does that mean. I am not a native speaker, and I have really struggled to try to figure that out.
Comment: This is not a common English phrase, nor does it make sense on its own. Is it a sticker meant for advertising a company? Such as: https://www.linkedin.com/company/occasion-genius ?
Comment: It's more like what @sharur says in the first possible answer. There is a brain-human cartoon which looks like it's a smart one, and says "occasion genius".
Answer: "Occassion Genius" is not a common English phrase. As a native (American) English speaker, it would look out of place to me, especially on a sticker; I would look to context to decipher the meaning, but would think one of the following things:

A grammatical error, which should be "occasional genius", meaning intermittent and infrequent "genius".

A corporate name, slogan, motto or advertisement tagline. As legal IP protections are more easily obtained for "abnormal" or "not commonly used" words or phrases, businesses tend to use "irregular" phrases for such things. (As an example, this is why IBM changed their name to their initials, away from their original name "International Business Machines").

A very unusual usage of "occasion" as a noun adjunct,    modifying "genius" in a commonplace pattern used to indicate subject mastery. I would interpret this as meaning a declaration that one is a "genius" at hosting or planning occasions and/or events, especially formal events.
Answer: As others have said, it's not an English phrase with a recognized meaning.
As @sharur says, it could be a mistake, intended to say "occasional genius". That is, sometimes you have bursts of genius but most of the time you don't. That's the sort of half-compliment I'd expect to hear among co-workers.
Or maybe he's using "occasion" in the sense of "special event", like birthdays and anniversaries. So the meaning could be that you are a genius at organizing office parties.
If neither of those seems likely in context ... Is this a professionally produced sticker? I mean, something mass produced that many people would buy? Or did your friend make it? If it's mass produced, I'm stumped, because it doesn't make any sense. Is there any other information on the sticker, like other text or a picture that might give a clue to the meaning? If your friend made it himself, then it becomes more likely that he either made a grammar error, or that it has some specific meaning between the two of you that he thought you would understand.
Sorry that I'm not able to be much help.

What does "occasion genius" mean?


How to maintain the same pixel appearance, when rendering a exported image sequence

Question: I need to import a animation png (with alpha) sequence into Blender, then put it on a geometry (a simple plane) to move some vertices (very subtle animation) and after that, export it again with the new deformation animation.
How can i maintain the same pixel ratio/animation when rendering the output? i don't want or need Blender to soften the edges for example.
(i want to render this on render internal, with plain colors, not adding any kind of light)
I also need to mention, the frame 0 need to be the same as the static image, with the same pixel appearance, without any 'filter' appeared.
Thanks in advance.
Comment: When you say move some vertices, you think to what ? If you don't use the video sequence editor with exact frame ration in input as in output, your render will pass through a matrice that will recalculate each pixel, and it won't be the EXACT same pixel (there is anti aliasing and other things) If you are effraied of losing some detail, render 10% bigger depending on your needs.
Comment: With the vertices i mean the vertices in the 3D plane, imagine a 3D 'word' that has kind of 3d extruded vertices, and i want to move these, but just a little.
Comment: If you move slightly a vertex, it will have to resample new pixel to regenerate this change.

Best you can do is turn into shadeless, change filmic to srgb (if it is what you need) and it will be ok for your needs i think.
Answer: Imagine an image of 140x139 (this one : )
If you import in blender with images as plane addon, with emission or shadeless shader
And set your render output to the same resolution and framerate
And add an orthographic camera above to the center of your image, with orthographic view
[
[
You can adjust the size by zooming a lot in a corner from the camera view (Numpad 0) and adjust the Orthographic Scale.
Set color management to standard to don't have filmic transformation
And sampling to 1 to avoid anti aliasing.

The resulting image shouldn't be different.(I checked on photoshop : )
However, if you want to move the plane (rotate, or distort) the pixel will change as the raster sample the same pixels to in the same location. It will rasterize the image depending on the new transform, some pixels may stay the same, but some others will change.
Example of a distorted image :


How can I set notations for different instruments in Logic?

Question: I'm trying to set up a score in Logic for multiple parts, and the horns are each in their own key signature (trumpet, saxophone, trombone) which isn't necessarily the key that the piano is recorded in. How can I get the Logic file to play back the sampled instruments with the correct notes, but have the sheet music generated display the notes as they would need to be transcribed for the live musicians? I've played around with global key signature changes and that's not helping.
Comment: Can someone explain to me the procedure here at AskDifferent to create a new tag? We should have a tag for "logic" referring to the Apple Logic software application.
Comment: @WheatWilliams Type it in the tags section and it will create a new tag. Note: only users over 300 rep can create tags. (I don't know if you figured this out already)
Answer: You will have better luck if you post your question at the Apple Support Communities discussion forum for Logic Studio.
https://discussions.apple.com/community/professional_applications/logic_studio
For instance, see this post: "How do you set up Logic Pro 9 for transposing instruments?"
I would also suggest that if you are serious about working with sheet music and arranging parts for orchestral ensembles, that you look into creating your scores in the Sibelius or Finale dedicated music notation programs. Logic's sheet music capabilities are quite limited by comparison. Sibelius and Finale both have excellent capabilities for playing back your sheet music score with virtual instrument libraries. After your score is complete, you can move to Logic for recording audio if that is required.
Comment: Thanks for the tip. I know about Finale and Sibelius, I'm just between jobs and it's nice to use the tools that I have. The stuff we're doing is pretty simple, I just want to find an easier way to make it print and sound the way it should.


Why does temperature of a system not change during a phase change of the system if even the internal energy of the system increases?

Question: I can't understand why the temperature of a system doesn't change during a phase change of the system if even the internal energy of the system increases. The problem is that I have never really understood the concept of temperature. Is the 'average' energy of all the particles in a system? If not, what is it and why does it not increase when the internal energy increases during a phase change?
Comment: Temperature is not a "concept". It is a measurable parameter for the system. The connection to kinetic energy is a postulate of statistical mechanics, and it is stated not that temperature is defined by kinetic energy but rather that kinetic energy is defined by temperature. So perhaps you should correspondingly invert your thought process. Ask yourself what conditions must be met to have (internal) energy depend only on temperature. Alternatively, ask under what (other) conditions could (internal) energy change even though temperature remains constant.
Comment: Adding to what Jeffrey said, you can start from the fundamental thermodynamic relation (https://en.wikipedia.org/wiki/Fundamental_thermodynamic_relation) and how an internal energy changes while a system goes from one phase to another phase (assumed to be more disordered, having more entropy).
Answer: Although previous answers are correct in connection with atomic, and classical systems, I would like to give a more general and complementary point of view, which may help in improving the conceptual understanding of what is behind the concept of temperature.
The really misleading concept one has to remove in order to understand why temperature does not change during a first order phase transition is the proportionality between internal energy and temperature, which is true for ideal gases but does not have universal validity, even far from phase transitions.
For classical systems which have kinetic energy, it is possible to show (as a theorem, it is the content of the so-called equipartition theorem) that the average kinetic energy is proportional to the temperature of the system. Therefore an explanation of the constancy of the temperature at a phase transition in terms of an increase of potential energy while kinetic energy remains the same is possible (see Bob D's and Kraig's answers).
However, there are two limitations of such a point of view:

it holds only for classical systems, because, as soon quantum effects
enter into play, equipartition theorem is not valid anymore and there
is no proportionality between kinetic energy and temperature, thus
phase transitions at low temperatures would become ununderstandable.
Even for classical systems, there are thermodynamic systems where the
kinetic energy does not play a direct role in the thermodynamic
description. A simple example is the case of magnetic phase
transitions.

Moreover, the explanation in terms of interplay between kinetic and potential energy does not really justify why temperature remains exactly constant and it does not happen that there is simply a different share between increase of kinetic and potential energy.
A more general point of view, which sheds some additional light on the concept of temperature is the following.
From a purely thermodynamic point of view, the temperature can be defined as the inverse of the slope of the entropy surface $S$ as a function of the internal energy $E$:
$$
T = \frac{1}{  \frac{\partial S}{\partial E}  }
$$
where all variables of $S$ different from energy have to be kept constant when taking the partial derivative.
On the other hand, the thermodynamic definition is consistent with the Boltzmann's statistical mechanic definition of entropy as proportional to the logarithm of the number of microscopic states available to the system at given energy:
$$
S(E) = k_B \log \Omega(E)
$$
These two ingredients help to understand, on a completely general base, why temperature remains constant at a first-order phase transition.
Such a transition is characterized by the physical phenomenon of phase coexistence. I.e., there is an interval of energies (say $[E_1,E_2]$)where the system cannot stays anymore in a homogenous one-phase state, but becomes inhomogeneous, with coexistence of macroscopic regions made of one phase at the lower energy $E_1$, and others mode of the second phase, at the upper energy $E_2$.
As a consequence of this fact, entropy in the whole interval $[E_1,E_2]$ is simply a linear combination of the boundary entropies:
$$
S(E)=S(E_1)+ \frac{E-E_1}{E_2-E_1} \left( S(E_2)-S(E_1) \right)
$$
Therefore, it is an immediate consequence of the thermostatistical definition of temperature as derivative of the entropy, to obtain the constance of $T$ all along the phase coexistence interval. The physical intuition one can build on top of this description, just adding the extensiveness of the entropy,  is that temperature remains constant because of the linear increase with the energy of the spatial region, in the coexisting system, filled by the phase at higher energy.
All that is not in contradiction, but as a complement to the explanation in terms of kinetic energy, valid for the classical systems where kinetic energy plays a role.
Answer:
I can't understand why the temperature of a system doesn't change during a phase change of the system if even the internal energy of the
  system increases.

The short answer is that the internal energy increases without a temperature change because, during a phase change, there is an increase in the potential energy of the system (the change in internal energy associated with the increase in separation distance of the molecules in the system) and not a change in the average kinetic energy of the molecules of the system, which is associated with a change in temperature of the system.
Since the total internal energy $U$ of a system is the sum of its microscopic kinetic and potential energies, or
$$U=KE+PE$$
The internal energy can increase or decrease with an increase or decrease of potential energy without any change in the kinetic energy of the system (which would be indicated by a change in temperature). This is what happens during a phase change where the heat added or removed is called the latent heat, i.e., heat that does not change temperature but that increases or decreases the internal potential energy of the system.
Hope this helps.
Comment: @Anton Theres a difference between a change in intermolecular potential energy that only occurs during a phase change where there is no change in molecular kinetic energy and thus no change in temperature, and a change in intermolecular potential energy that does not occur during a phase change and which may occur together with a change in kinetic energy and temperature. I suspect the Keesom force/temperature relationship relates to the latter.
Comment: What if the mean potential energy of the system depends on the temperature (e.g. Keesom force has $-T^{-1}$ dependence)? Shouldn't temperature increase in that case? What is so special during phase transition?
Comment: @Anton  Can you cite a reference that states Keesom forces cause a change in temperature during phase transition?
Comment: I don't say that Keesom forces cause a change in temperature during phase change. I am trying to understand why there is no such change if potential energy depends on temperature.
Answer: To help answer this question, I will first start with an example that should help you to understand what is happening.
Consider a positively charged ball and a negatively charged ball on a table stuck together; pretend the charges are locked into the balls, so they do not become neutral despite touching. What happens when you try to pull them apart? They resist! In order to pull them apart, you must input energy, and thus the internal energy of this system increases. This is easy to see, because now the balls have a potential energy, as they want to move back together. This is a similar explanation for why the internal energy can change while the temperature remains constant.
During a phase change from a liquid to a gas, the molecules are being pulled apart, just as the charged balls above were pulled apart. A liquid does not form unless there are attractive forces to hold it together. In water, you have polar molecules, so the main attractive force is the H$^+-~$O$^-$ attraction force. In other materials, you might see Van der Waals forces dominating. Regardless of what the force is, there is some binding force that must be overcome in order to change the state of the material; thus the change in internal energy is attributed to the increase or decrease in potential energy that arises as a result of the phase change.
Please note that while I used liquids as an example, this logic is applicable to all phase changes.


Can I point a example.com/subdirectory to another IP address?

Question: I have 2 servers and 1 domain name. Is there a way to point the domain at server 1 but then point example.com/subdirectory to server 2?
Answer: No, because domain translation is done before the request of the resource. The resource is your path /subdirectory. The domain-translation is example.com.
You can use redirection to redirect to an other domain if someone access example.com/directory to directory.example.com and map this domain to an other IP.
Answer: If you do not mind using a sub-domain, this is possible. You can redirect the directory to the sub-domain.
Otherwise, if you have your own network or your host can host a proxy server you would be able to proxy any request to any server however you like. It has been 12 years since I have done this, but we operated several proxy servers including reverse proxies that allowed us to create many URLs that appeared to exist on one domain and point them to many servers and implement a form of load balancing. As well, some services we offered were on different operating systems, application platforms, portals, CMS, application servers, and so on. Using proxies allowed about 200 servers to appear as one verbose website.
You do not have to get this complicated of course. But this is something you can look at for your needs. Research using Apache. Apache can do what you want and this is something your host should be able host easily or implement on your own network for a decent price. Also keep in mind that there are proxy servers both software and hardware that offer options. Apache is free however and works extremely well. Just be careful of the configuration or you will get 100,000+ proxy bounces from China per hour within seconds. But do not let that scare you! Just be thorough in your work and you should be fine.


Who are the wise and the disputer (debater) and what is the Biblical clue to know them?

Question: 1Corinthians 1:20 :- Where is the wise? Where is the scribe? Where is the disputer of this age? Has not God made foolish the wisdom of this world?
Answer: Let's look at the context.

1 Corinthians 1:20 Where is the wise person? Where is the teacher of the law? Where is the philosopher of this age? Has not God made foolish the wisdom of the world? 21For since in the wisdom of God the world through its wisdom did not know him, God was pleased through the foolishness of what was preached to save those who believe. 22 Jews demand signs and Greeks look for wisdom, 23but we preach Christ crucified: a stumbling block to Jews and foolishness to Gentiles

Paul debated with some of these people in Athens.

Acts 17:16 While Paul was waiting for them in Athens, he was greatly distressed to see that the city was full of idols. 17So he reasoned in the synagogue with both Jews and God-fearing Greeks, as well as in the marketplace day by day with those who happened to be there. 18A group of Epicurean and Stoic philosophers began to debate with him. Some of them asked, "What is this babbler trying to say?" Others remarked, "He seems to be advocating foreign gods." They said this because Paul was preaching the good news about Jesus and the resurrection.

There are quite a few commonalities in these two passages. Both concern the Jews and Gentiles. Both speak of wise persons and their wisdom/philosophies. Both deal with debates and arguments. Both contrast human and divine wisdom. Both conclude with the winning side of Christ crucified and the resurrection.
Answer: There are at least two kinds of wisdom in Scripture. Our Lord's stepbrother, James, describes them this way:

13 Who is wise and understanding among you? Let them show it by their good life, by deeds done in the humility that comes from wisdom. 14 But if you harbor bitter envy and selfish ambition in your hearts, do not boast about it or deny the truth. 15 Such "wisdom" does not come down from heaven but is earthly, unspiritual, demonic. 16 For where you have envy and selfish ambition, there you find disorder and every evil practice.

17 But the wisdom that comes from heaven is first of all pure; then peace-loving, considerate, submissive, full of mercy and good fruit, impartial and sincere. 18 Peacemakers who sow in peace reap a harvest of righteousness(James 3 NIV, my emphasis).

Having been in more graduate-school classes at the university than I can count, I have been exposed to worldly, earthly wisdom. There, quite often, knowledge parades as wisdom. The two virtues are not the same, however.
That is not to say knowledge is unimportant. In the biblical Book of Proverbs, the word wisdom appears 55 times, but knowledge is not far behind at 38 instances (in the NIV). God is surely pleased when academics, scientists, and theorists of every stripe and perspective build upon (or choose not to build upon!) the knowledge of previous generations and in so doing discover cures to diseases, invent things that make life safer, more fulfilling, and even easier.
Do all those theorists, scientists, and academics share a bedrock biblical and spiritual foundation? No. But even those who have no allegiance to God whatsover, realize in their better moments there is a force much greater than knowledge at work in what they do professionally, and that force is a "higher power" that is insurpassable.
Even the seemingly simple metaphors and paradigms at work in every specialized field you might care to name are built upon knowledge but are dependent on wisdom to apply that knowledge in God honoring and human benefitting ways for "the greater good". Barney Clark, for example, in 1972 became the first recipient of a permanent, artificial heart. The foundational and heuristic metaphor behind the artificial heart? The heart is a pump! Simple, yet profound.
Take nuclear energy, for example. Not until the 1930s when physicist Enrico Fermi first showed that neutrons could split atoms was the untapped potential of nuclear energy discovered and demonstrated to be a chain reaction having harnessible power for both good and evil. The unleashing of an atomic bomb could--and did--wipe out hundreds of thousands of Japanese in mere moments.
By the same token, however, to this day in America, nuclear energy provides about 20 percent of the electricity which heats and cools our homes, lights our streets, and powers our super computers and their "cloud computing."
All this to say: Worldly, earthly wisdom--the kind that comes from the so-called wise intellectuals and debaters among us has its roots in pride, envy, selfish ambition, and, at best, half-truths devoid of wisdom. Need we be reminded that knowledge tends to puff up, but love seeks to build up (1 Corinthians 8:1)?
In short, in the apostle Paul's day as well as in our own, Christians are able to recognize and distinguish between false wisdom and true, biblical wisdom. The former, ultimately, has the ability to steal, kill, and destroy (see John 10:7-14). The latter endues knowledge with a commitment to the greater good, which writ large is "pure; then peace-loving, considerate, submissive, full of mercy and good fruit, impartial and sincere" (James 3:17-18, excerpts).
Finally, the scribes, the wise, and the debaters in the apostle Paul's day were called Sophists. These teachers of public speaking and perveyors of half-truths and rules of thumb were informed by the foundational presupposition of Protogoras, the 5th century BC philosopher and first Sophist, that "Man is the measure of all things." Their "wisdom" was characterized by impressive eloquence but was fueled by the profit motive and the desire for fame and acclaim. Not so, the apostle Paul"

And so it was with me, brothers and sisters. When I came to you [Corinthians], I did not come with eloquence or human wisdom as I proclaimed to you the testimony about God [a, or proclaimed to you God's mystery] 2 For I resolved to know nothing while I was with you except Jesus Christ and him crucified. 3 I came to you in weakness with great fear and trembling. 4 My message and my preaching were not with wise and persuasive words, but with a demonstration of the Spirit's power, 5 so that your faith might not rest on human wisdom, but on God's power (1 Corinthians 2 NIV).
Comment: Very good answer. +1
Comment: @Dottard: Thanks for your encouraging words! Don
Answer: This passage is about preaching the gospel, or to be more precise, who preaches that gospel. And he compared the 'valued' intellectual philosophers to those that do. (Greek culture esteemed intellectual prowess.). Paul's claim was that these could not 'preach' the gospel, because they didn't understand it. Intellectual understanding is not required for spiritual discernment - anyone can understand the gospel.
The context begins in verse 17, and to understand the meaning of the verse you quoted (20) you need to start back at 17. Let's look at the previous verse ...
1 COR 1:19 For it is written, I will destroy the wisdom of the wise, and will bring to nothing the understanding of the prudent
Paul was referring to Isaiah 29:14. This passage from Isaiah is very applicable by itself, but it is even better if you take it in its context. In fact, Isaiah 29:14 begins with the word "therefore," directly linking it to what had been said in verse 13.
Isaiah 29:13 makes it clear why God is going to bypass the wisdom of mankind. It is because they were only going through the motions of serving God; their hearts were far from Him.
So back to 1 Corinthians 1 verse 20. What was Paul speaking of when he asked 'where?', Was he asking the location of these intellectuals? Certainly not! He was saying, "How do these intellectuals relate to ministering the Gospel?"
This can be seen by the context. In 1 Corinthians 1:21, Paul said that God uses the foolishness of preaching to save those that are lost. He doesn't do it through 'mental persuasion'.
Then later on, starting with 1 Corinthians 1:26, he drew their attention to the fact that not very many of the world's elite are called to minister the Gospel. He continued this same thought in 1 Corinthians 2 as he used himself as an example of preaching the Gospel in simplicity instead of wisdom of words.


How to turn DC motor to specified angle

Question: We have bought 2WD turtle bot with Arduino.
http://www.dfrobot.com/index.php?route=product/product&product_id=65#.UZxObIoW3RQ
Now we need to turn it to 90 angle.
We need to understand how we can do it.
We don't have encoders.
Comment: You can always make a rotation encoder with an LED and a photodetector placed on opposite sides of the spokes of each wheel, assuming the wheel is a spoked one. An expectation of angular control Without some form of encoder makes the question a bit "pie in the sky", hence down-voting.
Answer: Drive the left and right motors in opposite directions.
If your design requirements constrain you to having no feedback, your best bet is to experiment with the time you turn on your motors. Note that this value can change based on things like the battery voltage and floor texture.
Since it has an Arduino, I'd suggest adding a nice gyroscope and integrating the output to find your angular displacement. Or some other way to find out how far you've turned.
Comment: The problem with the time-based approach is, the degrees per second will vary widely due to floor resistance, battery charge level, wheel bearing wear, even minuscule slope of the floor, and any grit or dirt on the floor. The gyroscope solution is much more practical, though gyros too will have significant drift and jitter (due to motor vibration) so repeatibility will be poor at best.
Comment: I agree with you about dead reckoning. But my robotics team has seen good results with the SparkFun 9DOF Razor IMU for heading. With some filtering and calibration, we see less than 1 degree per minute drift in heading measurements.
Comment: Fair enough: A 9 DOF IMU which incorporates an accelerometer and a compass should be just about right.
Answer: The turtle bot has two geared motors. These can be turned ON and OFF and FORWARD and REVERSE. Without an encoder to measure the actual rotation you will need to basically guess (experiment with) the LENGTH OF TIME (DELAY) you activate the motors.
There are two ways you can turn a 90 degree angle.
(i) Turn ONE motor ON for a 'lazy' turn that will pivot around the other wheel. Depending on the speed of the geared down motor start with a 1 second DELAY and measure the angle turned. From this value (degrees per second) you can calculate the delay needed to turn 90 degrees.

(ii) Turn one motor ON + FORWARD, turn the other motor ON + REVERSE. This will produce a 'sharp' turn pivoting about a central point on the axis. This turn is much faster and effectively turns the bot on the spot. Again experiment with a given time (DELAY) and measure the angle turned the calculate the delay time needed.
Comment: The problem with this approach is, the degrees per second will vary widely due to floor resistance, battery charge level, wheel bearing wear, even minuscule slope of the floor, and any grit or dirt on the floor. It is a thoroughly impractical theoretician's approach.
Comment: @ Anindo - I think it answers the question that was actually asked with a constraint of no encoder - The question does not ask how can they build an encoder or angle measurement device to turn the bot accurately though 90 degrees which would have made a better question and produced a totally different solution from me - I totally agree that it would accumulate errors due to the variety of conditions you have stated but I was already aware of those. With over 50 years of practical experience I really object to your use of the personally derogatory term 'impractical theoretician'.
Comment: I called it like I saw it - The answer is what it is, your personal credentials notwithstanding. Sorry.
Answer: You can know, approximately, how fast the motor is turning by sensing the back-EMF of the motors without encoders. See How can I measure back-EMF to infer the speed of a DC motor?
Unfortunately this doesn't really tell you how much the robot has turned. Any error in your measurement will accumulate, and these errors will be significant. You will have errors from your back-EMF measurement. Most likely you will have more serious errors from wheel slip, which will vary based on the surface the robot is on and the dust accumulating on the wheels. Thus, back-EMF measurement, or even direct motor speed measurement with encoders, may not be productive.
A gyroscope would allow your robot to measure how much its turned. Integrate this into a feedback loop. A gyroscope is still subject to drift, but much less than other methods. An alternate method would be using a magnetometer to sense Earth's magnetic field like a compass.
Comment: Make sure you shield the motors so the magnetic field doesn't affect the compass. I do know someone who claims to have wandered in circles on night excersizes with a magnetic tourch and compass...

How to turn DC motor to specified angle


How can I run two instances of the iPhone simulator (Aspen) to try out the WiTap example?

Question: Has anyone had any luck running two instances of the iPhone simulator to test network code between the two?
Comment: possible duplicate of [Is there a way to simulate multiple iphones using xcode/iphone sim?](http://stackoverflow.com/questions/896487/is-there-a-way-to-simulate-multiple-iphones-using-xcode-iphone-sim)
Answer: No but you can run the Simulator and the WiTap code on your phone. I've done that and it's pretty cool.
Just provision the WiTap code for your development provisioning profile and load it on the phone. Then, making sure the phone is on the same network wifi, you can run your development machine with the Simulator running WiTap, and the phone running WiTap.
Works like a charm.
Answer: FYI, frankodwyer's idea of running iPhoneSimulator as a different user doesn't work. Quoth Finder: "You can't open the application 'iPhone Simulator' because another user has it open. Ask the other user to quit the application, then try again."
Answer: Just an idea, but you could try adding another user to your mac and run the simulator within both accounts. (I am pretty sure that the simulator config is stored relative to the user home directory)
First step would be to get that going under user switching. If that works, it should hopefully set up everything the simulator needs for a second instance. Then log out the second account, go back to your usual account. Now try running a second simulator instance from the command line in a terminal, but as the second user account (use 'su -' to switch the other user account before running the simulator).
I'm not at my mac and offhand I don't know the name of the simulator binary or I would try this out and paste some code for you.
Answer: Follow these steps to test your app.
You have to do one thing for whole process first : Go to Project - > Edit Project Settings -> tick on option - Build independent targets in parallel.
Debug code that will create your app in simulator For Example your App name is - Instance
Close Simulator
Go to Project->New Target -> Instance2 Add "Bundle display name : Instance2" in Instance2.info.plist file Set Executable Name : Instance2 Select Instance2 Target -> Go to Project -> Set Active Target -> Instance2 Build with Instance2
Note : Do all carefully otherwise you have to reset your simulator For Reset Simulator -> Run Simulator -> iPhone Simulator -> Reset Content & Settings...
Now You have two apps in simulator and you can test app on all instance.
Hope it will help you :)
Ravikant Nagar


Git add a folder to all branches in a repository

Question: I have a git repository on my local computer with many, about 10, branches. In the root directory of this repository there is a folder that is currently not tracked in any branch. I want to now start tracking this. If I do git add foldername/* and then git commit it will add the folder only to the current branch. Can I use a git command so that the folder is added to all the branches, without manually checking out each branch and adding the folder to that branch? If it is relevant, I want to state that there are a couple of files (not related to the above folder) that are different in each branch and I want to keep it that way. That is, the command you suggest should leave the other files untouched.
Thanks in advance for your help.
Answer: There's no simple way to do this.  The only way to achieve it would be to add the folder individually to each of the 10 branches, or add it to one folder and merge that commit individually into each of the other branches.
Answer: Branches are made to be treated separatly until you merge them. However, if you really don't want to do it manually, you can use some refinement of the following script:
$ git checkout master
$ git add foldername
$ git commit -am "Adding foldername"
$ for i in `git branch`; do git checkout $i && git cherry-pick master; done

Answer: reset instead of checkout will do exactly what you want, zero checkouts, nothing touched in the worktree
# from a worktree with nothing staged
for b in `git branch|sed s/.//`; do
    git reset $b
    git add folder
    git commit -m'add folder'
done
git reset where_you_were_before


How can I delete Telegram messages from their server?

Question: Since I heard that Telegram stores all the chats including messages, pictures, audio & video material on their servers (cloud) I would like to know how can I delete all of my chats from my phone and also from their servers?
Comment: This is a question for Telegram support
Answer: See the FAQ: telegram.org/faq

Q: How do I delete my account?
If you would like to delete your account, you can do this on the deactivation page. Deleting your account permanently removes all your messages and contacts. All groups and channels that you've created are orphaned and left without a creator but admins retain their rights.
Q: What happens if I delete my account?
As was just mentioned above, all your data will be flushed from our system: all messages, groups, and contacts associated with your account will be deleted. That said, your contacts will still be able to chat in the groups that you have created, and they will still have their copy of the messages you sent them. So if you want to send messages that can vanish without a trace, try using our self-destruct timer instead.
Termination of a Telegram account is irreversible. If you sign up again, you will appear as a new user and will not get your history, contacts or groups back. People, who have your phone number in their contacts, will be notified. The new user will be displayed as a separate conversation in their messages list and their conversation history with this new user will be empty.

(Emphasis mine)
From the privacy policy:

Everything you delete is deleted forever.


Estimating wind velocity behind a wind turbine

Question: According to the Wikipedia page on the Betz Limit, the outgoing wind velocity behind a wind turbine can be as low as 33% of the incoming wind velocity. However, this figure assumes that the turbine is operating at the theoretical Betz limit. Since most turbines operate below this limit, is there a straightforward formula for calculating a more realistic estimate of the wind velocity behind a turbine?
Answer: The wind behind an operating turbine is turbulent. So no, there is no straightforward formula for calculating a more realistic estimate of the wind velocity behind a turbine. The existence of such a formula is literally a million-dollar question.
However, calculating the approximate speed of the air isn't too hard: we know the energy in any given mass of air is $\frac{1}{2}mv^2$. So if we know the speed upwind of the turbine, the density of that air, and the amount of electricity generated, we can calculate the energy in the air downwind of the turbine, and thus its speed. Assume 95% efficiency for the turbine mechanics & electrics (for kinetic energy that has been harvested and is being converted to electricity), and you'll be near enough.
The study of the wakes of wind turbines is a rich and complex one, with quite a lot of work going on at the moment
Here are some wakes that nature has kindly visualised for us, at Horns Rev windfarm in Denmark (photo courtesy Vattenfall Wind Power)


What is the way to get rid of the redness that appears on the skin immediately after threading the upper lips?

Question: I have the combination skin. Skin becomes visibly red after threading the upper lips. What is the way to get rid of the redness that appears on the skin immediately after threading the upper lips?
Answer: I've actually had to look up this procedure first. From what I've read in this article the procedure itself seems sanitary.
Still our skin surface contains bacteria. When the hair is removed, the bacteria can enter through the pilo-sebaceuous duct.

Image source: http://www.aknicare.co.uk/science.php
This is why it would be good to disinfect the skin prior to the procedure. The choice of antiseptic will depend on your skin sensitivity. 70% ethanol is a very effective antiseptic, but if you have sensitive skin (and the area above the mouth is sensitive in its own right) then ethanol can cause irritation.
Another, somewhat milder antiseptic is boric acid, but if it is absorbed and has systemic effects it can be toxic. This is why its use in cosmetic products has been restricted in the UK. (Martindale: The Complete Drug Reference, 34th edition) This is why (if you chose to use it) it should be used on intact skin only. (An aside: The use in children under 3 years of age is now forbidden. This is because children have more permeable skin, and absorption is more likely than in adults.)
You can always ask your pharmacist or dermatologist to recommend you an antiseptic that would be good for you to use on this sensitive area.
After the procedure you can use a bit of talc powder to lessen the irritation.
From Martindale: The Complete Drug Reference:

Purified talc is used in massage and as a dusting powder to allay irritation and prevent chafing. It is usually mixed with starch, to increase absorption of moisture, and zinc oxide. Talc used in dusting powders or as talc poudrage should be sterilised.
Inhalation of talc can cause respiratory irritation; prolonged exposure may produce pneumoconiosis.

Because the area is right under your nose, you should just be careful not to inhale talc when you apply it, and you can apply a thin layer (there is no need for a thick layer). The microbiological quality of talc powder is very important, so make sure to purchase a reliable brand.
Comment: Thanks @anongoodnurse ! The first part of the response is based on anecdotal knowledge (actually from ladies who wax this area - that prior disinfection reduces the redness, so I hoped it might translate to this procedure) and my own logic. My guess would be that it is a mild local inflammatory response, but that local inflammation is somewhat enhanced in the presence of bacteria. Talc should soothe the irritation after any sort of hair removal - shaving, waxing or tweezing, and since the process of threading is similar to tweezing it should apply to that as well.
Comment: Because the redness occurs immediately after plucking, I'm tempted to believe it has little to do with infection, but perhaps a lot to do with a mild local inflammatory response? Or can infection appear that quickly? I've not looked into it. Your answer is interesting! I'll be curious to know if it helps the OP. :)


Toe Nailing Studs to Plates

Question: Perpendicular set studs sometimes shift during toe nailing to flat plates, top and bottom. Is there a way or a tool to clamp 2x4 perpendicular?
Answer: Measure and mark your stud placement on both plates and make sure the studs are on the marks when you nail them.
Generally, I lay the plates next to each other with the ends aligned.  Then mark and strike the line across both simultaneously.  Don't forget to mark which side of the line the stud goes on.
Answer: I think what you're asking about is toe nailing

It's a very basic method of nailing things together but there is some knack to it.  The stud does want to move laterally from the intended spot.  There are a few ways to counter that.
The name "toe nailing" comes from maybe the most basic way to keep the stud from slipping:

That kind of works, but it's pretty awkward and there's lots of situations where you can't get set up that way.
It's simple enough to build a jig to hold the stud in place.  The one pictured below would be cut to 14.5" for studs spaced 16" on centers.

Of course that won't work where the studs are not spaced at 16".
You can find lots of other jigs for toe nailing but I personally just start nailing with the stud a little off the mark and let it slip into place as I nail.  This is not a perfect method but with a little practice it's good enough.  If I am struggling I'll start a nail into the plate on the mark to keep the stud from slipping - just a half inch or so in - and remove it after the other side is nailed.

Toe Nailing Studs to Plates


If the truncation function provides differential privacy

Question: We have values in the range $[a, b]$, and we apply a differential privacy mechanism to add noise to these values. After obtaining the noisy values, we employ the following truncation function: if a noisy value falls below $a$, it is truncated to $a$, and if the noisy value exceeds $b$, it is truncated to $b$. Does this truncation function ensure differential privacy, assuming that the mechanism itself provides differential privacy?
Answer: It depends on what you mean, namely

does it maintain the level of differential privacy one gets from adding noise, or
does it enhance the level of differential privacy one gets.

The answer to the first question is "trivially yes".
This is because differential privacy satisfies a "data-processing inequality", in the sense that if a mechanism $M(x)$ satisfies some notion of differential privacy, then $f(M(x))$ does as well, for any function $f$.
There are certain situations where one can show that natural $f$ enhance the level of differential privacy. This is generally called "privacy amplification". I don't know if clamping does, but don't see why it would.
But various other types of post-processing (for example sub-sampling) do enhance the level of differential privacy one obtains.