text:
package org.scalatest.time

import org.scalatest.matchers.ShouldMatchers
import org.scalatest.{SeveredStackTraces, FunSpec}

class SpanSpec extends FunSpec with ShouldMatchers with SpanMatchers with SeveredStackTraces {

  describe("A Span") {

    it("should produce IAE if a negative length is passed") {
      for (u <- Seq(Nanosecond, Nanoseconds, Microsecond, Microseconds, Millisecond, Milliseconds, Millis, Second, Seconds,
          Minute, Minutes, Hour, Hours, Day, Days)) {
        for (i <- Seq(-1, -2, -3, Long.MinValue)) {
          withClue("u was: " + u + "; i was: " + i) {
            intercept[IllegalArgumentException] {
              Span(i, u)
            }
          }
        }
        for (d <- Seq(-1, -2, -3, -1.5, -9.98, Double.MinValue)) {
          withClue("u was: " + u + "; d was: " + d) {
            intercept[IllegalArgumentException] {
              Span(d, u)
            }
          }
        }
      }
    }

    it("should produce IAE if anything other than 1 is passed for singular units forms") {
      for (u <- Seq(Nanosecond, Microsecond, Millisecond, Second, Minute, Hour, Day)) {
        for (i <- Seq(0, 2, 3, Long.MaxValue)) {
          withClue("u was: " + u + "; i was: " + i) {
            intercept[IllegalArgumentException] {
              Span(i, u)
            }
          }
        }
        for (d <- Seq(0.0, 0.1, 1.1, 2.0, 9.98, Double.MaxValue)) {
          withClue("u was: " + u + "; d was: " + d) {
            intercept[IllegalArgumentException] {
              Span(d, u)
            }
          }
        }
      }
    }

    it("should construct with valid nanoseconds passed") {

      Span(0, Nanoseconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Nanosecond) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(1, Nanoseconds) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(2, Nanoseconds) should have (totalNanos(2), millisPart(0), nanosPart(2))
      Span(Long.MaxValue, Nanoseconds) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775807),
        millisPart(9223372036854L),
        nanosPart(775807)
      )

