Some four clubs have exactly $1$ student in common

Question: There are $100$ students in a school, and they form $450$ clubs. Any two clubs have at least $3$ students in common, and any five clubs have no more than $1$ student in common. Must it be that some four clubs have exactly $1$ student in common?
Comment: Can there be identical clubs?
Answer: I am not completely sure my argument is correct, but I would say that it is not possible to have at least 3 students in common with all other groups, and at most one between 5 groups.
If we look at the size $s$ of a club, there are ${s\choose 3}$ combinations of 3 members. Any other club must contain at least one of those $s\choose 3$ combinations. Thus, the average number of times such a combination occurs among other clubs, is $449/{s\choose 3}$. If this number is strictly greater than 3, there must be at least one of those combinations that occurs among 4 other clubs. This contradicts the second assumption of no five clubs sharing more than one member. Therefore, $s$ satisfies $449/{s\choose 3}>3$. This gives that $s\geq 11$.
This means that the average number of clubs that a person participates in is at least $11\cdot 450/100=49,5$. Therefore, there is at least one person $p$ participating in at least 50 clubs. Consider these 50 clubs. By the second assumption, no five of these clubs share any other member than $p$. However, the total number of other members of these clubs is at least $10\cdot 50=500$, and there are 99 other persons. Therefore, at least one of these 99 other persons must occur in 5 of those clubs. This gives a contradiction.
Comment: Your arguments seem to be OK.
Answer: I'm not going to give a complete answer, I just want to point out a couple of things; also this is more a comment than an answer, but I write it here because of formatting stuff.
This looks like the typical problem about the inclusion-exclusion principle.
Let us denote the clubs by $A_1, A_2, \dots, A_{450}$.
We have
$$  \left| \bigcup_{i=1}^{450} A_i \right| \leq  100 $$
$$ |A_i \cap A_j | \geq 3, \forall i,j $$
$$ |A_i \cap A_j \cap A_k \cap A_l \cap A_m| \leq 1, \forall i,j,k,l,m $$
Now we use the inequality that follows from the inclusion-exclusion principle
$$ 100 = \left| \bigcup_{i=1}^{450} A_i \right| \leq \\
\leq \sum |A_i| - \sum |A_i \cap A_j| + \sum |A_i \cap A_j \cap A_k|- \sum |A_i \cap A_j \cap A_k \cap A_l| + \sum |A_i \cap A_j \cap A_k \cap A_l \cap A_m| \leq \\
\leq \sum |A_i| - 3 \cdot {{450} \choose 2} + \sum |A_i \cap A_j \cap A_k|- \sum |A_i \cap A_j \cap A_k \cap A_l| + {{450} \choose 5} $$
I guess that now one should use some "trick" but I don't see it.
Answer: The problem can be made easier to solve if we observe that if a set of clubs has X students in common then all subsets containing at least two clubs will have at least X students in common. For example, if we have five clubs : A, B, C, D, and E, and three students in all five of these clubs then clubs A, C, and E will have at least three students in common. Clubs B and E will have at least three students in common.
It may not be clear from the problem statement that the O.P. doesn't mean that every two club combination must have at three students in common. There are ${450*449\over 2} = 101025$ two club combinations in 450 clubs which way outside the 100 student parameter we are limited to. Looking at higher club combinations just makes things worse. There are ${450*449*448\over 6} = 15086400$ three club combinations
What I think the O.P. meant to say was that each of the 450 clubs must have three students in common with at least one other club and if any club has students in common with four or more clubs then it cannot have more than one student in common. Given these requirements must there be a club where it has exactly one student in common with three other clubs.
To provide a counter example I must show that all four club combinations have 0 students in common or it must have two or more students in common while satisfying the other conditions.
Let's assume that every three club combination doesn't have any students in common, so to solve this we divide the 450 clubs into 225 sets of 2 clubs. To satisfy the first requirement, that each club must have three students in common with at least one other club, we put three students in each set where all students are apart of both clubs in their respective set this would mean that a minimum of 675 students are required.
Now let's assume instead that every four club combination doesn't have any students in common. To solve this we divide the 450 clubs into 150 sets of 3 clubs. This would require 450 students by applying the same process the above paragraph and using the first observation above.
From this we can deduce that the more clubs students participate in the less students are required to satisfy the requirements.
So if one student is in all 450 clubs. Then every five club combination has one student in common. To provide a counter example, adding at least one student in common to each four club combination without adding students in common to any five club combination, requires ${450*449*448*447\over 24}=1685905200$ additional students.
Let's look at a slightly altered version of the problem where we have 20 clubs instead of 450 and instead of having 100 students we just want to find the minimum number of students to provide a counter example. Keeping all other requirements the same. Dividing the 20 clubs into four sets of five clubs, where each set has one student in five clubs, then adding two students to each four club combination in each set. This requires (2 students)(5 four club combinations in each set)(4 sets)+(4 original students) = 44 students. Trying a second case where dividing the 20 clubs into five sets of four clubs so each set has three students in all clubs so that only 15 students are required to satisfy the requirements with no four club combination having exactly one student in common.
Thus having a student in more than four clubs causes more problems than it solves. By dividing the 450 clubs into 112 sets of four clubs and one set of two clubs, we have three students in each set where they are in all clubs in their respective set so we need a minimum of 339 students to show a counter example. Thus there must be at least one four club combination with exactly one student in common, because the more clubs students are in the less students are required to provide a counter example, unless the student is in five or more clubs in which case the number of students increases greatly.


what is Explicit And Implicit Qr Algorithms For Symmetric And Non-symmetric Matrices?

Question: I thought that QR algorithm decomposes a matrix into an orthogonal matrix Q and a upper triangular matrix R using GramSchmidth process for singular matrices but, what  is meant by Explicit and Implicit QR algorithms? and how will they help in decomposing a non-singular matrix?
Comment: I don't think it necessarily involves Gram-Schmidt. I recall implementing this using Householder transformations. And I think Givens rotations are another choice. (If I remember correctly, "Numerical Recipes, The Art of Scientific Computing" was an excellent reference. I don't remember if they talked specifically about the singular and nonsingular cases).
Comment: yeah! I have familiarity with Householder process. Can we say that Householder is Implicit and GramSchmidth is explict?
Comment: The implicit QR algorithm is an method for finding the matrix $A^{k+1}$ using $A^{k}$ without getting too much catastrophic cancellation during shifted QR algorithm, which is frequent. The $A^{k}$ sequences produced in shifted QR algorithm and implicit shifted QR algorithm is mathematically the same, but not numerically the same.
Answer: The explict QR algorithm for computing eigenvalues of a matrix $A$ works like this:

Compute $QR$ decomposition $A_i = Q_i R_i$
Set $A_{i+1} = R_i Q_i (=Q^{\mathsf T} A Q)$
Repeat until $A_{i+1}$ is sufficiently close to an upper triagonal matrix

One may prove convergence to an upper triangular matrix, if $|λ_i| \neq |λ_j|$ for all eigenvalues $λ_i, λ_j$ of $A$.
The computation of the $QR$ decomposition is costly ($\mathcal{O}(n^3)$) and one doesn't wan't to do it in every step of the iteration.
If $A$ is of so-called upper Hessenberg form, i.e. a matrix where all entries below the first lower subdiagonal are zero (or in formulas: $a_{ij} = 0$, if $i>j+1$), the computation becomes less costly, namely only $\mathcal{O}(n^2)$. One can use the Givens rotations, Harry mentioned. Also, if $A$ is an upper Hessenberg matrix, all the iterates $A_i$ will be, too. Therefore, transforming your matrix into an upper Hessenberg matrix (using Householder transformations) pays out.
But even for Hessenberg matrices computing the $QR$ decomposition and then performing the matrix matrix multiplication $RQ$ is still expensive. This is where in »Implicit $Q$ Theorem« is used. It says, that if $Q A Q^{\mathsf T}$ is an upper Hessenberg matrix, then $Q$ is essentially uniqely defined by the first column of $Q$. But we already know, that all the iterates must be in Hessenberg form.
The idea now is as follows:

Compute the first column of the $QR$ decomposition of $A$. That is: Compute a Givens rotation $G_1$ such that $(G_1 A_1)_{2,1} = 0$. Now, update $\tilde{A}_1 := G_1A_1 G_1^{\mathsf T}$ (which may be done efficiently without actually doing matrix matrix multiplications)
The entry $(3,1)$ of $G_1A_1 G_1^{\mathsf T}$ will now be non zero. Compute another Givens rotation $G_2$such that $(G_2 G_1 A_1 G_1^{\mathsf T})_{3,1} = 0$ und update the matrix analogously to 1. Note, that the first column of $G_2 G_1$ is still given by the first column of $G_1$!
The entry $(4,2)$ will now be non zero. Iterate the procedure. This is known as "bulge chasing"

At the end, one has implictly computed $RQ$ at a cost of only $\mathcal O(n^2)$ per iteration step. This is way this algorithm is called the Implicit QR algorithm.
I hope that my answer helps you. This answer is based on my lecture notes and unfortunately I don't have a good reference suggestion at hand …
Comment: An implementation of this, together with an not-so-thorough explanation, can be found in _Numerical Recipes in Fortran 77_.
Comment: Are you able to link to your lecture notes or are they copyrighted? I would like to read them to better understand the math behind how this works.
Answer: The classic QR algorithm iteration:

$QR = A $ ........decomposition

$A' = RQ $

due $Q$ is orthogonal, is also true:

$A' = Q^T Q RQ = Q^T A Q$

A=A' repeat, A should go diagonal after few iterations, probably
bottom-right to left, chance to reduce the matrix or deflate.

The explicit/implicit QR algorithm is mentioned generaly in the context of adding shifts for faster convergence. QR can take a lot of iterations due to the convergence rate that depends on the magnitude between adjacent eigenvalues along the matrix.
The explicit shifted version. Differs from the classic subtracting a diagonal shift for faster convergence:

$QR = A - \mu I$ ........decomposition

and adding the shift:

$A' = RQ + \mu I$

There's little choice for this shift and is either implementation or kind of matrix dependent. There's also a double-shifted version for dealing with complex values.
The QR decomposition operation to choose depends; A could have been transformed upper hessenberg form (an upper triangle with a subdiagonal), if symmetric matrix this transform will lead to a tridiagonal matrix; whatever was, those pre-transforms $H$ must keep the input A and the real input A, similar $A_{real} = H^{-1} A_{input} H$, with $H$ inversible, meaning that both matrices have the same eigenvalues. Usually those pre-transforms use householder reflections.
The implicit shifted form of the QR algorithm, uses Francis Q theorem. The theorem says that if $A'$ is an upper hessenberg matrix any orthogonal matrix $Z$ can be suitable for the iteration:

