I have a global variable that I am passing into a function. The function should feed/generate some values to that variable. So far, I tried: var final_transcript = &quot;&quot;; function test1(x) {   recognition.onresult = function(event) {     x += event.results.transcript;   } }  StartButton.addEventListener(&quot;click&quot;, () =&gt; {   test1(final_transcript); })  EndButton.addEventListener(&quot;click&quot;, () =&gt; {   console.log(final_transcript); })  In this case, assuming StartButton is clicked before EndButton. So the StartButton initiate the function that feeds in strings that add into the global variable final_transcript. when EndButton is clicked, the variable final_transcript should contain all the strings fed in. But the value of final_transcript is still empty according to the console log. EDIT: recognition.onresult transcript the user's voice into text. It is a real-time event. The reason why I am doing this is that the function test1 cannot detect an end event. Only EndButton.addEventListener does, and I cannot add it in test1 function.
The primitive types (number, string, etc.) are passed by value, but objects are unknown, because they can be both passed-by-value (in case we consider that a variable holding an object is in fact a reference to the object) and passed-by-reference (when we consider that the variable to the object holds the object itself).  Although it doesn't really matter at the end, I want to know what is the correct way to present the arguments passing conventions. Is there an excerpt from JavaScript specification, which defines what should be the semantics regarding this?
Uncaught rerender threw an error in 'markup://aura:expression' [info.$component$.$isValid$ is not a function] i'm trying to set a list of string to an aura:attribute and i get this error:     Uncaught rerender threw an error in 'markup://aura:expression'   [info.$component$.$isValid$ is not a function]   that's the attribute:  &lt;aura:attribute name="parents" type="String[]"/&gt;   i call this function in js:  test: function(component){     var action = component.get("c.test");         //Set up the callback         var self = this;         action.setCallback(this, function(actionResult) {                   debugger;             component.set("v.parents", actionResult.getReturnValue());         });                 $A.enqueueAction(action);    }   and thats the function:  @AuraEnabled public static List&lt;String&gt; test(){     String[] a = new String[]{};     a.add('1');     a.add('2');     return a; }   please help Thanks Framing a question whose answer is an ordinal number I am the third daughter (or son) of my parents.   OR      How should a question that is answered with the above sentences be framed? Singular or plural "set"? I'm having some issues with a sentence that is part of the purpose in a report that I'm writing. I'm not sure if the word "communicate" (in bold) should be singular or plural.  The applications in the "set" will communicate with each other, not with other "sets".     The purpose of this report is to develop a sample set of applications   that communicates between services on the internet, mobile devices   and a central processing unit in a motor vehicle. How long can I store a food in the pantry, refrigerator, or freezer? How does a battery ( primary cell ) work? I'm having an hard time understanding primary cells. There are plenty of videos and explanations about the reactions that happen inside the battery, but you must have a strong background in chemistry to really understand them. Instead, I would love to have a description that abstracts from the chemicals details, and still manages to explain its basic working princeples! I would like it to address the following questions/doubts:     Electrons flow form higher potential to lower potential so, when you buy a  battery, is an electric field already there, before connecting it to a wire? (I presume yes) So,How is this field created? Are the electrons at the top and the protons at  the bottom, or just electrons at the top and the bottom is neutral? How are electrons kept together in the same place before connecting the battery  to the wire? What does prevent them to flow inside the battery? How does the battery pump up the electrons? and at which rate? What makes it burn out? and after many cycles does it burn out?       I know there are a lot of questions but my mind is exploding. I don't expect everything to be abstracted from the chemicals but as long as you can through analogies, or intuitive principles, i'd love that. Anyway the main intent of the answer must be addressing the doubts listed. What is causing different spacing between a header and content on one page only? I have found that for only one page (so far) the spacing between the header and content is different from the spacing on all the other pages. You can see this behavior in the images below (from pages 2 and 3 of the document):     My .tex file contents are shown below.  \documentclass[a4paper]{report} \usepackage{fullpage} \usepackage{lipsum} \usepackage{fancyhdr} \pagestyle{fancy} \setlength{\headsep}{0.5cm}  \begin{document} \renewcommand{\headrulewidth}{0.4pt} \renewcommand{\chaptermark}[1]{\markboth{\thechapter. #1}{}} \fancyhead[L]{\bfseries \leftmark} \fancyhead[R]{\bfseries \rightmark}  \chapter{Version Control} \lipsum \lipsum \lipsum \lipsum  \end{document} Evaluating even binomial coefficients Can someone give me a hint how to evaluate $$ \binom{n}{0}+\binom{n}{2}+\cdots+\binom{n}{o(n)},$$ where $o(n)$ is $n$ if $n$ is even and $n-1$ otherwise ? What happens to the holes in the skull where teeth were developing? In Skeptics.SE, a question regarding the skulls of children arose. Depicting a scary skull where the permenent teeth are "hidden" inside the jaws and the milk teeth are in the their place.  After all milk teeth fall out, and the permanent teeth "rise", do the holes left by them filled up, or do we go around with holes in our jaws?    The picture: I have a button created by my script. I wonder how I can display what the system console displays but inside blender's console. CoDEmanX did this by running a script inside it as shown , but I want to display what happens in the system console inside blender's console.  My .blend file can be found here: What, precisely, is a confidence interval? The Setup: Let's say we want to study a Euclidean $\mathrm{CFT}_2$ on $\mathbb R^2$ with coordinates $\sigma^1$ and $\sigma^2$ and metric   $ds^2 = (d\sigma^1)^2+(d\sigma^2)^2$.    It seems to me that in the usual discussion (e.g. di Francesco, Ginsparg, Polchinski), one proceeds to consider an analytic continuation of the CFT to $\mathbb C^2$ with coordinates $z^1, z^2$ and complex metric  $ds^2 = (dz^1)^2+(dz^2)^2$  and then, one performs the coordinate transformation $z = z^1+iz^2$ and $\bar z = z^1-iz^2$.  In this way the coordinates $z$ and $\bar z$ can be considered "independent" because they are coordinates on a complex two-dimensional manifold.  Also, in these coordinates the metric becomes  $ds^2 = dz\,d\bar z$  and it becomes clear that conformal mappings consist of mappings: $(z, \bar z)\to (f(z), g(\bar z))$.  My confusion is this: Since our original theory was on $\mathbb R^2$, books say that when we do calculations, we should consider the physical theory as living on the copy of $\mathbb R^2$ embedded in $\mathbb C^2$ given by the condition $\bar z = z^*$.  But consider the mapping $(z, \bar z)\to (z^2, \bar z)$.  This is a conformal mapping on $\mathbb C^2$, but it does not map the surface $\bar z = z^*$ to itself; for example the point $(z, \bar z)=(2,2)$ gets mapped to the point $(z^2, \bar z) =(4,2)$ and $2$ is clearly not equal to $4^*$.  In particular, it seems to me that analytic continuation to a CFT on $\mathbb C^2$ enlarges the set of mappings one can have, so what relevance does it really have to the original CFT on $\mathbb R^2$? How can I strike through an expression (e.g. "2x") obliquely, e.g. from bottom left to top right, so as to indicate cancellation? With the \sout command from the ulem package, I can only strike horizontally. Should I upgrade my body or lens first? Sharing a Bluetooth Keyboard and Mouse sequentially between two Macs Been trying to this line to parse for a good 20mins, but all attempts have failed:  \beta = $-$0.84, t = $-$2.09, P = 0.04   Could anyone tell me why I'm getting a Missing $ inserted error here? Check for column name in a SqlDataReader object Lighter nuclei liberate energy when undergoing fusion, heavier nuclei when undergoing fission.  What is it about the nucleus of an Iron atom that makes it so stable?  Alternatively: Iron has the greatest nuclear binding energy - but why? I'm using LyX for technical documentation and want to automate the process of creating PDF files.  Within LyX, I can simply click the button "View PDF (XeTeX)", and LyX performs the whole build process for me: it creates a .tex file, does some bibliography magic, and uses XeTeX to create the final PDF file.  What I'm looking for is a way to call LyX from the command line and get the same result. So far, I've only managed to generate a plain .tex file (using --export-to xetex). However, when I run xelatex on the generated file, it keeps showing errors that don't occur when building using LyX. Is there a way to get LyX to do the work?  My system: Windows 7 64bit, LyX 2.1.0 The editor asked me to use the following format.      Reference   1. Author, blah blah   Instead of      Reference   [1] Author, blah blah ...   Even though in the main text, [1] style has been used.   For example,        Smith [1] has proposed ...      Reference   1. Smith,      This is what I want.   Could you please advise how I can do the above?  Thanks in advance. Using Sequence to delete a part of an expression