Installing 50 amp Hubbell receptacle on wall inside fully finished garage to charge Tesla

Question: I have 50'of Romex 6/3 wire, 50 amp Square D breaker and a Hubbell 50 amp receptacle - that I want to install with metal conduit on the inside of my garage on wall by car.  The 100 amp sub panel box is on outside of garage in stucco wall about 35' (total run) from where I want to place the receptacle - so I will have to go up outside wall with conduit into attic - which is accessible by pull down ladder - and run 6/3 wire above insulation on rafters to where it will go through finished ceiling in garage, and down the wall with metal conduit into metal receptacle box. Do I have to protect that 6/3 Romex copper wire with some kind of oversized conduit like 1" flexible metal conduit or liquid tight 1" flexible conduit???  Thank you
Comment: In conduit, (becasue it's normal to have devices that have 75°C terminals at this size class, and you are not limited to 60°C by using (most) cable) this can be #6 aluminum wires and save a lot of money .vs. knee-jerking to copper. Or you can go to #4 aluminum wires and *still* save a lot of money. Enough to buy the conduit and then some, most likely.
Answer: NM-B cable is not allowed outdoors, not even in conduit.  UF-B cable is, but it requires enormous conduit - 6/3 requires 2" conduit for Pete's sake.   If conduit is continuous between panel and interior box, you can run THWN individual wires which are easy to wire and easy to change. Neutral is wasted on an EVSE but an RV socket requires it.

Review Technology Connections' excellent video on this topic. I've cued it up to the part about sizing your charging circuit.
Please consider two critical things:

hard-wiring the EVSE (i.e. using a Tesla Wall Connector instead of the granny/travel charger)
Thinking carefully about the ampacity of the charging circuit, particularly relative to what your house is capable of, vs what you actually need.

When they sell you an EV, they typically "throw in" what's called a "granny charger".  That name is wrong.  It is actually a travel charger intended for "opportunity charging" on road trips or unexpected situations. And they give you the 2 plugs you're most likely to find on the road -- the common 120V plug, and also, the common RV (Recreational Vehicle) plug found at RV campgrounds.  That's what it's for and nothing else.  The travel EVSE belongs in your trunk for use in a pinch.
But this has created a number of misconceptions:  That NEMA 14-30 is the standard EV socket (no: it's the standard RV socket).  That EVSE's should use enormous plugs (no, hardwired is better).  That your car "needs" to charge at "50A" (LOL no, that is gross overkill for almost any car, but especially for a Tesla).
In fact, trying to charge that high is dangerous in many homes. The house's service is not ready for the load.  And since cars don't actually need it, why do it?
A common 20A circuit, bumped to 240V, will give you 4KW charge rate or 120 miles restored in a conservative 10-hour overnight.  Think about it. That's plenty. Even if it wasn't, literally 5 minutes at a Supercharger will get you the rest of the way.
So you don't need a 50A circuit or probably, even a 30A circuit. Feel this getting easier?
Ampacity / available service at the house
You must begin by doing a Load Calculation on the service, per NEC Article 220. Many city governments have a worksheet to help you do this. Many commercial websites also have fake articles on this topic; a proper Load Calculation starts with "3 VA per square foot" and 1500VA for kitchen and laundry circuits, and then looks at 240V appliances.
Once you have a Load Calculation, you can compare that to your service size (the size the power company has sized their delivery wires for; typically same as the main breaker) ... and that will tell you the max for the EV breaker.  (note that EVs actually charge at 80% of breaker trip, so 32A on a 40A circuit).
How do you tell the charger what amps it can safely pull from the house?  With the Tesla Wall Connector, you dial it to anything as part of the Commissioning Procedure.  With the travel EVSE, they sell 8 different dongle plugs, and the plug actually contains a microchip which tells the car the ampacity of the plug. (e.g. 20A for a NEMA 6-20 plug).
If you just use the travel charger with 50A socket as you plan, that socket is also used on 40A circuits, so the EVSE assumes 40A and charges at 32A actual.  So you don't even get "50A" (40A actual) out of it.
What keeps you from overloading the house? On old Rule of Six "6 main breakers" panels, nothing but the Load Calculation. Really. On panels with a single main breaker, that helps, but really the Load Calculation should be reviewed as part of pulling the permit.
Remember the part where I said EVs can charge very comfortably on a 20A/240V circuit?  Yeah, that's a lot easier to get by the inspector, since it wires exactly like a normal household circuit with normal #12 Romex.

240V at 15 or 20 amps is just that easy.
EV charging does not require neutral. BUT: If you install a receptacle that does have neutral, such as a NEMA 14-50, 14-30 or (outlawed) 10-30 -- then you must run neutral to the receptacle.  It will be wasted, but it's necessary in case somebody plugs something else into that receptacle.  Plugging an RV into a 14-50 that didn't have neutral would fry every electrical appliance on it.
About hard-wiring
NEC 2020 requires that 240V circuits that go to a socket be GFCI protected, and the only way to GFCI-protect a 240V circuit is with a costly 240V GFCI circuit breaker. Which notably, takes 2 full spaces in the panel.   So stepping away from the socket can save you some coin. It also removes true stupidity, since all EVSEs already contain a "smart GFCI" capable of resetting itself, and some can signal you that they're having problems.  Putting a dumb GFCI on an EVSE breaks those abilities.
Also, flimsy $10 30-50A sockets are just not designed for repeated insertions, and the better $50-60 30-50A sockets are strongly recommended.  That's not a problem with 20A sockets, since they are just normal sockets with a twist!
Also, using the travel charger as your daily EVSE gets old real fast and people want a wall-mount unit.  The Tesla Wall Connector is an absolute bargain at $400 (contrast with ClipperCreek or Siemens units, and contrast with the cost of GFCI+expensive socket+special dongles), supports hardwiring, and supports any ampacity so you can Definitely use it safely regardless of what your house can support.
The only rub is that hardwired things require a disconnect switch reasonably nearby and definitely in line-of-sight. Your panel breaker won't do because it's on the wrong side of the wall.
I really want to march forward with 50A, though
Well actually, your 6/3 NM-B cable is rated for 55A and can be breakered at 60A.  But you can only plan to use 55A.
OK, if your house is ready for it!  I would still recommend a wall unit and I'd still recommend hard-wiring.   Especially because 50A, with wall units, prepares you for having two EVs.
Hard-wired, you'll have a disconnect switch. For two EVs, swap that out for a 4-space subpanel which serves as a disconnect for both wall units.  Then, put two 60A breakers in there. Say whaaaaa???
Really. The Wall Connector 2.0 and 3.0 have a feature that others call "Share2".  It allows 2 Wall Connectors to share one power allocation.  You commission (or re-commission) the units and set up one as the Master and the other as Remote, linked to the Master. You tell the master "You share 55A" or whatever you have available.  The two units will then dynamically split the power between any EVs plugged in. If only one EV is plugged in, it gets the works. Otherwise they split. If one is tailing off at end of charge and pulling only 10A, the other gets 45A. Etc. It does this on the fly.
Pretty clever, if not embarrassing that it uses basically mid-1980s technology to do it LOL. I could have coded this functionality on an Apple II (or Arduino today).
Answer: You've got a few different issues:

Protecting Wire/Cables (what you actually asked about)

Generally speaking, wires need to be in conduit and cables don't. But cables in certain locations outside of walls need to be protected. That can be large conduit or it can be wood or something else placed around it to protect it.

Cable Outside

Only certain types of cable are allowed outside, because outside is considered a wet location. When we use the brand name "Romex", that normally refers to cables designed for inside use. If you are using that as a generic term for "any cable" and the cable you have is rated for outside/wet use then you are OK. If not then you can't use it outside, even if it is physically protected.
If you have to get new cable, you should seriously consider individual wires and using conduit for the entire distance.

Receptacle

Generally speaking you do not need to use a plug and receptacle with an EV charger. A hardwired connection:

Saves the cost of a receptacle and plug/cord. (OK, not necessarily a savings because if not near the breaker panel you will need a disconnect.)
Avoids the requirement of separate GFCI protection. That protection, practically speaking, has to be at the breaker. You don't generally have the easy (and inexpensive) option of GFCI/receptacle that you have for 120V 15A and 20A receptacles. This is not a requirement everywhere yet, but it is, I believe, a requirement in NEC 2020. My electrician can tell you a horror story he had recently with one customer who insisted on an EV receptacle and he couldn't just hardwire it because the customer has not yet selected the EV equipment. He came very close to having to physically modify a breaker to make it fit or install a subpanel (right next to the main panel) in order to use a different brand of breaker. In the end he found a just-released newer GFCI breaker for the panel. But the point is that hardwiring avoids the issue as (a) the requirement does not apply and (b) EV equipment includes GFCI protection.
Provides a neater, simpler installation.
Answer: New code requires garage receptacles to be GFCI protected, either at the breaker or receptacle.
Most/all EV chargers can be hard wired to the panel and eliminate the need for having GFCI protection, besides what the chargers provide.
By code cables need protection below 8 feet from floor. in conduit or inside walls.
Comment: There is no such thing as a 240V GFCI receptacle. *Oh wait. A wall-mount EVSE **is** a GFCI receptacle. However that only satisfies the requirement if it's hard-wired*.
Comment: It will be interesting to see, once NEC 2020 gets more traction, whether some of the most common 240V receptacles start being available in GFCI versions - particularly 14-30. On the one hand, it should be cheaper than a GFCI breaker. On the other hand, *most* people who would bother would be when doing major renovation to a house or a heavy-up - and in those cases the breaker would just be one of many.


Explanation of Lagrange Interpolating Polynomial

Question: Can anybody explain to me what Lagrange Interpolating Polynomial is with examples? I know the formula but it doesn't seem intuitive to me.
Comment: The formula is constructed so that the polynomial necessarily goes through the points specified.  [Examples](https://en.wikipedia.org/wiki/Lagrange_polynomial#Examples).
Answer: The Lagrange interpolating polynomial is a tool which helps us construct a polynomial which goes through any desired set of points.
Lets say we want a polynomial that goes through the points $(1,3), (3,4), (5,6)$ and $(7,-10)$.
First we define the polynomial $P(x)=(x-1)(x-3)(x-5)(x-7)$. This has roots at the x-coordinates of each of the points we want to interpolate. Then we construct the following polynomials from this,
$$f_1(x) = P(x)/(x-1)$$
$$f_2(x) = P(x)/(x-3)$$
$$f_3(x) = P(x)/(x-5)$$
$$f_4(x) = P(x)/(x-7)$$
Notice that in particular $f_1(x)=(x-3)(x-5)(x-7)$. This function has the following property: It is zero at $x=3,5,$ and $7$ and nonzero at $x=1$. This means that it is "on" when we are at the first x-coordinate and "off" at the others. Each of them are designed to work this way.
Now consider the following expression,
$$ L(x) = 3 \frac{f_1(x)}{f_1(1)} + 4 \frac{f_2(x)}{f_2(3)} + 6 \frac{f_3(x)}{f_3(5)} -10 \frac{f_4(x)}{f_4(7)} $$
Notice that this functions goes through all four designated points. When we plug in the desired value of $x$ only one of the four functions $f_j$ is turned on and the others are zero. The coefficients are designed to force the expression to equal the corresponding $y$-coordinates.
In particular consider $L(5)$,
$$ L(5) = 3 \frac{f_1(5)}{f_1(1)} + 4 \frac{f_2(5)}{f_2(3)} + 6 \frac{f_3(5)}{f_3(5)} -10 \frac{f_4(5)}{f_4(7)} $$
$$ L(5) = 0 + 0 + 6 \frac{f_3(5)}{f_3(5)} -0 $$
$$ L(5) =  6 \frac{f_3(5)}{f_3(5)} $$
$$ L(5) =  6 (1) $$
$$ L(5) =  6 $$
So we have the desired point $(5,6)$. Try explicitly writing out the polynomial and plugging in the other points to really see it work.
Comment: This explanation makes a lot of sense. It's really unfortunate that it's the other answer here that both Wolfram Alpha and Wikipedia have. Wikipedia's at least I can fix.
Comment: Wow! Thanks a lot for the explanation Sir!
Comment: My pleasure, I remember these being really confusing when I was first introduced to them.
Answer: Linear interpolation consists of approximating a function $f(x)$ as
$$f(x)=\sum_{i=1}^{N}a_i \phi_i(x)\;\;\;\;\;\;\;\;\;\;\;(1)$$
where the $a_i$'s are the interpolation coefficients and the $\phi_i$'s are prefixed interpolation functions.
Lagrange interpolation, which is one of the simplest and mostly employed interpolation methods, consists of finding the interpolation coefficients as the solution of the linear system
$$f(x_j)=\sum_{i=1}^{N}a_i \phi_i(x_j), \;\;\;\;\;\; j=1,\ldots,N\;\;\;\;\;\;\;\;\;\;\;(2)$$
where the $x_j$'s are interpolation points.
A common case is when the interpolation functions are polynonials, say
$$f(x_j)=\sum_{i=1}^{N}\alpha_i x^{i-1}_j, \;\;\;\;\;\; j=1,\ldots,N.\;\;\;\;\;\;\;\;\;\;\;(3)$$
The determinant of such a system is a Vandermonde determinant which is always non-vanishing and therefore the system always admits a unique solution, provided that the interpolation points are all different. Accordingly, polynomial Lagrange interpolation is always unique.
Polynomial interpolation functions in eq. (1) can be found by assuming that $\phi_i(x)$ is a polynomial of degree $N-1$, that $\phi_i(x_j)=0$, $j=1,\ldots,N$ and $j\neq i$, and that $\phi_i(x_i)=1$. Accordingly,
$$\phi_i(x)=\prod_{j\neq i}\frac{x-x_j}{x_i-x_j}\;\;\;\;\;\;\;\;\;\;\;(4)$$
and
$$f(x)=\sum_{i=1}^{N}f(x_i)\prod_{j\neq i}\frac{x-x_j}{x_i-x_j}\;\;\;\;\;\;\;\;\;\;\;(5)$$
Reference: N.S. Bakhvalov, Numerical Methods, Mir Publishers Moscow, 1981.


Are vocal critique questions acceptable?

Question: Are questions which have an audio/video recording with the request for critiquing of vocal performance acceptable? I think this can be generalized based on the response dealing with common problems.
Comment: @yo' Downvotes on meta are different--they usually just indicate an opinion in the negative. I.e. whoever is responsible for the downvote just thinks that "no, those questions would not be appropriate for the main site."
Comment: I really really do not understand the downvote. I would understood it if an off-topic question was actually asked, but this is just a request on advice. Especially in a beta site, completely reasonable one.
Comment: @NReilingh Which would, IMHO, be the appropriate thing to do if it was a feature request.
Comment: @NReilingh But this is a question, asking for us to give opinions. The downvote means effectively nothing, and it prevents the question to reach the sidebar. Some people just downvote because they don't like the question, the asker, or they don't want the question to reach the sidebar (maybe they are involved in a non-positive way). It happens in all meta SEs.
Answer: Critiquing a performance would not be appropriate as all the response would be completely opinionated and subjective. If these were allowed, how would the user select a correct response? The one with the most up votes? This kind of thing is better left elsewhere.
Comment: In addition I disagree with OP's idea that it could be generalized.  Even if the answers identify and address common issues, that doesn't affect the question -- which would be completely unsearchable and useless to others.
Comment: @MatthewRead perhaps OP meant that the submitted recording might be held as an example of common problems that other's may also learn from.  It would be hard to reference or research though (which I think is what your are saying) - as the identified problems would only be in the answer's and not in the question and the answers would only be useful to those who listened to the recording and read the answers and found the identified problems to be problems they had as well.  So the value would occur only through happenstance and accident.


Configure multiple web application over ssl including apps without using wildcard certs

Question: Let's admit it wildcard certs are evil (unless you can convince me otherwise, highly doubtful). for the past few months I've been thinking of ways to set up my SharePoint 2013 apps environment without using wildcard certs. I already have apps working over http and also already have multiple web applications running on the same port 443. Due to architecture of apps I'm having a hard finding a solution, there's gotta be one. Thank you for your suggestions and answers; anything will head.
Answer: Managing multiple web application over SSL is not an easy talk for developers.
Wildcard SSL - It allows developer to manage and secure unlimited number of sub-domains or apps (if App domain is a sub-domain) with single certificate.
The other solution is Multi Domain SSL
Multi Domain SSL will allow developer to manage and secure multiple domains/apps over SSL with single certificate.
Comment: Thank you Laura, however due to the security risk of wildcard certs, I'm trying to stay away from them. As you know they can be worse than self-signed certificates in a production environment. Multi-domain SSL unfortunately will not work in these situation since in SharePoint 2013 apps we don't don't know what the sub-domain will be until after the app is created. Also, it changes every time the app is installed on a site collection.
Comment: Well, If you are choosing Multi domain SSL, you can add, edit or delete your domains.

But Each time you add, edit you need to reissue the certificate from your certificate authority.

If you are purchasing Comodo Multi domain SSL, it will let you to add up to 2005 multiple domains names with single certificate (To add an extra domain you only need to purchase SAN cert)... So if your Domains are not more then 2005 it will be the best option.


Why scope annotations have RUNTIME retention in Dagger 2?

Question: Dagger 2 has compile-time validation, so why do the scope annotations have RUNTIME retention? Why are they needed at runtime?
Comment: Adding to the above, JSR 330 for sure did not have dagger in mind, and there are also runtime dependency injection frameworks that *would* need them.
Answer: Though I don't know for sure, I'd guess that Scopes necessarily have runtime retention because JSR 330's @Scope requires scopes to have runtime retention. (@Qualifier has the same restriction.) Both Dagger 1 and Dagger 2 advertise JSR-330 compatibility, and (as David mentions in the comments) there are plenty of runtime dependency injection solutions that would absolutely require runtime-retained scope annotations.
For Dagger in particular, I can't imagine why they'd actually be read at runtime either, though I suppose some external libraries could make use of the annotation.

Edit from comments + Android multidex caveat
This is not necessarily a problem, legacy or otherwise: Many DI systems configure at runtime and require the annotation. Dagger is notable in that it doesn't, but the spec was not written in a way that allows for runtime retention to be optional. This frees app developers to replace Dagger with a different JSR330 framework like Guice or Spring, and it frees library developers to make DI-compatible tools or frameworks agnostic to whether they are compile-time-configured or runtime-configured. That spec clarity (i.e. without implementation options) and flexibility (compile time or runtime) seems worth the cost of unnecessary annotation retention and the cost of learning.
However, this can be a problem in large Android apps because Android keeps runtime-annotated classes in the main dex by default; older versions of Android fail to load runtime annotations if the annotated class is in a secondary dex. See this bug linked from the keepRuntimeAnnotatedClasses docs for details. Though you could consider this a Dagger problem because of Dagger's applicability to large Android apps, it's more of a bug with Android annotation handling, for which Dagger would need to diverge from the JSR-330 spec in order to handle itself.
Comment: So this is like legacy problem? It does not simplify learning Dagger 2 usage.
Comment: Thanks, you helped a lot.


Pointing domain name to sub directory of an ip address

Question: I need to point my domain.com to x.x.x.x/directory
How should I do this?
this doesn't seem to work correctly, if you are familiar with enjin, then I'm using enjin name servers to do this.
Comment: This cannot be done. DNS only associates a domain name to an IP address. Nothing more. You will need a resolving website defined within your web server first.
Comment: hum this is not really a website anyways I just have a few folders on it and I wanted pretty much to point a sub domain to a sub directory to be exact
Comment: You would have to create the sub-domain within DNS and then again on a web server first. Then you can point the sub-domain to the specific directory.
Comment: I have a question. Why go back to IP addresses? Why not just use a domain name? and if anything special, use different port numbers so you have a website like `example.com:9999/folder1/folder2`
Answer: You need to tell Enjin Guild Hosting the domain that you have registered then you can follow there online tutorial. Basically you don't need to worry about the folder part at your domain registrar because of the way hosting works. All you should concern yourself with is the IP address of the server at Enjin. At the Enjin, there server will have what we call a virtual host file. It'll look something like:
<VirtualHost *:80>
    DocumentRoot /home/enjin-username/public_html
    ServerName www.example.com
</VirtualHost>

If you take a look at the DocumentRoot your notice this is the local path of your hosting package, the virtual host file will use www.example.com in local path of /home/enjin-username/public_html.
You're hosting root directory is /home/enjin-username/public_html. If you make a sub folder with something like a WordPress e.g /home/enjin-username/public_html/wordpress then this would be accessible via www.example.com/wordpress/ if you don't want a sub folder then you move the contents of WordPress into /home/enjin-username/public_html and then delete the WordPress folder.
Basically your  DNS at the domain registrar translate the domain to ip address, then at the server it will take a look at what 'domain' was requested and then path the local path seamlessly all in the background.
Please note that /public_html and username in the path is purely speculation, some hosts use /www, /httpdocs, /public_html and so on.
To confuse things even further there's actually two ways you can set this up. If you plan to use email and other servers then simply change your name servers at your domain registrar to the name servers that Enjin has setup,
The name servers at Enjin are:
ns1.enjin.com
ns2.enjin.com
ns3.enjin.com
ns4.enjin.com

If you plan to use your domain with a third party such as external emails then the more preferable route would be to use the A records method.
Enjin's A records and Cnames are:
Root A Record (@): 126.96.36.199
CNAME record (www): app.enjin.com.

I recommend for ease simply just change the name servers.


laptop internal speakers work but not external

Question: Hello I have a toshiba satellite laptop and the external speakers do not work no matter which speakers I attach none of them will have sound however all of the external speakers work when I plug them into other machines.  My interal speakers are functioning fine.  What could be causing this issue maybe a window update or something else.  I am not too familiar with audo settings and how they effect the speaker output.
Answer: After you plug them in you may have to change the default output device. This can be done in Control Panel under the "Audio Devices" section.
You will see a list of installed devices which allows you to change the default output device:

Some applications also need to be closed and reopened when a new sound device is selected. I know this is the case when using flash in web browsers on my machine.
Comment: what program is that? It looks similar, but not the native Windows one? :S


Virgin Galatic's Weightlessness

Question: Is the gravity pull of the Earth negligible at 50 miles up, or is the weightlessness experience just relative to a falling airframe?
https://en.wikipedia.org/wiki/Reduced-gravity_aircraft
Comment: Gravitational acceleration toward the Earth is about 97.5% of Earth surface gravitation at an altitude of 50 miles. I'm positive this is a duplicate; this question has been asked many, many times before.
Answer:
Is the gravity pull of the Earth negligible at 50 miles up...

No it's almost the same. Gravitational acceleration varies as
$$a = \frac{GM_{Earth}}{r^2}$$
Let's call 50 miles 80 km. Earth's equatorial radius is about 6378 km, so gravity at 80 km is
$$\left(\frac{6378}{6378+80}\right)^2 \approx 97.5\text{% of Earth.}$$

...or is the weightlessness experience just relative to a falling airframe?

You guessed it! They both just rise and fall at the same rate, so the "weightlessness experience" is just that, an experience no different than jumping off of a stool, except that it's longer because they jumped higher.
I'll add a link to Q&A here that address this in greater detail if/when I can find them. I'm pretty sure this has been explained in the context of the astronauts aboard the ISS; they're both "falling" or oribing the Earth, and up there gravity is about 85.5% that of the surface.

Virgin Galatic's Weightlessness


How can I cluster plant biomass and grain weight for different plant varieties using Ward's method based clustering?

Question: I have plant biomass and grain weight data for different plant varieties which I now need to cluster. Do I need to define the number of clusters if using Ward's method and Squared Euclidean distance in SPSS? Also both of the variables are measured in same units so do I need to standardize this data?
Answer: Ward's method is a hierarchical clustering procedure, so number of cluster is not required to start (unlike k-means procedure, which requires number of cluster to be given beforehand).
Standardization is not required if the two dimensions are roughly on the same magnitude.
Comment: Thanks @Nuclear03020704, another doubt is whether there is any co-efficient associated to each cases defining how well they are classified in each cluster? If not how can we understand how good/bad are the clusters?


Definition of Compactness

Question: I am revising for my exam in Metric Spaces. Within this course we cover closed and complete sets also. However I'm really struggled to wrap my head around the definition of compactness. Definition I have been given is: $A$ a subset of metric space $X$, $A$ is compact if every sequence in $A$ has a subsequence that converges to a point of $A$. My main lack of understanding is how would I prove a set is compact? Also I know that compact sets are complete and closed but this isn't an obvious result to me.
Comment: That is not obvious to most people, really. But surely a proof of that was part of your course! Similarly, it would have been a rather heterodox course on metric spaces if you had not had several examples of proving that some sets are compact!
Comment: Has your professor given you any examples of compact spaces, and proofs that they are compact?
Comment: I have got many consequential properties of being compact e.g Heine Borel but I'm finding these proofs hard to follow do to lack of initial examples of compact sets.
Comment: There is the complete & totally bounded equivalence in metric spaces which is useful. I have often found the open set definition to be directly applicable.
Answer: Well, if you have an arbitrary sequence, you should find some subsequence that converges within that set using some property of that set.
Example: $X$ some metric space and $A$ finite, then you know that any sequence would some value in $A$ take infinitely many times: choose these $n$ as $n_k$ of your subsequence and you get a constant, hence convergent subsequence.
Take any Cauchy sequence in $A$, then it has a convergent subsequence in $A$. As we have a convergent subsequence of a Cauchy sequence, this implies that the Cauchy sequence converges to the same limit as its subsequence: hence $A$ is complete. Take any convergent sequence in $A$ (with limit in $X$), then it is a subsequence in $A$ with limit in $A$, so this sequence converges within $A$: hence $A$ is closed.
Answer: In a general metric space, we can make the following statement: if $K$ is compact then $K$ is closed and bounded. The closedness arises because otherwise you can pick a sequence that converges to a point not in $K$, which cannot have a subsequence converging to a point in $K$. The boundedness arises because in an unbounded set you can take a sequence that is blowing up monotonically, which cannot have a convergent subsequence.
In $\mathbb{R}^n$ we have the Bolzano-Weierstrass theorem that says that these conditions are also sufficient. Thus the "classic" compact sets are finite sets and closed intervals.
In a general metric space, there are sets which are complete, bounded, and not compact. The sufficient condition in a general metric space replaces "bounded" with "totally bounded", which means that you can cover $K$ with finitely many arbitrarily small balls (the number depending on the size but remaining finite as long as the balls have finite size).
Answer: To understand the definition of compactness, first you need to understand the definition of covering.
A covering of A in X is a set of open sets in X such that A is contained in the union of this open sets.
A set A is said to be compact if, for each covering of A, there exists a finite subcovering of A.
With this definition, if you know the topology of the space, you can prove that a set is compact.
Answer: Another definition of compactness is that every open cover has a finite subcover...
But, using your definition,  take an arbitrary sequence  and show it has a convergent subsequence, with the limit point in $A$...
We also have Heine-Borel, namely, in $\mathbb R^n$,   $A$ compact $\iff A$ closed and bounded...

Definition of Compactness


Convert PDF to HTML file Java API

Question: I want to convert a pdf file to html file using java application. The PDF file contains some images , text etc.  Doesn anybody know a good java API? (please don't suggest Aspose).
I tried Apache PDFBox but not satisfied
Comment: I can't suggest a library, but some general advice: PDF to HTML is not trivial. They are two very different formats and any conversion will depend strongly on the quality and structure of the PDF. Alone the extraction of the text in the right order can be tricky. Let alone the formatting and layout. Often a manual conversation will be the best practical solution. May be the bigger picture would help giving more detailed help: How many PDFs? Did you make them yourself? Or general: Why do you need to do this?
Answer: CSSBox Pdf2Dom is a Java library that allows (among other things) converting PDF to HTML. The distribution contains even a PDFToHTML command line tool based on this library so you can check if the results correspond to your needs. However, converting PDF to HTML is always tricky as noted above. The results depend on the complexity and the structure of the particular PDF file so different tools may be suitable for different PDF files.
Comment: FYI for future searchers on Pdf2Dom: it works well but uses an absolute positioning technique for the output HTML. Which means: it is very good at reproducing the look of the content, but if you want to do something programmatically with the output, its not ideal.
Answer: Check out
JPedal, it handles embedded fonts very well but not free.
IcePDF, it is free but afaik it only can extract text/images or render the PDF to an image.
<code>public class QHyperArticleHtmlBuilder extends QHtmlBuilder {
    QStyle anchorStyle = createStyle("anchorStyle", a);
    QStyle sectionStyle = createStyle("sectionStyle", div);
    QStyle subsectionStyle = createStyle("subsectionStyle", div);
    ...
    public String buildSubSectionHeading(String anchorName, String text) {
        return buildAnchorHeading(subsectionStyle, anchorName, text);
    }

    protected String buildAnchorHeading(QStyle divStyle,
            String anchorName, String text) {
        QMutableElement element = create(p);
        element.add(br);
        element.add(create(a, anchorStyle, name.create(anchorName)))
        .add(create(div, divStyle, text));
        return element.buildHtml();
    }

    public String buildLink(String url, String label) {
        QMutableElement element = create(a, anchorStyle, href.create(url));
        element.add(create(span, underlineStyle))
        .add(create(span, linkStyle, label));
        return element.buildHtml();
    }
}

pre.javaStyle {
  font-family: courier new, courier, mono;
  background-color: #fbfbfb;
  font-size: 11pt;
  width: 800px;
  border: dashed 1px;
  border-color: lightgray;
  padding-left: 4px;
}
</code>
Resources here
Comment: thanks for the reply. I want a open source api (not paid one). I din't considered aspose api , since it's not free.
Answer: Try our Java library called jPDFWeb which preserves fonts and image resolution from the original PDF. You can upload your own PDF and try the live demo.
https://www.qoppa.com/pdfhtml/
Answer: You may try to use Print2Flash: www.print2flash.com It can convert to HTML from Java not only pdfs but other kinds of documents as well: Office docs, AutoCAD drawings, etc. It solved all document publishing needs for our company web site.
Answer: perhaps you can use this API: https://market.mashape.com/netservice/convert-pdf-to-html
works for java, node, php etc...
Comment: Instead of posting links as answer add some text to explanation how this answer help to OP in fixing current issue.Thanks
Comment: links to an api that does not work or does not have documentation.

Convert PDF to HTML file Java API


Is there an equivalent to the Windows 7 Problem Steps Recorder on macOS?

Question: Is there an equivalent to the Windows 7 Problem Steps Recorder on macOS and or iOS?
Comment: You could try having them do a screen recording with command+shift+5. If you want to see keystrokes, try to have them have the keyboard viewer on the screen: https://www.laptopmag.com/articles/show-on-screen-keyboard-macos-sierra

I don't know enough about problem recorder, but if you do think this is a good answer, lmk and I'll post it below for the bounty.
Comment: @TalosPotential that sounds like some help. I encourage you to post regardless of bounty system.
Comment: @Marco There's no built-in solution but would you be interested in a 3rd-party app to do this?
Comment: @ankii I wasn't sure if it counted as a full answer, but I guess I can try
Comment: @fsb. No, thanks, it is not 'that' necessary. Just curious.
Answer: If you do not wish to use video recording, I often press Command+Shift+4 and take a screenshot of every step. The screenshot names will reflect the time they were taken so they maintain order of execution.
Answer: You could try having them do a screen recording with command+shift+5. If you want to see keystrokes, try to have them have the keyboard viewer on the screen:

laptopmag.com/articles/show-on-screen-keyboard-macos-sierra

For iOS, swipe up to get control centre and tap the icon with a dot in a circle. It starts recording in 3 seconds and can be stopped using the red strip on the top. Video will be saved to photos.
Answer: No.
Comment: I am having a hard time finding reasons for how is this better than not answering? Don't blame me for removing the clutter around it in the edit, but is this really all you had to say?
Comment: @ankii I'm more inclined to blame the question when someone asks a yes/no question. Not the answerer. Since this is a software recommendation question and broad, the question could be voted closed quite easily until it explains a bit what the functions of the tool are explicitly.
Comment: @bmike **1** I tried VTC-ing it.. but bounty stops us non-diamond people. Didn't feel a lot for flagging for ending the bounty. **2** If Marco wants, better ask a new question, put details and then close this as the new one's dupe. **3** I anyway don't understand the purpose of putting a bounty on an inadequate question and moreover never coming back to give feedback. **4** the question was from 2011, answer came in 2012, [software rec policy](https://apple.meta.stackexchange.com/questions/2180) came in 2014. I am not aware of other faq.


What is the kernel used in the IBM Qiskit's source code?

Question: I want to redefine the QSVM code for a different kernel. But what is the kernel actually used in the IBM Qiskit's source code? And where is it defined, exactly. QSVC in Qiskit
Answer: You can refer to this link https://qiskit.org/documentation/_modules/qiskit/circuit/library/data_preparation/zz_feature_map.html#ZZFeatureMap
to get help on the default kernel being used.


Corrupted chromosome will be in any cell of body if zygote was corrupted?

Question: For example, zygote had abnormal number of chromosome (45, 47, 48 etc) or corrupted chromosome. And fetus was born. Then it means that in any cell of newborn's body there will be the same not normal or corrupted amount of chromosome?
Answer: The terms 'corrupted chromosome' and 'corrupted zygote' are very unusual and quite loaded. Mutations occur all the time (of the order of 1-10 mutations per individual per generation in humans, Drake et al. 1998) and it is unclear how big a mutation needs to be so that you talk about "corruption".
But in any case, yes, the egg will copy itself via mitosis to create the whole body. As such any mutation (whether a small substitution or a chromosomal duplication) present in the egg will be transmitted to all the daughter cells and will therefore be found in the entire body. Note that many of the changes in chromosome numbers lead to unviable zygotes and the baby never develop fully.
Note that during mitosis, sister chromatids are being separated and therefore the number of chromosome copy should not matter much in the general case.
Answer: The answer of @Remi.b is true in general case. Still, we can consider at least two mechanisms which will lead to fetus mosaicism.
First one is a mitotic recombination. It is a rare process of recombination in a somatic cell which can result in unequal genotypes in daughter cells. Therefore, if one chromosome of zygote possesses some minute mutation it is possible that after first division only one of daughter cells will have got a mutation. In such case, about half of fetus's cells will be mutation free.
The second possible process is a back mutation. They are such mutations that restore genotype to a state of the wild type. According to this paper, such mutations are not so rare in human cells. As a result, the fetus will consist of both mutated and wild type cells.
It is important to say that such mechanisms are quite rare and will work only for small mutations (i think only for point mutations).


I play bass and want more from myself & my instrument

Question: What is this the best way to go from an efficient intermediate bass player to a sought after, gigging musician? Also, I really want to get better at slap bass. Suggestions/insight?
Comment: Easy, three steps: 1.) ALWAYS show up on time. 2.) ALWAYS know your music. 3.) ALWAYS be as professional as possible. You're a bassist, you don't need to be flashy, but you *do* need to be a solid foundation - as a colleague and as a musician.
Comment: There are plenty of intermediate bass players who are sought-after gigging musicians by virtue of being in good bands!
Comment: What exactly do you mean by getting better? Seems like a rather vague term.
Comment: It would be easier to make suggestions about the slap bass bit if you could actually explain the problem you are having. That way it becomes useful to other users of the site in the future - maybe you could split that out to another question too?
Comment: I almost feel like **not** learning to slap is a good part of being "sought after". Unless you want to be sought after by a Red Hot Chili Peppers cover band. And I'm only half joking.
Answer:
Practice. Also practice, and finally practice some more. For several years, Tom Morello practiced guitar at least eight hours a day, regardless of whether he needed sleep or anything else.
Take lessons. And practice the things your teacher shows you.
Get into a band - any band, it doesn't have to be a great band. Try to be the best musician in the band. Try out for and try to get into the bands with the best other musicians. Challenge yourself to be in a better band even if you think you can't handle it. The challenge to keep up with musicians who have a lot of skill and practice is a great motivator.
Study musicians who you think are great. Read material on techniques, acoustics, music theory, etc., anything you can get your hands on. Watch YouTube videos of live performances and look for ideas you never thought of or techniques that you don't know yet. Listen to lots of music with the same things in mind.

Specifically for bass:

You must be on time, musically speaking. Play along with drum tracks and strive to play exactly when the kick drum is playing. Listen to great bassists (Motown - for example) and pay careful attention to the exact timing. When are they playing ahead of the beat? Behind the beat? Locked with the kick? Freewheeling? If you can groove like "I Want You Back" (Jackson Five) or "Root Down" (Jimmy Smith), people will want to play with you.
You must control your dynamics. That means playing with consistent and deliberate intensity across all notes and strings. This is a very overlooked skill when it comes to bass players, but if you listen closely to almost any famous bass player you'll realize this is a skill they almost all have. Learn which strings and notes are most sensitive on your bass, and play those notes more quietly. Learn which ones are least sensitive and give those more force. Learn the difference between how loud your different fingers sound and compensate. Play without a compressor of any kind and listen extremely closely to the intensity of each note. Slow it down and practice, practice, practice until you start to instinctively compensate for loudness changes. If you have access to a mixer or anything that has a loudness meter in it, plug right into that and practice while watching the meter, trying to keep the meter in the same place using just your fingers. A meter doesn't replace your ears, but it can help you learn to hear the loudness changes if you've never noticed them before.
Carefully hone one great sound. A lot of bass players chase having more "low end". This is a mistake. The bass already has an octave below the guitar (unless it's a five string and that goes even lower), so there's no need to work for lower frequency sound - you've already got it! If you're playing through a bass amp or a decent PA, you're fine on low frequencies, and too much low will overpower the rest of the band in a bad way. The best bass tones have present and balanced mids, and a tasteful amount of highs. But the mids are where it's at for the bass. Exactly how to shape the mids depends on genre and/or the guitar and keyboard tones of the rest of the band. That said, there is a Fender P-bass with Ampeg SVT sound that is slightly overdriven and has rich low-mids that is not too honky sounding that is very versatile and popular. That doesn't mean you have to own Fender and Ampeg gear to get a good bass tone, it's just an idea of what to shoot for. Motown again is a good place to look for this kind of sound. If you're leaning towards the metal side, there is another popular sound usually involving a bass with active pickups, played with a pick, and with more of a scooped mids sound. You still need a bit of mid, just less than the other tones, and having active EQ with active pickups can help to dial in the right highs and lows for this sound. Finally, there is a new sound that has been popular for a while now which is more of a bass synth tone, using some combination of distortion and EQ or bass synth pedals. Getting a good set of pedals can be expensive. I would say if you can nail the Motown sound and you're looking for something else, this is a good one to shoot for. Check out Muse, NIN, Metric, and almost any modern band and listen for these kinds of tones.

Keep in mind that the tone chase should be your lowest priority. If you can play consistent intensity and at exactly the right time, then the tone part of it will be dead easy. If you build the greatest rig ever made and your playing is all over the place, it won't matter a bit because your playing will be impossible to work with and won't sound right. As a sound engineer, I can take a DI from a great bass player and make it sound amazing, but nothing in my toolbox can salvage bad playing.
Comment: +1. Would add working very, very closely with drummers, and being able to move timing subtly with them, as well as keeping perfect time - which a lot of live stuff doesn't - and doesn't have to! Not sure about the levelling of dynamics. It'll depend a lot on the genre. I tend to use quite a lot of different dynamics in my playing, and no-one moans. And, yes there are repeat gigs!
Comment: Could I also add - keep your playing 'clean'. Mute the unplayed strings, so only the intended note sings out. Be aware that some songs need a more pizzicato style of play rather than legato. Play pro-actively as well as re-actively.
Answer: One thing that has helped me a lot is playing in bands. Find a band with music you like (and musicians better than yourself) and play with them. This is one significant point in making yourself a better bass player.
Also, you can find some bass player you admire and learn his/her songs. Play them again and again until you play them as good as them!
Besides these generic guidelines, I'm not sure we can recommend much more. You can always find a teacher to guide you.
Answer: As the bass player you are part of the rhythm section so having good time and being able to lock in with the drummer is absolutely essential. How is your timing? Are you able to keep time with a metronome? Metronome practice is one of the best ways to improve your timing so this is a must.
If you're interested in slap bass, then try looking up some tutorials on youtube that teach slap bass licks and techniques and practice them. You will get a whole lot more from video lessons demonstrating and breaking down the licks than you will from written explanations so that's what I'd suggest. However, just make sure that you practice to a metronome at a slow enough tempo so that your playing is clean and in time. You do not want to learn at tempos faster than you can play them correctly...there is nothing appealing about sloppy slap bass! lol
Comment: -Id like to learn more theory and get more fundamentally sound.    - As far as slap, I see your point as far as sometimes it's better to not play slap inless u wanna be Flea. But I love Funk.  Parliament, Curtis mayfield, etc. I also like to be able to be in the spot light at least SOMEWHAT of the time. I don't need it all, just a sliver. -but yes finding musician who are better than me always makes me better and drivers me to be better.
Comment: I wasn't saying not to play slap or that slap bass in general isn't appealing, I was only saying that you should not practice faster than you can play cleanly because there may be a tendency to want to play fast immediately with slap because it "sounds cool"...but that can do a lot more damage than good in the long run because you will be training yourself to play sloppy. So make sure you're learning at a slow enough speed to learn it correctly and don't rush it just for the sake of trying to play really fast right away. :)


Does running IIS7 in classic mode affect MVC output caching?

Question: I have a need to run an application in classic mode for backwards compatibility with a specific application, and am trying to understand what kind of impact that will have on the performance of an MVC application that is running on the site.
If we put a few static file maps (for .js, .css, .png, etc) above the ASP.NET wildcard map to reduce the amount of processing by the ASP.NET handler, will we be approaching the integrated mode in terms of performance?
The thing i'm primarily concerned with is any effect this might have on output caching.  I understand that integrated mode might (?) allow for the output cache to handle non ASP.NET content, but that isn't really a concern.  We're more interested in ensuring that the MVC application has full use of the output cache.
Empirically i've found that the two configurations operate on par when things go well, but if the page references resources that are not available, the integrated mode tends to fail much more quickly than the classic mode (e.g. 500 ms vs 10 seconds), reducing 'hang time' on the page load.
Thanks for any feedback.
Answer: The thing is you have told IIS to run a particular application in classic mode. Now sit back and see. I should do it.
I don't think if you are running only one application on classic mode, it should affect another application running on integrated mode.


What is Gate time of single and multi qubit?

Question: How much quantum gate need time do computation in superconducting quantum computer. For all types of single and multi qubit gate.
Answer: You are probably looking at tens to hundreds of nanoseconds. For instance Rigetti has some times for 1Q and 2Q gates here: https://qcs.rigetti.com/qpus.
You can get an idea of how to build your own custom gates with pulse schedules of this type of duration against Rigetti's Aspen-M and Oxford Quantum Circuit's Lucy with Amazon Braket on AWS in this blog post: https://aws.amazon.com/blogs/quantum-computing/amazon-braket-launches-braket-pulse-to-develop-quantum-programs-at-the-pulse-level/.


Can I screw only the bottom screw into a stud?

Question: I recently purchased Granhult from IKEA for my wall shelf. The problem is that my wall stud do not align with the brackets because of the size of my shelf. Can I simply screw the bottom screws into the noggins and use wall anchors for the top screws? The shelf is going to hold books and some legos. Thanks in advance!
Comment: @popham  Noggins are are 2x4s used to apply sense to heads, sometimes repeatedly.
Comment: What are "noggins"?
Comment: [Nogging](https://www.google.com/search?q=nogging), not [noggin](https://www.vocabulary.com/dictionary/noggin).
Comment: Either way it's UK English for blocking (noggin is also a synonym for block)
Comment: In the unlikely even you could get away with using a single screw, how is it not obvious that should be the top screw, not the bottom?
Comment: @crip659 noggins are what 2x4s are bashed into so as to apply sense.  (Noggin being a synonym for block, people with block heads need sense knocked into them.)
Comment: If your "builder's intuition" tells you that the bottom screw is the important one, I suggest you hire professionals for all your construction work!
Comment: Can you add plywood or 1x planks across the studs.  One book not that heavy, but a bunch of books do get heavy.
Comment: @popham noggin is foreign-speak for **dwang**, a common commonwealth term for the short horizontal nailed between studs.  Locally there are three rows in a wall.   You'll probably get a bunch more explanations with other weird-words for the same structural member - it may be worth asking a whole new question on the subject.
Answer: No.
First off, the top screws take up most of the load. The weight of the shelf + stuff will try to pull the top screws out of the wall, the bottom screws comparatively hold very little actual load.
Secondly, why are your studs not vertical? I'm having trouble picturing why the bottom holes hit a stud but the top screws do not.
Books are very heavy and a shelf needs to be well built to hold them up. Your best bet is to get different brackets with larger vertical members, which reduces the bending torque the screws have to withstand.
Floating or floating-ish shelves are challenging because their fasteners are extremely highly loaded compared to traditional shelves.
Comment: See e.g. https://en.wikipedia.org/wiki/Dwang
Comment: My stud finder cannot find my normal vertical studs for some reason, and my outlet is scewed into a noggin.
Comment: @TheCarpe That nogging you found will have a stud on both ends.  You may be able to knock on the wall to follow it down to the next stud.
Answer: It sounds like you've found some horizontal blocking (nogging) typically designed to slow down the spread of fire.
At minimum attach the top of the bracket to the blocking since those will experience the greatest stress; Option 1 in attached image.
Even better would be to find a stud and get two screws into it and one into the blocking; Option 2.
Best yet would be to get a shelf which is as wide as your stud spacing and hit all four screws into a stud.
Comment: I was going to say "shorten the shelf till it lands on two studs" but never thought of getting a longer shelf.   +1
Comment: I agree with the last point. The OP himself says that the "size of the shelf" is the reason for the issue.
Answer: The bottom screws are there more to keep things aligned. The top screws carry the load, where the weight on the shelf gets amplified because of the short distance from the top screw down to the very bottom of the bracket. The worst case load amplification looks to be about 300% at one top screw (when all of the load is located at the tip of a single bracket). For something small like this, I would take 300% of the weight you expect and multiply it by a safety factor. I would shop for drywall fasteners that claim to hold this load in tension. It's a pullout load, not a shear load.
Often times when I design something, I'll imagine what would happen if some idiot decided to climb up and jump on, say, my arched trellis, and I'll treat that idiot as the expected load instead of climbing roses. Those brackets look flimsy enough that somebody probably won't try sitting on your shelf, but if you have a pet chimp, then consider anchoring to support the chimp weight instead of the weight of your books.
* For comparison, the AWC connection calculator outputs the withdrawal strength of a #8 screw with 1-1/2" embedment (2" minus a half inch of drywall) at 117 pounds for Doug Fir studs. For 1" embedment (1-1/2" minus a half inch of drywall), it's 78 pounds.
Comment: "if you have a pet chimp" -- Every parent of a toddler has one of these.
Comment: So you visit sites like Darwin awards and hold my beer?
Comment: @crip659, there exist beefier drywall anchor than you're probably used to seeing. "Bullfix anchors" on Amazon come to mind. That and the shelf is 5" deep and 12" across. I _will_ qualify the answer better for small stuff like this, although I thought that the "chimp" bit was a pretty good caveat.
Comment: @crip659, and the analysis is predicated on an absurdly conservative load distribution. If you can find a drywall wall anchor that claims to hold the 300% plus safety factor, then use it and you're good.
Answer: Another option would be to find two verticals, and cut the shelf width so that the brackets aligned with them. Or at least use one upright for one top fixing, and an expanding plasterboard fixing for the other, which will spread out behind the plasterboard. They actually use a setscrew rather than a 'woodscrew', so present a much larger support area behind.
As already mentioned, the top fixings are the weight bearers, so they need to be the stronger ones, but without knowing exactly where the fixings will be compared with the noggins, it's difficult to give a more helpful answer.


When will SuperCam examine its first target?

Question: The Perseverance rover just landed yesterday. I'm guessing that there first are some checks to do on the rover itself before it starts to do any science, so the science instruments like SuperCam might not be used right away. When is SuperCam scheduled to be used for the first time?
Answer: From this NASA press release, SuperCam got its first readings on March 9, two and a half weeks after its landing on the red planet.


To write or to write to?

Question: Is it correct to say "I wrote him" or "I wrote to him"?  My Mother was a stickler for English grammar and would say "I wrote your Uncle..." rather than "I wrote to your Uncle..."
Answer: Write is a verb that can be used as a transfer (3-place) verb, and thus can have an indirect object, marked with to.
1.  She wrote a long letter to Bill.
This can participate in the Dative Alternation, which drops the to and reverses the order:
2. She wrote Bill a long letter.
Write in this usage also allows the direct object to be understood as some kind of letter or message, since that's what the usage specifies. This leaves only the indirect object.
But the deletion of the predictable direct object can occur with either variant.
(1) above produces (3) below
3. She wrote  ____ to Bill.
while (2) above produces (4) below.
4. She wrote Bill  ____ .
So they're both correct, and identical, because syntactic alternations don't change meaning.
Comment: In American English. See Barrie's answer for British English.
Comment: As Barrie and Colin point out, this is American English usage. I speak Midwestern American English and have almost no knowledge of British Englishes.
Comment: If you google ["Dative alternation"](https://www.google.com/search?q=dative+alternation) you get a lot of talk about verb subcategorization. That's linguist talk for the verb's rules for what can or must or can't occur as subject, or object, or prepositional phrase, and what order everything hasta be in. Basically every verb is different, and "subcategorization" is hifalutin handwavin.
Answer: The practice in British English is to use write to when there is no direct object, so we would say I wrote to your uncle, rather than I wrote your uncle. However, when a direct object is present and it occurs after the name of the person addressed, to is omitted, so we would say I wrote your uncle a letter. If the direct object occurs directly after the verb, to reappears: I wrote a letter to your uncle.
Comment: That BrE point seems right to me. *I wrote your uncle.* as a standalone sentence does have a decidedly "American" flavour to it. And somewhere in Paul Simon's lyrics there's *"Why don't you write me?"*

To write or to write to?


How is ionization explained in Quantum Mechanics?

Question: I remember in my highschool chemistry classes, they taught that an atom can be ionized when it loses a valence electron and becomes positively charged. In quantum mechanics, if electrons aren't really particles orbiting the nucleus, what is it that happens during the ionization (is the wavefunction of the electron destroyed by the ionization process)?
Answer: The wavefunction of the electron is just changed, not destroyed. It leaves the bound state around the atom and becomes a free particle. The bound state wave function is an atomic orbital and the free particle wave function is a traveling wave packet.
Comment: You mix different types of states. Atomic orbital is an eigenstate, while any wave packet in continuous spectrum must be a superposition of eigenstates (which, however, aren't wavefunctions because they can't be normalized).


Why the title 'Unforgiven' in the movie Unforgiven?

Question: I just watched the 1992 film Unforgiven and I liked it a lot. But how does the title of this movie relate to its story?
Comment: Because it would be silly to give the title *Unforgiven* to the movie *When Harry Met Sally*.
Answer: It's a good question, and sent me digging.
I found a terrific essay on the film written by William Beard, and here is an excerpt that pertains to your question:

That he should get away with killing while Ned dies horribly for not
  killing creates the moral abyss into which Munny plunges in forsaking
  his "good" self and embracing again his "bad" one. Here lies a way to
  an interpretation of the film's cryptic title. Munny's wife Claudia,
  in attempting his regeneration, in pulling him out of the maelstrom of
  nihilistic compulsive violence and drunken self-obliteration into a
  world of principle and language and family and human self-recognition,
  forgives him. The act of forgiveness produces the (feminine)
  redemptive result of self-forgiveness. In addressing at last the
  buried consciousness of horror and guilt, the fiery cycle of
  repression and violence whose first victim is the perpetrator is
  broken, and the functional person William Munny (the "good") is
  dredged up into view.
Once established in the social world of human relationships, gainful
  occupation, the code of civility and "decency," Munny is happier than
  before. Even after the death of his wife, and despite the rather naive
  and rudimentary nature of the precepts upon which he leans, he
  continues forthrightly in the same path. The process which pushes him
  back off that path begins with a condition of economic hardship and
  the unfulfilling nature of his labour. Pig-farming is dirty,
  frustrating, humiliating, and profitless. The temptation to move into
  another form of paid work—killing for hire—is very strong, when that
  work suffers none of the drawbacks just enumerated. In drawing Ned
  Logan into the business, Munny wishes not only to provide himself with
  a dependable co-worker, but to give himself a degree of orientation in
  this strange endeavour. Ned, like Munny (and like the Eastwood persona
  too), is a former hellraiser, now a respectable freeholding family
  man.
As the film proceeds Ned develops into Munny's anchor to the world,
  his reassurance that he has forsaken the old ways (which Ned also
  witnessed), and his guarantee that his actions have some foothold in a
  worthwhile life-pattern, in decency and fellow-feeling. But Munny
  makes the mistake first of returning to killing (however different his
  motives this time) and second of pulling Ned with him. When this
  happens the results are different from what was anticipated (this too
  is morally instructive). It is Ned who is punished for the
  transgression, a transgression he did not truly commit; Munny does
  everything and goes free, and gets paid to boot. It is not just that
  any notion of a higher system of justice and moral equilibrium is
  derisorily contradicted by this development. The death of Ned is also
  Munny's personal loss of his "good" self, his loss of Claudia's
  forgiveness and his own self-forgiveness. When he walks into
  Greely's to kill Skinny and Little Bill he is a creature who has lost
  salvation, a damned soul, "unforgiven."

If that was too much to take in, in a nutshell Munny had been forgiven by his wife, society and, most importantly, by himself - but the lure of his old ways are too tempting and he regresses into the violent world he had left behind, ultimately destroying the last vestiges of his 'good' self through the death of Ned. Ultimately he realizes what he is, what he has always been; unforgiven.
Comment: @Dredd walking into the Saloon he's avenging Ned, but Ned wouldn't have need avenging if he hadn't dragged him along in the first place!
Comment: although this time though he is avenging his friend ned doesn't he?
Comment: Heavy stuff there!
Answer: To me, forgiveness is a running theme under all the major characters. The women refuse to forgive the cowboys, even after Bill fines them. Bill refuses to forgive English Bob for his past. The kid immediately seeks forgiveness when he kills the cowboy.
Comment: Now that you mention it, just about everyone in the movie is unforgiven for something. This answer deserves a lot more love. :)
Comment: The biggest one of all is that Will doesn't forgive himself.
Answer: "forgiveness is a running theme under all the major characters" I agree. Women refuse to forgive the innocent cowboy even after he showed sincere remorse, perhaps because what they knew they already did (hire assassins). Most importantly, Munny never forgave himself over what he had done in the past, felt sure he was going to hell. And he certainly will never forgive himself for getting Ned killed. As he says: "Ned didn't kill anyone."
Answer: Even from the start of the film, the first taste we see is Quick Mike not forgiving Delilah for hurting his pride.  She gets slashed. There's no forgiveness from Little Bill toward the Englishman and no forgiveness toward the cowboys from the women at the whorehouse.
The core of the movie is about Will's inner conflict and lack of forgiveness for himself and his journey to try to rectify that along the way.  We see that he tries to show compassion to the cowboy he shot but allowing him water.  He tried to cope with alcohol as soon as he learns of Ned's death and feels guilt.  Ultimately the story ends in a Homer-like rage, as it's clear that Will hasn't forgiven himself for his past as much as his goodness would compel him to do so.
Answer: Unforgiven seems to have a lot of unforgiving, but the whole story is based around the decision of the girls, especially the leader, not forgiving the cowboys (knife slasher and his companion).
If they had taken the horse, or negotiated for a bit more, then the town's whole law enforcement would have all have survived and not been shot dead, directly reflecting back to the prostitutes' bounty.
One comment on other posts:
Bill doesn't like English Bob - not necessarily connected to forgiving - He doesn't like English Bob for his very bad treatment of Chinese people, including shooting them for no reason, apparently.  Also, he doesn't like English Bob because he knows Bob's there to assassinate someone, murder in his eyes.


Running wire from service panel to workshop

Question: I want to run electrical cable from service electrical panel in utility room to workshop. I would need to run the cable about 50' under the house to get to the outside, then I could bury the cable to the workshop. Would I need to put the wire from the service panel in conduit that would be under the house, fasten to the floor joist?  Or can I do something else to get the wire to the workshop?
Answer: You have several options.

You can run cable (NM-B or similar) through the crawl space and terminate it in a junction box where it will exit the house. In the JB, you join it to individual wires that would then run in conduit to the shop.

This is what I did a couple of summers ago to run a circuit to my shed.

You can run wires in conduit through the crawl space then directly out into the buried conduit and into the shop.

If you do this, make sure you respect the curve limits for conduit and take care of all the other rules around sizing, etc.

You can run cable in conduit through the crawl space then out to the buried conduit. There are many reasons not to pick this method, including:

Pulling cable through conduit is difficult at best
Cable in conduit requires larger conduit than the same number and gauge of individual wires
Others I'm sure I'm missing...

There are loads of other considerations for getting power to an outbuilding. There are a bunch of questions here that address a wide variety of issues, from circuit count, to wire size, an additional panel in the outbuilding, grounding, etc.
Please be sure to read up on them all to make sure your installation is safe and correct. Once you've read through them and feel comfortable, put together a plan, I'd suggest asking about either the overall plan or individual details of it, here. There are a lot of licensed electricians who would be happy to look over your plan and point out things that may need to change, or reinforce that you've got it right. For example, I posted this question a couple of years ago when I was taking on a task similar to what you're doing and got a lot of good feedback. It also raised a couple of other follow-up questions for me.
Comment: Could OP use UF-B under (attached to) the house, then buried to the workshop?  Too bad he's not specific about what size wire he's looking to install—could be he wants to put a subpanel in the workshop.
Comment: Sure, @Huesmann, UF-B can be run in the house and/or crawl space. However, it's more expensive than NM-B (current bizarre economics aside), it's not necessary in a crawl space, it's stiffer (therefore more difficult to work with), and it's a royal pain to strip the housing back without accidentally slicing through individual wire insulation. Additionally, direct burial is possible under the right conditions (depth, etc.) but it's not recommended because he may only want one circuit today, but that subpanel in the future and that requires a new trench.
Comment: Direct burial of cable is generally not recommended here as it has to be buried deeper for protection, and any damage to the cable or desire to upgrade requires digging the trench again to get to the old cable and repairing/replacing it. Conduit means you "just" pull the old out and the new in. Additionally, UF-B would be covered by "(NM-B _or similar_)" in option 1. ;)


How exactly can we interact with people resurrected by the resurrection stone?

Question: I mean to ask that we know that resurrection stone brings people nearly back from the death . So how exactly can we interact with a person who is "livelier than a ghost but less than alive"? I mean we can talk and see (partially) the ghosts, but the resurrected persons are more than a ghost. So what are the additional ways we can interact with them?
Answer: Speech
As you mentioned, you can talk to the resurrected person - as we see when Harry talks to

 Lupin, Sirius, and his parents.

Sight
You can see the person you called back - they're not just a disembodied voice.
Physical Contact
(This part is probably what answers your question the most.)
As we see when Harry summons

 Lupin, Sirius, Lily, and James,

the people interact with the world around them -

He knew it had happened, because he heard slight movements around him that suggested frail bodies shifting their footing on the earthy, twig-strewn ground that marked the outer edge of the forest.
Harry Potter and the Deathly Hallows, chapter 34: "The Forest Again"


Stability problem of QGIS 2.18 grass algorithms (windows 7 - 64 bits)

Question: I'm checking for a stability problem of QGIS 2.18 grass algorithms.
I could not use Grass algorithms like r.reclass with QGIS 2.18.4 (64 bits)
After researching in forums and using all the recommendations without success, I ended up performing the advanced installation with OSgeo4W.
It worked! Only less than 2 weeks later, the error messages when using the algorithm again, have returned! This shows the instability of the software.
Has anyone had this and have a suggestion?
Comment: Please post the error message, otherwise it is difficult to help.
Answer: Try to download QGIS 2.14.12 Long Term Release (LTR) from OSGeo4W instead of QGIS 2.18.4. QGIS 2.14.12 LTR is more stable than QGIS 2.18.4 as the latter is still under development and regular bugs fixes. Personally, I always use QGIS LTR for my daily work rather than QGIS 2.18.4. However, this does not guarantee that your problem will be fixed as we still do not have enough information from you.


Edit AirPort Extreme settings Linux terminal

Question: I'm using a raspberry pi as a sort of network login (ssh, VPN, nas access) for when I'm not at home. I have an AirPort Extreme router. Is there a way of changing the routers settings from the raspberry pi? Not its headless, ie I wans to change the settings in terminal on the raspberry pi using ssh.
I have tried airport-utile package, but it requires X11, and I can't set up VNC (For non-tech related reasons)
Any way I can do this? Thanks for your help
PS the Raspberry pi is running the standard Raspbian image
Answer: The easiest way would be to identify what ports the APE is using for its configuration utility then forward them through an SSH tunnel, running the Configuration Utility on your Macbook or PC.


90/180 Schengen rule for people with two justifications

Question: If one is a citizen of a Schengen entry visa-free country (e.g. Canada) and has a temporary residence permit from a Schengen country, and the Schengen visa-free days (90/180) have been used up on the Canadian passport, but have not been used up on the temporary residence permit, does this mean that one can travel in other Schengen countries outside the country which issued the temporary residence permit, 180 out of 180 days? In other words, can one "double up" on this rule or not?
Comment: The answer to the question you asked here https://travel.stackexchange.com/questions/169769/traveling-in-schengen-before-and-after-expiry-of-swedish-residence-permit seems to answer what can be done i  this scenario, AFAICT
Comment: @MarkJohnson that's a good point.  It deserves to be made in an answer rather than in a comment.
Answer:
In other words, can one "double up" on this rule or not?

No. There is only one justification: when outside the country that issued the residence permit the 90/180 rule applies.
Your passport and resident permit card are required for such trips.
The resident permit card explains the reason why you don't have an entry stamp that would otherwise be needed.
Comment: What's your basis for that answer? What 90/180 rule are you referring to? This interpretation is not at all obvious and that's exactly what the question is about.
Comment: @Relaxed the question seems to assume that the passport and the residence permit separately entitle the bearer to 90 days of presence in a 180-day period in countries other than the one issuing the residence permit.  In fact, the Schengen codes contemplate that a third-country national requires a passport whether in possession of a residence permit or not, so the residence permit does not in fact by itself entitle the (Annex II) bearer to anything outside of the issuing country.
Comment: @Relaxed Since **residence** (*migration and home affairs*) is within the [shared competence](https://ec.europa.eu/info/about-european-commission/what-european-commission-does/law/areas-eu-action_en#governments) category, the primary decision is up to a member state which (and under which conditions) a 3rd country nationals may **reside** within their territory. The issued residence permit is only valid within that territory. It does permit short-term **visits** (Article 6(1): 'of a duration of no more than 90 days in any 180-day period') to other member states.
Answer: The Schengen Borders code is not explicit on that. What it says is simply that

Periods of stay authorised under a residence permit or a long-stay visa shall not be taken into account in the calculation of the duration of stay on the territory of the Member States.

It's not completely obvious (to me, at any rate) whether only the time in Sweden (which issued your temporary residence permit) counts as a "period of stay authorised under a residence permit" or if a visit to another Schengen member state is also covered. This clause was presumably written with people staying a year or more in a member state in mind and in that scenario the distinction is not that important.
In practice, movement within the Schengen area is not tracked and border guards have no reason to focus on people with residence rights in the EU. Consequently, showing a residence permit is usually enough to side step the issue and a few short stays over the limit are unlikely to cause problems. At the same time, if you're trying to be clever, live 9+ months in a country other than Sweden, and somewhow the local police finds out, you might find it difficult to force them to interpret the rule in a way that suits you.


Updating Resume to Reflect Change in Corporate Structure

Question: My company is modifying their corporate structure and I am going to be reclassified as an employee of a subsidiary organization.  The work I do is already for the subsidiary and nothing will change in terms of my duties, title, or pay. Do I need to update my resume to reflect this change and if so, what would be the best way to communicate the change without using up too much space? I was just given a promotion a little over a month ago (mostly just a title change to more aptly characterize the job I was already doing) and I'd prefer not to use three lines of my resume to describe what is essentially the same job.
Comment: Does this answer your question? [Resume Writing: To list as one company or two?](https://workplace.stackexchange.com/questions/70175/resume-writing-to-list-as-one-company-or-two)
Answer: If it is only internal change, it is not that important but if your pay is now coming from a different payroll system, then I think it is a good idea to reflect it.
You can keep the description common but just add one more line to reflect the change in company
2019-Present: Current Designation, Subsidiary Company
200X-2019: Past Designation,  Original Company
Tasks performed - 1
Task Performed -2
In tasks performed you can can explicitly again mention subsidiary company if you think it will help others to know your previous work was also for the same company.
Answer: Past - Present      My Job Title
Spin-off company (A subsidiary of Big Company)
Answer: Simplify.  Your resume only has a few seconds to not get overlooked.  Miring it down in trying to explain the genealogy of your workplace will distract the reader and get you tossed out before they ever get to what YOU DO.
You now have a small advantage.  Pick whichever company looks better based on what story your resume is telling about you.  Name recognition and industry reputation are a couple considerations that come to mind.  Whatever the criteria, use that one.
If the minutia of which branch you worked for matters, that nuance can be discussed in the interview.  Waste too much space on the resume and you'll never get to have that interview in the first place.


Finale writing problem, four cross-beamed eighths

Question: How do I enter cross-beamed eighth notes in Finale?
Comment: This question is lacking some detail. Please elaborate on what is causing you problems. Is it the cross staff beaming in the alto? Then just try this: https://www.finalemusic.com/blog/finale-quicktips-cross-staff-beaming/ . Is it having multiple voices? Then maybe https://usermanuals.finalemusic.com/FinaleMac/Content/Finale/Multiple_voices.htm can help you.
Comment: @Lazy The first one!!! Thank you. Sorry for the lacking of detail, I am asking for my friend, still - great answer.
Answer: In case the link https://www.finalemusic.com/blog/finale-quicktips-cross-staff-beaming/ dies:
Finale QuickTips: Cross-Staff Beaming

Write all of your notes for the cross-staff passage in one staff.

Choose the Selection tool then click and drag to select the notes you wish to move.

After you have selected the region of notes you wish to move, press ALT+SHIFT+Up/Down Arrow (Win) or OPTION+SHIFT+Up/Down Arrow (Mac). (*no shift in Finale 2014 or later for Mac)

You can then use the Beam Angle tool from the Special Tools palette (Window > Special Tools Palette) to alter the beam height and angle.


What is the best racket in the world?

Question: I have heard that the best rackets that are lighter, powerful and fast racket models are Duora 7 and Glanz in Yonex brand.
Are these rackets best ones?
Is there any better ones?
Answer: Badminton rackets vary among a number of properties, none of which are a simplistic worse vs better:

Their balance, some rackets being more head-heavy, others being more head-light. As a rule of thumb, head-heavy rackets are better in the offense (when you want to generate lots of power), head-light rackets are better in defense and quick net play.
Their weight. Similar to the balance, a lighter racket is better for defense, a heavier racket tends to allow you to play more powerful shots. In contrast to balance, the variety in weight is larger; really heavy(120g+) training rackets allow you to feel incorrect technique and build up strength.
Their form. The laws of Badminton limit the size of the racket, but there are differences in form. Different forms are not so much about a larger area of the racket in general, but the size of the area where contact is optimal. Some rackets (namely, the YONEX Duora line) also have two different sides with different properties.
Their stiffness: All good badminton rackets bend on power hits, but some are more flexible than others. For players that are able to generate speed very quickly (i.e. virtually all professionals), a stiffer racket means more power is transferred onto the shuttle. For players who take longer to accelerate, a flexible racket is better, because it will store the power for a longer time.
Their grip size: Depending on your finger length, different grip sizes tend to be optimal. Naturally, the grip size is intertwined with balance and weight.

Rackets feeling will also vary by the outfit:

The string type: Narrow strings tend to give more feeling and power, but break faster. Also, the composition and production of the string impacts the final control.
The string tension: Higher string tensions limit the area where you can hit effectively, and transfer more power on very short hitting actions. On the other hand, a lower tension increases the sweet spot, and introduces a small trampoline effect. Therefore, string tension depends on skill as well as personal preference. Note that not all rackets work are strong enough for higher tensions.
The grip mainly changes the size of the handle, and may also have a very slight effect on balance.
The overgrip (or grip if you don't use an overgrip) material determines how good you can hold your racket. Towel grips tend to be problematic for players with very sweaty hands, and need to be powdered regularly. Plastic grips come with different surfaces.

There are some aspects where some rackets are better than others, namely average durability and price.
Some properties do not effect play, but are considered anyways: style/coloring and marketing.
In summary, there is no best racket. The best racket for a given player depends a lot on the player's technique, playing style, preferences and personal feeling. Most players will play fine with a any good racket, especially if the new racket's properties are similar to their usual racket.

What is the best racket in the world?


neural network for data set with large number of samples

Question: What are the rules of thumb for neural network configurations with large number of samples? I have a dataset with 200k samples, 400 features, and binary label classification problem. How should I choose the hidden layer size? I'm concerned that during training the network will gradually forget the older samples, and will overfit over the samples fed to it recently. How can I make sure this doesn't happen, and the network nicely generalizes over entire data set? Particularly I'm interested in choosing the right number of hidden layers (probably 1 is enough), number of hidden nodes, minibatch size, etc.
Answer:
Q: How should I choose the hidden layer size?

See Is there any method for choosing the number of layers and neurons?

Q: I'm concerned that during training the network will gradually forget the older samples, and will overfit over the samples fed to it recently. How can I make sure this doesn't happen, and the network nicely generalizes over entire data set?

If that happens, make sure you randomly draw your batches, e.g. 1:

As for any stochastic gradient descent method (including
  the mini-batch case), it is important for efficiency of the estimator that each example or minibatch
  be sampled approximately independently. Because
  random access to memory (or even worse, to
  disk) is expensive, a good approximation, called incremental
  gradient (Bertsekas, 2010), is to visit the
  examples (or mini-batches) in a fixed order corresponding
  to their order in memory or disk (repeating
  the examples in the same order on a second epoch, if
  we are not in the pure online case where each example
  is visited only once). In this context, it is safer if
  the examples or mini-batches are first put in a random
  order (to make sure this is the case, it could
  be useful to first shuffle the examples). Faster convergence
  has been observed if the order in which the
  mini-batches are visited is changed for each epoch,
  which can be reasonably efficient if the training set
  holds in computer memory.

1 Bengio, Yoshua. "Practical recommendations for gradient-based training of deep architectures." Neural Networks: Tricks of the Trade. Springer Berlin Heidelberg, 2012. 437-478.

Q:  I'm interested in choosing the right minibatch size

See  Tradeoff batch size vs. number of iterations to train a neural network

You can compare the sequential vs. random access speed of your disk with CrystalDiskMark:
Crucial  512 GB m4 2.5-Inch Solid State Drive SATA 6Gb/s CT512M4SSD2:

Crucial M500 960GB SATA 2.5-Inch 7mm (with 9.5mm adapter/spacer) Internal Solid State Drive CT960M500SSD1:

A good explanation of the tests: http://www.overclock.net/t/1231707/can-someone-explain-the-different-crystaldiskmark-tests#post_17508715

Sequential: Crystal disk mark (CDM) reads/writes whatever file size
  you choose when you start the test sequentially. That is to say it
  starts writing on a sector and then writes the next part on the
  adjacent sector and so on. This is fastest because the head doesn't
  have to move about a lot as all the sectors are adjacent.
512k: CDM read/writes to random sectors on the drive, but it
  reads/writes 512KB of data at a random point, then moves to the next
  random point. This is faster than 4k because there's more data
  read/written with less movement of the head.
4k: The same as above but instead of reading/writing the test data in
  512KB 'chunks' it reads/writes in 4KB chunks.
4kQD32: The same as 4K but there are more requests for the data sent
  to the HDD controller. I'm told that some HDDs increase performance
  when this happens because of the way their controller logic works but
  I think this mostly applies to SSDs not mechanical drives.
Comment: Is the disk-reading concern relevant for systems which have SSD storage?
Comment: @Sycorax Not really I would tend to say unless maybe if you read a small batch from the disk at each iteration and your ANN is so fast that loading batches is significant: I have added some benchmarks in the answer. Also RAM is it cheaper nowadays :-)


Any open subset of $\mathbb R$ is an uniquely countable union of disjoint open intervals

Question: I know how to prove that any open subset of $\mathbb R$ is a countable union of disjoint open intervals. See this question.
I would like to prove this union is unique. Is there a straightforward way to prove this?
Answer: It essentially follows from the fact that open intervals are connected spaces.
Let $S$ be open open subset of $\mathbb R$. Assume that $\{U_i\}_{i\in I}$ and $\{V_j\}_{j\in J}$ are two such representations of $S$ as the union of open intervals.
Fix $i\in I$, and note:
$$U_i = \bigcup_{j\in J} (U_i\cap V_j)$$
Then the $U_i\cap V_j$ are disjoint open subsets of $U_i$. But $U_i$ is connected. So only one of $U_i\cap V_j$ can be non-empty, and thus $U_i\cap V_j=U_i$ for some $V_j$ - that is $U_i\subseteq V_j$.
Then prove similarly that for each $j\in J$ there must be exactly one $i$ so that $V_j\subseteq U_i$ and $V_j\cap U_{i'}=\emptyset$ if $i'\neq i$.
Use these results to prove that the two partitions are the same.
We are essentially reducing it to the case where $S$ is an open interval - connectedness then shows that $S$ can't be represented as the non-trivial union of disjoint open sets.
Answer: For $x\in S$ let $V(x)$ be the set of all open intervals $J$ such that $x\in J\subset S.$ Let $U(x)=\cup V(x).$ Each $U(x)$ is an open interval containing $x.$ And $\cup_{x\in S}U(x)=S.$
Let  $\{U_i:i\in I\}$ be a pair-wise disjoint family of open intervals with $\cup_{i\in I}U_i=S$  and such that $U_i \ne U_{i'}$ for distinct $i,i'\in I.$
For $x\in S$ there  exists a unique $j(x)\in I$ such that $x\in U_{j(x)}.$ We have $U_{j(x)}\in V(x)$ so $U_{j(x)}\subset \cup V(x)=U(x).$
Suppose $U_{j(x)}\ne U(x)$. Because $U_{j(x)}\subset U(x)$ we may let $y=\sup U_{j(x)}$ if $\sup U_{j(x)}\in U(x)\setminus U_{j(x)},$ or, otherwise, let $y=\inf U_{j(x)}.$ In either case we have $y\in U(x)\setminus U_{j(x)}.$ But $y\in S$ because $y\in U(x)\subset S,$ so there exists $r>0$ and some $i\in I\setminus \{j(x)\}$  such that $(-r+y,r+y)\subset U_{i}.$ From the definition of $y$ it should be  clear that this implies $U_i\cap U_{j(x)}\ne \phi,$ which is absurd because $i\ne j(x).$
Therefore, by contradiction, we have $U_{j(x)}=U(x).$
Therefore $\{U_i:i\in I\}=\{U_{j(x)}:x\in S\}=\{V(x):x\in S\}.$


How do I confine a boids particle system to a volume?

Question: Is there a way to have boid particles be generally confined to a volume? For example, if I were to make a fish tank or fish net, and would want schooling fish to be animated throughout but wanted them to stay within the confines of the volume, is there a way to tell them to flock, but do not exit the volume?
I'm trying to figure a way to make a large school of fish remain in the background of a shot without letting them go all over the place. I've tried having them follow the leader and having the leader move, but it sprays fish across the camera view and all over. Once they start to flock, they just end up spiraling in a cylinder type thing. I'd ideally have them be in a sphere.
Answer: Just use avoid/avoid collision for your surrounding box. Of course you need the right values to make it work. And AFAIK there is no thing like "stay in that volume" for boids.


Apply affine transformation on Cesium rendered frame

Question: I have an image which was taken from an airplane. I know the airplane position when the picture hasbeen taken (lat lon height, heading pitch yaw and camera fov).
Suppose I would like Cesium to show the earth exactly like the image was taken. I can do it by:

Set Cesium container div to have same width/height as in the image.
Set camera.frustum.fov to appropriate values.
Use camera.setView with positionCartographic and angles.

The registration data of it are not accurate, thus the image has additional data produced by accurate registrator (Edit3: notice that I don't ask about such registrator, I already have the registrator output). The data is a fixing formula that should be applied on the image. The formula is represented as an affine matrix that should be applied on the image (2d, 3x3 matrix in which the last line is 0 0 1).
To get this fix on Cesium, I should apply something similar to the affine transformation on Cesium camera. What is the best way to do that?
Edit2: The way I suggested below will not work. I need to find a way to apply the affine transformation after any world-to-screen calculation and before any screen-to-world calculation is done. This is a purely technical question in Cesium core. How should I do that? I'm afraid that such transformation is performed in many places in the code...
[
For whom it may concern, there are some reasons that the way I deletted below will not work. Here is some intuitive explanations, a mathematical explanation follows:

The affine transformation translation has no equivalent operation that can be applied on the camera. Moving the camera by moveLeft is not equivalent, for example if I have a mountain on the left side of the scane it will hide larger area when I move the camera to the right and that doesn't happen in affine transformation applied on the rendered frame. Using rotateLeft is also not equivalent - try to draw it in 3D with the near and far planes of the camera and you will understand that easily.
The solution ignores the shearing components of the matrix. Shearing can really be decomposed to rotate-scale-rotate as I've done, but scaling after rotate is not equivalent to just change the fov if the horizontal and vertical fov are not equal - which is exactly what is required to perform shearing.

More mathematical intuition for that is: General affine 2x2 transformation which applied on the frame is equivalent (I think) to apply some transformation on the 4x4 matrix transformation of the camera, but general matrix cannot be converted to a camera parameters. Camera model has 8 freedom degrees (3 position's coordinates, 3 euler angles and 1 or 2 fov, depends on if aspect ratio freedom exists), but 3d to 2d perspective transformation has 12 components (11 freedom degrees because w can be normalized).
]
I thought first to decomposite the matrix into 4 matrices: translation, rotate, scale and another rotate. Assuming I know how to do that, I should apply the four matrices on the camera.

Applying the rotate transformations is easily done by twistLeft.
Applying the translation is trickier, I can move the camera by moveLeft and moveUp, but I don't know what amount should I pass to move in a given amount of pixels? (the matrix is given in terms of the image pixels which may be easily transformed into screen pixels (Edit: I think I should use rotateUp and rotateLeft to get the effect of affine translation, but I'm not sure if it equivalent to the translation. moveLeft and moveUp that were suggested in deletted suggestion because translation of camera is not equivalent to translation of the image. For example if I have a mountain on the left side of the scane it will hide larger area when I move the camera to the right. This example demonstrates why tthe camera cannot move).
I'm not sure how to apply a scale transformation. I thought about moving the camera forward or reduce the fov, but I wasn't sure if: a. Is it equivalent to a linear scale on the image? b. What amount should I pass to move or how to calculate the new fov? (Edit: I should reduce the fov. Moving the camera is wrong as was mentioned in the previous bullet about translation).

Finally if I succeed all the above I would like to handle cases in which the horizontal scale and vertical scale are not equal. Is it possible in Cesium?
Honestly I would prefer to just multiply the affine transformation with the internal camera matrix, but I couldn't find such functionality in the API. Anyway I also consider to change Cesium source code but this is the least prefered option now.
Answer: Seems that what are you are asking is orthorectification so it can not be easily done in Cesium. It is a complex task and here is the discussion on sister site where you can learn more. Also try asking this question there.
https://gis.stackexchange.com/questions/9334/free-gis-software-that-can-orthorectify
Comment: Thanks for the answer. Maybe the question was misleading - Orthorectification was already done and I have the affine matrix produced in that process. I just need to view it correctly in Cesium.