Parses next double in scientific form
@param cs
@param beginIndex
@param endIndex
@return
6960
public static final double findScientific(CharSequence cs, int beginIndex, int endIndex)
    {
        int begin = CharSequences.indexOf(cs, Primitives::isScientificDigit, beginIndex);
        int end = CharSequences.indexOf(cs, (c)->!Primitives.isScientificDigit(c), begin);
        return parseDouble(cs, begin, endIndex(end, endIndex));
    }
1030636
private void parseAdditiveExpr() throws TTXPathException {

        parseMultiplicativeExpr();

        String op = mToken.getContent();
        while (is(TokenType.PLUS, true) || is(TokenType.MINUS, true)) {

            // identify current operator kind
            // for (Operators op : Operators.values()) {
            // if (is(op.getOpName(), true)) {

            // parse second operand axis

            mPipeBuilder.addExpressionSingle();

            parseMultiplicativeExpr();

            mPipeBuilder.addOperatorExpression(getTransaction(), op);
            op = mToken.getContent();
        }
        // }
        // }
    }
259864
@Override
    public CharSequence subSequence(final int beginIndex, final int endIndex) {
        if (beginIndex < 0) {
            throw new IndexOutOfBoundsException("Negative beginIndex: " + beginIndex);
        }
        if (endIndex > this.len) {
            throw new IndexOutOfBoundsException("endIndex: " + endIndex + " > length: " + this.len);
        }
        if (beginIndex > endIndex) {
            throw new IndexOutOfBoundsException("beginIndex: " + beginIndex + " > endIndex: " + endIndex);
        }
        return CharBuffer.wrap(this.array, beginIndex, endIndex);
    }
200479
public void calc(CsvReader reader)
	{
		if(reader == null || reader.isEmpty())
			return;
		
		init();
		
		reader.sortRowsForIndexByType(timeMsIndex, DataType.Long);

		long tsMS, startTsMS = -1;
		int size = reader.size();
		
		for(int i=0; i < size;i++)
		{
			tsMS = reader.get(i,timeMsIndex, DataType.Long);

			this.currentVal = reader.get(i,calculateColumn, DataType.Long);
			
			//check if this is within a second
			if(startTsMS == -1)
			{
				startTsMS = tsMS;
				
				addInMillsec();
			}
			else if ((tsMS - startTsMS) <= milliseconds)
			{
				addInMillsec();
			}
			else if( (tsMS - startTsMS) > milliseconds)
			{
			
				this.incrementStat();
				startTsMS = tsMS;
			}
		}
		
		this.incrementStat();
	}
959071
public static Dcs cs_transpose(Dcs A, boolean values) {
        int p, q, j, Cp[], Ci[], n, m, Ap[], Ai[], w[];
        double Cx[], Ax[];
        Dcs C;
        if (!Dcs_util.CS_CSC(A))
            return (null); /* check inputs */
        m = A.m;
        n = A.n;
        Ap = A.p;
        Ai = A.i;
        Ax = A.x;
        C = Dcs_util.cs_spalloc(n, m, Ap[n], values && (Ax != null), false); /* allocate result */
        w = new int[m]; /* get workspace */
        Cp = C.p;
        Ci = C.i;
        Cx = C.x;
        for (p = 0; p < Ap[n]; p++)
            w[Ai[p]]++; /* row counts */
        Dcs_cumsum.cs_cumsum(Cp, w, m); /* row pointers */
        for (j = 0; j < n; j++) {
            for (p = Ap[j]; p < Ap[j + 1]; p++) {
                Ci[q = w[Ai[p]]++] = j; /* place A(i,j) as entry C(j,i) */
                if (Cx != null)
                    Cx[q] = Ax[p];
            }
        }
        return C;
    }
1275443
public static Double[] getColumnDoubleValues(CSTable t, String columnName) {
        int col = columnIndex(t, columnName);
        if (col == -1) {
            throw new IllegalArgumentException("No such column: " + columnName);
        }
        List<Double> l = new ArrayList<Double>();
        for (String[] s : t.rows()) {
            l.add(new Double(s[col]));
        }
        return l.toArray(new Double[0]);
    }
1131055
public int get24( int x , int y ) {
		int i = startIndex + y*stride+x*3;
		return ((data[i]&0xFF) << 16) | ((data[i+1]&0xFF) << 8) | (data[i+2]&0xFF);
	}
708123
public StringExpression substring(Expression<Integer> beginIndex, Expression<Integer> endIndex) {
        return Expressions.stringOperation(Ops.SUBSTR_2ARGS, mixin, beginIndex, endIndex);
    }
