Skip to content

Instantly share code, notes, and snippets.

View 3-24's full-sized avatar
🎯
Focusing

Youngseok Choi 3-24

🎯
Focusing
View GitHub Profile
@3-24
3-24 / tips.md
Created April 23, 2020 14:12
핀토스 팁 끄적끄적

GDB 사용법

Setup

shell 하나에서 pintos --gdb ~~~ 나머지 shell에서 gdb kernel.otarget remote localhost:1234

Breakpoints

b process.c:345 : process.c의 345번째 줄에 삽입

@3-24
3-24 / randombot.py
Created March 28, 2020 04:58
디스코드 랜덤봇
#!/usr/bin/python3
import discord
import random
import os
TOKEN = os.environ["randombot_TOKEN"]
client = discord.Client()
@client.event
async def on_ready():
@3-24
3-24 / change_key.md
Created August 16, 2019 07:46
ubuntu 한영키 설정
$ sudo vim /usr/share/X11/xkb/symbols/altwin

에서 symbols[Group1] = [ Alt_R, Meta_R ]의 값을 다음과 같이 바꿔준다:

// Meta is mapped to second level of Alt.
partial modifier_keys
xkb_symbols "meta_alt" {
@3-24
3-24 / change_key.md
Created August 16, 2019 07:46
ubuntu 한영키 설정
$ sudo vim /usr/share/X11/xkb/symbols/altwin

에서 symbols[Group1] = [ Alt_R, Meta_R ]의 값을 다음과 같이 바꿔준다:

// Meta is mapped to second level of Alt.
partial modifier_keys
xkb_symbols "meta_alt" {
@3-24
3-24 / change_key.md
Created August 16, 2019 07:46
ubuntu 한영키 설정
$ sudo vim /usr/share/X11/xkb/symbols/altwin

에서 symbols[Group1] = [ Alt_R, Meta_R ]의 값을 다음과 같이 바꿔준다:

// Meta is mapped to second level of Alt.
partial modifier_keys
xkb_symbols "meta_alt" {
@3-24
3-24 / change_key.md
Created August 16, 2019 07:46
ubuntu 한영키 설정
$ sudo vim /usr/share/X11/xkb/symbols/altwin

에서 symbols[Group1] = [ Alt_R, Meta_R ]의 값을 다음과 같이 바꿔준다:

// Meta is mapped to second level of Alt.
partial modifier_keys
xkb_symbols "meta_alt" {
@3-24
3-24 / feynnman_algorithm.py
Last active November 19, 2018 11:49
This is variation of Feynnman's problem solving algorithm written in Python. This code requires coffee because I love it. Have FUN!
##### Feynnman Algorithm #####
# 1. Write down the problem.
# 2. Think real hard.
# 3. Write down the solution.
##############################
class Paper(object):
def __init__(self):
self.s = ""
def write_down(self,string):
self.s += string
@3-24
3-24 / changeTyporaDelimiter.py
Last active September 15, 2018 02:23
Typora sets the math equations delimiters as ($,$) and ((<p class='md-mathblock>)$,$) for HTML source. This file converts the delimiters to (\( , \)) and ( \[, \] ) to use in Mathjax using in-line inputs and output.txt.
def checkInline(s):
i = 0
while True:
try:
if s[i] == '$':
return i
except IndexError:
return -1
i += 1
@3-24
3-24 / mergesort.py
Last active September 13, 2018 16:52
user defined list sorting function using divide-and-conquer
def merge(X,left,middle,right): #Assume that left and right part are sorted
A=X[left:middle+1]
B=X[middle+1:right+1]
a,b=len(A),len(B)
i,j=0,0 #i for A, j for B
while (i!=a and j!=b): #compare elements of both part until one reaches end
if A[i]<=B[j]: #right one is bigger
X[left+i+j]=A[i] #Modify X i+j th element as left one
i+=1
else:
@3-24
3-24 / 1707.py
Created September 13, 2018 05:38
Checking Bipartite Graph
test_nbr = int(input()) # number of test cases
def isBipartite():
# v and e is number of vertexes and edges, respectively.
v,e = map(int,input().split())
# None if not colored
# If colored, there are two bool cases: False and True.
colorArr = [None for _ in range(v+1)]
adjacentPoints = [[] for _ in range(v+1)]