rules

Work Item state change rules in TFS - Any way to use “AND”s or “OR”s?

喜你入骨 提交于 2019-12-06 10:43:41
I have this state in a work item that can only be set if one of four other fields (dates) are filled in . It doesn't matter which one of the four, if at least one is filled then the state can be set . Example: This scenario lets you change the work item state: DateA 01/05/2012 DateB ' DateC ' DateD ' This one too: DateA ' DateB 01/05/2012 DateC 01/05/2012 DateD ' This one doesnt: DateA ' DateB ' DateC ' DateD ' I thought of using WHEN , but it won't work, as I can't write "WHEN this AND WHEN that " Any suggestions? EDIT: Plus, I can't use the rule "PROHIBITEDVALUES" for System.State, so any

Vue简单的表单验证

▼魔方 西西 提交于 2019-12-06 10:41:34
前端验证必不可少~ 输入框验证 vue文件部分: <form :model="form" :rules="rules" ref="form"> <form-item :label="姓名" prop="name"> <kc-input v-model="form.name"></kc-input> </form-item> </form> ts文件部分: export default Vue.extend({ data() { return { form: { name: "", }, rules: { name: [ { required: true, message: "请输入姓名", trigger: "blur" }, ], } } }, methods: { // 验证 submitForm(): void { const form = this.$refs.form as Vue; form.validate((valid: any) => { if (valid) { this.doSave(); } else { return false; } }); }, doSave() { console.log("验证ok"); }, }, }); 其中,需要注意的是先定义验证规则rules,form-item标签上的prop属性的值是rules中定义的

vue 表单验证

£可爱£侵袭症+ 提交于 2019-12-06 10:37:17
整理一下表单验证。要过接口。步骤如下: <el-form ref="valObj" :model="valObj" :rules="rules"> 注意ref 和 rules ,是必须的。 model的valObj是绑定的对象,同ref的valObj。 给需要验证的表单加prop=“字段名”,如下: <el-form-item label-width="150px" label="名称" prop="name"> <el-input v-model="valObj.name" size="mini" /> </el-form-item> 写规则: 写在 data() { return { rules: ............. } } 里面 rules: { name: [{ validator: validateParking, required: true, trigger: 'blur' } ], code: [ { validator: validateParking, required: true, trigger: 'blur' } ], truckCompany: { // 树状下拉框 - 公司的选择 id: [{ validator: companyCheck, required: true, trigger: 'change' }] }, phone: [ {

PHP split email with rules

落爺英雄遲暮 提交于 2019-12-06 08:03:35
I have to split an email that is received everyday, with a set of rules. This is an example of the email: A N K U N F T 11.08.15 *** NEUBUCHUNG *** 11.08.15 xxx xxx X3 2830 14:25 17:50 18.08.15 xxx xxx X3 2831 18:40 F882129 dsdsaidsaia F882129 xxxyxyagydaysd **«CUT HERE»** A N K U N F T 18.08.15 *** NEUBUCHUNG *** 11.08.15 xxx xxx X3 2830 14:25 17:50 18.08.15 xxx xxx X3 2831 18:40 F881554 ZXCXZCXCXZCCXZ F881554 xcvcxvcxvcvxc F881554 xvcxvcxcvxxvccvxxcv **«CUT HERE»** 11.08.15 xxx xxx X3 2830 14:25 17:50 18.08.15 xxx xxx X3 2831 18:40 F881605 xczxcdfsfdsdfs F881605 zxccxzxzdffdsfds **«CUT HERE»

Avoid create extra childs Firebase

末鹿安然 提交于 2019-12-06 03:54:20
Im a new in firebase and I wish to know how to figure out a question regarding to hasChildren() RuleDataSnapshot and how validates the data will be created. Sample of db : { "visitors" : { "-KP4BiB4c-7BwHwdsfuK" : { "mail" : "aaa@mail.com", "name" : "aaa", } ..... } Rules : { "rules": { "visitors": { ".read": "auth != null", ".write": "auth.uid != null", "$unique-id": { ".read": "auth != null ", ".write": "auth != null", ".validate": "newData.hasChildren(['name','mail'])", } } } } As far I know if I want to create data, the data fields must have the same names to pass the rule validation. For

HP Fortify Validation Rules on Path Manipulation

一曲冷凌霜 提交于 2019-12-06 01:15:26
I am running code through Hp Fortify and have some path manipulation findings. I understand the context of it and trying to resolve. Instead of going through all the places where SOME path values are queried from a database to store output files (logs, export data, whatever), I tried to centralize it. So, instead of having File.WriteAllText() with some path + file name, content, I wanted to wrap into FortifyFileWriteAllText(). Then, in this function I do path validation check once up front, and if valid, only then allow the write to continue such as... public static bool

Rules to implement compare method

我们两清 提交于 2019-12-05 21:41:58
like compareTo, that have to be "reflexive, antisymmetric and transitive", are there any rules to implement the compare method?? thanks PermGenError From Comparator API : The implementor must ensure that sgn(compare(x, y)) == -sgn(compare(y, x)) for all x and y. (This implies that compare(x, y) must throw an exception if and only if compare(y, x) throws an exception.) The implementor must also ensure that the relation is transitive: ((compare(x, y)>0) && (compare(y, z)>0)) implies compare(x, z)>0. Finally, the implementor must ensure that compare(x, y)==0 implies that sgn(compare(x, z))==sgn

Validating array in Laravel using custom rule with additional parameter

南笙酒味 提交于 2019-12-05 21:27:22
I'm working with Laravel 5.7 and I need to validate a phone length by using 2 inputs (prefix+number). The total digits has to be 10 always. I'm using this custom rule for other projects which works fine: <?php namespace App\Rules; use Illuminate\Contracts\Validation\Rule; class PhoneLength implements Rule { public $prefix; /** * Create a new rule instance. * * @return void */ public function __construct($prefix = null) { // $this->prefix = $prefix; } /** * Determine if the validation rule passes. * * @param string $attribute * @param mixed $value * @return bool */ public function passes(

Rule variables in ANTLR4

佐手、 提交于 2019-12-05 11:44:08
I'm trying to convert my grammar from v3 to v4 and having some trouble. In v3 I have rules like this: dataspec[DataLayout layout] returns [DataExtractor extractor] @init { DataExtractorBuilder builder = new DataExtractorBuilder(layout); } @after { extractor = builder.create(); } : first=expr { builder.addAll(first); } (COMMA next=expr { builder.addAll(next); })* ; expr returns [List<ValueExtractor> ext] ... However, with rules in v4 returning these custom context objects instead of what I explicitly told them to return, things are all messed up. What's the v4 way to do this? There are multiple

Alignment Rules

荒凉一梦 提交于 2019-12-05 04:43:54
问题 I'm having a bit of trouble with a homework problem, and I was wondering if anyone could point me in the right direction. Suppose we are compiling for a machine with 1-byte characters, 2-byte shorts, 4-byte integers, and 8-byte reals, and with alignment rules that require the address of every primitive data element to be an even multiple of the element’s size. Suppose further that the compiler is not permitted to reorder fields. How much space will be consumed by the following array? A :