Effect of decreasing input voltage of transformer on output voltage

Question: I have designed a device which is controlled with a PIC micro controller.This micro's power is +5 volt. I have used a transformer for converting +220 volt to lower voltage +15 volt. Then a 7805 regulator generate +5 volt which is used by micro and other components. Now i want to know what happens if input voltage drop down very high. For example in bad situation maybe accidentally city voltage +220 drop down very high and goes up.
If input voltage drop down output voltage of transformer will drop down consequently and in high current +5 volt does not generate. This affect on micro and micro will be turn off.
This is very bad situation for my device. How could this be protected? is it true using transformer? Is there another solution for protecting from decreasing input voltage?
Comment: The words " +220 drop down very high and goes up." don't make total sense. Do you mean "drop to a low voltage". If so, what does "goes up" mean.
Comment: I, for one, can see two solutions for voltage-dips: either use a very large capacitor for the supply, while taking care not to overload the supply itself with the charging current, or you can use a 12V battery (for example) with an error detection for input voltage; when the voltage dips, then the battery comes in, similar to a UPS, only for DC and low voltage. Your circuit can be done with a simple transistor for detection and another one as a series-acting switch. Simple, but effective.
Comment: I'm going to guess that "very high" should be substituted with "quite a bit" or "very much".  Naturally, that still doesn't tell us how much that is.
Comment: It will be very much and i am worry that my micro turn off.I had experience that some times because of  bad situation +220 volt goes down but i don't know how much is it? but light bulb had very low light.
Answer: The output of voltage of the transformer will be proportional to the input voltage.  If it is 15 VAC at 220 VAC in, then it will be 13.6 VAC at 200 VAC in, for example.
You seem to have a lot of headroom, so should be able to tolerate significant power voltage sag.  In fact, you seem to have so much that your supply is quite inefficient.  At 15 V out, the peaks of the waves will be 21.2 V.  Assuming a full wave diode bridge, you loose about 1.4 V leaving 19.8 at the peaks.  This is the level that the capacitor after the full wave bridge will be charged to twice per line cycle, which is every 10 ms for 50 Hz power.
The 7805 regulator needs about 7.5 V in to make reliable 5 V out.  There is a lot of room between the 7.5 V minimum the regulator needs and the 19.8 V peaks the cap gets charged to.  The cap voltage will drop between the peaks depending on the cap size and the current.  Usually things are sized for a few volts drop.  For example, let's say you have a 1 mF cap and the current draw is 100 mA.  That would only sag 1 V over 10 mS, which brings the lowest voltage into the 7805 down to 18.8 V.
We can work this backwards and see what the minimum necessary line voltage is in this case.  You need 7.5 V into the regulator minimum.  The sag between peaks is still the same because it is only a function of the current draw and the capacitance.  That means the cap needs to be charged to 8.5 V at the peaks, which requires 9.9 V AC peaks before the full wave bridge, which is 7 V RMS.  That is 47% of the output at 220 V, so your minimum input limit is 103 V.
Of course you should always leave some margin because stuff happens, but any vaguely reasonable "220 V power" line isn't going to sag as low as 103 V unless something is very wrong.
As for another solution, get a "universal input" power supply.  These are designed to work with any of the worldwide house power.  They are usually specified for something like 90-260 V AC, 50 or 60 Hz.  They are switchers, so are a lot more efficient than your linear regulator.  This is really a better answer anyway than a big iron line power transformer type power supply.


How much does the gravitational and magnetic fields of a planet effect the chemistry in it?

Question: It is known that the earth has a magnetic field and gravitational field around it, I wish to ask to what degree is the chemistry on the planet is influenced by these fields? How would the chemical reactions seen everyday on earth be different if the strengths of these fields were different?
Comment: Magnetic fields affect chemistry, but not too much. Planets have typically a very weak magnetic field. Gravitational field does not affect it all. Indirectly it has effect, because attraction of the atmosphere makes its pressure. Pressure greatly affects chemistry (no pressure -> no liquids).
Comment: That's an ...interesting view point @John
Comment: Without gravity we wouldn't have a planet to speak of. So in the sense, wholly. Once the planet has formed it does so indirectly through its geology and atmosphere.
Answer:
How would the chemical reactions seen everyday on earth be different if the strengths of these fields were different?

Depends. If you're just talking about higher $g$ (i.e $g>9.8\ \rm{m/s}^2$) but the same atmospheric pressure, than not much will change on the surface of the earth.
If the atmospheric pressure changes, there could be changes to chemical reactions. There are several factors controlling chemical reactions. One being, obviously, the identity of the reactants. The other one is temperature. But also important is pressure. Because pressure on the surface of the earth is always 1 atm, no one really thinks or cares about pressure. No one, until it changes. That said, for any substantial change in chemistry, pressure has to change quite a lot, which would make earth uninhabitable for humans, so there would be no one to see that chemistry changed.
Comment: Worth noting  that without a magnetic field the earth might have far less of an atmosphere.
Answer: In the case of gravity, it depends on where you look, literally.  On the surface of a typical planet gravitational fields have hardly any effect on chemistry.  But if the planet is big and massive enough so that the pressure built up by gravity throughout the mass pushes it into a rounded shape, chances are that pressure is also affecting the chemistry of its rocks.
In the case of Earth, this shows up as the formation of silicate phases in the mantle that would not appear naturally on the surface, chief among them the silicate perovskites in which each silicon atom is bonded to six oxygen atoms instead of four.  The illustration below shows how the silicate rocks change from the from olivine (which has the "normal" silicate bonding) into perovskite and other phases where the silicon has become bonded to the additional oxygen neighbors.

Source
Silicates are not the only phases affected by the gravitationally generated pressure inside Earth.  Carbon is affected too, leading to the (natural) formation of diamonds -- which often have inclusions of those high-pressure silicate phases trapped inside, thus providing verification of these gravity/pressure-induced phases.


StackExchange.Redis crashing .NET webapi

Question: I have create a new .Net core 3.1 web api, that has no other dependencies except StackExchange.Redis.
In StartUp.cs, I am setting up the connection as
public static ConnectionMultiplexer redis;
public void Configure(IApplicationBuilder app, IWebHostEnvironment env) {
            redis = ConnectionMultiplexer.Connect("localhost"); ...

and then later setting up a key as
string value = "run at " + DateTime.Now.ToString();
IDatabase db = Startup.redis.GetDatabase();
db.StringSet("test_key", value, new System.TimeSpan(3, 0, 0));

This works fine in my development environment, but in the production environment it crashes. I get the following error
Faulting application name: w3wp.exe, version: 10.0.14393.0, time stamp: 0x57899135
Faulting module name: coreclr.dll, version: 4.700.20.51601, time stamp: 0x5f89f166
Exception code: 0xc0000005
Fault offset: 0x00061471
Faulting process id: 0x2f008
Faulting application start time: 0x01d73e02dc5d058e
Faulting application path: C:\Windows\SysWOW64\inetsrv\w3wp.exe
Faulting module path: C:\Program Files (x86)\dotnet\shared\Microsoft.NETCore.App\3.1.10\coreclr.dll
Report Id: 1104748b-7a7e-4e07-9302-a34883fada38
Faulting package full name:
Faulting package-relative application ID:

Redis is working fine in production and development environment.
Comment: Is there an exception anywhere? Is there *literally anything else* in the application? I can't see anything in that crash report that finger points at anything in particular ...
Comment: The application is running fine in my development environment and also runs fine in my local IIS after I publish. But it crashes in production. This application do not have anything else. I just did a dotnet new, added the StackExchange.Redis and added those 5 lines.
Answer: I compiled it as the application
dotnet publish . -o ..\publishedAPI -r win-x64
then in the pool I set Enable 32-bit application = False
and it started working..


How does exporting a hierarchical model to obj manage coordinates?

Question: I'm debugging an .obj parser a colleague of mine wrote for a simple Lua game, and I'm having trouble with understanding something. Since the .obj file does not preserve the tree structure I create in a Blender model, but only has the separate objects (the o wheel-like lines), how are the coordinates treated? Let's say I have wheels as children of a car's chassis in Blender, the car is translated from the origin and the wheels have a relative translation, rotation and scale from the car to be in the appropriate position. If I export them to .obj, are the coordinates of their vertices recalculated as global ones (meaning they already are where they should be if I put both the chassis and the wheels in as separate objects) or are they in relative coordinates (meaning I have to recreate the parent-child relation to have them in the right place)?
Answer: The .obj format is very simple and stores all vertices in global coordinates. It can't be local coordinates because there is no definition of a world matrix per object in the file format, which would be required to perform a conversion from local to global coordinates.


Is it safe to keep a plasma lighter in my bag?

Question: So I have a bag where I store my laptop, headphones, swiss army knife and cables on the go, or just hang it around my door handle if I'm home and need something. I recently got a plasma lighter stick with safety lock (requires press + slide motion to expose the points and turn them on). I was wondering if it's safe to store this in my bag
Comment: Asking if something works is not a Lifehack.  You should state a problem and request a solution.
Answer: I'd put that in a small, rigid container that you can close, just to be sure.
Especially if you sometimes carry more things in there, there's always a small chance of both the slider getting pushed sideways and the button being pressed simultaneously. And even though the chance this happens is small, the consequence would be setting the bag with your laptop on fire and losing it.

You could find something like this, these come in various sizes. If you can't find a perfect match and lighter ends up rattling around inside, you could always add some padding (for example a few bits of silicone cut to size, inserted to sit at the bottom and in the lid).


Is there any advantage or disadvantage of using high value capacitor instead of high value resistor in filter?

Question: For filter design, one can choose the resistor and capacitor value according to one's wish. But is there any disadvantage of using a high-value resistor with a low-value capacitor or vice versa?
Comment: Yes. But which is better depends on context you might have but we don't. Without that, this is a broad question. Which is why you get 7 different right answers to choose from.
Answer:
is there any disadvantage of using a high-value resistor with a low-value capacitor or vice versa?

Yes.
High impedance brings to mind:

High-value resistors create high-impedance nodes. That wouldn't be a huge problem in itself: after all, vacuum-tube circuits are chock full of nodes with load resistances in the 100kΩ-2MΩ range. But then: how familiar are you with all the design and assembly concerns that vacuum tube circuits have routinely dealt with already 50+ years ago?

High-impedance nodes are susceptible to coupling by leakage and stray capacitance to other nodes they'd otherwise not couple to. One such node of concern is the low-frequency mains wiring and fields emanating from mains transformers.

High-impedance nodes are susceptible to parasitic capacitances of the very resistors that create them. Those resistors are no longer ideal parts in such circumstances. For surface-mount parts, this matters only for frequencies well above 1MHz, though. The frequencies of concern go up as you go smaller, e.g. 0402 resistors are quite close to ideal from parasitic standpoint up to about 1GHz. Conversely, small values of 0402 capacitors (up to a couple hundred pF) are pretty ideal as well in that frequency range.

High value capacitors:

High-value capacitors generally cost more compared to lower value of the same type. The cost is often highly nonlinear and depends on production yield, market demand, etc.

High-value capacitors have high drive requirements. They are fine as long as they are connected only to high impedance nodes, but this has to be kept in mind.
As a rule of thumb, most op-amps are fine driving equivalent load reactances above 1kΩ. This would be the capacitive/inductive reactance in parallel to pure resistance. The load resistance/reactance used to specify distortion and settling time in op-amp datasheets is usually is in the 600Ω-2kΩ range. So, when going below that specification limit, you can refer to plots of distortion and output voltage range vs. load resistance if they are given in the datasheet. Outside of that you have to qualify the part for your application.

High-value capacitive loads rob op-amps of phase margin. In applications where high DC precision or high AC gain accuracy is required, you may be unable to afford isolating series resistors, and may have ringing in low-gain stages as the equivalent load capacitance goes beyond 100pF.
Now, this may not be a concern in low bandwidth applications. But even in those, you may need a high-GBW amplifier to keep the distortion down to a minimum if distortion is a concern. The highest performing audio op-amps have GBWs well in excess of 100MHz: about 3 orders of magnitude larger than the audio signal bandwidth. Such parts can't handle much capacitive loading unless they are designed for line driving applications.

High-value capacitors are typically larger, and thus have larger parasitic series inductance compared to lower values. Their larger sizes couples them more to adjacent nodes in the circuit. This is less of a concern with surface mount parts.

High-value capacitors of equivalent performance to smaller values are often much more expensive. That's why you may end up being forced to use high-value resistors to keep the capacitors small anyway. For example: in filter circuits that work from 0Hz to audio band, if you're using surface mount ceramic capacitors then C0G/NP0 types are the only acceptable ones, unless you are OK with the microphonics (your users might not be OK). Thus you can't generally use X5R/X7R nor other high-K ceramics like Z5. To keep costs down with C0G/NP0 you are limited to values well below 1μF.
Aside: audio doesn't need to be literal, only a frequency range. Most "DC" instrumentation circuits, such as signal conditioners for strain, pressure and optical measurements are quite sensitive to "audio" microphonics, and X5R/X7R/Z capacitors in the signal paths in those applications are bad news if you want high precision. They are bad news for reference voltage decoupling for A/D and D/A converters as well, unless in RF or wideband digital transmission, where audio is out-of-band. You may end up having to use tantalums in parallel with C0G types then.

High-value capacitors may force a dielectric type that's inherently more noisy, or with progressively more dielectric absorption. Vacuum and dry air and similar mixtures of single-element gases are close to ideal in terms of performance, but their volumetric efficiency leaves something to be desired. A couple hundred pF is all you can readily buy, although you can make much better parts yourself if you have the time and capability. Then comes Teflon, then various plastic films, then low-K ceramics, then high-K ceramics get mixed in with tantalum and electrolytics. If you carefully select electrolytic capacitors, you can get pretty low noise parts, but the variation between various types can be dramatic - several orders of magnitude difference in noise amplitude at low frequencies (1μHz to 1Hz, give-or-take - important if you're looking for long-term stable DC voltage references, for example).
Noise is obviously a concern in filter circuits at all frequencies. Dielectric absorption's relatively long time constant is of concern mainly at DC and in audio and similar low-frequency applications. It becomes largely irrelevant for RF use.
I've mentioned microphonics already as well - they are not quite noise (which is random/self-uncorrelated and usually wideband unless shaped otherwise by design), but certainly an interfering signal - usually quite narrowband.

