Identity of an inverse hyperbolic function

Question: Recently I stumbled upon the identity: $$\operatorname{csch}^{-1}(x) = \ln \left( \frac 1 x + \frac{\sqrt{1+x^2}}{|x|}\right)$$
So i decided to prove this identity by taking the integral of the derivative of inverse $\operatorname{csch}(x)$. Although i tried expressing the integral : $$-\int \frac{\mathrm dx}{ |x|\sqrt{1+x^2}}$$
into different forms, I still haven't found a way to write it in terms of $$\int \frac{f'(x)}{f(x)} \, \mathrm dx$$
**I know there is a solution which involves the application of the definition of hyperbolic functions (with exponentials), but I was wandering if it was possibile with integration
Answer: The usual algebraic proof:  Recall that $$\sinh x = \frac{e^{x} - e^{-x}}{2}.$$  Thus, $$\operatorname{csch} x = \frac{1}{\sinh x} = \frac{2}{e^x - e^{-x}}.$$  It follows that $y = \operatorname{csch}^{-1} x$ is the solution to the equation $$x = \frac{2}{e^y - e^{-y}}.$$  To this end, we write $$e^y - e^{-y} = 2/x,$$ and multiplying through by $e^y$ gives the quadratic $$(e^y)^2 - (2/x) e^y - 1 = 0,$$ which has the solution $$e^y = \frac{(2/x) \pm \sqrt{4/x^2 + 4}}{2} = \frac{1}{x} \pm \sqrt{\frac{1}{x^2} + 1}.$$  Since $$\frac{1}{x^2} + 1 > \frac{1}{x^2},$$ if we require $y$ to be real-valued, we must choose the positive root of the quadratic; hence $$y = \operatorname{csch}^{-1} x = \log \left( \frac{1}{x} + \sqrt{\frac{1}{x^2} + 1} \right), \quad x \ne 0.$$

Consider $$I = \int \frac{dx}{x \sqrt{x^2+1}} = \int \frac{x \, dx}{x^2 \sqrt{x^2+1}}.$$  With the substitution $$u^2 = x^2 + 1, \quad 2u \, du = 2x \, dx,$$ we obtain $$\int \frac{u \, du}{u(u^2-1)} = \int \frac{du}{u^2-1} = \frac{1}{2}\left(\int \frac{du}{u-1} - \int \frac{du}{u+1}\right).$$  It follows that $$I = \frac{1}{2} \log \frac{u-1}{u+1} + C = \frac{1}{2} \log \frac{(u-1)^2}{u^2 - 1} + C = \log \frac{u-1}{x} + C = \log \frac{-1 + \sqrt{x^2+1}}{x} + C.$$  The details are left to you to complete, namely to demonstrate $C = 0$, and to refine the argument to take care of the absolute values.
Comment: Thank you for the reply, though I think I am missing something on your third step.. how is x^2 = u? (on the denominator of the third integral you wrote)
Comment: @user372003 Actually, we have $u = \sqrt{x^2+1}$, and $x^2 = u^2-1$, so it is correct as written.
Comment: Sorry, my mistake! Thank you
Answer: Firstly, note that the idea does not fully work.
$
\def\lfrac#1#2{{\large\frac{#1}{#2}}}
\def\Int{{\displaystyle\int}}
$
After you differentiate you lose some information about the original function. Even if the derivative is continuous, integrating it will give you a class of functions that differ by a constant. So you still need to check at least one point to determine the constant, and you still need to verify that the derivative is continuous, because there are strange functions, like $\Big( \mathbb{R}\ x \mapsto \cases{ x^2 \cos(\lfrac1{x^2}) & if $x \ne 0$ \\ 0 & otherwise } \Big)$, which is differentiable on $\mathbb{R}$ but whose derivative cannot be integrated on any interval containing $0$.
With that in mind, by symmetry it suffices to prove that $\Int \lfrac1{x\sqrt{x^2+1}}\ dx = -{\ln}\Big( \lfrac1x + \lfrac{\sqrt{1+x^2}}{x} \Big) + C$ for some constant $C$, where $x > 0$.
Note the identity $\lfrac1{x\sqrt{1+x^2}} = \lfrac1x - \lfrac{x}{1+x^2+\sqrt{1+x^2}} = \lfrac1x - \lfrac{x \div \sqrt{1+x^2}}{1+\sqrt{1+x^2}}$ for any real $x > 0$.
Thus $\Int \lfrac1{x\sqrt{x^2+1}}\ dx = \ln(x) - \ln(1+\sqrt{1+x^2}) + C$ for some constant $C$.
Answer: we know,
$$\sinh^{-1}\left(\dfrac{1}{x}\right)=\ csch^{-1}x=\ln\left(\dfrac{1}{x}+\sqrt{\dfrac{1}{x^2}+1}\right),x\neq0$$
now, let
$\sinh^{-1}\left(\dfrac{1}{x}\right)=y$
$\sinh y=\dfrac{1}{x}$
differentiate w.r.t $x$ on both sides
$\cosh  y \ \dfrac{dy}{dx}=\dfrac{-1}{x^2}$
$\dfrac{dy}{dx}=-\dfrac{1}{x^2 \ cosh \left(\sinh^{-1}\left(\dfrac{1}{x}\right)\right)}=-\dfrac{1}{x^2 \sqrt{\dfrac{1}{x^2}+1}}=-\dfrac{1}{x\sqrt{{x^2}+1}}$
from above we can infer
$\displaystyle\int\dfrac{-1}{x\sqrt{{x^2}+1}}dx=y=\sinh^{-1}\left(\dfrac{1}{x}\right)=\ csch^{-1}x=\ln\left(\dfrac{1}{x}+\sqrt{\dfrac{1}{x^2}+1}\right)$


Pauli Decomposition

Question: I would like to apply a Pauli Decomposition to my Dual-Pol SAR Data (HH; VV). As a result, I need the complex values from Pauli Basis HH+VV and HH-VV and I will not use it for a RGB picture generation. I know that the R, (G), B bands produced by the following intensities: R = 0.5*|Shh - Svv|²; B = 0.5*|Shh + Svv|²
My question is now how can I convert the intensities R and B to their complex forms?
Answer: It sounds like your HH and VV data are "detected" amplitudes/intensities rather than SLC data (single look complex). In this case, you can use them directly and compute R = HH-VV and B = HH+VV. You could convert them back to complex numbers, but that would be meaningless without the phase information. Note that this is not truly a Pauli decomposition in the absence of the HV data.
EDIT, in light of OP comment:
If the data are truly SLC complex data, then you evaluate them as you wrote. In numpy this would be 0.5*numpy.abs(HH+VV)**2, or using no temporary arrays:
HH += VV
del VV
numpy.abs(HH, out=HH)
HH **= 2
HH *= 0.5

where HH and VV are the original complex values. The output is a real number, so you can save HH.real to a Float32 file for further analysis.
Comment: Hello Benjamin, thank you for your reply. I have 2 TanDEM-X SLCs in a bistatic acquisition mode.

Pauli Decomposition


Integral of Rational Functions

Question: $$\int \frac{dx}{ax^2 + bx + c} \quad \text{for} \quad 4ac-b^2 >0$$
then
$$\begin{align}
ax^2 + bx + c
&= a\biggl(x+\frac{b}{2a}\biggr)^2 + \frac{4ac-b^2}{4a} \\
&= \Biggl(\sqrt{a}\biggl(x+\frac{b}{2a}\biggr)\Biggr)^2 + \Biggl(\sqrt{\frac{4ac-b^2}{4a}}\Biggr)^2
\end{align}$$
implies
$$ \int \frac{dx}{ax^2 + bx + c} = \int \frac{dx}{\Bigl(\sqrt{a}\bigl(x+\frac{b}{2a}\bigr)\Bigr)^2 + \Bigr(\sqrt{\frac{4ac-b^2}{4a}}\Bigr)^2} = \frac{2\sqrt{a}}{\sqrt{4ac-b^2}}\arctan\frac{2ax+b}{\sqrt{4ac-b^2}}
$$
The correct answer does not have the $\sqrt{a}$ in the numerator.  I've checked over my work, but have clearly made some dumb mistake.  Can anyone please let me know where such an error was made?  Thank you for your help!
Answer: Hard to debug, since some detail is missing. To make things less messy, I would rewrite the integral as
$$ \int\frac{4a\,dx}{(2ax+b)^2+4ac-b^2}.$$
Let $4ac-b^2=K^2$.  Then let $2ax+b=Ku$. We have $2a \,dx=K\,du$. So our integral is
$$\int \frac{2K\,du}{K^2u^2+K^2},$$
which is
$$\frac{2}{K}\arctan u+C.$$
Remark: I am not fond of fractions, so for completing the square I prefer to write $$ax^2+bx+c=\frac{1}{4a}\left(4a^2x^2+4abx+4c\right)=\frac{1}{4a}\left((2ax+b)^2-(b^2-4ac)  \right).$$
Comment: I did not show every step in order to save time.  I like your way much better.  Thank you!!
Comment: You are welcome. Note also that when people derive the Quadratic Formula, they often first divide $ax^2+bx+c$ through by $a$, creating a mess. I prefer to multiply through by $4a$. Then the quadratic equation becomes $(2ax+b)^2=b^2-4ac$, from which the Quadratic Formula follows quickly.
Comment: Nice trick.  I will use this method from now on
Comment: Found the issue.  By letting $ u=\sqrt{a}(x+\frac{b}{2a})$, then $du = \frac{dx}{\sqrt{a}}$.  Thus, $\frac{\sqrt{a}}{\sqrt{a}}=1$ and I reach my desired result.  Thanks again!
Answer: I would solve for the roots and use maybe partial fractions, just to be more neat? have you tried that
Comment: I completed the square, and then wrote the denominator as the sum of squares.
Comment: but yes. your argument seems right. I teach calcalus and first time I see such a general question. That'ts interesting
Comment: It is from a table of integrals, and out of curiosity I wanted to show it to be true for myself.
Comment: @Daniel Since the discriminate is assumed negative, I don't think partial fractions would be much use here, unless you intend to factor the quadratic into complex linear factors.
Comment: alright. the way the discriminate was presented confused me I guess :). yes, I apologize.
Answer: A way to make diagnosing these types of errors way easier is to pretend your variables are dimensional (i.e. that they have units). Suppose $x$ has units of length (or you could pick mass or time or a made-up unit), which I will write in shorthand as $[x] = L$. Then if $[a] = L^{-2}$ and $[b] = L^{-1}$ and $[c] = 1$ (i.e. $c$ is unitless), the units are consistent and your final answer should have units of length, because $[dx] = L$ and the denominator is unitless. (It's important to make sure the units are consistent when you start, because if you have something like $1 + u^2$ you simply can't assign units to $u$.)
Now just go through your steps and look for the point at which the units stop being consistent. Everything is good up to the next-to-last step you've shown, i.e. this expression
$$\int \frac{dx}{\Bigl(\sqrt{a}\bigl(x+\frac{b}{2a}\bigr)\Bigr)^2 + \Bigr(\sqrt{\frac{4ac-b^2}{4a}}\Bigr)^2}$$
still has the correct units ($[dx] = L$ and denominator unitless), so the error came in somewhere in the steps you didn't show. Obviously, that's all I can say without you showing those steps, but perhaps you can apply this technique to your own private work and see exactly where that extra $\sqrt{a}$ came from.

