Suppose two coins $C_1$ and $C_2$ are tossed and suppose further that $C_1$ was tossed $40$ times and $C_2$ only $20$ times. The outcome for $C_1$ is $8$ times heads and $32$ times tails. For $C_2$ we have once head and $19$ times tails. My question is, what test do I use in order to try to show that the probabilities for having heads are significantly different for $C_1$ and $C_2$?  In addition I'd be interested if anyone could explain the following confusion to me. If I estimate the probability for heads of $C_1$ by $p_1=1/5$ then the probability of the outcome of $C_2$ under the hypothesis that the probability is $1/5$ as well equals $$ \binom{20}{1}\frac{1}{5}\left(\frac{4}{5}\right)^{19}\approx 5.7\% $$ which is not significant (I would like to have a significance level of $&lt;5\%$). On the other hand If I reverse the situation I obtain for the probability of the outcome of $C_1$ assuming a probability for heads of $p_2=1/20$ $$ \binom{40}{8}\frac{1}{20^8}\left(\frac{19}{20}\right)^{32}\approx 0.06\% $$ which is by far smaller than $5\%$. So one test tells me the probabilities are significantly different, while the other doesn't (this is the source of confusion) but in fact I would just like to know how I can tell that $p_1\ne p_2$ significantly.
I am using a chi-sq test between two proportions (). I am using this over the z-test for proportions because I do not think my data is normal.   My question is how do I get the difference (shift) estimate &amp; confidence intervals for this test.   For example,     Data1: 193/252=.77   Data2: 154/227=.68   P-value=.032 (I used the formula in the link above. I will also add my exact code below)  Shift Estimate: I assume its the difference between proportions, ie .77-.68=.09. Is this correct?   Confidence Interval: ??????????????????  Code for generating P-value (matlab):   % Pooled estimate of proportion  p0 = (n1+n2) / (N1+N2); % Expected counts under H0 (null hypothesis)  n10 = N1 * p0;  n20 = N2 * p0; % Chi-square test, by hand  observed = [n1 N1-n1 n2 N2-n2];  expected = [n10 N1-n10 n20 N2-n20];  chi2stat = sum((observed-expected).^2 ./ expected);  p = 1 - chi2cdf(chi2stat,1);  H=0; if(p&lt;.05), H=1; end
Suppose $X$ is a real-valued random variable and let $P_X$ denote the distribution of $X$. Then $$ E(|X-c|) = \int_\mathbb{R} |x-c| dP_X(x). $$  of $X$ are defined as any number $m \in \mathbb{R}$ such that $P(X \leq m) \geq \frac{1}{2}$ and $P(X \geq m) \geq \frac{1}{2}$.  Why do the medians solve $$ \min_{c \in \mathbb{R}} E(|X-c|) \, ? $$ MySQL - varchar length and performance How do I prevent "Read more: www.site.com" from being injected with non-Tynt JavaScript into copy-paste actions? There are many sites that insert something like "Read more: www.site.com" into your clipboard when you copy text in your browser.  I find this abominable.  A google search reveals   to stop this if the website happens to be using the service  (by just blocking the Tynt domain), but many websites use home-grown JavaScript.  Is there a general way to block this behavior besides just turning off JavaScript?   I use Chrome but I am interested in all solutions.  EDIT: To be clear, I want to be able to keep the rest of the JavaScript functionality for these websites, since many will break without it.  EDIT #2: Here are two example websites which continue to harass me despite my use of a Tynt blocker:  |   Here are two   and two   which explain ways to implement this shady practice manually without Tynt.  Here is a  describing how hard this turns out to be to block reliably.  Here is the  I could find (March 2013) which offers suggestions on how to block this in Chrome using AdBlock, but it didn't work for me. I want to change my computer's password. Right now my password is abc123. I run this command:  sudo passwd   I entered my current password and then a new one but the change does not take effect. How can I resolve this problem ? What should my Objective-C singleton look like? I'm trying to process some data in Excel. The data includes numeric account numbers and other long numeric strings (like cell phone MEIDs). I am not doing math operations on these strings, so I want Excel to treat them as plain text.  Here is what is making me nuts (this is Excel 2010):   Take a long number like 1240800388917 and paste it in a cell in a new worksheet. Excel's default cell format is general, so the string is presented in scientific notation as 1.2408E+12 Right click on the cell, select Format Cells, set the format to Text   The cell is still displayed in scientific notation, even though the format has been set to text.  Now, if I do the steps in a different order:   Format an empty cell as text. Right click on the cell, select Format Cells, set the format to Text Take a long number like 1240800388917 and paste it in to the text formatted cell   Now, the cell is displayed as a string and not in scientific notation.  The results remaining in scientific notation even though the cell is formatted as text just seems broken to me. I've seen suggested work-arounds like: use CSV import and set the format to text, add a space character to the beginning of each numeric string, and others.  Is there a simple good work around to easily keep these strings formatted as text?  Why on earth does Excel do this?  Related SU questions I found:  and Have Chrome autodetect language before spelling checking? I added textures to a minecraft character, but I realized I forgot the holes for the eyes. So I used a boolean modifier to make the holes, but it was unsuccessful. The holes appear except the texture wrap becomes messy and doesn't go around my character properly.  Without Boolean modifier   With Boolean modifier How do I alter a language item link? Windows 10 Icon Gone Missing TL;DR: The Windows 10 upgrade icon went missing. How do I get it back in order to update my system? I am running Windows 7 SP1.   I woke up this morning... er, noon all excited about Windows 10. I had reserved my copy using the clever little icon in the taskbar a few weeks back, so I thought I would be set to go. I booted my computer and checked the icon to see if it would download the update. It still behaved the same as if Windows 10 wasn't launched yet. I supposed this was normal behaviour. After all, Microsoft can't roll out the update to everyone at once.   Windows Update did want me to install several updates though. I installed KB2952664, KB3064209 and KB3048761. Everything went fine, and I was prompted to restart my system.   After restarting, the icon wasn't there anymore. I tried a lot of solutions including the answers provided by our awesome community on , and the answer provided to  posted on the Microsoft Windows support forums.   How do I get the icon back in order to update my system?  UPDATES:   Installing from the Media Creation Tool does not working with an error "Something Happened" with as description "Something Happened". Both are translated from Dutch.  I tried to install it from the Media Creation Tool using PowerISO to mount the created ISO. It will not accept my product key, even though I am able to verify my Windows installation is already registered and the product key is correct. I looked into the Event Log, and GWX-Ins has a bunch of error messages saying: Error message: GWX Main: App failed to start hresult. After that it says what is roughly translated to English as "Cannot find the element". How do I register a custom URL protocol in Windows? How do I register a custom protocol with Windows so that when clicking a link in an email or on a web page my application is opened and the parameters from the URL are passed to it? Bought a new battery, do I need to calibrate it? My original battery is bloated and is dying quickly after a full charge so I now bought a replacement. Do I need to calibrate this new battery using a calibration app? Can I disable full-disk encryption? How to assign dynamic Ids for ui:inputDate element inside aura:iteration? As title says, How do I assign dynamic Ids for ui:inputDate elements inside aura:iteration?  Here is the reproducible version of the problem I am facing:  HelloWorldApp.app  &lt;aura:application &gt;     &lt;c:inputDateExample /&gt; &lt;/aura:application&gt;   inputDateExample.cmp  &lt;aura:component &gt;     &lt;aura:handler name="init" value="{!this}" action="{!c.doInit}"/&gt;     &lt;aura:attribute name="datesList" type="List" /&gt;     &lt;table&gt;         &lt;aura:iteration items="{!v.datesList}" var="dateItem"&gt;             &lt;tr&gt;                 &lt;ui:inputDate aura:id="date-id"                                value="{!dateItem}"                                displayDatePicker="true"                               blur="{!c.fldChanged}"/&gt;             &lt;/tr&gt;         &lt;/aura:iteration&gt;     &lt;/table&gt; &lt;/aura:component&gt;   inputDateExampleController.js  ({     fldChanged : function(component, event, helper) {         console.log('Value changed');         //How do I find from which date element, event is fired??         //The below method finds both date elements because the Id is not unique         var dateComponent = component.find('date-id');         console.log(dateComponent);         console.log(dateComponent[0].get("v.value"));     },     doInit : function(component,event,helper){         var datesArray = [];         datesArray.push("2017-01-01");         datesArray.push("2017-01-31");         component.set("v.datesList",datesArray);     } })   This produces the below output and I need to find which element user is clicking on??    Notes:   I can assign unique Id for tr element but not sure how to use that inside component.find() method. I can assign dynamic id for plain input tags but there is too much markup involved for making these similar to lightning date element. I tried giving html5 data attributes for ui:inputDate but it doesn' accept.   Any workarounds or anything I am missing here? I can't seem to get Python to import a module in a subfolder. I get the error when I try to create an instance of the class from the imported module, but the import itself succeeds. Here is my directory structure:  Server     -server.py     -Models         --user.py   Here's the contents of server.py:  from sys import path from os import getcwd path.append(getcwd() + "\\models") #Yes, i'm on windows print path import user  u=user.User() #error on this line   And user.py:  class User(Entity):     using_options(tablename='users')      username = Field(String(15))     password = Field(String(64))     email    = Field(String(50))     status   = Field(Integer)     created  = Field(DateTime)   The error is: AttributeError: 'module' object has no attribute 'User' I want to run an app in 'kiosk' mode for public unattended access via touch screen (no mouse or keyboard attached). I can already automate a network user logon and then the app launches (but only in last state - not necessarily full screen - which I want) I know with Workgroup Manager you can hide the dock, use simple Finder etc...but need something more powerful. Ideally it needs to monitor if the app crashes out and restart it / log limited user off and back on again.  Thanks  Phil For any triangle with sides $a$, $b$, $c$, prove the inequality $$a^2b(a-b)+b^2c(b-c)+c^2a(c-a)\ge 0 .$$   This is IMO 1983 problem 6.  I tried substituting $a=x+y$, $b=y+z$, $c=z+x$ but well it doesn't help in any sense except wasting 3 pages that lead to nothing (please don't mind the joke). Using $a=2R\sin A$, $b=2R\sin B$, $c=2R\sin C$ also didn't lead to anything for me. Could you give me a hint for finding the proper substitution? How do i test capacitors? I've just gotten through replacing capacitors on a trio of dead LCD screens (nothing's blown up yet, so far) - they either had one or two capacitors on their inverter circuit SLIGHTLY bloated, and not quite leaky. I ended up replacing all capacitors of the same brand/'colour', even the ones that looked fine, in case.  Now, checking a bad resistor is simple - i can use a standard multimeter to test it, and i tend to check my solders with the continuity testing option of the multimeter.  How would i test a capacitor ? Is there some standard, common way to test one? Too many unprocessed floats I'm trying to a large number of figures. The code is  \begin{figure} \includegraphics[scale=0.5]{m2T4.pdf} \caption{M2T, Problem Size 513} \end{figure}   I'm not able to compile, I get the error  ! LaTeX Error: Too many unprocessed floats. See the LaTeX manual or LaTeX Companion for explanation. Type H &lt;return&gt; for immediate help. ... l.113 \includegraphics [scale=0.5]{m2T4.pdf} You've lost some text. Try typing &lt;return&gt; to proceed. If that doesn't work, type X &lt;return&gt; to quit. ! Undefined control sequence. \@float@Hx ...ltovf \fi \global \setbox \@currbox \color@vbox \normalcolor \... l.113 \includegraphics [scale=0.5]{m2T4.pdf} The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. ! Missing number, treated as zero. &lt;to be read again&gt; \vbox l.113 \includegraphics [scale=0.5]{m2T4.pdf} A number should have been here; I inserted `0'. (If you can't figure out why I needed to see a number, look up `weird error' in the index to The TeXbook.) pdfTeX warning: pdflatex (file ./m2T4.pdf): PDF inclusion: found PDF version &lt;1 .5&gt;, but at most version &lt;1.4&gt; allowed &lt;m2T4.pdf, id=1121, 538.28104pt x 212.1526pt&gt; File: m2T4.pdf Graphic file (type pdf) &lt;use m2T4.pdf&gt; I'm a bit of a force.com IDE newbie - still learning. I'm trying to migrate a simple custom object (no fields) from one sandbox to another and I'm running into this error:  # Deploy Results:    File Name:    package.xml    Full Name:  package.xml    Action:  NO ACTION    Result:  FAILED    Problem: Cannot deploy InstalledPackage in Package Manifest with any other types!   Any help would be greatly appreciated.  Thanks!