Skip to content

Instantly share code, notes, and snippets.

View mintisan's full-sized avatar

Jinhui-Lin mintisan

View GitHub Profile
@mintisan
mintisan / adpcm.md
Created August 15, 2022 12:32
[ADPCM Adaptive Differential Pulse Code Modulation] 音频压缩算法 #压缩 #算法
@mintisan
mintisan / timer_measure_arm_cortex_m4.c
Created August 4, 2022 14:42
[time measure on cortex-m4 platform] #MCU
// https://stackoverflow.com/questions/13379220/generating-nanosecond-delay-in-c-on-stm32
uint32_t m_nStart; //DEBUG Stopwatch start cycle counter value
uint32_t m_nStop; //DEBUG Stopwatch stop cycle counter value
#define DEMCR_TRCENA 0x01000000
/* Core Debug registers */
#define DEMCR (*((volatile uint32_t *)0xE000EDFC))
#define DWT_CTRL (*(volatile uint32_t *)0xE0001000)
@mintisan
mintisan / Termux.Jupyter.md
Last active August 4, 2022 14:52 — forked from pcornier/Termux.Jupyter.md
Install Jupyter with Numpy, SciPy, Pandas and Matplotlib #环境安装
pkg install apt-transport-https curl gnupg pkg-config clang
pkg install freetype freetype-dev libpng libpng-dev libzmq-dev libzmq

mkdir $PREFIX/etc/apt/sources.list.d

echo "deb [trusted=yes] https://its-pointless.github.io/files/ termux extras" > $PREFIX/etc/apt/sources.list.d/pointless.list

curl -O https://its-pointless.github.io/pointless.gpg
@mintisan
mintisan / op_of_elements.py
Created March 27, 2018 03:19
Apply Operations To Elements with Lambda
# Create matrix
matrix = np.array([[1, 2, 3],
[4, 5, 6],
[7, 8, 9]])
# Create a function that adds 100 to something
add_100 = lambda i: i + 100
# Create a vectorized function
vectorized_add_100 = np.vectorize(add_100)
@mintisan
mintisan / cv2.imsave.py
Created March 16, 2018 07:42
Python 下 OpenCV 保存图片时包含中文路径
import cv2
import os
# ref. : http://blog.csdn.net/carryheart/article/details/61937872
# https://stackoverflow.com/questions/541390/extracting-extension-from-filename-in-python/
# image: image to be saved
# filename: filename with absolute path
cv2.imencode(os.path.splitext(filename)[1], image)[1].tofile(filename)
@mintisan
mintisan / ctype_test.c
Created January 17, 2018 16:34
ctype for array of pointers
#include "stdio.h"
// mac : gcc -dynamiclib -o ctype_test.dylib ctype_test.c
/*
two dimensional pointer
*/
void ctype_test(void *pa, int num, int size)
{
@mintisan
mintisan / docker-ce-ubuntu-17.10.md
Created November 25, 2017 16:34 — forked from levsthings/docker-ce-ubuntu-17.10.md
Install Docker CE on Ubuntu 17.10

Installing Docker CE on Ubuntu 17.10 Artful Aardvark

As of 20/10/2017, a release file for Ubuntu 17.10 Artful Aardvark is not available on Download Docker.

If you are used to installing Docker to your development machine with get-docker script, that won't work either. So the solution is to install Docker CE from the zesty package.

sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
@mintisan
mintisan / kivy-serialdata.py
Created March 27, 2017 15:31 — forked from openp2pdesign/kivy-serialdata.py
Drawing serial data with Kivy (Python)
# -*- coding: utf8 -*-
from kivy.app import App
from kivy.uix.floatlayout import FloatLayout
from kivy.graphics import Line
from kivy.uix.label import Label
from kivy.core.window import Window
from kivy.clock import Clock
import serial
@mintisan
mintisan / tensorflow_pip_setup.md
Last active December 10, 2016 10:33
tensorflow pip setup on macOS
@mintisan
mintisan / Makefile
Last active December 2, 2016 10:48
Mikefile demo for MSP430-GCC
# Project Structure
# [D]src: all source files here
# [D]inc: all headers
# [D]obj: objects, binary, out
# [F]makefile
# [D]: derectory
# [F]: file
# Note:no need to add include directory in any header or source file
vpath %.h inc