- 博客(77)
- 收藏
- 关注
原创 Simple tool to monitor jvm memory usage and garbage collection
JDK has built-in tool to monitor jvm memory usage: jstatThis is a command line tool, which runs like:$ jstat -gc 17707 5000where, -gc is the option, 17707 is process ID of the jvm process, 5000 ...
2016-10-13 06:06:12 171
原创 正确理解 output of linux command free
linux command free is used to show the RAM usage of the system. Below is an example output of the command: $ free -m total used free shared buffers ...
2016-10-04 08:46:34 229
为什么说软件编程是一碗青春饭?
常听人说,软件编程是碗青春饭,现在倒是信了。 主要原因是这个行业需要不断学习,知识与技能更新要求比较高,比较频繁。在一两轮更新之后,老的开发人员要么走上了管理岗位,要么就失去了工作的热情。 本人是属于后者,对软件开发的热情逐渐燃尽了。为什么?因为我发现,这些所谓的技能更新,并没有革命性的意义,不过是根据个人喜好重新造轮子而已。 譬如现在流行的 RESTful,十几年前...
2015-07-23 07:21:01 1025
原创 unit test 是软件开发业界的强迫症
Unit tests helped me find bugs about 3 times in my whole career.--what a waste of time ... and energy, especially when you think about "continuous integration" and the bullshit unit tests get run ...
2015-06-11 12:59:47 155
原创 软件开发的单元测试要有选择性
软件开发的单元测试是IT业界的新宗教,尤其对于软件开发人员。 但是软件开发的单元测试是不是一必需的呢?对于算法及通用的库类,单元测试可能是需要的。但你为什么要测试SpringMVC Controllers呢? 单元测试保守估计,可能普遍要占到开发时间的20%以上,这还不算build/release所耗费的时间。但有多少问题是通过单元测试来发现的呢?太少了,个人经验几乎为零。...
2015-01-23 09:24:36 119
软件开发的最终目标将会是什么?
当人们忙于一件事的时候,就想把它干完,但却往往忘记了最初为什么要干这件事。就像有些单元测试,甚至比原代码更复杂,更难读,更难维护。然而又有多少问题是通过单元测试发现的呢?很少。那么单元测试的目的是什么,你为什么要写单元测试,尤其是为什么要写那么复杂的单元测试? 计算机,最初就如同它的名字,只是个高级计算器而已。我们开发软件,最初的目的,可能也只是自动化一些业务处理而已。然而今天软件...
2014-09-02 07:48:18 1196 1
原创 Tomcat 7: set external folder to tomcat class path
If you need to set an external folder to Tomcat, you can do that in "setclasspath.bat" (windows). At the end of this file, change the last few lines to the following: :endset CLASSPATH=%CLASSP...
2014-08-20 11:02:58 88
原创 Tomcat7: setenv.bat to set memory and enable debugging
You can create a file "setenv.bat" (windows) for Tomcat 7 to pickup on startup to configure memory size and enable debugging etc. File path should be Tomcat7_installation_dir/bin/setenv.bat Its ...
2014-08-20 10:49:40 150
原创 Node.js - a new platform for web development
Node.js is a new platform for web application developement. It's JavaScript on the server side, running on Google's V8 JavaScript runtime. It's event driven and employs call back method to achieve n...
2014-06-18 05:29:43 115
原创 JPA native query does not support setting list parameters
you might want to do the following highlighted code as: whereClause.append("f.id IN (:fleetIdsList)"); ..... query.setParameter("fleetIdsList", fleetIdsList); B...
2014-03-27 06:45:54 189
原创 PostgreSQL internal variable ON_ERROR_STOP
PostgreSQL internal variable ON_ERROR_STOP defaults to 0 for interactive common execution, such as the client program psql. So if you execute multiple statements in a script, if an earlier state...
2013-11-22 06:59:36 800
Owning Side and Inverse Side of JPA entity relationships
Entity relationships may be bidirectional or unidirectional. A bidirectional relationship has both an owningside and an inverse side. A unidirectional relationship has only an owning side. The own...
2013-09-10 07:08:02 162
avoid setParameter for "order by" in JPQL
you might want to create a JPQL like this:String sql = "select distinct s from Student s order by :orderByColumn asc"Query query = em.createQuery(sql);query.setParameter("orderByColumn", "name...
2013-03-07 05:55:48 141
原创 Glassfish and Netbeans headaches
lots. for instance the first time you deploy something, it seems not working at all, u need to repeat for couple of times. for instance, the Glassfish 3.1.2 app server cannot login properly ...
2013-03-01 10:57:04 99
A good tutorial about distributed version control system Mecurial
http://hginit.com
2013-02-03 09:23:01 91
JPA Path Expression, operator IN and Collection properties
If we want to select the Orders whose price is greate than 100, we can use this JPQL query: select o from Order o where o.price > 100Here "o.price" is used to refer to the property "price" ...
2013-01-23 16:25:29 552
与JEE6/EJB3.1相比, Spring framework 丧失了几乎所有的优势
The Spring framework was a major competitor against the ejb technologies. But with EJB3.0/3.1 picked up all the good things, such as Dependecy Injection, Configuration Over Convention etc, Spring no...
2013-01-19 13:13:54 168
Simple EasyMock tutorial
http://veerasundar.com/blog/2012/06/easymock-tutorial-getting-started/ EasyMock doc:http://www.easymock.org/EasyMock3_0_Documentation.html
2012-12-20 11:57:29 87
Cloud Computing and SaaS
Cloud computing is the use of computing resources (hardware and software) that are delivered as a service over a network (typically the Internet). Software as a Service (SaaS), sometimes refer...
2012-12-19 07:00:11 158
JAX-RS Jersey lite tutorial
http://www.vogella.com/articles/REST/article.html
2012-12-18 12:08:32 83
Jasper reports primer
1. You have two ways to use Jasper reports, one is to download and installe the Jaser Server and use it. It'll install Tomcat and by default PostgreSql, and an web application for managing your report...
2012-12-11 04:46:07 111
原创 iReport 5 does not work with ojdbc6.jar
一哥们先离职了,本人开始了擦屁股工程。可擦完了俺也要开路,到处是讨债的。 Since iReport5 does not support Oracle by default, you need to add Oracle's jdbc driver to iReport's classpath. This can be done by several ways, easiest w...
2012-12-07 15:31:40 109
Servlet 3.0 @WebFilter and @WebServlet
Servlet 3.0 provides new annotation @WebFilter to simplify the configuration of a servlet filter. Here's a simple example and the filter will be invoked with url pattern "/student/*": package c...
2012-12-04 07:09:58 85
Why JSF2 @ViewScoped not working?
javax.faces.bean.ViewScoped said as long as you stay on the same view/page, the backing bean should be the same. This is useful if you want to retain some state of the backing bean, whilst avoid cachi...
2012-12-03 06:55:21 152
When to configure an XA datasource?
If you ever came across this warning message from JBoss, you might wonder what's wrong:[b]WARN [TxConnectionManager] Prepare called on a local tx. Use of local transactions on a jta transaction wi...
2012-11-16 12:58:33 171
java ee transaction and datasource concepts
1. What is a transaction?A transaction groups units of work and save the them all at once, or at any failure, roll back all the changes.2. What are the features of a transaction?ACID: Atomicit...
2012-11-10 13:48:27 103
原创 Something about Agile Software Developement
An interesting comment about Agile / 敏捷开发:The first thing I do when screening a job description online is to do a text search for the word "agile". If that word or any related term appears anywhe...
2012-10-29 13:03:12 141
原创 Use Oracle DBCA silent mode to create new database from template
### command line to use Oracle DBCA (-silent) to create a new dabase, using a NoSeed template### 1. replace "SIDofNewDb" with the "SID" for your new database### 2. you can edit the template to ...
2012-10-12 12:23:51 232
manually drop and delete an Oracle database
Using DBCA command line to delete a database is quite simple:dbca -silent -deleteDatabase -sourceDB dbSID2deleteThe following describes MANUALLY delete a database:Refrence:Search "Orac...
2012-10-06 19:43:55 111
cold back up an oracle database
Refrence:search "Oracle DBA Justin - How to backup an 11g Oracle database cold" on YouTubehttp://www.youtube.com/watch?v=iH0E-g9qj90&feature=relmfu"Cold Backup" means to shutdown the Oracle ...
2012-10-06 19:23:28 93
manually create a new oracle database
using [b]dbca[/b] to create a database is preferred approach:http://docs.oracle.com/cd/B28359_01/server.111/b28310/create002.htmThe following describes MANUALLY creating a new oracle database:...
2012-10-06 18:25:05 101
Start/shutdown oracle
## set the database to logonexport ORACLE_SID=mydb## conect sqlplus to the target databasesqlplus / as sysdba## make sure connected to the correct databaseSQL>show user;user is "SYS"SQ...
2012-10-06 16:26:47 122
pass params to primefaces confirmation dialog box
<p:dataTable id="idStuDataTable" var="vst" value="#{ss.searchResultList}" >......<p:column><p:commandLink id="idDeleteButton" title="Delete Student" value="de
2012-09-28 19:30:27 99
disable browser back button after logout
<h:head> <title> <ui:insert name="title">Title</ui:insert> </title> <meta http-equiv="CACHE-CONTROL" content="NO-CACHE"/> &
2012-09-28 10:10:43 80
Handle Big Dataset with Real Pagination with Primefaces 3.3 LazyDataModel
If you have millions of records in your database, you would like to use real pagination to provide viewing of the data. By "real" (or true or proper, whatever) pagination, it means that the searching...
2012-09-21 13:41:40 200
why Oracle sequence not working with JPA entity ID?
Suppose you have an Oracle sequence defined as following: CREATE SEQUENCE BILLING.SEQ_ACTVID START WITH 300060 INCREMENT BY 1 NOMINVALUE NOMAXVALUE NOCYCLE NOORDER CACHE 20; ...
2012-09-19 08:08:18 80
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人