comments

VSCode: delete all comments in a file

不问归期 提交于 2020-02-01 05:37:13
问题 Is there an easy way to delete all comments from an open file in VSCode? Preferably both line and block comments. Most interested in Java, but also Python and R. 回答1: Easy way: Open extensions (ctrl-shift-x) type in remove comments in the search box. Install the top pick and read instructions. Hard way (I guess) search replace(ctrl-h) toggle regex on (alt-r). Learn some regular expressions! https://docs.rs/regex/0.2.5/regex/#syntax A simple //.* will match all single line comments (and more

(php) regexto remove comments but ignore occurances within strings

[亡魂溺海] 提交于 2020-01-25 21:50:06
问题 I am writing a comment-stripper and trying to accommodate for all needs here. I have the below stack of code which removes pretty much all comments, but it actually goes too far. A lot of time was spent trying and testing and researching the regex patterns to match, but I don't claim that they are the best at each. My problem is that I also have situation where I have 'PHP comments' (that aren't really comments' in standard code, or even in PHP strings, that I don't actually want to have

how to modify date format in wordpress list comments

被刻印的时光 ゝ 提交于 2020-01-24 16:35:53
问题 I want to modify my comments list detail date showing replay button and etc in my wordpress theme i saw this code and i use it but i need to modify the date format and the lable and titles and etc i use this code <?php /*----------------------------------- Template for Comments ---------------------------------------*/ ?> <div id="comments"> <?php if ( post_password_required() ) : ?> <p class="text-error"><?php _e( 'This post is password protected. Enter the password to view any comments.',

/* ARGSUSED */ and other special comments

血红的双手。 提交于 2020-01-24 03:12:58
问题 I've searched on SO and googled but I don't get meanings of them. What are they and their purposes? When are they used? I think that maybe I'm too late to see them in modern-day programming and in my generation. Some of them AFAIS, /* ARGSUSED */ /* VARARGS */ /* LINTLIBRARY */ /* NOSTRICT */ Example code with /* ARGSUSED */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <pthread.h> #define BUFSIZE 1024 #define TEN_MILLION 10000000L /* ARGSUSED */ void

/* ARGSUSED */ and other special comments

二次信任 提交于 2020-01-24 03:12:49
问题 I've searched on SO and googled but I don't get meanings of them. What are they and their purposes? When are they used? I think that maybe I'm too late to see them in modern-day programming and in my generation. Some of them AFAIS, /* ARGSUSED */ /* VARARGS */ /* LINTLIBRARY */ /* NOSTRICT */ Example code with /* ARGSUSED */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <pthread.h> #define BUFSIZE 1024 #define TEN_MILLION 10000000L /* ARGSUSED */ void

how to change xml by browser

北城余情 提交于 2020-01-23 18:03:44
问题 I would like to change some rules in my XML depending on the browser. For example, the 'fontcolor' should be black when using IE. So far I googled it, I found this could be possible using XSLT. But unfortunately, after googling/trying&error after 1/2 days, I still didn't get the clue how to do this. Could someone help me how to solve this? Any help would be highly appreciated. Thanks !! EetieD. My current XML: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href=

how to change xml by browser

匆匆过客 提交于 2020-01-23 18:03:33
问题 I would like to change some rules in my XML depending on the browser. For example, the 'fontcolor' should be black when using IE. So far I googled it, I found this could be possible using XSLT. But unfortunately, after googling/trying&error after 1/2 days, I still didn't get the clue how to do this. Could someone help me how to solve this? Any help would be highly appreciated. Thanks !! EetieD. My current XML: <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href=

Using social plugins for pre-existing Facebook posts

一笑奈何 提交于 2020-01-23 12:48:18
问题 If there a way to use the Facebook Feed, Comments, and Like social plugins for existing Facebook posts? We're looking for a way to have pages on our site supplementing existing Facebook posts made on our FB page. The goal is to keep all sharing, comments, and likes centralized around single post, rather than the usual model where each person shares a distinct post on their feed. Example post from McDonalds: http://www.facebook.com/photo.php?fbid=10151001277817014&set=a.10150319191897014

<fb:comments-count> not working on my WordPress powered blog

可紊 提交于 2020-01-23 03:40:06
问题 I am using the Facebook comments plugin on WordPress and the comments box is working fine but I want to access the number of counts on the index page and on single pages. On the pages, the Facebook Javascript is loaded on the pages. Here's the code I used: <fb:comments-count href=<?php echo get_permalink() ?>/></fb:comments-count> comments But it doesn't count the FB comments. Is there a simple code that let me retrieve the number of comment counts? Thanks, 回答1: Include this function

Using Rhino's Javascript parser, how to get the comments?

北城余情 提交于 2020-01-23 01:19:09
问题 I have some javascript files and parse it using Rhino's javascript parser. but I can't get the comments. How can I get the comments? here's a part of my code. run this code, "comment" variable has null. also, while running "astRoot.toSource();", it shows only javascript code. no comment included. it disappeared! [java code] public void parser() { AstRoot astRoot = new Parser().parse(this.jsString, this.uri, 1); List<AstNode> statList = astRoot.getStatements(); for(Iterator<AstNode> iter =