I hereby claim:
- I am bradclawsie on github.
- I am bradclawsie (https://keybase.io/bradclawsie) on keybase.
- I have a public key whose fingerprint is A241 EE39 764B 3F6B 7B8C F45D C518 3746 444A F753
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
srv := &http.Server{ | |
Addr: ":443", | |
TLSConfig: &tls.Config{ | |
CipherSuites: []uint16{ | |
tls.TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, | |
tls.TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, | |
tls.TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, | |
tls.TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, | |
tls.TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, | |
tls.TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, |
// g++ -g -Wall -Werror -Wextra -pedantic -pedantic-errors -std=c++11 -g -O2 -c wordchain.cpp | |
// g++ -o wordchain wordchain.o | |
// example: wordchain cause north | |
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <algorithm> | |
#include <climits> | |
#include <memory> |
package org.b7j0c.puzzles; | |
// http://programmingpraxis.com/2013/11/15/twitter-puddle/ | |
public final class Puddles { | |
public static void main(String[] args) { | |
int[] c = {2,5,1,2,3,4,7,7,6,1,1,9,8,8,9,1,1}; | |
int cl = c.length; | |
int w = -1; | |
int sub = 0; |
package org.b7j0c.puzzles; | |
import java.util.EnumMap; | |
import java.util.Map; | |
import java.util.HashMap; | |
import java.util.List; | |
import java.util.ArrayList; | |
// the Hex class represents an id with six neighbors. the orientation of the neighbors is irrelevant | |
// but it is useful to describe them with compass directions as such: |
type Foo struct { | |
MandatoryString string | |
OptionalUInt64 NullableUInt64 | |
OptionalString NullableString | |
} |
type NullableString string | |
func (n NullableString) MarshalJSON() ([]byte, error) { | |
sn := string(n) | |
if sn == "" { | |
var i interface{} | |
return json.Marshal(i) | |
} | |
return json.Marshal(sn) | |
} |
{ "MandatoryString":"somestring", "OptionalUInt64":1, "OptionalString":"anotherstring" } | |
{ "MandatoryString":"somestring", "OptionalUInt64":1, "OptionalString":null } | |
{ "MandatoryString":"somestring", "OptionalUInt64":null, "OptionalString":"anotherstring" } | |
{ "MandatoryString":"somestring", "OptionalUInt64":null, "OptionalString":null } | |
{ "MandatoryString":"somestring", "OptionalUInt64":1 } |
type Foo struct { | |
MandatoryString string | |
OptionalUInt64 uint64 | |
OptionalString string | |
} | |
;; blog.jazzychad.net/2012/08/01/array-iteration-problem.html | |
(use srfi-1) | |
(: f ((list-of number) number number -> (list-of number))) | |
(define f | |
(lambda (arr n i) | |
(cond [(< n 0) | |
;; if we are going right-to-left, reverse the list and use the abs count | |
(reverse (f (reverse arr) (abs n) i))] |