C++ Remove ':' from string to get integers
How do I iterate over the words of a string?
Difference between $\Delta$, $d$ and $\delta$ Doubly stochastic matrix proof A transition matrix $P$ is said to be doubly stochastic if the sum   over each column equals one, that is $\sum_i P_{ij}=1\space\forall i$.   If such a chain is irreducible and aperiodic and consists of $M+1$   states $0,1,\dots,M$ show that the limiting probabilities are given by   $$\pi_j=\frac{1}{1+M},j=0,1,\dots,M$$   I have no idea how to prove it but   If a chain is irreducible then all states communicate i.e $$P_{ij}&gt;0\space \text{and}\space P_{ji}&gt;0\space\forall i,j$$ If $d$ denotes the period of any state, if a chain is irreducible aperiodic, then $d(i)=1\forall i$   If $P_{(M+1)\times (M+1)}$ matrix and $\pi$ is the stationary distribution  $$\pi_j=\sum_iP_{ij}\pi_i\space j=0,1,\dots,M+1$$  but how I can get this expression? Why shouldn't I use getnonfreefonts to install additional fonts? Why shouldn't I use updmap when installing or removing fonts? What animal is a “weefil”? What animal is depicted in this image labelled “weefil”? I would like to grant the  app write access to external storage in Marshmallow.  The app does not request it explicitly (unlike other apps that seem to use the Storage Access Framework to do so).    In the app permissions screen, there is no permission listed for external storage, only for 'storage' (which seems to mean internal storage).  So there does not seem to be any direct way to grant this permission.   My phone is rooted and I could just run Syncthing as root - but this option creates many problems and sometimes results in the app hanging indefinitely.    Is there any other way around this problem? How to enable crash reports/core dumps/stack trace logging globally? Crashing bugs can be the most annoying ones, leading to data loss, downtime and frustrated users. It would be good if applications crashed less.  Because of the complexity of the machine context, crashes often can't be reproduced in reasonable time for an ordinary user. That doesn't mean that the bug is rare - It could simply mean that the thing that triggers it occurs rarely for each user (for example DST changes). Such bugs are unlikely to be fixed unless a lot of users report them. It would be good if more crashes were reported.  To debug crashes, the developers need as much unambiguous context as possible. Generated crash reports are good, because they're usually detailed and accurate. Users can't be expected to zealously observe and report all the context manually, so they often submit sparse and wrong information.  The target audience for a lot of applications is not developers or sysadmins, but rather the general public, at home or at work. Such users can't be expected to know how to collect crash information manually, or to install -dbg packages, but generated reports from such users can still be usable. Some applications have their own crash reporting tools, but in my experience these rarely work, and when they report that they failed to report the error there doesn't seem to be any information on how to do it manually (I've observed this for recent versions of both Firefox and Flash). System-wide generation of crash reports would be good.  Is there any sort of crash report generation* which can be enabled globally** without installing a ton of -dbg packages, reading the documentation of each and every application, or slowing a normal machine down to a crawl?  * Logs, core dumps, stack traces, whatever  ** Not necessarily for init, but at least for a significant subset of the applications running on a typical desktop Linux installation. In my experience GUI applications crash 100+ times more frequently than shell applications, so GUI applications would naturally be the focus. Search for all files with a .sql extension in folders and sub folders Logistic regression cost surface not convex I am building a simple logistic regression model on 2D data. Here is the input I use.    I built a logistic regression model using this data and it successfully is able to find the discriminating line between these two classes. Here is the separating line found by my program:    Also, just for debugging, I plotted number of iterations vs J(theta), which also looks fine:    Now, confusing part comes into play. I am investigating the cost surface of this model that the logistic regressions is doing the gradient descent on. I am considering three different loss functions. Sum-of-squared loss, hinge-loss, log-loss.  Hinge loss:    Log-loss:    Sum-of-squared loss:    As far as I know, both hinge loss, sum-of-squared loss and log-loss should produce a convex surface. When I look at my surfaces, however, sum-of-squared surface does not look convex to me. Why is that the case?  For convenience, here is the two critical functions from my code:  function retval = J(X, y, theta)     M = size(y, 1);     % sum of squared error     retval = (1/(2*M)) * sum((h(X, theta) - y).^2);  endfunction  function retval = h (X, theta)     % logistic     retval =  1 ./ (1+ exp(-1 * (X * theta))); endfunction I'm running Apache2 in a docker container, and want to write nothing to the disk, writing logs to stdout and stderr. I've seen a few different ways to do this (,  ) but these seem like hacks. Is there no way to do this by default?   To be clear, I do not want to tail the log, since that will result in things being written to the disk in the container. What are the best practices for battery longevity? Creating compressed GeoTIFF with QGIS Clipper tool? I have a geo-tiff created by Pix4D which is about 375 Mb in file size.   I have clipped it to a smaller area using Qgis 2.8(using Raster ‣ Extraction ‣ Clipper), and the output file is about 900 MB in size.  Why did the clipping process generate such a large file, when the source file was smaller?   How do I run the clipper tool so that it produces a smaller size? What is the difference between Early and Late Binding? What is the difference between early and late binding? C# List Sort by x then y Similar to , we want to sort by one element, then another.  we want to achieve the functional equivalent of   SELECT * from Table ORDER BY x, y     We have a class that contains a number of sorting functions, and we have no issues sorting by one element. For example:    public class MyClass {     public int x;     public int y; }    List&lt;MyClass&gt; MyList;  public void SortList() {     MyList.Sort( MySortingFunction ); }   And we have the following in the list:    Unsorted     Sorted(x)     Desired ---------    ---------    --------- ID   x  y    ID   x  y    ID   x  y [0]  0  1    [2]  0  2    [0]  0  1 [1]  1  1    [0]  0  1    [2]  0  2 [2]  0  2    [1]  1  1    [1]  1  1 [3]  1  2    [3]  1  2    [3]  1  2   Stable sort would be preferable, but not required. Solution that works for .Net 2.0 is welcome. Preserving signatures of decorated functions Does a bad grade in one course (with otherwise OK record) affect graduate admissions? I have a command that I want to have run again automatically each time it terminates, so I ran something like this:  while [ 1 ]; do COMMAND; done;   but if I can't stop the loop with Ctrl-c as that just kills COMMAND and not the entire loop.  How would I achieve something similar but which I can stop without having to close the terminal? I want to reinstall Ubuntu from scratch.   I have read ( and ) that it is recommended to have 3 partitions for the desktop installation: root, home and swap as having a separate home and root can simplify the process if you want to upgrade or reinstall Ubuntu (if you break something by mistake).  But there is no type of formula (that I can find) on how big each partition should be. I know this is somewhat dependant on what you plan to install. I want to have flexibility down the line to install new software without having to worry about shifting the partition sizes around.  Does anyone know of a formula or percentage breakdown that they have used to successfully calculate partition sizes?  i.e. x% of space will be allocated to the swap, y% of space to the root partition and z% of space to the home partition Realtime audio processing using Dynamic $E[e_te_s\Delta B_t\Delta B_s]$ for $\Delta B_t$ Brownian motion increments and $e_t(\omega)$ a measurable function. Understanding MongoDB BSON Document size limit