Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
abstract Measure | |
immutable Length{unit} <: Measure | |
value::Float64 | |
end | |
abstract MeasureOp{n} <: Measure | |
abstract UnaryOp{A} <: MeasureOp{1} | |
abstract ScalarOp{A} <: MeasureOp{2} | |
abstract BinaryOp{A, B} <: MeasureOp{2} |
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
A = [1 3; 4 2] / 4 | |
blue = RGB(0., 0., 9.) | |
red = RGB(9., 0., 0.) | |
place(point) = (point .+ 1) ./ 4 .+ .25 | |
drawpoints(points, c) = | |
[(context(place(points[:, i])..., 0.005, 0.005), fill(c), circle()) | |
for i = 1:size(points, 2)] |
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
{- Sierpinski's triangle -} | |
hscale = sqrt(3) / 2 | |
triangle a = | |
filled black (path [(-a / 2, -hscale * a / 2), | |
(a / 2, -hscale * a / 2), | |
(0, hscale * a / 2)]) | |
sierpinski (x, y) a n = |
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
using AudioIO | |
macro time_call(ex) | |
println(ex) | |
var = gensym() | |
ex = Expr(:(=), var, ex) | |
quote | |
$ex; | |
AudioIO.pull($var, 44100, 0, 44100); | |
@time AudioIO.pull($var, 44100, 0, 44100); |
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
def remove_comments(line, pref="", ctx=None, escape=False): | |
if line == "": return pref | |
if ctx == "#" and line[0] != '\n': | |
return remove_comments(line[1:], pref, ctx) | |
if not ctx: | |
if line[0] == "#": return remove_comments(line[1:], pref, '#') | |
for c in ['"""', '"', "'"]: | |
if line.startswith(c): | |
# open context | |
return remove_comments(line[len(c):], pref + c, c) |
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
/* CSS declarations go here */ | |
.wrapper { | |
width: 960px; | |
margin: 10px auto; | |
} | |
ul { | |
list-style: none; | |
} |
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
// Copyright 2009 Google Inc. All Rights Reserved. | |
package com.google.appinventor.components.runtime; | |
import com.google.appinventor.components.annotations.DesignerComponent; | |
import com.google.appinventor.components.annotations.DesignerProperty; | |
import com.google.appinventor.components.annotations.PropertyCategory; | |
import com.google.appinventor.components.annotations.SimpleEvent; | |
import com.google.appinventor.components.annotations.SimpleFunction; | |
import com.google.appinventor.components.annotations.SimpleObject; |
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
// Copyright 2009 Google Inc. All Rights Reserved. | |
package com.google.appinventor.components.runtime; | |
import com.google.appinventor.components.annotations.DesignerComponent; | |
import com.google.appinventor.components.annotations.DesignerProperty; | |
import com.google.appinventor.components.annotations.PropertyCategory; | |
import com.google.appinventor.components.annotations.SimpleEvent; | |
import com.google.appinventor.components.annotations.SimpleFunction; | |
import com.google.appinventor.components.annotations.SimpleObject; |
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
# Python Script to block spammy subscribers from your identi.ca account. | |
# bug me: identi.ca/g0 | |
import json | |
import sys | |
import urllib2 | |
apipath = 'http://identi.ca/api' | |
username = raw_input('Your username: ') | |
password = raw_input('Your password: ') |