A five-part problem that uses ends and the Cantor set to prove that there are $c$ non-homeomorphic connected open subsets of $\mathbb{R}^2$

Question: My question comes from Spivak's "Comprehensive Introduction to Differential Geometry Vol 1" (It's Chapter 1, Problem 24).
Background: Let $X$ be a connected, locally connected, locally compact, and hemicompact Hausdorff space.
And end of $X$ is defined to be a function $e$ that assigns to each compact set $C$ of $X$ a connected component of $X-C$, in such a way that if $C \subset D$, then $e(D) \subset e(C)$.
Let $E(X)$ be the set of all ends of X. In a previous problem, I've shown that the set $X \cup E(X)$ can be given a topology with basis elements being the open sets of X together with sets $N(C,e)=e(C) \cup \{f\in E(X) | e(C)=f(C)\}$ for each end $e$ and compact set $C$. (Thanks to Henno Brandsma here for suggesting the hemicompactness condition that makes this work). This topology is compact and Hausdorff.
Problem: The problem has five parts (a through e). I'd like to find a proof of b,d, and e. I think I have a solution for a and c, described further below.
a) Show that it is possible for $\mathbb{R}^2-A$ and $\mathbb{R}^2-B$ to be homeomorphic even though $A$ and $B$ are non-homeomorphic closed subsets.
b) If $A \subset \mathbb{R}^2$ is closed and totally disconnected, then $E(\mathbb{R}^2-A)$ is homeomorphic to $A$. Hence if $A$ and $B$ are non-homeomorphic totally disconnected closed subsets, $\mathbb{R}^2-A$ and $\mathbb{R}^2-B$ are non-homeomorphic.
c) The derived set $A'$ of a set $A$ is defined to be the set of non-isolated points of $A$. Show that for each $n$, there is a subset $A_n$ of $\mathbb{R}$ such that the $n$'th derived set ${A_n}^{(n)}$ of $A_n$ consists of a single point.
d) There are $c$ non-homeomorphic closed, totally disconnected subsets of $\mathbb{R}^2$.(Hint: Let $C$ be the cantor set, and $c_1<c_2<c_3\ldots$ a sequence of points in $C$. For each sequence $n_1<n_2<n_3\ldots$, one can add a set $A_{n_i}$ such that its $n_i$'th derived set is $\{c_i\}$.)
e) There are $c$ non-homeomorphic connected open subsets of $\mathbb{R}^2$.
What I've got so far:
For part a, $A=$point, and $B=$closed disk should solve the problem.
For part c, I think that we can take the $1/n$ sequence (and 0) and add smaller such sequences that converge to each of the points of the original. This can be done recursively.
For part b, I have a feeling that the statement of the problem should be to prove that $E(\mathbb{R}^2-A)$ is homeomorphic to the one-point compactification of $A$ (call it $\tilde{A}$). (The reason I think this is because $A$ might not be compact, but $E(\mathbb{R}^2-A)$ always is. Using the one-point compactification should also take care of the unbounded end.)
I think the idea is to define a function $\tilde{A}\to E(\mathbb{R}^2-A)$ that takes a point $a$ to an end $e$ defined by $e(C)$= the component of $\mathbb{R}^2-A-C$ whose closure in $\mathbb{R}^2$ contains $a$, and takes $\infty$ to the end $e$ defined by $e(C)=$the unique unbounded component of $\mathbb{R}^2-A-C$ (I'm not sure why there's a unique one, but it feels like removing a closed totally disconnected set from a connected open set should leave a connected open set). But I couldn't prove that this function is well-defined, much less bijective, continuous, or open.
If my guess about the one-point compactification in right, this may mess up the "hence" part of b, since I remember reading somehere that it's possible for two non-homeomorphic spaces to have isomorphic one-point compactifications.
For part d, I believe we can take the cantor set, and add the sets in part c vertically over the $c_i$. But I couldn't prove that the result is totally disconnected or closed, or that there are $c$ non-homeomorphic ones.
For part e, I believe that it's enough to prove that the complements of the sets used in part d are connected.
Edit: Beni Bogosel has provided a nice answer to part c below.
Comment: See Marian Reichbach (1923-2000), [*The power of topological types of some classes of* $0$-*dimensional sets*](https://www.ams.org/journals/proc/1962-013-01/S0002-9939-1962-0133103-6/), Proc. AMS 13 #1 (February 1962), pp. 17-23. FYI, I came upon this question while conducting a google search to determine whether Spivak's problem, which is on p. 33 of Volume I of the 1979 2nd edition, is also in Volume I of the 1970 1st edition (and what page, if it is). [yes, p. 31](https://books.google.com/books?id=HFTvAAAAMAAJ&q=%22Spivak%22+%22non-homeomorphic+closed+totally+disconnected+subsets+of%22)
Answer: For part $(c)$ you can consider the set $A_n=\{(\sum_{k=1}^n \frac{1}{p_k},0) : p_k \in \{1,2,3,...\}\}$. At each derivation the sum has fewer terms by $1$.
Comment: Thanks, that is very slick.
Answer: There are several references relevant to part (e) at https://mathoverflow.net/questions/25009/counting-submanifolds-of-the-plane
But perhaps there are more elementary solutions.  I'd be interested to see them!
Answer: There's a problem with (b), because it might happen that $A$ is compact and totally disconnected and has no isolated points, e.g. the Cantor set; it would not help, as you suggest, to take the "one point compactification" of $A$, since $A$ is already compact. But $E(\mathbb{R}^2-A)$ will always have an isolated point when $A$ is compact, corresponding to the unique end $\infty$ of $R^2$ itself, the "point at infinity". The correct statement of (b) might be just to consider $E(\mathbb{R}^2 - (A \cup \{\infty\})$ minus the point at infinity.


Android and reflection

Question: I get the impression that Android supports reflection. But does it really? How sensible would it be to rely on reflection heavily? What's the penalty?
Answer: It is supported, and even recommended in the situation where you want compatibility with multiple versions of the Android OS in one apk file. This article from the official Android Developers Blog describes how to build an app that requires only some early version of the API, and uses reflection to invoke new APIs if they are available:
Backward compatibility for Android applications
Answer: Android supports reflection.
Once you've got a prototype running, you can benchmark and determine your bottlenecks.
If its reflection, then consider trying to cache interfaces and such to make it a one-off cost, rather than continually resolving the same interfaces from the same instances repeatedly.
Comment: I guess the question is really if somebody already did the benchmarks on various devices.
Answer: a simple example related to using reflection on android  http://aaarkonusurum.blogspot.com/2012/02/android-ile-reflection.html
Class x = Object.class;
Constructor[] constructors = x.getDeclaredConstructors();
Field[] fields = x.getDeclaredFields();
Method[] methods = x.getDeclaredMethods();
for (Constructor constructor : constructors) {
    //constructors
}
for (Field field : fields) {
    //fields
}
for (Method method : methods) {
    //methods
}

Creating a TextView from codebehind at runtime with using reflection
String x = TextView.class.toString().replace("class ", "");
Class<?> cls = Class.forName(x);
Class<?> param[] = new Class[1];
param[0] = Context.class; //Context=o an ki context ==> [activity.class]
Constructor<?> ct = cls.getConstructor(param);
Object paramVal[] = new Object[1];
paramVal[0] = context;
Object retobj = ct.newInstance(paramVal);

Reaching to setText() method at the runtime
Class methodParam[] = new Class[1];
methodParam[0] = java.lang.CharSequence.class;
Method method = cls.getMethod("setText", methodParam);
Object arglist[] = new Object[1];
arglist[0] = new String("THIS TEXTVIEW HAS BEEN CREATED ON RUN TIME");
method.invoke(retobj, arglist);

Answer: There is a nice example of reflection in the sample code as well, in BusinessCard. This method wont result in a bunch of expections being thrown, so it should be much more performance friendly. It is also, in my opinion, easier to implement. Especially if it concerns a previously unimplemented method.
Here is where it is used:
http://developer.android.com/resources/samples/BusinessCard/src/com/example/android/businesscard/ContactAccessor.html
Answer: Android of course supports Reflection and we can read methods of a different APK or Framework class.
Here is an article on using Reflection in Android as a possible design approach to create API-
http://prasanta-paul.blogspot.kr/2013/09/java-reflection-as-android-api.html
Comment: I don't like the "of course" bit. There are plenty of Java environments in which reflection is non-existent. JavaCard and Java ME come to mind.

Android and reflection


Apple FileVault -- would Apple build a backdoor?

Question: Could Apple build a backdoor into it's FileVault encryption technology? Is that a risk you take of using a closed-source encryption product in general? Would using something like TrueCrypt be more reliable?
Comment: I would encourage the down-voter to express their thoughts on why the displeasure with my question.
Answer: I would be less worried about a backdoor than sheer weakness as an encryption scheme. This article appeared in February this year and was the first thing that came up when I typed "decrypt filevault" in google:  http://reviews.cnet.com/8301-13727_7-57369983-263/filevault-2-easily-decrypted-warns-passware/
You should check out TrueCrypt, as they are evidently purely devoted to mac disk encryption. Probably any non-costly or self-made system will be reversible in the right hands, partly due to the fact that the decrpyter would be smart to assume one of those methods (free or supplied with the operating system) were used, which is essentially removing one variable in the search for the decryption key.
Comment: Looking at the linked article they retrieved the key from memory using the firewire port (this has been a known issue with Macs for while), they didn't actually crack the Crypto on file vault.  It's worth pointing out that if someone has access to the memory on your machine and you have a loaded encryption key it's possible they'll be able to retrieve it.
Comment: What?! I didn't knew those algorithms were so bad it was possible to break a macbook in less than an hour. @rofls indeed.
Comment: Linux is excellent for servers, Windows is excellent for gaming, Mac OS is excellent for ads. Also, you mention a self-made system is not very good, but see it from the point of view that any self-made system will not have a commercial GUI application made just to crack that (and unless you're *very* high-profile no one will hire a top hacker to crack your laptop's encryption scheme).
Comment: Apple's changed how things work in OS X with the fix of CVE-2011-3215, and now the only way the Firewire attack would work is if the computer is on, logged in, and the session unlocked. Flat out removing the system's RAM while the machine is running could still be used, but such an attack would also work against TrueCrypt (and others).
Comment: In that article it looks like the machine would have to be powered on. At that point in time the entire disk would be decrypted. There would be no real need to extract the password, unless you want to power down the machine, when you could just copy the drive. If someone gets a machine that has entire disk encryption and it is powered on nothing is encrypted. On the other hand if the computer is off RAM will be empty or contains meaningless information. For Filevault to work you have to have the computer off.
Answer: The simple answer is yes - any provider of software could build a backdoor into it.
But would they? @Terry gives a good point about motivation, so my confidence would be high that they wouldn't want to add a backdoor, however you also need to be aware that governments and other pressures may force a company to add a backdoor.
So if you have sensitive data, think about additional encryption...
Answer: To answer the question, yes - it is possible that Apple could build a backdoor into its encryption system.
However, and I cannot stress this enough - there is no reason why Apple will do this. The fallout if it ever gets discovered would be enormous, probably enough to completely destroy the reputation and goodwill Apple has built up over the years.
I would not be worried about a backdoor - just the strength of the encryption. I would suggest TrueCrypt, it is simple to use and reliable.
Answer: Apple applies for 3 patents which are designed to retrieve private keys using a built-in backdoor in 2010.
Abstarct of one of patents:

The invention is a cryptographic system using chaotic dynamics. A chaotic system is used to generate a public key and an adjustable
  back door from a private key. The public key is distributed and can be used in a public key encryption system. The invention can also
  be used for authentication purposes. The adjustable back door of the invention can be used in conjunction with the public key to
  derive the private key. The degree of difficulty involved in deriving the private key is dependent on the adjustable back door. That is
  the value of the back door can be adjusted to vary the difficulty involved in deriving the private key.

More specific, this patent amongst other, claims (#5):

receiving a public key and a back door, the back door including interim conditions in an N-body chaotic system which has initial conditions, the public key being generated from the N-body chaotic system based on the initial conditions and the interim conditions; performing backward iterations on the public key, the backward iteration including applying one or more equations in a motion model to bodies in the N-body chaotic system; and generating a private key based on the public key and the backward iterations.

They have reversable cryptosystem. There is also a non-zero possibility that they use this cryptosystem in their closed-source products like FileVault, but it is hard to tell if they do really use it.


Is there any leaked information about the real purpose of the X-37B spaceplane

Question: Is there any leaked information about the real purpose of the X-37B. It is said that it could be used as a multipurpose space-plane such as a spy satellite or demonstrating technologies for re-usability, reliability, test of new  propulsion technology for longevity, testing avionics, flight systems, guidance and navigation, thermal protection, or insulation  and re-entry systems. In previous space flights information was tended to be secret and not many declarations are done by Boeing, Air Force and NASA for the purpose of each launch or program at all. Most of information remain just as possible but not confirmed. So i was searching if are some proofs,kind of proofs such as confirmed declarations published by wikileaks for example or leaked by inside people of the program, if X-37B is used for spying other countries for example, intercepting or capturing confidential secret information of other countries, if X-37B is completely a spy satellite itself, if it testing new propulsion system then what kind of it is testing and keeping so secret to other agencies,or doing other experimental technologies what exactly new technology is operating.
Comment: I saw that question it is really helpful for possible missions that could be used.I wrote in to my question some possible purposes which are shown in wikipedia and some other sites but i was searching if are some proofs,kind of proofs such as confirmed declarations published by wikileaks for example or by inside people of the program if X-37B is used for spying other countries for example,intercepting information,or if X-37B is a spy satellite itself,if it testing new propulsion system what kind of it is testing and keeping secret to other agencies,experimental technologies what exactly doing.
Answer: The official name of the vehicle is the "Orbital Test Vehicle", and there is an information sheet produced by the US Airforce. The two stated purposes are:

The primary objectives of the X-37B are twofold: reusable spacecraft technologies for America's future in space and operating experiments which can be returned to, and examined, on Earth.

Wikipedia has a pretty detailed list of some of the items that have been tested on the various flights.
The most likely candidate, as stated by Daily Mail, is that the space plane is being used to test technologies that will improve spy satellites. Such things could include camera testing, thrusters, surviving at low altitude, among others.


How to work out the kWh required to compress hydrogen gas?

Question: I am trying to work out the kWh/kg of compression of hydrogen. I have used the isentropic compression calculations and get values for the entropy but am unsure how to get this to a kWh value. I might be doing completely the wrong thing however.
Comment: I want to really help you, plz consider providing following information: what are boundary conditions ( assuming piston as a  system), is wall of piston insulated or diabatic. What is desired degree of accuracy, you want exact values or maximum values ?
Answer: Let's consider a piston.  Area A, length L1, filled with an ideal gas at pressure P1 (ideal gas requires pressures and temperatures be absolute- 0 being true theoretical vacuum, absolute zero respectively).  Initial volume is V1=A×L1.
We compress it to volume V2. Supposing temperature doesn't change, PV remains a constant (nRT) so P1×V1=P2×V2 and more generally P=P1×V1/V.
P×A×dL is the energy spent (Force×distance) to compress. A×dL=dV. In other words we wish to integrate P1×V1/V dV from V1 to V2.  Integral of 1/V dV is ln(V)+C so
Energy = P1×V1×(ln(V2)-ln(V1)) = P1×V1×ln(V2/V1) [volume form]
Substitute V2= P1×V1/P2
= P1×V1×ln(P1/P2) = [pressure form]
Note the signage for energy. Letting it expand can make it do work (positive).  Reciprocating the division can get it in forms where the cost instead becomes positive.
Comment: Hi, If I were to use this formula, would I use pressure in the form of Pa or bar?
Comment: Make sure it's absolute pressure (not gauge) for ideal gas approx.  Most unit conversions can be searched online these days https://www.google.com/search?q=bar*m3+to+J&oq=bar*m3+to+J
Answer: Calculating the specific kWh required to compress hydrogen gas depends on several factors, making it impossible to provide a one universally applicable formula. However, here's an outline of the key steps involved:

Define the conditions:

Specify the initial pressure (P1) of the hydrogen gas.
Determine the final pressure (P2) you want to achieve.
Define the mass (m) or volume (V) of hydrogen gas to be compressed.
Choose the type of compressor (e.g., reciprocating, centrifugal) as different types have varying efficiencies.

Select a method:

There are two main methods to estimate the energy required for compression:
a) Using the ideal gas law (assuming isothermal compression): This method assumes constant temperature during compression, which is an ideal case not achievable in reality. However, it provides a theoretical minimum energy requirement.
The formula is: $W = n * R * ln(P2/P1)$, where: W is the work done in Joules; n is the number of moles of gas; R is the gas constant (8.314 J/mol*K); ln is the natural logarithm. To convert Joules to kWh, divide by the conversion factor 3600 seconds/hour and 1000 J/kJ: kWh = W / (3600 * 1000).
b) Using compressor efficiency: This method is more realistic as it accounts for energy losses due to friction and other factors within the compressor.
The formula is: $kWh = (m * (P2 * V2) / (η * Z * J))$, where: m is the mass of hydrogen gas (kg); V2 is the final volume of hydrogen gas (m³); η is the compressor efficiency (decimal value between 0 and 1); Z is the compressibility factor (accounts for non-ideal gas behavior) at the specific conditions, which can be found from tables or charts; J is the conversion factor (1 kJ/kWh).
Additional consideration: The actual energy consumption can be higher than the estimated values due to factors like heat loss during compression, additional equipment needs, and possible inefficiencies in the system.
Comment: Hi, thanks for both of those, the second formula looks good but do you have any information on how it is derived?


