Javascript - removing undefined fields from an object Is there a clean way to remove undefined fields from an object?  i.e.  &gt; var obj = { a: 1, b: undefined, c: 3 } &gt; removeUndefined(obj) { a: 1, c: 3 }   I came across two solutions:  _.each(query, function removeUndefined(value, key) {   if (_.isUndefined(value)) {     delete query[key];   } });   or:  _.omit(obj, _.filter(_.keys(obj), function(key) { return _.isUndefined(obj[key]) }))
Remove blank attributes from an Object in Javascript How do I remove all attributes which are undefined or null in a JavaScript object?  (Question is similar to  for Arrays)
Why does the area of a bar in a histogram represent the frequency of that particular class In a bar-graph, the height of the bars represent the frequency of a particular category but it is counter-intuitive that in a histogram, instead of the height of the bar(which represents the frequency density), the area of the bar represents the frequency of the particular class. Why is this so? Why does shell Command Substitution gobble up a trailing newline char? What is the proof that the universal constants ($G$, $\hbar$, $\ldots$) are really constant in time and space? How to fix "error: unknown filesystem. grub rescue> I get this error:  Error: unknown filesystem. grub rescue&gt;   I'm not exactly sure what I did. I believe I installed Ubuntu over Windows on my Acer netbook. I then tried to install , but it wouldn't start installing.  I turned the netbook off and back on. Now I get the error.  I have read a lot of other questions like this, but in my case I cannot boot a CD. If I put a Ubuntu CD or a Linux Mint CD into my external CD/DVD drive and change my BIOS to boot the CD-ROM first, it just gives me the same error screen.  Update copied from comment dated 2012-05-26 02:54:29Z  Here are some results from my commands:   grub rescue&gt;ls (hd0) (hd0,msdos5) (hd0,msdos1)  grub rescue&gt;ls (hd0,msdos5) unknown filesystem  grub rescue&gt;ls (hd0,msdos1) unknown filesystem  grub rescue&gt;ls (hd0) unknown filesystem Display the original question beneath the answer edit form Often when I edit one of my answers, it's because I want to better address the original question. The only problem is that I can't see the original question while I'm editing my answer!  I'd love to see the original question text beneath the "answer edit" form. This way I could scroll down slightly to read it if I wanted to, or just ignore it if not.  Current workaround is to click the 'return to answer' link and hope that you remember to launch it in a new tab/window, then tab back and forth.    Imported from this uservoice item: What is an uninterruptible process? Sometimes whenever I write a program in Linux and it crashes due to a bug of some sort, it will become an uninterruptible process and continue running forever until I restart my computer (even if I log out).  My questions are:   What causes a process to become uninterruptible? How do I stop that from happening? This is probably a dumb question, but is there any way to interrupt it without restarting my computer? In some literature, I have read that a regression with multiple explanatory variables, if in different units, needed to be standardized.  (Standardizing consists in subtracting the mean and dividing by the standard deviation.)  In which other cases do I need to standardize my data?  Are there cases in which I should only center my data (i.e., without dividing by standard deviation)? Cross referencing between chapters of a thesis Hi I am new to the forum and fairly new to Tex, if I miss anything out please let me know and I will be glad to post it. I am writing up my PhD thesis using Texmaker on a windows system. I have my document organised with a main file and a sub-directory containing chapter 1 to 5. I want to be able to use the labels I created in chapter two for example in the appendix and vice versa. Is there an easy way to do this?   I have tried following the advice of various posts of including the commands \usepackage{xr} and \externaldocument{Chapters/Chapter_2} in the individual chapters but this leads to an error when compiling.   My Preamble is as follows:  \documentclass[12pt,hidelinks,twoside]{report} \usepackage[utf8]{inputenc} \usepackage[T1]{fontenc} \usepackage[greek,spanish,english]{babel} \usepackage{textgreek} \usepackage[version=3]{mhchem} \usepackage[a4paper,width=150mm,top=25mm,bottom=25mm,bindingoffset=6mm]{geometry} \usepackage{amsmath, amsfonts, pifont, float, color, url} \usepackage[pdftex]{graphicx} \usepackage[style=numeric,backend=biber,sorting=none]{biblatex} \addbibresource{references.bib} \usepackage[pdftex, plainpages=false, pdfpagelabels, bookmarks=true]{hyperref} \usepackage{fancyhdr} \usepackage[center,font={it,small}]{caption}   I then have a section such as this in the main document:  \begin{document} %%... Title page ... \chapter{Theory and Methods} \label{chap:Theory and Methods} \include{Chapters/chapter_2} %%... Other chapters .... \end{document}   In Chapter 2 I have for example a label for a diagram which I may want to reference in other chapters:  \begin{figure}[H] \centering \includegraphics[height=10cm,width=\textwidth]{RF_colour_hi_res.pdf} \caption{Random Forest} \label{fig:2.1 Random Forest} \end{figure}   How can I have this label show up in other chapters after I type \ref ?  Many thanks in advance.  If any other information is required please let me know.   This has been answered in the comments although the references do not appear in the auto complete if they are copied and pasted in they still work. Stacks for Unity Launcher I'm looking forward to emulate the behavior of OS X Dock Stacks so that I can have, for instance, one stack for browsers and another one for IDES. People at ask ubuntu are doing a lot of cleaver stuff with custom Launchers and Quicklists (see ). So has anyone figured out how to have stacks in Unity? Anything fancier than a static Quicklist over a dummy folder icon? How to send emails and avoid them being classified as spam? This is a  about how to handle email sent from your server being misclassified as spam.  For additional information you may find these similar questions helpful:                    Sometimes I want to send newsletters to my customers. The problem is, that some of the emails get caught as spam messages. Mostly by Outlook at the client (even in my own Outlook 2007).  Now I want to know what should be done to create "good" emails. I know about reverse lookup etc., but (for example), what about a unsubscribe link with an unique ID?  Does that increase a spam rating? Firmware vs. Software Is there any way to include an animated GIF directly in either PDFLaTeX or XeLaTeX? I realize the animate package can include animations in a PDF, but it doesn't support animated GIFs and you have to split them up manually into EPS or PNG files as far as I can tell. I usually am able to render successfully to the c:\tmp folder, but when I came into work today, I rendered out the image on my work laptop, and everything seems to work, but I'm not getting an output to the tmp directory.  Does anyone know how to make this work? Weird line in my mirrored mesh Considering the three types of Devil Fruits that has been explained are 1. Paramecia Type - where the user can get super human abilities and change their body parts into weapons, etc. 2. Zoan type - where the use can turn into a particular animal and inherit its abilities 3. Logia Type - where the user's body inherits a particular element and the body becomes like air which cannot be touched or damaged by non Haki users.  So what exactly is the type of Gomu Gomu no Mi? It cannot be Zoan or Logia. It's very close to a Paramecia but still doesn't have a logical explanation to be of Paramecia type! So is it some special type of Devil Fruit? Force refresh view in LWC In Aura, we can do      $A.get('e.force:refreshView').fire();   to cause standard components to update.  How can we do an equivalent in LWC because sfdx refuses to publish .js code with $A in it saying the usage is disallowed in LWC?  For now i tricked it with   eval("$A.get('e.force:refreshView').fire();");   but that is obviously less than ideal.... I'm having trouble editing this file on Windows 7:  C:\Program Files (x86)\CMake 2.8.7\share\cmake-2.8\Modules\FindJNI.cmake   If I edit it in Cygwin (vi) or TextPad, those two programs see the changes, so it's getting written to disk somewhere.  But if I "type" the file in a DOS cmd shell, it looks like the file hasn't been changed at all.  One thing I noticed is that in the cmd shell, the owner is Administrators, but in Cygwin's bash shell, the owner is Dan:  C:\Program Files (x86)\CMake 2.8.7\share\cmake-2.8\Modules&gt;dir /Q FindJ*  Volume in drive C is Windows7_OS  Volume Serial Number is 92CA-8707   Directory of C:\Program Files (x86)\CMake 2.8.7\share\cmake-2.8\Modules  12/30/2011  09:45 AM             1,480 BUILTIN\Administrators FindJasper.cmake 12/30/2011  09:45 AM             7,951 BUILTIN\Administrators FindJava.cmake 12/30/2011  09:45 AM            10,632 BUILTIN\Administrators FindJNI.cmake 12/30/2011  09:45 AM             1,669 BUILTIN\Administrators FindJPEG.cmake                4 File(s)         21,732 bytes                0 Dir(s)  132,524,654,592 bytes free   Dan@home /c/Program Files (x86)/CMake 2.8.7/share/cmake-2.8/Modules $ ls -al FindJ* -rwx------+ 1 Dan            None 10636 Jan 30 13:57 FindJNI.cmake -rwx------+ 1 Administrators None  1669 Dec 30 09:45 FindJPEG.cmake -rwx------+ 1 Administrators None  1480 Dec 30 09:45 FindJasper.cmake -rwx------+ 1 Administrators None  7951 Dec 30 09:45 FindJava.cmake   How can this be?  It's like there are two different files with the same name in the same directory. Proving the so-called "Well Ordering Principle" Is there anything wrong with the following proof?  Theorem. Every non-empty subset $B \subset\mathbb{N}$ has a least member.  Proof. Assume not. Then, of necessity, we'd have to have $B=\varnothing$, for if $B$ contained even one $b\in\mathbb{N}$, then that $b$ would satisfy $b=min(B). $ Contradiction, end proof.  I get the sense there is something wrong here, but I can't seem to define exactly what. Also, is there a context where one can simply take this principle as an axiom, and not have to prove it? After all, it is extremely intuitive. Thanks. Which meta am I supposed to post on? I'm mostly active on  and we have a separate . Most of my questions on IT Security meta have answers with links here. So my question is, where am I supposed to post what i.e. feature request, bug report, behavior questions? How to prove that we are living in a 3+1D world? Is there any scientific experiment that can lead us to conclude we live in 3 spatial dimensions without the premise of the conception of limited dimensions?  Thank you all who helped in the improvement of this question (which was not clear at first).   EDIT:  I know that this can be a little philosophical, but it is also a scientific question.  Let's consider the scenario where the mankind was not ever able to see.  Let's also consider that this limitation could be surpassed thus not limiting us to reach a scientific and technological knowledge "similar" to what we have today.  Would this civilization of blind people reach the conclusion that they are living in a 3D spatial world?  Is the sense of touch enough to reach that conclusion? Is there any scientific experiment that can lead us to that conclusion without the premise of the conception of limited dimensions?  Would it be easier, harder, or just different to reach a conclusion predicted by the M-Theory? (please do not focus only on this last question)