create a string representation whose gray value appears as an indicator
of magnitude, cf. Hinton diagrams in statistics.

@param d
value
@param max
maximum value
@return
775686
public static String shadefloat(float d, float max) {
        int a = (int) Math.floor(d * 10 / max + 0.5);
        if (a > 10 || a < 0) {
            String x = lnf.format(d);
            a = 5 - x.length();
            for (int i = 0; i < a; i++) {
                x += " ";
            }
            return "<" + x + ">";
        }
        return "[" + shades[a] + "]";
    }
527092
public Integer getMaxIdleTime()
   {
      if (childNode.getTextValueForPatternName("max-idle-time") != null && !childNode.getTextValueForPatternName("max-idle-time").equals("null")) {
         return Integer.valueOf(childNode.getTextValueForPatternName("max-idle-time"));
      }
      return null;
   }
1269000
public static BigRational max(BigRational... values) {
		if (values.length == 0) {
			return BigRational.ZERO;
		}
		BigRational result = values[0];
		for (int i = 1; i < values.length; i++) {
			result = result.max(values[i]);
		}
		return result;
	}
335067
public MetricBuilder withMaxValue(Number value, String prettyPrintFormat) {
        max = new MetricValue(value.toString(), prettyPrintFormat);    
        return this;
    }
306763
static public String doubleToString(double d) {
    if (Double.isInfinite(d) || Double.isNaN(d)) {
      return "null";
    }

    // Shave off trailing zeros and decimal point, if possible.

    String s = Double.toString(d);
    if (s.indexOf('.') > 0 && s.indexOf('e') < 0 && s.indexOf('E') < 0) {
      while (s.endsWith("0")) {
        s = s.substring(0, s.length() - 1);
      }
      if (s.endsWith(".")) {
        s = s.substring(0, s.length() - 1);
      }
    }
    return s;
  }
695679
public static double elementDiagonalMaxAbs( DMatrixD1 a ) {
        final int size = Math.min(a.numRows,a.numCols);

        double max = 0;
        for( int i = 0; i < size; i++ ) {
            double val = Math.abs(a.get( i,i ));
            if( val > max ) {
                max = val;
            }
        }

        return max;
    }
1372014
public int maxValue()
    {
        final int missingValue = this.missingValue;
        int max = size == 0 ? missingValue : Integer.MIN_VALUE;

        final int[] entries = this.entries;
        @DoNotSub final int length = entries.length;

        for (@DoNotSub int valueIndex = 1; valueIndex < length; valueIndex += 2)
        {
            final int value = entries[valueIndex];
            if (value != missingValue)
            {
                max = Math.max(max, value);
            }
        }

        return max;
    }
1107578
public static String format(double[] v, int w, int d) {
    DecimalFormat format = new DecimalFormat();
    format.setDecimalFormatSymbols(new DecimalFormatSymbols(Locale.US));
    format.setMinimumIntegerDigits(1);
    format.setMaximumFractionDigits(d);
    format.setMinimumFractionDigits(d);
    format.setGroupingUsed(false);

    int width = w + 1;
    StringBuilder msg = new StringBuilder() //
        .append('\n'); // start on new line.
    for(int i = 0; i < v.length; i++) {
      String s = format.format(v[i]); // format the number
      // At _least_ 1 whitespace is added
      whitespace(msg, Math.max(1, width - s.length())).append(s);
    }
    return msg.toString();
  }
471312
public static int Maximum(ImageSource fastBitmap, int startX, int startY, int width, int height) {
        int max = 0;

        if (fastBitmap.isGrayscale()) {
            for (int i = startX; i < height; i++) {
                for (int j = startY; j < width; j++) {
                    int gray = fastBitmap.getRGB(j, i);
                    if (gray > max) {
                        max = gray;
                    }
                }
            }
        } else {
            for (int i = startX; i < height; i++) {
                for (int j = startY; j < width; j++) {
                    int gray = fastBitmap.getG(j, i);
                    if (gray > max) {
                        max = gray;
                    }
                }
            }
        }

        return max;
    }
1278385
public static ArgumentPredicate max(int max, Radix radix) {
        return inRange(Integer.MIN_VALUE, max, radix);
    }
314783
public static String convert( long x, int n, String d ) {
        if (x == 0) {
            return "0";
        }

        String r = "";
        int m = 1 << n;
        m--;
        while( x != 0 ) {
            r = d.charAt((int) (x & m)) + r;
            x = x >>> n;
        }
        return r;
    }
