comments

Getting rid of the comment above Eclipse-generated serialVersionUID

限于喜欢 提交于 2019-12-10 12:28:44
问题 This has become a pet peeve of mine. I write a class, and implement Serializible . Then eclipse warns me that I don't have a serialVersionUID , so I select " Add generated serialVersionUID " or " Add default serialVersionUID " and I end up with something like this: /** * */ private static final long serialVersionUID = 4049849541314027178L; Most of the time I don't want to add a comment, so I have to go and delete the comment. I would rather the default be no comment, but I've looked through

comment style in Visual Studio 2017

天涯浪子 提交于 2019-12-10 11:28:58
问题 I want to select a piece of code in Visual Studio 2017 and comment it. I know I can use CTRL + K, C, but the result is: /*fstream in("c:\\users\\hp\\documents\\visual studio 2017\\projects\\inputfile.in"); if (!in) { cerr << "can't open input file\n"; return 1; } fstream out("outputfile.out", fstream::out); if (!out) { cerr << "can't open output file\n"; return 1; }*/ and what I actually want is //fstream in("c:\\users\\hp\\documents\\visual studio 2017\\projects\\inputfile.in"); //if (!in) /

Do comments get translated to machine code? C++

▼魔方 西西 提交于 2019-12-10 10:59:13
问题 When a program written in C++ has comments, are those comments translated into machine language or do they never get that far? If I write a C++ program with an entire book amount of comments between two commands, will my program take longer to compile or run any slower? 回答1: Comments are normally stripped out during preprocessing, so the compiler itself never sees them at all. They can (and normally do) slow compilation a little though--the preprocessor has to read through the entire comment

Are Pascal comments supposed to nest?

陌路散爱 提交于 2019-12-10 03:26:50
问题 I have a compiler homework question that wants me to draw a DFA for Pascal comments, but I have never (and probably never will) use Pascal. The question does not specify if we should use ANSI Pascal or Turbo Pascal, so I was going to do one for both. Some Google searches showed me that Turbo Pascal allows nested comments as long as the same delimiter is not used, so {(*comment*)} is ok and so is (*{comment}*) , but {{comment}} or (*(*comment*)*) are not ok. My question here is if a comment

git commit comment per file

前提是你 提交于 2019-12-10 01:48:02
问题 I am new to git having previously used Perforce, SVN, source safe and many other source control tools. I am looking for the functionality that I used to use in Perforce where I could construct a change list; I was able to add files to the change list and provide a comment specific to each file. git has a staging area into which changed files are added, is there a way to provide a per file comment when adding a file to the staging area? Or perhaps at the comment stage I can add a per file

CSS - smarter code comments

前提是你 提交于 2019-12-09 16:44:55
问题 I read some time ago about a way to comment a css block in a such way that you only need to remove one end of the comment character set in case you want to uncomment the block later. But I can't remember how it was done :( Maybe someone here does know :) 回答1: /* * / .class { color: #ffa; } /* */ The space between the * and / in the first line causes the comment block to be un-closed until the final, paired, */ on the last line. If you close that space then the .class css is un-commented. For

Do you use special comments on bug fixes in your code?

橙三吉。 提交于 2019-12-09 14:18:14
问题 Some of my colleagues use special comments on their bug fixes, for example: // 2008-09-23 John Doe - bug 12345 // <short description> Does this make sense? Do you comment bug fixes in a special way? Please let me know. 回答1: I don't put in comments like that, the source control system already maintains that history and I am already able to log the history of a file. I do put in comments that describe why something non-obvious is being done though. So if the bug fix makes the code less

How to comment multiple lines in PhpStorm IDE?

谁说胖子不能爱 提交于 2019-12-09 08:21:30
问题 I use PhpStorm to edit PHP files and configuration files for Apache. How to comment on the selected block and set the symbol comment? I want,for example, <Directory /> Options FollowSymLinks AllowOverride None Order deny,allow Deny from all </Directory> to #<Directory /> # Options FollowSymLinks # AllowOverride None # Order deny,allow # Deny from all #</Directory> 回答1: Select multiple lines and use the Comment with Line Comment ( Ctrl + / in the default keymap on Windows, can be changed in

Search for commented-out code across files in Eclipse

做~自己de王妃 提交于 2019-12-09 06:04:27
问题 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. 回答1: Sonar can do it: http://www.sonarsource.org/commented-out-code-eradication-with-sonar/ 回答2: In Eclipse, I just do a file search with the regular expression checkbox turned on: (/\*.*;.*\*/)|(//.*;) It will find semicolons in // These; and /* these; */

Add links to Swift classes in the quick help documentation comments?

我与影子孤独终老i 提交于 2019-12-09 05:29:38
问题 Assume I have two classes: /** This class should be used together with [Foo]( ??? ). */ class Bar { func doNothing() {} } /** Description of what Foo does goes here. */ class Foo { func doNothing() {} } I want to create a link to Foo or Foo's quick help from Bar's quick help in Xcode. Is it even possible? If so, how? The [name](target) syntax for links isn't up to snuff as far as I can tell by looking at Apple's docs and more Apple's docs. 回答1: I just stumbled upon this. Apparently, if the