Skip to content

Instantly share code, notes, and snippets.

View y-yu's full-sized avatar

YOSHIMURA Yuu y-yu

View GitHub Profile
@mala
mala / covid19-twitter-research_01.md
Last active December 31, 2021 05:58
生活と意見: ソーシャルディスタンスなどと称してユーザー名や文章にスペースを挟む行為についての苦情

生活と意見: ソーシャルディスタンスなどと称してユーザー名や文章にスペースを挟む行為についての苦情

更新履歴

2020-05-13 追記

@bessarabov
bessarabov / gist:674ea13c77fc8128f24b5e3f53b7f094
Last active March 27, 2024 07:46
One-liner to generate data shown in post 'At what time of day does famous programmers work?' — https://ivan.bessarabov.com/blog/famous-programmers-work-time
git log --author="Linus Torvalds" --date=iso | perl -nalE 'if (/^Date:\s+[\d-]{10}\s(\d{2})/) { say $1+0 }' | sort | uniq -c|perl -MList::Util=max -nalE '$h{$F[1]} = $F[0]; }{ $m = max values %h; foreach (0..23) { $h{$_} = 0 if not exists $h{$_} } foreach (sort {$a <=> $b } keys %h) { say sprintf "%02d - %4d %s", $_, $h{$_}, "*"x ($h{$_} / $m * 50); }'
@erutuf
erutuf / 180610.md
Last active June 10, 2018 16:53
今学期受けたMITのCSの授業2

今学期受けたMITのCSの授業2

アメリカでは春学期が終わり、私は無事にPhDの一年目を終えました。秋学期の終わりに受けた授業の感想を書いたわけですが、今回も書いてみようと思います。

Cryptography and Cryptoanalysis

暗号理論の授業です。試験はなく、隔週の宿題のみで成績が決まるのですが、今までの人生で受けた授業で一番ハードでした。今学期の私の時間はほとんど暗号に消えていました。ちなみに担当の教員は Shafi Goldwasser と Vinod Vaikuntanathan で、暗号理論では著名な二人です。ちなみにMITの暗号理論の研究者といえば他にもたとえばRonald Rivest(RSA暗号の発明者の一人)がいるなど、大物揃いです。(実は私は授業を受けるようになってからそのことを知ったのですが……。)

授業の内容をざっと並べると、

  1. Perfect Secrecy(Shanon Secrecy)
  2. Computational Secrecy, One-Way Functions, Hard-Core Predicates
@mala
mala / gist:f33c9654af5e06e8bca9
Last active November 15, 2016 13:25
クライアントサイドでガチャ

目的

  • サーバー側でガチャのアイテムを選択すると確率操作している疑いがかかるので、事前に提示した確率から変更が出来ず疑いが掛からないような方式を提案する
  • サーバー側でもクライアント側でも不正が出来ないことが要件として求められる
  • 簡便なアルゴリズムで一般市民にも理解しやすく、また、解析によるアルゴリズムの把握が容易であることが望ましい

かんがえかた

これ相当のことを、サーバーとクライアントでやればいい。

@voluntas
voluntas / webrtc.rst
Last active April 30, 2024 14:20
WebRTC コトハジメ

ECMAScript6th Quiz

Q.1

let func = function() {};
func.name
  1. ""
  2. "func"
@tyage
tyage / web400.js
Last active January 4, 2016 13:29
seccon quals seccon競馬 writeup
var socket = io.connect('http://133.242.52.129');
for(p in socket_routes){
socket.on(p, (function(p) {
return function(message){
console.log(message.data && 'waku:' + message.data.id, message.data && 'rank:' + message.data.seq)
};
})(p));
}
@y-yu
y-yu / zip.md
Last active December 29, 2015 07:39
zip

zip関数

次のような機能を満す関数zipを作ってほしい。ただし次のような制約がある。

  • C++11
  • STLはOK
  • BoostはNG

大嘘

@pthariensflame
pthariensflame / IndexedCont.md
Last active April 3, 2022 00:30
An introduction to the indexed continuation monad in Haskell, Scala, and C#.

The Indexed Continuation Monad in Haskell, Scala, and C#

The indexed state monad is not the only indexed monad out there; it's not even the only useful one. In this tutorial, we will explore another indexed monad, this time one that encapsulates the full power of delimited continuations: the indexed continuation monad.

Motivation

The relationship between the indexed and regular state monads holds true as well for the indexed and regular continuation monads, but while the indexed state monad allows us to keep a state while changing its type in a type-safe way, the indexed continuation monad allows us to manipulate delimited continuations while the return type of the continuation block changes arbitrarily. This, unlike the regular continuation monad, allows us the full power of delimited continuations in a dynamic language like Scheme while still remaining completely statically typed.

@Mortimerp9
Mortimerp9 / readerwithtooling.scala
Created April 14, 2013 22:14
An implementation of the Reader Monad in scala, with correct type variance and some implicit utils to simplify the daily use of Readers, In particular with Future.
/**
* A monad to abstract dependencies in the code, see https://coderwall.com/p/kh_z5g
*/
object Reader {
/**
* an implicit to convert a function A => B in a Reader[A, B]
*/
implicit def reader[C, R](block: C => R): Reader[C, R] = Reader(block)