Skip to content

Instantly share code, notes, and snippets.

View joechai93's full-sized avatar

Joe Chai joechai93

  • Brisbane, Australia
View GitHub Profile
@joechai93
joechai93 / main.cpp
Created May 27, 2021 10:26
Cyclic insertion
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
int main()
{
std::vector<int> v = {1,4,6,3};
@joechai93
joechai93 / main.cpp
Created May 28, 2021 23:44
Missing value in ordered vector problem
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
int main()
{
std::vector<int> A = {1,3, 2,4,7,6};
@joechai93
joechai93 / cuda-11.2_installation_on_Ubuntu-18.04
Created September 30, 2021 01:03 — forked from mcvarer/cuda-11.2_installation_on_Ubuntu-18.04
CUDA 11.2 Installation on Ubuntu 18.04
#!/bin/bash
## This gist contains instructions about cuda v11.2 and cudnn 8.1 installation in Ubuntu 18.04 for PyTorch
#############################################################################################
##### forked by : https://gist.github.com/Mahedi-61/2a2f1579d4271717d421065168ce6a73 ########
#############################################################################################
### steps ####
# verify the system has a cuda-capable gpu
# Copying from host to container
docker cp ~/Downloads/<filename> 0b2a63712e29:/home/joe/<filename>
# Running a live non-persistent container
docker container run --rm -ti ubuntu:latest /bin/bash
# List and remove docker images
@joechai93
joechai93 / rand.cpp
Created January 17, 2022 07:34 — forked from uchida/rand.cpp
boost random distribution usage sample
#include <iostream>
#include <boost/function.hpp>
#include <boost/bind.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_real_distribution.hpp>
#include <boost/random/normal_distribution.hpp>
int main(int argc, char* argv[])
{
size_t seed = 1234567890;
@joechai93
joechai93 / hardhat_cheatsheet.md
Last active May 18, 2025 10:32
Hardhat Cheat Sheet

Compile

npx hardhat compile

Run unit tests

npx hardhat test

Start local node

npx hardhat node

Deploy to Rinkeby