- 名前:高山
- 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
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
#!/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) |
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
<?php | |
class BloomFilter | |
{ | |
const BYTE = 8; | |
private $filter; | |
private $filter_length; | |
private $bit_num; | |
private $hash_num; |
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
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
object ProcessEnumerator { | |
// wraps a ProcessBuilder with Play's Enumerator | |
// and executes the process in Future | |
// so that the process' output can be streamed | |
def apply(process: ProcessBuilder): Enumerator[String] = { | |
val in = new PipedInputStream() | |
val out = new PipedOutputStream(in) | |
Future(process.#>(out).run()) | |
val reader = new BufferedReader(new InputStreamReader(in, StandardCharsets.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
<?php | |
if ($m = RT::get('/works/:id' /*pathパターン*/, [':id:uint' /*pathのパラメータ*/])) { | |
getWorks($m[':id']); | |
} else if ($m = RT::get('/works/', ['page:uint:1' /*GETパラメータ。デフォルト1*/, 'type:string:' /*GETパラメータ。デフォルト空文字*/, 'tags:string[]' /*GETパラメータ。配列のみ受け取る。デフォルトは空配列?*/])) { | |
getWorks($m['page'], $m['type'], $m['tags']); |
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
data MyList a = MyEmpty | MyCons a (MyList a) deriving (Show) | |
instance Functor MyList where | |
fmap f MyEmpty = MyEmpty | |
fmap f (MyCons x xs) = MyCons (f x) (fmap f xs) | |
instance Applicative MyList where | |
pure x = MyCons x MyEmpty | |
MyEmpty <*> _ = MyEmpty | |
_ <*> MyEmpty = MyEmpty |
OlderNewer