Skip to content

Instantly share code, notes, and snippets.

View JeonghunLee's full-sized avatar
🤗
I may be slow to respond.

JeongHun (James) Lee JeonghunLee

🤗
I may be slow to respond.
View GitHub Profile
int __io_putchar(int ch)
{
HAL_UART_Transmit(&huart4, (uint8_t *)&ch, 1, 0xFFFF);
return ch;
}
import cv2
import sys
import pytesseract
import numpy as np
from matplotlib import pyplot as plt
#import matplotlib.pyplot as plt
#
# /usr/share/tesseract-ocr/4.00/tessdata
#
import os
import argparse
import cv2
import numpy as np
import random
import matplotlib.pyplot as plt
from matplotlib.backend_bases import NavigationToolbar2, Event
# https://stackoverflow.com/questions/4098131/how-to-update-a-plot-in-matplotlib
@JeonghunLee
JeonghunLee / gist:c79fb515a32d00583e77adf45a9b9677
Created February 27, 2019 15:54
python Histogram Test program
import cv2
import numpy as np
import random
from matplotlib import pyplot as plt
from matplotlib.backend_bases import NavigationToolbar2
# https://opencv-python.readthedocs.io/en/latest/doc/19.imageHistograms/imageHistograms.html#mask
# https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_histograms/py_histogram_equalization/py_histogram_equalization.html
# https://opencv-python-tutroals.readthedocs.io/en/latest/py_tutorials/py_imgproc/py_histograms/py_histogram_begins/py_histogram_begins.html
@JeonghunLee
JeonghunLee / gist:252480befcbf05d1e7dbc09c875bb813
Created February 27, 2019 15:51
python matplotlib의 plot 사용시 naviationtool bar 사용
## https://stackoverflow.com/questions/14896580/matplotlib-hooking-in-to-home-back-forward-button-events/15109266
## https://www.csie.ntu.edu.tw/~azarc/sna/matplotlib/lib/matplotlib/backend_bases.py
import matplotlib.pyplot as plt
from matplotlib.backend_bases import NavigationToolbar2, Event
home = NavigationToolbar2.home
back = NavigationToolbar2.back
forward = NavigationToolbar2.forward
/*
* Jeonghun Lee
* Recently, I made FIFO functions by using Array in MSP430 for optimization
*/
#define MAX_TX_BUFF 1024
#define MAX_RX_BUFF 128
/*
1. Execute make first. This will result in a netlinkKernel.ko output among many others.
2. Execute $ gcc netlinkUser.c -o netlinkUser
3. Insert kernel module by :$ sudo insmod netlinkKernel.ko
4. Run ./netlinkUser to see message and run dmesg to see debug messages
5. Remove module by : $ sudo rmmod netlinkKernel
6. Finally make clean to remove output files.
1. Execute make first. This will result in a netlinkKernel.ko output among many others.
2. Execute $ gcc netlinkUser.c -o netlinkUser
3. Insert kernel module by :$ sudo insmod netlinkKernel.ko
4. Run ./netlinkUser to see message and run dmesg to see debug messages
5. Remove module by : $ sudo rmmod netlinkKernel
6. Finally make clean to remove output files.

[공통] 마크다운 markdown 작성법

1. 마크다운에 관하여

1.1. 마크다운이란?

**Markdown**은 텍스트 기반의 마크업언어로 2004년 존그루버에 의해 만들어졌으며 쉽게 쓰고 읽을 수 있으며 HTML로 변환이 가능하다. 특수기호와 문자를 이용한 매우 간단한 구조의 문법을 사용하여 웹에서도 보다 빠르게 컨텐츠를 작성하고 보다 직관적으로 인식할 수 있다. 마크다운이 최근 각광받기 시작한 이유는 깃헙(https://github.com) 덕분이다. 깃헙의 저장소Repository에 관한 정보를 기록하는 README.md는 깃헙을 사용하는 사람이라면 누구나 가장 먼저 접하게 되는 마크다운 문서였다. 마크다운을 통해서 설치방법, 소스코드 설명, 이슈 등을 간단하게 기록하고 가독성을 높일 수 있다는 강점이 부각되면서 점점 여러 곳으로 퍼져가게 된다.

1.2. 마크다운의 장-단점

1.2.1. 장점

/*
  Refer to https://github.com/meyerd/flex-bison-example
  Definitions
C코드 삽입시 %{, }% 기호
*/
%option noyywrap // flex
%{
#include <stdio.h>