O(n)时间复杂度,平移数组中部分连续元素
摘自:http://leili.iteye.com/blog/1580466
用jdk1.6自带的JVisualVM版本好像比较低,最好用比较新的,比如我用过1.3.1 2. to profile a remote app such as in a remote linux machine, we need to start JMX port in remote app as this way java -Dcom.sun.management.jmxremote.port=3333 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false YourJavaApp 3. in jvisualVM client, 在 “远程” 节点下添加 远程主机名或者ip地址(不需要提供port) 在远程节点下将出现新添加的子节点。在子节点下可以继续添加“JMX”节点,提供远程主机的ip:port即可, port就是我们上面定义的3333 4.双击即可打开,在sampler tab可mornitor CPU运行时间基于方法,类,或者包名。从中可以发现那个所占CPU的比例高,再从中发现性能瓶颈。 5. 可以save snapshot方便事后分析,很有用。方便team一块分析,共享。
inverse在one-to-many和many-to-many中 inverse 默认值是false 根据hibernate reference所说: the non-inverse side is used to save the in-memory representation to the database. The non-inverse side即 inverse=false的那一端。一般one-to-many关系one端设置成inverse=true,也即由多方维护关系。一个好处是不会因为一方一次修改,多方所有相关记录都要更新;many-to-many关系可以任选一端设置成inverse=true. 2. unsaved-value null, any,none 主要是cascade insert/update时,判断对象链上的隐含对象是插入还是更新到数据库。一般pojo主键是对象时新建默认是null,这时进行插入;否则该pojo就是从数据库中load出来的pojo,需要进行更新。 关于none和any的设置不是很清楚。
我们知道流行的AJAX库帮我们解决了跨浏览器的DOM 查询,DOM操作,CSS操作,AJAX调用等问题。不知以下两个问题是怎么解决的: 1. 浏览器的back & forward问题,浏览器能记住在各个点上的AJAX操作吗? 2. 并发问题。因为AJAX应用的重要场景是异步调用。假如一个HTML页面上同时产生了两个AJAX调用Invoke1 和 Invoke2。它们的回调函数操作了同一个DOM对象。Invoke1首先调用,其次Invoke2。但是Invoke2首先执行完成返回到浏览器更新DOM对象,再接着是Invoke1返回覆盖了Invoke2更新过的DOM对象。也就是Invoke2的结果丢失了。 不知道目前兄弟们是怎么解决这两个问题的。 :)
读写分离 一个主数据库负责写,多个从数据库负责读。主数据库数据单向同步到从数据库。
AJAX Same-Origin Policy(SOP) limitation
摘自:http://community.jboss.org/wiki/OpenSessioninView
Collection of handy online tools for developers, with great UX.
The "REST With Spring" Course:
A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
just for study, from internet.
A minimal Jekyll Theme to host your resume (CV) on GitHub with a few clicks.