小编atr*_*nce的帖子

如何在按钮或标签文本中显示"&"(&符号)?

我想在按钮或标签的text属性中显示&字符,而不是键盘快捷键.

有没有办法做到这一点?

vb.net windows ms-access

27
推荐指数
2
解决办法
3万
查看次数

flask视图函数映射正在覆盖现有端点函数:type

我最近购买了RealPython来了解Python和Web开发.但是,我遇到了一个障碍,我认为这是我机器上的Python配置问题.任何帮助都是非常有用的.

所以我有一个名为app.py的Flask文档,类似于RealPython的github app.py

# --- Flask Hello World ---#

# import the Flask class from the flask module
from flask import Flask

# create the application object
app = Flask(__name__)

# use decorators to link the function to a url
@app.route("/")
@app.route("/hello")

# define the view using a function, which returns a string
def hello_world():
    return "Hello, World!"

# dynamic route
@app.route("/test/<search_query>")
def search(search_query):
    return search_query

# dynamic route with an int type
@app.route("/integer/<int:value>")
def type(value):
    print …
Run Code Online (Sandbox Code Playgroud)

python flask

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

PL/SQL数值或值错误:数字精度太大

我有一个oracle 10g PL/SQL程序,我正试图运行,

程序

set serveroutput on size 10000;
DECLARE
     membership varchar2(1) :='Y';
     shipping number(2,2);
     quantity number(3) :=0;
BEGIN
   if membership = 'Y' then 
      if quantity  <= 3 then
        shipping := 3.00;
      elsif quantity > 3 and quantity <= 6 then
        shipping := 5.00;
      elsif quantity > 6 and quantity <= 10 then
        shipping := 7.00;
      elsif quantity > 10 then
        shipping := 9.00;
   end if;  
   elsif membership = 'N' then
      if quantity  <= 3 then
        shipping := 5.00;
      elsif …
Run Code Online (Sandbox Code Playgroud)

sql oracle plsql oracle10g

5
推荐指数
1
解决办法
6万
查看次数

必须声明PL/SQL标识符'string'

任何人都可以告诉我为什么这不会执行?

set serveroutput on ;
Declare
   TYPE type_emp IS RECORD(
        emp_name employees.last_name%TYPE,
        emp_salary employees.salary%TYPE);
     rec_emp type_emp;
   due_for_a_raise CHAR(1);
begin
   SELECT last_name, salary into rec_emp
   from employees
   where employee_id = 150;
   if emp_salary > 5000 then
      due_for_a_raise := 'Y';
     else
      due_for_a_raise := 'N';
   end if;
  dbms_output.putline(last_name);
  dbms_output.putline(salary);
  dbms_output.putline(due_for_a_raise);
end;  
Run Code Online (Sandbox Code Playgroud)

错误如下

Error report:
ORA-06550: line 11, column 6:
PLS-00201: identifier 'EMP_SALARY' must be declared
ORA-06550: line 11, column 3:
PL/SQL: Statement ignored
ORA-06550: line 16, column 23:
PLS-00201: identifier 'LAST_NAME' must be …
Run Code Online (Sandbox Code Playgroud)

oracle plsql oracle10g plsqldeveloper

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

"ServiceHost仅支持类服务类型"

出于某种原因,我无法克服这个错误.我已经完成了搜索,但找不到任何vb示例.这个web.config我做错了什么?

SalesTracking.svc

<%@ ServiceHost Language="VB" Debug="true" Service="SalesTracking.ISalesTracking" CodeBehind="SalesTracking.svc.vb" %>
Run Code Online (Sandbox Code Playgroud)

SalesTracking.svc.vb

Imports GlobalDir
Imports System.Web.Script.Serialization
Imports System.Reflection
Imports System.Data.SqlClient
Imports System.Web.Configuration
Imports System.Threading
Imports System.ServiceModel.Activation


