View rank_metrics.py
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
"""Information Retrieval metrics | |
Useful Resources: | |
http://www.cs.utexas.edu/~mooney/ir-course/slides/Evaluation.ppt | |
http://www.nii.ac.jp/TechReports/05-014E.pdf | |
http://www.stanford.edu/class/cs276/handouts/EvaluationNew-handout-6-per.pdf | |
http://hal.archives-ouvertes.fr/docs/00/72/67/60/PDF/07-busa-fekete.pdf | |
Learning to Rank for Information Retrieval (Tie-Yan Liu) | |
""" | |
import numpy as np |
View zmq_client_req.py
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 zmq # Client | |
sock = zmq.Context().socket(zmq.REQ) | |
sock.connect("tcp://127.0.0.1:10000") | |
sock.send('0') | |
print(sock.recv()) # Prints "1" |
View glass.html
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 style="width:100%; height:100%; overflow:hidden"> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
<canvas id="offscreen" width="640" height="360" style="display:hidden"></canvas> | |
<script> | |
HEIGHT = 360; | |
WIDTH = 640; | |
function drawCircle(x, y,tag) { | |
var width = WIDTH; | |
var height = HEIGHT; |
View exif_pil.py
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 get_exif(image): | |
from PIL.ExifTags import TAGS as id_names | |
image_tags = image._getexif() | |
return {name: image_tags[id] | |
for id, name in id_names.items() | |
if id in image_tags} |
View glass.html
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 style="width:100%; height:100%; overflow:hidden"> | |
<body style="width:100%; height:100%; overflow:hidden; margin:0"> | |
<script> | |
function qr(data, format) { | |
WS.publish('urlopen', atob(data)); | |
} | |
function server() { | |
WS.say('Scan a QR Code'); | |
WS.qr('qr'); | |
} |
View demo.py
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 ctypes | |
import time | |
import numpy as np | |
import example_cython | |
def mult_sum(a): | |
b = 0 | |
for i in range(10000): | |
b += a * i |
View server.py
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 gevent.monkey | |
gevent.monkey.patch_all() | |
import msgpack | |
from gevent import pywsgi | |
from geventwebsocket.handler import WebSocketHandler | |
def websocket_app(environ, start_response): | |
print('Connected') | |
if environ["PATH_INFO"] == '/': | |
ws = environ["wsgi.websocket"] |
View gist:6874542
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
<!--{"profile":"http://wearscript.com"}--> | |
<html> | |
</html> |
View dsa_crypto_example.go
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 "crypto/dsa" | |
import "crypto/rand" | |
import "fmt" | |
import "math/big" | |
func SignatureGenerateServerKey() *dsa.PrivateKey { | |
priv := dsa.PrivateKey{} | |
dsa.GenerateParameters(&priv.Parameters, rand.Reader, dsa.L3072N256) |
View test.txt
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
rev2 |
NewerOlder