comments

Is there a standard (like phpdoc or python's docstring) for commenting C# code?

泪湿孤枕 提交于 2019-12-01 02:43:16
Is there a standard convention (like phpdoc or python's docstring) for commenting C# code so that class documentation can be automatically generated from the source code? You can use XML style comments, and use tools to pull those comments out into API documentation. Here is an example of the comment style: /// <summary> /// Authenticates a user based on a username and password. /// </summary> /// <param name="username">The username.</param> /// <param name="password">The password.</param> /// <returns> /// True, if authentication is successful, otherwise False. /// </returns> /// <remarks> //

How do I comment attributes inside an XML tag?

廉价感情. 提交于 2019-12-01 02:02:40
Is it possible to comment one or several attributes inside an XML tag? Something like /* */ from C. I have tried using <!-- --> , but it was unsuccessful. <element attribute1="value1" attribute2="value2" <!-- attribute3="value3" (commented value) --> > No, this isn't possible. Comments are not allowed in an XML open tag. Depending on your application, you might get away with "commenting out" the attributes by prefixing their names with "_", or you might not (if the XML is validated against a schema or all attributes are parsed). Because whitespace is allowed, and most editors support line

mysql structure for posts and comments

倖福魔咒の 提交于 2019-12-01 01:44:36
I've read several tutorials, documentations about mysql, db structures and also I'm using it via php for weeks. Now I get a problem, I don't know how to form/organize/create my db structure for posts and comments. I've already read some posts about this (here on stackoverflow), but I didn't find anything useful. I understand that I need to have 2 tables for posts and comments, and when I need to print them on the page with a foreign key (or ID) I "merge" them (only on the page, not with SQL). When a person is viewing the page, he is seeing the post and comments normally, but in the "background

JSoup - Select all comments

自闭症网瘾萝莉.ら 提交于 2019-12-01 01:31:49
I want to select all comments from a document using JSoup. I would like to do something like this: for(Element e : doc.select("comment")) { System.out.println(e); } I have tried this: for (Element e : doc.getAllElements()) { if (e instanceof Comment) { } } But the following error occurs in eclipse "Incompatible conditional operand types Element and Comment". Cheers, Pete Since Comment extends Node you need to apply instanceof to the node objects, not the elements, like this: for(Element e : doc.getAllElements()){ for(Node n: e.childNodes()){ if(n instanceof Comment){ System.out.println(n); } }

How to find all comments in the source code?

别来无恙 提交于 2019-12-01 01:26:18
There are two style of comments , C-style and C++ style, how to recognize them? /* comments */ // comments I am feel free to use any methods and 3rd-libraries. To reliably find all comments in a Java source file, I wouldn't use regex, but a real lexer (aka tokenizer). Two popular choices for Java are: JFlex: http://jflex.de ANTLR: http://www.antlr.org Contrary to popular belief, ANTLR can also be used to create only a lexer without the parser. Here's a quick ANTLR demo. You need the following files in the same directory: antlr-3.2.jar JavaCommentLexer.g (the grammar) Main.java Test.java (a

Unicode in javadoc and comments?

你说的曾经没有我的故事 提交于 2019-11-30 22:44:11
问题 Some compilers failed on non-ASCII characters in JavaDoc and source code comments. What is the current (Java 7) and future (Java 8 and beyond) practices with respect to Unicode in Java source files? Are there differences between IcedTea, OpenJDK, and other Java environments, and what is dictated the the language specification? Should all non-ASCII characters be escaped in JavaDoc with HTML &escape; -like codes? But what would be the Java // comment equivalent? Update : comments indicate that

Nested Comments in MongoDB

夙愿已清 提交于 2019-11-30 22:03:47
I'm quite new to MongoDB and trying to build a nested comment system with it. On the net you're finding various document structures to achieve that, but I'm looking for some proposals that would enable me easily to do the following things with the comments Mark comments as spam/approved and retrieve comments by this attributes Retrieve comments by user Retrieve comment count for an object/user Besides of course displaying the comments as it is normally done. If you have any suggestions on how to handle these things with MongoDB - or - tell me to look for an alternative it'd be appreciated much

JSoup - Select all comments

梦想与她 提交于 2019-11-30 20:53:09
问题 I want to select all comments from a document using JSoup. I would like to do something like this: for(Element e : doc.select("comment")) { System.out.println(e); } I have tried this: for (Element e : doc.getAllElements()) { if (e instanceof Comment) { } } But the following error occurs in eclipse "Incompatible conditional operand types Element and Comment". Cheers, Pete 回答1: Since Comment extends Node you need to apply instanceof to the node objects, not the elements, like this: for(Element

mysql structure for posts and comments

▼魔方 西西 提交于 2019-11-30 20:46:42
问题 I've read several tutorials, documentations about mysql, db structures and also I'm using it via php for weeks. Now I get a problem, I don't know how to form/organize/create my db structure for posts and comments. I've already read some posts about this (here on stackoverflow), but I didn't find anything useful. I understand that I need to have 2 tables for posts and comments, and when I need to print them on the page with a foreign key (or ID) I "merge" them (only on the page, not with SQL).

How to find all comments in the source code?

谁说我不能喝 提交于 2019-11-30 20:21:04
问题 There are two style of comments , C-style and C++ style, how to recognize them? /* comments */ // comments I am feel free to use any methods and 3rd-libraries. 回答1: To reliably find all comments in a Java source file, I wouldn't use regex, but a real lexer (aka tokenizer). Two popular choices for Java are: JFlex: http://jflex.de ANTLR: http://www.antlr.org Contrary to popular belief, ANTLR can also be used to create only a lexer without the parser. Here's a quick ANTLR demo. You need the