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 time | |
import logging | |
import sys | |
import emotiv | |
import gobject; gobject.threads_init() | |
import gst | |
pipe = gst.parse_launch('audiotestsrc name=generator freq=0 ! autoaudiosink') | |
generator = pipe.get_by_name('generator') | |
pipe.set_state(gst.STATE_PLAYING) |
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
(defmacro defmixfix [name args & body] | |
(let [kws (vec (filter keyword? args)) | |
filter-indices (fn [pred coll] | |
(filter (complement nil?) (map-indexed #(if (pred %2) %1 nil) coll))) | |
positions (vec (filter-indices keyword? args)) | |
genkwsym (fn [kw] (with-meta (gensym) {:name kw})) | |
kw-symbols (reduce #(assoc %1 %2 (genkwsym %2)) {} kws) | |
args-with-symbols (vec (map #(if (keyword? %) (% kw-symbols) %) args))] | |
`(defn ~name ~args-with-symbols | |
(do |
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
(ns ants | |
(:require [clojure.string :as string])) | |
;;**************************************************************** | |
;; Constants and lookups | |
;;**************************************************************** | |
(declare ^{:dynamic true} *game-info*) | |
(declare ^{:dynamic true} *game-state*) |
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 pymongo, twilio.twiml | |
from flask import Flask, jsonify, render_template, request, abort | |
from operator import itemgetter | |
from twilio.rest import TwilioRestClient | |
account_sid = "your twilio account sid" | |
auth_token = "your twilio auth token" | |
client = TwilioRestClient(account_sid, auth_token) | |
CROWDINSTRUCTOR_NUMBER = "your twilio number" |
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
from hac import Humanity | |
Romeo = Humanity.find_person(nickname = "Romeo").assume_control() | |
Juliet = Humanity.find_person(nickname = "Juliet").assume_control() | |
Romeo.face(Juliet) | |
Juliet.face(Romeo) | |
Romeo.voice.say("Hello Juliet") | |
Romeo.face.wink() |
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
from hac import Humanity | |
Anastasis = Humanity().find_person(username = "Anastasis") | |
Anastasis.assume_control() | |
Anastasis.voice.say("Hello world!") |
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 multiprocessing | |
from hac import Humanity | |
from moviepy.editor import ImageSequenceClip | |
everyone = Humanity.find_people() | |
def take_photo(human): | |
human.assume_control(timeout = 30) | |
photo = human.smartphone.take_photo() # returns PIL Image | |
photo.show() |
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 multiprocessing | |
from hac import Humanity | |
from moviepy.editor import ImageSequenceClip | |
everyone = Humanity.find_people() | |
def take_photo(human): | |
human.assume_control(timeout = 30) | |
photo = human.smartphone.take_photo(front_facing = True) | |
photo.show() |
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 multiprocessing | |
from hac import Humanity | |
from moviepy.editor import ImageSequenceClip | |
everyone = Humanity.find_people() | |
def take_photo(human): | |
human.assume_control(timeout = 30) | |
other_human = human.vision.search_for_human() | |
photo = human.smartphone.take_photo(subject = other_human) |
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 multiprocessing | |
from hac import Humanity | |
everyone = Humanity.find_people() | |
def take_photo(human): | |
human.assume_control(timeout = 30) | |
other_human = human.vision.search_for_human() | |
photo = human.smartphone.take_photo(subject = other_human) | |
photo.show() |
OlderNewer