This gist contains lists of modules available in
in AWS Lambda.
#include <time.h> // Robert Nystrom | |
#include <stdio.h> // @munificentbob | |
#include <stdlib.h> // for Ginny | |
#define r return // 2008-2019 | |
#define l(a, b, c, d) for (i y=a;y\ | |
<b; y++) for (int x = c; x < d; x++) | |
typedef int i;const i H=40;const i W | |
=80;i m[40][80];i g(i x){r rand()%x; | |
}void cave(i s){i w=g(10)+5;i h=g(6) | |
+3;i t=g(W-w-2)+1;i u=g(H-h-2)+1;l(u |
This gist contains lists of modules available in
in AWS Lambda.
# vim: set ft=python : | |
from __future__ import print_function | |
import json | |
import sys | |
import datetime | |
from redis import StrictRedis as Redis |
#How I built an audio book reader for my nearly blind grandfather
Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.
####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an
import socket | |
import pickle | |
import random | |
import time | |
import struct | |
import threading | |
import urllib2 | |
#from sc_watchdog.logger import log |
date_to_integer_iso8601({date,{Y,M,D}}) -> | |
datetime_to_integer_iso8601({datetime,{{Y,M,D},{0,0,0}}}). | |
datetime_to_integer_iso8601({datetime,{{Y,M,D},{H,Min,S}}}) -> | |
Y * 10000000000 + M * 100000000 + D * 1000000 + H * 10000 + Min * 100 + S. |
L1 cache reference ......................... 0.5 ns
Branch mispredict ............................ 5 ns
L2 cache reference ........................... 7 ns
Mutex lock/unlock ........................... 25 ns
Main memory reference ...................... 100 ns
Compress 1K bytes with Zippy ............. 3,000 ns = 3 µs
Send 2K bytes over 1 Gbps network ....... 20,000 ns = 20 µs
SSD random read ........................ 150,000 ns = 150 µs
Read 1 MB sequentially from memory ..... 250,000 ns = 250 µs
#!/usr/bin/env ruby1.8 | |
# | |
# Copyright 2009 Stephan Maka <stephan@spaceboyz.net> | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |