Computes a visual representation of the approximate histogram with a given number of equal-sized bins

@param size number of equal-sized bins to divide the histogram into

@return visual representation of the histogram
505344
public Histogram toHistogram(int size)
  {
    Preconditions.checkArgument(size > 1, "histogram size must be greater than 1");

    float[] breaks = new float[size + 1];
    float delta = (max - min) / (size - 1);
    breaks[0] = min - delta;
    for (int i = 1; i < breaks.length - 1; ++i) {
      breaks[i] = breaks[i - 1] + delta;
    }
    breaks[breaks.length - 1] = max;
    return toHistogram(breaks);
  }
734492
public static String formatFileSize(long size) {
        if (size < 1024)
            return size + " B";
        else if (size < 1024 * 1024)
            return new DecimalFormat("#.# KB").format((double)size / 1024);
        else if (size < 1024 * 1024 * 1024)
            return new DecimalFormat("#.# MB").format((double)size / 1024 / 1024);

        return new DecimalFormat("#.# GB").format((double)size / 1024 / 1024 / 1024);
    }
335344
public static int[] randomPermutation(int size) {
        Random r = new Random();
        int[] result = new int[size];

        for (int j = 0; j < size; j++) {
            result[j] = j;
        }
        
        for (int j = size - 1; j > 0; j--) {
            int k = r.nextInt(j);
            int temp = result[j];
            result[j] = result[k];
            result[k] = temp;
        }

        return result;
    }
219029
public static <K, V> HashMap<K, V> newHashMap(int size) {
		return newHashMap(size, false);
	}
609534
function(size) {
        var tileSize = (size) ? size :
                                ((this.tileSize) ? this.tileSize :
                                                   this.map.getTileSize());
        this.tileSize = tileSize;
        if(this.gutter) {
          // layers with gutters need non-null tile sizes
          //if(tileSize == null) {
          //    OpenLayers.console.error("Error in layer.setMap() for " +
          //                              this.name + ": layers with " +
          //                              "gutters need non-null tile sizes");
          //}
            this.imageSize = new OpenLayers.Size(tileSize.w + (2*this.gutter), 
                                                 tileSize.h + (2*this.gutter)); 
        }
    }
278423
public static String asIbi(long size) {
        if (size > GIBI) {
            return String.format("%.1f GiB", (size / GIBI));
        } else if (size > MIBI) {
            return String.format("%.1f MiB", (size / MIBI));
        } else if (size > KIBI) {
            return String.format("%.1f KiB", (size / KIBI));
        } else {
            return String.format("%d B", size);
        }
    }
1313056
public Cell<C,T> prefSize (float size) {
		prefWidth = new FixedValue<C, T>(layout.toolkit,size);
		prefHeight = new FixedValue<C, T>(layout.toolkit,size);
		return this;
	}
546673
public Cell<C,T> maxSize (float size) {
		maxWidth = new FixedValue<C, T>(layout.toolkit,size);
		maxHeight = new FixedValue<C, T>(layout.toolkit,size);
		return this;
	}
162068
function(size) {
      return this.put(new SVG.Circle).rx(new SVG.Number(size).divide(2)).move(0, 0)
    }
1316119
public static String rand(int size) {
        StringBuilder num = new StringBuilder();
        for (int i = 0; i < size; i++) {
            double a = Math.random() * 9;
            a = Math.ceil(a);
            int randomNum = new Double(a).intValue();
            num.append(randomNum);
        }
        return num.toString();
    }
816000
public void printVectorSize(VectorSize size) {
        format(Locale.ENGLISH, "%10d %19d%n", size.size(), size.numEntries());
    }
1046417
public <T> CursorList<T> asCursorList(int size) {
		CursorList<T> result = CursorList.create(this, size);
		return result;
	}
451954
public BatcherBuilder sizeBound(int size) {
        checkState(this.maxSize == UNSET_INT, "Max size already set to %s", this.maxSize);
        checkArgument(size > 0, "Required to have a size bound greater than 0");
        this.maxSize = size;
        return this;
    }
1025250
public function median(int $size): Image
    {
        return $this->rank($size, $size, ($size * $size) / 2);
    }
186001
private static int sizeToInt(String size) {
		if (size==null) return -1;
		if ("full".equals(size)) return 12;
		if ("full-size".equals(size)) return 12;
		if ("fullSize".equals(size)) return 12;
		if ("full-width".equals(size)) return 12;
		if ("fullWidth".equals(size)) return 12;
		if ("half".equals(size)) return 6;
		if ("one-third".equals(size)) return 4;
		if ("oneThird".equals(size)) return 4;
		if ("two-thirds".equals(size)) return 8;
		if ("twoThirds".equals(size)) return 8;
		if ("one-fourth".equals(size)) return 3;
		if ("oneFourth".equals(size)) return 3;
		if ("three-fourths".equals(size)) return 9;
		if ("threeFourths".equals(size)) return 9;
		if (size.length()>2) {
			size=size.replace("columns", "");
			size=size.replace("column", "");
			size=size.trim();
		}
		return new Integer(size).intValue();
	}
946739
@Override
    public String getImageOf(String size) {
        if (owner == null) {
            return BallColor.GREY.getImageOf(size);
        }

        return calculateBallColor().getImageOf(size);
    }
19358
public int alloc(int size) {
        int index = n;
        int len = array.length;
        if (n + size >= len) {
            byte[] aux = new byte[len + blockSize];
            System.arraycopy(array, 0, aux, 0, len);
            array = aux;
        }
        n += size;
        return index;
    }