问题列表 - 第31161页

无法获得asp.net正则表达式验证器来处理空白密码?

我不想允许空白密码,但如果我将文本框留空,则在输入至少1个字符之前,正则表达式中的text属性不会显示.如何禁止密码为空?我尝试使用+符号而不是*符号,但它仍然无效.

<asp:RegularExpressionValidator 
                                ControlToValidate="txtPassword" 
                                Display="Dynamic"
                                runat="server" 
                                Text="Invalid" 
                                ValidationExpression="^(?=.*\d{1})(?=.*[a-zA-Z]{2}).{7,}$"
                                ValidationGroup="UserRegistrationValidation">
</asp:RegularExpressionValidator>
Run Code Online (Sandbox Code Playgroud)

regex asp.net

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

SQLite和自定义顺序

我有一个类别表:

ID  Category
"1","Baking"   
"3","Family"   
"4","Entertaining"   
"5","Children"   
"6","Desserts"   
Run Code Online (Sandbox Code Playgroud)

现在我想订购select语句的结果

ID  Category
"4","Entertaining"   
"3","Family"  
"1","Baking"   
"5","Children"   
"6","Desserts"  
Run Code Online (Sandbox Code Playgroud)

例如.在MySQL中,你会这样做:

SELECT * FROM CATEGORIES ORDER BY FIELD (ID, 4,3,1,5,6);
Run Code Online (Sandbox Code Playgroud)

你会怎么在SQLite中做到这一点?我没有"order by"字段.

mysql sql sqlite sql-order-by

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

GWT与ScriptSharp的利弊

We have determined it's too difficult for us to maintain the bulk of javascript we need to write full-scale "single page" javascript "applications". Relying on programming conventions still has left us wanting... especially in the area of refactoring. For developers new to these projects, they find it very difficult to change anything because they have no faith they know who else is truly relying on the component (things easy to do with "find all references..." and code access levels in …

javascript gwt script#

4
推荐指数
2
解决办法
2200
查看次数

使用jQuery.browser区分Chrome和Safari

从1.4开始,似乎jQuery.browser能够很容易地识别webkit.但是如何使用它来区分Chrome和Safari(反之亦然)?

safari jquery webkit google-chrome browser-detection

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

jQuery: form not submitting with $("#id").submit(), but will submit with a 'submit' button?

<form method="post" action="load_statements.php?action=load" id="loadForm"
                            enctype="multipart/form-data">
Run Code Online (Sandbox Code Playgroud)

that is my form, which looks fine to me. in that form, i put this button:

<input type="button" name="submit" id="submit" value="Submit" onclick="confirmSubmit()" class="smallGreenButton" />
Run Code Online (Sandbox Code Playgroud)

here is the function it calls:

function confirmSubmit() {
    // get the number of statements that are matched
    $.post(
        "load_statements.php?action=checkForReplace",
        {
            statementType : $("#statementType").val(),
            year : $("#year").val()
        },
        function(data) {
            if(data['alreadyExists']) {
                if( confirm("Statements already exist for " + $("#statementType").html() + " " + $("#year").val() +
                    ". Are you sure you …
Run Code Online (Sandbox Code Playgroud)

forms jquery form-submit

38
推荐指数
4
解决办法
8万
查看次数

Castle.Proxies.EntityProxy的Datacontact失败

如何通过WCF频道发送Castle.Proxies.EntityProxy?

如何将代理设置为KnownType?

wcf castle-dynamicproxy

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

在页面到达window.print()之前执行函数

我有一个调用window.print()的页面; 在页面的底部.我无法访问window.print(); 它由服务器生成,我无法触摸它.基本上是因为IE我需要在打印对话框出现之前执行一些javascript,但是在页面加载之后.我不能这样做因为它一旦到达window.print(); 出现打印对话框.我仍然需要打印,但首先我需要运行myFunction()然后我可以使用window.print();

<html><head></head><body></body><!--no access from here--><script>window.print();</script></html>
Run Code Online (Sandbox Code Playgroud)

javascript

8
推荐指数
2
解决办法
8711
查看次数

可以同时执行两个或更多查询吗?

好吧,假设我们有bank_account桌子.有一行叫money.它有2000个价值.我们有两个人试图撤回这笔钱,我们假设他们可以这样做.那么,他们有可能同时这样做吗?例如.有一个组成的代码:

 $all_money = get_value('money', 'bank_account); //lets suppose thats a function how we get value money from bank_account table

 if($all_money > 0) 
 {
     //here is a code where those money are being withdrawed from bank_account and inserting into the person's account
 }
Run Code Online (Sandbox Code Playgroud)

如果这两个人同时获得2,000,那么这意味着该条款if($all_money > 0)将被执行,并且两个玩家将获得2,000并且bank_account将具有-2,000的金钱价值.那么,有可能发生吗?如果是,那我该如何保护呢?谢谢.

php mysql concurrency

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

如何在一条线上找到所有网格方块?

我正在尝试在二维网格上实现视线算法.我知道它在概念上需要如何工作,但我想不出如何将其作为算法实现.

基本想法很简单.在伪代码中:

function LineOfSight(point1, point2): boolean
  squares = GetListOfSquaresOnLine(point1, point2)
  for each square in squares
    if square.IsOpaque then return false
  return true
Run Code Online (Sandbox Code Playgroud)

GetListOfSquaresOnLine将(概念上)从点1处的网格正方形的中心到点2处的网格正方形的中心绘制一条直线,并返回该线经过的所有正方形的列表.但那是我不知道如何实施的部分.有人知道怎么做吗?Delphi或C示例首选,但不是必需的.

algorithm geometry

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

Perlin噪声算法

我很难理解在线提供的许多高度数学论文,描述了Perlin噪音的产生方式,我想知道是否有人能指出我更方便的介绍方向.我希望在应用程序中使用Perlin噪声来创建2D纹理.

perlin-noise

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