<AspNetCompatibilityRequirements(RequirementsMode:=AspNetCompatibilityRequirementsMode.Allowed)> _
Public Class WebService
   Implements ISalesTracking



   Public Function GetDataUsingDataContract(ByVal composite As ClientSideData) As ClientSideData Implements ISalesTracking.GetDataUsingDataContract

   End Function
End Class
Run Code Online (Sandbox Code Playgroud)

Web.config文件

<?xml version="1.0"?>
<configuration>
    <appSettings/>
    <connectionStrings>
        <add name="dbconstring" connectionString="Data Source="" providerName="System.Data.SqlClient" />
    </connectionStrings>
  <system.web>
      <authentication mode="Windows" />
      <authorization>

          <allow roles="Domain Users" />
          <deny users="*" />
      </authorization>
          <customErrors mode="Off"/>

      <compilation debug="true" strict="false" explicit="true" targetFramework="4.0" />

  </system.web> …
Run Code Online (Sandbox Code Playgroud)

vb.net asp.net wcf

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

正则表达式验证数字0-100最多两位小数

所以我知道使用php is_numeric函数会更容易,但我要做的是创建一个正则表达式,主要用于学习正则表达式,以测试测试分数.范围可以是0-100,但可以有2个小数位.这就是我到目前为止所做的工作.

  if (preg_match("^([0-9]){2,3})(.[0-9]{2})?$([0-9]{1})?$", $quiz1))
    {
        echo "match";
    }
    else {
        $error = true;
    }
Run Code Online (Sandbox Code Playgroud)

如果我正确地思考字面含义:

字符串的开头找到字符0-9,两个地方.可选的字符串十进制结束,并找到字符0-9,两个地方.可选的字符串结尾查找字符0-9,表示1个位置.

php regex preg-match

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

PHP PDO准备删除.为什么这会失败?

我有一小段代码,我试图通过ajax响应执行.我有ID传递,但由于某种原因我的删除语句失败(不删除记录,因此添加到$ err数组).我确定这是一个愚蠢的事情,但它现在并没有向我跳出来.

PHP代码

<?php
define('INCLUDE_CHECK',true);

require '../../connect.php';
require '../../functions.php';
// Those two files can be included only if INCLUDE_CHECK is defined
// sets site to require https
echo redirectToHTTPS();
session_name('tzLogin');
session_set_cookie_params(2*7*24*60*60);
session_start();



