Skip to content

Instantly share code, notes, and snippets.


Anton Yablokov StSav012

View GitHub Profile
# -*- coding: utf-8 -*-
from typing import List, Dict
import urllib.request
import urllib.error
import os.path
FILES: List[str] = [
# 'test',
# 'aes_light',
StSav012 / parser.c
Last active Feb 27, 2018
INI file parser
View parser.c
#include <stdlib.h>
#include <stdio.h>
* @function readValue extracts a string value from an INI file
* @param f is a file opened for reading outside the function
* @param section is the section name to look into
* @param key is the key which value is required
* @param buffer is a buffer to store the key value into
* @note @param buffer should be long enough to store the value
StSav012 / calendar.tex
Last active Dec 7, 2017
Calendar Generator
View calendar.tex
\hypersetup{pdftex, pdftitle=Calendar, pdfauthor=StSav012}
StSav012 / sliders.html
Last active Oct 31, 2017
An example of a dynamically created table of sliders, and their values, and miscellaneous info
View sliders.html
<!DOCTYPE html>
<meta charset="utf-8">
* {
color: inherit;
background: inherit;
StSav012 /
Last active Oct 30, 2017
rp5 site parser
place="Нижний Новгород"
file=$(curl -s -o - "${lang}&q=${place}")
links=$(echo ${file} | grep -o -e "p class=\"navy\">.*<form id=\"f\"" | grep -o -e "=[^=]*" | tail -n +2 | head -n -1)
code=$(echo ${links} | grep -Eo -e "\"[[:digit:]]+" | grep -Eo -e "[[:digit:]]+" | head -n 1)
name=$(echo ${links} | grep -Eo -e "${lang}\">[^<]+" | grep -Eo -e ">.+" | grep -Eo -e "[^>]+" | head -n 1)
file=$(wget -q -O - "${code}/${lang}")
View rk4_mpi.c
#include <stdlib.h>
#include <stdio.h>
#include <time.h>
#include <mpi.h>
#define formaster if(id==0)
#define forothers if(id!=0)
#define dim 2
#define USE_DEFAULT 1 // skip user input
#define DO_HARLEM_SHAKE 1 // show the result
View rk4_omp.cpp
#include <cstdlib>
#include <iostream>
#include <vector>
#include <ctime>
#include <omp.h>
using namespace std;
#define dim 2
#define USE_DEFAULT 1 // skip user input