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
# Bench mark for dbs via python api | |
# Support DBs | |
# - MongoDB via pymongo | |
# - Sqlite3 via sqlite3 | |
# | |
import sys | |
import time | |
from pymongo import MongoClient |
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
# Provide function to identify the data type | |
import socket | |
class TypeIdentifer(object): | |
_identifers=list() | |
@staticmethod | |
def is_int(s): | |
""" |
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
Personal memo for extend LVM voule | |
Disk /dev/vda: 317.1 GB, 317085921280 bytes | |
255 heads, 63 sectors/track, 38550 cylinders, total 619308440 sectors | |
Units = sectors of 1 * 512 = 512 bytes | |
Sector size (logical/physical): 512 bytes / 512 bytes | |
I/O size (minimum/optimal): 512 bytes / 512 bytes | |
Disk identifier: 0x0009c06d | |
Device Boot Start End Blocks Id System | |
/dev/vda1 * 63 1028159 514048+ 83 Linux |
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
# Set of basic statistics operations | |
# | |
import math | |
def median(items): | |
""" | |
Return median | |
if number of items is odd, return average of 2 middles. |
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
#!/bin/bash | |
# chkconfig: 345 20 80 | |
# description: Play start/shutdown script | |
# processname: play | |
# | |
# Instalation: | |
# copy file to /etc/init.d | |
# chmod +x /etc/init.d/play | |
# chkconfig --add /etc/init.d/play | |
# chkconfig play on |
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
#!/bin/sh | |
### BEGIN INIT INFO | |
## END INIT INFO | |
# Path to play install folder | |
PLAY_HOME=/usr/share/play | |
PLAY=$PLAY_HOME/play | |
# Path to the JVM | |
JAVA_HOME=/usr/lib/jvm/java-1.6.0-openjdk |
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
package main | |
import "fmt" | |
func main() { | |
// Stringsは+で足すことができる。 | |
fmt.Println("go" + "lang") | |
// intgers と float | |
fmt.Println("1+1 =", 1+1) |
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
brew update | |
brew install go |
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
package main | |
import "fmt" | |
func main() { | |
// 1個以上の変数を宣言することができる。 | |
var a string = "initial" | |
fmt.Println(a) |
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
package main | |
import "fmt" | |
import "math" | |
// 定数は constで宣言される。 | |
const s string = "constant" | |
func main() { |
OlderNewer