var aut = new AutoUpdateTime(date, function(timeDiff) {
console.log(timeDiff + ' ms passed since last callback');
});
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
class BresenhamLineDrawer implements LineDrawer { | |
private PixelSetter buffer; | |
public BresenhamLineDrawer(PixelSetter buffer) { | |
this.buffer = buffer; | |
} | |
@Override | |
public void drawLine(int x1, int y1, int x2, int y2) { | |
int deltaX = Math.abs(x2 - x1); | |
int deltaY = Math.abs(y2 - y1); |
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
<!DOCTYPE html> | |
<!-- | |
Theme: Ashley v0.4 | |
Author: Jxnblk [http://jxnblk.com] | |
For: Tumblr [http://tumblr.com/] | |
Terms: Protected under Creative Commons. | |
--> | |
<html lang="en"> |
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
case class LoopState(i: Int = 0, acc: Double = 0.0, isCompleted: Boolean = false) | |
lazy val twoPowers = for (i <- 0 until 50) yield Math.pow(2.0, i) | |
val Epsilon: Double = 1e-17 | |
val TaskSize = 2500000 | |
def modPow16(exp: Double, m: Double): Double = { | |
if (exp < 1) Math.pow(16.0, exp) |
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
/** | |
* @constructor | |
*/ | |
function WebGLRenderingContext() { | |
} | |
WebGLRenderingContext.prototype = { | |
ACTIVE_ATTRIBUTES: 35721, | |
ACTIVE_TEXTURE: 34016, | |
ACTIVE_UNIFORMS: 35718, |
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
define([ | |
'promise' | |
], function (Promise) { | |
/** | |
* @param urlWithoutExtension {String} - the path to the sound file without a particular extension. | |
* @param audioContext {AudioContext} - the audio context of the sound file, used for decoding. | |
* @returns {Promise} - a promise containing the decoded audio data. | |
*/ | |
function getSoundBuffer(urlWithoutExtension, audioContext) { |
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
trtht (tritheite) | |
jwstn (Jewstone) | |
hwkng (hawking) | |
plrdr (Pleurodira, pleurodire) | |
drsnz (deresinize) | |
nlwry (inlawry) | |
nrckn (unreckon) | |
bdlmc (Bedlamic) | |
mrmps (Mormoops) | |
clvry (Calvary, clovery) |
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 usrnames) | |
(require '[clojure.string :as str]) | |
(def file (slurp "/usr/share/dict/words" :encoding "ASCII")) | |
(def words (str/split-lines file)) | |
(defn remove-vowels [word] | |
(->> | |
word |
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 markov-usrnames) | |
(require '[clojure.string :as str]) | |
(def file (slurp "/usr/share/dict/words" :encoding "ASCII")) | |
(def words (str/split-lines file)) | |
(defn generate-markov-nodes | |
[words] | |
(->> |
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
(defn generate-markov-nodes | |
[words] | |
(->> | |
words | |
(map str/lower-case) | |
(str/join " ") | |
(partition 3 1) | |
(map #(list (take 2 %1) (nth %1 2))) | |
(reduce | |
(fn [acc [l next-l]] (update-in acc [l next-l] (fnil inc 0))) |
OlderNewer