Having said all that, also remember that laboratory instruments and high-performance audio gear is not everyone's market. Your application may simply not care much for low distortion, low microphonics, etc. A lot of quite acceptable consumer goods have mediocre or just average performance in terms of signal chain fidelity, and the users are not unhappy with that. Reverse-engineering junked car audio gear is a one good way to learn about low-cost low-microphonic audio signal chains.
Personally, my view is slightly skewed since I've been doing instrumentation/audio/lab gear since I was a kid. My first design for an external user was a simple portable audio mixer, where I learned about the noise of MOS op-amps and high-value resistors. I still remember: it was based on CA3240, since that's what I had available. Those parts are anything but quiet for low-ish impedance audio work.
Comment: Large values of resistance also means higher levels of noise injected in the system, since its (rms) value depends on \$R\$. Of course this will never be of concern in power systems and so on, but it is in analog electronics.
Answer: What you're talking about is choosing the impedance of the filter.
If you were operating the filter between a zero source impedance and an infinite load impedance, then you would be completely free to implement your RC time constant with any value resistor, and the corresponding capacitor, that you wanted.
Usually however, that's not the case, and we need to operate between finite impedances. Then we would choose a resistor that's well above the source impedance, and below the load impedance.
Answer: Accurate, stable, high quality signal capacitors can be expensive, difficult to find, or outright not available. Often 100nF is the upper limit and that's already stretching it.
Really high value resistors make your low-pass filter output impedance really high.
Answer: The general trend is:
Higher resistor, smaller cap: less load on source, higher output noise, potentially reduced output voltage if load impedance is low.
Small resistor, large cap: less noise and better output impedance, but more burden on source and costlier/larger
Answer: You select filter components not <code>"according to ... wish"</code> but to meet the transfer function specifications.

On board
Resistors
For opamp based circuits: anything in the 1k\$\Omega\$ to 10k\$\Omega\$ range for resistors is considered good. A comprehensive post is available for your perusal. For larger resistors, offset currents become progressively relevant.
You can search for "precision resistors" that get more expensive with demanding specs. For PCB applications, surface mount resistors are small in size. (search 0802/0603 and smaller etc)
Capacitors
Electrolytic capacitors consume board space; besides larger capacitors are used for lower frequency ranges, so it makes sense to achieve \$R C\$ specs using resistors where possible. The lifetime of a product is determined by the most leaky capacitor.
For precision capacitors, read up on film capacitors that get progressively expensive with tolerance specs.

