This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Fri Jan 5 17:04:13 2018 | |
@author: brokendish | |
""" | |
import bottlenose as api | |
import bs4 | |
import sys |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <boost/regex.hpp> | |
#include <locale> | |
using namespace std; | |
int alphaNumericCheck(string a); | |
int numberOfDigit(string str, int max); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/groovy | |
//------------------------------------------------------ | |
// Groovy XmlSlurper sample | |
// | |
//------------------------------------------------------ | |
def xml = """ | |
<aaa> | |
<langs type='current' count='3' mainstream='true'> | |
<language flavor='static' version='1.5'>Java3</language> | |
<language flavor='dynamic' version='1.6.0'>Groovy3</language> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vi | |
------------------------------------------- | |
画面分割 | |
------------------------------------------- | |
:sp 画面を上下に分割 | |
:sp ファイル名 指定したファイルを分割した画面に表示 | |
Ctrl-w p 画面間の移動 | |
Ctrl-w k 上の画面に移動 | |
Ctrl-w j 下の画面に移動 | |
Ctrl-w l 右の画面に移動 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
----------------------------------------------------- | |
pdbのデバッガコマンド | |
----------------------------------------------------- | |
起動 | |
python -m pdb cmd_test.py | |
l | |
list。実行中のプログラムの周囲11行を表示。第一引数で数字を指定した場合は、その行の周囲11行を表示。例えば「l 12 」。指定した範囲のプログラムリストを表示したい場合は「l 10, 40」とする。PC(プログラムカウンター)がどこにあるかも確認できるしブレイクポイントを貼るときの行数の確認にもなるのでまずはコレ。 | |
b |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------- | |
#システムのコマンドを実行 | |
#Ctl+Cで止められる | |
#---------------------------------------------------- | |
#!/usr/bin/env python | |
import subprocess | |
for i in xrange(100): | |
cmd = "tail -f /var/log/syslog | cat " | |
subprocess.call(cmd, shell=True) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# _*_ coding: utf-8 _*_ | |
import sqlite3 as sq | |
import sys | |
#テーブルを削除 ※SQLiteはTruncateはサポートしていないようなのでDROPしてVACCUMする | |
#データベースに接続 | |
con = sq.connect("sqlite_test.db") | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
# -*- coding: UTF-8 -*- | |
#CSV | |
#モジュールをインポート | |
#デミリッタを使用してawkのような処理を行う事が可能 | |
import csv | |
#標準出力に出力したいのでsysをインポート | |
import sys | |
#ファイルの存在確認をしたいのでosをインポート |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#------------------------------------------------------------------------------------ | |
# パターン 4 | |
#------------------------------------------------------------------------------------ | |
create database xml_normalize; | |
use xml_normalize | |
drop table AA; | |
drop table BB; | |
#------------------------------------------------ | |
create temporary table AA( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
************************************************************************** | |
環境設定(データ準備) | |
************************************************************************** | |
bkdh@brokendish:~$ mysql -u root | |
mysql> create database xml_normalize; | |
mysql> use xml_normalize | |
Database changed | |
mysql> |
NewerOlder