This file contains hidden or 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 dataclasses import dataclass | |
class ADTMeta(type): | |
def __new__(mcs, name, bases, namespace: dict): | |
adtc_class = super().__new__(mcs, name, bases, namespace) | |
if "__is_adt_variant__" in namespace: | |
if namespace["__is_adt_variant__"]: | |
return adtc_class |
This file contains hidden or 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 concurrent.futures import ThreadPoolExecutor, as_completed | |
import numpy as np | |
import numba as nb | |
@nb.extending.llvm_call | |
def atomic_xchg(context, ptr, cmp, val): | |
if isinstance(ptr, nb.types.CPointer): |
This file contains hidden or 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
import json | |
import requests | |
from django.views.decorators.csrf import csrf_exempt | |
FB_MESSENGER_ACCESS_TOKEN = "[TOKEN]" | |
def respond_FB(sender_id, text): | |
json_data = { | |
"recipient": {"id": sender_id}, |
This file contains hidden or 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
// by d whyte | |
int[][] result; | |
float t; | |
float ease(float p) { | |
return 3*p*p - 2*p*p*p; | |
} | |
float ease(float p, float g) { |