comments

what is the purpose of the extra asterisks in php comments?

久未见 提交于 2019-12-30 03:44:11
问题 I've (finally) been reading up on PEAR (php) coding standards. What is the purpose of commenting like this: /** * Here is my comment * I Wrote this in a haiku * But why put the stars? */ As opposed to this: /* Here is a comment No haiku or anything special, but it still works! */ 回答1: The /** stuff */ document is also referred to as DocBlock notation. It's used to document PHP functions, classes, etc. /** * A test function * * @param foo $bar * @return baz */ function test(foo $bar) { return

WordPress: List posts with no comments

主宰稳场 提交于 2019-12-30 03:29:28
问题 I have simple page that I want to display a list of posts that haven't been commented on yet. How would I do this? I presume it's some parameters I can add to the query_posts? Thanks. 回答1: Unfortunately query_posts does not allow you to limit the query to comment_count=0 . You can do this: query_posts( 'orderby=comment_count&order=ASC' ); But that does not only display posts with zero comments, it just displays those with zero comments first . The more involved (but better) solution is to use

Showing generic class eg Table<String> in xml comments in visual studio

醉酒当歌 提交于 2019-12-29 08:34:07
问题 I know this maybe a basic question but I just can't seem to find the answer anywhere. I have a class like this Table<T> {} then I have some code that uses the above class that I would like to comment I would like to be able to do something like: /// <summary> /// blah blah blah Table<String> /// </summary> But I can't use the angle bracket in the comment as it thinks it's a tag and when the help shows up it just has an error about no end tag for . How do I show generic classes in comments in

Matching all three kinds of PHP comments with REGEX

青春壹個敷衍的年華 提交于 2019-12-29 01:45:33
问题 I'm new to REGEX and I need some help. I need to match all three types of comments that PHP might have: # Single line comment // Single line comment /* Multi-line comments */ /** * And all of it's possible variations */ Something I should mention, I am doing this in order to be able to recognize if a PHP closing tag ( ?> ) is inside a comment or not, if it is then ignore it, if not then make it count as one. This is gonna be used inside an XML document in order to improve Sublime Text's

HTML comments within comments?

依然范特西╮ 提交于 2019-12-28 16:31:15
问题 Is there a way to comment multiple lines... which already have some comments in them? i.e. <html> <!-- Multi-line comment begin <head> <!-- This script does abcxyz --> <script>...</script> </head> <body> Hello world! </body> Multi-line comment end --> </html> It seems that even SO's syntax hilighting won't accept this... 回答1: I think the key point is this: Note that comments are markup. http://www.w3.org/TR/html4/intro/sgmltut.html#h-3.2.4 This is not valid markup: <div <span/> /> ... so

Removing all types of comments in java file

只愿长相守 提交于 2019-12-28 06:36:09
问题 I have a java project and i have used comments in many location in various java files in the project. Now i need to remove all type of comments : single line , multiple line comments . Please provide automation for removing comments. using tools or in eclipse etc. Currently i am manually trying to remove all commetns 回答1: You can remove all single- or multi-line block comments (but not line comments with // ) by searching for the following regular expression in your project(s)/file(s) and

jQuery comment/uncomment <!--element-->

女生的网名这么多〃 提交于 2019-12-28 02:59:05
问题 I am looking for a way to wrap, with jQuery, an element into a comment, like: <!-- <div class="my_element"></div> --> and also a way to remove the comments. Is this possible? 回答1: To wrap an element with comment, or more specifically to replace an element with a comment node having that element's HTML: my_element_jq = $('.my_element'); comment = document.createComment(my_element_jq.get(0).outerHTML); my_element_jq.replaceWith(comment); To switch it back: $(comment).replaceWith(comment

Is it bad practice to comment out single lines of CSS with //?

大兔子大兔子 提交于 2019-12-28 02:39:15
问题 I have recently started using // to "comment" out single lines of CSS code. I understand that I am not actually commenting out the line; I am just breaking it (I should use /* ... */ ), but it has the same effect. The line is then terminated by the ; and the following code works fine. I could delete it, but often I prefer not to in case I want to put it back in later or see what I had been using if I come back to it. Example: li{ float:left; //list-style-type:none; text-indent:0px; } Can I

Regex for comments in strings, strings in comments, etc

廉价感情. 提交于 2019-12-27 12:07:45
问题 This a question I've solved and wanted to post in Q&A style because I think more people could use the solution. Or maybe improve the solution, show where it breaks. The problem You wanna do something with quoted strings and/or comments in a body of text. You wanna extract them, highlight them, what have you. But some quoted strings are inside comments, and sometimes comment-characters are inside strings. And strings delimiters can be escaped, and comments can be line-comments or block

How to put a line comment for a multi-line command [duplicate]

送分小仙女□ 提交于 2019-12-27 10:48:10
问题 This question already has answers here : Commenting in a Bash script (7 answers) Closed 3 years ago . I know how to write a multi-line command in a Bash script, but how can I add a comment for each line in a multiline command? CommandName InputFiles \ # This is the comment for the 1st line --option1 arg1 \ # This is the comment for the 2nd line --option2 arg2 # This is the comment for the 3nd line But unfortunately, the comment after continuation character \ will break the command. 回答1: I'm