Function Returns undefined object
How do I return the response from an asynchronous call?
I'm inserting an image with a simple:  \includegraphics[height=5cm]{filename.png}   This results in an image that maintains the aspect ratio, and so gives me something like 6cm width. I only really want the left side of the image though, and would like to crop it to 50% width. Is it possible to do this?  If possible, I'd like to do this in a portable way (i.e. something that other authors of this document won't have to install packages for, and something that works with a reasonably old version of pdflatex - our computers at work are in sore need of an upgrade). When I signed up I received a welcome message specifically indicating I should take the tour to earn my first badge:     Clicking the message takes me directly to the .  However, as   , the 'Informed' badge is not active here on meta.  Shouldn't the wording of the welcome message be altered if a user signs up on a site which does not use this badge? I just asked my first question on stackoverflow and I'm really impressed that my question seems to be answered sufficiently already! See:    The issue I have is that the last two answers combined would provide the most complete answer. What's the proper way to go about combining them, marking the question answered, and giving credit where credit is due?  Thanks big time guys for saving us all from experts exchange hell!  Edit: Wow, 5 responses in 5 minutes. I think what makes the most sense is that I create my own answer out of the two. I don't think the second part of my question was answered though.  What is the proper way to give credit to the 2 answers that I'm combining? Is an upvote for each sufficient? This question is a possibly harder version of: .  Question.  Let $f,g :\mathbb R\to\mathbb R$, such that \begin{align} f(x-y)=f(x)\, g(y)-f(y)\, g(x), \tag{1}\\ g(x-y)=g(x)\, g(y)+f(x)\, f(y), \tag{2} \end{align} for all $x,y \in \mathbb{R} $. If $g$ is continuous at $x=0$ and not identically zero, then there exists an $\alpha\in\mathbb R$, such  $$ f(x)=\sin \alpha x\quad\text{and}\quad g(x)=\cos \alpha x. $$ Is there a pair of discontinuous $f$ and $g$ satisfying $(1)$ and $(2)$?  Update. If $\ell :\mathbb R\to\mathbb R$ is a linear functional over $\mathbb Q$ (i.e., $\ell(qx+ry)=q\ell(x)+r\ell(y)$, for all $x,y\in\mathbb R$ and $q,r\in\mathbb Q$), then $$ \sin\big(\ell(x)\big), \quad \cos\big(\ell(x)\big), $$ satisfy $(1)$ and $(2)$. Discontinuous such functionals do exist, and they are obtainable using Zorn's Lemma (equivalently the Axiom of Choice.) This takes care of the second question. Does taking levels in a prestige class cause XP Penalty? How to delay a program such as cairo-dock (No openGL) or Firefox?  Sometimes programs crash when started with other startup apps. I want programs to start 10 seconds late to avoid a crash. How to find out if my system is i386 or x86_64 before installing Ubuntu? Etymology for “Mc‑” and “O’‑” prefix in surnames There is clearly a prefix in names like McDonald, McChrystal, O’Brian, O’Neal.  What does this Mc- and O- prefix signify? It looks like Donald, Chrystal, Brian, Neal are perfectly fine names on their own, so why is there a prefix before it? Mavericks unusually high RAM usage I thought Mavericks was suppose to utilize RAM memory better, thus run smoother.  Running ML on Mac mini 2012, with 16GB RAM...always running smoothly even with over a dozen apps running.  Now, after installing Mavericks, my Mac is SLOW, eating up RAM like crazy! Looking over usage, of the 16GB of installed memory...on average it uses 10-14 GB RAM when barely running a few apps!!!   There is this kernel_task that is always running with over 1GB of RAM and most apps are not taking that much RAM, so what is using up all my RAM?! File cache? It shows very high in that new description, with about 1/3 of my total RAM Nested roots sequence, how to prove it's monotone and bounded? Let $a\ge1$ and define the sequence $(x_n)$ recursively by: $$x_1 = \sqrt{a}$$ $$x_{n+1}= \sqrt{a+x_n}$$  Here's what I did:  Plugging in some values makes it seem as if the sequence is increasing. I first solve the equation $t=\sqrt{a+t}$, equivalently $t^2 -t -a =0$, to get an idea what's going on. The roots are $$t_{1,2}= \frac{1 \pm \sqrt{1+4a} }{2}.$$ Therefore, between the roots, that is for $$t\in \left( \frac{1 - \sqrt{1+4a} }{2}, \frac{1 + \sqrt{1+4a} }{2}\right)$$  we have $t^2-t-a \le 0 \iff t \le \sqrt{a+t}$. Here's my attempt at showing inductively that $$\forall n\in \mathbb{N}, \ x_n \le \frac{1 + \sqrt{1+4a} }{2}$$  For $n=1$, the statement is true (simple arithmetic). Suppose it's true for $n$. Consider  $$x_{n+1}= \sqrt{a+x_n}\le \sqrt{a+\frac{1 + \sqrt{1+4a} }{2}}=\frac{1 + \sqrt{1+4a} }{2},$$  because $\frac{1 + \sqrt{1+4a} }{2}$ satisfies $x=\sqrt{x+a}$.  So this establishes the sequence $(x_n)$ is bounded. Now, by induction again, I try to show it's monotonically increasing. The base case $x_1\le x_2$ is obvious. Assume (strong induction) $x_{n-1}\le x_n$ for all $n&gt;1$. But since we have $$x_1\le x_n \le \frac{1 + \sqrt{1+4a} }{2}, $$   then $x_n$ lies in the appropriate interval, so $x_n \le \sqrt{a+x_n}=x_{n+1}.$  Is this proof correct? Can the condition on $a$ be relaxed to $a&gt;0$? Maybe even small negative $a$? And could someone provide me with another proof of convergence of $x_n$? I absolutely hate this one! Given that $xyz=1$, prove that $\frac{x}{1+x^4}+\frac{y}{1+y^4}+\frac{z}{1+z^4}\le \frac{3}{2}$ Given that $xyz=1$, prove that $$\frac{x}{1+x^4}+\frac{y}{1+y^4}+\frac{z}{1+z^4}\le\frac{3}{2}.$$  I proved this with , but: is there a better/more elegant way? Does a Warlock receive the benefit of their familiar's Magic Resistance trait? The Warlock has access to special forms for their find familiar spell through the Pact of the Chain feature. I'm wondering if these special forms, the Quasit, Imp, and Pseudodragon in particular, allow the player character to share the familiar's Magic Resistance feature. In the Monster Manual each of these creatures has a sidebar that states that the familiar shares its Magic Resistance feature with the companion they are bonded to, but the PHB doesn't mention this in any of the creatures' stat blocks.   For example, in the Variant: Pseudodragon Familiar sidebar on page 254 of the MM it says:     "While the pseudodragon is within 10 feet of its companion,        the companion shares the pseudodragon's Magic Resistance trait."   This feature seems clear in the MM but I'm led to believe that it wasn't intended for Player Characters since mention of it is absent from the stat blocks in Appendix D of the PHB (pages 307-309).  Would a 3rd level warlock who chose one of these familiar forms through the Pact of the Chain feature benefit from advantage from saving throws from spells and other magical effects due to these special forms, or was this feature only meant for powerful NPCs and enemy spellcasters who had made this link with these familiars themselves? What is the source of help? help  displays information about builtin commands. What is the source of help? Does it maintain a database for builtin commands, or does it read some files of each builtin commands (similar to the manpage of each utilities)?  Sometimes I find its information seems to expand that by --help  $ cd --help bash: cd: --: invalid option cd: usage: cd [-L|[-P [-e]]] [dir]  $ help cd cd: cd [-L|[-P [-e]]] [dir]     Change the shell working directory.      Change the current directory to DIR.  The default DIR is the value of the     HOME shell variable.      The variable CDPATH defines the search path for the directory containing     DIR.  Alternative directory names in CDPATH are separated by a colon (:).     A null directory name is the same as the current directory.  If DIR begins     with a slash (/), then CDPATH is not used.      If the directory is not found, and the shell option `cdable_vars' is set,     the word is assumed to be  a variable name.  If that variable has a value,     its value is used for DIR.      Options:         -L  force symbolic links to be followed         -P  use the physical directory structure without following symbolic         links         -e  if the -P option is supplied, and the current working directory         cannot be determined successfully, exit with a non-zero status      The default is to follow symbolic links, as if `-L' were specified.      Exit Status:     Returns 0 if the directory is changed, and if $PWD is set successfully when     -P is used; non-zero otherwise.   I thought help extract the help part of the executable, but for a  python script , it isn't  $ help ./pdf-merge.py bash: help: no help topics match `./pdf-merge.py'.  Try `help help' or `man -k ./pdf-merge.py' or `info ./pdf-merge.py'.  $ ./pdf-merge.py --help usage: pdf-merge.py [-h] [-v] [--ask] [--output OUTPUT] [--title TITLE]                     [--author AUTHOR] [--keyword KEYWORD] [--pdftk PDFTK]                     [--gs GS] [--pdfmarks PDFMARKS] [--unicode]                     PDF [PDF ...]  Merge PDFs preserving bookmarks. Thanks to Larry Cai for suggesting that Unicode be supported and for discussion about the `--pdfmarks` option.  positional arguments:   PDF                  an input PDF to merge  optional arguments:   -h, --help           show this help message and exit   -v, --version        show program's version number and exit   --ask                pause for manual pdfmark tweaking   --output OUTPUT      name of the output PDF   --title TITLE        title of output PDF   --author AUTHOR      author of output PDF   --keyword KEYWORD    keywords for the output PDF   --pdftk PDFTK        path to the pdftk executable   --gs GS              path to the gs (Ghostscript) executable   --pdfmarks PDFMARKS  path to pdfmarks file. If not given, a temporary file                        is used. If given and the file is missing, execution                        will stop after the file is created (before the                        Ghostscript run). If given and the file exists, no                        attempt will be make to use pdftk to generate the mark                        file (I assume your input file is what you want).   --unicode            instead of merging PDFs, convert PDF-formatted unicode                        strings. For example `--unicode '&lt;FEFF03B103B203B3&gt;'                        \u03b1\u03b2\u03b3` How do you iterate over each file in a directory with a .bat or .cmd file?  For simplicity please provide an answer that just echoes the filename or file path. Is this study stating red algae reduces cold virus by 92% believable? I was using this spray meant to hasten recovery from the common cold. , sponsored by the pharmaceutical company that produces the spray, stated it reduced virus by 92%, and so shortens the duration of the common cold.  Meanwhile a doctor told me that these kinds of things don't work.  Does someone have some perspective on this? Is this a believable study? Was it well designed, and has it been duplicated?   If so, why wouldn't the pharmaceutical produced a certified and expensive drug instead of a no-prescription drug? How to show the solution of $\dot{x} = Ax $ is an invariant subspace? Consider the linear dynamical system $\dot{x} = Ax $ in $V$ a finite dimensional vector space.  The definition of an invariant subspace $U$ is as follows:  For all $x_0 \in U$, (initial condition), the solution $x(t)$ with initial condition $x(0)=x_0$ lies in $U$, i.e. $x(t) \in U$ for all $t \in \mathbb{R}$. Intuitively, it means if we start in a subspace we never leave that subspace.  Prove that a subspace $U \subset V$ is an invariant subspace if and only if $AU \subset U$. Cannot access any files on Samsung Tab 4 7" I came across a combinatorial proof of the Fermat's Little Theorem which states that    If $p$ is a prime number then the number ($a$$p$-$a$) is a multiple of $p$ for any natural number $a$.  Let me write down the proof.    PROOF  We have pearls of $a$ colours . From these we make necklaces of exactly $p$ pearls .   First,we make a string of pearls . There are $a$$p$ different strings.If we throw away  the $a$ one one -coloured pearls  ($a$$p$-$a$) strings will remain.We connect the ends of each string to get necklaces.We find that two strings that differ only by a cyclic permutation of its pearls result in indistinguishable necklaces.But there are $p$ cyclic permutations of $p$ pearls on a string . Hence the number of distinct necklaces is    [($a$$p$-$a$)/$p$].  Because of this interpretation this is an integer.Thus ($a$$p$-$a$) is a multiple of $p$ for any natural number $a$. [HENCE PROVED]     MY CONFUSIONS    What is the use of the fact that $p$ is a prime in this proof?  If this proof is true then why is this not true for every positve integer $p$? IllegalArgumentException or NullPointerException for a null parameter? I have a simple setter method for a property and null is not appropriate for this particular property. I have always been torn in this situation: should I throw an , or a ? From the javadocs, both seem appropriate. Is there some kind of an understood standard?  Or is this just one of those things that you should do whatever you prefer and both are really correct? How does one go about proving that the function $x \sin x$ is not uniformly continuous on the set of real numbers ?  Any method that uses the sequential criterion for discontinuity would be preferred.  Thanks in advance !