comments

How can I properly outcomment this PHP code? [closed]

天涯浪子 提交于 2019-12-02 13:45:49
I have this code: <?php do_action('twentytwelve_credits'); ?> <a href="<?php echo esc_url(__('http://wordpress.org/', 'twentytwelve')); ?>" title="<?php esc_attr_e('Semantic Personal Publishing Platform', 'twentytwelve'); ?>" ><?php printf(__('Proudly powered by %s', 'twentytwelve'), 'WordPress'); ?></a> How should I outcomment that? <?php echo 'This is a test'; // This is a one-line c++ style comment /* This is a multi line comment yet another line of comment */ echo 'This is yet another test'; echo 'One Final Test'; # This is a one-line shell-style comment ?> Depending on whether you want

The number of characters of comments in a file (C programming)

微笑、不失礼 提交于 2019-12-02 13:33:11
问题 I can't seem to get it right, tried everything, but.. int commentChars() { char str[256], fileName[256]; FILE *fp; int i; do{ long commentCount=0; fflush(stdin); printf("%s\nEnter the name of the file in %s/", p, dir); gets(fileName); if(!(fp=fopen(fileName, "r"))) { printf("Error! File not found, try again"); return 0; } while(!feof(fp)) { fgets(str,sizeof str,fp); for(int i=0;i<=sizeof str;i++) { if(str[i] == '/' && str[i+1] == '/') { commentCount += (strlen(str)-2); } } } fclose(fp);

FB.event.subscribe comment.create acting without action from user [duplicate]

瘦欲@ 提交于 2019-12-02 13:06:27
This question already has an answer here: Calling a PHP Method from JavaScript [closed] 2 answers OK, so here is my problem. I'm trying to get an email sent to the author of individual posts once a comments is made in facebook comments (to notify the author that comments have been made). The comment box is in a K2 item (in Joomla). FB.event.subscribe comment.create is working, I've tried it with just alert('fired'); and that works fine. But when I enter the PHP it just starts sending emails to the first email given everytime someone enters the page. How do I get it to send email only when a

Remove comments from JSON data

你离开我真会死。 提交于 2019-12-02 13:05:01
问题 I need to remove all /*...*/ style comments from JSON data. How do I do it with regular expressions so that string values like this { "propName": "Hello \" /* hi */ there." } remain unchanged? 回答1: You must first avoid all the content that is inside double quotes using the backtrack control verbs SKIP and FAIL (or a capture) $string = <<<'LOD' { "propName": "Hello \" /* don't remove **/ there." /*this must be removed*/ } LOD; $result = preg_replace('~"(?:[^\\\"]+|\\\.)*+"(*SKIP)(*FAIL)|/\*(?:

VBA Excel copy comment including formatting

泄露秘密 提交于 2019-12-02 13:03:16
问题 I'm using Excel 2007, and trying to write a VBA subroutine that will copy cell comments (including formatting). Cell comments can contain basic text formatting (style eg. bold etc) and I can successfully copy the text, but can't find a way to bring the formatting with it. I was hoping I could simply define a Comments object, then set it, but no go: Sub TestCommentCopy() Dim r As Range Dim c As Comment Set r = Selection If (Not r.Areas(1).Comment Is Nothing) Then Set c = r.Areas(1).Comment End

Excel: Add comment author using vba

女生的网名这么多〃 提交于 2019-12-02 11:38:17
When I add comments to a cell manually (using the insert comment command) the text is preceded by my username in bold font. Is it possible to replicate this characteristic for comments created in vba using Range.AddComment() (for whichever user is running the macro) ? You can add the logged in user name (with the user name in bold) like so - this example for cell A1: Sub EasyTest() Dim shCmt As Comment On Error Resume Next Set shCmt = [a1].Comment On Error GoTo 0 If shCmt Is Nothing Then Set shCmt = [a1].AddComment shCmt.Text Text:=Environ$("UserName") & Chr(10) & "TestMe" shCmt.Shape

Finding VBA Comments using RegEx

拈花ヽ惹草 提交于 2019-12-02 10:30:49
问题 I am trying to find all VBA comments using regular expressions. I have something that mostly works, but there are a few exceptions that I cannot figure out. Expression I am using: '(?!.*").* Take our test code: Working - This is a test 'This should be captured Working - "this is a test" 'This should be captured Not Working - "this is a test" 'This should be "captured" Not Working - This is a test 'This should be "captured" Working - "this is a test 'this should not capture'" 'this should

Automatic source file preamble in Visual Studio 2010? [closed]

烂漫一生 提交于 2019-12-02 09:20:15
I would like to configure my VS2010 so that, every time a new source file is created, a comment preamble (which will contain a license) is included. Our immediate need is for C#, but it would be nice to predefine different comment blocks for different languages (which may be needed because of different comment syntaxes). Is there a 3rd-party plugin for that? Example: /* * This software is licensed under the terms of Blah. * Use of this software is conditional to saying "Blah". */ using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication1

Finding VBA Comments using RegEx

怎甘沉沦 提交于 2019-12-02 07:33:24
I am trying to find all VBA comments using regular expressions. I have something that mostly works, but there are a few exceptions that I cannot figure out. Expression I am using: '(?!.*").* Take our test code: Working - This is a test 'This should be captured Working - "this is a test" 'This should be captured Not Working - "this is a test" 'This should be "captured" Not Working - This is a test 'This should be "captured" Working - "this is a test 'this should not capture'" 'this should capture Working - "this isn't a test" 'this should capture Here is a link to this example in RegExr: http:/

Display Comment in Nested Way like Gmail Comment

萝らか妹 提交于 2019-12-02 07:30:37
问题 I have a table comments , thats look like this, added some mockup content as well: +------------+---------+----------+-------------------+------------------------------------+---------------------------+ | comment_id | user_id | post_id | comment_parent_id | comment_content | comment_creation_datetime | +------------+---------+----------+-------------------+------------------------------------+---------------------------+ | 26 | 1 | 16329 | 0 | Första | 2016-01-24 10:42:49 | | 27 | 1 | 16329