$A' = Z^T A Z$

As long the first column of $Z$ equals to the first of $Q$, and $Z$ brings back the matrix to upper hessenberg form.
In this case, Z and Q can only differ by a diagonal product of +-1 values.
This theorem allows the previous explicit-shift $A - \mu I$ to be "inserted" implicitly (instead of subtract, decompose, add - just multipling at left and right Z).
So if $A - \mu I$ was the matrix, and the goal of the first  transform $Q_0$ of Q is to reflect or rotate a first column vector to start zeroing the matrix towards a triangle - Knowing the matrix have the shift $\mu$ subtracted allows us to create a similar $Z_0$; however when you plug on the iteration step $A'=Z_n^T...Z_0^T$ A $Z_0...Z_n$ - at the first $Z_0^T$ A $Z_0$ theres a second effect - a non-zero "a bulge" will be introduced. The set of transforms $Z_1..Z_n$ and its transposes should enter the game of the "chase-the-bulge" (as mentioned in the previous post) to lead the matrix to the right form; those pairs of transforms will introduce and erase places. Due the theorem the set of $Z_1..Z_n$ must not damage the first column $Z_0$; and  matrix $A'$ must end in an upper hessenberg, or a narrow version of, within less rows/cols affected by transforms as possible.


My wifi turns on randomly and automatically.

Question: I never turn my WiFi on because I have an unlimited data plan. I recently noticed that it is autonomously enabled randomly.
How can I find the culprit that keeps turning my WiFi on?  Is there a way I can catch the application that launched the WiFi enable Intent?
I have been going on a blind search thus far and I still notice my WiFi turning on. Thanks in advance! I have a Nexus 4 running Android 4.4
Comment: In my case, it turned out to be the Anti-theft feature of Avast because I recently changed my sim card.  Hopefully this saves someone the pain I went through...
Comment: I had the same thing happening on my Huawei phone. Turns out it was the Wi-Fi+ feature. Settings -> Wi-Fi -> Wi-Fi+ -> Off.
Answer: KitKat has a feature where, when Wi-Fi is turned off, it periodically scans for networks to allow Wi-Fi-based location detection to work. To turn this off:-

Go to the Wi-Fi settings
On the overflow menu (the three dots) select Advanced
Uncheck Scanning always available

Even when an app turns on Wi-Fi fully, this isn't done with an intent; rather, it's done by calling the method WifiManager.setWifiEnabled. Only apps with the permission  "connect and disconnect from Wi-Fi" can do this.
Comment: Thanks for the response! I have previously unchecked this option, but the issue remains.
Answer: If it's not that KitKat feature Dan mentioned, and the intervals are reasonably short (so e.g. it happens at least once while you're sleeping at night):

enable USB debugging
connect your device to your PC via USB
on your PC, run adb logcat | tee wifi.log
go to bed
next morning, press Ctrl+C
check wifi.log to see when it was triggered (and hopefully, by whom)

This should at least help narrowing things down. Even if it doesn't explicitly state "App X triggering WiFi", you can check for patterns, like "evertime WiFi had been turned on, I find event Z of app X mentioned a few lines before". Good indicator it might have to do with X then. So check whether X has some network (or "coarse location") permissions requested (and granted), as if not, it's unlikely to be your candidate. Otherwise, try disabling/freezing/uninstalling it, and see if your issue is gone. If so, you found it – if not, repeat with the next.
Comment: @Izzy can I simply find the applications with the Wi-Fi change state permission and then simply un-install the app on Android 4.1.2.The same problem only occurs regular time intervals.
Comment: If you want to use that approach, see [my answer here](http://android.stackexchange.com/a/78142/16575). Combining the two approaches might be a little safer, so you don't uninstall the wrong app ;)
Answer: I had the same issue with my device (Note 3). T-Mobile doesn't seem to have a "Connection Optimizer" feature in its line of phones. In T-mo's case the feature that needs to be disabled is the "Wi-Fi Manager".
To disable this feature you need to do the following:

Access your T-Mobile account (for me I just press on the "T-Mobile My Account" App).
Press the menu button on your device, then select "Options".
Under "Notifications" uncheck the box marked "Display Wi-Fi Manager notifications".
Under "Connection Assistant" select "Open Wi-Fi manager".
Uncheck the box for "Manage Wi-Fi Connections".

That's it...
I talked to T-mobile tech support about an unrelated issue and offhandedly mentioned this problem. The rep informed me that this was a known issue and stated that this issue was being addressed. In the mean time disabling the "Wi-Fi Manager" is a temporary fix to address this problem. Here is the shorthand way to disable the Wi-Fi manager:
T-Mobile My Account -> Menu -> Options -> "Display Wi-Fi Manager Notifications" (Uncheck) -> "Open Wi-Fi Manager" (under "Connection Assistant") -> (Uncheck) "Manage Wi-Fi Connections".


Impact of frequent resetting

Question: I have a stupid habit of resetting my phone every month. Does this have any bad impact on WP7 phone??
Comment: Just to clarify, do you mean losing all of your data by resetting your phone back to the factory settings?
Comment: Losing data is not the concern as everythings on cloud these days. I am asking about any general concern or any impact on phone processor or ROM
Answer: I have been reading a few pages (Nokia, LG, Samsung) on how to hard reset the device and haven't found any hint of this action causing some problems to the phone so I would say go for it. I am not really sure how it would do any harm because it's just "reloading" the original state into the phone.
The better question is why would you do something like that :)
Answer: There is a limit on the lifetime of flash memory used for storage within smartphones in the total number of times it can be rewritten.
Resetting the phone often will use up some of these writes, and reduce the overall lifetime by an amount, but I wouldn't expect it cause it to fail in the normal expected lifetime of the phone; after all, on low memory devices, the phone has the option to use memory paging which can have a dramatic effect on the number of reads/writes to flash memory.
I would be surprised if there was a good reason to wipe and start again so frequently - uninstalling is clean, and should suffice.

Impact of frequent resetting


bootstrap sass 2 -- custom.css.scss.css 404 not found

Question: I'm not able to get the bootstrap sass 2.0.0 to work with rails. The application layout does not change even after following the tutorial of Micheal Hartl which is by using rails 3.2. I have tried all the possible changes.
Started GET "/assets/custom.css.scss.css" for 127.0.0.1 at 2012-05-26 03:42:45 +0300
Served asset /custom.css.scss.css - 404 Not Found (7ms)

