Skip to content

Instantly share code, notes, and snippets.

Daniel Dugovic ddugovic

Block or report user

Report or block ddugovic

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@ddugovic
ddugovic / test-epd.py
Last active Nov 24, 2017 — forked from niklasf/bratko-kopec.py
An implementation of the Bratko-Kopec Test using python-chess
View test-epd.py
#!/usr/bin/python
import chess
import chess.uci
import sys
import time
def test_epd(engine, epd):
position = chess.Board()
@ddugovic
ddugovic / gist:827dcac503f9b458efe49d01888a3a60
Last active May 13, 2016
Parsey McParseface versus 2007 Miss Teen South Carolina
View gist:827dcac503f9b458efe49d01888a3a60
echo "I personally believe that U.S. Americans are unable to do so because uh some uh people out there in our nation don't have maps and uh I believe that our ed- education like such as in South Africa and uh the- the Iraq everywhere like such as and I believe that they should uh our education over here in the U.S. should help the U.S. or- or- should help South Africa and should help the Iraq and the Asian countries so we will be able to build up our future for our children." | ./syntaxnet/demo.sh
I syntaxnet/term_frequency_map.cc:101] Loaded 46 terms from syntaxnet/models/parsey_mcparseface/label-map.
I syntaxnet/embedding_feature_extractor.cc:35] Features: stack.child(1).label stack.child(1).sibling(-1).label stack.child(-1).label stack.child(-1).sibling(1).label stack.child(2).label stack.child(-2).label stack(1).child(1).label stack(1).child(1).sibling(-1).label stack(1).child(-1).label stack(1).child(-1).sibling(1).label stack(1).child(2).label stack(1).child(-2).label; input.token.tag input(1).token.ta
@ddugovic
ddugovic / audiosynth.view.js
Last active Jul 19, 2016
Attempting to draw some keys. Lovingly copied from http://www.keithwhor.com/music/audiosynth.view.js
View audiosynth.view.js
var fnCreateKeyboard = function(keyboardElement) {
// Generate keyboard
// This is our main keyboard element! It's populated dynamically based on what you've set above.
visualKeyboard = document.getElementById('keyboard');
selectSound = document.getElementById('sound');
var iKeys = 0;
var iWhite = 0;
var notes = __audioSynth._notes;
View hillclimbing.py
import gym
import numpy as np
def run_episode(env, parameters):
observation = env.reset()
totalreward = 0
#for 200 timesteps
for _ in xrange(200):
#env.render()
#initalize random weights
@ddugovic
ddugovic / run.pl
Last active Nov 7, 2016
Disclaimer: this generates some redundant files and puts files in the . directory unless specified otherwise
View run.pl
#!/usr/bin/perl
$ENV{'STBWDIR'} = '.';
$ENV{'STBZDIR'} = '.';
$ENV{'STBSTATSDIR'} = '.';
$ENV{'LTBWDIR'} = '.';
$ENV{'LTBZDIR'} = '.';
$ENV{'LTBSTATSDIR'} = '.';
$ENV{'GTBWDIR'} = '.';
$ENV{'GTBZDIR'} = '.';
@ddugovic
ddugovic / pawn_encoder.rb
Last active Jun 13, 2017
Encode white pawns and black pawns into bitmasks
View pawn_encoder.rb
# Program to encode pawns as bitmasks from a FEN
# Usage: ruby pawn_encoder.rb "rn3rk1/4bpp1/pq2bn1p/2pp4/B6B/2N1PN2/PP3PPP/2RQ1RK1"
def encode(fen)
board = fen.gsub("8"," 7").gsub("7"," 6").gsub("6"," 5").gsub("5"," 4").gsub("4"," 3").gsub("3"," 2").gsub("2"," 1").gsub("1"," ")
wpawnsA = board.gsub(/[^P\/]/,"0").gsub(/P/,"1").split("/")
bpawnsA = board.gsub(/[^p\/]/,"0").gsub(/p/,"1").split("/")
wpawnsB = wpawnsA.rotate
bpawnsB = bpawnsA.rotate(-1)
@ddugovic
ddugovic / crazyhouse-puzzles-test.epd
Last active Aug 27, 2017
Crazyhouse test positions
View crazyhouse-puzzles-test.epd
% Crazyhouse variant testsuite from https://chessvariants.training/
r6k/pppq2pp/3pp3/4p3/3nP1BP/2NPK1P1/PPP5/3R4[RBBNNPqrb] b - - bm B@f4+
rnb2r2/ppp3p1/4kp2/4pp1Q/3P4/8/PPP2PPP/R1B1KBNR[QBPPnn] w KQ - bm Bc4+ B@d5+
rnbk4/ppp1bp1p/8/4P3/4p3/2N5/PPP2PPP/R1B1KBNR[QRNPPqp] w KQ - bm Q@h8+ Q@g8+
r7/p1p1b1rp/b3kn2/4p1P1/3pP1n1/2NP2P1/PPP2pKP/R1BQ3R[QNPPb] w - - bm Q@d5+
r1b4r/p5pp/2pkp3/3p4/3Pp3/8/P1P2PPP/R2n1RK1[QBNNqbbnppp] w - - bm B@c5+ B@b4+
r3nr1b/ppp2p1k/6p1/4P1qB/3PK3/4Q3/PPP3PP/R7[RBBNNPPnpp] b - - bm Qf5+
r4r1k/ppp2pp1/3N4/3Np3/B5p1/6B1/PP3Pp1/R1BQ1RK1[QNPPPbnpp] w - - bm Q@h6+
1r5k/1P2Q1p1/p3Qnb1/1pp3N1/8/2P1BPp1/PP4P1/R4R1K[BBNrnppppp] w - - bm N@f7+
1rRq1r2/1PppkpQp/p3bN2/1pb1pp2/4P3/2P4N/PP4PP/Rb5K[BNnp] w - - bm Rxd8
View E4_Best_by_Test.user.js
// ==UserScript==
// @name E4, Best by Test
// @namespace https://github.com/ddugovic/UserScripts
// @description Best by test!
// @author ddugovic
// @copyright 2017+, ddugovic
// @license CC0 1.0 Universal
// @match https://lichess.org/training/coordinate
// @require https://lichess1.org/assets/compiled/coordinate.js?v=1932
// @grant none
View chess_game_analyzer_v39.14.beta.py
# -*- coding: utf-8 -*-
"""
I. About the script
1. It takes a pgn file with games in it and analyze those
games there one by one if there are more than one game
2. It mainly uses Stockfish uci engine during development.
Other uci engines can be used provided those engines support
multipv mode
@ddugovic
ddugovic / sl.sh
Created Mar 11, 2018
Stream Loading...
View sl.sh
#!/bin/bash
x=1
clear
while [ $? -eq 0 ]
do
x=$(( $x + 1 ))
/home/lila/sl/sl -dew -$x
done
clear && fortune | cowsay
You can’t perform that action at this time.