使用和不使用推送调用在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 put push 1 just after check-sat Z3 solves the query in 30sec. If don't put any push 1 at all - Z3 solves it in 200sec. Interesting. Any specific reasons or just a coincidence?


原文:https://stackoverflow.com/questions/9131078
2024-04-21 10:04

满意答案

关于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 input value 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();
});

相关问答

更多

加载DOM后无法读取动态创建的复选框的属性(Cannot Read Property of Dynamically Created Checkbox after DOM is Loaded)

您缺少表元素中的className courseList 。 更新我使用setTimeout模拟了Ajax请求。 您可以删除setTimeout代码并放置Ajax请求。 返回数据时,使用数据运行回调函数。 function getResults(studentID, callback) { // Async call. setTimeout(function() { // Replace generator with Ajax call var result =...

使用jQuery和链接操作DOM元素(Manipulating DOM elements with jQuery and chaining)

它应该是 $("#myDiv") .append("<h3>").children('h3:last') .append("<a>").children('a:last') .attr("href", "http://example.com") .text("Click here") 每个方法都会返回执行它的原始jQuery对象( 除了像find , children等遍历的对象),因此您可以继续使用它们。 我完全删除了.end()因为这只有在使用改变jQuery...

PHP JQuery Checkbox - 如果预先选中复选框,则在取消选中时不会删除'checked'属性(PHP JQuery Checkbox - If checkbox is pre-checked, it wont remove 'checked' attribute when unchecked)

使用 $('#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...

DOM更改后计算元素(count elements after DOM change)

没有标签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 m...

通过传递复选框值属性jQuery来影响DOM元素(Affect DOM elements by passing checkbox value attribute jQuery)

关于jQuery的一个好处是隐式循环。 大多数。集合上的.each操作都可以使用选择器或过滤来完成。 而不是写作 $('.filter_checkbox').each(function (index, checkbox){ if($(checkbox).prop('checked')){ /* do stuff */ } }); 你可以写 $('.filter_checkobx:checked').each( function(index, checkbox){ /* d...

相关文章

更多

【z】Storm - the world's best IDE framework for .NET

http://www.codeproject.com/Articles/42799/Storm-the ...

老友记中的高频词 (z)

下面是在FRIENDS共238集的剧本单词总数898805中出现10次以上的单词,共3137个.占总数 ...

学习di'z地址

杨丰盛cocos2d-x教程下载地址:http://www.dwz.cn/gwPgd 无限互联新浪微博 ...

Struts2 Push Tag 引发的问题

按照Struts官网上的CRUD例子,自己实践了一下,结果报错: tag 'push', field ...

Mercurial 如何让中央库在每次被push新内容后都自动update?

我在一台服务器上有个仓库,并开启web server 我希望,在其他机器往这台服务器push内容后, ...

关于Thread类中的start()方法和run()方法

引用 public void start() Causes this thread to ...

solr 的客户端调用solrj 建索引+分页查询

在solr 3.5 配置及应用(一) 讲过一了solr 3.5的详细配置,本节我们讲利用solr 的客 ...

solr 的客户端调用solrj   建索引+分页查询

在solr 3.5 配置及应用(一) 讲过一了solr 3.5的详细配置,本节我们讲利用solr 的客 ...

solr 的客户端调用solrj 建索引+分页查询

在solr 3.5 配置及应用(一) 讲过一了solr 3.5的详细配置,本节我们讲利用solr 的客 ...

怎么在java里面调用jruby类

大家是怎么用jruby的啊? 找了很久都没有java调用jruby的文章 难道不这样用的? ja ...

最新问答

更多

python的访问器方法有哪些

使用方法: class A(object): def foo(self,x): #类实例方法 print "executing foo(%s,%s)"%(self,x) @classmethod def class_foo(cls,x): #类方法 print "executing class_foo(%s,%s)"%(cls,x) @staticmethod def static_foo(x): #静态方法 print "executing static_foo(%s)"%x调用方法: a =

使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)

我认为你必须将两个TableGetway传递给UserTable构造。 你必须改变Module.php看看: public function getServiceConfig() { return array( 'factories' => array( 'User\Model\UserTable' => function($sm) { $userTableGateway = $sm->get('UserTable

透明度错误IE11(Transparency bug IE11)

这是一个渲染错误,由使用透明度触发,使用bootstrap用于在聚焦控件周围放置蓝色光环的box-shadow属性。 可以通过添加以下类覆盖来解决它。 .form-control:hover { -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,255,1); -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,255,1); box-shadow: 0px 0px 4px 0px rgba(0,0,255,1)

linux的基本操作命令。。。

ls 显示目录 mkdir 建立目录 cd 进入目录

响应navi重叠h1和nav上的h1链接不起作用(Responsive navi overlaps h1 and navi links on h1 isn't working)

将z-index设置为.main-nav这将解决您的重叠问题 .main-nav { position:relative; z-index:9; } set z-index to .main-nav This will fix your overlaping issue .main-nav { position:relative; z-index:9; }

在C中读取文件:“r”和“a +”标志的不同行为(Reading a File in C: different behavior for “r” and “a+” flags)

这是因为模式规范"a"打开一个文件以便追加,文件指针在末尾。 如果您尝试从此处读取,则由于文件指针位于EOF,因此没有数据。 您应该打开"r+"进行阅读和写作。 如果在写入之前读取整个文件,则在写入更多数据时,文件指针将正确定位以追加。 如果这还不够,请探索ftell()和fseek()函数。 That is because the mode spec "a" opens a file for appending, with the file pointer at the end. If you

NFC提供什么样的带宽?(What Kind of Bandwidth does NFC Provide?)

支持空中接口的数据速率是一回事。 在消除协议开销,等待eeprom写入以及所有需要时间的其他内容之后,您看到的数据速率是完全不同的故事。 长话短说,从标签读取或进行对等传输时的实际数据速率峰值约为2.5千字节/秒。 取决于具体的标签或对等技术,它可能比这慢很多。 The supported data-rates of the air-interface are one thing. The data-rate that you see after removing protocol overhe

元素上的盒子阴影行为(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