ActionController::RoutingError (No route matches [GET] "/assets/custom.css.scss.css"):
actionpack (3.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
railties (3.2.3) lib/rails/rack/logger.rb:26:in `call_app'
railties (3.2.3) lib/rails/rack/logger.rb:16:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/request_id.rb:22:in `call'
rack (1.4.1) lib/rack/methodoverride.rb:21:in `call'
rack (1.4.1) lib/rack/runtime.rb:17:in `call'
activesupport (3.2.3) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
rack (1.4.1) lib/rack/lock.rb:15:in `call'
actionpack (3.2.3) lib/action_dispatch/middleware/static.rb:62:in `call'
railties (3.2.3) lib/rails/engine.rb:479:in `call'
railties (3.2.3) lib/rails/application.rb:220:in `call'
rack (1.4.1) lib/rack/content_length.rb:14:in `call'
railties (3.2.3) lib/rails/rack/log_tailer.rb:14:in `call'
rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:138:in `service'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/httpserver.rb:94:in `run'
c:/RailsInstaller/Ruby1.9.3/lib/ruby/1.9.1/webrick/server.rb:191:in `block in start_thread'

Rendered c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/actionpack-3.2.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.0ms)

This is the thing which comes when run the rails server:
Started GET "/assets/application.js?body=1" for 127.0.0.1 at 2012-05-26 03:42:45 +0300
Served asset /application.js - 304 Not Modified (0ms)
[2012-05-26 03:42:45] WARN  Could not determine content-length of response body. Set content-leng
th of the response or set Response#chunked = true

Started GET "/assets/rails.png" for 127.0.0.1 at 2012-05-26 03:42:45 +0300
Served asset /rails.png - 304 Not Modified (0ms)
[2012-05-26 03:42:45] WARN  Could not determine content-length of response body. Set content-leng
th of the response or set Response#chunked = true

How do I fix this?
Answer: Rename your file to custom.css.scss
Comment: once i renamed my server keeps exiting...here this wat it shhows now ;


How to find the condition number of a 3*3 matrix with singular value 10, 1 and 1/10?

Question: If the singular values of a 3*3  matrix  are 10, 1 and 1/10 respectively, what is the condition number of the matrix? Is such a matrix numerically tractable?
Answer: the condition number of a matrix, $A$, with respect to a given matrix norm is:
$\kappa(A) = ||A||\cdot||A^{-1}||$.  in this case the singular values are the square root of the non-negative eigenvalues of $A^*A$, and the largest of them is the operator norm of $A$, so under this norm $||A|| = 10$ and $||A^{-1}|| = \left(\frac{1}{10}\right)^{-1} = 10$.  Thus the condition number, $\kappa(A) = ||A||\cdot||A^{-1}|| = 10\cdot 10 = 100$.  In general smaller condition numbers mean matrices are more tractable (Identity has condition number 1).  A condition number this high suggests conditioning is needed (SOR, Gauss-Sidel, etc).


If a high speed car or train enters a tunnel, will the aerodynamics effect slow it down and hence requiring more energy to maintain speed?

Question: Speed and distance are two main determinants in this question. A slow moving vehicle or train entering a tunnel is unlikely to be affected by the presence of solid stationery object covering them. But say the object is moving fast enough, will the presence of a tunnel requires the object to use more energy to go through it. Also the distance between the object and the wall of the tunnel, AND the length of the tunnel itself will most likely affect the energy required to go through the entire tunnel. Will it require more energy the longer the tunnel?
Comment: Sure.  You're correct on all these things.  The main question is whether it will be significant.
Answer: This is hard to answer quantitively.
A train in open air pushes air out of the way, and sucks air in behind it. Some air is dragged along with the train. Mostly air moves near the train.
In a New York subway, you can feel a strong breeze before the train arrives. The tunnel diameter isn't that much larger than the train, so the train acts something like a piston. It pushes air ahead of it and suck in air behind. The density of air is about 1 kg/m^3. It takes energy to accelerate that mass.
Air is not very viscous, but it does have viscosity. A thin layer of air against the train moves at the speed of the train. Likewise, a thin layer against the tunnel stays still. For a slow train, the flow might be laminar. Adjacent layers move at slightly different speeds, and air velocity varies smoothly between the train and tunnel. In that case, some kinetic energy is lost as heat.
Most flow is turbulent. This is disorganized and has much larger velocity differences across short distances. More energy is lost in turbulent flow.


How to convert old Japanese text encodings?

Question: I run MacBook Pro under 10.6.7, and I am competent in Unix.  I have old Japanese text files in various encodings (EUC, SJS, New-JIS) that I can no longer read or display.  The old program jconv.c does not help, since it only converts among these encodings.  Is there a way to convert them (or any one of them) to the current "normal" Japanese text that can be seen in TextEdit, etc.?  I have set the Terminal preferences to SJS and EUC (can't find NewJIS), among others, including UTF-8.  Eleanor
Answer: I recommend you look into iconv for doing such conversions.
Comment: Thanks!  That works fine!  I would never have known -- you're a big help!  Eleanor
Answer: nkf is a Linux command line program which can meet your requirement.
I am sure it is available at Debian. So you can download sorce code from the Net.


Creating Loop Cuts in any direction

Question: I want to create loop cuts in a direction that Blender does not allow me to. As far as I know.
Anyone have a solution how to create the loop cuts as shown in the image attached.
Comment: Have you tried using the knife or knife project tool?
Answer: I would suggest to use Knife Project for this task. Please be aware that this approach doesn't give you a clean topology.
You will need to add another object that is used to add the cuts. In your case I would use a Circle (Add > Circle in object mode). Select the Circle first and then the object you would like to apply the knife project on. Position your viewport perspective so that the Circle is placed where you'd want the cuts in the target mesh to be. Switch to edit mode (Tab), open the operator search (F3 or Edit > Operator Search), find the Knife Project operator and execute it.
Comment: .. and you can project a lattice, or concentric loops, etc, etc, by using a suitable object, with its faces deleted, as a cutter.

Creating Loop Cuts in any direction


Voltage increases speed/ current increase torque?

Question: I don't understand how current reduces speed in an electric motor,while voltage increases it. Wouldn't a stronger magnetic field mean there is a stronger "force" thus should be a higher acceleration, therefore a higher speed of rotation?
Comment: Field current or armature current?
Answer: Assuming you are referring to the motor slowing when you increase the field current (in a motor with a separate field winding, rather than a permanent magnet motor:
Remember what controls the speed of a lightly loaded motor : the speed increases until the back-EMF approximately equals the driving voltage. The back-EMF is generated by the motor acting as a generator. If the motor was perfectly efficient and completely unloaded, the motor would run fast enough so the back EMF equals the driving voltage; with any further increase in speed it would exceed the driving voltage and the motor would return power to the supply.
In practice the motor doesn't quite reach this ideal speed : the difference in voltage drives current through the motor's resistance, and this supplies the torque to overcome friction and the load.
Now consider what happens if you increase the FIELD current. As you expect, that increases the magnetic field. But remember the motor is acting as a generator, to generate back-EMF. Increasing the field will increase the voltage generated at any given speed : therefore the back-EMF equals the driving voltage at a lower speed. So, the motor slows down.
EDIT re : armature current. From the above explanation it should be clear that increasing armature current (by loading the motor harder) drops more voltage across the armature resistance : V=IR. Subtract this voltage from the driving voltage and you have the new, lower, back EMF : corresponding to a lower speed.
Comment: You can not believe how enlightened I feel right now... Its as if something has been blocked in a my mind for a while, now it's free to think and understand and move on! Thank you!
Comment: What if we increases the armature's current alone? I assume the same would happen?
Comment: Brian, if back-emf never was never induced increasing current would create a stronger magnetic field, thus a stronger forces, thus the speed would indeed increase? That's why if we increase more power to the electric motor... if it did not heat up it would increase it speed due to the additional current. So in reality the whole concept revolves around the BACK-EMF the current is the cause of the strong force, and that strong force is responsible for higher accelerations.
Comment: Essentially yes. You can stop back-emf being generated, simply by stalling the motor. Enormous current (maybe 10x the rated current) and enormous torque. But very low efficiency and output power because it's stopped... The current WILL heat it up so don't stall it for long! This happens momentarily when starting; a decent sized motor will trip breakers unless they are "motor rated" to take the abuse. A second revelation here : the IR loss is simply wasted power. So the key to efficiency is to minimise it : run a motor as fast as possible (maximum practical V) and as lightly loaded (minimum I)
Comment: ... as lightly loaded (minimum I) as practical. Of course bearings, brushes in old-fashioned brush motors and so on impose mechanical drag, so the peak in efficiency occurs *close* to maximum speed, minimum load - maybe 80-90% of its unloaded speed.


How to answer this question?

Question: This is the question: Did there use to be a different capital city?
So, I don't  know if I have to ask " Yes, it did" or " yes, There was"..I will be so thankful if you can help me! Thanks
Answer: It's common in immediate answers to questions during conversations, especially simple ones, to elide everything after the verb or first word of the verb, because the rest can be assumed from the question.
So you say:

There was (short for "There was a capital city.").

or:

There did (short for "There did use to be a capital city."  This is more emphasized than the above).

You wouldn't say Yes, it did because the there is the subject of the question, not it.
Answer: Remember that we simply invert the word order to change from a question to a statement or vice-versa.
Did there use to be a different capital city?
Yes, there did use to be a different capital city.
Yes, there did.

How to answer this question?


Why are businesses not concerned about every law in the world, mostly?

Question: Several businesses have publicly accessible websites . Thus don't they operate in every country? Then why are they only concerned about their own country's laws and sometimes GDPR and CCPA? Is it legal? Are they safe? Are their owners being and their assets in their home country safe?
Answer: That a company (C) has a website that can be accessed from a given county does not mean that the company operates in that country. If C is located in country A, markets and advertises to country A, offers products designed to appeal in country A, has its site only in the primary language of country A, uses servers located in country A, and has all its assets and physical offices in country A, it is not operating in country X, even if a few people from X do business with C over its web site.
Country X may have laws which claim to apply to C or its web site. It will find it hard to enforce those laws, particularly if owners and officers of X do not travel to X. It will find it hard to extradite anyone for violations of the laws of X  unless those actions are also crimes under the laws of A.
If X is a major, powerful country such as the US, the UK, or the EU it may be able to get A to enforce its court orders, or to use its influence over the banking system to impose penalties on C. If X is North Korea, or even Brazil, it is probably out of luck.
Thus the management of C needs worry primarily about the laws of A, and to a lesser extent the laws of major countries that make some effort to enforce their laws outside their own borders, such as the GDPR, or certain US laws. It probably has little reason to worry about the laws of other countries. If A is itself a major country that can easily resist any pressue from X, C has even less reason to worry.
If C does significant business in countries D and E, and particularly if it opens physical offices in D or keeps assets in E, it will have much more reason to worry about the laws of D and E. If it does advertising in the D & E markets, this also gives C more reason to be concerned with their laws.
There is always some risk of X finding a way to enforce its laws, but the risk is small.
Comment: @user253751 I never said that Amazon can't pass taxes on it its prices. The question would be what profit level such higher prices would result in. In short, I think this was a business decision (wise or not) not an ideological one.
Comment: Can C fall under jurisdiction by doing bussiness through its subsidiary ?
Comment: @scientist That depends on the details of the relationship, and the country involved. It is really a separate question. But in most cases a subsidiary is treated as a separate entity.
Comment: I seem to remember that Amazon in Australia ran into something like this. They claimed they didn't need to pay GST (VAT) because they weren't doing business in Australia, Australia said yes you are and yes you do, eventually Amazon just banned the whole country from buying things because taxation is theft I guess
Comment: @user253751  I suspect that it was not because of any theoretical position that "taxation is theft" but a decision that the costs of complying were larger than the profits to be made, if your account is correct. Amazon pays many taxes in countries where it does more business, including the US.
Comment: @DavidSiegel i find it very hard to believe that Amazon can't pass on a tax to its customers which every other Australian business does pass on.
Comment: Interesting. That would mean Amazon is a complete failure in Australia and was only able to succeed in the first place because they evaded taxes. Pretty bad news for Amazon...


Magento 2.1 Ccsave

Question: I was disappointed to find out Magento 2 does not have a Ccsave option. The only credit card option is with Braintree but they are making me jump through hoops with their application process. Is there a simple way I can add ccsave from Magento 1 to Magento 2?
Answer: You could create a custom payment method to re-implement the Saved CC method from M1. There is a sample payment module here that could be used as a starting point: https://github.com/magento/magento2-samples/tree/master/sample-module-payment-gateway
That being said, leaving it out was a very intentional decision. Storing credit card details on-site in your database is terrible for security and PCI compliance, regardless of what security measures you might put in place. The fact is, if your store in any way got compromised, every bit of that data on file is at risk.
There are numerous credit card gateways supported out-of-box by Magento 2 (PayPal, Braintree, Authorize.Net), and many more that can be added with third-party modules. Find a credit card processor you can work with, and do it right.
Comment: @Royan Hoerr yes correct m2 doesn't have. but there is a scenario m1 site used saved card cc payment method when they are going to migrate to m2 how they going to handle for open orders at the of migration. Your valuable suggestion is required. Please advise

Magento 2.1 Ccsave


Creating field that attributes what boundary set of points reside in

Question: I want to be able to assign a point layer a new attribute field with the polyline that the points are within. What method would work best in this scenario?
Comment: Do you already have the polyline or do you need to create the boundary from the points?
Comment: Hi Cary thanks for chiming in. I already have a polyline layer with a few boundaries.
Comment: https://gis.stackexchange.com/questions/144128/points-within-polygon-in-qgis There are a few possibilities with the standard Processing Menu.  If you have not used this yet. Click on the Processing menu item then Toolbox.  You may have to change polylines to closed polygons - also in processing.
Comment: If you are up to some code I have did something similar in the past and can send you the python code.
Comment: Kadir has a great code answer for you here - https://gis.stackexchange.com/questions/362436/count-points-in-polygon-grouping-by-attribute-using-pyqgis
Comment: Please, do not forget about ["What should I do when someone answers my question?"](https://stackoverflow.com/help/someone-answers)
Answer: Use one of these expressions using the overlay functions (available since QGIS 3.16) in field calculator on the points-layer and replace line with the name of your line-layer. You also might need to have to adapt the max_distance:= values, set to 1 here:
array_first(overlay_nearest('line', id, max_distance:=1))

Depending on your data (see below), a simpler expression could also work:
 array_first(overlay_intersects( 'line', id))

An alternative would be: apply a small buffer around your line and than use this expression:
array_first(overlay_within('buffer', id))

Explanation:
In my test setting, overlay_intersects() did not - as it should  - reliably identify the points being exactly on the line. I suppose that's because of rounding errors in the saved coordinate values, even if I snapped the points to the line: Snapping is not always reliable in QGIS.
So I had to opt for overlay_nearest() the find the line closest the each point. As this would also assign a value for the points that are not at all on the line, I had to add a maximum distance: only points closer to the line than this one will get a value from the line. So adapt this value: high enough that all points that should be on the line are recognized, small enough that points clearly not on the line are ignored.
Screenshot: the red points are labeled with the first expression from above as being part of line 1 or 2:
Answer: If you could share a screenshot or image it would be easier to provide some more feedback.
Is the polyline enclosed? like a circle/rectangle shape? In that case you can use the polygonize tool to create a polygon from your line features. Then afterwards, use the "Join attributes by Location" tool to combine the attribute field.
In case the lines are not fully enclosed,  you could use buffer to create a small polygon, making sure that respective points you want to match fall inside the buffer, and then use the "Join attributes by Location" to combine attributes.
Comment: Hi, the polylines are enclosed and mostly rectangular. I attempted to polygonize and join but I got a NULL field. I get this error: No spatial index exists for input layer, performance will be severely degraded.


What is the "simple frequency ratio" theory?

Question: What is the "simple frequency ratio" theory of consonance and dissonance? Why is it called a theory?
Comment: Steven - you need to stop deleting and reposting the same question each time it gets closed as dupe.
Answer: The "simple frequency ratio" theory basically claims that an interval is consonant if it can be expressed as the ratio of "simple" integers (as opposed to "complex" fractions).
This thought process has existed for centuries. One example was by Zarlino, a sixteenth-century theorist whose notion of the senario suggested that the only consonances were those created by ratios of the numbers 1 through 6. (For an earlier numerically based system, check out Pythagoras and the notion of the "tetraktys of the decad.")
Since Zarlino was publishing right around the onset of the scientific revolution, his senario was challenged almost immediately by theorists seeking physical/natural explanations. The "simple frequency ratio" theory is still problematic today.
As for why it's a theory, note that that word is being used in the sense of a scientific theory, not in the vernacular sense of theory that tends to mean "guess." It's a theory just like gravity, evolution, and germ theory: it's something that is falsifiable and can make testable predictions.


Preparing laptops for theft

Question: With a number of laptops out there the likelihood of one being stolen is high.  What methods, preferably free, can be used to secure the data on the computers?  The laptops do not have any special hardware on them, and generally keep their user data in a dropbox folder.  One small step taken is to have the the dropbox folder encrypted by Windows 7.  Any additional suggestions are greatly appreciated.  The data in the dropbox folder is sensitive.
Comment: Is your company OK putting sensitive data on Dropbox? I don't have a problem with it .. I use Dropbox for all my data .. but I suspect  careful (i.e. paranoid) companies would not condone it.
Comment: They are okay with it.  It's data you could trust to Dropbox, but not stuff you would like to have in the hands of just anyone.
Answer: Having your "dropbox" folder encrypted is a good first step. I use a dedicated TrueCrypt partition for data, and use two passwords on the laptop -- one for Windows login, and another for the TrueCrypt data partition. One weakness here is that browser history, last opened file names, and many other potentially interesting kinds of user data are left unencrypted.
You can supplement this with a 'phone home' solution like Prey. I think it's debatable how much this would help against a professional information thief, but at least it gives the appearance of doing something active about recovering the laptop.
You can also encrypt the full boot drive. There are pros and cons. On the plus side, full drive encryption is comprehensive, nothing is accidentally left unencrypted. On the negative side, a small software or hardware malfunction can lead to a OS reinstall.
Tom's Hardware recently compared TrueCrypt and BitLocker from Microsoft, but not some of the competition. IMHO the article misses the point a bit; speed is not a significant differentiator between the two, but BitLockers stronger support for enterprise deployment and key maintenance is.
Edit: Great comments below, thanks Warner, nedm & Maxwell. As for the "Evil Maid" attack, I know of this attack, but it's not stopping me from using TrueCrypt. If an attacker can repeatedly get physical access to a PC, then any security measure can ultimately be defeated. The question is, would it be economical to mount an attack, relative to the expected value of the stolen good. For most companies, I think TrueCrypt full disk encryption would make an attack uneconomical (cost of one criminal to make mutiple break-ins etc). The common thief would simply wipe the harddrive and sell the laptop as a stolen good. If that's not good enough for you, then have a look at BitLocker, or better yet PGP's Whole Disk Encryption with two-factor authentication -- or stop using laptops. :-)
Comment: Thank you for the TrueCrypt suggestion.  I am looking into this solution.
Comment: I have TrueCrypt deployed professionally for over a year not and we have yet to experience any support issues or otherwise.
Comment: +1 for Truecrypt full-disk encryption.  We've installed it on probably a dozen laptops + a few desktops with no issues.  Note that with a recovery disk, which it forces you to create on install, you can recover from a partial or fully overwritten disk volume header, which is the main threat to the integrity of the encryption scheme.  We've never had a problem, and even with block errors or hardware problems on the drive I wouldn't say it's been any more fragile than an unencrypted disk.  The lack of enterprise deployment features is a legitimate drawback, but then again, it's also free.
Comment: As for TrueCrypt you may want to read this article: http://theinvisiblethings.blogspot.com/2009/10/evil-maid-goes-after-truecrypt.html
Answer: Look at using full disk encryption, whether Bitlocker or a 3rd party product. This is not perfect, but makes it harder on a thief to get anything off of the system. Most will likely wipe and reload. You won't get the HW back, but you'll better ensure company data isn't lost because of a theft.
Comment: Agreed. The loss of a laptop with an encrypted hard drive is almost an incidental loss, almost every time. Yes, there are targeted thefts which increase the liklihood of your data being stolon, but really, you're protecting yourself from the snatch and grab on the subway or parked car.
Comment: Bitlocker sounds great, however, it requires an upgrade in editions (from business).  Can an upgraded Windows 7 instance use Bitlocker on the drive, or is a format required?
Answer: I would also advise going for the TrueCrypt solution as it can cover pretty much everything you want. I have a TrueCrypt voume on my laptop and have been experimenting with TrueCrypting the boot volume too. It's free, it's open source, and It don't play (as much) havoc with deployment.
Comment: I'm testing this out now, props to TrueCrypt
Answer: Use bitlocker and bitlocker to go.  Bitlocker is easily maintained and simple to deploy.  If you want to get the hardware back try laptopcop.  I like laptopcop because they work with the police freeing you from that pain.  Another source of security is windows rights management
Comment: Would you say bitlocker is worth upgrading business to enterprise?
Comment: Absolutely, win 7 pro + sa to get enterprise for bitlocker is an easy call to make
Answer: If you do not have physical security you do not have any security.  Any attempt at securing the data on an otherwise physically insecure system is only a delaying game against an incompetent thief.  Since NTLM hashes for 14 character password, even with special characters, can be broken in 6 to 8 seconds now I would recommend forcing a complex password scheme of no less than 24 characters and hoping the bad guy does not have a large enough rainbow table.
Comment: One nice thing about TrueCrypt is that it doesnt make it apparent that there is anything there worth attacking, or which method should be attacked.  While I agree, physical security is essential, even this can be be broken.

Preparing laptops for theft


What is the meaning of Einstein's field equation in terms of source and its effects on curvature?

Question: The Einstein's Field Equation is $$R_{\mu\nu}-(1/2)g_{\mu\nu}R=-8\pi T_{\mu\nu},$$ where the left hand side is the curvature term and the right hand side is the source term (see, Hartle). Now, in the case of Schwarzschild Exterior Solution (solution for empty space-time outside of a spherical body) we are taking the energy-momentum tensor $T_{\mu\nu}$ to be zero as there is no mass or energy outside the spherical body; and we are writing the field equation as $$R_{\mu\nu}=0.$$
My confusion is that what is the source of curvature here? Undoubtedly, here the source of curvature is the spherical body which have non-zero $T_{\mu\nu}$. So, does not the energy-momentum tensor refer to the source of curvature? What does it refer to then? Please clarify the meaning of Einstein's Field Equation in terms of source and its effects on space-time curvature.
Comment: The source of the curvature would be the spherically symmetric central body.  If we are outside of the body, then there is no matter source, but that doesn't mean that there is no matter anywhere.
Comment: Remember that curvature has to be continuous. Spacetime is supposed to be a manifold. So when you get outside the body, the source of curvature in a given region is the curvature on the boundaries of that region. Infinitely far away from the body, spacetime is flat an Minkowski. So each point in between has to continuously adapt the curvature from what it is inside the body to what it is at infinity
Comment: Side note, with $T_{\mu\nu}=0$, you get $R_{\mu\nu}=\frac{1}{2}Rg_{\mu\nu}$, which only equals zero iff $R=R^{\mu}_{\,\mu}=0$
Comment: Sorry, but you did not get me. I haven't said that there is no matter anywhere; rather I said there in no matter outside the spherical body. And if the spherical body is the source of space-time curvature then why we don't take the energy-momentum tensor of that body in the field equation? I may have misconception about what is meant by $T_{\mu\nu}$ in field equation? please clarify. @Jerry
Comment: Sorry, but the condition $T_{\mu\nu}=0$ automatically, implies that $R=R_{\mu}^{\mu}=0$, that's why we can write, $R_{\mu\nu}=0$ @Jimdalf
Comment: Sorry, it was my mistake; $T_{\mu\nu}=0$ will not always give $R_{\mu\nu}=0$; because, that will depend upon the metric $g_{\mu\nu}$ and the ability of contraction of $R_{\mu\nu}$ by this metric. But in the Schwarzschild exterior solution of empty space-time the Ricci Tensor will go to zero. @JimdalftheGrey
Answer: The fact that the energy-momentum tensor is called the source of curvature doesn't mean that there can't be any curvature where there is no energy-momentum. In fact, even if $T_{\mu\nu}=0$ across all spacetime, there are still nontrivial solutions of Einstein's equations, in the form of gravitational waves.
You should remember that $T_{\mu\nu}$ is a function of $x$, and can be nonzero inside a body but zero outside. Suppose we have a spherically symmetric star. Inside of it, the energy momentum tensor will be a very complicated object, with all sorts of pressures and flows and whatever. But outside of it, $T_{\mu\nu}$ will be simply zero. So we have divided space into two regions:
$$
\begin{cases}
R_{\mu\nu}-\frac12 g_{\mu\nu} R = T_{\mu\nu} & \text{Inside} \\
R_{\mu\nu} = 0 & \text{Outside} \end{cases}
$$
When we solve the outside equation assuming spherical symmetry and a static solution, we get Schwarzchild's solution, and we find that we don't need to know the metric inside the star in detail. All we need is a single number, $M$, that tells us everything we need to konw about the curvature outside of the star.
The Schwarzchild metric satisfies $R_{\mu\nu}=0$, because outside of the star (or black hole or whatever), there are no sources. But when we solve an differential equation, we need boundary conditions. And the boundary conditions at the star's surface (or at $r=0$ for a black hole) are the energy-momentum tensor's way of telling us that there is matter somewhere, even if the region where we solved the equation is empty.
Comment: So, is it like that both $R_{\mu\nu}-(1/2)g_{\mu\nu}R$ and $T_{\mu\nu}$ are functions of $(x,t)$ and we have to consider what is the value of $R_{\mu\nu}-(1/2)g_{\mu\nu}R$ and $T_{\mu\nu}$ **at the same event** and then equate them. @Javier Badia
Comment: @VikramadityaMondal: Yes, that's exactly it. Everything that we're considering here is a function of $x^\mu$, and Einstein's equations are partial differential equations beteen tensors that are functions of space and time.
Answer: We first note that the vanishing of the Ricci tensor does not imply the vanishing of the Riemann tensor. Thus the vacuum equations, $R_{\mu\nu}=0$, do not imply that spacetime is flat. The vacuum equations tell us that certain linear combination of components of the Riemann tensor vanishes.
When solving differential equations, one usually has to worry about the boundary conditions. The EFEs are just differential equations of the metric, to bo be solved for the components $g_{\mu\nu}$. Let $D$ be a region of spacetime containing matter, i.e. $T|_D\ne 0$. General relativity seeks to solve the problem
$$
\begin{cases}
G_{\mu\nu}(x) = 8 \pi T_{\mu\nu}(x) & x\in D \\
R_{\mu\nu}(x) = 0 & x\notin D \end{cases}
$$
We have two solutions:
$$
\begin{cases}
\tilde{g}_{\mu\nu}(x) & x\in D \\
\bar{g}_{\mu\nu}(x) & x\notin D \end{cases}
$$
The relevant boundary conditions are
$$\tilde{g}_{\mu\nu}(p)=\bar{g}_{\mu\nu}(p),\quad\forall p\in \partial D.$$
Furthermore, we require that this be a smooth transition. The metric of spacetime is thus
$$g_{\mu\nu}=\chi_D \tilde{g}_{\mu\nu}+(1-\chi_D)\bar{g}_{\mu\nu},$$
where $\chi_D$ is the characteristic function of $D$.
Let us consider a concrete example. We shall look at a spherically symmetric static star$^{1}$. By the Birkhoff theorem$^2$, we already know that the exterior solution is the Schwarzschild solution. We take the star to have a perfect fluid energy-momentum tensor in the interior. In the interior, the metric will still have spherical symmetry because of the properties of perfect fluids. Thus we must find $A$ and $B$ in
$$\mathrm{d}s^2=-B(r)\mathrm{d}t^2+A(r)\mathrm{d}r^2+r^2\mathrm{d}\Omega^2.$$
The solution for $A(r)$ is
$$A(r)=\left[1-\frac{2G\mathcal{M}(r)}{r}\right]^{-1},\quad\mathcal{M}(r)=\int^r \rho \,\mathrm{d}V=\int_0^r 4\pi r'^2\rho(r')\,\mathrm{d}r.$$
The solution for $B(r)$ is
$$B(r)=\exp\left\{-\int_r^\infty \frac{2G}{r'^2}[\mathcal{M}(r')+4\pi r'^3 P(r')]A(r')\,\mathrm{d}r'\right\}.$$
In these equations $\rho$ is the density of the star and $P$ its pressure.
Clearly, the support$^3$ of the density and pressure is contained within the star. If the star has radius $R$, then $\mathcal{M}(R)=M$ is the total mass. Let us analyze our solution at $r=R$. For $A(r)$ we get just the standard Schwarzschild metric component. A simple exercise in calculus is to check that
$$B(R)=A^{-1}(R)$$
and that $B(r)=A^{-1}(r)$ for $r\ge R$. We thus see the above general situation: we have an interior solution and an exterior vacuum solution, which are equal at the boundary of the source's support.

$^1$ See [1] section 11.1 or [2] section 6.2 for the full calculation.
$^2$ Proved in [1] on page 337.
$^3$ A quantity $f$ is said to have support in $X$ if $f(x)=0$ for all $x\notin X$.
References:
[1] S. Weinberg, Gravitation and Cosmology (1972).
[2] R. M. Wald, General Relativity (1984).
Answer: The equations $R_{\mu\nu} = 0$ alone don't define a well-posed problem since you need to add boundary conditions. Moreover the curvature of a manifold is measured by the Riemann tensor and $R_{\mu\nu}=0$ doesn't imply ${R^{\mu}}_{\nu\sigma\rho} = 0$.
Answer: It's helpful to look at an analogous situation in Classical Electrodynamics where the same issues come up.
In General Relativity, the source term is the stress-energy tensor.  In Classical Electrodynamics the source terms are the charge and the current.  When there are no sources, one possible vacuum solution is a constant uniform nonzero electric field.  Another possible vacuum solution is a constant uniform zero electric field.  We can piece together vacuum solution and sew them together, and this will no longer be a vacuum solution.  But for instance if you take a field uniform in the $\hat{x}$ direction $\vec{E}=E\hat{x}$ from $x=0$ to $x=1m$, and piece it together with $\vec{E}=\vec{0}$ for $x<0$ and $\vec{E}=\vec{0}$ for $x> 1m$, then this can still be a solution to Maxwell, with a source term.  In this case you need an infinite sheet of surface charge in the $x=0$ plane, and an equal and opposite surface charge on an infinite sheet in the $x=1m$ plane.
So let's try this with General Relativity, you can take two Schwarzschild solutions for different mass parameters, $M$ and $m$, with $M$>$m$. As embeddings they might look like funnels.  If you a surface of constant areal coordinate, you get a thin spherical shell, pick a surface with surface area $4\pi R^2$.  For the solution with $M$ remove the inside interior to the shell.  Repeat for the solution with $m$ find the thin shell with the exact same surface area $4\pi R^2$ (with the same numerical value of $R$) and this time remove the outside exterior to the shell.  So the one looks like a funnel with the tip cut off, and the other looks like a tip to a funnel.  Since they have the same surface area and are just spherical shells, we can sew them together.  We now have a manifold that looks like a funnel with a kink.
Each vacuum solution was a source free solution, and we sewed them together in a surface where the geometry of the surface matched. But the result (just like for the electrodynamics case) is not a source free solution.  In fact this is a solution where there is a thin shell of mass at the surface area $4\pi R^2$ spherical shell surface.  It is OK for spacetime to be curved (just like it is OK to have a travelling wave in electromagnetism or a constant electric field).  But only certain curvature is allowed, what a source term does is allow different kinds of curvature.
And this is not contrived in any way.  If you repeated that trick with the two solutions you could cut out the inside of the $m$ solution and put a $\mu$ solution inside it and then have a solution with two places with source, one at surface $4\pi R_1^2$ and another at $4\pi R_2^2$.  As you place shells at more and more radii you can approach the solution to a realistic nonrotating star or planet.  All the source term does is allow you to have a continuous limit of this process, the process of sewing vacuum solutions together.
Think of $G_{\mu \nu}=0$ as a natural allowed way for spacetime to curve (just as vacuum waves or static fields are allowed electromagnetic fields) and that curvature is allowed to deviate from these natural allowed curvatures as long as there is a source term there to give the appropriate OK.  Just like an electric field line isn't allowed to terminate unless there is a charge there to approve that message.


Is there a list of verses from the Bible which the Joseph Smith Translation has modified/restored?

Question: Rather than busting out a KJV and a JST and comparing them verse by verse I am lazily hoping that there is, somewhere, a list which has already been generated providing all of the verses from the Bible  which the JST has modified or allegedly 'restored'?
Comment: To clarify - The introduction to the Joseph Smith translation indicates that its purpose is to restore truth. It's purpose is not to restore the autographical texts of the Bible. To be just a touch humorous while also making this point, let us consider...the autographical texts of the Bible were written in Hebrew, Aramaic, and Greek. The Joseph Smith translation is in English, and is therefore not a verbatim copy of the autographs. So "redacted" might not be the right word to use in the question.
Comment: @HoldToTheRod The edits are appreciated.  I had only used the terms redacted and restored based upon other LDS answers and comments.
Comment: Closely related https://christianity.stackexchange.com/a/83970/51818
Comment: @HoldToTheRod Forgive me but I missed this thread from 3 months ago. You said, "To clarify - The introduction to the Joseph Smith translation indicates that its purpose is to restore truth." Perhaps you can give a list of the truths that had to be restored?
Comment: Hi @Mr.Bond - many such lists have been created -- if you're interested in reading an article, see an example [here](https://www.churchofjesuschrist.org/study/ensign/2006/10/plain-and-precious-truths-restored?lang=eng)
Answer: The closest thing I have found online to a complete listing of restored or retranslated passages is this online interactive comparison viewer at ScriptureToolbox.com, which lets you see from the table of contents which chapters have retranslated portions, and highlights the differences in context.
Print editions of books do exist that show side-by-side comparisons:
Complete Joseph Smith Translation of the New Testament (Overdrive.com) - borrowable online
Joseph Smith's New Translation of the Bible (Amazon.com) - not an affiliate link
There are manuscripts of the new translation available at JosephSmithPapers.com.
You could also download a text form of the KJV, perform a diff with the JST, and store the edits with verse references to a file.
I might do this myself when I have a minute; I have worked in plain text Scripture files before but had not yet located a plain text file of the JST in an easily digestible format.
Selections are published as an appendix to the Standard Works of the Church of Jesus Christ of Latter-day Saints, and can be found here:
https://www.churchofjesuschrist.org/study/scriptures/jst?lang=eng
The rights to some portions of the JST belong to the Community of Christ, they have an online edition of it (they call it the Inspired Version or IV), including a browser with side-by-side comparisons:
https://centerplace.org/
Some more background and resources can be found here:
https://rsc.byu.edu/joseph-smith-translation/joseph-smiths-translation-bible
Note that Joseph Smith's translation was never officially "finished".
Answer: I personally think a focused list of some of the most significant differences is more helpful than a comprehensive list for the whole Bible. Below, differences by Joseph Smith are bolded:

"But to him that seeketh not to be justified by the law of works, but believeth on him who justifieth not the ungodly, his faith is counted for righteousness," Joseph Smith, Romans 4:5

Paul wrote that God does justify the ungodly.

"In the beginning was the gospel preached through the Son. And the gospel was the word, and the word was with the Son, and the Son was with God, and the Son was of God."  Joseph Smith, John 1:1

This is entirely different than what John 1:1 really says.

"For unto such hath God promised his Spirit. And they who worship him must worship in spirit and in truth." Joseph Smith,John 4:26

Jesus instead said, "God is Spirit." The Joseph Smith version aligns well with the LDS doctrine that God is not a Spirit and instead has a body of flesh and bone.

"And David said unto Nathan, I have sinned against the Lord. And Nathan said unto David, The Lord also hath not put away thy sin, that thou shalt not die." Joseph Smith, 2 Samuel 12:13

2 Samuel actually records that God has put away David's sin.

Joseph Smith added about a dozen verses to the end of Genesis 50. This includes a new verse 33 which says, "And that seer will I bless, and they that seek to destroy him shall be confounded; for this promise I give unto you; for I will remember you from generation to generation; and his name shall be called Joseph, and it shall be after the name of his father; and he shall be like unto you; for the thing which the Lord shall bring forth by his hand shall bring my people unto salvation."

If you are unsure that Joseph Smith added himself into Genesis 50, in the Book of Mormon, it says in 2 Nephi 3:14-15
"And thus prophesied Joseph, saying: Behold, that seer will the Lord bless; and they that seek to destroy him shall be confounded; for this promise, which I have obtained of the Lord, of the fruit of my loins, shall be fulfilled.  Behold, I am sure of the fulfilling of this promise; And his name shall be called after me; and it shall be after the name of his father.  And he shall be like unto me; for the thing, which the Lord shall bring forth by his hand, by the power of the Lord shall bring my people unto salvation." (bold added to emphasize similar phrases)
Finally, it is commonly stated that Joseph Smith did not complete his translation, but as of March 24, 2024, the official LDS stance is that "Once finished with the New Testament, Joseph picked up where he left off in Genesis and completed his work on the entire project by July 1833." So the Joseph Smith translation actually is complete.
On that note, another reference I found online is that it says in the official History of the Church, Volume 1, page 324, "I completed the translation and review of the New Testament, on the 2nd of February, 1833 and sealed it up no more to be opened till it arrived in Zion,"
Finally, here is the entire Joseph Smith translation online, as well as other LDS Scriptures, in case you want to read more.
Comment: @MikeBorden Thank you, and I forgot about the tour since I was busy when the site told me about it, but I just took the tour.
Comment: Very nice answer. Welcome to stack exchange Christianity.  Take the tour. It'll help. +1


Why does grub break after installing a distro externally

Question: I have an internal drive nvme0 with partitions for windows and ubuntu budgie 19.04. Now I installed KDE neon to my external SSD. This made it so that I can only get into grub when I have my external drive connected. When I reconnect it and reboot, it seems to work again. I would love to know how to enable bootloader to just work from the internal drive. The external drive is small but it isnt practical to take it everywhere with me just to boot off it.
Comment: Are you using legacy BIOS or UEFI? In either case, you should install grub onto your internal disk and config your BIOS to boot from the internal disk.
Comment: I am using UEFI, and grub was installed onto my internal drive before adding KDE neon to my external drive. The installer only said it was changing my sda device which is the external one so I dont know why it stopped working. Did it make changes to my boot partition on my main drive without my permission?
Answer: This should be relatively simple to fix.  The installer has in some way replaced the UEFI Grub bootloader for Ubuntu.  This might have installed a new boot loader side by side with your existing Grub, or it might have completely replaced it.
Your new bootloader / bootloader config has is setup to load its full config from your external drive (from /boot/grub).  So your task is to revert the configuration.
First of, boot into Ubuntu (with the drive plugged in).  Then as root:
sudo grub-install
sudo update-grub

If this doesn't fix the problem then you will also need to check in your BIOS to see if a new bootloader has been installed side by side.  If so you should be able to select your old bootloader in your BIOS's boot settings.


mounded dirt prep for gravel driveway?

Question: On the side of my house I have brought in lots (1-3' deep, 15' wide) of dirt (very rocky and not so rocky) i plan putting gravel down on top of it for a drive way/RV parking. What prep work do i need to do before I lay the gravel down on it ?
Comment: compacting and making it leveld would be good, do not forget some drains
Comment: Rock would have been better.  Loose dirt will settle, maybe not level.  You usually undisturbed dirt for a base, then rock to build it up with gravel on top.
Comment: @crip659 maybe the area wasn't level so needed some fill to build it up.
Comment: I'd say none. You get some gravel and then drive on it for a year. Then you do it again. *I've brought in dirt* - I would've skipped that. Now you have to drive on *that* for a year, to get back to *undisturbed soil*. Also, parking on a porous surface would violate my city ordnance.... just saying.
Comment: It's not a Q of surface prep so much as it is how long will it take to stop shifting. Which is whenever you've dove on it enough to equate to ~3 hours of steam rolling. So ~5y and two or three times doing extra gravel IME and then it's as hard as a rock
Answer: 1-3 feet deep? Just dumped? Spread it out and wait for spring, unless you want to move most of it off to the side and put it in right.
If you need to build a driveway up by that much, you need to spread 4-6", compact it, and spread 4-6" and compact it, or, having not done that, you need to let the freeze/thaw cycles of Winter take care of that for you. If you don't have winter freezes, then time and driving over it may eventually get there, but it will still sink at random if not well-compacted when placed.
If you attempt to compact it while it's 1-3 feet deep, it will appear to have some effect, perhaps you'll move stuff around to make it seem level, and by spring you'll have an extremely bumpy mess as the base settles over winter. You can only effectively compact a thin crust (4-6") over a pile that deep. The base will be unsettled under that crust.
If you spread gravel/stone before you get the base resolved, you'll need a lot more gravel/stone in spring to fix the holes.
Comment: Compact it like a professional, or you're at this for the next five years, +1. But I'd just call the truck, have it dumped, spread it, drive on it, and repeat. Compacting is like... work.

mounded dirt prep for gravel driveway?


How to render blender hair and skin on the same mesh?

Question: I'm somewhat new on Blender, basically all youtube or Stack Exchange taught, so I'm not the best at all at rendering things...I got the hair rendered, but it's on the same mesh as the body, which I want to texture paint and render...how do I do that? Thanks!
Answer: You can assign several materials to a mesh.
To do that :

Go to edit mode (use face select mode Ctrl+Tab then 'face' as materials are applied to faces, but you are already in this mode here)
Select your hair surface using the group you have already created for the particles
Invert your selection Ctrl+I : the non hair part is now selected
Create a new material using the 'plus' sign in the material panel
Then click on 'assign'
You can then check that the assignation is ok : deselect all, then click 'select' in the material panel

Now you simply need to create your material (click on 'new' as this new material slot is selected), mark seams, assign a texture, etc. The same way you probably have already done it for the dress

Note : an alternative is surely to separate the scalp part. If you prefer that :

In edit mode select the scalp (using the group)
Duplicate it Shift+D
Then separate it P then 'selection'

In that way, you can have the hair and the scalp skin also. But here your hair is very dense and the scalp skin is not visible, it seems... so this is as you whish.
Another point. You have a lot of subdivisions with the subsurface modifier. You may lower it a bit and use the 'smooth shading' on your mesh. You will save a lot of calculation time, specially during the rendering. But this advice is totally optional !


How to set frame range independently for each camera

Question: blend file which contains multiple camera. Each of this camera will render its own specific frame range. How can i do this without each time have to edit the global frame range ?
Comment: Possible duplicate of [How can I make a camera the active one?](https://blender.stackexchange.com/questions/3502/how-can-i-make-a-camera-the-active-one)
Comment: @Leander don't think this is a dupe. Explained as a note on my answer. That said could be that an answer from dupe eg using markers to set active camera is the approach taken by OP.
Answer: Property getter and setter.

Quick test script.  Wires up a property on the scene, that using uses a get and set method to retrieve data from scene camera if set. The frame start and end properties of the scene are set within the getter.
Ultimately would recommend a corresponding boolean property to turn behaviour off or on.  Changing the output folder based on camera. This will avoid overwriting overlapping camera frames.
<code>import bpy
from bpy.props import IntVectorProperty
context = bpy.context
scene = context.scene
'''
# set defaults test code
cam_objs = [c for c in scene.objects if c.type == 'CAMERA']
for c in cam_objs:
    c["cam_range"] = [1, 250]
'''
def get_res(self):
    if self.camera:
        fr = self.camera.get("cam_range", (1, 250))
        self.frame_start, self.frame_end = fr

        return fr
    return (0, 0) # no scene camera

def set_res(self, value):
    print("setting", value)
    self.camera['cam_range'] = value

bpy.types.Scene.cam_frame_range = IntVectorProperty(
        name="Camera Frame Range",
        size=2,
        get=get_res,
        set=set_res,
        )

def draw_cam_range(self, context):

    scene = context.scene
    if scene.camera:
        layout = self.layout
        '''
        if scene.get("cam_range"):
            row = layout.row()
            row.prop(scene.camera, '["cam_range"]')
        '''
        row = layout.row()
        row.prop(scene, "cam_frame_range")

bpy.types.SCENE_PT_scene.prepend(draw_cam_range)
</code>
Note using this method fires off a lot of depsgraph events while displaying the panel.
On the possible duplicate How can I make a camera the active one?  the logic here is counter. Setting frame range from active camera as opposed to setting active camera from frame (marker).
Comment: Cool... thanks a lot. This is what i'm looking for . The script works perfectly ! I think Blender should have this basic feature as an option so i can use global frame range or override by this per camera range.
Comment: It is novel.  Re global range, there is the preview range available. (icon button on left of frame start) In hindsight might have been the go to wire this thru preview render, keeping scene frame start / end constant until user set.


annotate cannot find rake executable

Question: I'm using ctran/annotate_models to annotate my models and route files.  I'm now getting an error:
$ annotate -r
$ROOT/usr/lib/ruby/gems/1.9.1/gems/bundler-1.0.10/lib/bundler/shared_helpers.rb:151:in `block in cripple_rubygems': can't find executable rake (Gem::Exception)
from $ROOT/usr/lib/ruby/gems/1.9.1/bin/rake:19:in `'
Route file annotated.

...with the result that annotate adds the comment block to config/routes.db, but the comment is empty.  The message suggests that annotate can't find rake, but rake is certainly there:
$ which rake
$ROOT/usr/bin/rake

and here's what rake says about the current configuration:
$ rake about
About your application's environment
Ruby version              1.9.2 (x86_64-darwin10.6.0)
RubyGems version          1.3.7
Rack version              1.2
Rails version             3.0.5
Active Record version     3.0.5
Action Pack version       3.0.5
Active Resource version   3.0.5
Action Mailer version     3.0.5
Active Support version    3.0.5
Application root          .../myapp
Environment               development

The only things that's slightly odd in my Gemfile is that I am specifying a previous version of rake:
# file: Gemfile
source 'http://rubygems.org'
gem 'rails', '3.0.5'
gem 'rake', '0.8.7'             # workaround "uninitialized constant Rake::DSL" bug
...
gem 'annotate', '2.4.0'

Any ideas of what's wrong?
Answer: Try using bundle exec rake instead.
Comment: I typed `bundle exec rake` and got the same error message.  But perhaps I didn't understand your comment: try using `bundle exec rake` instead of what?

annotate cannot find rake executable


Text field exploit

Question: If a web application form contain few textbox fields. Among one should accept only 4 digit according to business logic. But it's taking more than 4 digit values. Is there any potential vulnerability here?
Answer: It depends on the backend. If the application logic validates on submit, there's no problem. The developers must implement server-side checks, because bypassing client-side protection is trivial, as the example you saw.
Client-side validation must be used only for avoid losing client time. Any and every client-side protection can be easily bypassed. Javascript, max-size, they don't matter.
Answer:
Is there any potential vulnerability here?

Yes but it depends on how the data from that field is used and how (or if) it is validated and sanitised server side. For example, careless use could lead to overflow errors that might be exploitable.
Note that HTML5 includes many features for client-side validation of input fields that can help.

specific input types for numbers.
min and max attributes.
pattern attribute.

But you should always also do server side validation/sanitisation of data and especially take countermeasures against SQL-injection and similar attacks. client-side validation is mainly for acheiveing levels of responsiveness and user-friendliness that cannot easily be obtained with server-side processing.
Comment: Client-side validation must be seen only as a convenience factor, not security, as any attacker can trivially bypass any protection with ease...
Comment: @ThoriumBR: We are in agreement on this, I specifically address this in my final paragraph.

Text field exploit


Why are sea dwelling mammals less aggressive than land dwelling mammals?

Question: Many mammals on land seem to be quite dangerous to humans: e.g., tigers, lions, elephants, hypos etc. However, their sea-dwelling counterparts (e.g., orcas, dolphins, sea lions, whales etc.) are relatively friendly to humans (and in contrast to say sharks). Is there a simple reason for this?
Comment: Is there an objective way to measure friendliness of wild animals?
Comment: There is only one sea mammal specialized in eating seal sized prey and mammals, orcas. Why only one? that's tough, it's the solution to your query. Land based mammals prey substantially on large mammals, bears, big cats, wolves... When mammals size up another animal they think: "what is that animal shape doing? is it a food or a monster?" and "what is that face?" when they look at other animals. When sea mammals sea us they think "that's an alien from another world, he swims like a clown but his face is cool"
Answer: More encounters on land
There are more land animals that meet humans walking around than there are sea animals that meet humans swimming around. If fewer attacks happen on humans in the sea environment, it might just be because there are fewer encounters with marine mammals than with land mammals.
Greater species diversity on land
In your list used as example, you cherry-picked a few aggressive(-ish) land mammals but the vast majority of land mammals are not aggressive toward humans. The fact that there are no marine mammal that are aggressive toward humans might just be because there are too few fewer marine mammal species.
Pseudoreplication and phylogenetic signal
I would argue that your sample size is not as large as you might think. There are only four lineages of mammals that evolve to live in the seas. There is therefore a phylogenetic signal and ignoring it would be a problem of pseudo replication.
For example, I could very well think of territorial behaviour (which is where a lot of aggressive behaviour comes from) as having a strong phylogenetic signal.
Why considering only humans?
Your post title talks about aggressiveness in general and the content of your post talks about attacks against humans. It sounds that considering only attacks against humans to be very unfair. Orcas, typically, are fierce and violent predators although no orcas have ever attacked a human in the wild.
Are they really that friendly to humans?
There has been a number of attacks in captivity (well known cases with orcas). Also, there have been a number of whales attacks against boats (according to this BBC article).
In short...
In short, I think your comparison is unfair. I think you are looking for an explanation for a pattern that does not really exist.
Comment: I think there are actually 4 lineages of marine mammals: cetaceans (whales & dolphins), pinnipeds (seals & walruses), sirenia (manatees and dugongs), and mustelids (sea otters).  Maybe 5, if you include polar bears - which aren't all that friendly to humans.  Wikipedia has a diagram: https://en.wikipedia.org/wiki/Marine_mammal
Comment: Another example of a predatory cetacean would be the sperm whale.  But since they prey mostly on squid that live at depths of 300-800 m or more, you are not in much danger from them.  Unless you are Captain Ahab, of course - and that was pure self-defense on Moby Dick's part :-)  (Yes, I know that's fiction, but it was inspired by actual events, notably the sinking of the Essex: https://en.wikipedia.org/wiki/Essex_(whaleship) )
Comment: @jamesqf Thanks for correcting! I forgot sirenia and the sea otters. I edited the post
Answer: They actually aren't less aggressive than terrestrial mammals. I've heard a lot of biologists talk about this weird trend in marine mammals (and more or less only marine mammals) where for some strange reason, marine mammals have this weird predilection for sexually assaulting other species. Warning, most of the below links are scientific articles or news sources reporting scientific articles, but they can still be a bit explicit due to the subject matter.

Bottlenose dolphins are well known for having sex with just about everything that moves, including other dolphins (of both genders), humans (there is actually a wealth of literature on this), their own parents, and other sea life, including the females and babies of other dolphin species (and the babies of their own, by the by). Gender, willingness, or even the fact of the other individual being alive need not matter. They've been known to drown baby porpoises due to assaulting them so hard, and then continue to have sex with the body. This isn't unique to bottlenoses but has also been documented to some degree in botos (Inia geoffrensis), dusky dolphins (Lagenorhynchus obscurus), and Hector's dolphins (Cephalorhynchus hectori). It hasn't been documented yet in orcas, though this is probably a tracking issue more than anything else.
There's actually some evidence that dolphins may not be attacking other marine life for any definable survival or directly Darwinian reason, but are doing it for fun (or, from an etho-evolutionary perspective, the play behavior of killing or assaulting other marine life gives dolphins practice for when they commit infanticide on their own kind). Dolphins, at the very least, are some of the few animals aside from great apes that are known to perform non-copulatory reproductive behavior for pleasure.
Sea otters are well known for sexually assaulting and raping female sea otters, and frequently they will do this to baby seals as well. They are so rough about it the females and baby seals often drown, and again like the bottlenoses the otters continue copulating with the body
True seals aren't perpetual victims of this, as grey seals have been observed sexually assaulting seals of other species
Elephant seals also get in on the act, though so far only with their own species.
Fur seals (a relative of sea lions, rather than true seals) have been observed chasing down and forcibly copulating with penguins. They sometimes eat them afterwards.

This is seemingly commonplace among marine mammals, and nobody really knows why. Some of it definitely seems to be purposeful rather than the result of misplaced instincts, at least the way the researchers in the primary literature listed in the articles linked describe it. However, you almost never hear about this among terrestrial mammals. The only thing I've heard close to this is how traumatized young bull African elephants have been known to kill adult rhinoceroses and try to copulate with the dead body, and in that case it's clearly not normal behavior for the species.
So in at least some ways marine mammals are violent in ways that terrestrial mammals rarely are, and at least some of this (in the case of dolphins) is directed at humans.


Read only field not working in page layout

Question: I have custom object called candidate. I have created field name called first name which is read-only in the page layout. Once a record is created with first name field populated I am able to edit that field. Why I am able to edit (I mean getting pencil icon). Can anyone suggest me for this issue?
Answer: Are you doing this as a system admin?
System Admin profile has the option "Edit Read Only Fields" under "Administrative Permissions" and this means that profile is always able to edit read only fields.
Try logging in as a user with a different profile.
Answer: By Default Sys Admins can edit the Read Only field marked in Layouts. So you can check this using by using a different profile first.
If you need to make some field mark as read-only for Sys Admins then you have to go to Object Manager-> Select Object -> Fields & Relationships-> Select the Field and on the top, there is a button called 'Set Field Level Security'.
And there mark the check box read-only for the Sys Admins.


How can I get unpublished drafts in my plugin?

Question: I'm building a widget where I want to list all unpublished drafts (made by users without access to publish live changes), but I can't figure out how to get them.
Answer: Depending on what you want to do with them you can request them using craft.entries but you'll probably need to change the status to pending.
If this doesn't work you'll need to fetch them through a custom controller/service that goes in and fetches the entry model and returns a list that fit you criteria.
Hope this helps.
Answer: Drafts store rows in the craft_entrydrafts table, relating to an entry, providing some context (author, date, notes), and serializing all the pending content into a data column. Craft normally gets drafts only as they relate to a specific entry, so you'll need to provide your own method of retrieving them all.
The EntryRevisionsService class has a method called getDraftsByEntryId(), which can be modified slightly to return all those draft records rather than ones limited specifically to a given entry:
public function getEntryDrafts($localeId = null)
{
    if (!$localeId)
    {
        $localeId = craft()->i18n->getPrimarySiteLocale();
    }

    $drafts = array();

    $results = craft()->db->createCommand()
        ->select('*')
        ->from('entrydrafts')
        ->where(array('locale = :locale'), array(':locale' => $localeId))
        ->order('dateUpdated desc')
        ->queryAll();

    foreach ($results as $result)
    {
        $result['data'] = JsonHelper::decode($result['data']);

        // Don't initialize the content
        unset($result['data']['fields']);

        $drafts[] = EntryDraftModel::populateModel($result);
    }

    return $drafts;
}

Each result will be an EntryDraftModel, so use the draftId parameter if you'd like to link directly to that draft as you'd normally see it in the control panel. In a Twig template, for example, that'd look like {{ draft.cpEditUrl ~ "/drafts/" ~ draft.draftId }}.


Dry gurgling from shower drain

Question: I just randomly heard a loud "dry" gurgling coming from my upstairs shower drain. It was draining slowly (assuming due to all the hair from a house full of females) so we have been using the basement shower. This particular shower hasn't been used in months. I haven't used the toilet or sink in this bathroom in about 2 hours and then I hear this weird sound. Is it possible to hear it from the clogged pipe hours after I used any other bathroom appliance?
Comment: Please [take the tour](https://diy.stackexchange.com/tour) to learn how this site operates. If you have new information it should go in your question post, not in a comment.
Comment: Yes. Did you have a more specific question?
Comment: Just everything I've been reading about the noise and clogged drains says if you hear it "shortly after" or "immediately after" and it was atleast 2 hours since any toilet or sink were used in the bathroom.. and that the toilet and sink drain fine.. so it could still be just from the clogged drain?
Comment: Sometimes clogs dissolve slowly or simply slip through on their own schedule.
Comment: Now our toilet bowl water levels are low
Answer: If the shower has not been used for a long time, the water in the P-trap under the drain  will evaporate, so you no longer have a seal against the sewer lines. So anything else that drains into the sewer will make sound that can now come back through that shower drain. That by the way would also be letting sewer gasses back into your house, which is not good. Pour some water into that shower and see if the sound goes away.
Answer: Sounds like a sewage issue in the drains..if it continues you may find sewage backing up into a lower drain area. Under a heavy load the water can litterally suck the toilet bowl dry. Rent a snake and send down the drain to clear clog or try some drain cleaner. A house full of women 1 might have flushed something that should not have been flushed

Dry gurgling from shower drain


Negative sigma Multivariate variate normal distribution

Question: I want to use the mvrnorm function in R, but I get an error that my sigma is negative.
I created some data and used log likelihood functions to estimate the best parameters for my model. I now want to test if these parameters are significantly different from zero. I thought to do this by making use of the mvrnorm function and than do a t-test for every parameter. For the mvrnorm I used the estimated parameter as the mean and as covariance matrix the inverse of the information matrix. However I get an error while running the mvrnorm that my sigma matrix is negative. How can I now test if my parameters are significantly different from zero? Should I make the sigma matrix positive definite and if so how can I do this?
Comment: Let's consider a special case of your question, where the dimension is $1.$  You are asking "I'm passing a negative variance to the software, but it gives an error.  What would be the best thing to do to make the variance positive?"  The answer is to supply  a positive variance.  There's nothing else we can tell you!
Comment: 'm just guessing here but I think the issue is that the numerical optimisation of the log likelihood didn't converge to an optimum but perhaps instead to a saddle point. This can easily happen if you use Newton's method. When you invert the negative of the observed fisher information matrix, you then get something which is not positive definite. Perhaps better starting values will solve the problem
Answer: You can simply perturb your original matrix by adding small diagonal elements, i.e. $A\leftarrow A+\mu I$, where $\mu$ is chosen a small value to guarantee the PD property. You can simply try out some values.
Another alternative can be using make.positive.definite method in package corpcor, which implements the algorithm provided here. In his blog, the author of the algorithm also provides other implementations that you can use.
Comment: Although these recommendations can work mathematically, unless they are preceded by careful analysis of the cause of the original problem, I would be concerned that they are just patching over the issue and might be hiding either (1) some other serious difficulty with the analysis, (2) misconceptions, or (3) opportunities for insight.
Comment: another alternative would be to calculate the the generalized inverse $V^-$ of the vcov matrix $V$ (see https://stat.ethz.ch/R-manual/R-devel/library/MASS/html/ginv.html) and calculate the test statistic by hand $\hat\beta^\prime V^{-}\hat\beta\sim\chi^2_{k}$, where $\hat\beta$ is the $k\times 1$-vector estimates.
Comment: I tried the make.positive.definite method, however when I than take mvrnorm for n=1000 and let it print it results, it gives 1000 times te same value for one parameter.. Can it be that this problem comes form using make.positve.definite?
Comment: try changing the tolerance argument, i.e. 'tol'


Cruise control switch 2008 Jeep Compass

Question: Could anyone tell me how to replace the cruise control switch on my 2008 jeep compass? Where it is on the steering wheel is a bad place. I got into my car and smacked it with my knee and broke it. I have a Haynes manual but it tell me nothing. I have also search youtube and the internet. I just need to know if i should take it somewhere or is it simple enough to do myself. Thanks.
Comment: It's usually pretty simple to replace, but I've never done it on a Compass. Look on YouTube for "turn signal stalk" or "multi-switch" ... maybe your Google Fu just wasn't kicking in. :o) I'd look for you, but I'm only on my phone app.
Comment: THANK YOU for the guide you posted. It was invaluable. I would add that a #25 Torx head bit, is the essential bit. The bolts on either side of the steering wheel to remove the air bag, are 10mm. :) I had to go looking for the right size torx bit & those can be really fun if you aren't sure where they went. ;) Leslea in Alberta.
Answer: You'll have to remove the airbag from the steering wheel.  There are screws on the side.
You MUST disconnect the battery negative terminal and let the vehicle sit for a few minutes before proceeding.

Disconnect the electrical connector for the horn bracket and remove the 3 screws.

Disconnect the cruise control stalk electrical connection, and the small screws that hold it.

You may have guessed it:  Assembly is simply the reverse of removal.

Cruise control switch 2008 Jeep Compass


Content not found Facebook

Question: I have created my app page on Facebook. I have added the required setting like Google Play Package Name, Class name and key hashes but still when try to access that app page it is showing below given error instead of taking us to play store. I have search a lot in web but did not get the relevant post. But I assume this issue can be fixed by Facebook settings. I would really appreciate any suggestion.
Answer: Either they deactivated or deleted their account, got suspended by Facebook or else they blocked you.
Answer: Any of these could be a reason:

Could be a browser problem. Try to delete cache of the browser and try to open with other browsers or other systems.
Unpublished your page and Published your page again. See this.
Could be a reason Facebook has removed the content of that page and now you can not access it.
Comment: Actually its play store URL. When clicking on that app page it should redirect to play store

Content not found Facebook


Why is my Nikon 18-200 lens not focusing at higher focal lengths?

Question: My Nikon 18-200 lens on a D300 camera will not focus when it is zoomed between 135mm and 200mm. Is there any tips on how to solve this besides handing it in to a photo store?
Answer: There really isn't all that much you can do with lenses yourself without making things worse. It sounds like something mechanically is wrong, and the only way to fix that is going to be to open up the lens.
I would take it to a Nikon authorized repair shop. If you are in the US, this form will take you to the list of authorized repair shops.
Comment: +1, but I'd send it to Nikon. These modern zoom lenses are insanely complicated and the store may not have the appropriate tools/parts/skills (and they might send it to Nikon anyway). Good luck!
Comment: That's what I tought. I will contact the store next week. Thank you :)
Comment: Not a helpful answer.
Answer: Just a note.  I found this thread while researching the same issue, though the range that wouldn't focus for me was more like from 80ish to 200.  After reading the comment by GRM, I investigated my lens and found the front element to actually be loose, having backed out on its threads.  As I never take the UV filter off, I never would have found this with out GRM's comment.  I tightened the element snugly, trying to resist my urge to torque the crap out of it, restored my UV filter to its rightful place, and bam.  Autofocus issue appears to be fixed.  Thanks, GRM.
Comment: Thanks to James Duncan for his solution, which solved the problem instantly. My front element was loose, so I gently snugged it down (about one full turn clockwise) and VOILA, problem solved. My lens now focuses at all focal lengths. There is a notch in the outer ring of the front element (on the outside); I just placed a fingernail in the notch and gently turned until it stopped. What a relief!
Comment: To James Duncan; thanks that is the same thing that was wrong with my lens. No need for the repair shop. Wow just that one little thing. Thanks
Comment: OMG.... thank you so much James Duncan.
The same thing happened to me recently on a Tour of Norway searching for The Northern Lights; which was incredibly poor timing :( I just checked the inner ring of my lens and it was incredibly loose. I tightened it 2-3 revolutions and now focussing perfectly again, YAY :)
Comment: I had the same issue: Nikon 5100 couldn't focus when my 18-200mm lens was zoomed in very far. This started happening while I was on vacation in Europe, so it was terrible timing. Fortunately, I came across this post, removed my UV filter, tightened the inner ring on the very front of the lens, and presto! Instantly fixed for free, just in time for several days in Amsterdam! Thank you (or, as they apparently say here, Dank u wel for alles!)
Answer: I also tightened up to outside element and it fixed the problem immediately.  The element has to be tightened using the inner ring, not the outside of the lens.  As mentioned previously, look for two notches adjacent to the lens glass and use these to screw the element back into position.  It works!
Comment: @AJ He: Sorry to hear that. I went to school in Troy, and we used to say that New York City was the butt end of the universe and Troy 120 miles upriver (slightly toned down to not get deleted here). To be fair, there are actually a few nice sections of Troy, but not anywhere students could afford the rent. One summer I lived on 8th street, which is where the police were afraid to get out of their cruiser and would only talk to people outside thru the slit formed by rolling down the windown one inch.
Comment: Welcome to Photography on StackExchange.  Always nice to see another New York stater.  I live a ways up the river from you in Troy (Albany area).
Comment: @OlinLathrop - RPI grad?  I'm class of '06.  I live in a nice part of town in South Troy.  RPI's also been dumping a lot of money in to cleaning up more of Troy, so it is getting better even in the historically shady parts.
Answer: I have experienced the EXACT same issue. I sent it to repair and they said that the top had to be screwed  back on. I have also read that this could be caused by dirty contacts so you can also try to clean them.
I have seen some articles about this on different forum so I guess it's a rather common problem and you shouldn't pay anything to get it fixed.
Answer: Send it to Nikon, if you have a USA lens, most likely you have a 5 years warranty on your lens. This can mean free repair.


Reference request quantum SU(3)

Question: Woronowicz shows that the C*-algebras of quantum $SU(2)$ are isomorphic (only as C*-algebras, forgetting the quantum group structure). Are there similar results for quantum $SU(n)$ for $n \geq 3$?
Answer: For SU(3), there's [1]. The general case is not fully worked out yet, I guess.
[1] Nagy, Gabriel; A rigidity property for quantum SU(3) groups. Advances in geometry, 297–336, Progr. Math., 172, Birkhäuser Boston, Boston, MA, 1999.

Reference request quantum SU(3)