2015-08-01から1ヶ月間の記事一覧

テーブル th, td 幅調整

IE11 th と td は 2 つで 1 つ workspace | |--- index.html |--- main.css index.html <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </meta></head></html>

IE で要素を消す visibility: none ではなく display: none

CSS

alternative to visibility:collapse not working on IE and Chromestackoverflow.com

IE

マルチヘッダ (multi th)(1 つの th 内に要素を多数設置して線区切り) の構築

表題通り mac-safari 8.0.7 アウトプットイメージは下 workspace | |--- index.html |--- main.css index.html <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </meta></head></html>

div 内の button を centering して left と right に交互へ並べる

mac-safari workspace | |-- index.html |-- main.css index.html <html lang="ja"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </meta></head></html>

JUnit 4 > org.junit.rules.ExpectedException のアクセス修飾子は public

表題通りそのままです OK @Rule public final ExpectedException exception = ExpectedException.none(); NG @Rule protected final ExpectedException exception = ExpectedException.none(); @Rule private final ExpectedException exception = ExpectedE…

IntelliJ にて Maven プロジェクトを作成し JUnit を dependency する場合の雛形 pom.xml

pom.xml でうまくいかんかったんで source value 1.5 is obsolete 問題(?) なんてのがあるらしく build > plugins > plugin > configuration の source, target を 明示的に利用 JDK の ver (${java.version} ではなく固定値) にしないと 「JDK 1.5 使ってま…

unmodifiable な Map を作成する

こういうの欲しかったので...書き残し 記事 java.util.Collections.unmodifiableMap() Method Examplewww.tutorialspoint.com 引用ソースコードと実行結果 import java.util.*; public class CollectionsDemo { public static void main(String[] s) { //obj…

内部クラス(public) に在るインスタンスメソッドを使う方法

$SOME_DIR/src/Main.java 1 import myutil.ExternalClass; 2 3 public class Main { 4 public static void main(String... args) { 5 ExternalClass externalClass = new ExternalClass(); 6 ExternalClass.SubClass subClass = externalClass.new SubClass(…

for-each の骨組み作っただけで Required Found のコンパイルエラー出た時

ループ変数、ループされる変数 のクラスに食い違いがないか確かめる ———————— 自戒用に書き残し import java.util.List; import org.apache.commons.beanutils.DynaBean; public class Test { public void testMethod(List<DynaBean> resource) { for(List<DynaBean> list : reso</dynabean></dynabean>…

catch 句での Throwable と Exception 違い

Throwable は JVM レベルでの Serious Error を catch する時に使う Exception より高階層な API Exception はアプリケーションレベルでの例外を catch する時に使う Throwable より低階層な API app 構築に当たるならこちらを使うべき Throwable Throwable …

try and re-throw best practice

quoted literal and source code from: IBM Best Practice: Catching and re-throwing Java Exceptions - United States re-throw is ok notice the way to re-throw Correct The correct way to catch and re-throw an exception is to pass the caught exc…

build.sbt の libraryDependencies には何を追加すればよいか

何をどのように追加すればよいか分からなかったので Maven Repository: Search/Browse/Explore に遷移 ヘッダー(?) の検索フォームにライブラリ名を入れる(ここでは postgresql とする) 結果一覧が表示されるので適当なライブラリを選択する(PostgreSQL JDBC…

JDBC Statement と PreparedStatement 使い分け

Statement 単純な実行計画を行いたい時(select * from ... を 1 回だけ など) PreparedStatement 複数回に渡る実行計画を行いたい時, ? のパラメーター解析を使いたい時(2 番目記事参照) JDBC - Statements, PreparedStatement and CallableStatementwww.tut…

connection pool

DB

基本的に、connection は開いたら閉じる 門外不出のOracle現場ワザ 第5章

static method (class method) と instance method の使い分け

Java に関わった話ではないと思い One rule-of-thumb: ask yourself "does it make sense to call this method, even if no Obj has been constructed yet?" If so, it should definitely be static. Java: when to use static methodsstackoverflow.com

static import は控えよ

参考記事 1. に直面したので、書き残し You have an outright naming conflict between java.awt.Event and com.mycompany.calendar.Event, and so you can't even compile. Why is using a wild card with a Java import statement bad?stackoverflow.com

PostgreSQL と Play Framwork を JDBC で連携接続する

環境 MacOSX 10.10.4 JDK 1.8.0_45 Play Framwork 2.4.2(Damiya) 前提 PlayFramework 初期状態から画面構築 に基づいて app 構築している PostgreSQL 構築 (brew だと、createuser 上手くいかんかったんでこっちで... brew はまた別途...) Postgres.app 公式…

sqlite-jdbc を使って Java から sqlite を操作する

ほとんど公式の Usage 通りです... 環境 MacOSX(Yosemite) 10.10.4 Java 1.8.0_45 sqlite3 3.8.5 sqlite DB を準備する $ mkdir ~/Develop $ touch ~/Develop/development.sqlite3 sqlite-jdbc を準備する ダウンロードページから適当な jar を取ってくる(最…

Play framework(Java) で initialize, routing, view 作成, controller 作成して画面表示まで

大前提 MacOSX(Yosemite) 10.10.4 Java 1.8.0_45 Play Framework 2.4.2 "Damiya" activator-1.3.5-minimal 公式サイトの [Download "Damiya"]を直接押下 initialize $ cd activator-1.3.5-minimal/ $ ./activator new Browse the list of templates: http://…

String と StringBuilder の使い分け

メモリ利用量 パフォーマンス が気になる時に切り分け 延々mallocとかもう... http://stackoverflow.com/a/4645155

Postfix 550 5.1.1 Recipient address rejected

Postfix error > 550 5.1.1 Recipient address rejected にて...気になった記事を留め書き Server refuses mail with 550 5.1.1 : Recipient address rejected: User unknown ...www.linuxquestions.org

netstat の アスター

= 未確要素 or ワイルドカード man の読込み大事(自戒) Unspecified, or ``wildcard'', addresses and ports appear as ``*''. What does the asterisk in the netstat output mean? | Ubuntu QAubuntuqa.com

Postfix では「知らないローカルユーザーのメール受信」を拒否する

査読中 リンク先参照 Rejecting Unknown Local Recipients with Postfix Postfix で知らないローカルユーザを拒否する

Mac コマンドラインでユーザーのデフォルトシェルを変更する(要 root pass)

Mac

COMMAND $ sudo chsh -s SHELL user_name_you_want_to_change_default_shell EX. $ sudo chsh -s /sbin/nologin testuser /sbin/nologin を指定するので、testuser では switch user で login できない $ su - testuser This account is currently not avail…

Mac で useradd したい時

Mac

mac に useradd ないんですね... osx で useradd, groupadd - 呆備録d.hatena.ne.jp