Safety of storing camera resting on lens/resting on back?

Question: I recently bought a Canon EF-S 55-250mm F4-5.6 IS STM for my Canon T7i. This lens is significantly heavier than previous lenses that I've owned and I'm concerned with how I can safely store the camera with this lens on, as I'd prefer not to introduce dust inside the camera taking it on and off all the time. I typically store my camera in its bag on its back (with the fold out screen down, and the lens pointing upward) - will this damage the camera/lens if I store it this way with the heavier lens? Will it damage either even with a lighter lens? The other way it gets stored is just right side up, which causes it to lean forward very slightly and rest on the lens. Is this alright as well?
Comment: How long so you expect to leave the camera in storage?
Comment: I'm talking just for general storage between taking pictures. It tends to get taken out every few days or so.
Answer:
The Canon EF-S 55-250mm f/4-5.6 IS STM is a light-weight lens made mostly of plastic. There should be no harm to your camera from the weight if you store it with the lens facing upwards. However, the LCD may be scratched if you happen to rest it on any grit.
There is risk of scratching the lens if you place it face down in the bag without a lens cap. The lens in question isn't sturdy enough to rest face down on a shelf while attached to a camera. (You can try, but don't be surprised if it falls over.)
Resting the camera with lens attached so that the lens is sideways, at an angle, with the front in contact with a surface, is usually an inefficient use of space. Leaving it that way on a shelf for long periods of time risks distortion to the mount or barrel. This may cause zoom to not work smoothly or other problems.
Consider what happens to cue sticks left leaning against walls. Lenses usually do not have this problem because they are able to stand vertically without support. However, if you leave one at an angle for long enough, I'd expect gravity would win.
Some bags have partitions you can use to store your camera with lens attached.  Whatever position your bag is designed for should be safe for your camera and lens.
Comment: Citation needed on "plastic should be more resistant than metal". I'm pretty skeptical about this as a risk overall — there are many ways in which a lens is not like a pool stick.
Comment: Pool cue sticks are made of organic wood that swells and contracts as it absorbs/releases moisture from the air.  That's why they can be deformed by leaning at angles.
Comment: Metal pipes leaned against walls also become deformed over time.  They do not absorb and release moisture from the air.
Comment: @xiota Metal pipes leaned against walls will become deformed almost instantly if they were not designed to not flex when placed in such a position. That's because they are relatively much longer and much thinner/weaker than the barrels of most camera lenses.
Comment: Please lean your 70-200/2.8 against a wall for a couple years. If it is able to resist the influence of gravity during that time, I will revise this answer appropriately.
Comment: Note: Risk ≠ Likely.
Answer: Your EF-S 55-250mm weighs about twice as much as your EF-S 18-55mm. When compared to most other lenses, it is still a very light lens, and there is NO WAY it will damage your camera. Store it any position you find most convenient.
For me, the most convenient method is lens down in the camera bag. With the bag open I can grab the camera with one hand and be ready to shoot at a moments notice.
Answer: In the overall scheme of Canon's EF lens system, any of the EF-S 55-250mm variants are pretty light. The STM version only weighs about 375 grams, and all of that weight is at less than 120mm from the lens flange when the lens is stored at its shortest length. Your camera only weighs around 532 grams.
The same EF mount is designed to support cameras that weigh up to 1,530 grams (The EOS 1D X and 1D X Mark II) attached to lenses that weigh as much as 4,600 grams (EF 800mm f/5.6 L IS)¹. With lenses that are heavier/exert more force on the mount than the camera body does, we tend to support the lens and the mount supports the weight of the camera.
Storing your camera with the lens attached and the camera resting on its back should not hurt your camera if left in that position for years. Storing it sitting on the camera's floorplate with the lens probably tilted down slightly and resting on a shelf or pad in your bag should also do no damage to your camera or lens for very long periods of time.
Related: Are there any official specifications regarding the torque for camera mounts?
¹ The discontinued EF 1200mm f/5.6 L IS was 16.5 kilograms, or 16,500 grams!


Barut-Zanghi (BZ) Lagrangian derivation

Question: I'm trying to derive the BZ Lagrangian (density) from the Dirac Hamiltonian density and some questions popped up.
BZ Lagrangian is
$$\mathcal{L} = \frac{i}{2}(\dot{\bar{\psi}}\psi - \bar{\psi}\dot{\psi}) + p_\mu(\dot{x}^\mu - \bar{\psi}\gamma^\mu\psi)\tag{1}$$
where the four-potential $A_\mu$ is set to zero for simplicity.
The first question is: how can I derive it? As it can be seen, the first right member is  the time derivative inside the Dirac Lagrangian (which corresponds to the conjugate momenta) and if I set $p_\mu\gamma^\mu = m$, then second member in brackets is the second term of Dirac Lagrangian.
I though that it can be derived from the Legendre transform starting with the Dirac Hamiltonian and the conjugate momenta (that I know) and inserting the other conjugate momenta linked to the dynamical variables $(x_\mu, p_\mu)$, i.e. $p_\mu\dot{x}^\mu$ .
The problem is that there's the divergence term of the Dirac Hamiltonian that doesn't appear. Any advice?
The second question is the following: I saw that the Lagrangian density depends on fields and their derivatives: in this case we have $\psi$,$\bar{\psi}$ as fields and their derivative there aren't. Although, in this case we also have a dependence from the dynamical variables $(x_\mu, p_\mu)$. How can I justify this?
Answer:
The Barut-Zanghi (BZ) Lagrangian
$$\begin{align} L ~=~& \frac{i}{2}(\dot{\bar{\psi}}\psi - \bar{\psi}\dot{\psi}) + p_{\mu}\dot{x}^{\mu} \cr &-(p_{\mu}-qA_{\mu}) \bar{\psi}\gamma^{\mu}\psi, \cr \bar{\psi} ~=~&\psi^{\dagger}\gamma^0 ,\end{align}\tag{1} $$
is a point-mechanical (rather than a field-theoretic) model, i.e. all the variables depend only on time. In contrast the spinor in the Dirac equation is a field.

The BZ Hamiltonian
$$H~=~ (p_{\mu}-qA_{\mu}) \bar{\psi}\gamma^{\mu}\psi\tag{2}$$ is minus the terms without time derivatives in the BZ Lagrangian (1), cf. e.g. the Faddeev-Jackiw method.
Comment: This seems relevant: https://arxiv.org/abs/hep-th/9607212
Comment: Thanks, I wrongly thought that was CFT. Anyways, from where can I start deriving this Lagrangian? Because I'm assuming that only the Dirac Hamiltonian is known.
Comment: Perhaps this is explained/motivated in the original BZ paper?
Comment: Unfortunately it is not explained anywhere

Barut-Zanghi (BZ) Lagrangian derivation


Permission Issues regarding Plugin updates & FTP transfers

Question: I am looking for a little assistance tracking down my permission issues regarding updating plugins from my admin page or transfering files via FTP into the wp-content file.
I have been searching for an answer for a while but nothing seems to be working.
I have tried: sudo chown -R www-data:www-data ~/html/blog/wp-content but it does not work.
My permissions for the wp-content folder are: drwxr-xr-x   5 root root  4096 Jan  1 13:16 wp-content
ps aux | grep apache (1st line): root      8879  0.0  2.2 125064 22916 ?        Ss   Jan01   0:09 /usr/sbin/apache2
ps aux | grep wp-content: pi       25195  0.0  0.0   4380   564 pts/0    S+   22:39   0:00 grep --color=auto
I am thinking that because apache is 'root' and wp-content is 'pi' that might be the problem, but I do not know how to fix it.
Thank you in advance.
Answer: Wordpress needs a proper read - write permission to work. To make sure everythings fine, try this:
Go to you public_html folder and run the commands
chown www-data:www-data  -R *
find . -type d -exec chmod 755 {} \;
find . -type f -exec chmod 644 {} \;

After that, you might wanna tighten your security, read this
That's what works on me, hope it works on you too...


Is there a way to test how many users my website can handle?

Question: I plan on running my website initially on an EC2 micro instance but am wondering if it's possible for me to test how many users it can handle?
Answer: Yes. I've had good success using httperf. Documentation is a little scarce but the email list is fairly responsive.
You'll want to set up httperf to bombard your site with larger and larger amounts of traffic. You'll start seeing error codes, timeouts, and slow reply times as you start to saturate your webserver with traffic.
You'll want to experiment with this or any tool you decide for load-testing your site. Good luck!
Answer:
[Is it] possible for me to test how many users it can handle?

It's called load testing. Do it to find out.
Answer: There is also ab, the Apache HTTP benchmark.
Example call:
ab -n100 -c10 http://localhost:8080/index.jsp


What's the most useful thing to buy from the store first?

Question: I just started playing League of Legends, and accumulated a small pile of IP.  What is the most useful thing to buy from the store first?
Comment: A /24 block perhaps? There's such a shortage of--- oh, right.
Answer: I would recommend you to get tier 1 runes until you get to summoner level 20, then as akaGrim stated, you can get the Tier 3 Runes.
These are general purpose (In the sense that they can fit any champion) tier 1 runes that will aid your way to level 30 and they are very cheap:
3 ×   Lesser Quintessence of Fortitude +14.6 Health  (165IP each - 495IP for the set)

9 ×   Lesser Mark of Insight +0.53 Magic Penetration  (30IP each - 270IP for the set)
or
9 ×   Lesser Mark of Desolation +0.93 Armor Penetration  (30IP each - 270IP for the set)

