This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// エラーのスタックトレースを表示 | |
StringWriter sw = new StringWriter(); | |
PrintWriter pw = new PrintWriter(sw); | |
e.printStackTrace(pw); | |
pw.flush(); | |
String str = sw.toString(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// yyyy/MM/dd | |
DateFormat format = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.getDefault()); | |
// yyyy/MM/dd hh:mm:ss | |
DateFormat format = DateFormat.getDateTimeInstance(DateFormat.MEDIUM, DateFormat.MEDIUM, Locale.getDefault()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.HashMap; | |
import java.util.Map; | |
public class Test | |
{ | |
private Map<Class<?>, Object> contents = new HashMap<Class<?>, Object>(); | |
private <T> T getContent(Class<T> type){ | |
return type.cast(contents.get(type)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var add = function (a, b) { | |
return a + b; | |
}; | |
var array = [3, 4]; | |
// first argument is "this"、second is parameters. | |
var sum = add.apply(null, array); //sum is 7 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" カレントディレクトリ設定 | |
cd C:\Users\username | |
"Windowsクリップボードの共有 | |
set clipboard=unnamed | |
"Tabのスペース数 | |
set tabstop=2 | |
"行数表示 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"--------------------------------------------------------------------------- | |
" カラー設定: | |
"colorscheme morning | |
colorscheme wombat | |
" Copyright (C) 2011 KaoriYa/MURAOKA Taro | |
"独自に見た目を設定 | |
set guioptions-=T " ツールバーを非表示 | |
"set lines=90 columns=200 " 全画面表示起動したい方はコメントアウトを戻す | |
gui |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Command + j or k で行を移動する | |
nnoremap <D-j> :m+<CR>== | |
nnoremap <D-k> :m-2<CR>== | |
inoremap <D-j> <Esc>:m+<CR>==gi | |
inoremap <D-k> <Esc>:m-2<CR>==gi | |
vnoremap <D-j> :m'>+<CR>gv=gv | |
vnoremap <D-k> :m-2<CR>gv=gv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Unicode文字列に変換する("あ" -> "\u3042") | |
* @param original | |
* @return | |
*/ | |
private static String convertToUnicode(String original) | |
{ | |
StringBuilder sb = new StringBuilder(); | |
for (int i = 0; i < original.length(); i++) { | |
sb.append(String.format("\\u%04X", Character.codePointAt(original, i))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ $JAVA_HOME\bin\jps | |
5486 Jps | |
14691 jar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$pre_array_object = (array)$original_object; | |
$array_object = array(); | |
foreach ($pre_array_object as $key => $value) { | |
$splited_key = preg_split("/[\\x0]/", $key); // 配列化すると"\u0000クラス名\u0000キー名"となるため処理 | |
$array_object[$splited_key[2]] = $value; | |
} |
OlderNewer