Install and run postgres:
brew install postgresql
initdb /usr/local/var/postgres -E utf8
postgres -D /usr/local/var/postgres
# keep this console open
| -- Thanks https://community.oracle.com/thread/630462?start=0&tstart=0 | |
| select 'Create Sequence '||sequence_name|| | |
| ' increment by '||increment_by|| | |
| ' start with '||last_number|| | |
| ' maxvalue '||max_value|| | |
| decode(cycle_flag,'N',' NOCYCLE ',' CYCLE ')|| | |
| decode(cache_size,0,'NOCACHE ','CACHE '||cache_size) | |
| from user_sequences; | |
| ductはClojureでWebアプリケーションを開発するためのテンプレートであり、小さなライブラリです。 | |
| * [Getting Started](./getting-started.md) | |
| * [設定](./configuration.md) | |
| * [サービス境界(boundaries)](./boundaries.md) | |
| * [互換性のあるライブラリ](./compatible-libraries.md) |
| (try (/ 1 0) | |
| (catch Exception e | |
| (println (clojure.string/join "\n " (cons (str e(.getMessage e)) (map str (.getStackTrace e))))))) |
| module Hoge | |
| def self.included(klass) | |
| klass.extend ClassMethods | |
| end | |
| module ClassMethods | |
| def foo | |
| p 'foo' | |
| end |
| (defn- 西暦->和暦 [西暦] | |
| (let [year (read-string 西暦)] | |
| (cond | |
| ;; 平成 | |
| (<= 0 (- year 1988)) | |
| {:和暦 "平成" | |
| :年 (- year 1988)} | |
| ;; 昭和 | |
| (<= 0 (- year 1925)) | |
| {:和暦 "昭和" |
| WITH | |
| sessions AS ( | |
| SELECT | |
| *, | |
| ROW_NUMBER() OVER (PARTITION BY anonymous_id ORDER BY sent_at ASC) AS rn | |
| FROM | |
| `your-project.your_dataset.pages` ), | |
| first_page AS ( | |
| SELECT | |
| * |
| (ns main | |
| (:require [clojure.java.io :as io]) | |
| (:import [org.apache.pdfbox.pdmodel PDDocument] | |
| [org.apache.pdfbox.text PDFTextStripper])) | |
| (defn extract-string [src] | |
| (with-open [doc (->> src PDDocument/load)] | |
| (->> doc (.getText (PDFTextStripper.))))) |