2015年2月10日 星期二

[Java] Get Class Name

Class<?> enclosingClass = getClass().getEnclosingClass();
if (enclosingClass != null) {
  System.out.println(enclosingClass.getName()); // the declaring class name
} else {
  System.out.println(getClass().getName()); // this class is anonymous
}

Or,

String className = this.getClass().getSimpleName(); // if this is not 
//an anonymous class, else return ""

http://stackoverflow.com/questions/6271417/java-get-the-current-class-name

[jQuery] Select More than One Element by Index Using .eq()

e.g

$('td', row).eq(0).addClass('strong text-info');
$('td', row).eq(1).addClass('strong text-info');

To combine the above as one line, add a jQuery plugin through (place anywhere in $(document).ready before using):
$.fn.eqAnyOf = function (arrayOfIndexes) {
    return this.filter(function(i) {
        return $.inArray(i, arrayOfIndexes) > -1;
    });
};
Then use the below codes:

$('td', row).eqAnyOf([0,1]).addClass('strong text-info');

http://tiku.io/questions/581385/use-jquery-to-select-multiple-elements-with-eq

[Wacom MovinkPad Pro 14] 選擇入手Wacom MovinkPad Pro 14的原因剖析

需求 一直都好想買一部屬於自己嘅tablet,需求是想有支筆可以用,但茫茫產品中,就喺點都落唔到手。 曾經物色過 Huion Note E ,原因是它的屏幕如紙的質感,有書寫的感覺(就喺想有支筆可以畫嘢),但喺,當決定買嘅時候,先發現……官網預購不寄香港,不想麻煩的我,唯有放棄。...