On chip
To implement a resistor on chip requires expensive silicon die space. Hence depending on use, a MOS transistor with an appropriate W/L ratio is used with proper biasing. This simple arrangement suffers from process variability (meaning: the absolute value of a component can vary over quite a range). The same variability argument applies to a capacitor on-chip as well.
The good news is that ratio of resistors (or capacitors)  can be made very accurate on a chip.
For this reason(and for lower frequency ranges), the switched capacitor filter concept is used. An iconic product is the MF-10 chip.
The main idea behind the SC concept is that a resistor is simulated by moving charges in and out of capacitor using non-overlapping clocks (whose frequency is controlled by a PLL using an external crystal and hence is very accurate). Couple that with accurate ratio between capacitors on chip, the idea becomes viable.
For high frequency applications, filtering is done using either well-characterized discrete components, of more advantageously using a PLL. That is the case for wireless transceiver circuits. A good series of articles can be found here.
Another choice for RF applications is the SAW/BAW filters.
Answer: In many cases, there is another restriction which will cause additional selection limits. Keyword: Component spread.
All second-order filter stages require a minimum of 2 resistors and 2 capacitors for establishing the desired filter function.
Depending on specific filter specifications (gain, pole-Q) the corresponding "component spread" (difference between the lowest and largest componenet values) can be pretty large. Very often, these considerations are inportant for selecting a suitable filter topolgy.
Example: Bandpass in MFB-topology (MFB: multi-feedback) with two equal capacitors and a bandwidth according to Q=10. In this case, the ratio of the two resistors must have a value of 4Q²=400.
(Hint: Additional resistive positive feedback - Antoniou`s modification - will improve the situation and decrease this component spread)
Comment: The same situation does exist for the well-known unity-gain S&K filter stage. Depending on the capacitor ratio, the required resistor ratio will be between app. 4Q² and 9Q².
(Hint: In this case, change from unity gain to a gain-of-two will drastically reduce the large component spread.)
Answer: Capacitors with "high value" are usually electrolytic and the price increases and physical size increases significantly as the value gets high.  A resistor is a resistor when you are talking about small signal filtering. A small SMD resistor is the same size whether 1k to 10M.
With Electrolytic resistors also comes current leakage and fairly wide tolerance bands on capacitance.  The aluminized film on high value electrolytes is rolled and with those rolls comes inductance.  So, you may get an unplanned inductive resonance with large value caps using rolled films.
Low value Film resistors or ceramic caps can be quite accurate and small with very low inductance - match that with a larger resistor and you'll be fine. In general, I try to stay below 1uF when I can but, that is a general phrase.  Sometimes it is not quite possible. Larger value ceramic caps (tens to hundred uF) can get expensive and sometimes you have to suck it up and dish out the dollars or sometimes you have to use an electrolytic.


Expectation of the inverse of a linear function of the Dirichlet distribution

Question: Let $\mathbf{X}=(X_1,X_2,\cdots,X_k)\in\mathbb{R}^k$ follow a Dirichlet distribution $X \sim \mathsf{Dir}(\alpha_1, \alpha_2, ..., \alpha_k)$, and let $\mathbf{c}\in\mathbb{R}_+^k$ be a vector of non-negative real numbers.
Is there a way to compute/approximate/upper-bound the expectation
$$
\mathbb{E} \left[ \frac{1}{\mathbf{c}^\top \mathbf{X}} \right]
= \mathbb{E} \left[ \frac{1}{c_1 X_1 + c_2 X_2 + \cdots + c_kX_k} \right]
$$
taken with respect to $\mathbf{X}$?
Answer: $E[X_i^k]$ is easy to calculate. For example, if $k \geq 1$, we have
$$
E[X_i^k] = \frac{\alpha_i (\alpha_i + 1)...(\alpha_i + k - 1)}{(\sum \alpha_i) (\sum \alpha_i + 1)...(\sum \alpha_i + k - 1)}.
$$
Same thing for $k < 0$:
$$
E[X_i^k] = \frac{(\sum \alpha_i - 1)...(\sum \alpha_i - k)}{(\alpha_i - 1)...(\alpha_i - k)}.
$$
Calculating $E[X_1^{k_1}...X_n^{k_n}]$ is also easy:
$$
E[X_1^{k_1}...X_n^{k_n}]
=
\frac{\prod_i \prod_{j = 0}^{k_i - 1} (\alpha_i + j)}{\prod_{j = 0}^{\sum k_i - 1}(\sum \alpha_i + j)}.
$$
Some preliminary inequalities to calculate the upper bound:
\begin{align}
&
\frac{1}{\sum c_i X_i} \leq \frac{1}{\min c_i} \\
&
\frac{1}{\sum c_i X_i}
\leq
\frac{1}{n} \left( \prod c_i X_i \right)^{-1/n}
\leq
\frac{\sum \frac{1}{c_i X_i}}{n^2} \\
&
\frac{1}{\sum c_i X_i} \leq \frac{1}{(\sum c_i)^2} \sum c_i \frac{1}{X_i}
\end{align}
The following potentially gives an infinite expansion.
\begin{align}
\frac{1}{\sum c_i X_i}
& =
\frac{\frac{1}{\max c_j}}{1 - \sum \frac{\max c_j - c_i}{\max c_j} X_i}
=
\frac{1}{\max c_j}
\sum_{k = 0}^\infty \left( \sum \frac{\max c_j - c_i}{\max c_j} X_i \right)^k
\end{align}
There are several things that you can do with this expansion. For example,
$$
\sum \frac{\max c_j - c_i}{\max c_j} X_i
\leq
\frac{\max c_j - \min c_j}{\max c_j},
$$
so the series vanishes exponentially and you can truncate the summation and get an upperbound to any precision.
Another possibility is to consider
$$
\left( \sum \frac{\max c_j - c_i}{\max c_j} X_i \right)^k
\leq
\left( \sum \frac{\max c_j - c_i}{\max c_j} \right)^{k - 1} \sum \frac{\max c_j - c_i}{\max c_j} X_i^k,
$$
which can make the calculation easier.
Another possible upper bound:
\begin{align}
\frac{1}{\sum c_i X_i}
& =
\frac{\frac{1}{\min c_j}}{1 + \sum \frac{c_i - \min c_j}{\min c_j} X_i}
\leq
\frac{1}{\min c_j}
\sum _{k = 0}^{2K} (-1)^k \left( \sum \frac{c_i - \min c_j}{\min c_j} X_i \right)^k.
\end{align}
However, the above does not converge as $K \to \infty$, unless $2\min c_i > \max c_i$, so this probably will not yield a good upper bound.
The two upperbounds above are special cases of the following. Notice that $\min c_i \leq \sum c_i X_i \leq \max c_i$, so we are indeed analyzing $f(x) = \frac{1}{x}$ for $x \in [\min c_i, \max c_i]$. Getting an upperbound of this $f$ is easy using Taylor expansion or other techniques.
Comment: Thanks! The power series approach in the second bound is interesting, but unfortunately I cannot assume $2\min c_i > \max c_i$. As for the infinite expansion, I can only get a lower bound by truncating the series, but not an upper bound, right? Actually, the only upper-bound I have been able to derive is $$\mathbb{E} \left[\frac{1}{\mathbf{c}^\top \mathbf{X}} \right] \le \mathbb{E} \left[ \sum_i \frac{1}{c_i} X_i \right] = \sum_i \frac{1}{c_i} \mathbb{E} [X_i] = \sum_i \frac{1}{c_i} \frac{\alpha_i}{\alpha_1 + \alpha_2 + \cdots + \alpha_k}, $$ which is probably quite loose.


Questions pertaining Performance reviewal

Question: IS it appropriate for someone to upload/provide a link to his own performance of a piece and then ask for corrections/suggestions about matters including but not limited to basic techniques, timing, correct notes, posture, expression (of the music), phrasing, etc. ? One could provide a sheet music along with it to aid the review. If it isn't then why not? It might be very insightful for everyone.
Answer: The basic thought is that no, it won't be useful to anyone.  One particular performance of yours is very, very localized and answers specific to it won't help someone at random.
Stack Exchange also requires specific problems as the basis for a question, not general requests for critique.  As an example, see What can I do about my problems with piano scales which manifest in just one direction?.  That issue might have shown up in a video, but it's much much better separated into a separate specific question.
Answer: My first instinct is no. They would be very hard for anyone else to find via a Google search just because of the nature of the question and likely be unhelpful if anyone did find them. They are highly specific questions. However, as far a subjectivity I think they would be great subjective questions if they got great answers (I highly recommend reading this SE blog post about subjective questions).
The other problem I foresee with them is this turning into a constant stream of low-quality, chaotic questions. We'll have a front page full of "Review Me!" questions, which will quickly become tiresome.
Answer: I would be interested in seeing review requests in chat. Initially at least, such requests seem appropriate for the general chat. Should they become popular (i.e., numerous), a new "reviews" chatroom could be created.


Symbolicating iPhone App Crash Reports

Question: I'm looking to try and symbolicate my iPhone app's crash reports.
I retrieved the crash reports from iTunes Connect. I have the application binary that I submitted to the App Store and I have the dSYM file that was generated as part of the build.
I have all of these files together inside a single directory that is indexed by spotlight.
What now?
I have tried invoking:
symbolicatecrash crashreport.crash myApp.app.dSYM

and it just outputs the same text that is in the crash report to start with, not symbolicated.
Am I doing something wrong?
Comment: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash
Comment: I've created a script which may help: https://github.com/amleszk/scripts/blob/master/ios-crashlog-symbolicatecrash.sh
Comment: You can refer this : https://medium.com/@Mrugraj/crash-re-symbolication-5c28d3a3a883
Comment: You can also see my answer at [iPhone SDK : Where is symbolicatecrash.sh located?](http://stackoverflow.com/a/8648232/590956).  I list out where to find the `symbolicatecrash` command, how to use it, and how to find the dSYM file needed to do symbolication.
Comment: If anyone is wondering where can you get *.app, *.dSYM & crash logs to being with then look at my answer below.
Comment: Here's a very simple open source app for OS X that lets you simply drag a crash log and the corresponding .xcarchive (including dSYM) to symbolicate it: https://github.com/johnno1962/Symbolicate
Answer: Steps to analyze crash report from apple:

Copy the release .app file which was pushed to the appstore, the .dSYM file that was created at the time of release and the crash report receive from APPLE into a FOLDER.
OPEN terminal application and go to the folder created above (using cd command)
Run atos -arch armv7 -o APPNAME.app/APPNAME MEMORY_LOCATION_OF_CRASH. The memory location should be the one at which the app crashed as per the report.

Ex:  atos -arch armv7  -o 'APPNAME.app'/'APPNAME' 0x0003b508
This would show you the exact line, method name which resulted in crash.
Ex: [classname functionName:]; -510
Symbolicating IPA
if we use IPA for symbolicating - just rename the extention .ipa with .zip , extract it then we can get a Payload Folder which contain app. In this case we don't need .dSYM file.
Note
This can only work if the app binary does not have symbols stripped. By default release builds stripped the symbols. We can change it in project build settings "Strip Debug Symbols During Copy" to NO.
More details see this post
Comment: There are multiple issues with this answer: 1. This can only work if the app binary does not have symbols stripped. And release builds by default do have them stripped. 2. Even if the symbols are available, it will never ever show the line number. Only symbolicating with the dSYM will provide that. 3. You cannot simply use the memory address shown in the stack trace, the address has to be normalized against the start memory address the app is loaded into. More details see this answer: http://stackoverflow.com/questions/13574933/ios-crash-reports-atos-not-working-as-expected/13576028#13576028
Comment: Just a tip to @NaveenShan answer, a real-world example would do this

`atos -o myApp.app/Contents/MacOS/myApp 0x0000000100001f2c`

and you get

`-[HUDWindow sizedHUDBackground] (in myApp) + 1197`
Comment: @OscarGoldman The second address eg:- In 0x332da010 0x332d9000 + 4112. use 0x332d9000.
Comment: Which address do you use, though?  The logs have two columns of addresses after each function, and the second has a + and an offset of some kind.  Like 0x332da010 0x332d9000 + 4112.
Comment: Also, if used without an address, it allow you to analyse multiple locations by submitting them one by one.
Comment: @Oscar you must use the first number, the second one is the base adress + offset (in decimal). Infact f.e. I have this numbers com.myApp 0x000000010001dc66 0x100000000 + 121958 and if you translate 121958 in esadecimal it is 1dc66. Btw if you go more down the log to Binary Images section, in my case, there will be 0x100000000 -        0x100244ff7 +com.myApp that indicates the range of addresses that are part of my application.
Comment: I've written a tool for symbolication, which looks through all your xarchives trying to symbolicate a crashlog. https://github.com/soniccat/symb
Comment: Didn't work.  Maybe I don't have the right files to go with the crash report, idk.
Comment: @WolfLink Is you try to symbolicate the IPA or Adhoc?
Comment: This is the only solution for me with Xcode 4.4. I have tried everything else with no luck, nothing symbolicates any other way...
Comment: I am not seeing expected result..atos -arch armv7 -o 'MobileApp.app'/'MobileApp' 0x68000
Result: 0x00068000 (in MobileApp) + 328... (lot of information here huh!!) I am using enterprise distributed ipa.
Comment: @Akki, Are you sure you are using the same IPA in which crash occurred?
Comment: Yes, I am using the same ipa. I extracted .app from it and copied in the folder with .crash and .dsym file.
Comment: @NaveenShan I have traced the UUID too. .app and .crash have same uuid.
Comment: Probably related to what Kerni said, but the approach described in this answer gives *completely* different results than `symbolicatecrash` when you cross-reference the two.  For instance, in `symbolicatecrash` I get 'InspectionViewController.m:2170', while using the same address with the technique in this answer gives 'AFHTTPClient.m:1220'.  Clearly one or the other is wrong.
Comment: If you need to manually do this (like from a screenshot of a crashlog), use the -l tag described in this answer: http://stackoverflow.com/a/19284459/548975 It does the math for you.
Comment: Damn, Apple has this much documentation https://developer.apple.com/library/content/technotes/tn2151/_index.html when your simple answer solves 90% of the people that would have read Apple's page.
Comment: I hate Apple with a passion.
Answer: After reading all these answers here in order to symbolicate a crash log (and finally succeeding) I think there are some points missing here that are really important in order to determine why the invocation of symbolicatecrash does not produce a symbolicated output.
There are 3 assets that have to fit together when symbolicating a crash log:

The crash log file itself (i.e. example.crash), either exported from XCode's organizer or received from iTunes Connect.
The .app package (i.e. example.app) that itself contains the app binary belonging to the crash log. If you have an .ipa package (i.e. example.ipa) then you can extract the .app package by unzipping the .ipa package (i.e. unzip example.ipa). Afterwards the .app package resides in the extracted Payload/ folder.
The .dSYM package containing the debug symbols (i.e. example.app.dSYM)

Before starting symbolication you should check if all those artifacts match, which means that the crash log belongs to the binary you have and that the debug symbols are the ones produced during the build of that binary.
Each binary is referred by a UUID that can be seen in the crash log file:
...
Binary Images:
0xe1000 -    0x1f0fff +example armv7  <aa5e633efda8346cab92b01320043dc3> /var/mobile/Applications/9FB5D11F-42C0-42CA-A336-4B99FF97708F/example.app/example
0x2febf000 - 0x2fedffff  dyld armv7s  <4047d926f58e36b98da92ab7a93a8aaf> /usr/lib/dyld
...

In this extract the crash log belongs to an app binary image named example.app/example with UUID aa5e633efda8346cab92b01320043dc3.
You can check the UUID of the binary package you have with dwarfdump:
dwarfdump --uuid example.app/example
UUID: AA5E633E-FDA8-346C-AB92-B01320043DC3 (armv7) example.app/example

Afterwards you should check if the debug symbols you have also belong to that binary:
dwarfdump --uuid example.app.dSYM
UUID: AA5E633E-FDA8-346C-AB92-B01320043DC3 (armv7) example.app.dSYM/Contents/Resources/DWARF/example

In this example all assets fit together and you should be able to symbolicate your stacktrace.
Proceeding to the symbolicatecrash script:
In Xcode 8.3 you should be able to invoke the script via
/Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash -v example.crash 2> symbolicate.log

If it is not there you may run a find . -name symbolicatecrash in your Xcode.app directory to find it.
As you can see there are no more parameters given. So the script has to find your application binary and debug symbols by running a spotlight search. It searches the debug symbols with a specific index called com_apple_xcode_dsym_uuids. You can do this search yourself:
mdfind 'com_apple_xcode_dsym_uuids = *'

resp.
mdfind "com_apple_xcode_dsym_uuids == AA5E633E-FDA8-346C-AB92-B01320043DC3"

The first spotlight invocation gives you all indexed dSYM packages and the second one gives you the .dSYM packages with a specific UUID. If spotlight does not find your .dSYM package then symbolicatecrash will neither. If you do all this stuff e.g. in a subfolder of your ~/Desktop spotlight should be able to find everything.
If symbolicatecrash finds your .dSYM package there should be a line like the following in symbolicate.log:
@dsym_paths = ( <SOME_PATH>/example.app.dSYM/Contents/Resources/DWARF/example )

For finding your .app package a spotlight search like the following is invoked by symbolicatecrash:
mdfind "kMDItemContentType == com.apple.application-bundle && (kMDItemAlternateNames == 'example.app' || kMDItemDisplayName == 'example' || kMDItemDisplayName == 'example.app')"

If symbolicatecrash finds your .app package there should be the following extract in symbolicate.log:
Number of symbols in <SOME_PATH>/example.app/example: 2209 + 19675 = 21884
Found executable <SOME_PATH>/example.app/example
-- MATCH

If all those resources are found by symbolicatecrash it should print out the symbolicated version of your crash log.
If not you can pass in your dSYM and .app files directly.
symbolicatecrash -v --dsym <SOME_PATH>/<App_URI>.app.dSYM/<APP_NAME>.app.dsym <CRASHFILE> <SOME_OTHER_PATH>/<APP_NAME>.app/<APP_NAME> > symbolicate.log

Note: The symbolicated backtrace will be output to terminal, not symbolicate.log.
Comment: This is a great explanation and should be the top answer IMO, thank you. Note that you may have to set your `DEVELOPER_DIR` environment variable if the script complains about it like so: ``export DEVELOPER_DIR=`xcode-select --print-path` ``. I added this line to my `~/.bash_profile`. See http://stackoverflow.com/q/11682789/350761
Comment: i can find all the files however i get this, and no symbolicated output `No crash report version in testlog.crash at /usr/bin/symbolicatecrash line 921.`
Comment: This was really helpful! In my case the .app file has different name than the executable name (I do not know why but it is built this way by Xcode). After renaming .app file in the XCode archive, the symbolicating did work.
Comment: Note that for Xcode 5, this has moved to:
/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKitBase.framework/Versions/Current/Resources/symbolicatecrash
Comment: symbolicate crash also has several helpful options.
`               Additional search paths in which to search for symbol rich binaries`

`-o | --output  The symbolicated log will be written to OUTPUT_FILE. Defaults to "-" (i.e. stdout) if not specified`

`-d | --dsym    Adds additional dSYM that will be consulted if and when a binary's UUID matches (may be specified more than once)`
Comment: There is an app in appstore that I found, that helps to find and symbolicate crash logs.
https://itunes.apple.com/us/app/symbolicator/id705354958?ls=1&mt=12
Comment: I can't, for the life of me, seem to get this to work...my .app and .dSYM file are in the same directory, from which I'm running 'symbolicatecrash', but the output (both to terminal and log file) is simply blank. Anyone encountered this? I also tried specifying the app and .dsym manually, same result.
Comment: Regarding his step "You can check the UUID of the binary package you have with dwarfdump:"   If your app has a space in name then your dwarfdump would look like this:  "$ dwarfdump --uuid 'Your Appname.app'/Your_Appname"    In the second part it replaces the space with an underscore.
Answer: With the latest version of Xcode (3.2.2), you can drag and drop any crash reports into the Device Logs section of the Xcode Organiser and they will automatically by symbolicated for you.  I think this works best if you built that version of the App using Build & Archive (also part of Xcode 3.2.2)
Comment: This is simply not working with Xcode4, on a fresh install. Seems to be a new bug :(
Comment: Don't work for me with downloaded crash reports from iTunes Connect.
Comment: This tip works with Xcode 4.2. Place crashlogs in Device Logs of Organizer. Restart the Organizer will get symbolicated crash logs !!! Thanks.
Comment: This didn't work from me when I imported an archive file from another computer to get a crash log.  :(  For this reason I had to manually symbolicate the file.  You can find steps on how to do the symbolication here: [iPhone SDK : Where is symbolicatecrash.sh located?](http://stackoverflow.com/a/8648232/590956)
Comment: I'm not sure if this solves the same problem you have, but someone has  patched the symbolicate script https://github.com/nskboy/symbolicatecrash-fix YMMV :)
Comment: I had some *partial* success with that script; it failed on approx 50% of the Apple library calls though, reported lots of errors along the lines of "armv7 architecture not found". With Xcode 3.x, I'd get symbolication on 99% of calls.
Comment: Make sure the first line in your crash report is... `Incident Identifier: 12345` (where 12345 is a random string of numbers) otherwise XCode wont let you import it.  I was using CrashReporter.framework and it was generating the first line as `Incident Identifier: [TODO]` and that was causing XCode to reject it
Comment: Works great with XCode 5.1 This is much simpler than using the terminal.
Comment: For people that have the same problem as @Altaveron - Symbolicating a crash log requires the system files from a similar device running the same system version as the crash log. Check the iOS version (e.g. 7.1.2 (11D257)) from which the crash log comes, and plug in a device in Xcode that has that same version, so Xcode can extract the symbols. You can check if you have the correct symbols in ~/Library/Developer/Xcode/iOS DeviceSupport/
Comment: This doesn't work with iTunes Connect which is asked in the question.
Answer: I did this successfully, using the following steps.
Step 1: Create a folder in desktop, I give name it to "CrashReport" and put three files ("MYApp.app", "MyApp.app.dSYM", "MYApp_2013-07-18.crash") in it.
Step 2: Open Finder and go to Applications, where you will find the Xcode application, right click on this and Click "Show Package Contents", after this follow this simple path.
 "Contents->Developer->Platforms->iPhoneOS.platform->Developer->Library->PrivateFrameworks->DTDeviceKit.framework->Versions->A->Resources"
OR
"Contents->Developer->Platforms->iPhoneOS.platform->Developer->Library->PrivateFrameworks->DTDeviceKitBase.framework->Versions->A->Resources"
OR
For Xcode 6 and above the path is
Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources
Where you find "symbolicatecrash" file, copy this and paste it to "CrashReport" folder.
Step 3: launch the terminal, run these 3 Command

cd  /Users/mac38/Desktop/CrashReport and  press Enter button
export DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer" and press Enter
./symbolicatecrash -A -v MYApp_2013-07-18.crash MyApp.app.dSYM and press Enter Now its Done..  (NOTE: versions around 6.4 or later do not have the -A option -- just leave it out).
Comment: for DTServiceKit look in Applications/Xcode.app/Contents/SharedFrameworks
Comment: Thank Thank you... as of April 9, 2015, this is what worked for me flawlessly. One thing, is that I got `Unknown option: A` for symbolicatecrash, but the process ran anyway
Comment: I wish I could give a thousand points to this answer. There are so many how-to's on this topic... but this is the one that works at the lowest level so it ALWAYS works. It's a pain in the rear to hit all the steps, but when everything else fails, this does the job.
Answer: Steps to symbolicate a crash report automatically using XCode:
UPDATED FOR XCODE 9

Connect any iOS device to your Mac (yes a physical one, yes I know this is stupid)
Choose "Devices" from the "Window" menu

Click your device on the left and VIEW DEVICE LOGS on the right

Wait. It might take a minute to show up. Maybe doing Command-A then Delete will speed this up.
Critical undocumented step: rename the crash report that you got from iTunesConnect from .txt extension to .crash extension
Drag the crash report into that area on the left

And then Xcode will symbolicate the crash report and display the results.
Source: https://developer.apple.com/library/ios/technotes/tn2151/_index.html
Comment: Thank you, I'm adding pictures now. Also included the SUPER UNDOCUMENTED step. I thought about make a git of red text and splicing it in there so that it would really stand out. Then I stopped thinking about that.
Comment: This is the official Apple procedure. Should be the answer.
Comment: Thank you! None of the other answers actually say that the device you use does not need to be the device (or even device type) that the crash occurred on.
Comment: Quick note, because for me it would not re-symbolicate.  I had to also open Organizer, click the build in Archives, click Download Debug Symbols. Then I could re-symbolicate in the device log view.  This was for a crash log downloaded from Apple after a rejected review.
Answer: I also put dsym, app bundle, and crash log together in the same directory before running symbolicate crash
Then I use this function defined in my .profile to simplify running symbolicatecrash:
function desym
{
    /Developer/Platforms/iPhoneOS.platform/Developer/Library/PrivateFrameworks/DTDeviceKit.framework/Versions/A/Resources/symbolicatecrash -A -v $1 | more
}

The arguments added there may help you.
You can check to make sure spotlight "sees" your dysm files by running the command:
mdfind 'com_apple_xcode_dsym_uuids = *'

Look for the dsym you have in your directory.
NOTE: As of the latest Xcode, there is no longer a Developer directory. You can find this utility here:
/Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash
Comment: I looked at the mdfind output, and the dSYM file can definitely be seen by spotlight.
However, the symbolicatecrash script still doesn't output anything different from the crash report itself. Even using the arguments you provided.
Comment: The script should produce some warning text at the beginning if it cannot find the dsym - can you look for that and see what it says?
Comment: Also, try adding "." after the command, so it would be "symbolicatecrash -A -v MyApp.crashlog ." .  That forces it to look in the current directory if it's not doing so already.
Comment: Meaning "Can't exec "/usr/bin/xcode-select": No such file or directory at /Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Plug-ins/iPhoneRemoteDevice.xcodeplugin/Contents/Resources/symbolicatecrash line 49."
Comment: Oops, apparently there is another SO question for that http://stackoverflow.com/questions/1859852/error-while-executing-symbolicatecrash-command-cant-exec-usr-bin-xcode-select
Comment: This did not directly work. But this did: http://stackoverflow.com/questions/7675863/atos-cannot-get-symbols-from-dsym-of-archived-application
Comment: Since Xcode 6, symbolicatecrash is located here : /Applications/Xcode.app/Contents/SharedFrameworks/DTDeviceKitBase.framework/Versions/A/Resources/symbolicatecrash
Answer: I use Airbrake in my apps, which does a fairly good job of remote error logging.
Here's how I symbolicate them with atos if the backtrace needs it:

In Xcode (4.2) go to the organizer, right click on the archive from
which the .ipa file was generated.
In Terminal, cd into the xcarchive for instance MyCoolApp 10-27-11 1.30 PM.xcarchive
Enter the following atos -arch armv7 -o 'MyCoolApp.app'/'MyCoolApp'
(don't forget the single quotes)
I don't include my symbol in that call. What you get is a block cursor on an empty line.
Then I copy/paste my symbol code at that block cursor and press
enter.  You'll see something like:
-[MyCoolVC dealloc] (in MyCoolApp) (MyCoolVC.m:34)
You're back to a block cursor and you can paste in other symbols.

Being able to go through your backtrace one item without re-entering the first bit is a nice time saver.
Enjoy!
Answer: Just a simple and updated answer for xcode 6.1.1 .
STEPS
1.Xcode>Window>Devices.
2.Select a device from a list of devices under DEVICES section.
3.Select View Device Logs.
4.Under the All Logs section you can directly drag drop the report.crash
5.Xcode will automatically Symbolicate the crash report for you.
6.You can find the Symbolicated crash report by matching its Date/Time with the Date/Time mentioned in your crash report.
Comment: Crash reports which I have downloaded from Apple Resolution Center usually have extension of .txt. Remember to rename them to .crash, otherwise Device Logs may refuse to add them. Work well for my current XCode 6.3.1
Comment: This is the official Apple procedure. Should be the answer.
Apple link: [Technical Note TN2151:
Understanding and Analyzing iOS Application Crash Reports](https://developer.apple.com/library/ios/technotes/tn2151/_index.html)
Comment: How do we do this if the crash came from Apple/ iTunesConnect? So in other words we don't actually know or have the device that the crash occurred on?
Answer: Even though I had been developing apps for a few years now, this was my first time debugging a binary and I felt like a complete NOOB figuring out where all the files were i.e. where is *.app *.dSYM and crash logs?  I had to read multiple posts in order to figure it out. Picture is worth a thousand words and I hope this post helps anyone else in future.
1- First go to itunesconnect and download your crash logs.
NOTE: Is most cases you may get something like "Too few reports have been submitted for a report to be shown." Basically not enough users have submitted crash log reports to Apple in which case you can't do much of anything at that point.

2- Now if you had not changed your code since you had submitted your binary it to Apple then Launch Xcode for that project and do Product --> Archive again. Otherwise just find your latest submitted binary and right click on it.
Answer: Using Xcode 4, the task is even simpler:

open Organizer,
click on Library | Device Log in the left column
click on "Import" button on the bottom of the screen...

and voilà. The log file is imported and Symbolized automatically for you.  Provided you Archived the build using Xcode -> Product -> Archive first.
Comment: Strange enough, importing has no effect. Putting .app, .dSYM and .crash and then running symbolicatecrash on .crash file (without any additional arguments) worked though (XCode 4)
Answer: In Xcode 4.2.1, open Organizer, then go to Library/Device Logs and drag your .crash file into the list of crash logs. It will be symbolicated for you after a few seconds.
Note that you must use the same instance of Xcode that the original build was archived on (i.e. the archive for your build must exist in Organizer).
Answer: The magical Xcode Organizer isn't that magical about symbolicating my app. I got no symbols at all for the crash reports that I got back from Apple from a failed app submission.
I tried using the command-line, putting the crash report in the same folder as the .app file (that I submitted to the store) and the .dSYM file:
$ symbolicatecrash "My App_date_blahblah-iPhone.crash" "My App.app"

This only provided symbols for my app and not the core foundation code, but it was better than the number dump that Organizer is giving me and was enough for me to find and fix the crash that my app had. If anyone knows how to extend this to get Foundation symbols it would be appreciated.
Comment: For core Foundation dSYM, a (may be chinese) guy out there had uploaded the dSYM on his shared google drive, just download it and throw in to "devices supported" folder and it will be solved. https://github.com/Zuikyo/iOS-System-Symbols
Answer: In my case, I was dragging crash reports directly from Mail to the Organizer. For some reason, that prevented the crash reports from getting symbolicated (I'd love to know why).
Copying the crash reports to the Desktop first, and then dragging them from there to the Organizer got them symbolicated properly.
Very specific case, I know. But thought I'd share just in case.
Comment: I imagine this may have something to do with spotlight. Is there any chance the location where the organizer keeps your logs wasn't being indexed by spotlight?
Answer: Here's another issue I have with symbolicatecrash – it won't work with Apps that have spaces in their bundle (i.e. 'Test App.app'). Note I don't think you can have spaces in their name when submitting so you should remove these anyway, but if you already have crashes that need analysing, patch symbolicatecrash (4.3 GM) as such:
240c240
<         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == $exec_name.app\"";
---
>         my $cmd = "mdfind \"kMDItemContentType == com.apple.application-bundle && kMDItemFSName == '$exec_name.app'\"";
251c251
<             my $cmd = "find \"$archive_path/Products\" -name $exec_name.app";
---
>             my $cmd = "find \"$archive_path/Products\" -name \"$exec_name.app\"";

Comment: For what it's worth, I filled a rdar on this and it's fixed in [redacted]
Answer: For those using Airbrake, there's a solid response above but it wouldn't work for me without tweaking:
Works for some memory addresses but not others, not sure why...

Create new dir on desktop or wherever
Find archive in question in Xcode organizer
Double tap to reveal in finder
Double tap to show bundle contents
Copy .dSYM file and .app file into new dir
cd into new dir
Run this command: atos -arch armv7 -o 'Vimeo.app'/'Vimeo'
Terminal will enter an interactive move
Paste in memory address and hit enter, it will output method name and line number
Alternatively, enter this command: atos -arch armv7 -o 'Vimeo.app'/'Vimeo'
To get info for one address only
Answer: The combination that worked for me was:

Copy the dSYM file into the directory where the crash report was
Unzip the ipa file containing the app ('unzip MyApp.ipa')
Copy the application binary from the resulting exploded payload into the same folder as the crash report and symbol file (Something like "MyApp.app/MyApp")
Import or Re-symbolicate the crash report from within Xcode's organizer

Using atos I wasn't able to resolve the correct symbol information with the addresses and offsets that were in the crash report. When I did this, I see something more meaningful, and it seems to be a legitimate stack trace.
Answer: I had to do a lot of hacking of the symbolicatecrash script to get it to run properly.
As far as I can tell, symbolicatecrash right now requires the .app to be in the same directory as the .dsym.  It will use the .dsym to locate the .app, but it won't use the dsym to find the symbols.
You should make a copy of your symbolicatecrash before attempting these patches which will make it look in the dsym:
Around line 212 in the getSymbolPathFor_dsymUuid function
212     my @executablePath = grep { -e && ! -d } glob("$dsymdir" . "/Contents/Resources/DWARF/" . $executable);

Around line 265 in the matchesUUID function
265             return 1;

Answer: This is simple, after searching a lot i found clear steps to symbolicate whole crash log file.

copy .app , crash_report and DSYM files in a folder.
connect the device with xcode
Then go to window -> select devices -> view device logs
Then select this device, delete all logs .
drag and drop your crash on device log section . it will automatically symbolicate the crash . just right click on report and export it .

happy coding,
Riyaz
Comment: best  short and sweet ans, follow each and every step written in this ans .       https://developer.apple.com/library/content/technotes/tn2151/_index.html follow this link to find the difference between unsymbolicated and fully symbolicated.
Answer: I prefer a script that will symbolicate all my crash logs.
Preconditions
Create a folder and put there 4 things:

symbolicatecrash perl script - there are many SO answers that tells it's location
The archive of the build that match the crashes (from Xcode Organizer. simple as Show in Finder and copy) [I don't sure this is necessery]
All the xccrashpoint packages - (from Xcode Organizer. Show in Finder, you may copy all the packages in the directory, or the single xccrashpoint you would like to symbolicate)
Add that short script to the directory:
#!/bin/sh

echo "cleaning old crashes from directory"
rm -P *.crash
rm -P *.xccrashpoint
rm -r allCrashes
echo "removed!"
echo ""
echo "--- START ---"
echo ""

mkdir allCrashes
mkdir symboledCrashes
find `ls -d *.xccrashpoint` -name "*.crash" -print -exec cp {} allCrashes/ \;

cd allCrashes
for crash in *.crash; do
    ../symbolicatecrash $crash > ../symboledCrashes/V$crash
done
cd ..

echo ""
echo "--- DONE ---"
echo ""

The Script
When you run the script, you'll get 2 directories.

allCrashes - all the crashes from all the xccrashpoint will be there.
symboledCrashes - the same crashes but now with all the symbols.
you DON'T need to clean the directory from old crashes before running the script. it will clean automatically. good luck!
Answer: I found out most of proposed alternatives did not work in latest XCode (tested with Xcode 10). For example, I had no luck drag-dropping .crash logs in Xcode -> Organizer -> Device logs -view.
I recommend using Symbolicator tool https://github.com/agentsim/Symbolicator

Git clone Symbolicator repository and compile and run with Xcode
Copy .crash file (ascii file, with stack trace in begging of file) and .xarchive of crashing release to same temporarly folder
Drag and drop .crash file to Symbolicator icon in Dock
In 5-30 secs symbolicated crash file is produced in same folder as .crash and .xarchive are
Answer: In order to symbolicate crashes, Spotlight must be able to find the .dSYM file that was generated at the same time the binary you submitted to Apple was. Since it contains the symbol information, you will be out of luck if it isn't available.
Comment: If you read the question, I stated that I have saved the original dSYM file that was generated at the same time the binary was submitted.
Answer: I got a bit grumpy about the fact nothing here seems to "just work" so I did some investigating and the result is:
Set up: QuincyKit back end that receives reports. No symbolication set up as I couldn't even begin to figure out what they were suggesting I do to make it work.
The fix: download crash reports from the server online. They're called 'crash' and by default go into the ~/Downloads/ folder. With that in mind, this script will "do the right thing" and the crash reports will go into Xcode (Organizer, device logs) and symbolication will be done.
The script:
#!/bin/bash
# Copy crash reports so that they appear in device logs in Organizer in Xcode

if [ ! -e ~/Downloads/crash ]; then
   echo "Download a crash report and save it as $HOME/Downloads/crash before running this script."
   exit 1
fi

cd ~/Library/Logs/CrashReporter/MobileDevice/
mkdir -p actx # add crash report to xcode abbreviated
cd actx

datestr=`date "+%Y-%m-%d-%H%M%S"`

mv ~/Downloads/crash "actx-app_"$datestr"_actx.crash"

Things can be automated to where you can drag and drop in Xcode Organizer by doing two things if you do use QuincyKit/PLCR.
Firstly, you have to edit the remote script admin/actionapi.php ~line 202. It doesn't seem to get the timestamp right, so the file ends up with the name 'crash' which Xcode doesn't recognize (it wants something dot crash):
header('Content-Disposition: attachment; filename="crash'.$timestamp.'.crash"');

Secondly, in the iOS side in QuincyKit BWCrashReportTextFormatter.m ~line 176, change @"[TODO]" to @"TODO" to get around the bad characters.
Answer: atos is being deprecated so if you are running OSX 10.9 or later you may need to run
xcrun atos

Warning: /usr/bin/atos is moving and will be removed from a future OS
  X release. It is now available in the Xcode developer tools to be
  invoked via: xcrun atos
Comment: Seems Apple is allowing for the DWARF format to morph with each release of the tools (makes sense, especially with the advent of Swift) so they're moving it to the tool distro.
Answer: I like to use Textwrangler to pinpoint errors in an original app upload binary rejection. (The crash data will be found in your itunesConnect account.)  Using Sachin's method above I copy the original.crash to TextWrangler, then copy the symbolicatecrash file I've created to another TextWrangler file. Comparing the two files pinpoints differences. The symbolicatecrash file will have differences which point out the file and line number of problems.
Answer: For those looking for a working solution in 2022
Steps to Symbolicating iPhone App Crash Reports

Convert apple provided crash log in .txt format to .crash
Xcode > Window > Devices and simulators
Must select a connected & running ios device. (not a simulator, or offline device)
Select All Logs section, drag & drop the .crash file

Note that, the other solutions having symbolicatecrash is deprecated and its usage shows:

⚠  symbolicatecrash is deprecated; it will be removed in future releases of Xcode ⚠
Answer: We use Google Crashlytics to supervise crash logs, the feeling is very timely and convenient to use.
Document links:
https://docs.fabric.io/apple/crashlytics/missing-dsyms.html#missing-dsyms
All about Missing dSYMs
Fabric includes a tool to automatically upload your project's dSYM. The tool is executed through the /run script, which is added to your Run Script Build Phase during the onboarding process. There can be certain situations however, when dSYM uploads fail because of unique project configurations or if you're using Bitcode in your app. When an upload fails, Crashlytics isn't able to symbolicate and display crashes, and a "Missing dSYM" alert will appear on your Fabric dashboard.
Missing dSYMs can be manually uploaded following the steps outlined below.
Note:
As an alternative to the automated dSYM upload tool, Fabric provides a command-line tool (upload-symbols)) that can be manually configured to run as part of your project's build process. See the upload-symbols section below for configuration instructions.
...

Symbolicating iPhone App Crash Reports


What's the best way to design a state machine with different object inheritance

Question: I have a class A and class B, both derive from the same parent class. Each object has a state machine inside it that defines it's behaviour. The behaviour is different though depending on if the object is of a class A or B. My approach to this is to differentiate what class an object is in the state machine and behave accordingly. Is there a better way to do this?
Comment: Not the downvoter, but trying to help explain a likely cause for the downvote since you're new here: while the core question itself is valid and on-topic, the quality of the question leaves a lot to be desired. A basic code example would've helped understand your exact situation and intentions. The vaguer your question is, the more possible scenarios answerers have to all account for, and the higher the chance that you get a generic but widely applicable answer instead of an answer that's tailored to your specific situation.
Comment: [virtual methods](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/virtual) is the usual way to have derived class have behavior differ from the parent and each other. Is your state machine an object you inject? Is there some other complication why virtual methods are not enough, or otherwise avoided?
Comment: This question is all solution and no requirements. We can always suggest a different way. How are we supposed to know what would be better without knowing what problem were solving?
Comment: Could you elaborate a bit more? E.g., you say "Each object has a state machine inside it", but then you also say "My approach to this is to differentiate what class an object is". Here's what's unclear - if each object has a state machine *inside* (which I interpreted to mean it implements its own state machine internally), then why do you have to check the objects class (from the *outside*)? Or is it that when you say "has a state machine" you just mean that it has some data in it that describes state, and the state machine (behavior) is actually implemented outside of it?
Answer: Your question is a bit light on specific context. One particular distinction here is if your A-state machine and B-state machine can be abstracted into a common ancestor, the base-state machine.
Specifically, are you able to abstract all of the state machine features that A and B use, so that the logic for A using its AStateMachine is exactly the same as B using its BStateMachine?

If yes, then simply use this base-state machine as the type. This is the best in terms of reusability. When this is possible, this is the best approach to take.
public class BaseStateMachine {}
public class AStateMachine : BaseStateMachine {}
public class BStateMachine : BaseStateMachine {}

public class Base
{
    private readonly BaseStateMachine _state;

    public Base(BaseStateMachine state)
    {
        _state = state;
    }

    public void DoJob()
    {
        Console.WriteLine(_state.MyValue);
    }
}

public class A : Base
{
    public A(AStateMachine state) : base(state)
    {

    }
}

public class B : Base
{
    public B(BStateMachine state) : base(state)
    {

    }
}

This is by far the easier approach, since the logic for both A and B only has to be written once (in Base). However, this relies on the idea that the handling between them is similar enough that the state machines have the same reusable interface.
If this is possible, this is usually the best approach to take. But that's an if...
Note: I'm ignoring the distinction between interfaces and base classes here, as they are equivalent for the current discussion. Whether you use the BaseStateMachine class or IStateMachine interface, the same principle applies.

If no, this is not possible, and the logic for A using its AStateMachine is fundamentally different from B using its BStateMachine, then your Base should define abstract/virtual methods where A and B can override it with their own implementation. Since the assumption here is that there is no default implementation before it gets overridden, abstract is the way to go.
public class AStateMachine
{
    public string GetFoo() => "State from A";
}

public class BStateMachine
{
    public int GetBar() => 123;
}

public abstract class Base
{
    protected abstract string GetStateValue();

    public void DoJob()
    {
        string result = GetStateValue();

        Console.WriteLine(result);
    }
}

public class A : Base
{
    private readonly AStateMachine _state;

    public A(AStateMachine state)
    {
        _state = state;
    }

    protected override string GetStateValue()
    {
        return _state.GetFoo();
    }
}

public class B : Base
{
    private readonly BStateMachine _state;

    public B(BStateMachine state)
    {
        _state = state;
    }

    protected override string GetStateValue()
    {
        int stateValue = _state.GetBar();

        return stateValue.ToString();
    }
}

Notice how Base itself doesn't have or use a state machine. Since the two state machines are inherently different, they shouldn't be stored in Base, but rather in A and B themselves. Base can access its virtual methods to gain access to the content of the state machine. Base cannot access the state machine directly, since Base cannot account for every different way of handling every different state machine (doing so would constitute an OCP violation).
This is more cumbersome to write because you need to individually implement the state machine handling logic for both A and B, but it gives you a great degree of freedom on how these machines can be handled in wildly different ways while still ensuring that your Base has a reusable way of accessing these wildly different state machines.


How to block @xxxx.ru email from registering on my magento2 site

Question: Since I migrated from M1 to M2.1.9, I have been bombarded with spam registrations from <code>.ru</code> domains. Is there a way of preventing this without a module ? I found this : Magento 2: Restrict customer registration by specific mail extension
which is totally beyond my competence...
Comment: If you don't want allow login to .ru domain then you can  write script to set deactivated flag by using customer attribute. It may help you.
Answer: Magento 2 has added a new layer of protection for the Customer Portal area same as Magento 1. CAPTCHA, which is disabled by default, can be enabled from the Dashboard panel.
This feature can help blocking spam and bots from logging into your website and it will effectively increase the security of the store.
CAPTCHA can be configured from backend and you can arrange whether to force it to each login or limit the feature to pop up only after a few failed logins. CAPTCHA prerequisite can be enabled/disabled by the Administrator for the following forms:

Create user
Login
Forgot password
Check Out as Guest
Register during Checkout
Contact Us
Change password

For more detail click here.
Comment: thx a lot for your help
Comment: @urbansurfers - Happy to help. Keep helping :)


Was so-called "early PIE" a single language without dialects or a wide continuum of dialects?

Question: Was so-called "early PIE" a single language without dialects or a wide continuum of dialects? If it was a dialect continuum, then probably when did the "common" PIE split up into dialects?
Comment: It probably started out as a single language, which, as the reach of the PIEans expanded, eventually became a dialect continuum, which then over time obviously broke into the separate languages we identify as the PIE languages today. (this I am guessing you already know) as for the time periods, we can not say definitely, since it is after all a reconstructed language, but scholars have given estimates of about 4-2 millennia BC, and since by the 3rd millennium BC they had expanded through out pontic-caspian steppe, it probably diverged into dialects by a around then or a little after.
Comment: @QuintusCaesius 2 millenia bc it was already mycenean greece or proto-greeks in the balkans. Not pie of any kind.
Comment: there is a lot of disagreement on the time period of PIE, though I admit that 2 millenia BC was a bit of a stretch on my part.
Answer: "Early PIE" refers to the stage before the split of Anatolian and the rest ("late PIE"). I don't think that we really know much about that stage of the proto-language because Anatolian is very divergent from the rest. Having only a binary split there is not much wiggle room for proto-language dialectology. In real life we expect any language to develop dialects, but in this case we cannot know them.
Answer: It depends a little on what you mean by Early PIE, whether you mean the product of our reconstructions, or the actual historical language we are aiming to study
It is extremely unusual for a language to exist without dialectal variation, and the few examples there are are almost all small and isolated populations
Early PIE was certainly not isolated, and doesn't seem to have had an especially small speaker population. As such, it is almost certain that the language ancestral to all Indo-European languages (including Anatolian) as actually spoken was either a dialect continuum or already had distinct dialects
Jk's answer already well addresses the question of Early PIE as we can reconstruct it
Answer: So many possible answers:
a) we can never know.
b) was Early-PIE an actual language or is it just a reconstruction reflecting elements of a language spoken at various times? Remember you could never reconstruct classical latin with all its case system from modern romance languages.
c) the normal development of languages is that a single dialect spreads across an area becoming a dialect continuum which then breaks into different languages when dialects are split off from each other (by migration for example) or when specific dialects gain a superior status (by becoming official dialects of states for example).
d) at the time that Indo-European was spoken on the steppes it may have been spoken over a considerable area so it would make sense its being a dialect continuum.
e) if you agree with Kristiansen that Indo-European was adopted by the Yamna steppe culture from the Maykop culture than it may be that a single language was borrowed from the Maykop culture which became a dialect continuum on the steppes.