9 ×   Lesser Seal of Clarity +0.036 mana regen / 5 sec. per level (+0.65 at champion level 18) (15IP each - 135IP for the set)
or
9 ×   Lesser Seal of Vitality +0.72 health per level (+12.96 at champion level 18) (30IP each - 270IP for the set)
or
9 ×  Lesser Seal of Shielding +0.05 magic resist per level (+0.9 at champion level 18) (30IP each - 270IP for the set)
or
A combination of the above mentioned

9 ×  Lesser Glyph of Focus    -0.36% cooldowns (65IP each - 585IP for the set)
or
9 ×   Lesser Glyph of Shielding +0.08 magic resist per level (+1.44 at champion level 18) (15IP each - 135IP for the set)
or
A combination of the above mentioned
A total set of runes will cost you around 1620IP, It is quite a bit but it is worth getting, it makes a difference on early game.
Assuming you will play with a 50/50 win/loose ratio you can get your complete set of tier 1 runes in less than 30 matches.

There are also many recommended champs for beginners which are usually very IP cheap, I am talking about champions like:
 Ashe, very easy to play Attack Damage Carry, 450IP
 Ryze, easy/medium skill Mage, fun to play and very powerful! 450IP
 Nunu, easy/medium skill Ability Power 'Tank' 450IP
There are many other cheap champions in the price range of 450-1350IP, don't hesitate to buy one if you are liking its playstyle, as you may have noticed Riot rotates the free champions every week and you might want to play a champion you liked from the previous free week on the actual.
For more information on runes and recommended champions check:
League of Legends Learning Center: Champions
League of Legends Learning Center: Runes
Comment: Don't believe the snowman runes are available any time other than christmas.
Comment: A very good response, I'd just like to add one thing. The IP costs of champions don't really mean a whole lot. Some of the harder to play champions have a higher cost OR more newly created champions. Regardless on how hard the new champions are to play, most require the top amount of IP (6300 if I remember). Since there are always balance changes some of the 'harder' characters are easier, and vice versa.
Comment: @Raven yup, I corrected the snowman rune! @akaGrim Agreed, thats why the recommended champions are so cheap, to let the newbies get them for cheap IP
Comment: just as an FYI, only the first @ works in any one comment.
Answer: There is no 'right' thing to buy. There are two main things you can spend your IP on, Champions and Runes.
You don't really want to spend your IP on runes before level 20 since there are multiple tiers of runes. Level 20 hasthe best and most expensive versions of the runes you can buy. Spending them earlier is a bit of a waste, and most people are still finding their champion style like the most to begin with. The cost of fully equipping a hero with max runes is about 15k IP. You can buy general purpose runes that can be used on multiple people such as mana regen yellow, armor / magic penatration reds, HP quints, etc.
Do you know what your play style is? That could help me give some ideas of what might be a champion you'd like.
Comment: Combining lower level runes to higher level runes is slightly more cost effective in the long run, but because of the randomness, the likelyhood of getting a decent set that way is minimal.
Answer: As new player I really suggest you to accumulate IPs and do not spend them until you reach level 20. Than you can start build your rune library and buy some champions you liked and fit well with your game style.
Until that level I suggest you to try only "free rotation" champions, maybe concentrate on 2/3 per week, depending also on how much time you can spend playing League of Legends each week.
I prefer to not suggest any runes because this is really subjective and strongly linked to the champion and role you decide to play.


What are some applications which require interval arithmetic?

