Skip to content

Instantly share code, notes, and snippets.

@saicologic
saicologic / memusg
Created August 30, 2017 01:01 — forked from netj/memusg
memusg -- Measure memory usage of processes
#!/usr/bin/env bash
# memusg -- Measure memory usage of processes
# Usage: memusg COMMAND [ARGS]...
#
# Author: Jaeho Shin <netj@sparcs.org>
# Created: 2010-08-16
############################################################################
# Copyright 2010 Jaeho Shin. #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); #
@saicologic
saicologic / dbdoc.rake
Last active August 31, 2015 02:18 — forked from ayasuda/dbdoc.rake
データベース定義書を作るタスク(rails用)
require 'rake'
Table = Struct.new(:name, :comment, :columns, :indexes)
Column = Struct.new(:name, :type, :not_null, :default, :primary_key, :comment)
Index = Struct.new(:name, :columns, :primary, :unique)
def get_schema_info(klass)
table = Table.new
table.name = klass.table_name
table.columns = []
@saicologic
saicologic / 0_reuse_code.js
Last active August 29, 2015 14:13
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
require 'rake'
require 'rspec/core/rake_task'
require 'yaml'
require 'highline/import'
properties = YAML.load_file('properties.yaml')
ENV['SSH_USER'] = ask("Enter ssh user: ") { |q| q.echo = true }
ENV['SSH_PASSWORD'] = ask("Enter ssh password: ") { |q| q.echo = false }
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
import sys
import os.path
import bz2
from gensim.corpora import WikiCorpus
from gensim.corpora.wikicorpus import filterWiki
@saicologic
saicologic / 00.md
Created March 20, 2014 08:34 — forked from hayajo/00.md
@saicologic
saicologic / latency.txt
Created July 26, 2012 05:10 — forked from rtomayko/latency.txt
Latency numbers every programmer should know
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns
Send 1K bytes over 1 Gbps network 10,000 ns 0.01 ms
Read 1 MB sequentially from memory 250,000 ns 0.25 ms
Round trip within same datacenter 500,000 ns 0.5 ms
Read 1 MB sequentially from SSD 1,000,000 ns 1 ms 4X memory
@saicologic
saicologic / app.rb
Created May 14, 2012 07:16 — forked from mfojtik/app.rb
sinatra with simple worker and queue
require 'rack'
require 'sinatra/base'
require 'uuidtools'
require 'rest-client'
require 'eventmachine'
require 'json'
require_relative './cache'
class Worker < EM::Connection
attr_reader :query

#NoSQLデータモデリング技法

原文:NoSQL Data Modeling Techniques « Highly Scalable Blog

I translated this article for study. contact matope[dot]ono[gmail] if any problem.

NoSQLデータベースはスケーラビリティ、パフォーマンス、一貫性といった様々な非機能要件から比較される。NoSQLのこの側面は実践と理論の両面からよく研究されている。ある種の非機能特性はNoSQLを利用する主な動機であり、NoSQLシステムによく適用されるCAP定理がそうであるように分散システムの基本的原則だからだ。一方で、NoSQLデータモデリングはあまり研究されておらず、リレーショナルデータベースに見られるようなシステマティックな理論に欠けている。本稿で、私はデータモデリングの視点からのNoSQLシステムファミリーの短い比較といくつかの共通するモデリングテクニックの要約を解説したい。

本稿をレビューして文法を清書してくれたDaniel Kirkdorfferに感謝したいと思う

@saicologic
saicologic / dozens.rb
Created March 31, 2012 02:28 — forked from chsh/dozens.rb
Ruby class to access Dozens API.
require 'net/http'
require 'uri'
require 'json'
class Dozens
API_BASE = 'http://dozens.jp/api/'
ZONE_BASE = API_BASE + 'zone'
RECORD_BASE = API_BASE + 'record'