logo
Tags down

shadow

Change formatting of inline comments from // to /* */


By : Vijay
Date : October 17 2020, 06:10 AM
Hope that helps I have a C file with multiple inline comments that begin with //.
code :
#include <stddef.h>
#include <stdio.h>
#include <string.h>


#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
#define ARRAY_SSIZE(arr) ((ptrdiff_t)ARRAY_SIZE(arr))


// Read line from file
fgets(buff, BUFSIZ, fp_r);

// Find "//" comment
p = strstr(buff, "//");
if (!p)
        continue;

// If comment is at the very end of the buffer, and wouldn't fit, remove it.
if ((p - &buff[0] + strlen("/**/\n") + 1) > ARRAY_SSIZE(buff)) {
        sprintf(p, "\n");
        continue;
}

// Remove "*/" that would break the new comment format
do {
        q = strstr(p, "*/");
        if (q)
                memmove(q, q + strlen("*/"), strlen(q + strlen("*/")) + 1);
} while (q);

// Write the new comment begining
sprintf(p, "/*");

// Find end of line
p = strrchr(buff, '\n');

// Check that the closing "*/" fits in the buffer
while ((p - &buff[0] + strlen("*/\n") + 1) > ARRAY_SSIZE(buff))
        p--;

// Write closing "*/"
sprintf(p, "*/\n");

// Write line to file
fputs(buff, fp_w);
a = 7; /* // this will mess everything */
a = /*7*/b; /* // hello, this too */ c=a; // another comment


Share : facebook icon twitter icon

Add specific Facebook Like Button for comments posted by inline ajax comments (WP plugin)


By : elendil33
Date : March 29 2020, 07:55 AM
To fix the issue you can do It necessary to include Facebook script inside this function like that :
code :
function inline_comments_load_template(){

    check_ajax_referer('inline_comments_nonce', 'security');

    $comments = get_comments( array(
        'post_id' => (int)$_POST['post_id'],
        'number'  => 100,
        'status'  => 'approve',
        'order'   => 'ASC'
    ) );

    ?>
<div id="fb-root"></div>
<script>(function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0];
  if (d.getElementById(id)) return;
  js = d.createElement(s); js.id = id;
  js.src = "//connect.facebook.net/fr_FR/all.js#xfbml=1";
  fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
    <div class="inline-comments-container" id="comments_target">
        <?php if ( $comments ) : foreach( $comments as $comment) : ?>
            <?php
            $user = new WP_User( $comment->user_id );
            $class = null;
            if ( ! empty( $user->roles ) && is_array( $user->roles ) ) {
                foreach ( $user->roles as $role ){
                    $class = $role;
                }
            } else {
                $class = 'annon';
            }
            ?>
            <div class="inline-comments-content inline-comments-<?php echo $class; ?>" id="comment-<?php echo $comment->comment_ID; ?>">
                <div class="inline-comments-p">
                    <?php inline_comments_profile_pic( $comment->comment_author_email ); ?>
                    <?php print $comment->comment_content; ?><br />

<div class="fb-like" data-href="http://YOUR-URL#<?php echo $comment->comment_ID; ?>" data-layout="button_count" data-action="like" data-show-faces="false" data-share="false"></div>

                    <time class="meta">
                        <strong><?php $user = get_user_by('login', $comment->comment_author ); if ( ! empty( $user->user_url ) ) : ?><a href="<?php print $user->user_url; ?>" target="_blank"><?php print $comment->comment_author; ?></a><?php else : ?><?php print $comment->comment_author; ?><?php endif; ?></strong>
                        <a href="<?php echo get_permalink( $comment->comment_post_ID); ?>#<?php echo $comment->comment_ID; ?>" class="inline-comments-time-handle" data-comment_id="<?php echo $comment->comment_ID; ?>"><?php print human_time_diff( strtotime( $comment->comment_date ), current_time('timestamp') ); ?> ago.</a>
                    </time>
                </div>
            </div>
        <?php endforeach; endif; ?>
    </div>
    <?php die();
}

VB.Net Inline comments


By : dokydoky
Date : March 29 2020, 07:55 AM
around this issue No it is not possible.
But, as you found out by yourself, in the future version - Visual Basic 14 (Visual Studio 2015) this will be possible New Language Features in Visual Basic 14
code :
Dim newPacketStarts As Byte = &HF5
Const StartOfNewPacket As Byte = &HF5
Const AnotherValue As Byte = &H1
Const AnotherNewvalue As Byte = &HF53
'...
Dim buffer As Byte() = 
    {
        StartOfNewPacket,
        AnotherValue,
        AnotherNewvalue
    }

How to add comments to inline CSS?