if (isset($_POST['id']) && $_SESSION['id'] && $_SESSION['permlvl']==3 )
{
    $id = is_numeric($_POST['id']);
    $err = array();
            $query = "DELETE FROM employees WHERE id = :id";
            $statement = $db -> prepare($query);
            $statement -> BindParam('id', $id, PDO::PARAM_INT);
            $result = $statement -> execute();
            $statement -> closecursor();
            if ($result === true){
            }
                else{
                    $err[] …
Run Code Online (Sandbox Code Playgroud)

php mysql pdo prepared-statement

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

Oracle PL/SQL选择和更新

当我执行这个PL/SQL块时,我一直收到"没有找到数据".如果我注释掉输出行,那么一切都按照我的怀疑输出,但更新语句永远不会执行.有任何想法吗?

set serveroutput on;
Declare
   TYPE type_emp IS RECORD(
        emp_salary emp.salary%TYPE);
     rec_emp type_emp;
   v_stars varchar2(50) ;
   v_count number(3);
   s_num number(3);
begin
 SELECT min(employee_id) into s_num from emp;
 SELECT count(*) into v_count from emp;
 v_count := v_count + s_num;
 for i in s_num .. v_count loop
   SELECT salary
     into rec_emp
     from emp
    where employee_id = i; 
    if rec_emp.emp_salary <1000 then 
        v_stars := null;
      elsif rec_emp.emp_salary >=1000 and rec_emp.emp_salary <2000 then 
        v_stars := '*';
      elsif rec_emp.emp_salary >=2000 and rec_emp.emp_salary <3000 then 
        v_stars …
Run Code Online (Sandbox Code Playgroud)

sql oracle plsql oracle10g

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

oracle包麻烦

我是oracle包的新手,想知道是否有人可以解释为什么这不会编译/执行.

CREATE OR REPLACE PACKAGE login_pkg IS
 FUNCTION login_ck_pf 
  (p_user IN VARCHAR2,
   p_pass IN VARCHAR2)
   RETURN CHAR;
END;
/
CREATE OR REPLACE PACKAGE BODY login_pkg IS
 FUNCTION login_ck_pf 
  (p_user IN VARCHAR2,
   p_pass IN VARCHAR2)
   RETURN CHAR
  IS
   lv_ck_txt CHAR(1) := 'N';
   lv_id_num NUMBER(5);
 BEGIN
   SELECT idShopper
    INTO lv_id_num
    FROM bb_shopper
    WHERE username = p_user
     AND password = p_pass;
   IF SQL%FOUND THEN
     lv_ck_txt := 'Y';
     lv_id_num := lv_id_num;
   END IF;
   RETURN lv_ck_txt;
 EXCEPTION
  WHEN NO_DATA_FOUND THEN
   DBMS_OUTPUT.PUT_LINE('Invalid Login');
   lv_ck_txt := 'N'; …
Run Code Online (Sandbox Code Playgroud)

sql oracle oracle10g

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

从客户端jQuery调用代码中的webmethod

我试图使用jQuery直接调用ASP.NET AJAX页面方法.我正在使用encosia.com作为参考.我的内联JavaScript是

       <script type="text/javascript">
           $(document).ready(function() {
               // Add the page method call as an onclick handler for the div.
               $("#Result").click(function() {                   
                   $.ajax({
                       type: "POST",
                       url: "Default.aspx/GetDate",
                       data: "{}",
                       contentType: "application/json; charset=utf-8",
                       dataType: "json",
                       success: function(msg) {
                           // Replace the div's content with the page method's return.
                           $("#Result").text(msg.d);
                       }
                   });
               });
           });

            </script>
       <div id="Result">Click here for the time.</div> 
Run Code Online (Sandbox Code Playgroud)

用我的webmethod

<WebMethod()> _
Public Shared Function GetDate() As String
    Return DateTime.Now.ToString()
End Function
Run Code Online (Sandbox Code Playgroud)

我会使用FF并检查发送的POST,但是因为我目前只有IE 7,所以这有点难.其他相关信息,ASP.net 2.0.有谁知道我做错了什么?


更新

web.config - 预先存在仍然无法正常工作 …

asp.net jquery

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

javascript替换正则表达式不是全局的

//Get width and resize another element
$(document).ready(function() {
  function ResizeSearch(GridID, SearchID) {
    var eleWidth = $("#" + GridID).width();
    $("#" + SearchID).width(eleWidth);
  }
  $("#getp").click(function() {
    ResizeSearch("<%= gvValidStatus.ClientID %>", "ValidStatusSearch");
  });
});
Run Code Online (Sandbox Code Playgroud)

对于很多 stackoverflow 人来说,这是一个简单的问题。我有一些看起来像这样的代码:

var www = '?points=City%20Chairman%20Brutas&another=test';
var name = 'points';
var match = RegExp(RegExp('[?&]' + name + '=([^&]*)').exec(www)[1]);
match = decodeURIComponent(match); 
match = match.replace('\/','');
document.write(match);
Run Code Online (Sandbox Code Playgroud)

代码非常简单,出于 jsfiddle 的目的,我做了一个var而不是使用window.location.search. 我知道我需要使match.replaceGLOBAL 才能正常工作。它目前输出:

City Chairman Brutas/
Run Code Online (Sandbox Code Playgroud)

如果我改变match.replacematch.replace('\//g','');这是行不通的。

以上输出: /City Chairman Brutas/

我知道我很接近,如果有人能指出我正确的方向,那将是很棒的。

javascript regex replace

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