Was so-called “early PIE” a single language without dialects or a wide continuum of dialects?


Is it OK to put the CSRF token in a cookie?

Question: I am developing CSRF protection with a token for one of my applications. Since there is no place to implement the token in POST or GET or form data, I am thinking about putting it in a cookie. Is that a good approach?
Answer: Putting the CSRF token in a cookie instead of in a form field or HTTP header is a bad approach, and will not work. The thing that makes the CSRF token effective is that (unlike e.g. a session cookie) it is not sent automatically on all requests. It has to be added manually by your application. If you put it in a cookie, it will be send automatically and thereby it looses it's effect.
Of course, if you are using the double submit cookie pattern you will need a cookie. But that is a different story.
Answer: the completely violates the use of having a csrf token.Let me explain why.
when ever a victim submits any request his browser automatically submits the cookies associated with that domain.so csrf works because the broken submits the session credentials(if victim is logged in).so if you put anti csrf token then it will be submitted along with it.instead you want to submit the csrf token in a POST request.
Answer: No. Not a good approach.
This makes it even more difficult to both ensure that the CSRF is effective and handle a split session (i.e. 2 windows). Further the cookie persists independently of the navigation path (i.e. does not provide proof of the origin for the request).
I am very confused by your assertion that there is "no place to implement the token in POST or GET or form data" but you seem to have the required access to control what cookies are deployed by the application.
Answer: The problem with cookies is that they tend to overwrite each other, and further, they can be shared between multiple tabs/windows in the same browser. So, for example, a (poorly designed) CSRF cookie might have an execution flaw such as: user logs in to site, a CSRF cookie is set; user checks email, clicks on malicious link; link opens in new tab, hijacks CSRF cookie and token; malicious action is executed by the server. Alternatively, a user might simply open two tabs, and try to perform two different actions in each tab, but at least one of those actions will likely be blocked by the CSRF cookie, if it were well-designed (single use, locked to a specific action/user, etc).
There are ways to mitigate these problems, such as supporting multiple tokens in the cookie at once, including a time stamp, action path, user name, a secret value only the server knows, then encrypt everything into the CSRF token using AES or another secure encryption algorithm. Just be aware that all of this has to be designed perfectly right, or you'll have a gaping wide CSRF problem in your application, and you might not even realize it. A better choice would be to fix whatever problem it is that's preventing you from putting the token in the URL/form data to begin with.