By : LuckyStiff
Date : March 29 2020, 07:55 AM
wish help you to fix your issue I want to comment out some css style that is inline (inside some html tags). How do I do this? Do I use the /* */comments from CSS? Or for html? , Use /* and */.
code :
<span class="color_dark" style="top:20px; /*font-size: 17px;*/ line-height: 0px;position: relative;">onbezorgd genieten van uw<br> haard of kachel</span>

How to apply Rich Text formatting in Podio comments while adding comments through comments API


By : gokcesengun
Date : March 29 2020, 07:55 AM
With these it helps Formatting works when we leave a space before and after of a special charector, In this comment developer have to add space before & after * or \n then it would must work.
code :
$comments .= " **[Created_On]** $created_on \n **[Comment]** $comment \n ";

DB2 CLP Inline Comments


By : João Vitor Ferreira
Date : March 29 2020, 07:55 AM
may help you . It seems it is a feature (restriction) of the CLP only, and the CLP is inconsistent as you described. Might be worth a PMR. In other words the interactive CLI (db2cli) let me run SQLExecDirect() successfully if the statement has the terminator followed by an inline-comment. And the jdbc driver also accepts inline comments (as you found with Data Studio). The doc link that specifies that for CLP -f option allows comments only when the first nonblank characters on the line are -- or /* is : here
Related Posts Related Posts :
  • RegEx for matching everything except a text between two words
  • RegEx for identifying a date followed by a special pattern
  • RegEx for transforming the next text using PhpStorm's search and replace dialog
  • RegEx capturing group in Elixir
  • Parsing multiline quoted strings in a large file
  • RegEx for removing lines that have the same id in Notepad++
  • RegEx for substituting only to the left of LaTeX comments
  • How to match a 10-char string ending with 2 Digits?
  • Parse default Salt highstate output
  • Why does Scala regexp work differently in pattern matching
  • RegEx for extracting a value from URLs
  • Regex match between parenthesis stopping at first space within parenthesis
  • How to replace some patterns with whitespace in perl?
  • RegEx for extracting part of HTML elements
  • Extract a specific term 'hardrock'
  • Using htaccess, how do you re-write for parameters over 8 characters or more only?
  • Regular expression cannot match "</p>" correctly
  • Need regex pattern for input text box allowing numbers between 0 to 100 and up to 2 decimals eg., 0.22 to 100.00
  • Regex to extract name from a string
  • Why is 1100 matched by /(0*1(00)*10*)*/?
  • Preventing a regex from matching by using a negative look behind
  • Is sed auto in-place substitution?
  • RegEx for identifying alphanumeric patterns with special chars and boundaries
  • Regex for patterns like [ABC], ABC and ABCxx where xx is a number
  • Regex remove first section and optional last section
  • regex pattern not fit well for code like assignment
  • Regex to encode an URL with special characters
  • How to replace a whitespace between a group of numbers with a dot or a comma?
  • How to find double letters and replace them with triple letters?
  • A regular expression for matching a group followed by a specific character
  • How to capture everything until another capture group
  • Remove lines with more than x digits
  • RegEx for ignoring certain words
  • Qt: Regex max. 9 digits (Int and Float)
  • Remove special characters and add a semi colon in a word - Tableau
  • Howto check if the first 4 characters of first name and first 4 characters of last name appear in the username
  • How do I use a variable in Perl regex/replace?
  • RegEx for capturing contents between asterisks, except for a word
  • How to only match letters that occur more than once in a string, using regex?
  • Dart http requests to manipulate a website with expression language
  • Remove numbers and parentheses at the beginning of each line in Notepad++
  • replace markdown heading to starts
  • Regex - Expression for 6 digits or 9 digits not less or between or more
  • Is there a pythonic way to count the number of leading matching characters in two strings?
  • How do I insert a variable into a regex .match() assertion?
  • Regexp - joining multiple lines not starting with dash
  • Quick one ,what is the appropriate regex to match any number greater than 750 ? in the below test content?
  • Regex last occurence of digit before some string
  • unexpected result by cutting the last column with sed
  • How to match cjk characters with sed?
  • How to convert dots to commas decimal notations using excel formula
  • Need a Regex that includes all char after expression
  • Match words and sentences between HTML tags while ignoring whitespaces at the beginning and the end
  • Perl string replace not working with $1 and $2
  • Matching inverse of multi line regex pattern
  • How can I make this query take multiple columns?
  • Regex to match variable number of annotations
  • Use .txt logfile to move files into multiple folders
  • Regex to find numbers from String with different format
  • Regex help specific to Spamassassin
  • shadow
    Privacy Policy - Terms - Contact Us © 35dp-dentalpractice.co.uk