Skip to content

Instantly share code, notes, and snippets.

# 選好の有無が混在する場合のマッチング手法
# https://proceedings-of-deim.github.io/DEIM2023/2b-6-5.pdf
import random
from typing import List, Tuple
def mixed_acceptance_algorithm(workers: List[Tuple[int, List[int]]], tasks: List[Tuple[int, List[int]]]) -> List[Tuple[int, int]]:
"""
選好の有無が混在する場合のマッチングアルゴリズム
#!/bin/bash
set -e -o pipefail
if [ -z "$GITHUB_TOKEN" ];then
echo "GITHUB_TOKEN を設定してください"
exit -1
fi
if [ -z "$1" ];then
echo "引数に組織名を入れてください"
exit -1
@nazoking
nazoking / aws_amazon_saml.userScript.js
Last active July 12, 2019 02:25
aws_amazon_saml.userScript.js
// ==UserScript==
// @name AWS SAML
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://signin.aws.amazon.com/saml
// @grant none
// ==/UserScript==

test

huge 'hoge huge huga' hoga

</html>

# Zero width spaces
@nazoking
nazoking / mysql.sh
Created July 21, 2017 05:16
環境変数から見合ったmysql(バージョン、ポート、データdir等)を起動する。direnvと一緒に使う
#!/bin/bash
set -e
set -o pipefail
set -u
# set -x
function !!
{
echo "$@"
"$@"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class Repeater{
static tracker_collect(tracker){
switch(type(tracker)){
case 'function':
return tracker;
case 'undefined':
case 'null':
return (value, index, list) => value;
case 'number':
case 'string':
@nazoking
nazoking / start_spot.sh
Last active September 15, 2016 04:33
スポットインスタンスを立ててボリュームをアタッチしてIPをHOSTファイルに保存する
#!/bin/bash
set -e
set -x
set -u
AWS_DEFAULT_REGION=us-west-1
INSTANCE_TYPE=c4.2xlarge
# イメージID
IMAGE_ID=ami-xxxxxx
@nazoking
nazoking / check_spot.sh
Created September 15, 2016 04:07
spot インスタンスが止められそうなら stop ファイルを作る
#!/bin/bash
# スポットインスタンスの停止イベントをチェックして stop ファイルを書き出す
set -e
BASE_DIR=$(dirname $0)
STOP_FILE=${STOP_FILE-$BASE_DIR/stop}
PID_FILE=${PID_FILE-$BASE_DIR/check_stop.pid}