Skip to content

Instantly share code, notes, and snippets.

View Randl's full-sized avatar

Evgenii Zheltonozhskii Randl

View GitHub Profile
@Randl
Randl / ieee_fullname.bst
Last active June 26, 2023 11:06
CVPR bibliography with natbib support
% Fixed extra right bracket
%
% Evgenii Zheltonozhskii, 09/28/2020, zheltonozhskiy@gmail.com
%
% ---------------------------------------------------------------
% Modified CVPR ieee_fullname.bst to support natbib
%
% Evgenii Zheltonozhskii, 03/10/2019, zheltonozhskiy@gmail.com
%
% ---------------------------------------------------------------
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Randl
Randl / icml18_parser.py
Created May 21, 2018 15:53
Parse ICML submissions, get some statistics
import pickle
from contextlib import closing
from timeit import default_timer as timer
from selenium.common.exceptions import TimeoutException
from selenium.webdriver import Firefox, FirefoxProfile
from selenium.webdriver.support.ui import WebDriverWait
from tqdm import tqdm
@Randl
Randl / blim.h
Created August 7, 2017 14:24
BLIM string matching algorithm
/**
Copyright 2017, Evgenii Zheltonozhskii
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
@Randl
Randl / nvidia.c
Created March 21, 2017 21:20
Overclocking tool for Nvidia GPUs
/*
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>, All rights reserved.
Copyright (C) 2017 Evgeniy Zheltonozhskiy <zheltonozhskiy@gmail.com>, All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
@Randl
Randl / fast_fibo.h
Created February 14, 2017 12:40
Calculate nth Fibonacci number
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <gmp.h>
/*
* from Fibo(n) = phi^n / sqrt(5) approximate number of bits in nth fibo
* is log_2(phi) * n - log_2(5)/2 For n >> 1, it's a bit less than 0.695n
*/
#define FIBO_BITCOUNT(x) ((mp_bitcnt_t)ceil(0.695 * (x)))
@Randl
Randl / tests_half.cpp
Created October 21, 2016 21:03
Tests for half.h
#include <iostream>
#include "half.h"
#include "picotest.h"
TEST(arithm, half_float) {
half abs_error(1e-2);
EXPECT_EQ(half(7.2), std::abs(half(-7.2)));
EXPECT_EQ(half(7.2), std::abs(half(7.2)));
EXPECT_EQ(false, bool(half(0.0)));
EXPECT_NEAR(half(8.602), half(7.238)+half(1.364),abs_error);
@Randl
Randl / half.h
Last active July 28, 2017 06:04
Half-precious class based on SSE F16C instructions
#include <cstdint>
#include <immintrin.h>
constexpr uint_least16_t CNN_HALF_SIGN = 1 << 15;
constexpr uint_least16_t CNN_HALF_EXPONENT = 0x1F << 10;
constexpr uint_least16_t CNN_HALF_MANTISSA = 0x3FF;
struct half;
namespace std {
/*
* Author: David Robert Nadeau
* Site: http://NadeauSoftware.com/
* License: Creative Commons Attribution 3.0 Unported License
* http://creativecommons.org/licenses/by/3.0/deed.en_US
*/
#if defined(_WIN32)
#include <Windows.h>
#elif defined(__unix__) || defined(__unix) || defined(unix) || (defined(__APPLE__) && defined(__MACH__))
@Randl
Randl / takuzu.cpp
Created October 25, 2015 21:58
Takuzu puzzle solver
#include <iostream>
#include <vector>
#include <array>
#include <algorithm>
enum Square { Zero, One, Nothing };
Square inverse(Square s) {
return s == Zero ? One : Zero;
}