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" | |
"github.com/vmihailenco/redis" | |
) | |
func main() { | |
client := redis.NewTCPClient("localhost:6379", "", -1) |
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
<html> | |
<head> | |
<title>Redis Listener</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var conn; | |
var msg = $("#msg"); | |
var log = $("#log"); | |
function appendLog(msg) { |
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
def Decorator(): | |
registry = {} | |
def registrar(func): | |
registry[func.__name__] = func | |
return func | |
registrar.all = registry | |
return registrar | |
my_func_decorator = Decorator() |
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
Connect the Arduino UNO pins "(x)" to the LED leads "-" as follows: | |
_________ | |
| | | |
(1)-| ***** |-(11) | |
| * * * | | |
(2)-| ***** |-(10) | |
| | | |
(3)-| ***** |-(9) | |
| * * * | |
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
int segA = 10; | |
int segB = 6; | |
int segC = 4; | |
int segD = 2; | |
int segE = 1; | |
int segF = 9; | |
int segG = 5; | |
int pnt = 3; | |
int dig1 = 7; |
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
from __future__ import division | |
import urllib, json, string, datetime | |
from itertools import permutations | |
from math import log | |
def _bf(V, E, src): | |
# init | |
dist = dict(zip(V, [float('Inf') for v in V])) | |
pred = dict(zip(V, [None for v in V])) |
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
import urllib, json, datetime | |
def ParseGist(g): | |
id = str(g[u'id']) | |
dt = datetime.datetime.strptime(g[u'created_at'], '%Y-%m-%dT%H:%M:%SZ').strftime('%Y-%m-%d') | |
files = g[u'files'] | |
desc = g[u'description'] | |
link = g[u'html_url'] | |
comments = g[u'comments'] | |
languages = [files[f][u'language'] for f in files.keys()] |
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" | |
"math" | |
"sync" | |
) | |
func Average(x []float64) float64 { | |
sum := 0.0 |
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 ( | |
"flag" | |
"github.com/tncardoso/gocurses" | |
"github.com/vmihailenco/redis" | |
"os" | |
"strings" | |
"time" | |
) |
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" | |
func Coef(k float64) func(float64) float64 { | |
return func(x float64) float64 { | |
return k * x | |
} | |
} |