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
InputStream in = null; | |
try { | |
in = new FileInputStream("test.txt"); | |
// stream操作 | |
} catch (IOException e) { | |
// error処理 | |
} finally { | |
try { // 必要に応じて | |
if (in != null) { | |
in.close(); |
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 learning.client.cassandra | |
import org.apache.cassandra.thrift.Cassandra | |
import org.apache.cassandra.thrift.Column | |
import org.apache.cassandra.thrift.ColumnParent | |
import org.apache.cassandra.thrift.ConsistencyLevel | |
import org.apache.thrift.protocol.TBinaryProtocol | |
import org.apache.thrift.transport.TFramedTransport | |
import org.apache.thrift.transport.TSocket | |
import java.nio.ByteBuffer |
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
// Option型(Optionモナド)を返す側 | |
public class Configuration { | |
public Option<String> get(String key) { | |
final String value = System.getProperty(key); | |
if (value == null) { | |
return new None<String>(); | |
} else { | |
return new Some<String>(value); | |
} | |
} |
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
sudo apt-get install xserver-xorg xvfb | |
sudo mount /dev/cdrom /media/cdrom | |
cd /media/cdrom | |
sudo sh VBoxLinuxAdditions.run |
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
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults\tenv_keep="SSH_AUTH_SOCK"' /etc/sudoers | |
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults:vagrant !requiretty' /etc/sudoers | |
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers | |
sudo sed -i -e '/%sudo\s\ALL=(ALL:ALL) ALL/a %vagrant ALL=(ALL) NOPASSWD: ALL' /etc/sudoers |
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 com.github.poad.example.selenium; | |
import org.junit.After; | |
import org.junit.Assert; | |
import org.junit.Before; | |
import org.junit.Test; | |
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebDriver; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.firefox.FirefoxDriver; |
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
# less コマンド等のエラー回避 | |
export TERM=msys | |
# lsで日本語を表示する | |
alias ls='ls --color=auto --show-control-chars' | |
alias ll='ls -l' | |
alias l='ls -CF' | |
# gettext用 | |
export OUTPUT_CHARSET=UTF-8 |
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
brew upgrade | |
brew install fuse4x | |
brew install ntfs-3g | |
sudo mv /sbin/mount_ntfs /sbin/mount_ntfs.orig | |
sudo ln -s /usr/local/Cellar/ntfs-3g/2014.2.15/sbin/mount_ntfs /sbin/mount_ntfs | |
sudo /bin/cp -RfX /usr/local/opt/osxfuse/Library/Filesystems/osxfusefs.fs /Library/Filesystems | |
sudo chmod +s /Library/Filesystems/osxfusefs.fs/Support/load_osxfusefs |
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
@MockClass(realClass=Hoge.class) // MockClassアノテーション廃止されてるせいで、コンパイラーさんがOKOKO | |
public class HogeMock { | |
} |
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
sudo aptitude update | |
sudo aptitude full-upgrade |
OlderNewer