link between firewalls and cpe internet dedicated or on internal vlan

Question: We have 2x datacenters in which we have 2x firewalls and 2x internet routers.
to allow the firewalls to reach both the internet routers there is a dedicated line between the datacenters
For budget issues we want to remove that line and route that traffic through a dedicated vlan on the core switches which are connected to each other with another dedicated line between the datacenters.
considering that the traffic between the firewalls and the internet routers is not protected we had doubts in terms of security to run such traffic over the core switches.
are there any security issues in this regard?
are there any other solutions?
thanks
Andy
Comment: What are your security concern? Running unfiltered WAN traffic over core-switch ports?
Answer: This borders on a opinion-based question but there are some objective facts.
Arguably, the biggest security issue is that someone will enter the wrong command on the switch(es) and accidentally allow untrusted traffic into the network.
There are many security features on commercial switches that significantly reduce the risk of compromise.  If the manufacturer's recommendations are followed, then VLAN separation of traffic can be sufficient for most organizations.  You will have to determine for yourself if you can tolerate the risk.
Answer: I hesitate to format this as an answer but you asked for opinion basically. Personally I would not hesitate to do it as long as it is simply a layer 2 VLAN configuration and you keep the switches updated to avoid any potential security issues that may come up later. I see minimal security problems with the described solution and have used it myself without issue. Just make sure the switch ports have services such as LLDP or CDP or other dynamic learning style features (VTP etc.) disabled so they can't interact with unmanaged systems and remote devices.


