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
{ | |
// Settings | |
"passfail" : false, // Stop on first error. | |
"maxerr" : 200, // Maximum error before stopping. | |
// Predefined globals whom JSHint will ignore. | |
"browser" : false, // Standard browser globals e.g. `window`, `document`. | |
"node" : false, |
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
// Base code is http://en.wikipedia.org/wiki/Damerau%E2%80%93Levenshtein_distance | |
function damerauLevenshtein(source, target, distanceLimit) | |
{ | |
if (source === target) | |
{ | |
return 0; | |
} | |
var m = source.length; | |
var n = target.length; |
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 calcWeight(index, length) | |
{ | |
var distance = (length - 1 - index) / (length - 1); | |
return distance * distance * 0.5 + 1; | |
} | |
function stringsDistance(source, target, distanceLimit) | |
{ | |
if (source === target) | |
{ |
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
module Distance | |
module_function | |
def calc_weight(index, length) | |
distance = (length - 1.0 - index) / (length - 1.0) | |
distance * distance * 0.5 + 1.0 | |
end | |
def strings_distance(source, target, distance_limit) | |
if source == target |
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
module HAL | |
module_function | |
def calc_weight(index, length) | |
distance = (length - 1.0 - index) / (length - 1.0) | |
distance * distance * 0.5 + 1.0 | |
end | |
def strings_distance(source, target, distance_limit) | |
if source == target |
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
#! /bin/sh | |
./configure --enable-static --disable-shared --disable-ltdl --disable-swig --disable-sharp --disable-go --disable-guile --disable-io --disable-java --disable-lua --disable-perl --disable-php --disable-python --disable-r --disable-ruby --disable-tcl --without-pic --without-tclsh --without-x --without-wish --without-expat --without-xpm --without-z --without-Xaw --without-webp --without-rsvg --without-ghostscript --without-visio --without-pangocairo --without-lasi --without-glitz --without-freetype2 --without-fontconfig --without-gtk --without-ming --without-qt --without-quartz --without-glut --without-cgraph --without-libgd --without-gdk_pixbuf LDFLAGS="-mmacosx-version-min=10.6" |
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
$ node | |
> (-90) % 360 | |
-90 | |
$ python | |
Python 2.7.3 (default, Dec 3 2012, 16:37:49) | |
[GCC 4.2.1 Compatible Apple Clang 4.0 ((tags/Apple/clang-421.0.60))] on darwin | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> (-90) % 360 | |
270 |
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
class _BWEntry { | |
static var LAST_CHAR = String.fromCharCode(1); | |
var last: string; | |
var key: string; | |
var _index: number; | |
function constructor(str: string, index: number) { | |
this.key = str.slice(index); | |
this._index = index; | |
if (index == 0) |
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
/** | |
* This is a JSX version of shellinford library: | |
* https://code.google.com/p/shellinford/ | |
* | |
* License: http://shibu.mit-license.org/ | |
*/ | |
class BitVector | |
{ | |
static const SMALL_BLOCK_SIZE : int = 32; |
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
TOPDIR := $(shell pwd) | |
LIBPOS := $(TOPDIR)/libs | |
RESULTPOS := $(TOPDIR)/result | |
LIBS := $(TOPDIR)/libs/lib | |
HEADERS := $(TOPDIR)/libs/include | |
build: libs/lib/libvorbis.a libs/lib/libiconv.a libs/lib/libintl.a result | |
cd vorbis-tools-1.4.0; ./configure --prefix=$(RESULTPOS) --enable-static --with-libiconv-prefix=$(LIBPOS) --without-curl --disable-shared --disable-ogg123 --disable-ogginfo --disable-vcut --disable-vorbiscomment --disable-oggtest --disable-vorbistest --disable-curltest --with-ogg=$(LIBPOS) --with-vorbis=$(LIBPOS) LDFLAGS="-mmacosx-version-min=10.6" --with-libintl-prefix=$(LIBPOS) | |
cd vorbis-tools-1.4.0; make; |
OlderNewer