Parallel transport curve with corners

Question: I am trying to understand the parallel transport along the triangle looking path on the sphere, as in http://en.m.wikipedia.org/wiki/File:Parallel_transport.png. The thing that confuses me is that the curve looks only piecewise continuous, so the only reason the vector points in a new direction is that the parallel transport ignores the rotation that occurs in the corners? I thought curves had to be smooth? What am I missing?
Comment: can you not smooth it out using a bump function in a small neighbourhood of the corner? if you work in a ball all paths are homotopic so parallel transport shouldn't change. right?
Comment: I am just using my intuition. It feels like walking around with a spear held fixed along that curve requires me to either rotate or start walking sideways in the corners, parallell transport equaling walking sideways... Don't know about homotopic paths in a ball and parallell transport.
Comment: @user125763 Homotopic paths do not induce the same parallel transport maps.  Your construction would work if you confined the distortion to a tiny neighborhood of the corner, but ultimately it's unnecessary.
Answer: Let $\gamma$ be a smooth curve starting at $p_1$ and ending at $p_2$.  "Parallel transport" is a linear map from the tangent space at $p_1$ to the tangent space at $p_2$ determined by $\gamma$ (as well as the chosen connection on the underlying manifold).  So if you have two curves - the first from $p_1$ to $p_2$ and the second from $p_2$ to $p_3$ - then parallel transport along their concatenation is just the composition $T_{p_1} \to T_{p_2} \to T_{p_3}$ of the parallel transport maps associated to the two curves.
In particular, there is no "rotation around the corners".  That sort of consideration would be relevant if you wanted to explore second-order phenomena such as the curvature of a curve, but not in parallel transport.  Perhaps the following example will help your intuition.  Take a vector on the equator of a sphere which points towards the north pole.  If you parallel transport the vector along the equator it will still point north (not true along any curve, but true along the equator).  But if you take two northward pointing vectors on the equator and parallel transport them both up to the north pole along geodesics then they will not point in the same direction (their angle will depend on how far apart they were at the equator).
Comment: Okay I should think of parallell transport as statue pushing I guess!
Answer: Do parallel transport of the vector ${\bf v}:=(1,0)$ along the unit circle beginning and ending at $(1,0)$. Then the vector ${\bf v}$ will be horizontal pointing to the right at all times, even though the circle changes its forward direction continuously by a total amount of $2\pi$.
This is telling you that you should not turn the transported vector ${\bf v}$ at points where the curve $\gamma$ along which you transport has corners.