QGIS Layer 1 Point. Layer 2 Line. Calculate distance along the line that the Point sits

Question: As per the title really.
I have a layer consisting of a network of Lines. I have another layer of point items 'snapped' to the lines. I'd like to attach a length value to the point based on how far along the line it is.
Answer:
Add a virtual field to the line layer by using the Field Calculator to create an unlimited length text field with this expression:  geom_to_wkt( $geometry)

Install the refFunctions plugin. This plugin gives you additional functions in the Field Calculator, including geomnearest.
Add a "distance along line" field to the point layer using the Field Calculator with this expression:
line_locate_point( geom_from_wkt( geomnearest('Lines', 'WKTgeometry')),$geometry)

geomnearest retrieves the "WKTgeometry" value from the line closest to the current point
geom_from_wkt converts the "WKTgeometry" into a geometry
line_locate_point returns the distance along a linestring to the closest position the linestring comes to the point geometry
Answer: It ain't pretty and I'd love if someone found a more elegant solution but here goes:

Add fields for X and Y coordinates to the point features, to do this create two fields populated using the functions $x and $y respectively. I'm going to call those "x" and "y".
Now we need to give those coordinates to the lines that they are on, this needs a spatial join. To do this use the Join attributes by location function.

When I tried joining the points to the lines it wouldn't work and I don't know why.
My workaround was to buffer the points by one metre and then join the buffer to the lines