Integral of Rational Functions


what if i never update to minor updates

Question: in Vista, I have turned updates totally off; I update when I feel like it; and I will be to blame if I don't update when there has already been a cyber world war (which is sarcastic for "I update when I feel like it"). What if I do that in Linux? By linux I definitely mean Ubuntu.
For downvoters:
I don't want to update my ubuntu everyday, I only want to update to major long term supports, what is my liability?
Answer: Failing to apply updates regularly will cause your machine or devices to be more vulnerable to recently-discovered security flaws.  Take the recent Heartbleed vulnerability for instance: if you weren't watching the news and you didn't update, any SSL-protected resources may have their private keys stolen.
If you're only running your desktop machine on your LAN behind a good firewall, there's less risk than in other scenarios and the Heartbleed example becomes a little drastic.  On the other hand, you're more vulnerable to viruses and malware if you're not regularly applying updates.  Viruses targeting Linux are less common than those targeting Windows, but I think you should still be careful.
At the end of the day you have to be the judge of whether or not you are willing to take the security risk involved in not regularly applying updates, because only you know the sensitivity of your data and how important it is to you to keep it private.

what if i never update to minor updates


phpmyadmin move to another server?

Question: Ok so I've got phpmyadmin running on my local server for web development, however, my server has crashed, but I have a backup of all the files (not a database backup) on my server from last night, if I copy across the phpmyadmin folder, and put it on another machine, will all my databases still be in tact?
Comment: No, phpmyadmin is only interface to databases, except if you copy phisical database files and can run them on new instance of sql
Comment: PHPMyAdmin is only a database administration tool. You'll need to access your database directory to retreive your database.
Comment: Sorry to sound stupid, but where's the database directory found in phpmyadmin folders? If it is found in there, that is :/
Answer: Your database files are probably in /var/lib/mysql.  If you have THOSE files backed up, with EXACTLY the same version of mysql, same libraries, etc., then you could just restore them to another machine, and check the configuration for hostnames (MySQL only uses these IN the database though, for login security, iirc, so it won't apply until you're up and running again).  Then, just boot it up.  Do keep a copy of the backed up /var/lib/mysql though, in case it fails to come up correctly.  MySQL will probably repair some files on startup, which may not work properly.
Once you can do pgrep -l mysql (as root), and you see mysql running, then you can worry about installing a webserver, php, phpmyadmin, etc.
Next time, have proper, regular backups (mysqldump plus a filesystem backup using something like rdiff-backup, dirvish, or faubackup), use a redundant RAID filesystem, and maybe a data-checksummed filesystem on top, like ZFS.
Answer: Phpmyadmin is only interface to database engine. You can dump databases trough it, but it is not the database engine. If your server is still alive (ssh or command prompt), and you have live mysql instance you can dump your databases to sql file, using the command mysqldump, and restore them on the new server with phpmyadmin or just using mysql -u user -p | cat sqlfile.sql

phpmyadmin move to another server?


Renaming ModelBuilder output shorter?

Question: I'm trying to use the modelbuilder to convert some feature classes to rasters using iterators. The names on each feature class contains year_xxxx with xxxx being an extension number that I don't want my output raster names to have. For example: 1845_6002pt.sh as input and I want 1845 only in the output.
Comment: Welcome to GIS SE!  As a new user be sure to take the [Tour] to learn about our focussed Q&A format.  I recommend not thinking about GIS SE as being some sort of online GIS tutor.  For your questions to be answered here they should as much as possible describe not just what you want to do, but precisely what you have tried and where you are stuck trying that.
Answer: How do you want to do this?  Do you have any python knowledge?  Add more detail to your question if you would like a detailed answer.
Here is a python snippet to split a string:
<code>yourstring = "1845_6002pt.sh"
return yourstring.split('_')[0]
</code>
This will return '1845'

Renaming ModelBuilder output shorter?


What is the cut off frequency of the RC filter in this circuit

Question: I have the circuit of a heartbeat sensor  module from pulsesensor.com but I can't seem to understand  the kind of filter in the schematic.  They Said  it contains a low pass RC  filter  with R = 100 ohm and C = 47uF. But from my analysis I see a hpf. What kind of  filter is formed  by R2, C2, C1, C3 and C4. what is the cut off frequency of the filter.
Comment: Why don't you contact them for clarification?
Comment: There are no components marked 100 Ω or 47 µF in your schematic. I don't think we can help.
Comment: @Transistor I mean. What  kind of  filter  is formed by R2, C2, C1, C3 and C4
Comment: Well edit your question and ask that!
Answer:
They Said it contains a low pass RC filter with R = 100 ohm and C =
  47uF.

No, they said:-

we designed a fairly universal Low Pass Filter for the output (passive
  RC. R: 100 C: 4.7uF)

but...

We made some changes to the original Pulse Sensor circuit

There are two filter stages in this circuit. The first is a passive low-pass filter formed by R2 and C2/C1. It has a cutoff frequency of ~5.64Hz and stop-band attenuation of 20dB per decade. However the load impedance in combination with R2 and C2 will form a high pass filter, so the practical result is a band-pass filter.
(Note: the 14K resistor in the simulation below is a simplification of the complex load impedance in your circuit).

simulate this circuit – Schematic created using CircuitLab
The second stage (C3, C4, U2 etc.) is an active band-pass filter with gain. In isolation it would have 47dB gain at a center frequency of about 2.3Hz, but with the two stages combined the overall result is 37.5dB gain at a center frequency of about 2.6Hz.
Analyzing a multistage filter circuit like this is not easy, due to the complex interaction between stages. Rather than trying to do the calculations by hand I simulated your circuit in LTspice. Here's the  schematic:-


Lorentzian metrics on a disk up to conformal equivalence

Question: Is it correct that a disk endowed with a metric of Lorentzian signature (smooth up to the boundary) is always conformally equivalent to some simply connected domain on Minkowski plane (with the metric induced from Minkowski)?
Answer: It seems the answer is no. See the paper "An Analogue of the Riemann Mapping Theorem for Lorentz Metrics" by R. S. Kulkarni, Proc. R. Soc. Lond. A 9 September 1985 vol. 401 no. 1820 117-130.
Comment: Thanks for the reference, I am trying to understand whether the answer to the question can be inferred from this paper.
Answer: Here is the main idea. Suppose that the metric extends smoothly to the boundary. Such a metric has two null directions at each point. Follow one until you reach the boundary, and then switch to the other one. Watch each boundary point move, according the first null direction, and then watch it move according to the second one. These are two continuous maps on the boundary. You can pretty easily come up with examples for which the resulting dynamical system is quite messy. I think that Vladimir Arnol'd once said he studied these dynamical systems in his doctoral thesis. Global invariants of these dynamical systems prove that there is an infinite dimensional moduli space of Lorentzian metrics on the closed disk. The ones on the open disk can get even worse.
Comment: Right, I understand that, but I did not ask whether all Lorentzian metrics on a disk are conformal to Minkowski metric on a standard disk. In terms of this dynamical system, my question is whether one arising from given Lorentzian metric on a disk can be realized on some closed curve (boundary of a domain) in Minkowski plane.
Comment: @pmnev: Null-curves on the discs is Minkowski plane is never recurrent, for instance; also, one null-curve cannot be asymptotic to another one. However, I would like to see an example of nontrivial dynamics on symply-connected Lorentzian surfaces as there might be some topological obstructions.
Comment: Sorry, I didn't read the question carefully enough.
Comment: @Misha On a general Lorentzian disk one also cannot have a closed null-curve, if there were one, we would have a simply connected domain (the interior of the null-curve) with a non-vanishing vector field tangent to the boundary, which would contradict the hairy ball theorem. Concerning null-curves asymptotically approaching one another, I would expect that this is impossible on a disk too; that was a part of the question. On a cylinder, as opposed to the disk, one can have these effects, as e.g. in Misner space.
Comment: Maybe the answer is in Tilla Weinstein's book An Introduction to Lorentz Surfaces.
Comment: Tilla Weinstein's book discusses the Luo-Stong theorem, which apparently gives both necessary conditions and sufficient conditions, and she gives an explicit counterexample.
Comment: @ Ben McKay: Thanks a lot, I beleive Luo-Stong's theorem answers my question.


Real meaning of "I am sorry I love you."

Question: I have seen many cases where people in love say, "I am sorry I love you." It might be due to my poor English, but I couldn't really understand what it meant. Could you please explain what it could mean?
Comment: Often when you go up to kiss someone, you accidentally step on their toes.
Comment: Could you give us some examples of where you've seen this usage? I've never heard it before and can only imagine its appearance in obscure contexts ("You broke my heart. I'm so sorry that I love you.")
Comment: EL&U is for linguists, etymologists, and serious English language enthusiasts; love questions are not followed.
Comment: @Mitch, thanks but it still puzzles me. Carlo_R, I think this is a  English Language Usage Question. Right? I just wondered what could be the real meaning(s) of this.
Comment: I even did Google search : https://www.google.com/search?q=real+meaning+of+i+am+sorry+i+love+you , which lead me nowhere.
Answer: It depends heavily on the punctuation, and the context.

"I am sorry I love you"

means, "I love you, but, for some unstated reason, I'm sorry that I do."
On the other hand,

"I am sorry; I love you."

means I'm sorry about something, but I want to let you know that I love you.
Note that "sorry" has at least two possible meanings here.  In English, "I'm sorry" can be roughly equivalent to "I apologize."  Also, "sorry" can be used to express woe or regret.
So, absent more context (and punctuation, maybe), there's no way to know for sure what it means.  But leading candidates would include:

I regret loving you (perhaps you broke my heart)
I apologize for loving you (I know I said we'd remain just friends, but, somehow, I fell in love with you instead)
I'm sorry, and I love you (oops! I forgot your birthday – but I still love you!)
Comment: Whenever I've heard this phrase, it's meant the last version you've posted: "I am sorry [for something]. I love you."
Answer: First of all, "I'm sorry I love you" is the name of very popular Korean drama. And this drama is one of my favourite dramas. Before I watched it I thought that they are telling this sentence because they regret their feelings. But at the end I understand something different. Until the last episode, we never hear this sentence.
Before explaining to you what I understood, let me tell you the story a little bit. The main character is about to die. We all know this in the first episode. He will die. He fell in love with a girl. This girl commits suicide at the end. She sees suicide as a choice not a crime or anything bad. She thinks she will do something for the first time for herself. She never makes a decidion on her own and she lives her all life for everyone else.
Anyway, while we are watching this movie, the man wants to leave her. Because he will die and he doestn't want to upset her. And that moment the girl write this sentence on the mirror. I think that means, you want me to go but I am sorry, I couldnt do that because I love you. That's why she commits suicide at the end. She tells us -- the people that watch the movie -- I think this is a choice. I am telling you why I am sorry. But I love. And the man says this sentence too. Normally some people  think what he did to her is not acceptable. Because she is driving crazy due to her love. But the man did not leave her even though he knew that she will be alone after his death. And he justify himself this sentence. I am sorry for doing this but I love you. That is not my choice.
I hope I can explain my thought clearly. What I understand is this. I can not leave you because I love you. I hope it helps.
Comment: @ Sema Kir  I edited your answer to make it easier to read.  Mainly, I split your one long paragraph into 4 shorter ones.  I also worked a little bit on the grammar.  If you don't like what I did, just change it back.  It is your answer!  One thing is not clear:  Is the man going to die because he has a fatal illness?
Comment: @ab2 I was about to edit the post, but I am not sure if it's worth it. The question should have been closed IMHO.
Comment: @Rathony Sometimes I can't stop myself.
Comment: @ab2 Yeap. I know how much you try to help learners. That's what I don't have. :-)


What is the change if a droplet of water is added to another droplet of water on a flat surface

Question: There is a tiny droplet of water lying on a flat clean surface and I add a droplet of water to the tiny droplet on the surface. How can I explain the change that might occur?
Answer: you explain it in terms of the surface energy of the flat clean surface and the surface tension of the water in the droplet: you make a vector sum of the surface tensions at the point where the water, the air, and the solid surface meet and solve for the wetting angle at that point.
Next you notice that if you add more droplets of water to the existing droplet, the contact point advances with one angle- and if you remove a little bit of water from it, the contact point retreats with a different angle. The difference between the advancing and retreating contact angle is called wettability hysteresis and reflects the fact that the water in the droplet has had enough time to adsorb onto the wetted surface, making it "friendlier" with the rest of the water in the droplet.
There is zero wettability hysteresis if the solid surface is something like teflon or if it is coated with a film of oil.
There are more useful and interesting experiments you can do with this basic setup. Write back if you want more and I'll provide it.


Geometry Nodes Boolean difference between mesh and boundary box

Question: I have been racking my brain on this topic but I am trying to create a ceiling generator and I want to remove extra geometry if I have an irregular shaped room. The only thing I have been able to work out is using the mesh geometry itself and somehow utilizing the bounding box node, but then I get stuck on how I can get the difference between these two elements. How can I get the mesh I need to remove the exess geometry?
Below are the picture examples I am working on.
Comment: please don't ask "bonus questions" - this site has some "rules". One of them is: Ask only one questions. If you have more questions, just open up a new one. Thx.
Comment: I think you'ere going to have to tell us in more detail what your generator does.. why the ceiling can't be generated _from_ the room, directly. Is it tiling, or something?
Comment: Yes, it is tiling. This is an exercise I wanted to do to see if I can create a realistic model that included all the physical elements. I found the solution down below.
Answer: I figured it out! At least one way of doing it. The reason for this question was so I could remove any areas of the ceiling that I don't want to show. Like for a room that is shaped like an "L".

This shows the raw geometry before the modifier. I just took the edges from the walls I created for the room and used this mesh as my foundation for the ceiling.
This box is what I want to cut from.

I will try to explain what this does. The top half of the group creates a plane from the original mesh. This means I have a workable face to extrude from. The nodes below uses the bounding box node to create a plane that is the overall size of the mesh. I then used the boolean node to remove the portion of the bounding box mesh which leaves me with only the object that I will use to remove parts of the ceiling.
This Idea came from Blender Bash's Youtube video which explains what I did in the top portion and why iit works.
https://www.youtube.com/watch?v=45O51Up5qxw&t=585s
Hope this will help other people. I will even leave a link to this exact file for those who want to go deeper into what I did.  Is the practical, maybe not, but its been a fun project.


Auto Disable a SQL Server User

Question: I have a SQL Authentication User: JOHNDOE
I would like this account to auto-expire or auto-disable after X days or at a certain date/time. Any suggestions or best practices to do this?
Answer: You could setup a job that reads from a table containing a list of logins and their expiration dates. For every login that is expired in this table it could just drop it. There you could also automatically deal with users associated with and databases own by this login.
Answer: There's no native way to do this.  You'll have to create a SQL Agent job which disabled the login and the specific time.

Auto Disable a SQL Server User


Magento API to import external data into Magento database

Question: Are there Magento API to import massive external data (products) from a third-party application into Magento database programmatically?
If they exist, what are they and how can I find them?
Since I am a beginner to Magento, would you please be so Kind to give me detailed information?
Thanks in advance
Answer: Magento comes with a SOAP and REST API out of the box.
Magento SOAP API:
https://www.magentocommerce.com/api/soap/introduction.html
Magento REST API:
http://devdocs.magento.com/guides/m1x/api/rest/introduction.html
The REST API does not offer as much functions as the SOAP API so you need to have a look what functions you need.


Can Autarky be prosperous?

Question: In light of the recent economic sanctions on the Russian federation, I would like to know, if it is theoretically possible for a country like Russia, with a high level of natural resources and educational attainment to achive economic prosperity (>40,000$ gdp per capita) in the state of complete or near-complete economic isolation? And if that is possible, what economic measures would need to be taken to achieve that?
Answer:
I would like to know, if it is theoretically possible for a country ... to achive economic prosperity (>40,000$ gdp per capita) in the state of complete or near-complete economic isolation

By your definition of prosperity (>\$40,000 gdp per capita) it could be eventually possible.
Autarky certainly shrinks production possibilities frontier of a country, because trade allows countries to produce more efficiently because of comparative advantage, economies of scale, exploiting differences in factor abundances and so on (you can see overview of all arguments in texts such as Krugman et al International Economics: Theory and Policy 8th ed).
However, country in principle could grow over time even without trade. Hypothetically, if whole world would unite it would be functioning under autarky (assuming no alien traders) as strictly speaking there would be no international trade. In such united world autarky would have no negative effect until some other civilizations would be encountered.
As an extension, if we had a government covering 90% of Earth there would be negative effects but probably small. There is for sure somewhere a tipping point where country would be too small to grow, but it stands to reason that sufficiently large country would be able to grow even in a state of autarky (although there is no practical way of knowing if Russia could be considered sufficiently large - outside running an experiment with the country). As long as economic growth is consistently higher than 0%, it is simply mathematical inevitability that country will eventually reach your definition of prosperity. For example, even with 0.001% growth of GDP per year Russia would eventually hit \$40000 GDP per capita at some distant future.  However, by the time it reaches your absolute definition of prosperity other faster growing countries would perhaps consider \$40000 to be low income.
There is a lot of evidence more closed economies tend to grow more slowly than relatively more open economies (e.g. see Raghutla 2020) so even if Russia manages to grow after isolation one should expect that this growth will be rather slow.

And if that is possible, what economic measures would need to be taken to achieve that?

The literature on what policies promote economic growth is simply too broad to explore in detail but some policies that are widely thought to promote economic growth (aside from openness) are:

