Skip to content

Instantly share code, notes, and snippets.

@muripoLife
muripoLife / document.md
Created February 19, 2020 01:02
MySQLでsplit的な事をしたい時
SELECT
 substring_index( 'Linux#Apache#MySQL#PHP', '#', 1 )
,substring_index(substring_index( 'Linux#Apache#MySQL#PHP', '#', 2 ), '#', -1 )
,substring_index( 'Linux#Apache#MySQL#PHP', '#', -1 )
;

結果

|column1|column2|column3|

@muripoLife
muripoLife / document.md
Created February 19, 2020 01:00
kubernetes(K8s)の基本・インストール

kubernetesとは

多数のコンテナに対する運用管理作業を自動化するためのツール(コンテナオーケストレーションシステム)

  • コンテナを用いたアプリケーションのデプロイ
  • Dockerホストの管理
  • サーバリソースの空き具合を考慮したコンテナ配置
  • スケーリング
  • 複数のコンテナ群へのアクセスを取りまとめるロードバランサー
  • 死活監視
@muripoLife
muripoLife / document.md
Created February 19, 2020 00:59
Singularity基本知識・インストール

Singularityとは

一言でいうと

HPC向けのコンテナー型仮想化

詳細

ユーザーが自身の計算環境を完全に再現し、保持できるようにした新しい Linux コンテナで、アプリケーションの本体及び動作に必要なライブラリ、さらにはデータをパッケージ化する。

特徴

  • 作成元LBNL
  • Job Schedulaerに対応
  • 実行時に root 権限不要
@muripoLife
muripoLife / product_set.sql
Created February 13, 2020 04:00
MySQLで直積を書く(月とidの直積)
with temp_yyyymm as(
select left(date, 7) yyyymm from calendar group by 1
),
temp_id as(
select id from table
)
select
id,
yyyymm
from temp_id, temp_yyyymm
@muripoLife
muripoLife / .vimrc
Created February 12, 2020 01:51
個人的なvimrc
" setting
"文字コードをUFT-8に設定
set fenc=utf-8
" バックアップファイルを作らない
set nobackup
" スワップファイルを作らない
set noswapfile
" 編集中のファイルが変更されたら自動で読み直す
set autoread
" バッファが編集中でもその他のファイルを開けるように
@muripoLife
muripoLife / 37th-place-solution_arrange.ipynb
Last active February 11, 2020 08:11
37th-place-solution_arrange.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@muripoLife
muripoLife / nn_wrap.py
Created January 17, 2020 13:05
kaggle tips wrap (neural network tensor flow)
import gc
import json
import os
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from matplotlib import pyplot
from scipy import stats
from time import time
from tqdm import tqdm_notebook as tqdm
@muripoLife
muripoLife / connpass_user_list.ipynb
Created January 17, 2020 08:34
connpassのuser一覧を取得
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@muripoLife
muripoLife / pref.sql
Created January 9, 2020 07:30
住所から都道府県を抽出_mysql
drop table if exists `address_table`;
create temporary table `address_table` (
`id` int(255) not null auto_increment,
`address` varchar(1024) default null,
`created_at` timestamp not null default current_timestamp,
primary key (`id`)
) engine=innodb auto_increment=42 default charset=utf8;
insert into `address_table` values
('兵庫県神崎郡市川町神崎831-8')
,('北海道白糠郡白糠町西六条北4-320-20')
@muripoLife
muripoLife / morphologicalAnalysis.py
Created January 8, 2020 08:11
形態素解析_python
# coding: UTF-8
#!/usr/bin/env python
import MeCab
import re
import json
def morphologicalAnalysis(text, writeFile):
m = MeCab.Tagger ("mecabrc")
mp = m.parse (text)