For some reason, I can't add my strongest Pokémon to a friendly gym? Will someone tell me why this is happening for me?
So I defeated a Team Valor gym earlier today using my highest cp Pidgeot. It turned grey, so I went to claim it with that Pidgeot, except it wouldn't let me. What determines which pokemon you are allowed to place at a gym? Is it just those who have participated in a battle can't? Is there a time period for it? What about training at a friendly gym? Does this impact anything?
Limit of divided integrals Prove that: $$\lim\limits_{m\to \infty} \frac{\int\limits_0^{\pi/2}(\sin(x))^{2m} dx}{\int\limits_0^{\pi/2}(\sin(x))^{2m+1} dx} = 1$$  I had tried to get it from inequalities like $$(\sin(x))^{2m+1} \le (\sin(x))^{2m} \le (\sin(x))^{2m-1}$$ But I always hit a wall in that regard (I integrate the sin functions and from there keep on going but there it ends). Every natural number $n$ can be written as $n=s-t$ with $\omega(s)=\omega(t)$ Can we prove the following statement ?  Let $\omega(m)$ denote the number of all distinct prime factors of a positive integer $m$. Prove that every  natural  number $n$ can  be  written  as $n=s-t$, where $s$ and $t$ are positive integers with $\omega(s)=\omega(t)$, in other words, as the difference of two positive integers with the same number of distinct prime factors.   If $n=1$ , we can choose $\ s=3\ $ and $\ t=2$.  If $n$ is even , we can choose $\ s=2n\ $ and $\ t=n$. Return multiple values to a method caller Headers of \chapters* take the headers of their previous \chapter When using book.cls and using \chapter* after a \chapter, the header used in \chapter* is wrong. An example is pasted below.   Is there any known workaround for that? I have tried quite some tricks without success.   \documentclass[]{book}  \begin{document}  \chapter{First Chapter} aslkjdf  \chapter*{Unnumbered Chapter} The GNU General Public License is a free, copyleft license for software and other kinds of works.  The licenses for most software and other practical works are designed to take away your freedom to share and change the works. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change all versions of a program--to make sure it remains free software for all its users. We, the Free Software Foundation, use the GNU General Public License for most of our software; it applies also to any other work released this way by its authors. You can apply it to your programs, too.  When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for them if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs, and that you know you can do these things.  To protect your rights, we need to prevent others from denying you these rights or asking you to surrender the rights. Therefore, you have certain responsibilities if you distribute copies of the software, or if you modify it: responsibilities to respect the freedom of others.  For example, if you distribute copies of such a program, whether gratis or for a fee, you must pass on to the recipients the same freedoms that you received. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights.  Developers that use the GNU GPL protect your rights with two steps: (1) assert copyright on the software, and (2) offer you this License giving you legal permission to copy, distribute and/or modify it.  For the developers' and authors' protection, the GPL clearly explains that there is no warranty for this free software. For both users' and authors' sake, the GPL requires that modified versions be marked as changed, so that their problems will not be attributed erroneously to authors of previous versions.  Some devices are designed to deny users access to install or run modified versions of the software inside them, although the manufacturer can do so. This is fundamentally incompatible with the aim of protecting users' freedom to change the software. The systematic pattern of such abuse occurs in the area of products for individuals to use, which is precisely where it is most unacceptable. Therefore, we have designed this version of the GPL to prohibit the practice for those products. If such problems arise substantially in other domains, we stand ready to extend this provision to those domains in future versions of the GPL, as needed to protect the freedom of users.  Finally, every program is threatened constantly by software patents. States should not allow patents to restrict development and use of software on general-purpose computers, but in those that do, we wish to avoid the special danger that patents applied to a free program could make it effectively proprietary. To prevent this, the GPL assures that patents cannot be used to render the program non-free.  The precise terms and conditions for copying, distribution and modification follow.  \end{document} Why are the holodecks on Voyager in use if they have energy issues? I'm watching the first two seasons of Voyager and various episodes have commentary on having energy limitations -- but we constantly see crew using extremely complicated holodeck simulations. Why would they allow use of the holodeck if they need to conserve energy? Uniform integrability of a backward submartingale Let $\{\mathcal{F}_n\}_n$ be a decreasing sequence of sub-$\sigma$-fields of $\mathcal{F}$($\mathcal{F}_{n+1}\subset\mathcal{F}_n$) and let $\{X_n\}_n$ be a backward submartingale($E[|X_n|]&lt;\infty$, $X_n$ is $\mathcal{F}_n$ measurable and $E[X_n|\mathcal{F}_{n+1}]\geq X_{n+1}$).  If we know $l=\lim_{n\rightarrow\infty}E[X_n]&gt;-\infty$, how to prove that $\{X_n\}_n$ is uniformly integrable? Many thanks!  I have an idea, it is enough to show:    $\sup_nE[|X_n|]&lt;\infty$;  $\forall\epsilon&gt;0$, $\exists\delta&gt;0$ s.t. $\forall A\in\mathcal{F}$ such that $\mathbb{P}(A)&lt;\delta$, we have $\sup_nE[1_{A}|X_n|]&lt;\epsilon$.    For $|X_n|=2X_n^+-X_n$, we have  $$E[|X_n|]=2E[X_n^+]-E[X_n]\leq 2E[X_0^+]-l\leq 2E[|X_0|]-l$$  which implies $\sup_nE[|X_n|]&lt;\infty$.  Secondly, $\forall A\in\mathcal{F}$, we can suppose without loss of generality that $A\in\mathcal{F}_0$.  $$E[1_{A}|X_n|]=2E[[1_{A}X_n^+]-E[[1_{A}X_n]$$  Does someone have an idea for this term? Thanks a lot..... How to plot stacked bar plot inside table? I have following code in Latex. Which plots only one data series (data2). I would like to plot staked bar plot inside table for both data1 and data2 with different colours.  Any ideas.?  Many thanks.  \documentclass{article} \usepackage{booktabs} \usepackage{multirow} \usepackage{pgfplotstable} \usepackage{filecontents}  % The data \begin{filecontents}{data.txt} accession,data1,data2 C1,150708.4564,481.0388003 C2,49652.53112,275.2190163 C3,37379.1284,58.85806921 C4,34165.85698,26.06571636 C5,30856.19158,35.96802428 C6,15204.22768,26.71594573 \end{filecontents}   \pgfplotstableread[col sep=comma]{data.txt}\data  \newcommand{\errplot}{% \begin{tikzpicture}[trim axis right] \begin{axis}[y=-\baselineskip,   scale only axis,   width=5cm,   enlarge y limits={abs=0.5},   axis y line*=middle,   ytick=\empty,   axis x line*=bottom,   xbar,   bar width=1.5ex,   xmin=0,   visualization depends on=x \as \rawx,   nodes near coords,   every node near coord/.style={   anchor=east,   shift={(axis direction cs:-\rawx,0)}   }  ] %   \addplot [draw=black, fill=red]  table [x=data2,y expr=\coordindex]{\data}; \end{axis} \end{tikzpicture}% }  \begin{document}  % Get number of rows in datafile  \pgfplotstablegetrowsof{\data} \let\numberofrows=\pgfplotsretval  % Print the table \pgfplotstabletypeset[columns={accession,data1,data2},   % Booktabs rules   every head row/.style={before row=\toprule,after row=\midrule},   every last row/.style={after row=[3ex]\bottomrule},   % Set header name   columns/accession/.style={string type,column type=l,column name=accession},   columns/data1/.style={string type,column type=l,column name=data1},    columns/data2/.style={     column name={Data2},     assign cell content/.code={% use \multirow for Z column:    \ifnum\pgfplotstablerow=0    \pgfkeyssetvalue{/pgfplots/table/@cell content}    {\multirow{\numberofrows}{6.5cm}{\errplot}}%    \else    \pgfkeyssetvalue{/pgfplots/table/@cell content}{}%    \fi   }  }, ]{\data} \end{document} I want to clear a element from a vector using the erase method. But the problem here is that the element is not guaranteed to occur only once in the vector. It may be present multiple times and I need to clear all of them. My code is something like this:  void erase(std::vector&lt;int&gt;&amp; myNumbers_in, int number_in) {     std::vector&lt;int&gt;::iterator iter = myNumbers_in.begin();     std::vector&lt;int&gt;::iterator endIter = myNumbers_in.end();     for(; iter != endIter; ++iter)     {         if(*iter == number_in)         {             myNumbers_in.erase(iter);         }     } }  int main(int argc, char* argv[]) {     std::vector&lt;int&gt; myNmbers;     for(int i = 0; i &lt; 2; ++i)     {         myNmbers.push_back(i);         myNmbers.push_back(i);     }      erase(myNmbers, 1);      return 0; }   This code obviously crashes because I am changing the end of the vector while iterating through it. What is the best way to achieve this? I.e. is there any way to do this without iterating through the vector multiple times or creating one more copy of the vector? How to find all graph isomorphisms in FindGraphIsomorphism How to use "`" in the same way it is used on the SE websites? Grammatical number agreement in a complex phrase using singular "they" another question, I used the following phrase:     Your reader is [...], but they are a busy person.   I have two difficulties here:   In the first phrase, a reader, being singular noun, certainly implies is; In the second phrase, they, being a plural pronoun (regardless that it refers a single person), still requires are, but are implies the plural for busy persons which sounds awkward (a reader &lrarr; persons);   Obviously, if I used "...but he is a busy person", everything works fine, but I'm trying to use a gender-agnostic form.  What is the proper number agreement here? Is it possible to flash a custom ROM without a custom recovery image For an un-rooted device, almost all articles/forum posts I've read say that in order to flash a custom ROM you first need to flash (or boot) a custom recovery image like TWRP.   I'm not sure I understand why. If the bootloader is unlocked shouldn't it be possible to manually flash images that make up the custom ROM to the required partitions with fastboot flash &lt;partition&gt; [ &lt;xxxx.img&gt; ], and leave the stock recovery untouched.  I realize that this may be difficult and that there is no benefit in doing it this way, but I'm curious to know whether or not it is possible, and if not, why? What is the difference between .pem, .csr, .key and .crt and other such file extensions? I'm new to SSL / TLS and I want to work with the OpenSSL toolkit.  I don't know what .pem and .csr stands for?  I do know that .key is the private key and .crt is the public key. Integral of Sinc Function Squared Over The Real Line Note: I will expand this question with more specific points when I have my own internet connection and more time (we're moving in, so I'm at a friend's house).  This question is broad, involved, and to some degree subjective.  (I started out as a physics-only student, but eventually decided to add a mathematics major. I am greatly interested in mathematics; the typical curriculum required for physics students is not deep or thorough enough; mathematics is more general (that means work!); and it only requires a few more classes. Naturally, I enjoy  immensely.)  This question asks mainly of undergraduate-level study, but feel free to discuss graduate-level study if you like.  Please do not rush your answer or try to be comprehensive. I realize the StackOverflow model rewards quick answers, but I would rather wait for a thoughtful, thorough (on a point) answer than get a fast, cluttered one. (As you probably know,  produces clear, useful writing; and a properly-done comprehensive answer would take more than a reasonable amount of time and effort.) If you think an overview is necessary, that is fine.  For a question this large, I think the best thing to do is focus on a specific area in each answer.    Update: To Sklivvz, Cedric, Noldorin and everyone else: I had to run off before I could finish, but I wanted to say I knew I would regret this; I was cranky and not thinking clearly, mainly from not eating enough during the day. I am sorry for my sharp responses and for not waiting for my reaction to pass. I apologize.  Re: Curricula:   Please note that I am not asking about choosing your own curriculum in college or university. I did not explicitly say that, but several people believed that was my meaning. I will ask more specific questions later, but the main idea is how a physics student should study mathematics (on his or her own, but also by choosing courses if available) to be a competent mathematician with a view to studying physics.  I merely mentioned adding a mathematics major to illustrate my conclusion that physics student need a deeper mathematical grounding than they typically receive.   And now I have to run off again. Why do some games allow offline Steam achievements? I know of  where it is asked if you can get Steam achievements offline. The accepted answer to that was no.   But I do earn achievements for some Steam games while playing in offline mode!  For example, right now I am earning achievements for Cave Story+ as I play in offline mode. In other games I also earn achievements while playing in offline mode. Not just when I am disconnected but still in "online" mode as might be suggested in the linked question.  But what is really bugging me is that this does not happen with all games that have Steam achievements.  So, is allowing offline achievements something that Steam allows, the game devs allow, or is it something decided by a magical elf in the steam servers rolling some d20 dice around?  Edit:  As per request, I was able to attain visual evidence:    You should be able to see the achievement-get in action while in offline mode.  What is worth noting, (and something that I forgot to mention before) is that I only started earning achievements after I had went into online mode with the game installed. This is why I was able to earn this achievement with the ones after unlocked. I had started the game for the first time in offline mode, and did not notice that I was not earning achievements. When I had connected once, I did not have to start the game while online. I was able to earn achievements offline.  I also must state publicly: I do not play on easy. This was for testing purposes only people. It was for Science! leaflet geojson coordinate problem I just started to play with leflet/geojson a little. But my coordinates are not rendered properly and I have no clue what is going on.  My coordinates are: 52.23943, 4.97599. They work correct with the setView function.  var map = L.map('leaflet_map').setView([52.23943, 4.97599], 15);   But using a geojasonFeature they are, hmmm, 'projected', somewhere east of Somalia.  var geojsonFeature = {             "type": "Feature",             "properties": {             "name": "Coors Field",             "amenity": "Baseball Stadium",             "popupContent": "This is where the Rockies play!"             },             "geometry": {                 "type": "Point",                 "coordinates": [52.23943, 4.97599]             }         };         var myLayer = L.geoJson().addTo(map);         myLayer.addData(geojsonFeature).bindPopup("I am a gjson point.");   Anyone who knows what is happening here?  EDIT  Out of pure curiosity I changed the coordinates around [4.976143930893815,52.23925499011473] and the point appears at its correct location. A known bug!? Graph partition that span a third of edges Given a graph G is easy to see that we have a partition $V=V_1 \cup V_2$ so that  $$e(G[V_1])+e(G[V_2])\leq e(G)/2$$. How can we improve this result showing that we can choose $V_i$ such that $e(G[V_i])\leq e(G)/3$ for $i=1,2.$ What would the collision of two photons look like? I don't follow understand what this theorem is saying: "Every function $f: A \to{\cal P}(A)$ is not surjective."   Is this saying so for example let A = {1,2,3} then the power set of A is {},{1},{2},{3},{1,2},{1,3},{2,3},{1,2,3} Is this saying that there is no surjective function that takes every element in each of its power sets to atleast 1 element in A?  Is my understanding correct?