investment in R&D and technology
investment in education
promoting savings
adopting inclusive institutions, that is institutions that allow people to broadly participate in economy (e.g. strong property rights, open labor markets where people are not restricted to participate by their social class, religious or political or other beliefs/background, ability to set up business again not restricted by one's background, trying to improve governance - by reducing corruption for example, etc).

The above are some generally accepted policies that help to promote economic development. For more details consult Acemoglu Introduction to Modern Economic Growth or Acemoglu & Robinson Why Nations Fail?
Comment: Thank you for the answer. Do you think that the Modern monetary theory could help a completely isolated economy grow?
Comment: @user21346 you first need to explain what do you mean by modern monetary theory. Professional reputable economists often joke modern monetary theory is neither modern nor monetary nor theory (quip on Voltaire saying that Holy Roman Empire is neither Holy nor Roman nor an empire). Focusing on the last part, many economists say its not a theory - because till now nobody managed to put forward some model or series of rigorous models that are supposed to describe economy according to MMT, so MMT can be essentially whatever you like it to be. I heard versions of MMT that are slight deviations from
Comment: New Keynesian macro with some extra assumptions on shape aggregate demand curve, to claims that MMT is literally new paradigm that covers everything from microeconomics to macroeconomics. As such its not possible to say if it could help unless you can specify what do you mean by MMT

Can Autarky be prosperous?


שליח-השליח: why the difference?

Question: How come in the paragraph starting ויוציאנו ה' ממצרים… the first time the Hagaddah says ולא ע"י שליח, and the second time ולא השליח?
Comment: Many editions have השליח in both and many have it in neither.
Comment: Which edition Haggada are you looking at?
Comment: Keep in mind that in [Rabbinical] Mishnaic Hebrew there was a big mess caused by Aramaic lack of ה. Compare שבת הגדול. Many Sugiot of Shas are trying to interpret [mis]-use of ה in the Mishna, such as "האשה נקנית" or "הַמְקַדֵּשׁ אֶת הָאִשָּׁה"
Answer: From memory (my grandchildren at the seder and from various haggador which I do not have with me). Hashem had appointed Moshe Rabbeinu as the shaliach to bring the Bnai Yisrael out of Mitzraim. When a shaliach is appointed, that agent is supposed to act on behalf of the one who appointed him (as Moshe acted in the previous 9 makos). However, in this final plague, Hashem acted explicitly and did not allow Moshe to be his agent, as he acted in the rest of the Exodus and as the leader in the desert. The other phrases also do not have the hei hayediah because Hashem did not appoint any being to act on his behalf.
The initial statement uses  ולא ע"י שליח (does not have the hei hayediah) because it is a basic statement of the general concept. as applied to the entire pasuk. That is He did not assign any messenger or agent to any of the actions shown in the pasuk. Only when the individual explanation is being used, does Hashem say, not only was an agent not used, but even the שליח that had already been appointed was not used for this particular action.
Comment: He's not asking why it says אני ולא השליח but not אני ולא המלאך, but rather why it says אני ולא השליח yet earlier said לא על ידי שליח right before quoting the passuk of ועברתי.
Comment: @DonielF I added an explanation for the word shaliach

שליח-השליח: why the difference?


Feature selection: Should we keep all metrics (like mean. median,..) of a distribution or they make redundant features?

Question: There are many cases in which I don't know which metric I should use to calculate the value of a feature when the value has a distribution for each data point instead of an absolute number. for example, for the dataset of websites on the web, if the feature is the number of links per page for each website, then we can use multiple aggregation functions such as min, max, median, standard deviation and so to measure it. However, it looks to me that it may result in having many correlated features. So the question is, is it in GENERAL, better to keep multiple aggregations or just choose the best one? Or it most of the times depends on the data. If this is the case, when does it result in duplicated features?
Answer: I think if you keep multiple correlated features and then do a PCA to reduce the dimensions, it should choose the ones which are most important for your task. Then you can use the first k principal components for any further work.
Comment: Does this satisfy your question?


Defining index for scattered polygons

Question: I have 50m X 200m polygon which has several small polygons inside. I would like to define how scattered small polygons inside a big polygon. I was wondering if there is a tool which can calculate some index based on the distribution of polygons across a big polygon. For example, if polygons are gathered it would give index 0 and if they are scattered well index would be 1. Is there any tool that I can use? ArcGIS or QGIS would be good.
Comment: Do you mean something like spatial homogeneity https://en.wikipedia.org/wiki/Spatial_descriptive_statistics#Measures_of_spatial_homogeneity?
Answer: ArcGIS's Spatial Analyst toolset has

Spatial Auto-correlation tool

Measures spatial autocorrelation based on feature locations and attribute values using the Global Moran's I statistic.

Multi-Distance Spatial Cluster Analysis (Ripley's K Function)

Determines whether features, or the values associated with features, exhibit statistically significant clustering or dispersion over a range of distances.

I don't see any tool in QGIS that definitely does the same thing. Here are a few things that look like they might do something relevant.

The SAGA Spatial point pattern analysis tool provides "a simple indication of the spatial distribution of points." This tool has a tutorial here. The centroids tool will convert your polygons to points so you can run the spatial point pattern analysis tool.
QGIS also has various cluster analysis tools. Most of them just divide points up into clusters without providing any measure of "clustered-ness" (ie spatial homo/heterogeneity).
The Visualist plugin has the tag spatial autocorrelation map.
Per user30184's comment, you could try to implement the spatial homogeneity measures (Ripley's K and L functions) explained in this Wikipedia article. Ripley's K function is explained in more detail in this article. Here are a few tips/suggestions:

As above, convert the small polygons to points.
Use the distance matrix tool to calculate the distance between each pair of points (this will provide the dij values).

Defining index for scattered polygons


What are the requirements for aircraft marker cones?

Question: What are the requirements on aircraft marker cones (a.k.a. safety cones) according to IATA IGOM-96, i.e. size & weight?
Comment: For those that are voting to close this question as "unclear what you're asking": The question is about the safety cones that are places around an aircraft to mark the wingtips etc. They need to have a certain size (to be visible) and a certain weight (not to be blown over the manoeuvring area in the slightest of wind), and there are possibly more requirements. The question asks about these requirements.
Answer: According to IATA Airport Handling Manual, safety cones should

be conical in shape
be of a minimum height of 750 mm (22.2″)
have a minimum base weight of 4.53 kg (10 lbs)
be orange in color with reflective striping.
Comment: I write (non aviation) indistry specs for work . "Be conical in shape" is a spec speak equivalent of "don't be cheeky mate, you know one when you see one"
Comment: Thanks so much!!!!!!!
Comment: This is what I was searching for!!!


Would you be able to see from my iphone if someone is reading my imessages on an ipad I lent them?

Question: I let a friend borrow my ipad that has some imessages saved. I signed out before lending it to him, but I got a notification that my ipad is signed into my imessages now. When I asked if they signed into it, they said their kid hit the button on accident, but if it's signed in now, will I get a notification if they are reading through my messages? Or is there a way I can find out?
Answer: You will see that the "unread" status of the message changes, if they're the first to read the message.
Apart from that you cannot really tell if they read the messages or not.


Any work around to show TextArea under bigobject

Question: I am able to create and hold records in big object. Here's my issue with bigobject fields, I am able to insert the data with LongTextArea/TextArea fields, but I am unable to query the field. And even Salesforce is not showing up LongTextArea field while querying from workbench as Salesforce is not supporting LongTextArea. Is there any workaround to store and get the field info?
Answer: You should be able to query the data (by query I hope you mean include that field in the select clause) including longtextarea fields. However you cannot use those fields to filter records or including in group by, or sort them.
The reason why that field is not showing up in Workbench or Salesforce may be the user you used doesn't have access to that field. Check field security.
Comment: Thank you for reminding field security, I am not sure that might be the cause but will try in that way.
Answer: Finally I am able to figure it out, everything is in permission set file. Adding LongTextArea field to the permission set file is mandatory to get/query the field.


Getting jQuery to work with Netscape 7 and 8

Question: Netscape fails to read a lot of jQuery written. What steps do you take to overcome these, and how much of the market do netscape users take up?
Comment: Do you have any data which indicates that your site audience uses Netscape 7 & 8? If not, don't bother with those two.
Answer: Steps I would take:

Let it fail
Wait for Netscape users to notice they are using a long dead browser with security holes in it

The market share for Netscape is as close to zero as makes no matter.
Answer: Umm, 0%?
Having said that, I have to admit that jquery fails on a lot of sites while prototype works, in my ancient Konqueror 3.5.10, so maybe there's a pattern here.
Answer: Although I grew up on Netscape ;-) ...its no longer maintained (R.I.P)
Thus as much as I'm all for the "support all browsers" mantra - supporting users of a now "dead" technology seems like a tall task.
IIRC, the jQuery support matrix is based on supporting the latest supported major version of a major browser (and 1 level previous). Netscape 7 and 8 are both excluded from this list.
I would suggest a simple "Please Upgrade" notice for the site... and since the users are on Netscape, Firefox would be a very compatible path to upgrade on since the concepts and layout are very similar (e.g. bookmarks, context menu options, etc.)
Thus providing a Download link for Firefox 3 would provide users a smooth guided path to upgrade.
Maybe just a simple iframe with this would work well.


Need to know what kind of issue is this?

Question: It is tough to select the date of birth from the calendar. Change the calendar format so that it should be easy to choose the year. It should be user friendly,  what kind of issue is this? UI or Functional or Non Functional
Comment: As Niels mentioned this could be an UX issue or more so an usability issue.
Answer: So what you are saying is that it is functionally working and the problem is that it unhandy to use. This would be a UX issue.

User experience design (UX, UXD, UED or XD) is the process of
  enhancing user satisfaction with a product by improving the usability,
  accessibility, and pleasure provided in the interaction with the
  product.
Answer: Non-Functional testing includes:

Baseline testing
Compliance testing
Documentation testing
Endurance testing
Load testing
Localization testing and Internationalization testing
Performance testing
Recovery testing
Resilience testing
Security testing
Scalability testing
Stress testing
Usability testing
Volume testing


What is access concentration?

Question: When sit for the meditation ears were blocked. Just like sink into the water. But sounds were heard.  With the time it's  heard in less intensity. Is that access concentration? Before  this developed experience the momentary  nature  of the in breath and out breath. As well as the momentary nature  of consciousness along with that withe the break of the in breath and outbreath.
Comment: One of the defining attributes of access concentration is dissociation with thoughts. Thoughts may be there, but one is not caught inside them.
Comment: While  walking  suddenly thought disappear and noticed of foot steps appeared . After that sitting  meditation thoughts disappear. Thoughts removed and cool and peacefulness of mind appear.
Comment: Sounds to me like you're making great progress! :-)
Comment: Thank you. Is it permanent?
Comment: Remember the entire of this clip https://www.youtube.com/watch?v=cOqZ43MKSqg and  https://medium.com/capoeirawellness/instructions-on-anapanasati-meditation-for-beginners-38db38787fe3 Then you will understand the only way is getting mind's focus back to breath in and out. Don't be bored, don't desire to the resultant, just be happy and relax to watch on breath.
Comment: Is it permanent? I try not to answer questions like that, because they arise from longing. At best, one might say there is an abiding that knows no time or causality.
Answer: Obviously the surefire way is to consult a qualified meditation teacher. For the mean time, you could read more about access concentraion from Ven. Bodhi's "Eightfold Noble Path":

When the learning sign appears, the meditator leaves off the preliminary sign and fixes his attention on the new object. In due time still another object will emerge out of the learning sign. This object, called the "counterpart sign" (patibhaga-nimitta), is a purified mental image many times brighter and clearer than the learning sign. The learning sign is compared to the moon seen behind a cloud, the counterpart sign to the moon freed from the cloud. Simultaneously with the appearance of the counterpart sign, the five absorption factors suppress the five hindrances, and the mind enters the stage of concentration called upacara-samadhi, "access concentration." Here, in access concentration, the mind is drawing close to absorption. It has entered the "neighbourhood" (a possible meaning of upacara) of absorption, but more work is still needed for it to become fully immersed in the object, the defining mark of absorption.

With further practice the factors of concentration gain in strength and bring the mind to absorption (appana-samadhi). Like access concentration, absorption takes the counterpart sign as object. The two stages of concentration are differentiated neither by the absence of the hindrances nor by the counterpart sign as object; these are common to both. What differentiates them is the strength of the jhana factors. In access concentration the jhana factors are present, but they lack strength and steadiness. Thus the mind in this stage is compared to a child who has just learned to walk: he takes a few steps, falls down, gets up, walks some more, and again falls down. But the mind in absorption is like a man who wants to walk: he just gets up and walks straight ahead without hesitation.
Answer: Pāmojja, joy out of letting go, surrender (Saddha, Sila), is what marks the entrance of the path.

What is access concentration?


Effect or Affect

Question: I can NEVER teel if it should be effect or affect. What are some ways that help you understand the differance?
Answer: First, they're both stressed on the second syllable, so the A or E is pronounced shwa (/ə/), regardless.
I.e, both words are pronounced /ə'fɛkt/.
Second, the word /ə'fɛkt/ that is a verb is spelled with A, while the one that is a noun is spelled with E. It is not a surprise that they are so similar, since they are related in meaning. What's unusual is spelling them differently this way.

