View Singleton
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
using System; | |
public class Singleton | |
{ | |
private static Singleton instance; | |
private Singleton() {} | |
public static Singleton Instance | |
{ |
View Recursive DOM Example
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
function walkTheDOM(node, F) | |
{ | |
F(node); | |
node = node.firstChild; | |
while (node) | |
{ | |
walkTheDom(node, F); | |
node = node.nextSibling; //Changes state here, destroying node | |
} | |
} |
View gist:1152858
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
function GetIncrementFunc(incBy) | |
{ | |
var temp = 0; | |
return function() { temp += incBy; return temp; } | |
} | |
var c = GetIncrementFunc(3); | |
document.write(c()); | |
document.write(c()); | |
document.write(c()); |
View 3JWebGL
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
<!doctype html> | |
<html> | |
<head> | |
<title></title> | |
</head> | |
<body> | |
<div id="container"> | |
</div> | |
</body> | |
<script src="Three.js" type="text/javascript"></script> |
View F# Factorial Simple
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
open System | |
open System.Diagnostics | |
let rec fac x = if x < 1.0 then 1.0 else x * fac(x-1.0) | |
let watch = new Stopwatch() | |
watch.Start() | |
let simpleComputation = [for i in 0.0..51000.0 -> fac(i)] | |
watch.Stop() | |
let result = watch.Elapsed.Seconds.ToString() | |
printfn "%s" result;; |
View Factorial Async Parallel F#
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
open System | |
open System.Diagnostics | |
let rec fac x = if x < 1.0 then 1.0 else x * fac(x-1.0) | |
let watch = new Stopwatch() | |
watch.Start() | |
let complexComputation = Async.Parallel [for i in 0.0..51000.0 -> async { return fac(i) }] |> Async.RunSynchronously;; | |
watch.Stop() |
View How to get SQL for ASPNET Membership Provider
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
cd %windir%\Microsoft.NET\Framework\v4.0.30319 | |
aspnet_regsql.exe -sqlexportonly C:\file.sql -A all |
View ConvertOBJtoJSON
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
C:\Program Files (x86)\IronPython 2.7>ipy.exe "C:\Users\djohnson\Desktop\Convert | |
OBJToJSON\convert_obj_three.py" -i "C:\users\djohnson\Desktop\ConvertOBJToJSON\B | |
razile.obj" -o "C:\users\djohnson\Desktop\outfile.js" |
View VSDOC
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
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.6.4-vsdoc.js" type="text/javascript"></script> |
View Towers of Hanoi
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
var hanoi = function(disc,src,aux,dst) { | |
if (disc > 0) { | |
hanoi(disc - 1, src,dst,aux); | |
document.write('Move disc ' + disc + ' from ' + src + ' to ' + dst); | |
hanoi(disc-1,aux,src,dst); | |
} | |
} | |
hanoi(3, 'src','aux','dst'); |
OlderNewer