Skip to content

Instantly share code, notes, and snippets.

Avatar

Kaj Björklund kbjorklu

View GitHub Profile
@kbjorklu
kbjorklu / a2c_cartpole.py
Last active Mar 1, 2019
CartPole-v0 A2C
View a2c_cartpole.py
"""a2c_cartpole.py solves CartPole-v0 from https://gym.openai.com/envs/CartPole-v0/ ."""
import random
from collections import deque
import gym
import numpy as np
import tensorflow as tf
ENV_NAME = "CartPole-v0"
SOLVED_REWARD = 200 # Cartpole-v0 is solved if the episode reaches 200 steps.
@kbjorklu
kbjorklu / codes_to_languages.json
Created Sep 7, 2017 — forked from Mumakil/codes_to_languages.json
ISO-639 language maps, codes to language and vice versa
View codes_to_languages.json
{
"ab": "Abkhazian",
"abk": "Abkhazian",
"ace": "Achinese",
"ach": "Acoli",
"ada": "Adangme",
"ady": "Adyghe",
"aa": "Afar",
"aar": "Afar",
"afh": "Afrihili",
@kbjorklu
kbjorklu / keybase.md
Last active Sep 12, 2019
Keybase proof
View keybase.md

Keybase proof

I hereby claim:

  • I am kbjorklu on github.
  • I am kbjorklu (https://keybase.io/kbjorklu) on keybase.
  • I have a public key ASBr-jtC3iljHKD-lj8o9bpWd7T--8WB77MgZ_t3f8-GmAo

To claim this, I am signing this object:

@kbjorklu
kbjorklu / CryptGenRandom.cpp
Created Aug 23, 2013
Sample code for the CryptGenRandom function.
View CryptGenRandom.cpp
#include <iostream>
#include <windows.h>
#pragma comment(lib, "advapi32.lib")
int main()
{
HCRYPTPROV hProvider = 0;
if (!::CryptAcquireContextW(&hProvider, 0, 0, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT))
return 1;
@kbjorklu
kbjorklu / waveOut.cpp
Created Aug 23, 2013
Sample code for the waveOutWrite function.
View waveOut.cpp
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib, "winmm.lib")
int main()
{
HWAVEOUT hWaveOut = 0;
WAVEFORMATEX wfx = { WAVE_FORMAT_PCM, 1, 8000, 8000, 1, 8, 0 };
waveOutOpen(&hWaveOut, WAVE_MAPPER, &wfx, 0, 0, CALLBACK_NULL);
char buffer[8000 * 60] = {};