This depression will affect my investments.
This depression will have an effect on my investments.

In (1), affect is a verb; in (2), effect is a noun, part of the idiom have ___ effect on,
which means the same thing as affect.
Third, there are also two other -- rare, and normally idiomatic -- uses of the spellings affect and effect,
but they're easy to distinguish from the normal ones described above.
One, the noun affect, is stressed on the first syllable, so that the vowel is not reduced to shwa, but rather fully pronounced: /'æafɛkt/. It also has a very restricted meaning, as a clinical technical term for display of emotion.

He has very low affect; pay attention or you might miss something important.

The other use, the verb effect, usually has a secondary stress on the first syllable, so that the vowel is often if not always /i/, and not shwa. In meaning, it also has a limited distribution, being always transitive, and used mainly in the idioms effect an escape, effect a solution, and the like. It's archaic and somewhat formal, the sort of thing that shows up in 19th-century newspapers and court proceedings.

The burglar effected his escape by means of the bathroom window.

Nowadays we would use the verb escape instead of having to use effect or something similar.

Effect or Affect


Difference between Song and Qawwali?

Question: Yesterday in lecture my teacher asked me to tell me the difference between Song and Qawwali and don't have any answer and he said me to tell me the difference b/w them tomorrow.Please tell me the real difference b/w these  two.
Thanks
Comment: Please, tell us more... What was the context of this question? What did you find in your research?
Answer: Qawwali is a specific style of music that arises out of the mystical Sufi tradition of Islam.  Perhaps the most internationally famous Qawwali singer was Nusrat Fateh Ali Khan of Pakistan.
I strongly suspect that the distinction your teacher is expecting to hear is that Qawwali has a deeper spiritual dimension --both in terms of the (typical, but not universal) religious meaning in the lyrics, and due to the hypnotic quality of the chanting.  A song is just a song, but Qawwali is a spiritual discipline.
Answer: Qawwali (कव्वाली) and songs are quite similar.
Qawaali however is more often sung live before audiance and less often appears in cinema. Though music is present in Qawaali but its mostly supporting, music of Qawaali is not primary. Qawaali  is supposed to contain couplets called sher(शेर). I do not agree with other answer about Qawaali having any deep spiritual meaning. Most often, Qawaalis have romantic meaning. However, Qawaalis are always supposed to be meaningful (romantic or otherwise). Audience that goes to listen to Qawaali program expects some meaning.
Also, pace of Qawaali can be really slow.  Many Indian or Pakistani Qawaali have been brought in mainstream cinema as proper songs. Those songs can no more be called Qawaali becuase they are faster and have better music than is generally available at a Qawaali stage programme.

Difference between Song and Qawwali?


Where should I start with a facebook application?

Question: I am thinking about developing a fairly simple facebook application which i have modelled the database in access.
I have web space and mySQL databases available, but I was wondering if anyone could point me towards any guides for facebook development? I had a search a while back, but they all seemed rather out of date. Anyone know where I should start with this?
I don't want to really share exactly what my idea is, but its a rating system for a particular set of products.
I haven't done much PHP before, only edited my wordpress template, and I do know enough SQL I hope.
Comment: Do u need to integrate ur application with facebook platform?
Comment: I havent yet designed the application, only come up with the idea and the database for it. I believe I need to lean PHP, I was just looking for any half decent guides. I trust stack overflow people better than google
Answer: Use the following links to create and configure ur application on facebook:
http://www.facebook.com/developers/
and the following links will help u to integrate with facebook platform i have an application on facebook developer platform and the following links helped me to integrate and use facebook API:
http://wiki.developers.facebook.com/index.php/API
http://wiki.developers.facebook.com/index.php/C
http://devtacular.com/articles/bkonrad/how-to-use-the-facebook-developer-toolkit-20/
Comment: sadly i dont know C#, however I do know java.
I may design an admin like interface for myself which interacts with my application.
Answer: You might find some good resources to start with here : Good resources on Facebook programming
Answer: I would highly recommend you buy...
http://pragprog.com/titles/mmfacer/developing-facebook-platform-applications-with-rails
No need to go through a bunch of small tutorials when you can find out just about all you can do through this book.  It seems to be lacking on building a facebook app with an iframe though.


Do my oil and ore industries produce anything after resources are depleted?

Question: I've set up a district with specialized industry (oil or ore) over an area with that natural resource. Buildings pop up, things work, and eventually the resource is depleted (as seen on the Natural Resources view). The buildings stay up, however, and appear to continue working. Will the buildings continue to work indefinitely, or do I need to eventually set the district back to generic industry?
Answer: Yes, they still work, but they need to import resources.
When you place specialized industry on their respective resources, they will create a mix of raw material producing factories and raw material consuming factories. The proximity means that the transport of goods between them is a very small issue. The consumers will supply goods to your generic industry so they don't need to import from off-map.
When the resources are depleted, or when you place specialized industry in an area without natural resources, then all the producers will be replaced with consumers. Now they need to import raw materials from off-map. This will create more cargo traffic at your highway ramps and cargo terminals (train, ship, airport). When you have a good road network, then this might not be an issue. But if the industrial zone is not that well connected, then it might lead to traffic problems.
When you can handle the traffic, then you might want to consider keeping the specialized industry, because it still creates more tax money than level 1 generic industry. But on the other hand, specialized industry can't upgrade. So if the area happens to meet the service coverage requirements for level 3 generic industry, then you might want to consider replacing.
When you can't solve the traffic issue, get rid of the industrial zone. Generic industry isn't a solution, because they too will need to import.
Comment: Parklife adds level up for specialized industry, so with that expansion does the advice change to keeping the specialized industry indefinitely (assuming traffic is managed)?
Comment: @mmathis No Idea. I don't own that DLC.
Answer: What do they produce? Traffic. Lots of traffic.
When the ore/oil is depleted, the industries will import those raw materials instead.  You can see this on the "Outside Connections" info view.
This creates a great deal of additional traffic.  In fact, the Cities: Skylines official Wiki warns of this:

This can be quite a shock for your transportation system and supply chain, as a zone which previously supplied raw material will transform into one that needs to import it.

Two city or zone Policies will greatly exacerbate the situation:

Industrial Space Planning - doubling product output.
Industry 4.0 (now in base game) - increasing product output by 50% (and demanding high education workforce)

These two policies also increase raw material imports by same amount.
I had a large area (about 1/3 of a tile) that I kept as an ore zone long after the ore ran out. It was running both policies.  It created tremendous traffic issues in the zone, strained freeways between the zone and all outside connections, and created long queues at the two nearest rail freight depots**.
Turn off specialty industry when that happens
The general advice is to shut down the specialty industries after the ore or oil runs out.  They remain at level 1*, so there is no great loss getting rid of them.
Official advice is to remove the specialization from the zone.
My own preference is to keep an eye on the Natural Resources info view, and "de-zone" little squares within the district once their resource is depleted (i.e. change the amber squares into clear).  I didn't zone the entire district to begin with, so at that point I zone another part of the district amber (industrial) and let it be mined.
I've never been in a rush, so I just wait for the entire zone to be depleted and then remove its specialization. By the time the last parts of the zone are depleted, the ground pollution is gone from the first parts, and residences and businesses can be zoned.
However, you could also shrink the district to exclude the depleted areas, and then zone them for industry again; that would bring general industry.

* To be more precise, they only have one level; it might be level 3 but they start at it, so what's the difference?  I thought I saw something about a DLC changing that and allowing them to level... but I can't find it again. Park Life?  Industries?
**  The queues at the freight depots ran smoothly because I installed a 0.5 km zig-zag road for them to queue in; it would've been a disaster if they queued on city streets.


Method of moments using just the moments?

Question: FindDistributionParameters (and EstimatedDistribution) can use "MethodOfMoments" as its ParameterEstimator, but as far as I can tell it still requires you to give it the full observed data as its first argument. If I have the moments, but not the full data, is there any way to just pass the observed moments directly to FindDistributionParameters? Or do I have to write down the system of equations for the moments myself and then use FindRoot?
Comment: You will have to do this yourself but depending on the distribution it shouldn't be difficult. If you need help with a particular example you can always add it to your question.
Comment: Or -- a somewhat roundabout approach -- you could generate lots of data using the parameters you have and then use `FindDistributedParameters` on the data you have generated.
Comment: @bills however if the moments they have are the parameters they wouldn't need to estimate. I think they have a situation where the parameters of interest are some function of the moments
Comment: @AndyRoss That's correct in my case -- if I knew how to generate the data I'd be done! It was just a bit annoying to write it myself, because writing the moments in terms of the parameters involved special functions, and I had to play with the form a bit to avoid over/underflows. I guess that means that I probably wouldn't have been able to use the default `ParameterEstimator` in any case though.
Answer: There is an add-on for Mathematica, called MathStatica, which does exactly what you want, if I understood you right.
Find an example on www.mathstatica.com/examples and click on the left side on the item "Person Fitting."
Ths is an excellent add-on which fits seamless into mma and extends its statistical capabilities.
Best regards
Volker
Comment: I was looking for something that would try to fit an arbitrary parametric form with an arbitrary number of free parameters (matching the number of moments).


Lagrangian gauge theory with physically observable local degrees of freedom

