comments

how to comment out R code blocks in R markdown?

安稳与你 提交于 2020-01-14 08:04:33
问题 I'm editing an R markdown file (.Rmd) that has a lot of R code blocks to move groups of those code blocks into "child" documents to simplify rearranging sections (if nothing else). As I convert sections to child documents, I would like to test the new child document without running the rest of the blocks and other children. However, when I use to comment out those sections, the R blocks still run (but RStudio makes the sections "look" as though they were commented out). If I eliminate the

how to comment out R code blocks in R markdown?

僤鯓⒐⒋嵵緔 提交于 2020-01-14 08:04:09
问题 I'm editing an R markdown file (.Rmd) that has a lot of R code blocks to move groups of those code blocks into "child" documents to simplify rearranging sections (if nothing else). As I convert sections to child documents, I would like to test the new child document without running the rest of the blocks and other children. However, when I use to comment out those sections, the R blocks still run (but RStudio makes the sections "look" as though they were commented out). If I eliminate the

How do I render all Comments in a Rails view?

自古美人都是妖i 提交于 2020-01-13 20:54:07
问题 I am new to rails so go easy. I have created a blog. I have successfully implemented comments and attached them to each post. Now...I would like to display, in the sidebar, a list of the most recent comments from across all posts. I think there are two things involved here, an update to the comment_controller.rb, and then the call from the actual page. Here is the comments controller code. class CommentsController < ApplicationController def create @post = Post.find(params[:post_id]) @comment

Regex to strip phpdoc multiline comment

随声附和 提交于 2020-01-13 02:15:39
问题 I have this: /** * @file * API for loading and interacting with modules. * More explaination here. * * @author Reveller <me@localhost> * @version 19:05 28-12-2008 */ I'm looking for a regex to strip all but the @token data, so the result would be: @file API for loading and interacting with modules. More explaination here. @author Reveller <me@localhost> @version 19:05 28-12-2008 I now have this: $text = preg_replace('/\r?\n *\* */', ' ', $text); It does the job partially: it only removes the

Visual studio code comment in HTML files

假装没事ソ 提交于 2020-01-12 14:25:23
问题 I am trying Visual Studio Code lately and i've noticed that when i try to add a line comment in an HTML file (using Ctrl+/ or Ctrl+K Ctrl+C) instead of this: <!-- --> , i get this {# #} . In JS or CSS files the key bindings work just fine and produce the expected result. So how can i get the proper type of comments in HTML files? 回答1: Finally i found what the problem was. I had installed the twig plugin (for the Twig php template engine) and that was causing the comments issue. 回答2: I've just

How do I comment in Power Query M?

谁说我不能喝 提交于 2020-01-12 11:57:18
问题 Is there a way to comment M code / comment out lines or blocks of code? 回答1: M supports two different types of comments: Single line comments can be started with // You can comment out multiple lines or comment out text in the middle of a line using /* */ (e.g. = 1 + /* some comment */ 2 ) Comments might seem to disappear in the formula bar if they are at the end of the line, but they are still there. You can verify this by looking at your code in the Advanced Editor. 来源: https:/

How do I comment in Power Query M?

吃可爱长大的小学妹 提交于 2020-01-12 11:57:09
问题 Is there a way to comment M code / comment out lines or blocks of code? 回答1: M supports two different types of comments: Single line comments can be started with // You can comment out multiple lines or comment out text in the middle of a line using /* */ (e.g. = 1 + /* some comment */ 2 ) Comments might seem to disappear in the formula bar if they are at the end of the line, but they are still there. You can verify this by looking at your code in the Advanced Editor. 来源: https:/

Vim plugin to generate Javascript Documentation comments

蓝咒 提交于 2020-01-12 05:50:12
问题 Is there a plugin for vim, somewhat like Jsbeautify, which automatically generates JavaDoc like comments in the script files. For example it will take this function(a , b , c){ } and return /** * Description. * * @param a Description. * @param b Description. * @param c Description. */ function(a , b , c){ } 回答1: Here's a little something to get you started - tweak as required!-) " generate doc comment template map <LocalLeader>/ :call GenerateDOCComment()<cr> function! GenerateDOCComment()

What is your personal approach/take on commenting?

廉价感情. 提交于 2020-01-12 04:53:27
问题 Duplicate What are your hard rules about commenting? A Developer I work with had some things to say about commenting that were interesting to me (see below). What is your personal approach/take on commenting? "I don't add comments to code unless its a simple heading or there's a platform-bug or a necessary work-around that isn't obvious. Code can change and comments may become misleading. Code should be self-documenting in its use of descriptive names and its logical organization - and its

PHP: Commenting standards

二次信任 提交于 2020-01-12 04:34:08
问题 I need to comment massive amounts of information in only a handful of files, and when I look around Google and here at SO, I continue to find results matching coding standards , when I need commenting standards. My coding matches most coding standards except not when it comes to commenting. Could someone please provide examples for the following? <? // beginning of file comments require( 'filename.php' ); // require or include, with filename public class Test { } // class without constructor