Skip to content

Instantly share code, notes, and snippets.

View akindyakov's full-sized avatar

Alexander akindyakov

View GitHub Profile
@akindyakov
akindyakov / yarn with boostrap
Created October 27, 2019 13:54
Yarn with bootstrap
.
├── index.html
├── node_modules
│   └── bootstrap
│   ├── dist
│   │   ├── css
│   │   │   ├── bootstrap.css
│   │   │   ├── bootstrap.css.map
│   │   │   ├── bootstrap-grid.css
│   │   │   ├── bootstrap-grid.css.map
@akindyakov
akindyakov / access_controller.cpp
Created June 26, 2018 13:28
Mutex guarded access controller
#include <iostream>
#include <mutex>
#include <shared_mutex>
#include <string>
#include <thread>
template<
typename Type
, typename MutexType
% g++ -std=c++11 -c main.cpp [0]
main.cpp: In function ‘int main()’:
main.cpp:8:25: error: invalid use of incomplete type ‘class Status’
std::cout << f.second().str() << '\n';
^
In file included from main.cpp:1:0:
first.h:3:7: error: forward declaration of ‘class Status’
class Status;
equality test: passed
float (Tensoflow): Time: 7.51398 s
float (double-conversion): Time: 0.371179 s
float (boost): Time: 3.03555 s
float (Tensoflow): Time: 7.43642 s
float (double-conversion): Time: 0.412458 s
float (boost): Time: 3.28229 s
@akindyakov
akindyakov / output
Last active August 9, 2017 08:15
double-conversion string to float benchmark
$ ./a.out
equality test: passed
float (Tensoflow): Time: 7.51398 s
float (double-conversion): Time: 0.371179 s
float (boost): Time: 3.03555 s
float (Tensoflow): Time: 7.43642 s
float (double-conversion): Time: 0.412458 s
float (boost): Time: 3.28229 s
#include<iostream>
#include<type_traits>
template<typename T1, typename T2>
struct First {};
template<typename T1, typename T2>
struct Second {};
template <typename T1, typename T2>
#include<iostream>
#include<type_traits>
struct Wrong1 {};
template<typename T1, typename T2>
struct Wrong2 {
T1 f;
T2 s;
};
if __name__ == '__main__':
raise NotImplementedError()

Description

This simple script will take a picture of a whiteboard and use parts of the ImageMagick library with sane defaults to clean it up tremendously.

The script is here:

#!/bin/bash
convert $1 -morphology Convolve DoG:15,100,0 -negate -normalize -blur 0x1 -channel RBG -level 60%,91%,0.1 $2

Results

#include <sstream>
#include <string>
class AException {
public:
AException(const std::string& whatsWrong)
: name( whatsWrong ),
row(-1) {}
AException(const std::string& whatsWrong, unsigned long int _row)