Recompute a split.
@param a input/out array containing the split, changed
on output
16384
private static void resplit(final double a[]) {
        final double c = a[0] + a[1];
        final double d = -(c - a[0] - a[1]);

        if (c < 8e298 && c > -8e298) { // MAGIC NUMBER
            double z = c * HEX_40000000;
            a[0] = (c + z) - z;
            a[1] = c - a[0] + d;
        } else {
            double z = c * 9.31322574615478515625E-10;
            a[0] = (c + z - c) * HEX_40000000;
            a[1] = c - a[0] + d;
        }
    }
948998
public static <E extends Exception> void flatOp(final short[][] a, Try.Consumer<short[], E> op) throws E {
        if (N.isNullOrEmpty(a)) {
            return;
        }

        final short[] tmp = flatten(a);

        op.accept(tmp);

        int idx = 0;

        for (short[] e : a) {
            if (N.notNullOrEmpty(e)) {
                N.copy(tmp, idx, e, 0, e.length);
                idx += e.length;
            }
        }
    }
1009031
@Override
	public InputSplit[] computeInputSplits(int requestedMinNumber) throws Exception {
		// we have to be sure that the format is instantiated at this point
		if (this.format == null) {
			throw new IllegalStateException("BUG: Input format hast not been instantiated, yet.");
		}
		return this.format.createInputSplits(requestedMinNumber);
	}
99592
public static void copyThenClose(InputStream input, OutputStream output)
      throws IOException {
    copy(input, output);
    input.close();
    output.close();
  }
1133394
function arraySpliceOut(mutate, at, arr) {
    var newLen = arr.length - 1;
    var i = 0;
    var g = 0;
    var out = arr;
    if (mutate) {
        i = g = at;
    } else {
        out = new Array(newLen);
        while (i < at) {
            out[g++] = arr[i++];
        }
    }
    ++i;
    while (i <= newLen) {
        out[g++] = arr[i++];
    }if (mutate) {
        out.length = newLen;
    }
    return out;
}
629993
static List<String> split(String input)
    {
        if (input.isEmpty())
            return Collections.<String>emptyList();

        List<String> res = new ArrayList<String>();
        int prev = 0;
        for (int i = 0; i < input.length(); i++)
        {
            if (input.charAt(i) != ':' || (i > 0 && input.charAt(i-1) == '\\'))
                continue;

            res.add(input.substring(prev, i));
            prev = i + 1;
        }
        res.add(input.substring(prev, input.length()));
        return res;
    }
1245419
function deepSplitString (input, separators) {
  if (input === null || typeof input === 'undefined') {
    return input
  }
  if (separators.length === 0) {
    return input
  }

  const sep = separators.shift()
  let output = input

  if (typeof input === 'string') {
    output = splitString(input, sep)
  } else if (Array.isArray(input)) {
    output = input.map(i => splitString(i, sep))
  } else if (typeof input === 'object') {
    output = {}
    Object.keys(input).forEach(key => {
      output[key] = splitString(input[key], sep)
    })
  }

  if (separators.length > 0) {
    return deepSplitString(output, separators)
  } else {
    return output
  }
}
1156643
function buildDiff( $oldArray, $newArray )
    {
        $substr = $this->substringMatrix( $oldArray, $newArray );

        $nOldWords = count( $oldArray );
        $nNewWords = count( $newArray );

        /*
        $tmp = $substr['lengthMatrix'];
        print( "<pre>" );
        $this->dumpMatrix( $tmp, $nOldWords, $nNewWords );
        print( "</pre>" );
        */

        $strings = $this->substrings( $substr, $oldArray, $newArray );
        $len = count( $strings );

        //Merge detected substrings
        $mergedStrings = array();
        foreach ( $strings as $sstring )
        {
            $mergedStrings = $mergedStrings + $sstring;
        }
        unset( $strings );

        //Check for changes in lead & inner words
        $differences = array();
        $offset = 0;
        $delOffset = 0;

        $oldOffset = -1;

        foreach ( $mergedStrings as $key => $wordArray )
        {
            if ( $oldOffset >= $wordArray['oldOffset'] )
            {
                continue;
            }

            $oldOffset = $wordArray['oldOffset'];

            // Added words
            while ( $key > $offset )
            {
                $differences[] = array( 'added' => $newArray[$offset],
                                        'status' => 2 );
                $offset++;
            }

            // Removed words
            while ( $oldOffset > $delOffset )
            {
                $differences[] = array( 'removed' => $oldArray[$delOffset],
                                        'status' => 1 );
                $delOffset++;
            }

            //The default state - unchanged paragraph
            $differences[] = array( 'unchanged' => $newArray[$key],
                                    'status' => 0 );
            $delOffset++;
            $offset++;
        }

        // Appended words
        while ( $nNewWords > $offset )
        {
            $differences[] = array( 'added' => $newArray[$offset],
                                    'status' => 2 );
            $offset++;
        }

        // Words, removed at the paragraph end
        while ( $nOldWords > $delOffset )
        {
            $differences[] = array( 'removed' => $oldArray[$delOffset],
                                    'status' => 1 );
            $delOffset++;
        }

        $output = $this->postProcessDiff( $differences );
        return $output;

    }
