offset

yii2 分页功能

旧城冷巷雨未停 提交于 2019-12-04 15:40:16
1、control use yii\data\Pagination; $query = goods::find(); $countQuery = clone $query; $pages = new Pagination(['totalCount' => $countQuery->count(),'pageSize' => '5']); $goods_info = $query->offset($pages->offset) ->limit($pages->limit) ->all(); return $this->renderPartial('show',['goods_info' => $goods_info,'pages'=>$pages]); 2、view use yii\widgets\LinkPager; echo LinkPager::widget(['pagination' => $pages]); 来源: oschina 链接: https://my.oschina.net/u/2450048/blog/521439

Parallax effect - calculate child offset to parent on scroll

旧巷老猫 提交于 2019-12-04 15:17:06
I'm trying to create a parallax effect whereby an absolutely positioned child element should move at a rate slower than it's parent on scroll. The child will always be 130% height of the parent but the parent can be any height: HTML: <div class="parallax-window lg"> <div class="parallax-image image-1"></div> <div class="parallax-content">Hello World</div> </div> <div class="parallax-window"> <div class="parallax-image image-2"></div> <div class="parallax-content">Hello World</div> </div> CSS: .parallax-window { min-height: 300px; position: relative; overflow: hidden; } .parallax-window.lg {

总结一下OpenWRT编译经验

不问归期 提交于 2019-12-04 15:03:00
1.如何为固件增加软件包 软件包索引存储在feeds文件夹中,luci.index packages.index以及xwrt.index就是几乎所有软件包的索引 实例:从Openwrt trunk 移植 aria2 到 Openwrt backfire 察看trunk源码,在packages.index文件中搜索关键字"aria2",发现aria2软件包的描述 复制代码 Source-Makefile: feeds/packages/net/aria2/Makefile Package: aria2 Submenu: File Transfer Version: 1.15.1-1 Depends: +libc +USE_EGLIBC:librt +USE_EGLIBC:libpthread +libopenssl +zlib +libxml2 +libstdcpp Menu-Depends: Provides: Section: net Category: Network Title: lightweight download utility Maintainer: OpenWrt Developers Team <openwrt-devel@openwrt.org> Source: aria2-1.15.1.tar.bz2 Type: ipkg Description:

kafka-python consumer start reading from offset (automatically)

倖福魔咒の 提交于 2019-12-04 14:21:31
问题 I'm trying to build an application with kafka-python where a consumer reads data from a range of topics. It is extremely important that the consumer never reads the same message twice, but also never misses a message. Everything seems to be working fine, except when I turn off the consumer (e.g. failure) and try to start reading from offset. I can only read all the messages from the topic (which creates double reads) or listen for new messages only (and miss messages that where emitted during

MD5加密(java代码)

天涯浪子 提交于 2019-12-04 12:24:53
package hdty.project.test.util; import java.io.UnsupportedEncodingException; import java.security.MessageDigest; import java.security.NoSuchAlgorithmException; public class EncoderByMd5 { public static String encodeByMd5(String plainText) { StringBuffer buf = new StringBuffer(""); try { MessageDigest md = MessageDigest.getInstance("MD5"); md.update(plainText.getBytes()); byte b[] = md.digest(); int i = 0; for (int offset = 0; offset < b.length; offset++) { i = b[offset]; if (i < 0) i += 256; if (i < 16) buf.append("0"); buf.append(Integer.toHexString(i)); } } catch (NoSuchAlgorithmException e)

C++ , Cheat Engine / OllyDBG finding base “static” address from multi-level pointers

萝らか妹 提交于 2019-12-04 12:07:21
问题 I'm back again, frustrated and desperately searching for help :D. I am trying to create a cheat for a simple program, it's basically going to be a .dll file which will change an integer's value from the main program when it's injected to it using its base address. The thing is, I can't find it using cheat engine mainly because there are multiple level pointers with NEGATIVE? offsets. for example: //Starting pointer address 0x0033FCF0 -> 200 //Finding second level pointer using "Find out what

es7 学习

独自空忆成欢 提交于 2019-12-04 11:41:00
以下分为 索引文档(insert) 和 查询文档(select) 1 一个index只有一个type 索引文档时,使用 _doc来代替type PUT /megacorp/_doc/3 { "first_name" : "Douglas", "last_name" : "Fir", "age" : 35, "about": "I like to build cabinets", "interests": [ "forestry" ] } 查询某一条文档 GET /megacorp/_doc/3 查询姓smith的 GET /megacorp/_search?q=last_name:Smith 2 查询姓smith的,并大于30岁的 DSL 1使用 a and b 2查询a,过滤b POST /megacorp/_search { "query": { "bool": { "must": [ { "match": { "last_name": "Smith" } }, { "range": { "age": { "gt": 30 } } } ] } } } POST /megacorp/_search { "query": { "bool": { "must": [ { "match": { "last_name": "Smith" } } ], "filter": { "range

Reposition drop down menu if near edge of window

偶尔善良 提交于 2019-12-04 11:40:51
I'm using the following code to reposition my drop down menus if they fall outside of the browser window area. However it does not work in Internet Explorer 7 and 8. jQuery(document).ready(function(){ jQuery("#nav>ul>li").each(function() { pos = jQuery(this).offset(); if(pos.left + 100 > jQuery(window).width()+window.pageXOffset-jQuery(this).width()) { jQuery(this).addClass("nav-shift");} }); }); The window.pageXOffset property is not supported in IE (7 and 8, at least). Try $(window).offset().left instead: jQuery(document).ready(function(){ jQuery("#nav>ul>li").each(function() { pos = jQuery

sql 分页查询

杀马特。学长 韩版系。学妹 提交于 2019-12-04 11:25:15
分页 使用SELECT查询时,如果结果集数据量很大,比如几万行数据,放在一个页面显示的话数据量太大,不如分页显示,每次显示100条。 要实现分页功能,实际上就是从结果集中显示第1~100条记录作为第1页,显示第101~200条记录作为第2页,以此类推。 因此,分页实际上就是从结果集中“截取”出第M~N条记录。这个查询可以通过 LIMIT <M> OFFSET <N> 子句实现。我们先把所有学生按照成绩从高到低进行排序: -- 按score从高到低 Run 现在,我们把结果集分页,每页3条记录。要获取第1页的记录,可以使用 LIMIT 3 OFFSET 0 : -- 查询第1页 Run 上述查询 LIMIT 3 OFFSET 0 表示,对结果集从0号记录开始,最多取3条。注意SQL记录集的索引从0开始。 如果要查询第2页,那么我们只需要“跳过”头3条记录,也就是对结果集从3号记录开始查询,把 OFFSET 设定为3: -- 查询第2页 Run 类似的,查询第3页的时候, OFFSET 应该设定为6: -- 查询第3页 Run 查询第4页的时候, OFFSET 应该设定为9: -- 查询第4页 Run 由于第4页只有1条记录,因此最终结果集按实际数量1显示。 LIMIT 3 表示的意思是“最多3条记录”。 可见,分页查询的关键在于,首先要确定每页需要显示的结果数量 pageSize

<转: 浏览器工作原理与实践> 01 | Chrome架构:仅仅打开了1个页面,为什么有4个进程?

时光毁灭记忆、已成空白 提交于 2019-12-04 10:42:49
<div data-slate-editor="true" data-key="994" autocorrect="off" spellcheck="false" data-gramm="false" style="outline: none; white-space: pre-wrap; overflow-wrap: break-word;"><div class="se-44f3bb23 " data-slate-type="paragraph" data-slate-object="block" data-key="995"><span data-slate-object="text" data-key="996"><span data-slate-leaf="true" data-offset-key="996:0" data-first-offset="true"><span data-slate-string="true">无论你是想要设计高性能 Web 应用,还是要优化现有的 Web 应用,你都需要了解浏览器中的网络流程、页面渲染过程,JavaScript 执行流程,以及 Web 安全理论,而这些功能是分散在浏览器的各个功能组件中的,比较多、比较散,要怎样学习才能掌握呢?通过浏览器的多进程架构的学习,你就可以把这些分散的知识点串起来,组成一张网