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
FROM ubuntu:trusty | |
RUN apt-get update && apt-get -f install | |
RUN apt-get install -y mingw-w64 --no-install-recommends | |
RUN apt-get install -y make patch | |
RUN apt-get install -y wget vim | |
RUN apt-get install -y swig | |
RUN find /usr -name '*.dll' -delete | |
RUN find /usr -name '*.dll.a' -delete |
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
public interface DbToolMapper { | |
@Select("${sql}") | |
List<Map<String, Object>> query(@Param("sql") String sql); | |
} |
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
C:\work>cscript xls2csv.vbs Book1.xlsx | |
Microsoft (R) Windows Script Host Version 5.812 | |
Copyright (C) Microsoft Corporation. All rights reserved. | |
完了しました |
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
// ファイルは最初の空行まで読み込まれる。 | |
Files.lines(path) | |
.peek(s -> { | |
System.out.println(s); | |
}) | |
.anyMatch(String::isEmpty); |
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
# ActiveRecord と postgres アダプタの gem が入ったイメージを用意する。 | |
# DockerHub 公式の ruby:onbuild を使うと、Gemfile を用意するだけで | |
# その内容をインストールした ruby 環境イメージを簡単に作成することができる。 | |
$ docker pull ruby | |
$ docker run --rm ruby ruby --version | |
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux] | |
$ ls | |
Gemfile Dockerfile |
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
// splitAsStream() を使った実装 | |
// 指定の正規表現を反転し、splitAsStream()を使ってテキストから文字列を抽出する。 | |
public List<String> extract1(String file, String regex) throws IOException { | |
// 任意の正規表現を反転(否定)した正規表現にするが、保証はできない。 | |
// 後読みとかしているので重い。ものによっては帰ってこれないかもしれない。 | |
final String inverse = String.format("(?<=^|(%1$s))((?!(%1$s)).)+", regex); | |
final Pattern invertedPattern = Pattern.compile(inverse); | |
try(Stream<String> lines = Files.lines(Paths.get(file))) { | |
return lines |
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 hoge; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.UncheckedIOException; | |
import java.nio.charset.Charset; | |
import java.nio.charset.StandardCharsets; | |
import java.nio.file.Files; | |
import java.nio.file.Path; | |
import java.util.Iterator; |
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
ENV['PATH'] += ";" + File.expand_path(File.dirname(__FILE__)) |
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
<?xml version="1.0" encoding="utf-8"?> | |
<appengine-web-app xmlns="http://appengine.google.com/ns/1.0"> | |
<application>my-application-id</application> | |
<version>v1</version> | |
<!-- TODO review code for thread-safety. --> | |
<threadsafe>false</threadsafe> | |
<system-properties> | |
<property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> | |
</system-properties> |
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
SELECT value, jsonb_typeof(value) | |
FROM jsonb_array_elements( | |
'[1, 1.00, 10.0e-3, "1", true, "2014-01-01T12:34:56", null, "", {}, []]' | |
); | |
value | jsonb_typeof | |
-----------------------+-------------- | |
1 | number | |
1.00 | number | |
0.0100 | number |
NewerOlder