I'm currently creating a small device to operate on a CR2032 battery when it is disconnected and a USB power when it is connected. I want the device to be powered by USB when it is connected, without any interruption in the power feed. So my question is: how to switch from battery to USB one the device is connected?  I thought to connect two diodes and a PNP transistor to turn the power based on the battery as soon as the USB is connected. But I wonder if this circuit consume many current when the USB is disconnected (consumption must be very low)?  The circuit :   If you have any solution which will consume less current please tell it to me !
Following an earlier question ,  I would love to implement the  as suggested by Russell McMahon.   That way I could switch between 4AA batteries (1.2V*4 or 1.5V*4) and USB power. The battery voltage would nicely be regulated to 5V too. And the idea was to use the shutdown pin of the chip IF USB power is detected. The device also has to work when no batteries are present.  I am not too experienced with this, but I thought to connect the 5V from the USB to the SHUTDOWN pin from the LDO chip. Pitywise, the pin function is inverted, if SHUTDOWN is low, Vout from the LDO chip is low.  I am now considering using an XOR gate to make the thing work:         &ndash; Schematic created using   I would love to limit the amount of components, but the number of diodes is already high, and the whole thing feels a bit crafted   My questions:    Is there a better suitable chip (with an inverted shutdown pin) is there a better circuit (without voltage drop) to get this (I would prefer to get rid of D1, but then, the XOR has no desired operation)
How do you prove the second law of thermodynamics from statistical mechanics? What is a good website to hack around using Selenium? I want to learn Selenium, but I don't know what to code. Sure, I can throw Google some queries, I can fill out some forms, press buttons, find divs and links, etc. But I think this stuff is pretty basic.  What would be more "advanced" ideas to try out? Can you give real-life examples? Can I switch the User-Agent header for only a single web site? Windows update doesn't progress beyond 0 KB 0% Follow-up to question: Aut(G) for G = Klein 4-group is isomorphic to $S_3$ This is most likely a lack of understanding of wording on my part. I was considerind the Klein 4-group as the set of four permutations: the identity permutation, and three other permutations of four elements, where each of those is made up of two transposes, (i.e., 1 $\rightarrow$ 2, 2 $\rightarrow$ 1 and 3 $\rightarrow$ 4, 4 $\rightarrow$ 3) taken over the three possible such combinations of four elements.  Here, then, is my question. I am assuming (?) that Aut(G) in this case is the set of permutations of the four elements of the Klein 4-group - or the three non-identity ones for the purpose of showing isomorphic to $S_3$. If this is the case, what does it mean to have a permutation of these three permutations that I mentioned above? As always, thanks for your help. How exactly does one “control for other variables”? Here is the article that motivated this question:   I liked this article, and it nicely demonstrates the concept of “controlling for other variables” (IQ, career, income, age, etc) in order to best isolate the true relationship between just the 2 variables in question.    Can you explain to me how you actually control for variables on a typical data set?      E.g., if you have 2 people with the same impatience level and BMI, but different incomes, how do you treat these data?  Do you categorize them into different subgroups that do have similar income, patience, and BMI?  But, eventually there are dozens of variables to control for (IQ, career, income, age, etc)  How do you then aggregate these (potentially) 100’s of subgroups?  In fact, I have a feeling this approach is barking up the wrong tree, now that I’ve verbalized it.  Thanks for shedding any light on something I've meant to get to the bottom of for a few years now...! In the Phone app (iPhone 5, iOS 6.1.2), I click on a contact's number, the call is initiated and starts ringing.   For a brief moment at this point, the label of the number (home / work / etc…) is displayed alongside the contact's name, but it quickly is removed and replaced with the call timer counting up and only the name (and picture of the contact) are shown.      How can I see the number that is being called during a phone call? Format string dynamically How can I make Chrome open bookmarked pages in new tab by default? Current situation:  I am currently browsing a page (say, www.google.com). I want to open a bookmarked page (say, www.bing.com), but I want to keep the current page (Google) opened. I need to click on new tab, then click on the bookmark for Bing. Alternatively, I can right click and open Bing in new tab.  But I want none of those because why click twice when one is enough?    What I want:  I am currently on Google. I want to open Bing, so I click on the bookmark and Bing opens in a new tab. Google remains open.    I am aware of a duplicate question linked . However it didn't really provide a satisfactory answer. Changing every link to javascript breaks the icon and is a pain to do; middle clicking doesn't really work because I'm on a laptop and the touchpad does not support middle clicking. I hope there is an extension for Chrome that can redefine this behavior to the way I want. A hidden setting in Chrome would be even better but I doubt Chrome offers that. Spheres with csv file How to construct a relative path in Java from two absolute paths (or URLs)? Redirect output from all commands to file, not just last Using Chrome's Element Inspector in Print Preview Mode? If you know the Index, Value or Text. also if you don't have an ID for a direct reference.  ,  and  are all helpful answers.  Example markup  &lt;div class="selDiv"&gt;   &lt;select class="opts"&gt;     &lt;option selected value="DEFAULT"&gt;Default&lt;/option&gt;     &lt;option value="SEL1"&gt;Selection 1&lt;/option&gt;     &lt;option value="SEL2"&gt;Selection 2&lt;/option&gt;   &lt;/select&gt; &lt;/div&gt; Vector. Properties It is given in a question that $\vec x+\vec a=(\vec a\cdot \vec x)\vec b$ and it is stated that $\vec a$, $\vec b$ and $\vec x$ are vectors.  It is also stated that $\vec a\cdot \vec b\ne 1$.  The question asks to express $\vec x$ in term $\vec a$ and $\vec b$.  How do you this? How can I make my IP address appear to be from another country? How do I make it appear that my IP address is coming from one country while I'm located in another? I live in Germany and some websites (like Hulu or Youtube) don't work because my IP isn't in the US. How do I get around this? Do I have to use a proxy or something?  Moderator note Super User does not endorse nor defend any activity which may be used to circumvent local/state/national laws. How to calculate the number of days you can stay in Taiwan on a tourist visa? Tourist visas to Taiwan have an associated "maximum stay" of 30 days. For those visas, how are the days counted? Does the stay begin on the partial day that the traveler arrives or the first full day spent in the country? Does it end on the last full day spent in the country, or the actual day the traveler departs? After upgrading to 12.04 from 10.04, can't login to PHPMYADMIN How to install Broadcom wireless drivers offline? I have installed Ubuntu alongside Windows 8.1. But the wifi is not working in Ubuntu (perhaps the drivers are not present), which worked fine in windows. Also I cant connect with Ethernet since my laptop does not have an Ethernet port. So is there any way for me to connect to the internet in ubuntu? Edit: Output of the terminal command  lspci -knn | grep Net -A2:  vikram@vikram-Inspiron-11-3148:~$ lspci -knn | grep Net -A2 01:00.0 Network controller [0280]: Broadcom Corporation BCM43142 802.11b/g/n [14e4:4365] (rev 01)     Subsystem: Dell Device [1028:0018]     Kernel driver in use: bcma-pci-bridge vikram@vikram-Inspiron-11-3148:~$    I did what Pilot6 suggested. Here is the output:    vikram@vikram-Inspiron-11-3148:~$ sudo dpkg -i *.deb [sudo] password for vikram:  Selecting previously unselected package bcmwl-kernel-source. (Reading database ... 163804 files and directories currently installed.) Preparing to unpack bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb ... Unpacking bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) ... Selecting previously unselected package dkms. Preparing to unpack dkms_2.2.0.3-1.1ubuntu5.14.04_all.deb ... Unpacking dkms (2.2.0.3-1.1ubuntu5.14.04) ... Setting up dkms (2.2.0.3-1.1ubuntu5.14.04) ... Setting up bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) ... Loading new bcmwl-6.30.223.141+bdcom DKMS files... First Installation: checking all kernels... Building only for 3.16.0-30-generic Building for architecture x86_64 Building initial module for 3.16.0-30-generic ERROR (dkms apport): kernel package linux-headers-3.16.0-30-generic is not supported Error! Bad return status for module build on kernel: 3.16.0-30-generic (x86_64) Consult /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/make.log for more information. modprobe: FATAL: Module wl not found. update-initramfs: deferring update (trigger activated) Processing triggers for man-db (2.6.7.1-1ubuntu1) ... Processing triggers for initramfs-tools (0.103ubuntu4.2) ... update-initramfs: Generating /boot/initrd.img-3.16.0-30-generic vikram@vikram-Inspiron-11-3148:~$ For a continuous function $f$ show $\exists c\in (0,1)$ s.t $f(c)=3c^2$ Let $f: [0,1] \to \mathbb{R}$ be a continuous function such that $$\int_0^1 f (t) dt =1 .$$ Show that there exists a point $c \in (0,1)$ such that $ f(c)=3c^2$.  I tried using mean value theorem of integrals on $f (x)$, so $$\int_0^1 f (t) dt = f (c) =1,$$ but it should be $3 c^2$. What is going wrong?