How can I determine polarity requirements for a device that is missing its power supply?

Question: I have a MASSFIDELITY relay, wireless Bluetooth receiver for which the power supply is missing. I found a manual for the device that states it requires DC 5V 1A power, but says nothing about polarity. I ordered a so-called replacement power supply, but the one I received was 12V so I no longer trust power supply retailers to know what this device needs. Is there a way to determine what the polarity of a power supply should be by looking inside the device? The device can be opened easily so as to see the back of the power input lug etc..
Comment: Yes, provide some pictures.
Comment: Crank out your lab supply. Set your current limit low and turn up the voltage slowly. Does it start to pull a lot of current in the 0.7 V range? Reverse the polarity and try again.
Comment: Needed neither additional details or clarity. (More always helps but ...).
Comment: Does the device have any labeling?
Comment: Yes, probably, by tracing out a bit of the circuit. Not so much by looking at the connector unless it's marked  (and it probably isn't, connectors are not inherently one polarity or the other, that's up to the designer who uses the connector).
Answer: Here is a photo (from here) of the official power supply.
It sort of looks to me like center positive (the lower right symbol), but I would not risk a $250 device based on that blurry guess.

Unfortunately the construction inside is not that easy to follow from a simple single photo. Try to get a photo of the back of the connector board looking in the direction of the arrows (photo from here:
Answer: Sphero's answer indicates that it's probably center-positive. I found a couple more pictures on Google Images for replacement adapters, which are also blurry but look more like center-positive than center-negative. Center-positive is generally the standard for most devices these days.
Looking at the board, it seems like the ground plane is likely connected to the chassis via the mounting screws, so it's possible that the polarity could be found by measuring the resistance from the DC barrel jack connector to the case.
Get a multimeter, put it in resistance mode, and put one probe on the metal chassis or a screw. Then touch the other probe to each part of the barrel jack.

If the outer part of the barrel jack to chassis is near 0Ω, then it's almost certainly center-positive (which we suspect it is).
If the center pin to chassis is near 0Ω, then it's center-negative. This is more unusual and you might want to do further investigation to confirm.
If neither show low resistance to the chassis then you'll need to investigate further, e.g. by taking the cover off and probing inside.

You might be tempted to use continuity testing mode on the multimeter to do this kind of connectivity check, since the beep is seen as more convenient than reading the display, but I would avoid it here because you can get misleading results while the input capacitors charge up. With the multimeter in resistance mode you can tell this is happening because the apparent resistance will start low and slowly increase over time, whereas with a direct connection (ground to ground) it will stay low.
Note that this test isn't a 100% guarantee and there's always some risk of damage if you guess wrong. If you're not willing to take a risk, I recommend contacting the manufacturer to confirm the polarity.


How should I define the problem of skepticism and the criteria for its solution?

Question: I am writing an epistemology essay on whether a particular theory solves the 'problem of skepticism'. I am familiar with the skeptical paradox, but I am not sure exactly how to define what a solution would be. Would it be to prove that I do know that I have hands, or that I can know that I have hands, given that I actually have hands?
Comment: Sounds like the epistemic anti-skeptical resolution depends on a particular agent, if you follow Norzick's account in terms of possible worlds semantics, it's agent irrelevant and only depends on the primitive notions of truth, belief and subjunctive conditionals where you *do* know insofar as the truth that "you have hands" is appropriately tracked by your belief in the actual world's close PWs with said truth and its negation. We normally don't add another PWs layer to account for the necessity or possibility of such knowledge. Epistemic modal logic can account for agent's possibility...
Comment: What is "the skeptical paradox"? I'll note that most responses to skepticism aren't attempts to prove something in the skeptic's own terms, but rather rejections of the skeptic's concept of what constitutes knowledge or proof or something similar.
Comment: Welcome, lovelace0207. I'm not sure that there is such a thing as 'the' problem of skepticism - you need to add focus. Nor am I clear what 'the skeptical paradox' is. Here again you need to be more specific. I'll let the question stand for now but it does need more focus and detail.
Answer: How do I define the problem of skepticism and the criteria for its solution?
This is what I take to be the question asked here: how do we know that all around us is not a simulation?

In the Wachowskis' 1999 film, The Matrix, Morpheus asks Neo: "Have you
ever had a dream, Neo, that you were so sure was real? What if you
were unable to wake from that dream? How would you know the difference
between the dream world and the real world?"

From Van Cleve, "The Problem of External World Skepticism," Introduction to Philosophy (University of Central Florida).
Ideally, this would be the falsifiable statement: If the world is real, and not a simulation, then every observation about the world is consistent with every other. Thus there would be no example of water running uphill. The heat generated by the stars would behave the same way as the heat generated by rubbing one's hands together.
As for the question of whether one even has hands, the answer is the same: the observer would look for examples where people tried to pick something up, for example, and the object simply passed through the nonexistent hands.
As soon as the inconsistent event appears, and it cannot be adequately explained, the game is given away. The observer knows that the observed is not real.
But what if the simulation is Everything? What if the Great Simulator designed a computer program so advanced and thorough that every event occurring today and during the past billions of years were consistent with every other?
First, one would have to assume that a Great Simulator, bounded by finite time and resources, still had the ability to design and build an infinite and consistent universe.  This assumption is quite a stretch, and perhaps the difficulty in working with it opens a road to challenging the possibility of a stimulation.
That said, if one makes the assumption of a successful Great Simulator, I do not see a method for challenging the notion that we are, and live in, a simulation.
Yours is a very frequent question on this site. Do let me know your thoughts about this.


How do I play a card if it has two colors within the one mana symbol in its cost?

Question: I have just bought a deck and it has cards that have two colors within one mana symbol, like . Do I have to pay both colors or can I choose between the two?
Comment: If you had to pay both, they'd be side-by-side.
Answer: Mana symbols such as  are called a hybrid mana cost. You can pay that cost with either of the 2 colors shown. Here is a brief summary of hybrid mana rules:

Hybrid mana symbols represent a cost that can be paid with either of two colors. For example, a cost represented by the  symbol can be paid with one white mana or one blue mana. It's both a white and a blue mana symbol, and a card with  in its mana cost is both white and blue.
Comment: I corrected an "oh1" to the same symbol; could you double check my correction in case that wasn't what it was supposed to refer to?
Comment: @doppelgreener Thanks; I had made the same correction in another place but missed that one; it's correct now.


WhatsApp notifications show contact name instead of sender-defined name

Question: When I get a message with WhatsApp and my iPhone is locked, I cant see sender's name as they set it in their own WhatsApp. I see the name which saved in my Contacts. Already 3 days like that... I want to solve this problem. I want to see the sender's name on the lock screen, not the Contact name.
Answer: The simplest way is to not have that person in your contacts or have their Whatsapp name in contacts. You can't have them both in your contacts and also just display the regular Whatsapp username as far as I know.
Comment: This sounds like something that happened with the latest version of whatsapp. until then, it was indeed possible. and it wouldn't make sense to remove that person from the contacts.
Comment: @rockyraw I haven't been keeping up with the recent changelogs of WhatsApp (mainly cause telegram is better :P ) other than the whole eula/terms/legalstuff update that happened a bit ago so I couldn't say if its a new change or even a change at all.

All I can say is at the time of answering, that's all that was possible and still seems to apply even now (i just checked quickly and don't see an option).

Also Mehriban remember to accept an answer once you are happy with the results. :)


storm with remote hbase cluster

Question: I have just started working on storm. One of my use case involves reading and writing data to/from a remote hbase table. I was wondering if it is possible to connect to a remote hbase cluster from local storm topology. If yes, how so?
TIA.
Answer: It is no different than connecting remotely from a stand-alone java application.  You may have to take care to set the parallelism hint - too high and you get too many connections and too low and you get a bottleneck - but that's really no different than connecting to any other kind of server from within storm.

storm with remote hbase cluster


Spin (helicity) and polarizations of photons: are they secretly related?

Question: Edit Circularly polarized photons have $$\textbf{S}\cdot\hat{\textbf{p}}=\pm \hbar\tag{1}$$ and it also satisfies $$\boldsymbol{\epsilon}\cdot\hat{\textbf{p}}=0\tag{2}$$ where $\textbf{S}$ is the spin, $\boldsymbol{\epsilon}$ is the polarization vector and $\hat{\textbf{p}}$ is the unit vector along the direction of propagation. Is it possible to derive (1) from (2) or vice-versa?
Comment: Clarification request (v5): you seem to be asking whether there's a spin-based explanation why $\epsilon\cdot\hat p=0$ for circularly-polarized light. But $\epsilon\cdot\hat p$ also vanishes for linearly-polarized light, since the momentum is determined by the Poynting vector. It's hard to tell whether your question is specifically about circular polarization, or about the relationship between the circular and linear polarization bases, or about why the momentum is perpendicular to the oscillating parts of the E and B fields. Each of these is a non-trivial and interesting question.
Comment: Possible duplicates: https://physics.stackexchange.com/q/291120/44126, https://physics.stackexchange.com/q/418974/44126 (neither of which address the part of your question about spin). The answer is "yes, because it's massless," but I can never keep the details straight.
Comment: They are essentially the same: https://physics.stackexchange.com/questions/360638/photons-are-faster-than-the-speed-of-light-because-they-travel-in-transversal-wa/360653#360653
Comment: I am trying to understand whether the fact that $\epsilon\cdot\hat{p}=0$ somehow dictates that $S.\hat{p}$ can have only two possible values because both as far as I know are related to the masslessness of photon. the latter in general has 2s+1 projections @rob
Answer: The gauge field $A^{\mu}(x)$ is a four-vector ($\mu=0,1,2,3$), which means that it has four internal degrees of freedom (at every point $x$ in spacetime). For the technically minded, the reason for it being a four-vector comes from the fact that it is an irreducible representation of the Poincare group, which contains the Lorentz group. These are noncompact groups. The compact part of the Lorentz group represent all the rotations, which are also associated with spin. As a result, the irreducible representations are distinguished as the different spins. The gauge field is said to be a spin-1 field.
Gauge invariance ensures that the mass of the gauge boson is zero. This (indirectly, from gauge invariance) removes one of the degrees of freedom (the temporal degree of freedom), leaving three.
Well, it turns out that the gauge invariance also remove another degree of freedom through the Ward identities. This time the degree of freedom that is removed, is the longitudinal component that would have been parallel to the direction of propagation.
Hence, we end up with only two remaining degrees of freedom for the spin of the EM field. These degrees of freedom manifest as the polarization of the EM field.
The helicity operator, which is the projection of the spin operator (the intrinsic part of the angular momentum) along the direction of propagation
$$ \hat{h} = \hat{S}\cdot \mathbf{e}_{p} , $$
where $\mathbf{e}_{p}$ denotes the direction of propagation, has two eigenstates. They are the two circular polarization states, respectively with eigenvalues $\pm 1$.
Comment: @SRS: yes it is not too difficult to construct such an operator. That would be a different question though.
Comment: "The gauge field $A^\mu$ is a four-vector, which means that it has four internal degrees of freedom (spin). "    4 degrees of freedom of $A^\mu$ at a given spacetime point correspond to $\mu=0,1,2,3$. What does it have to do with spin? @flippiefanus
Comment: @SRS: see the edited answer.
Comment: In the Hilbert space, are there operators associated with polarization? @flippiefanus
Answer: The two statements are identical as a result of the transversality of electromagnetic waves. Transversality means that $${\bf \epsilon} \cdot {\bf p} =0 \,.$$ Photon spin is proportional to ${\bf E} \times {\bf A}$. As both are transversal the result for a plane wave can only be parallel or antiparallel to $\bf p$.


