Skip to content

Instantly share code, notes, and snippets.

View milesrout's full-sized avatar

Miles Rout milesrout

View GitHub Profile
@milesrout
milesrout / types
Created October 11, 2016 04:38
A list of all of Chalice's types
uint8
uint16
uint32
uint64
int8
int16
int32
int64
uwrap8
uwrap16
@milesrout
milesrout / fix.md
Last active January 24, 2017 03:16
Investigating the fixed-point types in the Chalice programming language

Just as Chalice has a fairly broad selection of integral types, it also has a broad selection of fixed-point types. For the uninitiated, fixed-point arithmetic is like a cross between floating-point and integral arithmetic. Essentially, fixed-point arithmetic involves interpreting integers as being multiples of some value much smaller than 1.

For example:

  • uwrap16 can represent any number between 0x0000 and 0xffff (inclusive) with a precision of 0x0001. 0x1d9f can be represented, but 0x1d.9f cannot.
  • ufix8_8 can represent any number between 0x00.00 and 0xff.ff (inclusive) with a precision of 0x00.01. 0x1d.9f can be represented, but 0x1d.9fb2 cannot.
@milesrout
milesrout / int.md
Created October 10, 2016 08:39
Investigating the integer types in the Chalice programming language

Low level languages like C and Chalice need to have a selection of different integer types. In languages like Python can mostly get away with just one integer type, but when you're working at a very low level, you really need to be able to be specific about what your integers mean and how much space they take up.

One little-known fact of C is that code can speed up significantly if signed types are used instead of unsigned types. The reason for this is that signed types have undefined behaviour on overflow. This seems like a terrible design choice at first, and in some ways it is. But it means that for example if 32-bit signed integers are used to compute offsets into an array, the compiler is allowed assume that they never overflow and use pointer-sized overflow semantics instead of 32-bit semantics, which is different on a 64-bit platform. This might seem like an abysmal thing to do - it changes the semantics of the programme! But in all likelihood, a 'proper' overflow of

Trillek Engine C

GNU/Linux (Gcc and CLang) Windows (VStudio 2015)
Build Status Build status

Building

TEC requires cmake 3.1 and a few libraries GLFW3, GLM, ASIO, Protobuf, GLEW, Lua, Bullet and OpenAL.

If you do not have cmake 3.1 (try cmake -version), to install on Linux, use the same procedure that we do on Travis CI:

class Env(BaseEnv):
def __init__(self, bindings=None):
super().__init__({
# syntactic forms
'let': syntaxLet,
'lambda': syntaxLambda,
'quote': syntaxQuote,
'exact-number': syntaxExact,
'inexact-number': syntaxInexact,
'set!': syntaxSetBang,
(define (call-with-current-continuation& f k)
(k (f k)))
; If you look at this you'll get wrecked.
(register-event concrete-block event-type-player-look
(lambda (ev)
(cause-effect
#:type 'explosion
#:at (event-triggering-object ev)
#:radius 100)))
λ interpret dneImplAristotle
Proof {assumptions = fromList [(¬¬phi → phi)], conclusion = (¬(phi → ¬phi) → phi)}
λ interpret aristotleImplDne
Proof {assumptions = fromList [(¬(phi → ¬phi) → phi)], conclusion = (¬¬phi → phi)}
import functools, inspect
def constructor(__init__):
@functools.wraps(__init__)
def new_init(self, *args, **kwds):
bound_args = inspect.signature(__init__).bind(*args, **kwds)
bound_args.apply_defaults()
for k, v in bound_args.arguments.items():
setattr(self, k, v)
return new_init
(defun dotspacemacs/user-config ()
(define-key evil-normal-state-map (kbd ";") 'evil-ex)
(define-key evil-normal-state-map (kbd ":") 'evil-repeat-find-char))