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 n = 1000; | |
var from = 10000000000000000; | |
var to = from + n; | |
var i = from; | |
var missing = []; | |
while (i < to) { | |
var incr = 1; | |
while (i === i+incr) { | |
missing.push(i+" + "+incr); | |
incr ++; |
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 n = 10000000000000000; | |
for (var i = n; i < n+9; i++) { console.log(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
// https://github.com/gre/playCLI |
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 org.apache.commons.codec.binary.Base64 | |
val base64 = "data:([a-z]+);base64,(.*)".r | |
def decodeBase64 (src: String): Option[(String, Array[Byte])] = { | |
src match { | |
case base64(mimetype, data) => Some( (mimetype, Base64.decodeBase64(data.getBytes("utf-8"))) ) | |
case _ => None | |
} | |
} |
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
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
object Application extends Controller { | |
def zip = Action { | |
import play.api.libs.iteratee._ | |
import java.util.zip._ |
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
object Application extends Controller { | |
val buffSize = 10000 | |
var f = 200. | |
val rawStream = { | |
var i = 0; | |
val ticker = Enumerator.generateM[Int]({ | |
i += 1; | |
Promise.timeout(Some(i), (1000.*buffSize.toDouble/44100.).toInt) |
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
package encoders; | |
// Implementing the WAV format here! | |
case class MonoWaveEncoder ( | |
frameRate: Int = 44100, | |
samplesPerFrame: Int = 1, | |
bitsPerSample: Int = 16 // not supported yet (need to adapt the encodeData function) | |
) { | |
val bytesPerSamples = ((bitsPerSample+7)/8).toInt |
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
uniform float p; | |
uniform float amount; | |
uniform float seed; | |
uniform float lines; | |
uniform sampler2D tDiffuse; | |
varying vec2 vUv; | |
float rand(vec2 co){ | |
return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); |
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
jQuery(function($){ | |
if(!document.createElement('canvas').getContext) return; // canvas is required. | |
var requestAnimFrame = (function(){ | |
return window.requestAnimationFrame || | |
window.webkitRequestAnimationFrame || | |
window.mozRequestAnimationFrame || | |
window.oRequestAnimationFrame || | |
window.msRequestAnimationFrame || |
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 GridUtils = function() { | |
var log10 = Math.log(10.) | |
function powOf10 (n) { | |
return Math.floor(Math.log(n)/log10) | |
} | |
return { | |
findNiceRoundStep: function (delta, preferedStep) { | |
var n = delta / preferedStep; |