Return unknown quality scores ("B") for a slice with the specified length.

@param length slice length
@return unknown quality scores ("B") for a slice with the specified length
321825
static String unknownQualityScores(final int length) {
        StringBuilder sb = new StringBuilder(length);
        for (int i = 0; i < length; i++) {
            sb.append("B");
        }
        return sb.toString();
    }
813451
public static int countCodePoints(Slice utf8, int offset, int length)
    {
        checkPositionIndexes(offset, offset + length, utf8.length());

        // Quick exit if empty string
        if (length == 0) {
            return 0;
        }

        int continuationBytesCount = 0;
        // Length rounded to 8 bytes
        int length8 = length & 0x7FFF_FFF8;
        for (; offset < length8; offset += 8) {
            // Count bytes which are NOT the start of a code point
            continuationBytesCount += countContinuationBytes(utf8.getLongUnchecked(offset));
        }
        // Enough bytes left for 32 bits?
        if (offset + 4 < length) {
            // Count bytes which are NOT the start of a code point
            continuationBytesCount += countContinuationBytes(utf8.getIntUnchecked(offset));

            offset += 4;
        }
        // Do the rest one by one
        for (; offset < length; offset++) {
            // Count bytes which are NOT the start of a code point
            continuationBytesCount += countContinuationBytes(utf8.getByteUnchecked(offset));
        }

        verify(continuationBytesCount <= length);
        return length - continuationBytesCount;
    }
413668
@Override
    public byte[] getBytes(int position, int length) {
        byte[] result = new byte[length];
        for (int i = 0; i < length; i++) {
            result[i]=getByte(position);
            position += BYTE_LEN;
        }
        return result;
    }
1219053
public static String getRandomAlphaNumeric(int length) {
        if (length <= 0) {
            return "";
        }

        Random r = getRandom();

        StringBuffer result = new StringBuffer(length);

        for (int i = 0; i < length; i++) {
            int n = r.nextInt(alphaNumChars.length);
            result.append(alphaNumChars[n]);
        }

        return result.toString();
    }
383119
public int calculateScore(AlignmentScoring<S> scoring) {
        return AlignmentUtils.calculateScore(sequence1, sequence1Range, mutations, scoring);
    }
440557
public int get(char []key, int length)
  {
    if (key == null)
      return NULL;

    int hash = hash(key, length) & _mask;

    while (true) {
      char []mapKey = _keys[hash];

      if (mapKey == null)
        return NULL;
      else if (equals(mapKey, key, length))
        return _values[hash];

      hash = (hash + 1) & _mask;
    }
  }
617823
public static String generate(final int length) {
    final StringBuilder password = new StringBuilder(length);

    double pik = random.nextDouble(); // random number [0,1]
    long ranno = (long) (pik * sigma); // weight by sum of frequencies

    long sum = 0;
    outer:
    for (int c1 = 0; c1 < 26; c1++) {
      for (int c2 = 0; c2 < 26; c2++) {
        for (int c3 = 0; c3 < 26; c3++) {
          sum += get(c1, c2, c3);
          if (sum > ranno) {
            password.append(alphabet.charAt(c1));
            password.append(alphabet.charAt(c2));
            password.append(alphabet.charAt(c3));
            break outer; // Found start.
          }
        }
      }
    }

    // Now do a random walk.
    int nchar = 3;
    while (nchar < length) {
      final int c1 = alphabet.indexOf(password.charAt(nchar - 2));
      final int c2 = alphabet.indexOf(password.charAt(nchar - 1));
      sum = 0;
      for (int c3 = 0; c3 < 26; c3++) {
        sum += get(c1, c2, c3);
      }

      if (sum == 0) {
        break;
      }

      pik = random.nextDouble();
      ranno = (long) (pik * sum);
      sum = 0;
      for (int c3 = 0; c3 < 26; c3++) {
        sum += get(c1, c2, c3);
        if (sum > ranno) {
          password.append(alphabet.charAt(c3));
          break;
        }
      }
      nchar++;
    }
    return password.toString();
  }
6015
public static BinaryString blankString(int length) {
		byte[] spaces = new byte[length];
		Arrays.fill(spaces, (byte) ' ');
		return fromBytes(spaces);
	}
