I'd written a tiny c program. The code compiled successfully by GCC 4.8.5 20150623 (Red Hat 4.8.5-4) with -std=c99, but gave me a warning. I cannot deal with the warning, and I even don't known what's wrong with it. The code is here:  #include &lt;stdio.h&gt; #define COLS 4 int SumOf2DArray(const int array[][COLS], int rows); int SumOfArray(const int array[], int element_number); int main(void) {   int sum_of_array0, sum_of_2d_array, sum_of_array1;   int *array, (*dimensions)[COLS];   array = (int [2]){10, 20};   dimensions = (int [2][COLS]){{1, 2, 3, -9}, {4, 5, 6, -8}};   sum_of_array0 = SumOfArray(array, 2);   sum_of_2d_array = SumOf2DArray(dimensions, 2);   sum_of_array1 = SumOfArray((int []){4, 4, 4, 5, 5, 5}, 6);   printf("sum_of_array0 = %d \t sum_of_2d_array = %d \t sum_of_array1 = %d\n",     sum_of_array0, sum_of_2d_array, sum_of_array1);   return 0; } int SumOf2DArray(const int array[][COLS], int rows) {   int sum_of_2d_array = 0;   for (int rows_i = 0; rows_i &lt; rows; rows_i++) {     for (int cols_i = 0; cols_i &lt; COLS; cols_i++) {       sum_of_2d_array += array[rows_i][cols_i];     }   }   return sum_of_2d_array; } int SumOfArray(const int array[], int element_number) {   int sum_of_array = 0;   for (int i = 0; i &lt; element_number; i++) {     sum_of_array += array[i];   }   return sum_of_array; }   And the warning is here:  chapter10_compound_literals.c: In function ‘main’: chapter10_compound_literals.c:25:3: warning: passing argument 1 of ‘SumOf2DArray’ from incompatible pointer type [enabled by default]    sum_of_2d_array = SumOf2DArray(dimensions, 2);    ^ chapter10_compound_literals.c:15:5: note: expected ‘const int (*)[4]’ but argument is of type ‘int (*)[4]’  int SumOf2DArray(const int array[][COLS], int rows);   Now, I assume I have a 2d-array: int array[2][3] = {{1, 2, 3}, {3, 4, 5}}, and I have a function: int SumOf2DArray(const int array[][3], int rows).   The way in the code above is using a pointer(int (*pointer)[3] = array), but get a warning, and I have tried to pass argument using array directly, but the same warning.  How I can pass the array to the function?
The following code snippet (correctly) gives a warning in C and an error in C++ (using gcc &amp; g++ respectively, tested with versions 3.4.5 and 4.2.1; MSVC does not seem to care):  char **a; const char** b = a;   I can understand and accept this. The C++ solution to this problem is to change b to be a const char * const *, which disallows reassignment of the pointers and prevents you from circumventing const-correctness ().  char **a; const char* const* b = a;   However, in pure C, the corrected version (using const char * const *) still gives a warning, and I don't understand why. Is there a way to get around this without using a cast?  To clarify: 1) Why does this generate a warning in C?  It should be entirely const-safe, and the C++ compiler seems to recognize it as such. 2) What is the correct way to go about accepting this char** as a parameter while saying (and having the compiler enforce) that I will not be modifying the characters it points to? For example, if I wanted to write a function:  void f(const char* const* in) {   // Only reads the data from in, does not write to it }   And I wanted to invoke it on a char**, what would be the correct type for the parameter?
Auto confirm when running bash scripts? Glossaries: Make a glossary entry recognizable in printing How do you make it visible to the reader that the printed word/term is an entry in the glossary? In my PDF on the computer, I just see it because I use the hyperref package and there's a red box around it. But when printing it, there's just nothing that makes it visible to the user.  Is there a typographically good and common way of doing this? Skewness, kurtosis and how many standard deviations values are from the mean As is well known for the normal distribution, 68% of the probability mass is within one standard deviation of the mean, 95% within two standard deviations and 99.7% within 3 standard deviations.   However, I have some empirical distributions that are leptokurtic and negatively skewed. In such circumstances is there a formula based on their higher-order moments to calculate how much of the probability mass is within so many standard deviations of the mean?   I have a measurement and would like to give some sense of how far it is from the midpoint (mean or some other measure of central tendency).  Can this be done? Waiting for user input with a timeout I have searched but apparently my google foo is weak. What I need is a way to prompt for user input in the console and have the request time out after a period of time and continue executing the script if no input comes in. As near as I can tell, Read-Host does not provide this functionality. Neither does $host.UI.PromptForChoice() nor does $host.UI.RawUI.ReadKey(). Thanks in advance for any pointers.  EDIT: Much thanks to Lars Truijens for finding the answer. I have taken the code that he pointed out and encapsulated it into a function. Note that the way that I have implemented it means there could be up to one second of delay between when the user hits a key and when script execution continues.  function Pause-Host {     param(             $Delay = 1          )     $counter = 0;     While(!$host.UI.RawUI.KeyAvailable -and ($counter++ -lt $Delay))     {         [Threading.Thread]::Sleep(1000)     } } Basic mathematical induction regarding inequalities These are just the examples from my textbook, but I don't think it did not explain well.  One of the problem was to prove the inequality   $$n&lt;2^n$$  for all integers $n$.  I understand we assume if $P(n)$ is true, $P(k+1)$ is true.  Thus $k+1&lt; 2^{k+1}$  But in the text book, they added one more line that I don't understand:  $$k+1&lt;2^k+1 \le 2^k+2^k=2\cdot2^k=2^{k+1}$$  I understand  $$k+1&lt;2^{k+1}$$  But how do I know $2^k+1$ is larger than $k+1$, and smaller than $2^{k+1}$?  I have one another example just in case,  proving $2^n&lt;n!$ using induction.  $$2^{k+1}=2\cdot 2^k&lt;2\cdot k!&lt;(k+1)k!=(k+1)!$$  I understand we should start with $2^{k+1}&lt;(k+1)!$, but  Where did $2\cdot k!$ come from? Textbook says it came from inductive hypothesis, but I still don't get it.  Please advise. So I am on my college network which requires me to sign in to the browser before I start using the internet. I do so succesfully but on a clean install of Ubuntu, when I try to do sudo apt update, I get the following output:  $ sudo apt update Get:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease [2,847 B] Err:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease                     Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [2,854 B]     Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease              ... Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [2,855 B]    Err:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease ... Get:4 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [2,857 B] Err:4 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) Fetched 11.4 kB in 0s (18.3 kB/s) Reading package lists... Done E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?) ... E: Some index files failed to download. They have been ignored, or old ones used instead.   But when I do wget http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease, I get this output success:  2017-04-01 05:34:57  http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease Resolving in.archive.ubuntu.com (in.archive.ubuntu.com)... 91.189.88.162, 91.189.88.149, 91.189.88.152, ... Connecting to in.archive.ubuntu.com (in.archive.ubuntu.com)|91.189.88.162|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 246846 (241K) Saving to: ‘InRelease.3’  InRelease.3         100%[===================&gt;] 241.06K   110KB/s    in 2.2s      2017-04-01 05:35:00 (110 KB/s) - ‘InRelease.3’ saved [246846/246846]   Clearly I have internet access from my browser and on wget but when I do sudo apt (or apt-get) update I get this error.  PS: This question is not similar to other threads as their solutions do not seem to work on mine        As I have found out, this problem is happening only to me, not others on the college network. Despite setting up the network according to instructions, this still happens. Any more help would be appreciated  EDIT: So as it turns out, 50% of us in the college are facing this issue, while 50% aren't despite having no issues with the hardware and sudo apt update before the last week. Thanks to @David Foerster for helping me throughout all this time.  As it stands, the issue has been raised to our college's networking department :) Key to get help about current function I'm working on a map in Bedrock Edition, and I need to have a command block at the end that says "Congratulations [player], you win!" Because it's a map, I cant just have it say a specific player's name, and I've seen maps that do exactly what I want mine to do. How do I format the command to allow this? Most people know the famous equation:    What were his steps of thinking for this equation that helped us discover so much about our world? Need to print out iPhone text messages I have a court case and have text messages on my iPhone I need to transfer to my iPad email for evidence.  Every time I try it doesn't work, it will send them to my iMessage but not my email.  I need to print them out How do I do this? I use the babel package in order to write in greek with font "kerkis".  I want to add code in english ("courier new" font) to my latex document but I get some difficulties.  Can anybody help me, please. Thank you in advance.  \documentclass[12pt]{article} \usepackage[english,greek]{babel} \usepackage[utf8x]{inputenc} \usepackage{graphicx} \usepackage{fancybox} \usepackage{verbatim} \usepackage{courier} \usepackage{kerkis} \usepackage{float} \usepackage{geometry} \usepackage{fancyhdr} \usepackage{titlesec} \usepackage{tocloft} \usepackage{hyperref} \usepackage{afterpage} \usepackage{color}    \usepackage{listings}  \renewcommand{\lstlistingname}{Κώδικας}  \lstset{  %matlab   backgroundcolor=\color{white},     basicstyle=\normalsize,    % COURIER NEW?        commentstyle=\color{green},    % comment style   escapeinside={\%*}{*)},           extendedchars=true,               frame=single,                              keywordstyle=\color{blue},       % keyword style   numbers=left,                     numbersep=5pt,                     numberstyle=\normalsize\color{black},    rulecolor=\color{black},           stepnumber=1,                      stringstyle=\color{magenta},     % string style }   \begin{document}  \selectlanguage{greek} Ελληνικά: \textlatin{this word means greek}  \selectlanguage{english} Now I write in english  \selectlanguage{greek} Ελληνικά  %\selectlanguage{english}???  \begin{lstlisting}[caption = \textlatin{example1.m}] { % Entropy E = 0; for i = 1:J     if p(i) ~= 0         E = E + p(i)*log2(1/p(i));     end end } \end{lstlisting}  \end{document} I just upgraded my texlive distribution and can no longer insert space in table rows using \\[x pt] syntax when colortbl is loaded.  It seems that recent changes to array.sty might be the problem as this is the only package to change recently.  Can anyone suggest a workaround?  MWE  \listfiles \documentclass{article} \usepackage{colortbl} \begin{document} \begin{tabular}{l}   \hline   No space below with \texttt{colortbl.sty} loaded. \\[10mm]   \hline \end{tabular} \end{document}   File versions in use:   article.cls    2014/09/29 v1.4h Standard LaTeX document class   size10.clo    2014/09/29 v1.4h Standard LaTeX file (size option) colortbl.sty    2012/02/13 v1.0a Color table columns (DPC)    array.sty    2018/04/07 v2.4g Tabular extension package (FMi)    color.sty    2016/07/10 v1.1e Standard LaTeX Color (DPC)    color.cfg    2016/01/02 v1.6 sample color configuration   pdftex.def    2018/01/08 v1.0l Graphics/color driver for pdftex Unable to cover get set in apex test class Get names of all keys in the collection Subclassing tuple with multiple __init__ arguments Korean characters scrambled [XeLaTeX; Noto Sans Korean]? I was trying to find a font which has obsolete jamo and the right combining behaviour. Yesterday I found out about , which seems to have both of these. However, when I use it in XeTeX, I get some seemingly-arbitrary hanja (or blank spaces) instead of the expected characters.  (I’m guessing the composing behaviour will fix itself when the right characters are selected. And yes, I know that Code2000 is working perfectly in this example, but unfortunately it is the ugliest font in the world. :p)  MWE:  \documentclass{article} \usepackage{fontspec}  % 1. precomposed: U+BB47 % 2. separate jamo: U+1106, U+116E, U+11BA % 3. obsolete [separate jamo]: U+113B, U+119F, U+11EB \newcommand\test[1]{#1 &amp; {\fontspec{#1}{뭇; 뭇; ᄻᆟᇫ}} \\}  \begin{document}  \begin{tabular}{rl} \test{Arial Unicode MS} \test{Batang} \test{Code2000} \test{Gulim} \test{GungSeo} \test{HeadLineA} \test{Nanum Brush Script} \test{Nanum Myeongjo} \test{Nanum Pen Script} \test{Noto Sans Korean} \test{PCMyungjo} \test{PilGi} \test{Adobe Gothic Std} \test{Adobe Myungjo Std} \test{Apple SD Gothic Neo} \test{AppleGothic} \test{AppleMyungjo} \end{tabular}  \end{document} How do I get a block with data to place myself? When $z\neq 0$, $\arg z$ is defined to be the set $\{\theta \in \mathbb{R} : z=|z|e^{i\theta}\}$.  What if $z=0$? Usually does one leave the argument of $0$ undefined? Or is $\arg 0 = \mathbb{R}$? How to compute the integral $\int_{0}^{\infty} \frac{x^{1/3}}{1+x^{2}} \ dx$ I want to compute this integral $$\displaystyle\int_{0}^{\infty} \frac{x^{1/3}}{1+x^{2}} \ dx$$  What I did was the following. I substituted $x=t^{6}$, so that my $dx= 6t^{5} \ dt$ and so the integral changes to $$\int_{0}^{\infty} \frac{t^2}{1+t^{12}} \cdot 6 t^{5} \ dt =6 \cdot \int_{0}^{\infty} \frac{t^7}{1+t^{12}} \: dt$$  Now If I substitute $t^{4}=v$ then what I will be having is the following integral $$\frac{6}{4}\cdot \int_{0}^{\infty} \frac{v}{1+v^{3}} \ dv$$  Now I can write $1+v^{3} = (1+v) \cdot (1-v+v^{2})$ and so I have   \begin{align*} \int_{0}^{\infty} \frac{v}{1+v^{3}}\: dv &amp;= \int_{0}^{\infty}\biggl[\frac{1}{3}\cdot \frac{v+1}{1-v+v^{2}} - \frac{1}{3} \cdot \frac{1}{1+v}\biggr]\: dv \end{align*}  Now the point is that the integral of $1/(1+v) \to \infty$, so I am not sure if this is the right way to do. Can anyone suggest anything? Create line heatmap with QGIS I have loaded my bike tours as .gpx files into QGIS.    It already looks quite nice but I was wondering if it might be possible to create something similar to the strava heatmap with tools of QGIS.     I have tried to generate points along the lines and use kernel density but it just does not look nice as a raster layer.  Any suggestions?