Skip to content

Instantly share code, notes, and snippets.

Avatar

Shane Barratt sbarratt

View GitHub Profile
@sbarratt
sbarratt / keyboardhook.cpp
Created May 31, 2016
Create a keyboard hook using Win32 System API and log what the user types into a console.
View keyboardhook.cpp
#include <stdio.h>
#include <tchar.h>
#include <Windows.h>
#include <iostream>
HHOOK hHook{ NULL };
enum Keys
{
ShiftKey = 16,
@sbarratt
sbarratt / 3per.py
Last active Aug 15, 2016
Implementation of the 3-Base Periodicity Property: https://en.wikipedia.org/wiki/3-Base_Periodicity_Property
View 3per.py
import matplotlib.pyplot as plt
from numpy.fft import fft
from numpy.fft import fftshift
import numpy as np
import random
dictionary = ['A','C','G','T']
def generate_random_sequence(N):
return [dictionary[random.randint(0,len(dictionary)-1)] for _ in range(N)]