line-numbers

Is there any #pragma or similar directive for generated C# code to match template code line numbers to C# line number?

I have a templating system that looks similar to old-style ASP code. I run this through a class that rewrites the entire thing into C# source code, compiles, and finally executes it. What I'm wondering is if there is some kind of #pragma-like directive I can sprinkle the generated C# code with that will make compile errors match the lin...

Linenumber for Exception thrown in runtime-compiled DotNET code

Not quite the same as this thread, but pretty close. My program allows people to enter some VB or C# code which gets compiled, loaded and executed at runtime. My CompilerParams are: CompilerParameters params = new CompilerParameters(); params.GenerateExecutable = false; params.GenerateInMemory = true; params.IncludeDebugInformation = f...

Visual Studio 2008 Express Edition - line numbers not appearing?

In Visual Studio 2008 Express Edition, the numbers no longer appear next to the lines. I've looked in the settings and I can't find anything. Any ideas? ...

Preserving original StackTrace/LineNumbers in .NET Exceptions

Understanding the difference between throw ex and throw, why is the original StackTrace preserved in this example: static void Main(string[] args) { try { LongFaultyMethod(); } catch (System.Exception ex) { Console.WriteLine(ex.StackTrace); } } stat...

A C# Implementation of Number Line

NumberLine line = new NumberLine(); line.AddRange(1, 5); line.AddRange(20, 30); line.CheckRange(10, 25); NumberLine is a class which represents a number line. I want to mark on it different ranges of numbers. The CheckRange method should return which parts from 10-25 I marked and which I did not. In this case it should return that 10-...

PHP Fatal error on line number that doesn't exist

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 523800 bytes) in /Library/WebServer/Documents/XMLDataStore.class.php on line 981 The curious thing about this error is not the memory leak, which would be easy enough to troubleshoot. Rather, it is the fact that XMLDataStore.class.php is only 850 lines lon...

Which Javascript code editor supports plain text line numbering?

I need to add a text area that also has line numbering capabilities. I tried EditArea, but I couldn't make it work with text files. It would be ideal if it could highlight syntax for existing programming languages, but that would only be a side bonus. The main thing I'm after is line numbering for whatever I paste in it. Please only li...

How to activate revision info in line number view

I know of an Eclipse feature to show revision information (gradual coloring, more info like revisionnumber, date and author on mouseover) for the last changes in a line in the linenumbers-view. Does anyone know how to activate this feature for a file, or even better, by default? I accidently hit some shortcut lately which made it show i...

Need debug information for .NET assembly in Release

When an error occurs in any of my .NET assemblies the user just gets a generic error saying "MyApp has encountered a problem and needs to close. We are sorry for the inconvenience." I would like the user to to see the error message and line number if possible. From what I understand you need to deploy the pdb file along with your assemb...

HTML/CSS/JS: How to make an illusion of a textarea with line numbers?

I want to have a textarea which displays line numbers on the left. Wrap should be set to "off" (so that horizontal scrolling is available). I want to have my page as a single self-contained .html file (there will be no graphics), so I'd like to avoid any 3rd party frameworks. Which way should I go? How would you do this? ...

C++ Eclipse Galileo getting it to display line numbers - how?

EDIT: jldupont's suggestion (see below) did the trick Window -> Preferences -> General -> Editors -> Text Editors -> Show line numbers I just installed Eclipse Galileo (first time) and am programing in C++ and couldn't get the editor to display the line numbers... When i Googled it I got these directions: Go to Window -> Pre...

How to get surrounding method in Java source file for a given line number

I have a line number of a Java source file and want to get the sourounding method for that line number programatically. I looked into ANTLR which didn't help me much. Janino (http://www.janino.net) seems promising, I would scan and parse (and if necessary compile) the code. Then I could use JDI and ReferenceType.locationsOfLine(int li...

How do I extract lines from a file using their line number on unix?

Using sed or similar how would you extract lines from a file? If I wanted lines 1, 5, 1010, 20503 from a file, how would I get these 4 lines? What if I have a fairly large number of lines I need to extract? If I had a file with 100 lines, each representing a line number that I wanted to extract from another file, how would I do that? ...

Finding out what line number an element in the dom occurs on in Javascript?

Though I've never heard of this but, is it possible to retrieve a node from the DOM using JS, and then find out on what line of the file that node occurred on? I'm open to anything, alternative browsers plugins/add-ons etc...it doesn't need to be cross-browser per say. I would assume that this would be possible somehow considering that...

Delete specific line number(s) from a text file using sed?

I want to delete one or more specific line numbers from a file. How would I do this using sed? ...

Why do I get no line numbers from a stack trace created from Exceptions?

Okay; assuming this code running in debug mode - static StackFrame GetTopFrameWithLineNumber(Exception e) { StackTrace trace = new StackTrace(e); foreach (StackFrame frame in trace.GetFrames()) { if (frame.GetFileLineNumber() != 0) { return frame; } } return null; } I'm ALWAYS re...

Output line number in Rails log file

From the Rails Guide on debugging, I found that I can customize output to my log files using this simple method: logger.debug "Person attributes hash: #{@person.attributes.inspect}" I decided use this to track how a variable changes and goes through flow control. I would like to be able to see the line number of my code where logger#...

Difficulty while finding no of lines in a file using java?

While find out no of line in a file, it displays more number of lines. for example in my file having only 26 line in word document. But while count using java program it displays 118. File f=new File("C:\\Users\\os05\\Desktop\\Venkatesan(13-02-10).doc"); FileReader fr = new FileReader(f); LineNumberReader ln = new LineNum...

How can I determine the current line number in JavaScript?

Does JavaScript have a mechanism for determining the line number of the currently executing statement (and if so, what is it)? ...

search text file using c# and display the line number and the complete line that contains the search keyword

I require help to search a text file (log file) using c# and display the line number and the complete line that contains the search keyword. ...