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
(defmacro letfn- [fn-bindings & body] | |
(let [fn-names (map first fn-bindings) | |
fn-gensyms (into {} (for [f fn-names] | |
[f (gensym f)])) | |
delayed-bindings (for [f fn-names | |
x [(fn-gensyms f) | |
`(delay (~f ~@fn-names))]] | |
x) | |
forced-bindings (for [[n v] fn-gensyms | |
x [n `(force ~v)]] |
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
;SMBDIS.ASM - A COMPREHENSIVE SUPER MARIO BROS. DISASSEMBLY | |
;by doppelganger ([email protected]) | |
;This file is provided for your own use as-is. It will require the character rom data | |
;and an iNES file header to get it to work. | |
;There are so many people I have to thank for this, that taking all the credit for | |
;myself would be an unforgivable act of arrogance. Without their help this would | |
;probably not be possible. So I thank all the peeps in the nesdev scene whose insight into | |
;the 6502 and the NES helped me learn how it works (you guys know who you are, there's no |
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
/* http://l3net.wordpress.com/2012/12/09/a-simple-telnet-client/ */ | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
#include <string.h> | |
#include <arpa/inet.h> | |
#include <termios.h> | |
#include <fcntl.h> | |
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
(ns midi-parser.core | |
(:use clojure.java.data) | |
#_(:use utils.utils) | |
#_(:use vendors.debug-repl) | |
(:import (java.io File) | |
#_(java.util Arrays) | |
#_(java.nio ByteBuffer) | |
(javax.sound.midi MidiSystem Sequence MidiMessage MidiEvent ShortMessage MetaMessage Track))) | |
;***************** Utils ******************** |
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
(ns cljsaudio.core | |
(:require [goog.net.XhrIo] | |
[cljs.core.async :as async :refer [<! >! chan close!]]) | |
(:require-macros [cljs.core.async.macros :refer [go]])) | |
(defn decode-audio-data | |
[context data] | |
(let [ch (chan)] | |
(.decodeAudioData context | |
data |
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 sketch of Clojure-like protocols, implemented in Mal | |
;; Mal is https://github.com/kanaka/mal | |
(def! builtin-type (fn* [obj] | |
(cond | |
(list? obj) :mal/list | |
(vector? obj) :mal/vector | |
(map? obj) :mal/map | |
(symbol? obj) :mal/symbol | |
(keyword? obj) :mal/keyword |
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
var findFundamentalFreq = function(buffer, sampleRate) { | |
// We use Autocorrelation to find the fundamental frequency. | |
// In order to correlate the signal with itself (hence the name of the algorithm), we will check two points 'k' frames away. | |
// The autocorrelation index will be the average of these products. At the same time, we normalize the values. | |
// Source: http://www.phy.mty.edu/~suits/autocorrelation.html | |
// Assuming the sample rate is 48000Hz, a 'k' equal to 1000 would correspond to a 48Hz signal (48000/1000 = 48), | |
// while a 'k' equal to 8 would correspond to a 6000Hz one, which is enough to cover most (if not all) | |
// the notes we have in the notes.json file. | |
var n = 1024, bestR = 0, bestK = -1; |
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
/* telnet-example.c | |
* | |
* Copyright (c) 2015 Mittorn. Use may be in whole | |
* or in part in accordance to the General Public License (GPL). | |
* | |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND | |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE | |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
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
/** | |
* RIFF WAVE PCM file generator | |
* Reference: www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/WAVE.html | |
* | |
* @author Lara Sophie Schütt (@literallylara) | |
* @license CC0 | |
*/ | |
const DUR = 5 // duration in seconds | |
const NCH = 1 // number of channels |
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
(ns upload-file.core | |
(:require [reagent.core :refer [render atom]] | |
[cljs.core.async :refer [put! chan <! >!]]) | |
(:require-macros [cljs.core.async.macros :refer [go go-loop]])) | |
;; derived from https://mrmcc3.github.io/post/csv-with-clojurescript/ | |
;; and based on reagent-frontend template. | |
;; dependencies from project.clj in addition to clojure, clojurescript, and reagent: | |
;; [org.clojure/core.async "0.2.395"] |
OlderNewer