Trying to learn LaTeX, I'm using a very simple document to see if I can import C# code using the listings package. I've installed MikTex, and made sure it's up to date, and I'm using pdfLateX. The code is as follows: \documentclass{article}  \usepackage[T1]{fontenc} \usepackage{color}  \definecolor{bluekeywords}{rgb}{0.13,0.13,1} \definecolor{greencomments}{rgb}{0,0.5,0} \definecolor{redstrings}{rgb}{0.9,0,0}  \usepackage{listings} \lstloadlanguages{[Sharp]C} \lstset{     language=[Sharp]C,     showspaces=false,     showtabs=false,     breaklines=true,     showstringspaces=false,     breakatwhitespace=true,     escapeinside={(*@}{@*)},     commentstyle=\color{greencomments},     keywordstyle=\color{bluekeywords}\bfseries,     stringstyle=\color{redstrings},     basicstyle=\ttfamily }  \begin{document}  \lstinputlisting{DoDickey.cs}  \end{document}  My problem is that when I import the C# code, some junk characters are appended at the beginning.  Tried a bunch of different code files, tried using \lstinputlisting[[Sharp]C]{DoDickey.cs}. This just results in the error &quot;Package Listings Error: File `C(.tex)' not found.&quot; I'm assuming it's an encoding issue, but I honestly have no idea how to solve it.
When I used listings package to import C# code snippet from within my LaTeX file, I got an output as follows.    At the first line, there is an unnecessary white space because of the BOM (Byte Order Mark) that is intentionally added by Microsoft (R) Visual Studio.  I really want to remove it from the output rather than from the C# file, how to do that?   Here is my LaTeX code:  \documentclass{article} \usepackage{listings,xcolor} \lstset{% language={[Sharp]C}, backgroundcolor=\color{yellow!20}, basicstyle=\tiny, keywordstyle=\color{blue}, identifierstyle=\color{magenta}, breaklines=true}   \begin{document} \lstinputlisting{Program.cs} \end{document}
Notify on retagging A question here on meta for instance may stick around for quite a while. A feature-request  maybe even for months. Then the status (tags) gets changed to  or  or whatever and the OP does not get notified.  On a normal post-edit we get a notification but retagging does not count for that. Please add retagging to the edit notifications. Does an uncountable discrete subspace of the reals exist? Does an uncountable and discrete subspace of the reals exist? Can't run my hello world in C Editing PostGIS/GeoServer data via web? I've got PostGIS installed and would like to create a web application to do some simple edits:   Draw manually (over a Basemap) points, lines and polylines, using snapping  points (points, end of lines, intersections, center of circles)  Delete points, lines and polylines  Rotate a line or group of lines around a point  Move a line or group of lines with a base point  Move polylines and points (manually and to a point given by the coordinates) Edit position of vertices of polylines and lines (manually and to a point given by the coordinates)  Create buffers around points, lines and polylines    Which is the best way to do this via web? Is there any already-built JavaScript library? How do I disable administrator prompt in Windows 8? Java generics type erasure: when and what happens? How to get the key for a given object from an NSMutableDictionary? What would be the right position of "substantially" in the following:     1). Before verb: These optimal values substantially contribute to the success of the methodology.      2). After verb: These optimal values contribute substantially to the success of the methodology.   Here is my issue:  Fact1: When I use Google Ngram, I get , 0 occurrence of option 1.  Fact2: I found an excellent Grammar book that discusses Adverbs, their types and prefered positions. The author defines some rules that I'll summarize as follows:   Connecting adverbs, eg: however, then,..., Position: Beginning of clause. Indefinite frequency, eg: always, usually,..., Position: Mid position (after auxilary verb, before other verbs) sometimes beginning of clause. Focusing adverbs, eg: mainly, only,..., Position: Mid position. Adverb of certainty, eg: clearly, obviously, Position: Mid position. Adverb of completeness, eg: almost, nearly,..., Position: Mid position. Adverb of manner, eg: fast, slowly, nicely,..., Position: End clause, mid and beginning. Adverb of place, eg: upstairs, around, Position: End clause, sometimes beginning. Adverb of time, eg: daily, weekly, ... Position: Mostly end clause, sometimes beginning and mid position.   I think that "substantially" is an adverb of completeness. Therefore, the right position is before the verb "contribute" (option 1). However, Google Ngam indicates that option 1 is not widely used.  What do you think? Any suggestions? I have a python script that checks file path names for corresponding files in a drive location. All of the inputs were originally hard coded, and it works well enough:      import arcpy     import os     shp = r"C:\Users\dotwell\Desktop\Locations.shp"     fields = ["ZdriveLoc"]     f = open (r"C:\Users\dotwell\Desktop\ValMapsTest.txt", "w")     cursor = arcpy.da.SearchCursor (shp, fields)         for row in cursor:             Roll=str(row[0])             if not os.path.exists(Roll):             f.write(Roll + os.linesep)       f.close()   I'm trying to create an ArcGIS script tool from this, and I've only had partial success. I can use   shp = arcpy.GetParameterAsText(0)   to allow the user to select the shapefile. I'd like to then have a drop down list of the fields in that shapefile for the user to select the field that contains the path names, but I can't get it to work. Can someone show me how to generate the drop down? Here's my latest try. It works, but requires the user to type in the field name. It would also be nice for the user to designate the output text file name and location.   import arcpy import os shapefile = arcpy.GetParameterAsText(0) field = arcpy.GetParameterAsText(1) f = open (r"C:\Users\dotwell\Desktop\ValMapsTemp.txt", "w") cursor = arcpy.da.SearchCursor (shapefile, field) for row in cursor:     Roll=str(row[0])     if not os.path.exists(Roll):         f.write(Roll + os.linesep)   f.close()   Here are the parameters in my ArcGIS script tool: How to redirect stderr to a file Looking for title/author of SF novel about malevolent creatures/gods residing inside stars Interpreting the end of Inception Sorry for the vague title--I don't want the title to be a spoiler.  I've seen the movie three times, and the last two times I looked specifically for clues to this question, but found none.  The final scene in  shows       Cobb's top spinning, as he goes off to be reunited with his children.  The top continues to spin, then the movie ends, without telling us if the top topples--and therefore revealing whether he's in the "real world" or still in a dream. Do we know if he was in a dream at the end of the movie?   I'm assuming the answer is that we simply cannot know.  But did I miss anything?  Were there clues that I missed? How to query Sharepoint 2010 lists with sql? I think it has to be a common task. We have some applications on sharepoint and we need to prepare reports with data from these applications. It would be great if we could use Reporting Services. We need to query this data with sql because we need to join with some other sources. How can I do this? Are there any 3rd party tools or any built-it mechanisms in sharepoint to use Sharepoint lists data like ms sql tables? A pitcher contains $X + 1$ blue balls and $Y + 1$ red balls. It is known that $X, Y$ are independent random variables, and it is given that $X \sim \mathrm{Poisson}(n), Y \sim\mathrm{Poisson}(2n)$. Calculate the limit: $\displaystyle\lim_{n\to \infty}\mathbb P (X + n = Y) $   I tried to condition on the value of $Y$ and to use the Law of total probability but it did not lead to a solution. ( I tried to sum: $ \sum_{i=0}^\infty\mathbb P(X+n=Y|Y=i)\mathbb P(Y=i) $ and get an expression that I can calculate its limit as n goes to infinity) Distribution of hitting time of line by Brownian motion I came across the following question:     Let $T_{a,b}$ denote the first hitting time of the line $a + bs$ by a standard Brownian   motion, where $a &gt; 0$ and $−\infty &lt b &lt \infty$ and let $T_a = T_{a,0}$ represent the first hitting time of the level $a$.      1) For $\theta &gt; 0$, by using the fact that $\mathbb{E}e^{-\theta T_a}=e^{-a\sqrt{2\theta}}$, or otherwise, derive an expression for $Ee^{-\theta T_{a,b}}$, for each $b$, $−\infty &lt b &lt \infty$.       2) Hence, or otherwise, show that, for $t &gt; 0$,    $$\mathbb{P}[T_{a,b}\leq t] = e^{-2ab}\phi\left(\frac{bt-a}{\sqrt{t}}\right)+1-\phi\left(\frac{a+bt}{\sqrt{t}}\right).$$   For the first part, I ended up, by changing measure, with the (unverified) expression  $$\mathbb{E}e^{-\theta T_{a,b}}=\exp\left(-a\left[b+\sqrt{2\left(\theta+\frac{b^2}{2}\right)}\right]\right).$$  What's the cleanest way to do the second part? It seems I could either do some kind of inverse transform on the moment generating function, or calculate the moment generating function of the given distribution. Both of these seem difficult. Am I missing something, or do I just need to persevere?  Thank you. Discovering transformations and interactions I am teaching myself regression using Regression Modeling Strategies by Harell and the author goes at quite the length to showcase the importance of modeling interactions and transformations of the initial variables. I can't help but wonder how to approach this in a more structured/automated way when dealing with a lot of potential variables.  Can we use recursive partitioning, for example, to somehow to do the work for us and then use the output as variables, shrink the estimates with LASSO to deal with colinearity and do a final step where we use some sort of filtering for feature importance.  In my mind this will leave us with a well specified model which can be manually inspected and improved if need be, but is this reasonable? Are there other ways to approach this? Are there some resources that deal with problems like this? prove that $\mathbb{Q}^n$is dense subset of $\mathbb{R^n}$ Prove that $\mathbb{Q}^n$is dense subset of $\mathbb{R^n}$ using the fact that $\mathbb{Q}$ is dense subset  of $\mathbb{R}$  I know that $\mathbb{Q}$ is dense subset  of $\mathbb{R}$ That is, between any two real numbers, there exists a rational number  then how to prove that $\mathbb{Q}^n$is dense subset of $\mathbb{R^n}$ Is the graviton hypothetical? Wikipedia lists the  as a hypothetical particle. I wonder whether graviton is indeed hypothetical or does its existence directly follow from modern physics? Does observation of gravitational waves amount to the discovery of graviton or could there be gravitational waves not composed of gravitons? Intuitive Understanding of the constant "$e$" In .NET, the  is used in a lot of places throughout the .NET base class libraries. Implementing it properly is especially important to find items quickly in a collection or when determining equality.  Is there a standard algorithm or best practice on how to implement GetHashCode for my custom classes so I don't degrade performance?