Haskell is a functional programming language, in the ML family of languages, inheriting many of it’s properties from Lambda calculus. The label ‘functional’ refers to the fact that in functional languages, functions are treated as higher order objects. This means that they may be assigned to variables in the functional languages that have a concept of ‘variables’ in the traditional sense, and are otherwise treated as values. Both Haskell and Javascript are ‘functional’ languages in this capacity, however, they differ in many other ways. Javascript is a loosely typed language, meaning that it’s values, expressions, and functions do not have a specific type. One function could return values of different types depending on the arguments it receives, external state, or potentially other factors like internal calls to type unsafe APIs or underlying libraries. Javascript also features type coercion, where the interpreter will automatically convert variables of certain types into other t
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
//setup | |
var i = 0; | |
function log(a){ | |
console.log(a); | |
} | |
// read string literals as "string", and = and === as "is" | |
//haiku starts here | |
while(i<3){ | |
s = "i like javascript ";if(i===1)s+=" a lot"; | |
log(s);i++; |
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
// Is this a thing that people do? If so, what is it called? If not, why is it a bad idea? Answers on a tweet please. @hughrawlinson | |
var π = function(f,obj){ | |
try{ | |
f(obj()); | |
} | |
catch(e){ | |
f(obj); | |
} | |
}; |
9.15
Keynote #1 Audio and the Web - Chris Wilson
###Session Moderator: Raphaël Troncy
10.30
Building a Collaborative Digital Audio Workstation Based on the Web Audio API - Jan Monschke
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 JavascriptIs = ["wonderful","frustrating","charming","delightful"]; | |
console.log("I love javascript"); | |
// sometimes it does stupid shit | |
['10','10','10'].map(parseInt); | |
console.log("but all the time it's:"); | |
setInterval(function(){ | |
console.log(JavascriptIs[Math.round(Math.random()*JavascriptIs.length)]); | |
},1000); |
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
int analogInput = 0; | |
int rate = 0; | |
int val = 0; | |
int count = 0; | |
void setup() | |
{ | |
pinMode(analogInput, INPUT); | |
pinMode(2, OUTPUT); | |
pinMode(3, OUTPUT); |
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
int bpm; | |
// set the beats per minute here | |
60 => bpm; | |
// this signal flow approximates the timbre shown at: | |
// http://www.bsignetics.com/cases/ASD.ht65.gif | |
Noise n => HPF h => LPF l => ADSR e => dac; | |
int third; | |
int twothird; | |
60000/bpm/3 => third; |
I hereby claim:
- I am hughrawlinson on github.
- I am hugh (https://keybase.io/hugh) on keybase.
- I have a public key whose fingerprint is 9DF4 5AF7 0122 2683 1AC2 5128 9C1A C9F8 BCFC 89C9
To claim this, I am signing this object:
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
/** | |
@file fuzzylogic.c | |
@ingroup mc2liveAlg | |
hugh rawlinson - [email protected] | |
**/ | |
#include <stdio.h> | |
double fuzzyOR(double a, double b){ |
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
module.exports = function(){ | |
var self = {}; | |
//constructor stuff here | |
var private = 1; | |
self.public = 2; | |
var privateFunction = function(){ | |
console.log('this is a private function'); |