Skip to content

Instantly share code, notes, and snippets.

View marty1885's full-sized avatar
πŸ‘¨β€πŸ’»
Writing code

Martin Chang marty1885

πŸ‘¨β€πŸ’»
Writing code
View GitHub Profile
==> Making package: root 6.22.06-1 (Mon 07 Dec 2020 02:32:35 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
-> Found ROOFIT_LICENSE
-> Found root.xml
-> Found root.pc.tpl
-> Found settings.cmake
-> Found jupyter_notebook_config.py
-> Found nbman-for-arch.patch
@marty1885
marty1885 / sdl_gl.cpp
Created November 30, 2020 15:27
PoC code hacked from various sources, SDL with OpenGL (ES) using external context
// To compile: (Tested on Arch Linux)
// c++ sdl_gl.cpp -o sdl_gl `pkg-config sdl2 --cflags --libs` -lwayland-egl -lwayland-egl -lGL -lEGL -lX11 && ./sdl_gl
#include <stdio.h>
#include <stdint.h>
#include <assert.h>
#include <SDL2/SDL.h>
#include <SDL2/SDL_opengl.h>
#include "SDL2/SDL_syswm.h"
#include <GL/gl.h>
from etaler import et
import gym
env = gym.make('FrozenLake-v0', is_slippery=False)
# The agent is very simple. Mathmetically, think it as a weaker Q table. Biologically, it is a bunch
# of perimedial neurons receving input signals and direcly connected to a motor. Then the reward is
# used for modifing the behaivor of the neurons.
class Agent:
def __init__(self):
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <string>
#include <iostream>
#include <iomanip>
#include <random>
#include <openssl/sha.h>
inline std::string sha256(const std::string str)
{
unsigned char hash[SHA256_DIGEST_LENGTH+1];
#include <vector>
#include <algorithm>
#include <chrono>
#include <random>
#include <cstdint>
#include <cassert>
// Banchmarking library
#include <hayai/hayai.hpp>
#include <vector>
#include <algorithm>
#include <chrono>
#include <random>
#include <cstdint>
#include <cassert>
// Banchmarking library
#include <hayai/hayai.hpp>
#include <fstream>
#include <tuple>
#include <vector>
#include <iostream>
int main()
{
using vec2d = std::tuple<float, float>;
std::ifstream in("input.txt");
float x, y;