Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Jiun Bae jiunbae

🏠
Working from home
View GitHub Profile
View truncate.py
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
손코딩은 나쁜게 아닙니다.
View keybase.md

Keybase proof

I hereby claim:

  • I am jiunbae on github.
  • I am jiunbae (https://keybase.io/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
jiunbae / 띠용 코드 챌린지
Last active Dec 2, 2021
제1회 프로그래머스 배 띠용 코드 챌린지 ~ 한 줄로 짤 코드를 누가 436 줄로 만들어놨어요? ~
View 띠용 코드 챌린지
## Author: Jiun Bae (2019/08/18)
## ## See also (https://github.com/jiunbae/ITE4053/tree/master/NumpyNeuralNetwork)
from typing import Optional, List, Union, Tuple, Iterable, Callable
from functools import reduce
import numpy as np
## Class Definition
# _Module
@jiunbae
jiunbae / list.h
Created Dec 3, 2017
Lock Free Linked List
View list.h
/*****************************************************************************
MIT License
Copyright (c) 2017 Bae jiun, Maybe
@see also https://choosealicense.com/licenses/mit/
*****************************************************************************/
@jiunbae
jiunbae / thread.Pool.java
Last active Nov 28, 2017
Simple thread pool
View thread.Pool.java
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
jiunbae / plot drawer
Last active Oct 27, 2017
plot drawer for Project3@ITE4065
View plot drawer
#!/bin/python
'''
File name: draw.py
Author: Bae Jiun, Maybe
Date created: 10/27/2017
Requirements:
- matplotlib
'''
from subprocess import Popen, PIPE
@jiunbae
jiunbae / Thread.h
Created Sep 26, 2017
Thread::Pool support C++11 standard
View Thread.h
#ifndef THREAD_POOL_H
#define THREAD_POOL_H
#include <vector>
#include <queue>
#include <memory>
#include <thread>
#include <mutex>
#include <condition_variable>
#include <future>
#include <functional>
@jiunbae
jiunbae / bogo_genetic.py
Created Jul 19, 2017
Optimizing bogosort genetic algorithm
View bogo_genetic.py
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
ta_debug.exe
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!
ta_debug_64.exe
157696 bytes