Question: I have a very basic notion about interval arithmetic (IA), but it seems to be a very  interesting branch of computational science both theoretically and practically. It is clear that the obvious applications are verified computing and ill-posed problems,  but this is too abstract. Since there are a lot of people involved in applied computations here, I'm curious about real world problems which are hard or impossible to solve without IA.
Answer: This answer partly responds to JackPoulson's comment (because it is long), and partly answers the question.
Interval arithmetic is a computational procedure to give rigorous bounds on calculated quantities, only in the sense that the interval extension of a real-valued function over an interval encloses the image of that function over the same interval. Without calculating anything, interval arithmetic cannot give you any insight about what factors influence the numerical error in a calculation, whereas the theorems in Higham's book and others do give you insight into the factors influencing numerical error, at the cost of potentially weak bounds. Granted, the bounds obtained using interval arithmetic may also be weak, due to the so-called dependency problem, but sometimes they are much stronger. For instance, the interval bounds obtained using the integration package COSY Infinity are much tighter than the types of error bounds you would get on numerical integration from the results of Dahlquist (see Hairer, Wanner, and Nørsett for details); these results (I am particularly referring to Theorems 10.2 and 10.6 in Part I) give more insight into sources of error, but the bounds are weak, whereas the bounds using COSY can be  tight. (They use several tricks to mitigate dependency issues.)
I hesitate to use the word "proof" when describing what interval arithmetic does. There are proofs involving interval arithmetic, but calculating results using interval arithmetic with outward rounding is really just a means of bookkeeping to conservatively bound the range of a function. Interval arithmetic calculations are not proofs; they are a way to propagate uncertainty.
As far as applications go, in addition to Stadtherr's work in chemical engineering, interval arithmetic has also been used to calculate bounds for particle beam experiments (see the work of Makino and Berz, linked to the COSY Infinity web site), they've been used in global optimization and chemical engineering design applications (among others) by Barton (the link is to a list of publications), the design of spacecraft and global optimization (among others) by Neumaier (again, the link is to a list of publications), global optimization and nonlinear equation solvers by Kearfott (another list of publications), and for uncertainty quantification (various sources; Barton is one of them).
Finally, a disclaimer: Barton is one of my thesis advisers.
Comment: As far as I know, you can get bounds on eigenvalues or singular values. I'm not sure what interval eigenvectors or singular vectors would mean. The most recent paper I know of in a reputable journal is ["Bounds on Real Eigenvalues and Singular Values of Interval Matrices" by Hladík, Daney, and Tsigaridas](http://hal.inria.fr/docs/00/37/06/03/PDF/RR-xxxx.pdf) in *SIAM J. Matrix. Anal. Appl.* (2010). For solving linear systems, [this book](http://www.amazon.com/Interval-Equations-Encyclopedia-Mathematics-Applications/dp/0521102146/ref=sr_1_1?ie=UTF8&qid=1327611050&sr=8-1) is the best reference.
Comment: Thank you! Any idea how well interval arithmetic fairs for EVD and/or SVD computation? Or Krylov algorithms?
Answer: Interval arithmetic gives you a proof with mathematical rigor.
Good examples of actual applications is the work of Mark Stadtherr and his research group. In particular, phase equilibrium and stability calculations are successfully solved with intervals methods.
A nice collection of benchmarks, with reference to their physical background, is at the ALIAS website.
Comment: Honest question: in what sense is it more rigorous than the type of bounds arising from classical error analysis, e.g., in [Higham's Accuracy and Stability of Numerical Algorithms](http://www.maths.manchester.ac.uk/~higham/asna/)?
Comment: @JackPoulson: I've attempted to answer your comment in my answer, along with providing some references.
Comment: See also *Proving conjectures by use of interval arithmetic* by Andreas Frommer.
Answer: Another feature of interval arithmetic and its generalizations is that it allows adaptive exploration of the domain of a function. It can thus be used for adaptive geometric modeling, processing, and rendering, just to take examples from computer graphics.
Interval methods have featured in some recent proofs of hard mathematical theorems such as the existence of chaos in the Lorenz attractor and the Kepler Conjecture. See http://www.cs.utep.edu/interval-comp/kearfottPopular.pdf for these and other applications.
Comment: That's true; subdivision of intervals yields more accurate results, and this property helps in adaptively exploring the domain of a function.
Comment: @lhf Upvoted! It is a shame I have forgotten about the theorem proofs and Prof. Kearfott's website. Thanks for the reference!
Answer: Interval arithmetics is very useful for geometric algorithms. Such geometric algorithms take as input a set of geometric objects (e.g. a set of points) and construct a combinatorial data structure (e.g. a triangulation) based on spatial relations between the points. These algorithms depend on a small number of functions, called 'predicates', that take as input a fixed number of geometric objects and return a discrete value (typically one of 'above,aligned,below'). Such predicates typically correspond to the sign of a determinant of the point's coordinates.
Using standard floating-point numbers is not sufficient, since it may fail accurately compute the sign of the determinant, and even worse, return incoherent results (i.e., saying that A is above B AND B is above A, thus making the algorithm create a mess instead of a mesh !).
Systematically using multi-precision (such as in the Gnu Multi-Precision library and its MPFR extension to multi-precision floating point numbers) works but causes a significant performance penalty.
When the geometric predicate is the sign of something (as in most cases), using interval arithmetics allows one to do a faster computation, and then only launch the more expansive multi-precision computation if zero is in the interval.
Such an approach is used in several large computational geometry codes (e.g. CGAL).


Superfish Menu Wraps in IE9 and Mac Safari

Question: I have implemented Superfish in a pretty basic custom Wordpress theme. The padding and / or spacing of the top level menu items is off in IE9 and also Mac Safari. I can't figure out what is causing the problem or how to fix it without affecting the browsers where it already renders properly.
Answer: I'd forget about using a menu plugin and use the WP3 menu system. There are no IE issues and no extra JS needed. And it's probably easier to implement than the plugin you're using. Grab the code from twentyten or twentyeleven.
See http://codex.wordpress.org/Function_Reference/wp_nav_menu and http://codex.wordpress.org/WordPress_Menu_User_Guide


How to install skype?

Question: I'm using Ubuntu 12.04, 64 bit. I have tried commands and installing skype directly from the internet, it does not happen.
In laymen's term with detailed description can anyone please help me install Skype on my device?
Comment: Could you please [edit] your question as to describe what exactly you have tried? I.e. what commands you entered etc.
Answer: Download the 12.04 multiarch version from here
then you can both double click on it or execute from the Download folder

sudo dpkg -i skype-ubuntu...

you can just type skype then press tab
Answer: Download Skype for Linux in http://www.skype.com/en/download-skype/skype-for-linux/, choose multiarch, install the deb version (Using sudo dpkg -i skypefile.deb) and after it push it all by using sudo apt-get -f install .
It will install the necessaries programs.
If you failed with multiarch, you can choose the 32 bit and do the same, it will install 32 bit libraries.

How to install skype?


Web Farm Framework - Limited deployment to specific servers

Question: Is it possible when deploying apps using the IIS web farm framework to limit the number of servers the site is deployed on? The use case I am specific looking at is with a multi-tenant load balanced server where specific sites need to be deployed as either not load-balanced, load balanaced on 2 IIS machines, or load balanced on 4 IIS machines. Currently I can't see anyway of customising the replication or by setting parameters when creating the site.
Ideally if this is possible, I'd also like to do so via code or PS.
Answer: I am not aware of this functionality.  However, you can configure all sites on all IIS machines and then use host name affinity to configure how many servers serve each hostname.  See iis.net for the complete walkthrough of this feature of ARR.
Comment: Whilst this may theoretically answer the question, [it would be preferable](http://meta.stackexchange.com/q/8259) to include the essential parts of the answer here, and provide the link for reference.
Comment: @slm thanks for the feedback.  I have fixed the link (posted the wrong one before) and added a little clarification.


Why do we consider a circle as a closed loop while deriving the magnetic field of a infinitely long wire

Question: Why do we consider a circle as a closed loop while deriving the magnetic field of a infinitely long wire. How does it affect if I take another shape.
Comment: Are you asking why we choose a circular (constant radius) path vs an ellipse, or why we choose a closed path?
Comment: @BillN this is not the main question but I have problem in which you mentioned also
Answer: Because of the symmetry of the problem, we know that the magnitude of the magnetic field is dependent only on the distance from the wire (because the wire looks the same from any angle and after any displacement parallel to the wire). Therefore, the magnitude of the magnetic field should be constant along a circle with the wire at its center. This makes the line integral present in Ampere's Law very simple; for a circle of radius $r$,
$$\oint \vec{B}\cdot d\vec{\ell}=2\pi rB$$
Circles are considered closed loops because we are doing a line integral over a one-dimensional path (as opposed to in Gauss's law, in which we do a surface integral over a two-dimensional boundary). Any other shape would still be a perfectly valid choice for Ampere's Law calculations (so long as it formed a closed loop), but in almost every other case, doing the line integral is very difficult without basically knowing the magnetic field already, so we use circles because they take advantage of the symmetry of the problem.
Comment: The answer is basically the same as the answer here. The rectangle is the shape that best takes advantage of the symmetry of the problem (because the line integral vanishes along three of the four sides of the rectangle, and the field is constant along the remaining side). Any other shape will also work, assuming you can do the corresponding line integral (but you almost never can).
Comment: Thanks for helping. I have a request for you. Please answer my another question "Why do we consider a rectangle as a closed loop while deriving the magnetic field of a solenoid. I think I could have any other shape. How does it affect if I take another shape?"
Comment: I have posted the above question.


On submodules of finitely generated modules over a PID

Question: It is well-known that if $M$ is a finitely generated module over a PID $R$, then
$M\cong R/R{p_1}^{n_1}\oplus \ldots \oplus R/R{p_k}^{n_k}\oplus F$ for some prime element $p_i$ and for some positive integers $n_i$ $(1\leq i\leq k)$ and free $R$-module $F$ finite rank. What is the form of a submodule $N$ of $M$ with respect to this characterization?
Answer: A submodule is again a finitely generated module over a PID, hence it is of the form
$N \cong R/q_1^{m_1} \oplus \dotsb \oplus R/q_s^{m_s} \oplus F^\prime$
with $m_i \geq 1$ and $F^\prime$ free.
By tensoring with the quotient field, it is clear that the rank of $F^\prime$ is at most the rank of $F$.
By localizing the injection $N \hookrightarrow M$ at the prime $(q_j)$, we obtain that each $q_j$ occurs within the $p_j$. If not, the right hand side would have killed all torsion, while the left hand side still had torsion.
Thus we can write
$$N \cong R/p_1^{m_1} \oplus \dotsb \oplus R/p_k^{m_k} \oplus F^\prime$$
with $m_i \geq 0$.
By localizing at $(p_i)$ and then passing to the torsion part, we get an injection $R/p_i^{m_i} \hookrightarrow R/p_i^{n_i}$.
In particular $1 \in R/p_i^{m_i}$ is annihilated by $p_i^{n_i}$, hence $p_i^{n_i} \in (p_i^{m_i})$ or equivalently $m_i \leq n_i$.
Summarizing, we get the (intuitively obvious) result, that $N$ is of the form
$$N \cong R/p_1^{m_1} \oplus \dotsb \oplus R/p_k^{m_k} \oplus F^\prime$$
with $0 \leq m_i \leq n_i$ and $\operatorname{rank} F^\prime \leq \operatorname{rank}F$.
Comment: It's not quite so simple, because the $p_i$ might not all be distinct, so that localizing at one of them does not isolate a single torsion summand of $M$.  You have to look at the dimension of $p_i^nN/p_i^{n+1}N$ for each $n$ to entirely determine  what the $m_i$ can be.


The series $\sum_{n=1}^\infty \frac{\sin(\pi n / p)}{n}$ converges for each $p \in \mathbb{N}$

Question: This problem showed up on UCLA's Spring 2018 basic exam for Math Ph.D. students.  The problem asks to show that for each $p \in \mathbb{N}$, the infinite series $$\sum_{n=1}^{\infty}\frac{\sin(\pi n/p)}{n}$$ converges.  I am curious to see what solutions people come up with.  I tried to solve this using Fourier series but was unsuccessful.
Comment: Summation by parts does the trick: it proves the pointwise convergence of the Fourier series of the sawtooth wave, such that the value of the series is $\frac{\pi}{2}\left(1-\frac{1}{p}\right)$.
Answer: Hint: Show the partial sums of $\sum_{n=1}^{\infty}\sin(\pi n/p)$ are are uniformly bounded. You're then set up to use Dirchlet's convergence criterion.
Answer: This is an application of Summation by parts:

$\sum_{k \le n} \sin(\frac{\pi k}{p})$ is bounded for $n \in \mathbb N$.
$\sum \left(\frac{1}{n}-\frac{1}{n+1}\right)$ converges.
Answer: Since the community has pointed out that "Dirichlet's test" (or "summation by parts") provides a solution to this problem, I will now answer my own question.
Fix $p \in \mathbb{N}$.  Let us define $a_n := \sin(\pi n / p)$.  We first point out that the following relations hold for the $a_n$:

$a_{n + 2pk} = a_n$ for all $n, k \in \mathbb{N}^+$
$a_{n + p} = -a_n$ for all $n \in \mathbb{N}^+$

To see that (1) holds we note that $$a_{n + 2pk} = \sin\left(\frac{\pi(n + 2pk)}{p}\right) = \sin(\pi n /p + 2k \pi) = \sin(\pi n/p) = a_n.$$
To see that (2) holds we observe that
$$a_{n + p}= \sin\left(\frac{\pi(n + p)}{p}\right) = \sin(\pi n/p + \pi) = - \sin(\pi n /p) = -a_n.$$
Using these relations, we will show that for all $k \in \mathbb{N}$ and $0 \leq l < 2p$
$$\sum_{n=1}^{2pk + l} a_n = \sum_{n=1}^l a_n$$
where the empty sum $\sum_{n=1}^0 a_n$ is defined to be zero.
To show this we fix $l$ where $0 \leq l < 2p$ and induct on $k$.
The base case $k = 0$ holds trivially.  Now suppose
$$\sum_{n=1}^{2pk + l} a_n = \sum_{n=1}^l a_n$$ holds for some $k \in \mathbb{N}$.  Then
$$\begin{align*}
\sum_{n = 1}^{2p(k + 1) + l}a_n &= \sum_{n=1}^{2pk + l}a_n + \sum_{n = 2pk + l + 1}^{2pk + 2p + l}a_{n} \\
&= \sum_{n = 1}^l a_n + \sum_{n = 2pk + l + 1}^{2pk + 2p + l}a_{n}
\end{align*}$$
We'd now like to show that
$$\sum_{n = 2pk + l + 1}^{2pk + 2p + l}a_{n} = 0.$$
Well,
$$\sum_{n = 2pk + l + 1}^{2pk + 2p + l}a_{n} = \sum_{j = 1}^{2p}a_{2pk + l + j} = \sum_{j = 1}^{2p}a_{l + j}$$
by relation (1).  Then from relation (2) we can get
$$\sum_{j = 1}^{2p}a_{l + j} = \sum_{j = 1}^{p}a_{l + j} + \sum_{j = 1}^p a_{l + j + p} = \sum_{j = 1}^{p}a_{l + j} + \sum_{j = 1}^p - a_{l + j} = 0$$ as desired. Thus we may conclude that
$$\sum_{n = 1}^{2p(k + 1) + l}a_n = \sum_{n=1}^l a_n$$ and our inductive step is done.
Since every $N \in \mathbb{N}^+$ can be written in the form $N = 2pk + l$ with $k \in \mathbb{N}$ and $0 \leq l < 2p$, we can conclude that
$$\left| \sum_{n=1}^N a_n \right| \leq \max \left\{\left|\sum_{n = 1}^l a_n \right| : 0 \leq l < 2p \ \right\} \in \mathbb{R}$$
for all $N \in \mathbb{N}$.  Thus the partial sums $A_n := \sum_{k = 1}^n a_k$ form a bounded sequence.  Now let $b_n := 1/n$.  We note that $\{b_n\}_{n=1}^\infty$ is a monotonically decreasing sequence such that $\lim_{n \rightarrow \infty} b_n = 0$.  It thus follows by Dirichlet's test that $$\sum_{n = 1}^\infty \frac{\sin(\pi n/p)}{n} = \sum_{n = 1}^\infty a_n b_n$$ converges.
Answer: Possibly too unsophisticated for UCLA:
Grouping the terms $p$ at a time produces an alternating series whose terms decrease absolutely towards $0$, which therefore converges. (It is decreasing because $a_{n+p} = -\frac{n}{n+p}a_n$, so successive groups of $p$ terms decrease absolutely by comparing term for term).
The partial sums that do not run over a multiple of $p$ terms differ by at most $p/n$ from the next partial sum that does, and this difference goes to $0$.


The standard definition of current

Question: The book says current is the rate of flow of charge per unit time, but I don't understand whether it is rate of flow of charge through a single cross-sectional area per unit time or the entire amount of charge which makes it through both terminals in unit time. I have seen the answers, but how can you explain this definition $i=nqAv$, where $n$ is charge per unit volume, here a single cross-section is not taken but volume.
Comment: through both terminals? what do you mean? Current is just rate of charges changing over time. Usually the position is kept constant and the material is homogenous. So it doesn't matter where you measure e.g. in a wire, you will always measure the same current.
Comment: i mean what is the domain where we measure current
Answer: Current is defined as the rate at which charge flows through a given surface:
$$I=\frac{\mathrm{d}Q}{\mathrm{d}t}$$
and in a circuit this surface is any cross-sectional area (perpendicular to the flow).
You can often simplify that to charge through a cross-section per unit time and write $I=\frac{Q}{t}$
Answer to the comment:
Another but equivalent way to define current is:
$$I=nqAv_d$$
where $n$ is charge carrier concentration (no. of charges per volume), $q$ is charge of each charge carrier (in a typical circuit these might be electrons), $A$ is cross-sectional area, and $v_d$ is drift speed (the average speed in the length direction).
Let's break it up:

$Av_d$ is area-times-distance-per-second. This is volume-per-second. This whole volume moves through a cross-section every second.
In better words, all electrons within that volume will move through one cross-section within the next second. To find out how many that is, we multiply with the no. of electrons per unit volume $n$.
So, $nAv_d$ is the number of electrons moving through a cross-section every second. Thus we multiply with the charge of each electron, and we finally have the total charge moving through a cross-section every second.

These are two equal expressions of current, and:
$$I=\frac{Q}{t}=nqAv_d$$
Remember that $Q$ is total charge, while $q$ is charge-per-charge-carrier.
Comment: ok but how cn you explain this defination,,i=nqAv,where n is charge per unit volume
Comment: @SwapnavaChaudhuri No problem, I added the explanation to the answer.
Answer: It's the amount of charge flowing through a surface per unit time.
Answer: Consider, lets say, a wire of cross sectional area $A$, with charges (each of the same magnitude, $q$) flowing through it. If you consider a section of the wire of some length $x$, the volume of this region would be $Ax$. Because $n$ is the no of charges per unit volume, the charge in this region would simply be $q(nAx)$ ($nAx$ is the number of charged particles in your volume $Ax$.)
Since we are concerned with finding the current through the region (which is the rate of change of charge with time), and not the charge enclosed in it, we can consider this volume to be an infinitesimal one. ( Primarily because current is defined as the charge flowing through a surface, not a volume,  we can express this mathematically by letting $x$ tend to zero.)
This gives:
$$dQ=nqAdx$$
and then, $$I=\frac{dQ}{dt}=nqA(\frac{dx}{dt})=nqAv$$ (where $v$ is defined as the drift velocity of the charged particles.)

The standard definition of current


What is the archaeological evidence for the events in the Book of Mormon?

Question: I have read several books that identify archaeological evidence in support of hundreds and hundreds of biblical places, cultures, and historical events.  What is the archaeological evidence for the events in the Book of Mormon?
Comment: http://en.wikipedia.org/wiki/Archaeology_and_the_Book_of_Mormon
Comment: By way of clarification, archaeology has a lot to do with the study of ancient ruins.  There's a passing remark in the Book of Mormon indicating that the civilizations in question did a lot of their construction with wood, which unfortunately does not tend to leave much in the way of ruins.  Are you only looking for archaeological evidence?  If not, would you mind restating your question to describe what you *are* looking for?
Comment: Here's a relevant article: https://www.lds.org/ensign/2000/01/mounting-evidence-for-the-book-of-mormon
Comment: The introductory to the BOM implores you to pray to God about the authenticity of the book. That's about as close as you'll get to proving it one way or the other. For every bit of evidence supporting it, you will find an equal amount refuting that evidence.
Answer: Depending on the scope of this question, it can be very difficult to give any satisfactory answer to.  Archaeology primarily concerns itself with artifacts that have been left behind from ancient days, whereas the Book of Mormon deliberately avoids going into too much detail on the culture of its people and explaining details that might aid archaeological research, preferring to focus on more sacred matters.  Also, it appears that their preferred method of construction was in wood, which doesn't lend itself well to the generation of archaeological ruins:
From Helaman chapter 3:

3 And it came to pass in the forty and sixth [year], ... there were an exceedingly great many who departed out of the land of Zarahemla, and went forth unto the land northward to inherit the land.
...
7 And there being but little timber upon the face of the land, nevertheless the people who went forth became exceedingly expert in the working of cement; therefore they did build houses of cement, in the which they did dwell.
...
9 And the people who were in the land northward did dwell in tents, and in houses of cement, and they did suffer whatsoever tree should spring up upon the face of the land that it should grow up, that in time they might have timber to build their houses, yea, their cities, and their temples, and their synagogues, and their sanctuaries, and all manner of their buildings.
10 And it came to pass as timber was exceedingly scarce in the land northward, they did send forth much by the way of shipping.
11 And thus they did enable the people in the land northward that they might build many cities, both of wood and of cement.

So we see that they considered timber to be the preferred method of construction.  When it was unavailable, they developed new techniques for constructing houses and buildings of cement, and eventually became "exceedingly expert in the working of cement," but still placed a high value on wood as a construction material.  (Having lived in South America, where many modern homes are built of cement and bricks, I can certainly understand this attitude.  Cement is a rather good conductor of heat, which is an undesirable quality at low latitudes!)
The cement settlements are interesting.  This was once derided as a hopeless anachronism in the Book of Mormon: the working of cement was an Old World art that never existed in pre-Colombian America! Right up until the mid-twentieth century, that is, when archaeologists started finding cement settlements in the vicinity of modern-day Mexico City, built with an extremely high degree of skill ("exceedingly expert") dating back to approximately the same time as the Book of Mormon states that these colonists moved in. (As reported in Concrete Evidence for the Book of Mormon.)
However, this settlement is an exception rather than a general rule.  The people in question preferred construction in wood or simply living in tents, neither of which generates much in the way of ruins.  Also, Book of Mormon archaeology is at a second disadvantage when compared to Biblical archaeology: on the Biblical side, we know exactly where to start looking!  Modern-day Jerusalem is located on the side of the same mountain it's been on since at least the days of Melchizedek, to give just one example.
It will not be surprising, if you understand this, to hear that much of the truly interesting archaeological and historical evidence to arise in support of the Book of Mormon actually comes from discoveries in the Old World.  To continue the earlier theme of Book of Mormon details once thought to be ridiculous, the book mentions two different men by the name of Alma.  This was once held up as proof of Joseph Smith's hopeless inexperience: Alma is a Latin name, not a Jewish name, and a feminine Latin name at that!
...until the Dead Sea Scrolls were discovered, more than a century after the publication of the Book of Mormon, that is. One of the scrolls contains a reference to one "Alma, son of Judah." Oops.
Then we have the Lachish Letters, a group of clay tablets found in the ruins of an ancient Jewish city, dating back to just a few years after the start of the Book of Mormon. They describe several non-Biblical details of the local political climate which fit hand-in-hand with the corresponding Book of Mormon narrative.  LDS scholar Hugh Nibley wrote a very detailed article on the letters, summarizing it at the end with 18 points of remarkable similarity between the two, and concluding that

Other parallels may be added to taste, but this should be enough to show that Joseph Smith was either extravagantly lucky in the opening episodes of his Book of Mormon—that should be demonstrated by computer—or else he had help from someone who knew a great deal.

(Two Shots in the Dark, first half)
Entire volumes have been written, and then, sadly, largely ignored, regarding the authenticity of the introductory chapters of the Book of Mormon, the ones that deal with travels in the Old World.  To give just one example which is freely available online, see Lehi in the Desert, again by Dr. Nibley.  He examines cultural details, religious and dream imagery, historical background, and even the names used, and shows that it is all remarkably consistent with the time and place it purports to originate from.
Stronger than any external evidence for or against the authenticity of the Book of Mormon, though, is internal evidence.  There is a word for a literary work that claims a certain authorship but does not actually originate the way it claims to: forgery.  And there are well-established tools and techniques for the detection of literary forgery, and they do not require the support of external evidence.  But strangely enough, these formal methods don't tend to get applied in adversarial analyses of the Book of Mormon.
On the surface of it, there's no good reason not to; the Book of Mormon is a forger's nightmare!  A fairly large work, claiming to be historical in nature, disseminated as widely as possible and inviting all to read and critically examine it?  What is the forger thinking?!?  This violates every rule of producing a successful forgery!  But the two most important principles in the detection of literary forger tend to be consistently ignored:

Begin with the assumption that the work is genuine, and
no external evidence is required to expose a forgery of any significant size; internal inconsistencies alone will do that every time.

When the formal, scientific techniques for detecting forgery are applied to the Book of Mormon, instead of emotionally-driven attempts to reach a predetermined conclusion, the book is shown to be genuine. (Dr. Hugh Nibley, New Approaches to Book of Mormon Study)
I could go on, (and on and on and on; as I said before, there have been entire volumes written on the subject,) but this answer is getting to be too long as it is.  Suffice it to say that a large corpus of evidence exists which, while not enough to conclusively prove the truthfulness of the Book of Mormon, (they haven't even managed to do that with the Bible, so it would be unfair to hold another work that claims to be scripture to such a high standard,) definitely demonstrates that the book is worthy of serious attention and consideration.
Comment: Textual criticism points seem off-topic for the question.
Comment: The claims in the answer that textual analysis is overwhelming supportive are refuted with a short internet search. There is a very specific critique based on old world animals in the Americas 800 years too soon. 1 Nephi 18:25
*The people arrive in the promised land. About 591–589 B.C.*
"And it came to pass that we did find upon the land of promise, . . . , that there were beasts in the forests . . . , both the *cow* and the *ox*, and the *ass* and the *horse*, and the *goat* and the wild goat, and all manner of wild animals, . . . . " **ALL these animals arrived after Columbus.**
Comment: Thanks - I believe things are usually more complicated that they might seem at first. However, in your answer you seem to imply that the internal textual evidence is all but overwhelming positive. Not mentioning in the long answer that large potential holes are right on the surface hurts the answer in my opinion. *Every* animal mention is widely thought to be an old world animal? Are there any mentions of odd new world animals that would have been strange to these early settlers?
Comment: @GeorgeWhite: Those claims have been around for a long time, and there isn't enough space in a SE comment to answer them all, but suffice it to say this critique is nowhere near as simple as it appears on the surface.  When Europeans arrived, they called native animals such as llamas "goats," for example, so it's reasonable to think other Old World emigrants would as well. And pre-Colombian horse bones have been found in various places in the New World.  The evidence is not conclusive, but it's more than enough to show that the evidence *against* is not conclusive either.
Comment: @GeorgeWhite: The thing about external evidence is, it's external.  It depends on the state of the outside world for its validity, and that can change.  In the case of the Book of Mormon, [it has, several times,](http://maxwellinstitute.com/publications/books/?bookid=73&chapid=892) showing again and again a solid basis for things once thought to be ridiculously anachronistic.  But the internal evidence is self-contained.  The book says what it says, and new discoveries aren't going to change the text.
Comment: Proving, internally, that BOM is no forgery doesn't mean much.  Are folks claiming that Joseph Smith didn't really write it or that he did write it filled with errors.  Seems like more of a negative to prove it is genuine.
Comment: @TheodoreReinJedlicka [The cement cities have been found, dating to exactly when the book's narrative places them.](https://evidencecentral.org/recency/evidence/cement)  This has been known for decades now.  Whatever source told you they never existed really should be thrown out as entirely unreliable.
Comment: @TheodoreReinJedlicka "the article that you shared doesnt even say that they did." Sure it does.  (Try reading the words instead of just looking at the pictures.)  For sources, check the footnotes; there are pretty extensive sources given.  Also keep in mind that only a tiny fraction of Mesoamerica has actually been properly documented by archaeologists, and it's not until the past few years that they've even begun to use modern techniques such as LIDAR to look at regions long since overgrown by jungles.  Now that they're beginning to do so, the discoveries are pretty astounding!
Comment: As for the question of animals, bear in mind that the closest thing to a consensus among Book of Mormon scholars on the geography involved places the majority of the narrative in Mesoamerica, but the translation process was done by a person who, up to that point in his life, had never been outside of the northeastern United States and was most likely quite unfamiliar with local fauna.  There is one passage that has captivated the imagination of readers since the beginning, though, in which it names useful animals that were found, including "cureloms and cummoms," which were beasts of burden.
Comment: the portion of the BOM that you cited mentioned concrete houses, shipping, and extensive woodworking. woodworking and shipbuilding required heavy technological advances, all of which leave behind a trail of evidence to be discovered. Furthermore the text itself says that there were cities made of cement: "11 And thus they did enable the people in the land northward that they might build many cities, both of wood and of cement."
The idea that it would be unreasonable to expect to find archaeological evidence, simply because they used some wood, is preposterous.
Comment: @MasonWheeler thats very misleading. They didnt build cities out of cement in Mesoamerica or in Centralamerica, the article that you shared *doesnt even say that they did*. The article that you shared contains 2 pictures, neither of which represent cement structures. The only pyramids in Central America that have any cement on them (there are several, actually) were cemented over by early archeologists, in an attempt to preserve their structural integrity. Do you have a non-mormon source to back this up?
Comment: @MasonWheeler btw, this article https://knowhy.bookofmormoncentral.org/knowhy/when-did-cement-become-common-in-ancient-america
talks about lime whitewash used in building, and plaster, neither of which have anything to do with *cement structures* whatsoever. Lime and plaster mixes were used as a cosmetic covering over some structures, kind of like paint, *because they hadnt figured out how to make cement, or anything strong enough to actually build with*. This isn't evidence for the use of cement.
Comment: @MasonWheeler the BOM says that there were experts in building cement structures, with whole cities built out of cement. that is level of evidence you must provide
Comment: @TheodoreReinJedlicka Once again, you're not actually reading the text of the articles.  Look at the 5th and 6th paragraphs of the article you linked, explaining how their knowledge of lime working for other things grew into a knowledge of stronger structural cement *exactly at the expected time.*
Comment: @TheodoreReinJedlicka There is no "level of evidence I must provide" at all.  That's not how it works, that's not how it has *ever* worked for any comparable document, and no amount of goalpost-moving by people with their own agenda can change that.  Please read up on the actual process of telling authentic ancient documents from forgeries, because everything you're saying here is severely incorrect.
Comment: @MasonWheeler I read the article in its entirety (now twice). The 'explosion in the use of cement' that is referenced in the article *is not cement*, it is *lime whitewash and plaster that was used as paint* for decoration. This is very different from cement. **There are no pre-Colombian cement structures in Mesoamerica**. My wife is an archaeologist, working on these structures, we have seen them many times, we live in Central America, the Mormon article is intentionally opaque and misleading. If you have a non-mormon source (since the Mormon sources are unlcear and very biased) I am all ears
Answer: There is no archeological evidence that can be said to prove the book of Mormon, in the same way, that there is in the Bible; because the Mormon church does not allow for any real investigation of the claims of the BOM.
The most glaring example of the prohibition of archaeological investigation is at the site of the Hill Cumorah, where Joseph Smith supposedly found the gold plates which were translated into the BOM, and where according to the BOM there was a massive battle of extermination (which if true, would have been the largest battle in recorded history, certainly worth investigating for merely scientific reasons unrelated to the BOM), where there were supposedly millions of combatants, who were all destroyed, in upstate New York. Imagine millions of bodies, millions of swords, spears, and arrows. An event this massive and important would surely be one of the most important moments in human history.
The Mormon church (who bought the land) however, has never allowed, and will not allow the site to be excavated, therefore there is no evidence whatsoever that any of these events actually happened as described in the BOM.

"The hill, which was known by one division of the ancient peoples as
Cumorah, by another as Ramah, is situated near Palmyra in the State of
New York." (James E. Talmage - Mormon apostle, Articles of Faith,
Lecture 14, p.262)
"The great and last battle, in which several hundred thousand Nephites
perished was on the hill Cumorah, the same hill from which the plates
were taken by Joseph Smith." (Orson Pratt - Mormon apostle, Journal of
Discourses 14:331)
"Finally, they became so utterly wicked, so fully ripened for
destruction, that one branch of the "nation, called the Nephites,
gathered their entire people around the hill Cumorah, in the State of
New York, in Ontario County; and the Lamanites, the opposite army,
gathered by millions in the same region." (Orson Pratt - Mormon
apostle, Journal of Discourses 17:30)
"Thirty-six years prior to this time his nation was destroyed in what
we term the State of New York, around about a hill, called by that
people the Hill of Cumorah, when many hundreds of thousands of the
Nephites—men, women and children, fell, during the greatest battle
that they had had with the Lamanites." (Orson Pratt - Mormon apostle,
Journal of Discourses 20:63)

The lack of evidence proving (or definitively disproving) the BOM is not because the BOM does not provide enough detail to excavate (as was stated in another answer), it is because the Mormons will not allow their faith to be tested or examined scientifically or logically or historically, in the same way that the Bible and Christianity (and every other religion) is constantly being criticized and examined by both those from within and outside of it.
Comment: A few holes here... 1) most Latter-day Saints who study the topic conclude that the hill called Cumorah by Mormon and the hill called Cumorah by W.W. Phelps are two different hills. Plenty of Latter-day Saints, including leaders like Orson Pratt, have voiced opinions on the matter (they are welcome to their opinion), but Joseph Smith said nothing on the matter and the church has no official position on it. There's abundant evidence that the final battles of the Jaredites & the Nephites better fit the geography of Mexico than New York.
Comment: 2) the hill in New York was subjected to quite a bit of excavation in the 19th century. 3) Several Eastern Front battles in WWII (e.g. Stalingrad, Leningrad, Kursk) easily surpass any battle in the Book of Mormon in terms of size. 4) The church has no problem with archeology, but the site in New York is considered sacred, and isn't currently being excavated for essentially the same reason the temple mount in Jerusalem isn't either.
Comment: 5) Cerro de Hueso in Mexico is a far more promising candidate than the hill in New York for the site of the Nephite final battle, and the church isn't doing anything to stop people from digging there. 6) Re *Mormons will not allow their faith to be tested or examined scientifically or logically or historically* - Latter-day Saints certainly don't have the power to prevent people from making such inquiries, and scrutiny is quite common.
Comment: 1. You may assert that Hill Cumorah is not in New York, based upon your interpretation of the BOM, but in doing so you are disagreeing with the Articles of faith, and with the very the Apostles and Prophets of the LDS church.
2. Ok what were the results? 3. There is not a battle in history that has had millions of combatants, in terms of size, as explained in the sources I cited. 4. You have just contradicted yourself sir, per comment 2, if the church excavated before - then this is inconsistent.
Comment: No contradiction between 2 & 4: The 19th century excavations were the pursuit of treasure hunters, not the church. Could you clarify what statement in the Articles of Faith you believe disagrees with my post?
Comment: Re #3 More than 2 million people fought at Stalingrad in WWII; almost 3 million fought at Kursk. The only time the BoM mentions casualties above 1 million is in Ether 15, and it is reporting cumulative casualties for the war, not casualties (or combatants) in a single battle.


