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é <[email protected]> | |
# | |
import hashlib | |
import os | |
import re | |
import socket | |
import struct |
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
<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
#define FILE(file) \ | |
([[NSBundle mainBundle] pathForResource:file \ | |
ofType:nil]) | |
#define FILE_IN_DIR(file, dir) \ | |
([[NSBundle mainBundle] pathForResource:file \ | |
ofType:nil \ | |
inDirectory:dir]) |
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 fragment shader | |
// 'time' contains seconds since the program was linked. | |
uniform float time; | |
uniform sampler2D tex; | |
float radius = .5; | |
void main() |
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 fragment shader | |
// 'time' contains seconds since the program was linked. | |
uniform float time; | |
uniform sampler2D tex; | |
uniform sampler2D tex2; | |
float radius = .5; |
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
/* | |
This is a complete working program, equivalent to the Rust program. | |
*/ | |
package main | |
import ( | |
"fmt" | |
"math/rand" | |
"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
~/home/go/ | |
λ go get | |
# _/Users/alco/home/go | |
./dynamic_new.go:17: main redeclared in this block | |
previous declaration at ./crawl.go:47 | |
./fastinvsqrt.go:15: main redeclared in this block | |
previous declaration at ./dynamic_new.go:17 | |
./fib.go:17: main redeclared in this block | |
previous declaration at ./fastinvsqrt.go:15 | |
./find.go:22: main redeclared in this block |
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
@doc """ | |
Get list of files and directories in `dir`. | |
""" | |
def listdir(dir) do | |
F.list_dir(dir) | |
end | |
@doc """ | |
Get list of files and directories in `dir`. |