This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 <[email protected]> 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]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"bytes" | |
"fmt" | |
"io" | |
"strconv" | |
"strings" | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import "fmt" | |
/******************************************************************************* | |
* Reference: | |
* An O(ND) Difference Algorithm and Its Variations | |
* Eugene W. Myers | |
*******************************************************************************/ |