This is a simplified example, but the goal is to have a function that returns a function given a set of arguments, and the returned function should have those arguments expanded into numbers/strings.  The example here returns a function that checks whether a set of coordinates are within a rectangle:  function createFunction(startX, startY, width, height) {     return function(x, y) {         if (x &gt;= startX &amp;&amp; x &lt;= startX+width &amp;&amp; y &gt;= startY &amp;&amp; y &lt;= startY+height) {             return true;         }         return false;     }; }  var myFunction = createFunction(5, 10, 200, 100);  console.log(myFunction); //startX and the other arguments aren't expanded   The problem described in the comment above is that the arguments from the "createFunction"  function aren't expanded into values, and if one used the returned function it would create an error because startX and the other arguments aren't globally defined.  How do I return a function with the variables expanded?
How would you explain JavaScript closures to someone with a knowledge of the concepts they consist of (for example functions, variables and the like), but does not understand closures themselves?  I have seen  given on Wikipedia, but unfortunately it did not help.
I'm in a conversation and I don't really want to leave because the people there keep adding me back so it's just whatever. But I would like to mute the conversation or something like I do on Facebook so I won't take notifications or anything from there unless I press on the group and see what's going on. Because for now I have my Skype having a new notifications every half a second.  Any solutions to that? I have keypair (u,r), and two pieces of data, X and Y.  I reveal X publicly but keep Y secret. Y has high entropy.  I then concatenate X and Y, into Z.  I encrypt Z, into "encrypt(Z,u) = Q". r is needed to decrypt Q back into Z.  Later, (when it doesn't matter), r will be revealed and everyone will decrypt Q into Z. At that point, everyone will know that, all along, Q "contained" X. Can I prove that Q contains X before r is revealed (including interactive zero-knowledge proofs)? How can I keep track of a decimal number that indicates the current paragraph's place in a logical hierarchy and print it in the margin of each paragraph?  (To yield a numbering in the style of Tractatus Logico-Philosophicus).  \def\on{} \def\down{} \def\up{}  \on This is the first paragraph, paragraph number 1.  \on This is paragraph number 2.  \down This is paragraph number 2.1  \down 2 This is 2.101  \up This is 2.11  \down 2.111  \up 3 3  \bye   If \down is starred, begin with zero.  If \up is followed by an integer, it should take it as an argument, unless there is a newline between \up and the integer.  An indefinite number of decimals should be possible.  PS.  I apologize for changing the question after (2) answers have been given, but I realize I failed to appreciate a feature of Wittgenstein's numbering: the last decimal is never 0.  Therefore, \down &lt;n&gt; is better than \down*, as now demonstrated above.  I think the 0 is supposed to indicate an additional level of unimportance. In D&amp;D 4e there was an option to Delay your initiative:     Perform your actions as desired and adjust your initiative to your new   position in the order.   Does this rule to change initiative order still exist in 5th edition? I cannot find it in the PHB. Is the collapse of the wave function inherently time asymmetric? How to compute the marginal likelihood given two multivariate Normal distribution? Given that $a$~$\mathcal{N}(\mu, \Sigma)$ and $\mu$~$\mathcal{N}(0, \sigma^2 I)$, Is $p(a|\Sigma, \sigma)=\int p(a|\mu, \Sigma)p(\mu|\sigma)d\mu$ again a Normal distribution? And how to estimate the mean and variance respectively? Thanks a lot! I'm currently trying to extract textures from a binary file, and ideally I'd like to save each texture to a file or embed in the .blend file. However, before saving an image, I need to be able to create an image in memory from an array of pixel data.  The PIL library contains the kinds of functions I need to use, but it is not included with Blender. Is there anything similar to PIL in Blender? bpy.ops.image seems to be close to what I need, but lacks necessary pixel set/manipulation functions. Advanced search criteria for bounty questions? All active questions with awarded bounty can be seen in the Featured tab. However, there seems to be way to make searches to the contents of any particular question tab.  I realize that this is pretty much a duplicate of  but it has no clear answer whether there are any plans of supporting bounty searching or not.  So, could there possibly be a hasbounty:1 advanced search criteria? Same mesh with different colors So I have a 2010 15" macbook pro (MBP6,1) and I replaced the optical drive with a hard disk. I wanted to install windows 7 on the hard disk with boot camp with a USB and ISO image.  After searching I found that I need to modify my plist.info to allow my boot camp to create a bootable USB (since normally it doesn't have the option to create the USB for my model since it came with a disk drive).   After doing so and seemingly having a fine (but long) install process onto the USB. I told boot camp how much space to partition windows on and hit install.  Then the computer restarted. When it came back up it was stuck on a grey apple logo screen forever (I waited 15 minutes to ensure it wasn't just "thinking"). I force restarted and the next time it turned on it got stuck on the grey logo for a bit but then proceeded to go to a black screen that said " No bootable device - please insert a bootable device and hit any key". I tried hitting keys with he USB in but nothing happened.  I had to eventually remove the USB and reset PRAM to get it to boot into osx again  Is there any way to install windows 7 from a usb on my macbook pro using boot camp? When I double-click on a script in Nautilus in order to run it, the script opens in my text editor with no option to do so.  Using Nautilus, how do I run executable text files and/or scripts? For what values $s$ does $\int_{0}^{\infty} \frac{\sin x}{x^s}dx$ converge? For what values $s$ does $\int_{0}^{\infty} \frac{\sin x}{x^s}dx$ converge?  Solution says $0&lt;s&lt;2$.  Any ideas? If Eren Jaeger dies without transfering his titan powers, will both powers transfer to the same child? It's told in the story that if a titan shifter dies without transferring his power, this power will go to an eldian person who just was born. If Eren Jaeger dies without transferring his titan powers, will the attack titan and the founding titan go to different persons?  Note that his is not a duplicate of  as this is not about what happens when a titan shifter dies. But what happens if a titan shifter with 2 powers dies, which is not answered in the answer. I would like a way to convert a document from HTML to LaTeX on a Windows platform. What is my best option? How can I make NON-fluffy pancakes? Every recipe I can find is for "fluffy" pancakes.  I prefer thinner, slightly crispy, (very) slightly chewy, non-fluffy pancakes.  Basically, the less "cake-like" the better.  Apparently I'm the only one, and these are all non-desirable qualities in a pancake, so it is hard to find recipes.  How can I make non-fluffy pancakes?  I will be using a cast-iron pan. What are the strategies for getting feedback on articles? As an academic, one has to publish. Often, an article is drafted, and you need feedback of a colleague.  I see that quite often some perspective articles are often written by long-term collaborating pairs of authors.  What are some strategies people use to get feedback on their articles  (outside of immediate boss; and in the case that none of the friends in the field of work in the specific domain of the article, and one needs specific (not general) feedback)?   How do you approach a colleague to simply read your article. Or do you just mention it at a conference to the most suitable colleague - would you like to read an article and give me feedback? How do handle the co-authorship or acknowledgement? Do you establish the limits at the "approach time"?  What are some strategies to establish a "publishing" duos (buddies). Duplicate questions that use different words to describe the same problem are important for people to find the content via search engines. But the user experience when an anonymous user arrives at a duplicate is less than ideal.  They have to notice the duplicate link and understand that the answer they are looking for is likely behind that link. I don't think this is all that obvious to someone without experience with an SE site.  I propose to just redirect users to the duplicate automatically if the closed duplicate has zero answers. In that case they need to follow the link to the duplicate in any case, so we might as well redirect them to it in the first place.  I could imagine this being problematic with search engines, as we would be displaying different content than what the search engines see. If that is too problematic I would suggest to show a very obvious link to the duplicate in the answers section for anonymous users. I have a DVD I was trying to rip, and handbrake froze up when scanning it.  I tried to eject the DVD by dragging and dropping it to the trash, which trashed the icon, but didn't eject the DVD.  I then forced Handbrake to quit, but without an icon on my desktop to select, how can I eject the DVD? I read following in a web site ()     Lenses with maximum apertures of f2.8 allow the camera to use all high   precision sensors. In low light or other situations that are hostile   to autofocus, that’s a big deal. Lenses with a maximum aperture of   f4.0 use only the center focus sensor in its “high precision” mode,   and use the other sensors in their “horizontal line” only mode. Lenses   with a maximum aperture of f5.6 use all sensors in their   “horizontal-only” mode, and lenses with a maximum aperture of f8 use   only the center sensor point, and that with horizontal sensitivity   only.   I want to understand if this is completely true? I am raising this because recently I have purchased a Nikon 70-200 f/4 lens and would like to understand if I have made a wise investment, or, should I collect some more money and buy a 70-200 f/2.8 VR-II lens. Why do high resolution cameras shoot stills at high resolutions, but only typically shoot video at 1080p which is about 2 megapixels?  For example I have a Sony-NEX 6 which can shoot stills at 16 megapixels but only 1080p by 1920p video.  Also how do digital cameras separate the frames in video if the lens shutter never closes?  And if you can shoot video at 30 fps or 60 fps then why can't cameras have a continuous drives at 30 to 60 fps?