Skip to content

Instantly share code, notes, and snippets.

View stlukey's full-sized avatar

Luke Southam stlukey

View GitHub Profile
@stlukey
stlukey / gcn.py
Last active February 23, 2023 16:22
import torch
import torch.nn.functional as F
from torch_geometric.nn import GCNConv
from torch_geometric.data import Data, DataLoader
from torch_geometric import nn
import torch
import torch.nn.functional as F
from torch_geometric.nn import GCNConv, Sequential
class TemporalLayer(torch.nn.Module):
@stlukey
stlukey / plot.c
Last active May 19, 2019 22:46
plot.c - Plots an equation onto a graph and writes it to a PNG file.
/*
* Graph plotter.
*
* Plots an equation onto a graph and writes it to a PNG file.
*
*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
@stlukey
stlukey / Sudoku-EA.py
Last active August 4, 2022 19:59
Sudoku-EA.py - Sudoku solving Evolutionary Algorithm.
#!/usr/bin/env python2
"""
Sudoku solving Evolutionary Algorithm.
Usage: pypy Sudoku-AI.py <sudoku-file> <population-size>
Please make sure you execute using PyPy 2.7
"""
from __future__ import print_function
%!TEX TS-program = xelatex
\documentclass[]{frixggeri-cv}
\usepackage{afterpage}
\usepackage{hyperref}
\usepackage{color}
\usepackage{xcolor}
\hypersetup{
pdftitle={},
pdfauthor={},
pdfsubject={},
#!/usr/bin/env bash
git clone https://github.com/lucaciraolo/Guitar-Zero/
cd Guitar-Zero/server/
mvn package
sudo docker build -t guitarzero .
sudo docker run -p 8080:80 guitarzero
@stlukey
stlukey / PKGBUILD
Created January 7, 2018 03:34
amdgpu-pro-blockchain for archlinux
# Author: Luke Southam <luke@devthe.com>
#
# Credit: Janusz Lewandowski <lew21@xtreeme.org>
# David McFarland <corngood@gmail.com>
pkgbase=amdgpu-pro-blockchain
pkgname=(amdgpu-pro amdgpu-pro-dkms amdgpu-pro-gst-omx amdgpu-pro-libdrm amdgpu-pro-libgl amdgpu-pro-mesa-omx amdgpu-pro-opencl amdgpu-pro-vdpau amdgpu-pro-vulkan lib32-amdgpu-pro lib32-amdgpu-pro-gst-omx lib32-amdgpu-pro-libdrm lib32-amdgpu-pro-libgl lib32-amdgpu-pro-mesa-omx lib32-amdgpu-pro-opencl lib32-amdgpu-pro-vdpau lib32-amdgpu-pro-vulkan xf86-video-amdgpu-pro)
pkgver=17.40.483984
pkgrel=1
arch=('x86_64')
@stlukey
stlukey / java2d.md
Last active April 24, 2017 15:14
Java2D Examples

Java2D (By Luke Southam)

In Java 2D you have frames (JFrame) and panels (JPanel). A frame represents the window. A frame contains panels. A panel can contain components (JComponent) and is also a component itself.

JFrame

A Frame needs to be created to put panels on. This is done like so:

import javax.swing.*;
@stlukey
stlukey / MinimalMongo.py
Last active May 19, 2019 22:48
MinimalMongo.py - Minimal ORM for Mongodb
#!/usr/bin/env python3
"""
Minimal ORM for Mongodb
Example usage:
Simple: https://github.com/o4dev/store.py/blob/master/api/resources/mailing_list/models.py
Advanced: https://github.com/o4dev/store.py/blob/master/api/resources/products/models.py
:author: Luke Southam <luke@devthe.com>
"""
import os
@stlukey
stlukey / setup_mysql.sh
Created December 11, 2016 19:44
Download and setup mysql server (at /tmp/mysql) without root
#!/usr/bin/env bash
# Created by Luke Southam <luke@devthe.com>
MYSQL_DOWNLOAD_URL='https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.16-linux-glibc2.5-i686.tar'
MYSQL_HOME=/tmp/mysql
MYSQL_USER=$USER
MYSQL_DATADIR=$MYSQL_HOME/data
@stlukey
stlukey / example_parity.json
Last active August 29, 2015 14:17
Simple Python Turing Machine implementation
{
"states": [
[
["0", "0", 1, 0],
["1", "1", 1, 1],
[" ", "e", 1, -1]
],
[
["0", "0", 1, 1],
["1", "1", 1, 0],