github page hexo能被百度索引吗

com.github.pagehelper.PageHelper
Start line: &
End line: &
Snippet Preview
Snippet HTML Code
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&package&com.github.&&import&;&import&;&import&;&import&;&import&;&import&;&import&;&import&;&import&;&import&;&&import&;&import&;&import&; Mybatis - 通用分页拦截器
&&@(@(type&=&.class,&method&=&"query",&args&=&{.class,&.class,&.class,&.class}))&public&class&&implements&&{&&&&&public&static&final&&&=&new&();&&&&&public&static&final&&&=&new&();&&&&&public&static&final&&&=&MetaObject.(.class,&,&);&&&&&&private&static&class&&{&&&&&}&&&& 反射对象,增加对低版本Mybatis的支持
&&&&&&public&static&&(&object)&{&&&&&&&&&return&MetaObject.(object,&,&);&&&&&}&&&&&&private&static&final&&&=&"sqlSource.boundSql.sql";&&&&&&private&static&final&&>&&=&new&&>();&&&&&&private&static&final&&>&&=&new&&>(0);&&&&&&&&&&&private&static&&&=&"";&&&&&&&&&&private&static&boolean&&=&false;&&&&&&&&&&private&static&boolean&&=&false;&&&&&&&&&&private&static&boolean&&=&false;&&&& 开始分页
&&&&&&public&static&void&(int&pageNum,&int&pageSize)&{&&&&&&&&&(pageNum,&pageSize,&true);&&&&&}&&&& 开始分页
&&&&&&public&static&void&(int&pageNum,&int&pageSize,&boolean&count)&{&&&&&&&&&.(new&(pageNum,&pageSize,&count));&&&&}&&&& 获取分页参数
&&&&private&&(&rowBounds)&{&&&&&&&&&page&=&.();&&&&&&&&&&&&&&&&.();&&&&&&&&if&(page&==&null)&{&&&&&&&&&&&&if&()&{&&&&&&&&&&&&&&&&page&=&new&(rowBounds.(),&rowBounds.(),&);&&&&&&&&&&&&}&else&{&&&&&&&&&&&&&&&&page&=&new&(rowBounds,&);&&&&&&&&&&&&}&&&&&&&&}&&&&&&&&return&page;&&&&}&&&& Mybatis拦截器方法
&&&&@&&&&public&&(&invocation)&throws&&{&&&&&&&&final&[]&args&=&invocation.();&&&&&&&&&rowBounds&=&()&args[2];&&&&&&&&if&(.()&==&null&&&&rowBounds&==&.)&{&&&&&&&&&&&&return&invocation.();&&&&&&&&}&else&{&&&&&&&&&&&&&&&&&&&&&&&&args[2]&=&.;&&&&&&&&&&&&&ms&=&()&args[0];&&&&&&&&&&&&&parameterObject&=&args[1];&&&&&&&&&&&&&boundSql&=&ms.(parameterObject);&&&&&&&&&&&&&&&&&&&&&&&&&page&=&(rowBounds);&&&&&&&&&&&&&&&&&&&&&&&&if&(&&&&page.()&==&0)&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&result&=&invocation.();&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&page.(()&result);&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&page.(page.());&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&page.(page.());&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&return&page;&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&&qs&=&(ms,&new&(boundSql));&&&&&&&&&&&&&&&&&&&&&&&&args[0]&=&qs;&&&&&&&&&&&&&msObject&=&(qs);&&&&&&&&&&&&&sql&=&()&msObject.();&&&&&&&&&&&&&&&&&&&&&&&&if&(page.())&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&msObject.(,&(sql));&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&result&=&invocation.();&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&page.(()&(()&result).(0));&&&&&&&&&&&&&&&&if&(page.()&==&0)&{&&&&&&&&&&&&&&&&&&&&return&page;&&&&&&&&&&&&&&&&}&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&if&(page.()&>&0)&{&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&msObject.(,&(sql,&page));&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&msObject.("resultMaps",&ms.());&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&result&=&invocation.();&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&page.(()&result);&&&&&&&&&&&&}&&&&&&&&&&&&&&&&&&&&&&&&return&page;&&&&&&&&}&&&&}&&&& 获取总数sql - 如果要支持其他数据库,修改这里就可以
&&&&private&&(&sql)&{&&&&&&&&return&"select&count(0)&from&("&+&sql&+&")&tmp_count";&&&&}&&&& 获取分页sql - 如果要支持其他数据库,修改这里就可以
&&&&private&&(&sql,&&page)&{&&&&&&&&&pageSql&=&new&(200);&&&&&&&&if&("mysql".())&{&&&&&&&&&&&&pageSql.("select&*&from&(");&&&&&&&&&&&&pageSql.(sql);&&&&&&&&&&&&pageSql.(")&as&tmp_page&limit&"&+&page.()&+&","&+&page.());&&&&&&&&}&else&if&("hsqldb".())&{&&&&&&&&&&&&pageSql.(sql);&&&&&&&&&&&&pageSql.("&LIMIT&"&+&page.()&+&"&OFFSET&"&+&page.());&&&&&&&&}&else&if&("oracle".())&{&&&&&&&&&&&&pageSql.("select&*&from&(&select&temp.*,&rownum&row_id&from&(&");&&&&&&&&&&&&pageSql.(sql);&&&&&&&&&&&&pageSql.("&)&temp&where&rownum&&=&").(page.());&&&&&&&&&&&&pageSql.(")&where&row_id&>&").(page.());&&&&&&&&}&&&&&&&&return&pageSql.();&&&&}&&&&private&class&&implements&&{&&&&&&&&&;&&&&&&&&public&(&boundSql)&{&&&&&&&&&&&&this.&=&boundSql;&&&&&&&&}&&&&&&&&public&&(&parameterObject)&{&&&&&&&&&&&&return&;&&&&&&&&}&&&&}&&&& 由于MappedStatement是一个全局共享的对象,因而需要复制一个对象来进行操作,防止并发访问导致错误
&&&&private&&(&ms,&&newSqlSource)&{&&&&&&&&.&builder&=&new&.(ms.(),&ms.()&+&"_PageHelper",&newSqlSource,&ms.());&&&&&&&&builder.(ms.());&&&&&&&&builder.(ms.());&&&&&&&&builder.(ms.());&&&&&&&&builder.(ms.());&&&&&&&&if&(ms.()&!=&null&&&&ms.().length&!=&0)&{&&&&&&&&&&&&&keyProperties&=&new&();&&&&&&&&&&&&for&(&keyProperty&:&ms.())&{&&&&&&&&&&&&&&&&keyProperties.(keyProperty).(",");&&&&&&&&&&&&}&&&&&&&&&&&&keyProperties.(keyProperties.()&-&1,&keyProperties.());&&&&&&&&&&&&builder.(keyProperties.());&&&&&&&&}&&&&&&&&builder.(ms.());&&&&&&&&builder.(ms.());&&&&&&&&&&&&&&&&&>&resultMaps&=&new&&>();&&&&&&&&&resultMap&=&new&.(ms.(),&ms.(),&int.class,&).();&&&&&&&&resultMaps.(resultMap);&&&&&&&&builder.(resultMaps);&&&&&&&&builder.(ms.());&&&&&&&&builder.(ms.());&&&&&&&&builder.(ms.());&&&&&&&&builder.(ms.());&&&&&&&&return&builder.();&&&&}&&&& 只拦截Executor
&&&&@&&&&public&&(&target)&{&&&&&&&&if&(target&instanceof&)&{&&&&&&&&&&&&return&Plugin.(target,&this);&&&&&&&&}&else&{&&&&&&&&&&&&return⌖&&&&&&&&}&&&&}&&&& 设置属性值
&&&&public&void&(&p)&{&&&&&&&&&=&p.("dialect");&&&&&&&&if&(&==&null&||&"".())&{&&&&&&&&&&&&throw&new&("Mybatis分页插件PageHelper无法获取dialect参数!");&&&&&&&&}&&&&&&&&&&&&&&&&&offset&=&p.("offsetAsPageNum");&&&&&&&&if&(offset&!=&null&&&&"TRUE".(offset))&{&&&&&&&&&&&&&=&true;&&&&&&&&}&&&&&&&&&&&&&&&&&withcount&=&p.("rowBoundsWithCount");&&&&&&&&if&(withcount&!=&null&&&&"TRUE".(withcount))&{&&&&&&&&&&&&&=&true;&&&&&&&&}&&&&&&&&&&&&&&&&&sizeZero&=&p.("pageSizeZero");&&&&&&&&if&(sizeZero&!=&null&&&&"TRUE".(sizeZero))&{&&&&&&&&&&&&&=&true;&&&&&&&&}&&&&}}
&com.github.pagehelper
<div class="gae-status" id="gae-status-repo1.maven.org$maven2@com.github.pagehelper$pagehelper@3.2.3@com$github$pagehelper@PageHelper.BoundSqlSqlSource@(org.apache.ibatis.mapping.BoundSql)">
New to GrepCode? Check out our看到这个贴吧的索引,好棒。_c语言吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:465,283贴子:
看到这个贴吧的索引,好棒。收藏
第一次看到贴吧能那么高大上有个 GitHub Page 的索引,吧主赞一个。另外禁二级内容吗……我就问下看过 K&R ,应该写过上万行代码了(可能不到,几千行吧),裸考没问题吗,还是要背背概念?为了避免被删,顺便问问 C 模拟 OO 的最佳实践是什么……
我是打算试试看用宏 + 函数指针 + 结构体模拟OO的……不知道有没有好代码可以参考
本吧严禁二级,楼主自重。
/Rocaloid/RUtil2 正巧这是我上个月做的事。。
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或Module Summary
File size minified:
Dependencies:
Browser Support:
Component:
visionmedia/page.js
by Toby Ho on 4/16/2014
is a small client-side routing library for use with building single page applications (SPAs). It has a simple API which is inspired by . It utilizes the
under the hood, which is what allows you to build smooth user interfaces while still having linkable URLs for different pages of the app.
Page supplies you a page function which has a few different roles:
var page = require(&#39;page&#39;);
The first of those roles is specifying routes. If you&#39;ve use Ruby on Rails or Express or a similar framework, this should look familiar:
page(&#39;/&#39;, function(){
// Do something to set up the index page
page(&#39;/about&#39;, function(){
// Set up the about page
Your routes can contain parameters, which you can assess through the context parameter to your route handler
page(&#39;/user/:id&#39;, function(context){
var userId = context.params.id;
console.log(&#39;Loading details for user&#39;, userId);
You can use wildcards as parameters too, in which case you will need to use array indexing to access the parameters:
page(&#39;/files/*&#39;, function(context){
var filePath = context.params[0];
console.log(&#39;Loading file&#39;, filePath);
A key difference between using a wildcard vs a named parameter is that a wildcard can match the character &/&, while a named parameter cannot. In our file path example, using a wildcard allows filePath to contain arbitrarily nested subdirectories.
Another useful thing you can do with a wildcard is to define a fallback route:
page(&#39;*&#39;, function(){
console.error(&#39;Page not found :(&#39;);
Starting The Router
Once you have all your routes defined, you need to start the router, which is done with another call to page, but this time with no parameters:
If you are weirded out by this, and prefer to be more explicit, you can instead write the equivalent:
page.start();
Both of these can take an optional options object, containing the properties:
click - whether to automatically bind to click events on the page and intercept link clicks and handle them using page&#39;s router - defaults to true.
popstate - whether to bind to and utilize the
- defaults to true.
dispatch - whether to perform initial route dispatch based on the current url - defaults to true.
As mentioned above, page will by default automatically intercept clicks on links on the page and try to handle it using the routes you&#39;ve setup. Only if it can&#39;t match the url with any of the define routes will it default back to the browser&#39;s default behavior. Sometimes though, you may want to change the URL based on other events. Maybe the element clicked happens to be something other than a link. Or, if you are building a search page, you may want to allow users to share the URL to their search results. You can do this by just calling page function with the page you want to navigate to:
$(form).on(&#39;submit&#39;, function(e){
e.preventDefault();
page(&#39;/search?&#39; + form.serialize());
If you prefer to be more explicit, you can use page.show(path) instead.
Route Handler Chaining
A cool feature of page is that it allows for route handler chaining, which is similar to Express&#39;s middlewares. A route definition can take more than one handler:
page(&#39;user/:id&#39;, loadUser, showUser);
Here, when the path user/1 is navigated, page will first call the loadUser handler. When the user is done loading, it will call the showUser handler to display it. How does it know when the user is done loading? A callback is provided to the handlers as the second parameter - here is what loadUser might look like:
function loadUser(ctx, next){
var id = ctx.params.id;
$.getJSON(&#39;/user/&#39; + id + &#39;.json&#39;, function(user){
ctx.user = user;
Then, in showUser you can get at the user through ctx.user. Now this is nice because you can reuse the loadUser function for, say, the user/:id/edit route.
supports saving states along with each history entry. This allows you to cache information along with previously navigated URLs, so that if the user navigates back to them via the back button, you don&#39;t have to to re-fetch the information, making the UI much smoother. Page exposes this via the state property of the . To make the above loadUser function utilize this cache, you would write this:
function loadUser(ctx, next){
if (ctx.state.user){
var id = ctx.params.id;
$.getJSON(&#39;/user/&#39; + id + &#39;.json&#39;, function(user){
ctx.state.user = user;
ctx.save();
// saves the state via history.replaceState()
Putting It All Together
Now that you know what you need to know about page, let&#39;s build an example application. The app will render a list of the earliest Github users. You can click on an individual user and get more details about him or her. The back button should work seamlessly and should use caching. This will use the modules , , and .
var page = require(&#39;page&#39;);
var request = require(&#39;superagent&#39;);
var mustache = require(&#39;mustache&#39;);
These are route definitions:
page(&#39;/&#39;, loadUsers, showUsers);
page(&#39;/user/:id&#39;, loadUser, showUser);
The implementation of loadUsers and loadUser look like this, much like the previous state-caching example:
function loadUsers(ctx, next){
if (ctx.state.users){
// cache hit!
// not cached by state, make the request
request(&#39;/users&#39;, function(reply){
var users = reply.body;
ctx.state.users = users;
ctx.save();
function loadUser(ctx, next){
if (ctx.state.user){
var id = ctx.params.id;
request(&#39;/user/&#39; + id, function(reply){
var user = reply.body;
ctx.state.user = user;
ctx.save();
For rendering the pages, this will use mustache, and I&#39;ve made the following templates:
var listTemplate =
&#39;&h1&Early Github Users&/h1&\
&a href=&/user/{{id}}&&{{login}}&/a&\
&/ul&&#39;;
var showTemplate =
&#39;&h1&User {{login}}&/h1&\
&p&{{name}} is user number {{id}}. \
He has {{followers}} followers, \
{{public_repos}} public repos and writes a blog at\
&a href=&{{blog}}&&{{blog}}&/a&.\
&a href=&/&&Back to list&/a&.&/p&\
There are ways to lift the markup into .html files, but I&#39;ll save that for another day. To render these templates is job of showUser and showUsers:
function showUsers(ctx){
var users = ctx.state.users;
content.innerHTML =
mustache.render(listTemplate, users);
function showUser(ctx){
var user = ctx.state.user;
content.innerHTML =
mustache.render(showTemplate, user);
And finally, we need to start the router:
page.start();
And there you have it! A multi-page single page application. If you want to poke around with this code, take a look at the , which has been modularized into small files.
Please enable JavaScript to view the每次用心改变 社区看得见更小文件 更大作为更小体积的文件,满足更轻便的使用需求更灵活的打包方式,可自由选择你需要的图表和组件移动端强势来袭良好的自适应效果专属的移动端交互体验更丰富的可视化效果新增更多图表类型,更好的满足不同数据的处理需求更多的搭配方案让你的数据呈现方式更个性和完美Echarts 3.0的这一切仅仅是一个新的开始在探索和完善的道路上我们从未停止脚步

我要回帖

更多关于 github page禁用https 的文章

 

随机推荐