I hereby claim:
- I am jimfinnis on github.
- I am jimfinnis (https://keybase.io/jimfinnis) on keybase.
- I have a public key ASA9c-OHMfFtiCUK2jIZN958JncMTZXfEJ3tDjtjKpKLHgo
To claim this, I am signing this object:
| // The door name. Inner door, outer door and airvent must have this in the name. | |
| // Doors must also have [OUTER] and [INNER] also, and the displays must have [DISP] | |
| private string doorName = "vingdoor"; | |
| private const bool DISABLE_VENT = true; // if true, disable air vent when not using airlock | |
| private int tick=-1; // how long we have been in the current state; -1 nonsense value at start. | |
| private const float HIGH = 0.95f; // high pressure threshold | |
| private const float LOW = 0.05f; // low pressure threshold |
| void display_moon(float phase, int16_t x, int16_t y, int16_t r){ | |
| // phase here is 0-1, where 0 and 1 are new and 0.5 is full. | |
| // The x and y are the centre of the moon, and size is the radius of the moon. | |
| // Yes, there's a lot of duplication here. Could be tidied up. | |
| float n; // generally means "amount illuminated" or "amount not illuminated" | |
| if(phase<0.25){ | |
| // we fill a circle and then draw a black ellipse |
| #!/usr/bin/python3 | |
| # Used as part of 'up' to move up complex directory trees: | |
| # With no args, prints '..' | |
| # With a numeric argument, prints '../../' up as many levels as the arg. | |
| # With a string argument, looks for a string in the path, and prints '../' | |
| # enough times to go up to that directory. | |
| # | |
| # You also need to add to your .bash (I use .bash_aliases): | |
| # |
| double prevtime = now(); | |
| for(;;){ | |
| render(); | |
| double t = now() - prevtime; | |
| prevtime = now(); | |
| while(t>MINUPDATETIME){ | |
| update(MINUPDATETIME); | |
| t-=MINUPDATETIME; | |
| } | |
| update(t); |
| #include <stdio.h> | |
| #include <time.h> | |
| // calculate time in seconds between two timespecs | |
| inline double time_diff(timespec start, timespec end) | |
| { | |
| timespec temp; | |
| if ((end.tv_nsec-start.tv_nsec)<0) { |
I hereby claim:
To claim this, I am signing this object:
| /** | |
| * @file advent.cpp | |
| * @brief Brief description of file. | |
| * | |
| */ | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <angort/angort.h> |
| f = open('jokes.txt','r') | |
| jokes = [x.strip() for x in f.read().split('%%')] | |
| ... | |
| j = random.choice(jokes) |
| #include <stdio.h> | |
| #include <sys/socket.h> | |
| #include <netinet/in.h> | |
| #include <arpa/inet.h> | |
| #include <unistd.h> | |
| #include <strings.h> | |
| #include <string.h> | |
| #include <fcntl.h> | |
| #include <stdlib.h> |