Question: In my answer at What, in simplest terms, is gauge invariance?, I mentioned that in certain contexts there can be a "gauge theory" with a local symmetry that leave the
Lagrangian/Hamiltonian invariant and whose degrees of freedom are physically observable.  My follow-up got very long, so I decided to address the Lagrangian and Hamiltonian cases separately.  Here are my thoughts on the Lagrangian case - anyone else is of course welcome to contribute their own.  The case of lattice gauge Hamiltonian is addressed at Hamiltonian lattice gauge theory with physically observable local degrees of freedom.
Comment: @ACuriousMind From Wikipedia: "a gauge theory is a type of field theory in which the Lagrangian is invariant under a continuous group of local transformations ... Two such mathematical configurations are equivalent (describe the same physical situation) if they are related by a transformation of this abstract coordinate basis"
Comment: So you mean a gauge degree of freedom, but not a Lagrangian symmetry?
Comment: @BobBee Possibly an (emergent) symmetry of an effective Lagrangian.  See my answer for the precise statement of the question :-)
Comment: Can you give a reference for "A gauge theory is usually defined as containing d.o.f. that are both local and physically unobservables"? E.g. in *"Quantization of gauge systems"* by Henneaux/Teitelboim, a gauge theory is defined by the Legendre transformation being non-invertible, which reflects in a local symmetry of the Lagrangian and constraints in the Hamiltonian theory. For "nice" systems, this is a bijection - every local symmetry belongs to a Hamiltonian constraint and vice versa. Essentially, the definition of a "gauge theory" is then a constrained Hamiltonian system that is "nice".
Comment: Furthermore, on the mathematical side, "gauge theory" is much narrower and takes only those systems that are described by a global gauge group and the prinicipal bundle formalism, which also encompasses almost all applications of "gauge theory" in physics that I know.
Answer: (In my experience this tends to be a rather controversial subject, so I think this answer might start some arguments!)
First of all, given a specific action, it is a purely mathematical result whether or not there exists a local transformation that depends on an arbitrary smooth function $\lambda(x)$ on spacetime and leaves the action invariant.  The equations don't know whether these "gauge degrees of freedom" $\lambda(x)$ are "physically observable" or not.  But the existence of such a local freedom leads to nontrivial mathematical results, which hold whether or not the local degrees of freedom are observable.  The hard part is assigning the right physical interpretation to those degrees of freedom.
The precise mathematical consequence of a local symmetry is simply that the gauge degrees of freedom are completely decoupled from the gauge-invariant degrees of freedom.  The point isn't that these degrees of freedom are never physical; it's that if you only care about gauge-invariant quantities, then you can get away with completely ignoring the gauge degrees of freedom by working in whichever gauge you want, and you know that whatever choice you make won't affect your results for gauge-invariant quantities.
There may be certain sets of local degrees of freedom that are physically measurable in some situations, but not in others.  For example, let's say you discovered a new fundamental scalar field $\varphi(x)$ that coupled directly to the electromagnetic gauge field via a coupling $g\, \varphi\, A_\mu A^\mu$ and therefore explicitly broke the electromagnetic $U(1)$ gauge symmetry.  (I'll assume all the fields are classical for now - things get really subtle once you start considering gauge quantum field theories.)  You could then use this field as a probe that could directly measure the value of the gauge field $A_\mu$ itself, which would therefore become physically observable.  What physical implications would this have?
Well, the most direct physical consequence of gauge symmetry is the conservation of the current to which the gauge field couples linearly.  If we consider the modified Maxwell Lagrangian $$\mathcal{L} = -\frac{1}{4} F_{\mu \nu} F^{\mu \nu} + A_\mu J^\mu - g \varphi\, A_\mu A^\mu,$$ then the Euler-Lagrange equation becomes $$ \partial_\nu F^{\mu \nu} = J^\mu - 2g \varphi A^\mu$$ (which is manifestly no longer gauge-symmetric) and $$ \partial_\mu \partial_\nu F^{\mu \nu} = 0 = \partial_\mu J^\mu - 2g \partial_\mu (\varphi A^\mu) \implies \partial_\mu J^\mu = 2g \partial_\mu (\varphi A^\mu),$$ and indeed we see that electric charge is no longer conserved in general.
But here's the key point: in a region of space where the gauge-symmetry-breaking field $\varphi(x) \equiv 0$, charge is still conserved, even if $\varphi(x) \neq 0$ somewhere else.  In this hypothetical, $A_\mu$ is a physically measurable quantity, because there exists a $\varphi$ field that "measures" it.  So even if there's some region of space that happens to not have any $\varphi$ field in it, then the $A_\mu$ field still a unique configuration in that region.  But gauge symmetry is effectively restored in that region, because you aren't measuring $A_\mu$ even though you could.  (This is kind of like how particles only have mass in regions of spacetime where the Higgs field's $U(1)$ symmetry is spontaneously broken.)  We've demonstrated the sensible result that the gauge symmetry's enforcement of charge conservation is "robust," in the sense that the violation of charge conservation is proportional to the violation of the gauge symmetry - so if we discovered tomorrow that the photon actually had a mass of $10^{-10}$ eV, it's not like all of a sudden charges would suddenly start appearing and disappearing out of nowhere.  This is why in condensed-matter systems with emergent gauge symmetries that only hold approximately and at low temperature, the gauge symmetry is still useful even though it isn't exact - there are gauge-symmetry-breaking fields, but their effects are small.
To make this even more concrete, let's imagine you build a magic "$A_\mu$-meter" which shines a beam of $\varphi$ field on any system, and you use it to directly measure $A_\mu$.  You would find that when you're pointing the beam toward a system, charge will not be conserved in that system (i.e. charge could appear or disappear).  But as soon as you turn the beam off, charge suddenly becomes conserved!  It's as though the beam were adding or subtracting charge from the system, even though $\varphi$ and $J_\mu$ are not coupled directly, but only indirectly via $A_\mu$'s gauge degrees of freedom.
Taking this idea further, if an entire Lagrangian describing a system has a gauge symmetry, than that means that the gauge degrees of freedom cannot be detected within the system described by that Lagrangian, by a detector also within that system.  So when you have a condensed-matter system with an emergent gauge symmetry that isn't a true symmetry of the Standard Model, that system can't "see" the gauge degrees of freedom within itself, but only the gauge-invariant ones.  But we "outsiders" know that those gauge degrees of freedom still have unique physical values, and could use an external probe to measure them.  Or put another way, there could well be fields beyond the Standard Model that couple directly to the electromagnetic gauge degrees of freedom and can therefore directly measure the $A_\mu$ field - but as long as those fields aren't also coupled to us, and don't substantially affect the dynamics of the gauge-invariant degrees of freedom (the $F_{\mu \nu}$ tensor), we have no way of detecting their existence.
Comment: Sorry, it feels like you are really twisting things around, but I'll have to think about it more. Still, it seems you posit an external field that interacts with your gauge field and breaks the gauge symmetry, there is then no mystery why that gauge symmetry is not one any more, and you can measure its other degrees of freedom. Maybe that makes sense in some approximation in condensed matter, since one is always having to add another layer to the approximation, not sure how it enters in QFT, again unless you discover that new field.
Comment: I've understood it better as effective QFT. I don't doubt there will be other physics at higher energies, so if you mean that at those higher energies some gauge symmetries could break, ok. But I've understood at at the higher energies more than likely some additional symmetries emerge, or maybe they mean others get absorbed. For electroweak, U(1) survived. Is there a pubLished reputable paper, not in condensed matter, that has your points, within a plausible model? And I don't mean string theory. Edited: I'll look at your reference. Yes, hopefully this will cause controversy.
Comment: @BobBee It could go either way - at low temperatures, symmetries can break, but they can also emerge.  Also, I hope that you meant "a published reputable paper, not in condensed matter" as two separate conditions, not two phrasings of the same condition ... :)
Comment: @BobBee Point taken, but even the Standard Model is probably just "another layer to the approximation."  There are many theories suggesting that the SM gauge symmetries are only approximate and are broken at the Planck scale (or lower).  The way of thinking explained above gives you a systematic way of thinking about how these  possible effects would look at different scales.  http://arxiv.org/abs/cond-mat/0404617
Comment: Yes. I have no problem with what I called solid state. Just prefer to see in this context the QFT/high energy physics relation


Why does the United States call Japan an ally?

Question: From @PacificCommand

Secretary Tillerson met with two key strategic allies - #Australia and #Japan - for trilateral strategic talks.

