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
package dynamic; | |
import java.io.BufferedReader; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.HashMap; | |
/** | |
* Console example application. | |
* |
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
/** | |
* Flames. Generates some flames by using gradients (with basic | |
* spline math) and Perlin noise (for generating the flame | |
* height). | |
*/ | |
/** Flame outer color */ | |
color startCol = color(100, 0, 210); | |
/** Flame inner color */ | |
color endCol = color(200, 150, 255); |
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
/** | |
* Quad Tree implementation and visualization in Processing. Executes | |
* with Processing 1.5.1 | |
* | |
* Adds points to a quad tree and shows visually as the quad tree | |
* splits and repushes the values as new values are added. | |
* | |
* Restart QuadTree with new values with a key press. | |
*/ |
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
/** | |
* Space invaders generator. Generates and draws invaders. Inspired | |
* by invaders fractals: | |
* http://www.levitated.net/daily/levInvaderFractal.html | |
* | |
* Mouse press will create new invaders and draw the new ones. | |
*/ | |
/** Scaling factor */ | |
float sc = 3f; |
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
/** | |
* Funky pattern generator. Creates a rather funky, Amiga-esque | |
* demo pattern that fades and regenerates. Looks cool but is | |
* quite useless. | |
* | |
* Uses sinus function to generate the colors, offset and | |
* scaled so that the bound [-1.0f, 1.0f] is [0, 255] instead. | |
*/ | |
void setup() |
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
package javaapplication2; | |
public class BodyPart { | |
private int health = 100; | |
private String bodyPartName; | |
public BodyPart(String bodyPartName, int health) { | |
this.health = health; | |
this.bodyPartName = bodyPartName; | |
} |
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
// Use _.mixin to extend lodash | |
_.mixin({ | |
'paged': function(collection, size) { | |
var pages = []; | |
this.each(myarr, function(val, i) { | |
var pos = Math.floor(i/size); | |
if (!pages[pos]) pages.push([]); | |
pages[pos].push(val); | |
}); |
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
// Use _.mixin to extend lodash | |
_.mixin({ | |
'rankedBy': function(c, rank_cb, reversed) { | |
var ranks = [], pos = 0, _ = this; | |
var grouped = _.groupBy(c, rank_cb); | |
ranks = _.sortBy(grouped, function(v) { | |
return rank_cb(v[0]); | |
}); | |
if (reversed) { |
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
// Usage: | |
var pauseModule = require('./uselessPause'); | |
var callback = function(str) { | |
console.log(str); | |
}; | |
// Either call the async function with callback | |
pauseModule(callback); | |
// Or call the async and queue the callback to the returned promise |
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
define(['ko'], function(ko) { | |
var viewModel = function () { | |
}; | |
viewModel.prototype.hodor = ko.computed(function() { | |
return "HODOR!"; | |
}); | |
return function() { |
OlderNewer