FAQ Database Discussion Community


how to find multiline comments from a java file?

java,string,file,comments,lexical-analysis
I've read my java source file and stored it's contents in String s However i'm facing difficulty in finding the multiline comments from file My task is to find the multiline comments like these:- /* i am helpful i am great */ and display them...

Silverstripe - How to Allow Comments For A Blog Entry

comments,blogs,silverstripe
I'm setting up my first ever site in Silverstripe and I'm having trouble with the silverstripe blog module (https://github.com/silverstripe/silverstripe-blog/tree/0.3). I've installed it and the two supporting modules comments (https://github.com/silverstripe/silverstripe-comments) and grid-field-bulk-editing tools and they all seem to have installed without incident. Finally, I've checked the box in the setting for...

How can I comment out my Ruby return values with something like “# =>”?

ruby,comments,return-value,read-eval-print-loop
Having just started with Ruby and while following a tutorial, the result was shown as: a + b # => 3 I have never seen such a possibility; that seems so handy! Could you please tell me what it is? is it proprietary or is it for everyone?...

Facebook comment count per person

facebook,count,website,comments
Ok guys so I have this question, which facebook developers page doesn't answer. The only answer so far is on this page. https://developers.facebook.com/docs/plugins/comments which states that I can get the comment count on an entire URL. But I need it a little different way. So I have a website with...

vim comment/uncomment with one mapping [duplicate]

function,vim,mapping,comments
This question already has an answer here: What's a quick way to comment/uncomment lines in Vim? 32 answers I'm new(bie) in vim. I've got the following mapping to comment my python code : nmap cc 0i#<ESC> I would like to have the same mapping to uncomment a line. I...

Using Action mailer for new comment notification rails 4

ruby-on-rails,notifications,comments,actionmailer
i have action mailer setup in my app to send the micropost user a mail whenever a new comment has been made on his micropost. Here is my code comments_controller def create @micropost = Micropost.find(params[:micropost_id]) @comment = Comment.new(params[:comment].permit(:user_id, :body, :micropost_id)) @comment.micropost = @micropost @comment.micropost.user = @micropost.user @comment.user = current_user if...

Need help understanding mySQL PHP project

php,mysql,comments
I was given an assinment to finish a project from an advanced Web Aplication student and im trying to understand all the code, but it is becoming very difficult. I'd appreciate some help with the code lines. Im already commenting the lines to help me advance. Can you comment the...

Why do comments affect the logic of my file?

javascript,html5,comments
EDIT: In here, it shows this as being a comment. In my IDE, it shows this as being code. So weird (Code set #2): <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script> <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> <script src="bootstrap-3.3.2-dist/js/bootstrap.min.js"></script> I have two files. One has comments and one does not. The first set of code...

How to remove '#' comments from a string?

string,python-3.x,comments
The problem: Implement a Python function called stripComments(code) where code is a parameter that takes a string containing the Python code. The function stripComments() returns the code with all comments removed. I have: def stripComments(code): code = str(code) for line in code: comments = [word[1:] for word in code.split() if...

Wordpress - Alter the form action url in wp-includes/comments-template.php

php,wordpress,https,woocommerce,comments
I am currently working on a website that is non ssl for the non eCommerce sections, but uses ssl for the woocommerce portion. I am attempting to redirect reviews of products to a thank you page, which I was able to get working just fine on staging. When moving to...

What comment widget/system is 9GAG using? [closed]

javascript,php,jquery,comments
I want to use a comment system for my new website I'm developing, and I really like the comment system 9GAG is using. A random post as an example: http://9gag.com/gag/aby5Ky9 I searched their source code, checked their javascript files, but I simply couldn't find anything. Or did they built this...

Emacs major mode for emerald. Correct highlighting

emacs,comments,syntax-highlighting,major-mode
Long story short: I am a student and in one of my courses we have to use/learn the emerald programming language. After a quick google search I found that somebody already wrote a major-mode for it. Link to the script The problem: After the first comment line "%...", syntax highlighting...

Comment system in php and mysql

php,mysql,comments
I write script and form for comment for my movie website but I don't know how to store each comment in his table column in database for specyfic movie. for example, I have to movies on this image http://prntscr.com/65wilp So, I want when I post comment on movie 95ers Time...

PHP Comment Tag

php,tags,comments
In the wonderful world of Java/JSP, you can use this form of commenting: <%-- anything in here is ignored and does not get sent to the client it can span multiple lines and is useful for commenting out blocks of JSP, including tags and HTML: <c:if test="${some.condition}"> <p>All this is...

Displaying comments using django_comments

django,comments,django-comments
I have installed django_comments put it in INSTALLED_APPS field in settings.py have defined SITE_ID = 1 enabled the sites framework put url(r'^comments/', include('django_comments.urls')) in urls.py have written {% load comments %} in home.html But I still can't see any comments loading in my home page. What am I missing?...

how can i add comments to to a custom page

wordpress,comments,posts
I am trying to display the comments of a post in a custom page in wordpress. I want to display all the comments including sub-comments. There is any way to display the comments of corresponding post?the_comments() shows all the comments in the database. Can I use get_the_commets($args)?

Comment/Uncomment Chrome Developer tools

google-chrome,comments,development-environment
//Comment //Ctrl+K,Ctrl+C (to comment code in Visual studio) //Ctrl+K,Ctrl+U (to uncomment code in Visual studio) //Ctrl+? (To Comment in Chrome Developer Tools) //Ctrl+? (To Uncomment in Chrome Developer Tools) I use network mapping in Chrome Development Tools. I want to comment/uncomment a block of code in javascript. Is there a...

Static Comments on Drupal Node

drupal,drupal-7,comments,drupal-modules
I have a basic Drupal instance installed on my local server. One of the requirements I have is that users should be able to post comments on a node/article using static options given to them. For e.g., if a user opens an article, in the comment section, rather then showing...

Differences between /* */ and // in javascript

javascript,comments
I have searched everywhere for the answer to this, but I can't seem to find it. Maybe i'm looking in the wrong place? Anyway, I'm trying to figure out all the differences between /* */, and // comments. I know that // is line end, and that /* */ can...

Comment tag @code doesn't work with properties

ios,objective-c,properties,documentation,comments
I'm documenting my Objective-C code for the Quick help function in Xcode like this: but I have a little problem in documenting the properties: it's possibile use the tag @code ? Because this comment doesn't work: /** the URL base for backend APIs @code codeexample; @endcode */ @property (nonatomic, strong)...

Strange behavior of tcl comments?

comments,tcl
I have the following tcl file: proc test {} { ## proc test {} { # puts "test" ## } puts "Hallo" } Which does not produce an error. If I now delete the closing braced in the comment I get an error proc test {} { ## proc test...

How to set a notification conditional based on polymorphic comments?

ruby-on-rails,ruby,notifications,comments,polymorphic-associations
I have this in comment.rb: def create_notification self.notifications.create( comment: self, goal: self.goal, valuation: self.valuation, user: # How to fix this line? if valuation self.valuation.user, else goal self.goal.user, end read: false ) end How can we make it where when the comment is on a valuation the notification uses user: self.valuation.user...

Adding comments in a fish shell function file

comments,fish
How do I add comments to a function a write for fish shell? Is it //. I can't seem to be able to tell. When I use //, sometimes when the function fails, it changes the user to the root directory.

How can I deal with comments in my AST?

delphi,haskell,comments,abstract-syntax-tree
I am writing a Delphi code parser using Parsec, my current AST data structures look like this: module Text.DelphiParser.Ast where data TypeName = TypeName String [String] deriving (Show) type UnitName = String data ArgumentKind = Const | Var | Out | Normal deriving (Show) data Argument = Argument ArgumentKind String...

How to evaluate comments in php?

php,doctrine,comments,doctrine-odm
How is it possible, to evaluate commands in php like Doctrine? If I write this, Doctrine can handle it somehow, but I have no idea how: /** * @Column(type="string", name="title") * @var string */ private $title; ...

Why is executing Java code in comments with certain Unicode characters allowed?

java,unicode,comments
The following code produces the output "Hello World!". (No really, try it) public static void main(String... args) { // The comment below is no typo. // \u000d System.out.println("Hello World!"); } The reason for this is that the Java compiler parses the Unicode character \u000d as a new line and gets...

Do comments get translated to machine code? C++

c++,performance,compilation,comments
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? Thanks.

How to escape backslash in // comment

c++,escaping,comments,preprocessor,clang++
I have a comment that ends with backslash. Somethink like ... // use \ .. Clang(++) warned me, that this is multi-line comment warning: multi-line // comment [-Wcomment] // use \ ^ So I try add some whitespace at the end, but didn't help. Can I escape backslash somehow?...

Clean Code in Excel?

vb.net,excel,f#,functional-programming,comments
As a former programmer I like clean, maintainable and documented code. As a project manager I have to do complex excels from time to time and want to write "clean" formulas in the same way I wrote programs. (How) Can I add "comments" into a (multiline) formula? (How) Can I...

Is wordpress comment form safe?

wordpress,forms,validation,comments
I have this Wordpress form for comments, it's pretty standard: <form action="http://sitename.com/wp-comments-post.php" target="writeIframe" method="post" id="commentform" class="comment-form"> <p class="comment-form-author"> <label for="author">Your name</label> <input id="author" name="author" type="text" value="" size="30"> </p> <p class="comment-form-comment"> <label for="comment">Comment</label> <textarea id="comment" name="comment" cols="45" rows="8"...

Is executing C++ code in comments with certain Unicode characters allowed, like in Java?

c++,c++11,unicode,comments
I know that executing Java code in comments with certain Unicode characters is allowed. Please see this question for further clarification Executing Java code in comments. So was just curious to know if C++ has such features?

How do you add a comment box in java?

java,eclipse,comments,shortcut,box
I am working on a project in java for class and I need to add a comment box above each of my methods explaining what each method does. It's supposed to look like this: ***** *** ** ** ** (asterisk line) ************************************************************************* *@param * **** *** ** ** ** **(another...

Annotations in Java

java,comments
I was wondering what exactly anotations are used for in Java, I have a basic understanding of it. However my true question is, what does annotions mean when their in a comment? For example: /** @param **/. Does it have any effect in the code itself? Thank you. ...

Unable to pass current_user.name as an attribute for comment

ruby-on-rails,ruby,comments
Workaround for the below: <%= f.label :Commenter %><br> <%= f.text_field :commenter, :value => current_user.name %> This works for passing the username to the commenter attribute without having to type it in - with the addded bonus of being able to edit it if necessary! I am trying to make my...

Using django_comments but getting 'QuerySet' object has no attribute '_meta'

django,comments,django-comments,django-errors
My django project named comments is here. It has an app comms which is there to display comments using django_comments. I have installed django_comments put it in INSTALLED_APPS field in settings.py have defined SITE_ID = 1 enabled the sites framework put url(r'^comments/', include('django_comments.urls')) in urls.py But this template file is...

Facebook Graph API get page's comment

facebook,facebook-graph-api,comments
Using Facebook Graph API, I want to get that all comments that presents in a page and filter them based on datetime. I've read this thread, but it doesn't help as expected. I can get all post and limit using date for specific page e.g.: graph.facebook.com/110432309005026/tagged?since=<unix timestamp> Now I want...

SQL - Paging comments

sql,sql-server,sql-server-2008,comments,paging
I have the Table Comment below: CREATE TABLE Comment ( CommentID int, Username nvarchar(50), Content nvarchar(255), ReplyID int, primary key (CommentID), ) ALTER TABLE dbo.Comment ADD FOREIGN KEY (CommentID) REFERENCES dbo.Comment (CommentID) ON DELETE NO ACTION ON UPDATE NO ACTION, And I want to query paging comment in detail product...

Unicode escaped comments in Python

python,unicode,escaping,comments,lexical-analysis
I made a Java program that uses unicode escaped characters to break a multiline comment and hide some functionality. The program below prints "Hello Cruel World". I'm wondering if this is possible to do in Python (any version). If it is not possible, how is this prevented in the language?...

comment host file rows containing a string, if not already commented

bash,sed,comments,hosts
I am attempting to comment several entries in my [/etc/hosts] file using sed. I have the following command which works great: sed -i$(date +%s).bak '/devops/,/devops/s/^/# /' /etc/hosts My problem comes when i re-run the script containing the above line, my commented lines get a new comment. How can I add...

WORDPRESS - no Comment after server change

database,wordpress,comments
after the change to another server, I get this error when someone try to post a comment to a post: The comment could not be saved In the Debug Mode i get this information: Duplicate entry '1' for key 'PRIMARY' In the backend I can see, that there are new...

HTML-Comments most readable [closed]

html,html5,comments
I am wondering how html-comments on bigger section-blocks can get structured in the most readable, strucuturally easy to recognize way? I do mine as this: ....</section> <!-- _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ 4th Block: Contact sheet _-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_ --> <section class .... I know this takes a bit of file-size, but 1. you can autoreduce...

Change Excel Comment Font in C# VSTO

c#,excel,comments,vsto
This may seem really trivial, but for the life of me I cant figure out how to alter the font properties of a comment box. Excample of VBA code would be: Sub SetCommentsProperties() Dim Cell As Range For Each Cell In Selection If Not Cell.Comment Is Nothing Then With Cell.Comment.Shape.TextFrame.Characters.Font...

hiding comments in matlab's editor

matlab,comments
Is there a simple way to hide the comments while you're writing your code in matlab's editor? I have too many comments and they really get on my nerves sometimes. I did a little search and was surprised to find nothing on this simple issue! Thank you in advance

How to set :user_id with comment notifications?

ruby-on-rails,ruby,model-view-controller,notifications,comments
Whenever a notification is created how can we set the :user_id for the user who made the comment (and in affect the notification)? When I check rails console for some reason all Notifications are showing up as user_id: 1 when some of them should be user_id: 2 since the latter...

'comment_popup_link()' with different #ID on Genesis Framework

php,wordpress,comments,reply,genesis
I want to add a "comment" and "reply" links under every post on my Wordpress theme. Standard "comment_popup_link()" function creates such link: http://website.com/page/#comments What I want is to create another one, next to the above, looking like this: http://website.com/page/#reply How can I do that? I'm trying to add it on...

MySQL Workbench export error

mysql,import,export,comments,mysql-workbench
I designed a mysql database with Mysql Workbench and exported it as SQL commands. Then executed them on phpmyadmin. This is what happened: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near...

Strip comments from javascript file

javascript,regex,comments
I'm trying to construct a regular expression to strip all comments from javascript code, both single-line (//...) and multiline (/*..*/). This is what I've come up with: /\"[^\"]*\"|'[^']*'|(\/\/.*$|\/\*[^\*]*\*\/)/mg Description: As you can see it searches also for string literals. This is because string literals can contain content that otherwise could...

How to comment in a Right to left language in Visual studio IDE

visual-studio,comments,persian,farsi,rtl
I want to comment in visual studio in Persian (which is a right to left language) like this: //.برای نگهداری مقدار اولیه ی کالا می باشد value_ متغیر But it seems the code editor does not support RTL languages and reorders the words so the result is : //متغیر _value...

Having error while letting users post comments and loading comments on a page

ruby-on-rails,comments
I get the following error: syntax error, unexpected keyword_end, expecting end-of-input This is my Comments_controller file, class CommentsController < ApplicationController def create @post = Post.find(params[:post_id]) @comment = @post.comments.build(params[:comment]) @comment.save redirect_to @posts end def destroy end end end This is the HTML for using it, <h1><%= @post.title %></h1> <%= @post.text %>...

Doxygen \cond not working

comments,doxygen
I am writing some documentation of some software in a .dox file and wand to include some comments that will not show in the webpage. I am using \cond but I am not getting any output after calling \endcond. /// \section cuboids_sec Cuboids /// /// \cond /// [TODO] /// \endcond...

Why I can't comment and disable this section of code into a JSP page?

java,html,jsp,java-ee,comments
I am working on some JSP pages and I don't know how correctly comment (to disable) a portion of code. Into my code I have the following situation: <!-- <%if (tipoingresso.equalsIgnoreCase("NOLOGGED")) {%> <!--ATTENZIONE DIFFERENZA TRA FRONT END E SENZA FRONT END--> <!--<a href="/EdiWEA" target="_parent"><span class="linkboldblue10">&nbsp;&nbsp;Esci</span></a></ALIGN="LEFT">--> <!--<a href="../" target="_parent"><span...

Reference generic parameter in C# xml documentation comment

c#,.net,generics,comments,xml-documentation
How do I correctly reference the overloaded method with generic parameter in c# documentation comment? What should I put into cref attribute? I want Visual Studio 2010 (and ReSharper) to resolve it correctly. /// <summary> /// <see cref="MethodName(IEnumerable<string>)"/> /// </summary> public class ClassName { public void MethodName(IEnumerable<string> param) { //...

Adding a comment to a excel using VBA

excel,vba,excel-vba,comments
I'm having real difficulties adding a comment to a cell. I'm calling the following sub Sub ValidationError(row As Long, column As Integer, ErrorLine As String) Tabelle1.Cells(row, column).Interior.Color = vbYellow Tabelle1.Cells(row, column).AddComment ErrorLine End Sub But I always get a 1004 error, saying "Application or object error" (this is translated, original...

How to edit this code in wordpress

wordpress,comments
I have a theme called EasyVersion: 1.2 By D5 Creation. For the comment box section I want to change the text so it says something different than Post Comment. I have searched and searched every where, even searched for the code using All Files search. This I presume is the...

Replace every symbol of comments by whitespace

c#,replace,comments,whitespace
I have some C# code document. Need to replace every symbol of every comment by "whitespace".(need to do this with one-lined and multi-lined comments both). As example: I have comment: //12345 it must be replaced to 7 whitespaces. The same with multi-line comments. After doing this action I need to...

Move chunk of HTML with RegEx

html,regex,comments,dreamweaver,regular-language
What I am trying to do is find a chunk of HTML that has comments chunk!--/block--> and move it in its entirety right after header. The thing is that the comment always remains the same but the chunk varies through pages using find and replace in Dreamweaver. Here is a...

What exactly is license boilerplate commenting and what format does it need to be in?

c++,coding-style,comments,boilerplate,commenting
I was reading through the Google C++ Style Guide to try to emulate good coding practices. When I read through the section on how to comment my code, it asks me to start each file with license boilerplate. All I could find out about this terminology was from Mozilla and...

Why does it appear that my Javascript code is a comment?

javascript,comments,dreamweaver
Here is my code: chart.fillText(i*topNum, (right_cordinates_width/3)*2, (cVid.height-line_bottom_distance) / 10 - i ); the characters between / /3)*2, (cVid.height-line_bottom_distance) / is grayed out like a comment. Why does this happen and is it really a comment?...

Yahoo Merchant Store Catalog Tags Insert Dynamically with Javascript, Jquery, or Ajax

javascript,dynamic,tags,comments,yahoo-merchant-store
I opened up a yahoo store through their Merchant Service. They have a pretty good store catalog that I have used on a business site that I own. I like it so I decided to use the service again on another business I own. I got the site built but...

How to collapse/expand all comment blocks in a file in PhpStorm?

php,comments,phpstorm,collapse,docblocks
In PhpStorm, what is a quick way to collapse or expand all the comment (doc) blocks in a file? In the docs here it says: Folding and expanding code blocks works for entire classes, inner and anonymous classes, method bodies, import lists, comments, HTML and XML tags, closures and language...

Wordpress comments have footer tag

wordpress,twitter-bootstrap,comments
I am developing at wordpress theme, and ran into a problem. my comments are showing up with the same background image as my footer have, and i can't find the footer tag in the comments.php in my theme, so my question is there any other palce i should look ?...

SELECT posts, its last 3 comments and count of all comments

php,sql,select,pdo,comments
SELECT posts, its last 3 comments and count of all comments My code: SELECT p.*, u.id, u.username username, u.usersurname usersurname, u.usermainphoto userphoto, GROUP_CONCAT(c.text SEPARATOR '[email protected]#md%o^v&') commenttext,GROUP_CONCAT(c.likes SEPARATOR '-') commentlikes,GROUP_CONCAT(c.dislikes SEPARATOR '-') commentdislikes, GROUP_CONCAT(c.commentdate) commentdate, GROUP_CONCAT(u2.username) commentauthorname, GROUP_CONCAT(c.anonim) commentanonym, GROUP_CONCAT(c.id) commentid, GROUP_CONCAT(u2.id) commentauthorid,...

Block commenting in NetBeans IDE java editor

comments,netbeans-8
I have got the following code snippet written in java editor of NetBeans IDE 8.0.2 that should be multi-line commented in such a way that enables me to fold/collapse the commented portion. void changeGear ( int newValue ) { gear = newValue; } How can I do that?...

Double backslash in comment inside array

c++,arrays,comments
I have an array defined as follows: extern const char config_reg[] = { 0x05, //comment 0x00, //comment 0x00, // \\ <-- double backslash 0x01, //comment 0x03 } As you can see, there is a double backslash inside a comment (the <-- double backslash and preceding spaces do not appear in...

Is there any multiline commenting support for C language in Atom Editor?

c++,c,comments,atom-editor,commenting
I'd like to enable multiline commenting support in my Atom editor. I'd like the editor to automatically add a * and a proper indentation at the beginning of new lines of a multiline comment. Here's a sample of what I'm looking for: /*** * This is a comment * when...

How to print comments in lex?

comments,lex,lexical-analysis,lexical-scanner
So the title might be a little bit misleading, but I can't think of any better way to phrase it. Basically, I'm writing a lexical-scanner using cygwin/lex. A part of the code reads a token /* . It the goes into a predefined state C_COMMENT, and ends when C_COMMENT"/*". Below...

How to get Visual Studio quick comments to add a space after the double slash to avoid SA1005?

visual-studio,visual-studio-2012,comments,stylecop
In Visual Studio, I have a block of code. I highlight it and use Ctrl+k+c to comment out the block. That adds "//" at the start of every line I highlighted. I then try to submit my code... and I run into StyleCop rule "SA1005" that requires all // to...

Check Comments/Javadoc number of words with Checkstyle

java,comments,javadoc,checkstyle
Is it possible to set up a checkstyle rule that will count the number of words from a commment and then shows a problem if the number of words is under a defined limit. I searched on the checkstyle Javadoc properties, but did not found something useful. For Example: /**...

Eclipse Luna Dark Theme Modification: Change //Comments to be more distinct

eclipse,themes,comments,dark
Is there a way to modify this theme, which is pretty great, to make the comments more distinct? The light grey default is quite hard to read when my screen backlight is low.

Single line comment continuation

c++,comments
From the C++ standard (going back to at least C++98) § 2.2, note 2 states: Each instance of a backslash character (\) immediately followed by a new-line character is deleted, splicing physical source lines to form logical source lines. Only the last backslash on any physical source line shall be...

Any way to generate a postgres-comment using a select-statement?

sql,postgresql,select,comments
Is there any way to generate the text for comments by using a select statement (or otherwise to generate it dynamically)? Background: I have a rather big query stored in a table table_a for reusing it. In the comment for the table I've stored the creation date (and thus the...

Retrieve database table comments in CodeIgniter

php,mysql,database,codeigniter,comments
I have created a database table in PHPMyAdmin with table comments. I plan to use the table comments to store table version. I want to retrieve the table comments in CodeIgniter database mysql driver. I tried to execute the query via the query method: SELECT table_comment FROM INFORMATION_SCHEMA.TABLES WHERE table_schema='{$table}'...