Skip to content

Instantly share code, notes, and snippets.

@Larry57
Larry57 / KeyboardHook.cs
Created April 11, 2013 18:08
A global Keyboard Hook that works in WPF and is also high CPU load proof. Credits: http://blogs.vertigo.com/personal/ralph/Blog/Lists/Posts/Post.aspx?ID=8
public class KeyboardHook
{
#region pinvoke details
private enum HookType : int
{
WH_JOURNALRECORD = 0,
WH_JOURNALPLAYBACK = 1,
WH_KEYBOARD = 2,
WH_GETMESSAGE = 3,
@nin-jin
nin-jin / gist:111f32935da5c758a1c8
Last active November 25, 2015 04:51
Dlang non blocking messaging
import std.stdio;
import std.concurrency;
import std.conv;
import core.thread;
shared class Msg
{
string value;
Msg next = null;
Tid from;
#include <vector>
#include <iostream>
#include <cmath>
using namespace std;
#define EPSILON 1.0e-5
#define RESOLUTION 32
class Point2D