Is it possible to sum all row which has been summed?   For instance I have this query:      SELECT SUM(registered) AS `totalOftheDay`    FROM table    WHERE DATE(ds.register_time) BETWEEN '2015-03-01 00:00:00' AND '2015-03-30 23:59:59'    GROUP BY DATE(ds.register_time)   What I need is when total of registered people has been summed by date (group by) then I want to sum it again base on the month. So I got two results: based on date and based on month. How to do that if it is possible to do that in sql query?    Thanks for the help. Cheers!   For example:       +-----------------------+----------------+       register_time             registered     +-----------------------+----------------+       2015-03-01 01.00.00           20             2015-03-01 02.00.13           40             2015-03-01 03.01.10           60             2015-03-01 04.20.00           80             2015-03-01 05.01.10           20             2015-03-01 13.00.00           20            ----------------------------------------TOTALOFTHEDAY SUM 240       2015-03-02 13.00.00           20             2015-03-02 14.00.00           20             2015-03-02 15.00.00           20            ----------------------------------------TOTALOFTHEDAY SUM 60       2015-03-03 13.00.01           20             2015-03-03 14.00.02           20             2015-03-03 15.00.03           20             2015-03-03 16.00.04           20             2015-03-03 17.00.05           20            ----------------------------------------TOTALOFTHEDAY SUM 100   After I summed the total registered user by date, then I want to sum it again:       240 + 60 + 100 = 400 (TOTALOFTHEMOTHN)
I tried to find this question somewhere else on here, and found a couple that were similar to it -- but all the answers seemed pretty convoluted, and I think it was surprising to me because I just imagined that SQL would have a way easier way to do this.  Essentially, I'm using a GROUP BY to group two values on top of each other. The coding is simple and works well, where I get these results using WITH ROLLUP at the end:  Type    Person  Count Type A  Person 1    10 Type A  Person 2    91 Type A  Person 3    13 Type A  Person 4    10 Type A  Person 5    2 Type A  NULL        126 Type B  Person 6    16 Type B  Person 7    63 Type B  Person 8    15 Type B  Person 9    22 Type B  Person 10   16 Type B  Person 11   3 Type B  Person 12   20 Type B  Person 13   44 Type B  NULL        198 NULL    NULL        360   Is there an easy way to substitute something saying if "NULL" is in the "Person" column, then make NULL AS "Subtotal" and if "NULL" is in the "Type" column, NULL AS "Grand Total?"  And if that's weirdly complicated, I'd be totally fine with just calling all of them "Total."  Thanks!
When performing k-fold cross validation, I understand that you obtain the accuracy metrics by pointing all the folds except one at that one fold and make predictions, and then repeat this process $k$ times.  You can then run accuracy metrics on all of your instances (precision, recall, % classified correctly), which ought to be the same as if you calculated them each time and then averaged the result (correct me if I'm wrong).  The end result you want is a final model.  Do you average the models obtained to make your set of $k$ predictions to end up with the model that has the accuracy metrics obtained by the above method? How to create an extruded halftone effect in illustrator or photoshop How can I prevent my mail from being classified as spam? I have two checkboxes in a lightning component, when we click on the first checkbox it marks true to the other checkbox, it works well only with the UI tags but doesn't work when I convert it to lightning tag  &lt;ui:inputCheckbox aura:id="box3" change="{!c.selectAll}"/&gt;  &lt;ui:inputCheckbox aura:id="boxPack" value=""                                                          change="{!c.checkboxSelect}"/&gt;   below are the lightning tags  &lt;lightning:input type="checkbox" aura:id="box3" onclick="{!c.selectAll}"/&gt;  &lt;lightning:input type="checkbox" aura:id="boxPack" value=""                                                          onclick="{!c.checkboxSelect}"/&gt;   controller  checkboxSelect: function(component, event, helper) {         // get the selected checkbox value           var selectedRec = event.getSource().get("v.value");         // get the selectedCount attrbute value(default is 0) for add/less numbers.          var getSelectedNumber = component.get("v.selectedCount");         // check, if selected checkbox value is true then increment getSelectedNumber with 1          // else Decrement the getSelectedNumber with 1              if (selectedRec == true) {             getSelectedNumber++;         } else {             getSelectedNumber--;         }         // set the actual value on selectedCount attribute to show on header part.          component.set("v.selectedCount", getSelectedNumber);     },      selectAll: function(component, event, helper) {         //get the header checkbox value           var selectedHeaderCheck = event.getSource().get("v.value");         // get all checkbox on table with "boxPack" aura id (all iterate value have same Id)         // return the List of all checkboxs element          var getAllId = component.find("boxPack");         // If the local ID is unique[in single record case], find() returns the component. not array            if(! Array.isArray(getAllId)){             if(selectedHeaderCheck == true){                  console.log('true');                 component.find("boxPack").set("v.value", true);                 component.set("v.selectedCount", 1);             }else{                 component.find("boxPack").set("v.value", false);                 component.set("v.selectedCount", 0);             }         }else{             // check if select all (header checkbox) is true then true all checkboxes on table in a for loop               // and set the all selected checkbox length in selectedCount attribute.             // if value is false then make all checkboxes false in else part with play for loop              // and select count as 0              if (selectedHeaderCheck == true) {                 for (var i = 0; i &lt; getAllId.length; i++) {                     component.find("boxPack")[i].set("v.value", true);                     component.set("v.selectedCount", getAllId.length);                 }             } else {                 for (var i = 0; i &lt; getAllId.length; i++) {                     component.find("boxPack")[i].set("v.value", false);                     component.set("v.selectedCount", 0);                 }             }          }        }, How to get a file's Media Type (MIME type)? How do you get a Media Type (MIME type) from a file using Java?  So far I've tried JMimeMagic &amp; Mime-Util. The first gave me memory exceptions, the second doesn't close its streams properly. How would you probe the file to determine its actual type (not merely based on the extension)? I'm using Ubuntu 16.04.3 LTS, on a 64-bit system.   There are two available updates in "Updates" section of the Ubuntu Software, named OS Updates and Software respectively:      I usually update through Software Updater utility, (and occasionally used sudo apt update and sudo apt upgrade as recommended by some software installation tutorials)- anything that I think is required. So why is Ubuntu Software showing these updates? Should I install them?  As far as I know, these types of updates, if you look at the list, aren't ever available in the Software Updater. Usage of italics in writing What is the difference between data mining, statistics, machine learning and AI?  Would it be accurate to say that they are 4 fields attempting to solve very similar problems but with different approaches? What exactly do they have in common and where do they differ? If there is some kind of hierarchy between them, what would it be?  Similar questions have been asked previously but I still don't get it: The infinite product of the sines of all positive integers is zero I tried to prove that $\prod\limits_{k = 1}^\infty  {\sin k = 0}$  Define $$P(m)=\prod\limits_{k = 1}^m  {\left|\sin k\right|}$$  then I take the logarithm of both sides $$\log P(m)=\log \prod\limits_{k = 1}^m  {\left|\sin k\right|}$$  which can be written as $$a_m=\log P(m)=\sum\limits_{k = 1}^m  {\log\,\left|\sin k\right|}$$ for any $k\in\mathbb{N}$ we have $0&lt;\left|\sin k\right|&lt;1$, so all terms of the sum above is strictly negative.  I say that the sequence diverges: $\left\{a_m\right\}_{m\in\mathbb{N}}\to\,-\infty$  This is a delicate point on which I have some doubts.  I know that  $$\int\limits_0^\pi  {\log \left|\sin x\right|{\text{ d}}x}  =  - \pi \log 2$$ and that the function $\log \left|\sin x\right|$ is periodic with period $\pi$,  so the integral from 1 to $\infty$ diverges to $- \infty$. Then the series diverges as well for the integral test for convergence.  As $\log P(m)\to\, -\infty$ we can say that $P(m)\to\,0$ as $m\to\,\infty$  Therefore $$\mathop {\lim }\limits_{m \to \infty } \prod\limits_{k = 1}^m {\left| {\sin k} \right| = \mathop {\lim }\limits_{m \to \infty } \prod\limits_{k = 1}^m {\sin k = \prod\limits_{k = 1}^\infty  {\sin k = } 0} }.\quad \blacksquare$$ Do I need to enable the publishing features to change a Team Site's master page? When building a SharePoint 2010 site, we have a root Publishing site that has been branded up using a custom Master Page.  We'd now like to add some Team Sites below the publishing site, and have our branding and other look and feel changes applied there too, and for that we need to change the "System Master" setting of the Team Site.  The "Master page" options in the site settings are only available if I've enabled the Publishing features in the team site, but I'd rather not do this if I can avoid it.  Ideally, this should be enabled as soon as a new team site is created, without the site owner having to change the site settings. SOAP or REST for Web Services? When can I make opportunity attacks? What provokes an opportunity attack?  In 3.X moving out of a threatened square, standing up from prone, casting a spell (unless cast defensively), or making a ranged attack provoked, while in 4e moving out of a threatened square or making a ranged/area attack provoked. How to support different screen size in android Square Fibonacci numbers Are there Fibonacci numbers other than $F_0 = 0 = 0^2, F_1 = F_2 = 1 = 1^2,$ and $F_{12} = 144 = 12^2$ which are square numbers? If not, what is the proof? Pluralization rule for "five-year-old children", "20 pound note", "10 mile run" Understanding ROC curve No input file specified How to use a custom time in browser to test for client vs server time difference Package in Java In how many ways can a number be expressed as a sum of consecutive numbers?