A "Best of the Best Practices" (BOBP) guide to developing in Python.
- "Build tools for others that you want to be built for you." - Kenneth Reitz
- "Simplicity is alway better than functionality." - Pieter Hintjens
| #!/usr/bin/python3 | |
| import signal | |
| import gi | |
| gi.require_version('Gtk', '3.0') | |
| gi.require_version('AppIndicator3', '0.1') | |
| from gi.repository import Gtk | |
| from gi.repository import AppIndicator3 as AppIndicator |
| ################################## | |
| ### Custom tmux configuration ### | |
| ### by KienLT ### | |
| ################################## | |
| # Remap prefix from 'C-b' to 'C-a' | |
| unbind C-b | |
| set-option -g prefix C-a | |
| bind-key C-a send-prefix |
| Dir { | |
| ArchiveDir "./debian"; | |
| CacheDir "./cache"; | |
| }; | |
| Default { | |
| Packages::Compress ". gzip bzip2"; | |
| Sources::Compress ". gzip bzip2"; | |
| Contents::Compress ". gzip bzip2"; | |
| }; | |
| TreeDefault { |
| CC = gcc | |
| FLAGS = -g | |
| SRC_DIR := module1 module2 . | |
| INCLUDE := $(addprefix -I, $(SRC_DIR)) | |
| SRC := $(foreach sdir,$(SRC_DIR),$(wildcard $(sdir)/*.c)) | |
| OBJ := $(patsubst %.c, build/%.o,$(SRC)) | |
| PROG := build/test.out |
| /* | |
| * @Author: Trung Kien | |
| * @Date: 2017-03-24 23:10:01 | |
| * @Last Modified by: ksvbka | |
| * @Last Modified time: 2017-03-25 16:02:15 | |
| */ | |
| // | |
| // https://pdos.csail.mit.edu/6.828/2016/homework/sh.c | |
| // |
| /******************************************************************************** | |
| Product : Linkedlist Library | |
| Module : | |
| Author : Trung Kien - [email protected] | |
| Description : Library for Linkedlist data struct. | |
| ********************************************************************************/ | |
| /*-----------------------------------------------------------------------------*/ | |
| /* Header inclusions */ |
| /*-------------------------------------------------------------------------------- | |
| Function: InitRxDataPackage | |
| Purpose: Init Rx Data Package | |
| Parameters: RX_STATE state | |
| Return: NULL | |
| --------------------------------------------------------------------------------*/ | |
| VOID InitRxDataPackage() | |
| { | |
| RegisterUartCallback(UART_DATA_EVENT, CollectingDataPackage); | |
| } |
| /******************************************************************************** | |
| Product: Filter signal processing | |
| Module: Filter | |
| Created: 7/24/2015, by KIENLTB | |
| Description: Implement filter sinal processing (mean filter, Kalman, HPF, LPF..) | |
| ********************************************************************************/ | |
| /*-----------------------------------------------------------------------------*/ |
| function kalman(duration, dt) | |
| % function kalman(duration, dt) | |
| % | |
| % Kalman filter simulation for a vehicle travelling along a road. | |
| % INPUTS | |
| % duration = length of simulation (seconds) | |
| % dt = step size (seconds) | |
| measnoise = 10; % position measurement noise (feet) |