validate

jQuery Validate验证框架详解,提交前验证

╄→гoц情女王★ 提交于 2019-12-22 20:46:13
现在都用h5表单进行验证了,以下方式仅做回忆 https://www.runoob.com/jquery/jquery-plugin-validate.html <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <base href="<%=basePath%>"> <title>jQuery Validate验证框架详解</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <script type="text/javascript" src="<%=request.getContextPath()%>/validate/jquery-1.6.2.min.js"></script> <script

jquery表单验证validate

廉价感情. 提交于 2019-12-20 11:47:52
jquery表单验证 下载地址和Demo http://jquery.bassistance.de/validate/jquery.validate.zip 首页: http://bassistance.de/jquery-plugins/jquery-plugin-validation/ jQuery validation 1.7 ---验证插件 需要:jQuery 1.3.2 或 1.4.2版本 1 <script type="text/javascript"> 2 3 $().ready(function() { 4 5 // validate signup form on keyup and submit 6 /* 7 * validate()方法: 8 * * 验证表单,实际上调用就是validate()方法 9 * * validate()方法传入一个json格式数据 10 * * rules:表单验证里的验证规则 11 * * key:对应的是页面中表单的name属性值 12 * * value:对应的验证规则 13 * * required:验证是否为空 14 * * minlength:验证最小长度 15 * * equalTo:对比指定标签的内容是否一致,"#id" 16 * * email:验证email地址是否正确 17 * rules:{ 18 * key

[leetcode]946. Validate Stack Sequences用Stack验证序列

自作多情 提交于 2019-12-18 03:09:36
Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack. Example 1: Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1] Output: true Explanation: We might do the following sequence: push(1), push(2), push(3), push(4), pop() -> 4, push(5), pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1 Example 2: Input: pushed = [1,2,3,4,5], popped = [4,3,5,1,2] Output: false Explanation: 1 cannot be popped before 2. Note: 0 <= pushed.length == popped.length <= 1000 0 <= pushed[i],

第31题:LeetCode946. Validate Stack Sequences验证栈的序列

若如初见. 提交于 2019-12-18 03:09:17
题目 给定 pushed 和 popped 两个序列,只有当它们可能是在最初空栈上进行的推入 push 和弹出 pop 操作序列的结果时,返回 true ;否则,返回 false 。 示例 1: 输入:pushed = [1,2,3,4,5], popped = [4,5,3,2,1] 输出:true 解释:我们可以按以下顺序执行: push(1), push(2), push(3), push(4), pop() -> 4, push(5), pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1 示例 2: 输入:pushed = [1,2,3,4,5], popped = [4,3,5,1,2] 输出:false 解释:1 不能在 2 之前弹出。 提示: 0 <= pushed.length == popped.length <= 1000 0 <= pushed[i], popped[i] < 1000 pushed 是 popped 的排列。 考点 1.stack 2.vector 思路 输入:pushed = [1,2,3,4,5], popped = [4,5,3,2,1] 输出:true 输入:pushed = [1,2,3,4,5], popped = [4,3,5,1,2] 输出:false 函数入口做鲁棒性测试,都为空 -

Leetcode 946. Validate Stack Sequences 验证栈序列

感情迁移 提交于 2019-12-14 01:45:10
946. Validate Stack Sequences 题目描述 Given two sequences pushed and popped with distinct values, return true if and only if this could have been the result of a sequence of push and pop operations on an initially empty stack. 示例 示例1 Input: pushed = [1,2,3,4,5], popped = [4,5,3,2,1] Output: true Explanation: We might do the following sequence: push(1), push(2), push(3), push(4), pop() -> 4, push(5), pop() -> 5, pop() -> 3, pop() -> 2, pop() -> 1 示例2 Input: pushed = [1,2,3,4,5], popped = [4,3,5,1,2] Output: false Explanation: 1 cannot be popped before 2. 解答 这道题很简单,把pushed数组里面的每个数字入栈

CentOS 7 安装mysql数据库