Japan has been largely pacifist since WWII. During Gulf War I, Japan's contribution mainly consisted of financial support, and for Gulf War II, Japan send some unarmed soldiers that Australian soldiers had to protect.
It also hosts US military bases, and pays some of the cost involved, but I assume the stated purpose of those bases are to protect Japan. And Japan and the US espouse similar values (capitalism, rule of law, and democracy), but I'm not aware of those things making two countries allies.
Why does the US government call Japan an ally, let alone a "key strategic ally"?
Comment: Because "ally" has more definitions than "somebody who'll fight at my side".
Comment: The US and Japan are formally allied through the Treaty of Mutual Cooperation and Security between the United States and Japan. https://en.wikipedia.org/wiki/Treaty_of_Mutual_Cooperation_and_Security_between_the_United_States_and_Japan
Comment: Also Japan **mustn't** act aggressively. That was part of what was imposed on Japan's constitution after WWII. They are prohibited from having any standing offensive forces. While they do have some though nowadays (well most forces can be used defensively and offensively, duh), they are part of the self defense army and are only to be used defensively... Thus Japan can only act with military forces once they are attacked - or they violate their own constitution.
Comment: Those Japanese bases were quite important during the Korean War, and, I assume, during the Vietnam War.
Comment: @ThomasAndrews and the Cold War.  The Sovs would have **loved** to have taken over the whole of the Far East.
Comment: @Adwaenyth [Related question regarding Japan potentially defending allies](https://politics.stackexchange.com/a/23629/14378)
Answer: Japan and Australia are both MNNAs (major non-NATO ally)
Japan allows the US to have large bases on its territory, that alone makes it a major ally. The ability to station troops, aircraft and harbour battleships in Japan is of strategic importance in the American policy of military superiority in the Pacific. To allow a foreign power to station its military in your own country is about the closest two countries can be allied. This is much more significant the merely fighting on the same side in a war.
Japan and the US engage in intelligence sharing, joint training, share technological know-how.
Comment: Reminder to commenters to focus on the question. The general question of Japan/US relations can be discussed in chat.
Answer: Short version...
After WWII, three important things happened:

Japan's military forces were disbanded
A revised Japanese Constitution was drafted which included Article 9, forbidding the establishment of a military body for the purpose of waging war on another country.
As part of the post-war rebuilding, Japan became an occupied territory under the control of the USA.

The third item is particularly interesting, not only did US forces occupy Japan, they carried out a systematic rebuilding and revitalising process, helping the country recover from the war and end up coming out at the end in a strong condition.  Since item 1 meant Japan (like the other Axis powers) had no capacity to defend itself, the victorious states agreed to protect them from aggression.  Thus the US-Japan relationship became very strong over time, it's probably one of the better examples of two bitter enemies setting aside their past and working together for a better future.
It's not exactly fair to suggest Japan is defenceless though, as pacifism suggests.  Article 9 is generally interpreted that Japan is forbidden from initiating a conflict, but it is allowed to engage in self-defence.  To that end Japan does have a military body, the mentioned JSDF, which is actually quite capable and has strong backing from the US throughout its development.
Your mention of Gulf War II is a little off base.  They weren't unarmed, but rather given instructions to only open fire if fired upon.  Additionally, their protection was partially provided by the US trained Japanese Special Forces.  There presence was for reconstruction purposes, so they didn't really have much need to engage in offensive action.
Of the countries in the Pacific and East Asian theatre, Japan and South Korea are the two with the strongest ties to the US government.  Since South Korea is a terrible place to build a peace keeping force, Japan is the obvious choice for a primary ally in the area.  Particularly since the mutual defence treaties are still in place, giving NATO permission to violently oppose any military actions by NK, Russia or China that are considered to be a declaration of war against Japan.
Comment: Hm, I think the mutual defense treaty is purely between the US and Japan. Japan and Australia have been working on their own mutual defense treaty but as far as I know there is not one involving Japan and NATO (or even, individually, other NATO members).
Answer: Some data on United States and Japan cooperation.

The United States is Japan's largest largest economic partner while Japan is the US's 4th largest trading partner, with trade totalling an estimated $270.7 billion in 2016.
The number of US troops based in Japan is more than in any other foreign country, an estimated 54,000 troops is stationed in the country, part of the United States Pacific Command.

One of the reason is that it's stated that Japan is not allowed to form a conventional military, after their defeat in WWII. Rather, the US promises to defend Japan, thus the large number of troops. However, it's still worth noting that Japan has an equivalent of a military, called the Japan Self-Defense Forces, which is essentially their de facto military force.
Japan is also the cornerstone of the US's security interests in Asia.

The United States, too, was well-served by the alliance. America needed a strong Japan as a regional partner, where it served as an anchor on the far side of the Pacific and a gateway to Asia. Washington was able to station large air and naval forces off the coast of Asia where they were invulnerable to ground attack, and use them to fight communism on the mainland.(emphasis mine) — The Alantic

Some other areas of cooperation (from the Fact Sheet by the US State Dept.):

development assistance
global health
environmental and resource protection
women's empowerment
science and technology

brain science
aging
infectious disease
personalized medicine
international space exploration

people-to-people

education
science

Thus, both countries cooperate on a wide range of issues, thus Japan's considered a key strategic ally to the US.
Comment: Was the The Atlantic article this one? https://www.theatlantic.com/international/archive/2012/09/japan-and-the-us-its-time-to-rethink-your-relationship/262916/
Comment: @AndrewGrimm Yea, it describes the past US-Japan relationship and to some extent, it's still true today.
Answer: The general co-operation between the United States and Japan is covered well in the other answers.
However regarding a "largely pacifist" Japan, this view seems to stem primarily from Article 9 of the Japanese Constitution in which:

the state formally renounces the sovereign right of belligerency and
  aims at an international peace based on justice and order.

However, it's worth noting that Article 9 was amended (somewhat controversially) in July 2014 by Article 96 in which:

the Japanese government approved a reinterpretation which gave more powers to the Japan Self-Defense Forces, allowing them to defend other allies in case of war being declared upon them, despite concerns and disapproval from mainland China and South Korea, whereas the United States supported the move

This would seemingly allow Japan to join war defensive wars the US is involved in, perhaps adjusting the prevailing "largely pacifist" view of Japan.
Answer: I guess the fact that they stand on the same side when it comes to global (and some regional) political en military matters makes them allies.
In the current time frame I guess the most obvious matter would be that they both are opposed to North-Korea's nuclear programme.
Apart from that, I would guess the bases in Japan are not only for the protection of Japan, but they serve a strategic purpose for the defence of the US as well, in the same way Her Majesty's Navy built a base on the island of Saint Helena - that surely wasn't done to protect the island (a barren, uninhabited piece of vulcanic rock at the time, in the middle of the Atlantic Ocean).
Apart from that, after the "you're either with us, or against us"-rhetoric, I guess you are either an ally or an enemy of the US. And I don't think the US wants to make an enemy out of one of the more powerful industrialised nations on earth, especially when they are providing them with a strategic foothold on the Asian continent.
Comment: @ceejayoz I am sure there is some middle ground between being an ally or an enemy, but I am not convinced that membership of the NAM is relevant to that middle ground. In the last decade, the NAM was presided over by the leaders of Cuba, Egypt, Iran and currently Venezuela. At least three of those countries are not on the current US ally list. Two face threats of (increased) sanctions and one even was threatened very recently with military invasion by the US. I never said I agreed with the "you're with us or against us"-rhetoric, but such words have consequences.
Comment: "I guess you are either an ally or an enemy of the US." That's simply not true. There are 121 members of the [Non-Aligned Movement](https://en.wikipedia.org/wiki/Non-Aligned_Movement).


Why a Stumah Break Between Coveting Another's Wife and Other Possessions, if they are the Same Commandment?

Question: In the Jewish way of numbering the 10 commandments, all the "do not covets" are part of the same commandment (that is, the 10th commandment.) However, in the text there is a stuma break between coveting another's wife and coveting another's possessions. This would seem to suggest they are separate in some ways. Have rabbinical commentaries said anything about why the stuma break is there? Or about why we number it the way we do despite the stuma break?
Comment: +1 Great catch. Maybe because a wife is  ***NOT***  like other possessions?
Comment: Your first sentence is simply incorrect. There are different ways of numbering the 10, and you've just discovered another.
Comment: DoubleAA, can you provide examples of alternate numberings? I've never come across any...in Judaism at least.
Answer: This is a concern specifically in the version of the Aseret HaDibrot in Devarim 5 (Parshat Vaetchanan), and not in the version found in Shemot 20 (Parshat Yitro).
In Yitro, there is no break between the different sections of 'Do not covet'.  There is also no parsha break between "I am the Lord your G-d..." (verse 2) and "You shall have no other gods" (verse 3-6).  Otherwise there are parsha breaks between each of of the 'dibrot', including those found in a single verse (verse 13).  So here there are only 9 parshiot and a desire for 10 Dibrot.
In Vaetchanan, there is a stuma break within verse 18, as you note.  The parsha breaks are otherwise the same, in that "I am the Lord" and "You shall have no other" are in a single parsha.  This creates 10 parshiot and 10 Dibrot.  These line up with what I think of as the Christian ordering, though there may be Jewish sources that count this way, where the first commandment/dibra includes both "I am the Lord..." and "You shall have no other...", the Ninth is not to covet a wife and the 10th not to covet other things.  The other dibrot are not disputed that I am aware of beyond the count changing if "You shall have no other" is the second or part of the first.
Counting this way fits the Devarim section better in that it fits with parsha breaks.  However, it creates problems in the Shemot text as then Shemot (seemingly the primary place for mentioning the Aseret HaDibrot) mixes not coveting wives into the middle of not coveting possessions.  It also creates a problem with the derivation late in Makkot that there are 613 mitzvot.  That relies on there being 2 mitzvot in the section that was taught directly by G-d, and that section is presumably where G-d speaks in first person  rather than in third person.  That shift occurs between "You shall have no other G-d's before Me..."   and "Do not take the Lord's name in vain".  One could claim even if it is one dibra that it contains two mitzvot, just as there are mitzvah counters who do not count Anochi as a mitzvah even though they do count it as a dibra.
Comment: The existence of this section break was an old dispute, but for hundreds of years it's been accepted to include it, and that is indeed born out by the best evidence of the oldest manuscripts available
Comment: Though in this case, it seems sefaria has just taken a poor reading of the Leningrad Codex from Westminster. There's clearly an intended parsha break in the original https://upload.wikimedia.org/wikipedia/commons/thumb/5/5c/Leningrad-codex-02-exodus.pdf/page25-1275px-Leningrad-codex-02-exodus.pdf.jpg
Comment: There's a break in Yisro just like in Vaeschanan.  But house and wife are switched.
Comment: @Heshy if there is it doesn't appear on Sefaria, which is where I looked. https://www.sefaria.org/Exodus.20?lang=bi&aliyot=0 It does however appear on Mechon Mamre https://www.mechon-mamre.org/i/t/t0220.htm


Using private vs company devices for development at work

Question: I'm employed at a mobile app development company since 4 months as Android developer. Currently I'm using my two private Android devices for development. Is it common practice that developers use their own hardware devices for development in mobile development companies, or should I ask for company devices?
Comment: **BANG!** your device had malware on it and now several million dollars of company equipment are irrecoverably infected.
Comment: **BANG!** your device is broken. Now what????
Answer: The answer greatly depends upon the legal jurisdiction you live within.
But let's take the easy considerations first.  As brought up in the comments: what happens when your device breaks or your device injects malware into your team's development stream?
So then you need to ask:

Who pays to fix your device?
Who is responsible to replace your device if you turn it into a brick as part of the development activities?
Who detects that your device is running some malware that has managed to adulterate the application you're distributing?  Who is responsible for fixing all of that?
How do you handle all-night load testing when you need to go home and take your phone with you?
Who pays for the data usage on your phone?

BYOD starts looking ugly in cases like those.
But wait, it gets worse.
Your employer is generally expected to provide the resources you need for you to do your job. That help enables their claim to own the work that you produce.
When you use your equipment to develop for both your employer and your own personal projects, how do you draw the line as to what portions of your time were spent on what projects?  It matters because in the absence of detailed time logs, courts rely upon the resources that were used as part of the work.  Using your employer's resources enables your employer to say the development was done on their time and resource.  So they have a cleaner claim to owning the work you create.
But that's just a generality and each significant legal jurisdiction has nuances upon that generality.  So your particular predicament will be answered by local, legal norms.
A strong intellectual property agreement can help with some of those concerns, but the companies that "expect" developers to bring devices generally don't have strong IP agreements in place.
In general, it's a bad idea.
For the company, the potential claims against intellectual property ownership are significant.  For the developer, it's a bad idea - loaded with negatives and providing minimal direct benefits.
Comment: "Your employer is generally expected to provide the resources you need for you to do your job. That help enables their claim to own the work that you produce. " Except ever more companies have clauses in their contracts stating that the employee is required to have certain items like a cellphone and a laptop. The company may reimburse the employee for his use of those for work purposes, but often that's assumed to be part of the salary.
Comment: Usually when you develop for mobile you need to test it on many different phones. I don't believe the employer can require the employee to have several mobile devices?
Answer: I've encountered both scenarios. Previous company I worked we had a number of company devices but people also used their own in addition to that (AFTER the tests on the company devices showed the apps weren't going to cause mayhem, those private devices were mostly used to allow testing on more different screen sizes, OS versions, and hardware configurations).

Current environment I work in testing on personal devices is all but impossible because of access restrictions to the network. For a device to access the network at all it needs special software installed AND needs to be whitelisted at hardware level by the security department, which is just not going to be allowed for devices not owned by the organisation.
At most the user acceptance environment might be accessible for some apps (those that would be accessible to the general public after the system goes life) but that's it.

In general I'd be wary of using my personal devices to test software developed for a customer or employer, especially if I'm not one of the key coders on the project and can be fairly certain the app isn't going to do anything irreversible to my device. And that's before taking any legal problems into account, which are out of my field of expertise but may well exist.


