Skip to content

Instantly share code, notes, and snippets.

donchan922 donchan922

Block or report user

Report or block donchan922

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View DemoApplication.java
public class DemoApplication {
public static void main(String[] args) throws IOException {
CsvMapper mapper = new CsvMapper();
// ヘッダあり、タブ区切り
CsvSchema schema = mapper.schemaFor(User.class).withHeader().withColumnSeparator('\t');
Path path = Paths.get("TSVファイルのパス");
try (BufferedReader br = Files.newBufferedReader(path)) {
View no_header_tsv
001 Alice 18
002 Bob 25
003 Carol 23
View DemoApplication.java
public class DemoApplication {
public static void main(String[] args) throws IOException {
CsvMapper mapper = new CsvMapper();
// ヘッダなし、タブ区切り
CsvSchema schema = mapper.schemaFor(User.class).withColumnSeparator('\t');
Path path = Paths.get("TSVファイルのパス");
try (BufferedReader br = Files.newBufferedReader(path)) {
View DemoApplication.java
public class DemoApplication {
public static void main(String[] args) throws IOException {
// 空ファイルの格納先を設定する
Path path = Paths.get("/tmp/empty.txt");
try {
// 空ファイルを作成する
Files.createFile(path);
View mac.txt
- MacBook Air (11-inch, Mid 2013)
- macOS Mojave 10.14.4
View git.sh
# リモートブランチのdevelopをローカルにチェックアウトできない
$ git checkout -b develop origin/develop
fatal: 'origin/develop' is not a commit and a branch 'develop' cannot be created from it
# リモートブランチの一覧を確認する(developがない)
$ git branch -r
origin/HEAD -> origin/master
origin/master
# リモートブランチから最新情報を取得する
View git.sh
# リモートブランチから最新情報を取得する
$ git fetch --prune
View git.sh
$ git checkout -b develop origin/develop
fatal: 'origin/develop' is not a commit and a branch 'develop' cannot be created from it
View vim.txt
Put Vim in Paste mode. This is useful if you want to cut or copy
some text from one window and paste it in Vim. This will avoid
unexpected effects.
Setting this option is useful when using Vim in a terminal, where Vim
cannot distinguish between typed text and pasted text. In the GUI, Vim
knows about pasting and will mostly do the right thing without 'paste'
being set. The same is true for a terminal where Vim handles the
mouse clicks itself.
This option is reset when starting the GUI. Thus if you set it in
your .vimrc it will work in a terminal, but not in the GUI. Setting
You can’t perform that action at this time.