小编Arm*_*lak的帖子

没有从TextBox获得用户输入

我开始对一些完全平庸的事情感到不安:我没有从TextBox中获得用户输入:S

我这样做(aspx背后的代码):

protected void Page_Load(object sender, EventArgs e)
    {
        if (!this.IsPostBack)
        {
            this._presenter.OnViewInitialized();
        }
        this._presenter.OnViewLoaded();
        txtBox1.Text = "blah";

    }
    protected void Button1_Click(object sender, EventArgs e)
{
            //Do sth with txtBox1.Text but when I read it, it is still the same as when a loaded the page at Page_Load, So if I entered "blahblah" in the txtBox1 via browser the text I get when I debug or run is still "blah"
        }
Run Code Online (Sandbox Code Playgroud)

和aspx

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="InsertStudent.aspx.cs" Inherits="IzPT.Vb.Views.InsertStudent"
    Title="VnosProfesorja" MasterPageFile="~/Shared/DefaultMaster.master" …
Run Code Online (Sandbox Code Playgroud)

asp.net textbox wcsf

2
推荐指数
1
解决办法
2984
查看次数

从多字段访问插槽中的插槽

我有这个函数,它根据多个多场事实的多个槽来计算一些值.

因为涉及相当多的插槽并且在函数中需要所有插槽,我在想是否可以将整个事实传递给函数并访问其中的插槽,如下所示:

(deftemplate a-fact
    (slot id)
    (slot name)
    (slot ...)
    ...
)

(deffunction a-funciton (?factadr)
    (switch ?factadr:name
        (case bla then ...)
    )

    (return ?calculated-value)
)

(defrule a-rule
    ?factadr <- (a-fact (id ?i))
    =>
    (if (> **(a-function ?factadr) 20) then ... )
)
Run Code Online (Sandbox Code Playgroud)

我看到了这个?fact-adrres:这个例子中的slot-name并认为它可以工作,但事实并非如此.那么,它是否可能以及如何做到这一点?

(bind ?facts (find-all-facts ((?f attribute))
                               (and (eq ?f:name wine)
                                    (>= ?f:certainty 20))))
Run Code Online (Sandbox Code Playgroud)

使用剪辑6.3.

expert-system clips

2
推荐指数
1
解决办法
2263
查看次数

c ++模板和继承

我在使用模板和继承将代码分解为可重用部分时遇到了一些问题.我想实现我的树类和avltree类使用相同的节点类,并且avltree类从树类继承一些方法并添加一些特定的方法.所以我想出了下面的代码.编译器在tree.h中抛出错误,如下所示,我真的不知道如何克服这个问题.任何帮助赞赏!:)

node.h:

#ifndef NODE_H
#define NODE_H
#include "tree.h"

template <class T>
class node
{
T data;
    ...

node()
    ... 

  friend class tree<T>;
};

#endif
Run Code Online (Sandbox Code Playgroud)

tree.h中

#ifndef DREVO_H
#define DREVO_H

#include "node.h"

template <class T>
class tree
{
public: //signatures
    tree();
...

    void insert(const T&);
private:
    node<T> *root; //missing type specifier - int assumed. Note: C++ does not support default-int


};
//implementations

#endif
Run Code Online (Sandbox Code Playgroud)

avl.h

#ifndef AVL_H
#define AVL_H

#include "tree.h"
#include "node.h"

template <class T>
class avl: public tree<T>
{
public: …
Run Code Online (Sandbox Code Playgroud)

c++ inheritance refactoring templates data-structures

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

有关字符串长度计数的一些问题

我有一个关于计算字符串长度的问题。我总是收到一些数字,例如2432,您传递了一个字符串,例如“ abc”。

我认为问题在于

mov bl, byte [esi]
Run Code Online (Sandbox Code Playgroud)

但我不知道为什么。也许是字符长度以位为单位的东西?

问题可能出在64位操作系统还是双核处理器上?(我对此有所怀疑,因为我认为第一行“ 32位”应该可以解决问题)。

PS .:这是一个练习,这就是为什么我需要确定这样的字符串长度的原因。

代码:

bits 32
extern _printf
extern _scanf
global _main

section .data
number_frmt db 10,"%d",10,0
enter_str db "Enter some string: ", 10,0
string_frmt db "%s", 0

section .bss
entered_string resb 100

section .text

_main:
    pushad

    push dword enter_str
    call _printf
    add esp, 4

    push dword entered_string
    push dword string_frmt
    call _scanf
    add esp, 4  ;leave the entered string in the stack

    call count  ; count it and put the …
Run Code Online (Sandbox Code Playgroud)

assembly nasm

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