diff --git a/.gitignore b/.gitignore index 962f222..1e69c34 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,2 @@ -public/* *.lock .hugo_build.lock diff --git a/public/2021/05/파이썬으로-구현한-뉴턴의-방정식과-적분방정식/index.html b/public/2021/05/파이썬으로-구현한-뉴턴의-방정식과-적분방정식/index.html new file mode 100644 index 0000000..4e8c3df --- /dev/null +++ b/public/2021/05/파이썬으로-구현한-뉴턴의-방정식과-적분방정식/index.html @@ -0,0 +1,312 @@ + + + + + + + + +파이썬으로 구현한 뉴턴의 방정식과 적분방정식 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 파이썬으로 구현한 뉴턴의 방정식과 적분방정식 +

+ + +
+
+

우리의 세계에서 물체의 역학적 운동을 지배하는, 지배방정식이 있죠.뉴턴의 법칙, 방정식입니다.뉴턴의 법칙은 총 세개의 방정식이 있죠. 이 세가지 법칙만을 이용해서 물체의 운동을 계산할 수 있습니다.이것을 바탕으로 만들어진 역설이 라플라스의 역설이죠. 만약 모든 분자의 가속도, 속도, 위치 세가지 정보를 알고 있다면, 뉴턴의 법칙에 근거하여 그 다음 상황을 예측할 수 있고, 따라서 이 세상, 아니면 그것을 넘어서서 모든 분자의 정보를 알 수 있습니다.우리가 여기서 분석할 것은 가장 쉬운 법칙, 뉴턴의 제 2법칙, 가속도의 법칙입니다.뉴턴의 가속도 법칙은 $ F = \frac{dp}{dt} $ 로 표현할 수 있습니다. 이 법칙에 의하면, 질량의 변화가 없는 물체에서, $ a $ 는 $ F$ 에 비례합니다. 따라서 각 순간 물체에 작용하는 힘의 크기를 안다면, 그 물체의 가속도를 알 수 있겠죠?

+

이때, 가속도와 속도, 변위의 정의를 이용하면 $ a = \frac{dv}{dt} $ 이고, $ v = \frac{dx}{dt} $입니다.가속도를 안다면 적분을 통해 속도를 알 수 있고, 속도를 안다면 변위를 알 수 있죠.정상상태에서는 물체에 작용하는 힘의 방정식을 구할 수 있습니다. 이것을 질량으로 나눠 가속도를 얻을 수 있고, 속도와 변위의 방정식을 얻을 수 있습니다.

+

하지만, 컴퓨터는 대수적으로 적분할 수 없습니다. (물론 할 수 있는 알고리즘도 있지만 불완전하죠)그렇다면 어떻게 각 시점에서 가속도의 값을 알고, 속도와 변위의 값을 알 수 있을까요?이렇게 미분방정식을 통해서 각 시점의 이산적인 변수값을 알 수 있도록 하는 것이 오일러 근사법입니다.오일러 근사법을 통틀어 이렇게 수치적으로 방정식을 해석하는 학문을 통틀어 수치해석학이라고 합니다.이렇게 물리를 시뮬레이션 하거나 컴퓨터로 해를 구할 때는 수치해석학을 사용합니다.

+

오일러 방정식이란,

+

$$ \frac{dy}{dx} = f(x) $$라고 표현되어지는 미분 방정식이 있을 때, 오일러 근사법을 이용하면 일정한 지점의 $y$ 값을 근사로 구할 수 있습니다.

+

$$ y_{n+1} = y_n + \frac{dy}{dx}|_{x_n} \Delta x $$ 라는 식으로 말이죠.

+

이 식을 이용하면 특정 원점으로부터 $\Delta x$만큼의 일정한 간격을 띄어가며 $y$ 를 근사할 수 있습니다.

+

이 방법으로 물체에 작용하는 힘을 알 때 변위와 속도를 구할 수 있습니다. 특정 $\Delta t$를 기준으로 $\Delta$의 $n$배만큼의 시점에서 구할 수 있습니다.

+

$$ v_{n+1} = v_n + \frac{dv}{dt}|_{t_n} \Delta t $$

+

$$ x_{n+1} = x_n + \frac{dx}{dt}|_{t_n} \Delta t $$

+

으로 말이죠..

+

이제 파이썬으로 오일러 근사법을 구현해 봅시다.

+

이렇게 데이터의 배열끼리의 연산을 취급할 때에는 파이썬의 수치분석 모듈인 Numpy를 사용합니다. 하지만, 간단한 시뮬레이션에서는 파이썬 기본으로도 충분합니다. 그래프를 표현하기 위해 matplotlib과 수식을 위해 math를 이용합니다.

+
import matplotlib.pyplot as plt 
+import math 
+x0 = 0.0
+y0 = 1.0
+dx = 0.01
+step = 1000
+dydx = lambda x, y: 1/y 
+x = [x0 + dx*i for i in range(step)] 
+y = [y0] 
+
+for n in range(step-1): 
+	y.append(y[n] + dydx(x[n],y[n]) * dx) 
+
+plt.plot(x, y) 
+plt.grid() 
+plt.xlabel("x") 
+plt.ylabel("y") 
+plt.legend() 
+plt.show()
+
$ \frac{dy}{dx} = \frac{1}{y} $
+

$ \frac{dy}{dx} = \frac{1}{y} $

+
+
+ + + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/07/cfd-with-python-navier-stokes-equation/index.html b/public/2021/07/cfd-with-python-navier-stokes-equation/index.html new file mode 100644 index 0000000..5e0642e --- /dev/null +++ b/public/2021/07/cfd-with-python-navier-stokes-equation/index.html @@ -0,0 +1,1103 @@ + + + + + + + + +CFD with Python (Navier-Stokes Equation) | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ CFD with Python (Navier-Stokes Equation) +

+ + +
+
+

1-D Linear Convection

+

1차원 선형 열전도 방정식은 가장 심플하면서도 가장 기초적인 방정식입니다.

+

$$ \frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0 $$

+

이 식을 오일러 방정식으로 변환하여 수치해석적으로 해를 구할 수 있도록 변환을 해줍니다.

+

$$ ui^{n+1} = u_i^n - c \frac{\Delta t}{\Delta x}(u_i^n-u{i-1}^n) $$

+

이제 이 오일러 방정식을 파이썬으로 구현해봅니다.

+
import numpy
+from matplotlib import pyplot
+import time, sys
+%matplotlib inline 
+
+nx = 41  # try changing this number from 41 to 81 and Run All ... what happens?
+dx = 2 / (nx-1)
+nt = 25    #nt is the number of timesteps we want to calculate
+dt = .025  #dt is the amount of time each timestep covers (delta t)
+c = 1      #assume wavespeed of c = 1
+
+u = numpy.ones(nx)      #numpy function ones()
+u[int(.5 / dx):int(1 / dx + 1)] = 2  #setting u = 2 between 0.5 and 1 as per our I.C.s
+
+un = numpy.ones(nx) #initialize a temporary array
+
+for n in range(nt):  #loop for values of n from 0 to nt, so it will run nt times
+    un = u.copy() ##copy the existing values of u into un
+    for i in range(1, nx): ## you can try commenting this line and...
+    #for i in range(nx): ## ... uncommenting this line and see what happens!
+        u[i] = un[i] - c * dt / dx * (un[i] - un[i-1])
+
+pyplot.plot(numpy.linspace(0, 2, nx), u);
+
+
+ +

1-D Convection Equation (Non-Linear)

+

$$ \frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} = 0 $$

+

$$ ui^{n+1} = u_i^n - u_i^n \frac{\Delta t}{\Delta x} (u_i^n - u{i-1}^n) $$

+
import numpy                 # we're importing numpy 
+from matplotlib import pyplot    # and our 2D plotting library
+%matplotlib inline
+
+
+nx = 41
+dx = 2 / (nx - 1)
+nt = 20    #nt is the number of timesteps we want to calculate
+dt = .025  #dt is the amount of time each timestep covers (delta t)
+
+u = numpy.ones(nx)      #as before, we initialize u with every value equal to 1.
+u[int(.5 / dx) : int(1 / dx + 1)] = 2  #then set u = 2 between 0.5 and 1 as per our I.C.s
+
+un = numpy.ones(nx) #initialize our placeholder array un, to hold the time-stepped solution
+
+for n in range(nt):  #iterate through time
+    un = u.copy() ##copy the existing values of u into un
+    for i in range(1, nx):  ##now we'll iterate through the u array
+    
+     ###This is the line from Step 1, copied exactly.  Edit it for our new equation.
+     ###then uncomment it and run the cell to evaluate Step 2   
+      
+           ###u[i] = un[i] - c * dt / dx * (un[i] - un[i-1]) 
+
+        
+pyplot.plot(numpy.linspace(0, 2, nx), u) ##Plot the results
+

1-D Diffusion Equation

+

$$ \frac{\partial u}{\partial t}= \nu \frac{\partial^2 u}{\partial x^2} $$

+

$$ u*{i}^{n+1}=u*{i}^{n}+\frac{\nu\Delta t}{\Delta x^2}(u*{i+1}^{n}-2u*{i}^{n}+u_{i-1}^{n}) $$

+
import numpy                 #loading our favorite library
+from matplotlib import pyplot    #and the useful plotting library
+%matplotlib inline
+
+nx = 41
+dx = 2 / (nx - 1)
+nt = 20    #the number of timesteps we want to calculate
+nu = 0.3   #the value of viscosity
+sigma = .2 #sigma is a parameter, we'll learn more about it later
+dt = sigma * dx**2 / nu #dt is defined using sigma ... more later!
+
+
+u = numpy.ones(nx)      #a numpy array with nx elements all equal to 1.
+u[int(.5 / dx):int(1 / dx + 1)] = 2  #setting u = 2 between 0.5 and 1 as per our I.C.s
+
+un = numpy.ones(nx) #our placeholder array, un, to advance the solution in time
+
+for n in range(nt):  #iterate through time
+    un = u.copy() ##copy the existing values of u into un
+    for i in range(1, nx - 1):
+        u[i] = un[i] + nu * dt / dx**2 * (un[i+1] - 2 * un[i] + un[i-1])
+        
+pyplot.plot(numpy.linspace(0, 2, nx), u);
+
+
+ +

Burger’s Equation

+

$$ \frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} = \nu \frac{\partial ^2u}{\partial x^2} $$

+

$$ ui^{n+1} = u_i^n - u_i^n \frac{\Delta t}{\Delta x} (u_i^n - u{i-1}^n) + \nu \frac{\Delta t}{\Delta x^2}(u*{i+1}^n - 2u_i^n + u*{i-1}^n) $$

+
import numpy
+import sympy
+from sympy import init_printing
+from matplotlib import pyplot
+from sympy.utilities.lambdify import lambdify
+
+%matplotlib inline
+init_printing(use_latex=True)
+
+x, nu, t = sympy.symbols('x nu t')
+phi = (sympy.exp(-(x - 4 * t)**2 / (4 * nu * (t + 1))) +
+       sympy.exp(-(x - 4 * t - 2 * sympy.pi)**2 / (4 * nu * (t + 1))))
+
+phiprime = phi.diff(x)
+
+u = -2 * nu * (phiprime / phi) + 4
+ufunc = lambdify((t, x, nu), u)
+
+###variable declarations
+nx = 101
+nt = 100
+dx = 2 * numpy.pi / (nx - 1)
+nu = .07
+dt = dx * nu
+
+x = numpy.linspace(0, 2 * numpy.pi, nx)
+un = numpy.empty(nx)
+t = 0
+
+u = numpy.asarray([ufunc(t, x0, nu) for x0 in x])
+
+for n in range(nt):
+    un = u.copy()
+    for i in range(1, nx-1):
+        u[i] = un[i] - un[i] * dt / dx *(un[i] - un[i-1]) + nu * dt / dx**2 *\
+                (un[i+1] - 2 * un[i] + un[i-1])
+    u[0] = un[0] - un[0] * dt / dx * (un[0] - un[-2]) + nu * dt / dx**2 *\
+                (un[1] - 2 * un[0] + un[-2])
+    u[-1] = u[0]
+        
+u_analytical = numpy.asarray([ufunc(nt * dt, xi, nu) for xi in x])
+
+pyplot.figure(figsize=(11, 7), dpi=100)
+pyplot.plot(x,u, marker='o', lw=2, label='Computational')
+pyplot.plot(x, u_analytical, label='Analytical')
+pyplot.xlim([0, 2 * numpy.pi])
+pyplot.ylim([0, 10])
+pyplot.legend();
+
+
+ +

2-D Linear Convection

+

$$ \frac{\partial u}{\partial t}+c\frac{\partial u}{\partial x} + c\frac{\partial u}{\partial y} = 0 $$

+

$$ u*{i,j}^{n+1} = u*{i,j}^n-c \frac{\Delta t}{\Delta x}(u*{i,j}^n-u*{i-1,j}^n)-c \frac{\Delta t}{\Delta y}(u*{i,j}^n-u*{i,j-1}^n) $$

+
from mpl_toolkits.mplot3d import Axes3D    ##New Library required for projected 3d plots
+
+import numpy
+from matplotlib import pyplot, cm
+%matplotlib inline
+
+###variable declarations
+nx = 81
+ny = 81
+nt = 100
+c = 1
+dx = 2 / (nx - 1)
+dy = 2 / (ny - 1)
+sigma = .2
+dt = sigma * dx
+
+x = numpy.linspace(0, 2, nx)
+y = numpy.linspace(0, 2, ny)
+
+u = numpy.ones((ny, nx)) ##create a 1xn vector of 1's
+un = numpy.ones((ny, nx)) ##
+
+###Assign initial conditions
+
+##set hat function I.C. : u(.5<=x<=1 && .5<=y<=1 ) is 2
+u[int(.5 / dy):int(1 / dy + 1),int(.5 / dx):int(1 / dx + 1)] = 2 
+
+###Plot Initial Condition
+##the figsize parameter can be used to produce different sized images
+fig = pyplot.figure(figsize=(11, 7), dpi=100)
+ax = fig.gca(projection='3d')                      
+X, Y = numpy.meshgrid(x, y)                            
+surf = ax.plot_surface(X, Y, u[:], cmap=cm.viridis)
+
+
+ +

2-D Convection

+

$$ \frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} + v \frac{\partial u}{\partial y} = 0 $$$$ \frac{\partial v}{\partial t} + u \frac{\partial v}{\partial x} + v \frac{\partial v}{\partial y} = 0 $$$$ u*{i,j}^{n+1} = u*{i,j}^n - u*{i,j} \frac{\Delta t}{\Delta x} (u*{i,j}^n-u*{i-1,j}^n) - v*{i,j}^n \frac{\Delta t}{\Delta y} (u*{i,j}^n-u*{i,j-1}^n) $$$$ v*{i,j}^{n+1} = v*{i,j}^n - u*{i,j} \frac{\Delta t}{\Delta x} (v*{i,j}^n-v*{i-1,j}^n) - v*{i,j}^n \frac{\Delta t}{\Delta y} (v*{i,j}^n-v*{i,j-1}^n) $$

+
from mpl_toolkits.mplot3d import Axes3D
+from matplotlib import pyplot, cm
+import numpy
+%matplotlib inline
+
+###variable declarations
+nx = 101
+ny = 101
+nt = 80
+c = 1
+dx = 2 / (nx - 1)
+dy = 2 / (ny - 1)
+sigma = .2
+dt = sigma * dx
+
+x = numpy.linspace(0, 2, nx)
+y = numpy.linspace(0, 2, ny)
+
+u = numpy.ones((ny, nx)) ##create a 1xn vector of 1's
+v = numpy.ones((ny, nx))
+un = numpy.ones((ny, nx))
+vn = numpy.ones((ny, nx))
+
+###Assign initial conditions
+##set hat function I.C. : u(.5<=x<=1 && .5<=y<=1 ) is 2
+u[int(.5 / dy):int(1 / dy + 1), int(.5 / dx):int(1 / dx + 1)] = 2
+##set hat function I.C. : v(.5<=x<=1 && .5<=y<=1 ) is 2
+v[int(.5 / dy):int(1 / dy + 1), int(.5 / dx):int(1 / dx + 1)] = 2
+fig = pyplot.figure(figsize=(11, 7), dpi=100)
+ax = fig.gca(projection='3d')
+X, Y = numpy.meshgrid(x, y)
+
+ax.plot_surface(X, Y, u, cmap=cm.viridis, rstride=2, cstride=2)
+ax.set_xlabel('$x$')
+ax.set_ylabel('$y$');
+
+
+ +

2D Diffusion

+

$$ \frac{\partial u}{\partial t} = \nu \frac{\partial ^2 u}{\partial x^2} + \nu \frac{\partial ^2 u}{\partial y^2} $$$$ \begin{split}u*{i,j}^{n+1} = u*{i,j}^n &+ \frac{\nu \Delta t}{\Delta x^2}(u*{i+1,j}^n - 2 u*{i,j}^n + u*{i-1,j}^n) &+ \frac{\nu \Delta t}{\Delta y^2}(u*{i,j+1}^n-2 u*{i,j}^n + u*{i,j-1}^n)\end{split} $$

+
import numpy
+from matplotlib import pyplot, cm
+from mpl_toolkits.mplot3d import Axes3D ##library for 3d projection plots
+%matplotlib inline
+###variable declarations
+nx = 31
+ny = 31
+nt = 17
+nu = .05
+dx = 2 / (nx - 1)
+dy = 2 / (ny - 1)
+sigma = .25
+dt = sigma * dx * dy / nu
+
+x = numpy.linspace(0, 2, nx)
+y = numpy.linspace(0, 2, ny)
+
+u = numpy.ones((ny, nx))  # create a 1xn vector of 1's
+un = numpy.ones((ny, nx))
+
+###Assign initial conditions
+# set hat function I.C. : u(.5<=x<=1 && .5<=y<=1 ) is 2
+u[int(.5 / dy):int(1 / dy + 1),int(.5 / dx):int(1 / dx + 1)] = 2  
+
+###Run through nt timesteps
+def diffuse(nt):
+    u[int(.5 / dy):int(1 / dy + 1),int(.5 / dx):int(1 / dx + 1)] = 2  
+    
+    for n in range(nt + 1): 
+        un = u.copy()
+        u[1:-1, 1:-1] = (un[1:-1,1:-1] + 
+                        nu * dt / dx**2 * 
+                        (un[1:-1, 2:] - 2 * un[1:-1, 1:-1] + un[1:-1, 0:-2]) +
+                        nu * dt / dy**2 * 
+                        (un[2:,1: -1] - 2 * un[1:-1, 1:-1] + un[0:-2, 1:-1]))
+        u[0, :] = 1
+        u[-1, :] = 1
+        u[:, 0] = 1
+        u[:, -1] = 1
+
+    
+    fig = pyplot.figure()
+    ax = fig.gca(projection='3d')
+    surf = ax.plot_surface(X, Y, u[:], rstride=1, cstride=1, cmap=cm.viridis,
+        linewidth=0, antialiased=True)
+    ax.set_zlim(1, 2.5)
+    ax.set_xlabel('$x$')
+    ax.set_ylabel('$y$');
+
+diffuse(14)
+
+
+ +

Burgers’ Equation in 2D

+

$$ \frac{\partial u}{\partial t} + u \frac{\partial u}{\partial x} + v \frac{\partial u}{\partial y} = \nu ; \left(\frac{\partial ^2 u}{\partial x^2} + \frac{\partial ^2 u}{\partial y^2}\right) $$$$ \frac{\partial v}{\partial t} + u \frac{\partial v}{\partial x} + v \frac{\partial v}{\partial y} = \nu ; \left(\frac{\partial ^2 v}{\partial x^2} + \frac{\partial ^2 v}{\partial y^2}\right) $$$$ \begin{split}v*{i,j}^{n+1} = & v*{i,j}^n - \frac{\Delta t}{\Delta x} u*{i,j}^n (v*{i,j}^n - v*{i-1,j}^n) - \frac{\Delta t}{\Delta y} v*{i,j}^n (v*{i,j}^n - v*{i,j-1}^n) &+ \frac{\nu \Delta t}{\Delta x^2}(v*{i+1,j}^n-2v*{i,j}^n+v*{i-1,j}^n) + \frac{\nu \Delta t}{\Delta y^2} (v*{i,j+1}^n - 2v*{i,j}^n + v*{i,j-1}^n)\end{split} $$

+
import numpy
+from matplotlib import pyplot, cm
+from mpl_toolkits.mplot3d import Axes3D
+%matplotlib inline
+###variable declarations
+nx = 41
+ny = 41
+nt = 120
+c = 1
+dx = 2 / (nx - 1)
+dy = 2 / (ny - 1)
+sigma = .0009
+nu = 0.01
+dt = sigma * dx * dy / nu
+
+
+x = numpy.linspace(0, 2, nx)
+y = numpy.linspace(0, 2, ny)
+
+u = numpy.ones((ny, nx))  # create a 1xn vector of 1's
+v = numpy.ones((ny, nx))
+un = numpy.ones((ny, nx)) 
+vn = numpy.ones((ny, nx))
+comb = numpy.ones((ny, nx))
+
+###Assign initial conditions
+
+##set hat function I.C. : u(.5<=x<=1 && .5<=y<=1 ) is 2
+u[int(.5 / dy):int(1 / dy + 1),int(.5 / dx):int(1 / dx + 1)] = 2 
+##set hat function I.C. : u(.5<=x<=1 && .5<=y<=1 ) is 2
+v[int(.5 / dy):int(1 / dy + 1),int(.5 / dx):int(1 / dx + 1)] = 2
+###(plot ICs)
+for n in range(nt + 1): ##loop across number of time steps
+    un = u.copy()
+    vn = v.copy()
+
+    u[1:-1, 1:-1] = (un[1:-1, 1:-1] -
+                     dt / dx * un[1:-1, 1:-1] * 
+                     (un[1:-1, 1:-1] - un[1:-1, 0:-2]) - 
+                     dt / dy * vn[1:-1, 1:-1] * 
+                     (un[1:-1, 1:-1] - un[0:-2, 1:-1]) + 
+                     nu * dt / dx**2 * 
+                     (un[1:-1,2:] - 2 * un[1:-1, 1:-1] + un[1:-1, 0:-2]) + 
+                     nu * dt / dy**2 * 
+                     (un[2:, 1:-1] - 2 * un[1:-1, 1:-1] + un[0:-2, 1:-1]))
+    
+    v[1:-1, 1:-1] = (vn[1:-1, 1:-1] - 
+                     dt / dx * un[1:-1, 1:-1] *
+                     (vn[1:-1, 1:-1] - vn[1:-1, 0:-2]) -
+                     dt / dy * vn[1:-1, 1:-1] * 
+                    (vn[1:-1, 1:-1] - vn[0:-2, 1:-1]) + 
+                     nu * dt / dx**2 * 
+                     (vn[1:-1, 2:] - 2 * vn[1:-1, 1:-1] + vn[1:-1, 0:-2]) +
+                     nu * dt / dy**2 *
+                     (vn[2:, 1:-1] - 2 * vn[1:-1, 1:-1] + vn[0:-2, 1:-1]))
+     
+    u[0, :] = 1
+    u[-1, :] = 1
+    u[:, 0] = 1
+    u[:, -1] = 1
+    
+    v[0, :] = 1
+    v[-1, :] = 1
+    v[:, 0] = 1
+    v[:, -1] = 1
+fig = pyplot.figure(figsize=(11, 7), dpi=100)
+ax = fig.gca(projection='3d')
+X, Y = numpy.meshgrid(x, y)
+ax.plot_surface(X, Y, u, cmap=cm.viridis, rstride=1, cstride=1)
+ax.plot_surface(X, Y, v, cmap=cm.viridis, rstride=1, cstride=1)
+ax.set_xlabel('$x$')
+ax.set_ylabel('$y$');
+
+
+ +

2D Laplace Equation

+

$$ \frac{\partial ^2 p}{\partial x^2} + \frac{\partial ^2 p}{\partial y^2} = 0 $$$$ p*{i,j}^n = \frac{\Delta y^2(p*{i+1,j}^n+p*{i-1,j}^n)+\Delta x^2(p*{i,j+1}^n + p_{i,j-1}^n)}{2(\Delta x^2 + \Delta y^2)} $$

+
import numpy
+from matplotlib import pyplot, cm
+from mpl_toolkits.mplot3d import Axes3D
+%matplotlib inline
+
+def plot2D(x, y, p):
+    fig = pyplot.figure(figsize=(11, 7), dpi=100)
+    ax = fig.gca(projection='3d')
+    X, Y = numpy.meshgrid(x, y)
+    surf = ax.plot_surface(X, Y, p[:], rstride=1, cstride=1, cmap=cm.viridis,
+            linewidth=0, antialiased=False)
+    ax.set_xlim(0, 2)
+    ax.set_ylim(0, 1)
+    ax.view_init(30, 225)
+    ax.set_xlabel('$x$')
+    ax.set_ylabel('$y$')
+
+def laplace2d(p, y, dx, dy, l1norm_target):
+  l1norm = 1
+  pn = numpy.empty_like(p)
+
+  while l1norm > l1norm_target:
+      pn = p.copy()
+      p[1:-1, 1:-1] = ((dy**2 * (pn[1:-1, 2:] + pn[1:-1, 0:-2]) +
+                        dx**2 * (pn[2:, 1:-1] + pn[0:-2, 1:-1])) /
+                      (2 * (dx**2 + dy**2)))
+          
+      p[:, 0] = 0  # p = 0 @ x = 0
+      p[:, -1] = y  # p = y @ x = 2
+      p[0, :] = p[1, :]  # dp/dy = 0 @ y = 0
+      p[-1, :] = p[-2, :]  # dp/dy = 0 @ y = 1
+      l1norm = (numpy.sum(numpy.abs(p[:]) - numpy.abs(pn[:])) /
+              numpy.sum(numpy.abs(pn[:])))
+    
+  return p
+  
+nx = 31
+ny = 31
+c = 1
+dx = 2 / (nx - 1)
+dy = 2 / (ny - 1)
+
+
+##initial conditions
+p = numpy.zeros((ny, nx))  # create a XxY vector of 0's
+
+
+##plotting aids
+x = numpy.linspace(0, 2, nx)
+y = numpy.linspace(0, 1, ny)
+
+##boundary conditions
+p[:, 0] = 0  # p = 0 @ x = 0
+p[:, -1] = y  # p = y @ x = 2
+p[0, :] = p[1, :]  # dp/dy = 0 @ y = 0
+p[-1, :] = p[-2, :]  # dp/dy = 0 @ y = 1
+
+p = laplace2d(p, y, dx, dy, 1e-4)
+
+plot2D(x, y, p)
+
+
+ +

2D Poisson Equation

+

$$ \frac{\partial ^2 p}{\partial x^2} + \frac{\partial ^2 p}{\partial y^2} = b $$$$ p*{i,j}^{n}=\frac{(p*{i+1,j}^{n}+p*{i-1,j}^{n})\Delta y^2+(p*{i,j+1}^{n}+p*{i,j-1}^{n})\Delta x^2-b*{i,j}^{n}\Delta x^2\Delta y^2}{2(\Delta x^2+\Delta y^2)} $$

+
import numpy
+from matplotlib import pyplot, cm
+from mpl_toolkits.mplot3d import Axes3D
+%matplotlib inline
+# Parameters
+nx = 50
+ny = 50
+nt  = 100
+xmin = 0
+xmax = 2
+ymin = 0
+ymax = 1
+
+dx = (xmax - xmin) / (nx - 1)
+dy = (ymax - ymin) / (ny - 1)
+
+# Initialization
+p  = numpy.zeros((ny, nx))
+pd = numpy.zeros((ny, nx))
+b  = numpy.zeros((ny, nx))
+x  = numpy.linspace(xmin, xmax, nx)
+y  = numpy.linspace(xmin, xmax, ny)
+
+# Source
+b[int(ny / 4), int(nx / 4)]  = 100
+b[int(3 * ny / 4), int(3 * nx / 4)] = -100
+
+for it in range(nt):
+
+    pd = p.copy()
+
+    p[1:-1,1:-1] = (((pd[1:-1, 2:] + pd[1:-1, :-2]) * dy**2 +
+                    (pd[2:, 1:-1] + pd[:-2, 1:-1]) * dx**2 -
+                    b[1:-1, 1:-1] * dx**2 * dy**2) / 
+                    (2 * (dx**2 + dy**2)))
+
+    p[0, :] = 0
+    p[ny-1, :] = 0
+    p[:, 0] = 0
+    p[:, nx-1] = 0
+
+def plot2D(x, y, p):
+    fig = pyplot.figure(figsize=(11, 7), dpi=100)
+    ax = fig.gca(projection='3d')
+    X, Y = numpy.meshgrid(x, y)
+    surf = ax.plot_surface(X, Y, p[:], rstride=1, cstride=1, cmap=cm.viridis,
+            linewidth=0, antialiased=False)
+    ax.view_init(30, 225)
+    ax.set_xlabel('$x$')
+    ax.set_ylabel('$y$')
+    
+plot2D(x, y, p)
+

Cavity Flow with Navier–Stokes

+

$$ \frac{\partial \vec{v}}{\partial t}+(\vec{v}\cdot\nabla)\vec{v}=-\frac{1}{\rho}\nabla p + \nu \nabla^2\vec{v} $$$$ \frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+v\frac{\partial u}{\partial y} = -\frac{1}{\rho}\frac{\partial p}{\partial x}+\nu \left(\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2} \right) $$$$ \frac{\partial^2 p}{\partial x^2}+\frac{\partial^2 p}{\partial y^2} = -\rho\left(\frac{\partial u}{\partial x}\frac{\partial u}{\partial x}+2\frac{\partial u}{\partial y}\frac{\partial v}{\partial x}+\frac{\partial v}{\partial y}\frac{\partial v}{\partial y} \right) $$$$ \begin{split}p*{i,j}^{n} = & \frac{\left(p*{i+1,j}^{n}+p*{i-1,j}^{n}\right) \Delta y^2 + \left(p*{i,j+1}^{n}+p*{i,j-1}^{n}\right) \Delta x^2}{2\left(\Delta x^2+\Delta y^2\right)} & -\frac{\rho\Delta x^2\Delta y^2}{2\left(\Delta x^2+\Delta y^2\right)} & \times \left[\frac{1}{\Delta t}\left(\frac{u*{i+1,j}-u*{i-1,j}}{2\Delta x}+\frac{v*{i,j+1}-v*{i,j-1}}{2\Delta y}\right)-\frac{u*{i+1,j}-u*{i-1,j}}{2\Delta x}\frac{u*{i+1,j}-u*{i-1,j}}{2\Delta x} -2\frac{u*{i,j+1}-u*{i,j-1}}{2\Delta y}\frac{v*{i+1,j}-v*{i-1,j}}{2\Delta x}-\frac{v*{i,j+1}-v*{i,j-1}}{2\Delta y}\frac{v*{i,j+1}-v_{i,j-1}}{2\Delta y}\right]\end{split} $$

+
import numpy
+from matplotlib import pyplot, cm
+from mpl_toolkits.mplot3d import Axes3D
+%matplotlib inline
+nx = 41
+ny = 41
+nt = 500
+nit = 50
+c = 1
+dx = 2 / (nx - 1)
+dy = 2 / (ny - 1)
+x = numpy.linspace(0, 2, nx)
+y = numpy.linspace(0, 2, ny)
+X, Y = numpy.meshgrid(x, y)
+
+rho = 1
+nu = .1
+dt = .001
+
+u = numpy.zeros((ny, nx))
+v = numpy.zeros((ny, nx))
+p = numpy.zeros((ny, nx)) 
+b = numpy.zeros((ny, nx))
+
+def build_up_b(b, rho, dt, u, v, dx, dy):
+    
+    b[1:-1, 1:-1] = (rho * (1 / dt * 
+                    ((u[1:-1, 2:] - u[1:-1, 0:-2]) / 
+                     (2 * dx) + (v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy)) -
+                    ((u[1:-1, 2:] - u[1:-1, 0:-2]) / (2 * dx))**2 -
+                      2 * ((u[2:, 1:-1] - u[0:-2, 1:-1]) / (2 * dy) *
+                           (v[1:-1, 2:] - v[1:-1, 0:-2]) / (2 * dx))-
+                          ((v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy))**2))
+
+    return b
+
+def pressure_poisson(p, dx, dy, b):
+    pn = numpy.empty_like(p)
+    pn = p.copy()
+    
+    for q in range(nit):
+        pn = p.copy()
+        p[1:-1, 1:-1] = (((pn[1:-1, 2:] + pn[1:-1, 0:-2]) * dy**2 + 
+                          (pn[2:, 1:-1] + pn[0:-2, 1:-1]) * dx**2) /
+                          (2 * (dx**2 + dy**2)) -
+                          dx**2 * dy**2 / (2 * (dx**2 + dy**2)) * 
+                          b[1:-1,1:-1])
+
+        p[:, -1] = p[:, -2] # dp/dx = 0 at x = 2
+        p[0, :] = p[1, :]   # dp/dy = 0 at y = 0
+        p[:, 0] = p[:, 1]   # dp/dx = 0 at x = 0
+        p[-1, :] = 0        # p = 0 at y = 2
+        
+    return p
+
+def cavity_flow(nt, u, v, dt, dx, dy, p, rho, nu):
+    un = numpy.empty_like(u)
+    vn = numpy.empty_like(v)
+    b = numpy.zeros((ny, nx))
+    
+    for n in range(nt):
+        un = u.copy()
+        vn = v.copy()
+        
+        b = build_up_b(b, rho, dt, u, v, dx, dy)
+        p = pressure_poisson(p, dx, dy, b)
+        
+        u[1:-1, 1:-1] = (un[1:-1, 1:-1]-
+                         un[1:-1, 1:-1] * dt / dx *
+                        (un[1:-1, 1:-1] - un[1:-1, 0:-2]) -
+                         vn[1:-1, 1:-1] * dt / dy *
+                        (un[1:-1, 1:-1] - un[0:-2, 1:-1]) -
+                         dt / (2 * rho * dx) * (p[1:-1, 2:] - p[1:-1, 0:-2]) +
+                         nu * (dt / dx**2 *
+                        (un[1:-1, 2:] - 2 * un[1:-1, 1:-1] + un[1:-1, 0:-2]) +
+                         dt / dy**2 *
+                        (un[2:, 1:-1] - 2 * un[1:-1, 1:-1] + un[0:-2, 1:-1])))
+
+        v[1:-1,1:-1] = (vn[1:-1, 1:-1] -
+                        un[1:-1, 1:-1] * dt / dx *
+                       (vn[1:-1, 1:-1] - vn[1:-1, 0:-2]) -
+                        vn[1:-1, 1:-1] * dt / dy *
+                       (vn[1:-1, 1:-1] - vn[0:-2, 1:-1]) -
+                        dt / (2 * rho * dy) * (p[2:, 1:-1] - p[0:-2, 1:-1]) +
+                        nu * (dt / dx**2 *
+                       (vn[1:-1, 2:] - 2 * vn[1:-1, 1:-1] + vn[1:-1, 0:-2]) +
+                        dt / dy**2 *
+                       (vn[2:, 1:-1] - 2 * vn[1:-1, 1:-1] + vn[0:-2, 1:-1])))
+
+        u[0, :]  = 0
+        u[:, 0]  = 0
+        u[:, -1] = 0
+        u[-1, :] = 1    # set velocity on cavity lid equal to 1
+        v[0, :]  = 0
+        v[-1, :] = 0
+        v[:, 0]  = 0
+        v[:, -1] = 0
+        
+        
+    return u, v, p
+
+u = numpy.zeros((ny, nx))
+v = numpy.zeros((ny, nx))
+p = numpy.zeros((ny, nx))
+b = numpy.zeros((ny, nx))
+nt = 100
+u, v, p = cavity_flow(nt, u, v, dt, dx, dy, p, rho, nu)
+fig = pyplot.figure(figsize=(11,7), dpi=100)
+# plotting the pressure field as a contour
+pyplot.contourf(X, Y, p, alpha=0.5, cmap=cm.viridis)  
+pyplot.colorbar()
+# plotting the pressure field outlines
+pyplot.contour(X, Y, p, cmap=cm.viridis)  
+# plotting velocity field
+pyplot.quiver(X[::2, ::2], Y[::2, ::2], u[::2, ::2], v[::2, ::2]) 
+pyplot.xlabel('X')
+pyplot.ylabel('Y');
+
+
+ +
u = numpy.zeros((ny, nx))
+v = numpy.zeros((ny, nx))
+p = numpy.zeros((ny, nx))
+b = numpy.zeros((ny, nx))
+nt = 700
+u, v, p = cavity_flow(nt, u, v, dt, dx, dy, p, rho, nu)
+fig = pyplot.figure(figsize=(11, 7), dpi=100)
+pyplot.contourf(X, Y, p, alpha=0.5, cmap=cm.viridis)
+pyplot.colorbar()
+pyplot.contour(X, Y, p, cmap=cm.viridis)
+pyplot.quiver(X[::2, ::2], Y[::2, ::2], u[::2, ::2], v[::2, ::2])
+pyplot.xlabel('X')
+pyplot.ylabel('Y');
+
+
+ +
fig = pyplot.figure(figsize=(11, 7), dpi=100)
+pyplot.contourf(X, Y, p, alpha=0.5, cmap=cm.viridis)
+pyplot.colorbar()
+pyplot.contour(X, Y, p, cmap=cm.viridis)
+pyplot.streamplot(X, Y, u, v)
+pyplot.xlabel('X')
+pyplot.ylabel('Y');
+
+
+ +

Channel Flow with Navier–Stokes

+

$$ \frac{\partial u}{\partial t}+u\frac{\partial u}{\partial x}+v\frac{\partial u}{\partial y}=-\frac{1}{\rho}\frac{\partial p}{\partial x}+\nu\left(\frac{\partial^2 u}{\partial x^2}+\frac{\partial^2 u}{\partial y^2}\right)+F $$$$ \frac{\partial^2 p}{\partial x^2}+\frac{\partial^2 p}{\partial y^2}=-\rho\left(\frac{\partial u}{\partial x}\frac{\partial u}{\partial x}+2\frac{\partial u}{\partial y}\frac{\partial v}{\partial x}+\frac{\partial v}{\partial y}\frac{\partial v}{\partial y}\right) $$$$ \begin{split}p*{i,j}^{n} = & \frac{\left(p*{i+1,j}^{n}+p*{i-1,j}^{n}\right) \Delta y^2 + \left(p*{i,j+1}^{n}+p*{i,j-1}^{n}\right) \Delta x^2}{2(\Delta x^2+\Delta y^2)} & -\frac{\rho\Delta x^2\Delta y^2}{2\left(\Delta x^2+\Delta y^2\right)} & \times \left[\frac{1}{\Delta t} \left(\frac{u*{i+1,j}-u*{i-1,j}}{2\Delta x} + \frac{v*{i,j+1}-v*{i,j-1}}{2\Delta y}\right) - \frac{u*{i+1,j}-u*{i-1,j}}{2\Delta x}\frac{u*{i+1,j}-u*{i-1,j}}{2\Delta x} - 2\frac{u*{i,j+1}-u*{i,j-1}}{2\Delta y}\frac{v*{i+1,j}-v*{i-1,j}}{2\Delta x} - \frac{v*{i,j+1}-v*{i,j-1}}{2\Delta y}\frac{v*{i,j+1}-v_{i,j-1}}{2\Delta y}\right]\end{split} $$

+
import numpy
+from matplotlib import pyplot, cm
+from mpl_toolkits.mplot3d import Axes3D
+%matplotlib inline
+
+def build_up_b(rho, dt, dx, dy, u, v):
+    b = numpy.zeros_like(u)
+    b[1:-1, 1:-1] = (rho * (1 / dt * ((u[1:-1, 2:] - u[1:-1, 0:-2]) / (2 * dx) +
+                                      (v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy)) -
+                            ((u[1:-1, 2:] - u[1:-1, 0:-2]) / (2 * dx))**2 -
+                            2 * ((u[2:, 1:-1] - u[0:-2, 1:-1]) / (2 * dy) *
+                                 (v[1:-1, 2:] - v[1:-1, 0:-2]) / (2 * dx))-
+                            ((v[2:, 1:-1] - v[0:-2, 1:-1]) / (2 * dy))**2))
+    
+    # Periodic BC Pressure @ x = 2
+    b[1:-1, -1] = (rho * (1 / dt * ((u[1:-1, 0] - u[1:-1,-2]) / (2 * dx) +
+                                    (v[2:, -1] - v[0:-2, -1]) / (2 * dy)) -
+                          ((u[1:-1, 0] - u[1:-1, -2]) / (2 * dx))**2 -
+                          2 * ((u[2:, -1] - u[0:-2, -1]) / (2 * dy) *
+                               (v[1:-1, 0] - v[1:-1, -2]) / (2 * dx)) -
+                          ((v[2:, -1] - v[0:-2, -1]) / (2 * dy))**2))
+
+    # Periodic BC Pressure @ x = 0
+    b[1:-1, 0] = (rho * (1 / dt * ((u[1:-1, 1] - u[1:-1, -1]) / (2 * dx) +
+                                   (v[2:, 0] - v[0:-2, 0]) / (2 * dy)) -
+                         ((u[1:-1, 1] - u[1:-1, -1]) / (2 * dx))**2 -
+                         2 * ((u[2:, 0] - u[0:-2, 0]) / (2 * dy) *
+                              (v[1:-1, 1] - v[1:-1, -1]) / (2 * dx))-
+                         ((v[2:, 0] - v[0:-2, 0]) / (2 * dy))**2))
+    
+    return b
+
+def pressure_poisson_periodic(p, dx, dy):
+    pn = numpy.empty_like(p)
+    
+    for q in range(nit):
+        pn = p.copy()
+        p[1:-1, 1:-1] = (((pn[1:-1, 2:] + pn[1:-1, 0:-2]) * dy**2 +
+                          (pn[2:, 1:-1] + pn[0:-2, 1:-1]) * dx**2) /
+                         (2 * (dx**2 + dy**2)) -
+                         dx**2 * dy**2 / (2 * (dx**2 + dy**2)) * b[1:-1, 1:-1])
+
+        # Periodic BC Pressure @ x = 2
+        p[1:-1, -1] = (((pn[1:-1, 0] + pn[1:-1, -2])* dy**2 +
+                        (pn[2:, -1] + pn[0:-2, -1]) * dx**2) /
+                       (2 * (dx**2 + dy**2)) -
+                       dx**2 * dy**2 / (2 * (dx**2 + dy**2)) * b[1:-1, -1])
+
+        # Periodic BC Pressure @ x = 0
+        p[1:-1, 0] = (((pn[1:-1, 1] + pn[1:-1, -1])* dy**2 +
+                       (pn[2:, 0] + pn[0:-2, 0]) * dx**2) /
+                      (2 * (dx**2 + dy**2)) -
+                      dx**2 * dy**2 / (2 * (dx**2 + dy**2)) * b[1:-1, 0])
+        
+        # Wall boundary conditions, pressure
+        p[-1, :] =p[-2, :]  # dp/dy = 0 at y = 2
+        p[0, :] = p[1, :]  # dp/dy = 0 at y = 0
+    
+    return p
+
+##variable declarations
+nx = 41
+ny = 41
+nt = 10
+nit = 50 
+c = 1
+dx = 2 / (nx - 1)
+dy = 2 / (ny - 1)
+x = numpy.linspace(0, 2, nx)
+y = numpy.linspace(0, 2, ny)
+X, Y = numpy.meshgrid(x, y)
+
+
+##physical variables
+rho = 1
+nu = .1
+F = 1
+dt = .01
+
+#initial conditions
+u = numpy.zeros((ny, nx))
+un = numpy.zeros((ny, nx))
+
+v = numpy.zeros((ny, nx))
+vn = numpy.zeros((ny, nx))
+
+p = numpy.ones((ny, nx))
+pn = numpy.ones((ny, nx))
+
+b = numpy.zeros((ny, nx))
+
+udiff = 1
+stepcount = 0
+
+while udiff > .001:
+    un = u.copy()
+    vn = v.copy()
+
+    b = build_up_b(rho, dt, dx, dy, u, v)
+    p = pressure_poisson_periodic(p, dx, dy)
+
+    u[1:-1, 1:-1] = (un[1:-1, 1:-1] -
+                     un[1:-1, 1:-1] * dt / dx * 
+                    (un[1:-1, 1:-1] - un[1:-1, 0:-2]) -
+                     vn[1:-1, 1:-1] * dt / dy * 
+                    (un[1:-1, 1:-1] - un[0:-2, 1:-1]) -
+                     dt / (2 * rho * dx) * 
+                    (p[1:-1, 2:] - p[1:-1, 0:-2]) +
+                     nu * (dt / dx**2 * 
+                    (un[1:-1, 2:] - 2 * un[1:-1, 1:-1] + un[1:-1, 0:-2]) +
+                     dt / dy**2 * 
+                    (un[2:, 1:-1] - 2 * un[1:-1, 1:-1] + un[0:-2, 1:-1])) + 
+                     F * dt)
+
+    v[1:-1, 1:-1] = (vn[1:-1, 1:-1] -
+                     un[1:-1, 1:-1] * dt / dx * 
+                    (vn[1:-1, 1:-1] - vn[1:-1, 0:-2]) -
+                     vn[1:-1, 1:-1] * dt / dy * 
+                    (vn[1:-1, 1:-1] - vn[0:-2, 1:-1]) -
+                     dt / (2 * rho * dy) * 
+                    (p[2:, 1:-1] - p[0:-2, 1:-1]) +
+                     nu * (dt / dx**2 *
+                    (vn[1:-1, 2:] - 2 * vn[1:-1, 1:-1] + vn[1:-1, 0:-2]) +
+                     dt / dy**2 * 
+                    (vn[2:, 1:-1] - 2 * vn[1:-1, 1:-1] + vn[0:-2, 1:-1])))
+
+    # Periodic BC u @ x = 2     
+    u[1:-1, -1] = (un[1:-1, -1] - un[1:-1, -1] * dt / dx * 
+                  (un[1:-1, -1] - un[1:-1, -2]) -
+                   vn[1:-1, -1] * dt / dy * 
+                  (un[1:-1, -1] - un[0:-2, -1]) -
+                   dt / (2 * rho * dx) *
+                  (p[1:-1, 0] - p[1:-1, -2]) + 
+                   nu * (dt / dx**2 * 
+                  (un[1:-1, 0] - 2 * un[1:-1,-1] + un[1:-1, -2]) +
+                   dt / dy**2 * 
+                  (un[2:, -1] - 2 * un[1:-1, -1] + un[0:-2, -1])) + F * dt)
+
+    # Periodic BC u @ x = 0
+    u[1:-1, 0] = (un[1:-1, 0] - un[1:-1, 0] * dt / dx *
+                 (un[1:-1, 0] - un[1:-1, -1]) -
+                  vn[1:-1, 0] * dt / dy * 
+                 (un[1:-1, 0] - un[0:-2, 0]) - 
+                  dt / (2 * rho * dx) * 
+                 (p[1:-1, 1] - p[1:-1, -1]) + 
+                  nu * (dt / dx**2 * 
+                 (un[1:-1, 1] - 2 * un[1:-1, 0] + un[1:-1, -1]) +
+                  dt / dy**2 *
+                 (un[2:, 0] - 2 * un[1:-1, 0] + un[0:-2, 0])) + F * dt)
+
+    # Periodic BC v @ x = 2
+    v[1:-1, -1] = (vn[1:-1, -1] - un[1:-1, -1] * dt / dx *
+                  (vn[1:-1, -1] - vn[1:-1, -2]) - 
+                   vn[1:-1, -1] * dt / dy *
+                  (vn[1:-1, -1] - vn[0:-2, -1]) -
+                   dt / (2 * rho * dy) * 
+                  (p[2:, -1] - p[0:-2, -1]) +
+                   nu * (dt / dx**2 *
+                  (vn[1:-1, 0] - 2 * vn[1:-1, -1] + vn[1:-1, -2]) +
+                   dt / dy**2 *
+                  (vn[2:, -1] - 2 * vn[1:-1, -1] + vn[0:-2, -1])))
+
+    # Periodic BC v @ x = 0
+    v[1:-1, 0] = (vn[1:-1, 0] - un[1:-1, 0] * dt / dx *
+                 (vn[1:-1, 0] - vn[1:-1, -1]) -
+                  vn[1:-1, 0] * dt / dy *
+                 (vn[1:-1, 0] - vn[0:-2, 0]) -
+                  dt / (2 * rho * dy) * 
+                 (p[2:, 0] - p[0:-2, 0]) +
+                  nu * (dt / dx**2 * 
+                 (vn[1:-1, 1] - 2 * vn[1:-1, 0] + vn[1:-1, -1]) +
+                  dt / dy**2 * 
+                 (vn[2:, 0] - 2 * vn[1:-1, 0] + vn[0:-2, 0])))
+
+
+    # Wall BC: u,v = 0 @ y = 0,2
+    u[0, :] = 0
+    u[-1, :] = 0
+    v[0, :] = 0
+    v[-1, :]=0
+    
+    udiff = (numpy.sum(u) - numpy.sum(un)) / numpy.sum(u)
+    stepcount += 1
+
+fig = pyplot.figure(figsize = (11,7), dpi=100)
+pyplot.quiver(X[::3, ::3], Y[::3, ::3], u[::3, ::3], v[::3, ::3]);
+
+
+ +

출처> CFD Python: 12 steps to Navier-Stokes :: Lorena A. Barba Group (lorenabarba.com)

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/07/cryptography/index.html b/public/2021/07/cryptography/index.html new file mode 100644 index 0000000..c3ddf04 --- /dev/null +++ b/public/2021/07/cryptography/index.html @@ -0,0 +1,542 @@ + + + + + + + + +Cryptography | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Cryptography +

+ + +
+
+

Cryptography

+

공개키 암호화 알고리즘.

+

1. Diffie-Hellman

+

디피-헬먼 키 교환 방식은 암호화 통신을 위한 키를 교환하는 방식 중 하나이다. 두 통신 주체가 공통의 비밀 키를 사용할 수 있도록 하는 안전한 알고리즘이다. 디피-헬먼 방식은 기초적인 암호 통신 방법으로, 이 알고리즘에 RSA나 ECC같은 암호화 알고리즘을 합쳐서 암호화 통신이 성립된다. 공개키는 암호화할 수 있는 키이고, 개인키는 복호화할 수 있는 키이다.

+

디피-헬먼 키 교환은 공개키 암호화 방식에 기반한다. 공개키 암호화 방식이란, 자신의 공개키를 상대방에게 전송하고, 그 상대방은 그 공개키로 데이터를 암호화해서 전송하면, 자신은 자신의 개인키로 복호화 할 수 있어, 통신이 성립되는 방식이다. 이때 상호통신을 위해서는 서로의 개인키를 공개키를 이용하여 공유하고, 각각 공유한 개인키와 공유키를 이용하여 공통된 비밀키를 계산하여 그것으로 통신하거나, 서로 각자의 개인키로 복호화하여 통신할 수 있다. 공통된 비밀키를 사용한다면 대칭 키 알고리즘, 서로 다른 키를 사용한다면 비대칭 키 알고리즘이라 한다.

+

디피-헬먼 키 교환 방식은 이산수학의 난해성에 기초한다. 먼저, 상호에 매우 큰 소수 P와 임의의 정수 N을 교환한다. 이는 공개적으로 전송해도 문제가 없다. 이때, 서로 P보다 작은 정수 a, b를 임의로 설정하고, N의 a, N의 b승의 mod P를 서로 전송한다. 이후에, 서로 전송받은 N의 b, a승 mod P를 자신이 가지고 있는 정수 a, b를 이용해 N의 b승의 a승과 N의 a승의 b승 mod P를 계산한다. N의 ab승과 N의 ba승은 지수법칙에 의해 동일하므로 이 값을 서로 공통의 비밀키로 사용할 수 있다.

+

위 상황에서 중간의 사람은 N과 P, N의 a, N의 b승의 mod P를 알 수 있다. 키 값을 알기 위해서는 N^ab mod P를 구해야 하는데, 이를 위해서는 a나 b 둘 중 하나는 알아야 한다. 여기서, 이산수학의 난해성에 의해 중간자는 a, b값을 알 수 없고, 이에 기밀성이 유지된다.

+

하지만, DH알고리즘은 가장 중요한 취약점이 있다. MITM공격에는 아주 무력하고, 기밀성만 보장할 뿐 무결성, 인증 등 기타 보안의 필수 조건을 만족시키지 못한다. 인증이란, 서로간의 정체를 확실이 하는가에 대한 문제이다. MITM 공격이란, 중간에 다른 사람이 송신자의 정보를 가로채고, 수신자에게 위조된 정보, 즉 자신의 계산값을 전송하는 상황에서 일어난다. 이때 수신자는 그 정보가 중간자가 아닌 송신자에게서 온 정보라 믿고 비밀키를 만들 것이고, 이에 중간자는 그 비밀키를 알게 된다. 받은 정보가 제대로 된 송신자에게서 온 정보인지 확신할 수 있어야 한다는 것이 인증의 개념인데, 디피-헬먼 키 교횐은 이러한 방법이 없다. 이러한 취약점을 해결하기 위해 DH와 RSA, ECDH등 다른 암호화 알고리즘과 합쳐서 PKI 등을 사용하는 것이다.

+

2. RSA

+

RSA는 일반적으로 알려져 있듯이 매우 큰 소수는 소인수 분해할 수 없다. (매우 힘들다)는 것을 기초로 하고 있다. RSA는 이 방식의 개발자인 세 사람 이름의 앞글자를 따서 만들어 졌다. RSA도 DH와 마찬가지로 공개키 암호화 알고리즘이다. 현재 인터넷에 사용되는 거의 모든 보안 체계는 RSA이며, 이는 RSA가 오랫동안 인정된, 안정적인 암호화 알고리즘이라는 뜻이다.

+

원리를 바로 설명하자면, 서로 각자 매우 큰 소수 p, q를 준비한다. (p-1), (q-1)과 서로소인 e에 대해, ed mod (p-1)(q-1)이 1인 d의 값을 찾고, N=pq와 e를 공개한다. 이들이 공개키가 되고, d는 개인키가 된다.

+

공개키 N, e로 평서문 m을 암호화하기 위해서는 m^e mod N을 계산하면 된다. 개인키 d를 가지고 있는 사람이 이를 복호화 하기 위해서는 $ (m^e)^d mod N $을 계산하면, m을 알아낼 수 있다. 이 고정에서 페르마의 소정리가 이용되는데, 페르마의 소정리란, 어떤 수 N이 있을 때, 이 수와 서로소인 수 a에 대하여, $ a^(\phi(N)) = 1 mod N $가 성립한다는 법칙이다. 이때 $ \phi(n) $은 오일러 파이 함수로, 1-N까지궁 N와 서로소인 수의 개수를 의미한다. N이 두 소인수로 이루어진 합성수라면, $ \phi(N) = (p-1)(q-1) $로 나타난다. 바로 이 값을 이용해서 복호화를 진행한다. $ E*d $는 $ (p-1)(q-1)A + 1 $ 로 나타낼 수 있고, 따라서 $ m^(ed) = m^(A(p-1)(q-1) +1) $인데, $ m^(p-1)(q-1) $은 1이므로, 이 값이 $m$이 된다.

+

$M^e mod N$과 $N, $e로는 원문 $m$과 개인키 $d$를 계산할 수 없다. 이를 계산하기 위해서는

+

RSA암호화 알고리즘과 DH알고리즘의 차이가 별로 없다고 생각할 수 있다. 뭐 알고리즘 상으로는 비슷하다. 다를게 없다. 하지만 제일 중요하게 다른 것은, RSA의 경우는 공개키와 비밀키를 메시지를 암호화할 때 사용한다는 것이고, DH는 개인키와 공개키를 이용하여 새로운 공통의 비밀키를 만든다는 점이다. 따라서, DH와 RSA의 차이는 키들의 용도이다. 애초에 DH는 키를 교환하는 방식이고 RSA는 암호화/복호화 알고리즘이니까 용도가 다르지만.

+

RSA도 마찬가지로 MITM에 매우 약하다. 오는 정보에만 의존해서 키를 사용하기 때문이다. 따라서 RSA도 인증의 면에서는 부족한 암호화 알고리즘이며, 이를 해결하기 위해서 PKI, Public Key Infrastructure를 사용한다. 이는 사람들의 공개키를 한 인증기관이 모아서 관리하여, 상호에 신원을 보장해주는 방식이다. 송신자는 이 인증기관에 수신자의 공개키를 조회하여, 제대로 된 공개키인지 확인할 수 있다. 하지만, 이러한 방식은 인증기관에 확인하는 과정이 필요하므로, 인증기관과 연결되어 있어야 한다는 점과, 이 과정에서 시간이 오래 걸린다는 단점이 있다.

+

이 점을 해결하기 위해 웹 보안에서 사용하는 HTTPS에서는 TLS/SSL이라는 더 응용한 암호가 적용된다. TLS는 상호 알고리즘 교환, 키 교환과 인증, 대칭키 생성과 통신이라는 세 단계로 나누어 통신한다.

+

3. ECC

+

ECC는, Elliptic Curve Cryptography로, 타원곡선 이론에 기반한 암호화 알고리즘이다. RSA에서는 소수를 사용했다면, ECC에서는 GF에서 EC연산의 비가역성을 이용한다. EC는 RSA보다 키의 길이가 짧아도 보안성이 우수하며, 연산 시간이 더 짧다는 장점이 있어, 블록체인이나 IoT 보안 등 현재의 암호에는 ECC가 주로 사용된다.

+

타원곡선이란 무엇일까? 타원곡선이란, _ y2=x3+Ax+B_ 의 형식으로 나타나는 음함수이다. 타원곡선은 타원의 둘레를 계산하기 위해 타원을 적분하려다 나타난 식이라고 하는데, 그 함수의 역함수가 위의 형식이라고 한다. 더 자세하게 말하면, 체 k에서, 타원곡선은 특정 조건들을 만족시키며 원점이 주어진 k에 대한 사영 대수 곡선이다. 첫번째 특이점을 가지지 않으며, 둘째 위상수학적으로 원환면이며, 셋째 적어도 하나의 유리점을 가진다는 조건이다. 하나하나씩 알아보자.

+

체는 무엇이고, 사영 대수 곡선이란 말은 어떤 말일까?

+

일단 체(Field)란, 사칙연산(덧셈, 뺄셈, 곱셈, 나눗셈)에 대해 닫혀있는 집합을 의미한다. 이는 하나의 체 안에 있는 원소들끼리 사칙연산을 해도 그 값이 체 안에 속해있다는 의미이다. 가장 대표적인 체는 유리수 집합, 실수 집합, 복소수 집합이 있다.

+

즉, 체 k에서 특정한 조건을 만족시키며 특정 원점을 가지는 대수 곡선이라는 의미는, 위에서 언급했던 타원 방정식을 만족시키면서 A, B로 표기되어 있는 계수가 하나로 정해져 있는 점들의 집합을 의미한다. 타원 곡선이 체라고 하는 이유는, 타원 곡선에서 새롭게 정의한 덧셈을 이용해 서로 다른 점끼리 덧셈을 하면, 타원곡선 위에 있기 때문에, 사칙연산에 대해 닫혀있기 때문이다. 타원 곡선을 어떤 체 위에서 정의하느냐에 따라 달라지겠지만, 암호학에서 사용할 때에는 정수 위에서 정의하는 것으로 하자. 정수는 체가 아닌데요?라는 의문을 가진다면, 정수의 나눗셈을 해결할 수 있는, 모듈러 연산을 이용한 갈루아체 위에서 정의한다고 알아두자, 이는 나중에 설명하겠다. 타원 곡선상의 덧셈의 특징을 설명하기 전에, 무한점 O에 대해 설명하겠다. 무한점 O는 말 그대로 타원곡선 상에서 무한대로 극한을 보냈을 때의 점을 의미한다. 무한점은 타원곡선 상의 점A에 대해 (앞으로 점 A라고 하면 타원곡선 위에 있는 점을 의미한다.) A+O=A를 만족시킨다. 따라서, 타원곡선 체에 대해서 무한점O는 항등원이다. 또한, 점P와 점Q에 대해서 P+Q=O를 만족시키는 점 Q는 점P에 대한 역원이고, Q=-P로 표현할 수 있겠다. 이때, -P는 P를 x축 대칭한 점이 된다. 또한 교환법칙도 성립한다. 뭐라해도 타원곡선은 체이니까 말이다.

+

그렇다면 타원곡선 위에서 덧셈을 정의하자. 덧셈을 정의하면 곱셈이나 뺼셈이 정의되고, 그렇면 나눗셈도 정의된다. 점P를 (P_x, P_y)라 하고 마찬가지로 점Q를 (Q_x, Q_y)라고 하자. 특이하게도 타원곡선 상의 덧셈은 두 점이 같은 경우와 다른 경우를 나누어서 정의하는데, 그래도 쓰면 무한점이 나오기 떄문이다.

+

If P=Q, P+Q = 2*P

+

If P!=Q, P+Q = (,)

+

이 연산을 타원연산의 덧셈으로 정의한다. 곱셈은 덧셈을 여러 번 하면 되고, 나눗셈은 갈루아 체에서 정의되는 대로 역모듈러 연산을 사용한다.

+

타원 곡선 암호는 RSA에서 소인수분해의 난해성을 이용한 것 처럼 타원곡선에서 갈루아 소수가 커질 경우 x값을 만족시키는 y의 값을 찾기 힘든 점을 이용한다. 갈루아 소수란, 갈루아 체에서 이용하는 소수로, 모듈러 상수를 의미한다.

+

ECC는 RSA와 다르게 개인키를 먼저 생성한다. 갈루아 소수 P를 상호에 정하고, 송신자는 P보다 작은 한 소수 k를 임의로 정한다. 후에, 생성자라고 불리우는 상호 동일한 타원곡서 상의 임의의 점 G에 대해 kG를 연산하면 그 값이 공개키 Q가 된다. kG는 계산하기 쉬운 반면에 갈루아 체에서는 G와 Q를 이용해 k를 구하기 어렵다는 점을 이용한다.

+

ECC는 RSA에 비해 반절정도로 작은 키로 같은 보안을 얻어낼 수 있다. 하지만, ECC도 취약한 부분이 존재하는데, 임의의 소수를 정하는 데에 그것이 있다. 만약 그 난수를 구하는 알고리즘이 유출된다면 ECC는 무용지물이 되기 때문이다. 실제로, ECDSA를 이용하는 서명 체계에서 난수 생성 알고리즘이 알려져 무용지물 된 사건이 있었다. 따라서, 현재는 밀러-라빈 후보와 오일러 판정법을 이용하여 임의의 소수를 도출하거나, 하드웨어적으로 블랙박스안에 넣는 방식으로 이를 방지한다.

+

ECC에서 사용하는 타원 곡선의 종류에 따라 암호화 알고리즘을 나눈다. 비트코인에서 주로 사용하는 것으로 유명한 secp256k1 곡선도 있고, 생성자와 갈루아 소수를 정해놓지 않고 이것도 임의의 t로 교환하는 방식으로 이것에서 보안을 더 높인 SECP256R1 곡선을 이용한 암호도 있다. P256은 256비트짜리 소수를 이용한다는 의미이고, k는 곡선 y^2 = x^3 + 7을 의미, r은 random을 의미한다.

+

ECC는 개인키, 공개키 발급 방식 중 하나이고, DH과 ECC를 엮어서 만든 암호화 방식이 ECDH이며, ECC와 서명 알고리즘을 엮은 것이 ECDSA이다.

+

블록 암호화 알고리즘. (Block Cipher Algorithms)

+

1. DES (Data Encryption Standard)

+

DES는 64비트 블록을 사용하는 대칭키 블록 암호 알고리즘이다. 암호화 과정은 16 라운드의 Feistel 구조를 기반으로 한다. 각 라운드에서는 데이터는 48비트 서브키(subkey)를 사용하여 변형된다.

+

Key Schedule Algorithm:

+
    +
  • 초기 64비트 키에서 parity check bits를 제외해 56비트로 압축한다.
  • +
  • 압축된 키는 28비트로 두 개의 반으로 나뉜다. $( C_0, D_0 )$
  • +
  • 각 라운드마다 $C_i$와 $D_i$는 라운드에 따라 정해진 수만큼 왼쪽으로 이동(rotated)한다.
  • +
  • 회전 후의 $C_i$와 $D_i$는 결합되어 56비트가 되고, 48비트 서브키를 생성하기 위해 압축 퍼뮤테이션이 적용된다.
  • +
+

Encryption Operation:

+
    +
  • 초기 평문은 Initial Permutation (IP)을 통해 재배치된다.
  • +
  • 재배치된 평문은 32비트의 두 부분인 $L_0$과 $R_0$으로 나뉜다.
  • +
  • 각 라운드에서 $L_{i+1} = R_i$과 $R_{i+1} = L_i \oplus f(R_i, K_i)$를 계산한다. 여기서 $\oplus$는 bitwise XOR 연산자이고, $f$는 Feistel function, $K_i$는 $i$번째 라운드의 서브키다.
  • +
  • 마지막 라운드 후, 결과는 $R_{16}L_{16}$ 순서로 조합되고 Final Permutation (FP)을 통해 최종 암호문을 생성한다.
  • +
+

Feistel Function:

+
    +
  • $f(R_i, K_i)$는 확장 퍼뮤테이션으로 시작하여 $R_i$를 48비트로 확장한다.
  • +
  • 확장된 $R_i$는 서브키 $K_i$와 XOR 연산된다.
  • +
  • 결과는 S-box lookup table을 통해 각각 6비트가 4비트로 변환된다.
  • +
  • S-box 변환 후 32비트 나온 결과에 비선형 변환이 P-box permutation으로 수행된다.
  • +
+

DES의 보안은 같은 키를 사용해서 여러 데이터를 암호화하는 경우와 56비트 키 길이가 가지는 제한된 키 공간 때문에 줄어들었다.

+

2. AES (Advanced Encryption Standard)

+

AES는 128, 192, 혹은 256비트 키를 사용하여 128비트 데이터 블록을 암호화한다. AES의 구조는 Rijndael 암호에 기초를 두고 있으며, 라운드 수는 키 길이에 따라 달라진다 (10, 12, 또는 14 라운드).

+

Key Expansion:

+
    +
  • 라운드 키 생성에 사용되는 Rijndael 키 스케줄은 $W[i-1]$ 에 비선형 변환과 상수의 XOR 연산을 적용하여 $W[i]$ 를 생성한다.
  • +
  • 라운드 상수는 $RC[j]$로 표현되며, 이는 $x$의 멱도로 구성된다. $x$는 갈루아 체 $GF(2^8)$의 생성원이다.
  • +
+

$$ +W[i] = W[i-Nk] \oplus \text{SubWord}(W[i-1]) \oplus RC[j] +$$

+

여기서 $Nk$ 는 키 길이에 따른 워드 수 (4, 6, 또는 8), $RC[j]$ 는 라운드 상수, $\text{SubWord}()$ 는 S-box 변환을 적용한 함수이다.

+

Encryption Process:

+
    +
  • 평문은 AddRoundKey 스텝을 통해 초기 라운드 키와 XOR 연산된다.
  • +
  • 각 중간 라운드에서는 SubBytes (byte 치환), ShiftRows (행 이동), MixColumns (열 혼합), AddRoundKey (라운드 키 가산) 연산이 순차적으로 수행된다.
  • +
  • 마지막 라운드에서는 MixColumns 스텝이 생략된다.
  • +
+

SubBytes:

+
    +
  • 비선형 S-box 변환은 각 바이트를 갈루아 체 $GF(2^8)$ 의 역원을 구한 후, 아핀 변환을 적용하여 새로운 바이트로 치환한다.
  • +
+

$$ +\text{SubBytes}(a) = \text{Affine}(\text{MultiplicativeInverse}(a)) +$$

+

ShiftRows:

+
    +
  • 행 별 이동은 사이클릭 퍼뮤테이션을 적용하여 암호화 과정에 확산성을 부여한다.
  • +
+

MixColumns:

+
    +
  • 각 열은 다음 다항식과의 $\text{mod}\ x^4 + 1$ 에서 곱셈 연산을 통해 변환된다.
  • +
+

$$ +\begin{bmatrix} +02 & 03 & 01 & 01\ +01 & 02 & 03 & 01\ +01 & 01 & 02 & 03\ +03 & 01 & 01 & 02 +\end{bmatrix} +\cdot +\begin{bmatrix} +b_0\ +b_1\ +b_2\ +b_3 +\end{bmatrix} +$$

+

여기서 $b_0, b_1, b_2, b_3$은 현 열의 바이트이며, 행렬 연산은 $GF(2^8)$ 상에서 수행된다.

+

AddRoundKey:

+
    +
  • 각 라운드 키는 현재 상태와 다음과 같이 XOR 연산된다.
  • +
+

$$ +\text{State} \oplus \text{RoundKey} +$$

+

AES는 모듈러 산술과 갈루아 체(Galois field)를 사용하여 비선형 및 확산적 특성을 갖는다.

+

3. SEED

+

SEED는 한국 인터넷진흥원(KISA)에 의해 개발된 128비트 블록 암호 방식으로, 128비트 키를 사용하며 16 라운드의 Feistel 구조를 따른다.

+

Encryption Process:

+
    +
  • 128비트 키는 16개의 64비트 서브키로 확장된다.
  • +
  • 초기 평문 블록은 키와 Feistel 네트워크를 통해 가공된다.
  • +
  • 각 라운드의 결과는 두 반으로 이뤄져 있고, 지정된 함수를 통해 연산된 다음, 키와 XOR 연산된다.
  • +
  • 키 확장 과정에서 사용되는 상수는 일련의 알고리즘을 통해 생성되며, 이는 SEED의 보안성을 향상시킨다.
  • +
+

$$ +K_i = f(K_{i-1}), \quad \text{where } i = 1, 2, \ldots, 16 +$$

+

여기서 $f()$ 는 키 확장 함수, $K_i$ 는 $i$번째 라운드의 서브키이다.

+

Feistel Function:

+
    +
  • SEED의 Feistel 함수는 S-box를 통한 비선형 변환과 $GF(2^{32})$에서의 변환을 결합하여 사용한다. S-box의 비선형 특성과 더불어 선형 변환은 암호화 과정에 확산성과 혼돈성을 주입한다.
  • +
+

각 라운드에서의 연산은 다음과 같은 수학적 표현으로 이루어진다.

+

$$ +\text{left} = \text{right} +$$ +$$ +\text{right} = \text{left} \oplus F(\text{right}, K_i) +$$

+

여기서 $F()$ 는 Feistel 함수, $K_i$ 는 라운드 서브키이며, $\text{left}$와 $\text{right}$는 데이터 블록의 두 부분을 의미한다.

+

SEED는 높은 보안성과 우수한 성능으로 인해 South Korea 전자정부 및 인터넷 은행 거래에 사용된다.

+

4. PRINCE

+

PRINCE는 저전력 환경에 최적화된 경량 블록암호로 AES와 마찬가지로 여러 개의 라운드로 구분된다. Mix Column부터 ShiftBits까지 AES와 매우 비슷하지만, 연산을 더욱 간단화하고 라운드 수를 줄여 저성능 프로세서에서도 많은 비용과 시간을 들이지 않고도 암호화, 복호화를 진행할 수 있도록 한 암호화 방식이다. 기초적인 것들은 AES와 비슷하므로 바로 암호화, 복호화 과정을 살펴보자. 여기서는 PRINCE-64/128을 기준으로 설명할 것이다. 128bit 비밀키를 이용하여 64비트 키로 분할하여 사용한다는 의미이다.

+

PRINCE의 구조는 12 라운드로 구성되며, 상호 역변환되는 라운드 함수를 사용한다.

+

Encryption/Decryption Process:

+
    +
  • PRINCE 알고리즘은 암호화와 복호화 과정이 매우 유사하며, 라운드 키 스케줄이 역순으로 구성된다.
  • +
  • PRINCEcore는 중심 라운드로, 여기에서 상태는 여섯 개의 서브 라운드를 계속 거친다.
  • +
  • 암호화와 복호화는 대칭적인 알파(reflection) 구조를 갖는다. 즉, 전반부와 후반부 라운드가 서로 역변환된다.
  • +
+

Key Schedule:

+
    +
  • 키 스케줄에서, 128비트 키는 두 개의 64비트 부분 키로 나뉘며, 알파 상수를 사용하여 변형된다.
  • +
+

S-box-based Nonlinear Layer:

+
    +
  • PRINCE 알고리즘은 비선형성을 부여하기 위해 S-box를 사용한다.
  • +
+

M-Layer (Linear Transformation Layer):

+
    +
  • 이 선형 변환층은 확산을 증대시키기 위해 사용된다.
  • +
+

위 과정을 통해서 암호화하는 알고리즘을 4-Round 알고리즘이라 하며, 표준 Prince알고리즘은 총 12-Round를 사용한다. 이처럼 연산의 용이성을 위해 라운드를 줄인 Prince를 Round-Reduced Prince라고 한다. +PRINCE 알고리즘은 그것의 반사성(reflection property) 덕분에, 암호화 구조가 복호화 구조를 간단하게 반전시키는 방식으로 구현될 수 있다는 점에서 하드웨어 구현 시에 에너지 효율성을 높여준다. 하지만, 4-Round PRINCE-64/128 나 6-Round PRINCE-64/128는 고정키 대입 공격등 Side-Channel 공격에 면역이 없기 때문에 IoT나 소형 기기에서는 적당히 타협하여 12-Round PRINCE-64/128를 사용 한다.

+

해시 알고리즘. (Hash Algorithms)

+

1. MD5 (Message-Digest Algorithm 5)

+

MD5는 512비트 메시지 블록을 다루고 128비트 해시 값을 생성한다. MD5의 구성은 다음과 같다:

+

Process:

+
    +
  • 입력 메시지는 512비트 블록으로 나뉜다.
  • +
  • 각 블록은 압축 함수와 초기 해시 값(또는 이전 블록의 결과)에 의해 처리된다.
  • +
  • 압축 함수는 네 개의 사이클을 사용해서 각 블록을 처리한다.
  • +
+

Compression Function:

+
    +
  • 각 사이클은 S-box와 비선형 함수를 사용하며 메시지 블록과 현재 해시 값을 기반으로 연산을 수행한다.
  • +
  • 출력은 이전 해시 상태와 더해진다.
  • +
+

MD5는 충돌 공격에 취약하기 때문에 현재 보안이 중요한 용도에는 권장하지 않는다.

+

2. SHA (Secure Hash Algorithm)

+

SHA 패밀리는 다양한 해시 함수들을 포함한다 (SHA-0, SHA-1, SHA-2).

+

SHA-1 Process:

+
    +
  • 메시지는 512비트 블록으로 나뉘고 블록마다 압축 함수를 사용해 160비트 해시를 계산.
  • +
  • 각 블록은 특정한 비선형 기능과 함께 반복된다.
  • +
+

SHA-2 Variants (SHA-256, SHA-512 등):

+
    +
  • SHA-2는 무결성 보장 목적에 사용, 더 긴 해시 값과 변형된 알고리즘을 포함.
  • +
  • SHA-256은 32비트 워드, SHA-512는 64비트 워드를 사용한다.
  • +
+

Compression Function:

+
    +
  • 체인화된 값과 야수 상수를 사용한 라운드 함수.
  • +
  • 메시지 스케줄, 라운드 상수, 라운드 함수, 중간 상태 갱신을 통한 해시 생성.
  • +
+

SHA 알고리즘들은 다양한 애플리케이션에서 널리 사용되며, 특히 SHA-256과 SHA-3은 현재 많이 사용된다.

+

SHA-1

+

SHA-1 해시 함수는 메시지 $ M $을 160비트의 해시 값으로 매핑한다.

+

Initialization:

+
    +
  • 초기 해시 값 $ H^{(0)} $는 5개의 32비트 워드 $ H_0^{(0)}, H_1^{(0)}, H_2^{(0)}, H_3^{(0)}, H_4^{(0)} $로 설정된다.
  • +
+

Message Preprocessing:

+
    +
  • 입력 메시지 $ M $은 512비트 블록들로 나누어지고, 패딩과 길이 인코딩을 거쳐 $ L $ 비트의 메시지가 된다.
  • +
  • 각 블록에 대해, 80개의 32비트 워드 $ W $로 확장된 메시지 스케줄이 생성된다.
  • +
+

Hash Computation:

+
    +
  • 각 라운드 $ t $에서 다음의 연산을 수행한다: +$$ T = (H_0 \lll 5) + f_t(H_1, H_2, H_3) + H_4 + W_t + K_t $$ +$$ H_4 = H_3 $$ +$$ H_3 = H_2 $$ +$$ H_2 = H_1 \lll 30 $$ +$$ H_1 = H_0 $$ +$$ H_0 = T $$ +여기서 $ f_t $는 라운드에 따라 변하는 논리 함수이며, $ K_t $는 라운드 상수이다.
  • +
+

SHA-256

+

Initialization:

+
    +
  • 초기 해시 값 $ H $는 $ H_0 $부터 $ H_7 $까지의 8개의 32비트 워드로 구성되며, 이는 특정 소수의 제곱근에서 파생된다.
  • +
+

Message Preprocessing:

+
    +
  • 입력 메시지 $ M $은 512비트 블록들로 나누어지며, 패딩 및 길이 인코딩을 거쳐 메시지 스케줄 $ W $로 변환된다.
  • +
  • $ W $는 64개의 32비트 워드로 확장되며, 각 $ W_t $는 $ M $의 해당 부분과 앞선 워드들의 비선형 함수 $ f $에 의해 계산된다.
  • +
+

Hash Computation:

+
    +
  • 메인 루프는 $ H $를 업데이트하기 위해 64회의 라운드를 수행한다.
  • +
  • 각 $ t $번째 라운드에서, 다음과 같은 수학적 연산이 수행된다: +$$ T_1 = H_7 + \Sigma_1(H_4) + \text{Ch}(H_4, H_5, H_6) + K_t + W_t $$ +$$ T_2 = \Sigma_0(H_0) + \text{Maj}(H_0, H_1, H_2) $$ +여기서 $ \Sigma_0, \Sigma_1 $은 각각 회전 및 오른쪽 시프트 연산으로 정의되며, $ \text{Ch} $와 $ \text{Maj} $는 입력 워드들의 비트를 선택하는 논리 함수이다.
  • +
  • 그 후, 중간 해시 값 $ H $는 다음과 같이 업데이트된다: +$$ H_7 = H_6 $$ +$$ H_6 = H_5 $$ +$$ H_5 = H_4 $$ +$$ H_4 = H_3 + T_1 $$ +$$ H_3 = H_2 $$ +$$ H_2 = H_1 $$ +$$ H_1 = H_0 $$ +$$ H_0 = T_1 + T_2 $$
  • +
+

SHA-256의 모든 수학적 변환은 $ \text{GF}(2^{32}) $상에서 수행되며, $ K_t $는 각 라운드에 고유한 상수이다. SHA 알고리즘은 입력 메시지의 아주 작은 변화도 출력 해시 값에 큰 변화를 가져오는 “avalanche effect"를 만들어내는 설계 원리를 가지고 있다.

+

3. HMAC (Hash-Based Message Authentication Code)

+

HMAC은 해시 알고리즘 위에 구축된 메시지 인증 코드 (MAC) 프로토콜이며, 키와 메시지 모두를 기반으로 한 인증 태그를 생성한다.

+

HMAC Process:

+
    +
  • 키와 함께 초기화 벡터(IV)를 사용하여 해시 함수에 입력.
  • +
  • 두 단계 과정: +
      +
    • 내부 해시($H(K \oplus ipad \parallel m)$)는 입력 메시지 m과 패딩이 적용된 키 K를 사용.
    • +
    • 외부 해시($H(K \oplus opad \parallel inner)$)는 내부 해시 결과에 다시 패딩이 적용된 키 K를 사용.
    • +
    +
  • +
+

여기에서 $ipad$, $opad$는 특정한 패딩 값을 가리키고, $H$는 해시 함수, $K$는 비밀 키, $\parallel$는 이어붙이기 연산자다.

+
    +
  • +

    주어진 메시지 $ M $과 비밀 키 $ K $에 대해, HMAC은 다음과 같이 계산된다:

    +

    $$ \text{HMAC}(K, M) = H((K’ \oplus opad) \text{concat} H((K’ \oplus ipad) \text{concat} M)) $$ +여기서 $ H $는 해시 함수, $ K’ $는 원래 키 $ K $를 내부 블록 크기에 맞게 조정한 것, $ opad $와 $ ipad $는 각각 외부 및 내부 패딩이다.

    +
  • +
+

HMAC은 키와 긴 메시지를 사용한 메시지 인증, 데이터 무결성, 데이터 출처 인증에 사용된다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/08/hardware-security/index.html b/public/2021/08/hardware-security/index.html new file mode 100644 index 0000000..2f70a6d --- /dev/null +++ b/public/2021/08/hardware-security/index.html @@ -0,0 +1,304 @@ + + + + + + + + +Hardware Security | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Hardware Security +

+ + +
+
+

Hardware Security

+

신뢰성과 관련된 기술

+

1. RoT (Root of Trust)

+

Root of Trust, 신뢰점이란, 전자기기 안에서 별도로 존재하는 프로세싱 유닛으로, 메인 프로세서의 보조로서 다양한 암호화 기법이나 솔루션을 제공하거나 이를 제어하기 위한 보안 기능들을 의미한다. RoT가 궁극적으로 달성하고자 하는 것은 TC(Trusted Computing)으로, 신뢰할 수 있는 컴퓨팅, 즉 믿을 만 하고 무결성이 보장되는 계산 및 기능을 이야기한다. 이를 달성하기 위한, RoT에 포함되는 여러가지 기술들이나 알고리즘이 있고, 각 단계들을 순차적으로 달성되어 신뢰할 수 있는 보안적인 프로세스가 진행된다. RoT의 대표적인 기법이나 기기는 TPF, TEE등 신뢰할 수 있는 플랫폼 모듈이나 신뢰할 수 있는 실행 환경이 있다.

+

2. TPF

+

TPF, Trusted Platform Module이란, 신뢰할 수 있는 플랫폼 모듈을 의미한다. 어떤 어플리케이션이나 프로세스가 신뢰성 있도록 실행되기 위해 별도의 플랫폼 모듈을 설치한다. 이 플랫폼은 다양한 암호화 기법을 제공한다. TPF는 외부에서 접근이 불가하도록 설계된 암호화 키와 저장공간 및 연산장치를 별도로 제공함으로써 외부에서는 암호화 키나 암호화 과정 및 알고리즘, 그 설계를 알 수 없도록 만들어져 소프트웨어적으로 취약할 수 밖에 없는 키 유출을 해결한 장치/기술이다. TPF는 내부 키(서명)이 존재하고, 이를 바탕으로 다양한 암호화 프로세스를 제공한다. RSA암호화나 ECC암호화 및 서명 및 검증을 제공하며, Hashing이나 HMAC, 어플리케이션이 응용할 수 있는 암호화된 저장공간을 제공하기도 한다.

+

TPF는 외부에서는 절대 접근할 수 없게 만들어져 있다. 하드웨어적으로 메인 프로세스와 분리되어 있어 해킹 당하거나 키가 탈취당할 확률이 적으며, 별도의 메모리를 사용한다. 하지만, TPF도 물리적인 해킹에는 취약할 수 밖에 없으며, 직접 칩을 탈취하여 역공학이나 부채널 공격을 시행하면 키가 탈취당할 위험이 있다.

+

3. TEE

+

TEE, Trusted Execution Environment란 신뢰할 수 있는 실행 환경을 의미한다. TPF를 따로 설치할 수 없는 환경이거나 TPF를 설치한 환경이라도 더욱 보안을 강화하기 위해 메인 프로세서를 보안 영역과 일반 사용자 영역으로 나누어 사용하는 것을 의미한다. 보안 영역에서는 TPF에서와 마찬가지로 보안 정보의 저장과 처리를 수행하고, 암호화 프로세스를 실행한다. 일반 사용자 영역에서는 보안 프로세스가 필요하면, 이를 보안 영역에서 실행함으로써 이를 신뢰 가능한 별도의 환경에서 실행하도록 하는 기술이다. 결제 및 인증 과정이나 DRM 과정이 TEE에서 주로 실행된다. 보안영역은 일반영역과 물리적으로 분리되어 있어, TPF와 마찬가지로 일반영역에서 TEE에 접근할 수 있는 방법은 TEE가 제공하는 방법밖에 없다. TEE는 TPF와는 다르게 일반 영역에 있던 잡다한 프로세스도 실행하고 처리할 수 있다. TPF에서는 비밀번호 입력 등의 온전히 메인 프로세스의 일인 것들을 처리할 수 없었지만, TEE는 메인 프로세서에 포함되어 있으므로 이러한 사소한 것들까지 모두 담당할 수 있어 보안을 더욱 향상시켜 준다. 완전히 신뢰 가능한 환경을 조성하기 위해서는 TEE와 TPF를 혼용하여 TPF는 TEE에게만 통신하고, TEE는 기타 사소한 것들까지 처리한다면 최고수준의 보안을 유지할 수 있다.

+

대표적으로는 삼성전자에서 자사 휴대폰에 기본적으로 탑재하는 보안 솔루션 Knox가 있다. Knox는 휴대폰의 CPU를 보안 영역과 일반 영역으로 나누어 TEE를 제공한다.

+

Side-Channel Attack 대책

+

1. Side-Channel Attack

+

Side-Channel Attack, 부채널 공격이란, 암호화 과정이나 보안 프로세스가 진행중일 때 프로세서에서 부가적으로 얻을 수 있는 다양한 정보들을 이용하여 구조를 파악하거나 키를 탈취하는 방법이다. 부가적으로 얻을 수 있는 정보는 칩에서 나오는 열이나 전자기파, 연산이 수행되는 시간, 전력 소비량, 에러 처리(Fault)등이 있다.

+

2. 방어 기술

+

Side-Channel Attack의 방어에는 Hiding과 Masking기법이 가장 많이 사용된다. 마스킹이란, 연산의 중간에 사용되는 값을 랜덤하게 결함으로써 원래의 연산에서 사용되는 값들의 입력값과 연산값과의 관계를 불명확하게 하여 특성키 공격이나 알려진 평문 공격에 대비할 수 있도록 하며, 전력 사용량의 규칙성을 모호하게 만든다. 마스킹의 어떤 과정에서 랜덤한 값을 사용하는지에 따라 다양한 마스킹 기법이 존재한다. 하지만, 랜덤 알고리즘이 밝혀지거나 역공학을 통해 알아낸다면, 혹은 또 다른 공격에서는 이 방법은 효과적이지 않을 수 있다. 랜덤 알고리즘이 밝혀졌을 때의 문제점은 거의 모든 암호화 알고리즘에서의 문제이다.

+

SABL, WDDL, t-private Logic등이 있다.

+

EM(Electro-Magnetic) SCA의 대비하는 방법으로는 랜덤한 전자기파를 방출하는 방법이 있다. 암호화 퍼리 과정에서 더미 연산과 불필요한 값들을 중간중간에 넣어줌으로써 더미 전가지파를 만들어 낼 수 있다. 하지만, 결국 주요한 연산의 전자기파는 모두 누출되는 것이기에 칩을 설계할 시에 이를 대비할 방법을 모색하여 전자파를 최대한 약하게 방출하도록 하거나 차폐 솔루션을 도입하는 등의 과정이 필요하다.

+

Fault Injection SCA의 경우에는 예측 불가능한 다양한 상황에 대해서 많은 가능성을 두고 Fault처리를 할 수밖에 없다. 하지만, 이는 많은 연산 성능 하락을 유발하며, 알고리즘을 매우 무겁게 할 수 있다.

+

Timing SCA의 경우에는 각각의 입력에 대해 연산시간이 모두 동일하게 처리되도록 설계하거나, 각각의 연산에 더미 타임을 넣는 방법이 있다.

+

Reversing 대책

+

1. 역공학

+

역공학(Reversing)이란, 소프트웨어에서는 특정한 프로세스가 처리되는 과정에서 데이터 흐름이나 역어셈블, CPU처리 분석을 통해 원래의 알고리즘을 알아내거나 원리를 알아내어 크래킹하는 과정을 의미한다. 한편, 하드웨어의 경우에는 다양한 칩을 뜯어내어 그 구조를 확인하거나 전류 흐름을 측정하는 등의 물리적인 분석을 통해 반도체의 구조를 알아내거나 연산 중 어떤 데이터가 어떤 흐름을 통해 이동하는지에 대해 알아내는 것을 의미한다. 반도체 칩의 사진을 찍어 현미경을 통해 분석하는 과정등을 통해 데이터의 이동 버스(BUS)를 알아내는 과정이 포함된다.

+

칩의 리버싱은 디캡슐레이션, 디레이어링, 게이트 레벨 넷리스트 추출등의 과정이 있다. 먼저 패키지에선 다이를 제거하고, IC를 디캡슐레이션하여 반도체 칩에 직접 접근할 수 있도록 한다. 후에, 디레이어링을 통해 각각을 싱글 레이어로 분리하여 분석하는데, 이때에는 SEM촬영을 통하여 얻은 사진 설계도를 얻어내는 과정이 있고, 후에 이 사진을 이용하여 이를 회로도로 변환하는 과정이 있다.

+

데이터 BUS를 알아내게 된다면, 연산 중간중간에 사용되는 값들을 알 수 있으며, 입력과 출력값을 비교하여 어떤 부위가 어떤 연산을 처리하는지 알 수 있고, 이를 통해 전자기파 주입 공격을 하거나, 키를 알아낼 수 있다. 또한, 같은 역할을 하는 칩을 제작하여 이를 공격하는데 사용될 수 있다.

+

2. 메모리 추출 방지

+

메모리가 유출되는 경우를 방어하기 위한 방법으로는 PUF가 있다. PUF는 Physically Unclonable Function으로, 물리적으로 복제가 불가능한 함수를 의미한다. PUF는 칩이 각각의 고유한 값을 가지도록 하며, 이를 예측 불가능하도록 하여 칩에 직접 접근해도 이를 알 수 없도록 한다.

+

3. 역공학 대책

+

Reversing에 대비하는 방안에는 메모리 유출 방지에서 사용했던 방법을 사용한다. PUF를 이용함으로써 각각의 칩에 따라 연산값이 달라지게 되고, 따라서 칩의 구조를 알아내거나 Bus를 분석할 수 있어도 PUF에서의 값은 Bus를 지나가지 않으므로 키를 알 수 없다.

+

UART? PSA?

+

출처> Wikipedia, [ 하드웨어 칩 기반 보안시스템 밒 해킹 동향, 한양대학교 ]

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/08/security-of-iot/index.html b/public/2021/08/security-of-iot/index.html new file mode 100644 index 0000000..3e74ef4 --- /dev/null +++ b/public/2021/08/security-of-iot/index.html @@ -0,0 +1,287 @@ + + + + + + + + +Security of IoT | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Security of IoT +

+ + +
+
+

Security of IoT

+

IoT란?

+

IoT (Internet of Things)란, 독립적으로 존재했던 각종 전자기기 및 사물들이 인터넷으로 엮여 한번에 관리할 수 있게 되거나 상호 정보교환과 데이터 수집을 통해 사용자에게 최상의 서비스를 제공하는 기술을 의미이다. 여기에서 사물이라 함은 전구부터 세탁기, 그리고 신발이나 의류까지 모든 사물을 포함한다. 데이터를 분석하는 과정에서 인공지능을 주로 사용하므로 IoT에는 인공지능 기술이 들어가기도 한다.

+

IoT는 2013년부터 쭉 개발되어 왔으며 집에서 흔히 볼 수 있는 에어컨, 냉장고등 큰 가구들부터 연결되어 왔다. 그 이후 시간이 지나면서 점점 작은 기구들까지 연결되면서, TV, 전자레인지, 오븐부터 커피포트, 선풍기, 전등 뿐 아니라 변기, 샤워기, 거울, 헤어 드라이기까지 연결되어 있지 않은 것이 없을 정도로 발전되어 왔다.

+

IoT 서비스 제공자들은 사용자들의 데이터를 분석하는 더욱 발전한 알고리즘을 개발하면서 사용자들의 데이터를 수집한다. 이것들은 모여 방대한 빅 데이터가 된다. 물론 고객의 개인정보 무단수집과 남용의 논란도 계속 이어져 왔지만, 서비스를 이용하기 위해서 어쩔 수 없이 개인정보와 사생활을 팔아야 하는 것은 안타까운 일이다.

+

IoT 보안

+

IoT에서는 보안이 매우 중요하다. 개인의 사생활을 담당하고 있기도 하지만, 생활 환경을 조절할 수 있어 자칫하면 목숨까지 위협할 수 있기 떄문이다. IoT기기는 소형화되어 있으며 저성능으로 구성되고 하드웨어에 자체에 접근이 쉬워 해킹에 매우 취약하다. 자동화된 생산에서 만약 반도체 설계부터 문제가 있거나 펌웨어에 백도어나 트로이 목마가 존재한다면 매우 심각하고 영구적인 보안 결함이 될 것이다. 따라서, 반도체 설계, 생산 과정에서 모듈 점검을 정확하게 진행하여야 하며, 점대점(Point-to-Point) 보안을 확립하는 것이 중요하다. 또한, 저성능 프로세서에 대비하기 위해 주변에 보안칩(암호 Co-Processor)를 장치하는 것이 좋다. 소프트웨어 적인 보안은 업데이트하기 용이하고 대처하기 쉽다는 장점이 있지만, 하드웨어 보안을 확립한다면 물리적 보안, 암호 알고리즘, 보안 부팅, 키 암호화, 모듈 서명 등 다양한 보안 기능과 해킹 방지를 탑재할 수 있어 이를 확립하는 것이 무엇보다 중요하다.

+

반도체 물리적 복제 방지 (PUF)나 보안 칩(TPF)등의 탑재가 가장 중요할 것이며, 이는 키가 소프트웨어적으로 탈취당할 확률을 기하급수적으로 낮춰준다. 또한 Side-Channel Attack에 대한 방어까지 탐재하는 것이 좋을 것이다.

+

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/08/양자-컴퓨터와-양자-어닐링/index.html b/public/2021/08/양자-컴퓨터와-양자-어닐링/index.html new file mode 100644 index 0000000..96afd6a --- /dev/null +++ b/public/2021/08/양자-컴퓨터와-양자-어닐링/index.html @@ -0,0 +1,291 @@ + + + + + + + + +양자 컴퓨터와 양자 어닐링 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 양자 컴퓨터와 양자 어닐링 +

+ + +
+
+

양자 컴퓨터와 양자 어닐링

+

양자 컴퓨터 입문 / 양자 컴퓨팅 발전과 전망 / 1억배 빠른 양자 컴퓨터가 온다 / 스콧 애론슨의 양자 컴퓨터 강의

+

양자 컴퓨터란 무엇일까?

+

Ø 현대 컴퓨터의 발전 과정

+

20세기, 컴퓨터(Computer)란 말은 계산하는 사람, Computing Person이라는 뜻으로 사용되었다. 하지만 단순 반복 행동을 굳이 사람이 하지 않아도 되는, 일명 계산기계가 사용될 수 있음이 증명되면서, Computer라는 말은 ‘일정한 규칙ㅇㄹ 가지고 주어진 값을 토대로 계산하는 장치’라는 의미를 가지게 되었다.

+

현대적인 컴퓨터의 정의를 시작한 사람은 ‘찰스 배비지’이다. 이 사람은 19세기 초, 차분 기관이라는 기계식 계산기를 제작한다. 그 후, 그는 더 복잡한 기관인 분석 기관(해석 기관)을 제작한다. 찰스 배비지는 차분기관을 설계하였지만, 실제 완성하지는 못하였다. 하지만 후에 실제 만들어 보면서 작동하는 것을 확인하였다. 그는 천문 테이블을 만들기 위해 이 기계를 제작하였는데, 차분 기계는 다항함수를 계산할 수 있는 기관이었다. 그는 이 기관을 설계하고 난 뒤, 해석기관을 설계하였는데, 이는 천공카드를 이용해서 범용적인 계산을 할 수 있도록 하였다. 이 기계장치도 예산이랑 시간이 부족해서 완성하지 못하였다. 하지만 한 부인이 이 컴퓨터로 실제 프로그래밍을 하며, 최초의 프로그래머로 불리우고 있다.

+

범용 컴퓨터의 현대적인 개념은 그 유명한 앨런 튜링이 정립했다. 그는 튜링 머신이라는 수학적 모델을 만들었는데, 모든 컴퓨터들은 이러한 튜링 머신을 기본 기능으로 설명할 수 있다. 그 전에 발명되었던, 현대의 트랜지스터와 같은 원리로 움직이는 진공관을 통해 튜링 머신이라는 논리적 모델을 실제 구현하게 된다. 그 후 에니그마를 깨기 위해 실제 계산 가능한 장치를 만들면서 최초의 전자식 계산기라고 알려져 있다.

+

그 후 ENIAC이 만들어 지고, 폰 노이만이 노이만 구조라는 현대까지 아직도 적용되고 있는 방식을 제안한다. 이 폰 노이만 구조란 것은, 프로그램과 데이터를 기억장치에 저장하고, 명령어를 하나씩 수행하며 데이터를 수정해 나가는 방식을 의미한다.

+

그 후 우리가 나는 집적회로와 트랜지스터가 사용되어 더욱 작은 컴퓨터가 만들어 지게 되었고, 이들이 발전해 나가면서 최초의 개인용 컴퓨터가 IBM에서 나오게 된다.

+

Ø 그래서, 양자 컴퓨터란 무엇인가?

+

흔히 알려진 양자 컴퓨터의 특징을 나열하자면, 0과 1 이분적이지 않게 두가지 정보를 동시에 가질 수 있고, 또 일반적인 컴퓨터보다 훨씬 빠르게 작동하고, 현대의 보안이 모두 뚫릴 것이며, 완전한 인공지능이 가능할 것이라 한다. 이중에서 물론 실제로 가능할 것도 있지만, 이런 것들이 가능하기에는 너무 오래 걸린다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/10/ad-tech와-통계의-쓰임새/index.html b/public/2021/10/ad-tech와-통계의-쓰임새/index.html new file mode 100644 index 0000000..ed22418 --- /dev/null +++ b/public/2021/10/ad-tech와-통계의-쓰임새/index.html @@ -0,0 +1,285 @@ + + + + + + + + +Ad-Tech와 통계의 쓰임새 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Ad-Tech와 통계의 쓰임새 +

+ + +
+
+

CTR(클릭률) Click-through rate)는 특정 링크를 클릭한 사용자의 비율. Z지수는 표준점수로, 통계학적인 정규분포를 만들고 각각의 경우가 표준편차상의 어떤 위치를 차지하는지를 보여주는 차원없는 수치이다. Z-지수는 원수치가 평균에서 얼마나 떨어져 있는지를 나타내는 지수로, $ z = \frac{z - \mu}{\sigma} $로 나타난다. ($\sigma$ 표준편차, $\mu$는 모집단의 평균이다.

+

중심극한정리란 표본의 크기가 커질수록 표본 평균의 분포는 모집단의 분포 모양과는 관계없이 정규분표에 가까워진다는 정리이다.

+

점추정은 모집단의 특성을 단일한 값으로 추정하는 방법으로, 표본평균과 표본분산을 이용해 모집단의 평균과 분산을 계산해 내는 방법이 대표적인 예이다. 평소에 신뢰구간 95%와 같이 구간추정하는 것과는 달리 적률방법을 이용하여 하나의 수치로 나타낸다. 표본분산의 기댓값이 모분산이 되고, 표본평균이 모평균이 된다. 더욱 정확한 수치를 계산하기 위해서 적률법을 이용한다. 모집단의 평균이 표본평균과 일치하는 모수를 찾는 방법으로 진행한다. 적률 생성함수는 $M_x(t) = E(e^tX)$로 표현되어 확률분포의 적률은 $ E(X^n) = M_x^(n) (0)$으로 표현할 수 있다. 적률생성함수를 몇번 미분하냐에 따라 n차 적률이라고 한다.

+

이제 Ad-Tech에서 사용하는 각종 광고 비용계산과 그 지수 산출을 알아본다.

+

CTR은 노출수 대 클릭수 비율로 구할 수 있다. 일반적으로 계산한 CTR수치는 CTR의 표본 평균이라고 할 수 있다. CTR수치는 매일마다 다르고, 또 언제 어떻게 바뀔지 모르는 랜덤 모집단이기 때문이다. 따라서, 오랜 기간동안 CTR수치를 측정하여 예측을 하는 방법으로 신뢰구간을 얻을 수 있다. 하지만, 오랜기간동안 광고수치를 계산하여 그 비용을 지불하기에는 오랜 기간이 걸리며 유행이 빠른 광고의 특성상 정확하지 않을 가능성이 있다. 따라서, 광고에서 CTR을 계산하여 캠페인의 대표 수치를 구하기 위해 표본에서 모집단의 수치를 계산할 수 있도록 중심극한 정리를 가정 하에 점추정을 통해 캠페인의 대표 CTR수치를 나타낸다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/10/spectre-attacks-exploiting-speculative-execution/index.html b/public/2021/10/spectre-attacks-exploiting-speculative-execution/index.html new file mode 100644 index 0000000..827d98c --- /dev/null +++ b/public/2021/10/spectre-attacks-exploiting-speculative-execution/index.html @@ -0,0 +1,280 @@ + + + + + + + + +Spectre Attacks: Exploiting Speculative Execution | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Spectre Attacks: Exploiting Speculative Execution +

+ + +
+
+

The Central Processing Unit (CPU) is a device that plays a major role as the brain of a computer. The CPU controls four main functions: memory, interpretation, computation, and control, which are based on the role of interpreting the commands of a given program to perform operations with data. In CPU, there are the program counter, a command register, an ALU (arithmetic logic unit), a control unit, a bus, and a register. Modern CPUs include cache memory or error correction devices for faster performance and more accurate computation.

+

The current CPU follows the Von-Neumann structure, which includes four functions: Fetch, Deocde, Execute, and Writeback. Ancient CPUs interpret instructions in order to convert data, which only can be slow. Modern CPUs speed up through out-of-order. Out-of-Order means that the CPU executes commands dynamically as the input data and execution units, rather than in a original order. This requires the cache memory as mentioned above, and uses Branch Prediction and Specific Memory Disambiguation, which results in Meltdown and Spectre vulnerabilities.

+

One day, I heard a news about Spectre and Meltdown Attack with my father. It said that it can affect within all of modern CPU manufactured in Intel, and also other companies. To defent that massive attack, we have to take a decrement of CPU’s performance about half of entire CPU or more. Me and father thought that it is a big event that will effect the history of architecture of modern CPUs. And also will effect on the semiconductor development. After that day, I wanted to learn about the modern architecture of CPUs and basic operations of modern semiconductors. So I searched internet about it, read a university books to understand it, and also a paper written by many eminent researchers, like professor of KAIST and Samsung Semiconductor research center. After the days of learing CPUs, I finally read the paper of Spectre attack and Meltdown attack. It was hard for me to read, but I rarely can understand the way they found it. I also could understand how it works, and how to prevent it to happen. My knowledge about computer and semiconductors increased very fast after I read the entire paper. I can understand how CPU ultimately works, how to make a semiconductor, and also what I have to do to do what I want. Futhermore, I wanted to know the real of semiconductor design, manufacturing, and CPU designing. To learn that thing, I want to learn semiconductor professionally in universities.

+

Physical techniques and physically performed computations for improving and stabilizing the performance of modern CPUs often exhibit errors. Side-Channel attck aims to exploit vulnerabilities in these physical computational defects to obtain information that could not be obtained. Among these Side-Channel attacks, Spectre attack uses a buffer for Branch Prediction and Prediction History. This physical operation allows access to unacceptable memory. Branch prediction is a feature that improves execution performance by predicting true/false conditions when a processor executes code containing conditional statements such as if. When the processor encounters a conditional statement, it first predicts the outcome of the conditions it encounters, and first continues to execute the code based on the prediction. The processor calculates the results of the conditions while the code is running as predicted. When the results of the conditions are calculated, the processor verifies the results of the previously made predictions. If a prediction is previously correct, the execution continues and thus gains performance benefits. On the other hand, if the prediction is determined to be incorrect during execution as predicted, the result of the condition is returned to the predicted point and executed again. Spectre attack uses an attack method that allows an attacker with control flow to follow fragments of the machine language code of the targeted process and perform the desired task. An attacker discovers and executes parts of the target process that have the command he or she wants before returning. Since the attacker is free to change the control flow, changing the address of the return command to the address of the next instruction that the attacker wants to execute, even though the execution flow proceeds only within the target process.

+

There are two typical cases of Spectre discovered by researchers. Exploiting Conditional Branches and Bounds Check Bypass or Exploiting Indirect Branches and Branch Target Injection are known as Spectre attack. The way Bound Check Bypass work lies in the Speculative Execution by Branch Prediction. If there is an “if” or “while” statement in front of a code that causes Fault when accessed, the CPU is tricked into accessing data in the restricted area and stored in cache to allow this check to be checked. The value of the cache can then be determined using a time difference measurement to read the memory in the inaccessible zone. Branch Target Injection also uses Speculative Execution by Branch Prediction. If the attacker’s precess repeats the branch to the location where the attack code, the code to be rejected, the location is stored in the Branch Target Buffer. The characteristic that all processes share the same Branch Target Buffer allows them to reject attack codes into the victim process.

+

Wikipedia / Spectre & Meltdown Original Paper

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2021/10/구글-페이지랭크-알고리즘/index.html b/public/2021/10/구글-페이지랭크-알고리즘/index.html new file mode 100644 index 0000000..3ff9a92 --- /dev/null +++ b/public/2021/10/구글-페이지랭크-알고리즘/index.html @@ -0,0 +1,280 @@ + + + + + + + + +구글 페이지랭크 알고리즘 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 구글 페이지랭크 알고리즘 +

+ + +
+
+

구글은 방대한 웹페이지를 자사 데이터베이스에 기록하고 있으며, 이를 토대로 사용자가 검색한 검색결과와 가장 매치되는 페이지를 보여줌으로써 검색엔진의 역할을 할 수 있다. 구글이 이렇게까지 클 수 있었던 이유는 정확한 검색 결과를 보여주는 알고리즘 덕분이다. 그렇다면 이 알고리즘은 무엇일까? 구글이 웹페이지들의 관계를 산출하고 그 수치를 계산해내는 알고리즘인 페이지랭크 알고리즘은 구글의 창시자중 한명인 래리 페이지라는 사람이 석사논문으로 발명한 알고리즘이다. PageRank 알고리즘은 각각의 웹 페이지의 상대적 가중치를 계산하여 각각의 중요도와 연관성을 표현하는 방식을 이용하는데, 이를 이용하여 한 페이지와 가장 연관된 다른 페이지를 Rank를 매겨 정확한 연관성을 보여줄 수 있다. PageRank에서는 각각의 웹페이지를 노드로 보고, 상호 참조와 인용으로 각각의 노드를 연결하여 하나의 거대한그래프를 만든다. 각각의 페이지는 랭크값이라는 고유한 수치를 가지고 있고, 그 페이지에서 인용된 각각의 페이지는 인용한 페이지의 랭크값을 동등하게 나눠가진다. 많이 인용된 페이지는 랭크값이 높을 것이고 적게 인용된 페이지는 랭크값이 낮을 것이므로 이 랭크값으로 페이지들의 중요도를 줄세울 수 있다. 하지만 다중연결 그래프에서 각각의 노드가 각각의 노드의 값을 참조하기 때문에 순환참조 구조가 되어 무한적으로 계산하게 되는 문제가 있고, 결과적으로 노드의 값을 계산할 수 없다는 문제가 있다. 페이지랭크 알고리즘에서는 이 각각의 페이지의 랭크값이 계산을 계속하다 보면 각각 하나의 값으로 수렴한다는 것을 증명하여 문제를 해결하였다. 아니, 애초에 문제가 되지 않았던 것이다. 이 과정에서 그래프의 각 노드 랭크값을 표현한 행렬에 변환연산을 함으로써 계산의 단계를 나아가는데, 이때 이용되는 마르코프 행렬을 구글행렬이라고 한다. 페이지랭크 알고리즘은 이러한 각각의 랭크값을 계산하는 정규화공식과 계산과정의 규칙성, 그리고 수렴한다는 증명으로 완성된다. 물론 산출 과정중에 초기 산출 방법과 루프의 해결 그리고 보정을 위한 서퍼가 존재한다.

+

(Step1) 초기화각 노드들의 중요도 초기값은 1N1N으로 설정.(이때 NN은 전체 웹페이지의 개수)

+

(Step2) 업데이트노드 K의 t번째 시도에서 중요도를 $PR(K;t)$ 라고 할때, $ PR(K;t+1)$ 은 $ PR(K;t+1) = \frac{1−d}{N} + d \Sigma{P∈K} \frac{PR(P;t)}{|Γ_P|} $ 이다. 여기서 $d(0≤d≤1)$는 제동(damping)계수이고, $Γ_K$는 K에서 인용한 노드들의 집합이다. 그리고 $|ΓP|$는 P를 인용한 노드의 개수이다.

+

구글행렬은 행렬분리를 하기 좋은 구조로 이루어져 있으며 이 덕분에 반복연산을 행하기에 매우 좋은 구조로 되어있다. 그래프를 인접행렬로 표현한 후, 각각의 페이지값을 확률행렬로 나타낸다. 인접행렬을 n승하면 n번 순회하여 도달하는 페이지를 의미한다. 하지만 인접행렬로 계산하면 수렴성을 보장할 수 없기 때문에 수렴성의 확보를 위해 확률행렬로 변환한 후, 각 열의 합이 1이 되고 나서 n승 계산을 수행한다. 따라서 행렬 S는 다음과 같이 정의한다. $S = H + \frac{1e^T}{N}$ N은 총 노드의 갯수, 벡터 1인 전체 1인 열벡터이고, e는 특정 열의 합이 0이면 원소값이 1인 열벡터이다.

+

이제 이 확률행렬을 수렴하게 계산하기 위해 구글행렬 G를 계산한다.

+

$G = dS + (1-d)E$이고, 이때 d는 Damping 계수이다. 이렇게 계산한 구글행렬을 페이지랭크 알고리즘에 대입하면 가장 큰 고윳값이 1인 행렬이 되어 Frobenius 정리에 의해 초기값에 관계없이 일정한 값으로 수렴한다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2022/12/vae의-손실-함수/index.html b/public/2022/12/vae의-손실-함수/index.html new file mode 100644 index 0000000..8af46ab --- /dev/null +++ b/public/2022/12/vae의-손실-함수/index.html @@ -0,0 +1,301 @@ + + + + + + + + +VAE의 손실 함수 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ VAE의 손실 함수 +

+ + +
+
+

VAE의 손실 함수는 Variational Lower Bound(VLB)라고도 불리는데, 이 함수는 VAE에서 사용되는 정보량을 측정하는데 사용됩니다. 이 함수는 두 부분으로 나뉘어져 있으며, 이를 분리하여 계산하는 것이 일반적입니다. 이 때, reparametrization trick이란 기법을 사용하면 VAE의 손실 함수의 그래디언트를 계산하는 데 도움이 될 수 있습니다.

+

먼저, VAE의 손실 함수는 아래와 같이 정의됩니다.

+

$$L = \mathbb{E}{q(z|x)}[\log p(x|z)] - D{KL}(q(z|x)||p(z))$$

+

여기서 $p(x|z)$는 인코더의 출력을 디코더의 입력으로 넣었을 때 생성되는 값을 의미하고, $p(z)$는 잠재 변수의 확률 분포를 의미합니다. $q(z|x)$는 인코더의 출력을 잠재 변수의 확률 분포로 추정한 것을 의미하며, $D_{KL}$은 클로저-라이브러리 발산을 의미합니다.

+

이를 분리하여 계산하면 아래와 같이 나뉩니다.

+

$$L = \mathbb{E}{q(z|x)}[\log p(x|z)] - D{KL}(q(z|x)||p(z))$$

+

$$= \mathbb{E}{q(z|x)}[\log p(x|z)] - \mathbb{E}{q(z|x)}[\log \frac{q(z|x)}{p(z)}]$$

+

이때, reparametrization trick을 이용하면 손실 함수의 그래디언트를 쉽게 계산할 수 있습니다. 이 기법은 잠재 변수의 확률 분포를 정의할 때, 정규 분포의 모수를 함수로 표현하는 것을 의미합니다. 이렇게 하면 잠재 변수의 확률 분포를 명시적으로 정의할 수 있어 그래디언트를 계산하기 쉬워집니다.

+

예를 들어, $q(z|x)$를 아래와 같이 정의할 수 있습니다.

+

$$q(z|x) = \mathcal{N}(\mu(x), \sigma^2(x))$$

+

여기서 $\mu(x)$와 $\sigma^2(x)$는 인코더의 출력을 이용해 계산된 정규 분포의 모수입니다. 이렇게 정의된 $q(z|x)$를 이용하면 손실 함수의 그래디언트를 아래와 같이 계산할 수 있습니다.

+

$$\frac{\partial L}{\partial \theta} = \frac{\partial}{\partial \theta}\mathbb{E}{q(z|x)}[\log p(x|z)] - \frac{\partial}{\partial \theta}\mathbb{E}{q(z|x)}[\log \frac{q(z|x)}{p(z)}]$$

+

$$= \mathbb{E}{q(z|x)}\left[\frac{\partial}{\partial \theta}\log p(x|z)\right] - \mathbb{E}{q(z|x)}\left[\frac{\partial}{\partial \theta}\log \frac{q(z|x)}{p(z)}\right]$$

+

이때, 위 식의 첫 번째 항을 전개하면 다음과 같습니다.

+

$$\mathbb{E}_{q(z|x)}\left[\frac{\partial}{\partial \theta}\log p(x|z)\right] = \int q(z|x)\frac{\partial}{\partial \theta}\log p(x|z) dz$$

+

여기서 $\theta$는 VAE에서 사용되는 모든 매개변수를 의미합니다. 따라서 이 식을 이용하면 VAE의 손실 함수의 그래디언트를 계산할 수 있습니다.

+

예를 들어, 손실 함수가 $L = \mathbb{E}{q(z|x)}[\log p(x|z)] - D{KL}(q(z|x)||p(z))$인 경우에는 첫 번째 항의 그래디언트는 다음과 같이 계산할 수 있습니다.

+

$$\frac{\partial}{\partial \theta}\mathbb{E}{q(z|x)}[\log p(x|z)] = \mathbb{E}{q(z|x)}\left[\frac{\partial}{\partial \theta}\log p(x|z)\right]$$

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2023/10/chat-with-gpt-about-nuclear-fission/index.html b/public/2023/10/chat-with-gpt-about-nuclear-fission/index.html new file mode 100644 index 0000000..6b2fe07 --- /dev/null +++ b/public/2023/10/chat-with-gpt-about-nuclear-fission/index.html @@ -0,0 +1,658 @@ + + + + + + + + +Chat with GPT, about Nuclear Fission | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Chat with GPT, about Nuclear Fission +

+ + +
+
+

I made GPT create a new question about GPT’s response, and repeated it for 10 minutes.

+

This is log for it.

+

Question:

+

What is nuclear fission reactor, and what is breeder reactor?

+

Answer:

+

A nuclear fission reactor is a device used to initiate and control a self-sustained nuclear chain reaction. These reactions are used to generate heat, which is typically used in steam turbines to produce electricity in a nuclear power station.

+

In a fission reactor, heavy atomic nuclei, such as those of uranium or plutonium, are split into lighter nuclei through a process called nuclear fission. This process releases a considerable amount of energy, along with two or more neutrons. These neutrons can then induce further fissions, which release more neutrons, and so on. This can be controlled and sustained as a chain reaction, and is the fundamental process in a nuclear reactor.

+

A breeder reactor, on the other hand, is a type of nuclear fission reactor that is designed to generate more fissile material (nuclear fuel) than it consumes. This is achieved by surrounding the fission core of the reactor with a blanket of material (like uranium-238) that can capture neutrons and transform into a fissile material (like plutonium-239).

+

Breeder reactors aim to make better use of the nuclear fuel resources available. It’s called a “breeder” because it breeds new fuel. Compared to other types of reactors which waste a lot of the nuclear potential of the fuel, breeder reactors maximize the energy obtained from the nuclear fuel. The advantage of using breeder reactors is that they have the potential to extract almost all of the energy contained in uranium or thorium, decreasing the volume of nuclear waste and extending the use of these fuels for many thousands of years.

+

Question:

+

How can we optimize the design of a nuclear breeder reactor to maximize the production +of fissile material while minimizing the production of radioactive waste?

+

Answer:

+

Optimizing the design of a nuclear breeder reactor to maximize the production of fissile material and minimize the production of radioactive waste involves a series of complex scientific and engineering challenges. Here are a few technical approaches:

+
    +
  1. Fuel Type and Assembly: Fast breeder reactors (FBRs) typically use a mix of uranium and plutonium, where the fuel assembly design is crucial. In order to create a situation where more fuel is produced than consumed, the fuel rods are surrounded by a “blanket” of depleted uranium, which captures fast neutrons and converts non-fissile U-238 into fissile Pu-239.
  2. +
  3. Neutron Economy : Maximizing the production of fissile material also requires careful management of neutron economy. Every neutron that is absorbed without causing fission is a neutron lost to the breeding process. Therefore, the materials and geometry of the reactor are designed to minimize neutron losses.
  4. +
  5. Coolants & Moderators: The selection of coolant and absence of moderator are also important. Fast breeder reactors use liquid metal coolants, such as sodium, which do not slow down neutrons as much as traditional coolants. Since fast neutrons are required for breeding, this design increases the overall breeding ratio.
  6. +
  7. Reprocessing & Recycling: The spent fuel contains valuable fissile material. Reprocessing and recycling of spent fuel can potentially recover this material, reducing both the need for fresh fuel and the amount of high-level waste.
  8. +
  9. Waste management: Designing a reactor to minimize waste production requires an understanding of the nuclear reactions and isotopes produced. The reactor can be designed to burn off longer-lived transuranic waste while producing short-lived fission products.
  10. +
  11. Shielding & Containment: Shielding and containment structures play an important role in containing and reducing any radioactive waste leakage.
  12. +
+

It’s important to note that while breeder reactors have the potential to greatly extend our nuclear fuel supply, they come with significant technical, economic, and proliferation challenges.

+

Question:

+

How can advanced materials and fuels be designed to enhance the efficiency and safety of nuclear breeder reactors while reducing the potential for nuclear proliferation?

+

Answer:

+

Designing advanced materials and fuels for nuclear breeder reactors often comes down to two key aspects: enhancing efficiency and safety, and reducing the potential for nuclear proliferation. This is certainly a complex and multifaceted question, but I can explain a few strategies that scientists and engineers use:

+
    +
  1. Advanced Fuel Designs: The fuel used in breeder reactors is typically a mix of fissile material like plutonium-239 and fertile material such as uranium-238. New advanced fuel designs often involve using a mix of different elements, such as adding other actinides that can also be transmuted into fissile materials. These other elements can not only increase the amount of fissile material produced but also make it more difficult to use the produced plutonium for weapons, reducing proliferation risk.
  2. +
  3. Advanced Coolant Materials: The efficiency and safety of nuclear reactors can be improved by optimizing the materials used in the coolant system, which removes heat from the reactor core. For instance, liquid metal coolants like sodium or lead can operate at high temperatures without high pressures, improving thermal efficiency and reducing the risk of pressure-related accidents.
  4. +
  5. Cladding Materials: The cladding is the material that encases the fuel in the reactor. It must be corrosion-resistant, must not absorb too many neutrons (to avoid reducing the efficiency of the reactor), and must withstand high temperatures and radiation levels. Advanced cladding materials, such as silicon carbide, are being researched and can potentially improve both safety and efficiency.
  6. +
  7. Reprocessing: Reprocessing is a method where spent nuclear fuel is chemically processed to separate out useful elements that can be reused as fuel. This can help enhance efficiency by making more use of the fuel, and also reduce waste. However, it also poses proliferation risks, as it involves handling and potentially producing weapons-usable materials.
  8. +
  9. Non-Proliferative Fuel Cycles: Researchers are studying potential fuel cycles that could greatly reduce proliferation risk. An example is the uranium-233/thorium-232 cycle, where the uranium-233 is denatured with uranium-238, making it unsuitable for weapons uses.
  10. +
+

Remember, while these strategies can reduce risks and improve efficiency, they don’t eliminate all challenges or problems. It’s a complex balancing act that requires careful engineering and policy decisions.

+

Question:

+

How can advanced computational modeling and simulation techniques be used to accurately predict and optimize the performance of advanced materials and fuels in nuclear breeder reactors?

+

Answer:

+

Advanced computational modeling and simulation techniques play a crucial role in the analysis and design of modern nuclear breeder reactors. They are tools scientists use to predict behavior of the fuel and material in a nuclear reactor, which would be too complicated, expensive, dangerous, or even impossible to observe directly.

+

The design and optimization of materials and fuels for breeder reactors using computational techniques generally involve the following steps:

+
    +
  1. Microscopic Scale: At the atomic level, quantum mechanical simulations like Density Functional Theory (DFT) or Monte Carlo simulations can be used to understand and predict the behavior of materials under radiation, their mechanical and thermal properties, diffusion of atoms, and formation of defects or precipitates.
  2. +
  3. Mesoscopic Scale: Phase field simulations, cellular automata, lattice kinetic Monte Carlo, or discrete dislocation dynamics can model the microstructural evolution, grain boundary movement, or dislocation dynamics to predict material properties.
  4. +
  5. Macroscopic Scale: At a larger scale, Finite Element Analysis (FEA) or Computational Fluid Dynamics (CFD) can model stress-strain behaviors, deformation, or heat transfer in the reactor components under different conditions.
  6. +
  7. Neutronics Simulations: These simulate the neutron population in a nuclear reactor over time. Monte Carlo methods or deterministic methods like the method of characteristics can be used. This helps understand and predict fuel burnup, power distribution, or reactor kinetic behaviors.
  8. +
+

A successful optimization would aim for materials and fuels that demonstrate superior thermal properties, stand up to high radiation with less damage (high radiation tolerance), and limit the transmutation to less harmful isotopes or those that can be reused as fuel.

+

As far as reducing nuclear proliferation is concerned, computational modeling can help explore designs that limit production or ease of access to weapons-usable materials.

+

In conclusion, advanced computational modeling and simulation techniques are indispensable tools in the design and optimization of nuclear breeder reactors. They give scientists and engineers the ability to predict and control complex behaviors, ultimately leading to safer, more efficient, and more proliferation-resistant reactors.

+

Question:

+

How can quantum simulations be leveraged to study the behavior of advanced materials and fuels in nuclear breeder reactors at an atomic scale?

+

Answer:

+

Quantum simulations or quantum mechanical simulations are a powerful tool that apply the principles of quantum mechanics to predict and understand the behaviors of particles at the atomic and subatomic level. They can provide valuable insights into the properties of advanced materials and fuels at an atomic or molecular level.

+

In the context of nuclear breeder reactors, quantum simulations could be utilized in several ways:

+
    +
  1. Structural Analysis: Quantum simulations can predict the atomic-scale structure of the fuels. This includes details about defects or deformities, electron distribution, and reaction rates, giving hints on how a material may behave under extreme conditions typical of nuclear reactors.
  2. +
  3. Thermodynamic Properties: Quantum simulations can predict properties like heat capacity, thermal expansion coefficients, melting points, and more. This information is useful to predict how materials handle high-temperature situations inside a reactor.
  4. +
  5. Reactivity and Transmutation Analysis: Quantum simulations can be used to study the transmutation of elements, which is crucial in a breeder reactor where fuel atoms are transformed into different isotopes and elements.
  6. +
  7. Radiation Damage Analysis: Quantum simulations can study the effects of radiation on materials, predicting how they’ll respond to neutron radiation in the reactor. This would help in developing materials that have a better resistance to radiation damage.
  8. +
+

While simulation offers many potential advantages, their accuracy relies upon the physical models and parameters used. This kind of simulations also requires advanced computational capabilities due to the complex nature of quantum mechanical calculations, and interpretation of results often requires a deep understanding of both nuclear physics and reactor engineering.

+

But despite these challenges, the use of quantum simulations to study the behavior of advanced materials and fuels in nuclear reactors stands as an exciting area of research that could significantly advance our understanding and hence improve the design and operation of these complex systems.

+

Question:

+

How can the principles of quantum mechanics be utilized to develop new materials with enhanced properties for use in nuclear breeder reactors?

+

Answer:

+

Quantum mechanics, which governs the behavior of particles at atomic and subatomic scales, plays an integral role in the design of new materials for nuclear breeder reactors.

+

Firstly, quantum mechanical properties are critical in determining the material’s electronic and molecular structure which directly affects its physical and chemical properties. For example, the resistance of a material to radiation-induced damage is related to how its atoms are bonded which is in turn determined by quantum mechanics.

+

Secondly, quantum mechanics provides the foundation for computational methods (such as density functional theory) used to predict and optimize properties of materials before they are synthesized. This allows efficient screening and selection of materials with desired properties.

+

Thirdly, new quantum effects may be harnessed to create novel materials with improved properties. For example, nanostructured materials, which rely on quantum size effects, can potentially outperform their macroscopic counterparts.

+

However, it is important to note that while quantum mechanics can guide the development of new materials, actual implementation also require consideration of other factors such as manufacturability, cost, and safety among others.

+

Question:

+

How can quantum entanglement be harnessed to enhance the efficiency and stability of nuclear breeder reactors?

+

Answer:

+

Quantum entanglement is a quantum mechanical phenomenon in which the quantum states of two or more objects have to be described with reference to each other, even though the individual objects may be spatially separated. This can potentially have significant implications in the field of quantum computing, where quantum entanglement is a key resource for many protocols.

+

However, in the context of nuclear breeder reactors, quantum entanglement may not have any direct engineering applications, at least not with our current understanding and technology. The behaviour of nuclear reactors is fundamentally a large-scale, classical physics problem and does not directly involve quantum entanglement at an operational level.

+

Many sub-atomic reactions occurring within a nuclear reactor do depend on quantum phenomena, as the behavior of subatomic particles is governed by quantum mechanics. However, the concept of quantum entanglement as used in quantum computing and quantum information, doesn’t apply directly to enhancing the efficiency and stability of nuclear reactions.

+

On a more theoretical ground, manipulating individual nuclear spins via quantum entanglement could perhaps alter the probability of certain fission or fusion reactions, but such manipulation is well beyond our current technological capabilities and are not the subject of any current research in practical reactor design. Most research into incorporating quantum effects into nuclear reactions is currently theoretical and in very early stages of experimental investigation and not yet applied in practical energy production.

+

Nonetheless, the study of quantum phenomena at small scales continues to deepen our understanding of nuclear reactions and could potentially lead to breakthroughs in the future.

+

Question:

+

How can we utilize quantum computing to optimize the design and operation of nuclear breeder reactors, taking into account complex multi-physical phenomena and constraints?

+

Answer:

+

Quantum computing can potentially revolutionize the optimization of nuclear breeder reactor design and operation by handling complex multi-physical phenomena much more efficiently than classical computers.

+

Firstly, quantum computing offers exponential speedup for certain computations. For example, simulating the behavior of quantum systems in reactor materials is exponentially hard for classical computers, but can theoretically be done efficiently using a quantum computer. Hence, material properties and reactor performance could be predicted more accurately.

+

Secondly, certain optimization problems such as reactor core design and operation scheduling can be framed as quantum annealing problems or other types of quantum optimization problems. Using a quantum annealing approach could potentially find the global optimum more efficiently than classical optimization algorithms.

+

However, we should note that the current state of quantum computing is still experimental and practical quantum computing devices are in early stages of development. The utility of quantum computing for nuclear breeder reactor design is a topic of active research and is expected to become viable as quantum technology continues to mature.

+

Finally, it’s also important to address that the use of quantum computing in nuclear reactor planning must also be undertaken with a comprehensive understanding of the safety, security, and ethical implications associated with the technology.

+

Question:

+

How can we use machine learning algorithms to analyze vast amounts of data generated by nuclear breeder reactors in order to identify patterns and optimize their performance?

+

Answer:

+

Quantum computing and machine learning can be highly beneficial for analyzing the vast amounts of data generated by nuclear breeder reactors. These techniques can help optimize reactor performance, predict potential issues, and devise solutions more efficiently and accurately than traditional methods.

+

Machine learning algorithms can analyze large volumes of data to identify patterns that might not be obvious or intuitive to human operators. This could include relationships between different variables, trends over time, or anomalies that could indicate a problem.

+

Machine learning can assist in predicting and mitigating potential issues. For example, a machine learning model could forecast when certain components might fail based on their operating conditions and past performance, allowing technicians to perform maintenance before a breakdown occurs.

+

Machine learning can also be used to optimize reactor performance. By analyzing historical data on reactor operations, machine learning algorithms can identify the most efficient operating conditions and strategies.

+

Quantum computing could bring further benefits. While still a developing technology, quantum computers have the potential to perform calculations and simulations much faster and more accurately than conventional computers. In nuclear reactor design and operation, this could be used to model complex physical phenomena, such as the behavior of fuels and materials under different conditions.

+

By combining quantum computing and machine learning, it could be possible to create predictive models and optimization algorithms that are not only more accurate and efficient, but also capable of handling the complexity and volume of data generated by nuclear breeder reactors.

+

Question:

+

How can the integration of artificial intelligence and autonomous control systems improve the safety, efficiency, and overall performance of next-generation nuclear breeder reactors?

+

Answer:

+

Artificial Intelligence (AI) and autonomous control systems can significantly improve the safety and efficiency of next-generation nuclear breeder reactors in several ways.

+
    +
  1. Automated operation: Autonomous control systems can reduce human error by managing everyday operations of a nuclear reactor. This includes monitoring temperature, pressure, power output levels, and more. By automating these tasks, the system can respond quicker and more accurately than a human operator could in case of a deviation.
  2. +
  3. Incident prediction and reaction: AI can be used to predict potential faults or incidents by analyzing historical data and learning to identify signs of a potential problem. If the AI system predicts a potential incident, the autonomous controls can react quickly to mitigate the effects or avoid it.
  4. +
  5. Optimization of operation: Machine learning, a subset of AI, can be used to optimize the operation of the reactor. The system can analyze a vast amount of data from the reactor’s operation and learn how to optimize its conditions for different requirements.
  6. +
  7. Maintenance planning: Predictive maintenance systems can predict when a component might fail or requires attention, reducing the downtime and increasing the efficiency of the overall system.
  8. +
  9. Fuel optimization: AI can model and predict the behavior of the reactor’s fuel, helping to maximize efficiency and minimize waste.
  10. +
  11. Training and simulation: AI can be used to create realistic training simulators for operators, improving safety by providing better training.
  12. +
+

It’s important to mention that though these technologies offer significant potentials, their implementation also requires careful considerations in terms of safety, reliability, and cybersecurity.

+

Question:

+

How can we leverage advanced algorithms and data analytics to optimize the operation of nuclear breeder reactors in real-time, considering factors such as fluctuating power demands, fuel availability, and safety constraints?

+

Answer:

+

The leveraging of advanced algorithms and data analytics can play a crucial role in optimizing the real-time operation of nuclear breeder reactors. Various complex parameters and constraints should be taken into account, including fluctuating power demands, fuel availability, and safety precautions.

+

Using advanced machine learning algorithms, we can glean insights from collected data to predict reactor performance under a range of conditions. For example, a predictive model could be used to optimize reactor output in response to fluctuating power demands, keeping the system running at its most efficient while preventing any overload.

+

Additionally, fuel availability could be better managed through the use of predictive analytics, thus ensuring a sufficient supply of fuel and minimizing the risk of shortages.

+

Most importantly, safety is a crucial factor in the operation of any nuclear system. Advanced algorithms can identify unusual patterns in the data, which could be indicative of a potential safety issue. An autonomous control system could then take immediate actions, such as shutting down the reactor or adjusting its performance, to avert a potential crisis.

+

Thus, integrating advanced algorithms and data analytics in nuclear breeder reactor operation can significantly enhance efficiency, ensure the constant availability of fuel, and most importantly, improve safety measures.

+

Question:

+

How can we develop advanced machine learning algorithms that can dynamically adapt and optimize the operation of nuclear breeder reactors in response to changing external conditions and internal parameters, while ensuring safety and efficiency?

+

Answer:

+

To develop advanced machine learning algorithms for the dynamic adaptation and optimization of the operations of nuclear breeder reactors, the following principal steps might be necessary:

+
    +
  1. Data Acquisition and Preprocessing: This involves collecting relevant data from the reactor operations. The data would include various parameters such as temperature, pressure, neutron flux, fuel utilization, power output, and more. This data would then be preprocessed to remove any noise and anomalies.
  2. +
  3. Feature Selection: In this step, relevant features from the data that are critical to predicting the reactor performance are identified. Methods like correlation analysis, principle component analysis (PCA), and mutual information might be used for this purpose.
  4. +
  5. Training the Machine Learning Model: Once the data is ready, it can be used to train a machine learning model. A model such as a neural network might be suitable due to its ability to handle complex, nonlinear relationships between different parameters.
  6. +
  7. Prediction and Optimization: The trained machine learning model can be used to predict various performance measures of the reactor based on different operating conditions. The prediction results can then be used to optimize the operation of the reactor. For instance, an optimization algorithm such as a genetic algorithm or a gradient descent could be used to find the optimal operating conditions that maximize the reactor’s efficiency while ensuring safety.
  8. +
  9. Online Learning and Adaptation: Given that reactor conditions and performance can change over time, the machine learning model should ideally be capable of online learning - i.e., continually updating and improving its predictions based on new data. This allows the model to adapt to changing conditions over time.
  10. +
  11. Safety Verification: At all times, the algorithms should ensure that safety constraints are respected. In addition, these systems should be designed with fail-safe mechanisms to ensure that manual control can be reinstated at any time.
  12. +
+

Implementing such measures entails multidisciplinary knowledge, including domain knowledge of nuclear physics and engineering, machine learning, optimization theory, and control systems. It also demands rigorous testing and validation to ensure the reliability and safety of the algorithms. Ultimately, the integration of such systems could significantly improve the efficiency and safety of nuclear breeder reactors.

+

Question:

+

How can we integrate advanced robotics and sensing technologies into nuclear breeder reactors to enable remote inspection, maintenance, and repair, thereby enhancing safety and reducing the exposure of workers to radiation?

+

Answer:

+

Nuclear breeder reactors, due to their inherent high radiation environment, can certainly benefit from the integration of advanced robotics and sensing technologies.

+

Specifically, robotics can be designed to handle tasks that would be too dangerous for humans, including handling radioactive materials, inspecting and monitoring reactor conditions, performing cleaning tasks, and conducting emergency response procedures. Robots equipped with specialized sensors, vision systems, and manipulators can perform these tasks with an accuracy and consistency that far exceeds human capability.

+

Sensing technologies are also very crucial in maintaining the safety and integrity of the reactor. They can include radiation detectors, temperature sensors, pressure sensors, fluid flow sensors, and material integrity sensors to monitor different state conditions within the reactor.

+

The integration of such technologies must be carefully engineered to handle the conditions present in a reactor, including high radiation, extreme temperatures, and potentially corrosive environments. Moreover, these systems must be capable of autonomous or semi-autonomous operation due to the remote and inaccessible nature of their work environment.

+

Additionally, advanced algorithms and communication protocols must be developed to handle the large volumes of data gathered by these systems, allowing for real-time monitoring, decision-making, and control of the reactor.

+

By integrating these technologies into nuclear breeder reactor design, it is possible to significantly increase operational safety, efficiency and longevity, while simultaneously reducing the risk to human personnel.

+

Question:

+

How can the principles of robotics and artificial intelligence be leveraged to develop autonomous systems that can effectively manage and mitigate potential nuclear accidents in breeder reactors, ensuring the safety of both the facility and surrounding environment?

+

Answer:

+

The development of autonomous systems to manage and mitigate potential nuclear accidents in breeder reactors would be multifaceted, relying on advancements in several areas, from sensing and perception, decision making, to physical execution, all under the principles of robotics and artificial intelligence.

+

Sensing and Perception: Advanced sensors and AI-driven perception systems can be used to continuously monitor the condition of the reactor in real-time. They can collect data on various parameters such as temperature, pressure, radiation levels etc, and use machine learning algorithms to detect anomalies or recognize patterns indicative of a potential accident.

+

Decision Making: If an anomaly is detected, an AI system, leveraging robotics and controls principles, can be used to determine the best course of action. It might involve a combination of predictive modeling (to forecast the evolution of the accident), optimization (to determine the action that minimizes the impact), and decision theory (to handle uncertainty and make decisions under risk).

+

Physical Execution: Autonomous robots, designed to withstand harsh environments (like high temperature and radiation), can be utilized to carry out tasks such as repairing faults, shutting down systems, or applying cooling mechanisms. Such robots should possess advanced locomotion capabilities to navigate complex structures, and manipulation capabilities to handle tools and perform delicate operations.

+

Learning and Adaptation: Once an incident has been managed, machine learning methods can be used to learn from the incident, and update the models or decision-making algorithms accordingly. This ensures that the system gradually becomes better at preventing and responding accidents.

+

With the integration of these technologies, it’s possible to have an autonomous system that can effectively manage and mitigate potential nuclear accidents, thereby enhancing the safety of nuclear breeder reactors and reducing risks for human personnel.

+

Question:

+

How can we optimize the integration of renewable energy sources with nuclear breeder reactors to create a sustainable and resilient energy system for the future?

+

Answer:

+

Optimizing the integration of renewable energy sources with nuclear breeder reactors requires strategic planning, smart grid technologies, and sophisticated energy management systems. The following steps might be considered:

+
    +
  1. Diversifying Energy Sources: Rather than relying entirely on nuclear breeder reactors, an energy system including various renewable sources like solar, wind, hydro, and bio-energy, can ensure continuous power supply and make the system more resilient to the unpredictability of certain renewables.
  2. +
  3. Advanced Energy Storage Solutions: Energy storage technologies like supercapacitors, flywheels, and advanced battery systems can store excess power produced during periods of low demand or high renewable generation and release it during peak demand or when renewable generation is low. This can help balance the load between nuclear and renewable sources effectively.
  4. +
  5. Smart Grid Technologies: Smart grids can optimize energy flow, manage demand responses, and improve overall grid reliability. Real-time monitoring of both supply and demand can help to properly allocate power produced from different sources.
  6. +
  7. Advanced Energy Management Systems: These systems use machine learning and artificial intelligence algorithms to optimize power generation, transmission, and distribution from diverse energy sources. They continually monitor and predict power load, weather conditions, and grid status to adjust the operation of the system in real time.
  8. +
  9. Grid Flexibility and Interconnections: Strengthening the connectivity of the grid and enhancing its ability to flexibly respond to fluctuations, can enable the optimized use of varying power sources. This can be achieved through the use of virtual power plants and energy hubs.
  10. +
  11. Policy and Regulation: Formulating and implementing appropriate policies and regulations to manage investment risks, power purchase agreements, and grid management can accelerate the integration of renewables with nuclear breeder reactors.
  12. +
+

Please note that each solution also comes with potential challenges that need to be addressed. For example, a storage solution must take into account the costs associated, renewables’ intermittency can risk grid stability, and policy-related factors depend heavily on the specific political, social, and economic conditions of the area where the system is implemented.

+

Question:

+

How can we design an integrated energy grid that incorporates advanced energy storage technologies and utilizes machine learning algorithms to efficiently balance the intermittent nature of renewable energy sources with the constant baseload power provided by nuclear breeder reactors?

+

Answer:

+

Designing an integrated energy grid that incorporates advanced energy storage technologies and utilizes machine learning algorithms to balance the intermittent nature of renewable energy sources requires several steps:

+
    +
  1. Energy Storage: We need to integrate advanced energy storage technologies like batteries, flywheels, pumped hydro storage, and thermal energy storage. These technologies can store excess energy generated during periods of low demand and deliver it during times of high demand.
  2. +
  3. Smart Grid: An intelligent and smart grid system is required to manage and control the flow of electricity to ensure it gets delivered from the point of generation to the end consumers efficiently and effectively. This includes implementing automation, machine learning, real-time monitoring, and predictive modeling to control the power flow, detect faults, and respond to power outages.
  4. +
  5. Machine Learning Algorithms: Advanced machine learning algorithms can be leveraged to analyze real-time data from various energy sources, forecast energy demand and supply, and make intelligent decisions on how to balance them. For instance, they can be used to optimize when to store energy, when to release it, and how to distribute it across the grid.
  6. +
  7. Demand Response Management: Implementing demand response management systems that respond to changes in the price of power supply can also be a way to align demand with supply. With the help of IoT devices and smart meters, consumers can be encouraged to shift their use of electricity to times when the cost is lower, which often corresponds to when the supply is abundant.
  8. +
  9. Interconnecting Networks: Enhancing the interconnectivity of electricity networks can allow for efficient balancing of power supply and demand over a larger geographical area, as a surplus in one region can compensate for a deficit in another.
  10. +
  11. Flexible Baseload Power: Nuclear breeder reactors have the potential to provide a steady, constant supply of power. However, flexibility in their operation can be increased to complement the nature of renewable energy supplies. For instance, the output power from these reactors can be lowered during periods of high renewable energy generation and increased when renewable energy generation is low.
  12. +
+

These integrated approaches combined can potentially create a highly efficient, resilient, and sustainable energy system for the future.

+

Question:

+

What novel advancements in materials science and engineering can be explored to improve the efficiency and longevity of nuclear breeder reactors, while minimizing the use of rare earth elements?

+

Answer:

+

Improving the efficiency and longevity of nuclear breeder reactors, and minimizing the use of rare earth elements can be achieved by exploring the following advancements in materials science and engineering:

+
    +
  1. High-temperature Materials: The efficiency of nuclear reactors can be improved by using materials that can withstand high temperatures without degradation. The higher the operating temperature of a reactor, the higher its thermodynamic efficiency. Materials like High-Entropy Alloys (HEAs) and ceramic composites (Silicon carbide-SiC) which have high heat resistance could be potential candidates.
  2. +
  3. Corrosion-resistant Materials: The longevity of the reactor can be improved by using corrosion-resistant materials. Materials such as Ni-based superalloys and corrosion resistant coatings may play a critical role in this area.
  4. +
  5. Advanced Fuel Cladding Materials: The cladding is the first layer of defense in preventing the release of radiation from the reactor. Materials with greater burnup capability, such as advanced steels or alloys, can reduce the use of fuel over the reactor’s lifetime.
  6. +
  7. Materials for Coolants: Improved coolants such as liquid metals (like sodium, lead or a lead-bismuth eutectic) or gases (like helium) could be used. These coolants can operate at high temperatures without the high pressures required by water coolants, improving efficiency and safety.
  8. +
  9. Neutron Economy: Regarding the reduction of rare earth elements usage, replacing them with neutron efficient materials in the reactor designs could be done. Thorium, for example, is much more abundant and could be a suitable substitute in some breeder reactor designs.
  10. +
  11. Reducing and Recycling Waste: Lastly, research is being done into how nuclear waste can be recycled into usable fuel, thereby reducing the need for fresh fuel.
  12. +
+

Advanced computational techniques and simulations are being used to predict the behavior and performance of these new materials under the extreme conditions within a reactor. However, all these materials must undergo rigorous testing and verification before they can be used in a working reactor.

+

Question:

+

Can we develop new materials that exhibit high radiation resistance, thermal conductivity, and stability under extreme conditions, while also being more environmentally friendly and sustainable than current materials used in nuclear breeder reactors?

+

Answer:

+

Advancements in materials science and engineering are key to addressing this question. Scientists are exploring several avenues in the development of such materials.

+
    +
  1. High-entropy alloys (HEAs): These are substances composed of multiple principal elements mixed in similar proportions, known for their high strength, ductility, and resistance to wear and deformation, making them potentially suitable for reactor applications.
  2. +
  3. Ceramic composites: Certain ceramics and composite materials exhibit high thermal stability and resistance to radiation damage. Silicon carbide composites are one such example.
  4. +
  5. Metallic glass: These are metallic materials with disordered atomic-scale structure. They possess unique properties such as high strength and toughness, and good corrosion and wear resistance, potentially making them ideal for use in harsh environments such as nuclear reactors.
  6. +
  7. Nanostructured materials: These materials, engineered at the atomic or molecular level, can have unique properties like high strength and good radiation resistance that can be exploited.
  8. +
  9. Self-healing materials: These materials can automatically repair damage caused by radiation, improving their lifetime and reducing waste.
  10. +
  11. Refractory metals and alloys: These are a class of extraordinarily resistant materials – such as tungsten and its alloys – that could potentially be used.
  12. +
+

The ultimate goal would be to design a material that integrates the beneficial properties of each type for use in nuclear reactors. However, this is still an active area of research, and the practical implementation of such materials on a large scale has yet to be fully realized. Furthermore, the environmental impact and sustainability of these materials need to be fully evaluated. More research and scientific breakthrough will be needed to develop such materials.

+

Question:

+

How can we utilize nanotechnology to design and engineer advanced coatings and materials that can enhance the radiation resistance and thermal conductivity of nuclear breeder reactors, while also reducing the cost and environmental impact of their production and maintenance?

+

Answer:

+

Nanotechnology has the potential to significantly enhance the properties of materials used in nuclear breeder reactors. For example, the use of nanostructured materials, which have a high proportion of atoms at grain boundaries, could increase radiation resistance, since these boundaries can act as sinks for radiation-induced defects.

+

Furthermore, nanoparticles can be incorporated into fuel or structural materials to enhance their properties. One example is the dispersion of oxide nanoparticles in fuels, which can lead to increased thermal conductivity and burnup, and reduced swelling.

+

Nanocoatings can also be used to create a barrier between the fuel and the reactor coolant, reducing the release of fission products into the coolant and potentially extending the life of the fuel.

+

However, employing nanotechnology in reactor materials also presents challenges. The stability of nanostructures under irradiation and high temperatures is not fully understood, and the fabrication of nanoparticulate fuels or materials at a large scale remains a technical challenge.

+

Research is ongoing in this space to better understand these materials and their potential benefits and drawbacks. Scientists use advanced modeling and experimental tools to understand the behavior of these materials under the extreme conditions inside a reactor, aiming to design advanced nanostructured materials that can safely and effectively be used in nuclear breeder reactors.

+

Question:

+

How can advances in quantum computing and simulation techniques be employed to accelerate the discovery and development of novel materials for use in next-generation nuclear breeder reactors?

+

Answer:

+

The potential of quantum computing in discovering and developing novel materials is massive. Quantum computers use the principles of quantum mechanics to process information. They can model and simulate the behavior of materials at an atomic and subatomic level, which is beyond the capacity of classical computers.

+

By using quantum computing, scientists can virtually experiment with the properties and structures of new materials. This simulation approach can significantly cut down the trial-and-error part in the laboratory, reduce costs, and accelerate the material discovery process. For instance, in the context of nuclear breeder reactors, quantum computing could allow us to model and test the behavior of potential new fuels and structural materials under extremely high temperature and radiation conditions.

+

Moreover, quantum computation can facilitate the design of materials with improved characteristics such as higher radiation resistance, better thermal conductivity, or optimized neutron economy, which could significantly enhance the efficiency and safety of nuclear breeder reactors.

+

However, it’s important to note that although the potential is huge the quantum computing is currently in the development stage and it could take years or even decades before we see practical, wide-scale deployments in material science or other fields. The algorithms, error correction techniques, and hardware technologies for quantum computing are ongoing areas of research.

+

Question:

+

How can we harness the principles of quantum mechanics to design materials that can withstand the extreme conditions of nuclear breeder reactors, maximizing their efficiency and minimizing the production of radioactive waste?

+

Answer:

+

Quantum mechanics, as a fundamental theory in physics, provides a deep understanding of how particles like electrons and nuclei interact and behave. This knowledge can be harnessed in the design of materials for nuclear applications. Quantum mechanics principles can be utilized to understand material behavior at an atomic and molecular level.

+

Firstly, the principle of quantum superposition can allow us to predict the properties of materials under various conditions. For instance, quantum superposition could potentially enable the prediction of material behaviors under the high pressures and temperatures found inside a nuclear breeder reactor.

+

Secondly, quantum tunneling, another principle of quantum mechanics, might be utilized to improve the efficiency of nuclear reactions. Moreover, the principle of quantum entanglement could potentially be employed to make processes inside the reactor more controllable, which would lead to enhanced safety.

+

Thirdly, the study of quantum dots and other nanoscale materials could lead to advancements in radiation-resistant materials. These materials could potentially better withstand the harsh environment inside a nuclear reactor, thus increasing the reactor’s lifespan and safety.

+

Quantum mechanics is a rapidly evolving field and its application in the realm of material science is still in its infancy. But its potential applications in designing and developing new materials for nuclear reactors seem promising. It’s worth noting, however, that these are theoretical possibilities and more concrete results would require extensive research and experiments.

+

Question:

+

How can we optimize the interaction between quantum materials and nuclear breeder reactor systems to achieve unprecedented levels of energy efficiency and safety?

+

Answer:

+

Nuclear breeder reactors, due to their unique working principle, typically work at very high energy scales which is comparable to atomic scales. At these scales, quantum mechanical effects become significant. Optimizing the interaction between quantum materials and nuclear breeder reactor systems would require a solid understanding of quantum mechanics and statistical mechanics.

+

One possible approach to optimize the interaction might be to design materials with quantum properties that can withstand high temperature and pressure by taking into account quantum confinement and quantum exchange interaction. This could potentially increase the stability of the material under extreme conditions.

+

Another possible application of quantum materials is creating superconducting shields that might aid in the heat generation or transportation process, while also providing superior radiation absorption or shielding against neutrons generated in the reactor.

+

However, these topics are currently at the forefront of research and are fairly theoretical at the moment. They are not yet mature enough for industrial application, and a lot of work is still required to understand the practical intricacies of harnessing quantum principles in these scenarios.

+

Question:

+

How can we leverage advanced nanoscale engineering techniques to design materials with tailored quantum properties for use in nuclear breeder reactors?

+

Answer:

+

Advanced materials for nuclear breeder reactors can be developed by leveraging nanoscale engineering techniques to design materials with tailored quantum properties.

+

For example, quantum dots, which are nanoscale particles, can be engineered to have specific properties such as a specific band gap or optical properties. These can be used to enhance the efficiency of energy capture and conversion in nuclear reactors.

+

Similarly, materials with engineered nanostructures can be used to enhance thermal conduction and radiation resistance, thereby improving the safety and longevity of nuclear reactors. For example, nanocomposite materials containing high thermal conductivity nanoparticles can be used to enhance heat transfer. Meanwhile, nanolaminates can be utilized to provide high radiation resistance.

+

To achieve such advanced control over material properties, one can apply techniques from quantum physics and nanotechnology, such as quantum confinement and top-down or bottom-up nanofabrication. These allow us to precisely control the size, shape, composition, and arrangement of nanoparticles or nanostructures, tailoring the material’s response to nuclear environments.

+

Overall, the design of materials with tailored quantum properties using nanoscale engineering techniques could play a crucial role in improving the performance, safety, and sustainability of nuclear breeder reactors.

+

Question:

+

What are the potential implications and challenges of integrating quantum computing technologies into the control and optimization systems of nuclear breeder reactors?

+

Answer:

+

Quantum computing technologies have the potential to significantly enhance the control and optimization systems of nuclear breeder reactors due to their ability to process vast amounts of information and solve complex problems much quicker than traditional computing technologies. They could be utilized to model and simulate the behavior of the reactor core, optimize fuel use, monitor system performance, and predict potential faults or failures, among other things.

+

However, integrating quantum computing technologies into nuclear breeder reactors is not without its challenges. Firstly, quantum computers are highly sensitive to environmental disturbances, meaning that they need to be isolated from any external noise or interference. This presents a significant challenge in the context of a nuclear breeder reactor, which operates under extreme conditions of heat, radiation, and pressure.

+

Secondly, quantum computing is a very new and rapidly-evolving field, and there is still much to be learned about how to best utilize and manage these systems. This includes not only technical issues such as error correction and system optimization, but also broader logistical and regulatory issues.

+

Thirdly, there are also important security considerations to take into account when integrating quantum computing technologies into nuclear systems, given the potential for cyber-attacks that could compromise system integrity and safety.

+

Lastly, implementing quantum computing technologies would involve a significant investment in terms of both the technology itself and the necessary infrastructure and expertise to support it. This could be a barrier for some organizations, particularly in the public sector where budgets may be constrained.

+

Therefore, while the potential benefits of integrating quantum computing technologies into nuclear breeder reactors are substantial, these challenges need to be carefully considered and addressed.

+

Question:

+

How can we leverage quantum computing to enhance the accuracy and efficiency of nuclear waste management strategies, ensuring long-term containment and minimizing environmental impact?

+

Answer:

+

Question:

+

How can we leverage nanotechnology and advanced materials to develop efficient and sustainable methods for the safe storage and disposal of nuclear waste?

+

Answer:

+

Nanotechnology and advanved materials can play a significant role in improving the efficiency of nuclear waste disposal methods and the sustainability of nuclear power generally.

+

Firstly, nanomaterials can be used to enhance the efficiency of nuclear waste storage. An example are zeolites, a class of microporous minerals. Due to their larger surface-to-volume ratio, zeolites are capable of trapping and containing nuclear isotopes more efficiently than traditional materials.

+

Secondly, advanced materials such as borosilicate glass and synthetic rock have been used to immobilize nuclear waste. In a process known as vitrification, high-level waste is combined with glass-forming materials and heated until it melts and then cooled to form a solid, stable glass block. This method helps to contain the radioactivity and prevents leaching.

+

Other research is looking at encapsulating waste in synthetic rock. This waste form, known as Synroc, contains several titanate minerals which are capable of immobilizing the problematic components of nuclear waste.

+

Lastly, nanotechnology can also be used to reduce the volume of nuclear waste. A common approach is by using nanoparticles as absorbents or membranes that can effectively separate the radioactive elements from the waste.

+

However, these applications also come with challenges such as ensuring the long-term stability of these nanomaterials and advanced materials, as well as their resistance to radiation damage.

+

Developments in this field require interdisciplinary collaboration among nuclear physicists, materials scientists and engineers, and environmental scientists to ensure the safe and sustainable implementation of these technologies.

+

Question:

+

How can we utilize advanced materials and technologies to develop innovative strategies for the reprocessing and recycling of nuclear waste, thereby minimizing its long-term environmental impact and maximizing the potential for resource utilization?

+

Answer:

+

Question:

+

How can we develop advanced nuclear fuel cycles that optimize energy production, reduce waste generation, and minimize the proliferation risks associated with nuclear breeder reactors?

+

Answer:

+

Comprehensive optimization of advanced nuclear fuel cycles in breeder reactors involves a multi-pronged approach:

+
    +
  1. Fuel Efficiency: One of the most important goals is to improve fuel efficiency by designing and formulating fuels that can bear high burnup rates. This means creating fuel that can stay in the reactor longer, thereby extracting as much energy as possible from the nuclear material.
  2. +
  3. Waste Reduction: This involves focusing on fuel reprocessing and recycling strategies. Breeder reactors are typically capable of using recycled fuel. This can include techniques like pyroprocessing and advanced aqueous processing.
  4. +
  5. Proliferation Resistance: The fuel cycle must be designed to reduce the potential for proliferation. This means handling the materials such that it’s difficult to divert them for non-peaceful uses. This can be accomplished by increasing the accountability, control, and safeguard measures during material processing.
  6. +
  7. Safety: The fuel cycle needs to be inherently safe, so the processes involved in producing, using, and disposing of fuel should not bring about dangerous conditions.
  8. +
+

The specific processes and technologies to achieve these goals will depend on the type of reactor and fuel. Constant research is going on in areas like novel fuel formulations and designs, advanced waste reprocessing methods, and effective safeguards and containment techniques that ensure safety and non-proliferation.

+

Question:

+

What novel strategies can be explored to achieve sustainable and efficient utilization of nuclear fusion as a potential alternative to nuclear fission in the context of breeder reactors?

+

Answer:

+

Nuclear fusion is a different process compared to nuclear fission used in breeder reactors. The key challenge in harnessing nuclear fusion is to maintain the conditions under which fusion can occur.

+

For a fusion reaction, fuel (usually isotopes of hydrogen) needs to be heated to very high temperatures (approximately 100 million degrees Celsius) to form a plasma where the atoms have enough energy to overcome their natural repulsion and collide, leading to fusion. This state also needs to be confined and controlled for a sustained period of time. These conditions are challenging to achieve and maintain, and current fusion experiments consume more energy than they produce.

+

However, scientific and technological advancements are being made to improve the efficiency and feasibility of nuclear fusion. Some of the strategies include:

+
    +
  1. Advanced Plasma Containment: Development of advanced magnetic confinement systems, like tokamaks and stellarators, that can effectively contain the plasma, maintaining the conditions for fusion.
  2. +
  3. Alternative Fusion Methods: Exploration of alternative fusion methods, like inertial confinement fusion, which uses high-powered lasers to heat and compress the fuel.
  4. +
  5. Advanced Fusion Fuels: Use of advanced fusion fuels like helium-3, which generates less neutron radiation compared to other fusion reactions.
  6. +
  7. Advanced Materials: Development of materials that can withstand the harsh conditions inside a fusion reactor. These materials need to be resistant to high temperatures, high neutron radiation, and must also be able to efficiently transfer heat.
  8. +
  9. Machine Learning and AI: These technologies can potentially be used to optimize the complex plasma dynamics inside a fusion reactor in real-time.
  10. +
  11. Fusion-Fission Hybrids: Hybrid systems are being explored where fusion reactions are used to “breed” fissile material for use in conventional fission reactors, potentially improving the sustainability of nuclear energy.
  12. +
+

The feasibility of these strategies is a subject of ongoing research. Despite many challenges, nuclear fusion holds great promise as a virtually limitless and clean source of energy. If successful, it could complement or even replace fission reactors, including breeder reactors, in the future.

+

Question:

+

How can we overcome the challenges of achieving sustained and controlled nuclear fusion reactions in order to harness its immense potential as a clean and virtually limitless source of energy?

+

Answer:

+

The challenges to achieving sustained and controlled nuclear fusion are large and multi-faceted, with key areas including plasma confinement, plasma heating, neutron damage and reaction byproduct handling among others.

+
    +
  1. Plasma confinement: Fusion reactions take place at extremely high temperatures, forming a state of matter termed as plasma. Keeping the plasma stable and confined without touching the walls of the reactor is crucial. Two common methods in use today are magnetic confinement and inertial confinement, using strong magnetic fields or high energy lasers respectively.
  2. +
  3. Plasma heating: Adequate heating methods are crucial to maintain the high temperatures necessary for fusion reactions. This is often achieved through the use of high-frequency electromagnetic waves or neutral beam injection.
  4. +
  5. Neutron damage: The fusion process releases high energy neutrons which can cause structural damage to the reactor materials, inducing radioactivity. Developing robust materials that can withstand these conditions is a significant challenge.
  6. +
  7. Reaction byproduct handling: The fusion process generates byproducts including helium and neutron. Safe handling, extraction and disposal of these byproducts is another critical challenge.
  8. +
  9. Achieving ‘ignition’: A point at which the fusion reactions produce enough heat to sustain further reactions without external heating input is termed as ‘ignition’.
  10. +
+

Overcoming these challenges would require further extensive research, innovative engineering solutions, advanced materials science, plasma physics, and many other areas of science and technology.

+

Question:

+

What are the current limitations and challenges in the development and implementation of nuclear fusion as a viable and sustainable energy source on a large scale?

+

Answer:

+

The main challenges and limitations in achieving nuclear fusion as a viable and large-scale source of energy are:

+
    +
  1. Achieving and controlling high temperatures: Nuclear fusion reactions require extremely high temperatures (in the order of millions of degrees Celsius) to overcome the natural repulsion between atomic nuclei. Designing materials and devices capable of withstanding these high temperatures and controlling the plasma at these temperatures is a major challenge.
  2. +
  3. Sustaining the fusion reaction: For a fusion power plant to be viable, the fusion reaction must be sustained for a prolonged period. So far, it has been difficult to achieve this “ignition” where the fusion reaction is self-sustaining.
  4. +
  5. Net energy output: So far, no experimental fusion reactor has been able to achieve a net energy gain, i.e., producing more energy through the fusion reaction than the energy used to start and maintain the reaction. This is a fundamental requirement that must be met for fusion to be a practical source of power.
  6. +
  7. Neutron radiation: Fusion reactions generate high-energy neutrons, which can activate materials and make them radioactive. This poses challenges for materials design and reactor longevity.
  8. +
  9. Fuel supply: While the fusion of deuterium and tritium is the easiest to achieve and has been the focus of most research, tritium is not readily available and needs to be bred from lithium in the reactor, adding a layer of complexity to the fusion fuel cycle.
  10. +
  11. Cost and resources: Constructing a fusion reactor is a huge engineering challenge requiring significant resources. There is uncertainty whether fusion power can be economically competitive with other energy sources.
  12. +
  13. Nuclear waste: Although fusion reactors produce less radioactive waste than fission reactors and the waste is less long-lived, the management of waste is nonetheless an important consideration.
  14. +
+

Despite these challenges, advances in materials science, plasma physics, and engineering could eventually make nuclear fusion a viable energy source. Research in this field is ongoing and progress is being made, particularly with projects like the ITER fusion experiment in France.

+

Question:

+

What are the potential implications of harnessing nuclear fusion as a practical and abundant energy source for powering long-duration space exploration missions?

+

Answer:

+

Nuclear fusion has the potential to provide a nearly unlimited supply of energy with much less radioactive waste compared to nuclear fission. In the context of space exploration, if we can harness safe and controlled fusion reactions, it would be a game-changer.

+

Firstly, nuclear fusion could provide the high energy density required for long-duration space missions. A spacecraft powered by fusion energy could carry less fuel weight, which is a huge advantage given that fuel typically accounts for a large fraction of a spacecraft’s starting mass.

+

Secondly, nuclear fusion could also potentially power in-spacecraft systems for many years, even decades, providing long-term power generation.

+

Thirdly, in the farther future, if we could glean helium-3 (which is used in one type of fusion reaction) from lunar soil or the gas giants, it could potentially be used to fuel long-duration space missions.

+

However, despite its promise, nuclear fusion is currently not a viable power source for space missions. Challenges include the technology’s immaturity, the difficulty of achieving a sustained and controlled fusion reaction, the large size and mass of current experimental fusion reactors, and the high costs and resources associated with fusion research and development. Nonetheless, given the theoretical potential, research in this area continues with the hope of overcoming these obstacles.

+

Question:

+

How can we optimize the design of advanced propulsion systems using nuclear fusion for interstellar travel, considering the challenges of energy generation, mass conversion, and containment?

+

Answer:

+

Question:

+

How can we overcome the immense distances and time scales involved in interstellar travel to enable the exploration and colonization of distant star systems with advanced propulsion technologies?

+

Answer:

+

Nuclear fusion, if harnessed, can potentially provide a high thrust-to-weight ratio and specific impulse, which are necessary parameters for considering propulsion in interstellar travel.

+

There are several concepts that pair fusion energy and propulsion, most notably the concept of a fusion rocket. This device uses the reaction energy produced by fusion to heat and expel a propellant, creating thrust. The key challenge here is to produce a controlled fusion reaction that can be sustained for the duration of the mission.

+

Then, there are more futuristic concepts like the “Daedalus” or “Icarus” interstellar spacecraft design proposals, which are essentially immense, unmanned fusion-driven vessels specifically designed for interstellar travel.

+

Finally, there is the idea of a fusion ramjet, where interstellar hydrogen is used as both the fusion fuel and reaction mass, keeping the vehicle’s weight down. This again requires very advanced, yet-to-be-invented containment technologies.

+

But, all these concepts currently face significant technological hurdles and need many advancements in areas such as fusion technology, materials science, radiation shielding, fuel gathering and confinement methods, miniaturization, and more.

+

Nevertheless, the idea of using nuclear fusion for interstellar travel remains a major potential breakthrough that could revolutionize our approach to space travel and exploration. However, these are all still theoretical and research is ongoing. The distances and energy required for interstellar travel are immense, and even with optimal propulsion technologies like nuclear fusion, such missions would still likely take many decades or even centuries.

+

Question:

+

Is it possible to develop methods or technologies that can exceed the speed of light, allowing for near-instantaneous travel between star systems?

+

Answer:

+

As per our current understanding of physics and in accordance with Einstein’s theory of relativity, it is not possible to travel faster than the speed of light in a vacuum, which is approximately 186,282 miles per second (299,792 kilometers per second). This speed limit is considered fundamental to the fabric of space-time itself.

+

As objects with mass accelerate towards the speed of light, their relativistic mass increases, which requires more energy to continue to accelerate. It would require an infinite amount of energy to accelerate an object with mass to the speed of light.

+

Moreover, faster than light travel could involve causality problems, the cause and effect principle, leading to scenarios such as time paradoxes, which contradict our current understanding of physics.

+

While there are some theoretical concepts such as wormholes and Alcubierre drives that may allow for faster than light “effective” travel by warping space-time, these concepts are currently not practically achievable and remain within the realm of speculative science.

+

However, this is based on what we currently understand about the laws of physics. Future research, advancements in technology, or groundbreaking theoretical developments may reshape these understandings.

+

Question:

+

Is it possible to manipulate spacetime and create a stable wormhole for instantaneous travel across vast cosmic distances?

+

Answer:

+

According to current knowledge and understanding of physics, particularly General relativity by Albert Einstein, creating a stable wormhole for instantaneous travel across vast cosmic distances remains speculative and highly theoretical. Wormholes are theoretical passage through space-time that could create shortcuts for long journeys across the universe. However, to keep the wormhole stable, it would require the existence of a substance with negative energy, often referred to as “exotic matter”. But we do not currently have any experimental evidence to support the existence of such a substance.

+

Even if wormholes could be formed, there is the issue of stability. Current understanding suggest that any wormhole that could be formed would be extremely unstable, collapsing instantly after its formation. Some physicists proposed that “exotic matter” or energy with negative density relative to vacuum energy could theoretically be used to stabilize a wormhole, but such matter hasn’t been found yet and its existence remains hypothetical.

+

Also, forming a wormhole may involve quantum-scale effects, which are not well understood in the context of strong gravitational fields, and there may be fundamental limitations imposed by quantum mechanics.

+

Therefore, at present, wormhole formation and use for travel remain speculative and are largely the domain of very high-level theoretical physics and science fiction.

+

Question:

+

What are the potential long-term effects of exposure to ionizing radiation in space on the health and well-being of astronauts during long-duration interplanetary missions?

+

Answer:

+

Ionizing radiation in space poses a serious risk to astronauts on long-duration missions. This is due to the presence of galactic cosmic rays (GCRs) and solar particle events (SPEs), which are composed of high-energy protons and heavy ions that can pass through the walls of spacecraft and human tissue, potentially causing significant damage.

+

The potential long-term effects of exposure to this type of radiation can include:

+
    +
  1. Cancer: Ionizing radiation can damage DNA, leading to mutations that can cause various types of cancer.
  2. +
  3. Central Nervous System Effects: Studies have suggested that exposure to cosmic rays could have harmful effects on the brain, potentially impacting cognitive function, mood, and motor function.
  4. +
  5. Cardiovascular Disease: There is growing evidence that radiation exposure may increase the risk of cardiovascular disease.
  6. +
  7. Degenerative Tissue Effects: Degeneration of tissues, such as the skin, heart, and the lenses of the eyes, can be caused by radiation exposure. This could potentially lead to diseases such as cataracts, heart disease, and other age-related conditions.
  8. +
  9. Acute Radiation Syndrome (ARS): In the event of a large solar particle event (SPE), astronauts could potentially be exposed to very high doses of radiation, leading to ARS, which could cause nausea, fatigue, loss of white blood cells, and even death in very severe cases.
  10. +
+

It is important to note that much of our understanding of radiation risks comes from studies of populations on Earth exposed to radiation, and there is still much we do not understand about the health risks associated with space radiation. As a result, reducing astronaut exposure to radiation, through improved spacecraft shielding, mission planning, and potential future medical interventions, is a key area of research for long-duration interplanetary missions.

+

Follow-up Questions.

+
    +
  • What are the potential implications and challenges of utilizing advanced quantum teleportation techniques for near-instantaneous communication across astronomical distances?
  • +
  • What are the potential implications of quantum entanglement for secure and unbreakable communication channels in the context of interstellar space missions?
  • +
  • How can we harness the principles of quantum mechanics to develop quantum computing systems that can efficiently simulate and optimize complex quantum systems, such as nuclear breeder reactors, on a large scale?
  • +
  • How can we leverage the principles of quantum entanglement to develop new methods for the efficient transfer of energy in quantum systems?
  • +
  • What are the potential implications of harnessing quantum entanglement for secure quantum communication networks on a global scale?
  • +
  • What are the potential strategies and technologies that can be employed to mitigate the harmful effects of ionizing radiation on astronauts during long-duration space missions?
  • +
  • What are the potential biological and genetic adaptations that could occur in future human populations living in space colonies or on other planets, given the unique radiation environments and microgravity conditions?
  • +
  • What are the potential implications of extended space travel on the neurological and cognitive functions of astronauts, and how can we mitigate any negative effects?
  • +
  • What are the potential long-term effects of microgravity on the human immune system, and how can we develop countermeasures to maintain optimal immune function during space travel?
  • +
  • How can we optimize the design of artificial gravity systems to mitigate the negative effects of prolonged exposure to microgravity on the human body?
  • +
+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2023/10/toward-an-electronically-mediated-decentralized-society/index.html b/public/2023/10/toward-an-electronically-mediated-decentralized-society/index.html new file mode 100644 index 0000000..bc96643 --- /dev/null +++ b/public/2023/10/toward-an-electronically-mediated-decentralized-society/index.html @@ -0,0 +1,309 @@ + + + + + + + + +Toward an Electronically-Mediated Decentralized Society | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Toward an Electronically-Mediated Decentralized Society +

+
+ The Evolution of Democracy in the Digital Age +
+ + +
+
+

In the long and evolving tapestry of human civilization, each era has been defined by the tools it has harnessed and the political ideologies it has embraced. From the agrarian societies governed by monarchies to the industrial age’s democratic revolutions, the interplay between technology and governance has constantly shaped the contours of societies. Today, as we stand at the crossroads of an unprecedented digital revolution, it’s imperative to reflect on this intricate relationship once more. We find ourselves in a digital age where information flows at the speed of light, yet the foundational principles of governance in many societies remain rooted in centuries-old traditions. As trust in conventional democratic institutions wavers, and as technology offers new means of decentralisation and transparency, there emerges a potential to marry the philosophical ideals of decentralism with the determinism of electronic systems. This convergence promises a vision of a more equitable, participatory, and transparent society. Yet, to chart this course, one must delve deep into the historical contexts, understand the digital backdrop, examine the shifting sands of trust in governance, and ultimately, explore the potential of an decentralistic deterministic society. As we embark on this exploration, this introductory essay aims to lay the groundwork for the forthcoming detailed analysis, offering insights into how we might reimagine society in the digital age.

+

Historical Context: The Evolution of Trust in Governance

+

The annals of human history are littered with tales of governance—stories of leaders, of revolutions, of grand visions, and of the ordinary citizen. At the heart of these tales lies a singular, unifying thread: trust. This trust has been the cornerstone upon which edifices of governance, from monarchies to democracies, have been erected. In the ancient city-states of Greece, where democracy found its earliest expression, trust was an unwritten social contract. Citizens trusted one another’s judgment in the agora, just as they trusted their representatives in the proto-democratic institutions. As empires expanded and nation-states emerged, so did the complexities of governance. The Renaissance era, with its emphasis on individual freedoms and rights, led to new social contracts where the monarch’s divine right to rule was increasingly questioned, and in its place, the concept of a government ‘by the people, for the people’ began to take root.

+

But trust in governance has never been static. The Enlightenment period brought forth a wave of revolutions—American, French, and beyond—each fueled by the discontent of the masses who felt betrayed by the promises of their rulers. These upheavals were manifestations of broken trust, yet they also sowed the seeds for modern democracies, with checks and balances crafted meticulously to prevent such breaches. As industrialization swept across continents, democratic institutions adapted, introducing representative systems to manage the sheer scale of populations and their diverse needs. These systems, while imperfect, were anchored in trust. People trusted the process, the institution, and most importantly, the ethos of democracy.

+

Fast forward to the 20th century, with its world wars, cold wars, and rapid decolonization. Trust was tested at every juncture. International institutions like the United Nations were born out of a dire need to rebuild trust among nations. Similarly, post-colonial nations embarked on journeys to establish democratic roots, seeking to build trust within diverse and often divided populations. Yet, as the century waned, so did the unequivocal trust in democratic institutions. Scandals, political polarizations, economic disparities, and the emerging influence of media began chipping away at the once solid bedrock of trust. As we transitioned into the 21st century, the pace of change has been breathtaking. Globalization, technological advancements, and now the digital revolution have added layers of complexity to the already intricate tapestry of governance. With information at one’s fingertips and global events unfolding in real-time, the earlier vertical flow of knowledge from governments to citizens has been democratized, leading to a more informed but also more skeptical populace. In this age, trust in traditional structures appears fragile, often wavering under the weight of misinformation, populist rhetoric, and a sense of disenchantment. This evolving historical context underscores the urgency to reevaluate our existing systems and ponder what comes next in the ongoing saga of governance and trust.

+

Digital Background: The Proliferation of Technology and its Impact on Governance

+

The digital age, often characterized as the Fourth Industrial Revolution, has ushered in transformative shifts across all sectors of society, with governance being no exception. As we examine this metamorphosis, it becomes evident that the intersection of technology and governance is not just a recent phenomenon but an evolutionary process that has been unfolding over decades.

+

The 20th century saw the advent of computerization, which started as a ripple with room-sized machines crunching numbers, and gradually evolved into a tidal wave as personal computers found their way into homes by the 1980s. Governments worldwide recognized the potential of these technologies, leading to the digitalization of records, automation of bureaucratic processes, and the establishment of e-governance platforms. While these initial steps were transformative, they were just the tip of the iceberg.

+

The dawn of the internet in the late 20th century brought about the most significant paradigm shift. Suddenly, information wasn’t just a commodity; it was the lifeblood of a rapidly globalizing world. Governments began to grapple with the double-edged sword that the internet represented. On one side, it promised unparalleled transparency, efficiency, and citizen engagement. On the other, it posed challenges related to cybersecurity, privacy, and the potential spread of misinformation.

+

The rise of social media platforms in the 2000s intensified these dynamics. Political campaigns, policy discussions, and public debates shifted from town halls and newspapers to Twitter feeds and Facebook timelines. The Arab Spring of 2011, which saw governments toppled through grassroots movements coordinated on social media, was a testament to the profound power of digital platforms in shaping political destinies.

+

But beyond the evident macro shifts, the digital age has also redefined the minutiae of governance. Blockchain technology, for instance, offers transparent and tamper-proof record-keeping, reshaping everything from voting systems to land registries. Artificial intelligence and big data analytics allow governments to make more informed decisions by analyzing vast amounts of data, leading to insights previously unimaginable. However, these technologies also carry ethical dilemmas, especially around surveillance, data privacy, and algorithmic biases.

+

Furthermore, the rapid rise of the Internet of Things (IoT) means that cities and their infrastructures are becoming smarter, heralding the era of smart governance where urban planning, public transport, and even waste management are driven by real-time data and automation.

+

Yet, as we stand amidst this digital revolution, it’s imperative to recognize the challenges. The digital divide, which denotes the gap between those with and without access to digital technologies, is a growing concern. In many parts of the world, access to the internet remains a privilege, not a right. Ensuring that the benefits of digital governance are equitable and do not exacerbate existing inequalities is crucial.

+

Moreover, as cyber threats become more sophisticated, governments find themselves in a perpetual race to bolster cybersecurity defenses. In a world where cyber warfare can have as dire consequences as traditional warfare, establishing international norms and protocols becomes paramount.

+

In conclusion, the digital background of our era offers both immense possibilities and challenges for governance. Harnessing technology for transparent, efficient, and inclusive governance requires a delicate balance, taking into account both the potentials of these tools and the ethical and practical concerns they introduce.

+

The Erosion of Trust and the Reimagining of Democracy in Modern Times

+

Trust, a seemingly intangible concept, has been the linchpin of societies throughout history. As elucidated in our exploration of the historical context, trust has been the backbone of governance structures, from ancient city-states to modern democracies. However, as the digital age envelopes society, the traditional pillars of trust appear increasingly shaky, necessitating a critical examination of the dynamics at play and the possible pathways forward.

+

In an era of information superabundance, the gatekeepers of yesteryears—traditional media outlets, academic institutions, and governmental bodies—no longer hold a monopoly over the narrative. Today, a tweet, a blog post, or a viral video can sway public opinion with unparalleled potency. While this democratization of information carries the potential to amplify marginalized voices, it also provides a fertile ground for misinformation, deep fakes, and echo chambers. As falsehoods intermingle seamlessly with facts, discerning the truth becomes a Herculean task, eroding public trust in institutions and narratives.

+

This erosion is further exacerbated by the contemporary political climate. Populist movements worldwide, often rooted in nationalist or protectionist ideologies, have capitalised on this trust deficit. Their rhetoric often paints institutions, be they governmental, academic, or media, as ’elites’ detached from the realities of the common citizen. Such narratives, whether wholly accurate or not, further widen the chasm of distrust, rendering constructive dialogues and collaborative solutions more elusive.

+

However, the digital age doesn’t merely present challenges to trust; it also offers tools to rebuild it. Take, for instance, the concept of digital transparency. Governments and organizations can leverage technology to provide real-time insights into their operations, decision-making processes, and financial transactions. Estonia’s e-governance model stands as a testament to this, where citizens can track their data’s journey across governmental systems, fostering transparency and accountability.

+

Yet, transparency alone might not suffice. As the dynamics of trust shift, so should the structures of governance. The concept of ‘direct democracy’ gains renewed relevance in this context. If the traditional representative model of democracy, with its layers of bureaucracy and intermediation, appears out of sync with the zeitgeist, then perhaps it’s time to explore more direct, participatory models. Digital platforms can facilitate real-time referendums, policy discussions, and even decentralized decision-making. The Swiss model of direct democracy, where citizens regularly vote on a plethora of issues, offers a glimpse into such possibilities, albeit in a non-digital context.

+

However, as with any paradigm shift, this reimagining carries inherent risks. Direct democracy, in the absence of checks and balances, can morph into mob rule, swayed by transient emotions rather than reasoned debate. The challenge lies in crafting a model that marries the ethos of direct participation with mechanisms that ensure informed, balanced decision-making.

+

In essence, the digital era has ushered in a period of introspection and potential transformation for democratic governance. While trust in traditional structures wanes, the tools to sculpt a more participatory, transparent, and accountable system lie within our grasp. The onus is on societies worldwide to tread this path judiciously, balancing the promises of the digital age with its perils.

+

Decentralism, Deterministic Democracy, and the Path to an Equitable Future

+

In the search for a more equitable and truly democratic society, the tenets of decentralism emerge as both a historical touchpoint and a potentially revitalized philosophy in the context of our digital era. Traditionally, decentralism advocates for the abolition of centralized authority and coercive hierarchies, envisioning a society where individuals freely cooperate based on mutual aid and shared values. The goal is not chaos, as common misconceptions might suggest, but rather a society built on organic relationships and self-governance.

+

This brings us to an intriguing juxtaposition: Can the principles of decentralism coalesce with the promise of modern digital tools to form a new, more equitable system of governance? And can this union address the challenges of trust and representation that plague our contemporary democracies?

+

Consider the very nature of the digital realm. Open-source software, decentralized platforms, and blockchain technologies are inherently decentralistic in their design. They defy central control, emphasize transparency, and promote collaboration. Applied to governance, these technologies could pave the way for a deterministic form of democracy, where systems function predictably based on transparent algorithms, and citizens can directly influence or even craft these algorithms to ensure fairness and representation.

+

In this envisioned future, voting systems could be open-source, allowing for collective oversight and reducing the potential for manipulation. Decision-making processes could be decentralized, enabling direct participation and reducing the layers of bureaucracy that often dilute the citizen’s voice. The deterministic nature of digital systems could provide a framework wherein societal functions operate transparently, predictably, and in the best interests of all.

+

Yet, as with any transformative idea, challenges abound. How do we ensure that these deterministic systems, while predictable, do not become rigid and unresponsive to evolving societal needs? How do we ensure digital inclusivity, giving a voice to those who might be marginalized in a tech-driven governance model? And most importantly, how do we strike a balance between the principles of decentralism and the practicalities of managing large, diverse populations?

+

The journey from the trust-laden democracies of old to the current state of skepticism, and the potential leap towards a deterministic, decentralistic future, is rife with both promise and peril. The digital tools at our disposal offer a tantalizing glimpse of a world where power is decentralized, systems are transparent, and the individual’s agency is paramount.

+

However, the path to this future is not linear. It requires careful navigation, an understanding of historical contexts, a grasp of digital potentials, and a profound respect for the human elements of trust, collaboration, and mutual respect. As societies globally grapple with the challenges of the present, it becomes imperative to draw from the past, leverage the tools of the present, and craft a vision for the future that truly embodies the ideals of equity, representation, and shared prosperity.

+

In this grand tapestry of governance and societal evolution, every individual has a role to play. By fostering dialogues, challenging the status quo, and remaining open to transformative ideas, we can collectively inch closer to a world that, while perhaps not perfect, is fairer, more democratic, and truly reflective of the collective will.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2023/11/kernel-bootloader/index.html b/public/2023/11/kernel-bootloader/index.html new file mode 100644 index 0000000..b539833 --- /dev/null +++ b/public/2023/11/kernel-bootloader/index.html @@ -0,0 +1,290 @@ + + + + + + + + +Kernel, Bootloader | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Kernel, Bootloader +

+
+ Linux Kernel #2 +
+ + +
+
+

부트로더가 하는 일은

+
    +
  1. CPU 초기화
  2. +
  3. IVT 초기화
  4. +
  5. 하드웨어 초기화 및 커널 찾기 (외부 메모리 인터페이스 초기화 및 파일시스템 인식 과정)
  6. +
  7. 커널을 메모리에 올리고 커널 Entry로 점프
  8. +
+

인데, 여기서 부트로더가 커널을 메모리에 올릴때 어디에 어떻게 올리냐가 헷갈렸다.

+

컴파일 된 커널을 보면 relative 주소로 되어 있는데, 부트로더가 커널의 .data랑 .bss를 다른 프로세스처럼 적절한 곳에 따로 두는 걸로 착각했다. 당연히 부트로더 단계에서는 메모리 매핑이나 페이징이 아직 없고, 커널은 메모리에 매핑이 된게 아니라 고정된 주소에 있어야 한다.

+

커널은 PIC(Position Independant Code)인데, `.text`, `.data`, `.bss`가 정해진 offset 차이로 고정되어 메모리에 올라가기 때문에 동적 주소 매핑 없이 base address에 relative 하게 모든 section의 위치를 알 수 있다.

+

생각해보면 간단하고 당연한 거였다.

+

그리고 외부적 인터럽트나 시스템 콜 없이 프로세스가 context를 계속 잡고 있으면 다시 커널로 돌아올 방법이 없다. timed inturrupt나 watchdog이 필요하다.

+

* 부트로더 단계에서 MMU 초기화 하고 페이징 하는 복잡한 시스템이 아니라 임베디드 ARM 환경에서의 이야기다. UEFI나 모던 시스템에서는 다를거다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2023/11/kernel-process-creation/index.html b/public/2023/11/kernel-process-creation/index.html new file mode 100644 index 0000000..0a3c628 --- /dev/null +++ b/public/2023/11/kernel-process-creation/index.html @@ -0,0 +1,314 @@ + + + + + + + + +Kernel, Process creation | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Kernel, Process creation +

+
+ Linux Kernel #3 +
+ + +
+
+
static int init(void * unused)
+{
+	lock_kernel();
+	do_basic_setup();
+
+	/*
+	 * Ok, we have completed the initial bootup, and
+	 * we're essentially up and running. Get rid of the
+	 * initmem segments and start the user-mode stuff..
+	 */
+	free_initmem();
+	unlock_kernel();
+
+	if (open("/dev/console", O_RDWR, 0) < 0)
+		printk("Warning: unable to open an initial console.\n");
+
+	(void) dup(0);
+	(void) dup(0);
+	
+	/*
+	 * We try each of these until one succeeds.
+	 *
+	 * The Bourne shell can be used instead of init if we are 
+	 * trying to recover a really broken machine.
+	 */
+
+	if (execute_command)
+		execve(execute_command,argv_init,envp_init);
+	execve("/sbin/init",argv_init,envp_init);
+	execve("/etc/init",argv_init,envp_init);
+	execve("/bin/init",argv_init,envp_init);
+	execve("/bin/sh",argv_init,envp_init);
+	panic("No init found.  Try passing init= option to kernel.");
+}
+

In this init/main.c, after basic kernel initialization things, open("/dev/console") and two dup(0) opens three file descriptor 0, 1, 2 as stdin, stdout, stderr. Later when execve() or fork() happens, it simply copies calling process’s task_struct as process context, so all file descriptors are also passed down as-is.

+

All processes’ file descriptor 0, 1, 2 originates to init’s file descriptor.

+

If calling process opens PTY or TTY, which is common when we opens new terminal to run a process, it is also passed down to exec/forked process.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2023/11/kernel-pty-and-tty/index.html b/public/2023/11/kernel-pty-and-tty/index.html new file mode 100644 index 0000000..20e9580 --- /dev/null +++ b/public/2023/11/kernel-pty-and-tty/index.html @@ -0,0 +1,389 @@ + + + + + + + + +Kernel, PTY and TTY | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Kernel, PTY and TTY +

+
+ Linux Kernel #4 +
+ + +
+
+

PTY (Pseudo-TTY), TTY (TeleTYpewriter).

+

TTY

+

The term TTY originates from the early days of computing when teletype machines were used as the main way for hci. As technology evolved, the physical teletype machines were replaced with virtual terminals or screens, and TTY is used as interface for text-based communication between a user and the system. TTYs can be hardware-based, like a console, or software-based, commonly known as virtual consoles or terminals (e.g., /dev/tty1, /dev/tty2, etc.).

+

PTY

+

A PTY is a Pseudo Terminal, which is a software emulation of a TTY. It allows for the creation of a terminal interface without the need for any actual terminal hardware. A PTY is typically used for providing terminal functionality to processes whose input and output are not directly connected to a physical terminal. +PTY is used when you open a terminal window in GUI or SSH. It is used for bridge for real-TTY emulation and dealing with user-facing end of TTY.

+

TTY can be thought as two parts. IO, and TTY driver inside of kernel. When process is created, it is attched to some kind of IO device like TTY device as stdout/stdin/stderr. Just like writing to files via file descriptors, outputing and inputing act of process is a wrapper for read() and write() to “0, 1, 2” file descriptors. What printf actually does is fprintf(stdout, ...), in libc.

+

Just like in TTY, PTY acts simmilarly, just that it doesnt have actual “hardware” and matching driver, it just differently handles it.

+

PTY also has two ends: the master end and the slave end. The master end is used by a terminal emulator, like xterm or GNOME Terminal, to control the terminal session. The slave end provides the interface that emulates the physical terminal, where programs like shells (bash, zsh, …) read input from and write output to, as if they were interacting with a real TTY.

+

PTY and TTY

+

When we open new terminal emulator with shell and check shell’s /proc/{pid}/fd/, we can see 0, 1, 2 is a symlink to some /dev/pts/{id}. If we put data (char data) to /dev/tty0 as write(), in kernel (because write is also syscall), data is forwarded to driver code, and then driver transforms and sends char data to TTY as some kind of electronic signal. In case of PTY, it is just same but now instead of driver, kernel just forwards data to other end, /dev/pty#, and master process (like terminal emulator) handles that data just like kernel driver, but now it just makes display image out of it (GUI), or sends it to web socket (SSH).

+
static int pty_write(struct tty_struct * tty, int from_user,
+		       const unsigned char *buf, int count)
+{
+	struct tty_struct *to = tty->link;
+	int	c=0, n;
+	char	*temp_buffer;
+
+	if (!to || tty->stopped)
+		return 0;
+
+	if (from_user) {
+		down(&tty->flip.pty_sem);
+		temp_buffer = &tty->flip.char_buf[0];
+		while (count > 0) {
+			/* check space so we don't copy needlessly */ 
+			n = MIN(count, to->ldisc.receive_room(to));
+			if (!n) break;
+
+			n  = MIN(n, PTY_BUF_SIZE);
+			n -= copy_from_user(temp_buffer, buf, n);
+			if (!n) {
+				if (!c)
+					c = -EFAULT;
+				break;
+			}
+
+			/* check again in case the buffer filled up */
+			n = MIN(n, to->ldisc.receive_room(to));
+			if (!n) break;
+			buf   += n; 
+			c     += n;
+			count -= n;
+			to->ldisc.receive_buf(to, temp_buffer, 0, n);
+		}
+		up(&tty->flip.pty_sem);
+	} else {
+		c = MIN(count, to->ldisc.receive_room(to));
+		to->ldisc.receive_buf(to, buf, 0, c);
+	}
+	
+	return c;
+}
+
static int pty_open(struct tty_struct *tty, struct file * filp)
+{
+	int	retval;
+	int	line;
+	struct	pty_struct *pty;
+
+	retval = -ENODEV;
+	if (!tty || !tty->link)
+		goto out;
+	line = MINOR(tty->device) - tty->driver.minor_start;
+	if ((line < 0) || (line >= NR_PTYS))
+		goto out;
+	pty = (struct pty_struct *)(tty->driver.driver_state) + line;
+	tty->driver_data = pty;
+
+	retval = -EIO;
+	if (test_bit(TTY_OTHER_CLOSED, &tty->flags))
+		goto out;
+	if (test_bit(TTY_PTY_LOCK, &tty->link->flags))
+		goto out;
+	if (tty->link->count != 1)
+		goto out;
+
+	clear_bit(TTY_OTHER_CLOSED, &tty->link->flags);
+	wake_up_interruptible(&pty->open_wait);
+	set_bit(TTY_THROTTLED, &tty->flags);
+	retval = 0;
+out:
+	return retval;
+}
+
int __init pty_init(void)
+{
+	int i;
+    memset(&dev_tty_driver, 0, sizeof(struct tty_driver));
+	dev_tty_driver.magic = TTY_DRIVER_MAGIC;
+	dev_tty_driver.driver_name = "/dev/tty";
+	dev_tty_driver.name = dev_tty_driver.driver_name + 5;
+	dev_tty_driver.name_base = 0;
+	dev_tty_driver.major = TTYAUX_MAJOR;
+	dev_tty_driver.minor_start = 0;
+	dev_tty_driver.num = 1;
+	dev_tty_driver.type = TTY_DRIVER_TYPE_SYSTEM;
+	dev_tty_driver.subtype = SYSTEM_TYPE_TTY;
+	
+	if (tty_register_driver(&dev_tty_driver))
+		panic("Couldn't register /dev/tty driver\n");
+
+	dev_syscons_driver = dev_tty_driver;
+	dev_syscons_driver.driver_name = "/dev/console";
+	dev_syscons_driver.name = dev_syscons_driver.driver_name + 5;
+	dev_syscons_driver.major = TTYAUX_MAJOR;
+	dev_syscons_driver.minor_start = 1;
+	dev_syscons_driver.type = TTY_DRIVER_TYPE_SYSTEM;
+	dev_syscons_driver.subtype = SYSTEM_TYPE_SYSCONS;
+
+	if (tty_register_driver(&dev_syscons_driver))
+		panic("Couldn't register /dev/console driver\n");
+    ...
+}
+
+ +
+ + +
+
+ + + + + + + + + + + diff --git a/public/2023/11/kernel-syscalls/index.html b/public/2023/11/kernel-syscalls/index.html new file mode 100644 index 0000000..bbc4352 --- /dev/null +++ b/public/2023/11/kernel-syscalls/index.html @@ -0,0 +1,387 @@ + + + + + + + + +Kernel, syscalls | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Kernel, syscalls +

+
+ Deep dive Linux Kernel #1 +
+ + +
+
+

sys_fork()

+
.align 2
+_sys_fork:
+  call _find_empty_process
+  testl %eax,%eax
+  js 1f
+  push %gs
+  pushl %esi
+  pushl %edi
+  pushl %ebp
+  pushl %eax
+  call _copy_process
+  addl $20,%esp
+1:  ret
+

FUNCTION find_empty_process()

+
A:
+  IF ++last_pid < 0
+    last_pid = 1
+  FOR i : 0 -> NR_TASKS
+    IF task[i] && task[i].pid == last_pid
+      GOTO A
+  FOR i : 1 -> NR_TASKS
+    IF NOT task[i]
+      RETURN i
+  RETURN -1
+
    +
  1. +

    Set last_pid to 1 or more.

    +
  2. +
  3. +

    From taskid from 0 to max_tasks, if task exists and pid is last_pid then increases pid and again.

    +
  4. +
  5. +

    From taskid from 1 to max_tasks, if tasks not exists, return.

    +
  6. +
+

-> It just iterates through tasks and find last taskid linearly.

+

FUNCTION copy_process

+
<- nr, EBP, EDI, ESI, GS, EBX~EDX, CS~FS, EIP, EFLAGS, ESP, SS
+-> INT
+
TASK_STRUCT P
+INT I
+FILE F
+
+P = (TASK_STRUCT)(GET_FREE_PAGE())
+
+IF NOT P
+  RET ERR
+
+SET P 
+  START_TIME  = RUNNING
+  PID         = LAST_PID
+  FATHER      = CURRENT_PID
+  COUNTER     = PRIORITY
+  START_TIME  = jiffies
+  SIGNAL, ALARM, LEADER, UTIME, STIME, CUTIME, CSDTIME, BACK_LINK = 0
+
+  SET TSS
+    BACK_LINK = 0
+    ESP0      = PAGE_SIZE + ADDR(P)
+    SS0       = 0x10
+    EAX       = 0
+    ES ~ GS   = 0xFFFF
+    LDT       = _LDT(nr)
+
+    EIP, EFLAGS   = ARGUMENT 
+    ECX ~ EDI     = ARGUMENT
+
+    TRACR_BITMAP  = 0x80000000
+  
+COPY_MEM (nr, p)
+IF <-
+  FREE_PAGE ADDR(P)
+  RET ERR
+
+FOR i : 0 ~ NR_OPEN
+  IF 
+    f = P.filp[i]
+  THEN
+    INCR f.f_count 1
+
+IF 
+  CURRENT.PWD
+THEN 
+  INCR CURRENT.PWD.i_count 1
+
+IF 
+  CURRENT.ROOT
+THEN
+  INCR CURRENT.ROOT.i_count 1
+
+SET_TSS_DESC <- (GDT + nr/2 + FIRST_TSS_ENTRY) , P.TSS
+SET_LDT_DESC <- (GDT + nr/2 + FIRST_LDT_ENTRY) , P.LDT
+
+task(nr) <- p
+
+RET last_pid
+
    +
  • “nr” passed is the index of the new task in the task array, where each element corresponds to a process slot.
  • +
  • fork() copies the parent’s kernel context, as well as general registers and segment selectors required for a new process to run in user space.
  • +
  • It creates a new task structure from a new free page and sets up default values and certain parameters inherited from the parent, such as process ID, priority, and execution times.
  • +
  • Then it copies memory regions from the parent to the new process, referred to by “nr,” which is the index of the new process in the task array.
  • +
  • Changes the parent process’s working directory (PWD) and root directory reference counters, incrementing them by 1 to reflect the new child process now also using these resources.
  • +
  • Sets the Task State Segment (TSS) and Local Descriptor Table (LDT) entries, which are x86-specific structures used for task switching and memory segmentation, respectively.
  • +
  • TSS holds information about the task’s stack for privilege level changes and also the hardware context when a task switch occurs.
  • +
  • LDT is a segment descriptor table that stores descriptors for local segments, giving a task its own set of segment registers.
  • +
  • Finally, it assigns the newly created task structure, p, to the task array at index “nr.” This effectively makes the new task available for scheduling.
  • +
+

_sys_fork()

+

“sys_fork” finds an empty process ID using the search loop in _find_empty_process, then it invokes _copy_process to clone the parent’s kernel context to the new process. This sets up a complete environment for the new process to run independently from the parent, but initially as a nearly identical copy.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/JetBrainsMono-Bold.woff2 b/public/JetBrainsMono-Bold.woff2 new file mode 100644 index 0000000..4917f43 Binary files /dev/null and b/public/JetBrainsMono-Bold.woff2 differ diff --git a/public/JetBrainsMono-BoldItalic.woff2 b/public/JetBrainsMono-BoldItalic.woff2 new file mode 100644 index 0000000..536d3f7 Binary files /dev/null and b/public/JetBrainsMono-BoldItalic.woff2 differ diff --git a/public/JetBrainsMono-ExtraBold.woff2 b/public/JetBrainsMono-ExtraBold.woff2 new file mode 100644 index 0000000..8f88c54 Binary files /dev/null and b/public/JetBrainsMono-ExtraBold.woff2 differ diff --git a/public/JetBrainsMono-ExtraBoldItalic.woff2 b/public/JetBrainsMono-ExtraBoldItalic.woff2 new file mode 100644 index 0000000..d1478ba Binary files /dev/null and b/public/JetBrainsMono-ExtraBoldItalic.woff2 differ diff --git a/public/JetBrainsMono-ExtraLight.woff2 b/public/JetBrainsMono-ExtraLight.woff2 new file mode 100644 index 0000000..b97239f Binary files /dev/null and b/public/JetBrainsMono-ExtraLight.woff2 differ diff --git a/public/JetBrainsMono-ExtraLightItalic.woff2 b/public/JetBrainsMono-ExtraLightItalic.woff2 new file mode 100644 index 0000000..be01aac Binary files /dev/null and b/public/JetBrainsMono-ExtraLightItalic.woff2 differ diff --git a/public/JetBrainsMono-Italic.woff2 b/public/JetBrainsMono-Italic.woff2 new file mode 100644 index 0000000..d60c270 Binary files /dev/null and b/public/JetBrainsMono-Italic.woff2 differ diff --git a/public/JetBrainsMono-Light.woff2 b/public/JetBrainsMono-Light.woff2 new file mode 100644 index 0000000..6538498 Binary files /dev/null and b/public/JetBrainsMono-Light.woff2 differ diff --git a/public/JetBrainsMono-LightItalic.woff2 b/public/JetBrainsMono-LightItalic.woff2 new file mode 100644 index 0000000..66ca3d2 Binary files /dev/null and b/public/JetBrainsMono-LightItalic.woff2 differ diff --git a/public/JetBrainsMono-Medium.woff2 b/public/JetBrainsMono-Medium.woff2 new file mode 100644 index 0000000..669d04c Binary files /dev/null and b/public/JetBrainsMono-Medium.woff2 differ diff --git a/public/JetBrainsMono-MediumItalic.woff2 b/public/JetBrainsMono-MediumItalic.woff2 new file mode 100644 index 0000000..80cfd15 Binary files /dev/null and b/public/JetBrainsMono-MediumItalic.woff2 differ diff --git a/public/JetBrainsMono-Regular.woff2 b/public/JetBrainsMono-Regular.woff2 new file mode 100644 index 0000000..40da427 Binary files /dev/null and b/public/JetBrainsMono-Regular.woff2 differ diff --git a/public/JetBrainsMono-SemiBold.woff2 b/public/JetBrainsMono-SemiBold.woff2 new file mode 100644 index 0000000..5ead7b0 Binary files /dev/null and b/public/JetBrainsMono-SemiBold.woff2 differ diff --git a/public/JetBrainsMono-SemiBoldItalic.woff2 b/public/JetBrainsMono-SemiBoldItalic.woff2 new file mode 100644 index 0000000..c5dd294 Binary files /dev/null and b/public/JetBrainsMono-SemiBoldItalic.woff2 differ diff --git a/public/JetBrainsMono-Thin.woff2 b/public/JetBrainsMono-Thin.woff2 new file mode 100644 index 0000000..17270e4 Binary files /dev/null and b/public/JetBrainsMono-Thin.woff2 differ diff --git a/public/JetBrainsMono-ThinItalic.woff2 b/public/JetBrainsMono-ThinItalic.woff2 new file mode 100644 index 0000000..a643215 Binary files /dev/null and b/public/JetBrainsMono-ThinItalic.woff2 differ diff --git a/public/LINESeedKR-Bd.woff2 b/public/LINESeedKR-Bd.woff2 new file mode 100644 index 0000000..ad1bc34 Binary files /dev/null and b/public/LINESeedKR-Bd.woff2 differ diff --git a/public/LINESeedKR-Rg.woff2 b/public/LINESeedKR-Rg.woff2 new file mode 100644 index 0000000..15aaa0f Binary files /dev/null and b/public/LINESeedKR-Rg.woff2 differ diff --git a/public/LINESeedKR-Th.woff2 b/public/LINESeedKR-Th.woff2 new file mode 100644 index 0000000..158ec01 Binary files /dev/null and b/public/LINESeedKR-Th.woff2 differ diff --git a/public/Monaspace-Argon.woff2 b/public/Monaspace-Argon.woff2 new file mode 100644 index 0000000..6ec49f0 Binary files /dev/null and b/public/Monaspace-Argon.woff2 differ diff --git a/public/Monaspace-Neon.woff2 b/public/Monaspace-Neon.woff2 new file mode 100644 index 0000000..74117fc Binary files /dev/null and b/public/Monaspace-Neon.woff2 differ diff --git a/public/Monaspace-Xenon.woff2 b/public/Monaspace-Xenon.woff2 new file mode 100644 index 0000000..a9f8115 Binary files /dev/null and b/public/Monaspace-Xenon.woff2 differ diff --git a/public/SourceSans3-Black.woff2 b/public/SourceSans3-Black.woff2 new file mode 100644 index 0000000..bda7d7d Binary files /dev/null and b/public/SourceSans3-Black.woff2 differ diff --git a/public/SourceSans3-BlackIt.woff2 b/public/SourceSans3-BlackIt.woff2 new file mode 100644 index 0000000..89be601 Binary files /dev/null and b/public/SourceSans3-BlackIt.woff2 differ diff --git a/public/SourceSans3-Bold.woff2 b/public/SourceSans3-Bold.woff2 new file mode 100644 index 0000000..24e9972 Binary files /dev/null and b/public/SourceSans3-Bold.woff2 differ diff --git a/public/SourceSans3-BoldIt.woff2 b/public/SourceSans3-BoldIt.woff2 new file mode 100644 index 0000000..50599a2 Binary files /dev/null and b/public/SourceSans3-BoldIt.woff2 differ diff --git a/public/SourceSans3-ExtraLight.woff2 b/public/SourceSans3-ExtraLight.woff2 new file mode 100644 index 0000000..e7c66f4 Binary files /dev/null and b/public/SourceSans3-ExtraLight.woff2 differ diff --git a/public/SourceSans3-ExtraLightIt.woff2 b/public/SourceSans3-ExtraLightIt.woff2 new file mode 100644 index 0000000..37b39dd Binary files /dev/null and b/public/SourceSans3-ExtraLightIt.woff2 differ diff --git a/public/SourceSans3-It.woff2 b/public/SourceSans3-It.woff2 new file mode 100644 index 0000000..39a71c1 Binary files /dev/null and b/public/SourceSans3-It.woff2 differ diff --git a/public/SourceSans3-Light.woff2 b/public/SourceSans3-Light.woff2 new file mode 100644 index 0000000..54022e5 Binary files /dev/null and b/public/SourceSans3-Light.woff2 differ diff --git a/public/SourceSans3-LightIt.woff2 b/public/SourceSans3-LightIt.woff2 new file mode 100644 index 0000000..d414940 Binary files /dev/null and b/public/SourceSans3-LightIt.woff2 differ diff --git a/public/SourceSans3-Medium.woff2 b/public/SourceSans3-Medium.woff2 new file mode 100644 index 0000000..276a29c Binary files /dev/null and b/public/SourceSans3-Medium.woff2 differ diff --git a/public/SourceSans3-MediumIt.woff2 b/public/SourceSans3-MediumIt.woff2 new file mode 100644 index 0000000..f9e6830 Binary files /dev/null and b/public/SourceSans3-MediumIt.woff2 differ diff --git a/public/SourceSans3-Regular.woff2 b/public/SourceSans3-Regular.woff2 new file mode 100644 index 0000000..47c936f Binary files /dev/null and b/public/SourceSans3-Regular.woff2 differ diff --git a/public/SourceSans3-Semibold.woff2 b/public/SourceSans3-Semibold.woff2 new file mode 100644 index 0000000..f39c23c Binary files /dev/null and b/public/SourceSans3-Semibold.woff2 differ diff --git a/public/SourceSans3-SemiboldIt.woff2 b/public/SourceSans3-SemiboldIt.woff2 new file mode 100644 index 0000000..9895b3a Binary files /dev/null and b/public/SourceSans3-SemiboldIt.woff2 differ diff --git a/public/admin/config.yml b/public/admin/config.yml new file mode 100644 index 0000000..b07b0c4 --- /dev/null +++ b/public/admin/config.yml @@ -0,0 +1,55 @@ +backend: + name: gitea + repo: morgan/blog + app_id: 64d5b875-e747-4176-b545-ce7a3b0c7f16 + api_root: https://git.morgan.kr/api/v1 + base_url: https://git.morgan.kr + branch: main + +media_folder: static/img +public_folder: /img + +collections: + - name: 'post' + label: 'Post' + folder: 'content/posts' + create: true + publish_mode: editorial_workflow + slug: '{{year}}-{{month}}-{{day}}-{{slug}}' + editor: + preview: false + fields: + - { label: 'Title', name: 'title', widget: 'string' } + - { label: 'Publish Date', name: 'date', widget: 'datetime' } + - { label: 'Slug', name: 'slug', widget: 'string' } + - { label: 'Description', name: 'description', widget: 'string', required: false } + - { label: 'Body', name: 'body', widget: 'markdown' } + + - name: 'daily' + label: 'Daily' + folder: 'content/daily' + create: true + publish_mode: editorial_workflow + slug: '{{year}}-{{month}}-{{day}}' + editor: + preview: false + fields: + - { label: 'Title', name: 'title', widget: 'string' } + - { label: 'Publish Date', name: 'date', widget: 'datetime' } + - { label: 'Slug', name: 'slug', widget: 'string' } + - { label: 'Body', name: 'body', widget: 'markdown' } + + - name: 'diary' + label: 'Diary' + folder: 'content/diary' + create: true + publish_mode: editorial_workflow + slug: '{{year}}-{{month}}-{{day}}-{{slug}}' + editor: + preview: false + fields: + - { label: 'Title', name: 'title', widget: 'string' } + - { label: 'Publish Date', name: 'date', widget: 'datetime' } + - { label: 'Slug', name: 'slug', widget: 'string' } + - { label: 'Description', name: 'description', widget: 'string', required: false } + - { label: 'Body', name: 'body', widget: 'markdown' } diff --git a/public/admin/index.html b/public/admin/index.html new file mode 100644 index 0000000..a03e001 --- /dev/null +++ b/public/admin/index.html @@ -0,0 +1,20 @@ + + + + + + + Content Manager + + + + + + + \ No newline at end of file diff --git a/public/assets/css/stylesheet.dde9171333af37b8e856933e0deb815c09f761bbd3ee0e6826d3a1309b808533.css b/public/assets/css/stylesheet.dde9171333af37b8e856933e0deb815c09f761bbd3ee0e6826d3a1309b808533.css new file mode 100644 index 0000000..af5c500 --- /dev/null +++ b/public/assets/css/stylesheet.dde9171333af37b8e856933e0deb815c09f761bbd3ee0e6826d3a1309b808533.css @@ -0,0 +1,7 @@ +/* + PaperMod v6 + License: MIT https://github.com/adityatelange/hugo-PaperMod/blob/master/LICENSE + Copyright (c) 2020 nanxiaobei and adityatelange + Copyright (c) 2021-2022 adityatelange +*/ +:root{--gap:20px;--content-gap:20px;--nav-width:800px;--main-width:800px;--header-height:0px;--footer-height:60px;--radius:8px;--theme:white;--entry:#EEE;--primary:#242424;--secondary:rgb(108, 108, 108);--tertiary:rgb(214, 214, 214);--content:#181818;--hljs-bg:rgb(28, 29, 33);--code-bg:rgb(245, 245, 245);--border:rgb(238, 238, 238)}.dark{--theme:#202032;--entry:rgb(46, 46, 51);--primary:rgb(218, 218, 219);--secondary:rgb(155, 156, 157);--tertiary:rgb(65, 66, 68);--content:white;--hljs-bg:rgb(46, 46, 51);--code-bg:rgb(55, 56, 62);--border:rgb(51, 51, 51)}.list{background:var(--theme)}.dark.list{background:var(--theme)}@import "https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css";@import "https://fonts.googleapis.com/css2?family=Gowun+Batang&family=Gowun+Dodum";@font-face{font-family:line sans;src:url(/LINESeedKR-Rg.woff2)}@font-face{font-family:line sans;src:url(/LINESeedKR-Bd.woff2);font-weight:700}@font-face{font-family:line sans;src:url(/LINESeedKR-Th.woff2);font-weight:300}@font-face{font-family:"source sans 3";src:url(/SourceSans3-Regular.woff2)}@font-face{font-family:"source sans 3";src:url(/SourceSans3-It.woff2);font-style:italic}@font-face{font-family:"source sans 3";src:url(/SourceSans3-Bold.woff2);font-weight:700}@font-face{font-family:"source sans 3";src:url(/SourceSans3-Light.woff2);font-weight:300}@font-face{font-family:jetbrains mono;src:url(/JetBrainsMono-Regular.woff2)}@font-face{font-family:jetbrains mono;src:url(/JetBrainsMono-Italic.woff2);font-style:italic}@font-face{font-family:monaspace argon;src:url(/Monaspace-Argon.woff2)}@font-face{font-family:monaspace neon;src:url(/Monaspace-Neon.woff2)}@font-face{font-family:monaspace xenon;src:url(/Monaspace-Xenon.woff2)}*,::after,::before{box-sizing:border-box}html{-webkit-tap-highlight-color:transparent;overflow-y:scroll}a,button,body,h1,h2,h3,h4,h5,h6{color:var(--primary)}h1{font-size:24px}h2{font-size:18px}h3{font-size:16px}body{font-family:"source sans 3",line sans,sans-serif!important;font-size:14px;line-height:1.8;word-break:break-word;background:var(--theme)}code{font-family:jetbrains mono,monaco,cascadia code,monospace!important}article,aside,figcaption,figure,footer,header,hgroup,main,nav,section,table{display:block}h1,h2,h3,h4,h5,h6{line-height:1.2}h1,h2,h3,h4,h5,h6,p{margin-top:0;margin-bottom:0}ul{padding:0}a{text-decoration:none}body,figure,ul{margin:0}table{width:100%;border-collapse:collapse;border-spacing:0;overflow-x:auto;word-break:keep-all}button,input,textarea{padding:0;font:inherit;background:0 0;border:0}input,textarea{outline:0}button,input[type=button],input[type=submit]{cursor:pointer}input:-webkit-autofill,textarea:-webkit-autofill{box-shadow:0 0 0 50px var(--theme)inset}img{display:block;max-width:100%}.not-found{position:absolute;left:0;right:0;display:flex;align-items:center;justify-content:center;height:80%;font-size:160px;font-weight:700}.archive-posts{width:100%;font-size:16px}.archive-year{margin-top:40px}.archive-year:not(:last-of-type){border-bottom:2px solid var(--border)}.archive-month{display:flex;align-items:flex-start;padding:10px 0}.archive-month-header{margin:25px 0;width:200px}.archive-month:not(:last-of-type){border-bottom:1px solid var(--border)}.archive-entry{position:relative;padding:5px;margin:10px 0}.archive-entry-title{margin:5px 0;font-weight:400}.archive-count,.archive-meta{color:var(--secondary);font-size:14px}.footer,.top-link{font-size:10px;color:var(--secondary)}.footer{max-width:calc(var(--main-width) + var(--gap) * 2);margin:auto;padding:calc((var(--footer-height) - var(--gap))/2)var(--gap);text-align:center;line-height:18px}.footer span{margin-inline-start:1px;margin-inline-end:1px}.footer span:last-child{white-space:nowrap}.footer a{color:var(--primary)}.footer a:hover{text-decoration:underline}.top-link{visibility:hidden;position:fixed;bottom:30px;right:30px;z-index:99;width:32px;height:32px;border:none;outline:none;background-color:var(--tertiary);color:#000;cursor:pointer;padding:8px;border-radius:5px;transition:visibility .5s,opacity .8s linear}.footer a:hover,.top-link:hover{color:var(--primary)}.top-link:focus,#theme-toggle:focus{outline:0}.nav{display:flex;flex-wrap:wrap;justify-content:space-between;max-width:calc(var(--nav-width) + var(--gap) * 2);margin-inline-start:auto;margin-inline-end:auto;line-height:var(--header-height)}.nav-home{max-width:calc(var(--nav-width) - var(--gap))}.nav-nonpost{max-width:calc(var(--nav-width))}.nav-post{}.nav a{display:block}.logo,#menu{display:flex;margin:auto var(--gap)}.logo{flex-wrap:inherit}.logo a{font-size:18px;font-weight:600}.logo a img,.logo a svg{display:inline;vertical-align:middle;pointer-events:none;transform:translate(0,-10%);border-radius:6px;margin-inline-end:8px}button#theme-toggle{font-size:26px;margin:auto 4px}body.dark #moon{vertical-align:middle;display:none}body:not(.dark) #sun{display:none}#menu{list-style:none;word-break:keep-all;overflow-x:auto;white-space:nowrap}#menu li+li{margin-inline-start:var(--gap)}#menu a{font-size:16px}#menu .active{font-weight:500;border-bottom:2px solid}.lang-switch li,.lang-switch ul,.logo-switches{display:inline-flex;margin:auto 4px}.lang-switch{display:flex;flex-wrap:inherit}.lang-switch a{margin:auto 3px;font-size:16px;font-weight:500}.logo-switches{flex-wrap:inherit}.main{position:relative;min-height:calc(100vh - var(--header-height) - var(--footer-height));max-width:calc(var(--main-width) + var(--gap) * 2);margin:auto;padding:var(--gap)}.page-header h1{font-size:32px}.post-title-header{margin:48px auto var(--content-gap)12px;margin-left:var(--gap)}.pagination{display:flex}.pagination a{color:var(--theme);font-size:13px;line-height:36px;background:var(--primary);border-radius:calc(36px/2);padding:0 16px}.pagination .next{margin-inline-start:auto}.social-icons{padding:12px 0}.social-icons a:not(:last-of-type){margin-inline-end:12px}.social-icons a svg{height:26px;width:26px}code{direction:ltr}div.highlight,pre{position:relative}.copy-code{display:none;position:absolute;top:4px;right:4px;color:rgba(255,255,255,.8);background:rgba(78,78,78,.8);border-radius:var(--radius);padding:0 5px;font-size:14px;user-select:none}div.highlight:hover .copy-code,pre:hover .copy-code{display:block}.simpletitle{padding:var(--gap);font-size:24px;margin:32px 4px;text-align:center}.first-entry{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:320px;height:calc(100vh - var(--header-height) * 2 - var(--gap) * 1);margin:0 0 calc(var(--header-height) + var(--gap) * 2);border-bottom:solid 2px var(--entry)}.first-entry{height:calc(var(--vh,1vh) * 100 - var(--header-height) * 2 - var(--gap) * 1)}.first-entry .entry-header{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3}.first-entry .entry-header h1{font-size:32px;line-height:1.3}.first-entry .entry-content{margin:24px 0;font-size:16px;-webkit-line-clamp:3}.first-entry .entry-footer{position:absolute;width:80%;padding:4px 0;margin:0 auto;display:flex;justify-content:center;bottom:var(--gap);font-size:14px}.post-entry-title{padding:var(--gap)}.home-info .entry-content{-webkit-line-clamp:unset}.post-entry{position:relative;padding:var(--gap);border-radius:var(--radius);transition:transform .1s}.post-entry:hover{transform:scale(1.01)}.tag-entry .entry-cover{display:none}.entry-header h2{font-weight:450;font-size:20px;line-height:1.3}.entry-content{margin:8px 0;color:var(--secondary);font-size:14px;line-height:1.6;overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.entry-footer{color:var(--secondary);font-size:13px}.entry-link{position:absolute;left:0;right:0;top:0;bottom:0}.entry-cover,.entry-isdraft{font-size:14px;color:var(--secondary)}.entry-cover{margin-bottom:var(--gap);text-align:center}.entry-cover img{border-radius:var(--radius);pointer-events:none;width:100%;height:auto}.entry-cover a{color:var(--secondary);box-shadow:0 1px 0 var(--primary)}.post-single{}.post-header{margin:calc(var(--content-gap) * 3)auto calc(var(--content-gap) * 2);text-align:center}.post-title{margin-bottom:12px;font-size:24px}.post-description{margin-top:10px;margin-bottom:5px}.post-meta{color:var(--secondary);font-size:14px}.post-meta .i18n_list li{display:inline-flex;list-style:none;margin:auto 3px;box-shadow:0 1px 0 var(--secondary)}.post-divider{border-bottom:solid #000 1px;margin-bottom:var(--content-gap)}.breadcrumbs a{font-size:16px}.post-content{padding-top:var(--gap);font-size:14px;font-weight:400;font-family:inherit;color:var(--content);letter-spacing:-.1px;line-height:2;font-family:monaspace neon,sans-serif}.post-content h3,.post-content h4,.post-content h5,a .post-content h6{margin:24px 0 16px}.post-content h1{margin:40px auto 32px;font-size:22px}.post-content h2{margin:32px auto 24px;font-size:20px}.post-content h3{font-size:18px}.post-content h4{font-size:16px}.post-content h5{font-size:14px}.post-content h6{font-size:12px}.post-content a,.toc a:hover{box-shadow:0 1px}.post-content a code{margin:auto 0;border-radius:0;box-shadow:0 -1px 0 var(--primary)inset}.post-content del{text-decoration:none;background:linear-gradient(to right,var(--primary) 100%,transparent 0)0/1px 1px repeat-x}.post-content dl,.post-content ol,.post-content p,.post-content figure,.post-content ul{margin-bottom:var(--content-gap)}.post-content ol,.post-content ul{padding-inline-start:20px}.post-content li{margin-top:5px}.post-content li p{margin-bottom:0}.post-content dl{display:flex;flex-wrap:wrap;margin:0}.post-content dt{width:25%;font-weight:700}.post-content dd{width:75%;margin-inline-start:0;padding-inline-start:10px}.post-content dd~dd,.post-content dt~dt{margin-top:10px}.post-content table{margin-bottom:32px}.post-content table th,.post-content table:not(.highlighttable,.highlight table,.gist .highlight) td{min-width:80px;padding:12px 8px;line-height:1.5;border-bottom:1px solid var(--border)}.post-content table th{font-size:14px;text-align:start}.post-content table:not(.highlighttable) td code:only-child{margin:auto 0}.post-content .highlight table{border-radius:var(--radius)}.post-content .highlight:not(table){margin:10px auto;background:var(--hljs-bg)!important;border-radius:var(--radius);direction:ltr}.post-content li>.highlight{margin-inline-end:0}.post-content ul pre{margin-inline-start:calc(var(--gap) * -2)}.post-content .highlight pre{margin:0}.post-content .highlighttable{table-layout:fixed}.post-content .highlighttable td:first-child{width:40px}.post-content .highlighttable td .linenodiv{padding-inline-end:0!important}.post-content .highlighttable td .highlight,.post-content .highlighttable td .linenodiv pre{margin-bottom:0}.post-content code{margin:auto 4px;padding:4px 6px;font-size:.9em;line-height:1.5;background:var(--code-bg);border-radius:2px}.post-content pre code{display:block;margin:auto 0;padding:10px;color:#d5d5d6;background:var(--hljs-bg)!important;border-radius:var(--radius);overflow-x:auto;word-break:break-all}.post-content blockquote{margin:20px 0;padding:0 14px;border-inline-start:3px solid var(--primary)}.post-content hr{margin:30px 0;height:2px;background:var(--tertiary);border:0}.post-content iframe{max-width:100%}.post-content img{border-radius:4px;margin:1rem 0}.post-content img[src*="#center"]{margin:1rem auto}.post-content figure.align-center{text-align:center}.post-content figure>figcaption{color:var(--primary);font-size:16px;font-weight:700;margin:8px 0 16px}.post-content figure>figcaption>p{color:var(--secondary);font-size:14px;font-weight:400}.toc{margin:0 2px 40px;border:1px solid var(--border);background:var(--code-bg);border-radius:var(--radius);padding:.4em}.dark .toc{background:var(--entry)}.toc details summary{cursor:zoom-in;margin-inline-start:20px}.toc details[open] summary{cursor:zoom-out}.toc .details{display:inline;font-weight:500}.toc .inner{margin:0 20px;padding:10px 20px}.toc li ul{margin-inline-start:var(--gap)}.toc summary:focus{outline:0}.post-footer{margin-top:48px}.post-tags li{display:inline-block;margin-inline-end:3px;margin-bottom:5px}.post-tags a,.share-buttons,.paginav{border-radius:var(--radius)}.post-tags a{display:block;padding-inline-start:14px;padding-inline-end:14px;color:var(--secondary);font-size:14px;line-height:34px;background:var(--code-bg)}.share-buttons{margin:14px 0;padding-inline-start:var(--radius);display:flex;justify-content:center;overflow-x:auto}.share-buttons a{margin-top:10px}.share-buttons a:not(:last-of-type){margin-inline-end:12px}h1:hover .anchor,h2:hover .anchor,h3:hover .anchor,h4:hover .anchor,h5:hover .anchor,h6:hover .anchor{display:inline-flex;color:var(--secondary);margin-inline-start:8px;font-weight:500;user-select:none}.paginav{margin:10px 0;display:flex;line-height:30px;border-radius:var(--radius)}.paginav a{padding-inline-start:14px;padding-inline-end:14px;border-radius:var(--radius)}.pag-back{height:20px;width:20px;color:var(--secondary);margin-left:0;margin-bottom:24px}.pag-back:hover{transform:scale(1.1);transition-duration:.1s}.paginav .title{letter-spacing:1px;text-transform:uppercase;font-size:small;color:var(--secondary)}.paginav .prev,.paginav .next{width:50%}.paginav span:hover:not(.title){box-shadow:0 0}.paginav .next{margin-inline-start:auto;text-align:right}[dir=rtl] .paginav .next{text-align:left}h1>a>svg{display:inline}img.in-text{display:inline;margin:auto}@media(max-width:768px){.post-content{font-size:15.5px;word-break:break-word}.pag-back{margin-left:12px}}.buttons,.main .profile{display:flex;justify-content:center}.main .profile{align-items:center;min-height:calc(100vh - var(--header-height) - var(--footer-height) - (var(--gap) * 2));text-align:center}.profile .profile_inner h1{padding:12px 0}.profile img{display:inline-table;border-radius:50%}.buttons{flex-wrap:wrap;max-width:400px;margin:0 auto}.button{background:var(--tertiary);border-radius:var(--radius);margin:8px;padding:6px;transition:transform .1s}.button-inner{padding:0 8px}.button:active{transform:scale(.96)}#searchbox input{padding:4px 10px;width:100%;color:var(--primary);font-weight:700;border:2px solid var(--tertiary);border-radius:var(--radius)}#searchbox input:focus{border-color:var(--secondary)}#searchResults li{list-style:none;border-radius:var(--radius);padding:10px;margin:10px 0;position:relative;font-weight:500}#searchResults{margin:10px 0;width:100%}#searchResults li:active{transition:transform .1s;transform:scale(.98)}#searchResults a{position:absolute;width:100%;height:100%;top:0;left:0;outline:none}#searchResults .focus{transform:scale(.98);border:2px solid var(--tertiary)}.terms-tags li{display:inline-block;margin:10px;font-weight:500}.terms-tags a{display:block;padding:3px 10px;background:var(--tertiary);border-radius:6px;transition:transform .1s}.terms-tags a:active{background:var(--tertiary);transform:scale(.96)}.hljs-comment,.hljs-quote{color:#b6b18b}.hljs-deletion,.hljs-name,.hljs-regexp,.hljs-selector-class,.hljs-selector-id,.hljs-tag,.hljs-template-variable,.hljs-variable{color:#eb3c54}.hljs-built_in,.hljs-builtin-name,.hljs-link,.hljs-literal,.hljs-meta,.hljs-number,.hljs-params,.hljs-type{color:#e7ce56}.hljs-attribute{color:#ee7c2b}.hljs-addition,.hljs-bullet,.hljs-string,.hljs-symbol{color:#4fb4d7}.hljs-section,.hljs-title{color:#78bb65}.hljs-keyword,.hljs-selector-tag{color:#b45ea4}.hljs{display:block;overflow-x:auto;background:#1c1d21;color:#c0c5ce;padding:.5em}.hljs-emphasis{font-style:italic}.hljs-strong{font-weight:700}::-webkit-scrollbar-track{background:0 0}.list:not(.dark)::-webkit-scrollbar-track{background:var(--code-bg)}::-webkit-scrollbar-thumb{background:var(--tertiary);border:5px solid var(--theme);border-radius:var(--radius)}.list:not(.dark)::-webkit-scrollbar-thumb{border:5px solid var(--code-bg)}::-webkit-scrollbar-thumb:hover{background:var(--secondary)}::-webkit-scrollbar:not(.highlighttable,.highlight table,.gist .highlight){background:var(--theme)}.post-content .highlighttable td .highlight pre code::-webkit-scrollbar{display:none}.post-content :not(table) ::-webkit-scrollbar-thumb{border:2px solid var(--hljs-bg);background:#717175}.post-content :not(table) ::-webkit-scrollbar-thumb:hover{background:#a3a3a5}.gist table::-webkit-scrollbar-thumb{border:2px solid #fff;background:#adadad}.gist table::-webkit-scrollbar-thumb:hover{background:#707070}.post-content table::-webkit-scrollbar-thumb{border-width:2px}@media screen and (min-width:768px){::-webkit-scrollbar{width:19px;height:11px}}@media screen and (max-width:768px){:root{--gap:14px}.profile img{transform:scale(.85)}.first-entry{min-height:260px}.archive-month{flex-direction:column}.archive-year{margin-top:20px}.footer{padding:calc((var(--footer-height) - var(--gap) - 10px)/2)var(--gap)}}@media screen and (max-width:900px){.list .top-link{transform:translateY(-5rem)}}@media(prefers-reduced-motion){.terms-tags a:active,.button:active,.post-entry:active,.top-link,#searchResults .focus,#searchResults li:active{transform:none}} \ No newline at end of file diff --git a/public/assets/js/highlight.f413e19d0714851f6474e7ee9632408e58ac146fbdbe62747134bea2fa3415e0.js b/public/assets/js/highlight.f413e19d0714851f6474e7ee9632408e58ac146fbdbe62747134bea2fa3415e0.js new file mode 100644 index 0000000..93a6f86 --- /dev/null +++ b/public/assets/js/highlight.f413e19d0714851f6474e7ee9632408e58ac146fbdbe62747134bea2fa3415e0.js @@ -0,0 +1,44 @@ +/* + Highlight.js 10.2.1 (32fb9a1d) + License: BSD-3-Clause + Copyright (c) 2006-2020, Ivan Sagalaev +*/ +var hljs=function(){"use strict";function e(n){Object.freeze(n);var t="function"==typeof n;return Object.getOwnPropertyNames(n).forEach((function(r){!Object.hasOwnProperty.call(n,r)||null===n[r]||"object"!=typeof n[r]&&"function"!=typeof n[r]||t&&("caller"===r||"callee"===r||"arguments"===r)||Object.isFrozen(n[r])||e(n[r])})),n}class n{constructor(e){void 0===e.data&&(e.data={}),this.data=e.data}ignoreMatch(){this.ignore=!0}}function t(e){return e.replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function r(e,...n){var t={};for(const n in e)t[n]=e[n];return n.forEach((function(e){for(const n in e)t[n]=e[n]})),t}function a(e){return e.nodeName.toLowerCase()}var i=Object.freeze({__proto__:null,escapeHTML:t,inherit:r,nodeStream:function(e){var n=[];return function e(t,r){for(var i=t.firstChild;i;i=i.nextSibling)3===i.nodeType?r+=i.nodeValue.length:1===i.nodeType&&(n.push({event:"start",offset:r,node:i}),r=e(i,r),a(i).match(/br|hr|img|input/)||n.push({event:"stop",offset:r,node:i}));return r}(e,0),n},mergeStreams:function(e,n,r){var i=0,s="",o=[];function l(){return e.length&&n.length?e[0].offset!==n[0].offset?e[0].offset"}function u(e){s+=""}function g(e){("start"===e.event?c:u)(e.node)}for(;e.length||n.length;){var d=l();if(s+=t(r.substring(i,d[0].offset)),i=d[0].offset,d===e){o.reverse().forEach(u);do{g(d.splice(0,1)[0]),d=l()}while(d===e&&d.length&&d[0].offset===i);o.reverse().forEach(c)}else"start"===d[0].event?o.push(d[0].node):o.pop(),g(d.splice(0,1)[0])}return s+t(r.substr(i))}});const s="",o=e=>!!e.kind;class l{constructor(e,n){this.buffer="",this.classPrefix=n.classPrefix,e.walk(this)}addText(e){this.buffer+=t(e)}openNode(e){if(!o(e))return;let n=e.kind;e.sublanguage||(n=`${this.classPrefix}${n}`),this.span(n)}closeNode(e){o(e)&&(this.buffer+=s)}value(){return this.buffer}span(e){this.buffer+=``}}class c{constructor(){this.rootNode={children:[]},this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(e){this.top.children.push(e)}openNode(e){const n={kind:e,children:[]};this.add(n),this.stack.push(n)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(e){return this.constructor._walk(e,this.rootNode)}static _walk(e,n){return"string"==typeof n?e.addText(n):n.children&&(e.openNode(n),n.children.forEach(n=>this._walk(e,n)),e.closeNode(n)),e}static _collapse(e){"string"!=typeof e&&e.children&&(e.children.every(e=>"string"==typeof e)?e.children=[e.children.join("")]:e.children.forEach(e=>{c._collapse(e)}))}}class u extends c{constructor(e){super(),this.options=e}addKeyword(e,n){""!==e&&(this.openNode(n),this.addText(e),this.closeNode())}addText(e){""!==e&&this.add(e)}addSublanguage(e,n){const t=e.root;t.kind=n,t.sublanguage=!0,this.add(t)}toHTML(){return new l(this,this.options).value()}finalize(){return!0}}function g(e){return e?"string"==typeof e?e:e.source:null}const d="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",h={begin:"\\\\[\\s\\S]",relevance:0},f={className:"string",begin:"'",end:"'",illegal:"\\n",contains:[h]},p={className:"string",begin:'"',end:'"',illegal:"\\n",contains:[h]},m={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},b=function(e,n,t={}){var a=r({className:"comment",begin:e,end:n,contains:[]},t);return a.contains.push(m),a.contains.push({className:"doctag",begin:"(?:TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):",relevance:0}),a},v=b("//","$"),x=b("/\\*","\\*/"),E=b("#","$");var _=Object.freeze({__proto__:null,IDENT_RE:"[a-zA-Z]\\w*",UNDERSCORE_IDENT_RE:"[a-zA-Z_]\\w*",NUMBER_RE:"\\b\\d+(\\.\\d+)?",C_NUMBER_RE:d,BINARY_NUMBER_RE:"\\b(0b[01]+)",RE_STARTERS_RE:"!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",SHEBANG:(e={})=>{const n=/^#![ ]*\//;return e.binary&&(e.begin=function(...e){return e.map(e=>g(e)).join("")}(n,/.*\b/,e.binary,/\b.*/)),r({className:"meta",begin:n,end:/$/,relevance:0,"on:begin":(e,n)=>{0!==e.index&&n.ignoreMatch()}},e)},BACKSLASH_ESCAPE:h,APOS_STRING_MODE:f,QUOTE_STRING_MODE:p,PHRASAL_WORDS_MODE:m,COMMENT:b,C_LINE_COMMENT_MODE:v,C_BLOCK_COMMENT_MODE:x,HASH_COMMENT_MODE:E,NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?",relevance:0},C_NUMBER_MODE:{className:"number",begin:d,relevance:0},BINARY_NUMBER_MODE:{className:"number",begin:"\\b(0b[01]+)",relevance:0},CSS_NUMBER_MODE:{className:"number",begin:"\\b\\d+(\\.\\d+)?(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},REGEXP_MODE:{begin:/(?=\/[^/\n]*\/)/,contains:[{className:"regexp",begin:/\//,end:/\/[gimuy]*/,illegal:/\n/,contains:[h,{begin:/\[/,end:/\]/,relevance:0,contains:[h]}]}]},TITLE_MODE:{className:"title",begin:"[a-zA-Z]\\w*",relevance:0},UNDERSCORE_TITLE_MODE:{className:"title",begin:"[a-zA-Z_]\\w*",relevance:0},METHOD_GUARD:{begin:"\\.\\s*[a-zA-Z_]\\w*",relevance:0},END_SAME_AS_BEGIN:function(e){return Object.assign(e,{"on:begin":(e,n)=>{n.data._beginMatch=e[1]},"on:end":(e,n)=>{n.data._beginMatch!==e[1]&&n.ignoreMatch()}})}}),w="of and for in not or if then".split(" ");function N(e,n){return n?+n:function(e){return w.includes(e.toLowerCase())}(e)?0:1}const y={props:["language","code","autodetect"],data:function(){return{detectedLanguage:"",unknownLanguage:!1}},computed:{className(){return this.unknownLanguage?"":"hljs "+this.detectedLanguage},highlighted(){if(!this.autoDetect&&!hljs.getLanguage(this.language))return console.warn(`The language "${this.language}" you specified could not be found.`),this.unknownLanguage=!0,t(this.code);let e;return this.autoDetect?(e=hljs.highlightAuto(this.code),this.detectedLanguage=e.language):(e=hljs.highlight(this.language,this.code,this.ignoreIllegals),this.detectectLanguage=this.language),e.value},autoDetect(){return!(this.language&&(e=this.autodetect,!e&&""!==e));var e},ignoreIllegals:()=>!0},render(e){return e("pre",{},[e("code",{class:this.className,domProps:{innerHTML:this.highlighted}})])}},R={install(e){e.component("highlightjs",y)}},k=t,M=r,{nodeStream:O,mergeStreams:L}=i,A=Symbol("nomatch");return function(t){var a=[],i=Object.create(null),s=Object.create(null),o=[],l=!0,c=/(^(<[^>]+>|\t|)+|\n)/gm,d="Could not find the language '{}', did you forget to load/include a language module?";const h={disableAutodetect:!0,name:"Plain text",contains:[]};var f={noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",tabReplace:null,useBR:!1,languages:null,__emitter:u};function p(e){return f.noHighlightRe.test(e)}function m(e,n,t,r){var a={code:n,language:e};j("before:highlight",a);var i=a.result?a.result:b(a.language,a.code,t,r);return i.code=a.code,j("after:highlight",i),i}function b(e,t,a,s){var o=t;function c(e,n){var t=E.case_insensitive?n[0].toLowerCase():n[0];return Object.prototype.hasOwnProperty.call(e.keywords,t)&&e.keywords[t]}function u(){null!=R.subLanguage?function(){if(""!==L){var e=null;if("string"==typeof R.subLanguage){if(!i[R.subLanguage])return void O.addText(L);e=b(R.subLanguage,L,!0,M[R.subLanguage]),M[R.subLanguage]=e.top}else e=v(L,R.subLanguage.length?R.subLanguage:null);R.relevance>0&&(I+=e.relevance),O.addSublanguage(e.emitter,e.language)}}():function(){if(!R.keywords)return void O.addText(L);let e=0;R.keywordPatternRe.lastIndex=0;let n=R.keywordPatternRe.exec(L),t="";for(;n;){t+=L.substring(e,n.index);const r=c(R,n);if(r){const[e,a]=r;O.addText(t),t="",I+=a,O.addKeyword(n[0],e)}else t+=n[0];e=R.keywordPatternRe.lastIndex,n=R.keywordPatternRe.exec(L)}t+=L.substr(e),O.addText(t)}(),L=""}function h(e){return e.className&&O.openNode(e.className),R=Object.create(e,{parent:{value:R}})}function p(e){return 0===R.matcher.regexIndex?(L+=e[0],1):(S=!0,0)}var m={};function x(t,r){var i=r&&r[0];if(L+=t,null==i)return u(),0;if("begin"===m.type&&"end"===r.type&&m.index===r.index&&""===i){if(L+=o.slice(r.index,r.index+1),!l){const n=Error("0 width match regex");throw n.languageName=e,n.badRule=m.rule,n}return 1}if(m=r,"begin"===r.type)return function(e){var t=e[0],r=e.rule;const a=new n(r),i=[r.__beforeBegin,r["on:begin"]];for(const n of i)if(n&&(n(e,a),a.ignore))return p(t);return r&&r.endSameAsBegin&&(r.endRe=RegExp(t.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&"),"m")),r.skip?L+=t:(r.excludeBegin&&(L+=t),u(),r.returnBegin||r.excludeBegin||(L=t)),h(r),r.returnBegin?0:t.length}(r);if("illegal"===r.type&&!a){const e=Error('Illegal lexeme "'+i+'" for mode "'+(R.className||"")+'"');throw e.mode=R,e}if("end"===r.type){var s=function(e){var t=e[0],r=o.substr(e.index),a=function e(t,r,a){let i=function(e,n){var t=e&&e.exec(n);return t&&0===t.index}(t.endRe,a);if(i){if(t["on:end"]){const e=new n(t);t["on:end"](r,e),e.ignore&&(i=!1)}if(i){for(;t.endsParent&&t.parent;)t=t.parent;return t}}if(t.endsWithParent)return e(t.parent,r,a)}(R,e,r);if(!a)return A;var i=R;i.skip?L+=t:(i.returnEnd||i.excludeEnd||(L+=t),u(),i.excludeEnd&&(L=t));do{R.className&&O.closeNode(),R.skip||R.subLanguage||(I+=R.relevance),R=R.parent}while(R!==a.parent);return a.starts&&(a.endSameAsBegin&&(a.starts.endRe=a.endRe),h(a.starts)),i.returnEnd?0:t.length}(r);if(s!==A)return s}if("illegal"===r.type&&""===i)return 1;if(j>1e5&&j>3*r.index)throw Error("potential infinite loop, way more iterations than matches");return L+=i,i.length}var E=y(e);if(!E)throw console.error(d.replace("{}",e)),Error('Unknown language: "'+e+'"');var _=function(e){function n(n,t){return RegExp(g(n),"m"+(e.case_insensitive?"i":"")+(t?"g":""))}class t{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(e,n){n.position=this.position++,this.matchIndexes[this.matchAt]=n,this.regexes.push([n,e]),this.matchAt+=function(e){return RegExp(e.toString()+"|").exec("").length-1}(e)+1}compile(){0===this.regexes.length&&(this.exec=()=>null);const e=this.regexes.map(e=>e[1]);this.matcherRe=n(function(e,n="|"){for(var t=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./,r=0,a="",i=0;i0&&(a+=n),a+="(";o.length>0;){var l=t.exec(o);if(null==l){a+=o;break}a+=o.substring(0,l.index),o=o.substring(l.index+l[0].length),"\\"===l[0][0]&&l[1]?a+="\\"+(+l[1]+s):(a+=l[0],"("===l[0]&&r++)}a+=")"}return a}(e),!0),this.lastIndex=0}exec(e){this.matcherRe.lastIndex=this.lastIndex;const n=this.matcherRe.exec(e);if(!n)return null;const t=n.findIndex((e,n)=>n>0&&void 0!==e),r=this.matchIndexes[t];return n.splice(0,t),Object.assign(n,r)}}class a{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(e){if(this.multiRegexes[e])return this.multiRegexes[e];const n=new t;return this.rules.slice(e).forEach(([e,t])=>n.addRule(e,t)),n.compile(),this.multiRegexes[e]=n,n}resumingScanAtSamePosition(){return 0!==this.regexIndex}considerAll(){this.regexIndex=0}addRule(e,n){this.rules.push([e,n]),"begin"===n.type&&this.count++}exec(e){const n=this.getMatcher(this.regexIndex);n.lastIndex=this.lastIndex;let t=n.exec(e);if(this.resumingScanAtSamePosition())if(t&&t.index===this.lastIndex);else{const n=this.getMatcher(0);n.lastIndex=this.lastIndex+1,t=n.exec(e)}return t&&(this.regexIndex+=t.position+1,this.regexIndex===this.count&&this.considerAll()),t}}function i(e,n){const t=e.input[e.index-1],r=e.input[e.index+e[0].length];"."!==t&&"."!==r||n.ignoreMatch()}if(e.contains&&e.contains.includes("self"))throw Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return function t(s,o){const l=s;if(s.compiled)return l;s.compiled=!0,s.__beforeBegin=null,s.keywords=s.keywords||s.beginKeywords;let c=null;if("object"==typeof s.keywords&&(c=s.keywords.$pattern,delete s.keywords.$pattern),s.keywords&&(s.keywords=function(e,n){var t={};return"string"==typeof e?r("keyword",e):Object.keys(e).forEach((function(n){r(n,e[n])})),t;function r(e,r){n&&(r=r.toLowerCase()),r.split(" ").forEach((function(n){var r=n.split("|");t[r[0]]=[e,N(r[0],r[1])]}))}}(s.keywords,e.case_insensitive)),s.lexemes&&c)throw Error("ERR: Prefer `keywords.$pattern` to `mode.lexemes`, BOTH are not allowed. (see mode reference) ");return l.keywordPatternRe=n(s.lexemes||c||/\w+/,!0),o&&(s.beginKeywords&&(s.begin="\\b("+s.beginKeywords.split(" ").join("|")+")(?=\\b|\\s)",s.__beforeBegin=i),s.begin||(s.begin=/\B|\b/),l.beginRe=n(s.begin),s.endSameAsBegin&&(s.end=s.begin),s.end||s.endsWithParent||(s.end=/\B|\b/),s.end&&(l.endRe=n(s.end)),l.terminator_end=g(s.end)||"",s.endsWithParent&&o.terminator_end&&(l.terminator_end+=(s.end?"|":"")+o.terminator_end)),s.illegal&&(l.illegalRe=n(s.illegal)),void 0===s.relevance&&(s.relevance=1),s.contains||(s.contains=[]),s.contains=[].concat(...s.contains.map((function(e){return function(e){return e.variants&&!e.cached_variants&&(e.cached_variants=e.variants.map((function(n){return r(e,{variants:null},n)}))),e.cached_variants?e.cached_variants:function e(n){return!!n&&(n.endsWithParent||e(n.starts))}(e)?r(e,{starts:e.starts?r(e.starts):null}):Object.isFrozen(e)?r(e):e}("self"===e?s:e)}))),s.contains.forEach((function(e){t(e,l)})),s.starts&&t(s.starts,o),l.matcher=function(e){const n=new a;return e.contains.forEach(e=>n.addRule(e.begin,{rule:e,type:"begin"})),e.terminator_end&&n.addRule(e.terminator_end,{type:"end"}),e.illegal&&n.addRule(e.illegal,{type:"illegal"}),n}(l),l}(e)}(E),w="",R=s||_,M={},O=new f.__emitter(f);!function(){for(var e=[],n=R;n!==E;n=n.parent)n.className&&e.unshift(n.className);e.forEach(e=>O.openNode(e))}();var L="",I=0,T=0,j=0,S=!1;try{for(R.matcher.considerAll();;){j++,S?S=!1:R.matcher.considerAll(),R.matcher.lastIndex=T;const e=R.matcher.exec(o);if(!e)break;const n=x(o.substring(T,e.index),e);T=e.index+n}return x(o.substr(T)),O.closeAllNodes(),O.finalize(),w=O.toHTML(),{relevance:I,value:w,language:e,illegal:!1,emitter:O,top:R}}catch(n){if(n.message&&n.message.includes("Illegal"))return{illegal:!0,illegalBy:{msg:n.message,context:o.slice(T-100,T+100),mode:n.mode},sofar:w,relevance:0,value:k(o),emitter:O};if(l)return{illegal:!1,relevance:0,value:k(o),emitter:O,language:e,top:R,errorRaised:n};throw n}}function v(e,n){n=n||f.languages||Object.keys(i);var t=function(e){const n={relevance:0,emitter:new f.__emitter(f),value:k(e),illegal:!1,top:h};return n.emitter.addText(e),n}(e),r=t;return n.filter(y).filter(T).forEach((function(n){var a=b(n,e,!1);a.language=n,a.relevance>r.relevance&&(r=a),a.relevance>t.relevance&&(r=t,t=a)})),r.language&&(t.second_best=r),t}function x(e){return f.tabReplace||f.useBR?e.replace(c,e=>"\n"===e?f.useBR?"
":e:f.tabReplace?e.replace(/\t/g,f.tabReplace):e):e}function E(e){let n=null;const t=function(e){var n=e.className+" ";n+=e.parentNode?e.parentNode.className:"";const t=f.languageDetectRe.exec(n);if(t){var r=y(t[1]);return r||(console.warn(d.replace("{}",t[1])),console.warn("Falling back to no-highlight mode for this block.",e)),r?t[1]:"no-highlight"}return n.split(/\s+/).find(e=>p(e)||y(e))}(e);if(p(t))return;j("before:highlightBlock",{block:e,language:t}),f.useBR?(n=document.createElement("div")).innerHTML=e.innerHTML.replace(/\n/g,"").replace(//g,"\n"):n=e;const r=n.textContent,a=t?m(t,r,!0):v(r),i=O(n);if(i.length){const e=document.createElement("div");e.innerHTML=a.value,a.value=L(i,O(e),r)}a.value=x(a.value),j("after:highlightBlock",{block:e,result:a}),e.innerHTML=a.value,e.className=function(e,n,t){var r=n?s[n]:t,a=[e.trim()];return e.match(/\bhljs\b/)||a.push("hljs"),e.includes(r)||a.push(r),a.join(" ").trim()}(e.className,t,a.language),e.result={language:a.language,re:a.relevance,relavance:a.relevance},a.second_best&&(e.second_best={language:a.second_best.language,re:a.second_best.relevance,relavance:a.second_best.relevance})}const w=()=>{if(!w.called){w.called=!0;var e=document.querySelectorAll("pre code");a.forEach.call(e,E)}};function y(e){return e=(e||"").toLowerCase(),i[e]||i[s[e]]}function I(e,{languageName:n}){"string"==typeof e&&(e=[e]),e.forEach(e=>{s[e]=n})}function T(e){var n=y(e);return n&&!n.disableAutodetect}function j(e,n){var t=e;o.forEach((function(e){e[t]&&e[t](n)}))}Object.assign(t,{highlight:m,highlightAuto:v,fixMarkup:function(e){return console.warn("fixMarkup is deprecated and will be removed entirely in v11.0"),console.warn("Please see https://github.com/highlightjs/highlight.js/issues/2534"),x(e)},highlightBlock:E,configure:function(e){f=M(f,e)},initHighlighting:w,initHighlightingOnLoad:function(){window.addEventListener("DOMContentLoaded",w,!1)},registerLanguage:function(e,n){var r=null;try{r=n(t)}catch(n){if(console.error("Language definition for '{}' could not be registered.".replace("{}",e)),!l)throw n;console.error(n),r=h}r.name||(r.name=e),i[e]=r,r.rawDefinition=n.bind(null,t),r.aliases&&I(r.aliases,{languageName:e})},listLanguages:function(){return Object.keys(i)},getLanguage:y,registerAliases:I,requireLanguage:function(e){var n=y(e);if(n)return n;throw Error("The '{}' language is required, but not loaded.".replace("{}",e))},autoDetection:T,inherit:M,addPlugin:function(e){o.push(e)},vuePlugin:R}),t.debugMode=function(){l=!1},t.safeMode=function(){l=!0},t.versionString="10.2.1";for(const n in _)"object"==typeof _[n]&&e(_[n]);return Object.assign(t,_),t}({})}();"object"==typeof exports&&"undefined"!=typeof module&&(module.exports=hljs); +hljs.registerLanguage("apache",function(){"use strict";return function(e){var n={className:"number",begin:"\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?"};return{name:"Apache config",aliases:["apacheconf"],case_insensitive:!0,contains:[e.HASH_COMMENT_MODE,{className:"section",begin:"",contains:[n,{className:"number",begin:":\\d{1,5}"},e.inherit(e.QUOTE_STRING_MODE,{relevance:0})]},{className:"attribute",begin:/\w+/,relevance:0,keywords:{nomarkup:"order deny allow setenv rewriterule rewriteengine rewritecond documentroot sethandler errordocument loadmodule options header listen serverroot servername"},starts:{end:/$/,relevance:0,keywords:{literal:"on off all deny allow"},contains:[{className:"meta",begin:"\\s\\[",end:"\\]$"},{className:"variable",begin:"[\\$%]\\{",end:"\\}",contains:["self",{className:"number",begin:"[\\$%]\\d+"}]},n,{className:"number",begin:"\\d+"},e.QUOTE_STRING_MODE]}}],illegal:/\S/}}}()); +hljs.registerLanguage("bash",function(){"use strict";return function(e){const s={};Object.assign(s,{className:"variable",variants:[{begin:/\$[\w\d#@][\w\d_]*/},{begin:/\$\{/,end:/\}/,contains:[{begin:/:-/,contains:[s]}]}]});const t={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,t]};t.contains.push(n);const a={begin:/\$\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,s]},i=e.SHEBANG({binary:"(fish|bash|zsh|sh|csh|ksh|tcsh|dash|scsh)",relevance:10}),c={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0};return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b-?[a-z\._-]+\b/,keyword:"if then else elif fi for while in do done case esac function",literal:"true false",built_in:"break cd continue eval exec exit export getopts hash pwd readonly return shift test times trap umask unset alias bind builtin caller command declare echo enable help let local logout mapfile printf read readarray source type typeset ulimit unalias set shopt autoload bg bindkey bye cap chdir clone comparguments compcall compctl compdescribe compfiles compgroups compquote comptags comptry compvalues dirs disable disown echotc echoti emulate fc fg float functions getcap getln history integer jobs kill limit log noglob popd print pushd pushln rehash sched setcap setopt stat suspend ttyctl unfunction unhash unlimit unsetopt vared wait whence where which zcompile zformat zftp zle zmodload zparseopts zprof zpty zregexparse zsocket zstyle ztcp",_:"-ne -eq -lt -gt -f -d -e -s -l -a"},contains:[i,e.SHEBANG(),c,a,e.HASH_COMMENT_MODE,n,{className:"",begin:/\\"/},{className:"string",begin:/'/,end:/'/},s]}}}()); +hljs.registerLanguage("c-like",function(){"use strict";return function(e){function t(e){return"(?:"+e+")?"}var n="(decltype\\(auto\\)|"+t("[a-zA-Z_]\\w*::")+"[a-zA-Z_]\\w*"+t("<.*?>")+")",r={className:"keyword",begin:"\\b[a-z\\d_]*_t\\b"},a={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'(\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},i={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},s={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{"meta-keyword":"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(a,{className:"meta-string"}),{className:"meta-string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},o={className:"title",begin:t("[a-zA-Z_]\\w*::")+e.IDENT_RE,relevance:0},c=t("[a-zA-Z_]\\w*::")+e.IDENT_RE+"\\s*\\(",l={keyword:"int float while private char char8_t char16_t char32_t catch import module export virtual operator sizeof dynamic_cast|10 typedef const_cast|10 const for static_cast|10 union namespace unsigned long volatile static protected bool template mutable if public friend do goto auto void enum else break extern using asm case typeid wchar_t short reinterpret_cast|10 default double register explicit signed typename try this switch continue inline delete alignas alignof constexpr consteval constinit decltype concept co_await co_return co_yield requires noexcept static_assert thread_local restrict final override atomic_bool atomic_char atomic_schar atomic_uchar atomic_short atomic_ushort atomic_int atomic_uint atomic_long atomic_ulong atomic_llong atomic_ullong new throw return and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr _Bool complex _Complex imaginary _Imaginary",literal:"true false nullptr NULL"},d=[r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,i,a],_={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:l,contains:d.concat([{begin:/\(/,end:/\)/,keywords:l,contains:d.concat(["self"]),relevance:0}]),relevance:0},u={className:"function",begin:"("+n+"[\\*&\\s]+)+"+c,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:l,illegal:/[^\w\s\*&:<>]/,contains:[{begin:"decltype\\(auto\\)",keywords:l,relevance:0},{begin:c,returnBegin:!0,contains:[o],relevance:0},{className:"params",begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,i,r,{begin:/\(/,end:/\)/,keywords:l,relevance:0,contains:["self",e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,a,i,r]}]},r,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,s]};return{aliases:["c","cc","h","c++","h++","hpp","hh","hxx","cxx"],keywords:l,disableAutodetect:!0,illegal:"",keywords:l,contains:["self",r]},{begin:e.IDENT_RE+"::",keywords:l},{className:"class",beginKeywords:"class struct",end:/[{;:]/,contains:[{begin://,contains:["self"]},e.TITLE_MODE]}]),exports:{preprocessor:s,strings:a,keywords:l}}}}()); +hljs.registerLanguage("c",function(){"use strict";return function(e){var n=e.requireLanguage("c-like").rawDefinition();return n.name="C",n.aliases=["c","h"],n}}()); +hljs.registerLanguage("coffeescript",function(){"use strict";const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);return function(r){var t={keyword:e.concat(["then","unless","until","loop","by","when","and","or","is","isnt","not"]).filter((e=>n=>!e.includes(n))(["var","const","let","function","static"])).join(" "),literal:n.concat(["yes","no","on","off"]).join(" "),built_in:a.concat(["npm","print"]).join(" ")},i="[A-Za-z$_][0-9A-Za-z$_]*",s={className:"subst",begin:/#\{/,end:/}/,keywords:t},o=[r.BINARY_NUMBER_MODE,r.inherit(r.C_NUMBER_MODE,{starts:{end:"(\\s*/)?",relevance:0}}),{className:"string",variants:[{begin:/'''/,end:/'''/,contains:[r.BACKSLASH_ESCAPE]},{begin:/'/,end:/'/,contains:[r.BACKSLASH_ESCAPE]},{begin:/"""/,end:/"""/,contains:[r.BACKSLASH_ESCAPE,s]},{begin:/"/,end:/"/,contains:[r.BACKSLASH_ESCAPE,s]}]},{className:"regexp",variants:[{begin:"///",end:"///",contains:[s,r.HASH_COMMENT_MODE]},{begin:"//[gim]{0,3}(?=\\W)",relevance:0},{begin:/\/(?![ *]).*?(?![\\]).\/[gim]{0,3}(?=\W)/}]},{begin:"@"+i},{subLanguage:"javascript",excludeBegin:!0,excludeEnd:!0,variants:[{begin:"```",end:"```"},{begin:"`",end:"`"}]}];s.contains=o;var c=r.inherit(r.TITLE_MODE,{begin:i}),l={className:"params",begin:"\\([^\\(]",returnBegin:!0,contains:[{begin:/\(/,end:/\)/,keywords:t,contains:["self"].concat(o)}]};return{name:"CoffeeScript",aliases:["coffee","cson","iced"],keywords:t,illegal:/\/\*/,contains:o.concat([r.COMMENT("###","###"),r.HASH_COMMENT_MODE,{className:"function",begin:"^\\s*"+i+"\\s*=\\s*(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[c,l]},{begin:/[:\(,=]\s*/,relevance:0,contains:[{className:"function",begin:"(\\(.*\\))?\\s*\\B[-=]>",end:"[-=]>",returnBegin:!0,contains:[l]}]},{className:"class",beginKeywords:"class",end:"$",illegal:/[:="\[\]]/,contains:[{beginKeywords:"extends",endsWithParent:!0,illegal:/[:="\[\]]/,contains:[c]},c]},{begin:i+":",end:":",returnBegin:!0,returnEnd:!0,relevance:0}])}}}()); +hljs.registerLanguage("cpp",function(){"use strict";return function(e){var i=e.requireLanguage("c-like").rawDefinition();return i.disableAutodetect=!1,i.name="C++",i.aliases=["cc","c++","h++","hpp","hh","hxx","cxx"],i}}()); +hljs.registerLanguage("csharp",function(){"use strict";return function(e){var n={keyword:"abstract as base bool break byte case catch char checked const continue decimal default delegate do double enum event explicit extern finally fixed float for foreach goto if implicit in init int interface internal is lock long object operator out override params private protected public readonly ref sbyte sealed short sizeof stackalloc static string struct switch this try typeof uint ulong unchecked unsafe ushort using virtual void volatile while add alias ascending async await by descending dynamic equals from get global group into join let nameof on orderby partial remove select set value var when where yield",literal:"null false true"},i=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),a={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},s={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},t=e.inherit(s,{illegal:/\n/}),l={className:"subst",begin:"{",end:"}",keywords:n},r=e.inherit(l,{illegal:/\n/}),c={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:"{{"},{begin:"}}"},e.BACKSLASH_ESCAPE,r]},o={className:"string",begin:/\$@"/,end:'"',contains:[{begin:"{{"},{begin:"}}"},{begin:'""'},l]},g=e.inherit(o,{illegal:/\n/,contains:[{begin:"{{"},{begin:"}}"},{begin:'""'},r]});l.contains=[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.C_BLOCK_COMMENT_MODE],r.contains=[g,c,t,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,a,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];var d={variants:[o,c,s,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},E={begin:"<",end:">",contains:[{beginKeywords:"in out"},i]},_=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",b={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:n,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"\x3c!--|--\x3e"},{begin:""}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{"meta-keyword":"if else elif endif define undef warning error line region endregion pragma checksum"}},d,a,{beginKeywords:"class interface",end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",end:/[{;=]/,illegal:/[^\s:]/,contains:[i,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",end:/[{;=]/,illegal:/[^\s:]/,contains:[i,E,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"meta-string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+_+"\\s+)+"+e.IDENT_RE+"\\s*(\\<.+\\>)?\\s*\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:n,contains:[{begin:e.IDENT_RE+"\\s*(\\<.+\\>)?\\s*\\(",returnBegin:!0,contains:[e.TITLE_MODE,E],relevance:0},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:n,relevance:0,contains:[d,a,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},b]}}}()); +hljs.registerLanguage("css",function(){"use strict";return function(e){var n={begin:/(?:[A-Z\_\.\-]+|--[a-zA-Z0-9_-]+)\s*:/,returnBegin:!0,end:";",endsWithParent:!0,contains:[{className:"attribute",begin:/\S/,end:":",excludeEnd:!0,starts:{endsWithParent:!0,excludeEnd:!0,contains:[{begin:/[\w-]+\(/,returnBegin:!0,contains:[{className:"built_in",begin:/[\w-]+/},{begin:/\(/,end:/\)/,contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{className:"number",begin:"#[0-9A-Fa-f]+"},{className:"meta",begin:"!important"}]}}]};return{name:"CSS",case_insensitive:!0,illegal:/[=\/|'\$]/,contains:[e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/},{className:"selector-class",begin:/\.[A-Za-z0-9_-]+/},{className:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",illegal:/:/,returnBegin:!0,contains:[{className:"keyword",begin:/@\-?\w[\w]*(\-\w+)*/},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:"and or not only",contains:[{begin:/[a-z-]+:/,className:"attribute"},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"[a-zA-Z-][a-zA-Z0-9_-]*",relevance:0},{begin:"{",end:"}",illegal:/\S/,contains:[e.C_BLOCK_COMMENT_MODE,n]}]}}}()); +hljs.registerLanguage("diff",function(){"use strict";return function(e){return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,variants:[{begin:/^@@ +\-\d+,\d+ +\+\d+,\d+ +@@$/},{begin:/^\*\*\* +\d+,\d+ +\*\*\*\*$/},{begin:/^\-\-\- +\d+,\d+ +\-\-\-\-$/}]},{className:"comment",variants:[{begin:/Index: /,end:/$/},{begin:/={3,}/,end:/$/},{begin:/^\-{3}/,end:/$/},{begin:/^\*{3} /,end:/$/},{begin:/^\+{3}/,end:/$/},{begin:/^\*{15}$/}]},{className:"addition",begin:"^\\+",end:"$"},{className:"deletion",begin:"^\\-",end:"$"},{className:"addition",begin:"^\\!",end:"$"}]}}}()); +hljs.registerLanguage("go",function(){"use strict";return function(e){var n={keyword:"break default func interface select case map struct chan else goto package switch const fallthrough if range type continue for import return var go defer bool byte complex64 complex128 float32 float64 int8 int16 int32 int64 string uint8 uint16 uint32 uint64 int uint uintptr rune",literal:"true false iota nil",built_in:"append cap close complex copy imag len make new panic print println real recover delete"};return{name:"Go",aliases:["golang"],keywords:n,illegal:"e(n)).join("")}return function(a){var s={className:"number",relevance:0,variants:[{begin:/([\+\-]+)?[\d]+_[\d_]+/},{begin:a.NUMBER_RE}]},i=a.COMMENT();i.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];var t={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)}/}]},r={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[a.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},c={begin:/\[/,end:/\]/,contains:[i,r,t,l,s,"self"],relevance:0},g="("+[/[A-Za-z0-9_-]+/,/"(\\"|[^"])*"/,/'[^']*'/].map(n=>e(n)).join("|")+")";return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[i,{className:"section",begin:/\[+/,end:/\]+/},{begin:n(g,"(\\s*\\.\\s*",g,")*",n("(?=",/\s*=\s*[^#\s]/,")")),className:"attr",starts:{end:/$/,contains:[i,c,r,t,l,s]}}]}}}()); +hljs.registerLanguage("java",function(){"use strict";function e(e){return e?"string"==typeof e?e:e.source:null}function n(e){return a("(",e,")?")}function a(...n){return n.map(n=>e(n)).join("")}function s(...n){return"("+n.map(n=>e(n)).join("|")+")"}return function(e){var t="false synchronized int abstract float private char boolean var static null if const for true while long strictfp finally protected import native final void enum else break transient catch instanceof byte super volatile case assert short package default double public try this switch continue throws protected public private module requires exports do",i={className:"meta",begin:"@[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},r=e=>a("[",e,"]+([",e,"_]*[",e,"]+)?"),c={className:"number",variants:[{begin:`\\b(0[bB]${r("01")})[lL]?`},{begin:`\\b(0${r("0-7")})[dDfFlL]?`},{begin:a(/\b0[xX]/,s(a(r("a-fA-F0-9"),/\./,r("a-fA-F0-9")),a(r("a-fA-F0-9"),/\.?/),a(/\./,r("a-fA-F0-9"))),/([pP][+-]?(\d+))?/,/[fFdDlL]?/)},{begin:a(/\b/,s(a(/\d*\./,r("\\d")),r("\\d")),/[eE][+-]?[\d]+[dDfF]?/)},{begin:a(/\b/,r(/\d/),n(/\.?/),n(r(/\d/)),/[dDfFlL]?/)}],relevance:0};return{name:"Java",aliases:["jsp"],keywords:t,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"class",beginKeywords:"class interface enum",end:/[{;=]/,excludeEnd:!0,keywords:"class interface enum",illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"new throw return else",relevance:0},{className:"function",begin:"([À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(<[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*(\\s*,\\s*[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*)*>)?\\s+)+"+e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:t,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"params",begin:/\(/,end:/\)/,keywords:t,relevance:0,contains:[i,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},c,i]}}}()); +hljs.registerLanguage("javascript",function(){"use strict";const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);function s(e){return r("(?=",e,")")}function r(...e){return e.map(e=>(function(e){return e?"string"==typeof e?e:e.source:null})(e)).join("")}return function(t){var i="[A-Za-z$_][0-9A-Za-z$_]*",c={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/},o={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:e.join(" "),literal:n.join(" "),built_in:a.join(" ")},l={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:t.C_NUMBER_RE+"n?"}],relevance:0},E={className:"subst",begin:"\\$\\{",end:"\\}",keywords:o,contains:[]},d={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"xml"}},g={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[t.BACKSLASH_ESCAPE,E],subLanguage:"css"}},u={className:"string",begin:"`",end:"`",contains:[t.BACKSLASH_ESCAPE,E]};E.contains=[t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,g,u,l,t.REGEXP_MODE];var b=E.contains.concat([{begin:/\(/,end:/\)/,contains:["self"].concat(E.contains,[t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE])},t.C_BLOCK_COMMENT_MODE,t.C_LINE_COMMENT_MODE]),_={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:b};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:o,contains:[t.SHEBANG({binary:"node",relevance:5}),{className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},t.APOS_STRING_MODE,t.QUOTE_STRING_MODE,d,g,u,t.C_LINE_COMMENT_MODE,t.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+",contains:[{className:"type",begin:"\\{",end:"\\}",relevance:0},{className:"variable",begin:i+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),t.C_BLOCK_COMMENT_MODE,l,{begin:r(/[{,\n]\s*/,s(r(/(((\/\/.*$)|(\/\*(.|\n)*\*\/))\s*)*/,i+"\\s*:"))),relevance:0,contains:[{className:"attr",begin:i+s("\\s*:"),relevance:0}]},{begin:"("+t.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[t.C_LINE_COMMENT_MODE,t.C_BLOCK_COMMENT_MODE,t.REGEXP_MODE,{className:"function",begin:"(\\([^(]*(\\([^(]*(\\([^(]*\\))?\\))?\\)|"+t.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:t.UNDERSCORE_IDENT_RE},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:o,contains:b}]}]},{begin:/,/,relevance:0},{className:"",begin:/\s/,end:/\s*/,skip:!0},{variants:[{begin:"<>",end:""},{begin:c.begin,end:c.end}],subLanguage:"xml",contains:[{begin:c.begin,end:c.end,skip:!0,contains:["self"]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/\{/,excludeEnd:!0,contains:[t.inherit(t.TITLE_MODE,{begin:i}),_],illegal:/\[|%/},{begin:/\$[(.]/},t.METHOD_GUARD,{className:"class",beginKeywords:"class",end:/[{;=]/,excludeEnd:!0,illegal:/[:"\[\]]/,contains:[{beginKeywords:"extends"},t.UNDERSCORE_TITLE_MODE]},{beginKeywords:"constructor",end:/\{/,excludeEnd:!0},{begin:"(get|set)\\s+(?="+i+"\\()",end:/{/,keywords:"get set",contains:[t.inherit(t.TITLE_MODE,{begin:i}),{begin:/\(\)/},_]}],illegal:/#(?!!)/}}}()); +hljs.registerLanguage("json",function(){"use strict";return function(n){var e={literal:"true false null"},i=[n.C_LINE_COMMENT_MODE,n.C_BLOCK_COMMENT_MODE],t=[n.QUOTE_STRING_MODE,n.C_NUMBER_MODE],a={end:",",endsWithParent:!0,excludeEnd:!0,contains:t,keywords:e},l={begin:"{",end:"}",contains:[{className:"attr",begin:/"/,end:/"/,contains:[n.BACKSLASH_ESCAPE],illegal:"\\n"},n.inherit(a,{begin:/:/})].concat(i),illegal:"\\S"},s={begin:"\\[",end:"\\]",contains:[n.inherit(a)],illegal:"\\S"};return t.push(l,s),i.forEach((function(n){t.push(n)})),{name:"JSON",contains:t,keywords:e,illegal:"\\S"}}}()); +hljs.registerLanguage("kotlin",function(){"use strict";return function(e){var n={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},a={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},i={className:"subst",begin:"\\${",end:"}",contains:[e.C_NUMBER_MODE]},s={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},t={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[s,i]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,s,i]}]};i.contains.push(t);var r={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},l={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(t,{className:"meta-string"})]}]},c=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),o={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},d=o;return d.variants[1].contains=[o],o.variants[1].contains=[d],{name:"Kotlin",aliases:["kt"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,c,{className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},a,r,l,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,illegal:/fun\s+(<.*>)?[^\s\(]+(\s+[^\s\(]+)\s*=/,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin://,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[o,e.C_LINE_COMMENT_MODE,c],relevance:0},e.C_LINE_COMMENT_MODE,c,r,l,t,e.C_NUMBER_MODE]},c]},{className:"class",beginKeywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin://,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,]|$/,excludeBegin:!0,returnEnd:!0},r,l]},t,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:"\n"},{className:"number",begin:"\\b(0[bB]([01]+[01_]+[01]+|[01]+)|0[xX]([a-fA-F0-9]+[a-fA-F0-9_]+[a-fA-F0-9]+|[a-fA-F0-9]+)|(([\\d]+[\\d_]+[\\d]+|[\\d]+)(\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))?|\\.([\\d]+[\\d_]+[\\d]+|[\\d]+))([eE][-+]?\\d+)?)[lLfF]?",relevance:0}]}}}()); +hljs.registerLanguage("less",function(){"use strict";return function(e){var n="([\\w-]+|@{[\\w-]+})",a=[],s=[],t=function(e){return{className:"string",begin:"~?"+e+".*?"+e}},r=function(e,n,a){return{className:e,begin:n,relevance:a}},i={begin:"\\(",end:"\\)",contains:s,relevance:0};s.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t("'"),t('"'),e.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},r("number","#[0-9A-Fa-f]+\\b"),i,r("variable","@@?[\\w-]+",10),r("variable","@{[\\w-]+}"),r("built_in","~?`[^`]*?`"),{className:"attribute",begin:"[\\w-]+\\s*:",end:":",returnBegin:!0,excludeEnd:!0},{className:"meta",begin:"!important"});var c=s.concat({begin:"{",end:"}",contains:a}),l={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(s)},o={begin:n+"\\s*:",returnBegin:!0,end:"[;}]",relevance:0,contains:[{className:"attribute",begin:n,end:":",excludeEnd:!0,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:s}}]},g={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",returnEnd:!0,contains:s,relevance:0}},d={className:"variable",variants:[{begin:"@[\\w-]+\\s*:",relevance:15},{begin:"@[\\w-]+"}],starts:{end:"[;}]",returnEnd:!0,contains:c}},b={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:n,end:"{"}],returnBegin:!0,returnEnd:!0,illegal:"[<='$\"]",relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,l,r("keyword","all\\b"),r("variable","@{[\\w-]+}"),r("selector-tag",n+"%?",0),r("selector-id","#"+n),r("selector-class","\\."+n,0),r("selector-tag","&",0),{className:"selector-attr",begin:"\\[",end:"\\]"},{className:"selector-pseudo",begin:/:(:)?[a-zA-Z0-9\_\-\+\(\)"'.]+/},{begin:"\\(",end:"\\)",contains:c},{begin:"!important"}]};return a.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,g,d,o,b),{name:"Less",case_insensitive:!0,illegal:"[=>'/<($\"]",contains:a}}}()); +hljs.registerLanguage("lua",function(){"use strict";return function(e){var t={begin:"\\[=*\\[",end:"\\]=*\\]",contains:["self"]},a=[e.COMMENT("--(?!\\[=*\\[)","$"),e.COMMENT("--\\[=*\\[","\\]=*\\]",{contains:[t],relevance:10})];return{name:"Lua",keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:"\\[=*\\[",end:"\\]=*\\]",contains:[t],relevance:5}])}}}()); +hljs.registerLanguage("makefile",function(){"use strict";return function(e){var i={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,contains:[{className:"meta",begin:"",relevance:10,contains:[a,i,t,s,{begin:"\\[",end:"\\]",contains:[{className:"meta",begin:"",contains:[a,s,i,t]}]}]},e.COMMENT("\x3c!--","--\x3e",{relevance:10}),{begin:"<\\!\\[CDATA\\[",end:"\\]\\]>",relevance:10},n,{className:"meta",begin:/<\?xml/,end:/\?>/,relevance:10},{className:"tag",begin:")",end:">",keywords:{name:"style"},contains:[c],starts:{end:"",returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:")",end:">",keywords:{name:"script"},contains:[c],starts:{end:"<\/script>",returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:"",contains:[{className:"name",begin:/[^\/><\s]+/,relevance:0},c]}]}}}()); +hljs.registerLanguage("markdown",function(){"use strict";return function(n){const e={begin:"<",end:">",subLanguage:"xml",relevance:0},a={begin:"\\[.+?\\][\\(\\[].*?[\\)\\]]",returnBegin:!0,contains:[{className:"string",begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0,relevance:0},{className:"link",begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}],relevance:10},i={className:"strong",contains:[],variants:[{begin:/_{2}/,end:/_{2}/},{begin:/\*{2}/,end:/\*{2}/}]},s={className:"emphasis",contains:[],variants:[{begin:/\*(?!\*)/,end:/\*/},{begin:/_(?!_)/,end:/_/,relevance:0}]};i.contains.push(s),s.contains.push(i);var c=[e,a];return i.contains=i.contains.concat(c),s.contains=s.contains.concat(c),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:c=c.concat(i,s)},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:c}]}]},e,{className:"bullet",begin:"^[ \t]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},i,s,{className:"quote",begin:"^>\\s+",contains:c,end:"$"},{className:"code",variants:[{begin:"(`{3,})(.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})(.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},{begin:"^[-\\*]{3,}",end:"$"},a,{begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]}]}}}()); +hljs.registerLanguage("nginx",function(){"use strict";return function(e){var n={className:"variable",variants:[{begin:/\$\d+/},{begin:/\$\{/,end:/}/},{begin:"[\\$\\@]"+e.UNDERSCORE_IDENT_RE}]},a={endsWithParent:!0,keywords:{$pattern:"[a-z/_]+",literal:"on off yes no true false none blocked debug info notice warn error crit select break last permanent redirect kqueue rtsig epoll poll /dev/poll"},relevance:0,illegal:"=>",contains:[e.HASH_COMMENT_MODE,{className:"string",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:/"/,end:/"/},{begin:/'/,end:/'/}]},{begin:"([a-z]+):/",end:"\\s",endsWithParent:!0,excludeEnd:!0,contains:[n]},{className:"regexp",contains:[e.BACKSLASH_ESCAPE,n],variants:[{begin:"\\s\\^",end:"\\s|{|;",returnEnd:!0},{begin:"~\\*?\\s+",end:"\\s|{|;",returnEnd:!0},{begin:"\\*(\\.[a-z\\-]+)+"},{begin:"([a-z\\-]+\\.)+\\*"}]},{className:"number",begin:"\\b\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}(:\\d{1,5})?\\b"},{className:"number",begin:"\\b\\d+[kKmMgGdshdwy]*\\b",relevance:0},n]};return{name:"Nginx config",aliases:["nginxconf"],contains:[e.HASH_COMMENT_MODE,{begin:e.UNDERSCORE_IDENT_RE+"\\s+{",returnBegin:!0,end:"{",contains:[{className:"section",begin:e.UNDERSCORE_IDENT_RE}],relevance:0},{begin:e.UNDERSCORE_IDENT_RE+"\\s",end:";|{",returnBegin:!0,contains:[{className:"attribute",begin:e.UNDERSCORE_IDENT_RE,starts:a}],relevance:0}],illegal:"[^\\s\\}]"}}}()); +hljs.registerLanguage("objectivec",function(){"use strict";return function(e){var n=/[a-zA-Z@][a-zA-Z0-9_]*/,_={$pattern:n,keyword:"@interface @class @protocol @implementation"};return{name:"Objective-C",aliases:["mm","objc","obj-c"],keywords:{$pattern:n,keyword:"int float while char export sizeof typedef const struct for union unsigned long volatile static bool mutable if do return goto void enum else break extern asm case short default double register explicit signed typename this switch continue wchar_t inline readonly assign readwrite self @synchronized id typeof nonatomic super unichar IBOutlet IBAction strong weak copy in out inout bycopy byref oneway __strong __weak __block __autoreleasing @private @protected @public @try @property @end @throw @catch @finally @autoreleasepool @synthesize @dynamic @selector @optional @required @encode @package @import @defs @compatibility_alias __bridge __bridge_transfer __bridge_retained __bridge_retain __covariant __contravariant __kindof _Nonnull _Nullable _Null_unspecified __FUNCTION__ __PRETTY_FUNCTION__ __attribute__ getter setter retain unsafe_unretained nonnull nullable null_unspecified null_resettable class instancetype NS_DESIGNATED_INITIALIZER NS_UNAVAILABLE NS_REQUIRES_SUPER NS_RETURNS_INNER_POINTER NS_INLINE NS_AVAILABLE NS_DEPRECATED NS_ENUM NS_OPTIONS NS_SWIFT_UNAVAILABLE NS_ASSUME_NONNULL_BEGIN NS_ASSUME_NONNULL_END NS_REFINED_FOR_SWIFT NS_SWIFT_NAME NS_SWIFT_NOTHROW NS_DURING NS_HANDLER NS_ENDHANDLER NS_VALUERETURN NS_VOIDRETURN",literal:"false true FALSE TRUE nil YES NO NULL",built_in:"BOOL dispatch_once_t dispatch_queue_t dispatch_sync dispatch_async dispatch_once"},illegal:"/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+_.keyword.split(" ").join("|")+")\\b",end:"({|$)",excludeEnd:!0,keywords:_,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}}()); +hljs.registerLanguage("perl",function(){"use strict";return function(e){var n={$pattern:/[\w.]+/,keyword:"getpwent getservent quotemeta msgrcv scalar kill dbmclose undef lc ma syswrite tr send umask sysopen shmwrite vec qx utime local oct semctl localtime readpipe do return format read sprintf dbmopen pop getpgrp not getpwnam rewinddir qq fileno qw endprotoent wait sethostent bless s|0 opendir continue each sleep endgrent shutdown dump chomp connect getsockname die socketpair close flock exists index shmget sub for endpwent redo lstat msgctl setpgrp abs exit select print ref gethostbyaddr unshift fcntl syscall goto getnetbyaddr join gmtime symlink semget splice x|0 getpeername recv log setsockopt cos last reverse gethostbyname getgrnam study formline endhostent times chop length gethostent getnetent pack getprotoent getservbyname rand mkdir pos chmod y|0 substr endnetent printf next open msgsnd readdir use unlink getsockopt getpriority rindex wantarray hex system getservbyport endservent int chr untie rmdir prototype tell listen fork shmread ucfirst setprotoent else sysseek link getgrgid shmctl waitpid unpack getnetbyname reset chdir grep split require caller lcfirst until warn while values shift telldir getpwuid my getprotobynumber delete and sort uc defined srand accept package seekdir getprotobyname semop our rename seek if q|0 chroot sysread setpwent no crypt getc chown sqrt write setnetent setpriority foreach tie sin msgget map stat getlogin unless elsif truncate exec keys glob tied closedir ioctl socket readlink eval xor readline binmode setservent eof ord bind alarm pipe atan2 getgrent exp time push setgrent gt lt or ne m|0 break given say state when"},t={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:n},s={begin:"->{",end:"}"},r={variants:[{begin:/\$\d/},{begin:/[\$%@](\^\w\b|#\w+(::\w+)*|{\w+}|\w+(::\w*)*)/},{begin:/[\$%@][^\s\w{]/,relevance:0}]},i=[e.BACKSLASH_ESCAPE,t,r],a=[r,e.HASH_COMMENT_MODE,e.COMMENT("^\\=\\w","\\=cut",{endsWithParent:!0}),s,{className:"string",contains:i,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*\\<",end:"\\>",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:"{\\w+}",contains:[],relevance:0},{begin:"-?\\w+\\s*\\=\\>",contains:[],relevance:0}]},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",begin:"(s|tr|y)/(\\\\.|[^/])*/(\\\\.|[^/])*/[a-z]*",relevance:10},{className:"regexp",begin:"(m|qr)?/",end:"/[a-z]*",contains:[e.BACKSLASH_ESCAPE],relevance:0}]},{className:"function",beginKeywords:"sub",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return t.contains=a,s.contains=a,{name:"Perl",aliases:["pl","pm"],keywords:n,contains:a}}}()); +hljs.registerLanguage("php",function(){"use strict";return function(e){var r={begin:"\\$+[a-zA-Z_-ÿ][a-zA-Z0-9_-ÿ]*"},t={className:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?[=]?/},{begin:/\?>/}]},a={className:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},n=e.inherit(e.APOS_STRING_MODE,{illegal:null}),i=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),o=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*(\w+)\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(a)}),l={className:"string",contains:[e.BACKSLASH_ESCAPE,t],variants:[e.inherit(n,{begin:"b'",end:"'"}),e.inherit(i,{begin:'b"',end:'"'}),i,n,o]},s={variants:[e.BINARY_NUMBER_MODE,e.C_NUMBER_MODE]},c={keyword:"__CLASS__ __DIR__ __FILE__ __FUNCTION__ __LINE__ __METHOD__ __NAMESPACE__ __TRAIT__ die echo exit include include_once print require require_once array abstract and as binary bool boolean break callable case catch class clone const continue declare default do double else elseif empty enddeclare endfor endforeach endif endswitch endwhile eval extends final finally float for foreach from global goto if implements instanceof insteadof int integer interface isset iterable list new object or private protected public real return string switch throw trait try unset use var void while xor yield",literal:"false null true",built_in:"Error|0 AppendIterator ArgumentCountError ArithmeticError ArrayIterator ArrayObject AssertionError BadFunctionCallException BadMethodCallException CachingIterator CallbackFilterIterator CompileError Countable DirectoryIterator DivisionByZeroError DomainException EmptyIterator ErrorException Exception FilesystemIterator FilterIterator GlobIterator InfiniteIterator InvalidArgumentException IteratorIterator LengthException LimitIterator LogicException MultipleIterator NoRewindIterator OutOfBoundsException OutOfRangeException OuterIterator OverflowException ParentIterator ParseError RangeException RecursiveArrayIterator RecursiveCachingIterator RecursiveCallbackFilterIterator RecursiveDirectoryIterator RecursiveFilterIterator RecursiveIterator RecursiveIteratorIterator RecursiveRegexIterator RecursiveTreeIterator RegexIterator RuntimeException SeekableIterator SplDoublyLinkedList SplFileInfo SplFileObject SplFixedArray SplHeap SplMaxHeap SplMinHeap SplObjectStorage SplObserver SplObserver SplPriorityQueue SplQueue SplStack SplSubject SplSubject SplTempFileObject TypeError UnderflowException UnexpectedValueException ArrayAccess Closure Generator Iterator IteratorAggregate Serializable Throwable Traversable WeakReference Directory __PHP_Incomplete_Class parent php_user_filter self static stdClass"};return{aliases:["php","php3","php4","php5","php6","php7"],case_insensitive:!0,keywords:c,contains:[e.HASH_COMMENT_MODE,e.COMMENT("//","$",{contains:[t]}),e.COMMENT("/\\*","\\*/",{contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.COMMENT("__halt_compiler.+?;",!1,{endsWithParent:!0,keywords:"__halt_compiler"}),t,{className:"keyword",begin:/\$this\b/},r,{begin:/(::|->)+[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/},{className:"function",beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[e.UNDERSCORE_TITLE_MODE,{className:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:c,contains:["self",r,e.C_BLOCK_COMMENT_MODE,l,s]}]},{className:"class",beginKeywords:"class interface",end:"{",excludeEnd:!0,illegal:/[:\(\$"]/,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",end:";",illegal:/[\.']/,contains:[e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"use",end:";",contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"=>"},l,s]}}}()); +hljs.registerLanguage("php-template",function(){"use strict";return function(n){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},n.inherit(n.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),n.inherit(n.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}}()); +hljs.registerLanguage("plaintext",function(){"use strict";return function(t){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}}()); +hljs.registerLanguage("properties",function(){"use strict";return function(e){var n="[ \\t\\f]*",t="("+n+"[:=]"+n+"|[ \\t\\f]+)",a="([^\\\\:= \\t\\f\\n]|\\\\.)+",s={end:t,relevance:0,starts:{className:"string",end:/$/,relevance:0,contains:[{begin:"\\\\\\n"}]}};return{name:".properties",case_insensitive:!0,illegal:/\S/,contains:[e.COMMENT("^\\s*[!#]","$"),{begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+"+t,returnBegin:!0,contains:[{className:"attr",begin:"([^\\\\\\W:= \\t\\f\\n]|\\\\.)+",endsParent:!0,relevance:0}],starts:s},{begin:a+t,returnBegin:!0,relevance:0,contains:[{className:"meta",begin:a,endsParent:!0,relevance:0}],starts:s},{className:"attr",relevance:0,begin:a+n+"$"}]}}}()); +hljs.registerLanguage("python",function(){"use strict";return function(e){var n={keyword:"and elif is global as in if from raise for except finally print import pass return exec else break not with class assert yield try while continue del or def lambda async await nonlocal|10",built_in:"Ellipsis NotImplemented",literal:"False None True"},a={className:"meta",begin:/^(>>>|\.\.\.) /},i={className:"subst",begin:/\{/,end:/\}/,keywords:n,illegal:/#/},s={begin:/\{\{/,relevance:0},r={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/(u|b)?r?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(u|b)?r?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a],relevance:10},{begin:/(fr|rf|f)'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(fr|rf|f)"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,a,s,i]},{begin:/(u|r|ur)'/,end:/'/,relevance:10},{begin:/(u|r|ur)"/,end:/"/,relevance:10},{begin:/(b|br)'/,end:/'/},{begin:/(b|br)"/,end:/"/},{begin:/(fr|rf|f)'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,s,i]},{begin:/(fr|rf|f)"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,s,i]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},l={className:"number",relevance:0,variants:[{begin:e.BINARY_NUMBER_RE+"[lLjJ]?"},{begin:"\\b(0o[0-7]+)[lLjJ]?"},{begin:e.C_NUMBER_RE+"[lLjJ]?"}]},t={className:"params",variants:[{begin:/\(\s*\)/,skip:!0,className:null},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,contains:["self",a,l,r,e.HASH_COMMENT_MODE]}]};return i.contains=[r,l,a],{name:"Python",aliases:["py","gyp","ipython"],keywords:n,illegal:/(<\/|->|\?)|=>/,contains:[a,l,{beginKeywords:"if",relevance:0},r,e.HASH_COMMENT_MODE,{variants:[{className:"function",beginKeywords:"def"},{className:"class",beginKeywords:"class"}],end:/:/,illegal:/[${=;\n,]/,contains:[e.UNDERSCORE_TITLE_MODE,t,{begin:/->/,endsWithParent:!0,keywords:"None"}]},{className:"meta",begin:/^[\t ]*@/,end:/$/},{begin:/\b(print|exec)\(/}]}}}()); +hljs.registerLanguage("python-repl",function(){"use strict";return function(n){return{aliases:["pycon"],contains:[{className:"meta",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}}()); +hljs.registerLanguage("ruby",function(){"use strict";return function(e){var n="[a-zA-Z_]\\w*[!?=]?|[-+~]\\@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?",a={keyword:"and then defined module in return redo if BEGIN retry end for self when next until do begin unless END rescue else break undef not super class case require yield alias while ensure elsif or include attr_reader attr_writer attr_accessor",literal:"true false nil"},s={className:"doctag",begin:"@[A-Za-z]+"},i={begin:"#<",end:">"},r=[e.COMMENT("#","$",{contains:[s]}),e.COMMENT("^\\=begin","^\\=end",{contains:[s],relevance:10}),e.COMMENT("^__END__","\\n$")],c={className:"subst",begin:"#\\{",end:"}",keywords:a},t={className:"string",contains:[e.BACKSLASH_ESCAPE,c],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:"%[qQwWx]?\\(",end:"\\)"},{begin:"%[qQwWx]?\\[",end:"\\]"},{begin:"%[qQwWx]?{",end:"}"},{begin:"%[qQwWx]?<",end:">"},{begin:"%[qQwWx]?/",end:"/"},{begin:"%[qQwWx]?%",end:"%"},{begin:"%[qQwWx]?-",end:"-"},{begin:"%[qQwWx]?\\|",end:"\\|"},{begin:/\B\?(\\\d{1,3}|\\x[A-Fa-f0-9]{1,2}|\\u[A-Fa-f0-9]{4}|\\?\S)\b/},{begin:/<<[-~]?'?(\w+)(?:.|\n)*?\n\s*\1\b/,returnBegin:!0,contains:[{begin:/<<[-~]?'?/},e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,c]})]}]},b={className:"params",begin:"\\(",end:"\\)",endsParent:!0,keywords:a},d=[t,i,{className:"class",beginKeywords:"class module",end:"$|;",illegal:/=/,contains:[e.inherit(e.TITLE_MODE,{begin:"[A-Za-z_]\\w*(::\\w+)*(\\?|\\!)?"}),{begin:"<\\s*",contains:[{begin:"("+e.IDENT_RE+"::)?"+e.IDENT_RE}]}].concat(r)},{className:"function",beginKeywords:"def",end:"$|;",contains:[e.inherit(e.TITLE_MODE,{begin:n}),b].concat(r)},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(\\!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[t,{begin:n}],relevance:0},{className:"number",begin:"(\\b0[0-7_]+)|(\\b0x[0-9a-fA-F_]+)|(\\b[1-9][0-9_]*(\\.[0-9_]+)?)|[0_]\\b",relevance:0},{begin:"(\\$\\W)|((\\$|\\@\\@?)(\\w+))"},{className:"params",begin:/\|/,end:/\|/,keywords:a},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[i,{className:"regexp",contains:[e.BACKSLASH_ESCAPE,c],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:"%r{",end:"}[a-z]*"},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(r),relevance:0}].concat(r);c.contains=d,b.contains=d;var g=[{begin:/^\s*=>/,starts:{end:"$",contains:d}},{className:"meta",begin:"^([>?]>|[\\w#]+\\(\\w+\\):\\d+:\\d+>|(\\w+-)?\\d+\\.\\d+\\.\\d(p\\d+)?[^>]+>)",starts:{end:"$",contains:d}}];return{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:a,illegal:/\/\*/,contains:r.concat(g).concat(d)}}}()); +hljs.registerLanguage("rust",function(){"use strict";return function(e){var n="([ui](8|16|32|64|128|size)|f(32|64))?",t="drop i8 i16 i32 i64 i128 isize u8 u16 u32 u64 u128 usize f32 f64 str char bool Box Option Result String Vec Copy Send Sized Sync Drop Fn FnMut FnOnce ToOwned Clone Debug PartialEq PartialOrd Eq Ord AsRef AsMut Into From Default Iterator Extend IntoIterator DoubleEndedIterator ExactSizeIterator SliceConcatExt ToString assert! assert_eq! bitflags! bytes! cfg! col! concat! concat_idents! debug_assert! debug_assert_eq! env! panic! file! format! format_args! include_bin! include_str! line! local_data_key! module_path! option_env! print! println! select! stringify! try! unimplemented! unreachable! vec! write! writeln! macro_rules! assert_ne! debug_assert_ne!";return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",keyword:"abstract as async await become box break const continue crate do dyn else enum extern false final fn for if impl in let loop macro match mod move mut override priv pub ref return self Self static struct super trait true try type typeof unsafe unsized use virtual where while yield",literal:"true false Some None Ok Err",built_in:t},illegal:""}]}}}()); +hljs.registerLanguage("scss",function(){"use strict";return function(e){var t={className:"variable",begin:"(\\$[a-zA-Z-][a-zA-Z0-9_-]*)\\b"},i={className:"number",begin:"#[0-9A-Fa-f]+"};return e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,e.C_BLOCK_COMMENT_MODE,{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"selector-id",begin:"\\#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},{className:"selector-attr",begin:"\\[",end:"\\]",illegal:"$"},{className:"selector-tag",begin:"\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|command|datalist|dd|del|details|dfn|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|link|map|mark|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video)\\b",relevance:0},{className:"selector-pseudo",begin:":(visited|valid|root|right|required|read-write|read-only|out-range|optional|only-of-type|only-child|nth-of-type|nth-last-of-type|nth-last-child|nth-child|not|link|left|last-of-type|last-child|lang|invalid|indeterminate|in-range|hover|focus|first-of-type|first-line|first-letter|first-child|first|enabled|empty|disabled|default|checked|before|after|active)"},{className:"selector-pseudo",begin:"::(after|before|choices|first-letter|first-line|repeat-index|repeat-item|selection|value)"},t,{className:"attribute",begin:"\\b(src|z-index|word-wrap|word-spacing|word-break|width|widows|white-space|visibility|vertical-align|unicode-bidi|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform|top|text-underline-position|text-transform|text-shadow|text-rendering|text-overflow|text-indent|text-decoration-style|text-decoration-line|text-decoration-color|text-decoration|text-align-last|text-align|tab-size|table-layout|right|resize|quotes|position|pointer-events|perspective-origin|perspective|page-break-inside|page-break-before|page-break-after|padding-top|padding-right|padding-left|padding-bottom|padding|overflow-y|overflow-x|overflow-wrap|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|order|opacity|object-position|object-fit|normal|none|nav-up|nav-right|nav-left|nav-index|nav-down|min-width|min-height|max-width|max-height|mask|marks|margin-top|margin-right|margin-left|margin-bottom|margin|list-style-type|list-style-position|list-style-image|list-style|line-height|letter-spacing|left|justify-content|initial|inherit|ime-mode|image-orientation|image-resolution|image-rendering|icon|hyphens|height|font-weight|font-variant-ligatures|font-variant|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|float|flex-wrap|flex-shrink|flex-grow|flex-flow|flex-direction|flex-basis|flex|filter|empty-cells|display|direction|cursor|counter-reset|counter-increment|content|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|columns|color|clip-path|clip|clear|caption-side|break-inside|break-before|break-after|box-sizing|box-shadow|box-decoration-break|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-left-width|border-left-style|border-left-color|border-left|border-image-width|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-attachment|background-blend-mode|background|backface-visibility|auto|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|align-self|align-items|align-content)\\b",illegal:"[^\\s]"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:":",end:";",contains:[t,i,e.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"meta",begin:"!important"}]},{begin:"@(page|font-face)",lexemes:"@[a-z-]+",keywords:"@page @font-face"},{begin:"@",end:"[{;]",returnBegin:!0,keywords:"and or not only",contains:[{begin:"@[a-z-]+",className:"keyword"},t,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,i,e.CSS_NUMBER_MODE]}]}}}()); +hljs.registerLanguage("shell",function(){"use strict";return function(s){return{name:"Shell Session",aliases:["console"],contains:[{className:"meta",begin:"^\\s{0,3}[/\\w\\d\\[\\]()@-]*[>%$#]",starts:{end:"$",subLanguage:"bash"}}]}}}()); +hljs.registerLanguage("sql",function(){"use strict";return function(e){var t=e.COMMENT("--","$");return{name:"SQL",case_insensitive:!0,illegal:/[<>{}*]/,contains:[{beginKeywords:"begin end start commit rollback savepoint lock alter create drop rename call delete do handler insert load replace select truncate update set show pragma grant merge describe use explain help declare prepare execute deallocate release unlock purge reset change stop analyze cache flush optimize repair kill install uninstall checksum restore check backup revoke comment values with",end:/;/,endsWithParent:!0,keywords:{$pattern:/[\w\.]+/,keyword:"as abort abs absolute acc acce accep accept access accessed accessible account acos action activate add addtime admin administer advanced advise aes_decrypt aes_encrypt after agent aggregate ali alia alias all allocate allow alter always analyze ancillary and anti any anydata anydataset anyschema anytype apply archive archived archivelog are as asc ascii asin assembly assertion associate asynchronous at atan atn2 attr attri attrib attribu attribut attribute attributes audit authenticated authentication authid authors auto autoallocate autodblink autoextend automatic availability avg backup badfile basicfile before begin beginning benchmark between bfile bfile_base big bigfile bin binary_double binary_float binlog bit_and bit_count bit_length bit_or bit_xor bitmap blob_base block blocksize body both bound bucket buffer_cache buffer_pool build bulk by byte byteordermark bytes cache caching call calling cancel capacity cascade cascaded case cast catalog category ceil ceiling chain change changed char_base char_length character_length characters characterset charindex charset charsetform charsetid check checksum checksum_agg child choose chr chunk class cleanup clear client clob clob_base clone close cluster_id cluster_probability cluster_set clustering coalesce coercibility col collate collation collect colu colum column column_value columns columns_updated comment commit compact compatibility compiled complete composite_limit compound compress compute concat concat_ws concurrent confirm conn connec connect connect_by_iscycle connect_by_isleaf connect_by_root connect_time connection consider consistent constant constraint constraints constructor container content contents context contributors controlfile conv convert convert_tz corr corr_k corr_s corresponding corruption cos cost count count_big counted covar_pop covar_samp cpu_per_call cpu_per_session crc32 create creation critical cross cube cume_dist curdate current current_date current_time current_timestamp current_user cursor curtime customdatum cycle data database databases datafile datafiles datalength date_add date_cache date_format date_sub dateadd datediff datefromparts datename datepart datetime2fromparts day day_to_second dayname dayofmonth dayofweek dayofyear days db_role_change dbtimezone ddl deallocate declare decode decompose decrement decrypt deduplicate def defa defau defaul default defaults deferred defi defin define degrees delayed delegate delete delete_all delimited demand dense_rank depth dequeue des_decrypt des_encrypt des_key_file desc descr descri describ describe descriptor deterministic diagnostics difference dimension direct_load directory disable disable_all disallow disassociate discardfile disconnect diskgroup distinct distinctrow distribute distributed div do document domain dotnet double downgrade drop dumpfile duplicate duration each edition editionable editions element ellipsis else elsif elt empty enable enable_all enclosed encode encoding encrypt end end-exec endian enforced engine engines enqueue enterprise entityescaping eomonth error errors escaped evalname evaluate event eventdata events except exception exceptions exchange exclude excluding execu execut execute exempt exists exit exp expire explain explode export export_set extended extent external external_1 external_2 externally extract failed failed_login_attempts failover failure far fast feature_set feature_value fetch field fields file file_name_convert filesystem_like_logging final finish first first_value fixed flash_cache flashback floor flush following follows for forall force foreign form forma format found found_rows freelist freelists freepools fresh from from_base64 from_days ftp full function general generated get get_format get_lock getdate getutcdate global global_name globally go goto grant grants greatest group group_concat group_id grouping grouping_id groups gtid_subtract guarantee guard handler hash hashkeys having hea head headi headin heading heap help hex hierarchy high high_priority hosts hour hours http id ident_current ident_incr ident_seed identified identity idle_time if ifnull ignore iif ilike ilm immediate import in include including increment index indexes indexing indextype indicator indices inet6_aton inet6_ntoa inet_aton inet_ntoa infile initial initialized initially initrans inmemory inner innodb input insert install instance instantiable instr interface interleaved intersect into invalidate invisible is is_free_lock is_ipv4 is_ipv4_compat is_not is_not_null is_used_lock isdate isnull isolation iterate java join json json_exists keep keep_duplicates key keys kill language large last last_day last_insert_id last_value lateral lax lcase lead leading least leaves left len lenght length less level levels library like like2 like4 likec limit lines link list listagg little ln load load_file lob lobs local localtime localtimestamp locate locator lock locked log log10 log2 logfile logfiles logging logical logical_reads_per_call logoff logon logs long loop low low_priority lower lpad lrtrim ltrim main make_set makedate maketime managed management manual map mapping mask master master_pos_wait match matched materialized max maxextents maximize maxinstances maxlen maxlogfiles maxloghistory maxlogmembers maxsize maxtrans md5 measures median medium member memcompress memory merge microsecond mid migration min minextents minimum mining minus minute minutes minvalue missing mod mode model modification modify module monitoring month months mount move movement multiset mutex name name_const names nan national native natural nav nchar nclob nested never new newline next nextval no no_write_to_binlog noarchivelog noaudit nobadfile nocheck nocompress nocopy nocycle nodelay nodiscardfile noentityescaping noguarantee nokeep nologfile nomapping nomaxvalue nominimize nominvalue nomonitoring none noneditionable nonschema noorder nopr nopro noprom nopromp noprompt norely noresetlogs noreverse normal norowdependencies noschemacheck noswitch not nothing notice notnull notrim novalidate now nowait nth_value nullif nulls num numb numbe nvarchar nvarchar2 object ocicoll ocidate ocidatetime ociduration ociinterval ociloblocator ocinumber ociref ocirefcursor ocirowid ocistring ocitype oct octet_length of off offline offset oid oidindex old on online only opaque open operations operator optimal optimize option optionally or oracle oracle_date oradata ord ordaudio orddicom orddoc order ordimage ordinality ordvideo organization orlany orlvary out outer outfile outline output over overflow overriding package pad parallel parallel_enable parameters parent parse partial partition partitions pascal passing password password_grace_time password_lock_time password_reuse_max password_reuse_time password_verify_function patch path patindex pctincrease pctthreshold pctused pctversion percent percent_rank percentile_cont percentile_disc performance period period_add period_diff permanent physical pi pipe pipelined pivot pluggable plugin policy position post_transaction pow power pragma prebuilt precedes preceding precision prediction prediction_cost prediction_details prediction_probability prediction_set prepare present preserve prior priority private private_sga privileges procedural procedure procedure_analyze processlist profiles project prompt protection public publishingservername purge quarter query quick quiesce quota quotename radians raise rand range rank raw read reads readsize rebuild record records recover recovery recursive recycle redo reduced ref reference referenced references referencing refresh regexp_like register regr_avgx regr_avgy regr_count regr_intercept regr_r2 regr_slope regr_sxx regr_sxy reject rekey relational relative relaylog release release_lock relies_on relocate rely rem remainder rename repair repeat replace replicate replication required reset resetlogs resize resource respect restore restricted result result_cache resumable resume retention return returning returns reuse reverse revoke right rlike role roles rollback rolling rollup round row row_count rowdependencies rowid rownum rows rtrim rules safe salt sample save savepoint sb1 sb2 sb4 scan schema schemacheck scn scope scroll sdo_georaster sdo_topo_geometry search sec_to_time second seconds section securefile security seed segment select self semi sequence sequential serializable server servererror session session_user sessions_per_user set sets settings sha sha1 sha2 share shared shared_pool short show shrink shutdown si_averagecolor si_colorhistogram si_featurelist si_positionalcolor si_stillimage si_texture siblings sid sign sin size size_t sizes skip slave sleep smalldatetimefromparts smallfile snapshot some soname sort soundex source space sparse spfile split sql sql_big_result sql_buffer_result sql_cache sql_calc_found_rows sql_small_result sql_variant_property sqlcode sqldata sqlerror sqlname sqlstate sqrt square standalone standby start starting startup statement static statistics stats_binomial_test stats_crosstab stats_ks_test stats_mode stats_mw_test stats_one_way_anova stats_t_test_ stats_t_test_indep stats_t_test_one stats_t_test_paired stats_wsr_test status std stddev stddev_pop stddev_samp stdev stop storage store stored str str_to_date straight_join strcmp strict string struct stuff style subdate subpartition subpartitions substitutable substr substring subtime subtring_index subtype success sum suspend switch switchoffset switchover sync synchronous synonym sys sys_xmlagg sysasm sysaux sysdate sysdatetimeoffset sysdba sysoper system system_user sysutcdatetime table tables tablespace tablesample tan tdo template temporary terminated tertiary_weights test than then thread through tier ties time time_format time_zone timediff timefromparts timeout timestamp timestampadd timestampdiff timezone_abbr timezone_minute timezone_region to to_base64 to_date to_days to_seconds todatetimeoffset trace tracking transaction transactional translate translation treat trigger trigger_nestlevel triggers trim truncate try_cast try_convert try_parse type ub1 ub2 ub4 ucase unarchived unbounded uncompress under undo unhex unicode uniform uninstall union unique unix_timestamp unknown unlimited unlock unnest unpivot unrecoverable unsafe unsigned until untrusted unusable unused update updated upgrade upped upper upsert url urowid usable usage use use_stored_outlines user user_data user_resources users using utc_date utc_timestamp uuid uuid_short validate validate_password_strength validation valist value values var var_samp varcharc vari varia variab variabl variable variables variance varp varraw varrawc varray verify version versions view virtual visible void wait wallet warning warnings week weekday weekofyear wellformed when whene whenev wheneve whenever where while whitespace window with within without work wrapped xdb xml xmlagg xmlattributes xmlcast xmlcolattval xmlelement xmlexists xmlforest xmlindex xmlnamespaces xmlpi xmlquery xmlroot xmlschema xmlserialize xmltable xmltype xor year year_to_month years yearweek",literal:"true false null unknown",built_in:"array bigint binary bit blob bool boolean char character date dec decimal float int int8 integer interval number numeric real record serial serial8 smallint text time timestamp tinyint varchar varchar2 varying void"},contains:[{className:"string",begin:"'",end:"'",contains:[{begin:"''"}]},{className:"string",begin:'"',end:'"',contains:[{begin:'""'}]},{className:"string",begin:"`",end:"`"},e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,t,e.HASH_COMMENT_MODE]},e.C_BLOCK_COMMENT_MODE,t,e.HASH_COMMENT_MODE]}}}()); +hljs.registerLanguage("swift",function(){"use strict";return function(e){var i={keyword:"#available #colorLiteral #column #else #elseif #endif #file #fileLiteral #function #if #imageLiteral #line #selector #sourceLocation _ __COLUMN__ __FILE__ __FUNCTION__ __LINE__ Any as as! as? associatedtype associativity break case catch class continue convenience default defer deinit didSet do dynamic dynamicType else enum extension fallthrough false fileprivate final for func get guard if import in indirect infix init inout internal is lazy left let mutating nil none nonmutating open operator optional override postfix precedence prefix private protocol Protocol public repeat required rethrows return right self Self set static struct subscript super switch throw throws true try try! try? Type typealias unowned var weak where while willSet",literal:"true false nil",built_in:"abs advance alignof alignofValue anyGenerator assert assertionFailure bridgeFromObjectiveC bridgeFromObjectiveCUnconditional bridgeToObjectiveC bridgeToObjectiveCUnconditional c compactMap contains count countElements countLeadingZeros debugPrint debugPrintln distance dropFirst dropLast dump encodeBitsAsWords enumerate equal fatalError filter find getBridgedObjectiveCType getVaList indices insertionSort isBridgedToObjectiveC isBridgedVerbatimToObjectiveC isUniquelyReferenced isUniquelyReferencedNonObjC join lazy lexicographicalCompare map max maxElement min minElement numericCast overlaps partition posix precondition preconditionFailure print println quickSort readLine reduce reflect reinterpretCast reverse roundUpToAlignment sizeof sizeofValue sort split startsWith stride strideof strideofValue swap toString transcode underestimateCount unsafeAddressOf unsafeBitCast unsafeDowncast unsafeUnwrap unsafeReflect withExtendedLifetime withObjectAtPlusZero withUnsafePointer withUnsafePointerToObject withUnsafeMutablePointer withUnsafeMutablePointers withUnsafePointer withUnsafePointers withVaList zip"},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),t={className:"subst",begin:/\\\(/,end:"\\)",keywords:i,contains:[]},a={className:"string",contains:[e.BACKSLASH_ESCAPE,t],variants:[{begin:/"""/,end:/"""/},{begin:/"/,end:/"/}]},r={className:"number",begin:"\\b([\\d_]+(\\.[\\deE_]+)?|0x[a-fA-F0-9_]+(\\.[a-fA-F0-9p_]+)?|0b[01_]+|0o[0-7_]+)\\b",relevance:0};return t.contains=[r],{name:"Swift",keywords:i,contains:[a,e.C_LINE_COMMENT_MODE,n,{className:"type",begin:"\\b[A-Z][\\wÀ-ʸ']*[!?]"},{className:"type",begin:"\\b[A-Z][\\wÀ-ʸ']*",relevance:0},r,{className:"function",beginKeywords:"func",end:"{",excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][0-9A-Za-z$_]*/}),{begin://},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:i,contains:["self",r,a,e.C_BLOCK_COMMENT_MODE,{begin:":"}],illegal:/["']/}],illegal:/\[|%/},{className:"class",beginKeywords:"struct protocol class extension enum",keywords:i,end:"\\{",excludeEnd:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/[A-Za-z$_][\u00C0-\u02B80-9A-Za-z$_]*/})]},{className:"meta",begin:"(@discardableResult|@warn_unused_result|@exported|@lazy|@noescape|@NSCopying|@NSManaged|@objc|@objcMembers|@convention|@required|@noreturn|@IBAction|@IBDesignable|@IBInspectable|@IBOutlet|@infix|@prefix|@postfix|@autoclosure|@testable|@available|@nonobjc|@NSApplicationMain|@UIApplicationMain|@dynamicMemberLookup|@propertyWrapper)\\b"},{beginKeywords:"import",end:/$/,contains:[e.C_LINE_COMMENT_MODE,n]}]}}}()); +hljs.registerLanguage("typescript",function(){"use strict";const e=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends"],n=["true","false","null","undefined","NaN","Infinity"],a=[].concat(["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],["arguments","this","super","console","window","document","localStorage","module","global"],["Intl","DataView","Number","Math","Date","String","RegExp","Object","Function","Boolean","Error","Symbol","Set","Map","WeakSet","WeakMap","Proxy","Reflect","JSON","Promise","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Float32Array","Array","Uint8Array","Uint8ClampedArray","ArrayBuffer"],["EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"]);return function(r){var t={$pattern:"[A-Za-z$_][0-9A-Za-z$_]*",keyword:e.concat(["type","namespace","typedef","interface","public","private","protected","implements","declare","abstract","readonly"]).join(" "),literal:n.join(" "),built_in:a.concat(["any","void","number","boolean","string","object","never","enum"]).join(" ")},s={className:"meta",begin:"@[A-Za-z$_][0-9A-Za-z$_]*"},i={className:"number",variants:[{begin:"\\b(0[bB][01]+)n?"},{begin:"\\b(0[oO][0-7]+)n?"},{begin:r.C_NUMBER_RE+"n?"}],relevance:0},o={className:"subst",begin:"\\$\\{",end:"\\}",keywords:t,contains:[]},c={begin:"html`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,o],subLanguage:"xml"}},l={begin:"css`",end:"",starts:{end:"`",returnEnd:!1,contains:[r.BACKSLASH_ESCAPE,o],subLanguage:"css"}},E={className:"string",begin:"`",end:"`",contains:[r.BACKSLASH_ESCAPE,o]};o.contains=[r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,c,l,E,i,r.REGEXP_MODE];var d={begin:"\\(",end:/\)/,keywords:t,contains:["self",r.QUOTE_STRING_MODE,r.APOS_STRING_MODE,r.NUMBER_MODE]},u={className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:[r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,s,d]};return{name:"TypeScript",aliases:["ts"],keywords:t,contains:[r.SHEBANG(),{className:"meta",begin:/^\s*['"]use strict['"]/},r.APOS_STRING_MODE,r.QUOTE_STRING_MODE,c,l,E,r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,i,{begin:"("+r.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",contains:[r.C_LINE_COMMENT_MODE,r.C_BLOCK_COMMENT_MODE,r.REGEXP_MODE,{className:"function",begin:"(\\([^(]*(\\([^(]*(\\([^(]*\\))?\\))?\\)|"+r.UNDERSCORE_IDENT_RE+")\\s*=>",returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:r.UNDERSCORE_IDENT_RE},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:t,contains:d.contains}]}]}],relevance:0},{className:"function",beginKeywords:"function",end:/[\{;]/,excludeEnd:!0,keywords:t,contains:["self",r.inherit(r.TITLE_MODE,{begin:"[A-Za-z$_][0-9A-Za-z$_]*"}),u],illegal:/%/,relevance:0},{beginKeywords:"constructor",end:/[\{;]/,excludeEnd:!0,contains:["self",u]},{begin:/module\./,keywords:{built_in:"module"},relevance:0},{beginKeywords:"module",end:/\{/,excludeEnd:!0},{beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:"interface extends"},{begin:/\$[(.]/},{begin:"\\."+r.IDENT_RE,relevance:0},s,d]}}}()); +hljs.registerLanguage("yaml",function(){"use strict";return function(e){var n="true false yes no null",a="[\\w#;/?:@&=+$,.~*\\'()[\\]]+",s={className:"string",relevance:0,variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,{className:"template-variable",variants:[{begin:"{{",end:"}}"},{begin:"%{",end:"}"}]}]},i=e.inherit(s,{variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),l={end:",",endsWithParent:!0,excludeEnd:!0,contains:[],keywords:n,relevance:0},t={begin:"{",end:"}",contains:[l],illegal:"\\n",relevance:0},g={begin:"\\[",end:"\\]",contains:[l],illegal:"\\n",relevance:0},b=[{className:"attr",variants:[{begin:"\\w[\\w :\\/.-]*:(?=[ \t]|$)"},{begin:'"\\w[\\w :\\/.-]*":(?=[ \t]|$)'},{begin:"'\\w[\\w :\\/.-]*':(?=[ \t]|$)"}]},{className:"meta",begin:"^---s*$",relevance:10},{className:"string",begin:"[\\|>]([0-9]?[+-])?[ ]*\\n( *)[\\S ]+\\n(\\2[\\S ]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+a},{className:"type",begin:"!<"+a+">"},{className:"type",begin:"!"+a},{className:"type",begin:"!!"+a},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"\\-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},{className:"number",begin:"\\b[0-9]{4}(-[0-9][0-9]){0,2}([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?(\\.[0-9]*)?([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?\\b"},{className:"number",begin:e.C_NUMBER_RE+"\\b"},t,g,s],c=[...b];return c.pop(),c.push(i),l.contains=c,{name:"YAML",case_insensitive:!0,aliases:["yml","YAML"],contains:b}}}()); \ No newline at end of file diff --git a/public/blog/20210620-siheomeul-iljuil-apdugo/index.html b/public/blog/20210620-siheomeul-iljuil-apdugo/index.html new file mode 100644 index 0000000..2ad0dad --- /dev/null +++ b/public/blog/20210620-siheomeul-iljuil-apdugo/index.html @@ -0,0 +1,281 @@ + + + + + + + + +시험을 일주일 앞두고 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 시험을 일주일 앞두고 +

+ + +
+
+

지금까지 내 인생에서 가장 중요한 시험. 그 시험이 일부일 앞으로 다가왔다. 하루종일 시험공부 비슷한걸 하면서 심신이 지쳐 더 이상 집중을 할 수 없을 것 같다. 이제 이 고비만 넘기면 인생에서 가장 날아다닌다는 시기, 대학생이 된다. 앞으로 뭘 하고 살아야 할지, 무엇을 하고 싶은지, 내가 아는 게 많아지고 현실을 깨달으면서 철이 드니 생각이 복잡해지고 앞길이 막막하기만 하다.

+

몇일 전, 작년에 대학 원서 자기소개서를 다시 읽다 보니 내가 아는 게 많아졌음을 새삼 깨달았다. SW나 해킹이나 반도체에 대해 몇달동안 파고 들어 공부하고, 조사하고 생각하다 보니 전에보다 더 자세하게, 깊게 알게 되었고, 예전과는 살짝 다른 생각을 하게 되었다. 예전에는 마냥 컴퓨터공학이나 해킹이 하고 싶었던 반면 지금은 더 자세하게 무엇이 하고 싶은지에 대한 목록을 작성할 수 있게 되었다. 각종 주제에 대해서도 흥미를 갖게 되었고 특히 예전에는 그냥 넘어갔던 책들을 다시 읽어보고 싶어졌다. 앎에 대한 욕구가 끝없이 증가해 버렸다. 지금 교보문고에 있는 읽고싶은 책들만 합해도 100만원이 넘어가니 말이다.

+

아마 올해 자기소개서를 쓸 때에는 정말 깔끔하고 자세한 자기소개서를 쓸 수 있지 않을까 싶다. 개발자 이력서 쓰는 법이나 회사 취직에 관한 글을 꽤 읽었으니 기술적으로도 단정한 글이 되지 않을까 싶다. 항상 느끼는 것이, 이건 대학 자소서 준비인지 아니면 그냥 개발자의 자기소개서인지 의문이 든다. 그럴 정도로 기술적인 내용을 많이 집어넣는데, 이게 과학고생의 글인지 아니면 디미고 같은 개발중점 학교 학생의 글인지 햇갈린다.

+

짧은 회고록이 되었지만 2주 후, 자소서를 쓰고 있을 나를 상상하니 빨리 지나갔으면 좋겠다는 생각밖에 들지 않는다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/2022041406/index.html b/public/blog/2022041406/index.html new file mode 100644 index 0000000..4881a7c --- /dev/null +++ b/public/blog/2022041406/index.html @@ -0,0 +1,285 @@ + + + + + + + + +선택실패 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 선택실패 +

+ + +
+
+

고등학교 3학년 때까지만 해도 나는 무조건 컴퓨터 공학과나 전기전자 공학과. 학과만 보고 대학교에 진학하리라 마음먹었었다. 진짜 학교 이름은 절대 보지 않을 것이라 생각했다. 하지만 막상 입시에 처하고 선택의 갈림길에 있으니 그 다짐은 물거품이 되었다.

+

역시나, 아니나 다를까 원서 접수 기간이 되니 진로 담당 선생님은 실적을 위해 상위 대학교의 낮은 학과에 원서를 넣어볼 것을 추천하셨다. 말이 추천이지 반 강제로 넣게 되었다. 아무런 관심도 없었고, 3년동안 생각도 없었는데다 자기소개서도 짜맞춰야 쓸 수 있는 학과에 지원했다. 붙어도 안간다는 생각으로. 하지만 내가 희망했던 대학을 떨어지고, 상위 학교 하위 학과와 하위 학교 자유 학과중에 선택해야 했다. 내가 3년동안 해왔던 것과 내가 무엇을 하고 싶은지를 생각해 본다면 당연히 학과를 보고 진학을 해야 했었는데, 막상 상위 학교의 합격증을 받으니 당연히 마음 한켠에서는 이걸 버린다고?!?라는 마음이 있었고, 그 마음에 휘둘려 등록예치금을 보낸다. 아직 등록 기간이 남았으니 등록 취소를 해도 되겠지만, 사실상 마음을 다잡은 것이나 마찬가지였다. 등록금 환불 신청서까지 적어놓고 책상에 올려두었다. 도장과 보호자 서명까지 받아놓고 고민했다. 후회하지 않을까? 어느 쪽으로 가나 조금 다니고 후회하게 될텐데, 학교를 후회하는게 학과를 후회하는 것보다 더 심하지 않을까 생각해 결국 그대로 원서는 놔둔 채 날이 넘어간다. 날짜가 넘어가는 걸 보고 얼마나 힘이 풀렸는지 모르겠다. 이제는 돌이킬 수 없구나.

+

그런 선택을 한 후 몇일간은 대학교 이름에 심취해 우리 학과도 선녀처럼 보였다. 전망 좋은 공과 학과로만 보였다. 하지만 시간이 지나면서 심취해 있던 생각이 풀리기 시작했고, 학과의 현실을 마주하기 시작하면서 후회가 밀려왔다. 서양에서는 주로 취급하지도 않는 사양산업의 책임으로만 끌고 온 이름만 대학인 학과. 이게 우리 조선해양 공학과의 현실이었고, 미래였다. 미래도 없는 학과. 이런 학과인줄 알고는 있었다. 하지만 실제 전공 수업을 들으면서 더욱이 실감났다. 왜 이런 학교에 와서 이딴 옛날 정보를 배워야 하는가. 왜 교수님은 열등감에 산업을 과장하고 잘 될거라고 세뇌하고 애원하듯이 수업을 하실까. 그 정도로 사양산업의 학과라는 것을 깨닫게 되었고, 탈출을 결심했다.

+

결국 탈출을 결심하게 될 줄은 알았다. 반수를 하던, 유학을 결심하던, 군대를 가던 어떻게든 이런 현실을 벗어나고자 하게 될 것이란 것을 알고 있었다. 학교도 내가 생각했던 것처럼 엄청 막 좋은 곳은 마냥 아니었다. 역사가 오래되어 뿌리깊은 명문이지만 보수적 교육과 보수적 관념 그 자체인 학교인 듯 했다. 대학교 수업은 고등학교의 주입식 교육 그 연장선 뿐이었다. 많은 것에 너무 큰 상실감을 느꼈다. 학과에서도, 학교에서도. 그래서 결국 대한민국 교육의 한계인가 싶었다. 대학교도 같은 처지의 교육이구나 했다.

+

지금 학과에 대한 열등감으로 그렇게 느끼는 것일 수도 있다. 하지만 만약 ‘학과’때문에 학교도 그렇게 느껴진다면 그만큼 그 학과에 문제가 크다는 것이 아닐까?

+

난 유학을 결심했다.

+

대한민국의 교육을 벗어나고 싶다. 아직 기초를 공부하는 입장으로서 얼만큼의 주입식인 필요하다는 것은 인정한다. 하지만 이것이 대학원까지 이어지고 심지어 그 이상에도 이어지는 교육 체계와 대학 교수들 아래에서 배우고 싶지 않다. 난 이루고 싶은 꿈과 하고 싶은 일, 애타게 배우고 싶은 것이 있다. 지금까지 내가 노력할 수 있었던 사명감이라 할 수도 있다. 이것이 깨져버린 이상, 그리고 여기서 계속 공부를 이어나가는 이상 내 꿈은 영원히 짓밟힐 것이다. 지금 여기에는 어떤 수를 써도 그것을 이룰 수 있는 길은 없다고 생각한다. 누구는 회피라 할테지만, 난 여기에서는 내가 할 수 있는 능력의 최선을 다했다고 생각한다. 과거를 후회하면서 이뿐인 자리에 있느니, 차라리 이 현실을 회피해 새 길을 열어나가련다.

+

제일 중요한 것은 이것이 지금 하기 싫은 일에 대한 회피가 목적이 되어 버리면 안된다는 것이다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/attitude-for-criticism/index.html b/public/blog/attitude-for-criticism/index.html new file mode 100644 index 0000000..3826486 --- /dev/null +++ b/public/blog/attitude-for-criticism/index.html @@ -0,0 +1,285 @@ + + + + + + + + +Attitude for criticism | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ Attitude for criticism +

+ + +
+
+

요즘 우리 학교에 학교를 개혁하겠다는 학생회장이 나타나고 나서부터 친구들이 학교에 대한 여러 가지 불만들을 풀어내기 시작했다. 나도 마찬가지로 학교에 대한 여러 가지 불만사항들이 많았다. 나는 매 학기마다 개정된 학교 교칙이나 규정들을 정독하는 이벤트를 가지는데, 그때마다 항상 ‘아, 학생들이 당연히 너무 불리하다..’ 라던가, ‘이 조항은 너무 아닌데, 너무 구시대적인 생각이 아닌가?‘라는 생각이 들기도 한다.

+

대학을 가야하는 시기라서 여러 학교들의 생활이나 공부방법, 대학 진학 상황들에 대해서 더욱 관심을 가지게 되었다. 특히 전국급 자사고나 타 지역 과학고의 생활과 공부습관? 등에 대해서 많이 조사(나무위키 정독)해보았는데, 한 가지 우리 학교랑 공통으로 비교되는 것이 있었다. 점점 상승세를 보이거나, 기존부터 진학 상황이 좋았던 학교들은 당연히 공부에 대해 많이 엄격하다. 하지만, 엄격한 만큼 그것에 대한 보상이나 회유에 대한 것도 많았다. 기숙사에서의 자유는 보장해준다던지, 상담실을 운영한다던지, 혹은 실제로 보상을 해 주는 경우도 있고, 진짜 자유시간을 주는 경우도 있다.

+

우리 학교를 살아가면서 몸이 망가지도 마음이 지쳐가는 것을 확실히 느낄 수 있었다. 100명, 혹은 60명 정도의 소수의 인원이 3년 동안 계속 붙어서 살아간다고 한다면, 아무리 성격이 좋아도 인간관계에 대한 스트레스가 한두 번 쌓이는 것이 아닐 것이다. 또한, 이 열악한 환경 속에서 내신이라는 것에 의해 끝까지 몰아붙여져서, 틈도 없이 공부를 해야 한다는 현실이 피부에 와 닿았다. 우리가 이렇게 말한다면 반대쪽에서는 이렇게 반발할 것이다. 친구관계는 선생님과 상담해보고, 또 스트레스는 격주로 집에 갈 때 해소해도 되고.. 근데 실제로 하는 거 보면 쉴 틈이 많이 있는데, 왜 그렇게 호들갑을 떠느냐고.

+

학생의 생활에 관해서나 우리나라 입시제도에 의한 학생들의 스트레스에 대하여, 학생들의 편의를 위해서 학생들이 단체로 학교에 청원을 하거나 개선을 요구하면, 학교는 그 요구를 결국에는 들어줄 수 밖에 없다. 학교는 결국 학생이 주체이고, 학교를 믿고 학생을 맡긴 학부모가 있기 때문이다. 교직원들도 결국에는 한 가정의 일원이다. 학생들이 요구한 것에 대해 미성년자라서 잘 진행되지 않는다? 그러면 학부모회도 있고, 교육청도 있다. 아니면, 가장 확실한 방법으로 학생 대표가 교장선생님께 직접 찾아는 방법도 있다. 교장은 모든 교직원이 속해있는 학교의 ‘장’이니까.

+

하지만 우리가 하는 이야기는 성립되지 않는다. 특히 내가 하는 이야기도 성립하지 않는다. 우리, 또는 내가 학교에 대해 비판을 하고, 그 개선을 요구하기 위해서 대개는 그 조건이 충족되지 못했기 때문이다. 인도의 소금 행진, 홍콩 시위 등 사회적으로 받아들여지지 않는 소수민족이나 식민지가 최종적으로 변화를 만들어 낸 경우는 수도 없이 존재한다. 이와 같이 ‘교권’이나 ‘교칙’이라는 틀 속에 갇혀있는, ‘학생들’도 이와 같이 변화를 만들어 낼 수 있다. 하지만, 우선 이런 변화를 만들어 내기 위해서 위 운동들의 공통점, 비폭력 운동의 규칙에 대해 생각해 보아야 할 것이다. 도덕책에는 이렇게 적혀있었다. ‘비폭력 시위를 행하고 나서는 그 행위에 대한 처벌을 마다하지 않아야 합니다.‘라고. 이 문구가 도대체 우리랑 무슨 관련이 있는가. 학생들이 시위를 하고 나서 그 책임을 지고 퇴학이라도 하라는 이야기인가? 물론 아니다. 나는 이 문구를 이 문구 그대로 생각하지 않았다. 약간 억지일 수도 있겠으나, 나는 반대의 방면으로 바라보았다. 행위에 대한 책임이 아니라, 행위를 위한 의무에 대해서 생각해 보았다.

+

학생들이, 또는 군중들이 학교, 또는 정부에 무언가를 요구하려면 어떻게 해야 할까? 먼저 기존 체제의 문제점에 대해서 설명하고, 논리적으로 반박해 나갈 것이다. 학교나 정부는 그에 대한 반박을 할 것이고, 그 이유를 설명할 것이다. 학생이나 군중이 이에 대해 다시 반박하고, 전체와 구성원이 서로 타협해 나가면서 결국 변화를 만들게 될 것이다. 나의 생각은 그 행위 제일 처음부터 시작한다. 이들이 제일 처음으로 기존 체제의 문제점에 대해 설명할 때, 만약 이들이 범죄 조직이거나 불량 학생이라면 어떻겠는가. 당연히 정부는 그 말을 무시할 것이다. 학교나 교직원들도 불량 학생의 일탈이라 생각할 것이다. 심지어는 그 외 군중들이나 그 외 학생들도 그 요구에 대해서 쉽사리 찬성하기에도 무리가 있을 것이다.

+

결론적으로 하고 싶었던 말은 이것이다. 변화를 요구하기 전에, 한번 제대로 따라보고, 그 문제점을 지적하라고. 물론 이 말은 당연한 말이며 누구든지 할 수 있는 말이다. 하지만, 우리학교 친구들이 무언가를 비판하고 요구할 때 이러한 것들이 잘 지켜지지 않는 것 같다. 우리 학교뿐만 아니라 사회적으로도 이러한 ‘당연한’ 전제조건이 잘 지켜지지 않는 것 같았다. 나도 마찬가지였다.

+

그래서 나는 친구들에게 말하고 싶다. 마냥 불만만 품거나 일탈만 하지 말고, 한번 계속 지켰다가 그 문제점을 정리해서 사람을 모아, 제대로 한번 개혁을 만들어 보라고.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/index.html b/public/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/index.html new file mode 100644 index 0000000..07a1227 --- /dev/null +++ b/public/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/index.html @@ -0,0 +1,285 @@ + + + + + + + + +블로그 글쓰기는 너무 힘들어.. | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 블로그 글쓰기는 너무 힘들어.. +

+ + +
+
+

야심차게 티스토리 블로그를 만들어 몇몇 글을 쓰고 나서, 한참동안이나 글을 쓰지 않았다. 하지만 나중에 돌아보면 쓰일 곳이 있지 않을까 하여 내 소장을 위해 Ghost + Vultr로 넘어왔고, 돈도 내야 하니까 글을 조금씩이라도 쓰지 않을까 생각했지만…. 결국 글을 쓰지도 않은 채 달마다 돈만 나가고 있다…

+

블로그 글을 왜 쓰지 않았지..? 고등학교 생활을 하느라 힘들고 바빠서 (노느라) 글을 쓰지 않았을 수도 있고, 마땅하게 글을 쓸만한 소재도 없고, 마땅하게 글을 쓸 기기 또한 없다. 나에게 있는거라고는 집에 있는 아버지 노트북과 내 아이폰 밖에 없으니까..

+

그래도 일기같은 형식으로 글을 써 내려갔다면 좋을 것 같은데 그 역할을 트위터가 하고 있는 바람에 더욱 쓰지 않게 되었다. 물론 길게길게 회고록을 쓰거나 감상을 쓰거나 후회를 하기 위해서라면 블로그만큼 좋은것도 없기는 한데, 나는 타자가 느리고, 글을 너무 못쓴다. 이과생특

+

하지만 애초에 내가 코딩을 하지 않은것도 몇달째 되어가고 있고, 내가 아이패드나 노트북을 구매하지 않는 이상 글을 절대 꾸준히 쓸 수 없을 것 같다. 물론 아침에 일어나면 남는 자투리 시간을 이용하여 글을 틈틈히 쓸수도 있지만, 역시 그 역할을 트위터가 하고 있다.

+

글쓰기가 너무 힘들다. 다른 블로그들을 보면 글도 길고 길지만 쉽게 읽히며 뭘 말하고 싶은지 탁탁 이해가 쉽다. 하지만 내가 글을 쓰자니 길제 쓰기도 힘들고 시간도 걸리고 머리도 아프고 할 이야기도 없다.

+

글을 쓰고 싶다. 멋지게 글을 쓰고 싶다. 다른 사람에게 도움이 되는 글을 쓰고 싶다. 내 글을 가지고 사람들이 기꺼이 대가를 지불할 만큼의 가치를 가지는 글을 쓰고 싶다. (그 대가란, 그 사람들의 시간..)

+

열심히 해봐야 겠다. 앞으로 대학 입시까지 2달 적게 남기도 했고, 내 몸이 망가져가는 걸 많이 실감했기에 건강하고 규칙적인 생활습관을 가지려 하고 있고, 그 첫걸음이 일찍 자서 일찍 일어나고, 남는 시간에 글쓰기이다.

+

화이팅! 할 수 있다..!

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/daehag-ibsiga-handangye-namassda/index.html b/public/blog/daehag-ibsiga-handangye-namassda/index.html new file mode 100644 index 0000000..3e45aa6 --- /dev/null +++ b/public/blog/daehag-ibsiga-handangye-namassda/index.html @@ -0,0 +1,299 @@ + + + + + + + + +대학 입시가 한단계만 남았다. | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 대학 입시가 한단계만 남았다. +

+ + +
+
+

대학 입시가 한단계만을 앞두고 있다.

+

합격자 발표와 등록.

+

뭐 공부하고 대비해야하는 시험은 다 끝났으니 마음껏 놀고 있지만 마음의 한편에는 아직 불안함이 많이 존재하고 있다. 또 공부와 시험대비라는 정해져 있는 계획만을 12년 동안 따르던 나에게서 갑자기 계획이나 강제성이 사라졌다. 이제부터는 내가 무엇을 할 것인지를 나 혼자서 알아서 결정해야 하고 또한 그 책임도 내가 져야할 것이다. 예를 들어 늦게자도 누군가 깨워주지 않는다는 것에서 그것을 처음으로 느꼈다.

+

지금 하고싶은 것도 없다. 무언가 해야하는 것도 딱히 없다. 그래서 그게 더 스트레스다. 운동을 해야할 걸 알고 운동을 하고싶지만 무엇부터 시작해야 할지 막막하다. 영어공부를 해야하는 것을 알지만 막상 하려니 하기 싫다. 운전면허는 학원을 다니므로 예외. 남겨놓은 책도 읽어야 하지만 눈에 들어오지 않는다. 모두 핑곗거리 뿐이지만 나에게는 하지 않을 충분한 계기가 된다.

+

마음가짐을 고쳐잡아야 한다. 미련하고 기계이기만 했던 지난 학생 시절을 벗어나 자율적으로 움직이는 어른, 하나의 사람이 되어야 한다. 이러고만 있을 수는 없다. 그래서 다짐을 했다. 내일부터는 사람이 되어보자.

+

그 다짐은 물론 다음날 아침에 깨졌다. 늦게 깨어난 것은 물론 일어나자 마자 의욕을 잃었다. 아직 나는 사람이 될 마음가짐이 안되었구나. 옛날만큼이나 아니 오히려 더다짐에 대한 마음가짐과 독기가 풀렸구나..

+

어쨋든 무거운 얘기는 여기까지만 하고 이제 앞으로의 계획을 정하든가 해야겠다.

+

일단 첫번째로 운전면허. 이번주 주말부터 시작해 매일 1시에 수업이 있다고 들었다. 1차 필기시험을 통과할 수 있도록 집중해서 듣자.

+

두번째로 운동. 입시하던 도중에 항상 입시 끝나면 다이어트 하고 헬스를 해서 몸을 건강하게 만들어보자! 마인드였는데 지금은 헬스는 개뿔 먹고 자고 눕기만 하고 있다. 하지만 오늘 뻘짓으로 2시간이나 걸어다녔으니 운동의 초석을 다진것이라 보고 내일부터 or 담주부터 헬스를 끊어야 겠다. PT를 끊던가 하면 식단도 조절되고 그걸 따르는 건 할 수 있으니까 해보자구!

+

세번째 영어. TOEFL. 토익말고 토플이 나에게는 익숙하다. 토플 주니어를 거의 매년 치다시피 했고 중딩때 IBT를 여러번 쳤으니 토플이 제일 익숙할 것이다. 일단 나는 기본 영어 감은 충분하고 넘치다고 자부하고 있..으니(???) 문법이나 문제푸는 요령같은 것들을 인강을 듣고 문제집을 풀고 해서 꾸준히 영어공부를 해야겠다. 뭐 많이는 못하더라고 꾸준히는 할 수 있잖아? 할 것도 없는데.. 일단 교재부터 알아보고 (뭐 해커스가 되겠지만) 인강도 알아보고 해서 책을 빨리 구입하던가 해야겠다.

+

네번째. 자산. 돈관리. 원래 내 통장은 어머니가 관리하셨다. 금액이 *만 가까이 되니 내가 건들기 힘든 금액이기도 했고, 세금때문에 마음대로 건들면 안된다고 했다. 하지만 만 17세가 되면서 내가 내 금융을 관리할 수 있게 되었고 그때 카뱅이나 씨티같은 계좌를 몰래 만들어 놨다. (나중에 씨티는 해지하느라 애를 엄청 먹었지만) 뭐 지금은 다 알지만.. 내가 쓰는 계좌는 카뱅, 토뱅 두개이다. 어머니가 만들어 놓으신 계좌는 농협에 여러개인데 나도 잘 모른다. 근데 내가 그 고액 저축통장을 찔끔찔끔 빼서 써서 약간 일이 커지게 될 것 같이 되어버리긴 했다. 그리고 문제는 내 경제관념이다. 어디다 빼먹고 왔다. 고3 주제에 한달 사용액이 50만원 가까이 된다. 이건 진짜 고쳐야 한다고 생각한다. 통장정리 하고 어머니께 잔소리 좀 들으며 자산관리에 대해서알아가야 겠다. 국가장학금도 있고 해서..

+

다섯째. 뭐 독서려나. 사놓고 안읽은 책이 90%이다.권수로 치면 대강 40권이고 금액으로 치면 대충 100만원 정도이네..? 빨리 읽어야 한다. 대학가기 전에 30권 이상 읽는게 목표이다. 하지만 어림도 없지. 기술서는 빼고 읽으면 그정도는 할 수 있을 것 같다. 독서는 마음의 양식! 나는 독서를 좋아한다.

+

여섯째 자기계발! 프로그래밍 공부, 컴퓨터 공부!? 파이썬은 많이 했고 C++도 기초는공부했다. 이제 두꺼운 C++책과 TAoCP, EMC++, 하드웨어 보안, 전기전자 등등 이런 책들 가지고 공부해야 겠다! 재밌겠구만!! 이런거 좋아함.. 요즘에는 코테도 많이 보는 듯 하니 알고리즘 공부도 해놓고 내가 좋아하는 보안 공부도 하고..

+

일곱째 인간관계 청산. 이게 좀 많이 필요할 것 같다. 일단 고등학교 3년을 100명이랑 보내서 안 친할래야 안 친할 수 없다. 그 중 도움이 될것 같은 친구가 있고 아닌 친구도 있지만 나는 현생에 충실하지 않았으면서도 충실했어서 대강 다들하고 이어져 있다. 이 상태 유지만 하면 좋을 것 같다. 내 주요 인간관계는 모 SNS의 분들과 몇몇 친구들이니..

+

이게 이걸 바탕으로 계획을 짜보자! 애들 공부하는 VLOG도 보면서 ‘나도 그랬었지’ 와 ‘그랬었으니 지금도 가능’을 동시에 느낄 수 있다.

+

화이팅! 이제 끝이고, 이제 진정으로 새로운 시작이다!!!!!

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/datacenter/index.html b/public/blog/datacenter/index.html new file mode 100644 index 0000000..287a2e9 --- /dev/null +++ b/public/blog/datacenter/index.html @@ -0,0 +1,283 @@ + + + + + + + + +데이터센터 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 데이터센터 +

+ + +
+
+

구글같은 검색엔진이 늘어나고, 다양한 기업들과 서비스들이 사용자들의 개인정보와 데이터를 마구 수집한다. 이로 인해 생겨나는 기하급수적인 양의 데이터들을 보관할 스토리지와 그것들을 사용할 수 있는 데이터로 가공하기 위해 필요한 수없이 큰 컴퓨팅 파워를, 큰 기업들이 대형으로 지어놓은 데이터 센터가 담당하고 있다. 게다가 이제는 작은 기업이나 서비스들은 AWS나 GCP, Oracle과 같은 서비스를 통해 Cloud로 Computing하기까지 하니, 아마존이나 구글의 데이터 센터는 얼마나 커다랗고, 커다래야 하는지 알 수 있다.

+

아마존과 구글의 데이터센터뿐 아니라 네이버, MS, 오라클, 및 작은 데이터센터들이 지어질때 중요하게 작용하는 것이 있다. 발열과 전력문제이다. 어디보다도 전력을 사용하여 열이 덥혀질 시설이 겨울만큼 춥다는 것으로 얼마나 냉각시스템이 신경쓰는지 알 수 있다. 심지어 우리집에 있는 노트북만 사용해도 80도 가까이 올라가고, 방이 더워지는데 수백, 수천, 수만대의 컴퓨터가 설치되어있는 데이터센터는 오죽할까. 연료를 태워 그 열기로 전기를 만들고 그 전기를 다시 열로 바꾸고, 그 열을 내보내기 위해 또 다시 전기를 쓰다니.

+

나도 집에 작은 서버 하나를 운영하고 있다. 매달 받는 전기세가 가히 신비롭다. 그리고 방도 매우 덥다. 한대로 이 정도인데, 데이터센터는 엄청난 전기를 먹고 있다. 게다가 요즘에는 비트코인 열풍이 불어서 채굴이 한창 떠오르고 있다. 어떻게 보면 채굴장도 하나의 데이터 센터라고 볼 수 있지 않은가. Visa나 마스터카드와 같은 카드사들의 데이터센터가 각 나라로 각 개인으로 분산되어 분포하는 것과 비슷하게 볼 수 있으니 말이다. 이러한 와중에 전력이 부족해지고 있다는 뉴스가 자주 떠오른다.

+

그 많은 데이터센터의 대부분은 아마 인텔 제온 프로세서, 하드 디스크와 엔비디아의 그래픽카드를 구축해 놓았을 것이다. MS의 Bing 데이터 센터는 FPGA를 이용해 조금 더 성능을 높였다는데, ASIC이나 FPGA를 이용한 데이터센터도 많을 것 같다. 다들 전기를 많이 먹는 장비들이다. 그렇다면 전성비를 고려하는 건 어떨까. 가령 전성비 최강인 ARM이나 RISC를 사용한다던가, Bing처럼 FPGA를 이용하던가.

+

사실 전성비가 좋은만큼 서버 프로세서만큼의 수율이 나오지 않을 것이며 그 정도의 성능을 낼 정도의 대형 프로세서는 나오기 힘들 것 같다. 아직까지 모바일로 사용하는 이유기도 하고. 하지만 괴물급 기업들이 ARM 개발을 위해 한창 노력중이니. 엔비디아도 ARM코어로 데이터센터 개발중이라 하고, 그 애플이 ARM으로 노력중이니 곧 데스크탑급 되는 시스템이 나오고, 좀 있으면 서버급도 나올 수 있지 않을까 기대하고 있다. ARM 는 극강의 전성비를 고려한 설계인 만큼 물량으로 밀어붙여도 x86에 전력으로는 이길지 않을까 싶다. 서버에서는 코어수도 중요하게 작용하니까 다중코어로는 훨씬 유리하지 않을까 싶다.

+

화이팅! ARM으로 개발하시는 기업들 모두!

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/gaeinjeongbo-privacy/index.html b/public/blog/gaeinjeongbo-privacy/index.html new file mode 100644 index 0000000..0f5cc64 --- /dev/null +++ b/public/blog/gaeinjeongbo-privacy/index.html @@ -0,0 +1,283 @@ + + + + + + + + +개인정보.. Privacy.. | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 개인정보.. Privacy.. +

+ + +
+
+

나는 구글이 싫었다.

+

구글에 반대하며 지메일도 거의 쓰지 않고 있고, 다른 구글 플랫폼을 벗어나 다른 플랫폼으로 옮기고 있다. 하지만, 아이폰으로 옮기고 나서 몇주간을 생각해보니 내 분노의 대상은 구글이 아니라 애플이여야 한다는 것을 알게 되었다. 카카오, 구글에 가지고 있던 분노의 이유가 애플이라는 기업 자체를 강타한다. 물론 나도 알고 있었고, 구글 못지 않게 애플을 싫어하고 있었다. 새롭게 휴대폰을바꿀 때에도 OS만 구글이고 제조사는 다양한 (삼성이..겟지만..) 안드로이드 휴대폰과 휴대폰 하드웨어, 악세사리, OS, 결제, 게다가 웹엔진까지 제한하고 독점해버린 애플과는 비교가 된지 않는다고 생각했고, 이번에 플립이 잘 나와서 그것으로 바꾸려 했다. 물론 에어팟 수리를 하러 갔다가 아이폰에 홀리듯이 들어가버렸다. 한동안 애플의 통합 생태계의 편리함에 매료되어 내가 빅테크 기업에 어떤 이미지를 가지고 있으며 어떤 불만과 어떤 사상을 가지고 있는지 잊었었다.

+

하지만 이 문제는 구글이나 애플만의 문제가 아닐 것이다. 따라서 애플과 구글만을 싫어한다고 해서 해결될 문제가 아니다. 이건 모든 빅데이터 산업과 모든 데이터 기업들이 가지고 있는 문제이고, 현대 사회에서 피할 수 없는 문제인 것 같다. 개인에 맞추기 위해, 광고주와 개인을 동시에 만족시키기 위해선 개인정보의 수집이 불가피하다. 최소한의 개인정보 수집이라 해고 결국 수집해야 하는 개인정보는 한둘이 아니다. 따라서 우리는 우리의 개인정보에 대해 어떤 것을 기업에게 주고 어떤 것을 주지 않을지 선택할 권리가 있어야 하고, 선택에 신경써야 한다. 특정 앱을 잘못 설치했다가 지금 모습이 데이터센터에 축적되고 있을 수도 있으니까. 이러한 점에서 개인의 Privacy 선택권을 최대한으로 존중하는 애플은 본받을 만 하다. 애플이 선구적으로 도입한 Ask app not to track이나 앱별 개인정보 관리, 카메라 사용과 마이크 사용 표시는 안드로이드에서도 도입하려 하고 있으니까 이건 정말 잘했다고 생각한다. 애플은 광고 받는 장사가 아니니까 할 수 있는 거겠지만 말이다.

+

하지만 구글은 태생이 검색엔진이고 광고 받는게 중요하고 가장 큰 수입원인 기업인 만큼 개인정보 수집에 가장 신경써야 하면서도 가장 필요한 기업이다. 앞으로 어떻게 할지 궁금하다.

+

난 아이폰을 사용한다. 앱 트래킹은 다 차단했고, 필요한 것 외에는 카메라를 절대 허용하지 않는다. IP별 개인화도 좋아하지 않아 Private Relay도 잘 쓰고 있다. 하지만 매일매일 구글을 사용하고, 어쩔 수 없이 트래킹이 발생할 수 밖에 없다. 따라서 우리는 개인정보를 흘리고 다니지 않고 꽉 매고 다니는게 중요하다. 계정 보안과 로그아웃은 당연히 중요하고, 무분별하게 계정 연동을 하거나 가입하는 것도, 공개된 웹 상에 자신의 전화번호나 주소, 이메일 주소들을 과도하게 공개하지 않는것도 중요하다.

+

HTTPS 연결 확인도 중요하고, WiFi가 믿을 만 한지, 이 네트워크가 믿을 만 한건지도 중요하다. 신경써야 할 게 많지만 철저히 익명으로, 해킹당하지 않을 예방법을 생각하면 쉽다. 개인정보 보호와 해킹 방지는 방법이 비슷하다. 주의해야 할 것은 믿을 만한 곳에 흘리는 개인정보이다. 구글이나, 네이버. 믿을 만 하지만 가장 필요한 회사이다. 가장 이용해먹는 회사이고. 이 점만 주의한다면 일반적으로 자신의 개인정보를 관리한다고 할 수 있지 않을까..?

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/godeunghaggyo-dolabogi/index.html b/public/blog/godeunghaggyo-dolabogi/index.html new file mode 100644 index 0000000..7c0c567 --- /dev/null +++ b/public/blog/godeunghaggyo-dolabogi/index.html @@ -0,0 +1,295 @@ + + + + + + + + +고등학교 돌아보기 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 고등학교 돌아보기 +

+ + +
+
+

2021년을 돌아보며.

+

2021.12.22

+

벌써 12월 22일이다. 12월달에는 열심히 살아야지 하던게 어제같은데 벌써 새해가 다가온다. 나는 내년 성인이 되지만, 아직 실감이 안난다. 술담배를 할 수 있는 나이라기 보다는 내 행동에 내가 책임져야 하는 때가 되었다는 게 더 실감이 난다. 대학을 고민하며 내가 앞으로 뭘 하면서 먹고 살아야할지 꽤 오랫동안 고심했는데, 그 결과로 조금 성장한 것 같아 이제와서는 약간 기쁘기도 하고 무섭기도 하면서 슬픈 약간 오묘한 기분이다. 어찌되었든 이제 성인이 되니까 조금 변해야겠다고 다짐하고 있다.

+

2021년을 돌아보면 2020년을 돌아봐야 하고, 그러면 당연히 2019년이 생각난다. 여튼 고등학교 3년 생활이었기에 항상 쌍으로 돌아다녀야지. 고등학교 생활을 돌아본다.

+

2019년, 고등학교 입학.

+

나는 초등학교 때부터 영재교육원을 다니면서 내 미래가 결정되다 싶이 했다. 이렇게 계속 하다보면 동네 중학교에 진학하여, 과학고를 준비하고, 과학고에 진학하여 과기원을 가는게 정해져있었던것 같다. 그때는 지금 이렇게 될지는 몰랐겠지만, 그 길을 모범적으로 걸어서 지금의 내가 되었다.

+

2018년 연말, 나는 과학고 입시를 봤다. 자기소개서를 쓰면서 학원에서 선생님과 친구들과 새벽 3시까지 남아 첨삭을 했던 기억이 있다. 불 꺼진 건물에서 술래잡기를 하면서 즐거웠던 기억이 있는데, 지금 돌아보면 즐거워서는 안되었것 같지만 중학생이니 그럴 수 있다고 생각한다. 그때쯤에는 학원에 12시까지 남아서 서류준비를 하고는 했는데, 이때 항상 데리러 와주셨던 아버지께 정말 감사하다고 이제와서 생각한다. 초등학교 6학년때부터 올림피아드를 준비하면서 매 주말마다 학원에 갔고, 내가 숙제를 안해서 학원에 늦게 남아야 했던 적도 많은데, 그럴때마다 항상 아무말 없이 데려다 주셨다. 영재원도 다녔기에 먼 거리를 항상 운전해 주셨다. 2주마다 창원에서 진주까지 가고, 거기서 4시간을 기다려주시고, 집에 데려다 주셨다. 이제와서 생각하니 정말 너무 감사하다는 말 밖에 안나온다.

+

서류를 통과하고, 면접을 준비해야 했다. 나는 말을 잘 못했다. 정확히는 너무 긴장을 하는 타입이었다. 평소에는 그렇게 시끄럽고 잘 놀았는데, 면접은 너무 긴장되었다. 그래서인지 준비하는데도 애를 먹었지만, 결과적으로는 잘 되었다. 뭐 통과했으니 말이다.

+

면접시험은 너무 못봤다고 생각했고, 그래서 면접을 보고 와서 공부를 했을 정도이다. 아무래도 고등학교를 간다는 낮선 감정과 못봤다는 불안감이 교차해서 잠깐 철이 들었나보다. 하지만 뭐 합격을 했고, 합격 페이지를 봤을 때 그 희열은 아직까지도 기억이 난다. 합격을 했어서, 나는 의욕이 붙었었다. 과고 대비반, 과고를 들어가기 전 방학때 잠깐 하는 총정리 수업을 정말 열심히 했었다. 아마 그정도로 열정을 가지고 공부했던 적은 거의 없던것 같다. 고등학교때는 열정이 아니라 강박에 의해서 공부를 했으니… 그때 물리와 수학, 화학을 한번 쭉 배웠는데, 수학은 둘째치고 그때 배웠던 화학 지식은 고등학교 3년동안 우려먹었고, 그때 배웠던 물리 덕분에 상위권?을 유지할 수 있었다. 정말 재미있었고, 원리가 신기했다. 정말 지금 생각해도 그때 새로운걸 배운다는 느낌을 다시 느낄 수 없을 것 같다. 여튼 방학동안 정말 열심히 공부했고, 덕분에 1학년때에는 최상위권을 할 수 있었다.

+

내가 진학하는, 과학고는 기숙사 학교였다. 이때 처음으로 집을 떠나 멀리서 생활하기 시작했다. 처음에는 정말 정말 무서웠다. 들뜬 감정도 있었지만, 중3 그 어린 나이에 집을 나온다는 건 아무래도 많이 불안했던 것 같다. 과학고는 브릿지라고, 입학 전에 2주간 두번 학교에서 미리 생활하면서 기숙사 생활과 고등학교 일상에 미리 익숙해지고, 미리미리 여러가지 시험을 치면서 각종 반을 결정하는 기간을 가진다. 2월 초 처음으로 브릿지를 가면 기숙사 방을 배정받고 생애 처음으로 룸메이트를 배정받았다. 생판 모르는 친구랑 같은 방에서 자고 생활해야 하는 거였는데, 나는 새 친구를 잘 사귀지 못하는 편이라 약간 두려웠다. 물론 말만 한번 트면 급속도로 친밀감을 좁히는 스타일인데, 그 처음 말을 트는게 힘들었다. 하지만 착한 친구였고, 덕분에 2주동안 여러 친구도 사귀고 잘 지냈다. 기억나는건, 우리 방에 귀신이 나오기로 알려진 괴담이 있는 방이었는데, 무서워서 몇일은 못잤던 기억이 있다. 기숙사 생활은 생각보다 괜찮았다. 첫날 빼고는 바로 익숙해졌다. 아침 6시 20분에 일어나는 것과 점호, 그리고 공동 샤워실에서 씻는것이 정말 낮설었지만 성격상 금방 적응했다. 너무 적응해서 문제지만.. 아침에 일어나서 운동장을 한바퀴 도는 구보를 하고 기숙사로 돌아와 씻는 시간을 가진다. 이후 아침 자습을 하는데, 이때 시험을 쳤다. 진단고사라고, 아마 자신의 위치를 확인해보라고 시행했던 시험이었던 것 같다. 아침에 머리를 굴리는건 낮설었고, 그때에는 그게 지대한 영향을 끼칠 것 같아 최선을 다해서 쳤다. 물론 두번째 브릿지에서는 잔다고 치지도 못했지만..ㅎㅎ

+

입학을 하고 정식으로 학생이 되었다. 방학때 공부했던 기세로 1학기는 정말 열심히 했던 것 같다. 아마 고등학교 때중에서 최고로 집중했던 시기이다. 덕분에 뭐 점수는 잘 받았고, 원하던 영재학급도 들어갈 수 있었지만 원하던 동아리는 떨어졌다. 시험이 처음보는 개념들 투성이었고, 부산이나 서울에까지 가서 공부했던 친구들과 싸움은 힘들었다. 이때 한계를 첨으로 느꼈다. 1학기 기말고사가 끝나고 고등학교 생활의 전환점이 찾아온다. 한 친구를 알게 된다. 중3때 나는 덕후.. 였다. 1학기때에는 공부하느라 바빠서 다른거에 신경쓸 겨를이 없었지만 처음으로 방학을 맞이하면서 여유가 생겼고, 자유시간이 많이지면서 약간은 문화생활을 즐기게 되었다. 이때 내 내면에 있던 잠재력이 부활을 했고, 그때 같이 덕후인 한 친구를 만나게 된다. 나랑 너무 잘 맞았다. 성격도 잘 맞았고, 관심사도 잘 맞았던 그 친구와 나는 급속도로 친해졌다. 그러다 우리는 연애를 한다. 그것도 중간고사 5일전에 사귀기 시작했다. 당연히 공부는 하지 않았고, 연애에 몰두하느라 2학기는 통으로 날리게 된다. 하루종일 놀고, 문자하고, 편지쓰고 그랬다. 단 둘이 있기 좋은 시골학교라 산책도 자주 갔고, 정말 행복했다. 성적이 많이 떨어졌다. 그래도 중위권은 유지했는데, 부모님은 당연히 당황하셨을 것이다. 갑자기 그렇게 성적이 떨어졌으니.. 그래서 결국 부모님과 틈만 나면 싸웠고, 그 친구와도 정말 자주 싸웠다. 지금와서 내가 왜그랬을까 싶다. 정말 좋은 친구였고 정말 잘 맞았는데, 내가 너무 잘못했던것 같다. 시간이 많이 흘러서 알게 되는건가 싶다. 그 친구와는 몇번에 다툼 이후로 영영 멀어지게 되었다.

+

한번 공부를 놓으니 그 뒤로 공부하기 어려웠고 낮아진 성적은 높이기 힘들었다. 그렇게 나는 2학년을 맞이했다.

+

2020년에는..

+

2020년 나는 2학년이 된다. 1학년 친구들이 새롭게 들어오며 2학년이 되었다는 것을 실감했다. 새롭게 마음을 다잡고 공부를 하기로 마음먹었다. 그나마 공부를 해서, 성적을 높이는 데에는 성공했다. 2학년 1학기를 잘 쳐서, 조기진학이 가능한 성적이 되었다. IQ도 140을 넘겨서 조기졸업도 가능했다. 2학년 여름방학때는 고민을 한다. 조기졸업을 할지 조기진학을 할지.

+

그 전에, 2학년에 올라가는 시기에 코로나를 맞이한다. 전 수업이 온라인 수업이 되었고, 입학식뿐만 아니라 진급식, 그리고 그 사이 수업도 전체 다 온라인으로 진행하게 되었다. 온라인으로 진행하면서 장비를 셋팅하기 시작했다. 내가 아침에 수업을 제대로 들을리 없었기 때문에 캡쳐보드며 다른 여러 장비도 장만했다. 그러면서 오디오 문제가 생겼다. 에어팟은 녹음을 하면서 동시에 재생할 때 통화로 연결이 되어 음질이 정말 너무 구리기 때문에 이를 해결하기 위해 오디오 장치를 따로 썼고, 캡처보드에 오디오를 넣기 위해 가상 오디오 드라이버까지 찾아가며 준비했다. 그러면서 오디오 드라이버에 관심을 가졌고, 그러면서 컴퓨터에 대해서 관심을 가지게 된다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/haggyoeseo-haessdeon-peurojegteudeul/index.html b/public/blog/haggyoeseo-haessdeon-peurojegteudeul/index.html new file mode 100644 index 0000000..d146640 --- /dev/null +++ b/public/blog/haggyoeseo-haessdeon-peurojegteudeul/index.html @@ -0,0 +1,283 @@ + + + + + + + + +학교에서 했던 프로젝트들.. | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 학교에서 했던 프로젝트들.. +

+ + +
+
+
    +
  1. 귀가시간 수집 프로그램
  2. +
  3. 기상곡 수집 프로그램
  4. +
  5. 컴퓨터실 사용현황
  6. +
  7. 학교 내부 정보공유망
  8. +
  9. 문서파일 자동저장 및 복구 시스템
  10. +
  11. 학교 저지 사이트 API 정리 및 제출시스템 프록시
  12. +
  13. 선생님들이 부탁하셨던 수많은 프로그램들
  14. +
+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/index.html b/public/blog/index.html new file mode 100644 index 0000000..b9aecf6 --- /dev/null +++ b/public/blog/index.html @@ -0,0 +1,402 @@ + + + + + + + + +Blogs | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+

+ Blogs +

+
+ +
+ +
+
+

미러서버를 운영하면서... +

+
+
+

학교 둥하교때마다 짬내서 적은거라 비문이 많다.. +미러링 서버를 만든게 21년 말에 학교에서 우분투 깔다가 너무 오래걸려서 짜증나서 만든거였는데, 그게 서버 업그레이드도 몇번 거치고 다른것들도 추가하고 하니까 사이즈가 많이 커졌다. 작년까지 에러도 자주나고 그랬는데 이제야 안정적으로 운용할 정도의 수준은 된 것 같다. +미러 Sync하는 스크립트를 옛날 단순하게 적었던걸 그대로 쓰고 있다. Path도 지정 못하고 Configurability도 현저히 떨어져서 새로 짜야겠다고 생각은 했는데, 그래서 최근에 reposync 라고 아에 다시 만들었다. 근데 이게 미러링 사이즈가 18TiB정도 되니까 이걸 테스트 해보기가 겁나더라....

+
+
<span title='2023-10-23 09:45:50 +0000 UTC'>Oct 23, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

About USB-C and DP Alt Mode. +

+
+
+

Microsoft Surface Laptop 4 & Linux 제가 밖에서도 쓰고 집에서도 사용하는 만능 서피스 랩탑 4를 사용한지 어느새 2년이 넘었습니다. 그 사이에 리퍼도 받고 OS도 여러번 갈아엎기도 하고, 또 제 하드한 작업들을 잘 버텨주기도 한 정말 대단한 랩탑입니다. +특히 3:2의 광활한 세로는 정말 좋아서 다른 비율의 노트북은 이제 사용할 수 없는 몸이 되어버리기도 했습니다. 길이를 측정해보면 13인치 랩탑들과 동일한데, 세로에 5cm정도를 추가한 정도라 타이틀바 하나정도 넓혀주는 셈이라 마음놓고 패널바를 띄어놓고 사용할 수 있습니다....

+
+
<span title='2023-05-06 12:55:32 +0000 UTC'>May 6, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

선택실패 +

+
+
+

고등학교 3학년 때까지만 해도 나는 무조건 컴퓨터 공학과나 전기전자 공학과. 학과만 보고 대학교에 진학하리라 마음먹었었다. 진짜 학교 이름은 절대 보지 않을 것이라 생각했다. 하지만 막상 입시에 처하고 선택의 갈림길에 있으니 그 다짐은 물거품이 되었다. +역시나, 아니나 다를까 원서 접수 기간이 되니 진로 담당 선생님은 실적을 위해 상위 대학교의 낮은 학과에 원서를 넣어볼 것을 추천하셨다. 말이 추천이지 반 강제로 넣게 되었다. 아무런 관심도 없었고, 3년동안 생각도 없었는데다 자기소개서도 짜맞춰야 쓸 수 있는 학과에 지원했다....

+
+
<span title='2022-04-14 06:55:25 +0000 UTC'>Apr 14, 2022</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

다른 사람의 집에 산다는 것 +

+
+
+

우리 집은 창원이다. 어렸을 때 서울에 살다가 초증학교때 창원으로 내려왔고, 중학교 3학년까지 거기서 살아왔다. 고등학교는 기숙사 학교를 가서, 어쨋든 학창시절은 창원에서 지냈다. +대학을 서울로 와서 대학 기숙사에 들어가게 되었다. 고등학교때 기숙사는 들어오자마자 화장실과 샤워실을 리모델링 하기도 했고, 전국에서 아마 가장 넓은 방을 가지고 있었지 않을까 싶다. 각 방마다 냉장고도 있고. 하지만 대학교 기숙사는 참담했다. 2/3로 줄어든 엄청 좁은 방에, 낮은 천장, 허술한 난방, 게다가 못 쓸정도로 더러운 화장실과 때와 곰팡이로 가득한 샤워실까지....

+
+
<span title='2022-04-09 04:02:17 +0000 UTC'>Apr 9, 2022</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

고등학교 돌아보기 +

+
+
+

2021년을 돌아보며. +2021.12.22 +벌써 12월 22일이다. 12월달에는 열심히 살아야지 하던게 어제같은데 벌써 새해가 다가온다. 나는 내년 성인이 되지만, 아직 실감이 안난다. 술담배를 할 수 있는 나이라기 보다는 내 행동에 내가 책임져야 하는 때가 되었다는 게 더 실감이 난다. 대학을 고민하며 내가 앞으로 뭘 하면서 먹고 살아야할지 꽤 오랫동안 고심했는데, 그 결과로 조금 성장한 것 같아 이제와서는 약간 기쁘기도 하고 무섭기도 하면서 슬픈 약간 오묘한 기분이다. 어찌되었든 이제 성인이 되니까 조금 변해야겠다고 다짐하고 있다....

+
+
<span title='2021-12-21 16:23:55 +0000 UTC'>Dec 21, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

대학 입시가 한단계만 남았다. +

+
+
+

대학 입시가 한단계만을 앞두고 있다. +합격자 발표와 등록. +뭐 공부하고 대비해야하는 시험은 다 끝났으니 마음껏 놀고 있지만 마음의 한편에는 아직 불안함이 많이 존재하고 있다. 또 공부와 시험대비라는 정해져 있는 계획만을 12년 동안 따르던 나에게서 갑자기 계획이나 강제성이 사라졌다. 이제부터는 내가 무엇을 할 것인지를 나 혼자서 알아서 결정해야 하고 또한 그 책임도 내가 져야할 것이다. 예를 들어 늦게자도 누군가 깨워주지 않는다는 것에서 그것을 처음으로 느꼈다. +지금 하고싶은 것도 없다. 무언가 해야하는 것도 딱히 없다....

+
+
<span title='2021-12-01 08:09:52 +0000 UTC'>Dec 1, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

전자 제어의 세계인 미래, 그 보안의 위협 +

+
+
+

미래 사회에는 전기자동차와 자율주행 자동차가 성하게 유행할 것이다. 사람 운전자의 역할이 거의 축소되고, AI나 전자적으로 제어될 것인데, 지금도 많이 일어나고 있는 논란은 바로 보안이다. 만약 자율주행 자동차가 해킹을 당하게 된다면 어떨까? 해커는 자동차에 타고 있는 사람의 생사여탈권을 가지게 될 정도로 심각한 문제가 있는 것이다. 그러므로, 이러한 생활환경에 직접적인 영향을 주는 전자기기의 보안은 매우 중요한 것으로 판단된다. 미래에 우리의 생활을 가장 많은 부분 담당할 사물인터넷도 마찬가지이다. 우리의 생활과 강하게 연관되어 있고, 그러므로 보안이 가장 주요한 요인이 된다....

+
+
<span title='2021-10-30 07:17:47 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

양자들의 트랜지스터와 핫 캐리어 효과 +

+
+
+

트랜지스터가 점점 소형화가 되어가면서 전자가 예상한대로 움직이지 않는 작은 단위까지 내려갔다. 나노단위까지 생산공정이 작아지면서 양자역학적인 효과가 나타나기 시작했고, 이는 트랜지스터의 스위칭 작용을 방해하는 효과를 불어일으킨다. 이를 해결하기 위해서 양자 세계에서 사용할 수 있는 양자 트랜지스터와 단일 원자 트랜지스터가 개발되었다. +단일원자 트랜지스터 단일원자 트랜지스터는 양자 터널링 효과를 적극적으로 이용하여 스위칭 작용을 한다. 터널링 효과를 제어하기 위해서 직접 제어가 아닌 양자 얽힘 효과를 이용한다. 큐비트를 이용하여, 전자 주개로써의 원자를 제어하기 위해 원자 개개별의 스핀 상태를 이용한다....

+
+
<span title='2021-10-30 07:09:53 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

인생 두번째 실패. 두번째 대학탈락. +

+
+
+

내 첫번째 실패는 조기진학 실패이다. 대학을 떨어졌다. +내 두번째 실패도 대학 탈락이다. 이번엔 아직 9번 더 있지만, 작년에 떨어지고 느꼈던 그 참담함과 그 마음가짐을 다시 한번 느낄 수 있게 한 그 세글자 ‘불합격’. 역시 이번에도 참담함을 느꼈고, 여전히 안타까움과 공허함을 느낄 수 있었다. +내심 기대했었다. 붙기를 간절히 기도했다. 하지만 세상은 냉정했다. +바라던게 이제는 이룰 수 없다고 생각하니 공허했다. 하지만 그것도 잠깐이었다. 멘탈이 강하고 회복력도 강한게 내 장점이라 공허함으로 쳐져있는 것도 잠깐이었고, 앞으로를 다시 생각하고 마음가짐을 고치는 계기가 되었다....

+
+
<span title='2021-10-23 08:52:59 +0000 UTC'>Oct 23, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

나는 무엇을 하고 있는걸까 +

+
+
+

프로그래밍에 매력을 느껴 프로그래밍에 입덕하게 된 건 2학년때쯤.. 이후 그 재미를 느끼고 많은 것들을 시도해보곤 했다. HTML과 CSS를 배워 가장 기본적인 웹사이트를 만들고, 이를 더 화려하게 꾸미기 위해 JS를 공부했다. 이를 배포하기 위해 서버 구축에 대해 공부했고, PHP나 MySQL을 이용해 기능성을 부여하면서 DB와 SQL에 대해 공부했다. 이후 고전적인 서버를 넘어 SSR이나 CSR에 대해 알아보려 NodeJS를 공부했다. 학교 입학시 과제였던 C로 하는 PS를 하면서 C나 C++에 관심을 가졌고, 왜 C로 코딩하는데 C++를 써야하는지 의문을 가지고 C++을 공부했다....

+
+
<span title='2021-10-23 08:52:15 +0000 UTC'>Oct 23, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

학교에서 했던 프로젝트들.. +

+
+
+

귀가시간 수집 프로그램 기상곡 수집 프로그램 컴퓨터실 사용현황 학교 내부 정보공유망 문서파일 자동저장 및 복구 시스템 학교 저지 사이트 API 정리 및 제출시스템 프록시 선생님들이 부탁하셨던 수많은 프로그램들

+
+
<span title='2021-10-23 08:51:44 +0000 UTC'>Oct 23, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

개인정보.. Privacy.. +

+
+
+

나는 구글이 싫었다. +구글에 반대하며 지메일도 거의 쓰지 않고 있고, 다른 구글 플랫폼을 벗어나 다른 플랫폼으로 옮기고 있다. 하지만, 아이폰으로 옮기고 나서 몇주간을 생각해보니 내 분노의 대상은 구글이 아니라 애플이여야 한다는 것을 알게 되었다. 카카오, 구글에 가지고 있던 분노의 이유가 애플이라는 기업 자체를 강타한다. 물론 나도 알고 있었고, 구글 못지 않게 애플을 싫어하고 있었다. 새롭게 휴대폰을바꿀 때에도 OS만 구글이고 제조사는 다양한 (삼성이..겟지만..) 안드로이드 휴대폰과 휴대폰 하드웨어, 악세사리, OS, 결제, 게다가 웹엔진까지 제한하고 독점해버린 애플과는 비교가 된지 않는다고 생각했고, 이번에 플립이 잘 나와서 그것으로 바꾸려 했다....

+
+
<span title='2021-10-23 08:31:52 +0000 UTC'>Oct 23, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

데이터센터 +

+
+
+

구글같은 검색엔진이 늘어나고, 다양한 기업들과 서비스들이 사용자들의 개인정보와 데이터를 마구 수집한다. 이로 인해 생겨나는 기하급수적인 양의 데이터들을 보관할 스토리지와 그것들을 사용할 수 있는 데이터로 가공하기 위해 필요한 수없이 큰 컴퓨팅 파워를, 큰 기업들이 대형으로 지어놓은 데이터 센터가 담당하고 있다. 게다가 이제는 작은 기업이나 서비스들은 AWS나 GCP, Oracle과 같은 서비스를 통해 Cloud로 Computing하기까지 하니, 아마존이나 구글의 데이터 센터는 얼마나 커다랗고, 커다래야 하는지 알 수 있다. +아마존과 구글의 데이터센터뿐 아니라 네이버, MS, 오라클, 및 작은 데이터센터들이 지어질때 중요하게 작용하는 것이 있다....

+
+
<span title='2021-10-23 08:15:14 +0000 UTC'>Oct 23, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

블로그 글쓰기는 너무 힘들어.. +

+
+
+

야심차게 티스토리 블로그를 만들어 몇몇 글을 쓰고 나서, 한참동안이나 글을 쓰지 않았다. 하지만 나중에 돌아보면 쓰일 곳이 있지 않을까 하여 내 소장을 위해 Ghost + Vultr로 넘어왔고, 돈도 내야 하니까 글을 조금씩이라도 쓰지 않을까 생각했지만…. 결국 글을 쓰지도 않은 채 달마다 돈만 나가고 있다… +블로그 글을 왜 쓰지 않았지..? 고등학교 생활을 하느라 힘들고 바빠서 (노느라) 글을 쓰지 않았을 수도 있고, 마땅하게 글을 쓸만한 소재도 없고, 마땅하게 글을 쓸 기기 또한 없다....

+
+
<span title='2021-10-08 05:19:00 +0000 UTC'>Oct 8, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

나는 무엇을 해야 하는걸까 +

+
+
+

대학 탈락 이후 나는 대학을 한번 떨어진 경험이 있다. 과학고등학교 재학생 중 중상위권이었던 나는 조기진학의 기회를 받았고, KAIST만을 넣은 채로 떨어졌다. 그 때는 붙을 줄 알고 있어서 2학년 2학기 시험을 말아먹었고, 지금도 그 영향을 받아 피를 흘리고 있다. +다행히 그 이후 각성을 한건지 철이 든건지 3학년 1학기는 최상위권 성적을 받아 원래대로 유지는 할 수 있었다. 3-4등 정도 했으니까 망정이지 태도를 안고치고 그대로 했더라면 나는 그대로 멘탈이 없어져버렸을 것이다. +오늘까지 자기소개서를 작성했다....

+
+
<span title='2021-09-11 01:20:00 +0000 UTC'>Sep 11, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Attitude for criticism +

+
+
+

요즘 우리 학교에 학교를 개혁하겠다는 학생회장이 나타나고 나서부터 친구들이 학교에 대한 여러 가지 불만들을 풀어내기 시작했다. 나도 마찬가지로 학교에 대한 여러 가지 불만사항들이 많았다. 나는 매 학기마다 개정된 학교 교칙이나 규정들을 정독하는 이벤트를 가지는데, 그때마다 항상 ‘아, 학생들이 당연히 너무 불리하다..’ 라던가, ‘이 조항은 너무 아닌데, 너무 구시대적인 생각이 아닌가?‘라는 생각이 들기도 한다. +대학을 가야하는 시기라서 여러 학교들의 생활이나 공부방법, 대학 진학 상황들에 대해서 더욱 관심을 가지게 되었다. 특히 전국급 자사고나 타 지역 과학고의 생활과 공부습관?...

+
+
<span title='2021-09-10 07:30:10 +0000 UTC'>Sep 10, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

시험을 일주일 앞두고 +

+
+
+

지금까지 내 인생에서 가장 중요한 시험. 그 시험이 일부일 앞으로 다가왔다. 하루종일 시험공부 비슷한걸 하면서 심신이 지쳐 더 이상 집중을 할 수 없을 것 같다. 이제 이 고비만 넘기면 인생에서 가장 날아다닌다는 시기, 대학생이 된다. 앞으로 뭘 하고 살아야 할지, 무엇을 하고 싶은지, 내가 아는 게 많아지고 현실을 깨달으면서 철이 드니 생각이 복잡해지고 앞길이 막막하기만 하다. +몇일 전, 작년에 대학 원서 자기소개서를 다시 읽다 보니 내가 아는 게 많아졌음을 새삼 깨달았다....

+
+
<span title='2021-06-20 09:23:28 +0000 UTC'>Jun 20, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

나는 무엇을 하고 싶은 걸까.. +

+
+
+

나는 개발자가 되고 싶었다. 그래서 나 나름대로 여러가지 언어를 배우기도 했고 컴퓨터 관련된 여러 가지 활동을 하면서 나의 꿈을 키워나간다고 믿었다. 고등학교를 다니면서 외적으로 개인적인 공부도 많이 하고 있고, 이를 바탕으로 진로를 정하려고 했다. 고등학교 3학년이라 앞으로의 진로를 정해야 했고, 이런 저런 고민을 하다 보니 내가 공부했던 것들이, 또 내가 알고 있는 것들이 단순히 빙산의 일각이라는 사실을 깨달았다. +과학고를 다니는 덕에 수학적인 내용을 기본으로 하는 여러가지 컴퓨터 분야에 대해서는 나름 쉽게 공부할 수 있었다....

+
+
<span title='2021-01-28 06:14:00 +0000 UTC'>Jan 28, 2021</span>&nbsp;·&nbsp;Me
+ +
+
+
+ + + + + + + + + + diff --git a/public/blog/index.xml b/public/blog/index.xml new file mode 100644 index 0000000..686d7e2 --- /dev/null +++ b/public/blog/index.xml @@ -0,0 +1,193 @@ + + + + Blogs on Morgan's Blog + http://blog.morgan.kr/blog/ + Recent content in Blogs on Morgan's Blog + Hugo -- gohugo.io + en + Mon, 23 Oct 2023 09:45:50 +0000 + + 미러서버를 운영하면서... + http://blog.morgan.kr/blog/operating-mirroring-server/ + Mon, 23 Oct 2023 09:45:50 +0000 + + http://blog.morgan.kr/blog/operating-mirroring-server/ + operating-mirroring-server + + + + About USB-C and DP Alt Mode. + http://blog.morgan.kr/blog/usb-c-and-dp-alt-mode/ + Sat, 06 May 2023 12:55:32 +0000 + + http://blog.morgan.kr/blog/usb-c-and-dp-alt-mode/ + Microsoft Surface Laptop 4 &amp; Linux 제가 밖에서도 쓰고 집에서도 사용하는 만능 서피스 랩탑 4를 사용한지 어느새 2년이 넘었습니다. 그 사이에 리퍼도 받고 OS도 여러번 갈아엎기도 하고, 또 제 하드한 작업들을 잘 버텨주기도 한 정말 대단한 랩탑입니다. +특히 3:2의 광활한 세로는 정말 좋아서 다른 비율의 노트북은 이제 사용할 수 없는 몸이 되어버리기도 했습니다. 길이를 측정해보면 13인치 랩탑들과 동일한데, 세로에 5cm정도를 추가한 정도라 타이틀바 하나정도 넓혀주는 셈이라 마음놓고 패널바를 띄어놓고 사용할 수 있습니다. + + + + 선택실패 + http://blog.morgan.kr/blog/2022041406/ + Thu, 14 Apr 2022 06:55:25 +0000 + + http://blog.morgan.kr/blog/2022041406/ + 고등학교 3학년 때까지만 해도 나는 무조건 컴퓨터 공학과나 전기전자 공학과. 학과만 보고 대학교에 진학하리라 마음먹었었다. 진짜 학교 이름은 절대 보지 않을 것이라 생각했다. 하지만 막상 입시에 처하고 선택의 갈림길에 있으니 그 다짐은 물거품이 되었다. +역시나, 아니나 다를까 원서 접수 기간이 되니 진로 담당 선생님은 실적을 위해 상위 대학교의 낮은 학과에 원서를 넣어볼 것을 추천하셨다. 말이 추천이지 반 강제로 넣게 되었다. 아무런 관심도 없었고, 3년동안 생각도 없었는데다 자기소개서도 짜맞춰야 쓸 수 있는 학과에 지원했다. + + + + 다른 사람의 집에 산다는 것 + http://blog.morgan.kr/blog/%EB%8B%A4%EB%A5%B8-%EC%82%AC%EB%9E%8C%EC%9D%98-%EC%A7%91%EC%97%90-%EC%82%B0%EB%8B%A4%EB%8A%94-%EA%B2%83/ + Sat, 09 Apr 2022 04:02:17 +0000 + + http://blog.morgan.kr/blog/%EB%8B%A4%EB%A5%B8-%EC%82%AC%EB%9E%8C%EC%9D%98-%EC%A7%91%EC%97%90-%EC%82%B0%EB%8B%A4%EB%8A%94-%EA%B2%83/ + 우리 집은 창원이다. 어렸을 때 서울에 살다가 초증학교때 창원으로 내려왔고, 중학교 3학년까지 거기서 살아왔다. 고등학교는 기숙사 학교를 가서, 어쨋든 학창시절은 창원에서 지냈다. +대학을 서울로 와서 대학 기숙사에 들어가게 되었다. 고등학교때 기숙사는 들어오자마자 화장실과 샤워실을 리모델링 하기도 했고, 전국에서 아마 가장 넓은 방을 가지고 있었지 않을까 싶다. 각 방마다 냉장고도 있고. 하지만 대학교 기숙사는 참담했다. 2/3로 줄어든 엄청 좁은 방에, 낮은 천장, 허술한 난방, 게다가 못 쓸정도로 더러운 화장실과 때와 곰팡이로 가득한 샤워실까지. + + + + 고등학교 돌아보기 + http://blog.morgan.kr/blog/godeunghaggyo-dolabogi/ + Tue, 21 Dec 2021 16:23:55 +0000 + + http://blog.morgan.kr/blog/godeunghaggyo-dolabogi/ + 2021년을 돌아보며. +2021.12.22 +벌써 12월 22일이다. 12월달에는 열심히 살아야지 하던게 어제같은데 벌써 새해가 다가온다. 나는 내년 성인이 되지만, 아직 실감이 안난다. 술담배를 할 수 있는 나이라기 보다는 내 행동에 내가 책임져야 하는 때가 되었다는 게 더 실감이 난다. 대학을 고민하며 내가 앞으로 뭘 하면서 먹고 살아야할지 꽤 오랫동안 고심했는데, 그 결과로 조금 성장한 것 같아 이제와서는 약간 기쁘기도 하고 무섭기도 하면서 슬픈 약간 오묘한 기분이다. 어찌되었든 이제 성인이 되니까 조금 변해야겠다고 다짐하고 있다. + + + + 대학 입시가 한단계만 남았다. + http://blog.morgan.kr/blog/daehag-ibsiga-handangye-namassda/ + Wed, 01 Dec 2021 08:09:52 +0000 + + http://blog.morgan.kr/blog/daehag-ibsiga-handangye-namassda/ + 대학 입시가 한단계만을 앞두고 있다. +합격자 발표와 등록. +뭐 공부하고 대비해야하는 시험은 다 끝났으니 마음껏 놀고 있지만 마음의 한편에는 아직 불안함이 많이 존재하고 있다. 또 공부와 시험대비라는 정해져 있는 계획만을 12년 동안 따르던 나에게서 갑자기 계획이나 강제성이 사라졌다. 이제부터는 내가 무엇을 할 것인지를 나 혼자서 알아서 결정해야 하고 또한 그 책임도 내가 져야할 것이다. 예를 들어 늦게자도 누군가 깨워주지 않는다는 것에서 그것을 처음으로 느꼈다. +지금 하고싶은 것도 없다. 무언가 해야하는 것도 딱히 없다. + + + + 전자 제어의 세계인 미래, 그 보안의 위협 + http://blog.morgan.kr/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/ + Sat, 30 Oct 2021 07:17:47 +0000 + + http://blog.morgan.kr/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/ + 미래 사회에는 전기자동차와 자율주행 자동차가 성하게 유행할 것이다. 사람 운전자의 역할이 거의 축소되고, AI나 전자적으로 제어될 것인데, 지금도 많이 일어나고 있는 논란은 바로 보안이다. 만약 자율주행 자동차가 해킹을 당하게 된다면 어떨까? 해커는 자동차에 타고 있는 사람의 생사여탈권을 가지게 될 정도로 심각한 문제가 있는 것이다. 그러므로, 이러한 생활환경에 직접적인 영향을 주는 전자기기의 보안은 매우 중요한 것으로 판단된다. 미래에 우리의 생활을 가장 많은 부분 담당할 사물인터넷도 마찬가지이다. 우리의 생활과 강하게 연관되어 있고, 그러므로 보안이 가장 주요한 요인이 된다. + + + + 양자들의 트랜지스터와 핫 캐리어 효과 + http://blog.morgan.kr/blog/yangjadeulyi-teuraenjiseuteo/ + Sat, 30 Oct 2021 07:09:53 +0000 + + http://blog.morgan.kr/blog/yangjadeulyi-teuraenjiseuteo/ + 트랜지스터가 점점 소형화가 되어가면서 전자가 예상한대로 움직이지 않는 작은 단위까지 내려갔다. 나노단위까지 생산공정이 작아지면서 양자역학적인 효과가 나타나기 시작했고, 이는 트랜지스터의 스위칭 작용을 방해하는 효과를 불어일으킨다. 이를 해결하기 위해서 양자 세계에서 사용할 수 있는 양자 트랜지스터와 단일 원자 트랜지스터가 개발되었다. +단일원자 트랜지스터 단일원자 트랜지스터는 양자 터널링 효과를 적극적으로 이용하여 스위칭 작용을 한다. 터널링 효과를 제어하기 위해서 직접 제어가 아닌 양자 얽힘 효과를 이용한다. 큐비트를 이용하여, 전자 주개로써의 원자를 제어하기 위해 원자 개개별의 스핀 상태를 이용한다. + + + + 인생 두번째 실패. 두번째 대학탈락. + http://blog.morgan.kr/blog/insaeng-dubeonjjae-silpae/ + Sat, 23 Oct 2021 08:52:59 +0000 + + http://blog.morgan.kr/blog/insaeng-dubeonjjae-silpae/ + 내 첫번째 실패는 조기진학 실패이다. 대학을 떨어졌다. +내 두번째 실패도 대학 탈락이다. 이번엔 아직 9번 더 있지만, 작년에 떨어지고 느꼈던 그 참담함과 그 마음가짐을 다시 한번 느낄 수 있게 한 그 세글자 &lsquo;불합격&rsquo;. 역시 이번에도 참담함을 느꼈고, 여전히 안타까움과 공허함을 느낄 수 있었다. +내심 기대했었다. 붙기를 간절히 기도했다. 하지만 세상은 냉정했다. +바라던게 이제는 이룰 수 없다고 생각하니 공허했다. 하지만 그것도 잠깐이었다. 멘탈이 강하고 회복력도 강한게 내 장점이라 공허함으로 쳐져있는 것도 잠깐이었고, 앞으로를 다시 생각하고 마음가짐을 고치는 계기가 되었다. + + + + 나는 무엇을 하고 있는걸까 + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%98%EA%B3%A0-%EC%9E%88%EB%8A%94%EA%B1%B8%EA%B9%8C/ + Sat, 23 Oct 2021 08:52:15 +0000 + + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%98%EA%B3%A0-%EC%9E%88%EB%8A%94%EA%B1%B8%EA%B9%8C/ + 프로그래밍에 매력을 느껴 프로그래밍에 입덕하게 된 건 2학년때쯤.. 이후 그 재미를 느끼고 많은 것들을 시도해보곤 했다. HTML과 CSS를 배워 가장 기본적인 웹사이트를 만들고, 이를 더 화려하게 꾸미기 위해 JS를 공부했다. 이를 배포하기 위해 서버 구축에 대해 공부했고, PHP나 MySQL을 이용해 기능성을 부여하면서 DB와 SQL에 대해 공부했다. 이후 고전적인 서버를 넘어 SSR이나 CSR에 대해 알아보려 NodeJS를 공부했다. 학교 입학시 과제였던 C로 하는 PS를 하면서 C나 C++에 관심을 가졌고, 왜 C로 코딩하는데 C++를 써야하는지 의문을 가지고 C++을 공부했다. + + + + 학교에서 했던 프로젝트들.. + http://blog.morgan.kr/blog/haggyoeseo-haessdeon-peurojegteudeul/ + Sat, 23 Oct 2021 08:51:44 +0000 + + http://blog.morgan.kr/blog/haggyoeseo-haessdeon-peurojegteudeul/ + 귀가시간 수집 프로그램 기상곡 수집 프로그램 컴퓨터실 사용현황 학교 내부 정보공유망 문서파일 자동저장 및 복구 시스템 학교 저지 사이트 API 정리 및 제출시스템 프록시 선생님들이 부탁하셨던 수많은 프로그램들 + + + + 개인정보.. Privacy.. + http://blog.morgan.kr/blog/gaeinjeongbo-privacy/ + Sat, 23 Oct 2021 08:31:52 +0000 + + http://blog.morgan.kr/blog/gaeinjeongbo-privacy/ + 나는 구글이 싫었다. +구글에 반대하며 지메일도 거의 쓰지 않고 있고, 다른 구글 플랫폼을 벗어나 다른 플랫폼으로 옮기고 있다. 하지만, 아이폰으로 옮기고 나서 몇주간을 생각해보니 내 분노의 대상은 구글이 아니라 애플이여야 한다는 것을 알게 되었다. 카카오, 구글에 가지고 있던 분노의 이유가 애플이라는 기업 자체를 강타한다. 물론 나도 알고 있었고, 구글 못지 않게 애플을 싫어하고 있었다. 새롭게 휴대폰을바꿀 때에도 OS만 구글이고 제조사는 다양한 (삼성이..겟지만..) 안드로이드 휴대폰과 휴대폰 하드웨어, 악세사리, OS, 결제, 게다가 웹엔진까지 제한하고 독점해버린 애플과는 비교가 된지 않는다고 생각했고, 이번에 플립이 잘 나와서 그것으로 바꾸려 했다. + + + + 데이터센터 + http://blog.morgan.kr/blog/datacenter/ + Sat, 23 Oct 2021 08:15:14 +0000 + + http://blog.morgan.kr/blog/datacenter/ + 구글같은 검색엔진이 늘어나고, 다양한 기업들과 서비스들이 사용자들의 개인정보와 데이터를 마구 수집한다. 이로 인해 생겨나는 기하급수적인 양의 데이터들을 보관할 스토리지와 그것들을 사용할 수 있는 데이터로 가공하기 위해 필요한 수없이 큰 컴퓨팅 파워를, 큰 기업들이 대형으로 지어놓은 데이터 센터가 담당하고 있다. 게다가 이제는 작은 기업이나 서비스들은 AWS나 GCP, Oracle과 같은 서비스를 통해 Cloud로 Computing하기까지 하니, 아마존이나 구글의 데이터 센터는 얼마나 커다랗고, 커다래야 하는지 알 수 있다. +아마존과 구글의 데이터센터뿐 아니라 네이버, MS, 오라클, 및 작은 데이터센터들이 지어질때 중요하게 작용하는 것이 있다. + + + + 블로그 글쓰기는 너무 힘들어.. + http://blog.morgan.kr/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/ + Fri, 08 Oct 2021 05:19:00 +0000 + + http://blog.morgan.kr/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/ + 야심차게 티스토리 블로그를 만들어 몇몇 글을 쓰고 나서, 한참동안이나 글을 쓰지 않았다. 하지만 나중에 돌아보면 쓰일 곳이 있지 않을까 하여 내 소장을 위해 Ghost + Vultr로 넘어왔고, 돈도 내야 하니까 글을 조금씩이라도 쓰지 않을까 생각했지만&hellip;. 결국 글을 쓰지도 않은 채 달마다 돈만 나가고 있다&hellip; +블로그 글을 왜 쓰지 않았지..? 고등학교 생활을 하느라 힘들고 바빠서 (노느라) 글을 쓰지 않았을 수도 있고, 마땅하게 글을 쓸만한 소재도 없고, 마땅하게 글을 쓸 기기 또한 없다. + + + + 나는 무엇을 해야 하는걸까 + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%B4%EC%95%BC-%ED%95%98%EB%8A%94%EA%B1%B8%EA%B9%8C/ + Sat, 11 Sep 2021 01:20:00 +0000 + + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%B4%EC%95%BC-%ED%95%98%EB%8A%94%EA%B1%B8%EA%B9%8C/ + 대학 탈락 이후 나는 대학을 한번 떨어진 경험이 있다. 과학고등학교 재학생 중 중상위권이었던 나는 조기진학의 기회를 받았고, KAIST만을 넣은 채로 떨어졌다. 그 때는 붙을 줄 알고 있어서 2학년 2학기 시험을 말아먹었고, 지금도 그 영향을 받아 피를 흘리고 있다. +다행히 그 이후 각성을 한건지 철이 든건지 3학년 1학기는 최상위권 성적을 받아 원래대로 유지는 할 수 있었다. 3-4등 정도 했으니까 망정이지 태도를 안고치고 그대로 했더라면 나는 그대로 멘탈이 없어져버렸을 것이다. +오늘까지 자기소개서를 작성했다. + + + + Attitude for criticism + http://blog.morgan.kr/blog/attitude-for-criticism/ + Fri, 10 Sep 2021 07:30:10 +0000 + + http://blog.morgan.kr/blog/attitude-for-criticism/ + 요즘 우리 학교에 학교를 개혁하겠다는 학생회장이 나타나고 나서부터 친구들이 학교에 대한 여러 가지 불만들을 풀어내기 시작했다. 나도 마찬가지로 학교에 대한 여러 가지 불만사항들이 많았다. 나는 매 학기마다 개정된 학교 교칙이나 규정들을 정독하는 이벤트를 가지는데, 그때마다 항상 &lsquo;아, 학생들이 당연히 너무 불리하다..&rsquo; 라던가, &lsquo;이 조항은 너무 아닌데, 너무 구시대적인 생각이 아닌가?&lsquo;라는 생각이 들기도 한다. +대학을 가야하는 시기라서 여러 학교들의 생활이나 공부방법, 대학 진학 상황들에 대해서 더욱 관심을 가지게 되었다. 특히 전국급 자사고나 타 지역 과학고의 생활과 공부습관? + + + + 시험을 일주일 앞두고 + http://blog.morgan.kr/blog/20210620-siheomeul-iljuil-apdugo/ + Sun, 20 Jun 2021 09:23:28 +0000 + + http://blog.morgan.kr/blog/20210620-siheomeul-iljuil-apdugo/ + 지금까지 내 인생에서 가장 중요한 시험. 그 시험이 일부일 앞으로 다가왔다. 하루종일 시험공부 비슷한걸 하면서 심신이 지쳐 더 이상 집중을 할 수 없을 것 같다. 이제 이 고비만 넘기면 인생에서 가장 날아다닌다는 시기, 대학생이 된다. 앞으로 뭘 하고 살아야 할지, 무엇을 하고 싶은지, 내가 아는 게 많아지고 현실을 깨달으면서 철이 드니 생각이 복잡해지고 앞길이 막막하기만 하다. +몇일 전, 작년에 대학 원서 자기소개서를 다시 읽다 보니 내가 아는 게 많아졌음을 새삼 깨달았다. + + + + 나는 무엇을 하고 싶은 걸까.. + http://blog.morgan.kr/blog/what-i-wanted-to-do/ + Thu, 28 Jan 2021 06:14:00 +0000 + + http://blog.morgan.kr/blog/what-i-wanted-to-do/ + 나는 개발자가 되고 싶었다. 그래서 나 나름대로 여러가지 언어를 배우기도 했고 컴퓨터 관련된 여러 가지 활동을 하면서 나의 꿈을 키워나간다고 믿었다. 고등학교를 다니면서 외적으로 개인적인 공부도 많이 하고 있고, 이를 바탕으로 진로를 정하려고 했다. 고등학교 3학년이라 앞으로의 진로를 정해야 했고, 이런 저런 고민을 하다 보니 내가 공부했던 것들이, 또 내가 알고 있는 것들이 단순히 빙산의 일각이라는 사실을 깨달았다. +과학고를 다니는 덕에 수학적인 내용을 기본으로 하는 여러가지 컴퓨터 분야에 대해서는 나름 쉽게 공부할 수 있었다. + + + + diff --git a/public/blog/insaeng-dubeonjjae-silpae/index.html b/public/blog/insaeng-dubeonjjae-silpae/index.html new file mode 100644 index 0000000..0244ac7 --- /dev/null +++ b/public/blog/insaeng-dubeonjjae-silpae/index.html @@ -0,0 +1,288 @@ + + + + + + + + +인생 두번째 실패. 두번째 대학탈락. | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 인생 두번째 실패. 두번째 대학탈락. +

+ + +
+
+

내 첫번째 실패는 조기진학 실패이다. 대학을 떨어졌다.

+

내 두번째 실패도 대학 탈락이다. 이번엔 아직 9번 더 있지만, 작년에 떨어지고 느꼈던 그 참담함과 그 마음가짐을 다시 한번 느낄 수 있게 한 그 세글자 ‘불합격’. 역시 이번에도 참담함을 느꼈고, 여전히 안타까움과 공허함을 느낄 수 있었다.

+

내심 기대했었다. 붙기를 간절히 기도했다. 하지만 세상은 냉정했다.

+

바라던게 이제는 이룰 수 없다고 생각하니 공허했다. 하지만 그것도 잠깐이었다. 멘탈이 강하고 회복력도 강한게 내 장점이라 공허함으로 쳐져있는 것도 잠깐이었고, 앞으로를 다시 생각하고 마음가짐을 고치는 계기가 되었다.

+

할 수 있는 모든 것을 해보자. 후회없이.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/index.html b/public/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/index.html new file mode 100644 index 0000000..8922d10 --- /dev/null +++ b/public/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/index.html @@ -0,0 +1,280 @@ + + + + + + + + +전자 제어의 세계인 미래, 그 보안의 위협 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 전자 제어의 세계인 미래, 그 보안의 위협 +

+ + +
+
+

미래 사회에는 전기자동차와 자율주행 자동차가 성하게 유행할 것이다. 사람 운전자의 역할이 거의 축소되고, AI나 전자적으로 제어될 것인데, 지금도 많이 일어나고 있는 논란은 바로 보안이다. 만약 자율주행 자동차가 해킹을 당하게 된다면 어떨까? 해커는 자동차에 타고 있는 사람의 생사여탈권을 가지게 될 정도로 심각한 문제가 있는 것이다. 그러므로, 이러한 생활환경에 직접적인 영향을 주는 전자기기의 보안은 매우 중요한 것으로 판단된다. 미래에 우리의 생활을 가장 많은 부분 담당할 사물인터넷도 마찬가지이다. 우리의 생활과 강하게 연관되어 있고, 그러므로 보안이 가장 주요한 요인이 된다. 전자적으로 제어되는 보일러가 해킹당하면 어떻게 될까? 해커는 보일러를 과하게 제어함으로써 실 사용자에게 영향을 미칠 수 있다. 더 심각하게는 가스밸브나 의료 기기가 누군가의 악의대로 조종된다면 사용자를 죽음의 위기에 처하게까지 할 수 있다. 에어컨이나 히터, 그리고 화장실, 환풍기, 및 여러 가구들이 연결되어 있으며, 우리의 삶에 큰 영향을 미칠 수 있다. 실제로 IoT기기들에 대해 우리의 사생활의 침해도 문제가 된다. 미래 사회에서는 모든 기기가 연결되어 있을 것이며, 자동차나 버스, 그리고 비행기까지도 무선으로 연결되어 있을 것이다. 그러면 여기서 가장 문제가 되는 것이 무선통신의 보안이다. 무선통신은 유선통신과는 다르게 모든 사람들이 시호를 감청할 수 있기에 그 보안이 매우 중요하고 심각하게 느껴진다. 그렇다면 이러한 사항들에 대해 지금은 어떻게 보안이 이루어졌으며, 또한 앞으로는 어떻게 발전되어야 할까?

+

첫번째로는 AI상의 보안이다. 지금 보안의 상황으로는 공격자들이 시스템에 대해 예측이 어려운 신종 변종 공격을 많이 진행하고 있다. 이것의 바탕이 되는 기술은 바로 자동화이다. 보안이라는 것 자체가 공격 시 대응 및 방지가 주요한 특징이기 때문에 자동화나 변종 공격에 대해서는 취약할 수 밖에 없다. 완벽한 시스템이란 없는 것이다. 이런 공격에 대처하는 방안으로는 인공지능을 사용하는 방법이 있다. 실제 대규모로 전송되는 공격의 경우 인공지능으로 해킹에 대한 지도 및 비지도 학습을 통해 해킹 패턴을 자동적으로 분석해 막아줄 수 있기 때문이다. 또한 악성코드 분석에 인공지능을 접목시키면, 실제 사람이 분석하는 것보다 더욱 빠르게 분석할 수 있다. 하지만, 인공지능 보안에도 문제가 있다. 특히 인공지능은 실제 보안에 의지하는 것이 아니기 때문에 과하게 보안하거나 또는 이미 일어난 데이터들의 경향성 때문에 제대로 된 예측을 못하는 것이다. 인공지능도 선입견이 있는 것이다. 이와 관련지어서 인공지능에 의한 해킹을 고려해 보아야 한다. 인공지능 자체가 해킹을 하는 것이다. 해킹이란 것 자체가 반복성이 중요하고 난수성이 중요하기 때문에 이와같은 작업에 인공지능만큼 딱 맞는 것은 없을 것이다. 이와같은 공격에는 인공지능에 의한 대처밖에 답이 없는 것이다.

+

인공지능에 의한 해킹과 보안에 대해 알아보았으니 인공지능 시스템에 대한 보안을 어떨까? 이것이 이에서 언급했던 자율주행 자동차에 관한 보안이 될 수 있다. 기본적으로 업다운 인공지능이 아닌 다운업 인공지능인 현재의 인공지능으로서는 주어진 데이터가 가장 기초적인 원리로 작용한다. 데이터를 기반으로 학습하고 행동하기 때문에 데이터의 정확성이나 신뢰성이 중요하게 작용한다. 이때 문제가 될 수 있는 것이 데이터의 오염이다. 데이터를 인위적으로 조작하여 인공지능의 행동을 조작하는 방법이다. 인공지능이 해킹당하기 쉬운 (어떤 방면에서) 이유가 바로 이것이다. 데이터가 악위적인 방향으로 조작된다면 인공지능의 행동의 패턴을 유추할 수 있고, 또한 자율적으로 조작할 수도 있다. 따라서, 인공지능에 대해서는 데이터의 유입의 신빙성을 중요시하게 고려해야 할 것이며, 데이터의 무결성이나정확성에 검증을 위한 인공지능을 도입하여 방어를 한다고 한다.

+

두번째로는 사물인터넷에 대한 보안이다. 사물인터넷은 실질적으로 우리의 생활과 밀접하게 관련이 있고, 가장 많은 전자기기가 이 기술에 접목될 것이기 때문에 가장 중요한 보안이라고 생각할 수도 있다. IoT, Internet of Things는 기본적으로 인터넷에 대한 기술이기 때문에 가장 보안에 취약해 질 수밖에 없다. 또한 IoT기기는 저전력과 저성능이 가장 중요하고 소형화가 중요하기 때문에 특별한 보안 솔루션을 도입하기가 어렵다. 집에 커다란 보안서버를 하나씩 구비해 놓지 않는 이상. 따라서 IoT의 경우는 해킹에 가장 취약하면서 해킹에 있어서 가장 위험한 존재이다. 그 누가 자신의 집에서의 모습을 전 세계로 생중계되기를 원하겠는가.

+

따라서 IoT에 대한 보안 솔루션은 굉장히 후발적일 수 밖에 없다. 따라서 소프트 웨어적으로 강력한 솔루션을 집어넣거나 취약점을 분석하게 후에 조치하는 방법밖에 없다. 전 세계적으로 IoT기기에 대한 보안 규제를 강화하거나 보안 기준을 제시하고 있고, 이를 처리하거나 대처하는 인력이나 전략을 제대로 정비하기만 한다면 현재 가능한 보안 솔루션 중 가장 상위의 솔루션이지 않을까 싶다.

+

이와 같이 우리의 삶과 인터넷, 전자기기가 밀접하게 연결될 수록 그 보안의 영향력은 비약적으로 커진다. 보안 업계나 기업들은 이 점을 유의하여 서비스를 제공해야 할 것이다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/operating-mirroring-server/index.html b/public/blog/operating-mirroring-server/index.html new file mode 100644 index 0000000..2466497 --- /dev/null +++ b/public/blog/operating-mirroring-server/index.html @@ -0,0 +1,289 @@ + + + + + + + + +미러서버를 운영하면서... | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 미러서버를 운영하면서... +

+
+ operating-mirroring-server +
+ + +
+
+

학교 둥하교때마다 짬내서 적은거라 비문이 많다..

+

미러링 서버를 만든게 21년 말에 학교에서 우분투 깔다가 너무 오래걸려서 짜증나서 만든거였는데, 그게 서버 업그레이드도 몇번 거치고 다른것들도 추가하고 하니까 사이즈가 많이 커졌다. 작년까지 에러도 자주나고 그랬는데 이제야 안정적으로 운용할 정도의 수준은 된 것 같다.

+

미러 Sync하는 스크립트를 옛날 단순하게 적었던걸 그대로 쓰고 있다. Path도 지정 못하고 Configurability도 현저히 떨어져서 새로 짜야겠다고 생각은 했는데, 그래서 최근에 reposync 라고 아에 다시 만들었다. 근데 이게 미러링 사이즈가 18TiB정도 되니까 이걸 테스트 해보기가 겁나더라.. 게다가 라이브로 뭔가 꼬여버리면 여기저기서 큰일이 나니까 Consistency가 중요한 바람에 테스트도 못하고 그냥 방치하고 있다.

+

미러링 하는 서버가 NFS로 마운트하는 방식이라 비슷하게 다른 서버에서 Overlay로 설정해서 테스트를 해보기는 했다. 그때는 딱히 큰 문제가 없었지만 나중에 실제 돌릴때 혹여나 예상하지 못한 곳에서 문제가 생기면 많이 골치아파진다. 지금 쓰고 있는 스크립트는 1년 넘게 달 돌아가고 있으니 말이다. 단순히 YAML로 된 Config를 읽어서 Rsync로 동기화 한 뒤에 Index만 업데이트하면 되는 스크립트라 복잡한건 없는데, 여기저기 예상치 못한 곳에 에러가 나는 바람에 에러 핸들링에 꽤 애를 먹었다.

+

그래도 이거 만지면서 꽤 많은걸 배웠다. 물론 서버 만지면서 리눅스는 뭐.. 그렇고 (애초에 노트북이 리눅스라..) 쉘스크립트랑 템플릿팅이랑 웹 사이트 정적 디자인도 몇몇개 알게 되었고,, 특히 뭐랄까 개발 외적으로 책임감?도 약간은 느끼게 된듯 하다.. 내 서버가 잠깐 문제생기면 여기저기서 문제가 터지고 수습하는것도 꽤 힘드니까 말이다..

+

아 맞다, 오늘 Kali 리눅스 공식 미러에 추가되었다. 일주일쯤 전에 트친분께서 Kali 미러가 너무 느리다고 하셔서 확인 해봤는데, 한국에 없어서 대만이랑 일본에서 가져오는거 아니던가.. 한국 인터넷이 바다 건너면 속도가 1/4토막이 나는 바람에 심각하게 느리겠다 싶었다. 그래서 Kali 미러링 공식 문서를 읽어 봤는데, 다른 미러는 보통 4시간에 한번 이렇게 시간으로 동기화를 하는데 요거는 SSH Pushing을 쓰는 것이었다. 동기화가 필요할 때 (메인 미러가 업데이트 되고 나서) SSH로 각 서버에 신호를 보내 동기화를 하는 방식이다.

+

SSH를 Kali 서버로만 열고, Authorized Keys 파일에 Public Key와 “command=“를 입력해 두면 그 키로 인증한 클라이언트는 정해진 “command=“가 실행된 환경만이 주어진다. 물론 Kali에서 제공한 스크립트도 다 오픈되어 있는 스크립트이고, 나도 한번 확인해본 스크립트지만 여튼 SSH를 타인에게 연다는 게 약간 걱정이 되었다. 아무래도 서버 권한을 남에게 주는거니까 혹여나 그쪽 PrivKey가 유출이 되거나 하면 문제가 되니까 찜찜하기는 했는데, 뭐 별 수 없다 싶었다.

+

이것도 그쪽에서 도메인이 아니라 IP로 고정해둬야 하는 방식이듯 해 Dynamic IP는 안된다고 했는데, 이거는 VPS에 연결해서 SSH Shim 비슷하게 설정하는걸로 해결했다. VPS IP는 고정이니까 그 서버를 거쳐서 내 로컬 서버로 들어오게 설정해놨다. 이렇게 하는 바람에 이제 VPS가 Dependency로 남아버렸다. 내가 서버를 아마 앞으로 평생 해놓을 것 같으니 저 IP도 평생 달에 5불씩 내면서 유지를 해야한다. 이것 이외에는 값싸게 고정 퍼블릭 IP를 받을 방법이 없다. 데이터센터는 트래픽이 너무 비싸고, 트래픽이 싸더라도 로컬 NFS를 써야하니까 실제 서빙 대역폭의 두배가 필요하다. 계산해 보니 달에 평균적으로 14-15TiB정도 쓰는데, 이거 VPS에서는 한 5-60불이라 부담이 좀 된다.

+

아웃바운드 트래픽이 14-15TiB나 되니 ISP에 헤비업로더로 등록?된듯 하다. 아무래도 가정용 회선을 써야 하니까 ISP의 제한을 조금 받는데, 가끔 DHCP도 안주고 레이턴시도 늘어지고 해서 짜증이 난다. 근데 어차피 아웃바운드는 한 80%가 국내니까 어차피 ISP 내부 망 안일텐데, 이러면 왜 굳이 제한을 하는건지 잘 모르겠다. 솔직히 국내 ISP는 국내에서라도 QoS를 없애야 하지 않나 싶다. 150GiB는 요즘같은 시대에 너무 적은 용량이다.

+

초기에는 많은 사람들이 쓰지는 않아서 왜 굳이 아무도 안쓰는 서버를 계속 켜놓을까 생각이 들었는데, 요즘 들어 몸집도 커지고 트래픽도 팍팍 올라가니 할 맛이 난다. 특히 외부에 있는 다른 머신에서 (학교에 설치되어 있는 우분투라던지) 내 서버가 보이면 정말 기쁘다. 처음에는 커뮤니티를 위해서 하는거 보다는, 취미로 하는 부분이 컸는데, 지금은 커뮤니티에 조금이나마 보탠다는 생각이 좀 강해졌다. 물론 아직도 내 유일한 취미는 서버 운용과 오픈소스 기여다. 요새 프로그램을 만드는거에 노하우도 생기고 해서 꽤 완성도 있는 결과물도 많아졌다.

+

이제 남은 해보고 싶은 거는.. 러스트를 배우는거다.. 뭐랄까 내 머리는 C에 테일러되어 있어서 말이지, 러스트의 엄격함에 원초적인 거부감이 든다. 항상 C의 자유도를 바탕으로 꼼수를 쓰는 방식을 꽤 애용해서 그런지 마음대로 못하는 러스트는 별로다.. 그래도 C의 Proceeder기도 하고, 또 메모리 보호는 필요불가결한 부분이니까 적응해 나가야지 싶다.

+

카이스트 미러는 있는데 왜 우리 학교는 미러를 안하지.. 동아리방 가보니까 안쓰는 서버 있더만 그걸로 미러서버라도 돌려줘요~

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/page/1/index.html b/public/blog/page/1/index.html new file mode 100644 index 0000000..9530de1 --- /dev/null +++ b/public/blog/page/1/index.html @@ -0,0 +1,10 @@ + + + + http://blog.morgan.kr/blog/ + + + + + + diff --git a/public/blog/usb-c-and-dp-alt-mode/index.html b/public/blog/usb-c-and-dp-alt-mode/index.html new file mode 100644 index 0000000..908ca62 --- /dev/null +++ b/public/blog/usb-c-and-dp-alt-mode/index.html @@ -0,0 +1,297 @@ + + + + + + + + +About USB-C and DP Alt Mode. | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ About USB-C and DP Alt Mode. +

+ + +
+
+

Microsoft Surface Laptop 4 & Linux

+

제가 밖에서도 쓰고 집에서도 사용하는 만능 서피스 랩탑 4를 사용한지 어느새 2년이 넘었습니다. 그 사이에 리퍼도 받고 OS도 여러번 갈아엎기도 하고, 또 제 하드한 작업들을 잘 버텨주기도 한 정말 대단한 랩탑입니다.

+

특히 3:2의 광활한 세로는 정말 좋아서 다른 비율의 노트북은 이제 사용할 수 없는 몸이 되어버리기도 했습니다. 길이를 측정해보면 13인치 랩탑들과 동일한데, 세로에 5cm정도를 추가한 정도라 타이틀바 하나정도 넓혀주는 셈이라 마음놓고 패널바를 띄어놓고 사용할 수 있습니다.

+

약간의 불만족이라면 배터리와 IO, 그리고 더 깊게 들어가면 해상도 정도가 되겠네요. Intel 11세대를 탑재한 노트북 치고는, 그리고 이 가격 치고는 썬더볼트 없는 노트북을 찾는게 더 어려울것 같아요. USB-B 하나에 USB-C 하나, 그리고 자기네 proprietary한 Surface Connector라는 요상한 녀석과 다행이라면 다행일 3.5mm 오디오 잭이 하나 있습니다. 지금까지 썬더볼트를 이용할 일은 없어서 큰 불만은 아닌데 없는것보다는..

+

배터리는 3-4시간 웹서핑정도를 버텨주는데, 뭐 인텔 랩탑에서는 어쩔 수 없는 부분이죠. 약간 애매한 단점으로는 2496x1664 디스플레이가 있는데, 너무 낮은 FHD보다는 좋고, 4K보다는 안좋은 QHD 패널입니다. 4K를 탑재했다면 배터리가 정말 흘러내렸을테니 이래저재 일반적인 환경에서는 딱 맞는 해상도일겁니다.

+

하지만 리눅스를 쓰는 저에게는 15인치 QHD는 골치아픈 일이 되어버립니다. Fractional Scaling이라는 참으로 거지같은 상황이 생기는데, 보통 13인치 화면에는 FHD가 100%로 보기 좋고, 13-15인치 4K라면 200%를 해서 사용하면 딱 맞습니다. 인터페이스 크기가 노트북를 사용하는 거리에서 딱 좋은 크기인데, QHD는 150%라는 배율을 써야합니다.

+

윈도우 환경에서는 그냥 사용하는 배율이지만, 리눅스 특히 Wayland에서는 골치아픈 일이 생깁니다. 물리적으로 반-픽셀이 불가능하기에 원래라면 분수 배율은 불가능합니다. 이를 적당히 물려서 샤프하게 보이게 속이거나 인터페이스는 그대로 폰트만 크게 하는 경우도 있고, 아니면 해상도를 바꾸어 다시 계산하는 방법이 있겠는데, 리눅스가 원래 사용하는 X11에서는 큰 문제 없이 이러한 꼼수를 쓸 수 있습니다.

+

신기술인 Wayland에서도 마찬가지지만, Wayland를 안쓰고 레거시 X11을 사용하는 앱을 Wayland 환경에서 적용하면 반픽셀 문제 때문에 흐리게 보이게 됩니다. 그러면 그냥 X11을 사용하면 안되냐, 제가 Wayland를 사용해야만 하는 이유가 딱 하나 있습니다. X11에서는, 여러 모니터에 각각 다른 Scale을 적용하기가 힘듭니다.

+

랩탑을 집에서 사용할 때는 27" QHD 모니터 하나와 32" 4K 모니터를 사용합니다. 제가 다른 사람들보다 인터페이스를 크게 사용해서 125% 배율을 적용해야 합니다. 이때 문제가 생기는데, 노트북 화면은 150%, 27인치 모니터는 125%, 또 32인치 모니터는 150%로 사용해야 합니다. 더 작으면 안쓰는것만 못하더라구요..

+

이렇게 3가지 다른 크기의 화면은 각각 다른 배율로 써야해서, 이를 지원하는 Wayland를 써야 했습니다. 수동으로 손으로 만질수는 있지만 자주 깨지더라구요..

+

외부 모니터를 좋게 사용할 것이냐 일부 앱들을 흐리게 사용할 것이냐로 나뉘는데, 일단 저는 그냥 흐리게 쓰고 있습니다. Wayland도 나온지 한참이 지났고 (10년은 넘었으려나요), 많은 앱들은 Wayland를 지원합니다. Electron은 제대로 지원을 안하고 있는데.. 뭐 얼마전 완벽하게 적용했다니 시간이 지나면 괜찮아 지겠죠. 시간이 해결할 거라 생각하고 신기술을 택했습니다. 일단 명목상으로 얼리 어답터이기는 하니까요.

+

1. USB-C DP Alt Mode에 대해서..

+

외부 모니터를 사용할 당시 서피스가 썬더볼트를 지원하지 않는 바람에 호환성을 찾아봐야 했습니다.

+

USB-C 포트에 대한 정확한 정보가 없어 고민하던 중 USB-C 3.2 Gen 2라는 정보를 얻었습니다. USB3은 세분화를 이상하게 해서 헷갈리게 한다는 말을 많이 듣죠.

+

USB 3.2 Gen 2가 대체 뭔지 찾아봤더니, USB3중 USB3.2는 과거 USB3.1의 리네이밍입니다. USB3.2 Gen1, USB3.2 Gen2, USB3,2 Gen2x2는 각각 5, 10, 20Gbps의 bandwidth를 가집니다.

+

Gen1은 5Gbps 1레인으로 달성하고, Gen2는 10Gbps를 10Gbps 1레인으로 달성합니다. Gen2x2는 10Gbps 2레인입니다. USB3.2 1x2라는 것도 있는데, 이는 USB3.2 2x1과 동일하게 10Gbps인데, 5Gbps 레인 두개로 달성합니다.

+

USB-C는 양면으로 되어있고, Superspeed 4페어로 총 2개의 레인과 추가로 USB2가 있습니다. 이때 USB-C에는 Alt모드가 존재하는데, USB-C의 레인을 USB 데이터 교환목적이 아니라 다른 인터페이스를 얹어서 사용하는 방법입니다. 이중 가장 널리 사용되는 건 DP라는 디스플레이 인터페이스인데, DP에는 총 4페어가 있습니다. 하지만 USB와 달리 TX/RX가 필요하지 않아 4페어가 4레인이 됩니다.

+

제 서피스는 USB 3.2 Gen 2, 2x1입니다. 이 말은 1Gbps 하나의 레인을 사용합니다. USB-C에서 두개의 페어가 남고, 이 두개의 페어로 DP 시그널을 보냅니다. 따라서 최대 USB3 10Gbps + DP 2 Lane이 가능한거죠.

+

만약 USB3.2 1x2를 DP와 함께 사용한다면, 5Gbps 두개의 레인중 하나만 USB로 사용할 수 있고 두페어는 DP로 써야합니다.

+

다행이 제 경우 2x1이기에 DP를 다 쓰면서도 USB는 그대로 사용할 수 있었고, 자세하게는 DP Alt모드에서 DisplayPort 1.4 High Bit Rate 3 (HBR3) mode를 사용하기에 레인당 8.1Gbps, 총 16.2Gbps를 사용할 수 있습니다. 이는 4K60Hz를 두개까지 보낼 수 있는 대역폭으로, 저는 이론상 USB3.2 10Gbps와 4K60 모니터 두개가지 사용할 수 있습니다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/what-i-wanted-to-do/index.html b/public/blog/what-i-wanted-to-do/index.html new file mode 100644 index 0000000..b465a94 --- /dev/null +++ b/public/blog/what-i-wanted-to-do/index.html @@ -0,0 +1,290 @@ + + + + + + + + +나는 무엇을 하고 싶은 걸까.. | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 나는 무엇을 하고 싶은 걸까.. +

+ + +
+
+

나는 개발자가 되고 싶었다. 그래서 나 나름대로 여러가지 언어를 배우기도 했고 컴퓨터 관련된 여러 가지 활동을 하면서 나의 꿈을 키워나간다고 믿었다. 고등학교를 다니면서 외적으로 개인적인 공부도 많이 하고 있고, 이를 바탕으로 진로를 정하려고 했다. 고등학교 3학년이라 앞으로의 진로를 정해야 했고, 이런 저런 고민을 하다 보니 내가 공부했던 것들이, 또 내가 알고 있는 것들이 단순히 빙산의 일각이라는 사실을 깨달았다.

+

과학고를 다니는 덕에 수학적인 내용을 기본으로 하는 여러가지 컴퓨터 분야에 대해서는 나름 쉽게 공부할 수 있었다. 문턱이 낮았던 덕에 컴퓨터 아키텍쳐나 논리회로, FPGA, 어셈블리 언어에 대해서까지 공부를 하고는 했다. 이외에도 미래지향적인 양자컴퓨터나 양자논리에 대해서는 특히 관심을 가지고 있었고, 반도체에도 큰 관심이 있었다. 지금 돌이켜 보면 그냥 컴퓨터에 관련된 것이면 폭넓게 무엇이든 관심을 가졌었던것 같다. 컴퓨터란 물체를 설명하는 여러 원리나 그것을 활용하는 여러 방법에 대해 깊은 호기심이 있었다.

+

2학년, 대학을 지원하기 시작하면서 진로를 정할 때 즈음에는 정보보안에 대해 공부하고 있었기에 그 주제를 진로로 잡고 자기소개서를 썼었다. 내가 정보보안에 관심을 두게 된건 Live Overflow란 외국의 유튜버를 알게 되고 나서였는데, “비밀"이라는 알려지지 않은 부분들을 탐구하고 분석해 나간다는게 흥미로웠던 것 같다. 나에게 정보보안이라는 분야 자체가 생소했고, 또 비슷한 수학 분야를 공부했었기에 자연스럽게 그쪽 분야에 흥미를 느낀것도 없지 않아 있을 듯하다.

+

대학교에 떨어지고 나서 좌절하고 방황하고 있을 때 고맙게도 때마침 포스텍 해킹캠프에 참가했다. 보안쪽을 나름대로 미리 공부해 두었다고 생각했기에 부담없이 참여할 수 있겠구나 생각하고 있었는데, 나중에 최하위 점수를 받았다. 팀 협업이 잘 되지 않았던 점도 있겠지만, 나는 아, 결국에 내가 무얼 하든지 각 분야에서는 이미 나보다 잘하는 사람이 넘쳐나구나, 라는것을 깨달았다. 제한된 환경에서 제한된 교육만을 받고 자라온 나로서는 그때까지 이런 점들을 느끼기 힘들었다. 전국적인 대회에 참여하면서 나는 살면서 한번도 느껴보지 못했던 열등감을 느꼈다. 때마침 개인적으로 공부하던 부분에서도 한계를 느꼈고, 이걸 직면하고 나니 나는 컴퓨터라는 분야에 처음으로 싫증이 났다.

+

정확히 말하면 싫어졌다기 보다는 지겨워졌다는 의미가 더 맞는 것 같다. 아키텍쳐나 어셈블리 언어에 대한 내용은 컴퓨터에 대한 호기심을 잃지는 않았는지 중간중간 남는 시간이면 찾아보거나 여러 글을 읽으며 공부를 하고 있기는 하지만, 개발이라는 것에 대한 의미를 잃고 말았다. 물론 이 일련의 사건은 다른 사람의 입장에서 봤을때 별것 아닐테지만.. 개인적으로는 좀 충격이었다.

+

결심?

+

나는 앞으로 컴퓨터란 분야가 어떵게 발전될지 개발 양상이나 그러한 기술적, 경제적 이야기 하는것을 좋아한다. 이러한 분야에 관심이 있는 친구에게 나의 이런 저런 생각을 공유하고는 했다. (이러한 점은 우리 아버지의 영향이 가장 컸던것 같다.) 이런 저런 얘기를 하다 보면 결국에는 항상 대학이 중요하다는 결론이 나고는 했다. 대학에 대한 이야기를 하다 보면 나의 진학에 대한 이야기가 안나올 수 없었고, 이런 이야기를 하며 나는 마음 속으로 진로 방향을 결정해야 했다. 나는 원래 컴퓨터 공학과에 진학하고 싶었다. 더 나아가 공부 스탯을 쌓아 결론적으로 정보보안 대학원에 진학하는 것이 내 중간 목표였다. 사실 최종 목표는 컴퓨터 분야에 대한 패러다임을 새롭게 만들고 싶다는 말도 안되는 거창한 것이었는데, 지금 생각해 보면 무척이나 헛된 꿈이었던 것 같다.

+

나는 암호학, 정보보안, 네트워크, 로우-레벨 코딩, 하드웨어 설계, 반도체, 양자컴퓨터, 소프트웨어 공학, 등등.. 여러 분야에 관심을 가지고 있었다. 위에 있는 단어를 나열하면서 가장 나에게 끌렸던 분야는 다름아닌 반도체와 하드웨어 프로그래밍, 로우레벨 코딩이 가장 끌렸었다. 이런 결정을 내리는 과정에서 고민을 꽤 했는데.. 내가 제일 최종적으로 하고 싶었던 일은 무엇이었을까..? 아마.. 컴퓨터 아키텍처를 분석하고 그런 시스템을 리버싱 하거나 설계하는 것이였던 것 같다. 마냥 소프트웨어 공학이나 개발보다는 그냥 논리회로 같이 컴퓨터 기계적인 분야에 더 관심이 있었고, 양자컴퓨터에 대해서 공부를 하다 보면 또 양자세계에서는 다르게 적용되는 새롭게 정리되고 개발되는 아키텍처에 대해서도 공부하고 싶었다. 이런것들을 생각하고 생각하다 보니 결국 시간이 다가왔고, 컴퓨터 공학과인지 전기전자 공학과 인지 결정해야 할 때가 와버렸다. 컴퓨터 공학과는 뭐랄까.. 너무 공학의 느낌이 안났다. 뭐 딱히 그래서는 아니지만, 난 컴퓨터도 배울 수 있고 또 반도체/하드웨어 분야에 대해서도 연구를 하는 전기전자 공학과를 가고 싶어졌다.

+

이제 고등학교 3학년이라, 그러한 고민을 하기에 적당한 시기였지 않나 싶다. 전기전자 공학과를 가기로 한 이상 이제 대학교나 그 이상의 구체적인 계획을 세울 때가 되었었다. 같은 전기전자 공학과라도 서울대도 있고 카이스트도 있고 포항공대도 있다. 하지만 이미 진학 실패를 경험한 나로서는 어떤 대학에 들어간다거나 어디를 붙을 수 있는지 내 위치가 정확히 어딘지 잘 모르겠었다. 물론 제일 가고 싶은 것은 서울대학교이겠지만 그것은 이미 오래전에 막혔고. 나의 미비한 성적으로는 잘해봤자 카이스트에 가는 정도였던 것이다. (그것도 이번 내신을 엄청나게 잘 봤을때의 이야기이다.)

+

나는 포스텍도, 카이스트도 고려대학교도, 연세대학교 별 상관은 없었다. 어디를 가든 대학교에 가면 심화된 교육을 받을 수 있을테고, 또 나의 꿈을 실현시키는 데에는 내 노력이 필요하지 학교는 별 상관이 없을 테다. 근데 대학은 가야하지 않는가.. 그렇다. 나는 지금 공부를 해야 한다. 한국에서 가장 공부를 많이 한다는, 고3이라는 시절에 나는 무엇을 하고 있는걸까. 난 방황하는 척 하며 사실 놀았던 것과 다르지 않았다. 아무리 공부를 했어도 하고싶은 공부만 골라서 했으며 실제로 노력한 시간은 별로 없었다. 물론 지금까지의 생활에서는 충분히 많이 노력하고 있지만, 고등학교 3학년이라는 시기에 비해서는 (내가 상상한 것에 비해서), 또 내가 원하는 학교를 가서 내가 원하는 일을 할 수 있는 정도의 공부를, 노력을 나는 지금 하고 있지 않는것 같다.

+

얼마나 합리화를 해도 내가 충분히 노력했다고 생각할 수는 없을 것 같다. 하루종일 다른 생각 안하고 공부에만 매진해도 결국에는 체력이 딸려서 몇분동안은 졸게 되어있고, 아무리 열심히 다짐해도 컴퓨터 인터넷 한번에 모든 것이 무너져 내리기도 했다. 참, 이런 생각을 하니까 옛날 부모님이 하신 말씀이 생각이 난다. 너 생각하는 열심은 열심이 아니라고, 더 열심히 해야 한다고 자주 말씀하시곤 했는데, 어렸을 때에는 이러한 말을 잔소리로만 생각했다. 엄마는 내가 얼마나 노력하는지 모르면서 엄마의 기준을 들이대지 말라고 말이다. 진정으로 열심히 하고 있다면, 그것은 자신에게는 ‘더 열심히 해야 한다’라는 강박과 ‘더 열심히 하고 싶다’의 욕망의 형태로 다가와야 한다. 아무리 집중하고 노력해도 불안하고 더 해야하는 것 같아서, 더 열심히 해야 한다고 생각해서, 진심으로 자신을 밀어붙이는 상태가 되어야 열심히 했다고, 열심히 하고 있다고 할 수 있다.. 라고 생각이 들기도 한다.

+

어쨋든 결론적으로 대입이 가까워 지니 여러 가지 생각이 들면서 긴박해 졌고, 전혀 쓰지도 않던 블로그도 쓰고 있다.. 이런 생각들을 정리하면서 글을 쓰다 보니까 여러 가지 주제에 대해서 깊게 생각하게 되는것 같다.

+

이제 공부하러 가야지..

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/yangjadeulyi-teuraenjiseuteo/index.html b/public/blog/yangjadeulyi-teuraenjiseuteo/index.html new file mode 100644 index 0000000..b484078 --- /dev/null +++ b/public/blog/yangjadeulyi-teuraenjiseuteo/index.html @@ -0,0 +1,292 @@ + + + + + + + + +양자들의 트랜지스터와 핫 캐리어 효과 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 양자들의 트랜지스터와 핫 캐리어 효과 +

+ + +
+
+

트랜지스터가 점점 소형화가 되어가면서 전자가 예상한대로 움직이지 않는 작은 단위까지 내려갔다. 나노단위까지 생산공정이 작아지면서 양자역학적인 효과가 나타나기 시작했고, 이는 트랜지스터의 스위칭 작용을 방해하는 효과를 불어일으킨다. 이를 해결하기 위해서 양자 세계에서 사용할 수 있는 양자 트랜지스터와 단일 원자 트랜지스터가 개발되었다.

+
    +
  1. 단일원자 트랜지스터
  2. +
+

단일원자 트랜지스터는 양자 터널링 효과를 적극적으로 이용하여 스위칭 작용을 한다. 터널링 효과를 제어하기 위해서 직접 제어가 아닌 양자 얽힘 효과를 이용한다. 큐비트를 이용하여, 전자 주개로써의 원자를 제어하기 위해 원자 개개별의 스핀 상태를 이용한다. 이를 통해 큐비트의 역할을 할 수 있는 단일한 원자를 생성해 내고, 이 단일 원자들이 스위칭 작용을 하는 주체가 된다. 단일 원자 트랜지스터는 실온에서 작동하고, 적은 숫자의 원자만을 이용하기 때문에 스위칭에 필요한 전력의 양도 매우 적다.

+

단일원자 트랜지스터는 실리콘 표면의 인 원자와 반응시키는 방법이 이용된다. 원자가 정해진 위치에 고정되어 있고 각각의 원자가 전자 주개 또는 스위쳐로 작용하여 전자 하나하나의 흐름을 제어하게 된다.

+
    +
  1. 양자 트랜지스터
  2. +
+

양자 트랜지스터는 기존의 MOS 트랜지스터와 비슷하게 행동하지만, 중간 p,N형 반도체가 하던 채널 형성과 전자 이동 제어를 나노 양자점이 전담하게 된다.

+
    +
  1. 핫 캐리어 효과
  2. +
+

반도체 공정이 작아지면서 트랜지스터 채널이 소형화되었고, 이에 따라 채널의 길이가 줄어들게 되었다. 채널의 길이가 줄어들면서 전자의 튐 현상과 전자 제어가 힘들어진다는 한계점이 있다. 그 중 핫 캐리어 효과는 Drain전압은 일정한데 비해 짧아진 거리에 의해 전기장이 매우 커지는 효과가 일어나고, 평소보다 훨씬 가속된 전자들의 운동에너지에 의해 원래라면 넘어갈 수 없던 Oxide 전계를 넘어서게 되면서 규소 원자와 충돌하여 갇히게 된다. 이를 핫 캐리어 효과, 빠른 전자에 의한 주입 현상이라고 한다. 이에 의해 예측한 것과는 더 적은 전하가 이동하게 되고, 전류가 불안정하고 수율이 떨어지게 된다.

+

핫 캐리어 효과를 최소한으로 하고 이를 방지하기 위해서는 Oxide 게이트와 접해있는 부분의 실리콘을 특수하게 덜 도핑하는 방법이 있다. 전류 손실의 손해를 보지만 핫 캐리어 효과에 의한 손실보다는 훨씬 적다. 원래는 전자의 운동을 최소한으로 방해하기 위해 저항이 낮도록 도핑하는데, Oxide에 접해있는 부분의 저항을 특별히 더 높게 도핑하여 핫 캐리어의 운동을 방해하는 효과를 준다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/나는-무엇을-하고-있는걸까/index.html b/public/blog/나는-무엇을-하고-있는걸까/index.html new file mode 100644 index 0000000..980260d --- /dev/null +++ b/public/blog/나는-무엇을-하고-있는걸까/index.html @@ -0,0 +1,278 @@ + + + + + + + + +나는 무엇을 하고 있는걸까 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 나는 무엇을 하고 있는걸까 +

+ + +
+
+

프로그래밍에 매력을 느껴 프로그래밍에 입덕하게 된 건 2학년때쯤.. 이후 그 재미를 느끼고 많은 것들을 시도해보곤 했다. HTML과 CSS를 배워 가장 기본적인 웹사이트를 만들고, 이를 더 화려하게 꾸미기 위해 JS를 공부했다. 이를 배포하기 위해 서버 구축에 대해 공부했고, PHP나 MySQL을 이용해 기능성을 부여하면서 DB와 SQL에 대해 공부했다. 이후 고전적인 서버를 넘어 SSR이나 CSR에 대해 알아보려 NodeJS를 공부했다. 학교 입학시 과제였던 C로 하는 PS를 하면서 C나 C++에 관심을 가졌고, 왜 C로 코딩하는데 C++를 써야하는지 의문을 가지고 C++을 공부했다. C++이 완전히 다르다는 것에 충격을 먹었고, 이후 비슷한 객체지향에 대해 알아보며 Python에 입문했다. C에 비해 너무 쉬운 코딩과 너무 간단한 개발에 충격을 먹었고, PS하는데만 쓸 수 있던 C와는 다르게 다양한 분야에 접목하기 너무나도 쉬운 Python은 나를 개발 세계에 빠뜨렸다.

+

Python의 다양한 모듈을 사용하며 Requests와 같은 웹을 다루는 모듈을 쓰며 대체 웹은 어떤 구조일까 의문이 들어 네트워킹이나 HTTP, HTTPS에 대해 공부했고, 이런 것들을 응용해 나가며 실질적인 코딩에 가깝게 가면서도 주어진 기능 외로 작동하게 만드는 것에 맛을 들려 해킹에 대해 점점 흥미를 가지기 시작했다. Python은 빠르게 무언가 기능하는 하나의 완성품을 만들기 너무 적당했고, 실행했을 때 원하는 대로 작동했을 때의 쾌감에 빠져버렸다. 이후 생각나는 아이디어란 아이디어는 다 파이썬으로 구현했고, 나 자신의 아이디어 뿐 아니라 주변의 아이디어를 신경쓰게 되었고, 그게 학교 서비스 구현 프로젝트로 이어졌다. 파이썬으로 간단하게 했던 것들을 친구들이 노가다로 하는 모습을 보고 아 저거 파이썬으로 할 수 있겠는데라고 생각했고, 그렇게 만들어본게 수십개는 될 것이다. 한편으로는 내 호기심에 딱 알맞게 점점 깊은 곳으로 내려가고 있었다. 원리의 원리를 계속 파고들며 컴퓨터 구조까지 내려갔고, 내려가면서 다른 땅굴을 파는 게 너무 재미있었다. 해킹이.

+

결국 반도체까지 내려가서 더 이상 이해할 수 없을 때까지 내려갔고, 해킹은 더 이상 내가 알던 해킹이라는 학문이 아니게 다 통합되었다. 해킹을 할 수 있던 원인중 대부분 그 아랫단계에서 기초된 버그였고, 아래로 내려갈수록 하나로 합쳐졌다. 그래서 내가 읽은 책을 살펴보면 다양한 분야가 많이 있지만 다 상하관계로 얽혀있음을 알 수 있다. 네트워크에서 기초해서 TCP/IP로, 거기서 물리계층인 데이터 통신까지, 그리고 신호처리와 신호를 처리하는 소자까지 이어져 있다.

+

관심사에 따라 공부해서 재미있게 공부했고, 관심사에 따라 공부하니 꼬리물기 공부가 가능했다. 서로 얽혀서 각자의 이해를 도왔고, 서로의 흥미를 돋구었다. 그냥 ‘컴퓨터’라는 분야 하나가 너무 재미있었고, 나에게는 천직이라고 생각됐다. 전체가 재미있으니 가장 기초인 ‘반도체’나 ‘컴퓨터 구조’가 자연스럽게 내 진로이자, 내 주요 관심사가 되었다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/나는-무엇을-해야-하는걸까/index.html b/public/blog/나는-무엇을-해야-하는걸까/index.html new file mode 100644 index 0000000..11211b9 --- /dev/null +++ b/public/blog/나는-무엇을-해야-하는걸까/index.html @@ -0,0 +1,293 @@ + + + + + + + + +나는 무엇을 해야 하는걸까 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 나는 무엇을 해야 하는걸까 +

+ + +
+
+

대학 탈락 이후

+

나는 대학을 한번 떨어진 경험이 있다. 과학고등학교 재학생 중 중상위권이었던 나는 조기진학의 기회를 받았고, KAIST만을 넣은 채로 떨어졌다. 그 때는 붙을 줄 알고 있어서 2학년 2학기 시험을 말아먹었고, 지금도 그 영향을 받아 피를 흘리고 있다.

+

다행히 그 이후 각성을 한건지 철이 든건지 3학년 1학기는 최상위권 성적을 받아 원래대로 유지는 할 수 있었다. 3-4등 정도 했으니까 망정이지 태도를 안고치고 그대로 했더라면 나는 그대로 멘탈이 없어져버렸을 것이다.

+

오늘까지 자기소개서를 작성했다. 3번 대학별 지원동기를 쓰면서 계속 내가 하고 싶은 것이 무엇인지 내가 지금까지 무엇을 했는지에 대해 고민을 했다.

+

내가 항상 하던 생각. 무엇을 공부하던지 간에 항상 들었던 생각. 내가 무엇을 하던 나보다 잘하는 사람은 존재하구나. 특별한 존재가 되기에는 나는 너무나 작구나. 자신감이 점점 떨어지는 듯한 느낌이 들었다. 그래서 나는 나를 특별하게 만드는, 내가 돋보일 수 있도록 해주는 것들을 공부하자고 생각했다.

+

나는 마구잡이로 공부했다. 필요할 때에만 공부했고, 원하는 것만 공부했다. 그래서 그걸 공부라고 해도 될 지 모르겠다. 일단 내 기억에서는 공부가 아니다. 나는 컴퓨터 공부를 취미정도로만 생각했지 공부라고는 생각하지 않았다. 그래서 항상 뭔가 컴퓨터를 공부하면 죄책감이 들고 공부한 것 처럼 느껴지지 않았다. 물론 재미있게 한 덕분에 지식은 방대해 졌지만..

+

FPGA에 대해 공부할 때에도 마찬가지였다. 공부였지만 내 마음 속에서는 공부가 아니라 딴짓으로 박혀있었다. 그래서 원하는 것을 알 수 있고 재미있게 할 수 있었지만 자세히 알고 집중해서 했다고는 못한다. FPGA를 공부했지만, 알고는 있지만 공부했다고는 할 수 없어서 결국 안한거나 마찬가지인 것이 되어버렸다. 이미 한번 공부한 내용이지만..

+

그래서 자소서를 쓸 때 고민이 되었다. 주위 친구들은 다들 수과학 내용을 위주로 썼는데, 나는 온통 다 반도체, 컴퓨터 연구 공부했던 내용, 나한테는 딴짓했던 내용이기 때문이다. 나한테는 논 것을 써내려가는 느낌이었다. 물론 쓰고 나서 객관적으로 바라보면 꽤 볼만한 자소서가 되어있었지만, 처음부터 써내려갈때에는 많이 괴롭고 고민되었다.

+

아직도 컴퓨터 공부는 뭔지 잘 모르겠다. 하지만 그게 정말 재미있고, 내 적성에 100% 맞다는 것만은 알고 있다. 앞으로는 컴퓨터에 대해서 제대로 공부하고 싶다. 그것은 고등학생 신분으로는 내 맘속에서 딴짓이라고 정의되어 버리므로, 일단은 대학을 가야 하구나 싶다.

+

야망이라는 말이 있다. 나는 항상 내 꿈을 말할 때 표현의 부족함을 느꼈다. 꿈이라고 하기에는 지극히 개인적이고 꿈보다 훨씬 이루고 싶고, 인생을 움직이는 원동력과도 비슷한 거니까. 물론 꿈을 사람마다 다르게 해석할 수 있다. 그게 꿈 아니야? 라고 할 수도 있다. 하지만 나에게는 꿈보다 훨씬 이루고 싶은 것이 있다. 컴퓨터라는 기계의 역사에 내 이름을 크게 남기는 것. 내가 생각했을 때는 꿈보다는 야망에 훨씬 가까운 내용이었다. 나는 컴퓨터의 패러다임을 바꾸고 싶다. 어쩌면 Linus Torvalds처럼, 혹은 벨 연구소와 IBM 연구소의 많은 사람들 처럼. 내 이름을 직접적을 남기지 않아도 내 작품이 두고두고 무언가의 기반이 되었으면 좋겠다. 내 작품을 컴퓨터 역사에 깊이 뿌리박히게 하는 것. 그게 내 야망이자 꿈인것 같다.

+

내 야망을 이루기 위해서는 컴퓨터를 잘 알아야 할테지.. 컴퓨터라는 기계를 역사부터 원리까지 꿰뚫고 있어야 하겠지. 그것을 위한 여정은 매우 길고 또 험난하겠지. 하지만 운이 좋았다. 나는 그 과정이 정말로 재밌다. 놀지 말고 쉬지 말라고 해도 할 수 있다. 그게 내가 그것을 딴짓이라고 생각한 원인이니까.

+

그게 정말 강한 원동력이었던 것 같다. 컴퓨터 공부를 놀이라고 생각했던 것. 하지만 앞으로는 “공부”를 해야 할 것 같다. 슬금슬금 한계가 다가오고 있기도 했고, 무엇보다 그것만 하면서 살 수는 없으니까. 지금으로써 내가 할 수 있는 것은 이 마음을 잊지 않는 것. 꾸준히 생각하는 것. 기반 지식을 열심히 쌓는 것.

+

그리고 대학교 진학..

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/blog/다른-사람의-집에-산다는-것/index.html b/public/blog/다른-사람의-집에-산다는-것/index.html new file mode 100644 index 0000000..ecd8e3d --- /dev/null +++ b/public/blog/다른-사람의-집에-산다는-것/index.html @@ -0,0 +1,286 @@ + + + + + + + + +다른 사람의 집에 산다는 것 | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ +
+ +
+

+ 다른 사람의 집에 산다는 것 +

+ + +
+
+

우리 집은 창원이다. 어렸을 때 서울에 살다가 초증학교때 창원으로 내려왔고, 중학교 3학년까지 거기서 살아왔다. 고등학교는 기숙사 학교를 가서, 어쨋든 학창시절은 창원에서 지냈다.

+

대학을 서울로 와서 대학 기숙사에 들어가게 되었다. 고등학교때 기숙사는 들어오자마자 화장실과 샤워실을 리모델링 하기도 했고, 전국에서 아마 가장 넓은 방을 가지고 있었지 않을까 싶다. 각 방마다 냉장고도 있고. 하지만 대학교 기숙사는 참담했다. 2/3로 줄어든 엄청 좁은 방에, 낮은 천장, 허술한 난방, 게다가 못 쓸정도로 더러운 화장실과 때와 곰팡이로 가득한 샤워실까지. 고등학교때와는 차원을 달리할 정도로 극악의 기숙사였다. 그래서 그런지, 공용 공간의 위생을 병적으로 집착하는 나에게는 너무 스트레스였다. 여기저기 남이 쓰던 쓰레기나 껌같은 흔적들이 방 곳곳에 있었고, 애초에 너무 더러웠다. 그래서 결국 기숙사에일주일을 못 버티고도망쳐 나왔다. 그렇게 조부모님 댁에 얹혀 살기 시작했고, 1시간의 통학생활이 시작되었다.

+

처음에 통학을 했을 때에는 학교를 가기만 하는게 너무 힘들었고, 어떻게 이렇게 힘들게 학교를다니지라는 걱정만 있었지만, 막상 한달째 통학을 하고 나니 일상 운동도 되고 기숙사와는 달리 정신을 빠릿빠릿하게 세우고 생활을 하게되는 장점도 많았다. 특히 강제적으로라도 기상시간이 앞당겨진다는 것은 일상의 더 빠른 시작을 일으켜 가장 강점이 되었다. 강권의 약속과 술약에서 수월히 빠져나올 수 있는 구실이 된다는 것은 덤.

+

원래의 집에서 생활하는 여타 통학과는 달리 나는 조부모님 댁에서 생활을 하니 삶의 제한이 꽤 자유롭다. 통금 시간도 없고, 부모님의 잔소리도 없어(솔직히 이건 필요하다.) 기숙사의 자유도와 비슷하지 않을까 싶다. 하지만 그만큼의 자유에는 할머니 할아버지의 생활도 최대한 배려하고 눈치를 많이 보면서 살아야 한다는 의무가 따른다.

+

내가 가장 질색하는 몇가지가 있다. 강박에 가까워 고치기 정말 힘든데다 관련된 사소한 것에도 진짜 엄청난 스트레스를 받는다.

+

먼저 바닥에 먼지가 있는 것을 극도로 싫어한다. 발은 항상 깨끗해야 한다. 침대에서 거꾸로 누울때도 걱정없이 잘 수 있을 정도로 발은 청결해야 한다. 하지만 조부모님댁(이하 본가)은 연립주택인데다, 도심에 있어 먼지가 많이 쌓인다. 게다가 청소를 잘 안하신다. 발에 계속 뭔가 달라붙고 먼지가 쌓이고 그것으로 스트레스를 엄청 받았는데, 내가 청소를 하는 것으로 해결되었다. 난 청소를 좋아한다.

+

또, 나는 강박이 있어 밥을 남기지를 못한다. 죽을 것 같아도 밀어 넣는다. 그런 강박이 있다. 그래서 평소에는 음식 냄새를 맡으면 토가 쏠린다. 그런것은 문을 닫으면 해결될 수 있다. 하지만 본가의 세탁기는 부엌을 지나 베란다에 있다. 빨래를 해주시고 말리시는 과정에서 음식에 대해서 많은 일들이 일어난다. 첫번째 항목에와 마찬가지로 음식 먼지, 즉 고춧가루 소금이나 음식에 관련된 사소한 찌꺼기들에 엄청난 스트레스를 받는다. 빨래를 가져오시는 과정에서 음식 먼지가 많이 붙는다. 이건 어떻게 해결해야 할지 감이 안온다. 런드리고라고 빨래 대행까지 생각했는데, 도리가 아닌것 같아서 포기했다. 뭔가를 요구하기에는 얹혀 사는 입장이라 너무 불편하다.

+

내 방은 아무도 청소하지 않았으면 한다. 사생활 그런 문제는 아니고 그냥 ‘있던 그대로’라는 강박 때문이다. 물건이 나도 모르는 새에 위피가 바뀌어 있으면 사소한 것에도 스트레스를 받는다. 이건 어쩔 수 없는 성격상의 결점이라 부탁드리는 수밖에 없을 것 같다.

+

조부모님은 진짜 어려운 관계인 것 같다. 부모님보다는 거리감이 있지만 그 외에서는 가장 가까운 관계이다. 조부모님과 나의 관계는 극단적으로 생각하면 남이지만 사실 소중한 가족이다. 편해진다면 얼마든지 편해질 수 있지만 불편해지면 얼마든지 불편해질 수도 있는것 같다.

+ + +
+ + +
+
+ + + + + + + + + + + diff --git a/public/categories/index.html b/public/categories/index.html new file mode 100644 index 0000000..7545edf --- /dev/null +++ b/public/categories/index.html @@ -0,0 +1,147 @@ + + + + + + + + +Categories | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + +
    +
+
+ + + + + + + + + + diff --git a/public/categories/index.xml b/public/categories/index.xml new file mode 100644 index 0000000..d3b5999 --- /dev/null +++ b/public/categories/index.xml @@ -0,0 +1,10 @@ + + + + Categories on Morgan's Blog + http://blog.morgan.kr/categories/ + Recent content in Categories on Morgan's Blog + Hugo -- gohugo.io + en + + diff --git a/public/favicon-inv.png b/public/favicon-inv.png new file mode 100644 index 0000000..cda654c Binary files /dev/null and b/public/favicon-inv.png differ diff --git a/public/favicon.ico b/public/favicon.ico new file mode 100644 index 0000000..5eb8bd8 Binary files /dev/null and b/public/favicon.ico differ diff --git a/public/favicon.png b/public/favicon.png new file mode 100644 index 0000000..c3bcc9b Binary files /dev/null and b/public/favicon.png differ diff --git a/public/img/screenshot-from-2023-10-25-13-35-28.png b/public/img/screenshot-from-2023-10-25-13-35-28.png new file mode 100644 index 0000000..a821bf2 Binary files /dev/null and b/public/img/screenshot-from-2023-10-25-13-35-28.png differ diff --git a/public/index.html b/public/index.html new file mode 100644 index 0000000..06a668c --- /dev/null +++ b/public/index.html @@ -0,0 +1,371 @@ + + + + + + + + + +Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
Morgan’s Blog
+ +
+ +
+
+

Kernel, PTY and TTY +

+
+
+

PTY (Pseudo-TTY), TTY (TeleTYpewriter). TTY The term TTY originates from the early days of computing when teletype machines were used as the main way for hci. As technology evolved, the physical teletype machines were replaced with virtual terminals or screens, and TTY is used as interface for text-based communication between a user and the system. TTYs can be hardware-based, like a console, or software-based, commonly known as virtual consoles or terminals (e....

+
+
<span title='2023-11-26 10:47:11.631 +0000 UTC'>Nov 26, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Kernel, Process creation +

+
+
+

static int init(void * unused) { lock_kernel(); do_basic_setup(); /* * Ok, we have completed the initial bootup, and * we're essentially up and running. Get rid of the * initmem segments and start the user-mode stuff.. */ free_initmem(); unlock_kernel(); if (open("/dev/console", O_RDWR, 0) < 0) printk("Warning: unable to open an initial console.\n"); (void) dup(0); (void) dup(0); /* * We try each of these until one succeeds. * * The Bourne shell can be used instead of init if we are * trying to recover a really broken machine....

+
+
<span title='2023-11-26 07:44:51.449 +0000 UTC'>Nov 26, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Kernel, Bootloader +

+
+
+

부트로더가 하는 일은 +CPU 초기화 IVT 초기화 하드웨어 초기화 및 커널 찾기 (외부 메모리 인터페이스 초기화 및 파일시스템 인식 과정) 커널을 메모리에 올리고 커널 Entry로 점프 인데, 여기서 부트로더가 커널을 메모리에 올릴때 어디에 어떻게 올리냐가 헷갈렸다. +컴파일 된 커널을 보면 relative 주소로 되어 있는데, 부트로더가 커널의 .data랑 .bss를 다른 프로세스처럼 적절한 곳에 따로 두는 걸로 착각했다. 당연히 부트로더 단계에서는 메모리 매핑이나 페이징이 아직 없고, 커널은 메모리에 매핑이 된게 아니라 고정된 주소에 있어야 한다....

+
+
<span title='2023-11-22 05:35:09.645 +0000 UTC'>Nov 22, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Kernel, syscalls +

+
+
+

sys_fork() .align 2 _sys_fork: call _find_empty_process testl %eax,%eax js 1f push %gs pushl %esi pushl %edi pushl %ebp pushl %eax call _copy_process addl $20,%esp 1: ret FUNCTION find_empty_process() A: IF ++last_pid < 0 last_pid = 1 FOR i : 0 -> NR_TASKS IF task[i] && task[i].pid == last_pid GOTO A FOR i : 1 -> NR_TASKS IF NOT task[i] RETURN i RETURN -1 Set last_pid to 1 or more. +From taskid from 0 to max_tasks, if task exists and pid is last_pid then increases pid and again....

+
+
<span title='2023-11-11 01:22:30 +0000 UTC'>Nov 11, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Chat with GPT, about Nuclear Fission +

+
+
+

I made GPT create a new question about GPT’s response, and repeated it for 10 minutes. +This is log for it. +Question: What is nuclear fission reactor, and what is breeder reactor? +Answer: A nuclear fission reactor is a device used to initiate and control a self-sustained nuclear chain reaction. These reactions are used to generate heat, which is typically used in steam turbines to produce electricity in a nuclear power station....

+
+
<span title='2023-10-27 09:10:25 +0000 UTC'>Oct 27, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Toward an Electronically-Mediated Decentralized Society +

+
+
+

In the long and evolving tapestry of human civilization, each era has been defined by the tools it has harnessed and the political ideologies it has embraced. From the agrarian societies governed by monarchies to the industrial age’s democratic revolutions, the interplay between technology and governance has constantly shaped the contours of societies. Today, as we stand at the crossroads of an unprecedented digital revolution, it’s imperative to reflect on this intricate relationship once more....

+
+
<span title='2023-10-04 21:50:35.465 +0000 UTC'>Oct 4, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

VAE의 손실 함수 +

+
+
+

VAE의 손실 함수는 Variational Lower Bound(VLB)라고도 불리는데, 이 함수는 VAE에서 사용되는 정보량을 측정하는데 사용됩니다. 이 함수는 두 부분으로 나뉘어져 있으며, 이를 분리하여 계산하는 것이 일반적입니다. 이 때, reparametrization trick이란 기법을 사용하면 VAE의 손실 함수의 그래디언트를 계산하는 데 도움이 될 수 있습니다. +먼저, VAE의 손실 함수는 아래와 같이 정의됩니다. +$$L = \mathbb{E}{q(z|x)}[\log p(x|z)] - D{KL}(q(z|x)||p(z))$$ +여기서 $p(x|z)$는 인코더의 출력을 디코더의 입력으로 넣었을 때 생성되는 값을 의미하고, $p(z)$는 잠재 변수의 확률 분포를 의미합니다....

+
+
<span title='2022-12-15 11:21:46.836 +0000 UTC'>Dec 15, 2022</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Spectre Attacks: Exploiting Speculative Execution +

+
+
+

The Central Processing Unit (CPU) is a device that plays a major role as the brain of a computer. The CPU controls four main functions: memory, interpretation, computation, and control, which are based on the role of interpreting the commands of a given program to perform operations with data. In CPU, there are the program counter, a command register, an ALU (arithmetic logic unit), a control unit, a bus, and a register....

+
+
<span title='2021-10-30 07:19:36 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Ad-Tech와 통계의 쓰임새 +

+
+
+

CTR(클릭률) Click-through rate)는 특정 링크를 클릭한 사용자의 비율. Z지수는 표준점수로, 통계학적인 정규분포를 만들고 각각의 경우가 표준편차상의 어떤 위치를 차지하는지를 보여주는 차원없는 수치이다. Z-지수는 원수치가 평균에서 얼마나 떨어져 있는지를 나타내는 지수로, $ z = \frac{z - \mu}{\sigma} $로 나타난다. ($\sigma$ 표준편차, $\mu$는 모집단의 평균이다. +중심극한정리란 표본의 크기가 커질수록 표본 평균의 분포는 모집단의 분포 모양과는 관계없이 정규분표에 가까워진다는 정리이다. +점추정은 모집단의 특성을 단일한 값으로 추정하는 방법으로, 표본평균과 표본분산을 이용해 모집단의 평균과 분산을 계산해 내는 방법이 대표적인 예이다....

+
+
<span title='2021-10-30 07:10:34 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

구글 페이지랭크 알고리즘 +

+
+
+

구글은 방대한 웹페이지를 자사 데이터베이스에 기록하고 있으며, 이를 토대로 사용자가 검색한 검색결과와 가장 매치되는 페이지를 보여줌으로써 검색엔진의 역할을 할 수 있다. 구글이 이렇게까지 클 수 있었던 이유는 정확한 검색 결과를 보여주는 알고리즘 덕분이다. 그렇다면 이 알고리즘은 무엇일까? 구글이 웹페이지들의 관계를 산출하고 그 수치를 계산해내는 알고리즘인 페이지랭크 알고리즘은 구글의 창시자중 한명인 래리 페이지라는 사람이 석사논문으로 발명한 알고리즘이다. PageRank 알고리즘은 각각의 웹 페이지의 상대적 가중치를 계산하여 각각의 중요도와 연관성을 표현하는 방식을 이용하는데, 이를 이용하여 한 페이지와 가장 연관된 다른 페이지를 Rank를 매겨 정확한 연관성을 보여줄 수 있다....

+
+
<span title='2021-10-30 07:07:55 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

양자 컴퓨터와 양자 어닐링 +

+
+
+

양자 컴퓨터와 양자 어닐링 양자 컴퓨터 입문 / 양자 컴퓨팅 발전과 전망 / 1억배 빠른 양자 컴퓨터가 온다 / 스콧 애론슨의 양자 컴퓨터 강의 +양자 컴퓨터란 무엇일까? Ø 현대 컴퓨터의 발전 과정 20세기, 컴퓨터(Computer)란 말은 계산하는 사람, Computing Person이라는 뜻으로 사용되었다. 하지만 단순 반복 행동을 굳이 사람이 하지 않아도 되는, 일명 계산기계가 사용될 수 있음이 증명되면서, Computer라는 말은 ‘일정한 규칙ㅇㄹ 가지고 주어진 값을 토대로 계산하는 장치’라는 의미를 가지게 되었다. +현대적인 컴퓨터의 정의를 시작한 사람은 ‘찰스 배비지’이다....

+
+
<span title='2021-08-06 10:36:03 +0000 UTC'>Aug 6, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Security of IoT +

+
+
+

Security of IoT IoT란? IoT (Internet of Things)란, 독립적으로 존재했던 각종 전자기기 및 사물들이 인터넷으로 엮여 한번에 관리할 수 있게 되거나 상호 정보교환과 데이터 수집을 통해 사용자에게 최상의 서비스를 제공하는 기술을 의미이다. 여기에서 사물이라 함은 전구부터 세탁기, 그리고 신발이나 의류까지 모든 사물을 포함한다. 데이터를 분석하는 과정에서 인공지능을 주로 사용하므로 IoT에는 인공지능 기술이 들어가기도 한다. +IoT는 2013년부터 쭉 개발되어 왔으며 집에서 흔히 볼 수 있는 에어컨, 냉장고등 큰 가구들부터 연결되어 왔다. 그 이후 시간이 지나면서 점점 작은 기구들까지 연결되면서, TV, 전자레인지, 오븐부터 커피포트, 선풍기, 전등 뿐 아니라 변기, 샤워기, 거울, 헤어 드라이기까지 연결되어 있지 않은 것이 없을 정도로 발전되어 왔다....

+
+
<span title='2021-08-06 10:32:57 +0000 UTC'>Aug 6, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Hardware Security +

+
+
+

Hardware Security 신뢰성과 관련된 기술 1. RoT (Root of Trust) Root of Trust, 신뢰점이란, 전자기기 안에서 별도로 존재하는 프로세싱 유닛으로, 메인 프로세서의 보조로서 다양한 암호화 기법이나 솔루션을 제공하거나 이를 제어하기 위한 보안 기능들을 의미한다. RoT가 궁극적으로 달성하고자 하는 것은 TC(Trusted Computing)으로, 신뢰할 수 있는 컴퓨팅, 즉 믿을 만 하고 무결성이 보장되는 계산 및 기능을 이야기한다. 이를 달성하기 위한, RoT에 포함되는 여러가지 기술들이나 알고리즘이 있고, 각 단계들을 순차적으로 달성되어 신뢰할 수 있는 보안적인 프로세스가 진행된다....

+
+
<span title='2021-08-06 10:31:09 +0000 UTC'>Aug 6, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

CFD with Python (Navier-Stokes Equation) +

+
+
+

1-D Linear Convection 1차원 선형 열전도 방정식은 가장 심플하면서도 가장 기초적인 방정식입니다. +$$ \frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0 $$ +이 식을 오일러 방정식으로 변환하여 수치해석적으로 해를 구할 수 있도록 변환을 해줍니다. +$$ ui^{n+1} = u_i^n - c \frac{\Delta t}{\Delta x}(u_i^n-u{i-1}^n) $$ +이제 이 오일러 방정식을 파이썬으로 구현해봅니다. +import numpy from matplotlib import pyplot import time, sys %matplotlib inline nx = 41 # try changing this number from 41 to 81 and Run All ....

+
+
<span title='2021-07-10 08:23:47 +0000 UTC'>Jul 10, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Cryptography +

+
+
+

Cryptography 공개키 암호화 알고리즘. 1. Diffie-Hellman 디피-헬먼 키 교환 방식은 암호화 통신을 위한 키를 교환하는 방식 중 하나이다. 두 통신 주체가 공통의 비밀 키를 사용할 수 있도록 하는 안전한 알고리즘이다. 디피-헬먼 방식은 기초적인 암호 통신 방법으로, 이 알고리즘에 RSA나 ECC같은 암호화 알고리즘을 합쳐서 암호화 통신이 성립된다. 공개키는 암호화할 수 있는 키이고, 개인키는 복호화할 수 있는 키이다. +디피-헬먼 키 교환은 공개키 암호화 방식에 기반한다. 공개키 암호화 방식이란, 자신의 공개키를 상대방에게 전송하고, 그 상대방은 그 공개키로 데이터를 암호화해서 전송하면, 자신은 자신의 개인키로 복호화 할 수 있어, 통신이 성립되는 방식이다....

+
+
<span title='2021-07-09 10:24:00 +0000 UTC'>Jul 9, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

파이썬으로 구현한 뉴턴의 방정식과 적분방정식 +

+
+
+

우리의 세계에서 물체의 역학적 운동을 지배하는, 지배방정식이 있죠.뉴턴의 법칙, 방정식입니다.뉴턴의 법칙은 총 세개의 방정식이 있죠. 이 세가지 법칙만을 이용해서 물체의 운동을 계산할 수 있습니다.이것을 바탕으로 만들어진 역설이 라플라스의 역설이죠. 만약 모든 분자의 가속도, 속도, 위치 세가지 정보를 알고 있다면, 뉴턴의 법칙에 근거하여 그 다음 상황을 예측할 수 있고, 따라서 이 세상, 아니면 그것을 넘어서서 모든 분자의 정보를 알 수 있습니다.우리가 여기서 분석할 것은 가장 쉬운 법칙, 뉴턴의 제 2법칙, 가속도의 법칙입니다....

+
+
<span title='2021-05-21 13:18:27 +0000 UTC'>May 21, 2021</span>&nbsp;·&nbsp;Me
+ +
+
+
+ + + + + + + + + + diff --git a/public/index.xml b/public/index.xml new file mode 100644 index 0000000..2997592 --- /dev/null +++ b/public/index.xml @@ -0,0 +1,354 @@ + + + + Morgan's Blog + http://blog.morgan.kr/ + Recent content on Morgan's Blog + Hugo -- gohugo.io + en + Sun, 26 Nov 2023 10:47:11 +0000 + + Kernel, PTY and TTY + http://blog.morgan.kr/2023/11/kernel-pty-and-tty/ + Sun, 26 Nov 2023 10:47:11 +0000 + + http://blog.morgan.kr/2023/11/kernel-pty-and-tty/ + Linux Kernel #4 + + + + Kernel, Process creation + http://blog.morgan.kr/2023/11/kernel-process-creation/ + Sun, 26 Nov 2023 07:44:51 +0000 + + http://blog.morgan.kr/2023/11/kernel-process-creation/ + Linux Kernel #3 + + + + Kernel, Bootloader + http://blog.morgan.kr/2023/11/kernel-bootloader/ + Wed, 22 Nov 2023 05:35:09 +0000 + + http://blog.morgan.kr/2023/11/kernel-bootloader/ + Linux Kernel #2 + + + + Kernel, syscalls + http://blog.morgan.kr/2023/11/kernel-syscalls/ + Sat, 11 Nov 2023 01:22:30 +0000 + + http://blog.morgan.kr/2023/11/kernel-syscalls/ + Deep dive Linux Kernel #1 + + + + Chat with GPT, about Nuclear Fission + http://blog.morgan.kr/2023/10/chat-with-gpt-about-nuclear-fission/ + Fri, 27 Oct 2023 09:10:25 +0000 + + http://blog.morgan.kr/2023/10/chat-with-gpt-about-nuclear-fission/ + I made GPT create a new question about GPT&rsquo;s response, and repeated it for 10 minutes. +This is log for it. +Question: What is nuclear fission reactor, and what is breeder reactor? +Answer: A nuclear fission reactor is a device used to initiate and control a self-sustained nuclear chain reaction. These reactions are used to generate heat, which is typically used in steam turbines to produce electricity in a nuclear power station. + + + + 미러서버를 운영하면서... + http://blog.morgan.kr/blog/operating-mirroring-server/ + Mon, 23 Oct 2023 09:45:50 +0000 + + http://blog.morgan.kr/blog/operating-mirroring-server/ + operating-mirroring-server + + + + Toward an Electronically-Mediated Decentralized Society + http://blog.morgan.kr/2023/10/toward-an-electronically-mediated-decentralized-society/ + Wed, 04 Oct 2023 21:50:35 +0000 + + http://blog.morgan.kr/2023/10/toward-an-electronically-mediated-decentralized-society/ + The Evolution of Democracy in the Digital Age + + + + About USB-C and DP Alt Mode. + http://blog.morgan.kr/blog/usb-c-and-dp-alt-mode/ + Sat, 06 May 2023 12:55:32 +0000 + + http://blog.morgan.kr/blog/usb-c-and-dp-alt-mode/ + Microsoft Surface Laptop 4 &amp; Linux 제가 밖에서도 쓰고 집에서도 사용하는 만능 서피스 랩탑 4를 사용한지 어느새 2년이 넘었습니다. 그 사이에 리퍼도 받고 OS도 여러번 갈아엎기도 하고, 또 제 하드한 작업들을 잘 버텨주기도 한 정말 대단한 랩탑입니다. +특히 3:2의 광활한 세로는 정말 좋아서 다른 비율의 노트북은 이제 사용할 수 없는 몸이 되어버리기도 했습니다. 길이를 측정해보면 13인치 랩탑들과 동일한데, 세로에 5cm정도를 추가한 정도라 타이틀바 하나정도 넓혀주는 셈이라 마음놓고 패널바를 띄어놓고 사용할 수 있습니다. + + + + VAE의 손실 함수 + http://blog.morgan.kr/2022/12/vae%EC%9D%98-%EC%86%90%EC%8B%A4-%ED%95%A8%EC%88%98/ + Thu, 15 Dec 2022 11:21:46 +0000 + + http://blog.morgan.kr/2022/12/vae%EC%9D%98-%EC%86%90%EC%8B%A4-%ED%95%A8%EC%88%98/ + VAE의 손실 함수는 Variational Lower Bound(VLB)라고도 불리는데, 이 함수는 VAE에서 사용되는 정보량을 측정하는데 사용됩니다. 이 함수는 두 부분으로 나뉘어져 있으며, 이를 분리하여 계산하는 것이 일반적입니다. 이 때, reparametrization trick이란 기법을 사용하면 VAE의 손실 함수의 그래디언트를 계산하는 데 도움이 될 수 있습니다. +먼저, VAE의 손실 함수는 아래와 같이 정의됩니다. +$$L = \mathbb{E}{q(z|x)}[\log p(x|z)] - D{KL}(q(z|x)||p(z))$$ +여기서 $p(x|z)$는 인코더의 출력을 디코더의 입력으로 넣었을 때 생성되는 값을 의미하고, $p(z)$는 잠재 변수의 확률 분포를 의미합니다. + + + + 선택실패 + http://blog.morgan.kr/blog/2022041406/ + Thu, 14 Apr 2022 06:55:25 +0000 + + http://blog.morgan.kr/blog/2022041406/ + 고등학교 3학년 때까지만 해도 나는 무조건 컴퓨터 공학과나 전기전자 공학과. 학과만 보고 대학교에 진학하리라 마음먹었었다. 진짜 학교 이름은 절대 보지 않을 것이라 생각했다. 하지만 막상 입시에 처하고 선택의 갈림길에 있으니 그 다짐은 물거품이 되었다. +역시나, 아니나 다를까 원서 접수 기간이 되니 진로 담당 선생님은 실적을 위해 상위 대학교의 낮은 학과에 원서를 넣어볼 것을 추천하셨다. 말이 추천이지 반 강제로 넣게 되었다. 아무런 관심도 없었고, 3년동안 생각도 없었는데다 자기소개서도 짜맞춰야 쓸 수 있는 학과에 지원했다. + + + + 다른 사람의 집에 산다는 것 + http://blog.morgan.kr/blog/%EB%8B%A4%EB%A5%B8-%EC%82%AC%EB%9E%8C%EC%9D%98-%EC%A7%91%EC%97%90-%EC%82%B0%EB%8B%A4%EB%8A%94-%EA%B2%83/ + Sat, 09 Apr 2022 04:02:17 +0000 + + http://blog.morgan.kr/blog/%EB%8B%A4%EB%A5%B8-%EC%82%AC%EB%9E%8C%EC%9D%98-%EC%A7%91%EC%97%90-%EC%82%B0%EB%8B%A4%EB%8A%94-%EA%B2%83/ + 우리 집은 창원이다. 어렸을 때 서울에 살다가 초증학교때 창원으로 내려왔고, 중학교 3학년까지 거기서 살아왔다. 고등학교는 기숙사 학교를 가서, 어쨋든 학창시절은 창원에서 지냈다. +대학을 서울로 와서 대학 기숙사에 들어가게 되었다. 고등학교때 기숙사는 들어오자마자 화장실과 샤워실을 리모델링 하기도 했고, 전국에서 아마 가장 넓은 방을 가지고 있었지 않을까 싶다. 각 방마다 냉장고도 있고. 하지만 대학교 기숙사는 참담했다. 2/3로 줄어든 엄청 좁은 방에, 낮은 천장, 허술한 난방, 게다가 못 쓸정도로 더러운 화장실과 때와 곰팡이로 가득한 샤워실까지. + + + + 고등학교 돌아보기 + http://blog.morgan.kr/blog/godeunghaggyo-dolabogi/ + Tue, 21 Dec 2021 16:23:55 +0000 + + http://blog.morgan.kr/blog/godeunghaggyo-dolabogi/ + 2021년을 돌아보며. +2021.12.22 +벌써 12월 22일이다. 12월달에는 열심히 살아야지 하던게 어제같은데 벌써 새해가 다가온다. 나는 내년 성인이 되지만, 아직 실감이 안난다. 술담배를 할 수 있는 나이라기 보다는 내 행동에 내가 책임져야 하는 때가 되었다는 게 더 실감이 난다. 대학을 고민하며 내가 앞으로 뭘 하면서 먹고 살아야할지 꽤 오랫동안 고심했는데, 그 결과로 조금 성장한 것 같아 이제와서는 약간 기쁘기도 하고 무섭기도 하면서 슬픈 약간 오묘한 기분이다. 어찌되었든 이제 성인이 되니까 조금 변해야겠다고 다짐하고 있다. + + + + 대학 입시가 한단계만 남았다. + http://blog.morgan.kr/blog/daehag-ibsiga-handangye-namassda/ + Wed, 01 Dec 2021 08:09:52 +0000 + + http://blog.morgan.kr/blog/daehag-ibsiga-handangye-namassda/ + 대학 입시가 한단계만을 앞두고 있다. +합격자 발표와 등록. +뭐 공부하고 대비해야하는 시험은 다 끝났으니 마음껏 놀고 있지만 마음의 한편에는 아직 불안함이 많이 존재하고 있다. 또 공부와 시험대비라는 정해져 있는 계획만을 12년 동안 따르던 나에게서 갑자기 계획이나 강제성이 사라졌다. 이제부터는 내가 무엇을 할 것인지를 나 혼자서 알아서 결정해야 하고 또한 그 책임도 내가 져야할 것이다. 예를 들어 늦게자도 누군가 깨워주지 않는다는 것에서 그것을 처음으로 느꼈다. +지금 하고싶은 것도 없다. 무언가 해야하는 것도 딱히 없다. + + + + Spectre Attacks: Exploiting Speculative Execution + http://blog.morgan.kr/2021/10/spectre-attacks-exploiting-speculative-execution/ + Sat, 30 Oct 2021 07:19:36 +0000 + + http://blog.morgan.kr/2021/10/spectre-attacks-exploiting-speculative-execution/ + The Central Processing Unit (CPU) is a device that plays a major role as the brain of a computer. The CPU controls four main functions: memory, interpretation, computation, and control, which are based on the role of interpreting the commands of a given program to perform operations with data. In CPU, there are the program counter, a command register, an ALU (arithmetic logic unit), a control unit, a bus, and a register. + + + + 전자 제어의 세계인 미래, 그 보안의 위협 + http://blog.morgan.kr/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/ + Sat, 30 Oct 2021 07:17:47 +0000 + + http://blog.morgan.kr/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/ + 미래 사회에는 전기자동차와 자율주행 자동차가 성하게 유행할 것이다. 사람 운전자의 역할이 거의 축소되고, AI나 전자적으로 제어될 것인데, 지금도 많이 일어나고 있는 논란은 바로 보안이다. 만약 자율주행 자동차가 해킹을 당하게 된다면 어떨까? 해커는 자동차에 타고 있는 사람의 생사여탈권을 가지게 될 정도로 심각한 문제가 있는 것이다. 그러므로, 이러한 생활환경에 직접적인 영향을 주는 전자기기의 보안은 매우 중요한 것으로 판단된다. 미래에 우리의 생활을 가장 많은 부분 담당할 사물인터넷도 마찬가지이다. 우리의 생활과 강하게 연관되어 있고, 그러므로 보안이 가장 주요한 요인이 된다. + + + + Ad-Tech와 통계의 쓰임새 + http://blog.morgan.kr/2021/10/ad-tech%EC%99%80-%ED%86%B5%EA%B3%84%EC%9D%98-%EC%93%B0%EC%9E%84%EC%83%88/ + Sat, 30 Oct 2021 07:10:34 +0000 + + http://blog.morgan.kr/2021/10/ad-tech%EC%99%80-%ED%86%B5%EA%B3%84%EC%9D%98-%EC%93%B0%EC%9E%84%EC%83%88/ + CTR(클릭률) Click-through rate)는 특정 링크를 클릭한 사용자의 비율. Z지수는 표준점수로, 통계학적인 정규분포를 만들고 각각의 경우가 표준편차상의 어떤 위치를 차지하는지를 보여주는 차원없는 수치이다. Z-지수는 원수치가 평균에서 얼마나 떨어져 있는지를 나타내는 지수로, $ z = \frac{z - \mu}{\sigma} $로 나타난다. ($\sigma$ 표준편차, $\mu$는 모집단의 평균이다. +중심극한정리란 표본의 크기가 커질수록 표본 평균의 분포는 모집단의 분포 모양과는 관계없이 정규분표에 가까워진다는 정리이다. +점추정은 모집단의 특성을 단일한 값으로 추정하는 방법으로, 표본평균과 표본분산을 이용해 모집단의 평균과 분산을 계산해 내는 방법이 대표적인 예이다. + + + + 양자들의 트랜지스터와 핫 캐리어 효과 + http://blog.morgan.kr/blog/yangjadeulyi-teuraenjiseuteo/ + Sat, 30 Oct 2021 07:09:53 +0000 + + http://blog.morgan.kr/blog/yangjadeulyi-teuraenjiseuteo/ + 트랜지스터가 점점 소형화가 되어가면서 전자가 예상한대로 움직이지 않는 작은 단위까지 내려갔다. 나노단위까지 생산공정이 작아지면서 양자역학적인 효과가 나타나기 시작했고, 이는 트랜지스터의 스위칭 작용을 방해하는 효과를 불어일으킨다. 이를 해결하기 위해서 양자 세계에서 사용할 수 있는 양자 트랜지스터와 단일 원자 트랜지스터가 개발되었다. +단일원자 트랜지스터 단일원자 트랜지스터는 양자 터널링 효과를 적극적으로 이용하여 스위칭 작용을 한다. 터널링 효과를 제어하기 위해서 직접 제어가 아닌 양자 얽힘 효과를 이용한다. 큐비트를 이용하여, 전자 주개로써의 원자를 제어하기 위해 원자 개개별의 스핀 상태를 이용한다. + + + + 구글 페이지랭크 알고리즘 + http://blog.morgan.kr/2021/10/%EA%B5%AC%EA%B8%80-%ED%8E%98%EC%9D%B4%EC%A7%80%EB%9E%AD%ED%81%AC-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98/ + Sat, 30 Oct 2021 07:07:55 +0000 + + http://blog.morgan.kr/2021/10/%EA%B5%AC%EA%B8%80-%ED%8E%98%EC%9D%B4%EC%A7%80%EB%9E%AD%ED%81%AC-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98/ + 구글은 방대한 웹페이지를 자사 데이터베이스에 기록하고 있으며, 이를 토대로 사용자가 검색한 검색결과와 가장 매치되는 페이지를 보여줌으로써 검색엔진의 역할을 할 수 있다. 구글이 이렇게까지 클 수 있었던 이유는 정확한 검색 결과를 보여주는 알고리즘 덕분이다. 그렇다면 이 알고리즘은 무엇일까? 구글이 웹페이지들의 관계를 산출하고 그 수치를 계산해내는 알고리즘인 페이지랭크 알고리즘은 구글의 창시자중 한명인 래리 페이지라는 사람이 석사논문으로 발명한 알고리즘이다. PageRank 알고리즘은 각각의 웹 페이지의 상대적 가중치를 계산하여 각각의 중요도와 연관성을 표현하는 방식을 이용하는데, 이를 이용하여 한 페이지와 가장 연관된 다른 페이지를 Rank를 매겨 정확한 연관성을 보여줄 수 있다. + + + + 인생 두번째 실패. 두번째 대학탈락. + http://blog.morgan.kr/blog/insaeng-dubeonjjae-silpae/ + Sat, 23 Oct 2021 08:52:59 +0000 + + http://blog.morgan.kr/blog/insaeng-dubeonjjae-silpae/ + 내 첫번째 실패는 조기진학 실패이다. 대학을 떨어졌다. +내 두번째 실패도 대학 탈락이다. 이번엔 아직 9번 더 있지만, 작년에 떨어지고 느꼈던 그 참담함과 그 마음가짐을 다시 한번 느낄 수 있게 한 그 세글자 &lsquo;불합격&rsquo;. 역시 이번에도 참담함을 느꼈고, 여전히 안타까움과 공허함을 느낄 수 있었다. +내심 기대했었다. 붙기를 간절히 기도했다. 하지만 세상은 냉정했다. +바라던게 이제는 이룰 수 없다고 생각하니 공허했다. 하지만 그것도 잠깐이었다. 멘탈이 강하고 회복력도 강한게 내 장점이라 공허함으로 쳐져있는 것도 잠깐이었고, 앞으로를 다시 생각하고 마음가짐을 고치는 계기가 되었다. + + + + 나는 무엇을 하고 있는걸까 + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%98%EA%B3%A0-%EC%9E%88%EB%8A%94%EA%B1%B8%EA%B9%8C/ + Sat, 23 Oct 2021 08:52:15 +0000 + + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%98%EA%B3%A0-%EC%9E%88%EB%8A%94%EA%B1%B8%EA%B9%8C/ + 프로그래밍에 매력을 느껴 프로그래밍에 입덕하게 된 건 2학년때쯤.. 이후 그 재미를 느끼고 많은 것들을 시도해보곤 했다. HTML과 CSS를 배워 가장 기본적인 웹사이트를 만들고, 이를 더 화려하게 꾸미기 위해 JS를 공부했다. 이를 배포하기 위해 서버 구축에 대해 공부했고, PHP나 MySQL을 이용해 기능성을 부여하면서 DB와 SQL에 대해 공부했다. 이후 고전적인 서버를 넘어 SSR이나 CSR에 대해 알아보려 NodeJS를 공부했다. 학교 입학시 과제였던 C로 하는 PS를 하면서 C나 C++에 관심을 가졌고, 왜 C로 코딩하는데 C++를 써야하는지 의문을 가지고 C++을 공부했다. + + + + 학교에서 했던 프로젝트들.. + http://blog.morgan.kr/blog/haggyoeseo-haessdeon-peurojegteudeul/ + Sat, 23 Oct 2021 08:51:44 +0000 + + http://blog.morgan.kr/blog/haggyoeseo-haessdeon-peurojegteudeul/ + 귀가시간 수집 프로그램 기상곡 수집 프로그램 컴퓨터실 사용현황 학교 내부 정보공유망 문서파일 자동저장 및 복구 시스템 학교 저지 사이트 API 정리 및 제출시스템 프록시 선생님들이 부탁하셨던 수많은 프로그램들 + + + + 개인정보.. Privacy.. + http://blog.morgan.kr/blog/gaeinjeongbo-privacy/ + Sat, 23 Oct 2021 08:31:52 +0000 + + http://blog.morgan.kr/blog/gaeinjeongbo-privacy/ + 나는 구글이 싫었다. +구글에 반대하며 지메일도 거의 쓰지 않고 있고, 다른 구글 플랫폼을 벗어나 다른 플랫폼으로 옮기고 있다. 하지만, 아이폰으로 옮기고 나서 몇주간을 생각해보니 내 분노의 대상은 구글이 아니라 애플이여야 한다는 것을 알게 되었다. 카카오, 구글에 가지고 있던 분노의 이유가 애플이라는 기업 자체를 강타한다. 물론 나도 알고 있었고, 구글 못지 않게 애플을 싫어하고 있었다. 새롭게 휴대폰을바꿀 때에도 OS만 구글이고 제조사는 다양한 (삼성이..겟지만..) 안드로이드 휴대폰과 휴대폰 하드웨어, 악세사리, OS, 결제, 게다가 웹엔진까지 제한하고 독점해버린 애플과는 비교가 된지 않는다고 생각했고, 이번에 플립이 잘 나와서 그것으로 바꾸려 했다. + + + + 데이터센터 + http://blog.morgan.kr/blog/datacenter/ + Sat, 23 Oct 2021 08:15:14 +0000 + + http://blog.morgan.kr/blog/datacenter/ + 구글같은 검색엔진이 늘어나고, 다양한 기업들과 서비스들이 사용자들의 개인정보와 데이터를 마구 수집한다. 이로 인해 생겨나는 기하급수적인 양의 데이터들을 보관할 스토리지와 그것들을 사용할 수 있는 데이터로 가공하기 위해 필요한 수없이 큰 컴퓨팅 파워를, 큰 기업들이 대형으로 지어놓은 데이터 센터가 담당하고 있다. 게다가 이제는 작은 기업이나 서비스들은 AWS나 GCP, Oracle과 같은 서비스를 통해 Cloud로 Computing하기까지 하니, 아마존이나 구글의 데이터 센터는 얼마나 커다랗고, 커다래야 하는지 알 수 있다. +아마존과 구글의 데이터센터뿐 아니라 네이버, MS, 오라클, 및 작은 데이터센터들이 지어질때 중요하게 작용하는 것이 있다. + + + + 블로그 글쓰기는 너무 힘들어.. + http://blog.morgan.kr/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/ + Fri, 08 Oct 2021 05:19:00 +0000 + + http://blog.morgan.kr/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/ + 야심차게 티스토리 블로그를 만들어 몇몇 글을 쓰고 나서, 한참동안이나 글을 쓰지 않았다. 하지만 나중에 돌아보면 쓰일 곳이 있지 않을까 하여 내 소장을 위해 Ghost + Vultr로 넘어왔고, 돈도 내야 하니까 글을 조금씩이라도 쓰지 않을까 생각했지만&hellip;. 결국 글을 쓰지도 않은 채 달마다 돈만 나가고 있다&hellip; +블로그 글을 왜 쓰지 않았지..? 고등학교 생활을 하느라 힘들고 바빠서 (노느라) 글을 쓰지 않았을 수도 있고, 마땅하게 글을 쓸만한 소재도 없고, 마땅하게 글을 쓸 기기 또한 없다. + + + + 나는 무엇을 해야 하는걸까 + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%B4%EC%95%BC-%ED%95%98%EB%8A%94%EA%B1%B8%EA%B9%8C/ + Sat, 11 Sep 2021 01:20:00 +0000 + + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%B4%EC%95%BC-%ED%95%98%EB%8A%94%EA%B1%B8%EA%B9%8C/ + 대학 탈락 이후 나는 대학을 한번 떨어진 경험이 있다. 과학고등학교 재학생 중 중상위권이었던 나는 조기진학의 기회를 받았고, KAIST만을 넣은 채로 떨어졌다. 그 때는 붙을 줄 알고 있어서 2학년 2학기 시험을 말아먹었고, 지금도 그 영향을 받아 피를 흘리고 있다. +다행히 그 이후 각성을 한건지 철이 든건지 3학년 1학기는 최상위권 성적을 받아 원래대로 유지는 할 수 있었다. 3-4등 정도 했으니까 망정이지 태도를 안고치고 그대로 했더라면 나는 그대로 멘탈이 없어져버렸을 것이다. +오늘까지 자기소개서를 작성했다. + + + + Attitude for criticism + http://blog.morgan.kr/blog/attitude-for-criticism/ + Fri, 10 Sep 2021 07:30:10 +0000 + + http://blog.morgan.kr/blog/attitude-for-criticism/ + 요즘 우리 학교에 학교를 개혁하겠다는 학생회장이 나타나고 나서부터 친구들이 학교에 대한 여러 가지 불만들을 풀어내기 시작했다. 나도 마찬가지로 학교에 대한 여러 가지 불만사항들이 많았다. 나는 매 학기마다 개정된 학교 교칙이나 규정들을 정독하는 이벤트를 가지는데, 그때마다 항상 &lsquo;아, 학생들이 당연히 너무 불리하다..&rsquo; 라던가, &lsquo;이 조항은 너무 아닌데, 너무 구시대적인 생각이 아닌가?&lsquo;라는 생각이 들기도 한다. +대학을 가야하는 시기라서 여러 학교들의 생활이나 공부방법, 대학 진학 상황들에 대해서 더욱 관심을 가지게 되었다. 특히 전국급 자사고나 타 지역 과학고의 생활과 공부습관? + + + + 양자 컴퓨터와 양자 어닐링 + http://blog.morgan.kr/2021/08/%EC%96%91%EC%9E%90-%EC%BB%B4%ED%93%A8%ED%84%B0%EC%99%80-%EC%96%91%EC%9E%90-%EC%96%B4%EB%8B%90%EB%A7%81/ + Fri, 06 Aug 2021 10:36:03 +0000 + + http://blog.morgan.kr/2021/08/%EC%96%91%EC%9E%90-%EC%BB%B4%ED%93%A8%ED%84%B0%EC%99%80-%EC%96%91%EC%9E%90-%EC%96%B4%EB%8B%90%EB%A7%81/ + 양자 컴퓨터와 양자 어닐링 양자 컴퓨터 입문 / 양자 컴퓨팅 발전과 전망 / 1억배 빠른 양자 컴퓨터가 온다 / 스콧 애론슨의 양자 컴퓨터 강의 +양자 컴퓨터란 무엇일까? Ø 현대 컴퓨터의 발전 과정 20세기, 컴퓨터(Computer)란 말은 계산하는 사람, Computing Person이라는 뜻으로 사용되었다. 하지만 단순 반복 행동을 굳이 사람이 하지 않아도 되는, 일명 계산기계가 사용될 수 있음이 증명되면서, Computer라는 말은 ‘일정한 규칙ㅇㄹ 가지고 주어진 값을 토대로 계산하는 장치’라는 의미를 가지게 되었다. +현대적인 컴퓨터의 정의를 시작한 사람은 ‘찰스 배비지’이다. + + + + Security of IoT + http://blog.morgan.kr/2021/08/security-of-iot/ + Fri, 06 Aug 2021 10:32:57 +0000 + + http://blog.morgan.kr/2021/08/security-of-iot/ + Security of IoT IoT란? IoT (Internet of Things)란, 독립적으로 존재했던 각종 전자기기 및 사물들이 인터넷으로 엮여 한번에 관리할 수 있게 되거나 상호 정보교환과 데이터 수집을 통해 사용자에게 최상의 서비스를 제공하는 기술을 의미이다. 여기에서 사물이라 함은 전구부터 세탁기, 그리고 신발이나 의류까지 모든 사물을 포함한다. 데이터를 분석하는 과정에서 인공지능을 주로 사용하므로 IoT에는 인공지능 기술이 들어가기도 한다. +IoT는 2013년부터 쭉 개발되어 왔으며 집에서 흔히 볼 수 있는 에어컨, 냉장고등 큰 가구들부터 연결되어 왔다. 그 이후 시간이 지나면서 점점 작은 기구들까지 연결되면서, TV, 전자레인지, 오븐부터 커피포트, 선풍기, 전등 뿐 아니라 변기, 샤워기, 거울, 헤어 드라이기까지 연결되어 있지 않은 것이 없을 정도로 발전되어 왔다. + + + + Hardware Security + http://blog.morgan.kr/2021/08/hardware-security/ + Fri, 06 Aug 2021 10:31:09 +0000 + + http://blog.morgan.kr/2021/08/hardware-security/ + Hardware Security 신뢰성과 관련된 기술 1. RoT (Root of Trust) Root of Trust, 신뢰점이란, 전자기기 안에서 별도로 존재하는 프로세싱 유닛으로, 메인 프로세서의 보조로서 다양한 암호화 기법이나 솔루션을 제공하거나 이를 제어하기 위한 보안 기능들을 의미한다. RoT가 궁극적으로 달성하고자 하는 것은 TC(Trusted Computing)으로, 신뢰할 수 있는 컴퓨팅, 즉 믿을 만 하고 무결성이 보장되는 계산 및 기능을 이야기한다. 이를 달성하기 위한, RoT에 포함되는 여러가지 기술들이나 알고리즘이 있고, 각 단계들을 순차적으로 달성되어 신뢰할 수 있는 보안적인 프로세스가 진행된다. + + + + CFD with Python (Navier-Stokes Equation) + http://blog.morgan.kr/2021/07/cfd-with-python-navier-stokes-equation/ + Sat, 10 Jul 2021 08:23:47 +0000 + + http://blog.morgan.kr/2021/07/cfd-with-python-navier-stokes-equation/ + 1-D Linear Convection 1차원 선형 열전도 방정식은 가장 심플하면서도 가장 기초적인 방정식입니다. +$$ \frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0 $$ +이 식을 오일러 방정식으로 변환하여 수치해석적으로 해를 구할 수 있도록 변환을 해줍니다. +$$ ui^{n+1} = u_i^n - c \frac{\Delta t}{\Delta x}(u_i^n-u{i-1}^n) $$ +이제 이 오일러 방정식을 파이썬으로 구현해봅니다. +import numpy from matplotlib import pyplot import time, sys %matplotlib inline nx = 41 # try changing this number from 41 to 81 and Run All . + + + + Cryptography + http://blog.morgan.kr/2021/07/cryptography/ + Fri, 09 Jul 2021 10:24:00 +0000 + + http://blog.morgan.kr/2021/07/cryptography/ + Cryptography 공개키 암호화 알고리즘. 1. Diffie-Hellman 디피-헬먼 키 교환 방식은 암호화 통신을 위한 키를 교환하는 방식 중 하나이다. 두 통신 주체가 공통의 비밀 키를 사용할 수 있도록 하는 안전한 알고리즘이다. 디피-헬먼 방식은 기초적인 암호 통신 방법으로, 이 알고리즘에 RSA나 ECC같은 암호화 알고리즘을 합쳐서 암호화 통신이 성립된다. 공개키는 암호화할 수 있는 키이고, 개인키는 복호화할 수 있는 키이다. +디피-헬먼 키 교환은 공개키 암호화 방식에 기반한다. 공개키 암호화 방식이란, 자신의 공개키를 상대방에게 전송하고, 그 상대방은 그 공개키로 데이터를 암호화해서 전송하면, 자신은 자신의 개인키로 복호화 할 수 있어, 통신이 성립되는 방식이다. + + + + 시험을 일주일 앞두고 + http://blog.morgan.kr/blog/20210620-siheomeul-iljuil-apdugo/ + Sun, 20 Jun 2021 09:23:28 +0000 + + http://blog.morgan.kr/blog/20210620-siheomeul-iljuil-apdugo/ + 지금까지 내 인생에서 가장 중요한 시험. 그 시험이 일부일 앞으로 다가왔다. 하루종일 시험공부 비슷한걸 하면서 심신이 지쳐 더 이상 집중을 할 수 없을 것 같다. 이제 이 고비만 넘기면 인생에서 가장 날아다닌다는 시기, 대학생이 된다. 앞으로 뭘 하고 살아야 할지, 무엇을 하고 싶은지, 내가 아는 게 많아지고 현실을 깨달으면서 철이 드니 생각이 복잡해지고 앞길이 막막하기만 하다. +몇일 전, 작년에 대학 원서 자기소개서를 다시 읽다 보니 내가 아는 게 많아졌음을 새삼 깨달았다. + + + + 파이썬으로 구현한 뉴턴의 방정식과 적분방정식 + http://blog.morgan.kr/2021/05/%ED%8C%8C%EC%9D%B4%EC%8D%AC%EC%9C%BC%EB%A1%9C-%EA%B5%AC%ED%98%84%ED%95%9C-%EB%89%B4%ED%84%B4%EC%9D%98-%EB%B0%A9%EC%A0%95%EC%8B%9D%EA%B3%BC-%EC%A0%81%EB%B6%84%EB%B0%A9%EC%A0%95%EC%8B%9D/ + Fri, 21 May 2021 13:18:27 +0000 + + http://blog.morgan.kr/2021/05/%ED%8C%8C%EC%9D%B4%EC%8D%AC%EC%9C%BC%EB%A1%9C-%EA%B5%AC%ED%98%84%ED%95%9C-%EB%89%B4%ED%84%B4%EC%9D%98-%EB%B0%A9%EC%A0%95%EC%8B%9D%EA%B3%BC-%EC%A0%81%EB%B6%84%EB%B0%A9%EC%A0%95%EC%8B%9D/ + 우리의 세계에서 물체의 역학적 운동을 지배하는, 지배방정식이 있죠.뉴턴의 법칙, 방정식입니다.뉴턴의 법칙은 총 세개의 방정식이 있죠. 이 세가지 법칙만을 이용해서 물체의 운동을 계산할 수 있습니다.이것을 바탕으로 만들어진 역설이 라플라스의 역설이죠. 만약 모든 분자의 가속도, 속도, 위치 세가지 정보를 알고 있다면, 뉴턴의 법칙에 근거하여 그 다음 상황을 예측할 수 있고, 따라서 이 세상, 아니면 그것을 넘어서서 모든 분자의 정보를 알 수 있습니다.우리가 여기서 분석할 것은 가장 쉬운 법칙, 뉴턴의 제 2법칙, 가속도의 법칙입니다. + + + + 나는 무엇을 하고 싶은 걸까.. + http://blog.morgan.kr/blog/what-i-wanted-to-do/ + Thu, 28 Jan 2021 06:14:00 +0000 + + http://blog.morgan.kr/blog/what-i-wanted-to-do/ + 나는 개발자가 되고 싶었다. 그래서 나 나름대로 여러가지 언어를 배우기도 했고 컴퓨터 관련된 여러 가지 활동을 하면서 나의 꿈을 키워나간다고 믿었다. 고등학교를 다니면서 외적으로 개인적인 공부도 많이 하고 있고, 이를 바탕으로 진로를 정하려고 했다. 고등학교 3학년이라 앞으로의 진로를 정해야 했고, 이런 저런 고민을 하다 보니 내가 공부했던 것들이, 또 내가 알고 있는 것들이 단순히 빙산의 일각이라는 사실을 깨달았다. +과학고를 다니는 덕에 수학적인 내용을 기본으로 하는 여러가지 컴퓨터 분야에 대해서는 나름 쉽게 공부할 수 있었다. + + + + diff --git a/public/page/1/index.html b/public/page/1/index.html new file mode 100644 index 0000000..3fabbdd --- /dev/null +++ b/public/page/1/index.html @@ -0,0 +1,10 @@ + + + + http://blog.morgan.kr/ + + + + + + diff --git a/public/posts/index.html b/public/posts/index.html new file mode 100644 index 0000000..c97c22f --- /dev/null +++ b/public/posts/index.html @@ -0,0 +1,376 @@ + + + + + + + + +Posts | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+

+ Posts +

+
+ +
+ +
+
+

Kernel, PTY and TTY +

+
+
+

PTY (Pseudo-TTY), TTY (TeleTYpewriter). TTY The term TTY originates from the early days of computing when teletype machines were used as the main way for hci. As technology evolved, the physical teletype machines were replaced with virtual terminals or screens, and TTY is used as interface for text-based communication between a user and the system. TTYs can be hardware-based, like a console, or software-based, commonly known as virtual consoles or terminals (e....

+
+
<span title='2023-11-26 10:47:11.631 +0000 UTC'>Nov 26, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Kernel, Process creation +

+
+
+

static int init(void * unused) { lock_kernel(); do_basic_setup(); /* * Ok, we have completed the initial bootup, and * we're essentially up and running. Get rid of the * initmem segments and start the user-mode stuff.. */ free_initmem(); unlock_kernel(); if (open("/dev/console", O_RDWR, 0) < 0) printk("Warning: unable to open an initial console.\n"); (void) dup(0); (void) dup(0); /* * We try each of these until one succeeds. * * The Bourne shell can be used instead of init if we are * trying to recover a really broken machine....

+
+
<span title='2023-11-26 07:44:51.449 +0000 UTC'>Nov 26, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Kernel, Bootloader +

+
+
+

부트로더가 하는 일은 +CPU 초기화 IVT 초기화 하드웨어 초기화 및 커널 찾기 (외부 메모리 인터페이스 초기화 및 파일시스템 인식 과정) 커널을 메모리에 올리고 커널 Entry로 점프 인데, 여기서 부트로더가 커널을 메모리에 올릴때 어디에 어떻게 올리냐가 헷갈렸다. +컴파일 된 커널을 보면 relative 주소로 되어 있는데, 부트로더가 커널의 .data랑 .bss를 다른 프로세스처럼 적절한 곳에 따로 두는 걸로 착각했다. 당연히 부트로더 단계에서는 메모리 매핑이나 페이징이 아직 없고, 커널은 메모리에 매핑이 된게 아니라 고정된 주소에 있어야 한다....

+
+
<span title='2023-11-22 05:35:09.645 +0000 UTC'>Nov 22, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Kernel, syscalls +

+
+
+

sys_fork() .align 2 _sys_fork: call _find_empty_process testl %eax,%eax js 1f push %gs pushl %esi pushl %edi pushl %ebp pushl %eax call _copy_process addl $20,%esp 1: ret FUNCTION find_empty_process() A: IF ++last_pid < 0 last_pid = 1 FOR i : 0 -> NR_TASKS IF task[i] && task[i].pid == last_pid GOTO A FOR i : 1 -> NR_TASKS IF NOT task[i] RETURN i RETURN -1 Set last_pid to 1 or more. +From taskid from 0 to max_tasks, if task exists and pid is last_pid then increases pid and again....

+
+
<span title='2023-11-11 01:22:30 +0000 UTC'>Nov 11, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Chat with GPT, about Nuclear Fission +

+
+
+

I made GPT create a new question about GPT’s response, and repeated it for 10 minutes. +This is log for it. +Question: What is nuclear fission reactor, and what is breeder reactor? +Answer: A nuclear fission reactor is a device used to initiate and control a self-sustained nuclear chain reaction. These reactions are used to generate heat, which is typically used in steam turbines to produce electricity in a nuclear power station....

+
+
<span title='2023-10-27 09:10:25 +0000 UTC'>Oct 27, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Toward an Electronically-Mediated Decentralized Society +

+
+
+

In the long and evolving tapestry of human civilization, each era has been defined by the tools it has harnessed and the political ideologies it has embraced. From the agrarian societies governed by monarchies to the industrial age’s democratic revolutions, the interplay between technology and governance has constantly shaped the contours of societies. Today, as we stand at the crossroads of an unprecedented digital revolution, it’s imperative to reflect on this intricate relationship once more....

+
+
<span title='2023-10-04 21:50:35.465 +0000 UTC'>Oct 4, 2023</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

VAE의 손실 함수 +

+
+
+

VAE의 손실 함수는 Variational Lower Bound(VLB)라고도 불리는데, 이 함수는 VAE에서 사용되는 정보량을 측정하는데 사용됩니다. 이 함수는 두 부분으로 나뉘어져 있으며, 이를 분리하여 계산하는 것이 일반적입니다. 이 때, reparametrization trick이란 기법을 사용하면 VAE의 손실 함수의 그래디언트를 계산하는 데 도움이 될 수 있습니다. +먼저, VAE의 손실 함수는 아래와 같이 정의됩니다. +$$L = \mathbb{E}{q(z|x)}[\log p(x|z)] - D{KL}(q(z|x)||p(z))$$ +여기서 $p(x|z)$는 인코더의 출력을 디코더의 입력으로 넣었을 때 생성되는 값을 의미하고, $p(z)$는 잠재 변수의 확률 분포를 의미합니다....

+
+
<span title='2022-12-15 11:21:46.836 +0000 UTC'>Dec 15, 2022</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Spectre Attacks: Exploiting Speculative Execution +

+
+
+

The Central Processing Unit (CPU) is a device that plays a major role as the brain of a computer. The CPU controls four main functions: memory, interpretation, computation, and control, which are based on the role of interpreting the commands of a given program to perform operations with data. In CPU, there are the program counter, a command register, an ALU (arithmetic logic unit), a control unit, a bus, and a register....

+
+
<span title='2021-10-30 07:19:36 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Ad-Tech와 통계의 쓰임새 +

+
+
+

CTR(클릭률) Click-through rate)는 특정 링크를 클릭한 사용자의 비율. Z지수는 표준점수로, 통계학적인 정규분포를 만들고 각각의 경우가 표준편차상의 어떤 위치를 차지하는지를 보여주는 차원없는 수치이다. Z-지수는 원수치가 평균에서 얼마나 떨어져 있는지를 나타내는 지수로, $ z = \frac{z - \mu}{\sigma} $로 나타난다. ($\sigma$ 표준편차, $\mu$는 모집단의 평균이다. +중심극한정리란 표본의 크기가 커질수록 표본 평균의 분포는 모집단의 분포 모양과는 관계없이 정규분표에 가까워진다는 정리이다. +점추정은 모집단의 특성을 단일한 값으로 추정하는 방법으로, 표본평균과 표본분산을 이용해 모집단의 평균과 분산을 계산해 내는 방법이 대표적인 예이다....

+
+
<span title='2021-10-30 07:10:34 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

구글 페이지랭크 알고리즘 +

+
+
+

구글은 방대한 웹페이지를 자사 데이터베이스에 기록하고 있으며, 이를 토대로 사용자가 검색한 검색결과와 가장 매치되는 페이지를 보여줌으로써 검색엔진의 역할을 할 수 있다. 구글이 이렇게까지 클 수 있었던 이유는 정확한 검색 결과를 보여주는 알고리즘 덕분이다. 그렇다면 이 알고리즘은 무엇일까? 구글이 웹페이지들의 관계를 산출하고 그 수치를 계산해내는 알고리즘인 페이지랭크 알고리즘은 구글의 창시자중 한명인 래리 페이지라는 사람이 석사논문으로 발명한 알고리즘이다. PageRank 알고리즘은 각각의 웹 페이지의 상대적 가중치를 계산하여 각각의 중요도와 연관성을 표현하는 방식을 이용하는데, 이를 이용하여 한 페이지와 가장 연관된 다른 페이지를 Rank를 매겨 정확한 연관성을 보여줄 수 있다....

+
+
<span title='2021-10-30 07:07:55 +0000 UTC'>Oct 30, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

양자 컴퓨터와 양자 어닐링 +

+
+
+

양자 컴퓨터와 양자 어닐링 양자 컴퓨터 입문 / 양자 컴퓨팅 발전과 전망 / 1억배 빠른 양자 컴퓨터가 온다 / 스콧 애론슨의 양자 컴퓨터 강의 +양자 컴퓨터란 무엇일까? Ø 현대 컴퓨터의 발전 과정 20세기, 컴퓨터(Computer)란 말은 계산하는 사람, Computing Person이라는 뜻으로 사용되었다. 하지만 단순 반복 행동을 굳이 사람이 하지 않아도 되는, 일명 계산기계가 사용될 수 있음이 증명되면서, Computer라는 말은 ‘일정한 규칙ㅇㄹ 가지고 주어진 값을 토대로 계산하는 장치’라는 의미를 가지게 되었다. +현대적인 컴퓨터의 정의를 시작한 사람은 ‘찰스 배비지’이다....

+
+
<span title='2021-08-06 10:36:03 +0000 UTC'>Aug 6, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Security of IoT +

+
+
+

Security of IoT IoT란? IoT (Internet of Things)란, 독립적으로 존재했던 각종 전자기기 및 사물들이 인터넷으로 엮여 한번에 관리할 수 있게 되거나 상호 정보교환과 데이터 수집을 통해 사용자에게 최상의 서비스를 제공하는 기술을 의미이다. 여기에서 사물이라 함은 전구부터 세탁기, 그리고 신발이나 의류까지 모든 사물을 포함한다. 데이터를 분석하는 과정에서 인공지능을 주로 사용하므로 IoT에는 인공지능 기술이 들어가기도 한다. +IoT는 2013년부터 쭉 개발되어 왔으며 집에서 흔히 볼 수 있는 에어컨, 냉장고등 큰 가구들부터 연결되어 왔다. 그 이후 시간이 지나면서 점점 작은 기구들까지 연결되면서, TV, 전자레인지, 오븐부터 커피포트, 선풍기, 전등 뿐 아니라 변기, 샤워기, 거울, 헤어 드라이기까지 연결되어 있지 않은 것이 없을 정도로 발전되어 왔다....

+
+
<span title='2021-08-06 10:32:57 +0000 UTC'>Aug 6, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Hardware Security +

+
+
+

Hardware Security 신뢰성과 관련된 기술 1. RoT (Root of Trust) Root of Trust, 신뢰점이란, 전자기기 안에서 별도로 존재하는 프로세싱 유닛으로, 메인 프로세서의 보조로서 다양한 암호화 기법이나 솔루션을 제공하거나 이를 제어하기 위한 보안 기능들을 의미한다. RoT가 궁극적으로 달성하고자 하는 것은 TC(Trusted Computing)으로, 신뢰할 수 있는 컴퓨팅, 즉 믿을 만 하고 무결성이 보장되는 계산 및 기능을 이야기한다. 이를 달성하기 위한, RoT에 포함되는 여러가지 기술들이나 알고리즘이 있고, 각 단계들을 순차적으로 달성되어 신뢰할 수 있는 보안적인 프로세스가 진행된다....

+
+
<span title='2021-08-06 10:31:09 +0000 UTC'>Aug 6, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

CFD with Python (Navier-Stokes Equation) +

+
+
+

1-D Linear Convection 1차원 선형 열전도 방정식은 가장 심플하면서도 가장 기초적인 방정식입니다. +$$ \frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0 $$ +이 식을 오일러 방정식으로 변환하여 수치해석적으로 해를 구할 수 있도록 변환을 해줍니다. +$$ ui^{n+1} = u_i^n - c \frac{\Delta t}{\Delta x}(u_i^n-u{i-1}^n) $$ +이제 이 오일러 방정식을 파이썬으로 구현해봅니다. +import numpy from matplotlib import pyplot import time, sys %matplotlib inline nx = 41 # try changing this number from 41 to 81 and Run All ....

+
+
<span title='2021-07-10 08:23:47 +0000 UTC'>Jul 10, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

Cryptography +

+
+
+

Cryptography 공개키 암호화 알고리즘. 1. Diffie-Hellman 디피-헬먼 키 교환 방식은 암호화 통신을 위한 키를 교환하는 방식 중 하나이다. 두 통신 주체가 공통의 비밀 키를 사용할 수 있도록 하는 안전한 알고리즘이다. 디피-헬먼 방식은 기초적인 암호 통신 방법으로, 이 알고리즘에 RSA나 ECC같은 암호화 알고리즘을 합쳐서 암호화 통신이 성립된다. 공개키는 암호화할 수 있는 키이고, 개인키는 복호화할 수 있는 키이다. +디피-헬먼 키 교환은 공개키 암호화 방식에 기반한다. 공개키 암호화 방식이란, 자신의 공개키를 상대방에게 전송하고, 그 상대방은 그 공개키로 데이터를 암호화해서 전송하면, 자신은 자신의 개인키로 복호화 할 수 있어, 통신이 성립되는 방식이다....

+
+
<span title='2021-07-09 10:24:00 +0000 UTC'>Jul 9, 2021</span>&nbsp;·&nbsp;Me
+ +
+ +
+
+

파이썬으로 구현한 뉴턴의 방정식과 적분방정식 +

+
+
+

우리의 세계에서 물체의 역학적 운동을 지배하는, 지배방정식이 있죠.뉴턴의 법칙, 방정식입니다.뉴턴의 법칙은 총 세개의 방정식이 있죠. 이 세가지 법칙만을 이용해서 물체의 운동을 계산할 수 있습니다.이것을 바탕으로 만들어진 역설이 라플라스의 역설이죠. 만약 모든 분자의 가속도, 속도, 위치 세가지 정보를 알고 있다면, 뉴턴의 법칙에 근거하여 그 다음 상황을 예측할 수 있고, 따라서 이 세상, 아니면 그것을 넘어서서 모든 분자의 정보를 알 수 있습니다.우리가 여기서 분석할 것은 가장 쉬운 법칙, 뉴턴의 제 2법칙, 가속도의 법칙입니다....

+
+
<span title='2021-05-21 13:18:27 +0000 UTC'>May 21, 2021</span>&nbsp;·&nbsp;Me
+ +
+
+
+ + + + + + + + + + diff --git a/public/posts/index.xml b/public/posts/index.xml new file mode 100644 index 0000000..d230611 --- /dev/null +++ b/public/posts/index.xml @@ -0,0 +1,172 @@ + + + + Posts on Morgan's Blog + http://blog.morgan.kr/posts/ + Recent content in Posts on Morgan's Blog + Hugo -- gohugo.io + en + Sun, 26 Nov 2023 10:47:11 +0000 + + Kernel, PTY and TTY + http://blog.morgan.kr/2023/11/kernel-pty-and-tty/ + Sun, 26 Nov 2023 10:47:11 +0000 + + http://blog.morgan.kr/2023/11/kernel-pty-and-tty/ + Linux Kernel #4 + + + + Kernel, Process creation + http://blog.morgan.kr/2023/11/kernel-process-creation/ + Sun, 26 Nov 2023 07:44:51 +0000 + + http://blog.morgan.kr/2023/11/kernel-process-creation/ + Linux Kernel #3 + + + + Kernel, Bootloader + http://blog.morgan.kr/2023/11/kernel-bootloader/ + Wed, 22 Nov 2023 05:35:09 +0000 + + http://blog.morgan.kr/2023/11/kernel-bootloader/ + Linux Kernel #2 + + + + Kernel, syscalls + http://blog.morgan.kr/2023/11/kernel-syscalls/ + Sat, 11 Nov 2023 01:22:30 +0000 + + http://blog.morgan.kr/2023/11/kernel-syscalls/ + Deep dive Linux Kernel #1 + + + + Chat with GPT, about Nuclear Fission + http://blog.morgan.kr/2023/10/chat-with-gpt-about-nuclear-fission/ + Fri, 27 Oct 2023 09:10:25 +0000 + + http://blog.morgan.kr/2023/10/chat-with-gpt-about-nuclear-fission/ + I made GPT create a new question about GPT&rsquo;s response, and repeated it for 10 minutes. +This is log for it. +Question: What is nuclear fission reactor, and what is breeder reactor? +Answer: A nuclear fission reactor is a device used to initiate and control a self-sustained nuclear chain reaction. These reactions are used to generate heat, which is typically used in steam turbines to produce electricity in a nuclear power station. + + + + Toward an Electronically-Mediated Decentralized Society + http://blog.morgan.kr/2023/10/toward-an-electronically-mediated-decentralized-society/ + Wed, 04 Oct 2023 21:50:35 +0000 + + http://blog.morgan.kr/2023/10/toward-an-electronically-mediated-decentralized-society/ + The Evolution of Democracy in the Digital Age + + + + VAE의 손실 함수 + http://blog.morgan.kr/2022/12/vae%EC%9D%98-%EC%86%90%EC%8B%A4-%ED%95%A8%EC%88%98/ + Thu, 15 Dec 2022 11:21:46 +0000 + + http://blog.morgan.kr/2022/12/vae%EC%9D%98-%EC%86%90%EC%8B%A4-%ED%95%A8%EC%88%98/ + VAE의 손실 함수는 Variational Lower Bound(VLB)라고도 불리는데, 이 함수는 VAE에서 사용되는 정보량을 측정하는데 사용됩니다. 이 함수는 두 부분으로 나뉘어져 있으며, 이를 분리하여 계산하는 것이 일반적입니다. 이 때, reparametrization trick이란 기법을 사용하면 VAE의 손실 함수의 그래디언트를 계산하는 데 도움이 될 수 있습니다. +먼저, VAE의 손실 함수는 아래와 같이 정의됩니다. +$$L = \mathbb{E}{q(z|x)}[\log p(x|z)] - D{KL}(q(z|x)||p(z))$$ +여기서 $p(x|z)$는 인코더의 출력을 디코더의 입력으로 넣었을 때 생성되는 값을 의미하고, $p(z)$는 잠재 변수의 확률 분포를 의미합니다. + + + + Spectre Attacks: Exploiting Speculative Execution + http://blog.morgan.kr/2021/10/spectre-attacks-exploiting-speculative-execution/ + Sat, 30 Oct 2021 07:19:36 +0000 + + http://blog.morgan.kr/2021/10/spectre-attacks-exploiting-speculative-execution/ + The Central Processing Unit (CPU) is a device that plays a major role as the brain of a computer. The CPU controls four main functions: memory, interpretation, computation, and control, which are based on the role of interpreting the commands of a given program to perform operations with data. In CPU, there are the program counter, a command register, an ALU (arithmetic logic unit), a control unit, a bus, and a register. + + + + Ad-Tech와 통계의 쓰임새 + http://blog.morgan.kr/2021/10/ad-tech%EC%99%80-%ED%86%B5%EA%B3%84%EC%9D%98-%EC%93%B0%EC%9E%84%EC%83%88/ + Sat, 30 Oct 2021 07:10:34 +0000 + + http://blog.morgan.kr/2021/10/ad-tech%EC%99%80-%ED%86%B5%EA%B3%84%EC%9D%98-%EC%93%B0%EC%9E%84%EC%83%88/ + CTR(클릭률) Click-through rate)는 특정 링크를 클릭한 사용자의 비율. Z지수는 표준점수로, 통계학적인 정규분포를 만들고 각각의 경우가 표준편차상의 어떤 위치를 차지하는지를 보여주는 차원없는 수치이다. Z-지수는 원수치가 평균에서 얼마나 떨어져 있는지를 나타내는 지수로, $ z = \frac{z - \mu}{\sigma} $로 나타난다. ($\sigma$ 표준편차, $\mu$는 모집단의 평균이다. +중심극한정리란 표본의 크기가 커질수록 표본 평균의 분포는 모집단의 분포 모양과는 관계없이 정규분표에 가까워진다는 정리이다. +점추정은 모집단의 특성을 단일한 값으로 추정하는 방법으로, 표본평균과 표본분산을 이용해 모집단의 평균과 분산을 계산해 내는 방법이 대표적인 예이다. + + + + 구글 페이지랭크 알고리즘 + http://blog.morgan.kr/2021/10/%EA%B5%AC%EA%B8%80-%ED%8E%98%EC%9D%B4%EC%A7%80%EB%9E%AD%ED%81%AC-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98/ + Sat, 30 Oct 2021 07:07:55 +0000 + + http://blog.morgan.kr/2021/10/%EA%B5%AC%EA%B8%80-%ED%8E%98%EC%9D%B4%EC%A7%80%EB%9E%AD%ED%81%AC-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98/ + 구글은 방대한 웹페이지를 자사 데이터베이스에 기록하고 있으며, 이를 토대로 사용자가 검색한 검색결과와 가장 매치되는 페이지를 보여줌으로써 검색엔진의 역할을 할 수 있다. 구글이 이렇게까지 클 수 있었던 이유는 정확한 검색 결과를 보여주는 알고리즘 덕분이다. 그렇다면 이 알고리즘은 무엇일까? 구글이 웹페이지들의 관계를 산출하고 그 수치를 계산해내는 알고리즘인 페이지랭크 알고리즘은 구글의 창시자중 한명인 래리 페이지라는 사람이 석사논문으로 발명한 알고리즘이다. PageRank 알고리즘은 각각의 웹 페이지의 상대적 가중치를 계산하여 각각의 중요도와 연관성을 표현하는 방식을 이용하는데, 이를 이용하여 한 페이지와 가장 연관된 다른 페이지를 Rank를 매겨 정확한 연관성을 보여줄 수 있다. + + + + 양자 컴퓨터와 양자 어닐링 + http://blog.morgan.kr/2021/08/%EC%96%91%EC%9E%90-%EC%BB%B4%ED%93%A8%ED%84%B0%EC%99%80-%EC%96%91%EC%9E%90-%EC%96%B4%EB%8B%90%EB%A7%81/ + Fri, 06 Aug 2021 10:36:03 +0000 + + http://blog.morgan.kr/2021/08/%EC%96%91%EC%9E%90-%EC%BB%B4%ED%93%A8%ED%84%B0%EC%99%80-%EC%96%91%EC%9E%90-%EC%96%B4%EB%8B%90%EB%A7%81/ + 양자 컴퓨터와 양자 어닐링 양자 컴퓨터 입문 / 양자 컴퓨팅 발전과 전망 / 1억배 빠른 양자 컴퓨터가 온다 / 스콧 애론슨의 양자 컴퓨터 강의 +양자 컴퓨터란 무엇일까? Ø 현대 컴퓨터의 발전 과정 20세기, 컴퓨터(Computer)란 말은 계산하는 사람, Computing Person이라는 뜻으로 사용되었다. 하지만 단순 반복 행동을 굳이 사람이 하지 않아도 되는, 일명 계산기계가 사용될 수 있음이 증명되면서, Computer라는 말은 ‘일정한 규칙ㅇㄹ 가지고 주어진 값을 토대로 계산하는 장치’라는 의미를 가지게 되었다. +현대적인 컴퓨터의 정의를 시작한 사람은 ‘찰스 배비지’이다. + + + + Security of IoT + http://blog.morgan.kr/2021/08/security-of-iot/ + Fri, 06 Aug 2021 10:32:57 +0000 + + http://blog.morgan.kr/2021/08/security-of-iot/ + Security of IoT IoT란? IoT (Internet of Things)란, 독립적으로 존재했던 각종 전자기기 및 사물들이 인터넷으로 엮여 한번에 관리할 수 있게 되거나 상호 정보교환과 데이터 수집을 통해 사용자에게 최상의 서비스를 제공하는 기술을 의미이다. 여기에서 사물이라 함은 전구부터 세탁기, 그리고 신발이나 의류까지 모든 사물을 포함한다. 데이터를 분석하는 과정에서 인공지능을 주로 사용하므로 IoT에는 인공지능 기술이 들어가기도 한다. +IoT는 2013년부터 쭉 개발되어 왔으며 집에서 흔히 볼 수 있는 에어컨, 냉장고등 큰 가구들부터 연결되어 왔다. 그 이후 시간이 지나면서 점점 작은 기구들까지 연결되면서, TV, 전자레인지, 오븐부터 커피포트, 선풍기, 전등 뿐 아니라 변기, 샤워기, 거울, 헤어 드라이기까지 연결되어 있지 않은 것이 없을 정도로 발전되어 왔다. + + + + Hardware Security + http://blog.morgan.kr/2021/08/hardware-security/ + Fri, 06 Aug 2021 10:31:09 +0000 + + http://blog.morgan.kr/2021/08/hardware-security/ + Hardware Security 신뢰성과 관련된 기술 1. RoT (Root of Trust) Root of Trust, 신뢰점이란, 전자기기 안에서 별도로 존재하는 프로세싱 유닛으로, 메인 프로세서의 보조로서 다양한 암호화 기법이나 솔루션을 제공하거나 이를 제어하기 위한 보안 기능들을 의미한다. RoT가 궁극적으로 달성하고자 하는 것은 TC(Trusted Computing)으로, 신뢰할 수 있는 컴퓨팅, 즉 믿을 만 하고 무결성이 보장되는 계산 및 기능을 이야기한다. 이를 달성하기 위한, RoT에 포함되는 여러가지 기술들이나 알고리즘이 있고, 각 단계들을 순차적으로 달성되어 신뢰할 수 있는 보안적인 프로세스가 진행된다. + + + + CFD with Python (Navier-Stokes Equation) + http://blog.morgan.kr/2021/07/cfd-with-python-navier-stokes-equation/ + Sat, 10 Jul 2021 08:23:47 +0000 + + http://blog.morgan.kr/2021/07/cfd-with-python-navier-stokes-equation/ + 1-D Linear Convection 1차원 선형 열전도 방정식은 가장 심플하면서도 가장 기초적인 방정식입니다. +$$ \frac{\partial u}{\partial t} + c \frac{\partial u}{\partial x} = 0 $$ +이 식을 오일러 방정식으로 변환하여 수치해석적으로 해를 구할 수 있도록 변환을 해줍니다. +$$ ui^{n+1} = u_i^n - c \frac{\Delta t}{\Delta x}(u_i^n-u{i-1}^n) $$ +이제 이 오일러 방정식을 파이썬으로 구현해봅니다. +import numpy from matplotlib import pyplot import time, sys %matplotlib inline nx = 41 # try changing this number from 41 to 81 and Run All . + + + + Cryptography + http://blog.morgan.kr/2021/07/cryptography/ + Fri, 09 Jul 2021 10:24:00 +0000 + + http://blog.morgan.kr/2021/07/cryptography/ + Cryptography 공개키 암호화 알고리즘. 1. Diffie-Hellman 디피-헬먼 키 교환 방식은 암호화 통신을 위한 키를 교환하는 방식 중 하나이다. 두 통신 주체가 공통의 비밀 키를 사용할 수 있도록 하는 안전한 알고리즘이다. 디피-헬먼 방식은 기초적인 암호 통신 방법으로, 이 알고리즘에 RSA나 ECC같은 암호화 알고리즘을 합쳐서 암호화 통신이 성립된다. 공개키는 암호화할 수 있는 키이고, 개인키는 복호화할 수 있는 키이다. +디피-헬먼 키 교환은 공개키 암호화 방식에 기반한다. 공개키 암호화 방식이란, 자신의 공개키를 상대방에게 전송하고, 그 상대방은 그 공개키로 데이터를 암호화해서 전송하면, 자신은 자신의 개인키로 복호화 할 수 있어, 통신이 성립되는 방식이다. + + + + 파이썬으로 구현한 뉴턴의 방정식과 적분방정식 + http://blog.morgan.kr/2021/05/%ED%8C%8C%EC%9D%B4%EC%8D%AC%EC%9C%BC%EB%A1%9C-%EA%B5%AC%ED%98%84%ED%95%9C-%EB%89%B4%ED%84%B4%EC%9D%98-%EB%B0%A9%EC%A0%95%EC%8B%9D%EA%B3%BC-%EC%A0%81%EB%B6%84%EB%B0%A9%EC%A0%95%EC%8B%9D/ + Fri, 21 May 2021 13:18:27 +0000 + + http://blog.morgan.kr/2021/05/%ED%8C%8C%EC%9D%B4%EC%8D%AC%EC%9C%BC%EB%A1%9C-%EA%B5%AC%ED%98%84%ED%95%9C-%EB%89%B4%ED%84%B4%EC%9D%98-%EB%B0%A9%EC%A0%95%EC%8B%9D%EA%B3%BC-%EC%A0%81%EB%B6%84%EB%B0%A9%EC%A0%95%EC%8B%9D/ + 우리의 세계에서 물체의 역학적 운동을 지배하는, 지배방정식이 있죠.뉴턴의 법칙, 방정식입니다.뉴턴의 법칙은 총 세개의 방정식이 있죠. 이 세가지 법칙만을 이용해서 물체의 운동을 계산할 수 있습니다.이것을 바탕으로 만들어진 역설이 라플라스의 역설이죠. 만약 모든 분자의 가속도, 속도, 위치 세가지 정보를 알고 있다면, 뉴턴의 법칙에 근거하여 그 다음 상황을 예측할 수 있고, 따라서 이 세상, 아니면 그것을 넘어서서 모든 분자의 정보를 알 수 있습니다.우리가 여기서 분석할 것은 가장 쉬운 법칙, 뉴턴의 제 2법칙, 가속도의 법칙입니다. + + + + diff --git a/public/posts/page/1/index.html b/public/posts/page/1/index.html new file mode 100644 index 0000000..6a0b6ec --- /dev/null +++ b/public/posts/page/1/index.html @@ -0,0 +1,10 @@ + + + + http://blog.morgan.kr/posts/ + + + + + + diff --git a/public/sitemap.xml b/public/sitemap.xml new file mode 100644 index 0000000..3b48cbf --- /dev/null +++ b/public/sitemap.xml @@ -0,0 +1,124 @@ + + + + http://blog.morgan.kr/2023/11/kernel-pty-and-tty/ + 2023-11-26T10:47:11+00:00 + + http://blog.morgan.kr/ + 2023-11-26T10:47:11+00:00 + + http://blog.morgan.kr/posts/ + 2023-11-26T10:47:11+00:00 + + http://blog.morgan.kr/2023/11/kernel-process-creation/ + 2023-11-26T07:44:51+00:00 + + http://blog.morgan.kr/2023/11/kernel-bootloader/ + 2023-11-22T05:35:09+00:00 + + http://blog.morgan.kr/2023/11/kernel-syscalls/ + 2023-11-11T01:22:30+00:00 + + http://blog.morgan.kr/2023/10/chat-with-gpt-about-nuclear-fission/ + 2023-10-27T09:10:25+00:00 + + http://blog.morgan.kr/blog/ + 2023-10-23T09:45:50+00:00 + + http://blog.morgan.kr/blog/operating-mirroring-server/ + 2023-10-23T09:45:50+00:00 + + http://blog.morgan.kr/2023/10/toward-an-electronically-mediated-decentralized-society/ + 2023-10-04T21:50:35+00:00 + + http://blog.morgan.kr/blog/usb-c-and-dp-alt-mode/ + 2023-05-06T12:55:32+00:00 + + http://blog.morgan.kr/2022/12/vae%EC%9D%98-%EC%86%90%EC%8B%A4-%ED%95%A8%EC%88%98/ + 2022-12-15T11:21:46+00:00 + + http://blog.morgan.kr/blog/2022041406/ + 2022-04-14T06:55:25+00:00 + + http://blog.morgan.kr/blog/%EB%8B%A4%EB%A5%B8-%EC%82%AC%EB%9E%8C%EC%9D%98-%EC%A7%91%EC%97%90-%EC%82%B0%EB%8B%A4%EB%8A%94-%EA%B2%83/ + 2022-04-09T04:02:17+00:00 + + http://blog.morgan.kr/blog/godeunghaggyo-dolabogi/ + 2021-12-21T16:23:55+00:00 + + http://blog.morgan.kr/blog/daehag-ibsiga-handangye-namassda/ + 2021-12-01T08:09:52+00:00 + + http://blog.morgan.kr/2021/10/spectre-attacks-exploiting-speculative-execution/ + 2021-10-30T07:19:36+00:00 + + http://blog.morgan.kr/blog/jeonja-jeeoyi-segyein-mirae-geu-boanyi-wihyeob/ + 2021-10-30T07:17:47+00:00 + + http://blog.morgan.kr/2021/10/ad-tech%EC%99%80-%ED%86%B5%EA%B3%84%EC%9D%98-%EC%93%B0%EC%9E%84%EC%83%88/ + 2021-10-30T07:10:34+00:00 + + http://blog.morgan.kr/blog/yangjadeulyi-teuraenjiseuteo/ + 2021-10-30T07:09:53+00:00 + + http://blog.morgan.kr/2021/10/%EA%B5%AC%EA%B8%80-%ED%8E%98%EC%9D%B4%EC%A7%80%EB%9E%AD%ED%81%AC-%EC%95%8C%EA%B3%A0%EB%A6%AC%EC%A6%98/ + 2021-10-30T07:07:55+00:00 + + http://blog.morgan.kr/blog/insaeng-dubeonjjae-silpae/ + 2021-10-23T08:52:59+00:00 + + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%98%EA%B3%A0-%EC%9E%88%EB%8A%94%EA%B1%B8%EA%B9%8C/ + 2021-10-23T08:52:15+00:00 + + http://blog.morgan.kr/blog/haggyoeseo-haessdeon-peurojegteudeul/ + 2021-10-23T08:51:44+00:00 + + http://blog.morgan.kr/blog/gaeinjeongbo-privacy/ + 2021-10-23T08:31:52+00:00 + + http://blog.morgan.kr/blog/datacenter/ + 2021-10-23T08:15:14+00:00 + + http://blog.morgan.kr/blog/beulrogeu-geulsseugineun-neomu-himdeuleo/ + 2021-10-08T05:19:00+00:00 + + http://blog.morgan.kr/blog/%EB%82%98%EB%8A%94-%EB%AC%B4%EC%97%87%EC%9D%84-%ED%95%B4%EC%95%BC-%ED%95%98%EB%8A%94%EA%B1%B8%EA%B9%8C/ + 2021-09-11T01:20:00+00:00 + + http://blog.morgan.kr/blog/attitude-for-criticism/ + 2021-09-10T07:30:10+00:00 + + http://blog.morgan.kr/2021/08/%EC%96%91%EC%9E%90-%EC%BB%B4%ED%93%A8%ED%84%B0%EC%99%80-%EC%96%91%EC%9E%90-%EC%96%B4%EB%8B%90%EB%A7%81/ + 2021-08-06T10:36:03+00:00 + + http://blog.morgan.kr/tags/security/ + 2021-08-06T10:32:57+00:00 + + http://blog.morgan.kr/2021/08/security-of-iot/ + 2021-08-06T10:32:57+00:00 + + http://blog.morgan.kr/tags/ + 2021-08-06T10:32:57+00:00 + + http://blog.morgan.kr/2021/08/hardware-security/ + 2021-08-06T10:31:09+00:00 + + http://blog.morgan.kr/2021/07/cfd-with-python-navier-stokes-equation/ + 2021-07-10T08:23:47+00:00 + + http://blog.morgan.kr/2021/07/cryptography/ + 2021-07-09T10:24:00+00:00 + + http://blog.morgan.kr/blog/20210620-siheomeul-iljuil-apdugo/ + 2021-06-20T09:23:28+00:00 + + http://blog.morgan.kr/2021/05/%ED%8C%8C%EC%9D%B4%EC%8D%AC%EC%9C%BC%EB%A1%9C-%EA%B5%AC%ED%98%84%ED%95%9C-%EB%89%B4%ED%84%B4%EC%9D%98-%EB%B0%A9%EC%A0%95%EC%8B%9D%EA%B3%BC-%EC%A0%81%EB%B6%84%EB%B0%A9%EC%A0%95%EC%8B%9D/ + 2021-05-21T13:18:27+00:00 + + http://blog.morgan.kr/blog/what-i-wanted-to-do/ + 2021-01-28T06:14:00+00:00 + + http://blog.morgan.kr/categories/ + + diff --git a/public/tags/index.html b/public/tags/index.html new file mode 100644 index 0000000..dfe5d62 --- /dev/null +++ b/public/tags/index.html @@ -0,0 +1,150 @@ + + + + + + + + +Tags | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+ + + +
+ + + + + + + + + + diff --git a/public/tags/index.xml b/public/tags/index.xml new file mode 100644 index 0000000..0716deb --- /dev/null +++ b/public/tags/index.xml @@ -0,0 +1,20 @@ + + + + Tags on Morgan's Blog + http://blog.morgan.kr/tags/ + Recent content in Tags on Morgan's Blog + Hugo -- gohugo.io + en + Fri, 06 Aug 2021 10:32:57 +0000 + + security + http://blog.morgan.kr/tags/security/ + Fri, 06 Aug 2021 10:32:57 +0000 + + http://blog.morgan.kr/tags/security/ + + + + + diff --git a/public/tags/security/index.html b/public/tags/security/index.html new file mode 100644 index 0000000..df193e9 --- /dev/null +++ b/public/tags/security/index.html @@ -0,0 +1,162 @@ + + + + + + + + +security | Morgan's Blog + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ +
+
+

+ security +

+
+ +
+ +
+
+

Security of IoT +

+
+
+

Security of IoT IoT란? IoT (Internet of Things)란, 독립적으로 존재했던 각종 전자기기 및 사물들이 인터넷으로 엮여 한번에 관리할 수 있게 되거나 상호 정보교환과 데이터 수집을 통해 사용자에게 최상의 서비스를 제공하는 기술을 의미이다. 여기에서 사물이라 함은 전구부터 세탁기, 그리고 신발이나 의류까지 모든 사물을 포함한다. 데이터를 분석하는 과정에서 인공지능을 주로 사용하므로 IoT에는 인공지능 기술이 들어가기도 한다. +IoT는 2013년부터 쭉 개발되어 왔으며 집에서 흔히 볼 수 있는 에어컨, 냉장고등 큰 가구들부터 연결되어 왔다. 그 이후 시간이 지나면서 점점 작은 기구들까지 연결되면서, TV, 전자레인지, 오븐부터 커피포트, 선풍기, 전등 뿐 아니라 변기, 샤워기, 거울, 헤어 드라이기까지 연결되어 있지 않은 것이 없을 정도로 발전되어 왔다....

+
+
<span title='2021-08-06 10:32:57 +0000 UTC'>Aug 6, 2021</span>&nbsp;·&nbsp;Me
+ +
+
+
+ + + + + + + + + + diff --git a/public/tags/security/index.xml b/public/tags/security/index.xml new file mode 100644 index 0000000..68ac353 --- /dev/null +++ b/public/tags/security/index.xml @@ -0,0 +1,21 @@ + + + + security on Morgan's Blog + http://blog.morgan.kr/tags/security/ + Recent content in security on Morgan's Blog + Hugo -- gohugo.io + en + Fri, 06 Aug 2021 10:32:57 +0000 + + Security of IoT + http://blog.morgan.kr/2021/08/security-of-iot/ + Fri, 06 Aug 2021 10:32:57 +0000 + + http://blog.morgan.kr/2021/08/security-of-iot/ + Security of IoT IoT란? IoT (Internet of Things)란, 독립적으로 존재했던 각종 전자기기 및 사물들이 인터넷으로 엮여 한번에 관리할 수 있게 되거나 상호 정보교환과 데이터 수집을 통해 사용자에게 최상의 서비스를 제공하는 기술을 의미이다. 여기에서 사물이라 함은 전구부터 세탁기, 그리고 신발이나 의류까지 모든 사물을 포함한다. 데이터를 분석하는 과정에서 인공지능을 주로 사용하므로 IoT에는 인공지능 기술이 들어가기도 한다. +IoT는 2013년부터 쭉 개발되어 왔으며 집에서 흔히 볼 수 있는 에어컨, 냉장고등 큰 가구들부터 연결되어 왔다. 그 이후 시간이 지나면서 점점 작은 기구들까지 연결되면서, TV, 전자레인지, 오븐부터 커피포트, 선풍기, 전등 뿐 아니라 변기, 샤워기, 거울, 헤어 드라이기까지 연결되어 있지 않은 것이 없을 정도로 발전되어 왔다. + + + + diff --git a/public/tags/security/page/1/index.html b/public/tags/security/page/1/index.html new file mode 100644 index 0000000..9fb522d --- /dev/null +++ b/public/tags/security/page/1/index.html @@ -0,0 +1,10 @@ + + + + http://blog.morgan.kr/tags/security/ + + + + + +