Skip to content

Instantly share code, notes, and snippets.

我重新組織了一個範例。先假設沒有什麼權限或dependency的問題。先說我是用Java 8,我不知道後面版本的泛型推導有沒有變得比較智能:""(((

class Framework {
    public static <T, F extends Factory<T>> T resolve(Class<F> clazz) {
        try {
            return clazz.newInstance().getInstance();
        } catch (Exception e) {
            return null;
        }
    }
<property name="myconfig.area1.field1" value="123"/>
<property name="myconfig.area2.field1" value="456"/>
@lmr3796
lmr3796 / xorg.conf
Created February 24, 2019 21:41
For no NVIDIA
Section "Device"
Identifier "Intel Graphics"
BusId "PCI:0:2:0"
Driver "modesetting"
Option "AccelMethod" "glamor"
Option "DRI" "3"
EndSection
Section "Screen"
Identifier "intel"
@lmr3796
lmr3796 / .bashrc
Created March 23, 2016 07:33
To show some branch info
export EDITOR=vim
source $HOME/.git-prompt.sh
export GIT_PS1_SHOWDIRTYSTATE=1
export GIT_PS1_SHOWUPSTREAM="auto"
export GIT_PS1_SHOWCOLORHINTS="auto"
export GIT_PS1_SHOWSTASHSTATE="true"
export PS1=$PS1'\[\033[1;37m\]\w\[\033[0;33m\]$(__git_ps1 " (%s)") \[\033[0;37m\]\$\[\033[00m\] '