Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
(ns com.wangdera.slideshow | |
(:use [clojure.contrib.test-is]) | |
(:import (java.io File) | |
(javax.imageio ImageIO) | |
(javax.swing JFrame JPanel Timer) | |
(java.awt Dimension Frame Color) | |
(java.awt.event ActionListener WindowAdapter))) | |
(def imagelist (atom [])) | |
(def current-image (atom nil)) |
#lang racket | |
(require parser-tools/lex | |
(prefix-in re- parser-tools/lex-sre) | |
parser-tools/yacc) | |
(provide (all-defined-out)) | |
(define-tokens a (NUM VAR)) | |
(define-empty-tokens b (+ - EOF LET IN)) | |
(define-lex-trans number | |
(syntax-rules () |
require 'socket' | |
webserver = TCPServer.new('127.0.0.1', 7777) | |
puts "Iniciando servidor." | |
while (session = webserver.accept) | |
session.print "HTTP/1.1 200/OK\r\nContent-type:text/html\r\n\r\n" | |
begin |
#!/usr/bin/env python | |
import ctypes | |
import wave | |
import sys | |
pa = ctypes.cdll.LoadLibrary('libpulse-simple.so.0') | |
PA_STREAM_PLAYBACK = 1 | |
PA_SAMPLE_S16LE = 3 |
""" | |
Web Mercator Scale and Resolution Calculations | |
Python implementation of the formulas at http://msdn.microsoft.com/en-us/library/bb259689.aspx | |
""" | |
import math | |
def meters_per_pixel(zoom, lat): | |
""" | |
ground resolution = cos(latitude * pi/180) * earth circumference / map width | |
""" |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
*.so | |
*.o | |
*.html | |
.*.un~ | |
.*.swp |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
// adapted from intersectCube in https://github.com/evanw/webgl-path-tracing/blob/master/webgl-path-tracing.js | |
// compute the near and far intersections of the cube (stored in the x and y components) using the slab method | |
// no intersection means vec.x > vec.y (really tNear > tFar) | |
vec2 intersectAABB(vec3 rayOrigin, vec3 rayDir, vec3 boxMin, vec3 boxMax) { | |
vec3 tMin = (boxMin - rayOrigin) / rayDir; | |
vec3 tMax = (boxMax - rayOrigin) / rayDir; | |
vec3 t1 = min(tMin, tMax); | |
vec3 t2 = max(tMin, tMax); | |
float tNear = max(max(t1.x, t1.y), t1.z); |