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
function str_repeat_func($function, $multiplier) { | |
if(!is_callable($function) || !is_integer($multiplier) || $multiplier <= 0) | |
return ""; | |
$accumulator = ""; | |
for($i = 0; $i < $multiplier; $i++) | |
$accumulator .= call_user_func($function); | |
return $accumulator; | |
} |
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
import scala.io.Source | |
/* Boilerplate to make Java not throw Exceptions on non UTF-8 characters */ | |
import java.nio.charset.CodingErrorAction | |
import scala.io.Codec | |
implicit val codec = Codec("UTF-8") | |
codec.onMalformedInput(CodingErrorAction.REPLACE) | |
codec.onUnmappableCharacter(CodingErrorAction.REPLACE) | |
/* Put your WAV file here. You might want to slice it; a full WAV file will exceed JVM memory limit */ |
NewerOlder