This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define TC_MALLOC 1 | |
#define ELIBEN 0 | |
#include "hr_timer.h" | |
#include "allocators.h" | |
#include <iostream> | |
#include <cstdio> | |
#include <cstdlib> | |
#include <thread> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait MatrixBinOps[T] { | |
def +(that: Matrix[T])(implicit ev: Vector[Numeric[T]]): Matrix[T] | |
def -(that: Matrix[T])(implicit ev: Vector[Numeric[T]]): Matrix[T] | |
def *(that: Matrix[T])(implicit ev: Vector[Numeric[T]]): Matrix[T] | |
} | |
trait Matrix[T] { | |
// def zeros(length: Int)(implicit ev: Numeric[T]): Vector[T] | |
// def toString(): String | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
__author__ = 'sarangis' | |
from ctypes import CFUNCTYPE, c_int | |
import sys | |
import llvmlite.ir as ll | |
import llvmlite.binding as llvm | |
llvm.initialize() | |
llvm.initialize_native_target() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# draw about 50 polygons with varying transparencies to recreate an image | |
from PIL import Image, ImageDraw, ImageChops | |
from random import random, randint | |
import numpy as np | |
def clamp(minimum, x, maximum): | |
return max(minimum, min(x, maximum)) | |
def pil2array(img): | |
return np.array(img.getdata(), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from numba import double, jit | |
def top_level(): | |
a = 10 | |
a = a * 5 | |
def inner(): | |
nonlocal a | |
a = a * 5 | |
print(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
convert -delay 10 -loop 0 screenshot*.png animation.gif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
capture.py | |
A simple screen capture app using PySide ( or PyQt4 ) | |
#TODO: modifications required to run on Windows | |
Copyright Marc Robinson 2014 | |
''' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
The MIT License (MIT) | |
Copyright (c) <2015> <sarangis> | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Get your files that Gmail block. Warning message: | |
# "Anti-virus warning - 1 attachment contains a virus or blocked file. Downloading this attachment is disabled." | |
# Based on: http://spapas.github.io/2014/10/23/retrieve-gmail-blocked-attachments/ | |
# Go to your emails, click the arrow button in the top right, "Show original", save to the same directory as this script. | |
import email | |
import sys | |
import os | |
if __name__ == '__main__': |