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
create table Edges (n0 INTEGER, n1 INTEGER, label TEXT); | |
insert into Edges (n0, n1, label) values (0, 1, "e1"); | |
insert into Edges (n0, n1, label) values (1, 2, "e2"); | |
insert into Edges (n0, n1, label) values (1, 3, "e3"); | |
insert into Edges (n0, n1, label) values (2, 4, "e4"); | |
insert into Edges (n0, n1, label) values (3, 5, "e5"); | |
with recursive Traverse(n0, n1) | |
as ( values(0,0) UNION | |
select E1.n0, E2.n1 |
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
def f(term=b"12345"): | |
val = int('987278186585') | |
# The below line does not work, because it treats 1 as a constant integer | |
# in the C code (32 bit on my machine). Using 1L does work however. | |
val -= 1 << (len(term) * 8) | |
return val | |
print(f()) |
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
{-# LANGUAGE InstanceSigs #-} | |
import Control.Applicative | |
import Control.Monad | |
newtype Expr a = Expr { unExpr :: a } | |
instance Functor Expr where | |
fmap f c = Expr $ f (eval c) |
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
import Control.Applicative | |
-- NOTE: in a lazy language we only need 'data Expr a = Expr a' | |
data Expr a = Expr (() -> a) | |
instance Functor Expr where | |
fmap f e = Expr $ λ() -> f (eval e) | |
instance Applicative Expr where | |
pure x = Expr $ λ() -> x |
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
# Abstract types data descriptors | |
abstract DDesc{T} | |
abstract LocalDDesc{T} <: DDesc{T} | |
abstract OOCDDesc{T} <: LocalDDesc{T} | |
abstract RemoteDDesc{T} <: DDesc{T} | |
# ---- Data types ---- # | |
type DyndDDesc{T} <: DDesc{T} | |
arr :: Array{T} | |
end |
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
[0] [14:46] ~/numba-nextgen git(master!) ➤ cat test.py | |
from numba2 import jit | |
@jit | |
def f(a, b): | |
return a < b | |
print f(10, 20) | |
[0] [14:46] ~/numba-nextgen git(master!) ➤ ./bin/numba test.py |
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
static int | |
context_init(PyObject *self, PyObject *args, PyObject *kwds) | |
{ | |
static char *kwlist[] = { | |
"prec", "rounding", "Emin", "Emax", "capitals", "clamp", | |
"flags", "traps", "_allcr", NULL | |
}; | |
PyObject *rounding = NULL; | |
PyObject *traps = NULL; | |
PyObject *status = NULL; |
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
import ctypes | |
from cpython cimport PyObject | |
cdef extern from *: | |
ctypedef unsigned int Py_uintptr_t | |
struct __pyx_obj_4test_Base: | |
void *__pyx_vtab |
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
static int __mini_mangle___pyx_array_expression5strided(Py_ssize_t const *const CYTHON_RESTRICT __mini_mangle___pyx_shape, double *const CYTHON_RESTRICT __pyx_op1_data, Py_ssize_t const *const CYTHON_RESTRICT __pyx_op1_strides, double const *const CYTHON_RESTRICT __pyx_op2_data, Py_ssize_t const *const CYTHON_RESTRICT __pyx_op2_strides, double const *const CYTHON_RESTRICT __pyx_op3_data, Py_ssize_t const *const CYTHON_RESTRICT __pyx_op3_strides) { | |
Py_ssize_t __mini_mangle_temp0; | |
#ifdef _OPENMP | |
#pragma omp parallel for if(1) | |
#endif | |
for (__mini_mangle_temp0 = 0; __mini_mangle_temp0 < (__mini_mangle___pyx_shape[0]); __mini_mangle_temp0++) { | |
double *CYTHON_RESTRICT __mini_mangle_temp1; | |
double const *CYTHON_RESTRICT __mini_mangle_temp2; | |
double const *CYTHON_RESTRICT __mini_mangle_temp3; | |
Py_ssize_t __mini_mangle_temp4; |
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
refnanny.c | |
Creating library c:\Users\mark\cython\BUILD\support\temp.win32-2.7\Release\Users\mark\cython\BUILD\support\temp.win32-2.7\Release\pyrex\refnanny.lib and object c:\Users\mark\cython\BUILD\support\temp.win32-2.7\Release\Users\mark\cython\BUILD\support\temp.win32-2.7\Release\pyrex\refnanny.exp | |
_cython_inline_1421403a5f9562e8318d0ed8975c8664.c | |
Creating library BUILD\inline\BUILD\inline\_cython_inline_1421403a5f9562e8318d0ed8975c8664.lib and object BUILD\inline\BUILD\inline\_cython_inline_1421403a5f9562e8318d0ed8975c8664.exp | |
_cython_inline_ecd8a68b92274d5df8d2b6aee9b6d4f8.c | |
Creating library BUILD\inline\BUILD\inline\_cython_inline_ecd8a68b92274d5df8d2b6aee9b6d4f8.lib and object BUILD\inline\BUILD\inline\_cython_inline_ecd8a68b92274d5df8d2b6aee9b6d4f8.exp | |
_cython_inline_df82d7886146311391ffd9802ab9fa1c.c | |
Creating library BUILD\inline\BUILD\inline\_cython_inline_df82d7886146311391ffd9802ab9fa1c.lib and object BUILD\inline\BUILD\inline\_cython_inline_df82d7886146311391ffd9802ab9fa1c.exp | |
_cython |