comments

Best practice for comment voting database structure

有些话、适合烂在心里 提交于 2019-12-03 07:09:39
I'm working on a PHP app that has several objects that can be commented on. Each comment can be voted on, with users being able to give it +1 or -1 (like Digg or Reddit). Right now I'm planning on having a 'votes' table that has carries user_id and their vote info, which seems to work fine. The thing is, each object has hundreds of comments that are stored in a separate comments table. After I load the comments, I'm having to tally the votes and then individually check each vote against the user to make sure they can only vote once. This works but just seems really database intensive - a lot

PHP: Commenting standards

风流意气都作罢 提交于 2019-12-03 07:01:27
I need to comment massive amounts of information in only a handful of files, and when I look around Google and here at SO, I continue to find results matching coding standards , when I need commenting standards. My coding matches most coding standards except not when it comes to commenting. Could someone please provide examples for the following? <? // beginning of file comments require( 'filename.php' ); // require or include, with filename public class Test { } // class without constructor public class Test // class with constructor, if different from above { public function __constructor()

Are comment headers and footers in your code really necessary? [closed]

橙三吉。 提交于 2019-12-03 06:47:59
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Many corporate coding standards require a large comment header and footer in each and every file. Something like: // MyFile.cpp // //

How to extract comments and match to declaration with RecursiveASTVisitor in libclang c++?

老子叫甜甜 提交于 2019-12-03 06:47:10
I am writing a utility which is supposed to parse C++ (and C) header files, extract the structs, enums, fields etc. and generate code in other languages based on the extracted information. I decided to use libclang for this. I'm using a RecursiveASTVisitor and it seems I'm able to extract all the information I need, except for comments. I want to have the comment which appears right above every declaration (field, struct, class, enum) read, and add its text when I generate the code in other languages. The problem is that all the samples I saw which use comments use CxCursor and the C interface

Changing color of comments in Eclipse

99封情书 提交于 2019-12-03 06:32:25
问题 I am using Eclipse Indigo for my JSF project. When I comment something, I want the color of the commented part should be gray (this is a default feature in Netbeans), how can I achieve? 回答1: You can configure it at Window > Preferences > Java > Editor > Syntax Coloring . 来源: https://stackoverflow.com/questions/6991224/changing-color-of-comments-in-eclipse

Search for commented-out code across files in Eclipse

落爺英雄遲暮 提交于 2019-12-03 06:25:55
Is there a quick way to find all the commented-out code across Java files in Eclipse? Any option in Search, perhaps, or any add-on that can do this? It should be able to find only code which is commented out, but not ordinary comments. Sonar can do it: http://www.sonarsource.org/commented-out-code-eradication-with-sonar/ Scott Merritt In Eclipse, I just do a file search with the regular expression checkbox turned on: (/\*.*;.*\*/)|(//.*;) It will find semicolons in // These; and /* these; */ Works for me. You can mark your own commented code with a task tag. You can create your own task tags

Gettext automatic comments generation

笑着哭i 提交于 2019-12-03 06:13:53
I'm doing i18n for a php project using gettext. I'd like to use the automatic comment feature to give hints to translators when translating long phrases replaced by id. What I want to obtain is the following po file #: full-path-to-file/index.phtml:3 #. a very long text which should replaced by _('foobar') msgid "foobar" msgstr "" In this way the translator can see what he should translate when he see the key foobar using POEdit or some analogue tool in the programmer comment box. I've tried with this code but it doesn't work <?php /// TRANSLATORS: a very long text which should replaced by _(

How can I perform a diff that ignores all comments?

 ̄綄美尐妖づ 提交于 2019-12-03 06:07:50
I have a large codebase that was forked from the original project and I'm trying to track down all the differences from the original. A lot of the file edits consist of commented out debugging code and other miscellaneous comments. The GUI diff/merge tool called Meld under Ubuntu can ignore comments, but only single line comments. Is there any other convenient way of finding only the non-comment diffs, either using a GUI tool or linux command line tools? In case it makes a difference, the code is a mixture of PHP and Javascript, so I'm primarily interested in ignoring // , /* */ and # . To use

Best practices for version control comments

断了今生、忘了曾经 提交于 2019-12-03 05:47:02
问题 There is a lot of conversation about commenting code, but how about commenting on check-ins? I found this blog post: http://redbitbluebit.com/subversion-check-in-comment-great-practices/ As the guy who is putting together the release notes, I am looking for ways to make that job easier. Currently we defined our own scheme with <Begin_Doc>...<End_Doc> for anything that should be published to our software customers. But even for the internal stuff, I'd like to know the "why" for every change.

Todo tasks not appearing in the Task List in visual studio 2012

谁都会走 提交于 2019-12-03 05:21:47
问题 I've recently upgraded to Visual Studio 2012 and haven't have any problems except for the fact that comments beginning with "//todo" no longer show up in the task list. I have absolutely no idea on where to start looking for a solution to this problem as all of the keywords are too general. I came across other similar questions where the answer was that the file wasn't open containing the //todo comment, but that is not the case for me. My todo comments do not show up even when the file is