Skip to content

Instantly share code, notes, and snippets.

View Shirataki2's full-sized avatar
🏠
Working from home

Tomoya Ishii Shirataki2

🏠
Working from home
  • Keio University
View GitHub Profile
use pnet_macros::Packet;
use pnet_macros_support::{packet::Packet, types::*};
#[derive(Packet)]
pub struct SpeakingStart {
length: u13le,
ty: u3,
snowflake: u64le,
timestamp: u64le,
#[payload]
@Shirataki2
Shirataki2 / num_traits.rs
Created December 21, 2020 17:15
実用性 無になってしまった気がするけど供養
pub mod base {
pub trait Zero: Sized {
fn zero() -> Self;
fn is_zero(&self) -> bool;
}
pub trait One: Sized {
fn one() -> Self;
fn is_one(&self) -> bool;
}
pub mod modint {
use std::cell::RefCell;
use std::ops::*;
type Num = u64;
thread_local!(
static MOD: RefCell<Num> = RefCell::new(0);
);
pub fn set_modint<T>(v: T)
where
Num: From<T>,
import numpy as np
import matplotlib.pyplot as plt
import warnings
warnings.simplefilter('ignore')
t=np.linspace(0,112*np.pi,6000)
sin=np.sin
sqrt=np.sqrt
pi=np.pi
theta=lambda x:np.where(x>=0,1,0)
sgn=lambda x:x/abs(x)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Shirataki2
Shirataki2 / 10.1.1.ipynb
Last active November 27, 2019 10:04
PRML Chapter 10(if 10.3.ipynb does not show well, see https://gist.github.com/Shirataki2/66eb56ec28480d1d5c817bc931e93c09 )
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{"lastUpload":"2019-11-07T02:25:02.492Z","extensionVersion":"v3.4.3"}

見出しの表示

見出しは#の数に応じてそれぞれHTMLの<h1>~<h6>タグに対応します

見出しH1(#)

見出しH2(##)

見出しH3(###)

// _/ _/ _/ _/
// _/ _/ _/_/_/ _/_/_/ _/_/_/_/ _/_/_/
// _/_/_/_/ _/ _/ _/ _/ _/ _/ _/ _/
// _/ _/ _/ _/ _/ _/ _/ _/ _/ _/
// _/ _/ _/ _/ _/ _/_/_/ _/_/ _/_/_/
// C++ Conpetitive Programming Template
// Ver 1.1 (codename: Hinata)
// Last Modified : 2019-05-28
// Created : 2019-05-25
// Auther : shirataki3
#include <iostream>
#include <cstdint>
#include <chrono>
#include <vector>
const long long MOD = (long long)1e9+7;
using namespace std;
// 剰余を考慮した整数のクラス
template <uint_fast64_t Mod> class Mint {
using u64 = uint64_t;