使用和不使用推送调用在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 页面跳转第二次不刷新怎么办[2022-09-17]
checkbox -
jquery mobile本地和环境中显示问题[2023-06-25]
checkbox -
jquery mobile 点击跳转不加载数据怎么回事[2023-11-26]
checkbox -
jQuery Mobile框架弹窗中放表单文本框,整个弹窗区域都会变为文本框的触发焦点,不想这样[2022-03-02]
checkbox -
如何在 jQuery Mobile 的 Listview 中动态移除某一条的图标[2023-09-01]
checkbox -
加载DOM后无法读取动态创建的复选框的属性(Cannot Read Property of Dynamically Created Checkbox after DOM is Loaded)[2022-03-16]
您缺少表元素中的className courseList 。 更新我使用setTimeout模拟了Ajax请求。 您可以删除setTimeout代码并放置Ajax请求。 返回数据时,使用数据运行回调函数。 function getResults(studentID, callback) { // Async call. setTimeout(function() { // Replace generator with Ajax call var result = []; ... -
它应该是 $("#myDiv") .append("
").children('h3:last') .append("").children('a:last') .attr("href", "http://example.com") .text("Click here") 每个方法都会返回执行它的原始jQuery对象( 除了像find , children等遍历的对象),因此您可以继续使用它们。 我完全删除了.end()因为这只有在使用改变jQuery对象的遍历 ...
-
使用 $('#account_ad_city').prop('checked')); 在这里尝试 - http://jsfiddle.net/FloydPink/mvdzS/ 这个关于SO本身的答案给出了.attr()和.prop()之间差异的一个很好的解释。 Use $('#account_ad_city').prop('checked')); Try it here - http://jsfiddle.net/FloydPink/mvdzS/ And this answer here on SO i ...
-
DOM更改后计算元素(count elements after DOM change)[2021-09-07]
没有标签checkbox ,您需要使用:checkbox 文档选择器 $('#form').find(':checkbox').length; 或者更详细 $('#form').find('input[type="checkbox"]').length; There is no tag checkbox, you will need to use the :checkbox docs selector $('#form').find(':checkbox').length; or the more v ... -
通过传递复选框值属性jQuery来影响DOM元素(Affect DOM elements by passing checkbox value attribute jQuery)[2024-02-09]
关于jQuery的一个好处是隐式循环。 大多数。集合上的.each操作都可以使用选择器或过滤来完成。 而不是写作 $('.filter_checkbox').each(function (index, checkbox){ if($(checkbox).prop('checked')){ /* do stuff */ } }); 你可以写 $('.filter_checkobx:checked').each( function(index, checkbox){ /* do stu ...