- Take a decimal number
r
whose binary representation is a 1d automaton ruleset. - Simulate
n
generations. - Output a visualization of the progression—ascii's fine.
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
#lang racket | |
(require json | |
syntax/parse/define | |
net/url | |
(for-syntax racket/base json net/url)) | |
;; Replace YOUR_API_KEY with your actual OpenAI API key | |
(define-for-syntax api-key "YOUR_API_KEY") | |
;; Function to read all data from a port |
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
class Expr(object): | |
def __init__(self, *args): | |
self.args = args | |
def rewrite(self, fn): | |
rewritten = map(fn, self.args) | |
if any(a is not b for a, b in zip(self.args, rewritten)): | |
return type(self)(*rewritten) | |
return self |
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
Mimesis Recording | |
Title: mimesis |
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
Mimesis Recording | |
Title: example |
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
var http = require('http'); | |
var https = require('https'); | |
var GROUP = '10237173'; // Get from another API call | |
var record = []; | |
function getMessages(token, res, offset) { | |
https.get("https://api.groupme.com/v3/groups/" + GROUP + '/messages?limit=100&token=' + token + (offset ? '&before_id=' + offset : ''), function (apiRes) { | |
var buffer = []; | |
apiRes.on('data', function (chunk) { | |
buffer.push(chunk); | |
}); |
This file has been truncated, but you can view the full file.
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
[ | |
{ | |
"repo": "Honors/HubChronos", | |
"commit_days": { | |
"8/13/2013": 3 | |
} | |
}, | |
{ | |
"repo": "Honors/Elms", | |
"commit_days": { |
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
let testObject = PFObject(className: "User") | |
testObject["name"] = "Matt" | |
testObject["location"] = "asdfasdfasdf" | |
testObject["id"] = "1" | |
testObject.saveInBackgroundWithBlock { (success: Bool, error: NSError?) -> Void in | |
println("Object has been saved.") | |
} | |
let testObject = PFObject(className: "Event") | |
testObject["for_user"] = "1" |
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 requests | |
import threading | |
# a -> () | |
def out(x): | |
print x | |
def get(url, cb): | |
def work(): | |
cb(requests.get(url).json()) | |
return work |
NewerOlder