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 math | |
import random | |
from enum import Enum, auto | |
from typing import Iterable, Optional, Set, Tuple, List, Dict | |
from itertools import chain | |
#CHAR_CUR = '█' | |
#CHAR_CUR = '□' | |
#CHAR_CUR = ' ' | |
CHAR_CUR = '▯' |
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
// cc -shared -fPIC -I/usr/include/python3.5m -O -g -o bar.so bar.c | |
#include "Python.h" | |
static PyObject* sum_list(PyObject* self, PyObject* args) | |
{ | |
Py_ssize_t i, j, n; | |
long total = 0, value; | |
PyObject *item; | |
PyObject *list; | |
long *values; |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle' | |
}); |
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 Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
orders: null, | |
init() { | |
this.set('orders', this.get('store').findAll('order')); | |
} | |
}); |
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
Fib bench (Rust, Swift, C) I added C to the discussion on | |
https://www.reddit.com/r/rust/comments/3wxi9x/why_is_rust_much_slower_than_swift_in_this_simple/ |
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
-- script.lua | |
-- Receives a table, returns the sum of its components. | |
io.write("The table the script received has:\n"); | |
x = 0 | |
for i = 1, #foo do | |
print(i, foo[i]) | |
x = x + foo[i] | |
end | |
io.write("Returning data back to C\n"); | |
return x |