What's the difference between a regular lens and a macro lens?

Question: What is the difference between a 100mm lens and 100mm macro, or 50mm and 50mm macro?
Can we use a macro lens to shot portraits? If yes, what focal length is the best? Please suggest a Canon macro lens.
Comment: Relevant info [here](http://photo.stackexchange.com/questions/2149/what-is-a-macro-lens), [here](http://photo.stackexchange.com/questions/130/prime-vs-zoom-vs-macro-lens) and [here](http://photo.stackexchange.com/questions/140/considerations-when-purchasing-a-macro-lens); also maybe [here](http://photo.stackexchange.com/questions/7974/why-is-11-desirable-for-a-macro-lens).
Comment: This really is a duplicate...of probably all of the questions @koiyu linked. If you have something discernibly distinct from those four you need to ask about macro lenses, could you update your question to more specifically reflect them? If not, I'll probably merge this into the most relevant of the questions koiyu linked within a day.
Answer: The macro lens is capable of focusing on things that are really close.
How close? (Magification ratios explained)
A 1:1 magnification means that a lens can focus on something so close, its image on the film/sensor is the same size as the subject itself, so you can imagine that's probably about as close to the lens as the lens is long (depending on the lens design).  A lens with a 1:1 magnification ratio or greater is clearly a macro lens.  Just to give you an idea, this level of magnification should allow you to get close enough to a 50 cent coin so it fills the frame, and still focus on it correctly.
Macro lenses don't only do macro
Macro lenses are designed to be able to focus close, but that doesn't mean they can't focus out to infinity as well, and they may serve as a good portrait lens too.  You don't have to use them for actual macro photography (that's something I never realised when I was new to SLRs).
Properties of macro lenses in general
A macro lens of a similar quality and design will typically be more expensive than a lens with otherwise similar specs and no macro ability, because its ability to focus so close requires a few design considerations.  It may also be slightly more bulky.  It is likely, however, to have better image quality in some respects, even when not taking macro photographs.  These are generalisations only and each lens is going to be different.
Lenses for portrait photography
Traditionally, portrait photographers tend to like to minimise perspective distortion ("big nose effect") so they choose longer, rather than shorter, focal lengths and stand further away.  For this reason, 100mm/105mm and 135mm primes are popular focal lengths for lenses marketed as "portrait" lenses, but this won't stop you using something as wide as a 35mm or as long as a 300mm for a portrait - it's about the look you want to achieve.  Without knowledge of your budget or other requirements, this is one example of a Macro lens that should be good for portraits.
Comment: +1 for answering all common questions about macro lenses
Comment: 1:2 is *less* magnification than 1:1.  A common definition of a macro lens is a lens capable of 1:1 magnification so if you accept this definition that 1:2 lens is *not* a "true" macro lens.  However the term "macro" is commonly used in many lenses that don't reach 1:1.  See also http://www.cambridgeincolour.com/tutorials/macro-lenses.htm
Comment: A macro lens also has a very flat field of view making it suitable for photographing things like documents. And it makes a very good prime lens for general purpose use, which is why I have a 50mm macro..
Comment: How about 1:2 magnification? I just bought a Sigma 70-300 DG Macro, and the macro works on the 200-300 mm area with closest focus distance being 95 cm. Is it only a marketing term, or could we say a 1:2 magnification counts as macro?
Comment: There are macro lenses that are not capable of infinity focus or even any focus distance less than the MFD. The Canon MP-E 65mm 1-5X Macro is one. It only is capable of a single (very close - ranging from 0.78-1.02 feet) focus distance at any magnification setting.
Comment: The flat field correction and optimization for closest focusing distances [can work against using a macro lens for portraits](https://photo.stackexchange.com/a/85708/15871), even though a lot of photographers do it. (Probably because they think how "sharp" a lens is at close focus distances is more desirable for a portrait lens than, for instance, pleasing out-of-focus areas that are often not so pleasing due to the flat field correction of macro lenses). It works okay for f/8 head shots in a studio with a diffused backdrop, not so much when wide apertures are used with a busier background.
Answer: A lens designated as 'Macro' is designed to allow you to focus really close to the subject, usually to the point that the image on the sensor or film is the same size as the subject itself (which is described as 1:1 macro). Apart from that there is no difference in principle; you should still be able to use it for portraits and landscapes etc as it will still focus to infinity.
The best focal length for portraits is the 35mm equivalent of around 85mm or above. If you're using a cropped sensor camera this means you should use a lens of about 60mm focal length or longer. Lenses wider than that tend to distort the features, especially on a full-frame close-up. However a macro lens is not a requirement for portraiture.
Canon make a 60mm Macro lens with f/2.8 maximum aperture which would be suitable for portraiture on cropped sensor cameras (i.e. all but the 1Ds and 5D series of Canon cameras). But you should check the reviews on Fredmiranda.com to see which lens would be best for you.
Comment: Macro lenses are much better-corrected than ordinary lenses, because at the extreme closeup distances they're designed for many of the flaws that are common to all lenses are greatly magnified. Those corrections, along with the focusing mechanism (which has to cover a much greater variation) make macro lenses more expensive by their very nature. You can usually get a conventional prime lens that is as fast as or faster than a macro of the same focal length for less money that will be as good or better for portraiture, but you need to buy an extra lens for macro work. (cont'd)
Comment: (Damned wifi...) That's why macro lenses have traditionally doubled as portrait lenses at the same focal length -- no photographer wants to buy the "same" lens twice if he doesn't have to.
Comment: Thanks Nick... But is it worth buying a macro insteat of regular lense? As I see that macro fast lenses are much cheaper than a fast lens of similat focal length...
Comment: Can you give examples of such comparisons? I can't see which lenses you're referring to.
Comment: I mean is it possible to substitute a macro lense in place of a standard lens of same focal length?
Comment: I mean 100mm or 35 mm
Comment: @PRK as Stan says, macro lenses are typically more expensive than standard lenses, so I don't know where you get the impression that they are cheaper, which is why I asked for an example. However to answer your question, as I said in my answer above, you CAN substitute one for the other where the focal distance is long enough, e.g. for portraits.
Comment: @Nick: minor correction, the Canon EF-S Macro is 60mm, not 65mm.
Comment: The flat field correction and optimization for closest focusing distances can [work against using a macro lens for portraits](https://photo.stackexchange.com/a/85708/15871), even though a lot of photographers do it. (Probably because they think how "sharp" a lens is at close focus distances is more desirable for a portrait lens than, for instance, pleasing out-of-focus areas that are often not so pleasing due to the flat field correction of macro lenses). It works okay for f/8 head shots in a studio with a diffused backdrop, not so much when wide apertures are used with a busier background.


If i add more fruit, yeast and sugar can i re make wine?

Question: I made some homemade wine and I believe I didn't add enough sugar because it reads 0 alcohol. My question  is my wine has been strained and transferred into clean jars and dead yeast gone. If I take my "finished" alcohol free wine (wasn't trying to make alcohol free) and start the process over again, fruit, yeast, MORE sugar then last time and some water to top it off and start fermentation with it would it work?
Answer: First off, it seems unlikely that you have alcohol-free wine regardless of how much sugar you added.  Fruit juice alone has plenty of sugar to produce alcohol with a ferment -- perhaps not as much as you wanted.
I'd be interested to know exactly what reading represented 0 alcohol.
In the end, you could conceivably do what you suggest.  But I'd be certain I was reaching the correct conclusions from what you are reading.  Instead, take a taste of what you have.  Does it taste like the fresh juice, or does it taste more like wine? Take an SG reading.  Finished wine should be about 1.000 or less.
If the latter, I'd leave it alone, lay it down for a while and drink young (as it may have a light alcohol content).
If it still tastes like the original fruit juice (and has a high SG), then you had no ferment.  Sterilize the batch, take a SG reading, add sugar to reach your desired SG, and ferment with a lively yeast.
If it is sweet and super sour -- dump it.  You likely had no ferment the first time around and your must spoiled.
Hope this helps.
Comment: I used my hydrometer and it read 0.00 flat. This is my 1st time making wine so I'm sure I did something wrong lol the yeast I used was red star brand premier blanc. The recipe I used only called for 1 cup sugar, 1 gallon of water and 3lbs of barries. So idk it all fermented like it was suppose to and it very much tastes like wine my reading just said 0 I also didn't have the hydrometer when I had 1st started so I could just be completely wrong and I made good wine lol
Comment: I think you're fine.  If your hydrometer reads 0 *after* fermentation, that's normal for wine.  A lot of hydrometers will have readings for expected alcohol content on them, but that references the SG *before* fermentation.
Comment: Thank you so much for your help I really appreciate it.
Answer: What did you use to get a reading of 0 alcohol?
The common method to find alcohol level is to compare how much sugar you started with vs how much is left after fermentation. Hydrometers and refractometers show a reading that represents this sugar content. There are tons of calculators on websites that will tell you the alcohol percentage based on the beginning and ending readings.
There are also different hydrometers and refractometers that are calibrated to show direct alcohol percentage, but since they use the same method as the sugar-based ones, they only work on distilled liquor- if there is any sugar in the liquid, it will throw off the reading, potentially offsetting it to zero.
If that's not your problem in the first place, to answer your question: no, more sugar won't help. If yeast didn't consume any sugar, it's because there was too much, or maybe the pH was too low, or they didn't have enough nutrients, or a similar problem. Adding sugar won't fix any of those issues. If you just wanted to try adding something for fun, try adding water, or some yeast nutrients (fermaid O is great) or maybe even just pour some craft beer in there, with the hopes that it already has a good balance of everything. You could pour in "natural" wine as well, but it's more expensive, and wine propbably won't provide nutrients, and needs years of age before it tastes okay.
Comment: I used my hydrometer and it read 0.00 flat. This is my 1st time making wine so I'm sure I did something wrong lol the yeast I used was red star brand premier blanc. The recipe I used only called for 1 cup sugar, 1 gallon of water and 3lbs of barries. So idk it all fermented like it was suppose to and it very much tastes like wine my reading just said 0 I also didn't have the hydrometer when I had 1st started so I could just be completely wrong and I made good wine lol
Comment: So basically, a beer/wine/brewing hydrometer doesn't measure alcohol level, only sugar, and a proof/tralle/ABV hydrometer can only measure distilled liquor. Sugar will make a hydrometer rise up, and alcohol will make it drop down, so sugar+alcohol like in wine can make it show zero. If you saw it ferment and it tastes good, sounds like you did it right.
Comment: Ok thank you! So much for you help.
Answer: The hydrometer reading that says alcohol actually shows "potential ABV for the amount of sugar we think is in the liquid" - so your hydrometer showing 0.0 at the end is a good thing! Its means all the available sugar was converted.
It's not always super clear, but the hydrometer reading is actually just a rough measure of the "stuff in the liquid that isn't water" (it measures the density: higher than 1.0 is assumed to be sugars, lower than 1.0 is from alcohol).
If you have a reading from the start, the hydrometer instructions should include a formula to use the start + end values to calculate estimated ABV. Alternatively, there are a bunch of calculators online where you can type in your start + end values (and if you need, a way to convert the potential ABV reading or Brix reading to the SG reading).
Comment: Good point.  Only pay attention to the ABV indication in unfermented wort/must.


