上一页 1 2 3 4 5 6 ··· 10 下一页

to be assemble

摘要: Runtime Data Areas are the memory areas assigned when the JVM program runs on the OS. The runtime data areas can be divided into 6 areas. Of the six, one PC Register, JVM Stack, and Native Method Stack are created for one thread. Heap, Method Area, and Runtime Constant Pool are shared by all threads 阅读全文
posted @ 2012-10-11 15:30 grep 阅读(166) 评论(0) 推荐(0) 编辑

服务器并发处理能力

摘要: 吞吐率 (throughput) 单位时间内服务器处理的请求数apache mod_status 提供的统计数据 35.1requests/sec我们更加关心的是服务器并发处理能力的上限 即最大吞吐率我们普遍采用压力测试的方法,通过模拟足够数量的并发用户数,分别持续发送一定数量的HTTP请求,并统计测试持续的总时间,计算出这种压力下的吞吐率,即为一个平均计算值.Web服务器并发能力强弱的关键便在于如何针对不同的请求性质来设计最优并发策略.从微观层面来看,1个用户向服务器连续进行1000次请求的过程中,任何时刻服务器的网卡接收缓冲区中只有一个来自该用户的请求,而100个用户同时向服务器分别进行1 阅读全文
posted @ 2012-10-10 10:34 grep 阅读(2089) 评论(0) 推荐(0) 编辑

struts2

摘要: mvc:request-->servlet(based on mapping)-->javabean-->forward to jsp-->response配置struts2 --web.xml<web-app><filter><filter-name>struts2</filter-name><filter-class>org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter</filter-class><fi 阅读全文
posted @ 2012-09-21 09:25 grep 阅读(264) 评论(0) 推荐(0) 编辑

jsp/servlet

摘要: _jspServiceinit/destory/servicejsp注释 <%--xxx--%>jsp声明 <%! 声明部分 %> 不能声明abstract method,否则就导致servlet变成abstract 而无法实例化jsp表达式 <%=表达式%>jsp脚本 <%脚本%><%for (int i=0;i<10;i++){%><tr><td>值</td><td><%=i%></td></tr><%}%>==>_jspS 阅读全文
posted @ 2012-09-19 14:34 grep 阅读(362) 评论(0) 推荐(0) 编辑

SSH 1

摘要: SSHpresentation layer: jsp, velocity,freemaker,tapestrymvc controller layer: core controller,dispatch, user controller,biz core component: 1, 逻辑上是一个整体 一般是一个事务. 2, 业务逻辑中不应该有数据库的访问 不应该出现Hibernate,JDBC API.DAO: CRUD, Interface + implementation 解耦不同的数据源DO: sync with databaseWEB 服务器Tomcat/Jetty/Resin框架st 阅读全文
posted @ 2012-09-19 10:43 grep 阅读(323) 评论(0) 推荐(0) 编辑

"oneline" algorithm

摘要: kthdef partition(seq): pi,seq=seq[0],seq[1:] lo = [ x for x in seq if x <=pi] hi = [ x for x in seq if x>pi] return lo,pi,hidef select(seq,k): lo,pi,hi=partition(seq) m = len(lo) if m ==k: return pi elif m<k: return select(hi,k-m-1) else : return select(lo,k)kthOF2def kth... 阅读全文
posted @ 2012-09-06 09:30 grep 阅读(233) 评论(0) 推荐(0) 编辑

function in python

摘要: *args, **kwargsfilter(None,['','Simon','Danny'])def f1(x): if x>5: return True else: return Falsefilterseq=range(0,10)filter(f1,seq)closure: namespacedef foo(): x=1 def bar(): print (x) bar()sort with inline function lambdax=['ab','aab','czq']x.sort 阅读全文
posted @ 2012-08-24 20:33 grep 阅读(202) 评论(0) 推荐(0) 编辑

Common Examples of Asymptotic Running Times

摘要: ComplexityNameExamples, CommentsΘ(1)ConstantHash table lookup and modificationΘ(lgn)logarithmicBinary SearchΘ(n)Lineariterating over a listΘ(nlgn)LogLinearOptimal sorting of arbitrary valuesΘ(n2)QuadraticComparing n objects to each other( all against all)Θ(n3)CubicFloyd and Warshall's algorithms 阅读全文
posted @ 2012-08-18 09:42 grep 阅读(164) 评论(0) 推荐(0) 编辑

Induction and Recursion and Reduction

摘要: Where is the reduction? important as in dynamic programming, what is the dynamic function?There are two major variations of reductions: reducing to a different problem or reducing to a shrunken version of the same.Puzzler solutiondef cover(board,lab=1,top=0,left=0,size=None): if size is None: siz... 阅读全文
posted @ 2012-08-17 13:49 grep 阅读(287) 评论(0) 推荐(0) 编辑

Python Algorithms

摘要: A Tale of two tournamentsAlthough there are many types of tournaments, let's consider two rather common ones, with rather catchy names.These are the round-robin tournament and the knockout tournament.In a round-robin tournament(or, specifically, a single round-robin tournament), each contestant 阅读全文
posted @ 2012-08-16 09:26 grep 阅读(769) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 ··· 10 下一页