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 ( | |
m "math" | |
) | |
const LIMIT = 100 | |
func main() { | |
// They don't recomend working with raw arrays, so use a slice |
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" | |
import "math" | |
func FastInvSqrt(x float32) float32 { | |
xhalf := float32(0.5) * x | |
i := math.Float32bits(x) | |
i = 0x5f3759df - i>>1 | |
x = math.Float32frombits(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
<html> | |
<head> | |
<title>ZWS Example</title> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script> | |
<script language='javascript'> | |
$(document).ready(function() { | |
var ws = new WebSocket("ws://localhost:9999/test"); | |
ws.onmessage = function(evt) { | |
$('#output').append(evt.data+'<br />'); |
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
# producer | |
import zmq | |
context = zmq.Context() | |
socket = context.socket(zmq.PUB) | |
socket.setsockopt(zmq.LINGER, 0) # discard unsent messages on close | |
socket.connect('epgm://239.192.1.1:5000') | |
while True: |
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
# coding=utf8 | |
# Copyright (C) 2011 Saúl Ibarra Corretgé <saghul@gmail.com> | |
# | |
import hashlib | |
import os | |
import re | |
import socket | |
import struct |
NewerOlder