Can I temporarily store evolution points in myself with the Summoner's Aspect ability?

Question: When a Summoner uses the Aspect ability to divert evolution points to take on evolutions for himself, can those points then later be diverted back to his Eidolon's pool or are they permanently stuck in his pool? I wish to use Aspect as a way to store points and not have to remove evolutions from my eidolon in order to get a 3 or 4 point evolution.
Comment: You get to change your evolutions when you level why do you need to "store points"?
Comment: @Nickmagus maybe there's no good evolutions for the eidolon right now, but the summoner could benefit for a level or two, until the eidolon can get something good.
Comment: For roleplay purposes, I want to keep the Eidolon's form evolving in a pretty linear fashion. I've already decided getting rid of Climb in order to have an extra point for Flight would make sense. However, there is one spot where I want to give my character some lesser one or two cost evolutions that then are transferred into powerful four cost evolutions that are practically bigger versions of the lesser ones. I understand "storing points" makes no sense as far as mechanics go, but for roleplay purposes I think it would suit my purposes better. Perhaps something to just work with my DM about?
Answer: Yes, you could store the points and give your PC the 1-2 point evolution, and then change them out when you gain a level, just as you can change the delegation of the other evolution pool points.

Aspect
At 10th level, a summoner can divert up to 2 points from his eidolon's evolution pool to add evolutions to himself. ... The summoner can change the evolutions he receives from these points any time he can change the eidolon's evolutions.

Evolution Pool
(from Eidolon abilities)
... Whenever the summoner gains a level, the number in this pool increases and the summoner can spend these points to change the abilities of the eidolon. These choices are not set. The summoner can change them whenever he gains a level.

Transmogrify
Your eidolon's form shifts and transforms. This spell allows you to change any of the eidolon's evolutions by allocating its evolution pool on new evolutions. If you have the aspect or greater aspect ability, this spell also allows you to change the evolution points spent to modify you, including removing or adding points as allowed by those abilities.

The way I've read those is that every time the summoner gains a level in Summoner, he/she effectively resets the evolutions, gains the full pool of evolution points, then spends them as desired. With the Aspect ability, you are diverting points from that pool at any point you could change the eidolon's evolutions.
Thus, when you gain a level and want to store points, you divert the two from the evolution pool. The next time you gain a level, you choose whether you'd like to divert 0, 1, or 2 points with that ability again.
Also with how Transmogrify spell functions, moving points back and forth between Aspect and the Evolution Pool when you level up seems to be completely viable.


BubbleChart ignores Ticks option

Question: BubbleChart does not display ticks to the Ticks option specs.
BubbleChart[RandomReal[1, {10, 3}],
 Ticks -> {{#/10 // N, FromLetterNumber[#]} & /@ Range[10], Automatic}]

Is this a bug or have I spec'ed it incorrectly?
Version 10.2 on Win 8.1 Pro 64-bit
Comment: It uses a `Frame`, so `FrameTicks` are used, not `Ticks`.
Answer: Ticks generally aren't visible on graphics, when Frame->True is set.
Module[{ticks = {#/10., FromLetterNumber[#]} & /@ Range[10]},
  GraphicsGrid[{{BubbleChart[RandomReal[1, {10, 3}],
                   Ticks -> {ticks, Automatic}, Axes -> True, Frame -> False],
                 BubbleChart[RandomReal[1, {10, 3}],
                   FrameTicks -> {ticks, Automatic}, Axes -> False, Frame -> True]}}]]

Note the section on options in the help docs for BubbleChart, particularly the subsection which states: "BubbleChart has the same options as Graphics with the following additions and changes".
Comment: Yes, I read that section when figuring out the format for the ticks. It does not mention that `Frame` excludes `Ticks`.  My thoughts were with ticks, so I jumped over to Graphics and looked it up there.  In any case, I've learned something new for `Frame` and `Axes`.

BubbleChart ignores Ticks option


A question about systems of homogeneous polynomial equations

Question: Let $m$ and $n$ be positive integers. Suppose that we are given $m$ homogeneous polynomial equations (with complex coefficients) such that each of $n$ variables occurs at least once in all of the polynomials. No other variables occur in any of these polynomials – and they are not necessarily all of the same degree. If $m$ is less than $n$, will these $m$ equations always have at least one common root in the field of complex numbers that is non-trivial? By "non-trivial", I mean a root in which not all the variables are equal to zero.
Comment: Unless I'm misunderstanding you (possible), you don't even need your condition about each of the n variables occuring at least once. The statement is that in n dimensional complex projective space, the intersection of m < n hypersurfaces is always nonempty. That is, yes. (Moral: a degree d hypersurface is linearly equivalent to d copies of a hyperplane, and the intersection of m hyperplanes in projective n space is always nonempty. For a rigorous proof apply dimension theory to the affine cover, the intersection is nonempty because it contains the origin. I can expand on this if you want.)
Comment: I added this condition to rule out systems like 2{x(1)^2},  3{x(1)^2} and also x(2)^2+x(3)^2+x(4)^2 where m=3 and n=4-because the first two polynomials have no non-trivial common root.. But I see now that this need not cause any trouble. You are right. I know very little about projective geometry and was just trying to puzzle out the algebra. Many thanks.
Comment: I highly recommend Shafarevich Basic Algebraic Geometry book I if you want to learn the basics of projective algebraic geometry. The proposition I mentioned will be covered in the first chapter, I think.
Answer: Theorem: In n dimensional complex projective space over an algebraically closed field (such as the complex numbers), the intersection of m < n hypersurfaces is always nonempty.
Proof: Suppose that hypersurfaces are given by equation $f_1, \ldots f_m$. Consider these as equations cutting out points in the affine space whose lines will make up the projective space ($A^n \setminus 0 \to P^n$). Here each $X_i = V(f_i)$ contains the origin, so the intersection of the $X_i$ is nonempty. However, by dimension theory, the minimum dimension of the components of $X = \cap X_i$ is $n - m \geq 1$. Thus, $X$ is at least one dimensional and nonempty, so it contains a point not passing through the origin. This means that the corresponding projective algebraic set is non-empty.
Lemma: (From dimension theory) (Generalizing the theorem of algebra about the finiteness of roots of a polynomial) If $X$ is an algebraic variety of dimension $k$ in $A^n$, and $Y$ is a hypersurface, then the irreducible components of $X \cap Y$ have dimension $\geq k - 1$.
Proof: Relatively hard commutative algebra. (Depending on your definition of dimension.) But morally, $Y$ is given by an equation $f$. Restricting this equation to $X$ as $f|X$, the zeros of $f|_X$ correspond to points of the intersection $X \cap Y$. Now, generally speaking, looking the zeros of a polynomial equation on a variety $X$ can't cut down the dimension by more than 1. (Krull's Principal Ideal Theorem.)
Comment: Wow! I never expected such a detailed response. This approach to the problem seems so much more powerful than the pure algebraic elimination theory-as presented by Van der Waerden-which I was trying to use.
Comment: What do you mean by "a point not passing through the origin" ?


House electric not working

Question: I have a home from the 1850s. Mixed knob and tube with parts that are updated romex. I lost power to 1/3 of the rooms. Power is coming in from the outside to box, from box to breakers, and out from each breaker. Have tested each outlet and fixture in the house and those that work are obviously hot and those that are not are receiving any electric. Didn't finish my electrical map when we moved in so not sure how many breakers the trouble lies on. Have check all GFCIs and that is not the issue. Any advice? Guidance?
Comment: Do you have an electric stove or oven? Turning a burner on high does it get red hot like always or does it seem to not get as hot?
Comment: Hi! I have gas. All appliances work as normal and consistent prior to the power being dropped.
Answer: Many homes of this time frame had very few individual circuits and as you have found a mix of old and new wiring. With a large section not working it may be as simple as 1 conductor at a junction has failed. Tracing this may take quite a bit of time and or special equipment. I use a Greenlee CS 8000 circuit tracer it has a self powered transmitter that you can trace the wires through the walls and will locate the failure point. These are fairly expensive but you may be able to find a used one or factory second at a reasonable price but a tool like this may be a good one to have for future problems also. The CS 8000 works on both live circuits and dead. Other than that it will take tracing the wires back and the failure point could be in a wall or enclosed space the cs8000 will pinpoint it within a few inches.

House electric not working


Can you install a steel beam in timber posts?

Question: I'm planning to remove a load bearing wall and place a 4500 beam. Steel is stronger than timber and I should be able to use a thinner steel beam than a timber beam. Does this make sense and how do I attach it to the timber posts and rafters?
Comment: I'm thinking you should be talking to a structural engineer who will sign off on the correct way to do this.
Comment: @JACK Agreed - definitely a structural engineer question to make sure the beam is the right size, etc. But as far as how to attach, that will depend on many factors - typically some sort of metal bracket screwed into the wood and bolted to the steel. Too many variables to guess - someone *might* be able to help with: pictures, dimensions, etc.
Answer: You have several issues to consider: 1) span of steel beam vrs. wood beam, 2) weight of steel beam vrs. wood beam, 3) connectors, 4) ease of connecting joists to wood beam vrs. steel beam, 5) ease of installing wood post vrs. steel post, 6) size of footing under posts.
1) Yes, steel beams can be smaller than wood beams when carrying the same load and spanning the same distance. However, if there is a headroom problem, you can move the beam up and have the joists frame into the side of the beam or reduce the span of the wood.
2) Physically moving the beam into place is going to be difficult. A steel beam may weigh less, but with a wood beam you can nail supports to the side of it to keep it level, aligned, stable, etc. Also, if the beam needs to be cut to fit, wood is easier.
3) Connectors from a steel beam to a wood post will need to be custom and probably designed by a structural engineer. However, a connector from a wood beam to a wood (or steel) post is readily available and standard through Simpson Strong Tie. (See Simpson LCC or CCOS connectors for wood to steel posts.) See here: https://www.fastenersplus.com/shop-by-product/simpson-connectors/post-bases-post-caps/lccccos-lally-column-caps
4) Connections from wood joists to steel beam is not standard and you'll need a structural engineer to determine ledger size and bolting, plate size and bolting, etc. Whereas wood to wood Connection is standard.
5) When wood posts are cut to fit, they must be the perfect length. Fitting a wood post with a connector on it is very difficult to "pound" into place and fit tight. However, using a "Lally Column" allows adjusting in place.
6) If you are trying to span an extra long distance by using a steel beam, your footing will need to be extra large too. Make sure it's sized properly.
Summary:
Generally for ease of construction, the beam and posts are reversed: wood beam and steel posts.
Comment: Thank you guys your answers are fantastic! Lee, your explanation was a learning course for me :) I couldn't find this information anywhere. This is what I needed to know and now I'm convinced that adding steel to the mix will be significantly more challenging. I will stick to timber. I'm new in this awesome website and couldn't find out how to vote 5 stars for you guys. Please let me know of there's a way.
Comment: @Rudi the first thing to do is to "accept" Lee Sam's answer.


