码迷,mamicode.com
首页 >  
搜索关键字:would you like some more rice    ( 45620个结果
里氏代换原则
若对于每一个类型S的对象o1,都存在一个类型T的对象o2,使得在所有针对T编写的程序P中,用o1替换o2后,程序P的行为功能不变,则S是T的子类型。What is wanted here is something like the following substitution property: I...
分类:其他好文   时间:2014-05-14 03:32:08    阅读次数:229
When to use Class.isInstance() & when to use instanceof operator?
I think the official documentation gives you the answer to this one (albeit in a fairly nonspecific way):This method is the dynamic equivalent of the ...
分类:其他好文   时间:2014-05-14 03:31:06    阅读次数:223
elasticsearch 相关
1、对elsasticsearch index的解释,What exactly is an index in Elasticsearch ?basic definitionAn index isdefinedas:An index is like a ‘database’ in a relation...
分类:其他好文   时间:2014-05-14 03:21:49    阅读次数:287
【LeetCode】Rotate Image
You are given annxn2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?思路:先将矩阵转置,然后将第一列与最后...
分类:其他好文   时间:2014-05-14 03:09:35    阅读次数:225
java回调
一句话,回调是一种双向调用模式,什么意思呢,就是说,被调用方在被调用时也会调用对方,这就叫回调。“If you call me, i will call back”。不理解?没关系,先看看这个可以说比较经典的使用回调的方式:class A实现接口InA ——背景1class A中包含一个class ...
分类:编程语言   时间:2014-05-12 21:24:29    阅读次数:508
Thrift---more efficient transport protocol.
Thrift 是什么? Thrift源于大名鼎鼎的facebook之手,在2007年facebook提交Apache基金会将Thrift作为一个开源项目,对于当时的facebook来说创造thrift是为了解决facebook系统中各系统间大数据量的传 输通信以及系统之间语言环境不同需要跨平台的特性...
分类:其他好文   时间:2014-05-12 20:35:23    阅读次数:296
HDU 4027 Can you answer these queries?(线段树,区间更新,区间查询)
题目线段树简单题意:区间(单点?)更新,区间求和更新是区间内的数开根号并向下取整这道题不用延迟操作//注意://1:查询时的区间端点可能前面的比后面的大;//2:优化:因为每次更新都是开平方,同一个数更新有限次数就一直是1了,所以可以这样优化#include #include#define N .....
分类:其他好文   时间:2014-05-12 20:01:38    阅读次数:295
【LeetCode】Spiral Matrix II
Given an integern, generate a square matrix filled with elements from 1 ton2in spiral order.For example,Givenn=3,You should return the following matri...
分类:其他好文   时间:2014-05-12 19:53:23    阅读次数:332
SPOJ 4487. Can you answer these queries VI splay
题目链接:点击打开链接 题意比较明显,不赘述。 删除时可以把i-1转到根,把i+1转到根下 则i点就在 根右子树 的左子树,且只有i这一个 点 #include #include #include #include using namespace std; #define N 300500 #define inf 10000000 #define L(x) tree[x].ch[0] #d...
分类:其他好文   时间:2014-05-11 21:05:52    阅读次数:365
HDU 4027 Can you answer these queries? 线段树裸题
题意: 给定2个操作 0、把区间的每个数sqrt 2、求和 因为每个数的sqrt次数很少,所以直接更新到底,用个标记表示是否更新完全(即区间内的数字只有0,1就不用再更新了) #include #include #include #include #include #include #include #include using namespace std; #define N 1000...
分类:其他好文   时间:2014-05-11 21:02:45    阅读次数:325
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!