This file contains hidden or 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 bottle | |
from hacks import ProxyServer | |
root = bottle.Bottle() | |
ps = ProxyServer() | |
root.mount(ps.wrapped_proxy_app, "/proxyapp") | |
@root.route('/hello/:name') |
This file contains hidden or 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
#!/usr/bin/env python | |
# Ben's Magical Perceptron | |
def dot_product(a, b): | |
return sum([a[i]*b[i] for i in range(len(a))]) | |
def decision( x, w, theta ): | |
return (dot_product(x, w) > theta) |
This file contains hidden or 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> | |
<script src="http://mbostock.github.com/d3/d3.v2.js?2.8.1"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | |
<script type="text/javascript"> | |
$(function() { | |
var graph = null, | |
formatter = null, | |
dataSet = [], | |
graphPin = null; |
This file contains hidden or 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
/* | |
Web Server returning data as JSON-P | |
A simple web server that returns the value of the analog input | |
pins as a JSON-P object, using an Arduino Wiznet Ethernet shield. | |
Circuit: | |
* Ethernet shield attached to pins 10, 11, 12, 13 (standard configuration) | |
* Analog inputs attached to pins A0 through A5 (optional) | |
* Example of reading LM35 on pin A0: |
This file contains hidden or 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
# assume the following directory structure where contents of doc/ | |
# and source/ are already checked into repo., with the exception | |
# of the _build directory (i,e. you can check in _themes or _sources | |
# or whatever else). | |
# | |
# proj/ | |
# source/ | |
# doc/ | |
# remove doc/_build/html if present |
This file contains hidden or 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
net.ipv4.ip_forward=1 | |
net.ipv4.conf.eth0.proxy_arp=1 |
This file contains hidden or 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
CmdUtils.CreateCommand({ | |
name: ["dictcn", "dcn"], | |
author: { | |
name: "Hu Ziming", | |
email: "[email protected]" | |
}, | |
contributors: ["Hu Ziming", "azuwis"], | |
icon : "http://dict.cn/favicon.ico", | |
description: "Consulting the word from <a href=\"http://dict.cn\">http://dict.cn</a>.", | |
help: "Consulting the word from <a href=\"http://dict.cn\">http://dict.cn</a>.", |
NewerOlder