How to create a unique identifier in the attribute table based on spatial location within another layer?

Question: I am currently working in ArcGIS 10.2.2 for Desktop and would like to know if there is a workflow for creating a unique ID for polygons within a shapefile based on their location. I am using data driven pages that are clipped to individual Township/Range/Sections of a city. There is polygon information that spans the entire city, but would like to create some type of unique identifier that allows users (of the exported attribute table) to quickly see where a polygon is located based on the identifier. What I currently have in mind is to list the Township/Range/Section and add a numeric suffix. For example, in the image below the first polygon in Township26-Range42-Section27 (highlighted in red) would be 26-42-27-1. The Township/Range/Section information is saved in another shapefile, so I am not sure the best process to append that info to the individual polygons within this other shapefile based on location.
Comment: I was going to suggest http://gis.stackexchange.com/questions/155022/controlling-label-attributes-of-grid-fishnet-index-using-arcgis-for-desktop-and to create your index feature class but it looks like you already have that.  Consequently I think you just need to use the Intersect tool to intersect the feature class you want to index with your index feature class.  That will transfer the key field from your index feature class.
Answer: I agree with PolyGeo; if you do use the intersect tool that will provide you with a basis to at least link your data together. You would then want to make a new field and use the field calculator with something like this: [RangeInfo]&"-"&[FID] where [RangeInfo] is whatever field has your T/R/S info. If you have access to SQL Server or other spatial database, as spatial query could also be used to move the information from your one layer to the other as part of an update query.
Comment: In it's current state, this is more appropriate as a comment on the question. I'd recommend re-wording and adding more detail if you keep this as an answer.
Comment: @Adam  with less than 50 rep this answerer will not be able to comment on other than their own posts More detail would be great but I think there is already enough content to qualify as an answer.
Comment: i stand corrected
Comment: Thanks user# - the field calculator prompts were very helpful for reference.


What are the current implications of a 100% accurate lie detector?

Question: What are the current implications of a 100% accurate lie detector? Would we use it in the justice system? Would it change the way we chose and elected leaders?
Comment: A perfectly accurate lie detector cannot tell whether a person tells the truth or not, only whether the person tells what they _believe_ it's the truth or not. This is a plot point in many fantastic adventure novels. Not to mention that a skilled operator can try to answer truthfully but misleadingly -- this is a plot point in the *[Safehold](https://en.wikipedia.org/wiki/Safehold)* series by David Weber and in the *Belisarius* series (by David Drake and Eric Flint).
Comment: Even if it was 100% accurate, you won't be able to prove that it is and thus people can blame it by lying.
Comment: One *huge* implication would be the philosophical and religious effects of knowing that the definition of a "lie" is so definitively clear that a 100% accurate lie detector can exist.  Politicians would also have to get really clever, pushing the bounds of whatever this definition is.
Comment: If you could focus it on one aspect; the justice system or elections, maybe it could be salvaged, but as written it is way too broad a question.
Comment: Welcome to WorldBuilding *Chess*! What you are asking is incredibly broad. It looks like you would like to have a long list of all the ways this could affect societyas you list two very distinct topics already, that are pretty broad on their own. As a rule of thumb "If you can write a whole book to answer the question it is likely too broad". Please [edit] your question to narrow the scope down. Otherwise it might get closed until you edit it to conform to the sites guidelines. If you have a moment please take the [tour] and visit the [help] to learn more about the site. Have fun!
Comment: @A.C.A.C. An interesting twist on this problem, and related to AlexP's comment, is in one of the Fuzzy books by H Beam Piper, they had a perfect, trusted lie detector (or veridicator), but a key part of the trial revolved around the question whether a member of that species was even capable of lying.
Comment: @AlexP: Thank you for resisting the temptation to use what seems like a near-perfect example from current events :-)
Answer: Science isn't always applied equally
We know genetic tests are far more accurate and reliable than eyewitness testimony. Yet we still use eyewitness testimony -- and often value it more than genetic data -- in jury trials.
Your perfect lie detector may not be "trusted" by jurors, despite every logical reason to believe it is perfect.
There's truth and then there's truth
There's a concept in Robert Jordan's Wheel of Time series. The female magicians (called Aes Sedai) of that book series are magically oath-bound to never lie. Which gives rise to the idea of "An Aes Sedai never lies, but the truth she speaks may not be the truth you think you hear."1
If you cannot tell a lie, that's nowhere near the same thing as not deceiving your audience. One can manipulate the truth such that it doesn't mean what people thinks it means. And there will always be people who figure out how to do just that.
People will swear something is true, even when it isn't. A good investigator must be very careful how they question witnesses to make sure they don't taint the witness or lead them to misremember data. They don't ask "did you see a redheaded person robbing the store?" but instead "What color hair did the robber have?" Asking a Christian to say "Jesus Christ is God" will give you a Truth. But asking an atheist the same question will give you a False. So even this truth/not truth data must be managed carefully.
Partial truths, shades of the truth, what someone believes to be true, or just outright misdirection, can all pass a "100% truth" test in some cases. And good lawyers would both know how to use this and how to taint a jury by making them question whether the other lawyer was using this.
Fear of false positives?
You may need to expand on how your detector works. But the process for modern-day polygraphs is a very careful process. This is because false positives are not impossible.
I've taken a polygraph exam. The process isn't what you see in TV shows or movies. The examiner sits you down, and vary carefully goes through all the questions before you even see the machine. The examiner explains the process, and then fine-tunes the questions to help rule out false positives. One example from my exam was this baseline question: "Have you ever stolen from a previous employer?" So she asked me that. And we discussed what the question meant, discussed the reality of office environments, in a back-and-forth ("Does taking paperclips count? What about printing personal things on office printers?") that refined the baseline question to the one in the final exam: "Have you ever stolen anything worth more than $100 from a previous employer?"
Then, once all the questions have gone through this back-and-forth, you sit for the exam. In an unlit room. Where no external distractions can exist -- no hallway noises, etc. -- again, because false positives. And the examiner goes through the questions three times. Three times because that builds an average. Again, to reduce those false positives.
So again, unless we're talking about magic spells, no such instrument would be useful under the high stress environment that a court room or presidential debate would be.
Final outcome
It would make job screenings more useful. And might help criminal investigations. But probably wouldn't impact courts or elected officials much. Again, unless we're talking about magic. Because then all bets are off.
Answer: Letting aside 100% is not something actually existing in Nature, all problem is in the definition of "lie".
Please consider the famous citation (Robert A. Heinlein):

"It's not enough to be able to lie with a straight face; anybody with enough gall to raise on a busted flush can do that. The first way to lie artistically is to tell the truth — but not all of it. The second way involves telling the truth, too, but is harder: Tell the exact truth and maybe all of it…but tell it so unconvincingly that your listener is sure you are lying."

How would your "perfect lie detector" handle this? Only way out would be to actually detect the "intention" to lie, but that is a bit over the board.
Consider also that best liars actually convince themselves the lie is actually true (this is how certain individuals "resist" even drugs).
This said a few considerations:

Experienced liars would still escape, is some way, detection.
Widespread usage would face a heavy opposition because, in spite of our innate (and sometimes morbid) curiosity everybody has something to hide, in many cases with good reason (who would save Santa Claus?).
All religions would fiercely oppose it (even if majority(?) of "ministers" really believe there are many that do not or, at least, hold some doubts).
Lawyers would fiercely oppose it because they would become useless.
Politicians wouldn't see it well (unless they happen to be in one of the above "slippery" categories).

Given human nature this wonderful invention is likely to be buried, together with its creator, in some very deep pit (after public burning at the stake).
Answer: I presume that this lie detector can scan almost all the human brain, because lying detectors can be decieved if the person repeat the lie to itself a lot and be a very good actor. Maybe you've repeated the same story so much with your own lies that you truly believe them. The person who asks the questions has to be skillful too. The questions and answers would be analyzed in the end of the sessions and they will try to find "the Truth" based on their own hypothesis of what is not true. (Because, again, this is a LIE detector. There could not be a truth detector simply because what is true for you can be false to me.)

Corruption would only happen by human mistakes and misunderstandings.
You cannot extract the truth, but only, what is not true.
This could change diplomacies as a whole and even wars could escalate
as secret plans can be revealed.
Not every country would acept this kind of machine and will try to
scam it at all costs. They could use scientists to question the
integrity of this detector. (They could get some hipsters or nerds
from here e_e)
You must also think on the price, because if it is too low and
democratic, the whole society with its families and individuals could
be affected. Hippie-like movements would emerge praying for a cleaner
humanity.
Abstract questions can be hard to measure as it involves doubt, not
believing and faith.
The lie detector could still be used for evil if the analyzers
creates crazy theories of the questioned individual.
There would be burocracy and laws for the lie detector, because the analyzer could
ask a hundred of questions and the interpretation of what is true
based on what is not true can change from analyzer to analyzer.
Sciences and philosophies could born because of this.

