Skip to content

Instantly share code, notes, and snippets.

@voluntas
voluntas / pubsub_memory_database.rst
Last active July 2, 2018 08:04
クエリー処理を Lua で書け、処理結果を PubSub で共有できるキュー付きオンメモリデータベース

クエリー処理を Lua で書け、処理結果を PubSub で共有できるキュー付きオンメモリデータベース

作者:@voluntas
バージョン:0.2.1
URL:https://voluntas.github.io/

まだ個人の興味で作ってるだけです

@shunsukeaihara
shunsukeaihara / changefinder.py
Last active August 14, 2023 06:28
Change finder algorithm
# -*- coding: utf-8 -*-
import numpy as np
import math
def LevinsonDurbin(r, lpcOrder):
"""
from http://aidiary.hatenablog.com/entry/20120415/1334458954
"""
a = np.zeros(lpcOrder + 1,dtype=np.float64)
@voluntas
voluntas / shiguredo_tech.rst
Last active April 11, 2024 08:30
時雨堂を支える技術

時雨堂を支える技術

日時:2024-04-11
作:時雨堂
バージョン:2024.4
URL:https://shiguredo.jp/

時雨堂クラウドサービスを支える技術

import re
from saying.exceptions import ApplicationException
from itertools import chain
class DSLSyntaxError(ApplicationException):
pass
def format(handler, text, message):
var = {
u'sender': lambda: resolve_handle(message.Sender.Handle),
@hagino3000
hagino3000 / fibonacci.js
Last active December 28, 2016 21:11
asm.js sample
function fast_fib_module(stdlib, foreign, heap) {
"use asm";
function fib(n) {
n = n|0;
// nはint(符号の有無が不明の状態)
// 3はfixnum(0~2^31)
// 比較するためにnをシフト演算でunsignedに変換する
if (n >>> 0 < 3) {
@repeatedly
repeatedly / msgpack_issue_121.md
Last active November 30, 2021 02:09
MessagePackが文字列とバイナリをわけないのは問題?

MessagePackが文字列とバイナリをわけないのは問題?

msgpack/msgpack#121

Objective Cの実装使ってるとある問題にぶちあたった.なので,文字列をちゃんとバイナリ(Raw)と分けるべき,という提案

(*) 俺は熟読したわけではないので,中身が気になる人はちゃんと本スレを読みましょう

そもそもMessagePackとは

@havenwood
havenwood / bench.md
Last active December 12, 2015 05:49
Entirely Unscientific Benchmark of Primes in Various Ruby Implementations

Unscientific Benchmark

The Benchmark

def is_prime? n
  (2...n).all? { |i| n % i != 0 }
end

def sexy_primes n
@ymotongpoo
ymotongpoo / pyspa_advent.py
Created November 30, 2012 05:58
2012 PySpa advent calendar抽選
import random
participants = ["ymotongpoo",
"shiumachi",
"mopemope",
"tk0miya",
"shimizukawa",
"kuenishi",
"ransui",
"turky",
@kuenishi
kuenishi / gist:3870957
Created October 11, 2012 08:22
摩訶不思議PHP
thanks to @aodag @rokujouhitoma @toruf
php > function hoge(){ print "hoge"; }
php > hoge();
hoge
php > $func = "hoge";
php > $func();
hoge
php > "hoge"();
import bisect
class NFA(object):
EPSILON = object()
ANY = object()
def __init__(self, start_state):
self.transitions = {}
self.final_states = set()
self._start_state = start_state