Is there any difference between creating a Task constructor with a var vs just a function?  function Task(name, priority, timeout){ this.name = name; this.priority = priority; this.timeout = timeout; this.completed = false; } var task1 = new Task("firsttask",10,70s);   Versus  var Task = function(name, priority, timeout){ this.name = name; this.priority = priority; this.timeout = timeout; this.completed = false; } var task1 = new Task("secondtask",20,30s);
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?
If APS-C and similar crop-sensor digital cameras have a focal length multiplying effect such that a 50mm lens has an apparent focal length closer to the field of view of an 80mm on a full frame camera, and yet at the same time the depth of field for the smaller sensor camera is more like the depth of field a 50mm lens would produce on a full frame camera (using the same aperture), then this would seem to suggest the concept of an "aperture dividing effect."  In other words, a 50mm f/1.8 lens on an APS-C camera would act more like a 80mm f/2.8 (approx. 1.8 * 1.6x) lens in 35mm equivalent — for depth of field, not considering exposure.  Can someone with a better understanding of the physics involved clarify this for me.  I've never seen this concept explicitly mentioned anywhere, so I am a bit suspect of it. How to find out which (not installed) Debian package a file belongs to? On Debian systems (and derivatives):  $ dpkg --search /bin/ls coreutils: /bin/ls   That is, the file /bin/ls belongs to the Debian package named coreutils.  But this only works if the package is installed. What if it's not? I was trying to suggest a retag of  on Seasoned Advice, but the system won't let me; I get the familiar message     Edits must be at least 6 characters; is there something else to improve in this post?   In general, that's not true for retagging; if you don't change the question body at all, it should work. I suspect the logic checking the edit is thrown off guard because of the title warning:     The question you're asking appears subjective and is likely to be closed       I found , but I cannot find any evidence (in SEDE) for invisible characters being present in the question's source. Also, that's supposed to be . Why is there no option to login as root? Why does Ubuntu not allow the GUI users to login as root at the time of system start up like administrator in Windows?  Why they are restricting us to login only through the terminal? If Cooper wanted to stay, why did he send the NASA Coordinates? In Interstellar, after Cooper arrives in the Tesseract, Cooper tries to send the message STAY to his daughter in the past so she won't let him go on the mission. If that was his intention then why did he send the coordinates of NASA afterwards? If he didn't send the coordinates, he wouldn't have found NASA or go into space, he would have stayed. Find the maximum value of the expression ${\frac {x}{1+x^2}} + {\frac {y}{1+y^2}}+{\frac {z}{1+z^2}}$. Find the maximum value of the expression :   $${\frac {x}{1+x^2}} + {\frac {y}{1+y^2}}+{\frac {z}{1+z^2}}$$   where $x,y,z$ are real numbers satisfying the condition that $x+y+z=1$.   Taking $x=y=z=\frac {1}{3}$, I get the expression as $\frac {3x}{1+x^2}$, which is equal to $\frac {1}{1+{\frac{1}{9}}}$ or $\frac {9}{10}$.  How can I actually solve the problem without making unnecessary assumptions ? Stance on repost question instead of editing to invalidate answers? Duplicated Onedrive icon in explorer I've installed windows 10 on a new pc, with a secondary hard disk containing my onedrive folder, taken from my old pc. I've configured onedrive in order to use that folder, and it's working fine.  The problem is that when I open Explorer I can see two onedrive icons on the sidebar, both of them pointing at the same folder.  How can I remove the duplicated onedrive entry from the sidebar? "'void' type not allowed here" error (Java) Biliniear form to inner product Let $f:V\times V\rightarrow F$ be a bilinear form in a finite inner product space V.  If $F=R$, how can I prove that there exists a single linear transformation $T:V \rightarrow V$ so that for each $v,u\in V$, $f(u,v) = (Tu, v)$ ?  Would that sill be the case if $F=C$? Create a directly-executable cross-platform GUI app using Python When to use "If I was" vs. "If I were"? How can I obtain the command line arguments of another process?   Using static functions of the System.Diagnostics.Process class I can obtain a list of running processes, e.g. by name:  Process[] processList = Process.GetProcessesByName(processName);   However, there is no way to access the command line used to start this process. How would one do that? I heard that there was a twitter bot which automatically posted questions and asked for answers for specific questions on every site. How do they work? Is there an algorithm for doing this or is it purely random? I know that it doesn't tweet closed questions, but that's it. When he was just a professor, Dumbledore taught Transfiguration. As Headmaster what was he doing all day? In the 6th movie he was diligently looking for Horcruxes, but what about the other times?  When Fred and George pass the Maurader's Map to Harry they note that Dumbledore is pacing in his office. "He does that a lot" one of them says. Did Dumbledore just endless pace in his office as Headmaster, afraid to leave it for fear someone would know that he produced no work?   Sure, every year he had to go find a new DADA teacher, but most of those it seemed he did through correspondence. Horace Slughorn was the only one that seemed to resist. Dumbledore's 6th year may have been the only one where he earned his paycheck. Interpreting plot.lm() I had a question about interpreting the graphs generated by plot(lm) in R.  I was wondering if you guys could tell me how to interpret the scale-location and leverage-residual plots?  Any comments would be appreciated.  Assume basic knowledge of statistics, regression and econometrics. Comparing two Lists and returning the distinct values and the differences Is there any SCP program available for Ubuntu that does not require SFTP on a remote host? I need a program that can manage files on a remote device running Linux using SCP. The remote device runs OpenWrt. On Windows there is a perfect one WinSCP. it is weird that there is no native program that can be used. The program should be able to:  list files copy and move files to/from the device and within the device. delete files on the device view and edit files change file permissions  I have found only one alternative, except using CLI and installing WinSCP with wine. It is Midnight Commander with fish. It works really poor. The problems are:  It mixes up ~ on a remote device and on the computer. It can't edit files. I can open and edit, but they are saved to a wrong place.  There is a lot of other annoying problems that makes it almost unusable. I gave up using mc and now I am using pure shell on the remote device. Please do not tell me that Nautilus, etc support these features. They don't!!! Linux native file managers require SFTP that is not available on the remote device. Maybe it is possible to get nautilus use SCP, but I did not find a way of doing it without changing sources. THIS IS NOT A DUPLICATE !!! I have a specific requirement that is not covered in the duplicate question. If it is not possible on Ubuntu, then this could be an answer. I'm running Fedora 25 and I need to take a few particular screen captures so I've read that shutter is a great tool for that. Sadly I am unable to use it for some reason. Whenever I try to take a screenshot this is the result: How do I prove that $x^p-x+a$ is irreducible in a field with $p$ elements when $a\neq 0$? Let $p$ be a prime. How do I prove that $x^p-x+a$ is irreducible in a field with $p$ elements when $a\neq 0$?   Right now I'm able to prove that it has no roots and that it is separable, but I have not a clue as to how to prove it is irreducible. Any ideas?