Skip to content

Instantly share code, notes, and snippets.

View ser-mk's full-sized avatar
codeball

Evgeny Chormonov ser-mk

codeball
View GitHub Profile
@ser-mk
ser-mk / A.markdown
Created February 20, 2016 11:43 — forked from umpirsky/A.markdown
Sublime Text Monokai Sidebar Theme.
@ser-mk
ser-mk / led.cpp
Last active January 13, 2019 23:22
C version of led blink
// Step 1: Enable the clock to PORT B
RCC->APB2ENR |= RCC_APB2ENR_IOPCEN;
// Step 2: Change PB0's mode to 0x3 (output) and cfg to 0x0 (push-pull)
GPIOC->CRH = GPIO_CRH_MODE13_0 | GPIO_CRH_MODE13_1;
// Step 3: Set PB0 high
GPIOC->BSRR = GPIO_BSRR_BS13;
// Step 4: Reset PB0 low
@ser-mk
ser-mk / stm32f10x_i2c.c
Created January 11, 2019 13:58
example unsafe conversions of pointer in SPL
FlagStatus I2C_GetFlagStatus(I2C_TypeDef* I2Cx, uint32_t I2C_FLAG)
{
__IO uint32_t i2creg = 0, i2cxbase = 0;
….
/* Get the I2Cx peripheral base address */
i2cxbase = (uint32_t)I2Cx;
@ser-mk
ser-mk / Memcheck_issue.c
Created January 13, 2019 23:25
issue of Memcheck
int * p = (int*)0x654;
*p = 0x123;
@ser-mk
ser-mk / result_avarage_max_diff_ratio.txt
Last active May 5, 2022 23:09
Result of compare MinMax(M2) Delta and general Delta algorithm
|datasets |average difference ratio|maximum difference ratio|
|------------------------------------|------------------------|------------------------|
|CooperativePatent.csv_5 | -18.12% | -54.88% |
|Performance_2001Q3.txt_1_0_26 | -15.92% | -51.22% |
|Performance_2000Q2.txt_0_26 | -16.22% | -42.01% |
|DelayedFlights.csv_28_add_1 | -8.43% | -37.85% |
|DelayedFlights.csv_28_add_0 | -8.14% | -33.04% |
|Performance_2001Q3.txt_0_1_26 | -13.28% | -32.68% |
|Performance_2001Q2.txt_0_1_26 | -8.18% | -30.38% |
|Performance_2001Q3.txt_1_1_26 | -11.60% | -28.01% |
#!/bin/sh
# @SC: needs to have directories named llvm and clang in the same dir
# as this script
mkdir build
cd build
cmake -G "Unix Makefiles" \
-DCMAKE_BUILD_TYPE=MinSizeRel \
@ser-mk
ser-mk / build.cmd
Created June 13, 2023 22:18 — forked from mmozeiko/build.cmd
download & build llvm+clang on Windows
@echo off
setlocal enabledelayedexpansion
rem !!! build requirements !!!
rem Visual Studio 2019 or 2022
rem 7-Zip - https://www.7-zip.org/download.html
rem Python - https://www.python.org/downloads/
rem CMake - http://www.cmake.org/download/
rem ninja.exe - https://github.com/ninja-build/ninja/releases/latest