I hereby claim:
- I am jgrahamc on github.
- I am jgrahamc (https://keybase.io/jgrahamc) on keybase.
- I have a public key ASCYBDOIZyzosDOYJlurgIvmBkUPYwCCcRaUOElhCFSkZAo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
func doMightError() (err error) { | |
switch { | |
case !doFirst(&err): | |
case !doSecond(&err): | |
case !doThird(&err): | |
default: | |
moreStuff() | |
} | |
return |
func doMightError() (err error) { | |
if err = doFirst(); err != nil { | |
return | |
} | |
if err = doSecond(); err != nil { | |
return | |
} | |
if err = doThird(); err != nil { |
use strict; | |
use warnings; | |
my @alpha = split('', 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'); | |
my %frequencies = ( 'A' => 84, 'B' => 23, 'C' => 21, 'D' => 46, 'E' => 116, | |
'F' => 20, 'G' => 25, 'H' => 49, 'I' => 76, 'J' => 2, | |
'K' => 5, 'L' => 38, 'M' => 34, 'N' => 66, 'O' => 66, | |
'P' => 15, 'Q' => 2, 'R' => 64, 'S' => 73, 'T' => 81, | |
'U' => 19, 'V' => 11, 'W' => 21, 'X' => 2, 'Y' => 24, |
#include "stdint.h" | |
#include "stdio.h" | |
void main(int argc, void *argv[]) { | |
uint64_t i; | |
for (i = 0; i < 2^32; i++) { | |
uint32_t x = (uint32_t)i; | |
uint32_t l = (-x-1) & 0xffff; | |
uint32_t r = ~x & 0xffff; | |
if (l != r) { |
int b = 100; | |
int s = 640; | |
int w = b*(s/b); | |
int h = w; | |
void setup() { | |
background(0); | |
size(w, h); | |
int side = w/b - 1; | |
int x; |
// Copyright (c) 2014 John Graham-Cumming | |
// | |
// Takes a CSV containing rows in the form | |
// | |
// ip,name | |
// | |
// Connects to 'ip' on port 443 using TLS presenting the SNI name 'name' and | |
// verifies the result. | |
package main |
$(call to_n,4) = $(words ) $(if $(filter-out 4,$(words x )),$(call to_n,4,x )) # $1 == 4, $2 is blank | |
= 0 $(if $(filter-out 4,1),$(call to_n,4,x )) # $(filter-out 4,1) is 1 | |
= 0 $(if 1,$(call to_n,4,x )) # So the $(call) will happen | |
= 0 $(call to_n,4,x ) | |
= 0 $(words x ) $(if $(filter-out 4,$(words x x )),$(call to_n,4,x x )) | |
= 0 1 $(if $(filter-out 4,2)),$(call to_n,4,x x )) # $(filter-out 4,2) is 2 | |
= 0 1 $(if 2,$(call to_n,4,x x)) # So the $(call) will happen | |
= 0 1 $(call to_n,4,x x) | |
= 0 1 $(words x x ) $(if $(filter-out 4,$(words x x x)),$(call to_n,4,x x x )) | |
= 0 1 2 $(if $(filter-out 4,3),$(call to_n,4,x x x )) # $(filter-out 4,3) is 3 |
all: | parallel ; @echo $(JOB_COUNT) | |
parallel: .parallel ; @$(eval JOB_COUNT := $(shell sort -n $< | tail -n 1)) | |
.parallel: FORCE ; @$(MAKE) --no-print-directory par 2>/dev/null >$@ || true | |
FORCE: | |
to_n = $(words $2) $(if $(filter-out $1,$(words x $2)),$(call to_n,$1,x $2)) | |
PAR_COUNT := | |
par: $(addprefix par-,$(call to_n,32)) |
// loc_parser: functions to parse the textual part of a LOC record | |
// stored in our DNS. The key function here is parseLOCString which | |
// should be passed a dns.LOC and a string containing the latitude, | |
// longitude etc. | |
// | |
// This is an implementation of RFC 1876. Read it for background as | |
// the format in a dns.LOC is slightly unusual. | |
// | |
// Copyright (c) 2014 CloudFlare, Inc. |