Skip to content

Instantly share code, notes, and snippets.

View sipadan2003's full-sized avatar

Takayuki MINATO sipadan2003

View GitHub Profile
package tv.minato.app.tree;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.PrintStream;
import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.LinkOption;
import java.nio.file.Path;
@sipadan2003
sipadan2003 / TMGridBagConstraints.java
Last active July 16, 2016 17:58
Enhanced GridBagLayout Components
package tv.minato.common.gui;
/**
*{@link tv.minato.gui.layout.TMGridBagLayout TMGridBagLayout}でレイアウトを指定するためのクラスです。
*@since 1.8
*@Version 1.00 2016/07/16 for Java 1.8
*@author 1.00 Takayuki MINATO
*/
public class TMGridBagConstraints extends Object implements Cloneable {
/**
@sipadan2003
sipadan2003 / CSVReader.java
Created September 20, 2017 01:55
Simple CSV file reader
package tv.minato.common.csv
import java.io.BufferedReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
public class CSVReader implements AutoCloseable {
private final BufferedReader r;
private char splitter = ',';
@sipadan2003
sipadan2003 / reem001.sh
Last active November 11, 2019 05:43
ShellScript samples
#!/bin/bash
for i in `grep -E "^[0-9]+$" d.txt`
do
echo "Processing for $i"
rm -f $i.txt
for j in `grep -E "^[^:]+:$i" d.txt`
do
echo $j >> $i.txt
done
#!/bin/bash
p001(){
local input1=$1
local input2=$2
local output=$3
local pattern="^\([0-9]\+\)[ ]\+\([A-Za-z]\+\)$"
declare -A array
for i in `grep -E "^[0-9]+[ ]+[A-Za-z]+$" $input2`
import java.awt.Color;
import java.awt.Graphics;
import java.awt.MediaTracker;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import javax.swing.ImageIcon;
import javax.swing.filechooser.FileSystemView;
#!/bin/bash
function goCsv {
local IFS=,
while read row; do
local output=
columns=($row)
for c in "${columns[@]}"; do
if [ "${c}" == "" ]; then
c="AAA"
#!/bin/bash
reem003(){
local input1=$1
local output=$2
rm -f $output
cat $input1 | while read line
do
local k=`echo "$line" | sed -e "s/[<>-][0-9\.]\+/-99999.9/g"`
#!/bin/bash
num2=79
for num1 in `seq 40 60`; do
old_name=`printf "a_%03d" $num1`
new_name=`printf "a_%03d" $num2`
if [ -e ${old_name} ] && [ ! -e ${new_name} ]; then
mv ${old_name} ${new_name}
fi
num2=`expr ${num2} + 1`
BEGIN { FS="\t" }
{
if(NR > 1){
if($2!="" && $4!="" && $5!=""){
printf "%d\n", (NR-1)
}
}
}