What is the difference between anonymous function and function expression in JavaScript? I've been having trouble with function expression and anonymous function.  let sayHi = function() {   alert( "Hello" ); }; //This is function expression  var anon = function() {   alert('I am anonymous'); } anon(); //This is anonymous function   I don't see the difference between those two. From i see, they look the same to me. Can anyone please give me a better explanation of it so i can understand it. I appreciate it. Thank you
var functionName = function() {} vs function functionName() {} I've recently started maintaining someone else's JavaScript code. I'm fixing bugs, adding features and also trying to tidy up the code and make it more consistent.  The previous developer used two ways of declaring functions and I can't work out if there is a reason behind it or not.  The two ways are:  var functionOne = function() {     // Some code };     function functionTwo() {     // Some code }   What are the reasons for using these two different methods and what are the pros and cons of each? Is there anything that can be done with one method that can't be done with the other?
Using separation of variables to solve the wave equation I'm trying to teach myself separation of variables and have been following some notes for the wave equation, but there's one part which really confuses me and I'm not exactly sure how it makes the step.  For the wave equation   $$u_{tt} - c^2 u_{xx} = 0$$   with length $l$ and fixed ends, $u(0,t)=u(l,t)=0$ we seek a solution in the form $$u(x,t)=v(x)q(t)$$  and substituting this into the equation gives $$\frac{1}{q(t)}\frac{d^2 q}{dt^2}=c^2 \frac{1}{v(x)}\frac{d^2 v}{dx^2}=-\omega ^2$$   and I understand all of this so far. But when solving the equation  $$q''+\omega ^2 q = 0$$ the general solution is $$q(t)=A \cos(\omega t +\alpha)$$ where $A$ and $\alpha$ are constants - which is the part which I'm not exactly sure on how it gets to.   Could someone explain this step to me? Thanks! Me and my friends want to listen to music together. Two of us have Bluetooth Headphones (Beats Solo2 Wireless, Beats Studio Wireless) and one has a wired headset. Is there any way to use all three of these together? Congruent Modulo $n$: definition In an Introduction to Abstract Algebra by Thomas Whitelaw, he gives examples of the congruence mod operation, such as $13 \equiv5 \pmod4$,  and $9 \equiv -1 \pmod 5$. But when I first learned about the modulo operation my junior year, I would have told you that $13 \equiv 1 \pmod 4$, and that $9 \equiv 4 \pmod 5$.     Is this just a difference in the definition of modulo? Or is this pretty typical (to not take it to the largest factor, or one over)? Override back button to act like home button Wacom Tablet - Illustrator brush tool I currently got the intuos art wacom tablet so still learning how to use it. I'm currently in illustrator trying to draw out a map and the brush tool is doing something weird and I cannot figure out why. You can see in my image that where there are curves the black slightly spills over and is filling in half the curve with black. Brush setting is set up as a new calligraphic brush and the size is set to pressure, 3pt-3pt. As far as I know, it's possible to create a radially polarised ring magnet, where one pole is on the inside, and the field lines cross the circumference at right angles.    So imagine if I made one which was shaped like a sector of a torus.    Then I forced a load of these magnets into a complete torus.     Clearly this magnet is impossible because there's no way for the field lines to get back into the middle. So what happens to the field in this case? Does it disappear completely? Do the magnets blow up? Add "Delete with reason" button/dialog to existing moderator tools for flagged answers While this is an old problem, it's one that will only increase with time.  As Stack Exchange sites gain in popularity, more and more users are coming to the sites in search of answers to their specific problems.  Unfortunately, not all of them understand the basic operating principals behind Stack Exchange, and ask questions, or start discussions as separate answers.  Deleting these answers is fine, but more often (I would argue almost always) than not, a new user doesn't understand why.  Granted, comments are a way of doing this, but there are drawbacks to comments:   They require extra, replicated effort on the part of the moderator for something that they do repetitively The message will be inconsistent; messages like this would be consistent, cite the relevant resources that guide the user in the right direction The larger size would have a higher chance of grabbing the user's attention, as well as put more weight behind the action (as it's officially attached to the answer in a consistent manner). The banner will serve as an example of what not to do to other users who can see the deleted post.   Additionally, there are tools that can help with auto-commenting on posts, but these have their drawbacks as well:   Not all moderators use these tools The messages that are delivered by the tools are ultimately generated initially by the moderators, so the message will not be consistent These tools are not always available on other devices (e.g., mobile platforms)   It would be helpful to the user if they had a reason indicating why the answer was deleted.  Something along the lines of:    In order to accomplish this, I propose an additional (not a replacement) button in the moderation tools labeled "delete with reason".  Mods would still be able to delete answers outright, they just have the option now of stating why in an easy manner which will allows for more time to moderate harder.  Placement is not important (screen real estate is valuable, yes), but I envision it looking something like this in the moderator tools:    When clicking "delete with reason", a dialog, much like the "close" dialog will appear with options:    Initial options for the reasons could be:   Asking a new question Starting discussion   A mechanism like this has the potential for other benefits as well:   Users with an answer deleted with a reason might actually be directed to perform the right action now, and in the future (creating better site denizens) Users who wish to contest the deletion of an answer on meta can cite that specific reason, which mods can specifically address (which actually might reduce noise on meta about "why was my answer deleted?") Can reduce flags on answers asking "why was this deleted?" (admitted, I've not personally experienced this to be a pervading problem on Stack Overflow, but this might be the case for other mods on other Stack Exchange sites) Other Stack Exchange sites which don't have that many users will give a better experience to their users when their first action isn't ideal for a Stack Exchange site; this will enhance the chance that the site will retain the user and get good contributions from them (as per Farseeker's comments: , ).   Additionally, if this works well for the moderator tools, I imagine that it would not be such a leap to eventually have this graduated to users with the rep to cast delete votes, thus allowing non-mods to deliver a more clear message to new users about how to best participate on a Stack Exchange site. What is the remainder when $1! + 2! + 3! +\cdots+ 1000!$ is divided by $12$? What is the remainder when $$1! + 2! + 3! +\cdots+ 1000!$$ is divided by $12$.  I have tried to find the answer using the Binomial Theorem but that doesn't help. How will we do this?  Please help. Ackermann function - how to calculate the number of times it calls itself Purely for my own amusement I've been playing around with the .  The Ackermann function is a non primitive recursive function defined on non-negative integers by:  $A(m,n) = n+1$, if $m=0$  $A(m,n) = A(m-1,1)$, if $m&gt;0$ and $n=0$  $A(m,n) = A(m-1,A(m,n-1))$, if $m&gt;0$ and $n&gt;0$  I'm not interested in values of the function itself, rather I'm interested in the number of recursions the function takes to arrive at a value. For example:  $A(1,2) = A(0,A(1,1)) = A(0,A(0,A(1,0))) = A(0,A(0,A(0,1))) = A(0,A(0,2)) = A(0,3) = 4$  That's 6 steps, so if we define $RA(m,n)$ as the number of recursions to calculate $A(m,n)$, then $RA(1,2) = 6$.  I made a short Excel macro to calculate $RA(m,n)$ for any given $m$ and $n$. The problem I have is that $RA(m,n)$ grows even faster than $A(m,n)$ and I quickly run out of stackspace. The table below shows $RA(m,n)$ for very small values of $m$ and $n$. The numbers shown for $RA(3,10)$ and $RA(4,1)$ are the number of steps before crashing!    A formula for $RA(1,n)$ is trivial, and it is relatively easy to see that $RA(2,n) = 5(n+1) + 4n(n+1)/2$.  So my questions: can anyone see an explicit formula for $RA(3,n)$? More generally, does a formula exist for $RA(m,n)$, in the same way that $A(m,n)$ can be expressed using Knuth arrows?   For the low values shown of $m$ and $n$, $RA(m,n)$ looks about order of magnitude larger than $A(m,n)$. Can we prove that $RA(m,n) &gt; A(m,n)$ for all $m,n$. Intuitively, it should be.  For bonus points, can $RA(m,n)$ be expressed in terms of $A(m,n)$? I've recently come across several statements to the effect "there are questions science can't answer", mostly from proponents of  and , but also from  and  as well.   However it seemed to me that there was an inherent contradiction in statements of the type "Science doesn't have all the answers" or "Science can't answer all questions". This is hinged on what is meant by "answering a question". It seems to me that to answer any significant question is to provide 2 things:    An accurate and objective explanation of the current state of affairs, in terms of relationships, causes and effects.  Based on that explanation, a method for making decisions if one is faced with future scenarios similar to or related to the current state of affairs, and for predicting future states of affairs with a certain amount probability, i.e the explanation is useful for future purposes.   But then if a field of inquiry is able to provide accurate, objective and useful information regarding a question, doesn't that field simply become part of science?   As examples:    If some school of mysticism is demonstrated to truly improve the happiness and well being of it's practitioners, then wouldn't that school's mystical teachings simply be incorporated into mainstream psychology and psychotherapy?  Similarly, if a political ideology is proven to provide better economic conditions and less crime, less pollution, etc...then this ideology's principles would become an accepted part of social sciences?     To put it more simply: Science has all the answers, because science IS anything that can provide objective and useful answers to a question.  Am I not talking about the demarcation problem per-se (at I least I think I am not), because even disciplines which are agreed upon as failing various demarcation criteria (such as astrology or intelligent design) are still trying (and failing) to be scientific in the sense I mentioned above. If they did start to provide answers, science would have to take them into account. Moreover, various philosophical schools of ethics are trying to be scientific in their explanatory framework, they are just not able to provide verifiable and falsifiable statements to prove their precepts (and probably would do so if possible).   My questions then are:    Per those who claim that science can't answer all questions, what type of question are they talking about? Do they have a demarcation criteria for such questions? (I'm not asking for examples, there are already plenty in the links I posted above).  If a field starts providing objective, accurate answers, doesn't it just become a subfield of science?   Is there a second demarcation problem between "carckpot" pseudosciences (such as astrology or numerology) which are providing the wrong answers and legitimate fields of inquiry (such as political theory or ethics) which are trying to provide answers but so far have failed to provide verifiable and falsifiable statements or accurate predictions? Would you please tell me which of the following terms is correct? If both are correct, are they equal?     I have no [...] I don't have any [...] What is the fundamental group of $(\mathbb{C} \setminus {\{0\}})~/~\{e,a\}$, where $e$ is the identity homeomorphism and $az = -\bar{z}$?  Clearly this is homeomorphic to the half cylinder , which is homotopy equivalent to the half circle.  But what is the fundamental group of the half circle? Helpless after exhausting daily limit for reviewing Suggested Edits I have faced this problem earlier. But today I got to face this problem twice in a span of couple of minutes.. I have unfortunately finished my daily quota of reviewing Suggested Edits. But I want to further edit a post for which an edit has already been suggested by another user having less than 2000 Reputation.  I come across a post and it says that an edit has already been suggested which is pending for Review:   I click on edit (1) and a pop-up of Suggested Edit appears:    However, the problem is this Suggested Edit doesn't thoroughly deal with the post. It just fixes some capitalization and nothing else — no grammar fixes, no sentence restructuring to make it more clear, no code formatting, no dividing it into lists, etc. — in short, perfect candidate to be rejected. (The image for the suggested-edit I have uploaded didn't have those problems - however, there were those problems in the edits that I encountered earlier.) The problem before me is that I am helpless. I can't approve, reject or improve the edit since I have already gone past my daily quota of Reviewing them. Neither can I make the edits to the post since this suggested edit is pending review. I am completely helpless!! Whats the opinion of the community in this matter?  Should we (those with more than 2000 Rep) be able to edit them? Don't count it in our Review Progress obviously - not sure what should be done with the suggested edit already proposed.  Or, Let it be, someone else would come and edit them and other Reviewers would deal with the Suggested Edit appropriately.  Or, Something else.    Note: This might not be much of a problem for Stack Overflow since the Review Queue is very busy here. However, this is a bit of a problem for smaller sites. So, treat it as a question posted at Meta.SE and not so much at Meta.SO.  Dirty Hack: Ah... found a dirty hack to work around this situation. However, this shouldn't be used unless absolutely necessary. Credit goes to  in . To edit a post enter this link in your browser: http://${site_url}/posts/${post_id}/edit. So, to edit this particular post one would enter: http://meta.stackoverflow.com/posts/171129/edit. I repeat, the hack shouldn't be used unless necessary. Estimate on the derivative at fixed point Let $D$ be a bounded domain and let $f$ be analytic function from $D$ into $D$. Show that if $z_{0}$ $\in D$ is a fixed point for $f$ , then $|f' (z_{0} )| \leq 1$.  WHAT I WAS THINKING:   To have a conformal mapping from $D$ to the unit disc &amp; after composing it with $f$ ; I was thinking to use Pick's Lemma. So, can anyone tell me any conformal map from any bounded domain to the unit disc?? OR Is there any other way out to solve this problem?? How to distinguish gift from payment for the service? If somebody gives me reasonable advise or share important to me information.   Being attentive I would like to make a little gift or give some little (&lt;100$) amount of money (cash/wire/online) for that   How it would be classified by IRS?   Which obligations originate with this matter for me and my party?  How to do this in a most comfortable way to my party? Why does the variance of the Random walk increase? Object emit light distance I created an object, and I wanted it to glow. I used to just place points of light around it, and parent them to it, but using the emit option in the materials seemed so much easier.  But when I gave it an a higher emit than 0, it went only a small distance before the light stopped. I turned it up to 200, and the object was white with light, but the light didn't go any farther. Oh and I changed the color, and nothing happened. Can a shell script set environment variables of the calling shell? Word for "the entire back part of the body"? When we lie down, the "back part of the body" is in contact with the bed. It includes the heels, the calves, the backside, the back, and the back of the neck, and the back of the head etc.  How do we refer to the entire "back part" of the body? Are all electrons identical? Why should two sub-atomic (or elementary particle) - say electrons need to have identical static properties - identical mass, identical charge? Why can't they differ between each other by a very slight degree? Is there a theory which proves that?  Imagine an alien of size of order of Milky-way galaxy examining our solar system with a probe of size of 10's of solar system dimension and concludes that all planets are identical.