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

我可以用任何方式删除它们吗?我不懂正则表达式.
我有这个代码块我想评论,但内联注释不起作用.我不确定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) 我创建了一个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) 这是我的代码:
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) /
为灰色,如注释。
为什么会发生这种情况,这真的是一种评论吗?
我知道允许在带有某些Unicode字符的注释中执行Java代码.请参阅此问题以进一步说明在注释中执行Java代码.所以很想知道C++是否有这样的功能?
我不明白为什么开发中的东西有效,但在生产中它有不同的行为,这是我的另一个例子.在此示例中,注释始终由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) 我只是想知道这些类型的评论之间是否存在任何差异.
/*
...
Content of the comment
...
*/
Run Code Online (Sandbox Code Playgroud)
和
/*
* ...
* Content of the comment
* ...
*/
Run Code Online (Sandbox Code Playgroud) 我正在尝试制作一个可以在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) 您有没有办法在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显示"高度"工具提示.
我希望使用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()函数中的缩小器.
用逗号替换逗号+\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)comments ×10
javascript ×2
python ×2
regex ×2
unicode ×2
c# ×1
c++ ×1
c++11 ×1
coldfusion ×1
continuation ×1
dreamweaver ×1
eclipse ×1
escaping ×1
heroku ×1
ios ×1
java ×1
jd-gui ×1
pep8 ×1
python-2.7 ×1
ruby ×1
search ×1
tooltip ×1
xcode ×1