Connecting a 12V DC power adapter to Arduino
Choosing power supply, how to get the voltage and current ratings?
What is difference between int.class and Integer.TYPE in java? How do I share variables between two functions? So...here is part of my code for a plugin.  I'm a newb of sorts so be kind.  I've read up on global variables but I can't seem to get it to work and I've read you shouldn't use them anyway.  So what would be the best way to write the code below without having to re-declare the variables for each function?  Here is the  if necessary.  // Display the product badge on the shop page  add_action( 'woocommerce_after_shop_loop_item_title', 'wc_simple_product_badge_display_shop', 30 ); function wc_simple_product_badge_display_shop() {     $title = get_post_meta( get_the_ID(), '_wc_simple_product_badge_title', true ); // badge title     $class = get_post_meta( get_the_ID(), '_wc_simple_product_badge_class', true ); // badge class     $duration = get_post_meta( get_the_ID(), '_wc_simple_product_badge_duration', true ); // badge duration     $postdate = get_the_time( 'Y-m-d' ); // post date     $postdatestamp = strtotime( $postdate ); // post date in unix timestamp     $difference = round ((time() - $postdatestamp) / (24*60*60));  // difference in days between now and product's post date      if ( !empty( $title ) &amp;&amp; empty( $duration ) || !empty( $title ) &amp;&amp; $difference &lt;= $duration ){ // Check to see if there is a title and the product is still within the duration timeframe if specified         $class = !empty( $class ) ? $class : '';         echo '&lt;span class="wc_simple_product_badge ' . $class . '"&gt;' . $title . '&lt;/span&gt;';     } }  // Display the product badge on the single page  add_filter( 'woocommerce_single_product_image_html', 'wc_simple_product_badge_display_single' );     function wc_simple_product_badge_display_single( $img_html ) {     $title = get_post_meta( get_the_ID(), '_wc_simple_product_badge_title', true ); // badge title     $class = get_post_meta( get_the_ID(), '_wc_simple_product_badge_class', true ); // badge class     $duration = get_post_meta( get_the_ID(), '_wc_simple_product_badge_duration', true ); // badge duration     $single_opt = get_post_meta( get_the_ID(), '_wc_simple_product_badge_single_page_option', true ); // badge on single page     $postdate = get_the_time( 'Y-m-d' ); // post date     $postdatestamp = strtotime( $postdate ); // post date in unix timestamp     $difference = round ((time() - $postdatestamp) / (24*60*60));  // difference in days between now and product's post date      if ( !empty( $title ) &amp;&amp; empty( $duration ) &amp;&amp; $single_opt === 'yes' || !empty( $title ) &amp;&amp; $difference &lt;= $duration &amp;&amp; $single_opt === 'yes' ){ // Check to see if there is a title and the product is still within the duration timeframe ()if specified) and the checkbox is checked to show on single page view         $class = !empty( $class ) ? $class : '';         echo '&lt;span class="wc_simple_product_badge ' . $class . '"&gt;' . $title . '&lt;/span&gt;';         return $img_html; }      elseif ( $single_opt === 'no' ) { // Check to see if the checkbox is unchecked to show on single page view         return $img_html;     }  } The inequality is homogeneous, but I am not sure if that helps. Also, I was thinking about considering a concave function and apply Jensen or Karamata on LHS. How to use induction to prove the product rule for higher derivatives? How do I show through mathematical induction that   \begin{equation} \frac{d^n}{dx^n}[f(x)\cdot g(x)] = \sum_{k = 0}^{n} \binom{n}{k} \frac{d^k}{dx^k} [f(x)] \cdot \frac{d^{n-k}}{dx^{n-k}} [g(x)] \end{equation}  which is the product rule for higher derivatives? $M$ = mass of the Sun  $m$ = mass of the Earth  $r$ = distance between the Earth and the Sun  The sun is converting mass into energy by nuclear fusion.   $$F = \frac{GMm}{r^2} = \frac{mv^2}{r} \rightarrow r = \frac{GM}{v^2}$$  $$\Delta E = \Delta M c^2 = (M_{t} - M_{t+\Delta t}) c^2 \rightarrow \Delta M = \Delta E / c^2$$  $$\rightarrow \frac{\Delta r}{\Delta t} = \frac{G}{v^2 c^2}.\frac{\Delta E}{\Delta t}$$  Sun radiates $3.9 × 10^{26}~\mathrm W = \Delta E/\Delta t$  Velocity of the earth $v = 29.8 \mathrm{km/s}$  There is nothing that is stopping the earth from moving with the same velocity so for centripetal force to balance gravitational force $r$ must change.   Is $r$ increasing? ($\Delta r/ \Delta t = 3.26070717 × 10^{-10} \mathrm{m/s} $) Includegraphics maximum width With \includegraphics I can give the width of the resulting image (which would be scaled).   How can I give a maximum width of the image? That is, if the original is smaller than X, I'd like to keep the smaller image, if the image is larger than X, then the image width should be X.  Using pdflatex/graphicx. I was wondering if there is any way to escape a CDATA end token (]]&gt;) within a CDATA section in an xml document. Or, more generally, if there is some escape sequence for using within a CDATA (but if it exists, I guess it'd probably only make sense to escape begin or end tokens, anyway).   Basically, can you have a begin or end token embedded in a CDATA and tell the parser not to interpret it but to treat it as just another character sequence.  Probably, you should just refactor your xml structure or your code if you find yourself trying to do that, but even though I've been working with xml on a daily basis for the last 3 years or so and I have never had this problem, I was wondering if it was possible. Just out of curiosity.  Edit:  Other than using html encoding... Does the 14 day self-isolation period in the UK end if a travel-corridor starts during the 14-day self-isolation period? Help me understand Bayesian prior and posterior distributions In a group of students, there are 2 out of 18 that are left-handed. Find the posterior distribution of left-handed students in the population assuming uninformative prior. Summarize the results. According to the literature 5-20% of people are left-handed. Take this information into account in your prior and calculate new posterior.    I know the beta distribution should be used here. First, with $\alpha$ and $\beta$ values as 1? The equation I found in the material for posterior is   $$\pi(r \vert Y ) \propto r^{(Y +−1)} \times (1 − r)^{(N−Y +−1)} \\ $$  $Y=2$, $N=18$  Why is that $r$ in the equation? ($r$ denoting the proportion of left-handed people). It is unknown, so how can it be in this equation? To me it seems ridiculous to calculate $r$ given $Y$ and use that $r$ in the equation giving $r$. Well, with the sample $r=2/18$ the result was $0,0019$. The $f$ should I deduce from that?  The equation giving an expected value of $R$ given known $Y$ and $N$ worked better and gave me $0,15$ which sounds about right. The equation being $E(r | X, N, α, β) = (α + X)/(α + β + N)$ with value $1$ assigned to $α$ and $β$. What values should I give $α$ and $β$ to take into account prior information?  Some tips would be much appreciated. A general lecture on prior and posterior distributions wouldn't hurt either (I have vague understanding what they are but only vague) Also bear in mind I'm not very advanced statistician (actually I'm a political scientist by my main trade) so advanced mathematics will probably fly over my head. I want to use a very long USB cable to place a webcam in a different room. The maximum length that I found was five meters.   What is the maximum length of a USB cable? What is the maximum length achievable when using USB extension cables? I have this tex: \(\mu_{A}\left(x\right)\in \[0,1  \right\]\)  The issue here is that [ and ] are not showing around 0,1, why is that?  Thanks. A guide to moderating chat Chat is an offshoot of the main site, and using it is  during their time here.  Chat is our place for:        Real-time collaboration   Meeting fellow members of the community   Less structured, casual (but still roughly on-topic) conversation      Our chat system exists to serve the main site; users of each site can gather and commune with each other.  When in chat, we expect all users to abide by our  policy, which means that we expect community members to treat each other with respect.    While it is a place where the community can go to interact on a more casual level, chat still needs to be moderated by the community and there are tools in place to help with the moderation. This raises a few questions, that are addressed here: How do I put text over symbols? How do I contact other users? Simplest or nicest proof that $1+x \le e^x$ Python rounding error with float numbers Word for giving animal characteristics (esp. physical ones) to humans I am writing a paper about Art Spiegelman's Maus, specifically the metaphor that Spiegelman creates by depicting his obviously quite human characters with the heads of various animals, or a couple times animal masks. The metaphor is used at times to bestialize/animalize the acts of the Nazis and, in some cases, to show the arbitrary nature of the classes/groups/divisions they and others applied to human beings.  I considered "chremamorphism," but this describes the attribution of the characteristics of an object to, or the objectification of, a human. I also considered "animalize" and "bestialize," but those describe some of the effects that can be produced by Spiegelman's metaphor, not the metaphor itself - in many scenes in the book, the characters are extremely human, and I think that the negative or degrading connotations of these words makes them inappropriate for this use. Nor do "anthropomorphism" or "personification" fit, because Spiegelman is not applying human characteristics to animals but the other way around. None of the words that I can think of quite fit.  What is a word that accurately describes Art Spiegelman's depiction of obviously human characters as having animal body parts or wearing animal masks in the comic book Maus? Show that every connected graph with $n$ vertices has at least $n − 1$ edges.  How can I prove this?  Conceptually, I understand that the following graph has 3 vertices, and two edges:  a-----b-----c  with $a$, $b$ and $c$ being vertices, and $\{a,b\}$, $\{b,c\}$ being edges.  Is there some way to prove this logically?  --UPDATE--  Does this look correct?  Any advice on how to improve this proof would be appreciated.  Thank you. I'm having trouble getting basic APA bibliographies to work. The same thing works with nejm style, but changing the style to apa gives errors:  ! Undefined control sequence. &lt;argument&gt; \mkbibdateapalongextra  {year}{month}{day}\iffieldundef {endyear}{...  Package biblatex Warning: Macro 'name:apa:last-first' undefined. (biblatex)                Using \newbibmacro.  Package biblatex Warning: Macro 'name:apa:first-last' undefined. (biblatex)                Using \newbibmacro.   I'm using texlive 2012, as you can see I'm using biber, yes, I reran biber, and also tried delting the .bbl file and rerunning tools. My source markup is:  \documentclass[12pt]{article}  \usepackage[hidelinks]{hyperref} \usepackage[backend=biber,style=apa]{biblatex}  \addbibresource{BibResource.bib}  \begin{document}  test\parencite{ormrod2004human}  \clearpage  \printbibliography  \end{document} How can I automatically name files being exported based on input parameters