722847
private WritableDoubleDataStore computeMaxHeight() {
    WritableDoubleDataStore maxheight = DataStoreUtil.makeDoubleStorage(ids, DataStoreFactory.HINT_HOT | DataStoreFactory.HINT_TEMP, 0.);
    DBIDVar v1 = DBIDUtil.newVar();
    for(DBIDIter it = ids.iter(); it.valid(); it.advance()) {
      double d = parentDistance.doubleValue(it);
      if(d > maxheight.doubleValue(it)) {
        maxheight.putDouble(it, d);
      }
      if(d > maxheight.doubleValue(parent.assignVar(it, v1))) {
        maxheight.putDouble(v1, d);
      }
    }
    return maxheight;
  }
409826
public static int maxIdIn(SymbolTable table) {
    int max = 0;
    for (ObjectIntCursor<String> cursor : table) {
      max = Math.max(max, cursor.value);
    }
    return max;
  }
770577
public AABBd setMax(Vector3dc max) {
        return this.setMax(max.x(), max.y(), max.z());
    }
275324
private void minmax() {
        gmin = Double.MAX_VALUE;
        gmax = -Double.MAX_VALUE;

        for (SupportVector v : sv) {
            double g = -v.g[0];
            double a = v.alpha[0];
            if (g < gmin && a > 0.0) {
                svmin = v;
                gmin = g;
                gminindex = 0;
            }
            if (g > gmax && a < v.C) {
                svmax = v;
                gmax = g;
                gmaxindex = 0;
            }

            g = v.g[1];
            a = v.alpha[1];
            if (g < gmin && a < v.C) {
                svmin = v;
                gmin = g;
                gminindex = 1;
            }
            if (g > gmax && a > 0.0) {
                svmax = v;
                gmax = g;
                gmaxindex = 1;
            }
        }
    }
1233524
public int parseMaxAge(String maxAgeStr) {

        if (maxAgeStr == null) {
            showFormatError(maxAgeStr);
            return -1;
        }

        maxAgeStr = maxAgeStr.toLowerCase().trim();
        String[] tokens = maxAgeStr.split(" +");
        if ((tokens.length != 2)) {
            showFormatError(maxAgeStr);
            return -1;
        }
        int number = 0;
        try {
            number = Integer.parseInt(tokens[0]);
        } catch (NumberFormatException e) {
            showFormatError(maxAgeStr);
            return -1;
        }

        String unit = tokens[1];
        if ("d".equals(unit) || unit.startsWith("day")) {
            return 24 * number;
        } else if ("h".equals(unit) || unit.startsWith("hour")) {
            return number;
        } else if ("w".equals(unit) || unit.startsWith("week")) {
            return 7 * 24 * number;
        } else {
            showFormatError(maxAgeStr);
            return -1;
        }
    }
922912
public Span[] tokenizePos(String d) {
    Span[] tokens = split(d);
    newTokens.clear();
    tokProbs.clear();
    for (int i = 0, il = tokens.length; i < il; i++) {
      Span s = tokens[i];
      String tok = d.substring(s.getStart(), s.getEnd());
      // Can't tokenize single characters
      if (tok.length() < 2) {
        newTokens.add(s);
        tokProbs.add(ONE);
      }
      else if (useAlphaNumericOptimization() && alphaNumeric.matcher(tok).matches()) {
        newTokens.add(s);
        tokProbs.add(ONE);
      }
      else {
        int start = s.getStart();
        int end = s.getEnd();
        final int origStart = s.getStart();
        double tokenProb = 1.0;
        for (int j = origStart + 1; j < end; j++) {
          double[] probs =
            model.eval(cg.getContext(new ObjectIntPair(tok, j - origStart)));
          String best = model.getBestOutcome(probs);
          //System.err.println("TokenizerME: "+tok.substring(0,j-origStart)+"^"+tok.substring(j-origStart)+" "+best+" "+probs[model.getIndex(best)]);
          tokenProb *= probs[model.getIndex(best)];
          if (best.equals(TokContextGenerator.SPLIT)) {
            newTokens.add(new Span(start, j));
            tokProbs.add(new Double(tokenProb));
            start = j;
            tokenProb = 1.0;
          }
        }
        newTokens.add(new Span(start, end));
        tokProbs.add(new Double(tokenProb));
      }
    }

    Span[] spans = new Span[newTokens.size()];
    newTokens.toArray(spans);
    return spans;
  }