comments

How to use ant to check for tags (TODO: etc) in java source

ぃ、小莉子 提交于 2019-12-05 09:23:35
it's common to see something like this in code, hopefully only during development: //XXX: not in production! String password = "hello"; // getActualPassword(...); ... catch(Exception e) { /* TODO: Auto-generated catch block*/ } I would like ant to be able to a) warn (on TODO: / FIXME: tags) or fail (on XXX: or simmilar) The build server is linux, home grown and based on ant. Would need to work at least on linux if not on windows. We also use perforce if an alternative is to block file commits. We also use eclipse, however I don't think you can make it a fatal error. (yes, there's the tasks

Are there multiline comment delimiters in SQL that are vendor agnostic?

感情迁移 提交于 2019-12-05 08:28:37
问题 While editing, building up, or cherry picking from SQL statements I can find myself interacting with one of four popular database tools. I have been resorting to single line commenting for DB2 and Informix. I have created macros in vim to make this slightly more efficient but I was wondering if I am working too hard. 回答1: C style comments are standard in SQL 2003 and SQL 2008 (but not in SQL 1999 or before). The following DBMS all support C style comments: Informix PostgreSQL MySQL Oracle DB2

XML comments and “--”

ε祈祈猫儿з 提交于 2019-12-05 08:20:59
问题 <!-- here is some comment -- ^ | what can be here apart from '>'? XML seems not to like '--' inside comments. I read somewhere that '--' switchs some modes inside <! ... > thing, but <!-- -- -- --> (even number of -- s) seem to be invalid too. If it is some historic feature, what is "pro" part of it? ("contra" part is inability to have -- in comments). What is the reason of complicating comment processing by not making just '-->' end of comment and allowing '--' inside? 回答1: From the

How to comment within an HTML attribute?

陌路散爱 提交于 2019-12-05 06:47:22
The final (closing) angle bracket in the code below is not interpreted as closing the <input> element: <input type='text' name='name' <!-- id='name' -->> I thought this was a valid way to comment out this attribute but Google Chrome, Firefox and Notepad++ (color coding) all suggest that this is not the way to go. I used CTRL + Shift + Q in Notepad++ to do this. Then what is the proper way to comment out this <id> attribute? HTML provides no way to place a comment inside a tag. If you are generating the HTML from a template / programming language, then you can use features of that to comment

Convert Single Line Comments To Block Comments

 ̄綄美尐妖づ 提交于 2019-12-05 06:08:53
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 "/* " . trim(mb_substr($match[1], 0)) . " */";' ), $output ); } Bart Kiers As already mentioned, " //.

How to make a line as a comment in SED

有些话、适合烂在心里 提交于 2019-12-05 06:07:31
问题 Excuse me if it is a repeat. I have crontab entries which look like: * * * * * sleep 15;/etc/opt/wer.sh 1 * * * * /opt/sfm/qwe/as.sh How to insert a # on the line which contains a call to "as.sh" using sed ? How to uncomment it back? 回答1: You can use: sed '/\/as.sh/s/^/#/' which will replace the start-line zero-width marker with a comment character for all lines containing /as.sh , as shown in the following example: pax> echo ' * * * * * sleep 15;/etc/opt/wer.sh 1 * * * * /opt/sfm/qwe/as.sh '

Show comments on wordpress home page

耗尽温柔 提交于 2019-12-05 06:04:09
So I've inserted the following code to the template loop (in the correct place) but it is not outputting any comments. Any clue why? <?php $withcomments = true; // force comments form and comments to show on front page comments_template( '', true ); ?> I'm trying to display comments for each post on the main-home-page stream of posts. EDIT: Just for the record, I'm using twenty ten theme. Try this before the <?php endwhile; ?> of the loop in loop.php: <?php $withcomments = "1"; comments_template(); ?> Try this: <?php global $withcomments; $withcomments = 1; comments_template(); ?> 来源: https:/

Insert a picture in code comment via Emacs

别来无恙 提交于 2019-12-05 05:13:56
An idea has just came to my mind. Is there any methods to insert a picture in code comment to help explain our code? After all, a picture is worth a thousand words. Since I use Emacs, is there any implementations for Emacs so far? Take a look at iimage-mode : it is a standard solution to display an image in a text buffer. For example, given the following file: /* an image is worth a thousand words: * <path/to/image.png> */ int main (int argc, char **argv) { return 0; } then running M-x turn-on-iimage-mode should display image.png in place of its path. However, I agree with @user4815162342's

Are Pascal comments supposed to nest?

久未见 提交于 2019-12-05 04:09:56
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 like {(*{comment}*)} or (*{(*comment*)}*) is ok since the same delimiters are not used in a row. I also

How do I disable or hide the unwanted Disqus ads on my website?

不问归期 提交于 2019-12-05 03:33:47
问题 Imagine that one day, suddenly, random ads started appearing on your website... Recently Disqus started forcing unwanted ads inside of the Disqus comments, displaying those nasty ads on your website(s) without your knowing. It seems that they only target the sites with "big enough" daily traffic or use some other arbitrary criteria, so the ads do not appear on all the websites, but only on relatively busy ones. This way Disqus "forces" you to upgrade to the paid subscription plan - for the