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 TOKEN = (Math.random() + 1).toString(36).slice(2, 7); | |
var WRAP_START = "<wrap_" + TOKEN + ">"; | |
var WRAP_END = "</wrap_" + TOKEN +">"; | |
var NUM_REGEX = /^(?:NaN|[+]?Inf|-Inf|-?\d+\.?[\de]*)/i; | |
function wrapNumbers(text) { | |
var buffer = ""; | |
var previous = ""; | |
var beforePrevious = ""; |
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 DenseDates { | |
private DenseDates() {} | |
// 0 == Monday, 6 == Sunday | |
private static int epochDayToDayOfWeek0Based(long epochDay) { | |
return (int)Math.floorMod(epochDay + 3, 7); | |
} | |
public static int daysBetween(long fromEpochDay, long toEpochDay) { | |
// http://stackoverflow.com/questions/1617049/calculate-the-number-of-business-days-between-two-dates |
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
Full thread dump | |
"ForkJoinPool-1-worker-5@16423" daemon prio=5 tid=0x44 nid=NA waiting for monitor entry | |
java.lang.Thread.State: BLOCKED | |
waiting for ForkJoinPool-1-worker-3@16418 to release lock on <0x47f6> (a org.mapdb.DB) | |
at org.mapdb.DB.getNameForObject(DB.java:237) | |
at org.mapdb.DB$1.run(DB.java:138) | |
at org.mapdb.DB$1.run(DB.java:136) | |
at org.mapdb.SerializerPojo.serializeUnknownObject(SerializerPojo.java:400) | |
at org.mapdb.SerializerBase.serialize(SerializerBase.java:986) |
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
{-# LANGUAGE MultiParamTypeClasses #-} | |
{-# LANGUAGE Rank2Types #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE FlexibleContexts #-} | |
{-# LANGUAGE ScopedTypeVariables #-} | |
import Control.Applicative | |
data Exp = Var String | Lit Int | Add Exp Exp | |
| Mul Exp Exp | Neg Exp |