I have a strange syntax of for loop here :  for(--index ; index&gt;=0 ; --index)     // (--index) instead of (forInit)  {     //code }   I know for syntax is like this :  for ( [ForInit] ; [Expression] ; [ForUpdate] ) Statement   How do we have --index instead ForIniti in the loop. I thought that we can only initialise a variable at that place or can leave it blank like this :  for( ; index&gt;=0 ; index--)     {       //code     }   I haven't been introduced to this syntax before. Please explain why this is syntactically correct.
I have seen some very weird for loops when reading other people's code. I have been trying to search for a full syntax explanation for the for loop in C but it is very hard because the word "for" appears in unrelated sentences making the search almost impossible to Google effectively.  This question came to my mind after reading  which made me curious again.  The for here:   for(p=0;p+=(a&amp;1)*b,a!=1;a&gt;&gt;=1,b&lt;&lt;=1);   In the middle condition there is a comma separating the two pieces of code, what does this comma do? The comma on the right side I understand as it makes both a&gt;&gt;=1 and b&lt;&lt;=1.   But within a loop exit condition, what happens? Does it exit when p==0, when a==1 or when both happen?  It would be great if anyone could help me understand this and maybe point me in the direction of a full for loop syntax description.
What's the difference between Wubi and a regular "alongside Windows" installation? How to understand the drawbacks of K-means K-means is a widely used method in cluster analysis. In my understanding, this method does NOT require ANY assumptions, i.e., give me a dataset and a pre-specified number of clusters, k, and I just apply this algorithm which minimizes the sum of squared errors (SSE), the within cluster squared error.  So k-means is essentially an optimization problem.  I read some material about the drawbacks of k-means.  Most of them say that:   k-means assumes the variance of the distribution of each attribute (variable) is spherical;  all variables have the same variance; the prior probability for all k clusters is the same, i.e., each cluster has roughly equal number of observations;   If any one of these 3 assumptions are violated, then k-means will fail.  I could not understand the logic behind this statement. I think the k-means method makes essentially no assumptions, it just minimizes the SSE, so I cannot see the link between minimizing the SSE and those 3 "assumptions". I recently found out about Ubuntu for Android Multi-Core Smartphones and was digging around on the Ubuntu website as well as the Canonical website but have yet to find any information on if it available to the public yet ?  I am very interested to try it our on my Android and if it is available for the public am wondering where and how I can get a copy of "Ubuntu for Android" ?  If it is not available then perhaps someone can shed some lite on what sort of timeframe it will be until it is available to the general public? How to upgrade to GNOME 3.30 on Ubuntu 18.04.1 Confidence Interval for variance given one observation This is a problem from the "7th Kolmogorov Student Olympiad in Probability Theory":     Given one observation $X$ from a $\operatorname{Normal}(\mu,\sigma^2)$ distribution with both parameters unknown, give a confidence interval for $\sigma^2$ with a confidence level of at least 99%.   It seems to me that this should be impossible. I have the solution, but haven't read it yet. Any thoughts?  I'll post the solution in a couple days.  [Follow-up edit: Official solution posted below. Cardinal's solution is longer, but gives a better confidence interval. Thanks also to Max and Glen_b for their input.] The total number of subsets is $2^n$ for $n$ elements In my probability book, it says that to count the total number of subsets of n elements is a process of $n$ stages with binary choice of either adding this element to the subset or not to add it. Therefore, the total number is $$2^n$$  But, for instance, we have 3 elements, according to this formula, there are 2 to the power of 3 elements, namely 8, which are $${\emptyset},A,B,C, AB, AC, BC, ABC$$  However, I have a hard time of imagining the process or N stages binary choice that form this many subsets. Can anyone explain/help me to understand it? I mean, ABC, if we are making the choice of A, put it in or do not put it in, exactly which subset are we choosing to put in or not? Thank you. Get selected value in dropdown list using JavaScript What are the current travel restrictions on individuals entering the United States from regions affected by Covid-19? This community wiki explains the current restrictions by the United States of America on the entry of individuals who may pose a risk of transmission of the SARS-Cov2, the virus which causes the Covid-19 disease. For all $x,y\in\mathbb{R}$   define that $x\equiv y$   if $x^{2}=y^{2}$  . Then $\equiv$  is an equivalence relation on $\mathbb{R}$  , there are infinitely many equivalence classes, one of them consists of one element and the rest consist of two elements.  Solution  True. To show that \equiv  is reflexive we need to show that \forall x\in\mathbb{R}  :x=x.  Let x\in\mathbb{R}  , x\equiv\mbox{\ensuremath{x}}  if x^{2}=x^{2},   which is obvious.  [x]  ={y\in\mathbb{R}  |x\equiv y}  =[0]={y\in\mathbb{R}|0\equiv y}={0}  . Hence y^{2}  =0^{2}   =0   which implies that y=0  . Prove that there exist two integers such that i - j is divisible by n. Here's the full question:  Prove that, for any $n + 1$ integers, $\{x_0, x_1, x_2, . . . , x_n\}$, there exist two integers $x_i$ and $x_j$ with $i \neq j$ such that $x_i − x_j$ is divisible by $n$.  Now, the integers aren't necessarily consecutive, positive, or without repeats. I've tried breaking this into cases, such as "$x_i = x_j, \dfrac{0}{n} = 0$" etc. But I don't think it's possible to exhaust the cases.  I feel like there should be an easy way to contradict this one, by saying that $x_i - x_j$ isn't divisible by $n$. But I just wasn't getting anywhere with that one.  I thought about using induction, but I would have just as hard a time proving this for $n$ integers before $n+1$ integers, so I don't think it would be possible for me to do it that way.  If anyone could help out, that would be wonderful. I'm pretty stuck here. Why did the TIE fighter in The Force Awakens have life support? In The Force Awakens, Finn and Poe steal and escape in a TIE wearing no personal life support apparatus. TIEs have been upgraded with shields, hyperdrives (for "/sf"), weapons etc, but as far as I know they weren't upgraded with built in life support.   Finn and Poe should have frozen and/or suffocated after hitting space in the TIE. In the Rebels series, Sabine did the same thing. I've looked at what Wookieepedia states about the TIE as well as the old video game Star Wars "TIE Fighter".  Does the movie or any other work explain how Poe and Finn survived? How do I disable the screensaver/lock? When I'm watching a film in Mythtv the screen turns to black every 10 - 15 mins and I have to log back into Ubuntu. Very annoying!  How do I disable the black screen / screensaver / logout in Unity?  There no longer seems to be any options to turn the screen saver off as there were in Ubuntu prior to Unity. Finding distance between points in two different layers along route in ArcMap? I need to find the distance between points in separate layers along a stream network. I have source sites for macro-invertebrates and sites where they are lacking. I need to find the distance between the source sites and the sites where they are not through the stream network.   I tried the linear referencing toolbox but the locate features along route tool can only use one layer of points and has not way to differentiate between sources and not source sites.  Any ideas?  I am using ArcMap 10.3? How to replace a string on the 5th line of multiple text files? I want to replace the 5th line of multiple text files (file1.txt,file2.txt,file3.txt,file4.txt) with the string " Good Morning " using a single terminal command.  All the text files are located on my ~/Desktop.  Note: My desktop consists of 6 .txt files.I want to apply the change to above mentioned 4 text files only. Similar to  on the bugs in Minecraft, I would like a complete list of what error codes exist in Minecraft and how they occur, as well as how they can be resolved. Showing $\gcd(2^m-1,2^n+1)=1$ A student of mine has been self-studying some elementary number theory. She came by my office today and asked if I had any hints on how to prove the statement      If $m$ is odd then $\gcd(2^m-1,2^n+1)=1$.    It's been a while since I took number theory and I'm not sure what to do. She said she is learning about congruences, primitive roots, and power residues.  She has not taken any group theory. Why are there so many bottomless pits in Star Wars Why must I wait two days before accepting my own answer? I got this message today while trying to accept my answer on my own question.  Why must I wait this time, if I am sure that the answer I answered is the right one, just want to understand the point of view?  I faced that just today on Super user and didn't get this message before. Is a Squib a Muggle? ‘And what on earth’s a Squib?’ said Harry.   To his surprise, Ron stifled a snigger.   ‘Well – it’s not funny really – but as it’s Filch ...’ he said. ‘A Squib is someone who was born into a wizarding family but hasn’t got any magic powers. Kind of the opposite of Muggle-born wizards, but Squibs are quite unusual. If Filch’s trying to learn magic from a Kwikspell course, I reckon he must be a Squib. It would explain a lot. Like why he hates students so much.’ Ron gave a satisfied smile. ‘He’s bitter.’   Chamber of Secrets - pages 110-111 - British Hardcover   If a Squib is 'kind of the opposite of a Muggle-born wizards' wouldn't that make a Squib more Muggle than wizard? Does a Muggle strictly have to be born to Muggle parents to be considered a Muggle, or can the lack of magic render a person, even of wizarding parentage, a Muggle?  Hermione can say in all truthfulness that she is a 'Muggle-born witch.' The nickname (albeit derogatory) for a Muggle-born is 'Mudblood.' Filch can say in all truthfulness that he is a 'wizarding-born non-magic person,' which, according to Hagrid is a Muggle.  'Squib' may be derogatory in the same way as 'Mudblood' is. Neville laments his family thought he was a Squib when he showed no magical tendencies as a child; the Longbottoms were so rattled at the thought of Neville being a Squib that they, among other things, threw him out a second-story window to see if he would bounce. So could 'Squib' actually be a derogatory term meaning the opposite of 'Mudblood'? After all, the Ministry doesn't allow Squibs to register as magical beings, and many Squibs are schooled and trained in Muggle professions. Squibs don't get a Hogwarts letter.    Wizards can be born to Muggles. Can Muggles be born to wizards?  ETA 11.22.14: In regard to this question, I was glancing through Philosopher's Stone, and I came across this, that Neville said:     ‘Well, my gran brought me up and she’s a witch,’ said Neville, ‘but the family thought I was all Muggle for ages. My great-uncle Algie kept trying to catch me off my guard and force some magic out of me – he pushed me off the end of Blackpool pier once, I nearly drowned – but nothing happened until I was eight.’   Philosopher's Stone - page 93 - Bloomsbury - chapter seven, The Sorting Hat   Could what Neville says contribute to the theory and/or conclusion that Squibs are, or are not, Muggles? How do we apply what Neville said? Handling data in a PHP JSON Object Trends data from Twitter Search API in JSON.  Grabbing the file using:  $jsonurl = "http://search.twitter.com/trends.json"; $json = file_get_contents($jsonurl,0,null,null); $json_output = json_decode($json);   How do I work with data from this object. As an array? Only really need to extract data from the [name] values.  JSON object contains:  stdClass Object (     [trends] =&gt; Array         (             [0] =&gt; stdClass Object                 (                     [name] =&gt; Vote                     [url] =&gt; http://search.twitter.com/search?q=Vote                 )              [1] =&gt; stdClass Object                 (                     [name] =&gt; Halloween                     [url] =&gt; http://search.twitter.com/search?q=Halloween                 )              [2] =&gt; stdClass Object                 (                     [name] =&gt; Starbucks                     [url] =&gt; http://search.twitter.com/search?q=Starbucks                 )              [3] =&gt; stdClass Object                 (                     [name] =&gt; #flylady                     [url] =&gt; http://search.twitter.com/search?q=%23flylady                 )              [4] =&gt; stdClass Object                 (                     [name] =&gt; #votereport                     [url] =&gt; http://search.twitter.com/search?q=%23votereport                 )              [5] =&gt; stdClass Object                 (                     [name] =&gt; Election Day                     [url] =&gt; http://search.twitter.com/search?q=%22Election+Day%22                 )              [6] =&gt; stdClass Object                 (                     [name] =&gt; #PubCon                     [url] =&gt; http://search.twitter.com/search?q=%23PubCon                 )              [7] =&gt; stdClass Object                 (                     [name] =&gt; #defrag08                     [url] =&gt; http://search.twitter.com/search?q=%23defrag08                 )              [8] =&gt; stdClass Object                 (                     [name] =&gt; Melbourne Cup                     [url] =&gt; http://search.twitter.com/search?q=%22Melbourne+Cup%22                 )              [9] =&gt; stdClass Object                 (                     [name] =&gt; Cheney                     [url] =&gt; http://search.twitter.com/search?q=Cheney                 )          )      [as_of] =&gt; Mon, 03 Nov 2008 21:49:36 +0000 )