"Do black swans exist?"
"Yes."
The lying detector did not ring.
"Where have you seem them?"
"In various movies. So, I suppose they exist... isnt it?"
The lying detector did not ring.
"No, they dont."
Another guy name's Popper enters the room and says "Just because you havent seem black swans does not mean they do not exist."
So what is True?


Determine XBOX CD Drive From Box

Question: Our out-of-warrantly xbox died, and it's the CD drive (I've been in the box, and got it back working several times). I've determined it's not a big deal to swap in a new drive - if you also swap the PCB with it (short of transferring info with special programs). Unfortunately, I have BenQ drive with soldered connections, rather than plugin connectors. I've decided the best solution is just to buy a new xbox. But - is there any way to determine from an in-the-box new xbox, without opening the carton and peeking at the tray (which can tell you) what brand drive is in the xbox, so I can buy one that can be easily swapped if (when) it goes bad? Hitachi and Samsung/Toshiba appear to have PCBs with connectors, amking swapping easy if something goes wrong. Is there a serial number or something that can tell me this?
Comment: If xbox is out of warranty they can still fix it, it cost me $100.
Comment: Can't you just get the drive replaced by Microsoft for much less than the cost of a new XBox?
Comment: One good way of avoiding damaged DVD drives is to install your games to your hard drive. When I first got an XBOX and Oblivion, I went through 2 DVD drives and 3 game discs because of my extended play sessions. After installing the game to my hard drive, I have yet to experience any hardware malfunctions and all of my discs are in mint condition.
Answer: This is only be a partial answer, but this list appears to be up to date with the newest versions and will tell you how to determine what lot numbers and teams mean which drives are in the machine.
All that being said, I don't know that you can find this out without actually seeing the physical xbox 360 unit as these numbers are for sure on there. I do not know if the Lot numbers and teams are displayed on the cardboard box that the unit ships in, so it may not be of any use.

Determine XBOX CD Drive From Box


Renormalization of Composite Chiral Superfields

Question: On page 24 of these lecture notes  http://arxiv.org/abs/hep-th/0309149 it is stated that products of chiral superfields do not suffer from short distance singularities. In other words, if I want to calculate the dimension of a composite operator built out of chiral superfields, I may just add the dimensions of the individual field operators that form the product (in other words, it is sufficient to just renormalize the individual operators). This is definitely not the case in ordinary QFT. Can someone please explain why this is the case? Is the same true for products of vector superfields (the wording in the notes seems ambiguous)?
Comment: I don't have the answer, but it seems that one speaks about that in this [paper](http://arxiv.org/abs/hep-th/0309149) (end page $24$, beginning page $25$, and previous pages)  Maybe, it is because (see page $19$): "In particular, the superpotential cannot be renormalized at any order in perturbation theory!"
Comment: Yeah, I've read through page 25 of those notes (its the paper I linked to), but I don't see any justification for his statement. You may be right, it probably has something to do with holomorphy of the chiral superfield (superpotential is itself a chiral superfield), but to show non-renormalization of the superpotential you have to use various tricks like existence of weak-coupling limits, etc which don't really seem to apply to arbitrary operators.
Answer: The Green's function of a product of chiral superfields is independent of space-time as a consequence of the SUSY algebra. This can be shown by noting that (roughly)
$$
\bar{\sigma}_\mu^{\alpha\dot{\alpha}} \partial^\mu \langle0|\Phi_1(x_1),\cdots,\Phi_n(x_n)|0\rangle= \langle0|\Phi_1(x_1),\cdots,\{Q,\Phi_i(x_i)\},\Phi_n(x_n)|0\rangle=0
$$
where it is assumed that $Q|0\rangle=0$.
This independence of the space-time means that short distance singularities will not affect the product of chiral superfields (perturbatively).
I hope this helps
Answer: I've found the answer to this question, and it does basically follow from holomorphicity. The holomorphicity property is essentially the statement that the operator is BPS: $\Phi$ is annihilated by a supercharge $Q$. This is also the reason the property does not hold for vector superfields, which are not BPS.
The reason that the dimension of the operator is protected from quantum corrections is due to the structure of the superconformal algebra. The superconformal algebra contains, in addition to the supercharges $Q_\alpha$, the conformal supercharges $S_\alpha$ that come from the commutator $[Q,K]\approx S$. The commutation relations of the algebra show that S lowers dimensions by $1/2$, while $K_\mu$ still lowers dimensions by 1. The multiplets of the superconformal algebra are larger than those of the conformal algebra. The highest weight states are superconformal primaries that are annihilated by both $S$ and $K$. Starting with such an operator $\Phi$ satisfying
$[S,\Phi(0)]=[K,\Phi(0)]=0$
you may generate the rest of the representation by acting on $\Phi$ with both $Q$ and $P^\mu$. The point is that for special operators, called chiral primaries (also called BPS operators), $[Q,\Phi(0)]=0$ and you get a short multiplet. You can use this fact along with the commutation relations of the superconformal algebra (specifically $\{ Q,S   \} \approx R + D$ where R is the R charge and I am assuming a scalar operator for simplicity) to show that the dimension of a chiral primary is determined solely by it's R-charge. Note that in a superconformal theory R-charge is well defined since it cannot be anomalous without breaking superconformal invariance.
The point is that these chiral primaries cannot pick up anomalous dimensions. Basically, we have the dimension of the operator in the free theory where the coupling is 0. Regardless of the coupling, the chiral primary is still annihilated by the supercharge, it remains a chiral primary in the interacting theory. If this were not the case, continuously varying the coupling would lead to a discontinuity in the number of operators of a given dimension (this must be an integer, it cannot vary continuously with the coupling). So the operator in the interacting theory is still a chiral primary, its dimension is related to its R-charge.
In the case I asked about, the chiral superfield is a chiral primary. Products of chiral superfields are still chiral, so the composite operator is still BPS, and its dimension is related to its R-charge. But the R-charge of the operator is the sum of the R-charges of the individual operators, so we can simply add dimensions and not worry about any anomalous dimension.
The answer is a little more complicated than I had expected, but I am almost certain that this is the correct explanation.
Answer: You might want to look here: arxiv.org/abs/hep-ph/9309335
Your idea about holomorphicity of the super-potential is essentially correct.
Comment: I've read this paper. I don't think it really addresses my question but maybe I'm missing something. Can you elaborate?
Comment: Yep, please elaborate


Numerical Integration of a singular function

Question: I have a following function:
$$f(r)=\int_{r}^{\infty}\frac{g(y)\mathrm{d}y}{\sqrt{y^2-r^2}}~,$$
where $g(y)$ is a continuous function and $g(r)\neq 0$ and $g(r\rightarrow\infty)=0$. Now, in reality I do not have a full functional form for $g(y)$: all I have is data points $g(y_i)$ for $y_i\epsilon (r, \infty)$. And I need to estimate $f(r)$ based on the data points $g(y_i)$. Assuming an equal separation of $y_i$, so that $\Delta y=y_{i+1}-y_i$ for all $i$, the approach is carrying out summation:
$$f(r)\approx \Delta y\sum_{i}\frac{g(y_i)}{\sqrt{y_i^2-r^2}}~.$$
However, there is a problem in the summation, as the term $g(y_i=r)/\sqrt{(y_i=r)^2-r^2}$ is divergent. Is there any way to fix this issue, given that I do not have closed functional form of $g(y)$ but just the data points?
Comment: Do you know anything about $g(y)$ near $y=r$? E.g. if it is (more or less) constant when $r \le y \le 2r$, then you can calculate the integral explicitly between those points and start your sum at $2r$.
Answer: We can get rid of the problem at $y=r$ and change the integral over an infinite domain to a finite one using the substitution $y=r\sec(u)$:
$$
\begin{align}
\int_r^\infty\frac{g(y)\,\mathrm{d}y}{\sqrt{y^2-r^2}}
&=\int_0^{\pi/2}g(r\sec(u))\sec(u)\,\mathrm{d}u\\
\end{align}
$$


How does the Clojure compiler generates JVM bytecode?

Question: What library/api does the  Clojure compiler (which is just a jar/java application) uses to generate the JVM bytecode? I'm curious since the bytecode is being generated at runtime by java and not javac, so its a java program that outputs jvm bytecode.
Answer: Clojure uses a Java library called ASM to generate bytecode. A fork of a part of the lib is embedded into the clojure project here: https://github.com/clojure/clojure/tree/master/src/jvm/clojure/asm
Comment: It's actually a subset of ASM. As part of Clojure 1.6, the subset was recently updated to ASM 4.1 in master.
Answer:
How does the Clojure compiler generates JVM bytecode?

It is just Java programming (unless they have bootstrapped their code generator to Clojure ... which seems unlikely).  As a gross simplification1, is opening a file, writing out the code in "classfile" format as specified by the JVM spec, and then closing the file.  (Or writing the code to a ByteArrayOutputStream or equivalent.)
For the record, there is nothing qualitatively different between what the Clojure compiler is doing and the Java compiler can do if you call it at runtime.  But obviously there will be differences in the fine-grain details, because of differences in the languages, and different ideas and priorities for the respective developers.

1 - If you want to know how code generators in general work, read a textbook on compiler writing.  For all of the gory details of how Clojure does it, look at the source code ...
Comment: The one exception I know of regarding Clojure and Java bytecode generation is Clojure locals clearing, which has no Java analog iirc.
Comment: There is a CinC (Clojure in Clojure) project, that would generate Clojure byte code without using any Java code, but it is not yet mature.


How can I decompose this matrix into the linear or bilinear product of two matrices?