486096
private void obtainQualityMarks() {
        int total = 0;
        for (int i = 0; i < this.qualityScoresArray.length; i++) {
            total += this.qualityScoresArray[i];
            this.maximumQuality = Math.max(this.qualityScoresArray[i], this.maximumQuality);
            this.minimumQuality = Math.min(this.qualityScoresArray[i], this.minimumQuality);
        }
        this.averageQuality = (double) total / this.quality.length();
    }
71121
public double score(StringWrapper s, StringWrapper t) {
	checkTrainingHasHappened(s,t);
	UnitVector sBag = asUnitVector(s);
	UnitVector tBag = asUnitVector(t);
    if (s.unwrap().equals(t.unwrap())) {
      return 1.0;
    }
    else {
      String[] sTokens = getTokenArray(sBag),
          tTokens = getTokenArray(tBag);
      double[] sIdfArray = getIDFArray(sBag),
          tIdfArray = getIDFArray(tBag);
      return algorithm1(sTokens, tTokens, sIdfArray, tIdfArray);
    }
  }
1103757
public int compareTo(Slice that)
    {
        if (this == that) {
            return 0;
        }
        if (this.data == that.data && length == that.length && offset == that.offset) {
            return 0;
        }

        int minLength = Math.min(this.length, that.length);
        for (int i = 0; i < minLength; i++) {
            int thisByte = 0xFF & this.data[this.offset + i];
            int thatByte = 0xFF & that.data[that.offset + i];
            if (thisByte != thatByte) {
                return (thisByte) - (thatByte);
            }
        }
        return this.length - that.length;
    }
1157100
public static int[] range(int length) {
        int[] index = new int[length];
        for (int i=0; i<index.length; i++) {
            // TODO: This should maybe be a safe cast for the benefit of non-IntDouble classes.
            index[i] = (int) i;
        }
        return index;
    }
909740
public String[] getAsStringArray(byte b) {
		String s = get(b);
		if (s == null)
			return null;
		else
			return s.split(lineSeparator+"");
	}
807389
public static String randomString(int length) {
        // CAUSE: If-Else Statements Should Use Braces
        if (length < 1) {
            throw new IllegalArgumentException(String.format("length < 1: %s", length));
        }

		char[] buf = new char[length];

		return nextString(buf);
	}
1202745
public static GrowQueue_F64 zeros( int length ) {
		GrowQueue_F64 out = new GrowQueue_F64(length);
		out.size = length;
		return out;
	}
1282488
public double score(StringWrapper s, StringWrapper t) {
	String S = s.unwrap(),
	  T =t.unwrap();
    totalScore = 0.0;
    if (S.equals(T)) {
      matched = S.length();
      return 1.0;
    }
    else {
      sSize = S.length();
      tSize = T.length();
      // let S be the largest token
      if (sSize < tSize) {
        String tmp1 = S;
        S = T;
        T = tmp1;
        double tmp2 = sSize;
        sSize = tSize;
        tSize = tmp2;
        tokenT = T;
      }
      tokenT = S;
      ArrayList candidateList = algorithm1(S, T);
      sortList(candidateList);
      totalScore = getScore(candidateList);
      totalScore = (totalScore / ( (double) sSize) + totalScore / ( (double) tSize)) / 2.0;
      return winkler(totalScore, S, T);
    }
  }
1197127
public static int lengthOfCodePointSafe(Slice utf8, int position)
    {
        int length = lengthOfCodePointFromStartByteSafe(utf8.getByte(position));
        if (length < 0) {
            return -length;
        }

        if (length == 1 || position + 1 >= utf8.length() || !isContinuationByte(utf8.getByteUnchecked(position + 1))) {
            return 1;
        }

        if (length == 2 || position + 2 >= utf8.length() || !isContinuationByte(utf8.getByteUnchecked(position + 2))) {
            return 2;
        }

        if (length == 3 || position + 3 >= utf8.length() || !isContinuationByte(utf8.getByteUnchecked(position + 3))) {
            return 3;
        }

        if (length == 4 || position + 4 >= utf8.length() || !isContinuationByte(utf8.getByteUnchecked(position + 4))) {
            return 4;
        }

        if (length == 5 || position + 5 >= utf8.length() || !isContinuationByte(utf8.getByteUnchecked(position + 5))) {
            return 5;
        }

        if (length == 6) {
            return 6;
        }

        return 1;
    }