View angular.md
Angular と私
もはや5年くらい前の話です。
新しいプロダクトを作るという事になり、フロントエンドフレームワークに Angular を選択しました。
当時、React も候補にありましたが、Angular を選択しました。
理由としましては、みんなもう忘れているかもしれませんが React にはライセンス的な問題がありました。
google.co.jp/search?q=react+ライセンス+問題
そして、Angular 自体が TypeScript で作られていたためです。
そして現在、Angular の話が出ることが少なくなってきたような気がします。
View hello.txt
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
hello |
View java-lambda-check-exception.md
Java の lambda 内のチェック例外のウザさをなんとかする
Java の Stream API などを使っていると、lambda 内のチェック例外がうざいです。
例えば、次のようなコードは、コンパイルエラーになります。
Stream.of("http://example.com").map(string -> {
return new URL(string); // MalformedURLException を throw する可能性があるのでコンパイルエラー
});
View md-slide-example.md
Title
Aaa
Bbb
View raw-string-literals-4.md
sql 要素に SQL の取得元を enum で指定する案
Raw String Literals に対応した場合、SQL取得は内部文字列、外部ファイル、自動生成の3モードとなる。
sql
要素に enum で STRING
, FILE
, AUTO
の3モードいずれかを指定するようにする。デフォルトは、STRING
Select の場合
SQLはアノテーションから読む
@Select(sql = STRING, value = `select * from emp`)
View localStrage-set-map.ts
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
function stringify(map: Set<any> | Map<any, any>) { | |
return JSON.stringify(Array.from(map)); | |
} | |
function newSet<T>(text: string): Set<T> { | |
return new Set<T>(JSON.parse(text)); | |
} | |
function newMap<K, V>(text: string) { | |
return new Map<K, V>(JSON.parse(text)); |
View gist:8004877
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
package hello; | |
import javax.sql.DataSource; | |
import jp.sf.amateras.mirage.SqlManager; | |
import jp.sf.amateras.mirage.SqlManagerImpl; | |
import jp.sf.amateras.mirage.dialect.HyperSQLDialect; | |
import jp.sf.amateras.mirage.integration.spring.SpringConnectionProvider; | |
import org.apache.commons.dbcp.BasicDataSource; |
View gist:7484281
h2database tips
SQLスクリプトの実行
h2database でコマンドラインからスクリプトファイルの実行例。 エラーになったSQLで処理が中止され、次のSQLは実行されない。
java org.h2.tools.RunScript -url jdbc:h2:~/test -driver org.h2.Driver -user sa -password sa -script ~/script.sql