Skip to content

Instantly share code, notes, and snippets.

@alexminnaar
alexminnaar / ludii_jni_example.cpp
Last active Mar 23, 2020
Using the Ludii jar in cpp with JNI and calling the `listGames()` method
View ludii_jni_example.cpp
/*
Copyright (c) 2020 Alex Minnaar
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@alexminnaar
alexminnaar / dfs.py
Created Jun 17, 2019
depth-first search
View dfs.py
class Node:
def __init__(self, x):
self.val = x
self.children = []
def dfs(node, target):
# if the node is found then return it
if node.val == target:
return node
@alexminnaar
alexminnaar / gist:a286912efa417dfd0f25bd33992c3d6b
Created Mar 27, 2017
Joint image/text classifier in Keras
View gist:a286912efa417dfd0f25bd33992c3d6b
import numpy as np
from keras.layers import Dropout
from keras import applications
from keras.layers import Dense, GlobalAveragePooling2D, merge, Input
from keras.models import Model
max_words = 10000
epochs = 50
batch_size = 32
@alexminnaar
alexminnaar / gist:8f9ed5eb61dcef22c35eefcf2d7022b1
Last active Aug 25, 2016
Balanced Interleaving Algorithm
View gist:8f9ed5eb61dcef22c35eefcf2d7022b1
import random
def a_start_check():
if random.random() > 0.5:
print "A first"
return True
else:
print "B first"
return False
You can’t perform that action at this time.