Skip to content

Instantly share code, notes, and snippets.

// Here is a simple object with an (unnecessarily roundabout) squaring method
var AsyncSquaringLibrary = {
squareExponent: 2,
square: function(number, callback){
var result = Math.pow(number, this.squareExponent);
setTimeout(function(){
callback(null, result);
}, 200);
}
};
#const min_segments_between_nodes = 1.
#const max_segments_between_nodes = 2.
#const min_road_segment_length = 1.
#const max_road_segment_length = 6.
% symbol:
% N = node index
% E = edge index (connection between nodes)
% R = road segment index (each edge has some number of horizontal/vertical segments)
@dogles
dogles / gist:7750584
Created December 2, 2013 14:51
Visualizer for map skeleton
#!/usr/bin/python
import re
import sys
road_vertex = re.compile("road_vertex\(([\w\d]+),([\w\d]+),([\w\d]+),([\w\d]+),([\w\d]+)\)")
def display_maze(facts):
"""turn a list of ansprolog facts into a nice ascii-art maze diagram"""
max_x = 1
/** The function should be invoke when the thread exit. The execution only continues if all child threads have invoked their `JoinFunction`. */
typedef JoinFunction = (Void->Void)->Void;
/**
Fork threads for every element in <code>threadIdentifiers</code>.
@param handler The callback function invoked for each element in <code>threadIdentifiers</code>.
The <code>handler</code> can receive two parameters:
the element in <code>threadIdentifiers</code> and the <code>JoinFunction</code>.
**/
public static function fork<Identifier>(
ModelEntity.init = function(completion) {
var componentError = null;
var postFork = function() {
if ( componentError != null ) Log.error(componentError);
completion(componentError);
}
ForkJoin.fork(entity.m_components,function(component,join) {
component.onInit(function(error) {
if(error != null) componentError = error;
com.dongxiguo.continuation.utils.ForkJoin.fork = function(threadIdentifiers,handler) {
if(Lambda.empty(threadIdentifiers)) throw "threadIdentifiers must not be empty!";
var counter = 1;
var quickJoinHandler = null;
var $it0 = $iterator(threadIdentifiers)();
while( $it0.hasNext() ) {
var id = $it0.next();
counter++;
var isJoined = [false];
handler(id,(function(isJoined) {
# This file determines which asset bundles will be created for the game.
#
# Bundles are first created by specifying rules and paths. There are 5 available rules:
# bundle_all: Create a SINGLE asset bundle for all files found in the specified paths. This operates recursively on directories.
# bundle_each_file: Create an asset bundle for EACH file found in the specified paths. This operates recursively on directories.
# bundle_each_folder: Create an asset bundle for EACH subfolder found in the specified paths.
# bundle_all_folders: Create a SINGLE asset bundle for all subfolders found in the specified paths.
# exclude_all: Exclude all specified files/folders from being bundled by rules specified after this rule.
# exclude_folders: Exclude files in subfolders of the specified folders from being being bundled by rules specified after this rule.
#
Shader "Hidden/FastBlur" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Bloom ("Bloom (RGB)", 2D) = "black" {}
}
CGINCLUDE
#include "UnityCG.cginc"
#pragma strict
@script ExecuteInEditMode
@script RequireComponent (Camera)
@script AddComponentMenu ("Image Effects/Blur/Blur (Optimized)")
class Blur extends PostEffectsBase {
@Range(0, 2)
using haxe.root;
#pragma warning disable 109, 114, 219, 429, 168, 162
namespace view{
public class PzBlur : Blur, haxe.lang.IHxObject {
public PzBlur(haxe.lang.EmptyObject empty) : base(){
unchecked {
}
}