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
/** | |
* | |
* Newton-Raphson Square Roots | |
* as is shown in "why functional programming matters" | |
* http://www.cs.utexas.edu/~shmat/courses/cs345/whyfp.pdf | |
*/ | |
object NewtonRoots { | |
//algorithm to approach the square root of n |
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
/** | |
* User: miguelnegrao | |
* Date: 20/04/12 | |
*/ | |
import annotation.tailrec | |
import javax.sound.sampled._ | |
import math._ | |
import scalaz._ | |
import Scalaz._ |
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
( | |
i = 2**(1/9); | |
~innerIntervals = [i,i,i**2,i,i,i,i**2]; | |
~intervalsToRoot = ([1]++~innerIntervals).inject([], { |state,x| | |
if(state.size == 0){ | |
[x] | |
} { | |
state ++ [state.last*x] | |
} |
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 r = { |f| { | |
var combF, sawF, c, r, sine , pulse; | |
sine = { SinOsc.kr(rrand(0.01,0.03)).range(0.0,1.0) }; | |
pulse = { Pulse.kr(rrand(0.1,0.3)) }; | |
r = 10.collect{ | |
sawF = 2.collect{ ( ( (pulse ! 2).sum + LFNoise2.kr(1) ) / 3).range(f,f+300) }; | |
y = Saw.ar( sawF ); | |
combF = ( ( (pulse ! 2).sum + (sine ! 3).sum ) /5).rangeExp(0.0001,0.009); | |
c = CombC.ar(y, 0.01, combF, 0.2); |
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 width = 500, height = 400, rate = 0.005; | |
var u = UserView(nil, Rect(128, 64, width, height) ); | |
var sides = [ | |
// Front face | |
[[-1.0, -1.0, 1.0], | |
[1.0, -1.0, 1.0], | |
[1.0, 1.0, 1.0], |
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
{----------------------------------------------------------------------------- | |
------------------------------------------------------------------------------} | |
{-# LANGUAGE ScopedTypeVariables #-} -- allows "forall t. NetworkDescription t" | |
import Graphics.UI.WX hiding (Event) | |
import Reactive.Banana | |
import Reactive.Banana.WX | |
{----------------------------------------------------------------------------- |
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
-- to create. This will also attempt to set the network location | |
-- to that name as well. | |
-- Set NetworkPassword to be your wireless network password. It MUST BE | |
-- 13 characters long (or 26 hex digits). | |
property NetworkName : "helloworld" | |
property NetworkPassword : "77777" | |
property CreateMenuName : "Criar rede…" |
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
try | |
do shell script "/usr/sbin/scselect " & 0 | |
end try |
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
module Main where | |
import Control.Monad.State | |
import Control.Monad.Trans | |
import Control.Monad.Maybe | |
import Control.Monad.Reader | |
import Control.Monad.Writer | |
type X = ReaderT String (WriterT [String] (StateT Int Maybe)) Int |
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 de.sciss.synth._ | |
import ugen._ | |
import scalaz._ | |
import Scalaz._ | |
import concurrent._ | |
import org.friendlyvirus.mn.ScalaColliderZ._ | |
object Test1 { | |
def main(args: Array[String]) { |
OlderNewer