How i can deledete comment from listings code? I included source code file with \lstinputlisting{file.m} where file.m is matlab file. I want delete comment from file. % This is a comment function var = myfunction()   I tried to use comment commentstyle=\color{white} but the result isn't as I expected cause between code there are some withe line that i want totally remove.  Thanks in advance
I'm looking for an easy and robust way to strip all the comments from a listing. My approach (passing \@gobble to the commentstyle key) correctly removes all the one-line comments and block comments. However, the white space left behind by by block comments remains, creating useless gaps in my listing. See the screenshot below (the red rectangle is my emphasis). Any idea?    \documentclass{article}  \usepackage{xcolor} \usepackage[T1]{fontenc} \renewcommand{\ttdefault}{pcr} \usepackage{listings}  \makeatletter \lstset% {%   basicstyle   = \ttfamily,   morecomment  = [l]{//},   morecomment  = [s]{/*}{*/},   frame        = single,   commentstyle = \itshape\color[gray]{.5},   rulecolor    = \color{black},   breaklines, } \makeatother  \usepackage{filecontents} \begin{filecontents*}{sample.c} #include &lt;stdio.h&gt;  /*  block comment taking up white space */ main() {     float fahr, celsius;     float lower, upper, step;     lower   = 0;    /* lower limit of temperature scale */     upper   = 300;  /* upper limit */     step    = 20;   /* step size */     celsius = lower;     printf("\nCelsius\tFahr\n");     while (celsius &lt;= upper)        {         fahr = (9.0/5.0) * celsius+32.0;         printf("%3.0f\t%6.1f\n", celsius, fahr);         celsius = celsius + step;     } } \end{filecontents*}  \begin{document} \makeatletter \lstinputlisting[caption={with comments}]{sample.c} \lstinputlisting[caption={without comments},commentstyle={\@gobble}]{sample.c} \makeatother \end{document}
How to retrieve and display images from a database in a JSP page? So I have seen the similar question and answers on here for $x^4 +1$, but I am having trouble extending anything there to this polynomial... I understand it is fairly trivial with Galois theory, but my class has just barely covered Field Extensions, so suffice it to say we have no Galois theory to play with.  I managed to prove it for the primes such that $p \equiv 1, 7 \pmod 8$, by noting that $2$ is a square modulo those primes and thus $x^4 - 2x^2 +1 = (x^2 -1 + 2qx)(x^2 - 1 - 2qx)$ for those $\mathbb{Z}_p$... however, trying to get a similar result for $3 \pmod 8$ and $5 \pmod 8$ has been stumping me for a long time, I am having a hard time making $q^2 = -1$ and $q^2 = -2$ give me something factorable...  I guess the worst part of all of this is that I don't think this solution is even particularly enlightening, in terms of abstract algebra. It's really just some number theory trickery. I don't think my course has prepared me theoretically for this problem, does anyone have an elementary approach to it? Repeated Iteration of a 2x2 matrix Suppose I am given a $2$x$2$ matrix $A=$ \begin{pmatrix} a &amp; b \\ c &amp; d \end{pmatrix}  And an initial vector $x_n$ = \begin{pmatrix} x_0 \\ y_0\end{pmatrix}.  Under repeated iteration $x_{n+1} = Ax_n$, we find that $x_{n+1}$ converges to a line in the direction of the $eigenvector$  of $A$ of the form $X$= $[u,mu]$ where $m$ is the slope of the line.  I know that this process somehow also involves the largest $eigenvalue, \lambda,$ of $A$, though I am unsure how it connects.  My question is: How does the largest eigenvalue connect to this repeated iteration, how do I find the slope of the line of convergence $m$, and what is meant by the "direction of the eigenvector"? Find the infinite sum $\sum_{k=1}^{\infty}\sqrt k - 2\sqrt {k + 1} + \sqrt {k + 2} $ I am facing a problem, where I have to find the partial sum of a sequence/sum and with that, the infinite sum of the sequence.  $\sum_{k=1}^{\infty}\sqrt k - 2\sqrt {k + 1} + \sqrt {k + 2} $   The problem here is that I don't know how to proceed. I would be thankful if someone would steer me in the right direction. "can't" versus "couldn't", what is the difference? That can't be Obama at the door, it's too early.  That couldn't be Obama at the door, it's too early.    What is the difference between them? Are they almost the same? I got 2 ghast tears after I thought I deflected a fireball back at the ghast (with my looting 3 sword).  But I was pretty close, so I might have just hit it. I'm not sure.  If I deflect a fireball with a looting sword and it kills the ghast, do I still get the looting bonus? My multimeter is rated to 600V.  How can I readily (and safely) use it to measure higher voltages? Proof that disjoint cycles commute One of the drivers behind the 'Rule of Two' is that with fewer Sith, the dark side will become more concentrated in those users and they will be more powerful as a result. Is there any indication that the same is true for Jedi? 301 redirect blogspot to an existing domain? Is it possible to redirect a blogspot site to an existing URL?  Note that I don't want to buy a new domain and tell blogspot to use that, eg as per this question: .    Instead I am trying to 301 redirect to an existing website in order to combine the website and the blog in one place.  So it needs to be:  301 example.blogspot.com/post to example.com/blog/post Why are the moderators being so strict with quality related flags recently? How can I resize a partition with Disk Utility? I have 2 partitions, I reduced the size of one and want to expand the other to fill the now available space.   How do I expand the Lion Partition into the empty grey space beneath Macintosh HD partition? If in Pete's World there's no Doctor, how is there a Torchwood? A finite group which has a unique subgroup of order $d$ for each $d\mid n$. This problem is from a practice exam I was working on.     What is the cardinality of the quotient $\mathbb{Z}[x]/(x^2-3,2x+4)$ ?   Thoughts. If I find a ring that is easier to handle then this then I can go from there. So I think this is isomorphic to $\mathbb{Z}_2[x]/(x^2-3,x+2)$. And then I am stuck.  Am I correct so far? What should I be looking to do from here?  Thanks for your time and your answers. Let $z_1,z_2,\ldots,z_n$ be complex number such that $|z_i|&lt;1$ for all $i=1,2,\ldots,n$. Show that we can choose $a_i \in\{-1,1\}$, $i=1,2,\ldots,n$ such that $$\left|\sum_{i=1}^n a_iz_i\right|&lt;\sqrt3.$$ adjective describing middle distance (neither near nor far) Why does the browser renders a newline as space? Guaranteed lifetime of temporary in C++? Official way to ask jQuery wait for all images to load before executing something In jQuery when you do this:  $(function() {    alert("DOM is loaded, but images not necessarily all loaded"); });   It waits for the DOM to load and executes your code. If all the images are not loaded then it still executes the code. This is obviously what we want if we're initializing any DOM stuff such as showing or hiding elements or attaching events.  Let's say though that I want some animation and I don't want it running until all the images are loaded. Is there an official way in jQuery to do this?  The best way I have is to use &lt;body onload="finished()"&gt;, but I don't really want to do that unless I have to.  Note: There is a  in Internet Explorer which actually does wait for all images to load before executing code inside $function() { }. So if you're using that platform you'll get the behavior I'm looking for instead of the correct behavior described above.