input layer = lines
join layer = buffered points
join type = take attributes of first location feature only

Now the lines have fields with the coordinates of the points.
Next we create a field for the distance along the line of those coordinates, use the field calculator with this function:
 line_locate_point($geometry, make_point("x", "y"))

Comment: Probably the point to line join failed because the points aren't exactly on the lines (I know you said they were snapped to the line, but maybe the snapping algorithm is less precise than the join by location algorithm.) You could skip making point buffers if you use the NNJoin plugin to do a nearest-neighbor join, instead of joining by location.


Can I use a 40V schottky on a system which may suffer a 40V reverse fault?

Question: I've heard that the Vrrm of a diode is a maximum, and the diode should not be continuously exposed to it. I'm using a PMEG4010CEJ diode, a 40V/1A SOD323 diode. Basically, the power input is a 33.6V 8S LiPo battery, which could be reversed. The diode is in series with the power input and protects a buck converter against a reversed supply, which would damage it. To add a bit of a margin, let's say the system has to sustain a maximum -40V input fault. Can this diode (or any 40V diode) handle it, or do I need to use a 50-60V diode (more expensive)?
Answer: Exceeding the PIV will generally damage the diode, not to mention rapidly allowing current to flow - defeating the point of the protection diode.
Answer: Derating guidelines in industry usually allow for no more than 70-80% of the maximum reverse voltage stress for diodes. You'll want a 50V part for 33.6V reverse protection.
Comment: Side question: I'm using an LT1933. In the datasheet, for 34V in and 3.3V out, they recommend a 40V catch diode. If I'm not mistaken, isn't the catch diode exposed to full brunt of the supply's 34V about 550,000 times per second?


What is the difference between Linear Quantization and Non-linear Quantization?

