GVKun编程网logo

如何在Sphinx上忽略变量的值?

6

此处将为大家介绍关于如何在Sphinx上忽略变量的值?的详细内容,此外,我们还将为您介绍关于asp.net–如何在.aspx页面中访问c#变量的值?、bash–忽略变量内的引号、Delphi7:如何在

此处将为大家介绍关于如何在Sphinx上忽略变量的值?的详细内容,此外,我们还将为您介绍关于asp.net – 如何在.aspx页面中访问c#变量的值?、bash – 忽略变量内的引号、Delphi 7:如何在调用堆栈中看到局部变量的值?、delphi – 如何使用类的地址和变量的偏移量来访问类var的值?的有用信息。

本文目录一览:

如何在Sphinx上忽略变量的值?

如何在Sphinx上忽略变量的值?

我有一些模块级变量,它们的值长且无趣,我想从自动生成的文档中排除这些值。有没有办法做到这一点?

例如,在我的Python来源中,我有类似

#:This is a variable with a log value.long_variable = "Some really long value that is not really of interest and just kind of gets in the way of reading and understanding what''s going on."

在我的狮身人面像源中

.. automodule:: the_module   :members:

我希望文档 省略 变量值。

如何在Sphinx上忽略变量的值?在Python源代码中是否可以针对特定变量执行此操作?我可以在Sphinx源代码中为整个模块还是为单个变量执行此操作?

答案1

小编典典

解决方案:

  • 文件使用模块级变量autodataannotation选项。

asp.net – 如何在.aspx页面中访问c#变量的值?

asp.net – 如何在.aspx页面中访问c#变量的值?

无法修改Controls集合,因为该控件包含代码块(即<%...%>).

我们需要在遇到问题时访问.aspx页面中的c#变量

请指导我们?

解决方法

如果您提供了有关您尝试执行的操作的更多详细信息,这将有所帮助,但您可以尝试这样做:

首先,在aspx标记中保护您想要访问的任何变量.

然后在page_load方法中,调用DataBind();

然后在你的标记中你可以这样做:

<%# VariableName %>

“<%=”序列只能在服务器控件的某些上下文中使用.序列“<%#”用于DataBound控件,可以在ASPX页面标记的任何上下文中使用.调用DataBind();允许您在页面的任何位置使用它(几乎).

bash – 忽略变量内的引号

bash – 忽略变量内的引号

我想从这样的变量传递一个参数到rsync:
myopts='-e "ssh -p 1234" -a'
rsync $myopts 192.168.0.1:/a /a

出于某种原因,这不起作用.我甚至找到了this webpage,它说它不起作用:

### NO NO NO: this passes three strings:
###      (1)  "my
###      (2)  multiword
###      (3)  argument"
MYARG="\"my multiword argument\""
somecommand $MYARG

### THIS IS NOT (!!!!) THE SAME AS ###
command "my multiword argument"

### YOU NEED ###
MYARG="my multiword argument"
command "$MYARG"

不幸的是,它没有说明为什么它不起作用.

包含rsync调用的脚本被许多其他脚本使用,因此我只能以兼容的方式更改它.无法解决的解决方案是使用数组:

myopts=('-a' '-v' '-z') # new way,would work
myopts='-a -v -z'       # old way,breaks
rsync "${myopts[@]}" 192.168.0.1:/a /a

变量中的选项完全被忽略.

在变量扩展之后,唯一的处理是字拆分和通配符扩展(如果变量在双引号内,这些都不会完成),而不是引用处理.如果要重做命令行解析的所有步骤,则需要使用eval:
eval "rsync $MYOPTS 192.168.0.1:/a /a"

Delphi 7:如何在调用堆栈中看到局部变量的值?

Delphi 7:如何在调用堆栈中看到局部变量的值?

在Delphi 7中,在调试时我可以看到当前上下文局部变量(Ctrl-Alt-L)和调用堆栈(Ctrl-Alt-S).当我将调用堆栈导航回调用方法时,我不知道如何检查调用方局部变量.可能吗?

这是我的一个古老的宠儿.我可以用我编程的所有语言来实现,但不能用Delphi实现.

解决方法

您正在寻找的功能是 added to the Win32 debugger in Delphi 2005:

Delphi 2005 Reviewer’s Guide

A popular debugging feature in Delphi 8 and C# Builder is the capability to select a particular frame from the call stack using the Local Variables dialog Box. This feature is Now available for the Borland Win32 Debugger.

With the Borland Win32 Debugger loaded,view the Local Variables dialog Box. (If this dialog Box is not already visible,select View | Debug Windows | Local Variables,or press Ctrl-Alt-L,to display it.) Initially,the values of variables local to the current function that the debugger is in are shown. To view local variables in one of the methods earlier in the call chain,select the method name from the drop-down menu.

07001

在Delphi 7中,局部变量视图始终显示执行中断的函数的局部变量.

delphi – 如何使用类的地址和变量的偏移量来访问类var的值?

delphi – 如何使用类的地址和变量的偏移量来访问类var的值?

我需要使用他的实例和变量的偏移来访问类的严格私有类var值.

到目前为止尝试了这个,检查这个示例类

type
  TFoo=class
   strict private class var Foo: Integer;
   public
   constructor Create;
  end;

constructor TFoo.Create;
begin
  inherited;
  Foo:=666;
end;

//this function works only if I declare the foo var as 
//strict private var Foo: Integer;
function GetFoovalue(const AClass: TFoo): Integer;
begin
  Result := PInteger(PByte(AClass) + 4)^
end;

如您所见,函数GetFoovalue仅在foo变量未声明为类var时才起作用.

问题是我必须如何修改GetFoovalue以获得Foo的值,当声明为严格私有类var Foo:Integer时;

解决方法

要访问严格的私有类var,要使用Class Helper进行救援.

示例:

type
  TFoo = class
  strict private class var
    Foo : Integer;
  end;

  TFooHelper = class helper for TFoo
  private
    function GetFoovalue : Integer;
  public
    property Foovalue : Integer read GetFoovalue;
  end;

function TFooHelper.GetFoovalue : Integer;
begin
  Result:= Self.Foo;  // Access the org class with Self
end;

function GetFoovalue( F : TFoo) : Integer;
begin
  Result:= F.GetFoovalue;
end;

Var f : TFoo;//don't need to instantiate since we only access class methods

begin
  WriteLn(GetFoovalue(f));
  ReadLn;
end.

更新了适合问题的示例.

今天关于如何在Sphinx上忽略变量的值?的介绍到此结束,谢谢您的阅读,有关asp.net – 如何在.aspx页面中访问c#变量的值?、bash – 忽略变量内的引号、Delphi 7:如何在调用堆栈中看到局部变量的值?、delphi – 如何使用类的地址和变量的偏移量来访问类var的值?等更多相关知识的信息可以在本站进行查询。

本文标签: