Skip to content

Instantly share code, notes, and snippets.

View buttercrab's full-sized avatar

Jaeyong Sung buttercrab

  • School of Computing, KAIST
  • Seoul, Republic of Korea
  • 04:21 (UTC +09:00)
  • Instagram _.wodyd._
View GitHub Profile
@buttercrab
buttercrab / gc-example.rs
Last active June 25, 2023 16:50
Simple GC in Rust
use std::cell::RefCell;
use crate::gc::{collect, Gc, GcCtx, Trace};
#[derive(Clone)]
struct Node {
id: usize,
next: RefCell<Option<Gc<Node>>>,
}
@buttercrab
buttercrab / 📊 Weekly development breakdown
Last active August 24, 2023 00:56
📊 Weekly development breakdown
C++ 12 hrs 55 mins ████████████████████░ 95.6%
Java 27 mins ▋░░░░░░░░░░░░░░░░░░░░ 3.3%
ObjectiveC 4 mins ░░░░░░░░░░░░░░░░░░░░░ 0.6%
C 1 min ░░░░░░░░░░░░░░░░░░░░░ 0.2%
Brainfuck 1 min ░░░░░░░░░░░░░░░░░░░░░ 0.2%
@buttercrab
buttercrab / field.cpp
Last active October 21, 2021 03:32
c++ field implementation for Problem Solving
/**
* @class field
* Number that is in modular Mod
*
* @tparam Mod should be prime number
*/
template<long long Mod>
class field {
@buttercrab
buttercrab / quic.pdf
Last active September 29, 2021 08:20
구글의 새로운 프로토콜 QUIC
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@buttercrab
buttercrab / rbtree.h
Created January 20, 2020 02:40
red black tree implementation in c++
/**
* @class rbtree
*
* @details Red Black Tree Implementation
*
* @author Jaeyong Sung
*
* @date April 29, 2018
*/
@buttercrab
buttercrab / persistent_seg.cpp
Created October 23, 2019 11:45
persistent segment tree implementation in c++
#include <bits/stdc++.h>
using namespace std;
int func(int a, int b) {
// binary function
// ex) return gcd(a, b);
// ex) return a * b;
// ex) return a ^ b;
// BUT! associated law has to be held
@buttercrab
buttercrab / dynamic_seg.cpp
Last active October 24, 2019 06:08
dynamic segment tree implementation in c++
#include <bits/stdc++.h>
using namespace std;
// identity element of binary function
int e = 0;
int func(int a, int b) {
// binary function
// ex) return gcd(a, b);
@buttercrab
buttercrab / lazy_seg.cpp
Last active October 28, 2019 03:16
segment tree implementation with lazy propagation in c++
#include <bits/stdc++.h>
using namespace std;
int func(int a, int b) {
// binary function
// ex) return gcd(a, b);
// ex) return a * b;
// ex) return a ^ b;
// BUT! associated law has to be held
@buttercrab
buttercrab / segment_tree.cpp
Last active October 23, 2019 06:49
segment tree implementation in c++
#include <bits/stdc++.h>
using namespace std;
int func(int a, int b) {
// binary function
// ex) return gcd(a, b);
// ex) return a * b;
// ex) return a ^ b;
// BUT! associated law has to be held