吃可爱长大的小学妹 提交于 2019-12-13 10:59:48
原文地址:https://blog.csdn.net/fmwind/article/details/79436412 在CentOS中默认安装有MariaDB,这个是MySQL的分支,但为了需要,还是要在系统中安装MySQL,而且安装完成之后可以直接覆盖掉MariaDB。 1、 下载并安装MySQL官方的 Yum Repository [root@localhost ~]# wget -i -c http: // dev.mysql.com/get/mysql57-community-release-el7-10.noarch.rpm 使用上面的命令就直接下载了安装用的Yum Repository,大概25KB的样子,然后就可以直接yum安装了。 [root@localhost ~]# yum -y install mysql57-community-release-el7- 10 .noarch.rpm 看到上图所示表示安装成功。 [root@localhost ~]# yum repolist enabled | grep "mysql.*-community.*" 之后就开始安装MySQL服务器。 [root@localhost ~]# yum -y install mysql-community-server 这步可能会花些时间,安装完成后就会覆盖掉之前的mariadb。

AliYun-sms

时间秒杀一切 提交于 2019-12-11 23:11:22
AliYun-sms pip3 install geetest 网址 pip3 install requests https://www.aliyun.com/ pip3 install aliyun-python-sdk-core 一、使用详情: 第1步:访问阿里云网址,免费开通 第2步:查看新手引导 第3步:查看开发指南 二、练习: #!/usr/bin/env python #coding=utf-8 #pip3 install aliyun-python-sdk-core #pip geetest #pip requests from django.conf import settings from aliyunsdkcore.client import AcsClient from aliyunsdkcore.request import CommonRequest # client = AcsClient('<accessKeyId>', '<accessSecret>', 'cn-hangzhou') client = AcsClient(settings.ACCESSKEY_ID, settings.ACCESS_KEY_SECRET, 'cn-hangzhou') def send_sms(phone,code): request = CommonRequest(

python3 marshmallow学习

元气小坏坏 提交于 2019-12-10 16:23:23
python3 marshmallow学习 官方文档: https://marshmallow.readthedocs.io/en/stable/ 安装: pip install -U marshmallow Object -> dict 1 简单的例子 from marshmallow import Schema, fields class UserSchema(Schema): name = fields.String() email = fields.Email() age = fields.Integer() create_at = fields.DateTime(dump_only=True) class User: def __init__(self, *, name, email, age): self.name = name self.email = email self.age = age zhuyu = User(name="朱宇", email="33333@qq.com", age=22) user_schema = UserSchema() result = user_schema.dump(zhuyu, many=False) print(result,isinstance(result, dict)) # {'age': 22, 'name': '朱宇

tp5.1 完整验证

有些话、适合烂在心里 提交于 2019-12-10 15:45:53
$rule = [ 'name' => 'require|max:25', 'age' => 'number|between:1,120', 'email' => 'email', ]; $msg = [ 'name.require' => '名称必须', 'name.max' => '名称最多不能超过25个字符', 'age.number' => '年龄必须是数字', 'age.between' => '年龄只能在1-120之间', 'email' => '邮箱格式错误', ]; $data = [ 'name' => 'thinkphp', 'age' => 10, 'email' => 'thinkphp@qq.com', ]; $validate = Validate::make($rule,$msg); $result = $validate->check($data); if(!$result) { dump($validate->getError()); } 来源: CSDN 作者: 我是高手高手高高手 链接: https://blog.csdn.net/haibo0668/article/details/103475811

linux安装mysql

倖福魔咒の 提交于 2019-12-10 03:51:33
centos安装mysql 一、下载地址 1、 https://dev.mysql.com/downloads/repo/yum/ 2、截图如下: 3、MySQL8.0: https://dev.mysql.com/get/mysql80-community-release-el7-1.noarch.rpm 4、MySQL5.7.22: http://repo.mysql.com/mysql57-community-release-el7-10.noarch.rpm 二、操作步骤 1、下载 rpm包。 CentOS 7以上,下载 Linux 7;CentOS 7以下,下载 Linux 6。 2、 安装软件源: 使用以下命令安装下载的发行包,替换 platform-and-version-specific-package-name 为下载的包的名称: sudo rpm -Uvh mysql80-community-release-el6-n.noarch.rpm 3、安装 MySQL服务端: yum install -y mysql-community-server 4、启动 MySQL : service mysqld start 5、检查 MySQL运行状态: service mysqld status 6、修改临时密码 获取临时密码: 装的是RPM包,则默认是 /var/log