Skip to content

Instantly share code, notes, and snippets.

View d0p3t's full-sized avatar
❤️
be nice

Remco d0p3t

❤️
be nice
View GitHub Profile
@d0p3t
d0p3t / test.py
Created April 9, 2017 01:29
Video capture using OpenCV if you wanna try it. Works on my mac
import numpy as np
import cv2
from PIL import ImageGrab
fourcc = cv2.cv.CV_FOURCC(*'XVID') # or cv2.VideoWriter_fourcc('X','V','I','D') if you use opencv 3.0
vid = cv2.VideoWriter('record.avi', fourcc, 8, (500,490))
while(True):
img = ImageGrab.grab(bbox=(100, 10, 600, 500)) #x, y, w, h
img_np = np.array(img)
#frame = cv2.cvtColor(img_np, cv2.COLOR_BGR2GRAY)
var anchors = {}
anchors["minimap"] = [];
anchors["center"] = [];
anchors["botright"] = [];
function ProgressBar(data)
{
this.data = data;
this.value = data.value;
this.disp_value = data.value;
RegisterServerEvent('vRP:payment')
RegisterServerEvent('vRP:salary')
AddEventHandler('vRP:payment',function(player, amount)
local user_id = vRP.getUserId(player)
if user_id ~= nil then
vRP.giveMoney(user_id, amount)
end
end)
var tmi = require('tmi.js')
var options = {
options: {
debug: true
},
connection: {
reconnect: true
},
identity: {
const tmi = require('tmi.js');
const discord = require('discord.js');
const config = require('./config/config.js'); // see https://github.com/d0p3t/d0p3tbot/blob/master/config/config_sample.js for an example
// Initialize tmi twitch bot and connect
const client = new tmi.client(config.tmi);
client.connect();
// Initialize discord bot and connect
const discordClient = new Discord.Client();
var tmi = require('tmi.js');
var config = require('./config.js');
var client = new tmi.client(config.tmi);
client.connect();
client.on("subscription", function (channel, username, method, message, userstate) {
if (method.prime === true) {
console.log("Prime Sub");
@d0p3t
d0p3t / listfirst.js
Created August 20, 2017 19:07
For dannytoke
var myArray = ['Bobby', 'Jack', 'Danny'];
var favCities = ['Atlanta', 'Miami'];
function listFirst(array) {
return array[0];
}
console.log(listFirst(myArray));
console.log(listFirst(favCities));
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
DQN Setup Steps Cloney
1. init dqn in setup_play()
2. ?????? enter_train_mode() (WHAT IS DIFFERENCE BETWEEN RUN OBSERVER TRAIN)
3. next_step()?????????
4. build_frame_stack() and then / or update_frame_stack()??
5. pick_action(RANDOM or PREDICTED at % 20) how to format action mapping
6. now observe = next_step()?????
7. append_to_replay_memory() how to use reward parameter????
8. calculate_target_error() how to use observation parameter from previous step???
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.