View WOL.pde
// Simple web server for Nanode v5 that also provides Wake-On-LAN broadcast on | |
// network segment in response to a HTTP request. This provides a route-able | |
// way to start a server on another network segment. | |
// 2012-01-07 <matthew@densons.org> http://opensource.org/licenses/mit-license.php | |
#include <EtherCard.h> | |
#include <NanodeUNIO.h> | |
// ethernet mac address - must be unique on your network | |
static byte mymac[6]; |
View KMP
package main | |
import "fmt" | |
//naive approach | |
func inStr(s, w string) int { | |
pos, i := 0, 0 | |
for pos+i < len(s) { | |
//fmt.Printf("%x: s[%x+%x] == w[%x] / %c == %c\n", pos, pos, i, i, s[pos+i], w[i]) | |
if s[pos+i] == w[i] { |
View simple-forth
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io" | |
"strconv" | |
"strings" | |
) |
View diff.go
package main | |
import "fmt" | |
/******************************************************************************* | |
* Reference: | |
* An O(ND) Difference Algorithm and Its Variations | |
* Eugene W. Myers | |
*******************************************************************************/ |