Skip to content

Instantly share code, notes, and snippets.

@chetandhembre
chetandhembre / common_h264_codec_strings_used_in_youtube__no_parsing.js
Created September 3, 2021 10:19
H.264 Codec String Parser (video, profile, level) - August 2017
//"avcoti" hexadecimal representation of the following three bytes in the (subset) sequence parameter set Network Abstraction Layer (NAL) unit specified in AVC: 1.profile_idc, 2.the byte containing the constraint_set flags (currently constraint_set0_flag through constraint_set5_flag, and the reserved_zero_2bits), 3.level_idc.
AVC1_CODEC_MAP = {
,"avc1.66.30": {profile:"Baseline", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2)
"avc1.42001e": {profile:"Baseline", level:3.0, max_bit_rate:10000}
,"avc1.42001f": {profile:"Baseline", level:3.1, max_bit_rate:14000}
//other variations
,"avc1.77.30": {profile:"Main", level:3.0, max_bit_rate:10000} //iOS friendly variation (iOS 3.0-3.1.2)
,"avc1.4d001e": {profile:"Main", level:3.0, max_bit_rate:10000}
,"avc1.4d001f": {profile:"Main", level:3.1, max_bit_rate:14000}
@chetandhembre
chetandhembre / ubuntu_mount_efs.md
Created July 5, 2017 01:14 — forked from ryanmaclean/ubuntu_mount_efs.md
Mount EFS on Ubuntu Linux

EFS Mounting on Ubuntu

Get EFS ID

aws configure set preview.efs true
aws efs describe-file-systems --profile TEST --region us-east-2
{
@chetandhembre
chetandhembre / cart_pole.py
Last active February 5, 2017 12:46
Open AI Gym: Cart Pole
import math
import numpy as np
import gym
import tensorflow as tf
import matplotlib
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
@chetandhembre
chetandhembre / cart_pole.py
Created February 5, 2017 12:46
open ai gym:cart pole problem
import math
import numpy as np
import gym
import tensorflow as tf
import matplotlib
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
@chetandhembre
chetandhembre / cliff_world.py
Created October 22, 2016 20:34
Clif World Q- Learning Vs SARSA learning
# https://dl.dropboxusercontent.com/u/47591917/cliff_world_episode_length.png
# https://dl.dropboxusercontent.com/u/47591917/cliff_world_episode_reward.png
# https://dl.dropboxusercontent.com/u/47591917/cliff_world_episode_timestamp.png
# https://dl.dropboxusercontent.com/u/47591917/cliff_world_path.png
import numpy as np
import matplotlib
import math
import pandas as pd
from matplotlib import pyplot as plt
@chetandhembre
chetandhembre / windy_gride_sarsa.py
Created October 20, 2016 20:19
Windy Gride Sarsa Implementation
#graph solution
# https://dl.dropboxusercontent.com/u/47591917/windy_gride_episode_length_sarsa.png
# https://dl.dropboxusercontent.com/u/47591917/windy_gride_episode_reward_sarsa.png
# https://dl.dropboxusercontent.com/u/47591917/windy_gride_episode_timestamp_sarsa.png
# https://dl.dropboxusercontent.com/u/47591917/windy_gride_path_sarsa.png
import numpy as np
import matplotlib
import math
import pandas as pd
from matplotlib import pyplot as plt
@chetandhembre
chetandhembre / racecar.py
Last active October 12, 2016 18:20
SARSA on policy learning
#!#/usr/bin/python2
import numpy as np
import matplotlib
import math
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.mlab as mlab
from matplotlib.patches import Circle, Wedge, Polygon
from matplotlib.collections import PatchCollection
import matplotlib.patches as patches
@chetandhembre
chetandhembre / mc.py
Last active October 8, 2016 18:24
Easy21
#!#/usr/bin/python2
#plot link: https://dl.dropboxusercontent.com/u/47591917/easy21_mc.png
import numpy as np
import matplotlib
from matplotlib import pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
RED = 0
BLACK = 1
@chetandhembre
chetandhembre / gambler.py
Created September 25, 2016 20:25
Gambler's Problem: Reinforcement Learning
#resultant graphs are here: https://dl.dropboxusercontent.com/u/47591917/demo.png
import numpy as np
import math
from matplotlib import pyplot as plt
class State(object):
def __init__(self, capital):
self.capital = capital
def staked(self, stake):
# View list of connections and their states
netstat -tan | grep ':80 ' | awk '{print $6}' | sort | uniq -c
# List all connections and timers
ss -rota | less