Parallel transport curve with corners


Integer Wavelet with Only Positive coefficients

Question: Is there any Integer Wavelet Transform which produce only positive coefficients?
Currently i'm using Haar wavelet but it produces both positive and negative coefficients.
Comment: What is the meaning of producing?
Answer: If you are talking about the wavelet by itself, no, because   it is a  zero-mean function (by construction), hence there are positive and negative values.
For wavelet coefficients from data, no, because of linearity: if for some $x$, $W(x)$ is positive, then $W(-x)=-W(x)$ is negative.
Note that for some signal models, with certain multiscale schemes, you could achieve your goal. You can find hereafter two references:

Lossless data hiding based on integer wavelet transform

In data hiding, pieces of information represented by the data are
  hidden in the cover media. In some applications, people do care about
  the cover media. That is, the hidden data and the cover media may be
  closely related. For this type of data embedding, in addition to
  perceptual transparency, for some applications such as medical
  diagnosis and law enforcement, it is desired to invert the marked
  media back to the original cover media after the hidden data have been
  retrieved. The marking techniques satisfying this requirement are
  referred to as lossless, distortion-free or invertible data hiding
  techniques. From this point of view, it is observed that most of the
  current digital watermarking algorithms are not lossless.

Distortionless data hiding based on integer wavelet transform

A novel distortionless image data hiding algorithm based on integer
  wavelet transform that can invert the stego-image into the original
  image without any distortion after the hidden data are extracted is
  proposed. This algorithm hides data into one (or more) middle
  bit-plane(s) of the integer wavelet transform coefficients in the
  middle and high frequency subbands. It can embed much more data
  compared with the existing distortionless data hiding techniques and
  satisfy the imperceptibility requirement. The image histogram
  modification is used to prevent greyscales from possible overflowing.
  Experimental results have demonstrated the validity of the algorithm.
Comment: Thanks, I had difficulties with data hiding in wavelet coefficients...
Comment: The basic problem is after modifying coefficients and applying inverse integer wavelet, i got some negative pixel values. of course there is some tricks for how to not getting negative pixel values, but i was wondering if there was some kind of wavelet that guaranties positive coefficients in transform and its reverse.


Proof Of work (with real world example needed)

Question: I have understood the sha256 algorithm example . But how does a node in a network decide if a transaction is valid or not .
Comment: https://en.bitcoin.it/wiki/Proof_of_work
Answer: Proof of work has nothing to do with transaction validity.
Transaction is valid when it meets certain simple rules:

You do not spend more ether than you have.
Index number(nonce) of the transaction follows previous transaction of your address.

All valid transactions go in a block. And that's where Proof of Work comes.
Imagine it like finding a needle in a haystack. All miners start to do it in the same time. The one who finds it becomes the creator of the block. It used to verify that miner used a lot of computing power. The reason for this is to prevent malicious users from creating long chains which may compromise whole blockchain.


Multisite - create new site with precreated pages, menu etc

Question: I'm developing a site, where users will be creating their own sub-sites.
On new site creation, I would need to prefill it with some Pages, Menu settings etc. Is there an easy way to do this, any hook to use?
Answer: The proper hook for that is wpmu_new_blog. I will describe how we do that in Multilingual Press Pro. Our code is actually rather complex; I will extract the most important points.
We offer an option to select any existing blog as a template for the new blog. The nice part is that you can edit the template content, customize the theme, activate plugins … like in any other blog. No need to update the code when you change your mind about the default content later.
For your use case, you can just create one template blog and take the blog ID.
add_action( 'wpmu_new_blog', function( $blog_id ) {
    // copy the template blog here
});

What happens in the callback?

We get the prefix for the template blog (ID 44):
switch_to_blog( 44 );
$template_prefix = $wpdb->prefix;
restore_current_blog();

We erase the fresh tables for the new blog and copy the content from the template blog.
foreach ( $tables as $table )
{
    // empty the tables
    $wpdb->query( 'TRUNCATE TABLE ' . $wpdb->prefix . $table );
    // insert template content
    $wpdb->query( "INSERT INTO $wpdb->prefix$table SELECT * FROM $template_prefix$table" );
}

We restore the most important options for the new blog (blogname, home, admin_email and so on) and rename the user_roles to match the current blog.
Then we copy the attachments. These are … not simple. wp_upload_dir() is not reliable after switch_to_blog(). You have to add some workarounds to get the correct paths. This is actually a separate class with 250 lines. :)

There are other issues like domain mapping plugins, custom plugin tables and some minor compatibility problems with other plugins using the same hook or themes and plugins expecting an installation call. They shouldn't bother you when you just need a solution for one site.
Comment: @user1049961 On subdomains, `wp_upload_dir()[ 'baseurl' ]` is _sometimes_ wrong, it has to be adjusted. And you have to parse `_wp_attachment_metadata` to get the paths for all file sizes (thumbnail etc.). This part is of our plugin is released under GPL, but you get it only with the Pro version.
Comment: Thanks, ths was really helpfull! Can you give me some more details on the attachments? Or, do you offer a separate plugin for this?


Sealant for external outlet

Question: What type of sealant should I use for this?  I'm assuming 100% silicone.
Comment: That box should have a trim ring around it, not just a raw hole in the vinyl siding. The trim ring deals with controlling water getting behind the siding from the hole around the box by effectively flashing the hole in the siding.
Answer: Outdoor receptacle boxes aren't intended to be sealed
Yes, that's right: the standard outdoor/weatherproof electrical enclosures in use in the US are not intended to be sealed against water ingress.  In fact, the NEC contains an explicit allowance (in 314.15) for drain holes in the bottom of boxes.
Why is this?  The goal of a a weatherproof (NEMA 3R or equivalent) electrical enclosure is to keep the equipment inside from being rendered inoperable by bulk water, ice, small animals, or other such environmental contaminants, not to provide a pristine environs on the inside.  For the latter, you'd need a box with a NEMA 4X or 12 rating, with the much more stringent installation conditions (field fitted knockouts with sealed cable glands or Meyers hubs) those enclosures entail.
Furthermore, sealing a box against water ingress has to fight not only bulk water entrance, but two other factors: diffusion and pressure.  The former is slow, but can cause water vapor to get in to the box through various materials, including some that are used as seals, and results in condensation inside the box eventually due to temperature changes.  With the seals giving it nowhere to go, this condensation eventually builds up to a sufficient level to affect the electrical equipment inside.
Worse yet, though, are the effects of pressure.  Normally, with a raintight/weatherproof but not-hermetically-sealed enclosure, air can flow freely through small gaps and any drainage facilities provided, allowing the air pressure on the inside of the box to stay the same as the air pressure outside the box.  This lack of a pressure differential means that any water that gets in by way of momentum simply freely exits by gravity, and there is no force actively pushing water into the box.
When you seal the box though, this changes drastically.  Now, air can't get in or out of the box, so the pressure in the box stays about the same as when you sealed it.  However, the pressure outside the box changes all the time (just watch the nearest barometer reading).  These changes in pressure provide a non-zero pressure differential across the box seal which can force water through imperfections in the seal (or even via diffusion through bulk material, albeit slowly).  This force also can act to keep water resident in the box; atop the natural effect of the seal to stop drainage, this means that water again can build up in the box and cause a failure.
Comment: The answer no one wants but everyone needs to hear.
Answer: Actually 100% silicone isn't a great caulk in my book. It's hard to get off later and typically isn't UV resistant.
What you want is a solid outdoor oil-based (mineral spirit cleanup) caulk (sometimes called Window/Siding). I really like Quad, but anything made for outdoors will do (even some latex products).
If I were you, I'd also replace the cover. It's looking weathered. Once you've caulked it, you'll be less likely to replace it in the near future. I would highly recommend an in-use (bubble type) cover.
Comment: I like Quad as well for all siding/window work where a caulk is needed. It gives a nice smooth finish. If I want a bit of texture to it, I turn to Vulcan.

Sealant for external outlet


Help with Cavalier/mount special abilities

Question: I'm building a Cavalier in Pathfinder, and under the "mount" section in the APG it talks about the mount dying, then says, "New mount does not gain the link, evasion, devotion, or improved evasion special abilities..." But these are the only mention of those abilities that I find anywhere in the information about the Cavalier class. Was the original mount supposed to have had those abilities?  What am I missing?
Comment: Welcome to the site. Take the [tour]. Yes, *Pathfinder* can be awfully spread out, with information scattered everywhere. Thanks for your participation, and have fun.
Answer: A cavalier's mount functions as the druid's animal companion, so the mount gains the special abilities and other stuff as the cavalier levels up according to the linked animal companion table.
For example, a level 6 cavalier's mount has the special abilities link, share spells, evasion, ability score increase, and devotion, but were that mount to die, the mount the cavalier discovers after 1 week of mourning doesn't gain the special abilities link, evasion, and devotion until the cavalier himself becomes level 7.


