Skip to content

Instantly share code, notes, and snippets.

Working from home

Jiun Bae jiunbae

Working from home
View GitHub Profile
def truncate(string: str, max_length: int, suffix: str = "...", include_suffix_length: bool = True, mode: str = "center"):
"""Truncate string
:param string: input string
:param include_suffix_length: include suffix length to max_length
:param max_length: if string length is bigger than max_length, than truncate
:param suffix: trucate string, replace remain string to suffix
:param mode: select in ['left', 'center', 'right']
if include_suffix_length:
View soncoding
손코딩은 나쁜게 아닙니다.

Keybase proof

I hereby claim:

  • I am jiunbae on github.
  • I am jiunbae ( on keybase.
  • I have a public key whose fingerprint is 5588 48C3 6FB8 B5B9 CB85 17C8 260E B1CC 493F 6221

To claim this, I am signing this object:

jiunbae / 띠용 코드 챌린지
Last active Dec 2, 2021
제1회 프로그래머스 배 띠용 코드 챌린지 ~ 한 줄로 짤 코드를 누가 436 줄로 만들어놨어요? ~
View 띠용 코드 챌린지
## Author: Jiun Bae (2019/08/18)
## ## See also (
from typing import Optional, List, Union, Tuple, Iterable, Callable
from functools import reduce
import numpy as np
## Class Definition
# _Module
jiunbae / list.h
Created Dec 3, 2017
Lock Free Linked List
View list.h
MIT License
Copyright (c) 2017 Bae jiun, Maybe
@see also
jiunbae /
Last active Nov 28, 2017
Simple thread pool
package concurrent;
import java.util.Arrays;
import java.util.concurrent.LinkedBlockingQueue;
public class Pool {
private boolean terminate;
private final Worker[] workers;
private final LinkedBlockingQueue<Runnable> queue;
jiunbae / plot drawer
Last active Oct 27, 2017
plot drawer for Project3@ITE4065
View plot drawer
File name:
Author: Bae Jiun, Maybe
Date created: 10/27/2017
- matplotlib
from subprocess import Popen, PIPE
jiunbae / Thread.h
Created Sep 26, 2017
Thread::Pool support C++11 standard
View Thread.h
#include <vector>
#include <queue>
#include <memory>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <future>
#include <functional>
jiunbae /
Created Jul 19, 2017
Optimizing bogosort genetic algorithm
from random import sample, uniform, randrange, shuffle
from time import sleep
def breed(mother, father):
fetus = mother[:randrange(len(mother))]
sperm = list(filter(lambda x: x not in fetus, father))
return fetus + sperm
def fitness(array):
return len(list(filter(lambda x: x[0]==x[1],
View ELE3019_log
115200 bytes
0 ms program start!
0 ms process start!
1054 ms vector generated! 1000000
1318 ms vector swaped!! 100000
3543 ms vector sorted!
3544 ms program done!
157696 bytes