Category Archives: 程式語言

[HBase] security issue

error message: com.a.b.c.exception.BaseDAOException: org.apache.hadoop.hbase.security.AccessDeniedException: org.apache.hadoop.hbase.security.AccessDeniedException: Insufficient permissions for user ‘Cowman’ (table=ABC, action=READ) in jvm conf. add “-DHADOOP_USER_NAME=webuser”

Posted in HBase, Java | Leave a comment

[HBase] convert long value to bytes

Java code:

HBase shell command:

Posted in HBase, Java | Leave a comment

[Python] fix error while loading shared libraries: libpython2.7.so.1.0

error log: /opt/rh/python27/root/usr/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory check libpython2.7.so.1.0 exist? find . -name ‘libpython2.7.so.1.0’ if the file was exist: edit the ldconfig config echo “/opt/rh/python27/root/usr/lib64” > /etc/ld.so.conf.d/python27.conf ldconfig … Continue reading

Posted in CentOS, Python | Leave a comment

[Shelll Script] check tomcat status

!/bin/bash tomcat7=$(ps -ef | grep tomcat | wc -l) echo ${#tomcat7} if [ ${#tomcat7} -gt 0 ]; then printf “tomcat is running\n” else printf “tomcat is not running\n” fi

Posted in Linux, Shell Script, Tomcat | Leave a comment

[JavaScript] cannot call methods on [Object] prior to initialization; attempted to call method ‘refresh’

try to force initialize the object first. stackOverflow: selectmenu (‘refresh’, true)

Posted in JavaScript | Leave a comment

[Windows Bash Script] convert csv to html table

source: How to find and replace a string in text file using batch file just replace “,” with html table tag.

Posted in Windows Bash Script | 1 Comment

[Java] Convert Hex to String

stackoverflow: Convert a string representation of a hex dump to a byte array using Java?

Posted in Java | Leave a comment

[Jersey] disable decode the URL path

use annotation “@Encoded” Ex:

Posted in Java | Leave a comment

open external program from java for mac os x

Posted in Java, Mac, Office | Leave a comment

Gson usage : formJson

avoid to face the exception ‘java.lang.ClassCastException With com.google.gson.internal.LinkedTreeMap cannot be cast to…’, we use the TypeToken to convert json to List

Posted in Java | Leave a comment