- 浏览: 525396 次
- 性别:
- 来自: 杭州
最新评论
-
飞天奔月:
public List<String> gener ...
实践中的重构30_不做油漆匠 -
在世界的中心呼喚愛:
在世界的中心呼喚愛 写道public class A {
...
深入理解ReferenceQueue GC finalize Reference -
在世界的中心呼喚愛:
在世界的中心呼喚愛 写道在世界的中心呼喚愛 写道在classB ...
深入理解ReferenceQueue GC finalize Reference -
在世界的中心呼喚愛:
在世界的中心呼喚愛 写道在classB的finalize上打断 ...
深入理解ReferenceQueue GC finalize Reference -
在世界的中心呼喚愛:
iteye比较少上,如果可以的话,可以发e-mail交流:ch ...
深入理解ReferenceQueue GC finalize Reference
文章列表
主要参考
http://code.google.com/p/androidbmi/wiki/DiveIntoAndroid
这个教程是一个比较好的教程,但是天下没有人人满意的东西。
主要而言,对某些读者,该教程有两个小小的不足,1是繁体字,2是作者照顾了很多刚入门的程序员,写的太细致了,比如还要抽空讲一讲java,xml的一些语法。
本文的特点就是,1普通话,2面向有java,xml经验的程序员。主要是从一个小例子阐述一下OPhone/Android的一些重要概念。
本文的目标是除去搭建环境外的一个5分钟快速入门。并提供一个简单的程序代码可以用来修改验证一些OPhone/Android入门时 ...
关于对象如何销毁以及finalize更详细的信息
目录
概述
1 先看一个对象finalize的顺序问题。
2 对象再生及finalize只能执行一次
3 SoftReference WeakReference
4 PhantomReference
5 ReferenceQueue
Q&A
概述
先说一些基本的东西,GC只负责对象内存 ...
package temworkingarea;
/**
* <pre>
* The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out in a 2D grid. Our valiant knight (K) was initially positioned in the top-left room and must fight his way th ...
hbase分页功能的几种实现方案
- 博客分类:
- hbase_hadoop
hbase分页功能的几种实现方案。
分页功能是线上系统的常用功能,对hbase,有以下几个方案可以选择(抛砖引玉)。
假设要查第N页,1页大小为M
1 client分页,scan查到N*M条,过滤掉N*M-M条,返回M条。对于M,N较小时比较适合。
2 自定义Filter,该filter可以传递offset(server端需要过滤的记录条数),在server端分页,注意,跨不同的region时需要重新计算该offset。
例子:第1个HRegion的请求传递该值为N*M-M,表示需要在server端过滤掉N*M-M条记录。当第1个HRegion返回时,需要知道该次请求在server端实际 ...
package temworkingarea;
import leetcode.tag.JavaEye;
@JavaEye
/**
* <pre>
* Compare two version numbers version1 and version1.
* If version1 > version2 return 1, if version1 < version2 return -1, otherwise return 0.
*
* You may assume that the version strings are non-empty and cont ...
https://github.com/zhang-xzhi/simplehbase/
https://github.com/zhang-xzhi/simplehbase/wiki
simplehbase的主要功能
数据类型映射:java类型和hbase的bytes之间的数据转换。
简单操作封装:封装了hbase的put,get,scan等操作为简单的java操作方式。
hbase query封装:封装了hbase的filter,可以使用sql-like的方式操作hbase。
动态query封装:类似于myibatis,可以使用xml配置动态语句查询hbase。
insert,update支 ...
https://github.com/zhang-xzhi/simplehbase/
https://github.com/zhang-xzhi/simplehbase/wiki
simplehbase的主要功能
数据类型映射:java类型和hbase的bytes之间的数据转换。
简单操作封装:封装了hbase的put,get,scan等操作为简单的java操作方式。
hbase query封装:封装了hbase的filter,可以使用sql-like的方式操作hbase。
动态query封装:类似于myibatis,可以使用xml配置动态语句查询hbase。
insert,update支 ...
[leetcode] SameTree
- 博客分类:
- leetcode
/**
* <pre>
* Given two binary trees, write a function to check if they are equal or not.
*
* Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
* </pre>
*/
public class SameTree {
public class TreeNode {
int ...
/**
* Determine whether an integer is a palindrome. Do this without extra space.
* */
public class PalindromeNumber {
public class Solution {
public boolean isPalindrome(int x) {
int temResult = 0;
int temX = x;
while (temX > 0) {
t ...
https://github.com/zhang-xzhi/simplehbase/
https://github.com/zhang-xzhi/simplehbase/wiki
simplehbase的主要功能
数据类型映射:java类型和hbase的bytes之间的数据转换。
简单操作封装:封装了hbase的put,get,scan等操作为简单的java操作方式。
hbase query封装:封装了hbase的filter,可以使用sql-like的方式操作hbase。
动态query封装:类似于myibatis,可以使用xml配置动态语句查询hbase。
insert,update支 ...
PooledHTable多次close导致问题
PooledHTable close时,调用returnTable(table)
private void returnTable(HTableInterface table) throws IOException {
// this is the old putTable method renamed and made private
String tableName = Bytes.toString(table.getTableName());
if (tables.size(tableName) > ...
hbase中的CoprocessorProtocol机制.
CoprocessorProtocol的原理比较简单,近似于一个mapreduce框架。由client将scan分解为面向多个region的请求,并行发送请求到多个region,然后client做一个reduce的操作,得到最后的结果。
先看一个例子,使用hbase的AggregationClient可以做到简单的面向单个column的统计。
@Test
public void testAggregationClient() throws Throwable {
LongColumnInterpreter colu ...
hbase 0.94.0 0.94.9 0.94.24 功能不兼容初步分析
测试原因:
原有的simplehbase count测试代码当hbase从某个集团版本升级后,部分测试代码不通过,怀疑hbase的各个版本有兼容性问题。
测试环境:
0.94.0 0.94.9 0.94.24使用本机的独立部署hbase。 client 0.94.9
测试数据:
rowkey f/q1 f/q2 f/q3
1 1 2
2 4 ...
hbase 0.94.0 0.94.9 0.94.24 功能不兼容初步分析
测试原因:
原有的simplehbase count测试代码当hbase从某个集团版本升级后,部分测试代码不通过,怀疑hbase的各个版本有兼容性问题。
测试环境:
0.94.0 0.94.9 0.94.24使用本机的独立部署hbase。 client 0.94.9
测试数据:
rowkey f/q1 f/q2 f/q3
1 1 2
2 4 ...
/**
* <pre>
* Given an index k, return the kth row of the Pascal's triangle.
*
* For example, given k = 3,
* Return [1,3,3,1].
*
* Note:
* Could you optimize your algorithm to use only O(k) extra space?
* </pre>
* */
public class PascalsTriangle2 {
public class Solution {
...