213931
private static Spliterator.OfInt adapt(Spliterator<Integer> s) {
        if (s instanceof Spliterator.OfInt) {
            return (Spliterator.OfInt) s;
        }
        else {
//            if (Tripwire.ENABLED)
//                Tripwire.trip(AbstractPipeline.class,
//                              "using IntStream.adapt(Spliterator<Integer> s)");
            throw new UnsupportedOperationException("IntStream.adapt(Spliterator<Integer> s)");
        }
    }
736472
function copy(out, a) {
  out[0] = a[0]
  out[1] = a[1]
  out[2] = a[2]
  out[3] = a[3]
  return out
}
516966
@Override
    public boolean decompose( ZMatrixRMaj A ) {
        init(A);

        for( int k = 0; k < N-1; k++ ) {
            similarTransform(k);
        }

        return true;
    }
972796
public void write(DataOutput out) throws IOException {
    WritableUtils.writeVInt(out, splits.length);
    for (InputSplit s : splits) {
      Text.writeString(out, s.getClass().getName());
    }
    for (InputSplit s : splits) {
      s.write(out);
    }
  }
1351561
@Override
    public void initialize(InputSplit split) throws IOException, InterruptedException {
        super.initialize(split);
        this.iter = getIterator(0);
        this.initialized = true;
    }
43660
public static void normalize(double[] a) {
    double total = sum(a);
    if (total == 0.0 || Double.isNaN(total)) {
      throw new RuntimeException("Can't normalize an array with sum 0.0 or NaN: " + Arrays.toString(a));
    }
    multiplyInPlace(a, 1.0/total); // divide each value by total
  }
1291366
public static void copy(byte[] in, OutputStream out) throws IOException {
        assert in != null : "No input byte array specified";
        assert out != null : "No output stream specified";
        try {
            out.write(in);
        } finally {
            try {
                out.close();
            } catch (IOException ex) {
            }
        }
    }
376258
public static Iterable<String> split(String separator, String stringToSplit) {

    String[] StringArray = stringToSplit.split(separator);

    Iterable<String> iterable = Arrays.asList(StringArray);

    return iterable;
  }
952479
@Override
    public void initialize(InputSplit split) throws IOException, InterruptedException {
        if (split instanceof ListStringSplit) {
            ListStringSplit listStringSplit = (ListStringSplit) split;
            delimitedData = listStringSplit.getData();
            dataIter = delimitedData.iterator();
        } else {
            throw new IllegalArgumentException("Illegal type of input split " + split.getClass().getName());
        }
    }