681798
private static CoordinateArraySequence convertSequence(Coordinate[] cs,int dimension) {        
        for (int i = 0; i < cs.length; i++) { 
            Coordinate coord = cs[i];
            switch (dimension) {
                case 2:
                    coord.z = Double.NaN;
                    cs[i]=coord;
                    break;
                case 3: {
                    double z = coord.z;
                    if (Double.isNaN(z)) {
                        coord.z = 0;
                        cs[i]=coord;
                    }
                    break;
                }                
                default:
                    break;
            }
        }        
        return new CoordinateArraySequence(cs, dimension);        
    }
197082
protected function parse(File $phpcsFile, int $startIndex, int $endIndex): array
    {
        $tokens = $phpcsFile->getTokens();
        if (empty($tokens[$endIndex])) {
            throw new RuntimeException('Should not happen');
        }

        $classIndex = $phpcsFile->findNext(Tokens::$emptyTokens, $startIndex + 1, null, true);
        if (empty($tokens[$classIndex])) {
            throw new RuntimeException('Should not happen');
        }

        $implements = [];

        $i = $classIndex;
        while ($i < $endIndex) {
            if (empty($tokens[$i])) {
                break;
            }

            while ($tokens[$i]['code'] !== T_NS_SEPARATOR && $tokens[$i]['code'] !== T_STRING) {
                $i++;
                if (empty($tokens[$i])) {
                    break;
                }

                continue;
            }

            if (empty($tokens[$i])) {
                break;
            }

            $current = $i;
            $className = $tokens[$i]['content'];
            $i++;

            if (empty($tokens[$i])) {
                break;
            }

            while ($tokens[$i]['code'] === T_NS_SEPARATOR || $tokens[$i]['code'] === T_STRING) {
                $className .= $tokens[$i]['content'];
                $i++;

                if (empty($tokens[$i])) {
                    break;
                }
            }

            $implements[] = [
                'start' => $current,
                'end' => $i - 1,
                'content' => $className,
            ];
        }

        return $implements;
    }
264208
@Override void incr0( int b, double y ) {
    Utils.AtomicDoubleArray.add(_sums,b,y);
    Utils.AtomicDoubleArray.add(_ssqs,b,y*y);
  }
197960
public double getDouble(int index)
  {
    Object value = _values[index - 1];

    if (value instanceof Double) {
      return (Double) value;
    }
    else if (value instanceof Float) {
      return (Float) value;
    }
    else if (value instanceof Number) {
      return (Double) ((Number) value);
    }
    else {
      return Double.valueOf(value.toString());
    }
  }
875003
@Override
  protected int nextEscapeIndex(CharSequence csq, int index, int end) {
    for (; index < end; index++) {
      char c = csq.charAt(index);
      if (c >= safeOctets.length || !safeOctets[c]) {
        break;
      }
    }
    return index;
  }
1145187
private static double getX(Coordinate c) {
		double value = c.getX();
		if (value > 1000000) {
			value = 1000000;
		} else if (value < -1000000) {
			value = -1000000;
		}
		return value;
	}
948721
public static void quickSort(
			  String[]        vector,
			  int             startIndex,
			  int             endIndex
		 )
	{
		 int     i       = startIndex;
		 int     j       = endIndex;
		 String  pivot   = vector[(i + j) / 2];
		 do {
			  while (i < endIndex && pivot.compareTo(vector[i]) > 0) {
					++i;
			  }
			  while (j > startIndex && pivot.compareTo(vector[j]) < 0) {
					--j;
			  }
			  if (i < j) {
					String  temp    = vector[i];
					vector[i]       = vector[j];
					vector[j]       = temp;
			  }
			  if (i <= j) {
					++i;
					--j;
			  }
		 } while (i <= j);
		 if (startIndex < j) {
			  quickSort(vector, startIndex, j);
		 }
		 if (i < endIndex) {
			  quickSort(vector, i, endIndex);
		 }
	}
30368
public static int[] sliceByTime(CSTable table, int timeCol, Date start, Date end) {
        if (end.before(start)) {
            throw new IllegalArgumentException("end<start");
        }
        if (timeCol < 0) {
            throw new IllegalArgumentException("timeCol :" + timeCol);
        }
        int s = -1;
        int e = -1;
        int i = -1;
        for (String[] col : table.rows()) {
            i++;
            Date d = Conversions.convert(col[timeCol], Date.class);
            if (s == -1 && (start.before(d) || start.equals(d))) {
                s = i;
            }
            if (e == -1 && (end.before(d) || end.equals(d))) {
                e = i;
                break;
            }
        }
        return new int[]{s, e};
    }
991266
@Pure
	@Inline(value = "EndianNumbers.parseBELong(Double.doubleToLongBits($1))",
			imported = {EndianNumbers.class})
	public static byte[] parseBEDouble(double value) {
		return parseBELong(Double.doubleToLongBits(value));
    }