yumebayashi's note

Copy S3 to Redshift, the difference between delimiter ',' and CSV

copy table_name from 's3://bucket/path/' CREDENTIALS 
'aws_access_key_id=[access_key];aws_secret_access_key=[secret_key]' 
delimiter '\t' gzip maxerror 100;

When importing csv data from s3 to redshift, We can use delimiter ',' or CSV option. There two options are different. If we use CSV option, we can import such as this file

123,aaa ...

Export results with CSV files with MySQL, Postgres

Environments

db

  • postgres:9.4.4
  • mysql5.6.26

db-config

  • user:hoge
  • password:fuga
  • host:localhost
  • database:mydb

Postgres

psql -h localhost -U hoge mydb -c "select id,name from users" -A -F, -t > user.csv

option

-A, --no-align : unaligned table output mode
-F, --field-separator=STRING : field separator for unaligned ...

Chrome Custom Search Setting

Setting

go to chrome setting page chrome://settings/

example

en https://www.google.com/search?q=%s&hl=en
alc http://eow.alc.co.jp/search?q=%s
ama https://www.amazon.co.jp/s?field-keywords=%s
y http://www.youtube.com/results?search_query=%s
h http://b.hatena.ne ...

Install Mecab

Download

Download mecab core and dictionary.
http://taku910.github.io/mecab/#download

files are on google drive, if you want to use cli, need to add option like this.

wget 'https://drive.google.com/uc?export=download&id=0B4y35FiV1wh7cENtOXlicTFaRUE' -O mecab-0.996.tar.gz
wget 'https://drive.google.com/uc ...

Install Gradle

install script for centos

cd /opt/
sudo wget -N https://services.gradle.org/distributions/gradle-2.6-all.zip
sudo unzip gradle-2.6-all.zip
sudo rm gradle-2.6-all.zip
sudo ln -s gradle-2.6 gradle
sudo printf "export GRADLE_HOME=/opt/gradle\nexport PATH=\$PATH:\$GRADLE_HOME/bin" > /etc/profile.d/gradle-env.sh
source ...

Narrative Clip Script to make mp4 from images

What is this script?

Narrative Clip is a kind of life logging gadget. It takes a photo every 30 seconds (default setting). If we wear a Narrative Clip 10 hour a day, we get 1200 photos. This script make it possible to crop all photos square and combine them and ...

EyeTribe demo using java

EyeTribe is the world's first affordable eye tracker.
It enables us to get the eye movement trajectories and develop some tools with it.
Today I'll show you a demo play.
Github Fork Me

The eyetribe sercer gives 30 fps data by default setting.
The upper limit is 60 ...

Splitting words into letters in Java

  • -java7
"hoge".split("");
// ["", "h", "o", "g", "e"]
"hoge".split("(?<=.)");
// ["h", "o", "g", "e"]
  • java8-
"hoge".split("");
// ["h", "o", "g", "e"]