Skip to content

Instantly share code, notes, and snippets.

import jax
import jax.numpy as jnp
@jax.jit
def get_under_sample_index_one(y: jnp.ndarray):
"""
y は 0, 1 のみを取る
先頭から 0, 1 を選んでいくため y は事前にシャッフルされている必要がある
"""
@odanado
odanado / 継承.ts
Last active January 22, 2021 12:52
abstract class BaseCommand<T> {
abstract parse(argv: string): T;
abstract run(config: T): void;
}
// parse と run の実装とインタフェースを矯正させる
class CommandA extends BaseCommand<{}> {
parse(argv: string) {
return {}
}
<h1>poyo</h1>
@odanado
odanado / 49.212.217.137.txt
Created August 21, 2020 17:02
アクセス件数
$ wc -l access.log*
71 access.log
40827 access.log.2017-01-28
96341 access.log.2017-02-07
48355 access.log.2017-02-14
37780 access.log.2017-02-21
42383 access.log.2017-02-28
35684 access.log.2017-03-07
34110 access.log.2017-03-14
32159 access.log.2017-03-21
curl https://blog.odan.dev/ --head -H "via: 1.1 0af4f461b5a89684a06050bc1aca8c04.cloudfront.net (CloudFront), 1.1 0af4f461b5a89684a06050bc1aca8c04.cloudfront.net (CloudFront)"
@odanado
odanado / cal_offset.cpp
Created August 3, 2020 16:19
cal_offset.cpp
#include<cstdio>
typedef unsigned long long UInt64;
typedef unsigned int UInt32;
UInt64 seed1 = 0xC6942472D331BF96;
UInt64 LCGseed;
int offset;
@odanado
odanado / perl.ipynb
Last active March 13, 2020 02:00
perl.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
function taskA(i: number) {
return new Promise<number>((resolve, reject) => {
if (i % 2 == 0) reject(`error on taskA ${i}`)
resolve(i)
})
}
function taskB(i: number) {
return new Promise<number>((resolve, reject) => {
if (i % 3 == 0) reject(`error on taskB ${i}`)
resolve(i)
cd sandbox
ls
cd sandbox
ls
CREATE TABLE submissions (
id BIGINT NOT NULL,
epoch_second BIGINT NOT NULL,
problem_id VARCHAR(255) NOT NULL,
contest_id VARCHAR(255) NOT NULL,
user_id BIGINT NOT NULL, -- 数値化
language VARCHAR(255) NOT NULL,
point DOUBLE PRECISION NOT NULL,
length INT NOT NULL,
result VARCHAR(255) NOT NULL,