上一页 1 ··· 6 7 8 9 10

Reference summary

摘要: This is what I sum up here to prove you really understand reference?Q: what is reference and referent?Q: what are the gc roots?Q: during gc mark and sweep phases, how collector handle different kinds of reference?Q: explain the interaction between gc and reference?Q: how apps get involved in gc life 阅读全文
posted @ 2012-03-19 15:02 grep 阅读(219) 评论(0) 推荐(0) 编辑

Java Puzzler

摘要: does the following code compile?public class Puzzler { <T> T cast(T t, Class<T> clazz) { return clazz.cast(t); } <T> T nop(T t) { return cast(t, t.getClass()); }} 阅读全文
posted @ 2012-03-16 23:47 grep 阅读(144) 评论(0) 推荐(0) 编辑

Java Memory Reloaded

摘要: We can basically distinguish memory areas that are available for all threads in a JVM and those memory areas that are exclusively accessible from only one thread. The two areas that are available from all threads are the Method Area and the Heap.The method area is responsible for storing class infor 阅读全文
posted @ 2012-03-15 10:12 grep 阅读(298) 评论(0) 推荐(0) 编辑

inside the java virtual machine 再读

摘要: The lifetime of a class and an objectInitialization of a class consists of two steps:init its direct super class, it its direct super class hasn't already inited.executing the class's class init method, if it has one.The JVM initializes types on their first active use,Only four activities co 阅读全文
posted @ 2012-03-15 09:52 grep 阅读(410) 评论(0) 推荐(0) 编辑

transaction

摘要: <bean id="oracleDataSource" class="oracle.jdbc.pool.OracleDataSource"> <property name="URL" value="${jdbc.url}" /> <property name="user" value="${jdbc.username}" /> <property name="password" value="${jdbc 阅读全文
posted @ 2012-03-05 13:14 grep 阅读(335) 评论(0) 推荐(0) 编辑

path in distance

摘要: Distancethe distance between two nodes is the length of the shortest path between them.A conveninent way to compute distances from s to the other vertices is to proceed layer by layer.Once we have picked out the nodes at distance k, the nodes at k+1 are easily determined:they are precisely the as-ye 阅读全文
posted @ 2012-02-28 11:03 grep 阅读(227) 评论(0) 推荐(0) 编辑

graph

摘要: Finding all nodes reachable from a particular node.def explore(G,v)"""Input:G=(V,E) is a graph;v belongs to V""""""Output: visited(u) is set to true for all nodes u reachable from v"""visited(v) = trueprevisited(v)for each edge (v,u) in E: 阅读全文
posted @ 2012-02-27 15:46 grep 阅读(364) 评论(0) 推荐(0) 编辑

Heap

摘要: heap definitioncompletely balanced binary tree.the value of each node >= each of the node's children.heap data structurecompletely balanced binary tree implemented by an arraythe root is stored in A[1]the parent of A[i] is A[floor(i/2)]the left child of A[i] is A[2*i]the right child of A[i] i 阅读全文
posted @ 2012-02-25 11:40 grep 阅读(319) 评论(0) 推荐(0) 编辑

Recursive : Divide and Conquer(meta-algo II)

摘要: Assume you have an algorithm that works.Use it to write an algorithm that works.till use brute force to get into the smallest problem(base case).meta-recursive algorithmdef recursiveAlgo(a,b,c){//pre-cond: a,b,c//post-cond: x,y,z if((a,b,c) is sufficently small instance) return (0,0,0) else{ ... 阅读全文
posted @ 2012-02-24 21:49 grep 阅读(296) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10