-
Config support utf-8 with url on Tomcat
In server.xml, find and edit like below:
<Connector URIEncoding=”UTF-8” connectionTimeout=”20000” port=”8080” protocol=”HTTP/1.1” redirectPort=”8443”/>
-
When type characters by Japanese Keyboard on textarea, won’t trigger keyup event, but we can use keydown event.
-
Limit length in texarea
When limit length in textarea, browser calculate that string by characters, so a new line character is counted by 1. But in some OSes, a new line is “\r\n”, if in db you limit characters, you need remove “\r” before save.
-
Spring Roo
To avoid Java heap space error,
+when select a huge of rows, we should be get by parts then add them to list
+when return response to client, we should write data in many times
-
Java indexOf method for multiple matches
i = str.indexOf('x');
while(i >= 0) {
System.out.println(i);
i = str.indexOf('x', i+1);
} -
Yii - “Warning: date()”
Edit php.ini, change to date.timezone = "Asia/Ho_Chi_Minh"
-
CentOS
1. Install HTTP server
yum install httpd httpd-devel
/etc/init.d/httpd start
2. Install MySQL
yum install mysql mysql-server mysql-devel
/etc/init.d/mysqld start mysql
3. Install PHP
yum install php php-mysql php-common php-gd php-mbstring php-mcrypt php-devel php-xml
/etc/init.d/httpd restart
4. Open port 80
iptables -I INPUT -i eth1 -p tcp -m tcp —dport 80 -j ACCEPT
service iptables save
5. Install zip, unzip
yum install zip unzip
6. Install gcc, g++, make
yum install gcc-c++
yum install make
-
Jquery trigger click
$(‘a#swaswararedirectlink’)[0].click();
-
Half- And Full-width Characters In CJK (and normalization)
Latin Characters in half-width and full-width: Asia AsiaKatakana in half-width and full-width: アジア アジアJava Normalizing Text (recommend NKFC): http://docs.oracle.com/javase/tutorial/i18n/text/normalizerapi.htmlNormalizing Example: http://ideone.com/7iAIdNormalizing Algorithm: http://nlp.solutions.asia/?p=39 or see below: -
MySQL sum() return NULL if there were no matching rows
Returns the sum of
expr. If the return set has no rows,SUM()returnsNULL. TheDISTINCTkeyword can be used to sum only the distinct values ofexpr.SUM()returnsNULLif there were no matching rows.