comments

should I write more descriptive function names or add comments?

∥☆過路亽.° 提交于 2020-01-03 17:05:42
问题 This is a language agnostic question, but I'm wandering what people prefer in terms of readability and maintainability... My hypothetical situation is that I'm writing a function which given a sequence will return a copy with all duplicate element removed and the order reversed. /* *This is an extremely well written function to return a sequence containing *all the unique elements of OriginalSequence with their order reversed */ ReturnSequence SequenceFunction(OriginalSequence) {...} OR

JAXB - marshal with java comments

扶醉桌前 提交于 2020-01-03 15:17:10
问题 I am new to JAXB and for the beginning I am marshaling some simple Java files like Hello, world! . I want to marshal whole file, even with my comments lines placed like this: /* * some comment */ //another comment And get them in XML in comment block: <!-- some comment --> <!-- another comment --> Is there any way to marshal java files with comments? 回答1: There are a few hurdles to overcome with your use case: The comments aren't stored in the byte code for a class, so you will need to make

Read/Write Server side files ~ Comment Board (JQuery)

元气小坏坏 提交于 2020-01-03 05:01:10
问题 I am searching for the best and easiest way to have the client side be able to "post" text to a server side file (.txt) and then save it to the text file. I would like to set up a simple board to post comments. Something quick and easy? I've looked around and it seems there are many ways out there. I haven't found something that simply allows read/write, while only utilizing JQuery functionality. Advice? 回答1: jQuery is a framework built on top of javascript. Javascript is a language thet runs

Visual studio comments from a dll project

删除回忆录丶 提交于 2020-01-03 04:17:28
问题 When I write code I frequently use comment notation like below. For functions / methods / classes and sometimes even for public variables. /// <summary> /// Constructor of the process runner class. /// </summary> /// <param name="Name">The exe name of the application ea notead.exe</param> /// <param name="Processrunner">A Process instance to start</param> Public ProcesRunner(.....bla bla bla.. This works nice when both class and program are within the same project. However when I create a

sed to replace // with /* */ comments EXCEPT when // comments appear within /* */

杀马特。学长 韩版系。学妹 提交于 2020-01-03 00:19:26
问题 The problem I am facing is with an ANSI compiler that requires C style comments. So I am trying to convert my existing comments to comply with the C standard ISO C89. I am looking for a SED expression to replace // comments with /* comments EXCEPT when // comments appear within /* */ comments (which would break the comment). I have tried this (a range expression) to no avail: sed -e '/\/*/,/*\//! s_//\(.*\)_/*\1 */_' > filename Will something work to ignore the 1 line comments inside a

HTML Comment Behavior

痴心易碎 提交于 2020-01-02 16:21:21
问题 So, I noticed while messing around in a Magento WYSIWYG editor (of all things) that <!> renders as <!----> in the resultant HTML. It also seems that enclosing any string in <! > renders a normal <!-- [string] --> comment. I only tested this in Chrome, but this behavior seems a little odd to me. I have looked at the W3C spec on comments, as well as this little document on the MDN. Neither gave me an answer I could really wrap my head around, though; what is the significance of the comment open

vb.net - automatic XML comments - ''' — Can I change the automatic defaults?

假如想象 提交于 2020-01-02 14:31:13
问题 I'm using Visual Studio 2008 SP1 in VB.NET, when I type ''' above a function, some automatic default XML comments appear: ''' <summary> ''' ''' </summary> ''' <remarks></remarks> I would like this to be the following instead: ''' <summary></summary> ''' <remarks></remarks> Is there a way to change what appears when you type ''' above a function? 回答1: They key is in the VBXMLDoc.xml file. It provides templating for all of the XML comments in VB.NET. Still have not checked if there is a

Social Plugins for Facebook Photos and Albums

好久不见. 提交于 2020-01-02 10:26:27
问题 Is it possible to use Social Plugins such as the Comments and Like plugins to display the comments and likes for a photo or album uploaded to Facebook? I have tried various URLs for the HREF attribute (the photo source, the photo page, the graph URL, etc) and cannot get the plugin to display existing comments against the photo. Can someone suggest the correct URL (if any) that I should use? I can get access to the list of comments using the graph API, however I would prefer to make use of the

Convert Single Line Comments To Block Comments

你。 提交于 2020-01-02 04:00:46
问题 I need to convert single line comments (//...) to block comments (/*...*/) . I have nearly accomplished this in the following code; however, I need the function to skip any single line comment is already in a block comment. Currently it matches any single line comment, even when the single line comment is in a block comment. ## Convert Single Line Comment to Block Comments function singleLineComments( &$output ) { $output = preg_replace_callback('#//(.*)#m', create_function( '$match', 'return

Invisible comments in jsf 2.0? [duplicate]

和自甴很熟 提交于 2020-01-02 00:12:09
问题 This question already has an answer here : How can I remove HTML comments in my Facelets? (1 answer) Closed 5 years ago . is it possible to embed comments in my .xhtml-files that are only displayed in the source and not the rendered result? I want to include author, date,... in the files but they should not be visible to the enduser in the generated output. If I use the standard comment-tags <!-- --> the browser displays them. 回答1: Add the following into your web.xml : <context-param> <param