Family tree of Prishadhra?

Question: What is family tree of Prishadhra?what is name of child of Prishadhra ? Do child of prishadhra is shudra or Kshatriya?
Answer: <code>What is family tree of Prishadhra?
</code>
According to Scriptures, Prishadhra was the son of Vaivasvata Manu.
I am quoting from Agni Purana, Chapter 273.

5-6. Vaivasvata Manu had eight sons best of all but not equal to him—Ikṣvāku, Nābhāga, Dhṛṣṭa, Śaryāti, Nariṣyanta, Prāṃsu, Karuṣa and Pṛṣadhra. They were of great prowess and lived in Ayodhyā.

Accidentally, he killed a cow, so his preceptor cursed him to become Shudra

Prṣadhra became a śūdra on account of killing the cow of his preceptor.

Detailed story of Prishadhra killing cow is mentioned in Shiva Purana - Section 5 - Umā-Saṃhitā, Chapter 36.

Pṛṣadhra, a son of Manu was made the keeper of cows by his preceptor. During the nights, observing the posture of heroes, he diligently looked after the cows.

Once a tiger entered the cowshed to attack the cows. On hearing the shrieks of the cows he woke up. Strong that he was he seized a sword to kill it and started.

On seeing the lord armed with a sword the frightened tiger slipped away. Not knowing it and mistaking a reddish brown cow as the tiger he hit it with his sword on its head.

Due to rain and gust of wind in the night he was deluded. Thinking, that the tiger had been killed he returned to his place.

When the night dawned into day he got up and went there. He saw only the cow killed and not the tiger. He felt dejected.

On hearing about the incident and realising that he had committed a sin unconsciously and not wilfully, the preceptor cursed him—"Become a Śūdra, not a Kṣatriya."

On being cursed by his preceptor, the family priest out of anger, Pṛṣadhra started from there and went to the great forest.

Dejected by sufferings he became detached and practised Yoga. He burnt himself in conflagration and attained the greatest goal.

Lastly, Prishadhra took the wow of celibacy as it is mentioned in Srimad Bhagavatam - Canto 9 - Chapter 2

The hero thus being cursed by his guru, accepted the words with folded hands and took the vow of celibacy the way the sages want it.

Family tree of Prishadhra?


Should I capitalize the word 'Web' in this sentence?

Question:
A dedicated web server may be required, depending on XXX, YYY, ZZZ, and the total number of concurrent Web users
Comment: No. Why do you think you should?
Comment: Yes, the Web is  a proper noun.
Comment: The two comments and the two answers as of now clearly establish the fact that it is more a question of personal preference than a hard and fast rule.
Comment: I'd say this is off topic because style, as in this context, is not defined in language and usage. Style guides are known to recommend variously as [the web/ web site/ web user] and [the Web/ Web site/ Web user] -- currently the thing is in transition. Until the lowercase is established as the norm, you may have to follow the applicable style recommendation; and in the absence of any, be prepared to defend your choice.
Answer: No, you should not. Even Sir Tim Berners-Lee does not:

1991   T. Berners-Lee WorldWideWeb: Summary in comp.archives (Usenet newsgroup) 9 Aug.,   The WWW world consists of documents, and links... The web contains documents in many formats.

OED does say "usually with initial capital", and then goes on to say

Originally written with a capital initial, web compounds are now increasingly written with a lower-case w. Since it is difficult to make an objective judgement about the dominant capitalization in particular cases and the evidence is changing too rapidly for such a judgement to be of any lasting value to the reader, the compounds below have been routinely presented with a lower case w irrespective of the quotation evidence.
The patterns of attachment are less inscrutable. The relative dominance of one-word, hyphenated, and two-word forms is in general governed by the status of the second element. Those compounds in which web is combined with a word occurring independently as a common noun are most frequently written as two words (web page, web site). Blends with parts of other words are typically rendered as one word (webliography, webzine). Hyphenation occurs most consistently where the second element is an adjective or is frequently found in compound formations (web-aware, web-based, web-enabled).

You are using web users, a compound "in which web is combined with a word occurring independently as a common noun" — and should therefore not have a capital letter.
OED then goes on to list compounds where web appears as an attributive: web access, web address, web design, web designer, web developer, web publisher, web publishing, web surfer, web surfing.
Comment: I agree; you should not capitalise "web".

