comments

Commenting blank lines

蹲街弑〆低调 提交于 2019-12-24 00:58:38
问题 When commenting multiple lines in vs-code using ctrl + / , is there any way to comment the blank lines in the selection too. Example, if I have the following code, def A(): line1 line2 When all these lines are selected and commented using ctrl + / , I want the blank line to get commented also, like # def A(): # line1 # # line2 instead of: # def A(): # line1 # line2 来源: https://stackoverflow.com/questions/52919515/commenting-blank-lines

Rails AJAX comments clear textarea

痴心易碎 提交于 2019-12-23 23:30:26
问题 I am adding AJAX comments on my web app, but I have no idea how to make textarea (where I wrote comment on) clear after adding comment. Additionally I am struggling to display errors when using AJAX. My comment controller: def create @user = User.find(params[:user_id]) @guide = Guide.find(params[:guide_id]) @comment = @guide.comments.build(comment_params) if @comment.valid? @comment.user = current_user @comment.save respond_to do |format| format.html { flash[:notice] = "Comment added!"

Put comments in between multi-line statement (with line continuation)

北城以北 提交于 2019-12-23 23:25:45
问题 When i write a following pyspark command: # comment 1 df = df.withColumn('explosion', explode(col('col1'))).filter(col('explosion')['sub_col1'] == 'some_string') \ # comment 2 .withColumn('sub_col2', from_unixtime(col('explosion')['sub_col2'])) \ # comment 3 .withColumn('sub_col3', from_unixtime(col('explosion')['sub_col3'])) I get the following error: .withColumn('sub_col2', from_unixtime(col('explosion')['sub_col2'])) ^ IndentationError: unexpected indent Is there a way to write comments in

Tool to Scan Code Comments, and convert to Standard Format [closed]

天涯浪子 提交于 2019-12-23 22:38:33
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . I'm working on a C project that has seen many different authors and many different documentation styles. I'm a big fan of doxygen and other documentation generations tools, and I would like to migrate this project to use one of these systems. Is anybody aware of a tool that can scan source code comments for

In visual studio, how can I write a macro that will insert the date into a comment?

廉价感情. 提交于 2019-12-23 20:15:13
问题 My question is as exact as it is. I am wondering if it would be possible to insert the date or the date and time into a comment without having to manually write it out. But what I would really like to know is, is there a way to do this and will I have to implement something with visual studio to do this for me and if so, how can I do this? Any help will be greatly appreciated! :) Also, I am coding in C-Sharp and am using Visual Studio 2010. 回答1: In Visual Studio 2010 you write macros in

How to comment/document an override in C#?

梦想的初衷 提交于 2019-12-23 18:28:38
问题 Sometimes I override methods in base classes. Sometimes I even override them with an empty method, because what I want is to prevent the behavior. In the past I would write something like this to show the intent of bypassing the base method : protected override void OnMouseUp(MouseEventArgs e) { // base.OnMouseUp(e); } (I know a commented line of code is a bad thing. I used to do it) But I want to do better: How do I document the intention of the override? specifically: What do I write in the

Remove multi-line C style /* comments */ using Perl regex

☆樱花仙子☆ 提交于 2019-12-23 17:57:19
问题 How do I remove multi-line C style comments like: /* comments comments comments comments */ I am able to remove comments in one line like /* comments */ by using several codes provided in other questions. s#/\*[\s\S]*?\*/##sg; s#/\*(.*?)\*/##sg; s#/\*[^*]*\*+([^/*][^*]*\*+)*/|("(\\.|[^"\\])*"|'(\\.|[^'\\])*'|.[^/"'\\]*)#defined $2 ? $2 : ""#gse All three regexes above do not work with multi-line comments. How can they be handled? 回答1: I would do like, perl -0777pe 's/\/\*(?:(?!\*\/).)*\*\/\n?

Is there a way to force Visual Studio 2008 (or below) to use a spellchecker for comments?

拟墨画扇 提交于 2019-12-23 11:55:47
问题 I'm not sure if this can be done at all, but it'd certainly make my life easier. I was wondering if maybe the MS spellchecker could be used as a plug-in for other applications... or something like that. Thanks. 回答1: You can do it via this free add-in. Newer post 回答2: Visual Assist from Whole Tomato comes with a Spell Checker, along with many other wondrous productivity enhancing features - if you're using Visual Studio without Visual Assist you're really missing out :) 回答3: You could use

How do I see source code with comments?

白昼怎懂夜的黑 提交于 2019-12-23 10:06:57
问题 I want to view the R source code with any comments included, to see how the author of the package is running his code, but I am unsure what command to use to see it. In particular, I am trying to see the source code for the bgp() function in the R tgp package. So far I have tried library(tgp) tgp::bgp tgp:::bgp but each of these commands shows only the source code with the comments stripped away. 回答1: That is offering you the parsed version of the code, but it strips out all the comments. The

How do I handle TODO comments in VisualStudio 2010?

痴心易碎 提交于 2019-12-23 09:33:08
问题 I'd like Visual Studio to list all lines having "TODO: " in their beginning (usually after a comment sign which may vary depending on the file type), that can be found in any textual file in a solution (whether it be C#, VB, F#, T-SQL, ASPX, XAML or just TXT) in a special panel showing what's written in the line to the right of "TODO: ", project name (I use many projects in one solution), file name, line number, and code block name (like class and method) if possible. Do you know of such an