めも

技術メモとその他

javaからMS-Excelを読むサンプルコード

import java.io.FileInputStream; import java.util.ArrayList; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apach…

【Postgresql】 generate_seriesを使ったシーケンス(日付)

select * from GENERATE_SERIES('2020-03-12'::timestamp, '2030-03-12'::timestamp, '6 month'::INTERVAL); generate_series --------------------- 2020-03-12 00:00:00 2020-09-12 00:00:00 2021-03-12 00:00:00 2021-09-12 00:00:00 2022-03-12 00:00:00…

eclipseBIRT におけるdecimal型とfloat型について

ref: bugs.eclipse.org and test below: exam

postgreSqlのスキーマ を比較する

参考にさせてもらいました hacknote.jp

thanks helps

tmftake.hateblo.jp

dbunt - apache poi export excel date type format helps me

shorindo.com

ファイル更新を感知するシェルスクリプト

参考にさせてもらいました。 指定したファイルの更新があったらコマンドを自動実行するシェルスクリプト - 午睡二時四十分

java classファイルのデコンパイル( jspc )

www.ne.jp

【Birt】動的にwhere句をデータセットクエリに追加する

1. query 2. dynamic where clause(if parameter in)

【Postgresql】件数を元に連番を生成する generate_series

luna=# select * from sample; stake_no | cnt ----------+----- 0001 | 1 0002 | 3 (2 rows) luna=# select * from sample,generate_series(1, 99) as id where sample.cnt >= id; stake_no | cnt | id ----------+-----+---- 0001 | 1 | 1 0002 | 3 | 1 00…

【Java】easy mock "入れ子"のサンプル

<test class> 1. inner class public class ConcatorIml implements Concater { @Override public String concat(String str1, String str2) throws Exception { String conc = ""; conc = str1+str2; return conc; } } 2.outer class public class parConcatorImpl impl</test>…

【iBatis】sql ログの設定(log4j)

log4j.rootCategory=INFO, consoleLoglog4j.category.jp.terasoluna=DEBUGlog4j.category.org.springframework=INFOlog4j.category.org.apache.struts=INFO log4j.category.java.sql.Connection= DEBUG log4j.category.java.sql.Statement= DEBUG log4j.cate…

old "STS" download

http://dist.springsource.com/release/STS/index.html

Jenkins を Mac OS X上で動作させる際の注意

homebrewでインストールした際、初回起動時にanonymous以外のユーザが 未作成にも関わらず、ログインを求められる。 ネット上にはパスワードファイルを確認するように書かれているが、そもそも ユーザアカウントが一つもないのでパスワードファイルなどない…

apache axis

WebServices - Axis

log4j to console

log4j.rootCategory=INFO, consoleLog log4j.category.jp.terasoluna=DEBUG log4j.category.org.springframework=INFO log4j.category.org.apache.struts=INFO log4j.appender.consoleLog=org.apache.log4j.ConsoleAppender log4j.appender.consoleLog.Targe…

jquery updrafts

jqueryui.com

using Set not to duplicate values

sample code below package homeWork; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; import java.util.Set; public class distinctSample2 { public static void main(S…

how stream().distinct() works - list of maps

sample code below: package homeWork; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; public class distinctSample { public static void main(String[] args…

awk like sql

1)sample data tk-no-MacBook-Pro:~ tk$ cat test.csv 01,8888888,9999999999 09,7777777,6666666666 02,2777333,9999992222 03,8888888,6567637476 2)select col2,col3 from ... where col1 = 09 tk-no-MacBook-Pro:~ tk$ awk -F, '{if ($1 == 09) print $2…

how to grouping and maxBy (list of maps)

1) list of maps : sample list of maps 2) grouping and maxBy main codes 3) before and results appendix) to copy List<Optional<Map<String, Object>>> aggrList = mockList.stream().collect(Collectors.groupingBy(p -> (String)p.get("niveau_1")+ (String)p.get("niveau_2")+(Str</optional<map<string,>…

spring batch : junit test sample

1.project files are below(use terasolua spring batch sample) 2.test codes(test class) package batch; import static org.junit.Assert.fail; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.s…

its util

ttps://www.atmarkit.co.jp/ait/articles/0704/20/news130.html

ls with timestamp (BSD ver.)

ls -l below tk-no-MacBook-Pro:webapps tk$ ls -l total 51584 drwxr-xr-x@ 10 tk staff 340 1 29 2008 ROOT drwxr-xr-x@ 5 tk staff 170 1 29 2008 balancer drwxr-xr-x@ 23 tk staff 782 1 29 2008 jsp-examples drwxr-xr-x@ 11 tk staff 374 1 29 2008 s…

thanks for ...

https://gonsuke777.hatenablog.com/entry/20170112/1484215308

sts old dw

sts(spring tools suite) legacy download below https://spring.io/tools3/sts/legacy

copy files timestamp

-rw-r--r-- 1 tk staff 40988 3 22 21:58 2.log-rw-r--r-- 1 tk staff 40988 3 25 03:16 3.log tk$ touch -r 2.log -m 3.log -rw-r--r-- 1 tk staff 40988 3 22 21:58 3.log-rw-r--r-- 1 tk staff 40988 3 22 21:58 2.log

file and directory counts

count files find /Users/tk/ -type f | wc -l count directory find /Users/tk/ -type d | wc -l and.. list full path with subDirectory ls -ltrh -d $(find `pwd`) > list.log

how to save [jsonb_pretty] format data

1)data is below prototype=# select jsonb_pretty(memo) from foo prototype-# where id = 1; jsonb_pretty --------------------------- { + "name": "japan", + "currency": "JPY", + "population": "10000"+ } (1 row) 2)if you use copy to stdout, psq…

how to get and put pdf in bytea (postgres)

only using sql and sql-command0)main table to store binary file belowprototype=# \d storedpdf Table "public.storedpdf" col name type description id integer key name character varying file name pdf bytea to store files 1)create temporary ta…