使用和不使用推送调用在UFBV上对Z3进行增量调用(Incremental calls to Z3 on UFBV with and without push calls)
我在UFBV查询上运行Z3。 目前查询包含2个调用
check-sat
。 如果在check-sat
Z3之后将push 1
置于30秒内解决查询。 如果根本不放任何push 1
Z3在200秒内解决它。 有趣。 任何具体原因还是巧合?I am running Z3 on UFBV queries. Currently the query contains 2 calls
check-sat
. If putpush 1
just aftercheck-sat
Z3 solves the query in 30sec. If don't put anypush 1
at all - Z3 solves it in 200sec. Interesting. Any specific reasons or just a coincidence?
原文:https://stackoverflow.com/questions/9131078
满意答案
关于jQuery的一个好处是隐式循环。 大多数。集合上的
.each
操作都可以使用选择器或过滤来完成。 而不是写作$('.filter_checkbox').each(function (index, checkbox){ if($(checkbox).prop('checked')){ /* do stuff */ } });
你可以写
$('.filter_checkobx:checked').each( function(index, checkbox){ /* do stuff */ })
所以你只能使用选中的输入。
要获得
subcategory
属性等于输入value
属性的div,您可以简单地使用$('div[subcategory=' + checkbox.val() +']');
或者全部获取并按属性值过滤
$('div[subcategory]').filter( function(index, category){ return $(category).attr('subcategory') == checkbox.val(); });
我使用上面的原则重新创建了代码(还有一些), 在jsfiddle上有一个演示 ,这里有一个注释版本:
$('#browse_options').on("change", ".filter_checkbox", function(){ // get the subcategory divs to use later, var categories = $('div[subcategory]'); // make a list of the values of checked checkboxes. var selected_values = $('.filter_checkbox:checked').toArray().map( function( checkbox ){ return checkbox.value; }); categories // remove style and hide all the divs .removeAttr('style') .hide() // find the divs with subcategory attribute in the list of selected values .filter( function( index, cat ){ return selected_values.indexOf( $(cat).attr('subcategory') ) > -1; }) // now show the divs in filtered collection .show(); });
One of the nice things about jQuery are implicit loops. Most
.each
operations on collections can be done using selectors or filtering. Instead of writing$('.filter_checkbox').each(function (index, checkbox){ if($(checkbox).prop('checked')){ /* do stuff */ } });
you can write
$('.filter_checkobx:checked').each( function(index, checkbox){ /* do stuff */ })
so you only work with the checked inputs.
To get the divs with
subcategory
attribute equal to inputvalue
attribute you can simply use$('div[subcategory=' + checkbox.val() +']');
or get them all and filter by attribute value
$('div[subcategory]').filter( function(index, category){ return $(category).attr('subcategory') == checkbox.val(); });
I've re-created the code using the above principles (and some more), there's a demo on jsfiddle and here's a commented version:
$('#browse_options').on("change", ".filter_checkbox", function(){ // get the subcategory divs to use later, var categories = $('div[subcategory]'); // make a list of the values of checked checkboxes. var selected_values = $('.filter_checkbox:checked').toArray().map( function( checkbox ){ return checkbox.value; }); categories // remove style and hide all the divs .removeAttr('style') .hide() // find the divs with subcategory attribute in the list of selected values .filter( function( index, cat ){ return selected_values.indexOf( $(cat).attr('subcategory') ) > -1; }) // now show the divs in filtered collection .show(); });
相关问答
更多jquery mobile 页面跳转第二次不刷新怎么办
jquery mobile本地和环境中显示问题
jquery mobile 点击跳转不加载数据怎么回事
加载DOM后无法读取动态创建的复选框的属性(Cannot Read Property of Dynamically Created Checkbox after DOM is Loaded)
使用jQuery和链接操作DOM元素(Manipulating DOM elements with jQuery and chaining)
PHP JQuery Checkbox - 如果预先选中复选框,则在取消选中时不会删除'checked'属性(PHP JQuery Checkbox - If checkbox is pre-checked, it wont remove 'checked' attribute when unchecked)
DOM更改后计算元素(count elements after DOM change)
通过传递复选框值属性jQuery来影响DOM元素(Affect DOM elements by passing checkbox value attribute jQuery)
相关文章
更多【z】Storm - the world's best IDE framework for .NET
老友记中的高频词 (z)
学习di'z地址
Struts2 Push Tag 引发的问题
Mercurial 如何让中央库在每次被push新内容后都自动update?
关于Thread类中的start()方法和run()方法
solr 的客户端调用solrj 建索引+分页查询
solr 的客户端调用solrj 建索引+分页查询
solr 的客户端调用solrj 建索引+分页查询
怎么在java里面调用jruby类
最新问答
更多python的访问器方法有哪些
使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
透明度错误IE11(Transparency bug IE11)
linux的基本操作命令。。。
响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)
在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)
NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)
元素上的盒子阴影行为(box-shadow behaviour on elements)
它看起来像只在Windows上的Chrome的错误。 我在Google Canary (Chrome 63)中也进行了测试,问题依然存在,所以有可能它不会很快修复。 这个问题是由overflow: auto引起的overflow: auto ,在你的情况下,它可以很容易地通过删除或设置为可见(默认)来解决。 但是 ,将鼠标悬停在右侧(顶部和底部)时,会出现滚动条。 一个解决方案可以设置overflow: hidden的身体,所以预期的结果是所需的。 我想指出,这不是一个很好的解决方案,但我建议暂
Laravel检查是否存在记录(Laravel Checking If a Record Exists)
这取决于您是否要以后与用户合作,或仅检查是否存在。 如果要使用用户对象(如果存在): $user = User::where('email', '=', Input::get('email'))->first(); if ($user === null) { // user doesn't exist } 如果你只想检查 if (User::where('email', '=', Input::get('email'))->count() > 0) { // user found
设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
$scope.getData= function () { var reader = new FileReader(); reader.onload = $('input[type=file]')[0].files; var img = new Image(); img.src =(reader.onload[0].result); img.onload = function() { if(this.width > 640
Copyright ©2023
peixunduo.com All
Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!
Laravel检查是否存在记录(Laravel Checking If a Record Exists)
设置base64图像的大小javascript - angularjs(set size of a base64 image javascript - angularjs)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!