I am using AJAX requests (jQuery) for getting collections of data. Some of the endpoints support extra options for filtering out data (eg api.com/users/?name=chr)  When the data parameter (eg name) is empty, I don't want the request to send it.  I've tried this {name: name !== '' ? name : null} but the request is sending the 'name' parameter as empty string (eg api.com/users/?name=&amp;anotherparam=value)  [EDIT]  Because it got marked as duplicated due to the fact that a possible solution would be to remove empty properties from the data object that is sent, I want to clarify that firstly I wanted to use a feature (parameter omitting) of the framework (in that case jQuery) if that exists, which as I state in my answer, does.
How do I remove all attributes which are undefined or null in a JavaScript object?  (Question is similar to  for Arrays)
What defines a PC's consciousness of self, memories and knowledge? Prove $x^3 + 3 =4y(y+1)$ has no integer solutions Why do people not upvote, or accept answers that worked for them? I am regular Stack Exchange user, especially at Stack Overflow.  One of the things I really dislike about new and sometimes veteran users is that:   Either they do not accept an answer that works for them, Or they accept the answer but do not vote it up   I mean they can really both accept the answer and vote it up but somehow they wouldn't =(.  How many of you feel the same way? Are mixed geometry types allowed in shapefiles? Does the shapefile support mixed geometry types (ie. point and polygon all in the same file)? I found many related questions on this site but I am still not sure about the rules. How can I decide if I need a visa to transit? Schengen members as of May 2021 are as follows:  Austria Belgium Czech Republic Denmark (excluding Greenland and the Faroe Islands - but an open border with the Schengen Area is maintained) Estonia Finland France (excluding overseas departments and collectivities) Germany Greece Hungary Iceland Italy Latvia Liechtenstein Lithuania Luxembourg Malta Netherlands (excluding Aruba, Curaçao, Sint Maarten and the Caribbean Netherlands) Norway (excluding Svalbard) Poland Portugal Slovakia Slovenia Spain (except Ceuta and Melilla) Sweden Switzerland So my teacher gave a pretty tough (for me) problem in class today: Does the series $$ \sum_{n=1}^{\infty}\frac {\sin{\frac 1 n}} {\sqrt n} $$ converge or diverge?  So far I've thought of trying the Comparison Test and Ratio Test but couldn't really get anywhere. Intuitively I think it should converge, but how do I actually show this? I was wondering how far in imaging physics had gotten. Do we hold the technology to actually take a picture of, say, an alpha particle, or even a single atom?  I realise we aren't talking about camera pictures, so what kind of imaging techniques have taken images/is most likely to be the technique to take an image of a single atom? equal size numerator and denominator I am trying to size the numerator and denominator of the below equation so that they are equal in size.  I have not had much luck suggestions are appreciated.  \begin{equation} \sum_{i=1}^{n} \frac{\frac{cf_{n}}{(1+i)^n}} {\displaystyle\sum_{i=1}^{n}\frac{cf_n}{(1+i)^n}} , n_{i} \end{equation} How can I pass arguments to a batch file? I need to pass an ID and a password to a batch file at the time of running rather than hardcoding them into the file.  Here's what the command line looks like:  test.cmd admin P@55w0rd &gt; test-log.txt Standard deviation of binned observations I have a dataset of sample observations, stored as counts within range bins. e.g.:  min/max  count 40/44    1 45/49    2 50/54    3 55/59    4 70/74    1   Now, finding an estimate of the average from this is pretty straight forward.  Simply use the mean (or median) of each range bin as the observation and the count as a weight and find the weighted average:  $$\bar{x}^* = \frac{1}{\sum_{i=1}^N w_i} \sum_{i=1}^N w_ix_i$$  For my test case, this gives me 53.82.  My question now is, what's the correct method of finding the standard deviation (or variance)?  Through my searching, I've found several answers, but I'm unsure which, if any, is actually appropriate for my dataset.  I was able to find the following formula both  and .  $$s^{2*} = \frac{ \sum_{i=1}^N w_i (x_i - \bar{x}^*)^2 }{ \frac{(M-1)}{M} \sum_{i=1}^N w_i }$$  Which gives a standard deviation of 8.35 for my test case.  However, the Wikipedia article on  gives both the formula:  $$s^{2*} = \frac{ \sum_{i=1}^N w_i}{(\sum_{i=1}^N w_i)^2 - \sum_{i=1}^N w_i^2} \sum_{i=1}^N w_i(x_i-\bar{x}^*)^2$$  and  $$s^{2*} = \frac{1}{(\sum_{i=1}^N w_i) - 1} \sum_{i=1}^N w_i(x_i-\bar{x}^*)^2$$  Which give standard deviations of 8.66 and 7.83, respectively, for my test case.  Update  Thanks to @whuber who suggested looking into Sheppard's Corrections, and your helpful comments related to them.  Unfortunately, I'm having a difficult time understanding the resources I can find about it (and I can't find any good examples).  To recap though, I understand that the following is a biased estimate of variance:  $$s^{2*} = \frac{1}{\sum_{i=1}^N w_i} \sum_{i=1}^N w_i(x_i-\bar{x}^*)^2$$  I also understand that most standard corrections for the bias are for direct random samples of a normal distribution.  Therefore, I see two potential issues for me:   These are binned random samples (which, I'm pretty sure, is where Sheppard's Corrections come in.)  It's unknown whether or not the data is for a normal distribution (thus I'm assuming not, which, I'm pretty sure, invalidates Sheppard's Corrections.)   So, my updated question is; What's the appropriate method for handling the bias imposed by the "simple" weighted standard deviation/variance formula on a non-normal distribution? Most specifically with regards to binned data.  Note: I'm using the following terms:     $s^{2*}$ is the weighted variance   $N$ is the number of observations.  (i.e. the number of bins) $M$ is the number of nonzero weights.  (i.e. the number of bins with counts) $w_i$ are the weights  (i.e. the counts) $x_i$ are the observations.  (i.e. the bin means) $\bar{x}^*$ is the weighted mean. I have two partitions, one of them has a file system and the other is unallocated.  How to merge two partitions? How to completely remove Notepad++ in Ubuntu 18.04 terminal?  I can't find it in Synaptic package manager, and don't know where is on system, but I can see an icon in Activity. It is probably not completely installed, because I can't open it. Do internal forces cause change in velocity? How do I undo 'git add' before commit? I mistakenly added files to Git using the command:  git add myfile.txt   I have not yet run git commit. Is there a way to undo this, so these files won't be included in the commit? The Weyl equidistribution theorem states that the sequence of fractional parts ${n \xi}$, $n = 0, 1, 2, \dots$ is uniformly distributed for $\xi$ irrational.   This can be proved using a bit of ergodic theory, specifically the fact that an irrational rotation is uniquely ergodic with respect to Lebesgue measure. It can also be proved by simply playing with trigonometric polynomials (i.e., polynomials in $e^{2\pi i k x}$ for $k$ an integer) and using the fact they are dense in the space of all continuous functions with period 1.  In particular, one shows that if $f(x)$ is a continuous function with period 1, then for any $t$,  $\int_0^1 f(x) dx = \lim \frac{1}{N} \sum_{i=0}^{N-1} f(t+i \xi)$. One shows this by checking this (directly) for trigonometric polynomials via the geometric series.  This is a very elementary and nice proof.  The general form of Weyl's theorem states that if $p$ is a monic integer-valued polynomial, then the sequence ${p(n \xi)}$ for $\xi$ irrational is uniformly distributed modulo 1.  I believe this can be proved using extensions of these ergodic theory techniques -- it's an exercise in Katok and Hasselblatt.  I'd like to see an elementary proof.  Can the general form of Weyl's theorem be proved using the same elementary techniques as in the basic version? Why is it so hard to find the roots of polynomial equations? The question that follows was inspired by  question:  When trying to solve for the roots of a polynomial equation, the quadratic formula is much more simple than the cubic formula and the cubic formula is much more simple than the quartic formula.    That the general solutions to various polynomial equations are so complex and difficult to derive seems to suggest a fundamental limitation in the problem solving capabilities of the mathematical machinery. Does this intuition of mine make any sense? What should I make of it? Why is it that with each successive degree in a polynomial equation, the solution becomes so much more complex? Can I gain some intuition about what makes finding the roots so hard? According to the : "there is no general algebraic solution—that is, solution in radicals— to polynomial equations of degree five or higher." What is so special about the quintic that makes it the cut-off for finding a general algebraic solution? How would I go about finding $\prod_{n=1}^\infty (1+\frac{1}{n^2})$ ? Setting $a_k = \prod_{n=1}^k (1+\frac{1}{n^2})$, the first few partial products are $a_1 = 2$, $a_1 = 2.5$, $a_3 \approx 2.78$, $a_4 \approx 2.591$, $a_{20} \approx 3.50$, and they eventually appear to converge at around $3.639$. (These values were found with a quick python program. So much for my initial conjecture that the product converged to $e$.)   I tried writing $1+\frac{1}{n^2}$ as $\frac{n^2 + 1}{n^2}$, but it wasn't immediately obvious how to prove convergence / find the limit because the product doesn't really factor or telescope. Is there a way to calculate the limit? Government investigating home library of missing inventor This is a short story from the 50s or 60s.  A scientist or inventor has invented either teleportation or a space drive and has disappeared - leaving no documentation or clues except his extensive home library.  The government gathers all types of scientists to attempt to duplicate his research.  Several months later, as they are about to launch the first space drive space ship, the officer in charge reveals that there was no 'disappeared inventor'.  The greatest step toward a new impossible concept is knowing that it has already been done. Is there any freely available pointcloud data?   I'm especially interested in dense clouds of small areas(5m to 100m radius) but anything else would be fine too.   I've found that these pages have very nice and easy to access point cloud data. Interior of cartesian product is cartesian product of interiors I have to prove that:  $$Int(A\times B) = Int(A)\times Int(B)$$  Where $A\subset M$ and $B\subset N$, both $M$ and $N$ metric spaces.  The problem is that the exercise does not specify the metric, so I need to try to prove it using a generic metric.  If $x\in Int(A\times B)$, then an open ball can be centered at $(x,y)$ such that it is contained in $A\times B$. Therefore, this open ball, $B((x,y),r)\subset A\times B$. It means that $d((x,y),a)&lt;r$ for any $a\in A\times B$ for some $r&gt;0$. I guess that if I can take from here that $d(x,a)&lt;r$ and $d(y,a)&lt;r$ I can prove thhat $Int(A\times B)\subset Int(A)\times Int(B)$, but I still have to prove the other way around.   Any ideas?