fetch 和 lazy 配置用于数据的查询lazy 参数值常见有 false 和 true,Hibernate3 映射文件中默认lazy = true ;fetch 指定了关联对象抓取的方式,参数值常见是select和join,默认是select, select方式先查询主对象,再根据关联外键,每...
分类:
Web程序 时间:
2015-05-06 19:39:25
阅读次数:
278
题目地址:POJ 3237
这题用了一下午。。本来一直认为max和min两个数组是不用改的,只需要改lazy数组,然后在查询的时候利用lazy标记来返回max或-min,后来发现错的很严重。。
这题要在pushdown中修改max和min数组,从而实现最大值取反。
代码如下:#include
#include ...
分类:
其他好文 时间:
2015-05-04 22:13:18
阅读次数:
119
分析:线段树的应用,区间修改,使用延迟标记进行延迟修改。
#include
using namespace std;
#define N 100010
class SegmentTree
{
private:
struct Node
{
int left,right; //左右子节点
int sum; //区间和
int lazy; ...
分类:
其他好文 时间:
2015-05-03 16:06:09
阅读次数:
126
#include
#include
#define maxn 100000 + 10
#define Lson L, mid, rt<<1
#define Rson mid+1, R, rt<<1|1
struct Node
{
int sum, lazy;
} T[maxn<<2];
void PushUp(int rt)
{
T[rt].sum = T[rt<<1]....
分类:
其他好文 时间:
2015-05-03 12:03:50
阅读次数:
157
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3606Lazy SalesgirlTime Limit:5 Seconds Memory Limit:65536 KBKochiya Sanae is a lazy girl ...
分类:
其他好文 时间:
2015-05-02 23:21:47
阅读次数:
167
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3607Lazier SalesgirlTime Limit:2 Seconds Memory Limit:65536 KBKochiya Sanae is a lazy gir...
分类:
其他好文 时间:
2015-05-02 18:10:16
阅读次数:
238
块状链表太强大了,也可以实现和线段树一样的lazy操作来提高效率。每个块维护自己块的信息。 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 const in...
分类:
其他好文 时间:
2015-05-02 16:28:06
阅读次数:
125
懒加载(LazyLoad),又称为延迟加载。举个例子,当我们在用网易新闻App时,看着那么多的新闻,并不是所有的都是我们感兴趣的,有的时候我们只是很快的滑过,想要快速的略过不喜欢的内容,但是只要滑动经过了,图片就开始加载了,这样用户体验就不太好,而且浪费内存.这个时候,我们就可以利用lazy加载技术...
分类:
其他好文 时间:
2015-04-30 15:47:41
阅读次数:
144
速度居然进前十了...第八...splay, 区间翻转,用一个类似线段树的lazy标记表示是否翻转----------------------------------------------------------------------------------------#include#incl...
分类:
其他好文 时间:
2015-04-30 15:34:06
阅读次数:
190
1. 关闭延迟加载功能 lazy="false"2.修改抓取策略 fetch="join"直接查询关联数据,一个联接查询搞定3.使用Hibernate对象的initialize方法将关联对象进行预加载,不管用不用都提前查了一遍3中方法无非都是将session关闭之前执行了这个sql
分类:
Web程序 时间:
2015-04-28 18:16:48
阅读次数:
134