[Wired ran an article](https://www.wired.com/2016/04/ap-finally-realizes-2016-will-let-us-stop-capitalizing-internet/) when [the AP Stylebook](https://www.apstylebook.com/) updated their recommendations on this topic.
Answer: As Kris points out in his comment, the choice between web and Web is purely a matter of personal preference (or house style) at the moment—though as time goes on, the capitalized version is likely to become less and less and common, and therefore will begin to look more and more old-fashioned.
Andrew Leach's OED citation provides a succinct description of the current status of Web versus web as the short form of the entity formerly (or formally) known as the World Wide Web. At the computer magazine where I work, we shifted from "Web site" to "Website" about four years ago, and from "Website" to "website" about 18 months ago. Nevertheless, as a matter of house style, we continue to capitalize the W in "the Web." I suspect that inertia is as responsible for our current style as anything else is.
Still, there is one oddity at play here: Why is "the web" rapidly becoming standard while "the internet" remains (I believe) far less common than "the Internet"? Neither "Web"/"web" nor "Internet"/"internet" is a proprietary name; and as far as I can see, "the internet" is even less susceptible to ambiguity than "the web." Does anyone have any insight into the different treatment that these two terms appear to be receiving with regard to capitalization?
Answer: World Wide Web, or WWW is capitalized, as is Internet, so I capitalize the abbreviation, Web, since it is one of the three capitalized words in the proper compound noun, World Wide Web. I have had no complaints from my Navy customers. Even if someone prefers Web not being capitalized, I can support my choice with logic.
Comment: +1 for the "logic", but there are other view points too. One quick reference {{ http://gadgetopia.com/post/25 }} on the same issue.
Answer: You should not capitalize the word web. It is just a short form for window electronic browser. Just like we don't capitalize etc, which is a short form for et cetera, so do we follow the same for web.
Comment: @Thomsa it's an interesting one though, as I've come across this before. It's clearly wrong not just from the history of the name (we know it's an abbreviation of "World Wide Web" which uses *web* in a long-standing figurative use, and we can find plenty of documents from the web's early days) but also because the suggested expansion manages to be both meaningless and wrong (there's no requirement that browsers use windows). Yet it seems to pop up in TEFL contexts. As far as I can make out, the backronym comes from a joke making fun of newbies that said newbies didn't get.
Comment: Web is not an acronym.


How to delete duplicate comments using sql?

Question: In order to clean up an old large site from spam, I'd like to delete all duplicate comments from mysql. By duplicate I mean, the comments which are posted by the same user across all nodes of a certain type where content of the comments are exactly the same.
Comment: What is the magnitude of the purge you need to do? Depending on the magnitude you could do this with a View and Views Bulk Operations. Or this could be done using Drush. Also do you want to delete the users too?
Comment: Well the order of magnitude is 1e6, and it will be one-off hence raw sql is preferred. Just need to delete comments not  the authors.
Comment: Yup you want to do that via SQL.
Answer: For toying things on the backend in SQL. The best place to start would be to look to see how the API does something in Drupal. For this you want to look at comment_delete_multiple which you can call to delete mass comments. You will need to know the comment IDs of the comments that you want to delete.
This is where this gets complicated. You have to find the CIDs you need before you can start deleting. Your criteria for finding the comments is going to depend on what you want to do. If you just want to delete any and all comments that are dupes then you could run a query like this to find dupes and generate the CIDs you want to delete.
Once you ahve the CIDs, it is very easy.You write a delete statement against the comment table.  Using the Drupal API where it would iterate through the list of CIDs
<code>$cids = array( , , , .....)
db_delete('comment')->condition('cid', $cids, 'IN')->execute();
</code>
With the amount of comments you are trying to delete doing this strictly in SQL is going to be hard because you will need to write a statement with a gigantic list in a LIKE clause.
In my humble opinion: when I have had to do massive data changes like this in Drupal I write a PHP CLI script to do it so I can handle the data. I've migrated a website that had 150k users, 2000 blogs, and 110k comments, I did it all with PHP CLI scripts.
Comment: I would pose your question in a SQL forum rather than here because what you are asking for is a rather complex SQL statement.
Comment: Thanks for the explanation Brady. But I am not a php programmer and I am migrating out of drupal hence I mentioned that I need a raw sql to do the trick.
Comment: well the problem is that elsewhere  people don't know drupal table relationships.
Comment: @bili `comment.cid` on `field_data_comment_body.entity_id` and `comment.cid` on `field_revision_comment_body.entity_id` . Unless you have other fields on the comments those are probably the only relationships you'll need. Unless you also want to join `users.uid` on `comment.uid`. YMMV if you have comment-related contrib modules installed. Be sure to clear the caches after manipulating entity/field data manually. Constructing that SQL query for you is beyond the scope of Drupal Answers so you might be better off posting it elsewhere if you're on a deadline


Is it possible to make a CS:GO Machine Learning AI?

Question: I am not an expert on Machine Learning, Neural Networks or NEAT. In fact, I probably have no clue what I'm talking about. My question is if you can make a learning AI that learns to play complex multiplayer games and possibly outpreform humans. If it is possible, could you also recommend a language or languages to make this AI in? (I know I'll probably have to take a VACation for botting, but it's something I feel like we should try.)
Comment: It would actually be worse for you to use humans to train your AI. Often the strategy used to make AIs perform so well against human players is to have them play themselvs, AI vs AI, at a sped up pace. With this strategy the AI would learn from itself by playing thousands of games or even tens of thousands of games against itself before every playing humans. If you make it train on humans then it's not going to get many games in compared to the number it could be getting in and it won't be very good very quickly.
Answer: The answer is yes:
Example of a neural network outplaying human players in DOTA.  I haven't been able to find much regarding what kind of neural network but here is what is on the OpenAI website.  If you're a beginner you can learn some basic architecture and design principles in neural networks using Python and Keras (a neural network library).
Answer: My 2 cents - yes, it can be done definitely.
Immediate example I can think of is playing chess against a machine.
But I could be wrong. Let's wait for other experts to respond.
Answer: The question isn't whether this can be done. The question is how would you train such a model?
If you read the whitepapers on things like Alpha Go and the like, those models are just reinforcement learning run on massive hardware. Since Alpha Go was backed by Google, it was nothing for them to build a simple model and then tell it to go and play 10,000,000,000 games (or whatever) since it could do that in a very short amount of time (and many more games than any one human could possibly hope to achieve). Plus the straightforward nature of Go makes it easy to write software the simulates a game.
So, you would have to think about how your model (any model) could replicate this type of learning in an automated way. Are there mathematical representations of CS:GO that you can use to feed into the model? Do you have a way for your model to play a ton of these games automatically so that it can learn from it's own actions? You would have to answer both of these questions in a meaningful way in order to verify that there is a path forward with this effort.


problem with Shift, Ctrl and Alt button with integrated keyboard

Question: I have bought a new notebook: HP Pavilion 15 ab062nl, but have a problem with Shift, Alt and Ctrl buttons of the keyboard.
For example, when I press the Shift button to type in upper-case letters, some letters appear upper-case, and then it starts writing lower-case letters, though I'm still pressing the Shift button. It is as if I released the button, but I have not.
I have the same problem with the Alt button (for example, when I use Alt+Tab), and the same problem with the Ctrl buttons.
Sometimes it works as if these buttons are pressed autonomously. For example, sometimes, when I scroll pages on Firefox (or any other browser) using the scroll wheel of mouse, it is as if I am pressing the Alt button though I am not, and Firefox resizes the zoom of the page.
Furthermore, I discovered that if I press the Shift buttons for just a second or two, these problems momentarily disappear; i.e., till the next reboot.
I have noticed this bug with all distributions (ArchLinux, Antergos, Fedora 16, Fedora 23 - GNOME Wayland, Ubuntu 15.10, Ubuntu 14.04, and Debian 8.0.2).
I have tested x86-64 distros, and I have tested with all DEs (even without a DE). I have tried with 32-bit distributions as well but have the same problems.
This is not a hardware problem, because, on Windows, I do not have these problems, and even on a Linux distro on Virtualbox under Windows. And while using an external USB keyboard, I do not face these problems
My hardware:
CPU: AMD A10 8700p
GPU: Radeon R6 + Radeon R7 M360
RAM: 8GB DDR3L 1600MHz
Answer: There is a known bug for this issue, that appears to be specific to HP, possibly specific to the HP 15.  See https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1532746 and add any information you have.


Is a breath weapon a natural attack in Pathfinder?

Question: Is a breath weapon a natural attack in Pathfinder? I'm trying to build a class and want to increase the damage it deals with the improved natural attack feat.
Answer: Breath weapons are not natural attacks.
If you refer to the universal monster rules, you can see that Breath Weapons and Natural Attacks are listed separately; though the description of natural attacks does only include the "most common" kinds of natural attack as examples and allows for other options, breath weapons are separately described as their own special feature, and are not a natural attack form unless explicitly clarified so (though I'm not aware of any monster or ability which does).
I'm don't think there are any first-party options/feats/etc. which increase breath weapon damage, but you could always take Ability Focus with your breath weapon to at least make it harder to avoid.
Comment: There are a couple 3.5 Paizo breath weapon feats ([Slow Exhalation](http://www.archivesofnethys.com/FeatDisplay.aspx?ItemName=Slow%20Exhalation) comes to mind).


Is there a way to create multiple points in one layer of a Cartodb map and edit them each separately?

Question: I am making a Cartodb map that is supposed to show different pictures of a park in popups at points along a park path.  I started by making a different layer for each point but by the time I created 4 layers it looked like it was going to stop allowing me to create any more.  I have around 30 unique popups that I need to make.  Is there a way to create multiple points in one layer and edit them each separately?
Answer: Depending on your account type, CARTO has a limit of layers that you can add per map. For example FREE accounts have 4 layers as a limit.
It is possible to edit the points of the layer and edit each point (each point/geometry is stored in the_geom column of the dataset) in the data view of the map or of the dataset that you are using to create the map.
If I understood you correctly (let me know if I'm wrong!) you want to add a different picture for each popup. You could add a column where each row of the column could contain a different URL (1 row = 1 geometry and its attributes) of each image on your dataset and then use the infowindow "image header" template to display the images in the popups.
Comment: Thanks for the help!  I'm still having trouble.  I added a column & 3 rows in the data view and added 3 points within one layer to see if they would correspond to the rows.  I added a different URL & a description into each row of the new column.  Then checked to see if that would show up in the popups.  My html in the infowindow is still all that comes up in the popups, the same picture and description shows in each popup.  I tried deleting my html but that just left me with an empty popup.  Can you explain how to get the URL & description in the rows of the data view to show up in my popups?
Comment: i would recommend writting to CARTO support( email@example.com ) explaining your usecase.


Is it legal to bundle Oracles JRE with an open source program?

Question: Is it legal to bundle Oracles JRE together with the binaries of a (non commercial) open source program (GPLv3)?
Answer: Short answer: No. The Java (JRE and JDK) binaries provided by Oracle come so many strings attached that they are practically unfit for any usage or redistribution with proprietary or open source-licensed software including GPL-licensed software.
The only sane alternative is to consider the OpenJDK which is using a combo of licenses and is primarily under the GPL 2.0 with Classpath exception which is typically considered suitable for any open source or proprietary usage. See below for some pointers to OpenJDK pre-built binaries or build it yourself...
More details:
The Oracle JREs and JDKs (i.e. NOT the OpenJDK) are released under a proprietary license called the Oracle Binary Code License Agreement.
This license has evolved quite a bit over the years from its start at Sun to the point that it is barely usable for internal development and probably not much more. Oracle wants you to buy a commercial license instead for most usages.
In particular as one of the many issues in this license, the field of use restrictions have evolved to be so vague and far reaching as to make you wonder if any usage is allowed (emphasis is mine):

"General Purpose Desktop Computers and Servers" means computers, including desktop and laptop computers, or servers, used for general computing functions under end user control (such as but not specifically limited to email, general purpose Internet browsing, and office suite productivity tools). The use of Software in systems and solutions that provide dedicated functionality (other than as mentioned above) or designed for use in embedded or function-specific software applications, for example but not limited to: Software embedded in or bundled with industrial control systems, wireless mobile telephones, wireless handheld devices, kiosks, TV/STB, Blu-ray Disc devices, telematics and network control switching equipment, printers and storage management systems, and other related systems are excluded from this definition and not licensed under this Agreement.

These kind of restrictions would not fly much with any open source redistribution and with the GPL in particular.
This makes essentially any "LICENSE TO DISTRIBUTE" grants in section C and D moot in most cases. You may have a very narrow use case that may fit in these restrictions but all the lawyers I have consulted with on this license are quite uncomfortable with its terms for most practical cases.
The only sane alternative is to consider the OpenJDK whether for use in conjunction with FOSS or proprietary software. This is weirdly enough essentially the same codebase.
The OpenJDK project itself does not redistribute binaries and building an OpenJDK can be a rather engaged process. Linux distros have packages for this. For other OSes, there are some pre-built available for instance from Azul.
Update 2016-12: Actually the latest news is that Oracle is now enforcing commercial licensing and commercial audits if you do not use an OpenJDK.
Comment: Btw: Although it is hard to get someone at Oracle who *really* understands the license, *iff* you reach this person he/she will agree that it's very restrictive and want so sell you licenses.
Comment: @Reto sure thing!
Comment: @MartinSchröder yes, that's part of the quid-pro-quo I guess? ;)
Comment: Are they really the same codebase though. I thought there are quite some differences in terms of features supported and efficiency etc. I was reading something related to GraalVM: http://www.oracle.com/technetwork/oracle-labs/program-languages/overview/index.html, and it states some features are only offered by OracleJDK but not OpenJDK. Maybe they're similar enough for most general programs though.


Any "Gotchas" with using Freezable class outside of WPF?

Question: I've been reading up on concurrency, and looking at things from a more "thread safe" point of view.  WPF (or actually System.Windows.Freezable and others) has a freezable class, which can give "popsicle immutablity".  Has anyone tried using this outside of WPF/Silverlight and would it be better to use this, or roll your own/use someone else's?  I know there's a few good ones out there.
Answer: You should not use the Freezable type in System.Windows outside the WPF.
The reason for that is that you create a dependency to WindowBase.dll (or where Freezable is defined). And such a reference should not exist in "model projects" without direct access to the UI.
However, you can easily code your own Freezable base class.
I used the following interface in an application where I wanted to create thread-safe objects which required complicated initiation (it were circular references):
<code>public interface IFreezable
{
    bool CanFreeze
    {
        get;
    }
    bool IsFrozen
    {
        get;
    }

    void Freeze();
}
</code>
Note the CanFreeze property: I decided to use it as I wanted to validate the Freezables before freezing - and not giving the client a chance to do so is not good in my opinion.
The concept of Freezables is IMO a nice idea which enriches the palette of tools in multi-threaded applications.
Answer: Feel free to use Freezable and other dispatcher/dependency objects wherever you feel the need. Referencing WindowsBase.dll is no different from loading GDI32.DLL into a headless server program (as they all do and must). The only thing you need to consider is that DispatcherObject is oriented around the Windows message loop and provides infrastructure that will be of minimal benefit to you unless your code is event-driven and your objects reside on threads with Dispatcher event loops. But if so, you can gain substantial design clarity and flexibility from wrapping native objects with thread affinity inside DispatcherObject derivatives (I have done this to great effect with ESENT). It all just depends how far outside the box you are willing to think.


Scale a mesh cylinder instanced to geometry node grid

Question: B"H With 2.93 trying to form an audio visualizer with mesh cylinders instanced to all vertices on geometry node grid. Looked in Manual 2.93/Blender stack exchange/multiple tutorials. Geometry Nodes were initially formed with mesh circle. Deleted geometry node input.  Added geometry-grid, point instance and mesh cylinder. With point instance node, selected cylinder.
How to decrease scale so cylinders not overlap?  When scaled down the cylinder in 3d viewport, the size of the instanced cylinders is not altered.  Then tried multiple variations of geometry node combinations (including transform node before and/or after pt instance; object info node scale connected to point instance....) without any change in size of instanced cylinders.  Thank you.
Answer: Just scale down your cylinder in Edit mode, then all instances will be scaled.
Another option: Use the point scale node before the Point Instance node. Otherwise, it scales the points in the instances.
This has the same effect.
Comment: Maybe add: the _Point Scale_ node *before* the _Point Instance_ node. Otherwise, it scales the points in the instances. ( I've only just discovered you can nest Point Instancing.. you can instance more objects on the vertices of instanced objects )
Comment: thank you! added!
Comment: B"H Chris and Robin, Sequentially tried to scale 1st mesh cylinder then instanced cylinders in Edit Mode.   Will try again Thank you!  Also thank you very much the prompt response!    It worked. 0.361  THANK YOU!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Comment: If my answer helped, please check the checkmark legato my answer. Thank you!


Is implementing java.io.Serializable even in simple POJO Java classes a best practice?

Question: In general, is it a best practice to have simple POJO Java classes implement java.io.Serializable?
Answer: Generally not. Joshua Bloch says to implement Serializable judiciously. A summary of drawbacks that he describes:

decreases flexibility of changing class implementation later - the serialized form is part of the class's API
makes some bugs and security holes more likely - an attacker can access class internals within the serialized byte stream
increases test burden - now you have to test serialization!
burdens authors of subclasses - they have to make their subclasses Serializable too

Of course, sometimes you need a POJO to implement Serializable, say for RMI, but if the need isn't there, your code will be simpler and more secure without it.
Answer: Only if you need to be able to serialise them.  It's not worth the effort otherwise.
Answer: It depends more on the needs. In the context of web applications, some web servers (eg. Tomcat 6) even make it mandatory to serialize the classes whose objects we store in sessions.
Answer: One thing I've done to address the fact that the serialized form is not backwards compatible (say when dynamically reloading a class on a running system), is load the fields I want to save into a hashmap and then serializing that. That way, I can always deserialize in the data, even if there are missing fields. You might have to provide defaults for missing keys, but it's better than messing up field order.


Do intrigue cards have to be resolved?

Question: This question came up in my game group.  A player had a completed plot quest that gave him 2 victory points every time he played an intrigue card.  Is it possible to play an intrigue card and not resolve the action (either because he can't or doesn't want to) just to earn the victory point bonus?  This doesn't seem right to me, but I'm looking for supporting rules.
Answer: No, you always have to resolve the card.
The rules say that when you play an intrigue card, you follow its instructions, and none of the intrigue cards have instructions that say "if you feel like it, do X".

Play Intrigue Card: By assigning an Agent to one of the action
  spaces on Waterdeep Harbor, you play a single Intrigue card from
  your hand. If you have no Intrigue cards, you cannot assign an
  Agent to Waterdeep Harbor.
When you play an Intrigue card, you follow its instructions
  immediately. Its effect takes place just once.

(emphasis mine)
However, as GendoIkari pointed out in the comments, if he actually can't follow some part of the instructions, he would do as much as possible. He'd still be resolving the card, it's just that some instructions are impossible to follow so they don't happen. I don't think there's anything in the rules about this, but if the rules wanted you to ignore the whole card just because you couldn't do part of it, they'd presumably say so.

Side note: your instinct is right; ignoring what cards say in games is pretty much always wrong. If a game has an object (a card, tile, board space, or anything) with instructions printed on it, and you play/use that object, you follow the instructions (insofar as you can). If the game doesn't want you to always follow the instructions, it'll say so in the rules.
Comment: This applies to the "doesn't want to" part, but you didn't address the "because he can't" part. I would assume you ARE allowed to play a card even if it's impossible to follow the instructions; then you would just do as much as you can.
Comment: @GendoIkari That's not how it works in the officially licensed Lords of Waterdeep app.  Whenever the effects of an intrigue card can't be resolved in the current game state, the UI won't let you play it.
Comment: @RPL Interesting; I don't see why that would be from the rules. Does this apply if some of the effects are possible, but other effects are not?
Comment: Well, it won't let you play "Unlikely Assistance" if you don't have any wizards.  That's technically a thing you can't do (give an opponent a wizard) and a thing you can (score 8VP).  The other case that came up recently was that it won't let you play "Sample Wares" if you don't have any unassigned agents (but that's just a single impossible effect).
Answer: I disagree it is my understanding that you have to be able to do all of the intrigue card or not play the card.
The reason because,this would allow players to avoid going to somewhere where they could get a skull and lose points.
We play very specifically that if it says to do A,B and C you have to do all 3 or you cannot play the card.
If you could that would be as similar as skipping your turn which is not allowed either.
Comment: Welcome to Board and Card games! You answer would be greatly improved if you could find some supporting information, such as a rules citation. If you would like to learn more about how the site works and how to write good questions and answers feel free to check out [the tour](https://boardgames.stackexchange.com/tour).

Do intrigue cards have to be resolved?


How do formulas get figured out?

Question: Many of the formulas I learn in school are derived from more basic formulas — as long you your math is right and assuming the more basic formulas you used are correct, you are bound to get to a correct result... But how do people 'invent' the elementary formulas, like $F=ma$; how can you be sure that that's really the right equation for force?
Comment: See this question, nearly a duplicate: http://physics.stackexchange.com/q/2644/
Comment: Many of them are experimental relationships (fits).
Comment: It started with $F \propto a$ and then $m$ was chosen so that this works. But the first is experimental. And as you see in relativity, formulas are only good to some point, not perfect.
Comment: Both of those could be posted as answers...
Answer: The way in which formulas are figured out is through a process which is difficult to describe, because it only happens once per formula, and it is different when the formula can be deduced in some way, vs when it is a purely new relation between quantities which have not been related before.
The fundamental laws of a new regime of physics is never determined purely empirically, it always requires a principle of some sort, in addition to the empirical data, which serves to suggest empirical laws, and to weed out false theories. One of the best examples of a physical argument which produces a new equation is Einstein's argument for $E=mc^2$, described in my answer to this question: Did Einstein prove $E=mc^2$ correctly?
The most important tools which physicists have are the symmetry principles, these can be used to deduce many classical relations. But these are not enough, and there is no general way to describe how to reason about physics to derive new laws--- it must be learned through examples. There are many illuminating examples, but perhaps the best is Heisenberg's 1925 derivation of quantum mechanics. I find this one to be most strange, the most insightful, and requiring the greatest leaps of imagination. It is described on the Wikipedia page for Matrix Mechanics.
The equation you give is not the best example, because you can always say that it is the definition of force. This is not correct, because the force is implicitly assumed to be a physical property of the configuration of the particles, not of the particular particle trajectory, but in order to get rid of the circularity completely, let us assume you know statics, so that you have Archimedes definition of force.
Archimedes demonstrates that you can think of gravity as producing a force on a lever proportional to the mass. Then you know from Galileo's experiments that the acceleration is constant in gravity, and you know from Galileo's arguments that there is a principle of Galilean relativity. You deduce that the force should be proportional to the acceleration, which is invariant under Galilean boosts, and because all the acceleration is at the same rate, that the Archimedes notion of gravitational mass is also the notion of inertial mass in F=ma. Something like this is probably what was going through the heads of the 17th century physicists. It is hard to tell, because F=ma was appreciated by everyone in Newton's time, not just by Newton.
Comment: to add, dimensionality also plays an important role in determining that a formula is correct or not...
Comment: Dimensionality is only useful in regimes where you have at least one dimension, meaning away from quantum gravity regime.
Answer: They are figured out based on their ability to "economize thought," as Ernst Mach would say. To "economize thought" means to succinctly summarize the results of physical experiments or observations. Since there are many ways of "saving the phenomena" of experiments or observations, there are also many theories and thus many corresponding physics formulae.
For example, consider the following three theories of gravity applied to planetary motion:

epicyclic theory
Newton's $F\propto1/r^2$ theory
Einstein's theory of General Relativity (GR)

All three of these theories can explain, within certain limits, a given set of observations of the motions of the planets, but they all use completely different mathematical formulae:

The epicyclic theory basically uses a complex Fourier series (cf. this).
Newton's theory uses a simple algebraic equation.
GR uses tensors.

Newton thought that his universal theory of gravitation, $F=Gm_1m_2r^{-2}$, was uniquely, exactly, and logically deduced from Kepler's observations, but this clearly is false because Kepler's observations showed perturbations from a perfect $1/r^2$ law due to the solar system being comprised of many masses. It is also false because, e.g., Einstein's GR theory superseded Newton's theory of gravitation.
Thus, one physics theory (e.g., $p=mv$) is not more logically correct than another (e.g., $p=m+v$), although one might certainly be better at summarizing the results of experiments and observations than another.
Physics formulae do not derive from mathematics like a geometric proof derives from Euclid's axioms. Physics formulae derive from observations and experiment; mathematics does not force a physics formula to be a certain way.
For an excellent book on this whole topic, see The Aim & Structure of Physical Theory by the French physicist, historian, and philosopher of physics, Pierre Duhem.

How do formulas get figured out?


How to create InfoPath forms dynamically?

Question: I have an InfoPath form published to a library... I need to create forms dynamically with siteuser as form name... I need to achieve it in Object Model... Can any of you help me on this...?
Comment: If you are NOT using enterprise Sharpoint server, I do not think it is possible. IMO, it is possible only for browser-enabled IP forms, i.e. through IPFS - Sharepoint Server Infopath Forms Services. Is it your caee?
Comment: @Paddy: If this question is still relevant to you, please add some clarifying information.  Are you wanting to create a new InfoPath form _solution_ that others can then fill out, or create completed forms based on an existing template?
Answer: If you want to create form instances programmatically, I have done this recently with some relative ease.
As aforementioned, the XSN is a cab file. You need to use the Microsoft.Deployment.Compression and Microsoft.Deployment.Compression.Cab assemblies (which you can get here: http://wixtoolset.org/) to be able to read the cab file in memory (as opposed to saving it out to the file system first. Best to keep things in Streams in memory if at all possible).
Within the cab file, there is a file called template.xml which represents an empty form instance of that Form template.
Once you have that, you can then use standard XML techniques to populate fields in the my namespace.
You will also have to set the form save location to the full URL of the library where the Form's content type has been added. I can't remember off hand what the name of that node in the XML is, but it's one of the first nodes in the file, in a section just before the my namespace. You'll also need to generate a unique ID for the form (and this node is in the same section as before, the next node after the save URL), and this unique ID is just a GUID without the dashes, and in uppercase.
Once you've done all that, just use the SharePoint object model to write this completed XML to your library, using whatever name you want (just save with extension .xml). Ensure you keep the 'mso' namespace elements at the top of the file as this tells SharePoint what XSN file to use to render your form.
Answer: InfoPath forms certainly can be programmatically built - that was one of the motivations of the  change from the old office file formats (.doc, .xls etc) to the new (docx, xlsx etc)
These new formats are, in essence, cab files filled with XML-based data and manifests specifically designed to make object model manipulation easier.
Now, I don't exactly know what you want in entirety, but there are plenty of tutorials around to get started in creating forms programmatically. Such as this one from CodeProject
http://www.codeproject.com/Articles/33228/Programmatically-create-a-browser-enabled-InfoPath
and, of course, there are many more via google
https://www.google.com/search?sourceid=chrome&ie=UTF-8&q=programatically+create+infopath+forms&safe=active
Is that what you meant, or was it something different you were after?
Comment: "that was one of the motivations of the change from the old office file formats (.doc, .xls etc)". Infopath forms are XML based and I do not recall that their format was changed since 2005, i.e. before docx, xlsx introduction
Answer: Why don't you have your form published as a content type in your site, and add a new document (item) with the user's specific name to that library out of this content type? At the end all content types in SharePoint inherit from the item content type, and you can easily add new item to SharePoint list programmatically if you already have your form deployed.
I haven't tried it yet, but my guess it should work
Comment: Since the question is specifically about infopath form I suppose.
Comment: Yes, but he has the InfoPath form already there as a template! So it will be up to SharePoint to create a new form when you add new item to the Form Library from Form's Content Type programmatically, right?


Disable "shutdown" and "poweroff" command in Ubuntu

Question: I want to disable "shutdown" and "poweroff" CLI commands in Ubuntu for a specific user. How to do it?
Comment: Don't give that user `sudo`. Remove her/him from the `sudo` and `admin` groups.
Answer: If you are just on the command line, removing the user from the sudo/admin/wheel group may be enough since shutdown, poweroff and reboot need root privileges.
If we are talking about desktop sessions (or sessions otherwise handled by login managers such as consolekit or logind), this may become a little more complicated. In this case adjust your system's polkit rules as described here (or create them if they don't exist): https://askubuntu.com/questions/93542/how-to-disable-shutdown-reboot-suspend-hibernate
But make sure, the user you want to restrict has no other method of gaining root access (i.e. you also need to prevent him from using sudo). Otherwise he can just override or change these settings.
Edit: for a more up to date example with new JS config format, see https://wiki.archlinux.org/index.php/Polkit#Disable_suspend_and_hibernate
If you are using systemd (probably not when this is about Ubuntu), the action ids may also be different (starting with org.freedesktop.login1.xxx instead of org.freedesktop.consolekit.xxx). For a list of logind actions, have a look at https://www.freedesktop.org/wiki/Software/systemd/logind/
Comment: A quick way know what the actions would be: `pkaction | grep shutdown`, etc.
Comment: Actually I want the user to be able to issue all other commands except shutdown, poweroff and reboot on Ubuntu
Comment: As I said, you can disable those commands for him with polkit if the user cannot gain root privileges. If he can, he'd be able to circumvent or completely disable any restrictions. On the other hand, , you can also grant certain other privileges to non-root users if there is a daemon  that implements the needed polkit actions.


-Identity parameter in "Enable-SPFeature"

Question: I just want to confirm -identity parameter in Enable-SPFeature -Identity $parameter -Url $spSiteCollection.Url Powershell command. In $parameter parameter, should we need to provide the ID of feature or Name of feature or Both will work, Just want to clarify?
Answer: Either will work - the feature ID or the feature name.
From Technet documentation here: https://technet.microsoft.com/en-us/library/ff607803.aspx

Specifies the name of the Feature or GUID to uninstall. The type must be the name of the Feature folder located in the 14\Template\Features
  folder or GUID, in the form 21d186e1-7036-4092-a825-0eb6709e9281.
Answer: The Enable-SPFeature cmdlet enables an installed feature at the given scope. If the feature is a farm feature, no URL is needed. Otherwise, provide the URL where the feature is to be enabled and it will be enabled at the proper scope based on the Feature definition.
The Identity is a requied field. It is the name of the feature.
For more info check


What are all the types of radiation emitting from the Earth or an arbitrary mass in space?

Question: I'm interested in what forces collectively act upon a body in space (obviously radially, so they usually cancel) due to pressures caused by emitted radiation (of any type, strength, "size").  Can you give me a good book to read or paint a better picture for my understanding.  Or help me clarify this question further.  I would include static electric as well as magnetic fields (is this "radiation"?).
Answer: All objects in space emit a spectrum of electromagnetic radiation which closely approximates a black body spectrum that depends on their temperature. In addition, space is filled with electromagnetic radiation (also approximating a black body spectrum) corresponding to a temperature of about 2.7 degrees K, which approaches a true blackbody spectrum to a few parts in 10,000. This means most bodies in space will be absorbing and re-emitting that background radiation and will be striving towards thermal equilibrium with it.
Very hot objects like stars will radiate a spectrum corresponding to temperatures of between a few thousand degrees K and tens of thousands of degrees K and because of their size, the amount of power they emit is very large. That radiation will significantly warm objects nearby.
Because objects in space are nearly always electrically neutral, electrostatic forces will tend to cancel out.
If an object is electrically conductive and is moving through the magnetic field of another nearby object, both current flow and a magnetic field will be induced in it, and that induced field will affect the movement of any charged particles nearby. Since stars usually have large magnetic fields and emit streams of energetic and charged particles, a planet nearby (like Earth) will feel those effects.
The details of all these processes are taught in astrophysics classes on the university level and fill whole volumes of books, which means that this forum is not really the right place to get tutored on this topic.
Comment: The CMB background is at 2.7K. Blackbody radiation is a conceptual ideal. Nothing emits blackbody radiation because nothing is in perfect thermal equilibrium and absorbing all light incident upon it. In particular almost nothing in space is anywhere near a thermal equilibrium with the cosmic background radiation.
Comment: will edit this now.
Comment: will also post a question myself about it.


Is it possible to control dynamic bevel segments with a stylus?

Question: I am learning to use Blender with a stylus and pen display. There are times when the mouse scroll wheel is used to do things like increasing or decreasing bevel segments dynamically. Is there any way to configure Blender, or some keyboard shortcuts that will do this when using a stylus?
Answer: Found it. For Blender 2.79 the Numpad Minus and Numpad Plus also do what the missing scroll wheel does.
For Blender 2.8, When you are in the Bevel tool, press S (for Segments). At the bottom of the screen there is a list of all Bevel Properties that can be triggered with hotkeys. You can switch to different properties at will and the last setting will be set for you.


How can I track all of the webpages that have embedded a video online using the embed url?

Question: How can I track all of the webpages that have embedded a video online using the embed url?
Are there any search engines that will crawl web pages for instances of an embed url link within source code.
Answer: On "How you can track the webpages":
To find out in which webpages this url got embedded you would need to have a look at all of them. So doing this with your own resources (a script and your network connection for example) would most probably be too much to handle.
(Unless you've got a really huge serverfarm at your hands.)
On "Are there search engines for that":
I doubt, that the big ones will give this kind of access o their data, but I don't know for sure.


What duality can you quote that says supremum always exists $\implies$ infimum always exists of a bounded set?

Question: Say you've proven that for a subset of the reals bounded above, there exists a supremum of the set in the reals.  How do you prove the dual version for infimum without going through all the steps again?
Answer: Let $A$ be a set which is bounded below. We want to show that $A$ has an infimum.
Let $B=\{-a\,|\,a\in A\}$. Because taking the negative reverses the direction of inequalities, $B$ is bounded above. We  can then use the fact that $B$ has a supremum to conclude that $A$ has an infimum.
Comment: But is there something in category theory that says this automatically?
Comment: Not my field! The map that takes $x$ to $-x$ reverses order, and even plays nice with the additive structure.
Answer: If B is your given set, let A={a:a < b, for all b∈B}, then A is non-empty as it contains the lower bound of B, and it is bounded above by any element of B and hence has a supremum.You can check that this is also the infimum of B.
This works for any totally ordered set, i,e. supremum property implies infimum property for any totally ordered set.


iOS MapKit max zoom level

Question: Is there a way to increase the maximum zoom level of MKMapKit? As I zoom in further - eventually it no longer allows me to continue to zoom. Can this be overridden to allow for higher zoom levels?
Answer: No, you cannot.
The Map is compiled by google and has its limitations on how close you can zoom in. IF they were to update their maps to an even higher resolution and depth, the iOS SDK will hopefully be adapted accordingly.
You could cheat around this by enabling the accessibility options which then give you the possibility to zoom in the entire iPhone using a three-finger-tap.

iOS MapKit max zoom level


Can a phenotype only have one allele?

Question: A phenotype such as hair color
like blonde hair.
I am curious because mutations cause new alleles but does that mean that there always has to be a dominant or reccessive allele?
Comment: Related: https://biology.stackexchange.com/questions/111402/what-are-the-relative-frequencies-of-dominance-and-codominance-in-genes-underlyi
Answer: Can there be only one allele at a given locus?
An allele is a variant of a gene. If there is only one allele at a given gene, it means that there is no genetic variance at this specific locus (a locus is a position in the genome. It can typically correspond to a gene). It is not rare at all that the whole population is fixed for the same allele at a given locus.
Number of alleles
In courses, it is common to consider only the case of 2 alleles. In reality, there might be any number of strictly positive allele. At a given locus, you might have 1, 2, 3 or 11 alleles for examples. The reason why we typically teach about the 2 allele case is that 1 allele is not of much interest as there is not genetic variance at this specific locus and 3 or more alleles makes everything a little more complicated.
Dominance relationship
In courses, it is also common to consider diploid individuals, 2 alleles and the phenotypes of the three possible genotypes assuming $h_N = 1$ (see here to understand $h_N=1$). In reality, the relationship between two alleles may be vastly more complicated. There is a gradient from complete recessivity to complete dominance (passing through perfect additivity). It is also possible that the heterozygote is more extreme than any of the two homozygotes.
Dominance relationship - Number of alleles
As the number of alleles varies, any pair of alleles have a specific relationship of dominance. While empirical studies suggest that if allele A is dominant over B and B is dominant over C, then A is likely dominant over C, it is not impossible that C could be dominant over A. And again here, I am considering only cases of complete dominance but any scenario is possible.
Dominance relationship - Ploidy
The ploidy also varies from one species to the other (and also from one moment in the life cycle to the other for sexually reproducing organisms). If you have  a polyploid, then the number of possible genotypes is higher than 3 (even for a 2 allele case) and therefore the concepts of recessivity and dominance don't necessarily apply that easily.
Dominance relationship - Epistasis
Finally, there might have interaction between loci making that the relationship of dominance at one locus may depend upon the genetic background (that is the other variants present at other loci). Of course, it may as well depends upon the environment but let's not talk about that for the moment.
Comment: @NeelSandell Please, let me know if it answered your question or not.
Answer: This is actually a really good question.

Can a phenotype only have one allele?

Yes. Some diseases arise only from one known allele. Some common phenotypes can be predominantly controlled by a single allele, but are affected by more than one. On an individual level, it is common to see one allele creating the phenotype, such as rare diseases cause by de novo mutations or familial rare disease. On a population level, it is harder but not impossible to find a phenotype that has only one allele for everyone because genes typically contain many alleles.

Mutations cause new alleles but does that mean that there always has to be a dominant or recessive allele?

No, there doesn't. In fact, we've lied to you in school a little bit to make things less complicated. It is easy to teach dominance and recessive alleles and do punnet squares, but the reality is that dominant alleles have little effect on complex traits like height or how much education someone receives. You've stumbled upon the same intuition that led Fisher to develop the currently prevailing additive model in 1918.
All complex traits, i.e., most things that aren't a rare or Mendelian disease, do not have important dominant/recessive alleles. Instead, each allele contributes a little bit regardless of if other alleles are present or not. So not only does there not have to be a dominant or recessive allele, but it is the norm for there not to be.
Dominant alleles arise naturally due to loss of function mutations. They are very important in the discussion of monogenic genetic diseases, and frequently contribute to the phenotypes of rare disease, even though they are rarer than additive alleles.
Comment: "dominant alleles are quite rare" I would take issue with this. Simple example: loss of function mutations necessarily leave a dominant allele (LOF is recessive). Granted, they are certainly _numerically_ rarer overall, especially as you say for complex traits or neutral variation. But you will encounter them quite often in doing genetics on things people care about! Related: https://biology.stackexchange.com/questions/111402/what-are-the-relative-frequencies-of-dominance-and-codominance-in-genes-underlyi
Comment: Good point; I will edit it with that in mind
Answer: This may depend on how precisely you wish to define an allele. Cystic fibrosis is a disease effected by mutations in a chloride ion transport channel. Because this is an extensively studied illness, now over 500 different mutated versions of the gene are known. Each of these genotypes gives rise to the disease although there is much variation in the severity of the disease pending the exact mutation.
https://www.ncbi.nlm.nih.gov/pubmed/8949420

Can a phenotype only have one allele?


In PCA, every principal component a eigen vector?

Question: In pca, we convert predictors into principal components for dimensionality reduction. My assumption is every principal component is a eigen vector with eigen value as sum of squared distance of orthogonal projection of data points or vectors on it..
Is my assumption correct. If not pls clarify
Answer: Yes, a principal component is defined as the eigenvector of the covariance matrix of the data (zero-centered).
The eigenvector with the largest eigenvalue points in the direction of the greatest variance in the data. The smaller the eigenvalue, the less dispersed data points are in the direction of that eigenvector.
I'd recommend reading on the intuition behind PCA on Wikipedia.
Answer: Your assumption is correct. However, some additional details need to be specified e.g. eigenvector of what ? What characterizes the principal component eigenvector i.e. what criteria must it satisfy ?
As explained in the authoritative reference book by Bishop, the Principal Component Analysis (PCA) provides a set of mutually orthogonal directions, called principal components, which maximize the variance of the projections of the data points, when it is projected successively on respective directions as axes. Here, the underlying assumption is the data points are considered elements of a Vector Space equipped with standard inner product.
Illustrating using first principal component, which say is specified by unit vector, $\mathbf{u_1}$ for a dataset, $\{ \mathbf{x_n} \}, \text{n} = 1, \dots, N$ then

Projection of $ \mathbf{x_n} $ = $ \mathbf{u_1}^T \mathbf{x_n} $
Mean of Projections, $ \mathbb{E}_{\mathbf{u_1}}(\mathbf{x}) = \mathbf{u_1}^T \bar{\mathbf{x}} $  where  $ \bar{\mathbf{x}} = \frac{1}{N} \sum^N_{n=1} \mathbf{x_n} $
Variance of Projections, $ Var_{\mathbf{u_1}}(\mathbf{x}) = \frac{1}{N} \sum^N_{n=1} ( \mathbf{u_1}^T \mathbf{x_n} - \mathbf{u_1}^T \bar{\mathbf{x}} )^2 = \mathbf{u_1}^T \mathbf{S} \mathbf{u_1} $ where $\mathbf{S}$ is the Data Covariance matrix given by $ \mathbf{S} = \frac{1}{N} \sum^N_{n=1} ( \mathbf{x_n} - \mathbf{\bar{x}} ) ( \mathbf{x_n} - \mathbf{\bar{x}} )^T $

Maximizing $ Var(\mathbf{x}) $ subject to unit vector constraint, $ \mathbf{u_1}^T \mathbf{u_1} = 1 $, applying Lagrange multiplier we get optimization problem
$
\text{max}_{ \mathbf{u_1}^T \mathbf{u_1} = 1 } \mathbf{u_1}^T \mathbf{S} \mathbf{u_1}
= \text{max}_{ \mathbf{u_1} } \mathbf{u_1}^T \mathbf{S} \mathbf{u_1} + \lambda_1 ( \mathbf{u_1}^T \mathbf{u_1} - 1 )
$
At maxima, we get
$ \mathbf{S} \mathbf{u_1} = \lambda_1 \mathbf{u_1}
\implies \lambda_1 = \mathbf{u_1}^T \mathbf{S} \mathbf{u_1} = Var_{\mathbf{u_1}}(\mathbf{x})
$
Hence, principal eigenvectors e.g. $\mathbf{u_1}$ are eigenvectors of Covariance matrix, $\mathbf{S}$ with corresponding eigenvalues e.g. $\lambda_1$ as Variance of projections along corresponding eigenvector