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
Array.prototype.unique = function() { | |
var uniqueKeys = {}; | |
var items = this.length; | |
while ( items ) { | |
uniqueKeys[ this[ --items ] ] = true; | |
} | |
var uniqueArray = []; | |
for ( var key in uniqueKeys ) { | |
if ( uniqueKeys.hasOwnProperty( key ) ) { |
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
Array.prototype.unique = function() { | |
var uniqueKeys = {}; | |
var items = this.length; | |
while ( items ) { | |
uniqueKeys[ this[ --items ] ] = true; | |
} | |
var uniqueArray = []; | |
for ( var key in uniqueKeys ) { | |
if ( uniqueKeys.hasOwnProperty( key ) ) { |
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
Array.prototype.unique = function () { | |
var keys = {}, | |
result = [], | |
items = this.length | |
while (items) | |
keys[this[--items]] = true | |
for (item in keys) | |
if (keys.hasOwnProperty(item)) result.push(item) |
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
// inject ist ein alternativer Name für reduce, auch bekannt als fold oder foldl | |
Array.prototype.forEach = function (callback) { | |
for (var index=0, length=this.length; index < length, index++) | |
callback(this[index]) | |
} | |
Array.prototype.reduce = function (accumulator, callback) { | |
this.forEach(function (value) | |
accumulator = callback(accumulator, value) |
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> | |
<script type="text/javascript"> | |
var http = (function () { | |
var PublicInterface = {} | |
function request (verb, uri, payload) { | |
var uri = uri || "/", | |
payload = payload || "" |
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> | |
<script type="text/javascript"> | |
var http = (function () { | |
var PublicInterface = {} | |
function request (verb, uri, payload) { | |
var uri = uri || "/", | |
payload = payload || "" |
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 xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Testing inline SVG …</title> |
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 xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Testing inline SVG …</title> | |
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
#!/usr/bin/env python | |
# encoding: utf-8 | |
from collections import defaultdict | |
word2value = {'dog': 15, 'dogs': 20} | |
word2stem = {'dog': 'dog', 'dogs': 'dog'} | |
stem2value = defaultdict(int) |
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
$(document.body).bind({ | |
"DOMNodeInserted" : function (event) { | |
$(event.target).bind( | |
// „Hängt davon ab“ | |
) | |
}, | |
"DOMNodeRemoved" : function (event) { | |
$(event.target).unbind() | |
} | |
}) |