(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
package permutation | |
// Based on https://stackoverflow.com/a/30230552/14660 by Paul Hankin | |
// perm := NewPermutation( slice ) | |
// for next := perm.Next(); next != nil; next = perm.Next() { | |
// ... | |
// } | |
// | |
// or |
/* ADS1256 simple library for Arduino | |
ADS1256, datasheet: http://www.ti.com/lit/ds/sbas288j/sbas288j.pdf | |
connections to Atmega328 (UNO) | |
CLK - pin 13 | |
DIN - pin 11 (MOSI) | |
DOUT - pin 12 (MISO) | |
CS - pin 10 | |
DRDY - pin 9 | |
RESET- pin 8 (or tie HIGH?) |
func TestUserFail(t *testing.T) { | |
func() { | |
defer func() { | |
if r := recover(); r == nil { | |
t.Errorf("TestUserFail should have panicked!") | |
} | |
}() | |
// This function should cause a panic | |
CreateUser(12, "hello") |
// v2 of the great example of SSE in go by @ismasan. | |
// includes fixes: | |
// * infinite loop ending in panic | |
// * closing a client twice | |
// * potentially blocked listen() from closing a connection during multiplex step. | |
package main | |
import ( | |
"fmt" | |
"log" |
// There seem to be problems with "climatically" and "fezzes" as passwords. | |
// When using "climatically": Program terminates with "openpgp: unsupported feature: public key version" | |
// When using "fezzes": Program terminates with "openpgp: invalid data: tag byte does not have MSB set" | |
// Expected behaviour would be a reinvokation of the prompt function in an endless loop until the right password is used. | |
package main | |
import ( | |
"bytes" | |
"errors" |
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
package main | |
import ( | |
"archive/zip" | |
"fmt" | |
"log" | |
"os" | |
"time" | |
"github.com/cryptix/go/logging" |
protothread: protothread.o | |
gcc protothread.o -o protothread | |
protothread.o: protothread.s | |
as protothread.s -o protothread.o | |
protothread.s: protothread.ll | |
llc-3.4 protothread.ll |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
MIT License | |
Copyright (c) <year> <copyright holders> | |
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE S |