Question: Given the $(m_1 + m_2) \times (n_1 + n_2)$ block matrix $$A = \begin{bmatrix}A_{11} & A_{12} \\ A_{21} & A_{22}\end{bmatrix}$$ where $A_{11} \in \mathbb R^{m_1 \times n_1},A_{12} \in \mathbb R^{m_1 \times n_2},A_{21} \in \mathbb R^{m_2 \times n_1},$ and $A_{22} \in \mathbb R^{m_2 \times n_2}$, and given the non-block $2 \times 2$ matrix $$B = \begin{bmatrix}b_{11} & b_{12} \\ b_{21} & b_{22}\end{bmatrix}$$ is it possible to decompose the following $(m_1 + m_2) \times (n_1 + n_2)$ block matrix $$C = \begin{bmatrix}b_{11}A_{11} & b_{12}A_{12} \\ b_{21}A_{21} & b_{22}A_{22}\end{bmatrix}$$ into some product (such as Hadamard, Kronecker, or other linear/bilinear product) of the matrices $A$ and $B$?
Comment: This could be interpreted as an instance of the [Khatri-Rao product](https://en.wikipedia.org/wiki/Khatri%E2%80%93Rao_product)
Comment: @BenGrossmann just what I'm looking for. Thanks! Feel free to add an answer and for me to accept.
Answer: This could be interpreted as an instance of the Khatri-Rao product. In general, for any two matrices $\mathbf A$ and $\mathbf B$ partitioned into $2 \times 2$ block matrices, their Khatri-Rao product is given by
$$
\mathbf{A} \ast \mathbf{B} =
\left[
\begin{array} {c | c}
\mathbf{A}_{11} \otimes \mathbf{B}_{11} & \mathbf{A}_{12} \otimes \mathbf{B}_{12} \\
\hline
\mathbf{A}_{21} \otimes \mathbf{B}_{21} & \mathbf{A}_{22} \otimes \mathbf{B}_{22}
\end{array}
\right]
.
$$
Comment: Just to add to this, in my case, I can decompose my $C$ block matrix as $C = A * B$, where $A$ and $B$ are defined in my question.


Minimizing a Functional with a Path Length Constraint

Question: Say you have some functional of the form $\int_0^{t_f} L(x,\dot{x},y,\dot{y},z,\dot{z}) dt$ that you're trying to minimize. Normally one can solve this using the Euler-Lagrange equations, and when you have a constraint you can add that to the Lagrangian using Lagrange multipliers. But how do you handle it when the constraint is that the path has to have a specific length, i.e. we require $\int_0^{t_f} \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2} dt = a$ for some fixed $a$? Would it suffice to add a Lagrange multiplier of $\lambda(\int_0^{t_f} \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2} dt - a)$ to $L$ and move the derivatives inside the integral when applying the Euler-Lagrange equations, or is some other method required?
Answer:
Would it suffice to add a Lagrange multiplier of $\lambda(\int_0^{t_f} \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2} dt - a)$ to $L$?

Basically, yes, except you don't bother with the constant $a$ (it would make no difference to the Euler-Lagrange equations anyway), so you end up with the auxiliary functional
$$\int_0^{t_f} L(x,\dot{x},y,\dot{y},z,\dot{z}) - \lambda\left( \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2}\right)\,dt$$
from which you have three Euler-Lagrange equations. You should be given three pairs of boundary conditions to get rid of the constants of integration, and you can eliminate $\lambda$ by substituting your solutions $x,y$ and $z$ into your constraint $\int_0^{t_f} \sqrt{\dot{x}^2+\dot{y}^2+\dot{z}^2} dt = a$.
Answer: Constrained calculus of variations problems can be hard.  Here is an example of optimizing a functional with respect to a differential equation constraint.
I can get the answer to you tomorrow; there's a book with the answer in it that I left elsewhere, but I'll get it tomorrow and look it up for you.
For what it's worth, those are called isoperimetric problems.  Maybe you can find the answer before I do tomorrow :)
Comment: I haven't found a way to propose corrections on MSE without sounding rude, but I think this answer may have a typo: I believe such problems are called "isoperimetric" (which I believe comes from Dido's problem of maximizing the area enclosed by a closed planar curve of fixed perimeter) rather than "isoparametric."
Comment: You're right, fixed spelling.


Is the +10 increase to Craft DCs of the Accelerated Crafting rules be applied several times for the same item to craft?

Question: Can the voluntary +10 increase to the Craft DC of an item to finish it earlier be applied multiple times, effectively adding a multiple of 10 ?
Answer: RAW: No.
The rules are:

Accelerated Crafting You may voluntarily add +10 to the indicated DC to craft an item. This allows you to create the item more quickly (since you'll be multiplying this higher DC by your Craft check result to determine progress). You must decide whether to increase the DC before you make each weekly or daily check.

This only talks about adding +10, not lesser or greater amounts.
However try talking to your DM and they might allow you to take greater values as it makes sense that you could do more. Just make sure to discuss with him how the higher checks will affect the process.


Anyone please tell how flat universe have infinite Volume?

Question: I'm not able to imagine how flat universe have infinite volume can anyone please tell?
Comment: Very much related/possible duplicate https://physics.stackexchange.com/a/123692/23615
Comment: A (simply connected) universe is infinite i.e. if you draw a straight line that line will go on forever without ending. So it has an infinite volume. Or were you asking something more subtle that this?
Comment: can you give more explanation of this @John Reinni
Answer: "Flat" in this context doesn't mean flat like a sheet of paper, which is two dimensional. Space is three dimensional and thus can have volume; "flat" means that it doesn't have curvature. 3D curvature is hard (or impossible) to visualize, but it can exist, and we know from observations that on average the universe doesn't have any large scale curvature, so we call it flat. Not flat like a plane - flat like the regular 3D space we're used to.


Mazda 3 2015 2.2L diesel shakes each time when started up

Question: My Mazda 3 2.2 diesel shakes when starting up even when using auto stop/start in traffic or at a red light.
I took it to a mechanic and they checked the clutch kit and flywheel but did not resolve it.
Car shakes especially when the engine is warm.
The mechanic changed the drive belt too.
Thank you
Comment: Does it only shake when starting or stopping the engine, but not during normal running? If so, it could be a worn throttle body that needs replacing.
Comment: Only shake when start than normal until stop on traffic or traffic lights when stop starts working and car automatically start again make noise and shake
Comment: stop is normal only shake when start
Answer: Ask your mechanic to check the engine mounts and replace them if they are worn. Loose or worn engine mounts will cause a diesel engine to shake vigorously when it starts or stops.
Diesel engines have a much higher compression ratio than gasoline engines, so the first or last compression stroke that occurs when an engine starts or stops can be a bit violent. Some diesels have an "anti-shudder valve" that momentarily closes the air intake when the engine is shut down to rarify the air in the intake manifold and make shutdown more gentle. This doesn't work, of course on start-up.
Comment: Well I did before all engine mount are fin also I took car to diesel inject specialist and they said nothing wrong with fuel injectors.
Comment: @Nima I have no other ideas what could be wrong. I suggest that you go to a Mazda dealer to see if they have any 2015 Mazda 3 diesel on their lot and ask the service manager to start their car so you can see if it shakes the same as your car. If others shake the same as your car, you should consider it a normal behavior of this model.
Comment: Today I have appointment with diesel injector specialist to find out what is the wrong if they can't find it I will take car to Mazda dealer,  I will update you


Online guide to electronics

Question: I had the luck to have someone who could explain everything to me, but most starting hobbyists don't have someone like that. Is there a guide available which covers all the basics, like formulas, parallel / series, etc.?
Comment: Uhm, how about this stack exchange? :) If the question is good, it's still useful even if basic. As the "about" page say: "This is a free, community driven Q&A for electronics and electrical engineering professionals, students, and enthusiasts. "
Comment: http://sound.westhost.com/articles.htm
Comment: A random smattering of questions and answers with all difficulty levels mixed in is hardly a useful narrative. Its nice if you have something specific to ask, but not so useful if you want learn the basics with no large gaps.
Answer: As @Garrett said, there are a lot of beginner electronics websites out there. My favorites are:

http://www.electronics-tutorials.ws
http://www.allaboutcircuits.com
http://www.kpsec.freeuk.com/study.htm
http://www.learnabout-electronics.org/index.php
http://hyperphysics.phy-astr.gsu.edu/hbase/hframe.html -> Electricity
and Magnetism
http://www.pyroelectro.com/edu/basics/
http://tronixstuff.wordpress.com/electronics/
http://lcamtuf.coredump.cx/electronics/
http://www.renesas.com/edge_ol/engineer/index.jsp
Circuits and Electronics (6.002x) - free online electronics course from MIT
Answer: There are a ton of websites and tutorials, I got started from books, and we have a good list here as for a site, Electronics Theory has a good free course that starts very basic and very detailed.
Another site that has a lot of video and stuff is 101 Science.
For a bit more advanced user (not much more, but it isn't an intro into electronics,) Electronics Lab has a lot of projects and stuff, they even sell kits, and they buy designs and tutorials if you feel like writing one, I've done it years ago. And EEV Blog is a great source for the more advanced person, great very popular videos! Highly recommended, and they have a forum too!

Online guide to electronics


Schemes to resolve deadlocks

Question: I am interested in research that detects and recover from deadlocks. In other words the system is able to recover from deadlock faults. I'm interested in shared memory multicore processors. Uptill now I have only seen research for distributed systems. Can anyone guide me on this.
Comment: If an algorithmic scheme allows by some trick to recover when a deadlock occurs, by definition such a situation must be detectable beforehand and can thus entirely avoided. Or said otherwise, if you have an algorithm that potentially goes into deadlock, change your design.
Comment: this is just wishful thinking, stop writing code that deadlocks is the real solution
Comment: @David Heffernan: Not necessarily. I've heard of a few cases of fault-tolerant software being able to recover from dead-locks. But either way, it's very difficult and would probably make a decent Masters or Ph.D thesis.
Comment: Deadlocks and their prevention/avoidance/recovery used to be mandatory topics in the mandatory undergraduate operating systems class.  Indeed, they were among the most important topics in that class.  Dekker's Algorithm, semaphores, monitors, all that stuff.
Comment: Jens, I am talking about a system which detects and recover from deadlocks at runtime, in other words a fault tolerant system.
Comment: I agree with Jens. You must know during implementation that a deadlock may occur at the specific moment. Otherwise you have to assume that deadlock would occur in all possible situations where a thread wants for example to obtain a mutex, and apply timeout or other lifebuoy to recover from such a situation. I do not think that a system that would detect deadlock in real-time and recover automatically is theoreticaly possible.
Comment: @Mystical, if a fault-tolerant system can do that, wouldn't you still consider deadlocking to be a fault? Such systems are also supposed to be able to deal with hardware failures, but that doesn't mean it's okay to build hardware with known bugs.
Answer: I'm not sure what do you mean by recover, because since you're in a deadlock - you're obviously in a state where two threads depend on each other to complete their current tasks. So the recovery would be for one of them (or both...) not to complete the task.
In many cases, especially in embedded event-driven systems the detection is done through hardware watchdog that reboots the system. This can be considered as a recovery mechanism.
You can of course be less rigorous and instead of rebooting the system, shut down one of the offending threads (or all of them) and restart them, making sure that the deadlock situation can be avoided in the future (purging the bad input for example).
Or you can just unlock the blocking call and let the threads run with (potentially) corrupt data. Again, depends on your system and the reasons for deadlock.
Bottom line - watchdog (hardware, or software) is the solution, but if you're using the software version - you need to make sure that it itself is never locked out (i.e.: run on a dedicated CPU for example).
Ah, and the best of all is of course not to get into a deadlock situation entirely. You can verify your code using model checking or simulations, but it is of course easier said then done, even if you verified the model, you might still have bugs in the actual code implementation....
Answer: The best way to recover from a deadlock condition is to never get into it in the first place.
Techniques such as Tony Hoare's Communicating sequential processes give you the ability to formally reason about your system, detect the potential for deadlock and design it out of your system. I would highly recommend looking into some of the work done on CSP over the years to see if these techniques could be incorporated into your systems.
Answer: One example of deadlock avoidance is the use of reader-writer locks. The basic pattern is that if you have one lock (the reader) and try to acquire the other (writer) but can't, then you have to abandon and retry your entire operation.
This could in principle be used as a deadlock recovery mechanism - in a classic lock inversion situation, where two threads each hold a lock that the other one wants, then one or both could back out to the point where they acquired the first lock and retry (not both at the same time, or they'll just lock-invert again!). But this is limited as a means of fault tolerance, since it requires co-operation from the threads. In a bad case, each thread might have put some data structure into an inconsistent state that it doesn't know how to back out of, only how to complete. So the fault is un-recoverable. In many cases it's harder to avoid that than it is just to avoid lock inversion.
Those distributed systems you've seen research for, might have the advantage that if a set of nodes gets into an unfortunate deadlocked state, they can all just be shot dead and their contributions ignored. To do that in the bad case I describe above, you'd need some form of transactional memory, which is difficult (and actively researched). But of course you can always write your multi-core code as if it were distributed code (share nothing between threads), then use the techniques for distributed code.
Detecting a locking inversion for mutexes is trivial in principle, since you can draw a directed graph of each thread's dependencies on other threads (A depends on B if B holds a lock that A is waiting on) and check for cycles. Detecting deadlock on semaphores or condition variables is impossible unless you can do enough static analysis to determine which thread is "supposed" to post each semaphore that another thread is waiting on, or supposed to make true a condition that another thread needs to be true before continuing.
Answer: I'd take a look into Real-Time Systems and Programming Languages by Burns and Wellings. It discusses ways to prevent deadlocks in real time and does a good job with citing papers.
I don't have to book with me at work, but glancing at the ToC you have:

     4.7   Multiprocessor and distributed systems
     5.10  Shared memory multiprocessors
    11.14  Multiprocessor scheduling
Answer: I know in database systems (where all locks are held in one place and can be analyzed), the common practice is to make one thread the "deadlock victim" and kill it, thereby releasing the lock.  This could be complicated in an operating system environment, since a single thread/process could have several locks on disparate parts of the system, so picking a deadlock victim could require some significant introspection and analysis.  Also, retrying a failed transaction due to a deadlock is a pretty standard database idiom, but not so common in application programming.

Schemes to resolve deadlocks


Vuepress theme in vue template

Question: I am working on a vue project and I need to embed a documentation inside a vue template ideally. I considered using vuepress for making documentation as it has a full-fledged theme for documentation which is perfect for the kind of documentation I want and also supports markdown to write documentation. I tried using vuepress but only includes components written in .vuepress/components folder. Is there a way I can include other vue components of my project inside the markdown files or output the markdown files as vue templates instead of static html files.
Answer: You can use the string tag in your markdown file just as you would do in a regular vue project with webpack. For example:
on README.md:
<code># This is a title
## This is a subtitle
<my-component></my-component>
> My name is {{ name }}

<script>
import myComponent from '../myOtherFolder/MyComponent'
export default {
  components: {
    'my-component': myComponent
  },
  data: function() {
    return {
      name: 'John'
    }
  }
}
</script>
</code>

Vuepress theme in vue template


Mass,Energy,Matter

Question: In $E=mc^2$ what type of energy is $E$?
For instance, you can find the kinetic energy of an electron by using $\frac{1}{2}mv^2$ but you can also find the energy from $E=mc^2$. How are those two different besides the values?
Comment: Pretty much a duplicate of http://physics.stackexchange.com/questions/68217/is-energy-simple-or-composite
There are a lot of questions asking about "types of energy" but there aren't really different types.  Energy is energy and all that really matters in your perspective on it (or the field it's stored in).
Comment: another related/possible duplicate: http://physics.stackexchange.com/questions/69080/potential-energy-in-special-relativity
Answer: It's usually called the "rest energy". In some sense this is a potential energy I suppose, but not the sort that can be converted to the kinetic energy of the same particle. An electron at rest has some rest energy, but it cannot lose some rest energy and gain some velocity; the rest energy is tied up in the mass (hence $E=mc^2$). The rest energy comes into play when particles are created and destroyed. For instance, in electron-positron annihilation:
$$e^{-} + e^{+} \rightarrow \gamma + \gamma$$
the two photons produced by the annihilation have a total energy equal to the total rest energy of the electron-positron pair.
Qualitatively, conservation of energy for such particle interactions is:
$$E_{\rm rest}({\rm input}) + E_{\rm kinetic}({\rm input}) = E_{\rm rest}({\rm output}) + E_{\rm kinetic}({\rm output})$$
Comment: The typical representation of E=mc^2 can be misleading. As you say, the energy of a particle is the rest energy + kinetic energy + potential energy...  If we always wrote something like $$\mbox{E}=mc^{2}+\frac{1}{2}\left( mv^{2} \right)$$ or the relativistic equivalent, this question would not come up so often. Though I think it is a little late to get $$\mbox{E}=mc^{2}$$ out of the public consciousness.
Answer: It is a kind of potential energy, since the object/particle is at rest in the formula $E = mc^2$. In the case where the object is moving, you would have both Kinetic and Potential energies, which is (ignoring some special relativistic effects) the sum of the two.
if the object has some momentum $p$ (i.e, velocity) then we have the real formula of $E = \sqrt{ (m_{0} c^2)^2 + (p c^2)}$.
Comment: This somewhat misleadingly implies that potential energy is any different than any other type of energy.

Mass,Energy,Matter


How do I remove custom currencies in Google Sheets?

Question: In Google Sheets, you can add custom currency things under the formatting tab and google sheets with keep them saved. I was playing around with this function and added a few ones to test it out but now I can figure out how to get them to disappear, can anyone help me delete them? You can see the currencies I want to delete at the bottom of the attached image.
Answer: You can't remove them - you can only override them with other formattings. Google Sheets stores last 3 custom formattings for possible future re-usage which can be only overridden by other 3 custom formattings of your choice in this area:


Prove that the ant can survive

Question: There is a table with infinite cells. An ant starts from cell $(1,1)$ and each time it can move one cell up or right. Before starting to move, an infinite sequence of cell numbers like $<(x_{1},y_{1}) , (x_{2},y_{2}), ... , (x_{n}, y_{n}) , .... >$ is given to it.
After step $k$, cell number $(x_{k},y_{k})$ will be poisoned and if ant goes there or already is there, it'll die.
Prove with induction that the ant can live forever if it knows sequence elements from the beginning :)
Comment: What is the sum of $x$ and $y$ coordinates of ant at step $k$? How many cells are there that ant can reach at step $k$? How many of them can be poisoned before or at step $k$?
Comment: @didgogns There is an infinite number of cells. After each step one cell is poisoned, therefore K-1 cells can be poisoned before step k.
Answer: Hint: Consider for each level of the graph the number of possible cells at that level the ant can reach alive, minus the number of cells on later levels that are already poisoned at that time.
Show that this number cannot decrease.
Conclude that there are reachable cells on every level.

Prove that the ant can survive


How to prevent a Windows program from modifying attributes of a folder/file?

Question: My current problem is that I am trying to prevent a program from changing the attributes(specifically Write permissions) of its own files in order to stop the program from updating itself since it's connected to the Internet. What I have tried so far is denying the user under which the program is being executed to write(meaning modify/change) to the program's executable and all of its files with the help of icacls.exe. This built-in system tool can modify user permissions on files/folders. To start of, I granted Full Access to the program's executable and its files to clear all restrictions, then, I denied the followings:DE,WD,WDAC,WO,AS,WEA,WA (refer to the manual of icacls.exe to see what they stand for) but after relaunching the program, the attributes were reset to the program's advantage and it immediately began to update. After this failed attempt, I denied additional permissions such as: D but I could no longer start the program since I couldn't even dir the directory the program was located in. The same behaviour could be noticed with other additional denied permissions including, but not limited to, M, W, GW. I have also tried hiding away attrib.exe from the program since I noticed conhost.exe is always being called by the program at startup with the help of which it can pass an attrib.exe command to modify the attributes unless the user under which the program is running is denied to change attributes but again, denying M, W, GW permissions I mentioned previously restricts me from viewing the directory in which the program and its files are located let alone executing it. Could it be that the program is using the Windows API to change the attributes of its files? What are other methods to prevent this program from modifying attributes besides what I've already mentioned?
Answer: 1.
 DO NOT work in administrative account. Create standard account and work there. Use administrative account only to set security permission on files you need or for installation/deinstallation of new programs or adjusting system settings. If your account is administrative then program can easily overwrite all your restrictions since it works in administrative account too.
