comments

embedding one kind of syntax inside another: is it kludge or clever?

Background: Recently while looking at a "structured text editor" I noticed they used a trick to change python/perl/c++/java et al. into a "structured" outline by sneaking XML into the comments of the respective languages. I remembered seeing this trick inside a windows bat file once as well. The REM statements of the bat file were used ...

Is there a Vim equivalent to the Linux/Unix "fold" command?

I realize there's a way in Vim to hide/fold lines, but what I'm looking for is a way to select a block of text and have Vim wrap lines at or near column 80. Mostly I want to use this on comments in situations where I'm adding some text to an existing comment that pushes it over 80 characters. It would also be nice if it could insert ...

Indent C block comments in Emacs

Hi, I'm trying to configure emacs to indent my C block comments nicely. Emacs (22.3) does by default (regardless of the indentation style): /* My very long comment which spreads over multiple lines * and thus needs to be filled. */ But what I would highly prefer is: /* My very long comment which spreads over multiple lines * and...

How do I keep Netbeans from printing line like this // <editor-fold defaultstate="collapsed" desc=" UML Marker "> when printing code?

I am trying to keep Netbeans from printing statement like this // <editor-fold defaultstate="collapsed" desc=" UML Marker "> // #[regen=yes,id=DCE.B7E25FE1-C10B-ED91-77... // </editor-fold> without deleting them from the code. ...

Block commenting in Ruby

Does Ruby have block comments? If not, is there an efficient way of inserting # in front of a block of highlighted code in TextMate? ...

HTML Tidy, Don't move those comments!

I was working with html-tidy and a couple of my comments were moved from the head to the root of the document. Is there anyway to avoid this behavior? (I'm trying to turn some really really bad markup into xhtml complaint code) Oh and additionally it uses an in-house developed semi-server-side scripting language that uses comments to pl...

replace C style comments by C++ style comments

How can I automatically replace all C style comments (/* comment */) by C++ style comments (// comment)? This has to be done automatically in several files. Any solution is ok, as long as it works. ...

More comments in code or just simple, readable, maintainable code suffices?

Sometimes its really difficult to decide on when exactly you have written enough comments for someone to understand your intentions. I think one needs to just focus more on writing readable, easy to understand code than on including a large number of lines of comments explaining every detail of whats happening. What are your views abou...

Use #ifdefs and #define to optionally turn a function call into a comment

Is it possible to do something like this #ifdef SOMETHING #define foo // #else #define foo MyFunction #endif The idea is that if SOMETHING is defined, then calls to foo(...) become comments (or something that doesn't get evaluated or compiled), otherwise it becomes a call to MyFunction. I've seen __noop used, but I don't believe I ca...

Does doxygen support inline comments for method arguments in Objective-C?

I used to use doxygen lot for C++, and really like the ability to document function and method arguments inline using ///< , or variations. Conversely I really dislike having to repeat arguments in the comments when not using the inline style (as most over code doc systems only support). So recently I've been setting up doxygen with my ...

Numbering comments in ASP.NET and MSSQL

I've just thought about best way to store comments in database with appropriate numbers according to the article. The idea is to store comments with composite primary key (commentId, articleId) where commentId is generated according to the given articleId. The system of generating should has same principle as IDENTITY generated columns ...

ASP generated javascript

Hi, I'm wondering if someone can point me in the right direction. I've got an ASP.NET web application. And there's autogenerated portion of JavaScript in every page that handles postback. Sometimes that javascript is surrounded by <[CDATA[ ... ]]> , while on the other machine it may be enclosed in simple HTML comment like <!-- .....

My summary information won't show up in Sandcastle using VB ''' syntax

I'm trying to take advantage of Sandcastle to help build out system documentation, but for some odd reason none of my <summary> data shows up in the chm ... has anyone had success w/ the latest build of Sandcastle and VS2008 using VB? ...

What's the best method to separate nested discussions over multiple pages - for web application?

I am designing a threaded message display for a PHP/MySQL application - like comments on Slashdot or Youtube - and am wondering how I should go about ordering the comments and separating it into pages so that you can have, say, 20 comments to a page but still have them nested. Comments in my app can be nested unlimited levels, and this ...

Is it possible to obtain class summary at runtime?

Hi. Is it possible to obtain class summary at runtime in C#? I would like to obtain class summary through reflection and then write it to console. By class summary I mean summary comments before class definition, something like this: /// <summary> /// some description /// </summary> class SomeClass { } I don't know if these comments ...

Creating cell comments in an Excel Spreadsheet with OpenXML SDK

I'm trying to add comments to cells in an Excel 2007 spreadsheet. I'm using the OpenXml SDK 2.0 to do so. My use case is this: I've created a template Excel file that I copy and use that as my starting point, rather than create an OpenXML document from scratch. My template file has a comment in cell A1 so that Excel has already crea...

How do you comment html templates in Php (in a practical way) ?

Is there a simple solution to do the equivalent of Java's comments: <%-- this is a comment inside a template, it does not appear in the output HTML --%> Even if you use short php tags, you still have to wrap the comments with comment syntax, on top of the php tags: <? /* this is a comment of the html template */ ?> I'm considering ...

How do I implement threaded comments?

I am developing a web application that can support threaded comments. I need the ability to rearrange the comments based on the number of votes received. (Identical to how threaded comments work in reddit) I would love to hear the inputs from the SO community on how to do it. How should I design the comments table? Here is the structur...

How to write meaningful docstrings?

Hello crowd, What, in Your opinion is a meaningful docstring? What do You expect to be described there? For example, consider this Python class's __init__: def __init__(self, name, value, displayName=None, matchingRule="strict"): """ name - field name value - field value displayName - nice display name, if empty will b...

Is PostgreSQL's Ltree module a good fit for threaded comments?

I'm considering using PostgreSQL's Ltree module in my application to help with threaded comments. I've been eying it for a while to use for threaded comments. I figure it would help with cases where you need to update a node and its children, like when you want to hide a comment and its replies. I'm thinking ltree (or something like...