Skip to content

Instantly share code, notes, and snippets.

View HiroNakamura's full-sized avatar
🏠
Working from home

Developer of interesting things HiroNakamura

🏠
Working from home
View GitHub Profile
@dimzak
dimzak / main.sql
Last active September 12, 2019 23:36
Useful SQL queries for spring-batch metadata(MySql)
-- select job-time of the last 4 COMPLETED jobs
SELECT TIMESTAMPDIFF(SECOND,START_TIME,END_TIME),batch_job_execution.JOB_INSTANCE_ID from batch_job_execution
where(STATUS='COMPLETED')
order by JOB_EXECUTION_ID DESC LIMIT 4;
--select job-time from COMPLETED jobs named 'csvtoxml' limit:last 4
SELECT TIMESTAMPDIFF(SECOND,START_TIME,END_TIME),
batch_job_execution.JOB_INSTANCE_ID, batch_job_execution.END_TIME
from batch_job_execution
@gnosis23
gnosis23 / CompositeWriter.java
Created April 24, 2014 15:03
spring-batch compositeWriter sample
package batch;
import entity.TblReport;
import entity.TblReportExample;
import mapper.TblReportMapper;
import org.springframework.batch.item.ItemWriter;
import java.util.ArrayList;
import java.util.List;
@agonen
agonen / tips.sql
Last active January 26, 2020 15:37
oracle pl\sql ,sql tips
exec DBMS_PARALLEL_EXECUTE.DROP_TASK('mytask');
exec DBMS_PARALLEL_EXECUTE.CREATE_TASK ('mytask');
exec DBMS_PARALLEL_EXECUTE.CREATE_CHUNKS_BY_ROWID('mytask', 'BOND', 'BOND_ACTIVE_LIST', true, 100);
-- make sure the the sql statment in parameter 2 is correct (no error will return if the sql is not correct
exec DBMS_PARALLEL_EXECUTE.RUN_TASK('mytask', 'begin for i in (select * from bond_active_list where rowid between :start_id AND :end_id) loop datafeed_mgr.InsertHistBondDateRange(i.BOND_ID) ; end loop; end;', DBMS_SQL.NATIVE,parallel_level => 10);
time -p curl --header "j_username:yyy" --header "j_password:xxxx" http://fe.p.prod.primo.saas.exlibrisgroup.com:1701/cer/data/METADATA/PNX/prquest
@Toshakins
Toshakins / ch13.erl
Last active November 13, 2022 23:06
Erlang
-module (ch13).
-compile(export_all).
timer() ->
% io:format("Hi from ~p~n", [self()]),
receive
_
-> io:format("Bye!~n"),
exit('Bye')
after
@mattes
mattes / check.go
Last active October 13, 2025 14:50
Check if file or directory exists in Golang
if _, err := os.Stat("/path/to/whatever"); os.IsNotExist(err) {
// path/to/whatever does not exist
}
if _, err := os.Stat("/path/to/whatever"); !os.IsNotExist(err) {
// path/to/whatever exists
}
@carolynvs
carolynvs / install-mono.sh
Last active April 19, 2020 11:14
Install Mono on Ubuntu
wget http://download.mono-project.com/repo/xamarin.gpg
sudo apt-key add xamarin.gpg
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee --append /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete
sudo certmgr -ssl -m https://go.microsoft.com
sudo certmgr -ssl -m https://nugetgallery.blob.core.windows.net
sudo certmgr -ssl -m https://nuget.org
mozroots --import --sync
DECLARE
i number(3);
j number(3);
function es_primo(p int) return boolean
is
BEGIN
FOR k in reverse 2..(p-1) LOOP
IF mod(p, k) = 0 THEN
RETURN false;
END IF;
DECLARE
TYPE t_array IS TABLE OF integer INDEX BY varchar2(2000);
v_array t_array;
i integer;
j integer;
function es_primo(p int) return boolean
is
BEGIN
FOR k in reverse 2..(p-1) LOOP
IF mod(p, k) = 0 THEN
package com.mma.fingerprint;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.EnumMap;
import java.util.concurrent.LinkedBlockingQueue;
@thaenor
thaenor / Eliza.pl
Created December 15, 2014 18:20
ELIZA in Prolog
/*****************************************************************************/
/* ELIZA in Prolog */
/* */
/* Viren Patel */
/* Artificial Intelligence Programs */
/* University of Georgia, Athens, Georgia */
/* Email: [email protected] */
/* */
/* minor changes by Frank Schilder (FS) */
/* Email: [email protected] */