Skip to content

Instantly share code, notes, and snippets.

View pbcquoc's full-sized avatar

Pham Ba Cuong Quoc pbcquoc

View GitHub Profile
@jlblancoc
jlblancoc / Install_gcc7_ubuntu_16.04.md
Last active May 7, 2024 14:57
Installing gcc-7 & g++-7 in Ubuntu 16.04LTS Xenial

Run the following in the terminal:

Install the gcc-7 packages:

sudo apt-get install -y software-properties-common
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install g++-7 -y

Set it up so the symbolic links gcc, g++ point to the newer version:

@keithmorris
keithmorris / drive-format-ubuntu.md
Last active May 1, 2024 12:39
Partition, format, and mount a drive on Ubuntu
@gskoljarev
gskoljarev / ramerdouglaspeucker.py
Last active June 13, 2020 09:16
Python implementation of Ramer-Douglas-Peucker (RDP) algorithm; ported from JavaScript code at https://gist.github.com/msbarry/9152218; uses desired number of points instead of using a threshold.
# -*- coding: utf-8 -*-
import math
import time
def timenow():
return int(time.time() * 1000)
def sqr(x):
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@jezdez
jezdez / is_emoji.py
Created December 7, 2015 19:36
A Python script to check if a character is or a text contains emoji
# -*- encoding: utf-8 -*-
# pip install emoji
import emoji
def char_is_emoji(character):
return character in emoji.UNICODE_EMOJI