In an intro electronics class in high schools, we use 6v battery packs as a way of delivering safe power for experimenting.  However, the logistics of constantly getting fresh batteries, and our distaste for using so many batteries is leading to a search for an alternative.  We would like an inexpensive power supply that delivers small amounts of current (Ideally both 5V @ .2A, 12V @ .2A for example).  Building such a supply as a project would be possible for a class of the more advanced students.  So the question is to find a design.  However, it would have to be protected from short circuits, and ideally would indicate to the student (with an LED?) when they have made a mistake and short circuited.  I found one design for a DC circuit, though this one requires DC voltage in:   Obviously I could take the above design, add a transformer and full-wave rectifier, but that's both big and clunky as well as possibly not optimal.  In an earlier question, someone suggested a 5V wall wart.  I can find inexpensive 5V wall warts, but would ideally like 12V as well, and have no idea if a given wall wart is short-circuit protected and even if they are, I want an indicator SHOWING when there is a short-circuit.  I would like to take one and build in short circuit protection with an LED or alarm showing when a short happens, as well as a power indicator showing when it is on.  Can anyone suggest a design that we can build or buy?  Since we are talking dozens of units per class, the cost has to be kept low.
What is / how can I get a student-safe power supply for electronics projects?  I'm looking for a student-safe power supply for solder less breadboard.  I'm developing a course to teach electrical engineering to grade school students as an after-school program.  I'm wrapping up the first course and I've learned a lot, including that I need to find a safer power supply.  We're mostly using 9V batteries and connecting them to the breadboard via alligator clips.  After lots of searching, I'm realizing that I need to turn towards the expert community for guidance.  I hope that with the rise of the Makers  this question will become increasingingly relevant with time as more kids get into electronics.  Inextricably linked to this question is what is the minimum power source to use.  I've liked using 9V batteries since we can connect to them using alligator clips; but I worry that they are just a little too powerful.  I can imagine them somehow starting a fire with them.  My #1 priority is to keep the students safe.  Kids just have no concept that they can cause damage to themselves and property.  When I ask "where is that smoke coming from?" I'll get a gleeful response from the student that is seeing how many batteries he could hook together and short out.   I really need to limit the damage they can do.  I mainly don't want anyone electrocuted or anything to catch fire.  Kids will routinely attach LEDs backwards, leave them like that and then act surprised when they explode.   After safety, I want to protect the equipment.  Kids will hook up a LED backwards all the time.  After protection, I want to give the kids feedback as to what is going on.  A light that indicates power is on would be awesome.  A light or siren or circuit break that indicated a short would be awesome too.  Battery powered supplies are slightly preferred, just to keep upfront costs low and to avoid having to run outlets to each table.  Boundaries:   We are only using simple LEDs, BJT transistors, resistors and maybe a timer IC.    Similiar Questions:       References:  Course details are here:   We currently sometimes use  from the Squishy Circuits Store and/or a 9V battery with alligator clips.  Epilogue  I found it tougher than expected to find a suitable wall wart, so I'm listing what I finally found for future reference.  I'm about to test the following combination:         Epilogue 2  A year-plus in, I've decided to drop the in-line power switch since it wasn't obvious when it was 'on' vs. 'off'.  I'm instead relying upon the students to unplug the rat-tail from the supply, which is quick and easy.  Also, since I'm primarily using this for a squishy-dough project, I'm experimenting with with using two button batteries instead of a wall power.
What is the purpose of this? (function ($) { //function code here })(jQuery); Cant find the solution when sorting an array in JavaScript Moment generating function (MGF) of the ratio distribution $\displaystyle\frac{X}{Y}$ If we know the moment generating functions (MGFs) of the random variables $X$ and $Y$ to be $M_{X}(s)$ and $M_{Y}(s)$, respectively. The MGF of the sum $X+Y$ will $M_{X}(s) \cdot M_{Y}(s)$.  So what is the MGF of the ratio distribution $\displaystyle\frac{X}{Y}$? Unable to uninstall Wine apps I recently ran the iTunes 10 installer in Wine and everything seemed to go well. Then, when I tried to run it, it would constantly crash/and the appearance would be glitchy. After looking at the Wine website, it turns out that iTunes 10 has a 'garbage' rating of Wine compatability.  Now I'm trying to remove/uninstall iTunes, QuickTime, and the other applications that come default with installing iTunes (such as Bonjour, etc.). However, when I run the 'uninstaller' that wine provides for the programs, it instead executes what appears to actually be the original installer! I've tried deleting all the configuration/data files in my Wine's file-system, but to no avail.  Any help is greatly appreciated!  Edit1: After re-running the uninstall process and then rebooting, the program (iTunes 10) still remained installed. At a movie theater, the whimsical manager announces that a free ticket will be given to the first person in line whose birthday is the same as someone in line who has already bought a ticket.  You have the option of choosing any position in the line. Assuming that you don't know anyone else's birthday, and that birthdays are uniformly distributed throughout the year (365 days year), what position in line gives you the best chance of getting free ticket? Anyone have a good resource or provide a sample of a natural order sort in C# for an FileInfo array?  I am implementing the IComparer interface in my sorts. I see the following error while trying run the command shown below. I read somewhere that my /boot partition is low on disk space. How can I increase the size of the /boot partition so I can install more software? I have a 500GB hard disk, so there is enough space to play with.  sudo apt-get install libdvdread4  gzip: stdout: No space left on device                                                                                                                                                                                  E: mkinitramfs failure cpio 141 gzip 1                                                                                                                                                                                 update-initramfs: failed for /boot/initrd.img-3.2.0-33-generic with 1.                                                                                                                                                 run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1                                                                                                                                            Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-33-generic.postinst line 1010.                                                                                                        dpkg: error processing linux-image-3.2.0-33-generic (--configure):                                                                                                                                                      subprocess installed post-installation script returned error exit status 2                                                                                                                                            dpkg: dependency problems prevent configuration of linux-image-server:                                                                                                                                                 linux-image-server depends on linux-image-3.2.0-33-generic; however:                                                                                                                                                    Package linux-image-3.2.0-33-generic is not configured yet.    dpkg: error processing linux-image-server (--configure):     dependency problems - leaving unconfigured    dpkg: dependency problems prevent configuration of linux-server:     linux-server depends on linux-image-server (= 3.2.0.33.36); however:      Package linux-image-server is not configured yet.    dpkg: error processing linux-server (--configure):     dependency problems - leaving unconfigured    No apport report written because the error message indicates its a followup error from a   previous failure.                                                                                                           No apport report written because the error message indicates its a followup error from a previous failure.  Errors were encountered while processing:  linux-image-3.2.0-33-generic  linux-image-server  linux-server N: Ignoring file 'michael-gruz-canon-precise.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension N: Ignoring file 'michael-gruz-canon-precise.list.1' in directory '/etc/apt/sources.list.d/' as it has an invalid filename extension   Listed below is the output of du  Filesystem              1K-blocks      Used Available Use% Mounted on /dev/mapper/ubuntu-root 712660664 104095912 572363692  16% / udev                      3964792         4   3964788   1% /dev tmpfs                     1591012      1064   1589948   1% /run none                         5120         0      5120   0% /run/lock none                      3977528       684   3976844   1% /run/shm /dev/sda1                  233191    219821       929 100% /boot How to stop a script from running if it's not root (and echo "Not running as root! Exiting...") A closed form of $\int_0^1\frac{\ln\ln\left({1}/{x}\right)}{x^2-x+1}\mathrm dx$ This integral has been bugging me since yesterday:     $$\int_0^1\frac{\ln\ln\left({1}/{x}\right)}{x^2-x+1}\mathrm dx$$   I've tried substitution $y={1}/{x}$ and $e^y={1}/{x}$, but those didn't help much. Wolfram Alpha gives me result: $-0.67172$. Could anyone here please help me to obtain the closed form of the integral preferably (if possible) with elementary ways (high school methods)? Any help would be greatly appreciated. Thank you. I'm not able to get access to $wpdb Difference between "did save" and "saved" What is the difference between the two following sentences?     1) Where did you save that file?   And      2) Where you saved that file ? How to exceed left margin with longtable I'm trying to make a longtable that is wider than the textwidth at a certain moment. I've tried different things always ending up with a different problem:  First possibility: If I use the adjustwidth environment the longtabu does not align correctly. The left margin stays fixed and the right margin gets out of the page. This in contrast, if I do the exact same thing to make a tabu (instead of longtabu), it works perfectly. I think using the adjustwidth is the best way to go, but I can't manage to get it working.  Second possibility: I've found a solution using the fullwidth package. That package does the trick on small longtables, but freezes when I'm trying to do it on my big longtable. The command \setlength\LTleft{-2cm} didn't work as well.  The final option I tried was to use geometry. But that changes the margin of the whole page thus making a page break which I'm not interested in. The code I used for this was  \newgeometry{left=1.2cm} \begin{longtable} long table stuff \end{longtable} \restoregeometry   Here's an example of what I want contra what I get  \documentclass[a4paper]{article} \usepackage{longtable} \usepackage{chngpage} \usepackage{lipsum} \usepackage{tabu}  \begin{document} \section{This is the original textwidth.} \lipsum[1]  \section{This is the width I need for my longtabu} \begin{adjustwidth}{-1in}{-1in} \begin{tabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{tabu} \end{adjustwidth}  \section{This is what happens} \begin{adjustwidth}{-1in}{-1in} \begin{longtabu} to \linewidth {*{13}{|X[l]} |} 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ 01 &amp; 02 &amp; 03 &amp; 04 &amp; 05 &amp; 06 &amp; 07 &amp; 08 &amp; 09 &amp; 10 &amp; 11 &amp; 12 &amp; 13 \\ \end{longtabu} \end{adjustwidth}  \end{document} How to sort a character vector where elements contain letters and numbers in R? Where can I find some guidance on index strategies? Basically, I want to turn a continuous "1" into a short "1" pulse then "0". I'm new to logic gates, apologies if it's too obvious. An example:    O  O?   There is a triple letter tile to the right of the bottom O, indicated with a ?.  If I place an X on it, making the words OX (vertical) and OX (horizontal), do I score 50 points (scoring the tile twice) or 34 (scoring it once)? How can I compute the distance between two coordinates in TikZ? Given two points (defined, for instance using nodes), I want to compute the distance between them.   Is there some build in functionality in tikz to do this? If not, how can it be done using the mathematical engine?   The application I have in mind is to draw an circular arc centered at (a) and passing through some second point (b), where only (a) and (b) are known. Calling PHP functions within HEREDOC strings In PHP, the HEREDOC string declarations are really useful for outputting a block of html.  You can have it parse in variables just by prefixing them with $, but for more complicated syntax (like $var[2][3]), you have to put your expression inside {} braces.  In PHP 5, it is possible to actually make function calls within {} braces inside a HEREDOC string, but you have to go through a bit of work.  The function name itself has to be stored in a variable, and you have to call it like it is a dynamically-named function.  For example:  $fn = 'testfunction'; function testfunction() { return 'ok'; } $string = &lt;&lt;&lt; heredoc plain text and now a function: {$fn()} heredoc;   As you can see, this is a bit more messy than just:  $string = &lt;&lt;&lt; heredoc plain text and now a function: {testfunction()} heredoc;   There are other ways besides the first code example, such as breaking out of the HEREDOC to call the function, or reversing the issue and doing something like:  ?&gt; &lt;!-- directly output html and only breaking into php for the function --&gt; plain text and now a function: &lt;?PHP print testfunction(); ?&gt;   The latter has the disadvantage that the output is directly put into the output stream (unless I'm using output buffering), which might not be what I want.  So, the essence of my question is: is there a more elegant way to approach this?  Edit based on responses: It certainly does seem like some kind of template engine would make my life much easier, but it would require me basically invert my usual PHP style.  Not that that's a bad thing, but it explains my inertia..  I'm up for figuring out ways to make life easier though, so I'm looking into templates now. I recently found out that the expectation of a random variable $X$ in a probability space $(\Omega, \mathcal F,  \mathbb P)$, $\mathbb E(X)$, is just the term used in probability theory for the measure of the function $X$; i.e.:  $$ \mathbb E(X)=\mathbb P(X) $$  or, for a real-valued random variable $X:\Omega\to\mathbb R$:  $$ \mathbb E(X)=\int_\Omega X(x)\mathbb P(dx) $$  The thing is, I am also familiar with the definition of the expectation of a random variable $X:\Omega\to\mathbb R$ with probability distribution function $f$ to be:  $$ \mathbb E (X)=\int_\mathbb R xf(x)dx $$  Here, the integral is with respect to the Lebesgue measure on $\mathbb R$.    We can define the function $f$ in the following way: we have $F(x)=\int_\mathbb R f(x)dx$, where $F(x)=\mathbb P(X^{-1}((-\infty,x]))$.    I can't see any way to show that these two definitions are equal to one another.  The only transformation between integrals with respect to different measures that I know is that $\mu(f^{-1}(g))=\mu(g\circ f)$, which gives that $\mathbb E(g)=\mu_X(g)$, where $\mu_X$ is the image measure $\mathbb P\circ X^{-1}$, but that doesn't seem to help.  Why can we write $\mathbb E(X)=\int_\mathbb R xf(x)dx$?  Why are these two definitions consistent? I'm completing a problem set, one problem for which I literally have no idea what to do on. The graders would prefer to have a physical copy of the problem so I thought it best to include the ¯\_(ツ)_/¯ emoji as my answer, instead of something like "Dunno" or "No idea."  Option #1 is to include an image.  Beyond that I actually don't understand how this emoji works. The middle character is Japanese kana "tsu" and proves problematic - TeX wants it in math mode then renders "?" when it is.