- 名前:高山
- twitter:@edvakf
- お仕事:
- pixivのGrowthに関する開発
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 ( | |
"bytes" | |
"database/sql" | |
"encoding/gob" | |
"log" | |
Radix "github.com/fzzy/radix/extra/pool" | |
) |
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
# 10.2s user time, 210ms system time, 41.18M rss, 233.52M vsz | |
# Current date: Tue Sep 23 08:18:18 2014 | |
# Hostname: ip-172-31-16-67 | |
# Files: /var/lib/mysql/ip-172-31-16-67-slow.log | |
# Overall: 43.92k total, 45 unique, 422.35 QPS, 1.68x concurrency ________ | |
# Time range: 2014-09-23 08:15:33 to 08:17:17 | |
# Attribute total min max avg 95% stddev median | |
# ============ ======= ======= ======= ======= ======= ======= ======= | |
# Exec time 174s 3us 609ms 4ms 38ms 15ms 84us |
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
<?php | |
class BloomFilter | |
{ | |
const BYTE = 8; | |
private $filter; | |
private $filter_length; | |
private $bit_num; | |
private $hash_num; |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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/env ruby | |
# coding: utf-8 | |
require 'set' | |
module GeoLite2_Country | |
class IPv4Block < Struct.new(:start_ip, | |
:mask_length, | |
:geoname_id) | |
def self.from_line(line) |
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
open System.Collections.Generic | |
let limit = 100000 | |
let divisor = 1000000 | |
let memo = new Dictionary<int,int> () | |
let rec partitions = fun (n, m) -> | |
if (n >= limit || m >= limit) then 0 | |
elif (n = 0) then 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
/** | |
* 想定する文字列(UCS2)かどうか | |
* (parse_strした結果に適用される) | |
*/ | |
private static function isValidString($str) | |
{ | |
if (mb_strlen($str, 'UTF-8') > self::MAX_DETAIL_CHAR_LENGTH) { | |
return false; | |
} | |
$ucs2 = mb_convert_encoding($str, 'UCS-2', 'UTF-8'); |
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
# PRML p152-p154 | |
library(ggplot2) | |
library(MASS) | |
# a0 and a1 are parameters to predict | |
a0 <- -0.3 | |
a1 <- 0.5 | |
f <- function(x) {a0 + a1 * x} |
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
log_format ltsv | |
"time:$time_iso8601" | |
"\treq_time:$request_time" | |
"\tapp_time:$upstream_response_time" | |
"\tres_size:$bytes_sent" | |
"\tstatus:$status" | |
"\tmethod:$request_method" | |
"\tpath:$request_uri" | |
"\thost:$remote_addr" | |
"\tua:$http_user_agent" |