标签: comments

在eclipse中删除1000条评论?

我安装了JD-GUI来从jar文件中检索我的代码.一切正常,除了JD-GUI自动添加这样烦人的评论:

在此输入图像描述

我可以用任何方式删除它们吗?我不懂正则表达式.

eclipse comments jd-gui

0
推荐指数
1
解决办法
1170
查看次数

评论续行

我有这个代码块我想评论,但内联注释不起作用.我不确定PEP8指南适用于何处.建议吗?

        if next_qi < qi + lcs_len \ # If the next qLCS overlaps 
        and next_ri < ri + lcs_len \ # If the next rLCS start overlaps 
        and next_ri + lcs_len > ri: # If the next rLCS end overlaps
            del candidate_lcs[qi] # Delete dupilicate LCS.
Run Code Online (Sandbox Code Playgroud)

python comments pep8 python-2.7 continuation

0
推荐指数
1
解决办法
533
查看次数

Unicode在Python中转义了注释

我创建了一个Java程序,它使用unicode转义字符来打破多行注释并隐藏一些功能.下面的程序打印出"Hello Cruel World".我想知道在Python(任何版本)中是否可以这样做.如果不可能,这种语言会如何阻止?

public static void main(String[] args) {
    print("Hello");

    /*
     * \u002A\u002F\u0070\u0072\u0069\u006E\u0074\u0028\u0022\u0043\u0072\u0075\u0065\u006C\u0022\u0029\u003B\u002F\u002A
     */
    print("World");
}

private static void print(String s){
    System.out.print(s + " ");
}
Run Code Online (Sandbox Code Playgroud)

请注意,unicode是转义字符串 */print("Cruel");/*

到目前为止我没有成功的尝试......

test = False

#\u0023test = True

'''
\u0027\u0027\u0027
test = True 
\u0027\u0027\u0027
'''

print(test)
Run Code Online (Sandbox Code Playgroud)

python unicode comments escaping lexical-analysis

0
推荐指数
1
解决办法
714
查看次数

为什么我的Javascript代码似乎是注释?

这是我的代码:

chart.fillText(i*topNum, (right_cordinates_width/3)*2, (cVid.height-line_bottom_distance) / 10 - i );
Run Code Online (Sandbox Code Playgroud)

/ 之间的字符显示/3)*2, (cVid.height-line_bottom_distance) / 为灰色,如注释。

为什么会发生这种情况,这真的是一种评论吗?

javascript comments dreamweaver

0
推荐指数
1
解决办法
59
查看次数

是否在允许某些Unicode字符的注释中执行C++代码,就像在Java中一样?

我知道允许在带有某些Unicode字符的注释中执行Java代码.请参阅此问题以进一步说明在注释中执行Java代码.所以很想知道C++是否有这样的功能?

c++ unicode comments c++11

0
推荐指数
1
解决办法
795
查看次数

如何在生产中订购DESC的评论?

我不明白为什么开发中的东西有效,但在生产中它有不同的行为,这是我的另一个例子.在此示例中,注释始终由DESC在开发中排序,但在生产中如果用户喜欢注释,则该注释将移动到列表的底部,就像重新创建注释一样.

为什么会这样?

comments_controller

class CommentsController < ApplicationController
  before_action :set_commentable, only: [:index, :new, :create]
  before_action :set_comment, only: [:edit, :update, :destroy]
  before_action :correct_user, only: [:edit, :update, :destroy]

  def index
    @comments = @commentable.comments.order("created_at DESC")
  end

  def new
    @comment = @commentable.comments.new
  end

  def create
    @comment = @commentable.comments.new(comment_params)
    if @comment.save
      redirect_to @commentable, notice: "Comment created."
    else
      render :new
    end
  end

  def edit
  end

  def update
    if @comment.update_attributes(comment_params)
      redirect_to :back, notice: "Comment was updated."
    else
      render :edit
    end
  end

  def destroy
    @comment.destroy
    redirect_to @comment.commentable, …
Run Code Online (Sandbox Code Playgroud)

ruby model-view-controller comments ruby-on-rails heroku

0
推荐指数
1
解决办法
179
查看次数

Java中的这些多行注释有什么区别吗?

我只是想知道这些类型的评论之间是否存在任何差异.

/* 
...    
Content of the comment
...    
*/
Run Code Online (Sandbox Code Playgroud)

/* 
* ...    
* Content of the comment
* ...    
*/
Run Code Online (Sandbox Code Playgroud)

java comments

0
推荐指数
1
解决办法
189
查看次数

正则表达式在XCode中找到注释的代码

我正在尝试制作一个可以在Xcode项目中找到所有注释代码的正则表达式.请注意,Regex的结果必须只包含注释代码,并且不得包含我们添加的注释以使项目更易理解.

正则表达式搜索的结果不包含如下所示的行

// this comment is added to make the function understandable
Run Code Online (Sandbox Code Playgroud)

但包含类似的行

//  [super viewWillDisappear:animated];
Run Code Online (Sandbox Code Playgroud)

regex search xcode comments ios

0
推荐指数
1
解决办法
475
查看次数

c#不可变类型类的文档/注释

您有没有办法在c#中为开发人员记录不可变类型的属性?

我知道您可以使用以下方法轻松记录类和对象:

  /// <summary>
  /// This is an object
  /// </summary>
Run Code Online (Sandbox Code Playgroud)

但是如果我创建一个新对象,如何为popupmenu创建一个条目:

Myobject ob1 = new Myobject(x1,x2,.....);
Run Code Online (Sandbox Code Playgroud)

我想要的是每个值的简短描述,例如"x1是我的对象的长度"和"x2是高度".另外我想添加一些响应的东西,例如,如果用户为x1输入"1",x2显示工具提示"长度",但如果用户输入"2"作为输入,则x2显示"高度"工具提示.

c# documentation comments tooltip

0
推荐指数
1
解决办法
28
查看次数

CFML RegEx删除javascript注释

我希望使用coldfusion从字符串中删除javascript注释.我目前正在使用reReplace(string, "(\/\*.*\*\/)|\s(\/\/.{1,}[\r\n])", "", "all").

这是一个测试字符串:

<script type="text/javascript">
// comment
var a=1; // another comment
/* try{if (...)}; */
var b=2;
</script>
src="//domain.com"
Run Code Online (Sandbox Code Playgroud)

预期的结果是(和我所得到的使用replace()在javacript):

<script type="text/javascript">
var a=1; 
var b=2;
</script>
src="//domain.com"
Run Code Online (Sandbox Code Playgroud)

实际CFML结果:

<script type="text/javascript">
src="//domain.com"
Run Code Online (Sandbox Code Playgroud)

再次,它在javascript中工作正常.

如何使用CFML?


更新1,我的应用程序中更具体的代码.它基本上是app.cfc的OnRequest()函数中的缩小器.

  1. 获取页面html
  2. 删除两种类型的JS注释
  3. 展平\ r \n到\ r \n
  4. 将\n +\t替换为空格
  5. 将\ t替换为空格
  6. 用单个空格替换双空格
  7. 用单个\ r替换double\r \n
  8. 用逗号替换逗号+\r \n

    <!--- Define arguments. --->
    <cfargument
        name="TargetPage"
        type="string"
        required="true"
        />
    
    <cfheader name="content-type" value="text/html; charset=utf-8" />
    <cfheader name="X-UA-Compatible" value="IE=edge" />
    <cfheader …
    Run Code Online (Sandbox Code Playgroud)

javascript regex coldfusion comments

0
推荐指数
1
解决办法
212
查看次数