validation

Validate field for all language characters through REGEX

夙愿已清 提交于 2020-08-21 19:36:41
问题 i need to validate a field for empty. But it should allow English and the Foreign languages characters(UTF-8) but not the special characters. I'm not good at Regex. So any help on this would be great... 回答1: It would have been nice if I could say "Just do /^\w+$/.test(word) ", but... See this answer for the current state of unicode support (or rather lack of) in JavaScript regular expressions. You can either use the library he suggests, which might be slow or enlist the help of the server for

Validate field for all language characters through REGEX

删除回忆录丶 提交于 2020-08-21 19:36:27
问题 i need to validate a field for empty. But it should allow English and the Foreign languages characters(UTF-8) but not the special characters. I'm not good at Regex. So any help on this would be great... 回答1: It would have been nice if I could say "Just do /^\w+$/.test(word) ", but... See this answer for the current state of unicode support (or rather lack of) in JavaScript regular expressions. You can either use the library he suggests, which might be slow or enlist the help of the server for

Validate field for all language characters through REGEX

…衆ロ難τιáo~ 提交于 2020-08-21 19:36:09
问题 i need to validate a field for empty. But it should allow English and the Foreign languages characters(UTF-8) but not the special characters. I'm not good at Regex. So any help on this would be great... 回答1: It would have been nice if I could say "Just do /^\w+$/.test(word) ", but... See this answer for the current state of unicode support (or rather lack of) in JavaScript regular expressions. You can either use the library he suggests, which might be slow or enlist the help of the server for

How to Redirect only if form is not empty , JavaScript Validation

只谈情不闲聊 提交于 2020-08-20 16:03:42
问题 Right now even if input fields are empty , if submit button is pressed it shows alert"message": and then redirects to window.location="URL" What I m looking for is it only shows done alert and redirects if input fields are filled <form> <input type="text" placeholder="enter name here"> <input type="number" placeholder="enter number here"> <input type="submit" id="submitbutton" value="submit"> </form> </center> </body> <script type="text/javascript"> const submitit = document.getElementById(

阿里天池全国社保比赛心得

自闭症网瘾萝莉.ら 提交于 2020-08-19 22:30:43
最近时间都忙于参加阿里天池的全国社会保险大数据应用创新大赛,终于结束,最终全国排名第7,总共是1336只队伍参加,还是很激动进了前10,今天想把一些体悟写一下,希望对后来参加的人有用。这个比赛是完成数据算法模型的开发设计,实现对各类医疗保险基金欺诈违规行为的准确识别,根据给出的数据情况,最开始有两个思路,1.从就诊记录入手,找到可疑的就诊记录,然后拼接到人上 2.直接构造人的可疑程度的行为特征。两者都试过,最终选择了后者,因为题目给出的欺诈标签主要是人的欺诈标签,并没有给出某次就诊行为的欺诈标签。另外,此次的评测指标是F1值,这个非常重要,你要知道你最终排名都是看的这个值。下面我从三个方面讲一下这次比赛的心得。 一、特征 可能没参加比赛前很难理解 特征决定上限 的这个真理,特征特征才是最重要的! 一定要看特征重要度,要不断尝试,有些组合到一起反而降低,有些特征看着不重要,你把他去了 可是结果却会出现下降的情况,因为特征和特征之间是有关系的。 在重要特征做深入处理的收益远大于在次要特征中继续做。 汇总信息有些时候会丢失信息,比如我们最开始将医院数据进行了汇总,计算每个人去一级医院,二级医院,三级医院的个数,反而没有把所有医院的维度扩充好。 观察和了解你的数据很重要。观察数据发现患者同一天在同一个医院有药费,有治疗费分别出现不同的就诊id,包括挂号的费用也是不同的id

2017-ICLR-Neural Architecture Search with Reinforcement Learning 论文阅读

别等时光非礼了梦想. 提交于 2020-08-19 03:18:13
NAS with RL 2017-ICLR-Neural Architecture Search with Reinforcement Learning Google Brain Quoc V . Le etc GitHub: stars Citation:1499 Abstract we use a recurrent network to generate the model descriptions of neural networks and train this RNN with reinforcement learning to maximize the expected accuracy of the generated architectures on a validation set. 用RNN生成模型描述(边长的字符串),用RL(强化学习)训练RNN,来最大化模型在验证集上的准确率。 Motivation Along with this success is a paradigm shift from feature designing to architecture designing, 深度学习的成功是因为范式的转变:特征设计(SIFT、HOG)到结构设计(AlexNet、VGGNet)。 This paper presents Neural

Hibernate Validator校验参数全攻略

試著忘記壹切 提交于 2020-08-18 16:43:18
1. 前言 数据字段一般都要遵循业务要求和数据库设计,所以后端的参数校验是必须的,应用程序必须通过某种手段来确保输入进来的数据从语义上来讲是正确的。 2. 数据校验的痛点 为了保证数据语义的正确,我们需要进行大量的判断来处理验证逻辑。而且项目的分层也会造成一些重复的校验,产生大量与业务无关的代码。不利于代码的维护,增加了开发人员的工作量。 3. JSR 303校验规范及其实现 为了解决上面的痛点,将验证逻辑与相应的领域模型进行绑定是十分有必要的。为此产生了 JSR 303 – Bean Validation 规范 。 Hibernate Validator 是 JSR-303 的参考实现,它提供了 JSR 303 规范中所有的约束(constraint)的实现,同时也增加了一些扩展。 Hibernate Validator 提供的常用的约束注解 约束注解 详细信息 @Null 被注释的元素必须为 null @NotNull 被注释的元素必须不为 null @AssertTrue 被注释的元素必须为 true @AssertFalse 被注释的元素必须为 false @Min(value) 被注释的元素必须是一个数字,其值必须大于等于指定的最小值 @Max(value) 被注释的元素必须是一个数字,其值必须小于等于指定的最大值 @DecimalMin(value)

Spring Boot数据校验

扶醉桌前 提交于 2020-08-18 14:47:15
数据校验是一个相当重要的环节,使用Spring Boot 进行数据校验。 添加校验依赖 全部依赖文件如下 <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.3.1.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>demo</artifactId>

Command and Query Responsibility Segregation (CQRS) pattern

☆樱花仙子☆ 提交于 2020-08-18 06:49:46
Command and Query Responsibility Segregation (CQRS) pattern The Command and Query Responsibility Segregation (CQRS) pattern separates read and update operations for a data store. Implementing CQRS in your application can maximize its performance, scalability, and security. The flexibility created by migrating to CQRS allows a system to better evolve over time and prevents update commands from causing merge conflicts at the domain level. The problem In traditional architectures, the same data model is used to query and update a database. That's simple and works well for basic CRUD operations.