Is there any way to get the length from the following:   {     "11": {         "id": "456",         "uuid": "b596362a-b5bb-4n94-8fd5-1e9fh6fd877b",         "name": "Test",         "description": "Test"     },     "22": {         "id": "739",         "uuid": "c4ccbddf-5177-482f-b5e8-cdd4f699e6b7",         "name": "Test2",         "description": "Test2"     },     "33": {         "id": "737",         "uuid": "m4ccbddv-5177-482f-b5e8-cdd4f699e6b7",         "name": "Test3",         "description": "Test3"     } }   The length should be 3. I tried to use JSON.stringify(data).length but this gives the length of the whole string.
What's the fastest way to count the number of keys/properties of an object?  It it possible to do this without iterating over the object?  i.e. without doing  var count = 0; for (k in myobj) if (myobj.hasOwnProperty(k)) count++;   (Firefox did provide a magic __count__ property, but this was removed somewhere around version 4.)
Should the network use thousands separators in numbers? Path connectedness of the set $\{(x,y):(x+1)^{2}+y^{2}\leq 1\}\cup\{(x,y):y=x\sin(\frac{1}{x}),x>0\}$ Let $A$ be the following subset of $\mathbb{R}^{2}$:$$A=\{(x,y):(x+1)^{2}+y^{2}\leq 1\}\cup\{(x,y):y=x\sin(\frac{1}{x}),x&gt;0\}$$ Then  $1.$ $A$ is connected.  $2.$ $A$ is compact.  $3.$ $A$ is path connected.  $4.$ $A$ is bounded.  It is clear that $A$ is unbounded as the graph of $x\sin(\frac{1}{x})$, so option $2$nd and $4$th are not correct. Again $A$ is connected by using the fact that closure of connected set is connected. But i am confused about path connectedness of $A$. Please help me about path connectedness of $A.$ Thanking you. How are app sales/acquisitions taxed in the US? Restoring MySQL database from physical files Is it possible to restore a MySQL database from the physical database files. I have a directory that has the following file types:  client.frm client.MYD client.MYI    but for about 20 more tables.  I usually use mysqldump or a similar tool to get everything in 1 SQL file so what is the way to deal with these types of files? Questions like looking for css templates, blog templates, icons ... In general, resources (let's leave the licensing terms aside for now) which you might need when building a project of your own. Where should those questions go?  They're definitely not on-topic on Stack', SuperUser maybe although I doubt it. Webapps? Hmm, probably not.  Is there a place where they would be on-topic on the SE network? Measures of variable importance in random forests I've been playing around with random forests for regression and am having difficulty working out exactly what the two measures of importance mean, and how they should be interpreted.  The importance() function gives two values for each variable: %IncMSE and IncNodePurity. Is there simple interpretations for these 2 values?  For IncNodePurity in particular, is this simply the amount the RSS increase following the removal of that variable? Why is electric field of an infinite plate constant at all points? I know from Gauss law, it is $\vec{E}=\dfrac{\sigma}{2 \epsilon_0}(\hat{n})$ at all points. But it doesn't make sense because of the inverse square nature of electric field which suggests if you move further away from the plane, electric field must reduce.   Then why is electric field of an infinite plate constant at all points? What are the differences between sudo, su, visudo, chroot, and gksu? What are the differences between sudo, su, visudo, chroot, and gksu ? ISP blocking port 25 Recently I needed to do weighted random selection of elements from a list, both with and without replacement. While there are well known and good algorithms for unweighted selection, and some for weighted selection without replacement (such as modifications of the resevoir algorithm), I couldn't find any good algorithms for weighted selection with replacement. I also wanted to avoid the resevoir method, as I was selecting a significant fraction of the list, which is small enough to hold in memory.  Does anyone have any suggestions on the best approach in this situation? I have my own solutions, but I'm hoping to find something more efficient, simpler, or both. Why Multiplication of zero by any number is zero? If I multiply $a$ by $0$, it means $a$ is added $0$ times, but I am not able to visualize $0$ times! Word for a male that prefers female companions (no slang such as "pimp") Does SE have a social life/relationships questions site I'm having trouble restarting a 2D game when the user presses the "New Game" button.  Structure of my game:  The game has several 'screens': Opening screen, instructions screen, main game screen, and a game-over screen.  Each screen is an instance of a class: OpeningScreen class, GameScreen class, etc.  There is a class named Main. This class has three roles.   It's the JFrame (the window) of the program. It has the main method - first class to run. It has a method that change's screens.   When the program starts, this class runs. When it first runs:   Creates a new instance of itself (it's a JFrame-type class). Creates an instance of every 'screen-class'. The constructor of each 'screen-class' takes the instance of Main as an argument: (aka: GameOverScreen gameOverScreen = new GameOver(this)). Creates a new JPanel named mainPanel, and adds it to the JFrame. Any screen to be displayed will be contained in this JPanel (The screens are also JPanel-type classes).   How the changeScreen() method works:  The signature of changeScreen() is this: changeScreen(JPanel from, JPanel to).  Whenever a screen needs to be changed, the current screen that is displayed calls this method, like so: main.changeScreen(this, main.InstructionsScreen). It removes the previous screen from mainPanel and adds the new screen to mainPanel. As said, these screens are created when the program launches.  This is the method that changes screens:   public void changeScreen(JPanel from, JPanel to){      mainPanel.remove(from);     mainPanel.add(to);      mainPanel.revalidate();     mainPanel.repaint();  }   My problem:  After a game is finished, the Game class calls the changeScreen method: main.changeScreen(this, main.GameOverScreen) .  This replaces the game screen with a game over screen. Pressing the "New Game" button in the game-over screen, calls main.changeScreen(this, main.GameScreen) .  The problem: Pressing the "New Game" button in the game-over screen, indeed displays once again the instance of the Game class. But this is the old instance, so the game is not restarted. It's already finished.  I tried to do the following changes in changeScreen():  public void changeScreen(JPanel from, JPanel to){      mainPanel.remove(from);      if(to.equals(gameScreen)){         gameScreen = null;         gameScreen = new GameScreen(this);     }     mainPanel.add(gameScreen);      mainPanel.revalidate();     mainPanel.repaint();  }   This should reset the gameScreen object. But this creates a delay of about 10 seconds when pressing the "New Game" button.  What would be a good way of restarting the game?  Thank you Combinatorial proof of $\sum_{i = 0}^{n} \binom{i}{r - 1} = \binom{n + 1}{r}$ and then use result to find a formula for $1^2 + 2^2 + \ldots + n^2$ Proof of continuity of Thomae Function at irrationals. In :  $$ \begin{align} t(x) = \begin{cases} 0 &amp; \text{if $x$ is irrational}\\ \frac{1}{n} &amp; \text{if $x = \frac{m}{n}$ where $\gcd(m,n) = 1$} \end{cases} \end{align} $$  I can prove the discontinuity at rational $b$ by taking a sequence of irrationals $x_n$ which converge to $b$.   But while going through an argument for continuity at irrationals.  I found this in a book.      On the other hand if $b$ is an irrational number and $\epsilon &gt; 0$   then there is a     natural number $n_0$ such that $1/n_0 &lt; \epsilon$.   There are only finite number of rationals with denominator less than   $n_0$ in the interval $(b-1,b+1)$. Hence we can find a $\delta &gt; 0$   such that $\delta$ neighbourhood of $b$ contains no rational with   denominator less than $n_0$.   I understand the rest of the proof. But I am unable to prove the emphasized text. Although I find it intuitive. I am looking for a way to get the output of a command when it is run from within a C++ program.  I have looked at using the system() function, but that will just execute a command. Here's an example of what I'm looking for:  std::string result = system("./some_command");   I need to run an arbitrary command and get its output. I've looked at , but I have not found anything that will give me what I need. On freedom in Sartre's existentialism I am reading "Existenstialism is a humanism", the text of the famous conference by Sartre in which he explains his own version of existentialism. I think is full of logical inconsistencies, but maybe it's just because I don't understand it or I don't know enough about existentialism. Anyway, my question is about a specific passage. After having "demonstrated" that there is no way one can derive an ethics outside of Man (God does not exist and reason is insufficient), he asks himself according to what principle a person should behave and he says:     "For I declare that freedom, in respect of concrete circumstances, can   have no other end and aim but itself; and when once a man has seen   that values depend upon himself, in that state of forsakenness he can   will only one thing, and that is freedom as the foundation of all   values. That does not mean that he wills it in the abstract: it simply   means that the actions of men of good faith have, as their ultimate   significance, the quest of freedom itself as such."   So it seems Sartre says that when deciding a course of action, people will always choose "freedom," (and also, elsewhere, that "freedom" is always a good thing). That is for him the only principle, the only moral that governs or should (because we can do wrong judgments about what is freedom) govern our action.  My questions are:  1) do I understand correctly Sartre's thinking?  2) He says: a) freedom is absolute; b) the values that man chooses are also absolute because no God or reason can tell him what to do, c) therefore man will choose freedom. Is there any logic in this statement? If I replace freedom with X where X is "pleasure" or "justice" or "pain" or "zero temperature", wouldn't I "demonstrate" by this logic that man will choose X?  3) assuming what I said makes any sense, how can existentialism ever find a rule of moral conduct? and if it does, what is it and how can be demonstrated? and if it cannot, why is or has been important at all as a philosophy?  Thanks! I need rules to drop some malicious Apache connections Why are some applications so hard to find in the Ubuntu Software Centre? Some applications don't pop up in the search even when you type in their name. Take for instance Sushi. When you type in "sushi" into the search box, it fails to throw up the application. Only when you type in "gnome-sushi" does it appear. This is despite the fact that the application has "sushi" by itself in the application description. There are other applications which don't spring to mind right now, but I've discovered before.