line-numbers

Add line numbers in vim

How can I add line numbers to a range of rows in vim? Not as in ":set nu" - this just displays numbers, but doesn't add them to the file. ...

VB.NET and ASP.NET DLL line numbers don't appear in production error logs

I can see line numbers in my error logs in our development environment, in which VB.NET 2005 and ASP.NET components are compiled in debug mode, with PDB files copied to the server on deployment. I don't see line numbers in production, where things are compiled in release mode, and presumably no PDB files are created or deployed? Can som...

How can I print source line number in Perl?

Is it possible to get the current source line number in Perl? The equivalent in C++ is __LINE__. ...

Number of lines in a file in Java

I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file I was wondering if there is a smarter way to do that ...

Exception line numbers are messed-up on CCNET build reports

We are having an integration server (CruiseControl.NET) building and validating a couple of .NET 3.5 libraries. When some integration code fails, the exception is logged and appears in a custom report. Yet, the line numbers reported by the exception messages are messed-up - usually short from 50 / 100 lines below the place where the exc...

Why did we bother with line numbers at all?

When you write something in BASIC, you are required to use line numbers. Like: 10 PRINT "HOME" 20 PRINT "SWEET" 30 GOTO 10 But i wonder: who came up with the idea to use line numbers at all? It is such a nuisance, and left quite an "echo" in the developing (pun intended) world! ...

WPF RichTextBox to create editor with line numbers

I'm creating a text editor for a domain specific language. I'm using the WPF RichTextBox as the basic control. I don't know how to gracefully include line numbering. Does anyone know of any examples? ...

Is it possible to get the current line number when parsing an XML document with Xerces ?

I have a java program that parses an XML document using xerces API. My parsing class extends org.apache.xerces.parsers.XMLDocumentParser, overloading the startElement, endElement, characters methods. Since it's a complicated XML document that is written by hand (mainly some kind of configuration elements), classic validation by xsd or ...

Current line number from a System.Xml.XmlReader (C# & .Net)

Does anyone know how I can get the current line number of an System.Xml.XmlReader? I am trying to record where in a file I find Xml elements. ...

Display lines number in Stack Trace for .NET assembly in Release mode

Is there a way to display the lines in the stack trace for the .NET assembly build/deployed in Release mode? UPDATE: My application is divided into three class library projects and one ASP.NET "website" project. The error I am trying to track down is in one of the three class library projects. I only deployed the pdb file for the cl...

displaying line number in rich text box c#

I have a Multiline richtextbox control into which i want to integrate the feature of adding a line number. i have considered many approaches Add a label and updating the line numbers as the line count changes Add a picturebox along with to draw string on it. Add another textbox along with and show line numbers on it Add listbox along a...

show line in exception.message

How would one display what line number caused the error and is this even possible with the way that .net compiles its exes? If not is there an automated way for exception.message to display the sub that crapped out? try { int x = textbox1.text; } catch(exception ex) { messagebox.show(ex.message); } ...

Remove line numbers from SyntaxHighlighter

Is there any way to remove the line numbers of SyntaxHighlighter? Thanks! ...

Line numbers in StackTrace point to method start

We're developing a web application with Rational Application Developer 7.5 (based on Eclipse 3.4) for WebSphere Application Server 6.1 . When examining stacktraces on a staging server, the line numbers always point to the beginning of the methods, never to the actual line. In the local development environment (each developer has his loca...

in C# can I explicitly set height of font and/or adjust whitespace width between lines of multiline textbox?

I want to implement my own textbox (editor) with line numbers to the left of it. Well, so I am implementing the line numbers in another, narrow multiline textbox. However, I want to be able to adjust the font in the main editor and generally make it to be big size, whereas I don't want to have the line numbers to be of equally big size f...

Method name from line number

Given a line number of a particular class source code (Java/C#) - is there an easy way to get the name of the method it falls within? (If it falls within one) (Presumably using an Abstract Syntax Tree) (This would be useful in limiting the output of checkstyle to just the method touched). I'm assuming you'd have to use an Abstract Syn...

Most Compact Way to Count Number of Lines in a File in C++

What's the most compact way to compute the number of lines of a file? I need this information to create/initialize a matrix data structure. Later I have to go through the file again and store the information inside a matrix. Update: Based on Dave Gamble's. But why this doesn't compile? Note that the file could be very large. So I try t...

parsing XML file in python with cElementTree: dealing with errors and line number in the file

Hello I am using the cElementTree library to parse XML files in Python. Everything is working fine But I would like to provide full error messages for the user when a value in the XML is not correct. For example, let's suppose I have the following XML: <A name="xxxx" href="yyyy"/> and want to tell the user if the href attribute doe...

enable line numbers of stack trace in xcode console

I read this post http://stackoverflow.com/questions/1093999/stack-trace-or-more-info-on-unhandled-exception-in-xcode-iphone It seems like the chosen answer is the correct way, however the answerer doesn't tell you how to create the global breakpoints. Does anyone know how I can create these break points and see the line number of my ex...

How to get JavaScript caller function line number? How to get JavaScript caller source URL?

I am using the following for getting the JavaScript caller function name: var callerFunc = arguments.callee.caller.toString(); callerFuncName = (callerFunc.substring(callerFunc.indexOf("function") + 8, callerFunc.indexOf("(")) || "anoynmous") Is there a way to discover the line number from which the method was called? Also, is there ...