Including URL in search results

Question: Google (and other search providers) include the page title, URL and some description in search results. For search within a large organisation, where all results are from the same domain, is there any value in including the URL beyond supporting users who may want to print the results?
Answer: It depends.  One consensus seems to be to remove such information from intranet search results in favor of including a more human-readable location (http://www.steptwo.com.au/papers/cmb_searchresults/index.html), however other groups recommend including it as a valuable piece of contextual information (i.e., "Oh, that URL is under http://projectA.mycompany.com/..., I definitely don't want that site").  I tend to fall in this second camp.
What you decide will depend on a number of factors:

Is your organization largely technical?  I have a feeling computer-oriented people will value having URLs in their search results.
How well is your internal network structured in terms of URLs?  Are your URLs clean and informative, or do they look like "http://projectA.company.com/se?alkdjfalkje819283"?
Answer: In SERP, I believe it is useful for a seasoned search user if URI is included for quick decision making.
Let's see why a public search engine includes a URI first.
From the domain perspective (e.g. example.com/)

Creditability
You usually trust a big company instead of small one. When user skim through the list, he/she can quickly filter it.
Example:
google.com - Trustworthy
guimp.com - Unknown
Categorization
It is easier to distinguish the type of the content resided in the website.
Example:
github.com - only code is stored
wikipedia.org - You would not expect game is insided
perl.org - org usually represents the non-profit organization
stanford.edu - edu always associated with education institudes
Familiarity
If user visited a site before for several times, he/she would remember the URI.
When the URI is shown in SERP, one could immediately recognize it without looking at the messy title which is varied and inconsistent.

In Intranet, categorization become the an important part to assist searching.
Think URI in term of home address, if the URI is well organized,
Either
jobvacancies/2013.html
hrservices/2013.html
Or
itintranet.mycorp/
hrintranet.mycorp/
It would be a benefit for user to filter the noise rapidly.
Otherwise if URI is gibberish, it doesn't make sense to include the URI at all.

Including URL in search results


When do I have to pay for the Mexican tourist card?

Question: I have a question about Mexican tourist cards, or whatever they're called these days. There is now a fee, a little more than $20. According to some sources, a traveler only has to pay this once per 180 days. Yet, when I travel by bus to Central America for a month or so I wind up paying twice, once going south and once going north. It seems every INM (immigration) official I ask has a different understanding, so to avoid complications I do not make an issue of it. Does anyone have suggestions about how to avoid paying twice?
Comment: @phoog, The "multiple" in FMM doesn't mean "multiple entry", it means "multiple uses". In particular both tourists and resident card holders fill out that form, but tourists fill it out on the way in while  residents fill it out on the way out. In the olden days tourists filled out an FMT while residents used a separate form.
Comment: A little research seems to indicatet that while the card is valid for up to 180 days, they are good for only a single entry into Mexico except under limited circumstances.
Comment: That despite the fact that the form has the word "multiple" in its name.  I'm still a bit confused on that, since part of the form is an exit record that you have to return to the authorities when you leave.  When you left Mexico going south, did you keep that part of the form or return it?
Comment: As far as I can tell, you need a new FMM for each visit.
Comment: I always return the form when I leave the country. One INM employee in central mexico told me to keep extra copies of the fee receipt, but another one at the border told me to pay each way.
Answer:
Does anyone have suggestions about how to avoid paying twice?

tl;dr I don't

There is an image of such a card on Baja Bound Insurance Services Inc. where its title is "Forma Migratoria Múltiple (FMM)".
Details there include:
•   Cost as of September 2015, $332 Pesos (appx U.S. $20*) per person; FREE if the trip is 7 days or less and you cross by land
•   May be issued for up to 180 days
and:

According to the INM, an FMM, or Forma Migratoria Múltiple is an "admission document" issued to vacationing visitors of certain nationalities. Although the tourist card (FMM) is also popularly known as a tourist "visa," it is not officially a visa. U.S. and Canadian citizens driving to Mexico for vacation may obtain a tourist card (FMM) within minutes at a Mexican immigration office at the border with only a valid passport or passport card. The tourist card application is now available online as well. The tourist card (FMM) may be issued for up to 180 days and is issued per person including children.

More relevant to this question (same site different page):
Is it possible to enter and exit Baja multiple times with the same tourist card (FMM)?

Yes. The INM delegate for Baja California (Norte) announced in September 2015 that the FMM is now multiple entry for land travel in Baja California only.

Noting the only the inference is that the card is single-entry elsewhere in Mexico. Instituto Nacional de Migración has, in connection with the electronic version of the form for entry by land:

El solicitante se da por enterado que la FMM tiene una vigencia máxima de 180 días naturales y podrá utilizarla para una sola internación.

The last part of which is "for single admission".
Undated information from mexonline has:

The card, known as the Migratory Tourist Form (FMT) is valid for six months (180 days) with multiple entries. Make sure you ask for the full 180 days even is you plan to stay only a short time. You never know if you may return in those 180 days.

but judging by the cost mentioned there (190 peso) the site is not up to date, though at least indicates that the FMT was indeed multiple entry.
* Mexperience which has approximately US$22 for the permit also has:

If you lose your FMM while you're in Mexico, you will need to visit one of the immigration offices situated in towns and cities across the country, or at the airport, and apply for a replacement before you can leave. This will involve some form-filling and filing, and a trip to a local bank to pay your permit replacement fee (about US$40) before you return to the immigration office to receive your FMM replacement.

The same site states:

If you are driving out or leaving the country by sea, you should voluntarily surrender your FMM to an immigration official before your departure.  Failure to do so might cause delays the next time you try and enter Mexico.

There is even advice that if you leave the county with it by mistake you should contact a Mexican Consulate for what to do with it.


How to efficently handle large amounts of insert statements

Question: I have a file containing a large amount of insert statements roughly 30 GB worth of them. The insert statements themselves are rather simple and contain 5 different values. I now have the requirement the insert the data from these statements into a SQL database on Azure. Which tool would be best to easily and efficiently insert the data? This is a one-time thing, so the solution does not need to be elegant or repeatable. The key priority is getting it done with as little time spent on the solution as possible. Thanks for reading this.
Comment: You could have a look at [this](https://medium.com/@benmorel/high-speed-inserts-with-mysql-9d3dcd76f723). p.s. welcome to the forum! :-)
Answer: If each line of the file is a well-formed SQL INSERT statement, listing target columns and has a VALUES clause you can simply submit is as input using the command line tool of your choice. It will be slow but it will work. It would be better to split the one 30GB file into many smaller files (perhaps about 100MB each?) and have a script submit each in succession. Then failures can be more easily recovered, the server will become less flooded, and the load can be halted and resumed as required.
If the file can be converted to raw data, say a CSV format, that can be submitted using whichever ETL or bulk load tool you have. Again, I'd split the source into multiple smaller files for easier management.
Of course getting the source files as close as possible to the server will reduce run-time network latency.
Finally, disable all triggers, foreign keys, secondary indexes etc. on the target table. They can be rebuilt or rechecked after all the data is in place. It will be faster overall than having them checked for each row as it is processed. Make sure the DB has sufficient disk to handle the new data and the DBMS can get to it. Figure out how you'll manage log growth as data is processed. Halt all other activity on the server while the load is in progress.


Selling bitcoin for IDR

Question: I bought bitcoins but my currency is in Rands but I want to sell it to IDR is it possible to do so
Comment: please be a bit more specific for others to be able to answer this question, and show what you have tried before. From your question I could guess, that you have South Africa Rand, but honestly I don't know what IDR is. And: you would probably look at an exchange in both countries, so you can get in and out...
Answer: Yes you can use localbitcoins and find your country/city and sell it there. Becareful when selling in person. Always meetup in a public space like starbucks, bank, or police station.

Selling bitcoin for IDR


Do variables with similar correlation coefficient values multicollinear?

Question: For example I have two variables, X1 and X2, with which I calculate the Pearson Correlation Coefficients with a target Y. Say, if both of them result in 0.6 as the correlation coefficient, can I say X1 and X2 are multicollinear so I can only keep one of them in my linear regression model? Thanks.
Answer:
Collinearity is meassured as a large correlation between predictive
variables in your model.

I just wanted to add something to this statement.
Although multicollinearity might be a problem that is also determined by calculation.
It is also determined by the research objective and the research field. Having multiple items in a SEM would lead to the ultimate assumption that we have not clearly defined our items, thus even smaller thresholds might be feasible. There is no straight line, you can cross to say we have multicollinearity. Although higher values are clearly outlined, a coll. of 0.5 to 0.6 could also be problematic.
Researchers in germany and in other countries state different thresholds for having multicollinearity:
- Urban/Mayerl 2014, Structural Eqution Modeling (on german) highlights coll > 0.8
- Hair et al. 2010, Multivariate data analysis, who proposes a freaky 0.10 as a threshold, p. 204 f.*
I would advise the OP Cohen et al. 2003 Applied Multiple Regression/Correlation Analysis for the Behavioral Sciences, p. 420 to have a look on this subject.
This discussion is also extended to the values of the VIF which can reflect some of this phenomenon:
https://www.researchgate.net/post/Multicollinearity_issues_is_a_value_less_than_10_acceptable_for_VIF
Answer: If I am understanding you correctly, you say that $cor(X_1,y)=0.6$ and $cor(X_2,y)=0.6$. That does not mean that your model is facing collinearity. Collinearity is meassured as a large correlation between predictive variables in your model. Following your example, you would be facing collinearity if $cor(X_1, X_2)=0.9$.
Intuitively
Imagine that this is the case and $cor(X_1, X_2)=0.9$. Intuitively, the problem with it is that the information that $X_1$ privides overlaps with the information that $X_2$ provides. Both of them provide roughtly the same information so you can remove one of the variables.
Mathematically
Mathematically, the analytical solution of a linear regression model is
$$\hat\beta = (X^tX)^{-1}X^ty$$
If $cor(X_1, X_2)=0.9$ this means that $X_1$ is a linear function of $X_2$ and thus $(X^tX)$ is not invertible and the model cannot be solved (or, if solved, the solution is not stable, small changes in the data can lead to large changes in the coefficients$
Some code
Lets generate a fake dataset using R programming language
x = seq(1, 100)
y = x + rnorm(100, sd=4)
summary(lm(y~x))

Call:
  lm(formula = y ~ x)

Residuals:
  Min      1Q  Median      3Q     Max
-9.2178 -2.0213 -0.3459  2.2776  9.1166

Coefficients:
  Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.19308    0.69892  -1.707    0.091 .
x            1.03636    0.01202  86.252   <2e-16 ***
  ---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 3.468 on 98 degrees of freedom
Multiple R-squared:  0.987, Adjusted R-squared:  0.9869
F-statistic:  7439 on 1 and 98 DF,  p-value: < 2.2e-16

Observe here that the p-value associated to variable $x$ is < 2.2e-16. This means that it is smaller than 2.2e-16 (basically, that it is 0). Also, observe that the $R^2$ coefficient is 0.98, so with variable $x$ we explain pretty much all the behavior of $y$. Now I generate a new variable x2 that has a large correlation with x,
x2 = x
x2[1] = 3
cor(x, x2)
0.9999769

So $cor(X, X_2)=0.99$. And I solve a new model with the two variables:
summary(lm(y~x+x2))

    Call:
  lm(formula = y ~ x + x2)

Residuals:
  Min      1Q  Median      3Q     Max
-9.2253 -2.0085 -0.3042  2.3064  9.1034

Coefficients:
  Estimate Std. Error t value Pr(>|t|)
(Intercept) -1.26943    0.71571  -1.774   0.0793 .
x            0.08308    1.77381   0.047   0.9627
x2           0.95442    1.77588   0.537   0.5922
---
  Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Residual standard error: 3.481 on 97 degrees of freedom
Multiple R-squared:  0.987, Adjusted R-squared:  0.9868
F-statistic:  3693 on 2 and 97 DF,  p-value: < 2.2e-16

Observe that here both variables $x$ and $x_2$ have large p-values, this means that none of them is considered as a significant variable for our model. But still, the $R^2$ coefficient is large (0.98). This is indicating that the second model has some colinearity problems. Since both variables $x$ and $x_2$ explain the same, none of them is correctly identified as significant, but globally, our model is able to explain the behavior of $y$.


Generalized eigenvalue problem of Hermitian matrix (exist complex eigenvalues)

Question: Let $\mathbf{A}, \mathbf{B} \in \mathbb{C}^{n \times n}$ be Hermitian and invertible. Show that exists eigenvalues $\lambda$ which satisfy $\mathbf{Av} = \lambda \mathbf{Bv}$ are not real.
My solution and question:
From the property of Hermitian we know that all eigenvalues of Hermitian matrix are real. (Omit the proof)
Then $\forall x \in \mathbb{C}^n$ we have $x^HAx = x^HP^HDPx = (Px)^HD(Px) = y^HDy = \lambda_1|y_1|^2 + \cdots + \lambda_n |y_n|^2$ which is a real number, where $D$ is diagonal matrix and the second inequality is derived form eigendecomposition.
Back to the question, $Av = \lambda Bv \Rightarrow v^HAv = \lambda v^HBv$.
Since $\mathbf{A}$ and $\mathbf{B} $ are Hermitian, the quadratic form should real. Therefore, the $\lambda = \frac{v^HAv}{v^HBv}$ is real.
Is the original problem wrong? Could anyone help me out? Thanks in advance!
Answer: Your considerations are fine. The original problem wrong, as can also seen by taking $\mathbf{B} =\mathbf{I} $.


Lyapunov's Inequality for Weak-Lp Spaces

Question: Let $(X,\mu)$ be a measure space. Suppose that $0 < p_{0} < p < p_{1} < \infty$ and $\frac{1}{p} = \frac{1-\theta}{p_{0}} + \frac{\theta}{p_{1}}$ for some $\theta \in (0,1)$. If $f \in L^{p_{0},\infty}(X,\mu) \cap L^{p_{1},\infty}(X,\mu)$, then $f \in L^{p,\infty}(X,\mu)$ and $$\left\|f\right\|_{L^{p,\infty}} \leq \left\|f\right\|_{L^{p_{0},\infty}}^{1-\theta}\left\|f\right\|_{L^{p_{1},\infty}}^{\theta}$$
It isn't hard to show this inequality for a constant greater than 1, using Holder's inequality for $L^{p,\infty}$ spaces (Grafakos Classical Fourier Analysis Exercise 1.1.15), but I can't figure out how to prove the stated inequality.
Comment: Where is $p_1$? $0 < p_0 < p < p_1$?
Comment: It is late, but are you sure it is true? Let $f = 2 1_A$. Then $\|f\|_{p, \infty} = \mu(A)^{1/p}$. Hence we get $\mu(A)^{1/p} \leq \mu(A)$. Did I make a mistake somewhere? If not, this fails for $p = \frac12$ and $\mu(A) = 2$.
Comment: I'm not sure that the stated inequality is true, although Grafakos appears to claim that it's true by including it in his book. However, I don't understand how you get $\mu(A)^{\frac{1}{p}} \leq \mu(A)$. Don't we have $\left\|f\right\|_{L^{p_{0},\infty}} = \mu(A)^{\frac{1}{p_{0}}}$ and $\left\|f\right\|_{L^{p_{1},\infty}} = \mu(A)^{\frac{1}{p_{1}}}$. Hence, $$\left\|f\right\|_{L^{p_{0},\infty}}^{1-\theta}\left\|f\right\|_{L^{p_{1},\infty}}^{\theta} = \mu(A)^{\frac{1}{p}}$$
Comment: Right, I was mistaken (the sum is $1/p$ not $1$). I will see if I can find a solution, part a) was easy (I have done it some years ago) but with the Hölder inequality for weak $L^p$ you get an additional constant...
Answer: WLOG assume $f \geq 0$.
$$ \|f\|_{p,\infty}^p := \sup_{t > 0} t^p \mu\{ f > t\} $$
Now, fix $\lambda,\eta \in (0,1)$, you have
$$ t^p \mu\{ f > t\} = t^{\eta p} \left(\mu\{f > t\}\right)^\lambda \cdot t^{(1-\eta)p}\left( \mu\{f > t\}\right)^{(1-\lambda)} $$
or
$$ = \left( t^{\eta p / \lambda} \mu\{f > t\}\right)^{\lambda} \cdot \left( t^{(1-\eta) p /(1-\lambda)} \mu\{f > t\}\right)^{1-\lambda} $$
so taking the sup of the terms inside the parentheses
$$ \| f \|_{p,\infty}^p \leq \| f \|_{\eta p/\lambda,\infty}^{\frac{\eta p}{\lambda}\cdot\lambda}\| f\|_{(1-\eta)p/(1-\lambda),\infty}^{\frac{(1-\eta)p}{1-\lambda}\cdot(1-\lambda)} $$
or
$$ \| f \|_{p,\infty} \leq \| f \|_{\eta p / \lambda,\infty}^\eta \| f \|_{(1-\eta)p/(1-\lambda),\infty}^{1-\eta} $$
Now let $p_0 = \eta p / \lambda$ and $p_1 = (1-\eta)p / (1-\lambda)$. It is simple to check that
$$ \frac{\eta}{p_0} + \frac{1-\eta}{p_1} = \frac{\lambda}{p} + \frac{1-\lambda}{p} = \frac{1}{p} $$
Comment: Hah, it's that easy. Nice +1.
Comment: @Jonas: The natural next question to ask is what can be said about general Lorentz spaces $L^{p,s}$. Using the same method you can prove *something* that allows to interpolate both in $p$ and in $s$, but I am not sure what the constant should be.
Comment: @Willie: Many Thanks!


Mac Audio framework

Question: I know that AVFoundation framework works on iPhone.
Does the same framework be used for Mac as well to play and record sounds???
Basically I want to write an application to play 2 music files parallelly and record the music that is being played. Is it possible???
Answer: No, AVFoundation is for the iPhone only.
What does work cross platform (iPhone, OS X) is the Audio Queue framework. It is more difficult to use but there are plenty of examples available. It is also more low level so it will allow you to do stuff like playing and recording.

Mac Audio framework


How do I make Firefox 4 save passwords without asking?

Question: This is not a duplicate, the original question covers versions of Firefox before 3.6. The way Firefox has been designed in these newer versions is fundamentally different from how it was in that older question.
Answer: As far as I know, it's now impossible to do so as of Firefox 4. It's a question of safety (the built-in password manager is really unsafe!). I recommend using an add-on like Lastpass, but note that it still won't save any passwords without asking.
Answer: via Raymond.cc

In Firefox 4, the developers have
  packed all of the naked files into one
  jar file called omni.jar.
[...]
All you need to do is extract the
  omni.jar file with WinRAR or rename it
  to omni.zip and use the Windows 7 to
  extract it. Then make any modification
  or changes to the files, ZIP it back
  again and copy to Firefox folder.
You can go ahead and edit the
  nsLoginManagerPrompter.js to auto
  save password without prompting the
  user or edit the nsLoginManager.js to
  allow saving of password into the
  built-in password manager on login
  forms with autocomplete="off".


Where can I start learning to develop Decenteralized apps?

Question: I have been trying to understand this development process of making DaPPs using ehtereum from various sources, some of them are outdated because this technology is evolving pretty fast as of now.
Currently, I am following this tutorial https://medium.com/@mvmurthy/full-stack-hello-world-voting-ethereum-dapp-tutorial-part-2-30b3d335aa1f but It is using testnet for syncing blockchain and I am confused because, I have found people refering an alternate for this using metamask. I am a begginer therefore there is lot of confusions. Please suggest some latest resource to follow in order to understand dApps better.
Answer: ETHEREUM PET SHOP
In my opinion, one of the best tutorials at this moment.
The tutorial is step-by-step, up-to-date and with a very good notes to every step.
In this tutorial you will be introduced to:

Truffle
MetaMask
Ganache

But don't be scared if you are not familiar with some of these names, tutorial shows the full guide how to use any of them!

This tutorial is meant for those with a basic knowledge of Ethereum and smart contracts, who have some knowledge of HTML and JavaScript, but who are new to dapps.

Based on my experience.


Show That Wigner's Theorem Defines a Surjective Homomorphism $\operatorname{U}(2) \rightarrow \operatorname{SO}(3)$

Question: Preliminary Knowledge
We are working on the finite dimensional Hilbert space $\mathbb{C}^2$.  The projective Hilbert space is given by
$$\mathbb{P}(\mathbb{C}^2)=\big(\mathbb{C}^2 \backslash \{0\}\big)/\mathbb{C}^*, \tag{1}$$
where the equivalence relation $\psi \sim \phi$ is satisfied when $\psi=\lambda \phi$, for some $\lambda \in \mathbb{C}^*$ and $\psi ,\phi \in \mathbb{C}^2 \backslash \{0\}$.
An important structure is quantum mechanics is the transition probability, which is the map $p:\mathbb{P}(\mathbb{C}^2) \times \mathbb{P}(\mathbb{C}^2) \longrightarrow \mathbb{R}$ defined by
$$p([\psi],[\phi])=\frac{|\langle \psi , \phi \rangle |^2}{\langle \psi , \psi \rangle \langle\phi , \phi \rangle}. \tag{2}$$
Furthermore, a quantum mechanical symmetry is defined as an invertible map $f:\mathbb{P}(\mathbb{C}^2) \longrightarrow \mathbb{P}(\mathbb{C}^2)$ which preserves the transition probability:
$$p(f([\psi]),f([\phi]))=p([\psi],[\phi]), \quad \text{for} \space [\psi],[\phi] \in \mathbb{P}(\mathbb{C}^2).\tag{3}$$
And finally, Wigner's theorem states that for any quantum mechanical symmetry $f:\mathbb{P}(\mathbb{C}^2) \longrightarrow \mathbb{P}(\mathbb{C}^2)$ there exists a unitary or anti-unitary operator on $\mathbb{C}^2$ that induces $f$ on $\mathbb{P}(\mathbb{C}^2).$
What we know
Consider now the set of all one-dimensional projectors in $\mathbb{C}^2$:
$$ \mathbb{E} := \{e \in \operatorname{End}(\mathbb{C}^2) : e^2=e=e^*, 0 \ne e \ne I, \operatorname{dim} \operatorname{im} (e)=1\}, \tag{4}$$
where $I$ is the identity.  By identifying $\mathbb{E}$ with the space of all $2 \times 2$ complex matrices $\operatorname{M}_{2 \times 2}(\mathbb{C})$ with trace $1$ (while excluding the obviously trivial zero and identity matrix), it is straightforward to show that any $e \in \mathbb{E}$ can be written as
$$e(\vec{x})=\frac{1}{2}I + \frac{1}{2}\sum_{i=1}^{3}x_i \sigma_i, \quad||\vec{x}||=1, \tag{5}$$
where $\sigma_i$ are the $3$ Pauli matrices.  Equation $(5)$ turns out to define an isomorphism $S^2 \longrightarrow \mathbb{E}$, and thus $S^2 \cong \mathbb{E}$.  One can also show that $\mathbb{E} \cong \mathbb{P}(\mathbb{C}^2)$, and so we have $\mathbb{P}(\mathbb{C}^2) \cong S^2$.  Then,  by using the formula $p(e,f)=\operatorname{Tr}(ef)$ for any $e,f \in \mathbb{E}$, we can show that transition probability is given by
$$p(\vec{x},\vec{y})=\frac{1}{2}(1+ \langle\vec{x},\vec{y}\rangle), \quad \text{for} \space\vec{x},\vec{y} \in S^2. \tag{6}$$
Next, consider the group of all quantum mechanical symmetries:
$$G:= \{f:S^2 \longrightarrow S^2 \space | \space f \space \text{invertible and} \space p(f(\vec{x}),f(\vec{y}))=p(\vec{x},\vec{y}) \space \forall \vec{x},\vec{y} \in S^2\}, \tag{7}$$
as well as the orthogonal group $\operatorname{O}(3)$, given by
$$\operatorname{O}(3; \mathbb{R}) = \{\rho \in \operatorname{GL}(3; \mathbb{R}) \space | \space \langle \rho a, \rho b \rangle = \langle a,b \rangle \space \forall a,b \in \mathbb{R}^3 \}. \tag{8}$$
One can then show that $G \cong \operatorname{O}(3)$, and hence identify $\operatorname{O}(3)$ with $G$.
The Problem
We now restrict to $\operatorname{SO}(3) \subset \operatorname{O}(3)$.  Show that Wigner's theorem defines a surjective homomorphism $\operatorname{U}(2) \longrightarrow \operatorname{SO}(3)$ sending $u \mapsto R$ defined by
$$ue(\vec{x})u^*=e(R(\vec{x})). \tag{9}$$
My Question
I do not understand the meaning of equation $(9)$ and I have no idea how to use it; I expected to be given the explicit formula of the homomorphism!  I tried inverting it by using $e^{-1}$ to isolate $R$, but to no avail.  How then can I show that this map is a homomorphism using equation $(9)$? More importantly, I do not see how Wigner's theorem relates to the problem; I'm trying to find a surjective group homomorphism, how can the unitary/anti-unitary operator that induces $f:S^2 \longrightarrow S^2$ help me with that?  The theorem doesn't seem to state anything useful in particular.
Any hints/answers will be well appreciated.  Thank you!
Comment: The Wigner's theorem actually says that the symmetry group in QM is the central extension of $SO(3)$ by $U(1)$, which is precisely $SU(2)$.
Answer: Given $u$ in $U(2)$, we have for every $\vec x$ in $S^2$ that $e(\vec x)$ is a $2\times 2$ matrix that is a projection.  Therefore the product of matrices $$ue(\vec x)u^*$$ is also a projection and hence must be of the form $e(\vec y)$ for a unique vector $\vec y\in S^2$.
This defines a function $$R=R_u:\vec x\in S^2\mapsto \vec y\in S^2.$$
So the problem consists in showing that

$R$ is the restriction of a unique linear transformation (also denoted by $R$ by abuse of language), lying is $SO(3)$.

We then get a map $$u\in U(2)\mapsto R\in SO(3),$$ which should be proven to be a group homomorphism.

Finally I don't see either what is the relevance of Wigner's Theorem here!
Comment: It is relevant because Wigner's theorem actually says that in QM is symmstry group actually becomes the central extension of $SO(3)$ by $U(1)$, which is exactly $SU(2)$.
Comment: Yes I know that Wigner's Theorem is important.  But my claim is that it is not used in the solution to this problem.
Comment: Is it perhaps the other way round: that this problem indicates one way to prove Wigner's theorem?
Comment: Hi! Thank you for the answer.  I don't see how $u \mapsto R$ can be proven to be a homomorphism if I don't have an explicit formula for the mapping.  I suppose equation $(9)$ has something to do with this, but I don't understand what.
Comment: @ShikiRyougi. The purpose of my answer was to clarify how does (9) define $R(\vec x)$ unambiguously in terms of $\vec x$.  Not all definitions in Math can be given through explicit  formulas but I believe the present definition is enough to allow for proving what you need.

Show That Wigner’s Theorem Defines a Surjective Homomorphism $\operatorname{U}(2) \rightarrow \operatorname{SO}(3)$


How do I provide support to a growing sunflower?

Question: I am growing sunflowers and they grow quite high, sometimes toppling over. What kind of support can I give to them in this case?
Answer: I currently have a wobbly sunflower tied with twine to one of the tepees for pole-beans I built from some saplings I cut. We had 60mph+ winds during a storm this past weekend and that sunflower is still standing. The ends of the stakes are just pushed 6" or so into the loose soil.
I just tied on a bit of twine that I had laying around in the garden. The bug ugly knot in the back is where the tepee is lashed together. It's not terribly secure, but I'm not going to cry if we get hurricane-force winds this weekend and the worst that happens is my 7' tall sunflower falls down.
Comment: So you build a teepee next to the sunflower, and tied them with twine? Good idea...last year I tried to tied the sunflower with a metal stick inserted vertically in the soil, but the twine fell off sometimes. But if the sunflower grow bigger, your teepee can't hold the upper part of the sunflower anymore.
Comment: If you want to tie it in a few places, or build a taller tepee, that's ok. My sunflower stem is over 1" thick. The upper part isn't going to flop over without taking the whole thing down with it. I don't normally fuss too much about sunflowers. They are already somewhat sheltered from prevailing winds, and if we get strong winds that take them out then my attitude is *c'est la vie*...
Answer: I find that little bamboo stakes do nothing. You need a serious stake:  1/2" to 1" diameter and anywhere from 5' to 7' tall.  Tie the sunflower at several points along the stem. to reduce point stress.
All this will do nothing if you have squirrels around who think nothing of hanging off the seed head.  Damage from gale force winds cannot be prevented either.
Another approach is to trim the plant during the growing season of the side shoots which can add considerable weight to the plant.
Planting a smaller cultivar is also quite successful
Answer: Heres what i did. I have an ash tree thats sending suckers out at the base of the tree. I had several 4 foot suckers about the diameter of a pencil neer the middle.
I cut the very top off for being too flexable. Took about 3 feet of fairly flexable, fresh cut, sucker, with leaves off, and some masking tape, and simply increased the strength of the existing stem. I tied it little toward the flower, from the apex of the bend, the  tied the bottom of the sucker branch, to the stronger part of the stem wberever it landed, then a couple bands of tape in the middle. This puts the branch in a pre-flexed position, slightly lifting it, and providing support. Facing the ground is the natural state of a mature head though. I live in Amarillo Tx WINDIER THAN EVERYWHERE!  When it  blows, the heads stay almost stationary as the rest of the plant whips around  violently.  Hope this helps.


Connect Windows 7 Laptop to Mac mini

Question: I have a Mac mini and a Windows 7 laptop.  I want to control the Mac mini through my Windows laptop.  Is there any solution in a way that I don't have to hook up the Mac with a monitor, keyboard, and mouse every time I want to connect?
Comment: You had two questions in here. This site works better when there is only one question per question. That way, it's easier for other people to find solutions if they have the same problem. I've edited out your second question, but feel free to ask it separately.
Comment: To answer the question that was removed, "_Is there is way to connect between them with a ethernet cable and then use the Wi-Fi in my Windows laptop for Internet access?_", yes this can be done however you'll need to post it as a new question to get detailed answer(s) to it.
Answer: I have a similar scenario in that I need to access a Linux system on my LAN from my MacBook Pro, so I use the free version of NoMachine. It's available for Windows, Linux and OS X.
You first have to hook up a monitor, keyboard, and mouse to get NoMachine installed and configured on the Mac and then connect at least once from the Windows system.  You could then shutdown the Mac mini, unplug monitor, keyboard, and mouse and then restart the Mac mini.  I'm assuming you also have it set to auto login.
It would need to be installed on both the Windows and Mac systems.

Connect Windows 7 Laptop to Mac mini


Are energy beings considered "biological"?

Question: In "Forsaken," Dax posits that non-biological life could exist---mechanical life, for instance. We know this is the case since nanites, among other mechanical life, exist. My question is whether Dax (or any knowledgeable 24th century person) would consider energy beings such as Douwd, Q, and Organians to be "biological," or if "biological" only refers to organic life forms: Hirogen, Andorians, Allasomorphs, Excalbians, Changelings, etc.
Comment: Yes according to [the guys from this episode](http://en.memory-alpha.org/wiki/Bride_of_Chaotica!_(episode))
Comment: Hey, what about that silocon-based life form from that one episode I don't know the name of?  The ones that were being mined to death?
Comment: The Microbrain? From "Home Soil?"
Answer: It would likely depend on the context of the discussion.  A conversation about a viral plague would no doubt make a distinction between "biological" species (i.e. those who could contract the virus) and non-biological species (i.e. mechanical, energetic, or any other type which would be immune).
Whereas, a discussion of organic vs synthetic life (such as takes center-stage in the Mass Effect universe) would probably include any species that used to be biological but ultimately evolved into something else (such as many speculate the Q to have done) under the heading "biological," as opposed to purely artificial lifeforms (such as Data).  In such a case, the "biological" label becomes less about their actual current reality and more about their history or cultural/political alignment, in opposition to the vastly different "artificial" category of species.
Of course, in a straight, technical discussion, beings without biology (such as Douwd or Q) are not biological.  But given the wild-and-wacky world of Star Trek, there are plenty of circumstances where it might be expedient to gloss over the distinctions and group them all under the heading "biological" for convenience.
So technically, no.  But practically, maybe.
Comment: I would say the decision to refer to energy-based lifeforms as "biological" could be made based on the origins of the energy. Maybe.
Comment: @Omegacron Exactly.  It would probably just depend on the point of view of the speaker, or the context of the conversation.  Any kind of definitive answer ends up just coming around to "maybe."  :P
Comment: I would argue that you cannot have a clear dividing line in a universe that contains the Bynars and Borg. Both those species have a mixture of biological and synthetic components.
Answer: Biology is the study of life; so if you consider that the non-organic entities such as synthetic life or Q are living beings then yes, you must consider them as biological.
In one episode of Voyager (I don't remember which one exactly), Q as a child (with Q2?); therefore I don't see how it would be possible to not consider him as a living being and therefore, subject to the study of life.
For some synthetical lifes such as the nanites; I suppose that the final answer depends  on your consideration of them as being living or not.
Comment: It's at the end of [The Q and the Grey](http://en.memory-alpha.org/wiki/The_Q_and_the_Grey_(episode)), and with [the female Q](http://en.memory-alpha.org/wiki/Q_(female)), not [Q2](http://en.memory-alpha.org/wiki/Q2) (though that would have been interesting!)
Answer: By definition, "biological" means "living". Are energy beings living? It may depend upon  your definition of life. IMHO, the defining properties of life reduce to the capacity for growth, reproduction, and evolution. Therefore, for an energy being to be biological, it must be able to grow, reproduce, and evolve.
Just because a being is non-corporeal doesn't mean it isn't biological. The energy being in ST:TOS "Obsession" needed to feed, and was thought to be preparing to spawn. Since it had to have come into existence somehow, it's reasonable to conclude it must have evolved from something else. It seems to satisfy all the criteria of something living, so it could be considered biological.
The Q are believed if not self-declared to have evolved from beings not all that unlike humans (which is why the Q is interested in humans - seeing potential future rivals to themselves). The Q, despite their nature contemporaneous with TNG,DS9,Voyager and especially given "Junior" (Voyager "Q2") would seem to qualify as biological, although it is said that they haven't reproduced in a very long time. Given that Trelane had parents, his race must also be biological.
The Organians might not be biological because nothing is ever said about them growing and reproducing; if they have ceased to reproduce, they may have become eternal/immortal and reached a sort of "end of the road"; they would therefore no longer qualify as biological.
Comment: Your closing paragraph seems to contradict your opening sentence.
Comment: I don't think so. I just presented a couple of examples of energy beings which seem to qualify as biological and one which may no longer be. I don't see how anything I've said contradicts anything else.


How do you clue in your readers as to what your theme is, especially when the theme is morally wrong?

Question: How do you clue in your readers as to what your theme is, especially when the theme is morally wrong? Let's say your theme is: Survival is the most important thing, and to survive you must be willing to commit any crime. Because this theme is so wrong, it's difficult to assume your readers will understand what the theme of your story is since it's a theme that's rarely if ever adopted by an author. How do you clue in your readers to that?
Comment: At least how I understand it, "Theme" is not the same as "Final lesson". So a story may be exploring a certain theme just to come to a conclusion that there are moral flaws within it.
Comment: You really should wait 24 hours before accepting an answer. You don't give folks a chance to even answer before they feel the choice is made. It's a global site.
Comment: ::confused::  Survival at any cost is a common theme in science fiction and adventure stories.  Your conclusion that survival at any cost is wrong is also questionable.
Comment: I don't think it's that questionable that survival can have moral costs; e.g. murder-cannibalism to avoid starvation. -- Anyway. How about just putting it as tagline under/after your story's title?
Comment: @JRE indeed, this was a primary reason for Darth Vader's fall. He wanted so much to save his family that he was willing to do whatever it took, even if it meant turning his back on the Jedi and committing treason.
Answer: In movie scripts, they often want the theme expressed early in the film; somewhere before the inciting incident. Usually this is expressed in some form by one character summing up a situation for another; that character may be the protagonist or anybody talking to the protagonist; even an extra, a homeless bum.

"What goes around, comes around."

"You can whine about it, or do something about it."

In your case, the line might be something like, in response to a news story:

"I get it. He had to save his kid. Who cares about a train full of strangers?"

"Screw morality, I'd go down swingin' too."

"Our morality shrinks as our desperation grows. Remember that."

If you can have a character quickly state your theme explicitly and sound natural, fine. Otherwise, just allude to it, as I have done. And invent situations in which the characters, even walk ons, exemplify the theme. Don't keep stating it.
Answer: I'm a little confused as to what you mean by the moral/theme of a story being "morally wrong", and this ties into the general answer to your question.
The entire point of the theme of a story is to reveal some moral truth about the way the world works (or at least how the author believes the world works). This is why it's often called "the moral of the story". Imparting moral wisdom and life lessons is the entire reason humans started telling each other stories in the first place.
Thus, the theme of the story must be something that you, as the author, actually believe. "Morally wrong" implies that you, as the author, do not believe in the moral message of your own story, because per your own words you have a moral compass and this message is illegitimate according to your own sense of right and wrong. The theme and moral should flow naturally from the story. If you don't believe in your own conclusion you can't make an honest argument.
Now, if you believe this to be true and you are trying to convince other people of its validity, you have an entirely different problem: no one will want to read your story.
Humans are generally pro-social animals, and as a result any story that tries to promote unprovoked aggression as a good thing (i.e., "commit any crime to survive" as you state, which would include things like assault and murder) will set off red flags and disgust most people. Committing unprovoked aggression against other members of the in-group (and sometimes the outgroup) is the worst sin a person can commit in every single human society on the planet. There are published authors who try to promote similar "subversive", pro-aggression messages, such as Ayn Rand or the Marquis de Sade, but also note that these authors have a very small fanbase and the average person considers them deranged.
At worst, people will just find the story distasteful and...not read it. At best, they'll read it and deliberately misinterpret the message because the moral is just so alien to human sensibilities no one will be able to resonate with it. There are plenty of cases where an author intended one moral message in a story and the audience gleefully ignored it for whatever reason.
It's not possible for an author to force people to agree with their moral stance, merely present their moral argument as to why they think the way they do, and if someone's morals are so warped and alien they come off as disturbed in contrast, most people won't listen to what they have to say.
Comment: Wikipedia tells me Ayn Rand has sold over 9 million copies of Atlas Shrugged. It also appears to have inspired other writers and other public figures, and references to it can be found in many domains. I don't know that I would call that "a very small fanbase".
Comment: @Stef Bile fascination is a thing. A lot of the popularity tends to be of the "it can't be that bad, right?" type. Much like how Twilight is a widely read book series that a lot of people go "Eh" in hindsight. These kinds of stories tend to have comparably small, very rabid fanbases, and then a wider audience who look at it just to see what the big deal is about, find it uninteresting, and never internalise the message. E.g., look at how poorly the movie adaptations of Ayn Rand's works have done compared to the books, where people have to actually consume the story when they purchase it.
Answer: Progression:
The logical way to introduce this idea to your reader is for the characters to have to make a series of increasingly questionable actions to survive or thrive. But you can be subtle about it, if you want. Give a character an opportunity to do the right thing, but make it a bitter experience when they choose the "right" thing. The nun they save isn't a nun, but a prostitute in a costume. Or they rescue someone who then steals something from them they need to survive (triggering a series of increasingly desperate choices...). The goal is to embitter the character so we empathize with their seemingly flawed choices. After all, the 'other' they harm would have stabbed them in the back just as readily.

If the goal is to point out the evil intrinsic in the character from the beginning, then have the character do something small and petty and selfish, like throwing away a solicitation from a charity. This draws attention to the character being impure from the get-go. Evil in small things indicating evil in big things. But the character can verbally espouse good values at the same time ("we should give to charity - but not today.") to emphasize the hypocrisy.
If the goal is to track the declining morality of the characters, then make them do something bad while trying to get revenge for their betrayal. The person steals their water, and they destroy the water rather than let the thief keep it. They would rather condemn the thief to death than see them succeed at the character's own expense. But then when confronted with the same opportunity to steal the means of survival, the character can make the same flawed but necessary choice as the thief.
Some people will lead with a prelude including the character doing the most despicable thing possible to survive. Then it cuts back to the seemingly innocent and good character earlier, and the reader is left to wonder what series of terrible events or choices led to the good character doing something so terrible.


What (natural) phenomenon could cause an earthquake on O'neill cylinder?

Question: There is an O'Neill cylinder about 10,000km long and 10km wide in diameter orbiting a blue giant star. The crew on board have been complaining about the tremors or sometimes a powerful 6.8 magnitude earthquake which occurs sporadically. The engineering could not think of a cost effective and reliable way to compensate for this shaking but had confidence that the station's structural integrity will not be compromised unless it's a magnitude measuring 8.9 or more. I am curious what kind of natural phenomenon could have caused the O'Neill cylinder to experience sporadic earthquake in orbit? By natural, I meant not any kind of design intents including terrorism.
Comment: Well, its a cylinder. 10.000 km in diameter, ok. What is the height of the cylinder? Is it a short-height cylinder like a disc, a long-height cylinder like a rod, or a middle-height like a can?
Comment: @VictorStafusa: my mistakes should be 10,00km long and 10km diameter ;D
Comment: What you've described is not an O'Neill cylinder, it's a McKendree cylinder.
Comment: @rek This is only about twice the size of an O'Neill cylinder, but about 100 times smaller than a McKendree cylinder...unless your comment was from before he corrected his diameter vs length?
Comment: Instability of such structure - long, small diameter, rotating axis along its length - the thing will be unstable and any failure of dampening systems will lead to such things. The rest is nonissue compared to that.
Comment: space debris or asteroids hit it
Answer: A huge rod-like cylinder in space is subject to some problems:

Occasional collision with meteors. Those will shake the cylinder occasionally and might damage the hull requiring significant shielding and significant repair maintenance.

Gravitational uneveness. Although it is intended to generate outward gravity, a structure this large has considerable self-gravity. Far from being a spherical body, that makes the ends of the cylinder feel like they are sloped and with a stronger gravity than the center of the cylinder.

Flexing. A hollow rod-shaped body this long would not be perfectly rigid, and the size of its flexing and wiggling in orbit is substantial.

Uneven loading. If the interior of the cylinder is loaded unevenly, the weight differences might create accumulating forces that might be released subtly when something moves.

Orbital excentricity. If its orbit is significantly elliptical, the cylinder will experience significant tides.

Vibrational ressonances. Every object has some vibrational ressonance frequency. You can make an entire building vibrate if there is some hardware producing vibrations in that frequency. See Tesla's oscillator for that. The MythBusters tested it in a metal bridge, and although the vibrations didn't caused any damage and couldn't cause an earthquake, it made the entire bridge vibrate. Now, put a vibrating cubic-kilometer-sized motor in the cylinder and see what happens when it gets the critical frequency.

Stellar activity. Blue giant stars are very unstable, so the cylinder may expect to suffer from strongly varying stellar wind, strongly varying temperature and strongly varying magnetic field. Those may create varying differences on the cylinder body that may induce some tremors.

Leaning rotation. If the rotation of the cylinder is not perfectly perpendicular to its circular section, i.e., it is rotates leaning, this might trigger tremors, specially in sections with uneven weight distribution. And far from being spherical or ellipsoidal, it might rotate chaotically as time passes if no correcting measure is taken.

Gravitational interference from other big ships. If other very big ships and/or stellar stations occasionally comes near the cylinder, or even lands on it, they might have enough gravitational interaction to shake some things.
Answer: Magnetic Launch Problems
Think fighter jets taking off from a carrier. When they launch, it shakes the ship noticeably. And that's the system working as intended.
For sending spaceships out to other habitats or locations in system, a magnetic launch system is a good answer - if you've coated your habitat in solar panels, you have lots of energy available, but fuel is still valuable, so you replace the scarce resource with an abundant one.
Damper Issues
Maybe there's a damping system, designed to smoothly transfer the "kick" from the launcher to the habitat over a longer period of time (say over a minute instead of a 20 seconds). This large, relatively complex hydraulic system might have a problem that is very expensive to correct, and it means that some launches cause tremors or quakes. (Just the downtime could be expensive - all cargo off the ship is grounded while work is done!)
If they feedback system is complicated enough, you might not even be able to predict which launches are problematic. Temperature could be a factor, which means the habitat's exact angle compared the star, recent solar activity, what heat rejection systems are online... could all come into play. And that's just for the temperature part of this complex system.
The result is: you're launching many ships for trade and transport, and you don't have a good idea if any particular launch is going to cause a large quake.
Answer: A Failing Central Bearing
An O'Neil Cylinder is not actually 1, but 2 cylinders connected by a central bearing that causes them to rotate in opposite directions.  This allows it to control its artificial gravity/spin without having to expend tons of reaction mass.  But this bearing can become warped over time.
In smaller warped bearings we see at human scales (like on an old wheel) as deformation starts, you begin by feeling the occasional tiny skip whenever speed, alignment, and the deformation line up just "right". As the bearing deforms more, the skips become stronger and more frequent until it turns into a rattle.
However, the sheer size of the central bearing on an O'Neil Cylinder means that it would be subject to stretching over time much more so than a simple wheel.  The stretching means that the shaft will no longer make contact with the whole ring, but rather press into one side and role around the interior of the outer ring.  By the time your bearing starts to skip, you may already have several meters of play working against you; so, even the first skip may feel like a significant Earth quake as the bearing may bounce from one side to the other before settling back into a role.
This means that not only are your engineers worried about a magnitude 8.9 earthquake, but they are worried about the central bearing transitioning from skipping occasionally to rattling.  If that happens, you habitat will enter a constant state of Earthquakes that will rapidly get worse until the central bearing fails all together.
Answer: ICE
In the larger / deeper bodies of water, orbital differences cause the cylinder to go though 'seasons' some times freezing the lower (outer) layers of water closer to the radiative hull sections that are covered in shadow. Some times these ice covered areas can get quite large and dislodge from the bottoms. These bergs cause some havoc as they are tossed about by the currents from the Coriolis force. Sometimes colliding with other structures in the habitat.


How do I issue a warning in a wordpress plugin?

Question: I'm trying to debugging a plug in that's misbehaving. I don't have a good setup for debugging and developing wordpress, so I just want to output the values of some variables to the rendered page. Is that possible? How do you issue a warning or some sort of message?
Answer: Simple, wherever you're working on data that's output, just use var_dump($whatever_variable). You can also use print_r($a_variable)


Can I Birthing Pod a token to get a creature with a CMC of 1?

Question: From my understanding, the CMC (converted mana cost) of a token is 0.  When you sacrifice a creature with Birthing Pod it adds 1 to the CMC.  So, if I sacrifice a token (any token) to Birthing Pod, can I get a creature with a CMC of 1 from my deck?
Answer: You are correct in the general sense. The CMC of almost any tokens is 0. The only exception is tokens copying other cards (e.g. Cackling Counterpart).
The simplest reference is the Oracle rulings:

6/1/2011  A token has a converted mana cost of 0, unless it is copying
something else.

6/1/2011  If a creature is copying something else, its converted mana
cost is the converted mana cost of whatever it's copying.

So, why do most tokens have CMC 0?

110.5b ... A token doesn't have any characteristics not defined by the spell or ability that created it.
Example: Jade Mage has the ability "{2}{G}: Put a 1/1 green Saproling
creature token onto the battlefield." The resultning token has no mana
cost, supertype, expansion symbol, rules text, or abilities.

Normally, in Magic, the absence of a value isn't the same as "zero", but the definition of converted mana cost explicitly covers this situation:

202.3a The converted mana cost of an object with no mana cost is 0.
Comment: Little nitpick: the absence of a value usually does usually imply that it's zero, if it's needed in a calculation: *107.2. If anything needs to use a number that can't be determined, either as a result or in a calculation, it uses 0 instead.* When in doubt, the comp rules tend to repeat themselves just to err on the safe side, so it's no wonder that they explicitly spell out 202.3a when 107.2 would technically suffice.
Comment: Silly me, I should have looked at the card.
Comment: Note, a flipped card (Delver, Huntsmaster, etc) also has a casting cost of 0.
Comment: Does this mean the resulting token has no artist, too, until it is targeted by Brushstroke Paintermage of course? :-)
Comment: Indeed it does.


URL-dependent templates only evaluated once, incorrectly cached

Question: I have a twig template that controls the HTML of the page based off of some URL-specific information. However, this template seems to be evaluated once on the server and then gets cached, never to be evaluated again. The result is that the first page loaded displays the correct information inside this particular block, but every page after that displays the same information as the first page in the block, even though the URLs are obviously different.
To illustrate, page A should have data A loaded on the side in a block, page B should have data B loaded on the side, and so on. If you go to page B first, then you will see data B loaded correctly. However, after that, if you go to page A, you will still see data B loaded on the side, rather than data A. Note that this bug only pertains to the portion of the page that is controlled by the URL-specific logic; the rest of each page loads correctly.
If I go to Home >> Administration >> Configuration >> Development and clear the cache, the next page loads correctly, but then I'm just stuck with a new incorrectly cached chunk of data for all the other pages.
Why is Drupal caching this block whose display is dependent on the URL? More importantly, how can I get rid of this behavior without disabling caching completely?
Update 1: I have tried going to the view for the block (Home >> Administration >> Structure >> Views) and under Advanced Settings selecting None for Caching, but this has no effect.
Update 2: I don't have a custom block with code to modify, so not sure how to incorporate fixes from questions like this.
Comment: You need a cache context, see for example https://drupal.stackexchange.com/questions/200819/how-do-i-get-the-current-path-of-a-block
Answer: As stated you would need a cache context for the block, more specifically the "url.path" cache context. You could add it in a preprocess hook, but it requires some PHP knowledge.
You could try the Blocache module which lets you change the Cacheability metadata for any block. Once enabled, select "Contexts" and check "url.path". Disclaimer: I have not tried this module myself, but it looks like it would solve your problem.


How do I Pass An Array Between Two Views Using the SWRevealViewController?

Question: QUICK BACKGROUND:
I have an app that shows a list of songs in a searchable, tabbed interface (a.k.a. "Cheers View Controller").  There are two tabs, one for each category of my cheers.  I have a sidebar that allows you to select menu options, one of which is called "My Favorites".  It uses the SWReveal Controller (a.k.a. "Sidebar").  I am trying to allow the user to mark favorite cheers before game time, then use the sidebar navigation to quickly reference their list of favorite songs when they're in the dugout.
The initial view controller for my application is a Reveal View Controller.
The front view (sw_front) is the tab bar controller that shows the Cheers View Controller when the app first launches.  The data is loaded into an array form a CSV file in the ViewDidLoad of the Cheers View Controller.
The rear controller (sw_rear) is the Sidebar that defines the menu options for my application.  One of the menu options on my Sidebar is called My Favorites.  It's this sidebar that is conceptually throwing me.  See below for a snapshot of the relevant area of my storyboard.
STORYBOARD SNAPSHOT:
It turns out that as a new user I cannot post images.  :(
GOAL
I am trying to access the array of favorite cheers in the Cheers View Controller from the My Favorites view controller.  There is currently no segue from Cheers View Controller to My Favorites and it seems like defining a segue here is wrong conceptually.
I don't want to use a singleton or some other work around, I would rather structure my app the correct way.  One easy solution is to move My Favorites over to another tab of the Tab Bar Controller.  While I can change the design and things would probably be easier, it feel like I'm missing a valuable concept here that I can use in later apps.
I realize that there are many posts already on the topic of passing data from one controller to another.  I've read what I think is all of them but I have not been able to incorporate the solutions into the SWRevealController implementation successfully yet.  So clearly I'm confused either on mechanics or on concepts (or both).  Most of those posts I read were involving segues or passing fields between two controllers that had segues or relationships of some sort.
MECHANICS QUESTIONS:
I currently prep the favorites array in the ViewDidLoad of the table view controller in the Main Tabbed Interface.  I did this immediately after loading the main array with all the songs from a CSV file.  I was thinking that I could somehow pass this to the My Favorites table view controller or access it from the My Favorites Table view controller.
<code>//Copy favorite cheers into array
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"SELF.favorite contains[c] %@",@"Yes"];
NSArray *tempArray = [self.cheersArray filteredArrayUsingPredicate:predicate];

self.myFavoriteCheersArray = [NSMutableArray arrayWithArray:tempArray];
</code>
Here's where it gets sticky for me - when the user clicks the button to show the SideBar, then clicks on My Favorites:
the prepareForSegue of the Sidebar will execute with this:
<code>- (void) prepareForSegue: (UIStoryboardSegue *) segue sender: (id) sender
{
    // Get the selected row and identify the destination controller you are sending to
    NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
    UINavigationController *destViewController = (UINavigationController*)segue.destinationViewController;

    // Set the title of navigation bar by using the menu items
    destViewController.title = [[_menuItems objectAtIndex:indexPath.row] capitalizedString];

    if ( [segue isKindOfClass: [SWRevealViewControllerSegue class]] ) {
        SWRevealViewControllerSegue *swSegue = (SWRevealViewControllerSegue*) segue;

        swSegue.performBlock = ^(SWRevealViewControllerSegue* rvc_segue, UIViewController* svc, UIViewController* dvc) {

            UINavigationController* navController = (UINavigationController*)self.revealViewController.frontViewController;
            [navController setViewControllers: @[dvc] animated: NO ];
            [self.revealViewController setFrontViewPosition: FrontViewPositionLeft animated: YES];
        };

    }
</code>
And I was trying to add this to the end of the prepareForSegue to somehow allow My Favorites access to the array...but I'm having trouble identifying the property in the Cheers View Controller from the Sidebar...
<code>    if([segue.identifier isEqualToString:@"myFavorites"]) {

        //Get the Favorites View Controller (which has a navigation controller)
        MyFavoritesViewController *myFavoritesViewController = [[MyFavoritesViewController alloc] init];
        myFavoritesViewController = (MyFavoritesViewController*)destViewController.topViewController;

        //THIS BELOW PART IS SHAKEY AT BEST
        //Get the Cheers View Controller (which is part of a tabbed view controller)
        SWRevealViewController *frontViewController = [[SWRevealViewController alloc] init];
        CheersViewController *cheersViewController = (CheersViewController*)frontViewController.frontViewController;

        //Pass the Favorites Array -- The below code gives me an error that the property I set on the CheersViewController is not found.
        rankingViewController.favoriteCheers = CheersViewController.myFavoriteCheersArray;
    }

}
</code>
CONCEPT QUESTIONS I'D LOVE COMMENTARY ON:

What is the best (by best, I mean a balanced approach between implementation reality and academic purity) approach to make the array available to another view controller when a segue is not defined without butchering OO concepts/designs?
The rear view controller (the Sidebar) does not get loaded on app startup - instead it gets loaded on first display.  Is it correct that I am therefore loading the data for the first time in the Cheers View Controller (i.e. I could make the Sidebar load on app startup but this seems conceptually wrong as well since the user may never access the Sidebar)?
Is it best to prep the my favorites array when the app first launches in the Cheers View Controller or only when My Favorites is first viewed?  The list is rather small but technically if the user never clicked on the sidebar to view their favorites then I would be loading an extra array unnecessarily - probably a nit since the array is small but I am curious.
Is the proper place to load the data where I have it currently?
It seems to me that a delegate conceptually wouldn't make sense since the Cheers View Controller doesn't really need to be aware of a user viewing his/her favorites.  All I'm really doing is trying to query a set of master data. Am I correct in thinking this way?
Comment: Many of the answers I was seeking can be found here:  http://stackoverflow.com/questions/569940/whats-the-best-way-to-communicate-between-view-controllers
Answer: Here is how these were solved.  They work - as for whether or not they are the best, I'll let you know as I learn more.  grin
QUESTION 1:  Load an initial set of data from a plist, CSV or any other source file in AppDelegate didFinishLaunchingWithOptions.  For example:
<code>//Read in from JSON file
NSError *error;
NSData *data = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Cheers" ofType:@"json"]];
NSDictionary *json = [NSJSONSerialization JSONObjectWithData:data options:kNilOptions error:&error];

self.cheersArray = json[@"cheers"];
</code>
This array can be immutable (i.e. NSArray) and you can cast this to a view controller who can manipulate it as an NSMutableArray if needed.  For example:
<code>//Instantiate initial view controller
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
CMViewController *cmViewController = [storyboard instantiateInitialViewController];

//Pass array of data into a table view controller
cmViewController.tableData = (NSArray *)self.tableData;
</code>
This assumes your View Controller has a property that can be used to pass the data into.
If you had a JSON file and need it to be a PLIST, there's a great utility via Terminal on your Mac
<code>plutil -convert xml1 InputFileName.json -o OutputFileName.plist
</code>
As you learn like I did you may realize plists with a smaller number of rows is preferred over JSON files and a tad bit easier (personal opinion) to deal with when it comes time to saving changes to the data (if your app allows that).
QUESTION 2: It is conceptually wrong from an academic point of view to load the Sidebar on app startup.  It should only be loaded on first use.
QUESTION 3:Similar to Question 2, It is best to pass the favorites array to the view controller that needs it on first request (i.e. the user presses on the tab "Favorites".  Since technically Favorites is just a specific view of a subset of the master data I am loading, I believe this is correct.
QUESTION 4:I moved it form the first view controller to the App Delegate as shown above.  This gave me more flexibility to pass data down (conceptually speaking from a parent to a child view controller) rather than across (form child to child view controller).  This simplified my code.
QUESTION 5: I don't believe a delegate is appropriate for the answer to the challenge I was facing.
Feel free to comment!
Comment: Note that you can also load data in an initial view controller if you like as well.  This view controller could be the parent view controller for the app.  I'm just not sure which place is "best practice" or if it is more situational/personal preference.


Understanding the calculation of the independent samples Cohen's d from t & df

Question: It seems that for calculation of Cohen's $d$ (an estimate of effect size), you should use the difference in means (or in one-sample case, from baseline), divided by $SD$, if that information is available:
$$
\frac{\bar X_1 - \bar X_2}{SD}
$$
However, when you only have the $t$-statistic and the degrees of freedom ($\rm df$) available, what is the formula for Cohen's $d$? In the one-sample / paired-sample case, it's intuitive how to derive $d$ from $t$, since $t$ is calculated as the difference in means over standard error:
$$
t = \frac{\bar X_1 - \bar X_2}{SE} = \frac{\bar X_1 - \bar X_2}{\frac{SD}{\sqrt{N}}}
$$
so $d$ equals:
$$
d = \frac{\bar X_1 - \bar X_2}{SD} = \frac{t}{\sqrt{N}}
$$
And that's what you find in online articles such as this one (pdf). But for independent samples, the equation is listed instead as:
$$
d = \frac{2t}{\sqrt{\rm df}}
$$
as seen here, or even:
$$
d = t \sqrt{\frac 2 N}
$$
So where does the "$2$" come from? Is it related to the formula for pooled SD?
Comment: You've got a lot of questions in 1 here.  I've answered the first part about the 2 but your later question would require a whole additional answer.  Perhaps divide these up because the repeated measures v. biased estimators are two separate things. (not everyone uses the biased estimator for Cohen's d... Cohen never defined it).
Comment: Hey John, you make a good point. I appreciate your in-depth answer to the first part, and I'll post the second part as a separate question soon, and take it out of the post, as well.
Answer: The SD used in the t calculation is that of the effect, not of the individual groups.  In the paired case the SD to use in Cohen's d and t are the same. But the SD used in the d calculation for independent samples is the pooled SD of the individual groups, not the theoretical SD of the effect.  Under the assumptions of 0 correlation and equal variance (the independent case) the variance of the effect is double the variance of the individual conditions.
Try the following R code to demonstrate the effect
x <- rnorm(1000, 0, 10)
var(x)
y <- rnorm(1000, 5, 10)
var(y)
cor(x,y)
var(x-y)

Run the example a few times.  The first two lines get random independent samples of 1000 with variances of 100 (sd = 10).  What you'll see is that with the correlation between x and y close to 0 the variance of x-y (the effect) tends toward 200.  This is also true for x+y.  With the large samples in the code above spurious correlations are rare but in real experiments with large sampled they happen all the time (reduce the n in the sample above and they'll happen there).  Therefore, what we do is stick to the theory and average the variance across the groups (pooled variance) and then double it.  One could alternatively just sum var(x) + var(y).  This turns out to be mathematically the same but hides the assumption of equal variance.
For comparison, try some correlated data made from effect calculations.
m <- rnorm(1000, 2.5, 10)
x <- m - rnorm(1000, 2.5, 10)
y <- m + rnorm(1000, 2.5, 10)
var(x)
var(y)
cor(x,y)
var(x-y)

I didn't bother equating the variances to the above (an sd = sqrt(50) in all samples above would do it).  What you'll see this time is that the variance of x and y are each 200.  This should result in a final variance of x-y of 400, if all was true as before.  However, because x and y are correlated (about 0.5) you'll get a much lower variance.  This is the mathematical property that a paired t-test takes advantage of.
That's part of it, but why does cohen's d use different calculations?  With the paired measures design, the correlation between conditions is part of the calculation of the effect.  You typically only collect enough of an N to really measure the effect and you're not really about measuring the true values in each condition, just the effect.  Future experiments will tend to be of a similar design and the effect size from repeated measures provides a more accurate prognosticator of the likelihood of replication.  A similar argument holds for the independent design.
Some have argued that you should use a pooled variance of the individual conditions all of the time.  There's debate about that with some people coming down firmly that the d formula should always be the same and use the independent groups version.  This insures a common reference point for when you do and don't use repeated measures designs.  I think the argument has some merit if an independent design is possible, and probable. But I see this argument made in things like differences between people's ears.  That can never be an independent groups design, will have very highly correlated measurements, and therefore should always have an effect size calculated through the paired or correlated effect measurement.
Comment: OK great! So to calculate _d_ from _t_ for independent groups, you must change SDeffect in the denominator of _t_ to SDpooled. Since SDeffect = 2*SDpooled (assuming no correlation) as you eloquently explained above, you must add a "2" to the numerator as well. So why does _d_ use SDpooled rather than SDeffect as _t_ does? Are we putting the difference in means into units of either group, instead of into units of the effect? And would the argument to use pooled variance for paired samples be that how much the two paired samples correlate would vary and so is not a consistent measure? Thanks!
Comment: Yes, the d for paired measures is in units of the effect while for unpaired it is not.  But that's really a difference in the design of such studies as well.  In paired tests you typically don't get good estimates of the individual measures and only really measure effects.  In independent designs you don't get reliable results unless you measure each condition well.  And yes the argument for pooled variance reported has to do with the correlation varying.  However, if you are in a field where effects is all you can measure you should reporting the paired d.
Comment: And don't forget SDeffect = sqrt(2 * VARpooled).  It is NOT 2 * SDpooled.  It is sqrt(2) * SDpooled.


what is the most effective and cost efficient way to heat basement rooms via electricity?

Question: I am finishing my basement and will have 1 bedroom, laundry room, full bathroom and family room with bar.   I want the heating source in the basement to be electrical since the rest of the house is heated by oil and fireplace.  I want to be able to control heating individual rooms when necessary if it will save me on heating cost.  I have a electrical heating unit controlled by a thermostat in my sunroom that is like a big square air vent on the wall.  Are these units better than the individual baseboard units that have a power on and temperature control dial on the baseboard?
what are some of the best names out their for reliable electrical heating units?
Comment: Is your oil unit forced-air or hydronic?
Answer: Efficiency
Cheap to install, expensive to run:
All electric resistance heaters are basically 100% efficient, no more, no less.  *Mind you, that's at converting electricity to heat.  Back at the power plant, things are not so efficient**, and that's it's much cheaper to just use gas, rather than have them turn it into electricity first.*  An electric heater spends all its energy as heat, and since they don't have or need vents, it all winds up in the room.
Expensive to install, cheap to run:
If you want to exceed 100% efficiency by a wide margin, use a heat pump.  This actually does work.  It is taking heat from outside and concentrating it.  However this is a lot like an A/C system (in reverse) and so it's hard to have fine zone-control.   If you want zone control, there's a product called a "mini-split heat pump" with no ducting and a little unit in each room. There needs to be freon piping back to an outside evaporator.
Thermostats
On the unit:  Most heaters have a kit that lets you put a thermostat right on the heater.  The heater's heat causes the thermostat to misread, so not a great idea.   You also have to turn off a bunch of thermostats when you go home.
Line-power thermostat: They are cheap and can drive several heaters, so zone control is easy.  It switches the heavy electric power cables going to the unit.  Those big wires make some heat inside the thermostat which again can cause it to misread, which is why they're infamous for being sloppy.  It also requires the heavy power cables make a big detour to go to the location of the thermostat.  This adds length, cost and energy loss while in use.
Common 24V thermostats: Electric heaters can also be used with common 24V thermostats, including "smart" thermostats like the Nest or Ecobee. This involves running the heavy cables in a beeline to the heater, and putting a common 24V relay either in the heater or down at the service panel. The installation is more complex but the most flexible.  You can even integrate the electric heat with a gas or heat pump system, using it as a stage of auxiliary heat.
A heat pump absolutely requires a 24V thermostat, and a fairly sophisticated one at that!
Quality
Resistance heaters are very simple things.  It's possible for them to be both cheap and high quality.  Cadet heaters are notoriously cheap, but I can't honestly say I've ever seen one fail, including some that were horribly abused by bad placement. They just keep working.

** A thermal power plant (that burns gas or coal to spin turbines) is 37-40% efficient; 60+% of the heat value is lost in the machinery.  So is nuclear, but nobody cares about thermal efficiency of nukes.  Hydro is near 90% efficient at turning falling water into electricity.  Wind and solar use "found energy" so efficiency is not critical. Electric heat is a good "dump" for wind/solar systems that have topped up their batteries.
Answer: The most cost efficient way to heat with electricity is via heat pump - cold climate if your climate is cold.
Electrical resistance heat is cheap to install, expensive to run. Much more expensive to run than adding the rooms to your oil heat, for instance.


Specht polynomials for dihedral groups

Question: The representation theory of the symmetric group is best understood via the Specht polynomials. In wonder how this works for other finite reflection groups, such as dihedral groups. Are the similarly nice objects?
Comment: Since the representations of dihedral groups are easy to analyzr in classical ways, it isn't clear to me what else Specht polynomials would accomplish here.   Other infinite families of reflection groups probably offer a better rationale for this machinery.
Answer: Specht polynomials and Specht modules have been applied not only to the representation theory of symmetric groups, but also for other reflection groups, e.g., for
octahedral groups, see for example http://www.cmi.ac.in/~pdeshpande/projects/irreps.pdf.
Furthermore there are "Higher Specht Polynomials for Complex Reflection Groups", see the paper of H. Morita, and H. Yamada. Perhaps also of interest in this connection may be Garnir polynomials for finite reflection groups, which play a role for modular representations, too (S. Devadas).

Specht polynomials for dihedral groups


How to move all files plus hidden to folder down?

Question: I want to move all my drupal files in www folder to html folder. I don't know how to do this in terminal and I'm not sure if all folder and files including hidden ones are drupal in the www folder, is there a way of checking the lesser obvious ones or would www have been empty before and any hidden files will auto recreate?
Answer: With zsh:
mv -- *(D) html

mv will complain that it can't move html to itself, but will still move the rest.
With bash:
shopt -s dotglob
mv -- * html

With ksh93:
FIGNORE='@(.|..)'
mv -- * html

POSIXly:
mv -- * .??* .[!.] html

or
mv -- * .[!.]* ..?* html

(you're likely to get errors for those of the patterns that have no match. That should be harmless but will still cause the exit status to be non-zero so in script you would not be able to distinguish that with a failure to move files).
Comment: Oh I wish I had seen this before- very helpful. I ended up uploading to html directory a fresh install and now the other is still residing other folder so I will just remove what I know to be drupal I guess. Thanks. I will copy this above info for future ref.
Answer: The easy way:
# from the www directory
cd ..
mv www html
mkdir www
mv html www/

This assumes you don't already have a html directory at the same level as www. If you do, pick a different name:
cd ..
mv www temp_name
mkdir www
mv temp_name www/html

Comment: remember to check access permissions and ownership if you're to recreate a directory that existed before.
Answer: A naive option (don't try it!) would be: mv * .* html - this will however try to move . and .. too, which is not quite what you want. I usually do something like mv * .??* html - this moves normal file and hidden files with names that have at least 3 characters in them, effectively skipping . and ..
Comment: That would skip `.a` and `.z` as well.
Comment: Thanks but how do I know what files are assoc with drupal, is there a way to ask the system?


How to picture the relation between the momentum, force, and kinetic energy?

Question: Does the force impact a body to have momentum and kinetic energy, and how does it impacts? How does one differentiate the momentum of a body from the kinetic energy of the same body? Please give me an example that would picture the difference between the force, momentum and kinetic energy.
Answer: Think of catching an apple.

Force is what stops the apple's motion. Your hand is applying that force. So force cause changes in both momentum and kinetic energy.
The apple has a weight. But when you catch it, it feels even heavier than it's weight. Momentum is what makes things feel heavier when you stop them from moving.
While momentum takes care of how hard the apple is to stop, the kinetic energy tells what happens after you stop it. This energy is converted into something else, for example heat. Kinetic energy is how much the apple can heat up (or do you work on) something else when impacting.
Answer: Force by definition is something that brings about acceleration i.e. a change in velocity which has an effect on both Kinetic Energy and Momentum
To differentiate between Momentum and Kinetic Energy, imagine an ideal gun. On firing, both the gun and the bullet fired have the same momentum(conservation of momentum) but the bullet is far more dangerous than the gun because since it has the lower mass, it must have the higher velocity for the momentum to be the same and thus higher Kinetic Energy
Momentum has little meaning as a quantity but it is useful as it can give you an idea of the motion of a particle(it's a vector quantity) while Kinetic Energy can't(it's a scalar quantity)


Drupal 7 views - distinct not working with ordering by multiple (date) field

Question: I have "Episode" content type and some "Showing from" date field in it which is repeating (more than one value can be added). Then I have a view that list episodes ordered by that field, which works, but I want to exclude same episodes. Now if episode has i.e. 3 times that fulfill filter criteria episode will be listed 3 times. I checked "Distinct" option but it doesn't help - still episode is listed 3x.
Actually I'm not very sure how Distinct works - is it possible to select a filed that has to be distinct (if yes - how?) or it works for all fields? I would like to set distinct on episode nid of course.
Answer:
Apply a filter on the date field
Select the operator: 'Is equal to', and type '0'

When you have a multiple value field, the field has a list or array of values. delta=0 is the first value

https://www.drupal.org/node/1872262#comment-6869736
Answer: for that you can use aggregation with views i.e in advanced option in views from their you can use aggregation yes, and in that field click agregation settings set your option as distinct
Comment: I tried with grouping but without success. When I just turn on aggregation I got mySql error. Also, for all fields in their aggregation settings it's pre-select "Group results together". And there is no "Distinct" option to select?! There is "Count DISTINCT", but when I set that I get no results at all?! Where can I set that "distinct" option for specific field?
Comment: To be more precise if I turn on aggregation and in format settings I select the field I want to group by (node id) I get mySql error:

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AS field_data_field_img_, field_data_field_show.field_show_nid AS field_data_fie' at line 1
Comment: And the query I get starts with:
SELECT DISTINCT field_data_field_img. AS field_data_field_img_, field_data_field_show.field_show_nid AS field_data_field_show_field_show_nid, field_data_field_season.field_season_value AS field_data_field_season_field_season_value, field_data_field_episode.field_episode_value AS field_data_field_episode_field_episode_value, field_data_body.body_value AS field_data_body_body_value, node.nid AS nid_1, node.title AS node_title, field_data_field_video_id.field_video_id_value AS field_data_field_video_id_field_video_id_value, node.created
...
Comment: First field that I'm getting is image from that "episode" content type, but it "field_data_field_img." looks suspicious to me - every where else is something.something and for image field variable after dot is missing.
Comment: Is image field somehow specific? Do I have to set something there when I turn on aggregation?
Comment: I think your view is some how like that it shows the listing which fulfill its critires. you need to be more specific in your views.