Search for LaTeX in PDF

Question: Is it possible to search for LaTeX characters like \alpha in a PDF file? Perhaps there's some PDF reader that can do that?
Comment: Just search for `α`.  If you want to make equations copyable and searchable in PDF see http://tex.stackexchange.com/a/119718/31416
Comment: @giordano That is a great feature! Are you sure those `ActualText`s are searchable as well? (too lazy to test right now)
Comment: @MHaaZ yes, I tried before posting `;-)`
Answer: It's not quite as comfortable as it could be, but here's how I do it:

Open the Character Map on your system
Copy the symbol you want to search for in the PDF
Do a normal text search (Ctrl+F on most readers) and paste the special symbol

Of course this only works with single symbols and not if you want to search for bigger parts of formulas (for example something like \frac{\alpha}{8 \times d_{k}^{3.17}}. Still, better than nothing...
For me, this works with the PDF Viewer evince to find the small character "α" (\alpha). It works for pretty much every Unicode character you want to look for.

Search for LaTeX in PDF


Making dua in your head

Question: Is it permissible to make dua in one's head? When we're in public for example, we can't speak or whisper our duas. So does it still count if we say it all to ourselves?
Answer: Allah SWT is All-Hearer, All-Knower. Whatever (Halal or Haram) we think in our mind, Allah SWT still hears, knows and listens to us.
Answer: I do it all the time. Your connection to Allah is just mind-blowing!
وَاذْكُرُوا نِعْمَةَ اللَّهِ عَلَيْكُمْ وَمِيثَاقَهُ الَّذِي وَاثَقَكُم بِهِ إِذْ قُلْتُمْ سَمِعْنَا وَأَطَعْنَا وَاتَّقُوا اللَّهَ إِنَّ اللَّهَ عَلِيمٌ بِذَاتِ الصُّدُورِ
And remember the favor of Allah on you and His covenant with which He bound you firmly when you said: We have heard and we obey and be careful of (your duty to) Allah, surely Allah knows what is in the breasts.
Answer: We're expected to live with one foot in this world and the other foot in the other world. This means that we do not have to do dua all the time - far from. What is obligatory is the five daily namaz, and it matters not if one says ones dua aloud or in one's mind as 'Allah is Knowing, Wise'.

Making dua in your head


Why are GPIOs used?

Question: I have been searching around [in vain] for some good links/sources to help understand GPIOs and why they are used in embedded systems. Can anyone please point me to some ?
Comment: What do you want to know that's not covered by the wikipedia page?
Comment: The same embedded processor is used for many different embedded systems - producing a million processors of one type is *far* cheaper than making a hundred thousand each of ten different processors. General-purpose IO pins make it much easier to repurpose for various uses.
Comment: http://electronics.stackexchange.com/questions
Comment: @Anon: Well, for starters, why is it used instead of providing dedicated pins at the microprocessor ?
Answer: In any useful system, the CPU has to have some way to interact with the outside world - be it lights or sounds presented to the user or electrical signals used to communicate with other parts of the system.  A GPIO (general purpose input/output) pin lets you either get input for your program from outside the CPU or to provide output to the user.
Some uses for GPIOs as inputs:

detect button presses
receive interrupt requests from external devices

Some uses for GPIOs as outputs:

blink an LED
sound a buzzer
control power for external devices

A good case for a bidirectional GPIO or a set of GPIOs can be to "bit-bang" a protocol that your SoC doesn't provide natively.  You could roll your own SPI or I2C interface, for example.
Answer: The reason you cannot find an answer is probably because if you know what an embedded system is and does, or indeed anything about digital electronic systems, then the answer is rather too obvious to write down!  That is to say that if you get as far a s actually implementing a working embedded system, you should already know what they are.
GPIO pins are as a minimum, two state digital logic I/O.  In most cases some or all of them may also be interrupt sources.  These interrupts may have options for be rising, falling, dual edge, or level triggering.
On some targets GPIO pins may have configurable output circuitry to allow, for example, external pull-ups to be omitted, or to allow connection to devices that require open-collector outputs, and in some cases even to provide filtering of high frequency noise and glitches.
Answer: In most embedded systems, a processor will be ultimately responsible for sensing the state of various devices which translate external stimuli to digital-level logic voltages (e.g. when a button is pushed, a pin will go low; otherwise it will sit high), and controlling devices which translate logic-level voltages directly into action (e.g. when a pin is high, a light will go on; when low, it will go off).  It used to be that processors did not have general-purpose I/O, but would instead have to use a shared bus communicate with devices that could process I/O requests and set or report the state of the external circuits.  Although this approach was not entirely without advantages (one processor could monitor or control thousands of circuits on a shared bus) it was inconvenient in many real-world applications.
While it is possible for a processor to control any number of inputs and outputs using a four-wire SPI bus or even a two-wire I2C bus, in many cases the number of signals a processor will need to monitor or control is sufficiently small that it's easier to simply include the circuitry to monitor or control some signals directly on the chip itself.  Although dedicated interfacing hardware will frequently have output-only or input-only pins (the person choosing the hardware interface chips will know how many signals need to be monitored, and how many need to be controlled), a particular family of processor may be used in some applications that require e.g. 4 inputs and 28 outputs, and other applications that require 28 inputs and 4 outputs.  Instead of requiring that different parts be used in applications with different balances between inputs and outputs, it's simpler to just have one part with inputs that can be configured as inputs or outputs, as needed.
Answer: I think you have it backwards. GPIO is the default in electronics. It's a pin, a signal, that can be programmed. Everything is made up of these. For a processor, dedicated peripherals are a special case, they're extras for when you know you want a more limited function.
From a chip manufacturers perspective, you often don't know exactly what the user needs so you can't make the exact peripherals on your chip. You make generic ones instead. Many applications are so rare that there's no market for a specific chip. Only thing you can do is use GPIO or make specific hardware yourself. Also, all (unused or potentially unused) pins are worth turning into GPIO because that makes the part even more generic and reusable. Generic and reusable is very nearly the whole point of programmable chips, otherwise you would just make ASICs.
Some particularly suitable applications:

Reset parts (chips) in a system
Interface to switches, keypads, lights (all they have is one pin/signal!)
Controlling loads with relays or semicondctor switches (on-off)

Solenoid, motor, heater, valve...

Get interrupts from single signals

Thermostats, limit switches, level detectors, alarm devices...

BTW, the Parallax Propeller has practically nothing but GPIO pins. Peripherals are made in software. It works very well for many uses.

Why are GPIOs used?


Constant curvature metrics on the sphere

Question: Are there Riemannian metrics other than the standard metric induced from the euclidean space on $S^2$ such that the sectional curvature is equal to 1 everywhere? Or is this the unique Riemannian metric of constant curvature (up to scaling)?
Comment: If $\phi:S^{2} \to S^{2}$ is a diffeomorphism other than a rotation and $g$ is the round metric, then $\phi^{*}g$ is isometric to $g$ (via $\phi$) and therefore has constant curvature $1$, but is distinct from $g$ as a Riemannian metric. However, @mollyerin's answer is "morally" correct, in that if $\lambda$ is real, then _up to isometry_ there is a unique _complete_, simply-connected Riemannian $n$-manifold of constant _sectional_ curvature $\lambda$.
Answer: The standard metric is the only metric of constant sectional curvature $1$ on $S^2$.
More generally, for any positive integer $n$ and any $\lambda \in \mathbb{R}$, there is a unique simply connected Riemannian manifold of dimension $n$ and constant scalar curvature $\lambda$ (which therefore looks like a scaling of either $S^n, \mathbb{R}^n$, or hyperbolic space $H^n$ depending on the sign of $\lambda$).
This is a standard fact in Riemannian geometry, not entirely trivial to prove but not terribly complicated either. Any introductory Riemannian geometry text should have a proof; for instance, it's given as Theorem 4.1 in Chapter 8 of do Carmo and Corollary 10 in section 10.2 of Petersen.
Comment: Thank you very much, i will take look at these!


Do i need Administrator priviliges to run an HTA?

Question: I am trying to install an activex but my user has no admin priviliges.
I saw an artical descirbing that HTA can install activeX as if it is an administrator.
Do i need to be an administrator to run HTA? if not is this not a security loop hole?
Comment: People still use ActiveX? Wow... I feel bad for the users of your site
Answer: An HTA file is an application that has the same privileges as a .EXE or a .CMD file. Many people are confused about permissions because an HTA looks like a web page. An HTA uses the same technology as web pages, but it executes locally under the same security model as any other local application.
This means, that if you run your .HTA as Administrator, it can do things that require Administrator privileges. Ordinary users can run HTAs just fine. The security model is the same as for batch files, CMD files, WSH scripts and so on.


How can I make a li-ion charger using logic gates with auto cut-off facilities?

Question: I'm recently assigned a project to make a battery charger, using logic gates. But I have no idea how to proceed. I'm in need of guidance.
I have basic knowledge but not so deep. So I think I can design it, but I just need a push-up.
Comment: [This is what happens if your charger doesn't work right.](https://m.youtube.com/watch?v=YuKF8XfCVKQ)
Comment: Consider using a commercially available module rather than starting from scratch.
Comment: _"I'm recently assigned a project to make a battery charger, using logic gates."_ - can you provide any more details? eg. the type and number of logic gates available, any other components allowed, battery specifications?
Comment: Any number of logic gates can be used, the charger is mainly for li-ion battery and yes other components are allowed. The project needs to have logic gates. I'm wanting the gates to cut-off the circuit when the battery is charged.
Answer:
I'm recently assigned a project to make a battery charger, using logic gates

Sounds like a mission impossible to me, you simply can't make a Li-Ion battery charger using only logic gates. You can't. period.
To properly and safely charge a Li-Ion battery you need to have a well defined voltage reference available. This is needed to make sure that charging stops when the battery voltage is around 4.1 to 4.3 V.
With only logic gates available there is no way to create or detect such a voltage accurately enough.
Whoever gave you that assignment is either joking or doesn't have a clue.
Comment: Actually I also am willing to make the circuit auto cut-off when it's charged.
Comment: Your comment: a) repeats what is already in your question b) shows that you didn't get the point I make in my answer. I suggest that you get studying and learn: 1) how Li-Ion batteries need to be treated, start at: https://batteryuniversity.com/learn/article/charging_lithium_ion_batteries 2) search for "Li-Ion charging circuits" and figure out how they work and how that relates to 1). Note how the charging circuits are **analog** ciruits. If there is any logic it is for control functions only.