Skip to content

Instantly share code, notes, and snippets.

View amckinley's full-sized avatar

Austin McKinley amckinley

View GitHub Profile
def _key_fn(x):
return x.first()
def main2():
names = golf_name_list(argv[1])
sorted_names = sorted(names, key = _key_fn)
for n in sorted_names:
print n.first(), n.last()
def austin_name_list(file_name):
with open(file_name) as f:
names = []
for line in f.readlines():
first, last = line.split(" ")
names.append(Name(first, last))
return names
def golf_name_list(file_name):
def search_list(ls, target):
found_target = False
for i in range(0, len(ls)):
if ls[i] == target:
found_target = True
return found_target
def find_min_and_max(values):
max_val = 0
min_val = 0
i = 0
while i < len(values):
c = values[i]
if c == '-':
val = int(values[i:i+2])
i += 2
typedef unsigned __int128 TaggedPointer;
#define TP_GET_PTR(ptr) ((Node *)((ptr) >> 64))
#define TP_GET_VERSION(ptr) ((uint64_t)(ptr))
TaggedPointer pack_tagged_pointer(void *ptr, uint64_t version) {
printf("args of %p, %lu\n", ptr, version);
unsigned __int128 result = (intptr_t)ptr;
result = result << 64;
# server
import zmq
zmq_context = zmq.Context()
pub_socket = zmq_context.socket(zmq.PUB)
pub_socket.connect(subpub.SUB_ADDR)
while True:
pub_socket.send_multipart((str(topic), str(flask.request.data)))