What happens if multiple bundles overwrite the same controller in symfony?

Question: I want to make a bundle that i would like other bundles to extend by either overwriting functionality or adding on to it. SYmfony supports that out of the box (http://symfony.com/doc/2.0/cookbook/bundles/inheritance.html) but what happens if multiple bundles tries to overwrite the same controller. Does it have a chain like effect where each bundle gets the response of the bundle before it or does the last bundle to extend the functionality only gets noticed? If its the latter, is there a way in symfony to allow the chain like method?
Answer: I think you are getting confused with how 'overwriting' works. When you extend a class you can 'overwrite' a method in the base class by creating a method with the same name, but you are not actually affecting the base class in any way, so multiple classes can extend the same base class without interacting with each other.
In Symfony2, it is absolutely fine to extend a base controller from multiple different bundles. Any methods defined in this base class will be available in the classes you have used to extend it. Depending on your needs for this, you may also wish to look into services which can be defined to allow access to methods globally in your application.


Is there a command to upgrade a package and all its dependencies without upgrading all packages?

Question: We have a meta-package, similar to ubuntu-desktop, that requires a bunch of dependencies to run some internal, not-yet-packaged code. Currently we are updating the meta-package so that it requires >= the current version every time we repackage it so that its dependencies will be upgraded when it is installed. However, if there was a way to upgrade a package and all its dependencies without upgrading all packages then that would be much simpler. Is that possible?
Answer: Not directly, as far as I know. You can use a little shell snippet to generate the list of dependencies of the package and upgrade these (assuming you aren't interested in recursive dependencies):
apt-get install our-metapackage $(dpkg-query -Wf '${Depends}' our-metapackage | sed 's/ *\(([^()]*)\)\? *[,|] */\n/g')

An alternative approach would be to supply your packages through a repository with a unique origin. Write an APT preferences file that specifies only your repository as having a normal priority and everything else as having too low a priority to be installed automatically. (See APT pinning in the APT manual for explanations.) I won't go into details about making the repository (this would be material for a separate question, which may well exist already). To specify that packages from your repository get upgraded and others don't, write the following file as /etc/apt/preferences.nnutter:
Package: *
Pin: release o=nnutter
Pin-Priority: 500

Package: *
Pin-Prority: 100

500 is the normal priority. 100 causes packages not to be upgraded, though the package will be installed if required by dependencies. Run apt-get upgrade or apt-get dist-upgrade with this APT preferences file when you only want to upgrade packages from the nnutter repository:
apt-get -o Dir::Etc::Preferences=/etc/apt/preferences.nnutter -o Dir::Etc::PreferencesParts=/etc/apt/preferences.nnutter.d upgrade

Comment: I did not succeed implementing this solution : apt-get always upgrade all packages.
Answer: You can use wajig command which can be used to put some packages on hold when upgrading
just type :
sudo wajig hold SomePackage

sudo wajig unhold

check the man page for more info
Comment: This would sort of be the same problem but from the opposite perspective.


How to use Fold on Select with a list of conditions to progressively eliminate from a list?

Question: The application of Reduce (over the integers) to an equation produces, after the application of LogicalExpand, a list of 1296 And'ed logical conditions (in 9 generated parameters, 5 of which are asserted to be $\in$ Integers.  Within each condition are individual terms like 6k == 3^P and other similarly unsatisfiable.
I have a list of such unsatisfiable patterns and would like to eliminate the conditions that contain them. This can be done pattern by pattern, but I think it should be possible by using Fold on Select with the list of patterns, so that each successive pattern to exclude is applied to the results of the previous selection.
(I have done this manually.. ultimately all conditions are eliminated; this means either the setup is defective or Reduce is not working as I expected because there are solutions for n in the negative integers. I am interested here in the use of Fold and Select but include the ancillary detail for other potential points of discussion.)
Question How can Fold be used with Select on a list of such conditions and a list of patterns to progressively eliminate conditions, by retaining only those that do not match?
Status Quo
Q[n_] := 2^Sum[q[j], {j, 1, n}]
collatz[P_, n_] := (n (3^P ) +  3^(P - 1) + Sum[Q[i] 3^(P - i - 1), {i, 1, (P - 2)}] +
  Q[P - 1])/Q[P]

Applying Reduce to the equation collatz[P_, n_] == n produces the strange condition $2^{-\sum _{j=1}^P q_j}\in \mathbb{Z}$, and since I don't know why and it doesn't make sense to me, I recast the equation in a more general form where the Q[n] is no longer explicitly a power of two but a general indexed variable c[], thus
collatzLike[P_, n_] := (3^P n + 3^(-1 + P) + Sum[3^(-1 - i + P) c[i], {i, 1, P - 2}] + c[P - 1])/c[P];

This does not deliver, via Reduce, any such bizarre constraint on the denominator of collatzLike.
Reduce and expand via
List@@LogicalExpand@Reduce[collatzLike[P, n] == n && Mod[c[P], 2] == 0 && c[P] > 4 &&
Mod[n, 2] == 1, {n}, Integers, GeneratedParameters -> (Subscript[k, #] &) ]

delivers a list ("expandedReducedList") of 1296 elements, each like this
$3^{P-1}\in \mathbb{Z}\land k_1\in \mathbb{Z}\land k_2\in \mathbb{Z}\land k_3\in \mathbb{Z}\land k_4\in \mathbb{Z}\land k_5\in \mathbb{Z}\land 6 k_1=3^P\land 6 k_2=3^{P+1}\land 6 k_3=c(P-1)\land 6 k_4=c(P)\land 6 k_5+1=n\land \sum _{i=1}^{P-2} c(i) 3^{-i+P-1}=\frac{2}{3} \left(-k_6-6 k_5 k_7-k_7-3 k_8+18 k_5 k_9+3 k_9\right)\land k_4\geq 1$
With the rules (note, these are produced by another function that scans for common assertions)
integralReplacementRules = {Subscript[k, 1] \[Element] Integers -> True, Subscript[k, 2] \[Element] Integers -> True, Subscript[k, 3] \[Element] Integers -> True, Subscript[k, 4] \[Element] Integers -> True, Subscript[k, 5] \[Element] Integers -> True, 3^(-1 + P) \[Element] Integers -> True}

we use
eliminatedExpandedReducedList = Fold[ReplaceAll, expandedReducedList, integralReplacementRules]

to obtain our target set of simpler conditions, such as
$6 k_1=3^P\land 6 k_2=3^{P+1}\land 6 k_3=c(P-1)\land 6 k_4=c(P)\land 6 k_5=n\land \sum _{i=1}^{P-2} c(i) 3^{-i+P-1}=\frac{2}{3} \left(-k_6-6 k_5 k_7-3 k_8+18 k_5 k_9\right)\land k_4\geq 1$
Using Select, I then eliminate the conditions with unsatisfiable terms. One by one like this:
Select[eliminatedExpandedReducedList,FreeQ[#, 6 Subscript[k, 1] == 3^P, -1] &]

Eventually, I obtained this putative list of patterns to apply.
eliminations = {
HoldPattern@FreeQ[#, 6 Subscript[k, 1]==3^P, -1],
HoldPattern@FreeQ[#, Times[2 ,_]==Power[3,_], -1],
HoldPattern@FreeQ[#, Times[6 ,_]==c[_], -1],
HoldPattern@(FreeQ[#, 1+6 Subscript[k, _]==3^_, -1] &&  FreeQ[#, 1+6 Subscript[k, _]==3^_,-1]),
HoldPattern@(FreeQ[#, 1+2 (1+3 Subscript[k, _])==3^P, -1] &&  FreeQ[#, 6 Subscript[k, _]==3^(1+P), -1]),
HoldPattern@FreeQ[#, 1+6 Subscript[k, _]==c[-1+P], -1],
HoldPattern@FreeQ[#, 1+2 (1+3 Subscript[k, _])==c[-1+P], -1],
HoldPattern@FreeQ[#, 1+2 (2+3 Subscript[k, 3])==c[-1+P], -1],
HoldPattern@FreeQ[#, 2 (_+3 Subscript[k, _])==n, -1],
HoldPattern@FreeQ[#, 1+2 (2+3 Subscript[k, _])==c[-1+P], -1]
}

What I would like to do is... something like Fold[Select, eliminatedExpandedReducedList , eliminations ] but the correct form of this has stumped me.
How should I proceed? (with MMA 18.104.22.168) Specifically, how can Fold be used with select etc., and perhaps more generally, is there a better way to remove unsatisfiable items from the list.
Last, and definitely least, why do we terms like $6 k_1=3^P$ appear at all given that $P$ is a specified variable for Reduce over the Integers and $k_1$ is asserted to be $\in$ Integers (The question Reduce over integers - why does MMA not give ~impossible? is related, but apart from a comment that "The methods available to FindInstance are insufficient..." for similar equations the issue remains unexplained, it's just "Because" Is there some way that the capabilities of Reduce etc. could be enhanced to deal with such simply multiplicative comparisons?)
Comment: Why do you insist on doing it with successive calls to `Select`? Wouldn't a single call with something like `Select[list, FreeQ[Alternatives[...]]]` also work, or am I missing something?
Comment: @LukasLang Thanks! (I'm *insisting* only to the extent that I want to understand MMA better w.r.t Fold, etc. - I did say it was a generic question about them, albeit with specific reference; I do have the result, clumsily obtained though it might have been). Then: a) didn't think of it, and now (I just had a go) b) given some And'ed terms such as `(FreeQ[#, 1+6 Subscript[k, _]==3^_, -1] &&  FreeQ[#, 1+6 Subscript[k, _]==3^_,-1])` I don't know how to construct that. Could you provide a working example?
Comment: The elimination conditions should be functions.
Comment: @att Example please.
Comment: Your `eliminations` is a list of `HoldPattern[FreeQ[#, ...]]`s.  Those should be functions `FreeQ[#, ...]&` instead.
Comment: @att interestingly I also discovered that myself late yesterday. Thanks
Answer: The elimination conditions should be functions, thus:
eliminations = HoldPattern@{
    FreeQ[#, 6 Subscript[k, 1] == 3^P, -1] &,
    FreeQ[#, Times[2 , _] == Power[3, _], -1] &,
    FreeQ[#, Times[6 , _] == c[_], -1] &,
    (FreeQ[#, 1 + 6 Subscript[k, _] == 3^_, -1] && FreeQ[#, 1 + 6 Subscript[k, _] == 3^_, -1]) &,
    (FreeQ[#, 1 + 2 (1 + 3 Subscript[k, _]) == 3^P, -1] && FreeQ[#, 6 Subscript[k, _] == 3^(1 + P), -1]) &,
    FreeQ[#, 1 + 6 Subscript[k, _] == c[-1 + P], -1] &,
    FreeQ[#, 1 + 2 (1 + 3 Subscript[k, _]) == c[-1 + P], -1] &,
    FreeQ[#, 1 + 2 (2 + 3 Subscript[k, 3]) == c[-1 + P], -1] &,
    FreeQ[#, 2 (_ + 3 Subscript[k, _]) == n, -1] &,
    FreeQ[#, 1 + 2 (2 + 3 Subscript[k, _]) == c[-1 + P], -1] &
   };

Then the desired form of Fold is
Fold[Select, eliminatedExpandedReducedList, ReleaseHold@eliminations]

Which, for the equations given in the OP and these particular conditions, leaves 4 (one more pair of unsatisfiable conditions to eliminate being then apparent).
Other incidental questions remain unanswered, but this was the man thrust of the OP.
Note that the use of subscripted variables is not recommended; they should be replaced by indexed variables and the patterns amended accordingly.


Testing bluetooth communication on RaspberryPi

Question: I am a beginner at RaspberryPi programing so I hope the question doesn't sound dumb. I would like to test a communication between two bluetooh modules in SPP mode. Is it possible to connect them both to TxD and RxD pins and test the Bluetooth connection this way?
Answer: Short answer: no, it's not enough to just connect Rx and Tx to MCU, as the modules do not know who to send messages to and who to receive from.
Assuming you mean HC-05/HC-06 bluetooth modules, apart from Rx and Tx pins you should power them via GND and VCC pins, and after powering up, you pair them and establish a link between them (A master module would require switching to AT mode for that, which, as I know, requires a KEY pin to be controlled as well). From this point what you send to one module's Tx would appear on another module's Rx and vica-verca.


What's the differences between the Herniated discs and Cervical spondylitis with cord/root compression?

Question:

For the first picture, it shows the Herniated discs and the second picture shows the cervical spondylitis.
Comment: Also, you need to provide a link to the source of those images.
Comment: Welcome to MedicalSciences.SE! Please take the [tour] and read the [help]. For [reasons mentioned in this post](https://medicalsciences.meta.stackexchange.com/q/411) and in [ask], we require prior research information when asking questions. *See [this list of helpful resources](https://medicalsciences.meta.stackexchange.com/a/784)*. Please help us to help you and [edit] your question to provide more information on what you have read on this subject, what made you ask this question, and any problems you are having understanding your research. If you found nothing, what did you Google?
Answer: A herniated disc means that a part of a disc has ruptured and squeezed out beyond its regular circumference. A herniated disc may or may not press upon the spinal cord or a root of a spinal nerve.
Spondylosis refers to age-related wear and tear of the spinal discs, which is the most common cause of a herniated disc. Cervical spondylosis means that the neck (Latin: cervix) part of the spine is affected.
Spondylitis refers to an inflammatory disease of the spine. Like in spondylosis, the parts of damaged discs or vertebra can result in nerve root compression. The most common changes in spondylitis are bone spurs and fusion of the vertebra (ankylosis) but less likely herniated discs.
The top picture shows a herniated disc, probably due to spondylosis. The bottom picture also shows a herniated disc, probably due to spondylitis (because the right arrow shows that some vertebral bone is affected).


Developing a product for commercial use compatible with Google Home/Alexa

Question: I would like to know whether there are any restrictions/rules when developing a product which is compatible with Google/Alexa or maybe even other hubs. Do I need to get some license or follow some rules?
Comment: What do Google Home and Amazon Alexa support pages say about it?
Comment: As @Bence said, you need to go read the terms of service which are available from the respective vendors website's
Comment: I have tried looking but couldnt really find an accurate answer to my question. I have even contacted google home support and they could not answer my question for some reason. They forwarded me to google developers section. Im looking how to contact them
Comment: Also, support page suggested asking in stack overflow with actions-on-google tag. But I am not  able to add this tag for some reason. Can someone confirm?
Answer: As of know they don't have any restrictions as they give you permission to tether with your television music player and etc , they don't have any problem by accessing your own product through Alexa or google assistant., if you can make effective product you can do that and on other hand you are just going to pass the voice command to Alexa and Alexa should react to your own device that is the thing you have to take care so the choosing methodology and devices does the matter here , do more research on this and then start to develop your product
Answer: Google Documentation includes a check list which has the ToS
https://developers.google.com/assistant/smarthome/develop/launching
Especially read the first item on the list on that page.
For Amazon you should probably start here:
https://developer.amazon.com/en-US/alexa/devices/connected-devices/business-resources
And look at "Certification and Badging" section
Comment: That's between you and Google, not something we can answer
Comment: My only concern : "Note: In order to have your Smart Home Action certified and released to production, your Action must support commercially available products.". How can I have my product commercially available if I havent yet got the google home certification? I want to get it certified and fully compatible with google home before I release it commercially
Comment: @zazas321 it says "released to production" there are unreleased states of Alexa skills which you put of for certification with your product which is at that time also unreleased. Then you get the certification,you can print fancy Alexa logos on your products and align with Amazon on when you start selling and the skill goes live. The specific timings are up for discussion between you and Amazon.


What is the difference between C.UTF-8 and en_US.UTF-8 locales?

Question: I'm migrating a Python application from an Ubuntu server with a en_US.UTF-8 locale to a new Debian server which comes with C.UTF-8 already set by default. I'm trying to understand if there could be any impact from this change.
Answer: In general C is for computer, en_US is for people in US who speak English (and other people who want the same behaviour).
The for computer means that the strings are sometime more standardized (but still in English), so an output of a program could be read from another program. With en_US, strings could be improved, alphabetic order could be improved (maybe by new rules of Chicago rules of style, etc.). So more user-friendly, but possibly less stable. Note: locales are not just for translation of strings, but also for collation (alphabetic order, numbers (e.g. thousand separator), currency (I think it is safe to predict that $ and 2 decimal digits will remain), months, day of weeks, etc.
In your case, it is just the UTF-8 version of both locales.
In general it should not matter. I usually prefer en_US.UTF-8, but usually it doesn't matter, and in your case (server app), it should only change log and error messages (if you use locale.setlocale().  You should handle client locales inside your app. Programs that read from other programs should set C before opening the pipe, so it should not really matter.
As you see, probably it doesn't matter.  You may also use POSIX locale, also define in Debian. You get the list of installed locales with locale -a.
Note: Micro-optimization will prescribe C/C.UTF-8 locale: no translation of files (gettext), and simple rules on collation and number formatting, but this should visible only on server side.
Answer: Here are some reasons why I added LC_TIME=C.UTF-8 in /etc/default/locale, in case it helps someone:
It provides a 24-hour clock instead of AM/PM in Firefox for HTML5 input type=time (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/time) and uses a datepicker in the format DD/MM/YYYY instead of MM/DD/YYYY for HTML5 input type=date (https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date).
It allows to use YYYY-MM-DD international date format (ISO 8601) with a 24-hour clock when replying to emails in Thunberbird.
Previously, it was possible with LC_TIME=en_DK.UTF-8 (http://kb.mozillazine.org/Date_display_format) but there is a bug currently and it stopped working (https://bugzilla.mozilla.org/show_bug.cgi?id=1426907#c155).
Edit: Now even the LC_TIME=C.UTF-8 workaround does not work for Thunberbird (https://bugzilla.mozilla.org/show_bug.cgi?id=1426907#c197) but at least en_IE.UTF-8 provides the European date format DD/MM/YYYY instead of MM/DD/YYYY.
Answer: There might be some impact as they differ in sorting orders, upper-lower case relationships, collation orders, thousands separators, default currency symbol and more.
C.utf8 = POSIX standards-compliant default locale. Only strict ASCII characters are valid, extended to allow the basic use of UTF-8
en_US.utf8 = American English UTF-8 locale.
Though I'm not sure about the specific effect you might encounter, but I believe you can set the locale and encoding inside your application if needed.
Comment: What is "basic use of UTF-8"?
Comment: I want to upvote this, but I haven't yet simply because I don't know if it is true... However, I will note that it at least makes sense. It would be great if a reference could be included in this answer.
Comment: Especially: Only strict ASCII in C.utf-8 vs. allow the basic use of UTF-8? Wasn't it the goal of multibyte encodings to leave ASCII behind? If C.utf-8 really is ASCII only, it would explain my current problem and why I came here...
Answer: I can confirm there is effect on different locales (C.UTF8 vs en_US.UTF8). I recently deployed one python program into a new  server, and it performed differently. The old and new servers are both Ubuntu 18 servers, and the only difference is the locale (C.UTF8 vs en_US.UTF8).  After setting the locale in new server as C.UTF8, they behave the same now.
It is easy to set the locale for a single application in Linux environment. You just need to add export LANG=C.UTF8; before your application. Assume you execute you application as python myprogram.py, then you type:
export LANG=C.UTF8; python myprogram.py
Comment: When you ask "what is the difference between X and Y" and someone answers "yes, there is a difference" it's a bit frustrating.
Comment: Thanks Ben Lin, could you also share what were the differences you noticed?
Comment: Hi Marcelo, sorry I can't pin point the differences, because my product line is too long. It is related to ocr/python/numpy/opencv and some more.


Is there any way to ask permission programmatically?

Question: Is there any way to ask permission programmatically in android ? I don't want to add all permission to AndroidManifest.xml. So is there any dialog that asks for permission at runtime?
Comment: @jeffamaphone For example if the feature requiring that permission isn't a core feature of my application. No need to bother every user with excessive permissions for features he doesn't use. You could even do that declaratively, by marking the permission as optional in the manifest. IMO the all-or-nothing mentality for permissions is one of the most annoying things about android.
Comment: Why don't you want to use the manifest?  The market place uses the manifest to make decisions about whether or not to make an app available to a given user per their hardware.  If you don't list your requirements in the manifest, how would it know?
Comment: @CodeInChaos: Hmmm...I'm pretty sure I've seen apps dodge this by having smaller, separate "helper" applications that are invoked through intents. "Don't want to give our app too much power? Fine, install the base app. Want this extra feature? Fine, install this helper which has a broader permission set."
Comment: Just another remark: I've seen Android pop up a system dialog at app runtime telling me the app was trying to enable bluetooth and asking for my approval. So, at least in this case, Google seems to accept the 'risk' of prompting the user at runtime.
Answer:
Applications statically declare the permissions they require, and the Android system prompts the user for consent at the time the application is installed. Android has no mechanism for granting permissions dynamically (at run-time) because it complicates the user experience to the detriment of security.

Android Developer site - System Permissions
Comment: I wonder how the time changes so quickly, it could complicate user experience in 2011 but not in 2015 ;)
Comment: @ay89 They were just too lazy to implement it :)
Answer: Not until now, but yes.
According to Google's new permission model introduced in Android M:

If an app running on the M Preview supports the new permissions model, the user does not have to grant any permissions when they install or upgrade the app. Instead, the app requests permissions as it needs them, and the system shows a dialog to the user asking for the permission.

Here's a summary of the key components of this new model:

Declaring Permissions:
The app declares all the permissions it needs in the manifest, as in
earlier Android platforms.
Permission Groups: Permissions are divided into permission groups, based on their functionality. For example, the CONTACTS permission group contains permissions to read and write the user's contacts and profile information.
Limited Permissions Granted at Install Time: When the user installs or updates the app, the system grants the app all permissions listed in the manifest that fall under PROTECTION_NORMAL. For example, alarm clock and internet permissions fall under PROTECTION_NORMAL, so they are automatically granted at install time. For more information about how normal permissions are handled, see Normal Permissions.
The system may also grant the app signature permissions, as described in System components and signature permissions. The user is not prompted to grant any permissions at install time.
User Grants Permissions at Run-Time: When the app requests a permission, the system shows a dialog to the user, then calls the app's callback function to notify it whether the user granted the permission.
This permission model changes the way your app behaves for features that require permissions. Here's a summary of the development practices you should follow to adjust to this model:
Always Check for Permissions: When the app needs to perform any action that requires a permission, it should first check whether it has that permission already. If it does not, it requests to be granted that permission. You do not need to check for permissions that fall under PROTECTION_NORMAL.
Handle Lack of Permissions Gracefully: If the app is not granted an appropriate permission, it should handle the failure cleanly. For example, if the permission is just needed for an added feature, the app can disable that feature. If the permission is essential for the app to function, the app might disable all its functionality and inform the user that they need to grant that permission.
Permissions are Revocable: Users can revoke an app's permissions at any time. If a user turns off an app's permissions, the app is not notified. Once again, your app should verify that it has needed permissions before performing any restricted actions.

Source: https://developer.android.com/preview/features/runtime-permissions.html
Answer: No.
Answer here: get Android permission dynamiclly
See the "Uses Permissions" section here:
http://developer.android.com/guide/topics/security/security.html
Comment: Now you can get permissions dynamically, Android Marshmellow
Answer: No. The user needs to be informed about the permissions while installing the application. Asking the user at runtime would be a security risk.
Comment: @Piskvor Those users will click through the warning at installation time as well. So I don't see how the risk is any larger than with install time warnings.
Comment: "Asking them at runtime would be a security risk." How so? Only danger I see is clickjacking, and that can be easily prevented by a countdown.
Comment: I do not see the security risk at all. This is not different from validating it at install. It is the logic of Symbian and Blackberry10, which are clearly platforms with a better security
Comment: @CodeInChaos: "easily prevented"? You underestimate the power of "click through the big scary security warning to see funny video".
Comment: Android M appears to have brought in some new permissions architecture to include permission dynamically. I have the same question now.
Answer: Android M introduced Runtime permissions, which everyone has been waiting for. Also the permissions are now categorized into NORMAL and DANGEROUS, where NORMAL permissions are granted by default and DANGEROUS permissions are requested when they are needed. Also DANGEROUS permissions can be revoked by the user at any time from the device's Settings menu.
Answer: If I combine the answers from 'Piskvor' and from 'Hanno Binder', your app can check if the helper app is available (try to invoke it with an Intent), and if it is not there (the invocation fails), prompt the user to install it.
Look at the following, for example.
how to download adobe reader programatically if not exists


Can anyone explain it to me why correlation between the variables (X and Y) is what it is?

Question: The figure on left looks less scattered (the axis is compressed) but has lower correlation. Whereas, the figure on right has multiple association for same value of X (i.e. X=0).
Comment: I would guess that the scatterplot is hiding the fact that there are lots of points somwhere. Perhaps on the right there are many points on [0, 0]
Comment: Why would such an overlap lead to a high correlation? I am really finding it very non-intuitive with my limited knowledge of statistics.
Answer: There are a lot of data and there's a lot of overlap of points. This obscures any visual relationship that can be detected from the data. To reconcile the correlation values with the data, you can create a plot of point density (e.g., link). Perhaps a bit more simply I'd suggest making the point translucent. If you can color points using RGBA, then reduce the alpha channel to make the points translucent. This will allow you to more clearly see areas of the graph with higher and lower densities of points. HTH.
Comment: Thanks for the response. I will check what's happening with the overlaps.