Skip to content

Instantly share code, notes, and snippets.

View theeluwin's full-sized avatar
🎹
스콜라아이돌교수버튜버

Jinseok Seol theeluwin

🎹
스콜라아이돌교수버튜버
View GitHub Profile
@theeluwin
theeluwin / linear_regression.c
Created January 3, 2026 16:25
linear regression in C
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#define NOISE_SCALE 5.0
#define EPSILON 1e-12
#define MAX_FILE_PATH_LENGTH 100
#define MAX_FEATURE_DIMENSION 2
#define MAX_DATASET_SIZE 10000
#define TEST_DATASET_SIZE_RATIO 0.1
@theeluwin
theeluwin / queue_with_two_stacks.py
Created November 25, 2025 08:20
Queue with two stacks
from typing import (
Any,
Optional,
)
class Node:
def __init__(self, value: Any) -> None:
self.value = value
@theeluwin
theeluwin / git_get_all.sh
Last active July 19, 2022 07:14
clone everything, everything
mkdir repo
cd repo
git clone --bare path/to/repo.git .git
git config --unset core.bare
git reset --hard
@theeluwin
theeluwin / well_documented_transformer.py
Last active January 18, 2022 19:36
Well-documented Transformer
import torch
import torch.nn as nn
from typing import Optional
from math import (
pi,
sqrt,
)
@theeluwin
theeluwin / calc_batch_rec_metrics_per_k.py
Last active December 13, 2021 13:12
HR, Recall, nDCG, AUROC @ k (recommendation evaluation metric)
import torch
from typing import (
Any,
List,
Dict,
)
def calc_batch_rec_metrics_per_k(ranks: torch.LongTensor,
import os
from unicodedata import normalize
def walk_normalize(target_dir):
for root, dirs, files in os.walk(target_dir):
for name in files:
path = os.path.join(root, name)
if name == '.DS_Store':
@theeluwin
theeluwin / randaug.py
Created June 25, 2021 14:39
from @ihl7029
import random
import PIL
import PIL.ImageOps
import PIL.ImageEnhance
import PIL.ImageDraw
__all__ = (
'augment_bound',
@theeluwin
theeluwin / get_logger.py
Created July 20, 2020 14:14
맨날 쓰는 그 로거
def get_logger(name, log_dir, use_formatter=True):
# 함수를 처음 부르는 경우, static 변수를 추가
if not hasattr(get_logger, '_name2logger'):
get_logger._name2logger = {}
# 생성한적 없는 로거 객체의 경우, 초기화
if name not in get_logger._name2logger:
# 로그 파일 경로 설정
@theeluwin
theeluwin / gom_downloader.py
Created February 23, 2020 06:41
곰자막 다운로드 스크립트 (죄송해요 곰앤컴퍼니 여러분)
# -*- coding: utf -*-
import os
import time
import logging
import argparse
import requests
from bs4 import BeautifulSoup
@theeluwin
theeluwin / clean_debug_stuff.py
Created January 13, 2020 15:16
인생 백업할때 소스코드만 백업합시다.
# -*- coding: utf-8 -*-
import os
import shutil
TARGET_PATH = ""
bad_dirnames = (
'venv',