Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
#include <assert.h> | |
#include <pthread.h> | |
#include <stdio.h> | |
void *function(void *argument) { | |
printf("%s\n", (char *) argument); | |
return NULL; | |
} |
function createStorage() { | |
var | |
_, | |
map | |
; | |
map = new WeakMap(); | |
return (function (object) { | |
var |
Original link: http://www.concentric.net/~Ttwang/tech/inthash.htm
Taken from: http://web.archive.org/web/20071223173210/http://www.concentric.net/~Ttwang/tech/inthash.htm
Reformatted using pandoc
Thomas Wang, Jan 1997
last update Mar 2007
function isNumeric(value) { | |
return ((! isNaN(parseFloat(value))) && isFinite(value)); | |
} |
function classExtend(subClass, superClass) { | |
for (var property in superClass) { | |
if (superClass.hasOwnProperty(property)) { | |
subClass[property] = superClass[property]; | |
} | |
} | |
function constructor() { | |
this.constructor = subClass; | |
} |
THIS JUST IN: @WebandPHP Embrace Women in an attempt to Enhance PHPness and Boost Subscriptions
< sarcasm >
(PHP) -- A massive sexist storm spanning the globe dumped thousands of foreign messages on unsuspecting geeks as they watched as their tweet stream, normally depicting handy references to JS resources, object oriented design structures and REGEX utilities, turned into a thick sludge of sadness and despair, dividing the community.
Observers agreed, the divide also provided a distinct benefit by making easy work of identifying and arresting misogynist asshats who threaten the very fabric of a community, a community known for communicating using curly brackets, semi-colons and now, with PHP 5.3, namespaces.
Those detained now await no trail, but are able to exercise their right to a quick tagging and permanent display on the Geek Feminist Wiki.
var primeFactorization = function primeFactorization(number, result) { | |
var result = (result || []); | |
var root = Math.sqrt(number); | |
var x = 2; | |
if (number % x) { | |
x = 3; | |
while ((number % x) && ((x = (x + 2)) < root)) {} | |
} |
if (! Function.prototype.bind) { | |
Function.prototype.bind = function bind(context) { | |
if (typeof this !== "function") { | |
throw new TypeError("Function.prototype.bind: the object on which you're trying to bind to is not callable.") | |
} | |
var | |
bound_func, | |
func, |
module DataStructures | |
class NaiveLinkedList | |
def initialize() | |
@head = nil | |
end | |
def [](index) | |
node = @head | |
self.loop_set_node(index, node) | |
node.value() |