Question: What is the difference between Linear Quantization and Non-linear Quantization ? I'm talking with regard to PCM samples.
http://www.blurtit.com/q927781.html has an article about it but I'm looking for a more elaborate answer.
Answer: It's pretty simple really. With linear quantization every increment in the sampled value corresponds to a fixed size analogue increment. E.g. an 8 bit A-D or D-A with a 0 - 1 V analogue range has 1 / 256 = 3.9 mV per bit, regardless of the actual signal amplitude.
With non-linear quantization you normally have some sort of logarithmic encoding (e.g. µ-Law or A-law), so that the increment for small sample values is much smaller than the increment for large sample values. Ideally the step size should be roughly proportional to the sample size. This translates to a fixed S/N ratio (due to quantization noise), regardless of the signal amplitude. Another way of looking at this is that you can use fewer bits to get a given S/N ratio over the signal amplitude range of interest.
Comment: its the same as uniform encoding with fixed step size
Answer: Errors occur on every sample except where the sample size exactly coincides the mid-point of the decision level.
If smaller steps are taken the quantization error will be less. However, increasing the steps will complicate the coding operation and increase bandwidth requirements.
Quantizing noise depends on step size and not on signal amplitude
The quantizing intervals are of equal size.
Quantization noise: the difference between the input signal and the quantized output signal
Signal-to-quantized-noise ratio
S/N= 6n+1.76 dB
n=8, S/N=49.76 dB
In other words, every added binary digit increases the ratio by 6dBs
Example
Consider sample 2, the actual amplitude of the signal is +1.7V.
This is assigned level 2 (same for any voltage between 1 & 2), which is transmitted as line code 101.
At the receiving end 101 is converted to a pulse of +1.5V (the middle value of the decision level at the encoder)
This produces an error of 0.2V between original input and output signals.
Non-Linear Quantization
With linear quantization, the signal to noise ratio is large for high levels but small for low level signals.
Therefore, non-linear quantization is used.
The quantizing intervals are not of equal size.
Small quantizing intervals are allocated to small signal values (samples) and large quantization intervals to large samples so that the signal-to-quantization distortion ratio is nearly independent of the signal level.
S/N ratios for weak signals are much better but are slightly less for the stronger signals.
Commanding: a process in which compression is followed by expansion.
Two separate laws are used
A-Law adopted by ITU-T for 30 channel PCM.
µ-law used mainly in USA,Canada and Japan.


What is the difference between radiation, emission and reflection in terms of heat?

Question: I am reading heat transfer and I get confused between these terms. I know they are very basic terms but I can't relate them with heat. Any help is appreciated.
Answer: Heat IS radiation in the sence that it is infrared electromagnetic radiation.
Emission is how much energy (heat) one radiates outwards due to ones internal energy. Normally this behaviour is modelled as a blackbody radiator with an emissivity and absorbtivity (spelling please).
Reflection is the part of incoming radiation that is not absorbed by the blackbody (unless it is a perfect blackbody) and is thus reflected outwards.
Comment: In my mind heat is not radiation, and radiation is not the net of absorption and emission.  I think the lesson of this answer is that the words have different meanings to different people and in different contexts.
Answer: Speaking as an architect and engineer I am familiar with three forms of heat emission or transfer:

Conduction in which thermal motion of particles is transferred from a hot body to a cold one in contact with it.
Convection in which heat is similarly transferred to a fluid medium, the locally heated volume of which then expands and rises, drawing in more cold fluid.
Radiation in which electromagnetic energy, primarily in the infrared band, is emitted to carry away the excess energy of the agitated particles.

Thus, from my perspective one can give the more physics-related answer that in this context:

"Heat" may refer either to the random kinetic energy of individual particles in a mass, or to electromagnetic radiation in the infrared band.
Radiation is the emission of heat via black body radiation, which one may describe either as a classical wave or a stream of photons, according to which mathematical treatment is the more convenient at the time.
Emission is the passing of heat energy in any form to somewhere else.
Reflection is the blocking of incoming thermal radiation and returning it back to the medium in which it arrived.
Answer: Think about the duality of wave and particle proposed by Paul Dirac.
Emission is used in context that it is considered as particle, like blackbody emits photon energy (energy in packets).
Radiation is used in context that it is considered as wave, like frequency of electromagnetic waves.


How can I use external expressions in Linq with EF4 (and LINQKit)?

Question: I want to separate out often used expressions in linq queries. I'm using Entity Framework 4 and also LINQKit but I still don't know how I should do it the right way. Let me give you an example:
Article article = dataContainer.Articles.FirstOrDefault(a => a.Id == id);

IEnumerable<Comment> comments =
  (from c in article.Comments
   where CommentExpressions.IsApproved.Invoke(c)
   select c);

public static class CommentExpressions
{
    public static Expression<Func<Comment, bool>> IsApproved
    {
        get
        {
            return c => c.IsApproved;
        }
    }
}

Of course the IsApproved expression would be something much more complicated.
The problem is that the Invoke() won't work because I didn't call .asExpandable() from LINQKit on container.Comments but I can't call it because it's just an ICollection instead of an ObjectSet.
So my question is: Do I always have to go through the data context when I want to include external expressions or can I somehow use it on the object I fetched (Article)?
Any ideas or best practices?
Thanks very much!
neo
Comment: did you mean "article.Comments" instead of "container.Comments" on line 4 of your sample code?
Answer: The problem is EF doesn't support Invoke expressions, so you need to fold the expression into the EF in a different way.
You should check out Damien's 'Client-Side properties' post which does basically what you are asking for.
And for more background information check out Colin Meek's post showing how to visit and replace Invoke expressions with expressions EF can handle.
Hope this helps
Alex
Comment: Hm... Damien's post depends on putting ".WithTranslations()" at the end of the expression but this is again not possible in my case because after the Article object is fetched, I get no IQueryable's e.g. for article.Comments and as .WithTranslations is an extension for IQueryable this won't help. Tell me if I overlooked something.
Answer: I think I found an answer to my "problem". My problem wasn't really a problem but rather a wrong way of thinking.
When I read through this, it came clear to me that I just wanted to find a solution for a wrong problem. Let me explain that....
I'm using the POCO template with EF4 and have lazy loading still activated. With this I could magically walk through the objects without sending additional queries, at least they were not visible in my code. But of course, for each access to a relationship, queries were sent, and I also observed these with EF Profiler. And of course I also wanted to have them in their optimal way, i.e. "use the where condition in that sql" instead of "fetch all rows and do the filtering afterwards". This way of thinking is also called premature optimization.
It finally hit me when I started thinking "How would it be if I don't use lazy loading?" Simple, all data I want is fetched in the first place and afterwards you operate on that data and on nothing else, i.e. no hidden queries. When looking at it this way it makes sense to have ICollection instead of IQueryable on your domain object's relationships. And of course I can't use an Expression> for a .Where() call on a ICollection, but rather the inner Func<..>.
To answer my own question, Expression<>'s must only be used while having access to the repository or being aware of it which the POCO objects are not. If they should be used outside, i.e. on a ICollection, they have to be compiled to Func objects like that:
IEnumerable<Comment> comments =
  (from c in article.Comments
   select c).Where(CommentExpressions.IsApproved.Compile());

And if there really is a need for high performance then the repository has to be asked to fetch all the comments belonging to that article by matching on the ID and where CommentExpressions.IsApproved is fulfilled. Something like that:
IEnumerable<Comment> comments =
  (from c in dataContainer.ArticleComments
   where c.ArticleId == article.Id
   select c).Where(CommentExpressions.IsApproved);

Now the last where condition retains an Expression because of the missing .compile() and can be used in the sql.
I'm nearly satisfied with this. What I find annoying is the need to call ".compile()" and what I still don't understand is how I should construct or let one Expression use another expression which doesn't seem to be possible except by calling .compile() while including it because it's again only ICollection on which I cannot put Expression objects. I suppose here I can use LINQKit which then strips out the compile() calls.
I hope I'm going in the right direction. If you spot any logical error or can think of better ways doing that, please tell me in the comments so I can update the answer. Thanks all!
Answer: As you are using LinqKit use the predicate builder:
IEnumerable<Comment> comments =
  article.Comments.Where(CommentExpressions.IsApproved).Select(c=>c);

 public static class CommentExpressions
 {
    public static Expression<Func<Module, bool>> IsApproved
    {
        get
        {
            var pred = PredicateBuilder.True<Module>();
            pred = pred.And(m => m.IsApproved);
            return pred
        }
    }
 }

Comment: Doesn't work for me because article.Comments.Where() accepts only Func and not an Expression. (There was also a typo, it's not "Module, bool" but "Comment, bool", sorry)


how to add / configure new currency in sitecore commerce 9.1

Question: Please suggest me How to add new currency in existing currency sets ? actually i'm adding new currency but it will be not binding at business tool currency dropdown.
Answer: Looks like you just defined the currency set and you didn't follow all steps like here: https://doc.sitecore.com/developers/93/sitecore-experience-commerce/en/configure-currencies.html
You need to Define currency settings:
1.In the Content Editor, navigate to storefront in the Commerce Control Panel (sitecore/Commerce/Commerce Control Panel/Storefront Settings/Storefronts/).

Expand the storefront. right-click Currencies Display Adjustments, and select Insert, Currency.
Type a name for the currency and click OK.

On the Content tab, define:

Currency Description–provide an meaningful description of the
currency.
Currency Symbol–the three-digit ISO code or special character, for
example USD or $.
Currency Symbol Position–select 0 to display $n, 1 to display n$, 2
to display $n, and 3 to display n $
Currency Number Format–type the culture code for the currency. For
example:

ja - Japanese
fr - French (France)
da - Danish
en-GB - English (Great Britain)
en-US - English (United States)

Click Save.
You need to Associate a currency set with a storefront

In the Content Editor, navigate to sitecore/Commerce/Commerce
Control Panel/Storefront Settings/Storefronts/.
Select Currency Configuration.
On the Content tab, in the Commerce Control Panel section, select
the currency set you want to associate with the storefront.
Save your changes.


ShrinkWrap to multiple objects

Question: Is there a way to Shrinkwrap and move a plane across more than one mesh?
Answer: You can remake a shrinkwrap modifier in geometry nodes and reference a collection as a target:

Here, I'm telling the mesh's vertices to acquire the position of the nearest point (on a face) of any geometry in collection 1.  That's just like a shrinkwrap on nearest surface point, except I'm referencing multiple objects.
Other kinds of shrinkwrap can be recreated as well; a raycast node can be used for project-mode shrinkwraps, as well as to make determinations like inside/outside.
Note that shrinkwraps don't always end up working like you want when you start referencing multiple bits of geometry, because there's more potential for self-intersection on the target.
Another way to do this would be to use a proxy object.  We could use geometry nodes, or a boolean-union that referenced a collection, to make an object that represented multiple objects:

Here, I'm booleaning a point with a collection, giving me a single object I can use as the target of a shrinkwrap.
Answer: Since the question used the phrase "more than one mesh" the answer for the shrinkwrap modifier is "yes, but only if the multiple meshes are contained in the same object.
The shrinkwrap modifier takes a single target object, so there is no way to apply it to multiple meshes if each mesh is in a separate object, but if you join the meshes into a single object you can do something like this:

where Suzanne and the default cube have joined into a single object.  But no, you couldn't wrap the plane around Suzanne and a cube if they're separate objects.
You can accomplish the shrinkwrap effect without the modifier by using geometry nodes in various ways.  For examples, see this answer

ShrinkWrap to multiple objects