The Mars parachute opened against a black sky on Earth but a blue-magenta sky on Mars during Perseverance landing. How is it possible?

Question: I have discovered two images (see below) and I do not find an explanation for the different color of the sky as seen from below the parachute just starting to deploy. The video with the test performed on Earth says that the altitude was chosen in such a way as to simulate the conditions on Mars.

See: Testing a Parachute for Mars

See: Real Footage of The Perseverance Rover Landing on Mars
Comment: I'm voting to close this question because the OP is pushing a theory that the Mars landing is fake.
Comment: In both videos the color and brightness of the sky varies rapidly, depending on both altitude, instantaneous camera angle with respect to the Sun, and affected by probably exposure setting and color balance. It does not make sense to compare one screen shot to another screen shot. There are many questions and answers about sky brightness and color here in Space SE, in Astronomy SE, Physics SE and Earth Science SE and several Wikipedia articles.
Comment: @azot: the apparent colour of the sky changes dramatically as the parachute opens because the camera is adjusting its exposure as now there is an enormous bright thing (the parachute) in its field of view, and its metering therefore compensates as it doesn't want to have most of that bright thing appear as blown out whites.  See [Schwem's answer](https://space.stackexchange.com/a/50344/21103) which talks about this.
Comment: No, the color of the sky does not change as long as the parachute does not cover the view of the camera. This is the reason I posted two pictures (on Earth and Mars) just before the moment the parachute opened.
Comment: @azot No. uhoh is correct. The sky colours do change. For example. [At 2 sec in the Perseverance Footage](https://youtu.be/L8zy4UA0D3I?t=2), the sky has a tint of blue. But at [11 sec into the footage](https://youtu.be/L8zy4UA0D3I?t=11), the sky is now much darker.
Comment: @StarMan , I have already explained in my previous comment that the opening of the parachute changes the color of the sky, as viewed by the camera. On the video posted by you, it is self evident that the moment the parachute opens the color of the sky changes abruptly.
Answer: Hard to say, there's a lot of factors at play. Different angle relative to the Sun. Different solar intensity. Different atmosphere. Different cameras. Different exposures. The only thing that's the same is the air density and parachute. You're going to get different pictures.

That video is from the third JPL ASPIRE (Advanced Supersonic Parachute Inflation Research Experiment) test. It's at 38km to simulate 10 km above Mars.

When onboard sensors determined the payload had reached the appropriate height and Mach number (38 kilometers altitude, Mach 1.8), the payload deployed a parachute...

"Earth's atmosphere near the surface is much denser than that near the Martian surface, by about 100 times," said Ian Clark, the test's technical lead from JPL. "But high up – around 23 miles (37 kilometers) – the atmospheric density on Earth is very similar to 6 miles (10 kilometers) above Mars, which happens to be the altitude that Mars 2020 will deploy its parachute."

38 km is well above where airliners fly, high in the stratosphere. Mars does not have a permanent stratosphere, 10 km is within Mars's troposphere.
The test launch happened Sept 7th at 13:30 UTC which is 09:30 at the Virginia launch site, early in the day which will make the sky darker. I don't know the time of day on Mars when Perseverance landed, but the Sun appeared much higher in the sky.

A lot of things can effect the color of the sky. Altitude, air density, chemical makeup, particulate matter, angle of the Sun (ie. time of day), distance to the Sun, and angle of view relative to the horizon. Mars's atmosphere is very different than the Earth's, the only attribute which is the same between those two videos is the density. Mars's atmosphere and Earth's atmosphere are very different and will reflect light differently.
A lot of things can effect the color of a picture of the sky. Pictures and videos are not true representations of what you would see, they are chosen. These videos are to observe the behavior of the parachute and will be calibrated for that, not to get the true color of the sky, and they're using different cameras with different characteristics. Phil Plat discusses calibration problems on Mars.
In this video discussing the parachute opening at 18:35 you can see the sky color dramatically change as the parachute deploys and the camera adjusts its exposure levels.
Mars 2020 just before inflation, over-exposed.

Mars 2020 just after inflation, under-exposed.

This is because the first shot is over-exposed making the dark sky look bright, and the light parachute chord and spacecraft are blown out. The second is under-exposed, the sky is dark and the parachute and spacecraft are under-exposed.
This is not because it blocks the Sun, the Sun is off to the left side somewhere and would not affect the exposure levels.
We see the same effect in the test video, though less pronounced.
ASPIRE just before inflation.

ASPIRE just after inflation.

There's still a difference, but this provides a better apples-to-apples comparison than the images use in your question.
Comment: I think the things that are the same are the air *density* and the parachute.  Probably this means the pressure is similar of course, but it's the density that matters. (But this is a good answer IMO.)
Answer: To have on Earth same airpressure of Mars at parachute-opening-altitude you must go very high in the sky, as pressure on Mars is 1/100 than Earth.
So you must go "almost in space" to test a Mars parachute on Earth (don't know exact altitude)
Hence you see black sky.
Comment: I understand but as long as on Mars the pressure is only 1/100 that on Earth, it is like you are almost in space!
Comment: Also, assuming they're looing for a particular atmospheric pressure, because Earth's gravity is 2.5x higher, and its atmosphere is generally warmer, you can get the same pressure with less mass of atmosphere above you over Earth, than on the surface of Mars, even neglecting the significantly different gas composition.
Comment: Similar conditions does not mean same pressure but same density of the atmosphere, on Earth and Mars. The pressure is not so relevant for a parachute. The Drag is in general independent of pressure.
Comment: At the same pressure, CO2 is about 53% more dense than earth air, so the difference is noticeable, but within the same order of magnitude.
Answer: It depends a lot on the sun angle, and exposure settings.
For example, here's the a screenshot from the Perseverance descent:

It's a dark sky. You can see the Sun on the bottom left corner. So the camera is clearly much closer to pointing to the Sun. It's also important to keep in mind that there is a bit of dust which does scatter a bit of blue light.
Secondly (and most importantly), the camera is slightly overexposed. This is evident when the parachute fully opens, and the camera immediately adjusts its exposure.
So the reason is most definitely lighting, and the fact that the camera was slightly pointed at the sun. I am quite positive that if the Earth test camera was overexposed as the Perseverance camera was initially, you would see a tint of blue colour (perhaps not as much because of the sun angle).
Comment: @azot There is a connection. But saying "the sky went dark because of the parachute opening" is not _wrong_ per se, but misleading. The most accurate way is saying "the sky went dark because the camera adjusted its exposure". See [Schwern's answer](https://space.stackexchange.com/a/50344/32284) The camera automatically adjusted its exposure when it saw the gigantic parachute in it's FOV. So there is a connection. But that's not the direct reason the sky went dark.
Comment: _The effect is evidently due to the parachute blocking the view of the camera._ No. That's not the direct reason the sky got darker. The camera automatically adjusted its exposure (as I stated in my answer). That's what caused the sky to get darker. You could think of it similar to something like auto-focus.
Comment: This is the third time when I explain that the black sky appears on Mars at the very moment the parachute opens. The effect is evidently due to the parachute blocking the view of the camera.
Comment: Do you imply that there is no connection between the opening of the parachute and the color of the sky getting considerably darker exactly the same moment?
Answer: Not that I disagree with any of the other answers that it's largely impossible to judge the camera exposure, but one thing not yet discussed is that the phenomenon that makes the sky bluish is different between mars and earth. On earth the sky looks colored/bright due to Rayleigh scattering of light off nitrogen and oxygen, but on mars it's dominated by Mie scattering of light off of dust particles. If there was no dust in the atmosphere on mars, it would look similarly black. On earth, there's very little dust in the atmosphere at such a high altitude where the pressure is similar to mars. There have been no geologic processes active on mars for a long time which would strongly condense dust back into solid rock, so it's just a lot dustier than earth.
EDIT: This page has some good explanations and diagrams on the difference between different types of scattering.
Comment: @azot: why is the moon white when you look at it in the daytime sky?  Why is [he Sahara brown when seen from space](https://spaceflight.nasa.gov/gallery/images/shuttle/sts-68/html/sts068-228-081.html)?  Because, under a clear sky, about 5 times as much light reaches the surface directly from the Sun as does from the diffuse sky radiation.
Comment: On Earth the atmosphere looks blue no matter what direction (up or down) you look through it, assuming there is enough gas above or below you (when you are in a plane for instance). The question is: Why is the sky of Mars bluish as seen from a certain altitude and at the same time, why is Mars reddish while viewed from orbit. That Mie scattering should make the red planet look bluish.
Comment: "about 5 times as much light reaches the surface directly from the Sun as does from the diffuse sky radiation"?!! For our case, it is important what reaches the objective of the camera not the surface (of the planet).
Comment: The moon is bluish if it is visible in the daytime (see: https://www.beyultreks.com/?attachment_id=2698). It is not white.
Comment: @azot: Yes, and every bit of light which reaches the lens of the camera from the surface to make an image of the surface has ... previously reached the surface from somewhere.  But I give up: nothing I can say will persuade you of anything, I'm sure.


Appreciation email after interview

Question: I had a virtual interview with  a hiring committee in a university for a faculty position.  Do I need to send an email of appreciation after that? If so, to whom I should send? Can I send one email to all interviewer in one email? or it must be separate emails?
Answer: If you met with them as a committee, then I would send a quick email to the committee chair. It can be very minimal, thanking them for their time and expressing your continued interest in the position.
Probably not totally necessary, but can signal interest, which is occasionally useful if you are perceived as a candidate who may have lots of competing interviews and offers. It reiterates you are serious about their particular opportunity.

Appreciation email after interview


Understanding current through batteries and Kirchoff's Law

Question: i've just started studying electricity a while ago , but there is something that i've been trying to understand and it's making a huge gap inside my head to understand electricity. Now in kirchoff circuits where you haven't got just one battery but more , how does current flow through the battery ? If it's through the electrolyte then if electrons can do that why batteries die then ? I'am just starting to understand it , thanks in advance and i owe whoever make me understand it
Comment: Batteries store charge like huge electrolytic caps in xxx Farads, but with a nominal cell chemical potential voltage.  By convention we say current drains out of a battery going from its voltage to a lower one thru resistance and might accept charges visa versa. Charge, Q=CV and current is dQ/dt
Comment: @TonyStewart.EEsince'75 those formulae for charge are for a capacitor, not for a battery
Comment: @Claudio, yes they apply but you use between initial and near final voltage rather than initial voltage and zero.  since there are secondary charge hysteresis effects 90 to 10% SoC gives best results. But I digress...
Comment: You should edit your post. It's hard to follow, and doesn't need all that "I don't know what the hell I'm doing"-fluff you inserted.
Comment: Youtube has lots of good videos on batteries, cations, anions, electric potential of half-reactions (relative to hydrogen) and a host of other details. Lots of good videos to take you from, quite literally, a sing-song follow-along approach with music and animation, to serious stuff. You should watch some.
Comment: @jonk I found that YT and grade-school battery chapters give lots of misinformation and "lies to children." Also they usually miss the central concepts (such as conductivity of electrolyte and the closed path for current.)  University texts are correct, but they give math-based treatments.  To explain batteries to beginners, it's safest to base it on college physics/chemistry texts, while translating their math into plain English.
Comment: @wbeaty Sure, I agree with that. I am just thinking that there *are* some good descriptions on youtube (since I've seen them) and it actually takes some significant time to detail enough of chemistry in order to describe a battery well. Einstein said something like, "make it as simple as possible, but no simpler." And in the case of batteries, the "no simpler" part makes it necessary to write a lot. It would be better if the OP did some basic reading, first, and demonstrated some understanding to base an answer on.
Comment: Note - in theoretical Kirchoff's-law demonstrations, you might have current going the "wrong way" through a battery. In theory this is okay, but in practice it might cause the battery to explode, so don't actually build the circuit.
Answer: Current flows through batteries, electrons do not...
Batteries are sort of like bottomless capacitors, continually refilled with charge by a chemical reaction.
When in circuit, electrons leave the negative terminal and are immediately replaced by an electron entering the positive terminal. The arrival of this electron causes the chemical reaction to advance which in turn creates a new electron ready to leave at the negative electrode.
The whole process repeats until all the chemicals involved in the chemical reaction are expended and the battery is dead.
However, while still alive, since the number of electrons leaving the negative terminal equals the number arriving at the positive terminal, we can say current flows through the battery.
Answer: You guessed right.  The path of current is through the electrolyte.
When batteries are powering a circuit, the charges are flowing into one battery terminal, through the battery, then back out through the other terminal.  No charge is ever lost during discharge.  A battery forms a complete circuit, like an ideal zero-ohm resistor.  And whenever we "recharge" a battery, no charge builds up inside.   In this way batteries are no different than resistors or wires.  Or different than DC generators with all those thick coils inside which short everything out.
In batteries and in wires, the amount of charge doesn't change, and the flowing charges are provided by the conductors.  All conductors are always full of vast quantities of movable charges.  (The word "conductor" really means "charge-filled matter, where the charges are mobile.)
Why do batteries die?
They die when they run out of chemical fuel, when one of the plates has entirely corroded away.  All batteries are charge-pumps: chemically-powered charge-pumps.  As with any pump, the "fluid" is not provided by the pump, and also it's pumped through the device and back out again.  Batteries are closed circuits, same as resistors.  Think of a battery as a constant-pressure, variable-speed water pump, where the "pump" turns off as soon as the constant pressure is reached.
The battery electrolyte is a good conductor, a short circuit.  Why doesn't it short out the battery?  Simple: because all batteries are actually composed of two "half-cells."  One half-cell appears at the metal surface where the liquid electrolyte touches the positive plate.  The other one is found where the electrolyte touches the negative plate.   All the weird and interesting stuff is happening at these two contact-areas.   The actual battery part is actually quite thin: it's a molecule-thin surface layer where a liquid conductor touches a solid conductor.  ANd there are two of them, not one.
So, the battery-electrolyte is actually a sort of "shorting bar," like a "heavy wire" which connects between the two internal half-cells.
When grade-school science books tell us that batteries "store electricity," they're just wrong.  Batteries store chemistry!  Batteries provide energy via the corrosion of metals.  During "discharge," one battery plate is dissolving into the electrolyte.  (Your zinc plate becomes zinc chloride solution.)
What about recharge?  No charge is ever injected into a battery.  Instead, we "charge" them with energy, with joules not coulombs.  In rechargeable batteries we can reverse the current and un-corrode the metal plates; electroplating new metal out of the dissolved compounds in the electrolyte.  Since the path for charges is through the battery and back out, "recharging" means filling the battery with new chemical fuel.
Batteries are very weird, since no electrons ever flow through the electrolyte.  In lead-acid batteries, the electric current is made of protons.  Conductivity in acids is caused by movable protons, not movable electrons.  (This is easy to miss in chemistry classes, since protons are called "+H hydrogen ions.")
While inside metals we have electrons jumping between atoms, in acids we have protons jumping between water molecules.  Metals and acids are both conductors.  (Double-Es should all be familiar with Drude and Grotthuss, but we usually miss it, since they're both fairly concealed in university physics and chem classes.)  In addition to these two, we also have salt-based electrolytes where the moving charges are copper ions and chloride ions for example.  Also there are alkaline solutions, where positive sodium and negative OH ions are moving along as the "electric current."
So, whenever you're starting your car, the few hundred amps in the battery acid is a proton-flow mostly, while the same amperes turn into electron-flows as the current in the acid enters the battery plates.   And since batteries aren't charged with electric charge, it makes sense that one way to "recharge" a lead-acid battery is to take out the plates and coat them with chemical fuel, oxide/sulfide paste etc.

Drude model of metal conductivity
Grotthuss mechanism of proton-conductors, acid solutions.


deserializing models in play 2.2

Question: I've been looking at the docs at http://www.playframework.com/documentation/2.2.1/ScalaJsonCombinators for the last couple of hours which has lead me to a model that looks like:
case class Person(
    id: Pk[Long],
    email: String,
    isActive: Boolean,
    firstName: String,
    lastName: String,
    gender: String,
    dob: String,
    address: String,
    phone: String)

object Person{
    implicit object PkFormat extends Format[Pk[Long]] {
        def reads(json: JsValue): JsResult[Pk[Long]] = JsSuccess (
            json.asOpt[Long].map(id => Id(id)).getOrElse(NotAssigned)
        )
        def writes(id: Pk[Long]): JsValue = id.map(JsNumber(_)).getOrElse(JsNull)
    }

    implicit val personFormat = (
        (__ \ "id").format[Pk[Long]] ~
        (__ \ "email").format[String] ~
        (__ \ "isActive").format[Boolean] ~
        (__ \ "firstName").format[String] ~
        (__ \ "lastName").format[String] ~
        (__ \ "gender").format[String] ~
        (__ \ "dob").formatNullable[String] ~
        (__ \ "address").formatNullable[String] ~
        (__ \ "phone").formatNullable[String] ~
    )(Person.apply, unlift(Person.unapply))

I'm getting a compile time error:

type mismatch; found : (anorm.Pk[Long], String, Boolean, String, String,
  String, String, String, String, Long, Long, String, String) => models.Person
  required: (anorm.Pk[Long], String, Boolean, String, String, String,
  Option[String], Option[String], Option[String], Long, Long, Option[String],
  Option[String]) => ? Note: implicit value personReads is not applicable here
  because it comes after the application point and it lacks an explicit result type

Which makes sense because String and Option[String] are not the same. I've tried adding orElse(null) or getOrElse(Null) to the optional fields but both give compile time errors about how those methods are not available on the given object.
What is the correct way to deserialize optional fiends in json? This doesn't seem maintainable compared as the number of attributes on an object grows when compared to something like Jackon with annotations.
Comment: Why don't you use a `Json.Reads` or Json.Format` to do the same? Like this: `implicit val personFormat = Json.format[Person]`?
Comment: Tried resulted in
    `Overloaded method value [apply] cannot be applied to (() => models.Person)`
Comment: If `dob` `address` `phone` can be null, the `Person` case should have those fields declared as `Option[String]`. It is recommended avoid using `null` in scala.
Answer: When you use formatNullable[A] that means that you will get an Option[A], None if the field is missing and Some(a: A) if the field is present.
In your case class you have typed dob, address and phone as String but then in your format you say formatNullable[String] which means that the list of values that has been parsed does not match the apply method that you have provided (Person.apply). The error message tells you the expected parameter list of the function given and the actual one.
Change the fields in the case class, your format or provide an intermediate function instead of Person.apply that provides defaults if the values are not present and creates an instance of Person.

deserializing models in play 2.2


Proof (at least name or source) of this probability inequality?

Question: I stumbled upon this beautiful piece of inequality :

I'd appreciate very much if anyone can provide me a source where I can find the proof of this inequality. Does it have a name? (It must! But I don't know where to look.)
Comment: Let's start with: where did you find the theorem?
Comment: There are a number of comments I would like to make on the statement. The wording makes $c_1$,$c_2$ possibly depend on $\epsilon$ but nu such inequality can be proved in this case. Let us assume that $c_1$,$c_2$ are constants. We have EX_n= \int_0 {\infty} P\{X_n >\epsilon d \epsilon$ and we can get a bound for $EX_n$ using this. This is the best inequality you can get and there won't be a $log (c_1)$ on the right side. So the exact inequality seems doubtful.
Comment: Hmmm... So when $c_1=e^{-1}$, $E(X_n)=0$? Obviously wrong. For a more detailed reduction, please see my answer.
Comment: @Raskolnikov Here's the source : http://npslagle.info/articles/onehundredprobabilityinequalities.pdf
page 3, number 4.
Comment: There's a reference to a lecture for your inequality, so that answers already part of your question.
Comment: It's here http://www.stat.cmu.edu/~larry/=stat705/ .
Comment: @Raskolnikov Ah you're right. Larry Wasserman did provide a proof there! On the other hand, Did disproved it here. I've to check.
Answer: Probably no name. For a proof, first note that the hypothesis that $$c_1>0\qquad c_2>e^{-1}$$ should read $$c_1>e^{-1}\qquad c_2>0$$ for the conclusion to make sense and let us choose values of the parameters such that $$c_1=c\qquad c_2n=1$$ Replacing $X_n$ by $\sqrt{c_2n}X$, this is not a loss of generality, thus it suffices to consider the case when, for every $x>0$, $$P(X>x)\leqslant ce^{-x^2}$$ Then $$E(X)=\int_0^\infty P(X>x)dx$$ Thus, if $c<1$, $$E(X)\leqslant\int_0^\infty ce^{-x^2}dx=c\frac{\sqrt{\pi}}2$$
 so the task in this case is to prove that, for every $c$ in $(e^{-1},1)$, $$c\frac{\sqrt{\pi}}2\leqslant\sqrt{1+\log c}$$ or, equivalently, that for every $a$ in $(0,1)$, $$e^{-a}\frac{\sqrt{\pi}}2\leqslant\sqrt{1-a}\tag{1}$$
On the other hand,
if $c>1$, $$E(X)\leqslant\int_0^{\sqrt{\log c}}dx+\int_{\sqrt{\log c}}^\infty ce^{-x^2}dx$$ so the task in this case is to prove that, for every $c>1$, $$\sqrt{\log c}+\int_{\sqrt{\log c}}^\infty ce^{-x^2}dx\leqslant\sqrt{1+\log c}$$ or, equivalently, that, for every $a>0$, $$a+\int_a^\infty e^{a^2-x^2}dx\leqslant\sqrt{1+a^2}\tag{2}$$ The trouble with all this is that your problem is really equivalent to proving $(1)$ and $(2)$ and that $(1)$ is obviously wrong.
Edit: It appears that, while $(1)$ is wrong, the desired inequality holds when $c>1$. Since the technique used in the notes mentioned in a comment below works in this case, avoids completely the clumsy inequality $(2)$ above, and is, independently of the specific question at hand, worthy of being remembered, we outline it here.
Again, one starts from the hypothesis that $X\geqslant0$ almost surely and that, for some $c\geqslant1$, for every $x\geqslant0$, $$P(X>x)\leqslant ce^{-x^2}$$ Then one makes the apparent détour of considering $Y=X^2$ instead of $X$... Thus, for every $y\geqslant0$, $$P(Y> y)=P(X>\sqrt y)\leqslant ce^{-y}$$ hence $$E(X^2)=E(Y)=\int_0^\infty P(Y> y)dy\leqslant\int_0^{\log c}dy+\int_{\log c}^\infty ce^{-y}dy=(\log c)+1$$ hence, using Cauchy-Schwarz inequality, $$E(X)\leqslant\sqrt{E(X^2)}\leqslant\sqrt{1+\log c}$$ To sum up the above, passing by $X^2$, one loses a bit due to Cauchy-Schwarz but one gains a lot because the primitives of $e^{-y}$ are handier than those of $e^{-x^2}$. Cute...
Comment: Hmmm, these are only humans, you know? Even LW... Time better spent trying to understand and remember the cute détour by $X^2$ in the proof.
Comment: The mistake in the notes you linked to is that, in the notations there, they first assume that $$a>0$$ then they choose $$a=\frac{\log c_1}{nc_2}$$ under the only conditions that $$nc_2>0\qquad c_1>1/e$$ If $c_1<1$, this can only lead to chaos since then, $$\frac{\log c_1}{nc_2}<0$$ If $c_1>1$, their approach is sound. (But anyway, please correct the irritating condition $c_2>1/e$ in your question...)
Comment: I understood your argument. On the other hand, Larry Wasserman apparently gave a proof here : http://www.stat.cmu.edu/~larry/=stat705/Lecture2.pdf (page 7). I'm confused.
Comment: Thanks! I'm kinda shocked to see this in Wasserman's notes. I mean not because of the technical mistake, that's probably been done by a TA. But the wrong statement of the theorem is really shocking.
Comment: Thanks a lot for the detailed edit, explaining the nice trick!


total energy in a typical solar Hard X ray flare

Question: The RHESSI (Reuven Ramaty High Energy Solar Spectroscopic Imager) website lists solar Hard X ray flares with energy of each flare given in a range, say, 50 - 75 keV. We presume that is the energy observed by the satellite (like GOES satellite) or ground based instrument, so that accounting for the sun-earth distance, one can estimate the total energy of flare over its total duration. That could be of the order of 10^27 - 10^32 ergs. Hence, my question is how we can convert the given, say, 75 keV energy value in the RHESSI flare list into total energy in ergs.?
Comment: Generally instruments like those on RHESSI measure a _flux_ or _energy flux_ of particles, in this case photons.  By knowing properties and the response function of the instrument, one can convert the flux to a total integrated energy density, energy, or power, etc. (whatever units you want).  So you measure the flux versus time, integrate over time, solid angle, area, and particle energy to get the total energy released by a flare (overly simplified, but it's close enough to get the point across).
Answer: I am afraid, that the number 50-75 keV concerns one single (Xray) photon, not the whole flare. Maximum you can get from these two numbers is estimation, how many photons participated on the flare. One photon energy 50 keV = $8\times 10^{-15} J = 8 \times 10^{-8} ergs$.
Your answer concerning the total energy is actually those $10^{27}-10^{32}$ ergs.
Remark: you probably cannot detect these Xray flares by ground instruments, as Xray is attenuated in atmosphere.


Can't figure out how to get space around an image?

Question: If you go to this page you will see the text is butted up against the right side of the headshot picture. I've tried plugins and codes, etc., but nothing seems to work. Any ideas on how I can get some padding around the picture so the text won't be right up against it?
Answer: If for just this image, you can edit that post and in text editing mode you could add something like this around the link to the image:
 ...image link here...

If you are looking to fix this for any image that is added to posts, you'd need to add a rule similar to this to your .css for the theme you are using.  Some themes allow custom css to be added, check the settings/options for your theme.
img[class*="wp-image-"] {
  padding: 10px;
}

Comment: PERFECT! I was able to use the second suggestion and add it to the custom CSS just for that page and it worked perfect. THANK YOU!


convex function and convex set

Question: Let $f$ be a convex function from $R_{++}^n$ to $R$. If $f(x_i)\geq f(y_i)$, where $x_i,y_i$ in $R_{++}^n$, $i=1,2,...,n$. The question is: is the following inequality true:
$$f(\sum_{i=1}^n a_i x_i)\geq f(\sum_{i=1}^n a_i y_i),$$
where $a_i\geq 0, \sum_{i=1}^n a_i=1$. If it is true, how to prove?
Comment: What is $R^n_{++}$?
Answer: It seems the following.
This inequality is far away from the truth. For instance, let $f:\mathbb R\to \mathbb R$ such that $f(x)=x^2$ for each real $x$. Put $a_1=a_2=1/2$, $y_1=3,$ $y_2=-1$, $x_1=4$ and $x_2=-4$. Then $$f(x_1)=16>4=f(y_1), f(x_2)=9>1=f(y_2),$$ but $$f(a_1x_1+a_2x_2)=f(0)=0<1=f(1)=f(a_1y_1+a_2y_2).$$ The restriction of domain of $f$ to $\mathbb R_{++}$ is easily overcame by its shift.

convex function and convex set


Work done on centre of mass vs Work done on point of application

Question: For a rigid body, can we substitute the work done on the point of application of force by the work done on the center of mass so that we can use the work-energy theorem for rigid as well as non-rigid bodies?
Answer: In short, generally, no, except for the weight.
To understand this, you just have to consider a solid as a set of punctual masses. Since a solid is... solid, these masses don't move relative to each other: internal forces don't work. Then, since energy is extensive, you just have to sum all the work of external forces on their point of application to find the change of kinetic energy.
In the case of weight, when you sum all the weights of the masses which form the solid, you find that everything is as if the weight was applied on the center of mass of the rigid body.
While solids are really easy to study, since internal forces don't work, non rigid bodies are really complex: indeed, it's much more difficult to know what internal forces are.


wpf datagrid observablecollection

Question: I'm working on a large database application using WPF. So far, I have been able to create a DataContext using Link to Sql class, store it in an ObservableCollection, and feed it to my DataGrid as DataContext.
The main table in SQL I'm trying to read/write looks like this
Work_Table
  WorkID[pk int] | frn_CustomerID[fk int] | frn_UserID[fk int] | DateCreated[datetime] | etc...

Customers_Table
  CustomerID[pk int] | CustomerName[varchar] | etc...

Users_Table
  UserID[pk int] | UserName[varchar] | etc...

I want to represent these columns in my DataGrid by using DataTemplates and Inline editing
WorkID | CustomerName | UserName | DateCreated

Do I have to use a Proxy Class that contains all these columns and ids? Should I modify my observablecollection, or should I handle everything in the code behind based on events? I like the fact that the datagrid does basic CRUD which is in fact great since I'm on a time constraint at the moment.
I am fairly new to WPF and particularly to the DataGrid control. I also have read about IValueConverters but I'm not exactly sure if this is the way to go and what performance issue I might encounter.
If anyone can point me in the right direction, so far, all the searches I found are simple tables without the use of foreign keys, etc.

UPDATE
I found this code so far and had some progress but now the issue is sorting.
<toolkit:DataGridTemplateColumn Header="Customer Name">
     <toolkit:DataGridTemplateColumn.CellTemplate>
         <DataTemplate>
             <ComboBox ItemsSource="{Binding Customers, Source={StaticResource MyDataContext}}" DisplayMemberPath="CustomerName" SelectedValuePath="Customer_ID" SelectedValue="{Binding Path=Customer_ID, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  />
         </DataTemplate>
     </toolkit:DataGridTemplateColumn.CellTemplate>
 </toolkit:DataGridTemplateColumn>`

This took care of being able to display the "Customer Name" instead of just the Customer_ID. Of course, I want to keep the underlying data as an integer but display a User Readable description. Now the problem is sorting. I'm just wondering if there's a way to do this very cleanly. I assume this is a common scenario but I haven't been successful finding a solution. I guess maybe I'm looking for the wrong search terms.
To simplify things, here's what I have so far:
1.) I have a table called Work_Table that contains Work_ID, Customer_ID, Employee_ID etc..
2.) I have another lookup table called Customers_Table that contains Customer_ID, CustomerName, etc..
3.) I have to display these columns in a DataGrid - Work_ID, CustomerName, etc...
I have an ObservableCollection that my DataGrid is bound to. Before I tried the combobox approach, it displayed Work_ID, Customer_ID, Employee_ID, etc.. basically the whole table and its columns.
The question is what is the best way for me to do item 3.)? Should I bind my DataGrid to a custom ObservableCollection that only contains columns I needed? Is IValueConverter another feasible solution so when the DataGrid is about to display the Customer_ID it will display CustomerName instead?
I did not have this problem before until I normalized the database.
Answer: I think this is probably what you are looking for.
http://blogs.msdn.com/vinsibal/archive/2008/08/19/wpf-datagrid-stock-and-template-columns.aspx
Comment: Hi Mr Wayne,

Thanks for the reply, It is indeed a very helpful blog. I think I now understand what I am trying to look for. I will repost my question. Thanks again!

wpf datagrid observablecollection


How to retrieve static resource from backup

Question: Apparently a co-worker accidentally overwrote a static resource zip file.  I do weekly backups.  Is it possible to retrieve past static resources from a zip file?
Comment: Is the weekly back from the Data Export function or are you backing up metadata explicitly?
Comment: I have weekly data export backups.  The good news is that I was able to get the missing static resource from the partial sandbox I made earlier in the week.  What should I do to have backups of the static resources.  I want to have backups of them if possible.
Answer: The Weekly/Monthly Data Export function does not back up metadata configuration files. For metadata, you should be using a source code repository (e.g. Git). This allows you to recover changes to your fields, objects, classes, static resources, and anything else you want to back up configuration-wise. You can even use SFDX to make it easier to migrate changes between orgs.


Phasor diagram of Phase modulated signal

Question: While studying the phasor diagrams of Amplitude modulation and Frequency modulation, I am stuck at a problem involving the phasor diagram of an angle modulated signal whose equation is given by $$s(t) = A_c \cos(2\pi f_ct)-\alpha A \sin(2\pi (f_c+f_m)t)-\alpha A \sin(2\pi (f_c-f_m)t)$$
I have studied the procedure of how we write the signal as a real part of complex phasors and then plot the phasor by taking the carrier frequency as a reference but am unable to proceed.
Comment: Hint: you have a carrier and two symmetrical side bands. Does that spectrum remind you of anything?
Answer: The phasor diagram is a notion adapted from AC circuit analysis methods in which each sinusoid (at a fixed frequency) is represented as a rotating vector (rotating counterclockwise at the fixed frequency) but is shown on paper as a nonmoving vector (usually as a straight line with arrowhead) corresponding to the position of the vector at time $t=0$. (The whole diagram on the piece of paper as well as the observer_ is assumed to be rotating at the fixed frequency and so, as Albert Einstein observed, the phasor in the phasor diagram on the piece of paper appears to be in a fixed position as far as the observer is concerned). Thus, the phasor for $\cos(2\pi f_c t)$ is an arrow along the $x$ axis while the phasor for $-\sin(2\pi f_c t)$ (note the $-$ sign) is an arrow along the $y$ axis. Now that you have multiple frequencies involved, your phasor diagram should look something like a long right arrow with two uparrows at the arrowhead, something like
$${\Large\longrightarrow\!\!}^{\large\textstyle\uparrow}$$
You also need to indicate that there are two phasors rotating in opposite directions (at relative frequencies $\pm f_m$) on that vertical phasor.
If the modulating signal had been $\sin(2\pi f_mt + \theta)$, the AM signal would have worked out to be
$$A_c \cos(2\pi f_ct)-\alpha A \sin(2\pi (f_c+f_m)t+\theta)-\alpha A \sin(2\pi (f_c-f_m)t-\theta)$$
and those two vertical phasors would have separated into two different (non-vertical) phasors and been easier to see, but not as easy to render in MathJax and so I won't attempt to include a diagram.


Do I need to have the passport when my domestic flight halts in an international airport?

Question: I want to know whether it is mandatory to carry my passport during domestic travel too and at what conditions do I need one!
Comment: What country are you asking about? India?
Comment: Yes we need more details. Where does this flight go? Where does it stop? What airline?
Comment: Yes, I am asking about that.
Answer: Generally, no, a passport is not required for domestic travel.  International airports are designed to handle domestic flights without requiring travelers to pass through immigration control.
In many cases domestic travelers need to present some form of ID, however, and anyone who has a passport but lacks any other acceptable form of non-passport identification would have to use the passport.  This is frequently the case for foreign tourists taking a domestic flight in a country they're visiting.
If you are concerned about a specific flight, you should ask the airline operating that flight.  They can tell you what documents will be required.
Answer: No, you don't necessarily need to have a passport for domestic flight halts within India if you're an Indian Citizen.
Many airports in India have a common terminal for use of both domestic and international flights, you can get along easily with ID proof like Aadhar Card, PAN Card,Driving License or Election Card etc.
I had a flight from Chandigarh(Chd Intl. Airport) to Mumbai(Chhatrapati Shivaji Intl. Airport) with halt at Delhi(Indira Gandhi Intl. Airport). Showing Aadhar Card or similar ID proof to the guards along with tickets/boarding pass is more than sufficient.
Comment: okkk...It is helpful.
Answer: If your domestic flight is stopping at an international airport, you should not need your passport in MOST cases, as long as the entire aircraft was meant for a domestic route.
Exception?

Some international flights fly a domestic leg as it hops to pick up passengers, It occasionally may have a few domestic passengers on board, they will be required to show passport.

Thumb rule:

If exiting at an international airport, check with the airline to ask if you are expected to go though immigration on landing.


Protocol for Adding people on Linkedln

Question: Is it unreasonable to add a person on linkedln that interviewed you? I want to add a person who did a phone interview with me. Is this seen as a bad gesture?
Comment: I have had the interviewer invite me, the potential job candidate, on LinkedIn. I was uncomfortable accepting the invite because I wasn't ready to make the connection. I didn't want them to see other people I was interviewing with.
Answer: It's very normal and very common.
It's become an acceptable and public way to check someone out in more detail and vica-versa.
It communicates a "I'm still quite interested in the job after the call".
It's frequently seen as providing immediate references (including actual recommendations on linkedIn) and many folks can create resume's there too.
Comment: I agree with Michael's answer.  @PaulJames, to your comment about "better than just sending a thank you," I would say no -- a LinkedIn invite should not be used in lieu of a thank-you, but you could combine the two with your invite text: "Thank you for the interview...please  join my LinkedIn network (etc)". Maybe not those exact words, but you get the idea. :)
Comment: Durant: So it is better than just sending a thank you email? Also this was a phone screening. Sending an invitation wouldn't hurt?
Comment: Durant: Also I don't know whether I have the job yet. There is still more interviews to follow.
Comment: Sure doing it before any offers means each side is taking the chance to learn more and do due diligence.
Comment: Basically, go ahead.  If they don't accept it's a useful indicator of a lack of further interest.  Yes, it won't hurt (usually).
Answer: I think you want to play it by ear, and take refusal with a grain of salt.
Some companies advise against such links to insulate hiring managers from the expectation of followup after the interview.  Others don't care or may even encourage the link.
If you had a good rapport with the person, if they stuck out to you as particularly worth keeping contact with - then give it a shot, but don't be upset if you get ignored.  Conversely, I'd advise against doing it just because you had an interview - because it's pretty likely that in 3 years you won't have any idea who these people were, or why they mattered - and LinkedIn is really geared towards sustaining professional connections...
If you'd prune your connection tree of this guy if you don't get the job, I'd say don't invite in the first place.  If you think that 3 months down the line, you'd want to read a status update from him - then go for it.
Answer: As an interviewer I would not be a fan of this.
My feeling is that LinkedIn is a way to form a network of trusted colleagues. After one interview I am not really a colleague of yours and certainly haven't formed a trust relationship.
It would seem to me a bit awkward. I would not hold it against you in terms of the interview process, but I would not accept the invite.
Comment: +1 - Indeed. I don't have a problem with someone hunting down my linked-in account (as an interviewer, I will usually look at a candidate's page to know if we share any 'friends'), but an invite is too presumptive after a basic interview.

Protocol for Adding people on Linkedln


What would be considered thick milk in old recipe

Question: I have a cake recipe from my Grandmother that calls for thick milk?   Anyone know what this might be?  Not sure of the cake name, handwriting is hard to read.  Full recipe is 1 c sugar, 2 eggs, 1 c thick milk, 1 tsp baking soda, 1 tsp cream of tartar, 1/2 c butter.
Comment: And: is there no flour or similar amongst the ingredients?
Comment: What area of the world are we talking about? https://www.yourdictionary.com/clabber
Comment: Or rather, what region of the world did your grandma (or rather: the recipe) come from? You can also add a photo to the post, we've seen (and deciphered) old handwritten recipes before.
Answer: I am pretty sure she means milk which went sour naturally, or spoiled milk.
Before refrigeration and even after refrigeration but before ESL and UHT milks, a milk that got sufficient microbial activity would visibly curdle and get thicker and somewhat sour. Such milk is unpleasant to drink, but people used to not want to afford to throw this milk away, and took the risk of using it within something that gets baked. The reasons for baking it are 1) to hide the taste, and 2) to reduce the risk of food borne disease.
My own family has this kind of recipes, and I still remember my mother using them in this way when I was a child (it was in the 90s, but food safety rules hadn't reached us yet). Also, this is how names like the German Dickmilch (which literally translates as "thick milk") came to be. So I think it's plausible that this must be the case here, given that your recipe is old. Also, if the recipe really has no flour, using soured milk improves your chances of getting something firm and custardlike (albeit grainy), as opposed to the much more finicky flans made with fresh milk. Although I must admit my mothers' recipes wouldn't be for a completely flourless cake - she had some that were used as filling for baked pastries, and a savory one which contains just a little bit of flour, gets poured into a pan and baked. It doesn't form a doughy texture, but rather something like a pie filling, or a quiche without crust and vegetables.
For recreating the recipe nowadays, I would suggest that you use the stuff that American supermarkets sell today as "buttermilk". This is milk soured by known-harmless bacterial cultures, somewhat similar to yogurt. If you live in a part of the world which uses the term "buttermilk" in its original meaning (the watery liquid that is left after butter has been beaten out of the current-american-meaning-buttermilk) try searching for similar cultured products under a different name, maybe "cultured milk" or "soured milk". If you cannot find any, appropriate substitutes would be kefir or yogurt thinned with milk, even creme fraiche thinned with milk for a creamier result. I am not a fan of adding acids to fresh milk as a substitute, in my experience this creates the wrong texture and it is difficult to get the acidity right. Do not let your own raw milk out, this is unsafe by modern standards, and our grandmothers were wrong in assuming that it will become safe by heating.
Comment: @stephie There is no real boundary, one person's good is another person's disgusting. I would argue that in contemporary use, milk left out until it thickens on its own is not considered "good, soured", even though that was different in other times and cultures. And I hoped to be clear about the double use of the word "buttermilk" - I am suggesting the thick modern kind, which is equivalent to the oldfashioned soured milk, not the thin traditional kind, which is equivalent to the whey left after churning oldfashioned soured milk.
Comment: Access to buttermilk isn't obvious all over the world, alas.  But I've learned a good substitute for baking:  put some lemon juice into fresh warm milk (say half a lemon in a cup of milk), let it sit out 10-15mn.  It will be curdled enough to pass for buttermilk, and add a nice acid note to whatever you're making.
Comment: serious eats did an article about kefir substitutes in baking https://www.seriouseats.com/2017/04/how-to-substitute-buttermilk.html - the best substitute is Kefir, which is available in many places where buttermilk is not
Comment: Actually, I doubt that we are talking about real spoiled milk. Spoiled = disgusting, soured = good. And I would probably pick something thicker than buttermilk?
Comment: @GeorgeM it is actually a lousy substitute. I"d only use it if I am out of any kind of cultured dairy, and even then, I might consider going shopping or baking something else.
Comment: Well, good for you if you have a good local source of buttermilk. I don't much like the vinegar version of this hack myself, but doing it with my organic meyer lemons adds a nice touch to any baking, in the opinion of others as well as mine.  Better than the blah version of buttermilk which is hard to find
Comment: I think it is extremely rare for somebody to have a local source of fresh milk, but no local source of any kind of cultured dairy, such as yogurt, indian curd, creme fraiche, etc, even if they don't have access to buttermilk specifically. And any of these cultured dairy products is a much better substitute than fresh milk with acid.


PHP fast Reporting in multiple formats

Question: I'm building a gigantic app using SMARTGWT + JSON + Symfony PHP Framework + ORACLE
It's working pretty well so far, it's very fast due to the way gwt only gets what it need form the server and the low size of json responses.
But I need to generate reports as well, in pdf, excel, word, etc.
I've developed code in php that makes this happen, using tcpdf for example, but it's very slow when my queries fetch more than 1000 rows at a time.
I was wondering if you know of a way to make php faster, or to rely on another laguage using swig for example for generating the pdfs or the xlss from other files that I've already generated from php, all of this or course in less than 30 seconds so my end user isn't annoyed.
I know of mem cache and md5ing the queries so that you cache the html for later reuse if the data hasn't changed, but these solutions aren't fast enough, specially for pdf generation. It's too bad that php is so slow, and the fact that it doesn't allow native multithreading is not that good also.
Should I build C++ classes that build my reports faster and invoke these libraries as php extensions? Is there a way to use another scripting language that apache understands?
Any ideas will be truly appreciated as I will publish my project as an opensource framework for high demand web apps and enterprise web development.
thanks!
Answer: You may want to look into NginX and PHP-FPM.

PHP fast Reporting in multiple formats


How does an acid prevents or discourges oxidation of iron?

Question: In the titration of $\ce{KMnO4}$ with Mohr's salt, I have learned that sulphuric acid prevents oxidation of $\ce{Fe^2+}$ to $\ce{Fe^3+}$ in the solution before the actual titration. How does the acid hampers oxidation?
Answer: This is largely due to the extreme insolubility of iron (III) hydroxide, i.e. $\ce{Fe(OH)3}$.
One can write the oxidation reaction, somewhat simplified, as:
$$\ce{Fe^2+(aq) + 6 H2O(l) <=> Fe(OH)3(s) + 3 H3O+(aq)} + e^-$$
The $K_{sp}$ (solubility product) value for $\ce{Fe(OH)3}$ is very small: $2.79 \times 10^{-39}$ (Wikipedia).
From the equilibrium reaction it's easy to understand that acidic conditions (high $[\ce{H3O+}]$) push the equilibrium to the left, thus preventing the oxidation.
It also explains why Mohr's Salt resists oxidation much better than simple ferrous sulphate, as the ammonium ion provides some acidity.
In alkaline conditions the oxidation of ferrous ions to ferric ions is very fast.
Comment: Tomorrow never came...
Comment: Yes, I understood you used the Le Chatelier's Principle on the reaction. That answers my questions. But why does extreme insolubility has a role to play in this.
Comment: Well, *precisely because of Le Chatelier*. As precipitation removes $\ce{Fe^3+}$, the equilibrium shifts toward more $\ce{Fe(OH)3}$. Lower solubility obviously promotes precipitation.
Comment: I'll put a bit of 'mathematical meat' on this answer tomorrow.
Comment: Would you still like me to add that part?


Fuel pump burned out

Question: Can me taking my truck (2003 Chevy avalanche) mudding burn out my fuel pump? If not what are things that can burn it out?
Comment: Welcome to Motor Vehicle Maintenance & Repair!
Answer: Mudding or full throttle operation, in and of itself, should not burn out a fuel pump.
Your fuel pump is in your fuel tank. Its motor produces significant heat, and in normal use it expects to be submerged in fuel, which provides cooling by conducting heat away. If not for the fuel, the pump motor would burn out in short order.
If you keep your fuel tank level very low for mudding, and especially if you spend significant time tilted at a steep angle, this can contribute to fuel pump failure due to inadequate cooling. It's said that 1/4 tank should be the minimum fuel level to ensure adequate fuel pump cooling.
Answer: What @MTA stated or it could just be a fuel pump in a 2003 Avalanche gave up the ghost because it was worn out. While fuel pumps last a while, given it is probably 20 years old (assuming the fuel pump was never replaced before), it was probably just its time to go. Give that thing a good and proper burial and call it a day.

Fuel pump burned out


How should I connect GFCI outlets where the wires loop over the existing outlet?

Question: Hopefully this picture explains it all. However I'm confused what to do with my hot and neutral wires in a loop like this. Obviously these lines are connected to outlets down the line, but I'm not sure if I can just keep my hot and neutral in a loop like this, or if I need to cut them and connect to both line and load on the gfci. There will be 4 of these for my kitchen. Thanks]1
Answer: Option 1, which has the merit of being easy:  Put them both on LINE, just like that. Leave the warning tape on the LOAD terminals.
This will only provide GFCI protection at this receptacle location, and you would need to buy GFCIs for each socket.
Now if you want one GFCI device to protect every receptacle on the circuit, you have several options.
Option 2: Fit a GFCI+breaker
These critters are more expensive than a GFCI+receptacle device, and you need to open up your service panel to do it. But voila, your entire circuit is protected and done.  You could protect 5 circuits in about 10 minutes' work, instead of all the chasing and troubleshooting I'll next describe:
Option 3: Reverse-engineer the circuit to place the GFCI correctly
Every GFCI has a pair of LOAD terminals, which protect loads downstream from the GFCI device itself. That is simple on breakers and plain GFCI (deadfronts). But on GFCI+receptacles, their dual function makes it very easy to misapply the LOAD terminals, and cause big problems.  Hence the warning tape. Heed it.
You will need to get some testing equipment (dollar-store night lights are great) to detect power on each receptacle socket.   First, turn off the breaker to that circuit, and check absolutely everything to figure out which loads are on that circuit, and which are not.  You don't want to miss a load.  If the breaker is a 2-pole breaker, you have a MWBC and you'll need a lot more skill to do this; instead just punt back to the "Fit a GFCI+Breaker" option using a 2-pole GFCI breaker.
Take a guess at which receptacle load is the first one reached by the cable from the panel.  Regrettably, you'll need to cut that nifty loop there.  If this turns out to be the wrong one, darn.  Strip a little more insulation back so the wires can go into a wire-nut or around a screw terminal, and either sit there making 4 shepherd's hooks and putting them on 4 screw terminals, or just get a 6" length of black and white wire and pigtail the receptacle using wire-nuts.  My knees prefer the latter.
If you found the right location, when you sever those wires (cap them off temporarily with wire-nuts), the entire rest of the circuit will be dead when you turn the breaker back on.  That is the best place to put the GFCI+receptacle device.  Now you need to figure out which black/white pair is the supply.  Trial and error will suffice.  Attach that to the LINE terminals as I describe here:
Best way to use LOAD terminals without it going badly
STEP 0: Grounds go everywhere.
The GFCI engine doesn't use ground.  But they are often packaged in  or combined with things which do need ground.  (e.g. a GFCI+receptacle combo device, whose sockets need ground).  So if able, ground it. Grounds are always pigtailed so you can remove the device without severing the ground.
STEP 1: Attach only 2 conductors to the LINE terminals.
Over the course of mapping the circuit, you will find 1 cable/wire pair (black, white) that you think may be your supply hots.
Connect only that pair only to the LINE terminals of the GFCI.  (obviously also connect ground).
Give the GFCI a full shakedown cruise.  Make sure it powers up, make sure a big load like a toaster works on it, try its test/reset buttons, try a 3-lamp tester/external GFCI tester (ground needs to be hooked up for an external GFCI tester to work) etc.  Until you do this, do not pass GO, do not collect $200.
STEP 2: Hook up anything else to the LOAD terminals
Without disturbing work so far, only now tear the warning label off the LOAD terminals, and to them, hook up any additional (downline) loads.  If you need to land 2 on there, use a pigtail.
If you get any GFCI trips that you aren't intentionally causing via testing, then separate all your loads and apply one load at a time until you find the load that is tripping.  That load has a problem. The problem is probably not a defective GFCI device, it's a defective load that needs cleaning, repair or replacement.  Do that.
Then label each downline receptacle "GFCI Equipped" and if applicable, "No Equipment Ground".
Comment: @rrauenza clarified.  To me, "GFCI" is the protection engine, which cannot use ground.  To others, it's slang for any device which combines GFCI and some other function, i.e. sockets.  Often that other function needs ground.
Comment: Good answer -- STEP 0 reads a little confusingly though -- you say GFCI's don't use ground, but then you say to hook them up, but it also sounds like you mean don't need to hook them up.  Just thought you might want to make what you mean clearer.
Comment: @rrauenza Okay.
Comment: Thanks.  I'd personally change 'don't use ground' to 'don't require ground' ... but that's picking nits.
Comment: @rrauenza I thought of that, but that would change the meaning to one which is incorrect.  GFCIs literally do not care about ground and make no connection to it.  The only reason to ground a GFCI is so you cannot be shocked by its metal yoke, and to provide grounds to equipment for ESD purposes.
Comment: .....the ground part of the plug is really floating?  I thought it is connected to ground, even though the gfci electronics ignore it.  In other word, I'd expect near 0 ohms if I connected the ground of the socket to a non gfci socket (or neutral for that matter.)


xcode: drawing objects in catiledlayer

Question: I'm trying to draw my own objects to a CATiledLayer, im just not sure how i should push the objects to context that is used in drawLayer. For example i know that i can add the text i want to draw on the screen by declaring the text code inside the method drawLayer, however say that i want to draw something only when i get a user input, then i would like to create this new text object and draw it to the screen, but i'm not sure how i would do this outside the drawLayer method since i need the context.
Answer: If you want the layer to redraw it's contents you send it a setNeedsDisplay message. Then you can draw your additional objects.
Comment: yes, but i was wondering how i could get a hold of the context that is used in the drawlayer method

-(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context

so i could use an outside function that would add the text to that context and then i would be able to call setNeedsDisplay, or is this even possible ?

xcode: drawing objects in catiledlayer


Minimum heating temperature for dehydration of cobalt chloride

Question: I found online several sources that state 100 °C for a rapid dehydration of cobalt chloride in its various forms. I'm wondering if that's a minimum, or would it be possible to dehydrate it at a much lower temperature, provided ambient humidity is controlled.
Answer: The minimum I could find is 110 °C (Chemical forums) although not verified. The same is written in this link although there are two temperature, I am assuming the hexahydrate start to lose water above 110 °C.

mp 86 °C; loses $\ce{6H2O}$ at 110 °C
[...]
Anhydrous cobalt chloride is blue in color. It can be prepared by
dehydration of the hexahydrate either at 150–160 °C in vacuo.

Also, you can find this paper useful. The temperature mentioned here is 200 °C.
Answer: One of the "various forms" of cobalt chloride is Drierite, a mixture of cobalt chloride and calcium sulfate which is a common dessicant. It is blue when active and pink when hydrated (Ref 1). "Drierite can be regenerated by spreading the granules in a tray and heating them in an oven at about 425°F (220°C) for 1 to 1.5 hours."
A more informative website (Ref 2) explains; "The temperature at which DRIERITE desiccants are regenerated is crucial in restoring DRIERITE to its original condition. Absorbed moisture is water of hydration and is chemically bound to the calcium sulfate of DRIERITE. Temperatures in the range of 400° - 450° F are required to break these bonds and release absorbed moisture. Lower temperatures, regardless of heating time, will not regenerate DRIERITE unless applied under vacuum (26" Hg, 325° F or 28" Hg, 275° F). Care should be taken not to overheat DRIERITE Desiccants. High temperatures can alter the crystal structure and render the desiccants permanently inactive."
There are three well-defined hydrates of CaSO$_4$: the dihydrate, the hemihydrate (Plaster of Paris) and the anhydrous material, which can be especially useful (i.e., reactive) when not quite totally anhydrous. Wikipedia explains (Ref 3): "On heating to 180 °C (356 °F), the nearly water-free form, called γ-anhydrite (CaSO4·nH2O where n = 0 to 0.05) is produced. γ-Anhydrite reacts slowly with water to return to the dihydrate state, a property exploited in some commercial desiccants. On heating above 250 °C, the completely anhydrous form called β-anhydrite or "natural" anhydrite is formed. Natural anhydrite does not react with water, even over geological timescales, unless very finely ground." Apparently, some porosity remains in the anhydrite until all the water is gone, and then the lattice is closed up tight.
Although the times and temperatures mentioned above apply to CaSO$_4$ rather than to CoCl$_2$, and stray from the actual question, they indicate that a mixture including CoCl$_2$ performs its function (color change vs dessicant capability) usefully when the properties of the actual dessicant are taken into account.
Ref 1. https://secure.drierite.com/catalog3/faq.cfm
Ref 2. https://www.foxscientific.com/PDF/Drierite.pdf
Ref 3. https://en.wikipedia.org/wiki/Calcium_sulfate


HyperX Alloy Elite 2 keyboard RGB issue

Question: I just bought the keyboard in the title. As in all Linux distros it works great without any drivers. Unfortunately as in all Linux distros there's no software to configure the RGB lighting. I tried plugging in another Windows 7 pc i have to configure it but the software is W10 or later.There is also OpenRgb which sounds great,but their current build is broken on Arch linux which I run.I ended up reading this. And there one man recommends running the software in a w10 VM to configure it, which sounds great since the keyboard has an on board memory to store profiles,but the OP in the post says that plugging the keyboard in a W7 OS broke it because the firmware wasn't updated properly. I spent the whole day looking for any solutions and can't find anything that I can trust. What are my other options? I don't care about crazy lighting effects,I just want the colors to be stable instead of waving.
Answer: Update: Solved
I contacted the developers of OpenRGB and we worked a fix on their Arch build.
The software works ok,it has a small delay on light swiching. It has a delay when using Media keys as well.
Comment: Welcome to the site, and thank you for your update. If possible, please add a link the OpenRGB site which mentions this fix (e.g. changelog etc.)

HyperX Alloy Elite 2 keyboard RGB issue


What is the name of this style of design/illustration where cartoony items are surounded by a black/colored stroke?

Question: I have been seeing this style all over the internet and I would like to know its name, here's an example:
Comment: I don't know why they downvoted your question, anyway it's true they don't have a specific style name but they are usually referred to by "Colored Outline Icons"
Comment: @kapreski Thank you! yeah I noticed that the main feature was that the outline is colored, so I thought there might be a name for this style especially it's very characteristic and easily identifiable when you see it.
I will be editing the question to add a new picture that better illustrates the concept.
Answer: Art is not so definitive as to provide a specific name for everything you may see.
Not every style of art has a name.
I'd merely call this an "illustration"... maybe a "vector illustration". But that's making an assumption that it's vector in nature.
Beyond that, any words I would use to describe it - comic, cartoon, high contrast, etc. - would probably similar to what you use to describe it.


What is the difference between thermal and infrared imaging?

Question: Is there any sort of difference between thermal radiation and infrared radiation at least when detected by a camera? What are the differences between the two?
Answer: The thermal radiation and the infrared radiation are the same thing if the sources of the radiation have temperatures comparable to the room temperature.
In general, the two terms are different: the infrared radiation is defined by having the wavelength in the fixed interval 0.7 - 300 micrometers (a convention)

http://en.wikipedia.org/wiki/Infrared_radiation

while the thermal radiation of an object depends on its absolute temperature $T$. While any object at nonzero temperature emits at all wavelengths, the wavelength at which the emission is maximized is inversely proportional to the temperature of the source $T$ in Kelvins. See:

http://en.wikipedia.org/wiki/Thermal_radiation

For ordinary cold and lukewarm objects, the thermal radiation is mostly emitted in the infrared. For much hotter objects, thermal radiation may be dominated by the visible light (or even ultraviolet light, at even higher temperatures). On the contrary, much colder objects emit radiation at a much longer wavelengths; for example, the empty Universe has temperature 2.7 Kelvin so it is filled by the "cosmic microwave background" which is dominated by much longer electromagnetic waves which are microwaves - similar long waves to those in the microwave oven.
If the comments about the "wavelength" of the infrared radiation were new to you, I recommend you to read some basic texts about the electromagnetic spectrum

http://en.wikipedia.org/wiki/Electromagnetic_spectrum

which explains all kinds of electromagnetic radiation. In all cases, they only differ by the wavelength (or the energy or frequency which is inversely proportional to it).
Comment: I think there is scope for confusion. Near Infrared (.8 to 1.5microns) is a lot easier to make a camera for, but is too high frequency to catch thermal emissions for ordinary temperatures. True terrestrial thermal radiation is about ten times longer in wavelength, but thermal cameras cost several thousand dollars.
Comment: @ Omega Centauri - depends on the camera! I spent a reasonable slice of M bucks building a 0.8-1.6um camera (for astronomy) while you can get thermal imagers built into firefighting helmets for  1000. It all depends on sensitivity and resolution.
Comment: Near infrared has enough energy per photon to knock an electron loose in a detector. Thermal not so much. If it is bolometric, it measures the heat from the total amount of radiation. But perhaps there are other detection mechanisms that are used for thermal (i.e. 5-25 microns)?
Comment: @Omega - thats a good engineering difference. You can push photovoltaics to about 6um (InSb). In the mid-far IR you can also use Josephson effect and soon Quantum Well detectors but most are bolomters
Answer: Infrared imaging can refer to any imaging system that operates in the infrared, which extends from about .7 to 300 microns wavelength, as Lubos stated. Thermal imaging, as the term is commonly used, refers to an infrared imaging system designed specifically for the portion of the infrared range which is emitted by object at or just above room temperature. This is typically in the neighborhood of 10 microns. At this wavelength you will see images that people typically associate with "thermal vision." People will be brighter than room temperature objects, running car engines will stand out, etc.
Infrared imaging is useful as well, of course. Most "night vision" goggles work by imaging visible and infrared light, and amplifying the resulting image to a level that the user can detect. Using infrared in addition to visible simply means that the goggles have a stronger signal to work with before amplification, because they are sensitive to a broader range of wavelengths.
Answer: Rest has already been covered however for basic students....the crux to understand is....Infra Red or commonly referred as IR detects the heat generated by a body( which of course is there due to atomic vibrations), and generates a picture through a IR conversion tube.
whereas Thermal Imaging device or commonly referred as TI detects the picture based upon temperature difference between the body and its immediate surroundings.....thus generating a picture. it involves use of high speed thermal scanner coupled with an IR detector, amplifier and Video Display.
thus TI is not only eye safe as it offers indirect view and provides facility of storage and re production of video images as well
Answer: It seems to me that your title and the body of your question could be interpreted as asking two different things.  One asks about imaging, and the other about the radiation the image is made from.
Others have talked about the frequencies and wave lengths you might infer from "thermal" and "infrared".  I'm more interested by what is implied when you talk about the image.
I'm not sure what products on the market are actually producing, but there's a difference between producing an image of the colour temperature of the surfaces in the image, vs the quantities of radiation received from different parts of the image.  I.e a monochrome or false colour image might be based on the colour of the light reserved or it's brightness.  Due to differences in the heat conductivity of materials being photographed, they are not the same thing.  Brightness of the infrared received is not entirely a simple quantity either when you start to think of the sensitivity to different frequencies of radiation.
If you are producing a thermal image for the purpose of auditing energy leakage from a building, then you want an image that shows you the rate of heat emission of surfaces in the image.  Timber, glass, concrete and metal will all radiate at quite different rates while at the same temperature, and in context with air at the same temperature.  That rate of radiation, with sensitivity to frequencies in proportion to the energy carried is what you are after here, not colour temperature, though product manufacturers may try to tell you that's what you are looking at, and in theory it might even be true.
If you are trying to asess heat of components in a circuit, then colour temperature probably is what you want, though it's likely not to be what your camera gives you, and you might find yourself sticking plastic tape over some of the metal surfaces.
If your purpose is to photograph the activities of wildlife, then you might want sensitivity at the frequency of the IR LEDs you use to light the scene, while sensitivity to the background thermal radiation in other frequencies just reduces the contrast of your images.  Or you might not be illuminating the scene, and want to see the quantity of radiation in the range of temperatures likely for a warm body.
I can't tell you what various cameras actually give you, though these sorts of variations no doubt account for much of the wide variation in prices.


What does an NSF-sponsored conference mean?

Question: Do the sponsors of a conference have anything to do with the quality of that conference? In particular, can someone conclude something of a conference's quality by an NSF sponsorship? I searched around looking for NSF funding criteria but could find very little.
Answer: This is probably field dependent. For example in computer science, conferences are typically selective and there is a hierarchy of prestige. This answer will cover mathematics, where journal publications are what similarly "counts" on your CV.
As Buffy said, funding from NSF (or any other agency) is a sign of confidence in the organizers and their plans. In practice, it also means that you might be able to have your travel to the conference funded.
But keep in mind that "quality" may mean different things. I am an organizer of an NSF-sponsored series of regional conferences, and a major stated aim of the conference is to give local researchers an opportunity to speak and interact with the community. This includes early-career graduate students, as well as faculty at teaching-oriented schools who may not have many other opportunities to present their work. We aren't selective; we give an opportunity to speak to more or less anyone who requests one.
We indeed take pride in running quality conferences -- but it's worth keeping in mind that "quality" is not necessarily the same thing as prestige.
Comment: I some fields, many good researchers have no grant and the grants that exist have only minimal funding for travel.  A large part of NSF funding of a conference is often to pay for participant travel.
Comment: @AzorAhai-him- I'm writing a conference grant right now.  One of the selling points of this conference as far as the NSF is concerned is that it (and the area it is in) engages professors at teaching-oriented universities in research.  Almost all of the grant will be spent on travel support for attendees who do not have their own grants (and that's almost all of the US-based attendees).
Comment: "In practice, it also means that you might be able to have your travel to the conference funded." By whom? NSF? In your field, do grants not pay for travel to conferences unless they're sponsored by certain groups? Confused by this statement
Comment: @AzorAhai-him- Our situation is the same as what Terry Loring and Alexander Woo described. Travel is funded by the NSF (which, in practice, means by the conference organizers). In math, faculty at teaching-oriented schools are unlikely to have grants, and even at research oriented schools funding can be hit or miss.
Comment: Interesting, I hadn't heard of such an arrangement. I work in an expensive field where travel costs are relatively small compared to the science.
Answer: I'd suggest that prestigious organizations, including companies, will sponsor a conference only if they have high confidence in the organization and in its organizational committee. Associating themselves with less than fully reputable conferences has negative value for their reputation.
To get NSF (or IBM...) sponsorship, someone has to ask for it. The reputation of those who ask is, I assume, one element in any decision, along with an analysis of the likelihood of positive contributions of conference presenters, papers, etc.
However, I doubt that very many people use the list of sponsors to decide whether to submit to a conference or not. But, they probably use a similar quality index to that used by potential sponsors.
And, a collection of weird sponsors, might, on the other hand, indicate something negative about the conference.
Comment: I see, so it certainly isn't particularly important but is also a positive sign. Do most reputable conferences have such corporate or government sponsors?
Comment: Depends on the size probably. Big conferences are expensive to run.
Answer: Being "NSF-sponsored" just means that the NSF contributed some funds towards the conference.
The NSF has a limited budget and wants to give money only to conferences that are worthwhile for some purpose.  (Note that sometimes the purpose is related to "broader impacts" rather than "intellectual merit".  For example, one of the selling points of the conference I'm writing a grant for is that it (and the area it covers) engages professors at universities where research is not a priority.)  However, a small conference grant of say $10K is a very small amount for the NSF and they're not going to expend too much effort vetting the conference.
Answer: I can think of two mechanisms by which a conference might be considered to be "NSF sponsored".
One would be an NSF conference grant, where somebody organizes a conference and specifically applies for money to support that conference.
A second mechanism is if there is some larger NSF grant, and part of that grant has been specified to support a conference.  For example, if somebody writes a grant to develop educational techniques, and part of their plan is to disseminate the findings, and in the grant they propose the best way to do that is to hold a conference, and funds are requested to support that conference.
I wouldn't think that NSF sponsorship would influence a person's decision to attend a conference, unless of course that sponsorship pays the attendees' way!  It's possible that the speakers may be a little bit better than those in an unfunded conference, but not necessarily.  Also, means of funding has zip to do with whether the conference is appropriate for a given individual to attend.


Hotend does not reach set temperature

Question: If I set the temperature of my hotend with pronterface to 200 °C, the temperature never reaches that value. For instance, it almost reaches the target with a temperate of 196/197 °C and then starts to drop to 184/85 °C before it starts to rise again to 196/197 °C. It remains in this loop forever and thus I'm not able to start any print because the temperature never stabilizes enough.
I've tried to configure the PID (M303 E0 S200 C8) with 8, 12, 15 intervals not help the issue continue.
I've tried to change heatblock and thermistor not help
Its important to refer this behaviour occur in any tempurate if I fix 150º it never reaches 150º it go to 146/147º and then drops again 10/15º and restart the loop. Same thing if I fix the tempurature to 210º.
Also I've tested this in multiple versions of marlin 1.1.8 and 1.1.9.The version of marlin 1.1.8 have worked in the same print in the past.
I'm have not clue about what can cause this issue, maybe its a board malfunctions (mosfet) or a powersupply malfunction.
Somebody can help me on this?
Comment: Did you change the Heater Block (square metal block) or the Heater Cartrige (the actual heating element)? What is your Printer? What kind of hotend you use? Did you *save your settings* after PID tuning?
Comment: Can you go higher than 200 °C when you set the temperature to 235 °C for instance?
Comment: Yes my printer could reaches higher temp then 200º easy. I've a heat cartrige of 50w the problem is stabilize that temp. I'm using 3dv6 clone with Trianglelab Thermistor Cartridge 260 from ali
Answer: Your description sounds indeed as if the PID is not correct. You can try autotune with M303 only if your heating cartridge is not absolutely overpowered. However, in such a case you typically also have an overshoot, which you don't mention in your description.
In that case you need to lower your duty cycle (by the BANG_MAX parameter in the firmware) a bit. Otherwise autotune fails, because your heating cartridge overshoots even at small gains.
Out of the box I would suggest you to increase your D-term and decrease your I term if it cycles like that. For most printers, I used, a ratio like that is sufficient: 4/1.5/25.
Comment: During autotune PID I'm seeing overshoots, tempurature raise over the setted temperature. But in print's never get overshots only undershoots. In case never have overshoots should I increase or decrease D-Term in PID parameters?? I'll set my bang_max to 64 now its setted 255. I'll drecrease
Comment: Many thanks for your reply I not mention but have update my termistor (Trianglelab Thermistor Cartridge 260) and heat Cartrige to a new 50w aswell as the heat block. How I can check if the PID routine was failed? Because I'm using the value that came out of that routine.
Comment: When heating up, do you have overshoots? Typically, in such cases and after Autotune you will just get PIDs leading to overshoot-undershoot-loops which indicate that the D-Term is too low. At least it was like this for me. Just set your Bang_MAX to 64 and try again.
Comment: your tip have solve my issue I reduce the BANG_MAX from 255 to 240 and them I've run the M303 whiout any parameters that have run the PID with round temp of 160 and gave me parameters which work for me. Many thanks for your help

Hotend does not reach set temperature


What can I use in place of shiitake mushrooms?

Question: I would like to know what can I use instead of dried Shiitake mushroom for stock/broth making, a small deviation from the original flavour is acceptable but please share something pocket friendly.
Answer: While shiitake mushrooms do have a distinct and identifiable flavor, the reason dried skiitake mushrooms are added in broth and stock making is for the umami.  The flavor of umami is the result of the glutimates available in dried mushrooms (as well as other ingredients).  While shiitake mushrooms contain a lot of glutimates, any other dried (or even fresh, though you will need more) mushrooms are a suitable substitute.  Barring that, you could use other ingredients high in glutimates, such as tomato, or the rind of an aged cheese, like parmesan.  Alternately you can add a sprinkle of MSG, as that is simply the sodium salt of the glutamic acid that is naturally occurring in the ingredients mentioned.  Don't go too heavy on the MSG, though, as your broth will take on the flavor of dashi...unless, of course, you are making dashi.
Comment: probably would be worth mentioning explicitly that they can use another type of dried mushroom
Comment: @csk...it's in the answer.


Writing too much to debug log would affect APEX trigger or Visualforce page performance?

Question: In order to debug we usually write chunks of data to the debug log using System.debug statements.  Will writing too many debug logs affect visualforce page or Apex performance in any way?
Answer: I created the simplest page in the world, with a custom controller, that looked like this:

Generated by
<apex:page controller="spinspinspin" action="{!spin}">

Congratulations

    This is your new Page
</apex:page>

And in the controller I simply had
public class spinspinspin {
    public void spin() {
        for(Integer i = 0; i < 100000; i++) {

        }
    }

}

I loaded this page up and inspected the source for the generation time, which is in a HTML comment at the bottom:

Here we see the simple page took 80ms.
I loaded it 10 times and took an average of the load times, it was 78ms.
I then added System.debug to the for loop
for(Integer i = 0; i < 100000; i++) {
    System.debug(i);
}

and loaded the page 10 more times.
I averaged it out and the page now took 4140ms !!
I also then opened the developer console and checked, there were a bunch of 1.72Mb log files, so it was doing what one might expect, and the logging (allbeit 100,000 of them) was significantly slowing down the page load.

I then took the debug out of the loop (but left the empty loop as per the control) and added a single debug statement with a 3,500 character string in it. The average load for this page was 86ms indicating a single long debug statement does also slow the page.
(after this I was going to go on to a couple of other tests, but when I returned to the control state, I quickly re-tested my base level and they were up into the 100's of ms so I think either my DE on eu2 was being hammered, or I had simply worn a bit of it out temporarily! Therefore no future results would be fair ;) )
Update!!
Following other answers surrounding making the debug optional based on a boolean switch, I changed the controller to be this and ran the test again (I also re-ran my control a couple of times and the org was back on 75 - 85ms for standard page load)
private static final boolean logIt = false;

public void spin() {
    for(Integer i = 0; i < 100000; i++) {
        if(logIt) {
            System.debug(i);
        }
    }
}

The page load time was now an average (just 5 runs this time) of 112ms so the boolean flag does make a big difference. Putting that into a custom setting/label etc. and pumping it into the controller etc. might slow you down, but the concept of switchable logging has potential! (I was suspicious, so I changed the flag to true and loaded the page, low and behold, 4 seconds).
Comment: You're always bring logged. With logging turned off, the call still happens. In short, any line of code you execute has a time penalty. Many best practice lists, including security review checklists, advise removing all debug statements from production code.
Comment: yes, obviously evaluating an IF statement is a lot lighter than executing a System library call and persisting data etc.etc. you could have different "levels" of flag and wrap different debug in them (thus emulating for example the functionality of log4j).
Comment: Loading the log heavy page above without the developer console or logging enabled still took over 4 seconds, so even though I was not accessing the logs they appear to be being executed. That is a good question though! I'd be interested to hear a little more about the debug architecture. Maybe pop that in another question and see if another expert pops up!!
Comment: With the Boolean flag, you skip calling the debug line, so far less time penalty. A full blown solution might be to write a custom logger that checks a custom setting and only calls system.debug if a value is set.
Comment: Thanks, @Simon. Yes, Great Answer. I had that doubt on the page performance but now i understood from your detailed explanation it really slows down the page performance. I have another question though. Would system.debug always write to debug log even if an user not configured in debug log setting?
Comment: Thanks @sfdcfox. Lot of valuable notes from experts really helpful to understand the underlying architecture and behind the scenes
Comment: Thanks for the update with the results for using the boolean flag - very interesting. Nice work :)
Comment: Splendid notes @SimonLawrence. Nice!
Answer: Building on top of Simon's answer, if a page loads on average in 78ms with no debug statements but loads on average at 4140ms with 100,000 debug statements, we could determine:

By adding the debug statements, our load time increased 4062ms.
On average, each debug statement added .04062ms to load times.

Now, these are obviously the most simple debug statements you would ever use. If they were longer, it would be safe to say the time it takes to log these debug statements may increase. For the sake of argument, let's say a debug statement averages 5x as long as the simplest debug statement. In that scenario, we are looking at .2031ms. Let's go a step further and say it is 10x the simplest debug statement, even then we are only looking at .4062ms.
At 10x the simplest debug statement for the average debug statement, we can log 2461 statements and still only effect the page by slightly under a second (999.65ms). While it does effect performance, I think it is safe to use them in most circumstances, given that you most likely won't be running thousands of debug statements. Be smart and keep them out of loops, etc and you should be fine to debug the information you need with a minimal effect on performance.

To be clear, this isn't to say you should put thousands of debug statements in your code. As sfdcfox noted in a comment on Simon's answer, on performance critical pages being able to shave a few milliseconds add up to increase performance.
All I am saying by this is that if you have a troublesome page that you need to put a few debug statements in, it isn't the end of the world. If a page takes 1 second to load without debug statements, a few debug statements won't add more than a few milliseconds. Will a user really notice the difference between a 1 second page load and a 1.05 second page load? I would argue they wouldn't.
Comment: Debug statements still don't belong in production code, so one should keep them to a minimum. Your primary reliance should be on test methods to validate logic. I often find asserts are more useful for debugging because when a failure occurs, users get meaningful errors you can use, instead of digging through logs. Of course, asserts should be kept to a minimum as well. Checkpoints are incredibly useful for debugging as well. You use them to get the entire state of the system, and they can be turned on and off without code.
Comment: Yes, this is a good point! My answer was intended mearly to prove the fact, and not to accidentally scare-monger!! A few hundred (or thousand) debugs are not going to hurt your performance, but as they do have an impact avoid sticking them in too many loops. I would be surprised if even the most attentive developer could make a tangible difference to page load times (compared to other massively affecting factors like code and query efficiency, and/or fluctuating server/internet response times).
Comment: Thanks a lot @Jesse. Great notes to read and keep it in my library.
Answer: What you are really asking is,
How can I have debug statements in my code for future debugging without affecting current performance excessively?
I suggest structuring your debug calls like this:
If (DebugOn)
    System.debug('your message here.');

where DebugOn is a static class variable.  For extra convenience, DebugOn could load its value from a Custom Label.  That way, you can turn logging on without changing your code.  As suggested in other answers, keeping logging out of loops will help avoid performance issues.
Comment: Wouldn't the IF statement itself take up some processing overhead? If you tried Simons test and put this in a loop 100,000 times I wonder whether you'd see performance degradation
Comment: Please see the update to my answer. The result is astounding!
Comment: While this check will help make the performance impact extremely minimal, it will effect performance because that if check will have to run at all of those messages. It will be extremely minimal and it is a good idea, but you can't say it won't effect performance at all.
Comment: I was just doing that!
Comment: Very interesting results!  Thanks for doing the tests.


Config import same config different position in yml, keeps importing

Question: Best way to describe this is to show image, So this is one example and it keeps happening. I drush cim and it imports and then when I do drush cim again, it is the same and I can do this 1000 times. Have few of those files
Comment: Export it, then they'll match.
Comment: It may be a solution but what is the reason drupal keeps them unmatched?
Answer: I would typically see this situation when a module adjusts the schema for its config. Usually this would be because they add new config variables or change the existing config variables in some way. Sometimes a module is adding a config schema in the for the first time - they didn't previously have one. Or maybe they're just changing it so it makes more sense. There are any number of reasons they'd change it.
A module will provide an update hook to set new values for any new variables to not break a site. However, the new variables don't always go into the right order in the configuration (they're just being defaulted), it doesn't really matter what order they're in.
However, the config schema will enforce the configuration into a particular format only when you export configuration. That is, if you have active configuration, and the variables are in a jumbled order, they'll stay in that order until the configuration is exported (then imported). The export process will export the configuration in a manner that matches the config schema exactly. Then, the next time you import your configuration, the active configuration will be updated to match.
I've only found myself in scenarios like this when I've updated module code and performed the database updates, but forgot to export configuration after the database updates.


"Subject Matter Expert"

Question: In the term "Subject Matter Expert" (SME), what does the qualifier "Subject Matter" mean?  Are there experts without subject matter (other than perhaps Irwin Corey, the "World's Foremost Authority")
https://en.wikipedia.org/wiki/Subject-matter_expert
Comment: Welcome to EL&U. As a reminder, questions on Stack Exchange are expected to demonstrate some initial attempts at research. *[Subject matter](https://www.collinsdictionary.com/dictionary/english/subject-matter)* can be found in a dictionary.
Comment: I'm not convinced the second part of this  question ("Are there experts without subject matter") belongs here. It's not really a question about the English language. Obviously "expert" without "subject matter" before it is good English.
Comment: @choster I'll argue that I did include a link to the research, an entire Wikipedia article on the subject, which did not actually differentiate aS ubject Matter Expert from other types of Expert.  The terms and acronym are commonly used in business .
Answer: From the page you reference:

In general, the term is used when developing materials (a book, an examination, a manual, etc.) about a topic, and expertise on the topic is needed by the personnel developing the material.

The reason you might call someone a "subject-matter expert" is to clarify that the person is an expert on this subject matter.  A medical doctor can certainly be called an expert, but if he's being quoted in a book about plants, then he's probably not a subject-matter expert.
Comment: @dolphin_of_france An *expert marksman* may know nothing about the theory of shooting, but still be an excellent shot. They are not expert in a *subject matter* (body of knowledge) but in a *practice*.
Comment: no one disagrees that there is a definition.  But the OP says the term Subject Matter Expert... Is redundant.  And I think he has an excellent point...  what expert isn't only an expert of his/her subject matter?
Answer: But I totally see his point
All experts are only expert in their subject matter.
it is kind of understood, and implied.
So it is kind of redundant to call someone a subject matter expert.
It is a $5 term for a 25 cents concept.

"Subject Matter Expert"


Do all Cauchy sequences in incomplete metric spaces have "natural limits" that simply lie outside the space?

Question: The standard definition of a complete metric space is that all Cauchy sequences converge in the space. It's easy to come up with examples where a Cauchy sequence has a natural limit that simply is not in the space (e.g. any sequence in $\mathbb{Q}$ that should converge to an irrational number). However, this way of thinking about it can be confused with closure. Typically, I try to differentiate the two by thinking about completeness as more a property of the metric than a property of the space: in a complete metric space, any sequence that doesn't have a limit won't be Cauchy because the metric will be more "appropriate" in some sense. To further differentiate between completeness and closure, I'm wondering if there are examples of Cauchy sequences in incomplete metric spaces that don't have a "natural limit" in a larger space, though this seems unlikely to me. (I ask this because it's a different way that a Cauchy sequence wouldn't converge in the space -- rather than converging to something outside the space, it wouldn't converge at all.)
Comment: You should search about the completion of a metric space
Comment: Actually, that does not *beg* the question, that **answers** the question, because you can define equivalence classes of Cauchy sequences without every invoking the concept of "convergence to the same value". That's kind of the whole point of the construction of the completion of a metric space.
Comment: Also, your example of $\mathbb Q$ is not quite apt. One of the common axiomatic constructions of $\mathbb R$ is, simply, as the completion of $\mathbb Q$ (i.e. one defines Cauchy sequences in $\mathbb Q$, and equivalence classes of Cauchy sequences, purely in terms of the $\mathbb Q$-valued metric $d(r,s)=|r-s|$).
Comment: I'm familiar with the completion of a metric space. I like to think of the completion of a metric space as a space of equivalence classes of sequences where sequences are equivalent if they converge to the same value, and elements in the original space can be thought of as constant sequences. I suppose another way to think about the completion is just by adding limits of Cauchy sequences, though that sort of begs the question.
Comment: @LeeMosher, yes I understand that the equivalence class space does not beg the question, but was remarking that merely thinking about completion as adding elements from some larger ambient space would (without assuming that all Cauchy sequences have a natural limit in the ambient space, which elements do you add?). This conceptual problem doesn't exist when thinking about the completion in terms of equivalence classes of Cauchy sequences, since the Cauchy sequences themselves are in some sense the "added" elements.
Comment: In that case what you are asking is looking rather blurry, and I'm having a hard time finding an actual mathematical question here.
Answer: There is something called the completion of a space, and basically you take as "larger space" the set of Cauchy sequences. You must be a little careful, because you want to identify sequences that "you think should converge to the same thing".This is formalized by saying that two sequences $a_n, b_n$ are the same if the alternating sequence
$$c_{2n} := a_n, c_{2n+1} = b_n$$
is a Cauchy sequence. It is a very instructive exercise to see that the metrics extend to this space, that this space is complete, and that there is a map from the original space to the completion such that the original space is dense.
There is also a faster path to the solutions of the above: google.