2.
Block outgoing connection in firewall for your stubborn program in advanced firewall settings.
You can try to revoke ownership from files you want to be unwritable and assign restricted user as an different owner (not an account that run program) but I guess functionality of program would be broken.
Comment: "Is the monitoring of function calls documented anywhere?" Yes, official here: https://msdn.microsoft.com/en-us/library/ms123401.aspx and you can also find  unofficial API on countless hacker's sites. Try to revoke permission "OWNER/Creator" since usually it has full access
Comment: The user under which the program is executed is not a member of Administrators group therefore no console commands can be executed with administrative priviliges. I should also state that that user which executes the program is run inside my own user environment which is a member of Administrators group but with the help of UAC I can block any attempt to run a command with admin priviliges. Blocking connections is not something I want because the program should remain connected to the Internet to allow me to use its necessary functions even if it tries to download patch updates & other stuff.
Comment: "user which executes the program is run inside my own user environment which is a member of Administrators group" - then this program can use system API as administrator. Try to track function calls, what it use. You can use ProcessMonitor (http://technet.microsoft.com/en-us/sysinternals/bb896645.aspx) or WinAPIOverride32 (http://jacquelin.potier.free.fr/winapioverride32/) or APImonitor (http://www.rohitab.com/apimonitor/)
Comment: Great that you mention ProcMon as I use it quite frequently although I am not experienced enough with it. Is the monitoring of function calls documented anywhere? By the way, I've just logged in to the user account with standard priviliges to run the program and witnessed the same behaviour - the attributes still get reset to the program's advantage.
Comment: I am back with a small update to tell that the permission revoke trick solved the problem. That program now can't modify the attributes provided that the program's executable and its files(probably the executable alone is enough) have denied permissions on: (DE,WD,WDAC,WO,AS,WEA,WA). Thank you Alex for your time and effort.
Comment: No problem, Im glad I was able to help you !


How to output meaningful errors in aura server side calls?

Question: I am attempting to use exceptions to display errors in my aura application. As per documentation, the only way to return a meaningful error from code is to throw AuraHandledException. The problem is that the class is not extensible (non-virtual) meaning that only a custom message property is returned as part of the exception. Is there a way to use some other exception class that can be extended to include more attributes and that would be handled in the same way AuraHandledException is?
Comment: What additional attributes are you trying to add to your error?
Comment: I would like to add details of the dml errors. That would allow mapping of errors to the fields on the screen or applying certain logic/styling around it.
Answer: I ended up JSON-encoding the message for AuraHandledException and attempting to parse the JSON inside the javascript callback. If parsing fails, I assume the message is a string and use it instead. This allows me to pass any structured error response that I need now or in the future. Not saying that it is the right way to do things but I don't see an alternative at the moment.
Answer: AuraHandledException is a quick way to tell the client to throw an error and display your custom message, gracefully. If you want to "handle" the error on the client, then you should do so by catching the exception on the server and returning your custom result with more information as to how the client should behave:
var state = response.getState();
if (state === "SUCCESS") {

  var response = response.getResponseValue();

  if(response.hasError) {
    switch(response.errorCode) {
      case 403: throw new Error("You don't have permission"); break;

      // bad request eg. bad parameters sent to server
      case 400: helper.showInlineErrorMessageInForm(); break;
    }
  }
  else {
    helperProcessSuccess();
  }
}

Comment: That seems to be more of a workaround as when you handle the server exception and return the response in that way, you also need to handle the rollback of everything you have done. I would prefer to use the exception mechanism as the functionality is already pre-built for it to minimize the code required both on server and client side.
Comment: @Artur have you tried throwing a custom exception on the server, then handling that in the state == "ERROR" in your client callback?
Comment: I tried both standard exceptions and custom exceptions that extend Exception class. Both return something similar to: An internal server error has occurred Error ID: 1726879261-336513 (119852647) when not wrapped via AuraHandledException. I think it would be a lot easier if standard class AuraHandledException could be extended. :(
Comment: Did you add an error state handler to your action callback like I mentioned above?
Comment: Yes the response above comes for the error state.


Can somebody help me understand this sentence?

Question: "The molar enthalpy of vaporisation of a liquid is the enthalpy change when one mole of the liquid changes into one mole of its gas at the boiling temperature."
 The part which i am not sure of is the one highlighted above. Does it mean that the temperature of the flame that is supplying the energy needed to vaporise a substance is at the boiling temperature of the liquid ? Or is the liquid itself at its boiling point ? Because i cant imagine how the temperature of a liquid could be maintained at its boiling temperature so i guess its the temperature of the flame right ?
Comment: The temperature of the flame has absolutely nothing to do with this except that the flame must be hotter than the boiling point of the liquid. // The enthalpy of vaporization is the amount of heat necessary to convert one mole of liquid to one mole of gas given that the liquid is already at the boiling point. In other words the heat to rasie the liquid from room temperature to the boiling point doesn't count in the heat necessary for the liquid to vapor transition.
Comment: but if it is already at its boiling point then the liquid is already boiling and doesnt need any energy to turn into vapor so the definition is "the amount of  energy needed to keep a mole of a liquid at its boiling temperature until it is converted to a mole of gaseous molecules"   ?
Comment: That is essentially correct. // You have to realize that all of the thermodynamics terminology hangs together. There are all sorts of problems hiding in simple explanations.
Comment: It doesn't have to be the boiling point.  The enthalpy of vaporization applies to converting a saturated liquid to a saturated vapor at any temperature and corresponding vapor pressure.
Answer: I'll give it a try :-)
There is always a transition of liquid to gas till the system gets to equilibrium by rault's law which is true at every temperature.But at a specific temperature all the liquid will go to the gas phase, that is the boiling point. So, the molar enthlapy of vaporisation of a liquid refers to the enthalpy change of one mole of liquid that changes into gas at the boiling temperature of that specific solution.
Comment: I don't think the OP was referring to a chemical mixture.
Answer: You need to understand that the thermodynamic quantity being measured (the heat of vaporisation) is a separate idea from the heat capacity of the liquid.
If you took a liquid at well below its boiling point and applied heat until it was turned to vapour, some of the energy would be used to heat the liquid. The energy required to vapourise the liquid would be overestimated if you just measured the total energy input.
The point of the sentence is to separate the two thermodynamic concepts. It take energy to warm a liquid and it takes energy (a different amount) to vaporise the liquid. These quantities are different and should not be confused.
The thermodynamic concepts are ideal concepts and not strictly an explanation of what happens when you boil a liquid (unless you do it very carefully and slowly). In the real world a boiling liquid will not be evenly heated and some of it won't be at the boiling point. the thermodynamic concept is about the ideal experiment where you do everything slowly and ensure perfect mixing. In this case the liquid will reach the boiling point and any extra energy added will cause vaporisation rather than a mixture of warming and vaporisation.
The temperature that matters here is the temperature of the liquid.


Why are stars made from hydrogen and helium and not other elements?

Question: My understanding is that the stars are primarily made up of hydrogen and helium. Why do those elements end up in stars and other heavier elements make up the planets?
Comment: Fun fact: hydrogen and helium are such a large majority of a star's combination that all other elements are collectively called _metals_, and variation among stars in [their (low) total abundance](https://en.wikipedia.org/wiki/Metallicity) is an important aspect to how stars differ.
Comment: Related: https://physics.stackexchange.com/questions/418550/why-is-hydrogen-the-most-abundant-element-in-the-universe
Comment: Also see: https://en.wikipedia.org/wiki/Stellar_nucleosynthesis
Comment: Could you change the Question, to Ask how the natures of other elements are different? Else, how is the Question really different from how roads are different from cars?
Answer: Most of the planetary mass in our Solar System is also in the form of hydrogen and helium - locked up in Jupiter. So I think your question is just confined to the inner, rocky planetary objects, Mercury, Venus, Earth and Mars, which are indeed very poor in hydrogen and helium compared with the Sun.
The gas from which the Solar System formed was 99% by mass hydrogen and helium. The heavier elements are trace contaminants. The measured elemental abundances of the Sun are pretty much representative of this initial composition (bar lithium).
The reasons that H/He are dominant are the limited window of time in which primordial nucleosynthesis can occur after the big bang; that elements heavier than helium are not produced (there are trace quantities of Li) by primordial nucleosynthesis, only in stars; and that most primordial gas has never been incorporated into stars. See Why didn't the Big Bang create heavy elements? and Why is hydrogen the most abundant element in the Universe? for details.
The sequence of events that leads to the inner planets being "rocky" is that they are formed from solids that were able to condense at the high temperatures close to the Sun. Most of these solids would have been things like metal oxides or even solid  metal grains that did not incorporate either hydrogen and helium (with a few exceptions). The vast majority of hydrogen and helium would have remained in the gaseous phase. The solids then initially stick together by being... sticky! Subsequently, once the protoplanets get massive enough, gravity takes over and the bodies can begin to accumulate matter and become even bigger.
It is a relatively straightforward calculation to then show that objects the size of Earth and at the temperature of the Earth are not able to retain gaseous hydrogen and helium - the typical speeds of the atoms/molecules is big enough that the gas can escape from an Earth-like planet. Thus, unlike the gas giants which are both more massive and in a colder part of the Solar System, the inner planets end up with very little hydrogen and helium; and what there is exists bound up in molecules with heavier elements (e.g. water).
Answer: It is not that the heavier elements prefer the rocky planets instead of the star. It is H and He that escape easier from celestial bodies with lower gravitational potential, as is the case of that planets.
The Sun for example has only about $1$% of other elements besides H and He. But that small fraction is still 1000 times the mass of the all the inner planets together.
Comment: Gravitational potential of the planets not of the molecules. For the same kinetic energy, the velocity of H2 and He2 molecules is bigger than N2 or O2, due to their smaller masses. So the probability that they reach the escape velocity is greater.
Comment: How are the gravitational potential of He and He is lower than others? Because they have different radii? Though the gravitational effect for such small distances should be negligible? Thanks.
Answer: The universe is almost all hydrogen and helium (about 98%), so of course the stars are too. You can get smaller clumps of heavier elements because they can stick together and form solids, but, as The_Sympathizer said, there's no natural way to separate out enough oxygen or whatever to put together a star.
The fact that hydrogen can escape lower mass planets isn't really the reason, I would argue. That's just the reason that such planets don't have hydrogen atmospheres.
Finally, don't get the impression that other elements are somehow excluded from the stars. The sun is 0.014% iron, but that works out to 46.6 planet earths made entirely of iron.
Answer: Stars are not made of other elements simply because they are rare and not concentrated enough naturally to make them.
There is nothing impossible about, say, collapsing a cloud of carbon to make a star that burns carbon in its core. Problem is that free clouds of pure carbon with enough mass to do that just don't exist. Instead, we have free clouds of almost entirely hydrogen and some helium. Heavier elements are mixed with those things, and thus as a result, they don't get a chance to collapse into large stars without also collapsing in way more hydrogen and helium.
And with planets, once you get past a certain mass, it starts accruing more of the hydrogen/helium dominant components of the stellar birthing nebula or, more accurately, the disk of such material around the star, so it either becomes a gas giant, or else gets so big it becomes another star in its own right made with the usual composition, i.e. a binary or multi-star system with a small companion star next to, and orbiting, a large one.
Hence, if one found a star made of some such exotic composition, it might be a good indicator of aliens having done it artificially!
Answer: This is somewhat a separate line of consideration than the "planets' gravity keeps heavier elements" aspect the other answers provided, but note that stars are limited in what elements are provided in the primordial cloud that forms the star as well as the elements they produce via stellar nucleosynthesis.
So, to some degree, stars contain primarily hydrogen and helium because that is primarily what is found in regions of star formation. Then when enough hydrogen turns into helium (or carbon, oxygen & nitrogen), the star begins helium fusion which forms to make carbon and so on down the line. Eventually, for the heavier stars, we get to silicon fusing to create iron, which unfortunately coincides with the end of that star's life (cf. this Physics.SE Q&A). For the smaller stars, however, I believe a helium core is all you can expect and the star basically lives its very long life really only burning those two.
The end of the star's life is a fantastic explosion (supernova), which means that the material that was the star is now flying (at some fraction of the speed of light!) out into space and isn't (strictly) localized to the star. It is during the supernova process, we begin the fun neutron capture processes that give us the remaining elements we see in planets, comets, etc via either the rapid process or the slow process (see also supernova nucleosynthesis).
So it is a bit of a feed back loop at this point: the (predominantly) hydrogen cloud collapses into a star, the star produces heavier elements & explodes, the supernova produces some even heavier elements while also pushing the outer hydrogen layer back into the cloud to later create a new star.
Comment: Your 3rd paragraph seems to imply that all stars end their life in a supernova. But supernova only happens to very large stars (the ones big enough to burn silicon), and to sufficiently large stars in binary systems ([type Ia supernova](https://en.wikipedia.org/wiki/Type_Ia_supernova)).
Comment: Every speed is *some* fraction of the speed of light. Most are very small fractions, though.
Comment: "It is during the supernova process we begin...".  A supernova is unlikely to be the dominant site of neutron capture  and the s-process begins in the red giant phase. https://physics.stackexchange.com/a/141180/43351
Comment: Sorry, I wasn't trying to be condescending. I didn't *think* that you were claiming that all stars end in a supernova, but I do think that some readers may get that impression.
Comment: "The end of the star's life is a fantastic explosion (supernova)"  That is confusing as written / doesn't apply to all stars.
Comment: There are some cases where being overly pedantic is just silly; this is one of them.
Comment: @ProfRob In re both r- & s-processes, I'm going by my >8Y old memories of the lectures & classes by Don Clayton & Brad Meyer. I bow to your expertise in the field over my faulty memories.
Comment: @PM2Ring [condescension not needed](https://physics.stackexchange.com/questions/99375/why-does-a-star-beyond-a-certain-mass-limit-chandrasekhar-limit-only-become-a/99429#99429) as it, like nagging & fishing, don't work on me.
Comment: @MikeB Please read the comments before posting useless information. Not only was I already informed of that (twice by the same user), but I also already indicated I'm aware of the distinction by linking to my own answer wherein I state the difference.
Comment: I don't understand why you don't want to fix that ambiguity. I'd like to upvote this answer.
Answer: It is an interplay of several factors:

Big bang nucleosynthesis produced almost only hydrogen and helium (3/1).
Under Gravitational contraction in the early universe clouds of these gases concentrated. What we define as a star is a collapse of a gas cloud under its own gravity that simultaneously is so much concentrated and hot that increases its internal temperature to a degree that fusion begins and outwards pressure equates gravity.
Onion like structure of burning elements begins, rate is determined by the mass of the star. Burn stops at Fe, the heavier elements are constructed more rapidly when stars terminate their life abruptly. Their concentrations are pretty low though since every heavy element needs its predecessor in the periodic table, roughly speaking, in order to form. Hence can't have heavy concentration of an element that is not abundantly produced

Long story short, that's the reason for stars chemical composition.
Now for planets, can't have rocky planets made of gases by definition. More seriously, light elements evade easier planets weak gravity. However planets made of gases exist. Most are failed stars, their gravity was not enough to start nuclear fusion and they end up like the gas giants in our solar system.
Comment: And of course, those gas giants are quite rocky themselves - Jupiter is estimated to have somewhere between 7 and 25 Earth masses of heavy elements (and of course, the Sun has _much_ more than that). It's just that its growing mass eventually allowed it to start capturing the hydrogen and helium too, and there was a _lot_ more hydrogen and helium in the solar nebula than heavy elements.


How much power do I need to transmit a radio signal through a solid ice crust 100 km thick?

Question: Imagine I put a floating probe inside the subglacial ocean of Encelado or Europa: how much power should my radio have to be able to communicate from external surface with the probe? Or, in different words, how much attenuation do 100 km of solid ice cause to a radio signal at, say, UHF frequency?
Comment: Plan on packing a decent-sized reactor.
Comment: A couple of alternative approaches come to mind.  Drag an optical fiber behind the probe.  Acoustic communication which can also act as a backup in case the fiber breaks.
Comment: Earth's ice is quite pure water, and so may be less ionic than the ice sheets of Europa and Enceledis. Here is some info on the problems associated with broadcasting through seawater (and presumably through salty ice?) https://en.wikipedia.org/wiki/Communication_with_submarines
Comment: Not just Earth's ice, but almost any water ice. As water freezes, impurities get forced out of the crystalline matrix as it forms. Pockets of impurities may be created, but the ice itself is fairly pure.
Comment: So, at the end of the game (and after all answers)... If any radio-equipped civilization evolved under Europa ice crust.... we would never know.
Answer: I can't answer that directly but Nasa are probing Greenland's ice sheets with aeroplane radar to find the depth of the bedrock. Here's what they say about ice and radio waves: -

Ice, on the other hand reacts differently depending on the radar's
  frequency. It reflects high-frequency radio waves, but despite being
  solid, lower frequency radar can pass through ice to some degree. This
  is why MCoRDS uses a relatively low frequency—between 120 and 240 MHz.
  This allows the instrument to detect the ice surface, internal layers
  of the ice and the bedrock below. "To sound the bottom of ice you have
  to use a lower frequency," said John Paden, CReSIS scientist. "Too
  high a frequency and signal will be lost in the ice."

This came from here and it's interesting to note that this is radar and requires a reflection from the bedrock to pass back through the ice to the receiving aeroplane. I would imagine that the reflected power is a fraction of the incident power reaching the rock so maybe you might get 10x this distance thru a solid ice sheet with a one-way transmission.
Here's the sort of image they are getting: -

It looks to me that +3km is possible with radar. I don't know what the radar beam angle is so it's impossible to calculate what the incident power at the surface of the ice is - the transmission from the aeroplane might be a 1MW pulsed radar with a very tight beam angle producing an incident power at the top surface of the ice of hundreds of watts. Also, the reflection from the bedrock will not be a tight beam - this means the power reflected back will be spread thinly as distance increases (see Friis equations). Also the power received at the aeroplane will be much smaller than that emitting from the surface of the ice - again see the Friis equations.
Addendum
I had a think about the link loss for the radar application: -

Link-loss from plane to ground. A 2m diameter dish will have a gain of \$\frac{\pi^2 D^2}{\lambda^2}\cdot 0.6\$ = 3.35 or about 10.5 dB. If the aircraft is 1km above the ice, the link loss to an identical dish (on the ice) will be -21 (antenna gains) +32.5 + 20log(MHz) + 20log(km) = 11.5 + 46 + 20 = 78dB link loss. If the radar output power is 1 MW (90 dBm), the received signal at the ground/icecap surface will be 12 dBm (16 mW).
It's the same problem for the reflection signal. At the surface, it is subject to the same attenuation up to the aircraft (78dB) that is 1km higher.

These losses won't be encountered by a simple transmission thru ice - transmitting and receiving antennas are sited either in the ice or at its surface. This all bodes well for being able to transmit in a single direction through large distances of ice.
Answer: Assuming that it behaves similarly to water ice on Earth, there were some measurements done of the RF attenuation of the Ross Ice Shelf in Antarctica. The attenuation length was found to be 300-500m for frequencies from 75MHz to 1.25GHz.
(Attenuation length is the distance for the signal to drop to 1/e ~=0.368 ~= -4.3dB, somewhat analogous to time constant)
That's going to be a pretty intimidating amount of attenuation for 100km thickness (something like -950dB). Ain't gonna happen.
The power would, of course, depend on the bandwidth of signals that need to be transmitted.
To put it in perspective, the record for moon bounce communication is something like 3mW transmit power (~ -300dB attenuation). If we had 1GW, that would be another 115dB, but still well short of what's required.
Comment: I'm unsure what "attenuation length" actually means.
Comment: Edited.. or is it a deeper question?
Comment: No, nothing deeper. Interesting article and I'm still trying to work out what the results mean - it seems they're trying to infer distance by looking at reflections. Maybe you have a better take on this. It does seem to contradict the NASA results in my answer and I'm genuinely scratching my head to the large disparity.
Comment: How do you "pass" from attenuation dB to needed power? (e.g. from  115 dB to 1 MW)
Comment: dB is 10*log(x/y) where log is base 10 and x/y is a ratio of powers. If x = 1 gigawatt and y = 0.003W, that's about 115dB.
Answer: Currently I'm operating as a radar engineer for the British Antarctic Survey so I think I can help.
Frequency is important Ice is ( other than some specific gaps) none blocking at MF frequency's but at HF and UHF ice and water are very similar, near enough impenetrable.
If you kept you frequency low enough (below 2.4Mhz) than I think that ( assuming the ice where you are talking about is water based) going to have few problems with ice... your still transmitting to space and MF signals are fairly poor for that mainly due to ionospheric interference on earth. I know that Earths magnetic field is very powerful so maybe on some bodies you could get away with it.
Either way I think your primary issue could be finding a single frequency for which you can pass through the ice and any atmospheric disturbances. that would certainly be the problem on earth


Huawei Analytics console export data failure

Question: Tried to export data on below dates and i got error saying "Failure details".
why this export data could fail? Do we have any limit for data exporting?
Answer: The data volume is limited, select a date range in the upper right corner, and we can view data in a preset time range (such as Last 7 days) or a custom time range.
Please follow the link for viewing analytics data:  https://developer.huawei.com/consumer/en/doc/distribution/app/agc-view_analysis.