Skip to content

Instantly share code, notes, and snippets.

@gauravkaila
gauravkaila / install_docker_ubuntu_16.04.sh
Last active May 20, 2023 05:47
Install Docker and nvidia-docker on Ubuntu-16.04
#!/bin/bash
# add the GPG key for the official Docker repository to the system
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# add the Docker repository to APT sources
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
# update the package database with the Docker packages from the newly added repo
sudo apt-get update
@TimSC
TimSC / RunningAverage.h
Last active November 27, 2019 01:43
Calculate running average in C++
#ifndef _RUNNING_AVERAGE_H
#define _RUNNING_AVERAGE_H
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
class RunningAverage
{
@hamaluik
hamaluik / cppLinearInterpolator
Created January 15, 2013 04:53
Basic linear interpolator class in C++
#include <map>
#include <vector>
/**
* Provides a basic interpolation mechanism in C++ using the STL.
* Maybe not the fastest or most elegant method, but it works (for
* linear interpolation!!), and is fast enough for a great deal of
* purposes. It's also super easy to use, so that's a bonus.
*/
class LinearInterpolator {