This file contains hidden or 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
// Given a number, find the next higher number which has the exact same set of digits as the original number | |
// http://stackoverflow.com/questions/9368205/given-a-number-find-the-next-higher-number-which-has-the-exact-same-set-of-digi | |
function nextUp(iNumber){ | |
var sDigitsSorted = iNumber.toString().split('').sort().join(''); | |
var aPermutations = (function(){ | |
var i = parseInt(iNumber.toString().split('').sort().reverse().join(''),10) + 1, | |
a = []; |
This file contains hidden or 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
/* | |
d3.phylogram.js | |
Wrapper around a d3-based phylogram (tree where branch lengths are scaled) | |
Also includes a radial dendrogram visualization (branch lengths not scaled) | |
along with some helper methods for building angled-branch trees. | |
Copyright (c) 2013, Ken-ichi Ueda | |
All rights reserved. |
This file contains hidden or 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
"use strict"; | |
var SMALLEST_NORMALIZED_VALUE = 2.2250738585072014e-308; // Math.pow(2, -1022) | |
var MIN_VALUE = 5e-324 === 0 ? SMALLEST_NORMALIZED_VALUE : 5e-324; | |
var MAX_VALUE = Number.MAX_VALUE; | |
Math.nextUp = function (x) { | |
x = Number(x); | |
if (x !== x) { | |
return x; |
This file contains hidden or 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 doHash(str, seed) { | |
var m = 0x5bd1e995; | |
var r = 24; | |
var h = seed ^ str.length; | |
var length = str.length; | |
var currentIndex = 0; | |
while (length >= 4) { | |
var k = UInt32(str, currentIndex); | |
This file contains hidden or 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
# af-magic.zsh-theme | |
# | |
# Author: Andy Fleming | |
# URL: http://andyfleming.com/ | |
# Repo: https://github.com/andyfleming/oh-my-zsh | |
# Direct Link: https://github.com/andyfleming/oh-my-zsh/blob/master/themes/af-magic.zsh-theme | |
# | |
# Created on: June 19, 2012 | |
# Last modified on: June 20, 2012 |
NewerOlder