      Span(0.0, Nanoseconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.0, Nanosecond) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(1.0, Nanoseconds) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(2.0, Nanoseconds) should have (totalNanos(2), millisPart(0), nanosPart(2))
      Span(0.1, Nanoseconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.1, Nanoseconds) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(1.2, Nanoseconds) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(1.499, Nanoseconds) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(1.5, Nanoseconds) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(1.9, Nanoseconds) should have (totalNanos(1), millisPart(0), nanosPart(1))
      Span(2.2, Nanoseconds) should have (totalNanos(2), millisPart(0), nanosPart(2))
      Span(Long.MaxValue.toDouble, Nanoseconds) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775807),
        millisPart(9223372036854L),
        nanosPart(775807)
      )
    }

    it("should throw IAE if a Double nanos value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue.toDouble
      for (d <- Seq(biggest + 10000, biggest + 20000, biggest + 30000, Double.MaxValue)) {
        withClue("d was: " + d) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(d, Nanoseconds)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should construct with valid microseconds passed") {

      Span(0, Microseconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Microsecond) should have (totalNanos(1000), millisPart(0), nanosPart(1000))
      Span(1, Microseconds) should have (totalNanos(1000), millisPart(0), nanosPart(1000))
      Span(2, Microseconds) should have (totalNanos(2000), millisPart(0), nanosPart(2000))
      Span(1000, Microseconds) should have (totalNanos(1000 * 1000), millisPart(1), nanosPart(0))
      Span(1001, Microseconds) should have (totalNanos(1001L * 1000), millisPart(1), nanosPart(1000))
      Span(1002, Microseconds) should have (totalNanos(1002L * 1000), millisPart(1), nanosPart(2000))
      Span(2000, Microseconds) should have (totalNanos(2000 * 1000), millisPart(2), nanosPart(0))
      Span(2001, Microseconds) should have (totalNanos(2001 * 1000), millisPart(2), nanosPart(1000))
      Span(2002, Microseconds) should have (totalNanos(2002 * 1000), millisPart(2), nanosPart(2000))
      Span(Long.MaxValue / 1000, Microseconds) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775000),
        millisPart(9223372036854L),
        nanosPart(775000)
      )

      Span(0.0, Microseconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.0, Microsecond) should have (totalNanos(1000), millisPart(0), nanosPart(1000))
      Span(1.0, Microseconds) should have (totalNanos(1000), millisPart(0), nanosPart(1000))
      Span(2.0, Microseconds) should have (totalNanos(2000), millisPart(0), nanosPart(2000))
      Span(1000.0, Microseconds) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(1001.0, Microseconds) should have (totalNanos(1001L * 1000), millisPart(1), nanosPart(1000))
      Span(1002.0, Microseconds) should have (totalNanos(1002L * 1000), millisPart(1), nanosPart(2000))
      Span(2000.0, Microseconds) should have (totalNanos(2000 * 1000), millisPart(2), nanosPart(0))
      Span(2001.0, Microseconds) should have (totalNanos(2001 * 1000), millisPart(2), nanosPart(1000))
      Span(2002.0, Microseconds) should have (totalNanos(2002 * 1000), millisPart(2), nanosPart(2000))
      Span(0.1, Microseconds) should have (totalNanos(100), millisPart(0), nanosPart(100))
      Span(1.1, Microseconds) should have (totalNanos(1100), millisPart(0), nanosPart(1100))
      Span(1.2, Microseconds) should have (totalNanos(1200), millisPart(0), nanosPart(1200))
      Span(1.499, Microseconds) should have (totalNanos(1499), millisPart(0), nanosPart(1499))
      Span(1.5, Microseconds) should have (totalNanos(1500), millisPart(0), nanosPart(1500))
      Span(1.9, Microseconds) should have (totalNanos(1900), millisPart(0), nanosPart(1900))
      Span(2.2, Microseconds) should have (totalNanos(2200), millisPart(0), nanosPart(2200))
      Span((Long.MaxValue / 1000).toDouble, Microseconds) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775807),
        millisPart(9223372036854L),
        nanosPart(775807)
      )
    }

    it("should throw IAE if a microseconds value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue / 1000
      for (i <- Seq(biggest + 1, biggest + 2, biggest + 3, Long.MaxValue)) {
        withClue("i was: " + i) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(i, Microseconds)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should throw IAE if a Double microseconds value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue.toDouble / 1000
      for (d <- Seq(biggest + 10, biggest + 20, biggest + 30, Double.MaxValue)) {
        withClue("d was: " + d) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(d, Microseconds)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should construct with valid milliseconds passed") {

      Span(0, Milliseconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Millisecond) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(1, Milliseconds) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(2, Milliseconds) should have (totalNanos(2 * 1000 * 1000), millisPart(2), nanosPart(0))
      Span(1000, Milliseconds) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
      Span(1001, Milliseconds) should have (totalNanos(1001 * 1000 * 1000), millisPart(1001), nanosPart(0))
      Span(1002, Milliseconds) should have (totalNanos(1002L * 1000 * 1000), millisPart(1002), nanosPart(0))
      Span(2000, Milliseconds) should have (totalNanos(2000L * 1000 * 1000), millisPart(2000), nanosPart(0))
      Span(2001, Milliseconds) should have (totalNanos(2001L * 1000 * 1000), millisPart(2001), nanosPart(0))
      Span(2002, Milliseconds) should have (totalNanos(2002L * 1000 * 1000), millisPart(2002), nanosPart(0))
      Span(Long.MaxValue / 1000 / 1000, Milliseconds) should have (
        totalNanos(1000L * 1000 * 9223372036854L),
        millisPart(9223372036854L),
        nanosPart(0)
      )

      Span(0.0, Milliseconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.0, Millisecond) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(1.0, Milliseconds) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(2.0, Milliseconds) should have (totalNanos(2 * 1000 * 1000), millisPart(2), nanosPart(0))
      Span(1000.0, Milliseconds) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
      Span(1001.0, Milliseconds) should have (totalNanos(1001 * 1000 * 1000), millisPart(1001), nanosPart(0))
      Span(1002.0, Milliseconds) should have (totalNanos(1002L * 1000 * 1000), millisPart(1002), nanosPart(0))
      Span(2000.0, Milliseconds) should have (totalNanos(2000L * 1000 * 1000), millisPart(2000), nanosPart(0))
      Span(2001.0, Milliseconds) should have (totalNanos(2001L * 1000 * 1000), millisPart(2001), nanosPart(0))
      Span(2002.0, Milliseconds) should have (totalNanos(2002L * 1000 * 1000), millisPart(2002), nanosPart(0))
      Span(0.1, Milliseconds) should have (totalNanos(100L * 1000), millisPart(0), nanosPart(100000))
      Span(1.1, Milliseconds) should have (totalNanos(1100L * 1000), millisPart(1), nanosPart(100000))
      Span(1.2, Milliseconds) should have (totalNanos(1200L * 1000), millisPart(1), nanosPart(200000))
      Span(1.499, Milliseconds) should have (totalNanos(1499L * 1000), millisPart(1), nanosPart(499000))
      Span(1.5, Milliseconds) should have (totalNanos(1500L * 1000), millisPart(1), nanosPart(500000))
      Span(1.9, Milliseconds) should have (totalNanos(1900L * 1000), millisPart(1), nanosPart(900000))
      Span(2.2, Milliseconds) should have (totalNanos(2200 * 1000), millisPart(2), nanosPart(200000))
      Span(Long.MaxValue.toDouble / 1000 / 1000, Milliseconds) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775807),
        millisPart(9223372036854L),
        nanosPart(775807)
      )
    }

    it("should throw IAE if a milliseconds value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue / 1000 / 1000
      for (i <- Seq(biggest + 1, biggest + 2, biggest + 3, Long.MaxValue)) {
        withClue("i was: " + i) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(i, Milliseconds)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should throw IAE if a Double milliseconds value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue.toDouble / 1000 / 1000
      for (d <- Seq(biggest + 1, biggest + 2, biggest + 3, Double.MaxValue)) {
        withClue("d was: " + d) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(d, Milliseconds)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should construct with valid milliseconds passed when used with the shorthand, Millis") {

      Span(0, Millis) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Millis) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(1, Millis) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(2, Millis) should have (totalNanos(2 * 1000 * 1000), millisPart(2), nanosPart(0))
      Span(1000, Millis) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
      Span(1001, Millis) should have (totalNanos(1001 * 1000 * 1000), millisPart(1001), nanosPart(0))
      Span(1002, Millis) should have (totalNanos(1002L * 1000 * 1000), millisPart(1002), nanosPart(0))
      Span(2000, Millis) should have (totalNanos(2000L * 1000 * 1000), millisPart(2000), nanosPart(0))
      Span(2001, Millis) should have (totalNanos(2001L * 1000 * 1000), millisPart(2001), nanosPart(0))
      Span(2002, Millis) should have (totalNanos(2002L * 1000 * 1000), millisPart(2002), nanosPart(0))
      Span(Long.MaxValue / 1000 / 1000, Millis) should have (
        totalNanos(1000L * 1000 * 9223372036854L),
        millisPart(9223372036854L),
        nanosPart(0)
      )

    Span(0.0, Millis) should have (totalNanos(0), millisPart(0), nanosPart(0))
    Span(1.0, Millisecond) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
    Span(1.0, Millis) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
    Span(2.0, Millis) should have (totalNanos(2 * 1000 * 1000), millisPart(2), nanosPart(0))
    Span(1000.0, Millis) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
    Span(1001.0, Millis) should have (totalNanos(1001 * 1000 * 1000), millisPart(1001), nanosPart(0))
    Span(1002.0, Millis) should have (totalNanos(1002L * 1000 * 1000), millisPart(1002), nanosPart(0))
    Span(2000.0, Millis) should have (totalNanos(2000L * 1000 * 1000), millisPart(2000), nanosPart(0))
    Span(2001.0, Millis) should have (totalNanos(2001L * 1000 * 1000), millisPart(2001), nanosPart(0))
    Span(2002.0, Millis) should have (totalNanos(2002L * 1000 * 1000), millisPart(2002), nanosPart(0))
    Span(0.1, Millis) should have (totalNanos(100L * 1000), millisPart(0), nanosPart(100000))
    Span(1.1, Millis) should have (totalNanos(1100L * 1000), millisPart(1), nanosPart(100000))
    Span(1.2, Millis) should have (totalNanos(1200L * 1000), millisPart(1), nanosPart(200000))
    Span(1.499, Millis) should have (totalNanos(1499L * 1000), millisPart(1), nanosPart(499000))
    Span(1.5, Millis) should have (totalNanos(1500L * 1000), millisPart(1), nanosPart(500000))
    Span(1.9, Millis) should have (totalNanos(1900L * 1000), millisPart(1), nanosPart(900000))
    Span(2.2, Millis) should have (totalNanos(2200 * 1000), millisPart(2), nanosPart(200000))
    Span(Long.MaxValue.toDouble / 1000 / 1000, Millis) should have (
      totalNanos(1000L * 1000 * 9223372036854L + 775807),
      millisPart(9223372036854L),
      nanosPart(775807)
    )
  }

  it("should throw IAE if a milliseconds value larger than the largest expressible amount is passed when used with the shorthand, Millis.") {
    val biggest = Long.MaxValue / 1000 / 1000
    for (i <- Seq(biggest + 1, biggest + 2, biggest + 3, Long.MaxValue)) {
      withClue("i was: " + i) {
        val caught =
          intercept[IllegalArgumentException] {
            Span(i, Millis)
          }
        caught.getMessage should include ("Passed length")
      }
    }
  }

  it("should throw IAE if a Double milliseconds value larger than the largest expressible amount is passed when used with the shorthand, Millis.") {
    val biggest = Long.MaxValue.toDouble / 1000 / 1000
    for (d <- Seq(biggest + 1, biggest + 2, biggest + 3, Double.MaxValue)) {
      withClue("d was: " + d) {
        val caught =
          intercept[IllegalArgumentException] {
            Span(d, Millis)
          }
        caught.getMessage should include ("Passed length")
      }
    }
  }

    it("should construct with valid seconds passed") {

      Span(0, Seconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Second) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
      Span(1, Seconds) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
      Span(2, Seconds) should have (totalNanos(2000L * 1000 * 1000), millisPart(2000), nanosPart(0))
      Span(1000, Seconds) should have (totalNanos(1000L * 1000 * 1000000), millisPart(1000 * 1000), nanosPart(0))
      Span(1001, Seconds) should have (totalNanos(1000L * 1000 * 1001000), millisPart(1001 * 1000), nanosPart(0))
      Span(1002, Seconds) should have (totalNanos(1000L * 1000 * 1002000), millisPart(1002 * 1000), nanosPart(0))
      Span(2000, Seconds) should have (totalNanos(1000L * 1000 * 2000000), millisPart(2000 * 1000), nanosPart(0))
      Span(2001, Seconds) should have (totalNanos(1000L * 1000 * 2001000), millisPart(2001 * 1000), nanosPart(0))
      Span(2002, Seconds) should have (totalNanos(1000L * 1000 * 2002000), millisPart(2002 * 1000), nanosPart(0))
      Span(Long.MaxValue / 1000 / 1000 / 1000, Seconds) should have (
        totalNanos(1000L * 1000 * 9223372036000L),
        millisPart(9223372036000L),
        nanosPart(0)
      )

      Span(0.0, Seconds) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.0, Second) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
      Span(1.0, Seconds) should have (totalNanos(1000L * 1000 * 1000), millisPart(1000), nanosPart(0))
      Span(2.0, Seconds) should have (totalNanos(2000L * 1000 * 1000), millisPart(2000), nanosPart(0))
      Span(1000.0, Seconds) should have (totalNanos(1000L * 1000 * 1000000), millisPart(1000 * 1000), nanosPart(0))
      Span(1001.0, Seconds) should have (totalNanos(1000L * 1000 * 1001000), millisPart(1001 * 1000), nanosPart(0))
      Span(1002.0, Seconds) should have (totalNanos(1000L * 1000 * 1002000), millisPart(1002 * 1000), nanosPart(0))
      Span(2000.0, Seconds) should have (totalNanos(1000L * 1000 * 2000000), millisPart(2000 * 1000), nanosPart(0))
      Span(2001.0, Seconds) should have (totalNanos(1000L * 1000 * 2001000), millisPart(2001 * 1000), nanosPart(0))
      Span(2002.0, Seconds) should have (totalNanos(1000L * 1000 * 2002000), millisPart(2002 * 1000), nanosPart(0))
      Span(0.1, Seconds) should have (totalNanos(1000L * 1000 * 100), millisPart(100), nanosPart(0))
      Span(1.1, Seconds) should have (totalNanos(1000L * 1000 * 1100), millisPart(1100), nanosPart(0))
      Span(1.2, Seconds) should have (totalNanos(1000L * 1000 * 1200), millisPart(1200), nanosPart(0))
      Span(1.499, Seconds) should have (totalNanos(1000L * 1000 * 1499), millisPart(1499), nanosPart(0))
      Span(1.5, Seconds) should have (totalNanos(1000L * 1000 * 1500), millisPart(1500), nanosPart(0))
      Span(1.9, Seconds) should have (totalNanos(1000L * 1000 * 1900), millisPart(1900), nanosPart(0))
      Span(2.2, Seconds) should have (totalNanos(1000L * 1000 * 2200), millisPart(2200), nanosPart(0))
      Span(0.001, Seconds) should have (totalNanos(1000L * 1000), millisPart(1), nanosPart(0))
      Span(88.0001, Seconds) should have (totalNanos(1000L * 1000 * 88000 + 100000), millisPart(88 * 1000), nanosPart(100000))
      Span(88.000001, Seconds) should have (totalNanos(1000L * 1000 * 88000 + 1000), millisPart(88 * 1000), nanosPart(1000))
      Span(88.000000001, Seconds) should have (totalNanos(1000L * 1000 * 88000 + 1), millisPart(88 * 1000), nanosPart(1))
      Span(Long.MaxValue.toDouble / 1000 / 1000 / 1000, Seconds) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775807),
        millisPart(9223372036854L),
        nanosPart(775807)
      )
    }

    it("should throw IAE if a seconds value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue / 1000 / 1000 / 1000
      for (i <- Seq(biggest + 1, biggest + 2, biggest + 3, Long.MaxValue)) {
        withClue("i was: " + i) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(i, Seconds)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should throw IAE if a Double seconds value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue.toDouble / 1000 / 1000 / 1000
      for (d <- Seq(biggest + 1, biggest + 2, biggest + 3, Double.MaxValue)) {
        withClue("d was: " + d) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(d, Seconds)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should construct with valid minutes passed") {

      Span(0, Minutes) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Minute) should have (totalNanos(1000L * 1000 * 1000 * 60), millisPart(60 * 1000), nanosPart(0))
      Span(1, Minutes) should have (totalNanos(1000L * 1000 * 1000 * 60), millisPart(60 * 1000), nanosPart(0))
      Span(2, Minutes) should have (totalNanos(1000L * 1000 * 2 * 1000 * 60), millisPart(2 * 60 * 1000), nanosPart(0))
      Span(1000, Minutes) should have (totalNanos(1000L * 1000 * 1000 * 1000 * 60), millisPart(1000 * 60 * 1000), nanosPart(0))
      Span(1001, Minutes) should have (totalNanos(1000L * 1000 * 1001 * 1000 * 60), millisPart(1001 * 60 * 1000), nanosPart(0))
      Span(1002, Minutes) should have (totalNanos(1000L * 1000 * 1002 * 1000 * 60), millisPart(1002 * 60 * 1000), nanosPart(0))
      Span(2000, Minutes) should have (totalNanos(1000L * 1000 * 2000 * 1000 * 60), millisPart(2000 * 60 * 1000), nanosPart(0))
      Span(2001, Minutes) should have (totalNanos(1000L * 1000 * 2001 * 1000 * 60), millisPart(2001 * 60 * 1000), nanosPart(0))
      Span(2002, Minutes) should have (totalNanos(1000L * 1000 * 2002 * 1000 * 60), millisPart(2002 * 60 * 1000), nanosPart(0))
      Span(Long.MaxValue / 1000 / 1000 / 1000 / 60, Minutes) should have (
        totalNanos(1000L * 1000 * 9223372020000L),
        millisPart(9223372020000L),
        nanosPart(0)
      )

      Span(0.0, Minutes) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.0, Minute) should have (totalNanos(1000L * 1000 * 1000 * 60), millisPart(60 * 1000), nanosPart(0))
      Span(1.0, Minutes) should have (totalNanos(1000L * 1000 * 1000 * 60), millisPart(60 * 1000), nanosPart(0))
      Span(2.0, Minutes) should have (totalNanos(1000L * 1000 * 2 * 1000 * 60), millisPart(2 * 60 * 1000), nanosPart(0))
      Span(1000.0, Minutes) should have (totalNanos(1000L * 1000 * 1000 * 1000 * 60), millisPart(1000 * 60 * 1000), nanosPart(0))
      Span(1001.0, Minutes) should have (totalNanos(1000L * 1000 * 1001 * 1000 * 60), millisPart(1001 * 60 * 1000), nanosPart(0))
      Span(1002.0, Minutes) should have (totalNanos(1000L * 1000 * 1002 * 1000 * 60), millisPart(1002 * 60 * 1000), nanosPart(0))
      Span(2000.0, Minutes) should have (totalNanos(1000L * 1000 * 2000 * 1000 * 60), millisPart(2000 * 60 * 1000), nanosPart(0))
      Span(2001.0, Minutes) should have (totalNanos(1000L * 1000 * 2001 * 1000 * 60), millisPart(2001 * 60 * 1000), nanosPart(0))
      Span(2002.0, Minutes) should have (totalNanos(1000L * 1000 * 2002 * 1000 * 60), millisPart(2002 * 60 * 1000), nanosPart(0))
      Span(0.1, Minutes) should have (totalNanos(1000L * 1000 * 100 * 60), millisPart(100 * 60), nanosPart(0))
      Span(1.1, Minutes) should have (totalNanos(1000L * 1000 * 1100 * 60), millisPart(1100 * 60), nanosPart(0))
      Span(1.2, Minutes) should have (totalNanos(1000L * 1000 * 1200 * 60), millisPart(1200 * 60), nanosPart(0))
      Span(1.499, Minutes) should have (totalNanos(1000L * 1000 * 1499 * 60), millisPart(1499 * 60), nanosPart(0))
      Span(1.5, Minutes) should have (totalNanos(1000L * 1000 * 1500 * 60), millisPart(1500 * 60), nanosPart(0))
      Span(1.9, Minutes) should have (totalNanos(1000L * 1000 * 1900 * 60), millisPart(1900 * 60), nanosPart(0))
      Span(2.2, Minutes) should have (totalNanos(1000L * 1000 * 2200 * 60), millisPart(2200 * 60), nanosPart(0))
      Span(0.001, Minutes) should have (totalNanos(1000L * 1000 * 60), millisPart(60), nanosPart(0))
      Span(88.0001, Minutes) should have (totalNanos(1000L * 1000 * 5280006), millisPart(88 * 1000 * 60 + 6), nanosPart(0))
      Span(88.000001, Minutes) should have (totalNanos(1000L * 1000 * 5280000 + 60000), millisPart(88 * 1000 * 60), nanosPart(60000))
      Span(88.000000001, Minutes) should have (totalNanos(1000L * 1000 * 5280000 + 60), millisPart(88 * 1000 * 60), nanosPart(60))
      Span(Long.MaxValue.toDouble / 1000 / 1000 / 1000 / 60, Minutes) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 773760),
        millisPart(9223372036854L),
        nanosPart(773760)
      )
    }

    it("should throw IAE if a minutes value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue / 1000 / 1000 / 1000 / 60
      for (i <- Seq(biggest + 1, biggest + 2, biggest + 3, Long.MaxValue)) {
        withClue("i was: " + i) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(i, Minutes)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should throw IAE if a Double minutes value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue.toDouble / 1000 / 1000 / 1000 / 60
      for (d <- Seq(biggest + 1, biggest + 2, biggest + 3, Double.MaxValue)) {
        withClue("d was: " + d) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(d, Minutes)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should construct with valid hours passed") {

      Span(0, Hours) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Hour) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60), millisPart(60 * 60 * 1000), nanosPart(0))
      Span(1, Hours) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60), millisPart(60 * 60 * 1000), nanosPart(0))
      Span(2, Hours) should have (totalNanos(1000L * 1000 * 2 * 1000 * 60 * 60), millisPart(2 * 60 * 60 * 1000), nanosPart(0))
      Span(1000, Hours) should have (totalNanos(1000L * 1000 * 1000L * 1000 * 60 * 60), millisPart(1000L * 60 * 60 * 1000), nanosPart(0))
      Span(1001, Hours) should have (totalNanos(1000L * 1000 * 1001L * 1000 * 60 * 60), millisPart(1001L * 60 * 60 * 1000), nanosPart(0))
      Span(1002, Hours) should have (totalNanos(1000L * 1000 * 1002L * 1000 * 60 * 60), millisPart(1002L * 60 * 60 * 1000), nanosPart(0))
      Span(2000, Hours) should have (totalNanos(1000L * 1000 * 2000L * 1000 * 60 * 60), millisPart(2000L * 60 * 60 * 1000), nanosPart(0))
      Span(2001, Hours) should have (totalNanos(1000L * 1000 * 2001L * 1000 * 60 * 60), millisPart(2001L * 60 * 60 * 1000), nanosPart(0))
      Span(2002, Hours) should have (totalNanos(1000L * 1000 * 2002L * 1000 * 60 * 60), millisPart(2002L * 60 * 60 * 1000), nanosPart(0))
      Span(Long.MaxValue / 1000 / 1000 / 1000 / 60 / 60, Hours) should have (
        totalNanos(1000L * 1000 * 9223369200000L),
        millisPart(9223369200000L),
        nanosPart(0)
      )

      Span(0.0, Hours) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.0, Hour) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60), millisPart(60 * 60 * 1000), nanosPart(0))
      Span(1.0, Hours) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60), millisPart(60 * 60 * 1000), nanosPart(0))
      Span(2.0, Hours) should have (totalNanos(1000L * 1000 * 2 * 1000 * 60 * 60), millisPart(2 * 60 * 60 * 1000), nanosPart(0))
      Span(1000.0, Hours) should have (totalNanos(1000L * 1000 * 1000L * 1000 * 60 * 60), millisPart(1000L * 60 * 60 * 1000), nanosPart(0))
      Span(1001.0, Hours) should have (totalNanos(1000L * 1000 * 1001L * 1000 * 60 * 60), millisPart(1001L * 60 * 60 * 1000), nanosPart(0))
      Span(1002.0, Hours) should have (totalNanos(1000L * 1000 * 1002L * 1000 * 60 * 60), millisPart(1002L * 60 * 60 * 1000), nanosPart(0))
      Span(2000.0, Hours) should have (totalNanos(1000L * 1000 * 2000L * 1000 * 60 * 60), millisPart(2000L * 60 * 60 * 1000), nanosPart(0))
      Span(2001.0, Hours) should have (totalNanos(1000L * 1000 * 2001L * 1000 * 60 * 60), millisPart(2001L * 60 * 60 * 1000), nanosPart(0))
      Span(2002.0, Hours) should have (totalNanos(1000L * 1000 * 2002L * 1000 * 60 * 60), millisPart(2002L * 60 * 60 * 1000), nanosPart(0))
      Span(0.1, Hours) should have (totalNanos(1000L * 1000 * 100 * 60 * 60), millisPart(100 * 60 * 60), nanosPart(0))
      Span(1.1, Hours) should have (totalNanos(1000L * 1000 * 1100 * 60 * 60), millisPart(1100 * 60 * 60), nanosPart(0))
      Span(1.2, Hours) should have (totalNanos(1000L * 1000 * 1200 * 60 * 60), millisPart(1200 * 60 * 60), nanosPart(0))
      Span(1.499, Hours) should have (totalNanos(1000L * 1000 * 1499 * 60 * 60), millisPart(1499 * 60 * 60), nanosPart(0))
      Span(1.5, Hours) should have (totalNanos(1000L * 1000 * 1500 * 60 * 60), millisPart(1500 * 60 * 60), nanosPart(0))
      Span(1.9, Hours) should have (totalNanos(1000L * 1000 * 1900 * 60 * 60), millisPart(1900 * 60 * 60), nanosPart(0))
      Span(2.2, Hours) should have (totalNanos(1000L * 1000 * 2200 * 60 * 60), millisPart(2200 * 60 * 60), nanosPart(0))
      Span(0.001, Hours) should have (totalNanos(1000L * 1000 * 60 * 60), millisPart(60 * 60), nanosPart(0))
      Span(88.0001, Hours) should have (totalNanos(1000L * 1000 * 5280006 * 60), millisPart(88 * 1000 * 60 * 60 + 6 * 60), nanosPart(0))
      Span(88.000001, Hours) should have (totalNanos(1000L * 1000 * 316800003 + 600000), millisPart(88 * 1000 * 60 * 60 + 3), nanosPart(600000))
      Span(88.000000001, Hours) should have (totalNanos(1000L * 1000 * 5280000 * 60 + 3600), millisPart(88 * 1000 * 60 * 60), nanosPart(3600))
      Span(Long.MaxValue.toDouble / 1000 / 1000 / 1000 / 60 / 60, Hours) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775807),
        millisPart(9223372036854L),
        nanosPart(775807)
      )
    }

    it("should throw IAE if an hours value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue / 1000 / 1000 / 1000 / 60 / 60
      for (i <- Seq(biggest + 1, biggest + 2, biggest + 3, Long.MaxValue)) {
        withClue("i was: " + i) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(i, Hours)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should throw IAE if a Double hours value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue.toDouble / 1000 / 1000 / 1000 / 60 / 60
      for (d <- Seq(biggest + 1, biggest + 2, biggest + 3, Double.MaxValue)) {
        withClue("d was: " + d) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(d, Hours)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should construct with valid days passed") {

      Span(0, Days) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1, Day) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60 * 24), millisPart(60 * 60 * 24 * 1000), nanosPart(0))
      Span(1, Days) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60 * 24), millisPart(60 * 60 * 24 * 1000), nanosPart(0))
      Span(2, Days) should have (totalNanos(1000L * 1000 * 2 * 1000 * 60 * 60 * 24), millisPart(2 * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(1000, Days) should have (totalNanos(1000L * 1000 * 1000L * 1000 * 60 * 60 * 24), millisPart(1000L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(1001, Days) should have (totalNanos(1000L * 1000 * 1001L * 1000 * 60 * 60 * 24), millisPart(1001L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(1002, Days) should have (totalNanos(1000L * 1000 * 1002L * 1000 * 60 * 60 * 24), millisPart(1002L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(2000, Days) should have (totalNanos(1000L * 1000 * 2000L * 1000 * 60 * 60 * 24), millisPart(2000L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(2001, Days) should have (totalNanos(1000L * 1000 * 2001L * 1000 * 60 * 60 * 24), millisPart(2001L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(2002, Days) should have (totalNanos(1000L * 1000 * 2002L * 1000 * 60 * 60 * 24), millisPart(2002L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(Long.MaxValue / 1000 / 1000 / 1000 / 60 / 60 / 24, Days) should have (
        totalNanos(1000L * 1000 * 9223286400000L),
        millisPart(9223286400000L),
        nanosPart(0)
      )

      Span(0.0, Days) should have (totalNanos(0), millisPart(0), nanosPart(0))
      Span(1.0, Day) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60 * 24), millisPart(60 * 60 * 24 * 1000), nanosPart(0))
      Span(1.0, Days) should have (totalNanos(1000L * 1000 * 1000 * 60 * 60 * 24), millisPart(60 * 60 * 24 * 1000), nanosPart(0))
      Span(2.0, Days) should have (totalNanos(1000L * 1000 * 2 * 1000 * 60 * 60 * 24), millisPart(2 * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(1000.0, Days) should have (totalNanos(1000L * 1000 * 1000L * 1000 * 60 * 60 * 24), millisPart(1000L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(1001.0, Days) should have (totalNanos(1000L * 1000 * 1001L * 1000 * 60 * 60 * 24), millisPart(1001L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(1002.0, Days) should have (totalNanos(1000L * 1000 * 1002L * 1000 * 60 * 60 * 24), millisPart(1002L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(2000.0, Days) should have (totalNanos(1000L * 1000 * 2000L * 1000 * 60 * 60 * 24), millisPart(2000L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(2001.0, Days) should have (totalNanos(1000L * 1000 * 2001L * 1000 * 60 * 60 * 24), millisPart(2001L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(2002.0, Days) should have (totalNanos(1000L * 1000 * 2002L * 1000 * 60 * 60 * 24), millisPart(2002L * 60 * 60 * 24 * 1000), nanosPart(0))
      Span(0.1, Days) should have (totalNanos(1000L * 1000 * 100 * 60 * 60 * 24), millisPart(100 * 60 * 60 * 24), nanosPart(0))
      Span(1.1, Days) should have (totalNanos(1000L * 1000 * 1100 * 60 * 60 * 24), millisPart(1100 * 60 * 60 * 24), nanosPart(0))
      Span(1.2, Days) should have (totalNanos(1000L * 1000 * 1200 * 60 * 60 * 24), millisPart(1200 * 60 * 60 * 24), nanosPart(0))
      Span(1.499, Days) should have (totalNanos(1000L * 1000 * 1499 * 60 * 60 * 24), millisPart(1499 * 60 * 60 * 24), nanosPart(0))
      Span(1.5, Days) should have (totalNanos(1000L * 1000 * 1500 * 60 * 60 * 24), millisPart(1500 * 60 * 60 * 24), nanosPart(0))
      Span(1.9, Days) should have (totalNanos(1000L * 1000 * 1900 * 60 * 60 * 24), millisPart(1900 * 60 * 60 * 24), nanosPart(0))
      Span(2.2, Days) should have (totalNanos(1000L * 1000 * 2200 * 60 * 60 * 24), millisPart(2200 * 60 * 60 * 24), nanosPart(0))
      Span(0.001, Days) should have (totalNanos(1000L * 1000 * 60 * 60 * 24), millisPart(60 * 60 * 24), nanosPart(0))
      Span(88.0001, Days) should have (totalNanos(1000L * 1000 * 5280006L * 60 * 24), millisPart(88L * 1000 * 60 * 60 * 24 + 6 * 60 * 24), nanosPart(0))
      Span(88.000001, Days) should have (totalNanos(1000L * 1000 * 7603200086L + 400000), millisPart(88L * 1000 * 60 * 60 * 24 + 86), nanosPart(400000))
      Span(88.000000001, Days) should have (totalNanos(1000L * 1000 * 5280000L * 60 * 24 + 86400), millisPart(88L * 1000 * 60 * 60 * 24), nanosPart(86400))
      Span(Long.MaxValue.toDouble / 1000 / 1000 / 1000 / 60 / 60 / 24, Days) should have (
        totalNanos(1000L * 1000 * 9223372036854L + 775807),
        millisPart(9223372036854L),
        nanosPart(775807)
      )
    }

    it("should throw IAE if a days value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue / 1000 / 1000 / 1000 / 60 / 60 / 24
      for (i <- Seq(biggest + 1, biggest + 2, biggest + 3, Long.MaxValue)) {
        withClue("i was: " + i) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(i, Days)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should throw IAE if a Double days value larger than the largest expressible amount is passed.") {
      val biggest = Long.MaxValue.toDouble / 1000 / 1000 / 1000 / 60 / 60 / 24
      for (d <- Seq(biggest + 1, biggest + 2, biggest + 3, Double.MaxValue)) {
        withClue("d was: " + d) {
          val caught =
            intercept[IllegalArgumentException] {
              Span(d, Days)
            }
          caught.getMessage should include ("Passed length")
        }
      }
    }

    it("should give pretty, localized toStrings reflecting what went in") {
      Span(1, Nanosecond).prettyString should be ("1 nanosecond")
      Span(1, Nanoseconds).prettyString should be ("1 nanosecond")
      Span(2, Nanoseconds).prettyString should be ("2 nanoseconds")
      Span(1.0, Nanosecond).prettyString should be ("1.0 nanosecond")
      Span(1.0, Nanoseconds).prettyString should be ("1.0 nanosecond")
      Span(1.1, Nanoseconds).prettyString should be ("1.1 nanoseconds")
      Span(2.0, Nanoseconds).prettyString should be ("2.0 nanoseconds")

      Span(1, Microsecond).prettyString should be ("1 microsecond")
      Span(1, Microseconds).prettyString should be ("1 microsecond")
      Span(2, Microseconds).prettyString should be ("2 microseconds")
      Span(1.0, Microsecond).prettyString should be ("1.0 microsecond")
      Span(1.0, Microseconds).prettyString should be ("1.0 microsecond")
      Span(1.1, Microseconds).prettyString should be ("1.1 microseconds")
      Span(2.0, Microseconds).prettyString should be ("2.0 microseconds")

      Span(1, Millisecond).prettyString should be ("1 millisecond")
      Span(1, Milliseconds).prettyString should be ("1 millisecond")
      Span(2, Milliseconds).prettyString should be ("2 milliseconds")
      Span(1.0, Millisecond).prettyString should be ("1.0 millisecond")
      Span(1.0, Milliseconds).prettyString should be ("1.0 millisecond")
      Span(1.1, Milliseconds).prettyString should be ("1.1 milliseconds")
      Span(2.0, Milliseconds).prettyString should be ("2.0 milliseconds")

      Span(1, Millis).prettyString should be ("1 millisecond")
      Span(2, Millis).prettyString should be ("2 milliseconds")
      Span(1.0, Millis).prettyString should be ("1.0 millisecond")
      Span(1.1, Millis).prettyString should be ("1.1 milliseconds")
      Span(2.0, Millis).prettyString should be ("2.0 milliseconds")

      Span(1, Second).prettyString should be ("1 second")
      Span(1, Seconds).prettyString should be ("1 second")
      Span(2, Seconds).prettyString should be ("2 seconds")
      Span(1.0, Second).prettyString should be ("1.0 second")
      Span(1.0, Seconds).prettyString should be ("1.0 second")
      Span(1.1, Seconds).prettyString should be ("1.1 seconds")
      Span(2.0, Seconds).prettyString should be ("2.0 seconds")

      Span(1, Minute).prettyString should be ("1 minute")
      Span(1, Minutes).prettyString should be ("1 minute")
      Span(2, Minutes).prettyString should be ("2 minutes")
      Span(1.0, Minute).prettyString should be ("1.0 minute")
      Span(1.0, Minutes).prettyString should be ("1.0 minute")
      Span(1.1, Minutes).prettyString should be ("1.1 minutes")
      Span(2.0, Minutes).prettyString should be ("2.0 minutes")

      Span(1, Hour).prettyString should be ("1 hour")
      Span(1, Hours).prettyString should be ("1 hour")
      Span(2, Hours).prettyString should be ("2 hours")
      Span(1.0, Hour).prettyString should be ("1.0 hour")
      Span(1.0, Hours).prettyString should be ("1.0 hour")
      Span(1.1, Hours).prettyString should be ("1.1 hours")
      Span(2.0, Hours).prettyString should be ("2.0 hours")

      Span(1, Day).prettyString should be ("1 day")
      Span(1, Days).prettyString should be ("1 day")
      Span(2, Days).prettyString should be ("2 days")
      Span(1.0, Day).prettyString should be ("1.0 day")
      Span(1.0, Days).prettyString should be ("1.0 day")
      Span(1.1, Days).prettyString should be ("1.1 days")
      Span(2.0, Days).prettyString should be ("2.0 days")
    }

    it("should have a pretty toString") {
      Span(1, Nanosecond).toString should be ("Span(1, Nanosecond)")
      Span(1, Nanoseconds).toString should be ("Span(1, Nanoseconds)")
      Span(2, Nanoseconds).toString should be ("Span(2, Nanoseconds)")
      Span(1.0, Nanosecond).toString should be ("Span(1.0, Nanosecond)")
      Span(1.0, Nanoseconds).toString should be ("Span(1.0, Nanoseconds)")
      Span(1.1, Nanoseconds).toString should be ("Span(1.1, Nanoseconds)")
      Span(2.0, Nanoseconds).toString should be ("Span(2.0, Nanoseconds)")

      Span(1, Microsecond).toString should be ("Span(1, Microsecond)")
      Span(1, Microseconds).toString should be ("Span(1, Microseconds)")
      Span(2, Microseconds).toString should be ("Span(2, Microseconds)")
      Span(1.0, Microsecond).toString should be ("Span(1.0, Microsecond)")
      Span(1.0, Microseconds).toString should be ("Span(1.0, Microseconds)")
      Span(1.1, Microseconds).toString should be ("Span(1.1, Microseconds)")
      Span(2.0, Microseconds).toString should be ("Span(2.0, Microseconds)")

      Span(1, Millisecond).toString should be ("Span(1, Millisecond)")
      Span(1, Milliseconds).toString should be ("Span(1, Milliseconds)")
      Span(2, Milliseconds).toString should be ("Span(2, Milliseconds)")
      Span(1.0, Millisecond).toString should be ("Span(1.0, Millisecond)")
      Span(1.0, Milliseconds).toString should be ("Span(1.0, Milliseconds)")
      Span(1.1, Milliseconds).toString should be ("Span(1.1, Milliseconds)")
      Span(2.0, Milliseconds).toString should be ("Span(2.0, Milliseconds)")

      Span(1, Millis).toString should be ("Span(1, Millis)")
      Span(2, Millis).toString should be ("Span(2, Millis)")
      Span(1.0, Millis).toString should be ("Span(1.0, Millis)")
      Span(1.1, Millis).toString should be ("Span(1.1, Millis)")
      Span(2.0, Millis).toString should be ("Span(2.0, Millis)")

      Span(1, Second).toString should be ("Span(1, Second)")
      Span(1, Seconds).toString should be ("Span(1, Seconds)")
      Span(2, Seconds).toString should be ("Span(2, Seconds)")
      Span(1.0, Second).toString should be ("Span(1.0, Second)")
      Span(1.0, Seconds).toString should be ("Span(1.0, Seconds)")
      Span(1.1, Seconds).toString should be ("Span(1.1, Seconds)")
      Span(2.0, Seconds).toString should be ("Span(2.0, Seconds)")

      Span(1, Minute).toString should be ("Span(1, Minute)")
      Span(1, Minutes).toString should be ("Span(1, Minutes)")
      Span(2, Minutes).toString should be ("Span(2, Minutes)")
      Span(1.0, Minute).toString should be ("Span(1.0, Minute)")
      Span(1.0, Minutes).toString should be ("Span(1.0, Minutes)")
      Span(1.1, Minutes).toString should be ("Span(1.1, Minutes)")
      Span(2.0, Minutes).toString should be ("Span(2.0, Minutes)")

      Span(1, Hour).toString should be ("Span(1, Hour)")
      Span(1, Hours).toString should be ("Span(1, Hours)")
      Span(2, Hours).toString should be ("Span(2, Hours)")
      Span(1.0, Hour).toString should be ("Span(1.0, Hour)")
      Span(1.0, Hours).toString should be ("Span(1.0, Hours)")
      Span(1.1, Hours).toString should be ("Span(1.1, Hours)")
      Span(2.0, Hours).toString should be ("Span(2.0, Hours)")

      Span(1, Day).toString should be ("Span(1, Day)")
      Span(1, Days).toString should be ("Span(1, Days)")
      Span(2, Days).toString should be ("Span(2, Days)")
      Span(1.0, Day).toString should be ("Span(1.0, Day)")
      Span(1.0, Days).toString should be ("Span(1.0, Days)")
      Span(1.1, Days).toString should be ("Span(1.1, Days)")
      Span(2.0, Days).toString should be ("Span(2.0, Days)")
    }

    it("should have working equals and hashCode") {
      // Lame. Need a better way to test equals and hashCode
      assert(Span(1, Second) == Span(1, Seconds))
      assert(Span(1, Second) != Span(2, Seconds))
      assert(Span(1, Second).hashCode == Span(1, Seconds).hashCode)
      assert(Span(10, Milliseconds) == Span(10, Millis))
      assert(Span(10, Milliseconds) != Span(11, Millis))
      assert(Span(10, Milliseconds).hashCode == Span(10, Millis).hashCode)
    }

    describe("when scaled via the scaleBy method") {
      it("should throw IllegalArgumentException when a negative number is passed") {
        intercept[IllegalArgumentException] {
          Span(1, Second) scaledBy -1
        }
        intercept[IllegalArgumentException] {
          Span(1, Second) scaledBy -1.0
        }
      }
      it("should return the exact same Span when 1 is passed") {
        val span = Span(1, Second)
        assert(span scaledBy 1 eq span)
        assert(span scaledBy 1.0 eq span)
      }
      it("should return an zero-length Span when 0 is passed") {
        assert((Span(1, Second) scaledBy 0) === Span.ZeroLength)
        assert((Span(1, Second) scaledBy 0.0) === Span.ZeroLength)
      }
      it("should give correct results when only operating in the nanosPart") {
        assert((Span(1, Nanosecond) scaledBy 100) === Span(100, Nanoseconds))
        assert((Span(1, Nanosecond) scaledBy 100.0) === Span(100, Nanoseconds))
      }
      it("should give correct results when only operating in the millisPart") {
        assert((Span(1, Millisecond) scaledBy 100) === Span(100, Milliseconds))
        assert((Span(1, Millisecond) scaledBy 100.0) === Span(100, Milliseconds))
      }
      it("should give Span.Max when overflow occurs") {
        assert((Span.Max scaledBy 2) === Span.Max)
        assert((Span.Max scaledBy 2.0) === Span.Max)
      }
      it("should give Span.ZeroLength if less than 1 nanosecond") {
        assert((Span(1, Nanosecond) scaledBy 0.1) === Span.ZeroLength)
      }
      it("should be 0 Nanoseconds if zero length span") {
        {
          val span = Span(1, Day) scaledBy 0
          assert(span === Span(0, Nanoseconds))
          assert(span.toString === "Span(0, Nanoseconds)")
          assert(span.prettyString === "0 nanoseconds")
        }
        {
          val span = Span(0, Nanoseconds) scaledBy 100
          assert(span === Span(0, Nanoseconds))
          assert(span.toString === "Span(0, Nanoseconds)")
          assert(span.prettyString === "0 nanoseconds")
        }
      }
      it("should have nanosecond units if < 1000 nanoseconds") {
        {
          val span = Span(100, Nanoseconds) scaledBy 0.01
          assert(span === Span(1, Nanosecond))
          assert(span.toString === "Span(1, Nanosecond)")
          assert(span.prettyString === "1 nanosecond")
        }
        {
          val span = Span(100, Nanoseconds) scaledBy 5
          assert(span === Span(500, Nanoseconds))
          assert(span.toString === "Span(500, Nanoseconds)")
          assert(span.prettyString === "500 nanoseconds")
        }
        {
          val span = Span(100, Nanoseconds) scaledBy 5.001
          assert(span === Span(500.1, Nanoseconds))
          assert(span.toString === "Span(500.1, Nanoseconds)")
          assert(span.prettyString === "500.1 nanoseconds")
        }
        {
          val span = Span(1, Nanosecond) scaledBy 999
          assert(span === Span(999, Nanoseconds))
          assert(span.toString === "Span(999, Nanoseconds)")
          assert(span.prettyString === "999 nanoseconds")
        }
      }
      it("should have microsecond units if > 1 and < 1000 microseconds") {
        {
          val span = Span(1, Nanosecond) scaledBy 1000
          assert(span === Span(1, Microsecond))
          assert(span.toString === "Span(1, Microsecond)")
          assert(span.prettyString === "1 microsecond")
        }
        {
          val span = Span(100, Microseconds) scaledBy 0.01
          assert(span === Span(1, Microsecond))
          assert(span.toString === "Span(1, Microsecond)")
          assert(span.prettyString === "1 microsecond")
        }
        {
          val span = Span(100, Microseconds) scaledBy 5
          assert(span === Span(500, Microseconds))
          assert(span.toString === "Span(500, Microseconds)")
          assert(span.prettyString === "500 microseconds")
        }
        {
          val span = Span(3, Microseconds) scaledBy 0.5
          assert(span === Span(1.5, Microseconds))
          assert(span.toString === "Span(1.5, Microseconds)")
          assert(span.prettyString === "1.5 microseconds")
        }
        {
          val span = Span(1, Microsecond) scaledBy 999
          assert(span === Span(999, Microseconds))
          assert(span.toString === "Span(999, Microseconds)")
          assert(span.prettyString === "999 microseconds")
        }
      }
      it("should have millisecond units if > 1 and < 1000 milliseconds") {
        {
          val span = Span(1, Microsecond) scaledBy 1000
          assert(span === Span(1, Millisecond))
          assert(span.toString === "Span(1, Millisecond)")
          assert(span.prettyString === "1 millisecond")
        }
        {
          val span = Span(100, Millis) scaledBy 0.01
          assert(span === Span(1, Millisecond))
          assert(span.toString === "Span(1, Millisecond)")
          assert(span.prettyString === "1 millisecond")
        }
        {
          val span = Span(100, Millis) scaledBy 5
          assert(span === Span(500, Millis))
          assert(span.toString === "Span(500, Millis)")
          assert(span.prettyString === "500 milliseconds")
        }
        {
          val span = Span(3, Millis) scaledBy 0.5
          assert(span === Span(1.5, Millis))
          assert(span.toString === "Span(1.5, Millis)")
          assert(span.prettyString === "1.5 milliseconds")
        }
        {
          val span = Span(1, Millisecond) scaledBy 999
          assert(span === Span(999, Millis))
          assert(span.toString === "Span(999, Millis)")
          assert(span.prettyString === "999 milliseconds")
        }
      }
      it("should have second units if > 1 and < 60 seconds") {
        {
          val span = Span(1, Millisecond) scaledBy 1000
          assert(span === Span(1, Second))
          assert(span.toString === "Span(1, Second)")
          assert(span.prettyString === "1 second")
        }
        {
          val span = Span(100, Seconds) scaledBy 0.01
          assert(span === Span(1, Second))
          assert(span.toString === "Span(1, Second)")
          assert(span.prettyString === "1 second")
        }
        {
          val span = Span(10, Seconds) scaledBy 5
          assert(span === Span(50, Seconds))
          assert(span.toString === "Span(50, Seconds)")
          assert(span.prettyString === "50 seconds")
        }
        {
          val span = Span(3, Seconds) scaledBy 0.5
          assert(span === Span(1.5, Seconds))
          assert(span.toString === "Span(1.5, Seconds)")
          assert(span.prettyString === "1.5 seconds")
        }
        {
          val span = Span(1, Second) scaledBy 59
          assert(span === Span(59, Seconds))
          assert(span.toString === "Span(59, Seconds)")
          assert(span.prettyString === "59 seconds")
        }
      }
      it("should have minute units if > 1 and < 60 minutes") {
        {
          val span = Span(1, Second) scaledBy 60
          assert(span === Span(1, Minute))
          assert(span.toString === "Span(1, Minute)")
          assert(span.prettyString === "1 minute")
        }
        {
          val span = Span(100, Minutes) scaledBy 0.01
          assert(span === Span(1, Minute))
          assert(span.toString === "Span(1, Minute)")
          assert(span.prettyString === "1 minute")
        }
        {
          val span = Span(10, Minutes) scaledBy 5
          assert(span === Span(50, Minutes))
          assert(span.toString === "Span(50, Minutes)")
          assert(span.prettyString === "50 minutes")
        }
        {
          val span = Span(3, Minutes) scaledBy 0.5
          assert(span === Span(1.5, Minutes))
          assert(span.toString === "Span(1.5, Minutes)")
          assert(span.prettyString === "1.5 minutes")
        }
        {
          val span = Span(1, Minute) scaledBy 59
          assert(span === Span(59, Minutes))
          assert(span.toString === "Span(59, Minutes)")
          assert(span.prettyString === "59 minutes")
        }
      }
      it("should have hour units if > 1 and < 24 hours") {
        {
          val span = Span(1, Minute) scaledBy 60
          assert(span === Span(1, Hour))
          assert(span.toString === "Span(1, Hour)")
          assert(span.prettyString === "1 hour")
        }
        {
          val span = Span(100, Hours) scaledBy 0.01
          assert(span === Span(1, Hour))
          assert(span.toString === "Span(1, Hour)")
          assert(span.prettyString === "1 hour")
        }
        {
          val span = Span(3, Hours) scaledBy 4
          assert(span === Span(12, Hours))
          assert(span.toString === "Span(12, Hours)")
          assert(span.prettyString === "12 hours")
        }
        {
          val span = Span(3, Hours) scaledBy 0.5
          assert(span === Span(1.5, Hours))
          assert(span.toString === "Span(1.5, Hours)")
          assert(span.prettyString === "1.5 hours")
        }
        {
          val span = Span(1, Hours) scaledBy 23
          assert(span === Span(23, Hours))
          assert(span.toString === "Span(23, Hours)")
          assert(span.prettyString === "23 hours")
        }
      }
      it("should have day units if > 1 and < ? days") {
        {
          val span = Span(1, Hour) scaledBy 24
          assert(span === Span(1, Day))
          assert(span.toString === "Span(1, Day)")
          assert(span.prettyString === "1 day")
        }
        {
          val span = Span(100, Days) scaledBy 0.01
          assert(span === Span(1, Day))
          assert(span.toString === "Span(1, Day)")
          assert(span.prettyString === "1 day")
        }
        {
          val span = Span(3, Days) scaledBy 4
          assert(span === Span(12, Days))
          assert(span.toString === "Span(12, Days)")
          assert(span.prettyString === "12 days")
        }
        {
          val span = Span(3, Days) scaledBy 0.5
          assert(span === Span(1.5, Days))
          assert(span.toString === "Span(1.5, Days)")
          assert(span.prettyString === "1.5 days")
        }
        {
          val span = Span(53376, Days) scaledBy 2
          assert(span === Span(106751.99116730063, Days))
          assert(span.toString === "Span(106751.99116730063, Days)")
          assert(span.prettyString === "106751.99116730063 days")
        }
      }
    }
  }

  describe("The Span.Max value") {
    it("should return a Span with the maximum span length") {
      Span.Max should equal (Span(Long.MaxValue, Nanoseconds))
    }
  }

  describe("The Span.ZeroLength value") {
    it("should return a Span with a 0 span length") {
      Span.ZeroLength should equal (Span(0, Nanoseconds))
    }
  }
}


text:
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

#include <fcntl.h>
#include <errno.h>

#ifndef _WIN32
#include <termios.h>
#include <strings.h>
#include <sys/ioctl.h>
#endif

#ifdef __LINUX__
#include <linux/ppdev.h>
#include <linux/parport.h>
#endif

#include <winpr/crt.h>
#include <winpr/synch.h>
#include <winpr/thread.h>
#include <winpr/interlocked.h>

#include <freerdp/types.h>
#include <freerdp/constants.h>
#include <freerdp/utils/list.h>
#include <freerdp/utils/thread.h>
#include <freerdp/utils/memory.h>
#include <freerdp/utils/stream.h>
#include <freerdp/utils/unicode.h>
#include <freerdp/utils/svc_plugin.h>

#include "rdpdr_constants.h"
#include "rdpdr_types.h"

struct _PARALLEL_DEVICE
{
	DEVICE device;

	int file;
	char* path;
	uint32 id;

	PSLIST_HEADER pIrpList;
	freerdp_thread* thread;
};
typedef struct _PARALLEL_DEVICE PARALLEL_DEVICE;

static void parallel_process_irp_create(PARALLEL_DEVICE* parallel, IRP* irp)
{
	char* path;
	uint32 PathLength;

	stream_seek(irp->input, 28);
	/* DesiredAccess(4) AllocationSize(8), FileAttributes(4) */
	/* SharedAccess(4) CreateDisposition(4), CreateOptions(4) */
	stream_read_uint32(irp->input, PathLength);

	freerdp_UnicodeToAsciiAlloc((WCHAR*) stream_get_tail(irp->input), &path, PathLength / 2);

	parallel->id = irp->devman->id_sequence++;
	parallel->file = open(parallel->path, O_RDWR);

	if (parallel->file < 0)
	{
		irp->IoStatus = STATUS_ACCESS_DENIED;
		parallel->id = 0;

		DEBUG_WARN("failed to create %s: %s", parallel->path, strerror(errno));
	}
	else
	{
		/* all read and write operations should be non-blocking */
		if (fcntl(parallel->file, F_SETFL, O_NONBLOCK) == -1)
			DEBUG_WARN("%s fcntl %s", path, strerror(errno));

		DEBUG_SVC("%s(%d) created", parallel->path, parallel->file);
	}

	stream_write_uint32(irp->output, parallel->id);
	stream_write_uint8(irp->output, 0);

	xfree(path);

	irp->Complete(irp);
}

static void parallel_process_irp_close(PARALLEL_DEVICE* parallel, IRP* irp)
{
	if (close(parallel->file) < 0)
		DEBUG_SVC("failed to close %s(%d)", parallel->path, parallel->id);
	else
		DEBUG_SVC("%s(%d) closed", parallel->path, parallel->id);

	stream_write_zero(irp->output, 5); /* Padding(5) */

	irp->Complete(irp);
}

static void parallel_process_irp_read(PARALLEL_DEVICE* parallel, IRP* irp)
{
	uint32 Length;
	uint64 Offset;
	ssize_t status;
	uint8* buffer = NULL;

	stream_read_uint32(irp->input, Length);
	stream_read_uint64(irp->input, Offset);

	buffer = (uint8*) xmalloc(Length);

	status = read(parallel->file, irp->output->p, Length);

	if (status < 0)
	{
		irp->IoStatus = STATUS_UNSUCCESSFUL;
		xfree(buffer);
		buffer = NULL;
		Length = 0;

		DEBUG_WARN("read %s(%d) failed", parallel->path, parallel->id);
	}
	else
	{
		DEBUG_SVC("read %llu-%llu from %d", Offset, Offset + Length, parallel->id);
	}

	stream_write_uint32(irp->output, Length);
	if (Length > 0)
	{
		stream_check_size(irp->output, Length);
		stream_write(irp->output, buffer, Length);
	}
	xfree(buffer);

	irp->Complete(irp);
}

static void parallel_process_irp_write(PARALLEL_DEVICE* parallel, IRP* irp)
{
	uint32 Length;
	uint64 Offset;
	ssize_t status;
	uint32 len;

	stream_read_uint32(irp->input, Length);
	stream_read_uint64(irp->input, Offset);
	stream_seek(irp->input, 20); /* Padding */

	DEBUG_SVC("Length %u Offset %llu", Length, Offset);

	len = Length;

	while (len > 0)
	{
		status = write(parallel->file, stream_get_tail(irp->input), len);

		if (status < 0)
		{
			irp->IoStatus = STATUS_UNSUCCESSFUL;
			Length = 0;

			DEBUG_WARN("write %s(%d) failed.", parallel->path, parallel->id);
			break;
		}

		stream_seek(irp->input, status);
		len -= status;
	}

	stream_write_uint32(irp->output, Length);
	stream_write_uint8(irp->output, 0); /* Padding */

	irp->Complete(irp);
}

static void parallel_process_irp_device_control(PARALLEL_DEVICE* parallel, IRP* irp)
{
	DEBUG_SVC("in");
	stream_write_uint32(irp->output, 0); /* OutputBufferLength */
	irp->Complete(irp);
}

static void parallel_process_irp(PARALLEL_DEVICE* parallel, IRP* irp)
{
	DEBUG_SVC("MajorFunction %u", irp->MajorFunction);

	switch (irp->MajorFunction)
	{
		case IRP_MJ_CREATE:
			parallel_process_irp_create(parallel, irp);
			break;

		case IRP_MJ_CLOSE:
			parallel_process_irp_close(parallel, irp);
			break;

		case IRP_MJ_READ:
			parallel_process_irp_read(parallel, irp);
			break;

		case IRP_MJ_WRITE:
			parallel_process_irp_write(parallel, irp);
			break;

		case IRP_MJ_DEVICE_CONTROL:
			parallel_process_irp_device_control(parallel, irp);
			break;

		default:
			DEBUG_WARN("MajorFunction 0x%X not supported", irp->MajorFunction);
			irp->IoStatus = STATUS_NOT_SUPPORTED;
			irp->Complete(irp);
			break;
	}
}

static void parallel_process_irp_list(PARALLEL_DEVICE* parallel)
{
	IRP* irp;

	while (1)
	{
		if (freerdp_thread_is_stopped(parallel->thread))
			break;

		irp = (IRP*) InterlockedPopEntrySList(parallel->pIrpList);

		if (irp == NULL)
			break;

		parallel_process_irp(parallel, irp);
	}
}

static void* parallel_thread_func(void* arg)
{
	PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) arg;

	while (1)
	{
		freerdp_thread_wait(parallel->thread);

		if (freerdp_thread_is_stopped(parallel->thread))
			break;

		freerdp_thread_reset(parallel->thread);

		parallel_process_irp_list(parallel);
	}

	freerdp_thread_quit(parallel->thread);

	return NULL;
}

static void parallel_irp_request(DEVICE* device, IRP* irp)
{
	PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device;

	InterlockedPushEntrySList(parallel->pIrpList, &(irp->ItemEntry));

	freerdp_thread_signal(parallel->thread);
}

static void parallel_free(DEVICE* device)
{
	IRP* irp;
	PARALLEL_DEVICE* parallel = (PARALLEL_DEVICE*) device;

	DEBUG_SVC("freeing device");

	freerdp_thread_stop(parallel->thread);
	freerdp_thread_free(parallel->thread);

	while ((irp = (IRP*) InterlockedPopEntrySList(parallel->pIrpList)) != NULL)
		irp->Discard(irp);

	_aligned_free(parallel->pIrpList);

	xfree(parallel);
}

int DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POINTS pEntryPoints)
{
	char* name;
	char* path;
	int i, length;
	PARALLEL_DEVICE* parallel;

	name = (char*) pEntryPoints->plugin_data->data[1];
	path = (char*) pEntryPoints->plugin_data->data[2];

	if (name[0] && path[0])
	{
		parallel = xnew(PARALLEL_DEVICE);

		parallel->device.type = RDPDR_DTYP_PARALLEL;
		parallel->device.name = name;
		parallel->device.IRPRequest = parallel_irp_request;
		parallel->device.Free = parallel_free;

		length = strlen(name);
		parallel->device.data = stream_new(length + 1);

		for (i = 0; i <= length; i++)
			stream_write_uint8(parallel->device.data, name[i] < 0 ? '_' : name[i]);

		parallel->path = path;

		parallel->pIrpList = (PSLIST_HEADER) _aligned_malloc(sizeof(SLIST_HEADER), MEMORY_ALLOCATION_ALIGNMENT);
		InitializeSListHead(parallel->pIrpList);

		parallel->thread = freerdp_thread_new();

		pEntryPoints->RegisterDevice(pEntryPoints->devman, (DEVICE*) parallel);

		freerdp_thread_start(parallel->thread, parallel_thread_func, parallel);
	}

	return 0;
}

redpajama_set_name: RedPajamaGithub


text:
(function () {
  'use strict';

  angular
    .module('amenities.admin.controllers')
    .config(['$mdIconProvider', function($mdIconProvider) {
      $mdIconProvider.icon('md-close', 'modules/core/client/common/assets/angular-material-assets/img/icons/ic_close_24px.svg', 24);
    }])
    .controller('AmenitiesAdminController', AmenitiesAdminController);

  AmenitiesAdminController.$inject = ['$scope', '$state', '$window', 'amenityResolve', 'Authentication'];

  function AmenitiesAdminController($scope, $state, $window, amenity, Authentication) {
    var vm = this;

    vm.amenity = amenity;
    vm.amenity.tags = [];
    vm.authentication = Authentication;
    vm.form = {};
    vm.remove = remove;
    vm.save = save;

    // Remove existing Article
    function remove() {
      if ($window.confirm('Are you sure you want to delete?')) {
        vm.amenity.$remove(function() {
          $state.go('admin.amenities.list');
        });
      }
    }

    // Save Amenity
    function save(isValid) {
      if (!isValid) {
        $scope.$broadcast('show-errors-check-validity', '$scope.basicAmenityForm');
        return false;
      }

      // Create a new amenity, or update the current instance
      vm.amenity.createOrUpdate()
        .then(successCallback)
        .catch(errorCallback);

      function successCallback(res) {
        $state.go('admin.amenities.list'); // should we send the User to the list or the updated Article's view?
      }

      function errorCallback(res) {
        res.data.message;
      }
    }
  }
}());


text:
local police = {
    title = "Police",
    wanted = "Wanted rank {1}",
    not_handcuffed = "~r~Not handcuffed.",
    cloakroom = {
      title = "Cloakroom",
      uniform = {
        title = "Uniform",
        description = "Put uniform."
      }
    },
    pc = {
      title = "PC",
      searchreg = {
        title = "Registration search",
        description = "Search identity by registration.",
        prompt = "Enter registration number:"
      },
      closebusiness = {
        title = "Close business",
        description = "Close business of the nearest player.",
        request = "Are you sure to close the business {3} owned by {1} {2} ?",
        closed = "~g~Business closed."
      },
      trackveh = {
        title = "Track vehicle",
        description = "Track a vehicle by its registration number.",
        prompt_reg = "Enter registration number:",
        prompt_note = "Enter a tracking note/reason:",
        tracking = "~b~Tracking started.",
        track_failed = "~b~Tracking of {1}~s~ ({2}) ~n~~r~Failed.",
        tracked = "Tracked {1} ({2})"
      },
      records = {
        show = {
          title = "Show records",
          description = "Show police records by registration number."
        },
        delete = {
          title = "Clear records",
          description = "Clear police records by registration number.",
          deleted = "~b~Police records deleted"
        }
      }
    },
    menu = {
      handcuff = {
        title = "Handcuff",
        description = "Handcuff/unhandcuff nearest player."
      },
      putinveh = {
        title = "Put in vehicle",
        description = "Put the nearest handcuffed player in the nearest vehicle, as passenger."
      },
      getoutveh = {
        title = "Get out vehicle",
        description = "Get out of vehicle the nearest handcuffed player."
      },
      askid = {
        title = "Ask ID",
        description = "Ask ID card from the nearest player.",
        request = "Do you want to give your ID card ?",
        request_hide = "Hide the ID card.",
        asked = "Asking ID..."
      },
      check = {
        title = "Check player",
        description = "Check money, inventory and weapons of the nearest player.",
        request_hide = "Hide the check report.",
        info = "money: ${1}

inventory: {2}

weapons: {3}",
        checked = "You have being checked."
      },
      seize = {
        seized = "Seized {2} ~r~{1}",
        weapons = {
          title = "Seize weapons",
          description = "Seize nearest player weapons",
          seized = "~b~Your weapons have been seized."
        },
        items = {
          title = "Seize illegals",
          description = "Seize illegal items",
          seized = "~b~Your illegal stuff has been seized."
        }
      },
      jail = {
        title = "Jail",
        description = "Jail/UnJail nearest player in/from the nearest jail.",
        not_found = "~r~No jail found.",
        jailed = "~b~Jailed.",
        unjailed = "~b~Unjailed.",
        notify_jailed = "~b~You have been jailed.",
        notify_unjailed = "~b~You have been unjailed."
      },
      fine = {
        title = "Fine",
        description = "Fine the nearest player.",
        fined = "~b~Fined ~s~${2} for ~b~{1}.",
        notify_fined = "~b~You have been fined ~s~ ${2} for ~b~{1}.",
        record = "[Fine] ${2} for {1}"
      },
      store_weapons = {
        title = "Store weapons",
        description = "Store your weapons in your inventory."
      }
    },
    identity = {
      info = "Name: {1}
First name: {2}
Age: {3}
Registration n°: {4}
Phone: {5}
Business: {6}
Business capital: ${7}
Address: {9}, {8}"
    },
	alert = "~r~Police alert:~n~~s~",
	notify = "~b~You called the police.",
	answer = "~b~The police is coming.",
	fines = {
	  insult = "Insult",
	  speeding = "Speeding",
	  stealing = "Stealing",
	  lowcrime = "Organized crime (low)",
	  medcrime = "Organized crime (medium)",
	  highcrime = "Organized crime (high)"
	}
}

return police


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>com.communote.server.api.core.task Class Hierarchy (Communote 3.5 API)</title>
<meta name="date" content="2019-02-02">
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Hierarchy For Package com.communote.server.api.core.task

Package Hierarchies:

All Packages

Class Hierarchy

java.lang.Object

com.communote.server.api.core.task.TaskTO

java.lang.Throwable (implements java.io.Serializable)

java.lang.Exception

com.communote.server.api.core.task.TaskHandlerException

com.communote.server.api.core.task.TaskManagementException

com.communote.server.api.core.task.InvalidInstanceException

com.communote.server.api.core.task.TaskAlreadyExistsException

com.communote.server.api.core.task.TaskNotActiveException

com.communote.server.api.core.task.TaskStatusException

com.communote.server.api.core.task.TaskAlreadyRunningException

Interface Hierarchy

com.communote.server.api.core.task.TaskHandler

com.communote.server.api.core.task.TaskManagement

Skip navigation links

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Copyright © 2019 Communote team. All rights reserved.


text:
package synth.auxilliary;

import net.beadsproject.beads.core.AudioContext;
import net.beadsproject.beads.core.UGen;
import net.beadsproject.beads.ugens.*;

import java.util.Iterator;
import java.util.LinkedList;
import java.util.ListIterator;

public class Patcher {
    public Patcher(){

    }

    /**
     * Patches in input to and output
     * @param input input UGen
     * @param output output UGen
     */
    public static void patchSingle(UGen input, UGen output){
        try {
            output.addInput(input);
        } catch(NullPointerException e){
            System.out.println("Output not existing");
        }

    }

    /**
     * Routes several inputs to a single output
     * @param inputs array of inputs
     * @param output output to patch to
     */
    public static void patchMultiple(UGen[] inputs, UGen output){
        if(inputs != null){
            for (UGen input: inputs) {
                if(input != null && output != null) {
                    output.addInput(input);
                }
            }
        }
    }

    public static void patchMultiple(LinkedList<WavePlayer> inputs, UGen output){
        if(inputs != null && output != null){
            ListIterator<WavePlayer> iterator = inputs.listIterator();
            while(iterator.hasNext()){
                UGen e = iterator.next();
                if(e != null){
                    output.addInput(e);
                }
            }
        }
    }
}


text:
package fr.aviz.tokennotifier.gui.eventviews;

import java.awt.Container;
import java.awt.Image;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyEvent;
import java.io.File;
import java.util.ArrayList;
import java.util.Hashtable;

import javax.imageio.ImageIO;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JFrame;
import javax.swing.JList;

import fr.aviz.tokennotifier.mapping.NotificationEvent;
import fr.aviz.tokennotifier.util.GUIUtils;

public class EventStack {

	final static int UNREAD_TAG = 0;
	final static Image unreadIcon = loadImage("img/unread.png");
	final static Image unreadIcon_small = loadImage("img/unread_14.png");
	final static int IMPORTANT_TAG = 1;
	final static Image importantIcon = loadImage("img/important.png");
	final static Image importantIcon_small = loadImage("img/important_14.png");

	static Image loadImage(String filename) {
		try {
			return ImageIO.read(new File(filename));
		} catch (Exception e) {
			return null;
		}
	}

	static class EventState {
		TitlePreviewWindow titleWindow;
		DescriptionViewWindow descriptionWindow;
		ArrayList<TagViewWindow> tagWindows = new ArrayList<TagViewWindow>();
		boolean seen = false;
	}

	ArrayList<NotificationEvent> stackedEvents = new ArrayList<NotificationEvent>();
	Hashtable<NotificationEvent, EventState> eventStates = new Hashtable<NotificationEvent, EventState>();
	int lastUsedRow = -1;

	public EventStack() {
	}

	public void stack(NotificationEvent e) {
		if (stackedEvents.contains(e)) return;
		EventState state = new EventState();
		lastUsedRow++;
		state.titleWindow = new TitlePreviewWindow(e.getFormattedTitle(), lastUsedRow);
		state.descriptionWindow = new DescriptionViewWindow(e.getFormattedDescription(), state.titleWindow);
		state.tagWindows.add(new TagViewWindow(unreadIcon, unreadIcon_small, true, state.descriptionWindow, state.titleWindow));
		state.tagWindows.add(new TagViewWindow(importantIcon, importantIcon_small, false, state.descriptionWindow, state.titleWindow));
		stackedEvents.add(e);
		eventStates.put(e, state);
	}

	public NotificationEvent getNotificationEventWithID(int ID) {
		for (NotificationEvent ev : stackedEvents) {
			if (ev.getID() == ID)
				return ev;
		}
		return null;
	}

	public void showTitle(NotificationEvent e) {
		if (!stackedEvents.contains(e)) return;
		EventState state = eventStates.get(e);
		state.titleWindow.showTitle();
		if (!state.seen) {
			state.titleWindow.enterTitle();
			state.seen = true;
		}
	}

	public void hideTitle(NotificationEvent e) {
		if (!stackedEvents.contains(e)) return;
		EventState state = eventStates.get(e);
		state.titleWindow.hideTitle();
	}

	public void showDescription(NotificationEvent e) {
		if (!stackedEvents.contains(e)) return;
		EventState state = eventStates.get(e);
		state.descriptionWindow.showDescription();
		if (!state.seen) {
			state.seen = true;
		}
	}

	public void hideDescription(NotificationEvent e) {
		if (!stackedEvents.contains(e)) return;
		EventState state = eventStates.get(e);
		state.descriptionWindow.hideDescription();
	}

	public void setTagEnabled(NotificationEvent e, int tagIndex, boolean enabled) {
		if (!stackedEvents.contains(e)) return;
		EventState state = eventStates.get(e);
		if (enabled)
			state.tagWindows.get(tagIndex).makeAppear();
		else
			state.tagWindows.get(tagIndex).makeDisappear();
	}

	public void markRead(NotificationEvent e) {
		setTagEnabled(e, UNREAD_TAG, false);
	}

	public void markImportant(NotificationEvent e) {
		setTagEnabled(e, IMPORTANT_TAG, true);
	}

	public void unstack(NotificationEvent e) {
		if (!stackedEvents.contains(e)) return;
		EventState state = eventStates.get(e);

		// offset title windows below
		int removedRow = state.titleWindow.getRow();
		for (NotificationEvent ev : stackedEvents) {
			TitlePreviewWindow win = eventStates.get(ev).titleWindow;
			if (win.getRow() > removedRow)
				win.setRow(win.getRow() - 1);
		}

		state.titleWindow.exitTitle();
		state.titleWindow.hideTitle();
		eventStates.remove(e);
		stackedEvents.remove(e);
	}

	//////////////////////////////////////////////////////////

	public static EventStack debugStack = null;
	static JList<String> debugList = null;
	static DefaultListModel<String> debugListModel = null;

	private static NotificationEvent getSelectedDebugEvent() {
		String s = debugList.getSelectedValue();
		if (s == null) return null;
		int id = Integer.parseInt(s);
		return debugStack.getNotificationEventWithID(id);
	}

	public static void addDebugEvent(NotificationEvent e) {
		if (debugStack == null)
			createDebugWindow();

		debugStack.stack(e);
		debugListModel.addElement(""+e.getID());
		debugList.repaint();
	}

	private static void createDebugWindow() {

		debugStack = new EventStack();

		JFrame win = new JFrame();
		Container c = win.getContentPane();
		debugListModel = new DefaultListModel<String>();

		debugList = new JList<String>(debugListModel);
		c.add(debugList);
		win.setSize(100, 400);
		win.setVisible(true);

		GUIUtils.addAdvancedKeyListener(null, new GUIUtils.AdvancedKeyListener() {
			@Override
			public void keyPressedOnce(KeyEvent e) {
				if (e.getKeyCode() == KeyEvent.VK_T) {
					NotificationEvent ev = getSelectedDebugEvent();
					if (ev == null) return;
					debugStack.showTitle(ev);
				}
				if (e.getKeyCode() == KeyEvent.VK_M) {
					NotificationEvent ev = getSelectedDebugEvent();
					if (ev == null) return;
					debugStack.showDescription(ev);
				}
				if (e.getKeyCode() == KeyEvent.VK_R) {
					NotificationEvent ev = getSelectedDebugEvent();
					if (ev == null) return;
					debugStack.markRead(ev);
				}
				if (e.getKeyCode() == KeyEvent.VK_D) {
					NotificationEvent ev = getSelectedDebugEvent();
					if (ev == null) return;
					debugStack.unstack(ev);
				}
			}

			@Override
			public void keyReleased(KeyEvent e) {
				if (e.getKeyCode() == KeyEvent.VK_T) {
					NotificationEvent ev = getSelectedDebugEvent();
					if (ev == null) return;
					debugStack.hideTitle(ev);
				}
				if (e.getKeyCode() == KeyEvent.VK_M) {
					NotificationEvent ev = getSelectedDebugEvent();
					if (ev == null) return;
					debugStack.hideDescription(ev);
				}
				if (e.getKeyCode() == KeyEvent.VK_I) {
					NotificationEvent ev = getSelectedDebugEvent();
					if (ev == null) return;
					debugStack.markImportant(ev);
				}

			}

			@Override
			public void keyTyped(KeyEvent e) {
			}

			@Override
			public void keyPressed(KeyEvent e) {
			}

			@Override
			public void keyRepeated(KeyEvent e) {
			}

		}, false);
	}
}


text:
var path = require('path')
var webpack = require('webpack')
var HtmlWebpackPlugin = require('html-webpack-plugin')

var rootPath = path.resolve(__dirname, '..')
var srcPath = path.join(rootPath, 'src')
var distPath = path.join(rootPath, 'dist')

module.exports = {
  // multiple entries
  entry: {
    app: path.join(srcPath, 'main.js'),
    vendor: ['bootstrap-loader']
  },
  // different entry, different filename
  output: {
    path: distPath,
    publicPath: '/',
    filename: '[name].js'
  },
  module: {
    rules: [
      {
        test: /\.vue$/,
        loader: 'vue-loader',
        options: {
          // vue-loader options go here
        }
      },
      {
        test: /\.js$/,
        include: srcPath,
        loader: 'babel-loader',
        exclude: /node_modules/
      },
      {
        test: /\.(png|jpg|gif|svg|ttf|eot|woff(2)?)$/,
        loader: 'file-loader',
        options: {
          name: '[name].[ext]?[hash]'
        }
      },
      {
        test: /bootstrap-sass(\\|\/)assets(\\|\/)javascripts(\\|\/)/,
        loader: 'imports-loader?jQuery=jquery'
      },
      {
        test: /\.json$/,
        loader: 'json-loader'
      }
    ]
  },
  resolve: {
    modules: [srcPath, 'node_modules'],
    // extensions: ['*', '.js', '.vue'],
    alias: {
      COMPONENT: path.join(srcPath, 'components'),
      SERVICE: path.join(srcPath, 'services'),
      LIB: path.join(srcPath, 'lib'),
      'vue$': 'vue/dist/vue'
    }
  },
  plugins: [
    new HtmlWebpackPlugin({
      filename: 'index.html',
      template: path.join(rootPath, 'index.html')
    }),
    new webpack.DefinePlugin({
      // 配置开发全局常量
      __DEV__: process.env.NODE_ENV.trim() === 'development',
      __PROD__: process.env.NODE_ENV.trim() === 'production'
    }),
    new webpack.ProvidePlugin({
      "$": "jquery",
    })
  ]
}

if (process.env.NODE_ENV === 'production') {
  module.exports.devtool = '#source-map'
  // http://vue-loader.vuejs.org/en/workflow/production.html
  module.exports.plugins = (module.exports.plugins || []).concat([
    new webpack.DefinePlugin({
      'process.env': {
        NODE_ENV: '"production"'
      }
    }),
    new webpack.optimize.UglifyJsPlugin({
      compress: {
        warnings: false
      }
    }),
    new webpack.LoaderOptionsPlugin({
      minimize: true
    })
  ])
}


text:
Ext.define('gov.va.cprs.CoverSheet', {
    extend: 'Ext.container.Container',
    requires: [
        'gov.va.cprs.coversheet.Appointments',
        'gov.va.cprs.coversheet.ActiveProblems',
        'gov.va.cprs.coversheet.ActiveMedications',
        'gov.va.cprs.coversheet.Allergies',
        'gov.va.cprs.coversheet.RecentLabs',
        'gov.va.cprs.coversheet.RecentVitals',
        'gov.va.cprs.coversheet.Reminders'
    ],
    alias: 'widget.classiccoversheet',
    mixins: {
        patientaware: 'gov.va.hmp.PatientAware'
    },
    title: 'Classic Cover Sheet',
    padding: '0 5 5 5',
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    items: [
        {
            xtype: 'container',
            itemId: 'row1',
            flex: 1,
            layout: {
                type: 'hbox',
                align: 'stretch'
            }
        },
        {
            xtype: 'splitter'
        },
        {
            xtype: 'container',
            itemId: 'row2',
            flex: 2,
            layout: {
                type: 'hbox',
                align: 'stretch'
            }
        },
        {
            xtype: 'splitter'
        },
        {
            xtype: 'container',
            itemId: 'row3',
            flex: 1,
            layout: {
                type: 'hbox',
                align: 'stretch'
            }
        }
    ],
    initComponent: function () {
        // adding components here so that each coversheet component doesn't need its own xtype
        this.items[0].items = [
            Ext.create('gov.va.cprs.coversheet.ActiveProblems', {
                ui: 'condensed',
                flex: 1,
                frame: true,
                rowLines: false
            }),
            {
                xtype: 'splitter'
            },
            Ext.create('gov.va.cprs.coversheet.Allergies', {
                ui: 'condensed',
                flex: 1,
                frame: true,
                rowLines: false
            }),
            {
                xtype: 'splitter'
            },
            {
                xtype: 'container',
                flex: 1,
                layout: {
                    type: 'vbox',
                    align: 'stretch'
                },
                items: [
                    {
                        xtype: 'panel',
                        ui: 'condensed',
                        title: 'Patient Record Flags',
                        frame: true,
                        flex: 1
                    },
                    {
                        xtype: 'splitter'
                    },
                    {
                        xtype: 'viewdefgridpanel',
                        ui: 'condensed',
                        title: 'Postings',
                        frame: true,
                        flex: 1,
                        rowLines: false,
                        viewID: 'gov.va.cpe.vpr.queryeng.ProfileDocsViewDef',
                        hideHeaders: true,
                        detailType: 'window',
                        detailTitleField: 'localTitle',
                        detail: {
                            width: 600,
                            height: 400
                        }
                    }
                ]
            }
        ];
        this.items[2].items = [
            Ext.create('gov.va.cprs.coversheet.ActiveMedications', {
                ui: 'condensed',
                frame: true,
                flex: 2,
                rowLines: false
            }),
            {
                xtype: 'splitter'
            },
            Ext.create('gov.va.cprs.coversheet.Reminders', {
                ui: 'condensed',
                frame: true,
                flex: 3,
                rowLines: false
            })
        ];
        this.items[4].items = [
            Ext.create('gov.va.cprs.coversheet.RecentLabs', {
                ui: 'condensed',
                frame: true,
                flex: 1,
                rowLines: false
            }),
            {
                xtype: 'splitter'
            },
            Ext.create('gov.va.cprs.coversheet.RecentVitals', {
                ui: 'condensed',
                frame: true,
                flex: 1,
                rowLines: false
            }),
            {
                xtype: 'splitter'
            },
            Ext.create('gov.va.cprs.coversheet.Appointments', {
                ui: 'condensed',
                frame: true,
                flex: 1,
                rowLines: false
            })
        ];

        this.callParent(arguments);

        this.mon(this, 'patientchange', this.onPatientChange, this);
    },
    initEvents: function () {
        var me = this;

        me.callParent(arguments);

        var components = me.query('gridpanel');
        for (var i = 0; i < components.length; i++) {
            me.mon(components[i], 'selectionchange', me.onSelectionChange, me);
        }
    },

    onPatientChange: function (pid) {
        this.pid = pid;
        if (!this.pid || pid == '') return;
        var rem = this.down("#clinicalReminders");
        if (rem && rem.rendered) {
            rem.viewParams.filter_dfn = gov.va.hmp.PatientContext.getPatientInfo().localId;
            rem.viewParams.filter_user = gov.va.hmp.UserContext.getUserInfo().duz;
            rem.setViewDef(rem.curViewID, rem.viewParams, true);
        }
    },
    // coordinates only one selection amongst all cover sheet components
    onSelectionChange: function (selModel, selection) {
        var me = this;
        var components = me.query('gridpanel');
        for (var i = 0; i < components.length; i++) {
            if (components[i].getSelectionModel() !== selModel) {
                components[i].getSelectionModel().deselectAll();
            }
        }
    }
});


text:
// Copyright 2016 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef _FASTDDS_RTPS_RECEIVER_RESOURCE_H
#define _FASTDDS_RTPS_RECEIVER_RESOURCE_H

#include <functional>
#include <vector>
#include <memory>
#include <fastdds/rtps/messages/MessageReceiver.h>
#include <fastdds/rtps/transport/TransportInterface.h>

namespace eprosima {
namespace fastrtps {
namespace rtps {

/**
 * RAII object that encapsulates the Receive operation over one channel in an unknown transport.
 * A Receiver resource is always univocally associated to a transport channel; the
 * act of constructing a Receiver Resource opens the channel and its destruction
 * closes it.
 * @ingroup NETWORK_MODULE
 */
class ReceiverResource : public fastdds::rtps::TransportReceiverInterface
{
   //! Only NetworkFactory is ever allowed to construct a ReceiverResource from scratch.
   //! In doing so, it guarantees the transport and channel are in a valid state for
   //! this resource to exist.
    friend class NetworkFactory;

public:
    /**
    * Method called by the transport when receiving data.
    * @param data Pointer to the received data.
    * @param size Number of bytes received.
    * @param localLocator Locator identifying the local endpoint.
    * @param remoteLocator Locator identifying the remote endpoint.
    */
    virtual void OnDataReceived(const octet* data, const uint32_t size,
        const Locator_t& localLocator, const Locator_t& remoteLocator) override;

    /**
     * Reports whether this resource supports the given local locator (i.e., said locator
     * maps to the transport channel managed by this resource).
     */
    bool SupportsLocator(const Locator_t& localLocator);

    /**
     * Register a MessageReceiver object to be called upon reception of data.
     * @param receiver The message receiver to register.
     */
    void RegisterReceiver(MessageReceiver* receiver);

    /**
    * Unregister a MessageReceiver object to be called upon reception of data.
    * @param receiver The message receiver to unregister.
    */
    void UnregisterReceiver(MessageReceiver* receiver);

    /**
     * Closes related ChannelResources.
     */
    void disable();

    inline uint32_t max_message_size() const
    {
        return max_message_size_;
    }

    /**
     * Resources can only be transfered through move semantics. Copy, assignment, and
     * construction outside of the factory are forbidden.
     */
    ReceiverResource(ReceiverResource&&);

    ~ReceiverResource() override;

private:
    ReceiverResource() = delete;
    ReceiverResource(const ReceiverResource&) = delete;
    ReceiverResource& operator=(const ReceiverResource&) = delete;

    ReceiverResource(fastdds::rtps::TransportInterface&, const Locator_t&, uint32_t);
    std::function<void()> Cleanup;
    std::function<bool(const Locator_t&)> LocatorMapsToManagedChannel;
    bool mValid; // Post-construction validity check for the NetworkFactory

    std::mutex mtx;
    MessageReceiver* receiver;
    uint32_t max_message_size_;
};

} // namespace rtps
} // namespace fastrtps
} // namespace eprosima

#endif /* _FASTDDS_RTPS_RECEIVER_RESOURCE_H */


text:
SYNONYM

#### According to
Index Fungorum

#### Published in
Epicr. syst. mycol. (Upsaliae) 7 (1838)

#### Original name
Agaricus validus Fr.

### Remarks
null


text:
Wallet Information

        Wallet Name (at creation)

          {{walletName}}

        Wallet Id

          {{walletId}}

        Wallet Configuration (m-n)

          {{M}}-{{N}}

        Wallet Network

          {{network}}

        Address Type

          {{addressType}}

        Derivation Strategy

          {{derivationStrategy}}

        Hardware Wallet

          {{index.externalSource}}

          No private key

        Account ({{derivationStrategy}})

          #{{index.account}}

Copayers

           {{copayer.name}} ({{'Me'|translate}})

           {{copayer.name}}

Extended Public Keys

Copayer {{$index}}

{{pk}}

              ({{basePath}})

Last Wallet Addresses

            {{a.address}}

            {{a.path}} ·  {{a.createdOn *1000  | amDateFormat:'MMMM Do YYYY, h:mm a' }}

        Only Main (not change) addresses are shown. The addresses on this list were not verified locally at this time.

          Scan addresses for funds

          Send addresses by email

Balance By Address

            {{a.address}}

            {{(a.amount/1e8).toFixed(8)}} BTC


text:
If you create your React component with React.createClass most of your methods are automatically bound (as expected) such that 'this' refers to the component itself rather than 'window'.  This package allows you to do the same for ES6 React Components, i.e. React Components created as follows:

    MyReactComponent = class MyReactComponent extends React.Component

To accomplish this automatic binding in ES6 classes, install the package, then call SteinitzREA.Autobind in your class's constructor, like this:.

    MyReactComponent = class MyReactComponent extends React.Component
    {
        constructor (props)
        {
            super (props);
            SteinitzREA.AutoBind (this);
        }
        ...

Note that my main purpose for releasing this package was to support my React ES6 Component package (which calls AutoBind for you in its own constructor).  But I felt that this package might be useful to someone on it's own.  Personally, I found it annoying to that 'this' pointed to 'window' in most React ES6 class methods.  And, Facebook have stated that they have no intention of changing that.


text:
/*************************************************************************/
/*  audio_stream_player.h                                                */
/*************************************************************************/
/*                       This file is part of:                           */
/*                           GODOT ENGINE                                */
/*                      https://godotengine.org                          */
/*************************************************************************/
/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur.                 */
/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md).   */
/*                                                                       */
/* Permission is hereby granted, free of charge, to any person obtaining */
/* a copy of this software and associated documentation files (the       */
/* "Software"), to deal in the Software without restriction, including   */
/* without limitation the rights to use, copy, modify, merge, publish,   */
/* distribute, sublicense, and/or sell copies of the Software, and to    */
/* permit persons to whom the Software is furnished to do so, subject to */
/* the following conditions:                                             */
/*                                                                       */
/* The above copyright notice and this permission notice shall be        */
/* included in all copies or substantial portions of the Software.       */
/*                                                                       */
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,       */
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF    */
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.*/
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY  */
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,  */
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE     */
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.                */
/*************************************************************************/

#ifndef AUDIO_STREAM_PLAYER_H
#define AUDIO_STREAM_PLAYER_H

#include "core/templates/safe_refcount.h"
#include "scene/main/node.h"
#include "servers/audio/audio_stream.h"

class AudioStreamPlayer : public Node {
	GDCLASS(AudioStreamPlayer, Node);

public:
	enum MixTarget {
		MIX_TARGET_STEREO,
		MIX_TARGET_SURROUND,
		MIX_TARGET_CENTER
	};

private:
	Vector<Ref<AudioStreamPlayback>> stream_playbacks;
	Ref<AudioStream> stream;

	SafeFlag active;

	float pitch_scale = 1.0;
	float volume_db = 0.0;
	bool autoplay = false;
	StringName bus = SNAME("Master");
	int max_polyphony = 1;

	MixTarget mix_target = MIX_TARGET_STEREO;

	void _mix_internal(bool p_fadeout);
	void _mix_audio();
	static void _mix_audios(void *self) { reinterpret_cast<AudioStreamPlayer *>(self)->_mix_audio(); }

	void _set_playing(bool p_enable);
	bool _is_active() const;

	void _bus_layout_changed();
	void _mix_to_bus(const AudioFrame *p_frames, int p_amount);

	Vector<AudioFrame> _get_volume_vector();

protected:
	void _validate_property(PropertyInfo &p_property) const;
	void _notification(int p_what);
	static void _bind_methods();

public:
	void set_stream(Ref<AudioStream> p_stream);
	Ref<AudioStream> get_stream() const;

	void set_volume_db(float p_volume);
	float get_volume_db() const;

	void set_pitch_scale(float p_pitch_scale);
	float get_pitch_scale() const;

	void set_max_polyphony(int p_max_polyphony);
	int get_max_polyphony() const;

	void play(float p_from_pos = 0.0);
	void seek(float p_seconds);
	void stop();
	bool is_playing() const;
	float get_playback_position();

	void set_bus(const StringName &p_bus);
	StringName get_bus() const;

	void set_autoplay(bool p_enable);
	bool is_autoplay_enabled();

	void set_mix_target(MixTarget p_target);
	MixTarget get_mix_target() const;

	void set_stream_paused(bool p_pause);
	bool get_stream_paused() const;

	Ref<AudioStreamPlayback> get_stream_playback();

	AudioStreamPlayer();
	~AudioStreamPlayer();
};

VARIANT_ENUM_CAST(AudioStreamPlayer::MixTarget)

#endif // AUDIO_STREAM_PLAYER_H


text:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <title>Python Module Index — Debinterface 3.3.0 documentation</title>

    <link rel="stylesheet" href="_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />

    <link rel="index" title="Index" href="genindex.html" />
    <link rel="search" title="Search" href="search.html" />
    <link rel="top" title="Debinterface 3.3.0 documentation" href="index.html" />

Navigation

          index

          modules |

Debinterface 3.3.0 documentation »

Python Module Index

   d

       d

       debinterface

       debinterface.adapter

       debinterface.adapterValidation

       debinterface.dnsmasqRange

       debinterface.hostapd

       debinterface.interfaces

       debinterface.interfacesReader

       debinterface.interfacesWriter

       debinterface.toolutils

Quick search

    <form class="search" action="search.html" method="get">

<input type="text" name="q" />

<input type="submit" value="Go" />

      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>

Navigation

          index

          modules |

Debinterface 3.3.0 documentation »

        © Copyright 2018, Nathan Mustaki.
      Created using Sphinx 1.4.8.


text:
Aria.tplScriptDefinition({
    $classpath : "test.aria.widgets.form.autocomplete.autoedit.AutoEditInputTplScript",
    $dependencies : ["aria.resources.handlers.LCResourcesHandler"],
    $constructor : function () {
        this._lcHandler = new aria.resources.handlers.LCResourcesHandler();
        this._lcHandler.setSuggestions([{
                    label : 'Paris',
                    code : 'PAR'
                },{
                    label : 'Milan',
                    code : 'MXP'
                }]);
    },
    $destructor : function () {
        this._lcHandler.$dispose();
        this._lcHandler = null;
    },
    $prototype : {
        _getAirLinesHandler : function () {
            return this._lcHandler;
        }
    }
});


text:
package com.orasi.core.by.angular;
import org.openqa.selenium.WebElement;

import java.util.List;

	public interface FindsByNGModel {
	  WebElement findElementByNGModel(String using);
	  List<WebElement> findElementsByNGModel(String using);
	}